@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.
- package/dist/lib/mcp-client.d.ts +39 -0
- package/dist/lib/mcp-client.js +131 -0
- package/dist/routes/api/v1/ai/tools.js +49 -232
- package/dist/routes/api/v1/proposals/[id]/route.d.ts +10 -24
- package/dist/routes/api/v1/proposals/[id]/route.js +10 -1
- package/dist/routes/api/v1/proposals/route.d.ts +2 -16
- package/dist/routes/api/v1/proposals/route.js +11 -8
- package/dist/routes/api/v1/terminal/[proposalId]/create/route.js +2 -2
- package/dist/routes/api/v1/terminal/code/index.d.ts +3 -0
- package/dist/routes/api/v1/terminal/code/index.js +5 -0
- package/dist/routes/api/v1/terminal/code/route.d.ts +13 -0
- package/dist/routes/api/v1/terminal/code/route.js +155 -0
- package/dist/server-with-static.js +2 -0
- package/dist/server.js +2 -0
- package/package.json +4 -4
- package/static/assets/{ActivityPage-DxajSxG1.js → ActivityPage-BIYCh5I6.js} +1 -1
- package/static/assets/{ApiKeysSettingsPage-DiBqSUMz.js → ApiKeysSettingsPage-uPmxt5fp.js} +1 -1
- package/static/assets/{ArchitectureEditPage-iflIJaCh.js → ArchitectureEditPage-DlNQfJe3.js} +2 -2
- package/static/assets/{ArchitecturePage-oB3FtdZ7.js → ArchitecturePage-z4FsbdfN.js} +1 -1
- package/static/assets/{AuthSettingsPage-BY7x-6wd.js → AuthSettingsPage-Ct9brG0C.js} +2 -2
- package/static/assets/{CallbackPage-CYcV3OHa.js → CallbackPage-DrMJVPyS.js} +1 -1
- package/static/assets/CodePage-CFl4HO-3.js +2 -0
- package/static/assets/{CollapsibleSection-BLZv27JC.js → CollapsibleSection-D_16mIbS.js} +1 -1
- package/static/assets/{DashboardPage-BdsK2Vor.js → DashboardPage---KVQx1B.js} +2 -2
- package/static/assets/{GitPage-CKIIMGjF.js → GitPage-CNYHAHAE.js} +3 -3
- package/static/assets/{GitSettingsPage-sI4uzGzt.js → GitSettingsPage-CQbe217E.js} +2 -2
- package/static/assets/{IdentityPage-vzzaKU2-.js → IdentityPage-BNrnoMAb.js} +2 -2
- package/static/assets/{ImplementationStepsEditor-BMHTxNEX.js → ImplementationStepsEditor-CpIE-yvb.js} +1 -1
- package/static/assets/IntegrationsSettingsPage-Bvrthw6u.js +1 -0
- package/static/assets/{JobDetailPage-C-IKmhAF.js → JobDetailPage-C1uyETkW.js} +1 -1
- package/static/assets/{KnowledgeDetailPage-C1RHtPzz.js → KnowledgeDetailPage-D4ZUM3Zz.js} +1 -1
- package/static/assets/KnowledgeEditPage-CkO6HZ1m.js +1 -0
- package/static/assets/{KnowledgePage-DJphs1Kg.js → KnowledgePage-DTgCuE5t.js} +1 -1
- package/static/assets/{LoginPage-DVaToPHL.js → LoginPage-kNNO_ouW.js} +1 -1
- package/static/assets/{MailInboxPage-I-MbS647.js → MailInboxPage-DFA4mCj0.js} +1 -1
- package/static/assets/{MailProcessingModal-DXtDHWM_.js → MailProcessingModal-Caii7A8L.js} +2 -2
- package/static/assets/{MailReadPage-DUN8EQjl.js → MailReadPage-DnxomkpM.js} +1 -1
- package/static/assets/{MailSentPage-DsGgBGBQ.js → MailSentPage-BHkc5X_Y.js} +1 -1
- package/static/assets/{McpSettingsPage-d66ZIwm7.js → McpSettingsPage-DFwFqNpn.js} +1 -1
- package/static/assets/NewKnowledgePage-Dst7m_BB.js +9 -0
- package/static/assets/{NewSkillPage-DesCsYgS.js → NewSkillPage-E2godqql.js} +1 -1
- package/static/assets/{NewTaskPage-CrmiPuuw.js → NewTaskPage--x_FMYzw.js} +2 -2
- package/static/assets/{NotFoundPage-BcTtqwNP.js → NotFoundPage-CWYaoUzq.js} +1 -1
- package/static/assets/NotificationsSettingsPage-BgGoQm7i.js +1 -0
- package/static/assets/ProjectEditPage-BlQkGGW3.js +11 -0
- package/static/assets/{ProjectPage-CKaHBZlw.js → ProjectPage-cnzG8ymb.js} +1 -1
- package/static/assets/PromptsSettingsPage-DEMozxxj.js +1 -0
- package/static/assets/{ResourceDetailPage-BSeDQxri.js → ResourceDetailPage-D-amMTWE.js} +1 -1
- package/static/assets/{ResourcesPage-YmerqN0J.js → ResourcesPage-BaxxCRUq.js} +2 -2
- package/static/assets/RoleEditPage-Bn5nL0Hm.js +13 -0
- package/static/assets/{RolePage-DoN5_uka.js → RolePage-BOBxbE4o.js} +1 -1
- package/static/assets/{RulesSettingsPage-yQELBKgb.js → RulesSettingsPage-BX4-A4bn.js} +1 -1
- package/static/assets/SchedulePage-BNmUnXVu.js +4 -0
- package/static/assets/{SkillDetailPage-BFjBVPS8.js → SkillDetailPage-Dyvc1AIM.js} +1 -1
- package/static/assets/{SkillEditPage-CjpscD5K.js → SkillEditPage-BBr2jC5s.js} +1 -1
- package/static/assets/{SkillsPage-Dr_uyKVB.js → SkillsPage-C8moT36F.js} +1 -1
- package/static/assets/{SkillsSettingsPage-BknrbJBC.js → SkillsSettingsPage-D1begXXp.js} +1 -1
- package/static/assets/{SourceInput-LclyzQLW.js → SourceInput-D_5iVkI5.js} +1 -1
- package/static/assets/{TagInput-BZ6JyIo1.js → TagInput-C1r8NbaU.js} +1 -1
- package/static/assets/{TaskDetailPage-D97oWW98.js → TaskDetailPage-DY-hfPO_.js} +2 -2
- package/static/assets/TaskEditPage-BQNQc-sZ.js +1 -0
- package/static/assets/{TasksPage-COvedmQz.js → TasksPage-ssM1z2ta.js} +3 -3
- package/static/assets/{TerminalPage-DhbOmISZ.js → TerminalPage-Cny60rpN.js} +1 -1
- package/static/assets/{TerminalSessionPage-D2rZb8Ej.js → TerminalSessionPage-Cy2h1IvH.js} +2 -2
- package/static/assets/UserPreferencesPage-DLLHv7Sv.js +1 -0
- package/static/assets/{UserSettingsPage-AXLWqe0G.js → UserSettingsPage-wrlm0m4w.js} +1 -1
- package/static/assets/{UtilitiesPage-CxQkYrza.js → UtilitiesPage-DDdi2gjr.js} +1 -1
- package/static/assets/{alert-BUrHsk9_.js → alert-ClYcOZrl.js} +1 -1
- package/static/assets/apl-B4CMkyY2.js +1 -0
- package/static/assets/{arrow-down-J9YP8VW9.js → arrow-down-C21GpXY8.js} +1 -1
- package/static/assets/{arrow-left-RAzvFXpe.js → arrow-left-Bo3ORcvL.js} +1 -1
- package/static/assets/{arrow-up-CjXXRPYC.js → arrow-up-BvV2LsrY.js} +1 -1
- package/static/assets/{arrow-up-down-BRoDh-fK.js → arrow-up-down-vbTTNMQ9.js} +1 -1
- package/static/assets/asciiarmor-Df11BRmG.js +1 -0
- package/static/assets/asn1-EdZsLKOL.js +1 -0
- package/static/assets/asterisk-B-8jnY81.js +1 -0
- package/static/assets/{badge-CA-A_JCd.js → badge-BIzmYH_4.js} +1 -1
- package/static/assets/brainfuck-C4LP7Hcl.js +1 -0
- package/static/assets/{browser-modal-DVtwh2h7.js → browser-modal-CkjrwJ8N.js} +1 -1
- package/static/assets/{card-DdrUHBUG.js → card-Bg-wA9s_.js} +1 -1
- package/static/assets/{chevron-left-C4bGr2Al.js → chevron-left-DO-Zz6cq.js} +1 -1
- package/static/assets/{chevron-up-CPpQ_jgb.js → chevron-up-C115Uf6r.js} +1 -1
- package/static/assets/{chevrons-up-C8oR0iOR.js → chevrons-up-bgADpoQ9.js} +1 -1
- package/static/assets/{circle-alert-B3zeVGHG.js → circle-alert-D8dEhUnq.js} +1 -1
- package/static/assets/{circle-check-OfRBf8tJ.js → circle-check-CS2LuTcV.js} +1 -1
- package/static/assets/{circle-check-big-CeVxJ4hA.js → circle-check-big-Bm4c-_XI.js} +1 -1
- package/static/assets/{circle-play-C_Chmziu.js → circle-play-N-BXePlE.js} +1 -1
- package/static/assets/{circle-x-CtfEmATn.js → circle-x-DWHqcJFb.js} +1 -1
- package/static/assets/clike-B9uivgTg.js +1 -0
- package/static/assets/{clipboard-Z_0Z5-r1.js → clipboard-BBdw7Fw8.js} +1 -1
- package/static/assets/{clock-B43LjbrK.js → clock-Cg9nPTux.js} +1 -1
- package/static/assets/clojure-BMjYHr_A.js +1 -0
- package/static/assets/cmake-BQqOBYOt.js +1 -0
- package/static/assets/cobol-CWcv1MsR.js +1 -0
- package/static/assets/{code-D77i0toJ.js → code-D21v96Wj.js} +1 -1
- package/static/assets/coffeescript-S37ZYGWr.js +1 -0
- package/static/assets/commonlisp-DBKNyK5s.js +1 -0
- package/static/assets/crystal-SjHAIU92.js +1 -0
- package/static/assets/css-BnMrqG3P.js +1 -0
- package/static/assets/cypher-C_CwsFkJ.js +1 -0
- package/static/assets/d-pRatUO7H.js +1 -0
- package/static/assets/diff-DbItnlRl.js +1 -0
- package/static/assets/dockerfile-BKs6k2Af.js +1 -0
- package/static/assets/{download-C8rLaNF6.js → download-ULpe9uEL.js} +1 -1
- package/static/assets/dtd-DF_7sFjM.js +1 -0
- package/static/assets/dylan-DwRh75JA.js +1 -0
- package/static/assets/ebnf-CDyGwa7X.js +1 -0
- package/static/assets/ecl-Cabwm37j.js +1 -0
- package/static/assets/eiffel-CnydiIhH.js +1 -0
- package/static/assets/elm-vLlmbW-K.js +1 -0
- package/static/assets/erlang-BNw1qcRV.js +1 -0
- package/static/assets/{external-link-D6UvIQYD.js → external-link--nEePPjR.js} +1 -1
- package/static/assets/{eye-C3fWwYx-.js → eye-nqxk2SXP.js} +1 -1
- package/static/assets/factor-kuTfRLto.js +1 -0
- package/static/assets/fcl-Kvtd6kyn.js +1 -0
- package/static/assets/{folder-git-2-Crtn4eyJ.js → folder-git-2-D1jARXTb.js} +1 -1
- package/static/assets/forth-Ffai-XNe.js +1 -0
- package/static/assets/fortran-DYz_wnZ1.js +1 -0
- package/static/assets/gas-Bneqetm1.js +1 -0
- package/static/assets/gherkin-heZmZLOM.js +1 -0
- package/static/assets/groovy-D9Dt4D0W.js +1 -0
- package/static/assets/haskell-Cw1EW3IL.js +1 -0
- package/static/assets/haxe-H-WmDvRZ.js +1 -0
- package/static/assets/http-DBlCnlav.js +1 -0
- package/static/assets/idl-BEugSyMb.js +1 -0
- package/static/assets/index-80RT6UXi.js +3 -0
- package/static/assets/index-AIsVwTBP.js +1 -0
- package/static/assets/index-AeonINTL.js +1 -0
- package/static/assets/index-BBY4n5t-.js +1 -0
- package/static/assets/index-BEkvG6MQ.js +1 -0
- package/static/assets/index-BEvAFxs_.js +1 -0
- package/static/assets/index-BS_uzzCh.js +1 -0
- package/static/assets/index-Beun4ywN.js +2 -0
- package/static/assets/index-CR0uN9wO.js +1 -0
- package/static/assets/index-CRSfgM43.js +1 -0
- package/static/assets/index-CawWXqM_.js +1 -0
- package/static/assets/index-ChD5bDHD.js +1 -0
- package/static/assets/index-ClFRvTkG.js +1 -0
- package/static/assets/index-D8UBHQdy.js +1 -0
- package/static/assets/index-DCrCdQ-J.js +1 -0
- package/static/assets/{index-SWBrq2bx.js → index-DF2yEDGL.js} +103 -103
- package/static/assets/index-DH_vXhd4.css +1 -0
- package/static/assets/index-DHmd0I4e.js +1 -0
- package/static/assets/index-DvIiLgyh.js +1 -0
- package/static/assets/index-p-EXqOgO.js +7 -0
- package/static/assets/{info-BZi8bEGv.js → info-jWH_Nbw8.js} +1 -1
- package/static/assets/javascript-iXu5QeM3.js +1 -0
- package/static/assets/julia-DuME0IfC.js +1 -0
- package/static/assets/{label-C8Wxd6GE.js → label-Bo7tep86.js} +1 -1
- package/static/assets/livescript-BwQOo05w.js +1 -0
- package/static/assets/lua-BgMRiT3U.js +1 -0
- package/static/assets/markdown-editor-B6HEtSkH.css +1 -0
- package/static/assets/markdown-editor-DGcgv9Jo.js +111 -0
- package/static/assets/mathematica-DTrFuWx2.js +1 -0
- package/static/assets/mbox-CNhZ1qSd.js +1 -0
- package/static/assets/{message-square-BpqFAvyq.js → message-square-CJkxqplf.js} +1 -1
- package/static/assets/mirc-CjQqDB4T.js +1 -0
- package/static/assets/mllike-CXdrOF99.js +1 -0
- package/static/assets/modelica-Dc1JOy9r.js +1 -0
- package/static/assets/mscgen-BA5vi2Kp.js +1 -0
- package/static/assets/mumps-BT43cFF4.js +1 -0
- package/static/assets/nginx-DdIZxoE0.js +1 -0
- package/static/assets/nsis-LdVXkNf5.js +1 -0
- package/static/assets/ntriples-BfvgReVJ.js +1 -0
- package/static/assets/octave-Ck1zUtKM.js +1 -0
- package/static/assets/oz-BzwKVEFT.js +1 -0
- package/static/assets/{paperclip-Dk7jEYtI.js → paperclip-Dw99lBW-.js} +1 -1
- package/static/assets/pascal--L3eBynH.js +1 -0
- package/static/assets/{pause-CX3StCWt.js → pause-CSm_MUb9.js} +1 -1
- package/static/assets/perl-CdXCOZ3F.js +1 -0
- package/static/assets/pig-CevX1Tat.js +1 -0
- package/static/assets/pipeline-builders-UvjOF56t.js +17 -0
- package/static/assets/{play-CRPN1vUy.js → play-Sq1Ji6eG.js} +1 -1
- package/static/assets/powershell-CFHJl5sT.js +1 -0
- package/static/assets/properties-C78fOPTZ.js +1 -0
- package/static/assets/protobuf-ChK-085T.js +1 -0
- package/static/assets/pug-DeIclll2.js +1 -0
- package/static/assets/puppet-DMA9R1ak.js +1 -0
- package/static/assets/python-BuPzkPfP.js +1 -0
- package/static/assets/q-pXgVlZs6.js +1 -0
- package/static/assets/r-B6wPVr8A.js +1 -0
- package/static/assets/{radio-group-DFIfCEpZ.js → radio-group-BfqZdNY5.js} +1 -1
- package/static/assets/{refresh-cw-DGBXSYy5.js → refresh-cw-DwXF5JvK.js} +1 -1
- package/static/assets/rpm-CTu-6PCP.js +1 -0
- package/static/assets/ruby-B2Rjki9n.js +1 -0
- package/static/assets/sas-B4kiWyti.js +1 -0
- package/static/assets/scheme-C41bIUwD.js +1 -0
- package/static/assets/{search-C9jI6Lg7.js → search-NagOQziO.js} +1 -1
- package/static/assets/select-XHfMw_BF.js +1 -0
- package/static/assets/shell-CjFT_Tl9.js +1 -0
- package/static/assets/sieve-C3Gn_uJK.js +1 -0
- package/static/assets/simple-mode-GW_nhZxv.js +1 -0
- package/static/assets/smalltalk-CnHTOXQT.js +1 -0
- package/static/assets/solr-DehyRSwq.js +1 -0
- package/static/assets/sparql-DkYu6x3z.js +1 -0
- package/static/assets/spreadsheet-BCZA_wO0.js +1 -0
- package/static/assets/sql-D0XecflT.js +1 -0
- package/static/assets/stex-C3f8Ysf7.js +1 -0
- package/static/assets/stylus-B533Al4x.js +1 -0
- package/static/assets/swift-BzpIVaGY.js +1 -0
- package/static/assets/{switch-C2zPfM3G.js → switch-uoWXvqqm.js} +1 -1
- package/static/assets/{tabs-B7fjkp5h.js → tabs-Be_b96k_.js} +1 -1
- package/static/assets/{tag-BOwlwHfi.js → tag-wGnl5hoT.js} +1 -1
- package/static/assets/tcl-DVfN8rqt.js +1 -0
- package/static/assets/{terminal-preview-BvBQu5Sd.js → terminal-preview-BBm_7lm8.js} +1 -1
- package/static/assets/textile-CnDTJFAw.js +1 -0
- package/static/assets/tiddlywiki-DO-Gjzrf.js +1 -0
- package/static/assets/tiki-DGYXhP31.js +1 -0
- package/static/assets/toml-Bm5Em-hy.js +1 -0
- package/static/assets/troff-wAsdV37c.js +1 -0
- package/static/assets/ttcn-CfJYG6tj.js +1 -0
- package/static/assets/ttcn-cfg-B9xdYoR4.js +1 -0
- package/static/assets/turtle-B1tBg_DP.js +1 -0
- package/static/assets/{use-terminal-xv9qDaX1.js → use-terminal-QLr-9n4J.js} +1 -1
- package/static/assets/vb-CmGdzxic.js +1 -0
- package/static/assets/vbscript-BuJXcnF6.js +1 -0
- package/static/assets/velocity-D8B20fx6.js +1 -0
- package/static/assets/verilog-C6RDOZhf.js +1 -0
- package/static/assets/vhdl-lSbBsy5d.js +1 -0
- package/static/assets/{video-CW0zFsfp.js → video-Dn8vsERP.js} +1 -1
- package/static/assets/webidl-ZXfAyPTL.js +1 -0
- package/static/assets/xquery-DzFWVndE.js +1 -0
- package/static/assets/yacas-BJ4BC0dw.js +1 -0
- package/static/assets/z80-Hz9HOZM7.js +1 -0
- package/static/index.html +2 -2
- package/dist/lib/auth/auth-manager.d.ts.map +0 -1
- package/dist/lib/auth/auth-manager.js.map +0 -1
- package/dist/lib/gait-path.d.ts.map +0 -1
- package/dist/lib/gait-path.js.map +0 -1
- package/dist/lib/git-settings.d.ts.map +0 -1
- package/dist/lib/git-settings.js.map +0 -1
- package/dist/lib/git.d.ts.map +0 -1
- package/dist/lib/git.js.map +0 -1
- package/dist/lib/jobs/global-job-scheduler.d.ts.map +0 -1
- package/dist/lib/jobs/global-job-scheduler.js.map +0 -1
- package/dist/lib/jobs/job-runner.d.ts.map +0 -1
- package/dist/lib/jobs/job-runner.js.map +0 -1
- package/dist/lib/jobs/job-scheduler.d.ts.map +0 -1
- package/dist/lib/jobs/job-scheduler.js.map +0 -1
- package/dist/lib/jobs/job-store.d.ts.map +0 -1
- package/dist/lib/jobs/job-store.js.map +0 -1
- package/dist/lib/project-paths.d.ts.map +0 -1
- package/dist/lib/project-paths.js.map +0 -1
- package/dist/lib/storage/file-storage.d.ts.map +0 -1
- package/dist/lib/storage/file-storage.js.map +0 -1
- package/dist/lib/symlinks/symlink-manager.d.ts.map +0 -1
- package/dist/lib/symlinks/symlink-manager.js.map +0 -1
- package/dist/lib/symlinks/types.d.ts.map +0 -1
- package/dist/lib/symlinks/types.js.map +0 -1
- package/dist/lib/terminal/context-helper.d.ts.map +0 -1
- package/dist/lib/terminal/context-helper.js.map +0 -1
- package/dist/lib/terminal/global-manager.d.ts.map +0 -1
- package/dist/lib/terminal/global-manager.js.map +0 -1
- package/dist/lib/terminal/shell-utils.d.ts.map +0 -1
- package/dist/lib/terminal/shell-utils.js.map +0 -1
- package/dist/lib/terminal/terminal-manager.d.ts.map +0 -1
- package/dist/lib/terminal/terminal-manager.js.map +0 -1
- package/dist/lib/user-preferences.d.ts.map +0 -1
- package/dist/lib/user-preferences.js.map +0 -1
- package/dist/middleware/auth.d.ts.map +0 -1
- package/dist/middleware/auth.js.map +0 -1
- package/dist/routes/api/v1/agents/[id]/index.d.ts.map +0 -1
- package/dist/routes/api/v1/agents/[id]/index.js.map +0 -1
- package/dist/routes/api/v1/agents/[id]/route.d.ts.map +0 -1
- package/dist/routes/api/v1/agents/[id]/route.js.map +0 -1
- package/dist/routes/api/v1/agents/index.d.ts.map +0 -1
- package/dist/routes/api/v1/agents/index.js.map +0 -1
- package/dist/routes/api/v1/agents/route.d.ts.map +0 -1
- package/dist/routes/api/v1/agents/route.js.map +0 -1
- package/dist/routes/api/v1/ai/index.d.ts.map +0 -1
- package/dist/routes/api/v1/ai/index.js.map +0 -1
- package/dist/routes/api/v1/ai/route.d.ts.map +0 -1
- package/dist/routes/api/v1/ai/route.js.map +0 -1
- package/dist/routes/api/v1/api-keys/index.d.ts.map +0 -1
- package/dist/routes/api/v1/api-keys/index.js.map +0 -1
- package/dist/routes/api/v1/api-keys/route.d.ts.map +0 -1
- package/dist/routes/api/v1/api-keys/route.js.map +0 -1
- package/dist/routes/api/v1/auth/index.d.ts.map +0 -1
- package/dist/routes/api/v1/auth/index.js.map +0 -1
- package/dist/routes/api/v1/auth/route.d.ts.map +0 -1
- package/dist/routes/api/v1/auth/route.js.map +0 -1
- package/dist/routes/api/v1/auth-settings/index.d.ts.map +0 -1
- package/dist/routes/api/v1/auth-settings/index.js.map +0 -1
- package/dist/routes/api/v1/auth-settings/route.d.ts.map +0 -1
- package/dist/routes/api/v1/auth-settings/route.js.map +0 -1
- package/dist/routes/api/v1/chats/[id]/index.d.ts.map +0 -1
- package/dist/routes/api/v1/chats/[id]/index.js.map +0 -1
- package/dist/routes/api/v1/chats/[id]/route.d.ts.map +0 -1
- package/dist/routes/api/v1/chats/[id]/route.js.map +0 -1
- package/dist/routes/api/v1/chats/index.d.ts.map +0 -1
- package/dist/routes/api/v1/chats/index.js.map +0 -1
- package/dist/routes/api/v1/chats/route.d.ts.map +0 -1
- package/dist/routes/api/v1/chats/route.js.map +0 -1
- package/dist/routes/api/v1/config/index.d.ts.map +0 -1
- package/dist/routes/api/v1/config/index.js.map +0 -1
- package/dist/routes/api/v1/config/route.d.ts.map +0 -1
- package/dist/routes/api/v1/config/route.js.map +0 -1
- package/dist/routes/api/v1/context/architecture/route.d.ts.map +0 -1
- package/dist/routes/api/v1/context/architecture/route.js.map +0 -1
- package/dist/routes/api/v1/context/index.d.ts.map +0 -1
- package/dist/routes/api/v1/context/index.js.map +0 -1
- package/dist/routes/api/v1/context/knowledge/[filename]/index.d.ts.map +0 -1
- package/dist/routes/api/v1/context/knowledge/[filename]/index.js.map +0 -1
- package/dist/routes/api/v1/context/knowledge/[filename]/route.d.ts.map +0 -1
- package/dist/routes/api/v1/context/knowledge/[filename]/route.js.map +0 -1
- package/dist/routes/api/v1/context/knowledge/index.d.ts.map +0 -1
- package/dist/routes/api/v1/context/knowledge/index.js.map +0 -1
- package/dist/routes/api/v1/context/knowledge/route.d.ts.map +0 -1
- package/dist/routes/api/v1/context/knowledge/route.js.map +0 -1
- package/dist/routes/api/v1/context/project/route.d.ts.map +0 -1
- package/dist/routes/api/v1/context/project/route.js.map +0 -1
- package/dist/routes/api/v1/git/index.d.ts.map +0 -1
- package/dist/routes/api/v1/git/index.js.map +0 -1
- package/dist/routes/api/v1/jobs/[id]/route.d.ts.map +0 -1
- package/dist/routes/api/v1/jobs/[id]/route.js.map +0 -1
- package/dist/routes/api/v1/jobs/[id]/run/route.d.ts.map +0 -1
- package/dist/routes/api/v1/jobs/[id]/run/route.js.map +0 -1
- package/dist/routes/api/v1/jobs/index.d.ts.map +0 -1
- package/dist/routes/api/v1/jobs/index.js.map +0 -1
- package/dist/routes/api/v1/jobs/route.d.ts.map +0 -1
- package/dist/routes/api/v1/jobs/route.js.map +0 -1
- package/dist/routes/api/v1/jobs/status/route.d.ts.map +0 -1
- package/dist/routes/api/v1/jobs/status/route.js.map +0 -1
- package/dist/routes/api/v1/mcp/index.d.ts.map +0 -1
- package/dist/routes/api/v1/mcp/index.js.map +0 -1
- package/dist/routes/api/v1/mcp/route.d.ts.map +0 -1
- package/dist/routes/api/v1/mcp/route.js.map +0 -1
- package/dist/routes/api/v1/proposals/[id]/route.d.ts.map +0 -1
- package/dist/routes/api/v1/proposals/[id]/route.js.map +0 -1
- package/dist/routes/api/v1/proposals/index.d.ts.map +0 -1
- package/dist/routes/api/v1/proposals/index.js.map +0 -1
- package/dist/routes/api/v1/proposals/route.d.ts.map +0 -1
- package/dist/routes/api/v1/proposals/route.js.map +0 -1
- package/dist/routes/api/v1/resources/[id]/index.d.ts.map +0 -1
- package/dist/routes/api/v1/resources/[id]/index.js.map +0 -1
- package/dist/routes/api/v1/resources/[id]/route.js.map +0 -1
- package/dist/routes/api/v1/resources/[id]/thumbnail/index.d.ts.map +0 -1
- package/dist/routes/api/v1/resources/[id]/thumbnail/index.js.map +0 -1
- package/dist/routes/api/v1/resources/[id]/thumbnail/route.js.map +0 -1
- package/dist/routes/api/v1/resources/index.d.ts.map +0 -1
- package/dist/routes/api/v1/resources/index.js.map +0 -1
- package/dist/routes/api/v1/resources/route.d.ts.map +0 -1
- package/dist/routes/api/v1/resources/route.js.map +0 -1
- package/dist/routes/api/v1/symlinks/index.d.ts.map +0 -1
- package/dist/routes/api/v1/symlinks/index.js.map +0 -1
- package/dist/routes/api/v1/symlinks/route.d.ts.map +0 -1
- package/dist/routes/api/v1/symlinks/route.js.map +0 -1
- package/dist/routes/api/v1/terminal/[proposalId]/create/index.d.ts.map +0 -1
- package/dist/routes/api/v1/terminal/[proposalId]/create/index.js.map +0 -1
- package/dist/routes/api/v1/terminal/[proposalId]/create/route.d.ts.map +0 -1
- package/dist/routes/api/v1/terminal/[proposalId]/create/route.js.map +0 -1
- package/dist/routes/api/v1/terminal/[proposalId]/destroy/index.d.ts.map +0 -1
- package/dist/routes/api/v1/terminal/[proposalId]/destroy/index.js.map +0 -1
- package/dist/routes/api/v1/terminal/[proposalId]/destroy/route.d.ts.map +0 -1
- package/dist/routes/api/v1/terminal/[proposalId]/destroy/route.js.map +0 -1
- package/dist/routes/api/v1/terminal/[proposalId]/resize/index.d.ts.map +0 -1
- package/dist/routes/api/v1/terminal/[proposalId]/resize/index.js.map +0 -1
- package/dist/routes/api/v1/terminal/[proposalId]/resize/route.d.ts.map +0 -1
- package/dist/routes/api/v1/terminal/[proposalId]/resize/route.js.map +0 -1
- package/dist/routes/api/v1/terminal/sessions/index.d.ts.map +0 -1
- package/dist/routes/api/v1/terminal/sessions/index.js.map +0 -1
- package/dist/routes/api/v1/terminal/sessions/route.d.ts.map +0 -1
- package/dist/routes/api/v1/terminal/sessions/route.js.map +0 -1
- package/dist/routes/api/v1/user/index.d.ts.map +0 -1
- package/dist/routes/api/v1/user/index.js.map +0 -1
- package/dist/routes/api/v1/user/settings/index.d.ts.map +0 -1
- package/dist/routes/api/v1/user/settings/index.js.map +0 -1
- package/dist/routes/api/v1/user/settings/route.d.ts.map +0 -1
- package/dist/routes/api/v1/user/settings/route.js.map +0 -1
- package/dist/server-with-static.d.ts.map +0 -1
- package/dist/server-with-static.js.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js.map +0 -1
- package/static/assets/CodePage-DxJYFhiT.js +0 -2
- package/static/assets/IntegrationsSettingsPage-BzuUrHO1.js +0 -1
- package/static/assets/KnowledgeEditPage-D3gIqqKn.js +0 -1
- package/static/assets/NewKnowledgePage-WbN6BikQ.js +0 -9
- package/static/assets/NotificationsSettingsPage-BeJw7gY7.js +0 -1
- package/static/assets/ProjectEditPage-DiHz-pYk.js +0 -11
- package/static/assets/PromptsSettingsPage-B_Opt_KA.js +0 -1
- package/static/assets/RoleEditPage-Bm7HG4sg.js +0 -13
- package/static/assets/SchedulePage-nmchdGUK.js +0 -4
- package/static/assets/TaskEditPage-BTfzRYwM.js +0 -1
- package/static/assets/UserPreferencesPage-CgtsVqvs.js +0 -1
- package/static/assets/index-CHdBxVyk.css +0 -2
- package/static/assets/kiro-CX1mOsRO.js +0 -17
- package/static/assets/markdown-editor-DAk7M9Ju.js +0 -62
- package/static/assets/markdown-editor-DUEthZ0y.css +0 -1
- 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 {
|
|
7
|
-
import {
|
|
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
|
|
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:
|
|
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: ${
|
|
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 -
|
|
317
|
-
async function executeProposalsToolDirect(args,
|
|
318
|
-
const { operation, id, filters
|
|
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
|
|
305
|
+
const proposals = await storage.listCPs(filters || {});
|
|
323
306
|
return {
|
|
324
307
|
success: true,
|
|
325
308
|
data: proposals,
|
|
326
|
-
|
|
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: '
|
|
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
|
-
|
|
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: '
|
|
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:
|
|
367
|
-
message: `
|
|
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: `
|
|
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
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
if (
|
|
1087
|
-
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
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
|
-
|
|
13
|
-
intent?: string;
|
|
12
|
+
intent: string;
|
|
14
13
|
content?: string;
|
|
15
14
|
author: {
|
|
16
|
-
type: import("@lovelybunch/
|
|
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/
|
|
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/
|
|
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/
|
|
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
|
-
|
|
177
|
-
intent?: string;
|
|
169
|
+
intent: string;
|
|
178
170
|
content?: string;
|
|
179
171
|
author: {
|
|
180
|
-
type: import("@lovelybunch/
|
|
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/
|
|
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/
|
|
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/
|
|
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
|
-
|
|
146
|
+
intent: proposal.intent
|
|
138
147
|
}
|
|
139
148
|
});
|
|
140
149
|
}
|