@lovelybunch/api 1.0.76-alpha.0 → 1.0.76-alpha.10
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/auth/auth-manager.js +1 -1
- package/dist/lib/mcp-client.d.ts +39 -0
- package/dist/lib/mcp-client.js +131 -0
- package/dist/lib/terminal/terminal-manager.js +31 -0
- package/dist/routes/api/v1/ai/route.js +136 -1
- package/dist/routes/api/v1/ai/tools.js +49 -232
- package/dist/routes/api/v1/config/route.js +13 -9
- package/dist/routes/api/v1/context/agents/route.d.ts +3 -0
- package/dist/routes/api/v1/context/agents/route.js +159 -0
- package/dist/routes/api/v1/context/index.js +6 -0
- package/dist/routes/api/v1/context/memory/route.d.ts +3 -0
- package/dist/routes/api/v1/context/memory/route.js +163 -0
- package/dist/routes/api/v1/context/team/route.d.ts +3 -0
- package/dist/routes/api/v1/context/team/route.js +159 -0
- package/dist/routes/api/v1/knowledge/route.js +26 -32
- package/dist/routes/api/v1/mail/route.d.ts +3 -3
- package/dist/routes/api/v1/mcp/index.js +170 -4
- 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/slack/route.d.ts +6 -6
- package/dist/routes/api/v1/tasks/route.d.ts +18 -38
- package/dist/routes/api/v1/tasks/route.js +94 -16
- 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 +14 -0
- package/dist/routes/api/v1/terminal/code/route.js +159 -0
- package/dist/server-with-static.js +2 -0
- package/dist/server.js +2 -0
- package/package.json +6 -7
- package/static/assets/ActivityPage-B3rsYt_4.js +1 -0
- package/static/assets/AgentsContextEditPage-4D7qO4S-.js +9 -0
- package/static/assets/AgentsContextPage-NmvLRo0k.js +1 -0
- package/static/assets/{ApiKeysSettingsPage-DiBqSUMz.js → ApiKeysSettingsPage-BGj5p9zw.js} +2 -2
- package/static/assets/ArchitectureEditPage-DI2jNmc9.js +15 -0
- package/static/assets/ArchitecturePage-DiIuThUM.js +1 -0
- package/static/assets/{AuthSettingsPage-BY7x-6wd.js → AuthSettingsPage-DWuwxAS0.js} +2 -2
- package/static/assets/{CallbackPage-CYcV3OHa.js → CallbackPage-BCmkYhEr.js} +1 -1
- package/static/assets/CodePage-BZhIkymg.js +2 -0
- package/static/assets/{CollapsibleSection-BLZv27JC.js → CollapsibleSection-BJzLVd-x.js} +1 -1
- package/static/assets/DashboardPage-DtwE553F.js +41 -0
- package/static/assets/{GitPage-CKIIMGjF.js → GitPage-qG7VYL9b.js} +4 -4
- package/static/assets/{GitSettingsPage-sI4uzGzt.js → GitSettingsPage-C8Bgpj-X.js} +2 -2
- package/static/assets/{IdentityPage-vzzaKU2-.js → IdentityPage-Cf8Ruu-g.js} +2 -2
- package/static/assets/{ImplementationStepsEditor-BMHTxNEX.js → ImplementationStepsEditor-BXIRT7o1.js} +2 -2
- package/static/assets/IntegrationsSettingsPage-th56kUgi.js +1 -0
- package/static/assets/{JobDetailPage-C-IKmhAF.js → JobDetailPage-ZyEcbPAe.js} +1 -1
- package/static/assets/KnowledgeDetailPage-BklEOfs0.js +1 -0
- package/static/assets/KnowledgeEditPage-BGqzVqHi.js +1 -0
- package/static/assets/{KnowledgePage-DJphs1Kg.js → KnowledgePage-Dmm7vzAj.js} +2 -2
- package/static/assets/{LoginPage-DVaToPHL.js → LoginPage-PDafaEnq.js} +1 -1
- package/static/assets/{MailInboxPage-I-MbS647.js → MailInboxPage-M5_2gGkB.js} +1 -1
- package/static/assets/{MailProcessingModal-DXtDHWM_.js → MailProcessingModal-C4PotIFc.js} +2 -2
- package/static/assets/{MailReadPage-DUN8EQjl.js → MailReadPage-D32FUx5o.js} +1 -1
- package/static/assets/{MailSentPage-DsGgBGBQ.js → MailSentPage-CjBrbezf.js} +1 -1
- package/static/assets/{McpSettingsPage-d66ZIwm7.js → McpSettingsPage-DxE-4YPc.js} +1 -1
- package/static/assets/MemoryEditPage-BlQ5EN1w.js +13 -0
- package/static/assets/MemoryPage-B8fsgW7z.js +1 -0
- package/static/assets/NewKnowledgePage-CuH201xQ.js +1 -0
- package/static/assets/{NewSkillPage-DesCsYgS.js → NewSkillPage-BdX7eNoi.js} +1 -1
- package/static/assets/{NewTaskPage-CrmiPuuw.js → NewTaskPage-D9W2Yi0r.js} +2 -2
- package/static/assets/{NotFoundPage-BcTtqwNP.js → NotFoundPage-D9tmTVho.js} +1 -1
- package/static/assets/NotificationsSettingsPage-B4lBxS8D.js +1 -0
- package/static/assets/ProjectEditPage-DdqUI91K.js +11 -0
- package/static/assets/{ProjectPage-CKaHBZlw.js → ProjectPage-DB7ugw8l.js} +1 -1
- package/static/assets/PromptsSettingsPage-DFXoKUjj.js +1 -0
- package/static/assets/{ResourceDetailPage-BSeDQxri.js → ResourceDetailPage-CWc4YIMc.js} +1 -1
- package/static/assets/{ResourcesPage-YmerqN0J.js → ResourcesPage-BK-EXoIA.js} +2 -2
- package/static/assets/RoleEditPage-B20UAC2r.js +13 -0
- package/static/assets/{RolePage-DoN5_uka.js → RolePage-C5Jf7wxY.js} +1 -1
- package/static/assets/{RulesSettingsPage-yQELBKgb.js → RulesSettingsPage-91WP1FQf.js} +2 -2
- package/static/assets/SchedulePage-BijprHGn.js +4 -0
- package/static/assets/{SkillDetailPage-BFjBVPS8.js → SkillDetailPage-Cpxz_wmk.js} +1 -1
- package/static/assets/{SkillEditPage-CjpscD5K.js → SkillEditPage-Cz7VRg0r.js} +1 -1
- package/static/assets/{SkillsPage-Dr_uyKVB.js → SkillsPage-Bxmsi6Xd.js} +2 -2
- package/static/assets/{SkillsSettingsPage-BknrbJBC.js → SkillsSettingsPage-Cysx53Au.js} +1 -1
- package/static/assets/{SourceInput-LclyzQLW.js → SourceInput-D59F7hff.js} +1 -1
- package/static/assets/{TagInput-BZ6JyIo1.js → TagInput-BH6wDXWJ.js} +1 -1
- package/static/assets/{TaskDetailPage-D97oWW98.js → TaskDetailPage-5ktdWaTr.js} +2 -2
- package/static/assets/TaskEditPage-CIZWp_s4.js +1 -0
- package/static/assets/{TasksPage-COvedmQz.js → TasksPage-BNXDm-Er.js} +3 -3
- package/static/assets/TeamEditPage-C10siqme.js +9 -0
- package/static/assets/TeamPage-CXpZVAfy.js +1 -0
- package/static/assets/{TerminalPage-DhbOmISZ.js → TerminalPage-DJ-Tu_hG.js} +1 -1
- package/static/assets/TerminalSessionPage-BLryJlkL.js +3 -0
- package/static/assets/UserPreferencesPage-BvAcv5tt.js +1 -0
- package/static/assets/{UserSettingsPage-AXLWqe0G.js → UserSettingsPage-NQfoOvHf.js} +1 -1
- package/static/assets/UtilitiesPage-NnBCWVn8.js +1 -0
- package/static/assets/{alert-BUrHsk9_.js → alert-CMfexl-V.js} +1 -1
- package/static/assets/apl-B4CMkyY2.js +1 -0
- package/static/assets/{arrow-down-J9YP8VW9.js → arrow-down-7VoAlw8h.js} +1 -1
- package/static/assets/{arrow-left-RAzvFXpe.js → arrow-left-CkQCXG-O.js} +1 -1
- package/static/assets/{arrow-up-CjXXRPYC.js → arrow-up-Bozm6eto.js} +1 -1
- package/static/assets/{arrow-up-down-BRoDh-fK.js → arrow-up-down-BgZelEPF.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-CKqDVhJv.js} +1 -1
- package/static/assets/brainfuck-C4LP7Hcl.js +1 -0
- package/static/assets/{browser-modal-DVtwh2h7.js → browser-modal-CIOZi1Jw.js} +2 -2
- package/static/assets/{card-DdrUHBUG.js → card-jBf8qQSy.js} +1 -1
- package/static/assets/{chevron-left-C4bGr2Al.js → chevron-left-D1qHCYRd.js} +1 -1
- package/static/assets/{chevron-up-CPpQ_jgb.js → chevron-up-CcwaoTsZ.js} +1 -1
- package/static/assets/{chevrons-up-C8oR0iOR.js → chevrons-up-BtlNQbrw.js} +1 -1
- package/static/assets/{circle-alert-B3zeVGHG.js → circle-alert-DqK0nUqF.js} +1 -1
- package/static/assets/{circle-check-big-CeVxJ4hA.js → circle-check-big-DDQIqE0G.js} +1 -1
- package/static/assets/{circle-check-OfRBf8tJ.js → circle-check-qo4cPVA1.js} +1 -1
- package/static/assets/{circle-play-C_Chmziu.js → circle-play-CQ-UItmT.js} +1 -1
- package/static/assets/{circle-x-CtfEmATn.js → circle-x-Bd57ohC5.js} +1 -1
- package/static/assets/clike-B9uivgTg.js +1 -0
- package/static/assets/{clipboard-Z_0Z5-r1.js → clipboard-JQLlAwqS.js} +1 -1
- package/static/assets/{clock-B43LjbrK.js → clock-DTp411N-.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-Bi-U-NxE.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-DNaE6rtO.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-DRsIhdWR.js} +1 -1
- package/static/assets/{eye-C3fWwYx-.js → eye-jqpFU8Rl.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-ixHmuqNj.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/globe-BZEWER4V.js +6 -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-2_Tb936f.js +1 -0
- package/static/assets/index-B8B_4B2l.js +1 -0
- package/static/assets/index-BD47WGC6.js +1 -0
- package/static/assets/index-BGKQ2Csq.js +3 -0
- package/static/assets/index-BLjvGp1F.js +1 -0
- package/static/assets/{index-SWBrq2bx.js → index-BWhM9fZn.js} +117 -102
- package/static/assets/index-Bft1WzL9.js +1 -0
- package/static/assets/index-C3ao8yMv.js +7 -0
- package/static/assets/index-CK5AHHmM.js +1 -0
- package/static/assets/index-CdmUQF6-.js +1 -0
- package/static/assets/index-CiS46Fde.js +1 -0
- package/static/assets/index-CoeRBZRl.js +2 -0
- package/static/assets/index-CtWTFIFI.js +1 -0
- package/static/assets/index-D-5sddKG.js +1 -0
- package/static/assets/index-DHAvHhw0.js +1 -0
- package/static/assets/index-DffngCzC.js +1 -0
- package/static/assets/index-M-XcYp88.js +1 -0
- package/static/assets/index-UDlexUv4.js +1 -0
- package/static/assets/index-htJaaOEZ.js +1 -0
- package/static/assets/index-oRAlpULD.css +1 -0
- package/static/assets/{info-BZi8bEGv.js → info-Na9GqbtC.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-CHVVHrlr.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-CT9CPLw5.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-B5NR6hzj.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-SI0kWfGf.js} +1 -1
- package/static/assets/pascal--L3eBynH.js +1 -0
- package/static/assets/{pause-CX3StCWt.js → pause-DKI9nsrI.js} +1 -1
- package/static/assets/perl-CdXCOZ3F.js +1 -0
- package/static/assets/pig-CevX1Tat.js +1 -0
- package/static/assets/pipeline-builders-Bkf0wt_O.js +17 -0
- package/static/assets/{play-CRPN1vUy.js → play-BTA0gBuh.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-BO2__pxZ.js} +1 -1
- package/static/assets/{refresh-cw-DGBXSYy5.js → refresh-cw-DLJpfa8_.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-SRuczbr5.js} +1 -1
- package/static/assets/select-D8HyxWyg.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-Ck0OeSLk.js} +1 -1
- package/static/assets/tabs-CmFe8eVW.js +1 -0
- package/static/assets/{tag-BOwlwHfi.js → tag-BTjGQC_2.js} +1 -1
- package/static/assets/tcl-DVfN8rqt.js +1 -0
- package/static/assets/{terminal-preview-BvBQu5Sd.js → terminal-preview-BkQIuk__.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-CrqBojgD.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-BlwRNgSo.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/ActivityPage-DxajSxG1.js +0 -1
- package/static/assets/ArchitectureEditPage-iflIJaCh.js +0 -21
- package/static/assets/ArchitecturePage-oB3FtdZ7.js +0 -1
- package/static/assets/CodePage-DxJYFhiT.js +0 -2
- package/static/assets/DashboardPage-BdsK2Vor.js +0 -51
- package/static/assets/IntegrationsSettingsPage-BzuUrHO1.js +0 -1
- package/static/assets/KnowledgeDetailPage-C1RHtPzz.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/TerminalSessionPage-D2rZb8Ej.js +0 -8
- package/static/assets/UserPreferencesPage-CgtsVqvs.js +0 -1
- package/static/assets/UtilitiesPage-CxQkYrza.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
- package/static/assets/tabs-B7fjkp5h.js +0 -1
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import { promises as fs } from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import matter from 'gray-matter';
|
|
5
|
+
import { findGaitDirectory } from '../../../../../lib/gait-path.js';
|
|
6
|
+
import { getLogger, ContextKinds } from '@lovelybunch/core/logging';
|
|
7
|
+
import { requireAuth } from '../../../../../middleware/auth.js';
|
|
8
|
+
function generateSummary(content, maxLines = 3, maxChars = 200) {
|
|
9
|
+
const cleanContent = content
|
|
10
|
+
.replace(/^#+\s+/gm, '')
|
|
11
|
+
.replace(/[*_`]/g, '')
|
|
12
|
+
.replace(/\[([^\]]+)\]\([^)]+\)/g, '$1')
|
|
13
|
+
.trim();
|
|
14
|
+
const lines = cleanContent.split('\n').filter(line => line.trim().length > 0);
|
|
15
|
+
const summary = lines.slice(0, maxLines).join(' ');
|
|
16
|
+
return summary.length > maxChars
|
|
17
|
+
? summary.substring(0, maxChars) + '...'
|
|
18
|
+
: summary;
|
|
19
|
+
}
|
|
20
|
+
const app = new Hono();
|
|
21
|
+
async function getMemoryPath() {
|
|
22
|
+
const gaitDir = await findGaitDirectory();
|
|
23
|
+
if (!gaitDir)
|
|
24
|
+
return null;
|
|
25
|
+
return path.join(gaitDir, 'context');
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* GET /api/v1/context/memory
|
|
29
|
+
*/
|
|
30
|
+
app.get('/', async (c) => {
|
|
31
|
+
try {
|
|
32
|
+
const memoryPath = await getMemoryPath();
|
|
33
|
+
if (!memoryPath) {
|
|
34
|
+
return c.json({ success: false, error: 'GAIT directory not found' }, 404);
|
|
35
|
+
}
|
|
36
|
+
await fs.mkdir(memoryPath, { recursive: true });
|
|
37
|
+
const filePath = path.join(memoryPath, 'memory.md');
|
|
38
|
+
try {
|
|
39
|
+
const fileContent = await fs.readFile(filePath, 'utf-8');
|
|
40
|
+
const { data, content } = matter(fileContent);
|
|
41
|
+
const title = content.match(/^#\s+(.+)$/m)?.[1] || 'Memory';
|
|
42
|
+
const document = {
|
|
43
|
+
filename: 'memory.md',
|
|
44
|
+
metadata: {
|
|
45
|
+
...data,
|
|
46
|
+
updated: data.updated || new Date().toISOString().split('T')[0],
|
|
47
|
+
type: 'memory',
|
|
48
|
+
category: 'context',
|
|
49
|
+
tags: data.tags || []
|
|
50
|
+
},
|
|
51
|
+
content,
|
|
52
|
+
title
|
|
53
|
+
};
|
|
54
|
+
return c.json({ success: true, document });
|
|
55
|
+
}
|
|
56
|
+
catch (fileError) {
|
|
57
|
+
const defaultContent = `# Memory
|
|
58
|
+
|
|
59
|
+
This document stores persistent memory and learned context.
|
|
60
|
+
|
|
61
|
+
## Key Decisions
|
|
62
|
+
|
|
63
|
+
Important decisions made during the project.
|
|
64
|
+
|
|
65
|
+
## Lessons Learned
|
|
66
|
+
|
|
67
|
+
Insights and patterns discovered over time.
|
|
68
|
+
|
|
69
|
+
## Preferences
|
|
70
|
+
|
|
71
|
+
Remembered preferences and conventions.
|
|
72
|
+
`;
|
|
73
|
+
const document = {
|
|
74
|
+
filename: 'memory.md',
|
|
75
|
+
metadata: {
|
|
76
|
+
version: '1.0',
|
|
77
|
+
updated: new Date().toISOString().split('T')[0],
|
|
78
|
+
type: 'memory',
|
|
79
|
+
category: 'context',
|
|
80
|
+
tags: []
|
|
81
|
+
},
|
|
82
|
+
content: defaultContent,
|
|
83
|
+
title: 'Memory'
|
|
84
|
+
};
|
|
85
|
+
return c.json({ success: true, document });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
console.error('Error loading memory document:', error);
|
|
90
|
+
return c.json({ success: false, error: 'Failed to load memory document' }, 500);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* PUT /api/v1/context/memory
|
|
95
|
+
*/
|
|
96
|
+
app.put('/', async (c) => {
|
|
97
|
+
try {
|
|
98
|
+
const body = await c.req.json();
|
|
99
|
+
if (!body.content) {
|
|
100
|
+
return c.json({ success: false, error: 'Content is required' }, 400);
|
|
101
|
+
}
|
|
102
|
+
const memoryPath = await getMemoryPath();
|
|
103
|
+
if (!memoryPath) {
|
|
104
|
+
return c.json({ success: false, error: 'GAIT directory not found' }, 404);
|
|
105
|
+
}
|
|
106
|
+
await fs.mkdir(memoryPath, { recursive: true });
|
|
107
|
+
const filePath = path.join(memoryPath, 'memory.md');
|
|
108
|
+
let currentData = {};
|
|
109
|
+
try {
|
|
110
|
+
const currentContent = await fs.readFile(filePath, 'utf-8');
|
|
111
|
+
const { data } = matter(currentContent);
|
|
112
|
+
currentData = data;
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
// File doesn't exist, use defaults
|
|
116
|
+
}
|
|
117
|
+
const updatedMetadata = {
|
|
118
|
+
...currentData,
|
|
119
|
+
...body.metadata,
|
|
120
|
+
updated: new Date().toISOString().split('T')[0],
|
|
121
|
+
type: 'memory',
|
|
122
|
+
category: 'context',
|
|
123
|
+
version: currentData.version || '1.0'
|
|
124
|
+
};
|
|
125
|
+
const fileContent = matter.stringify(body.content, updatedMetadata);
|
|
126
|
+
await fs.writeFile(filePath, fileContent, 'utf-8');
|
|
127
|
+
const title = body.title ||
|
|
128
|
+
body.content.match(/^#\s+(.+)$/m)?.[1] ||
|
|
129
|
+
'Memory';
|
|
130
|
+
try {
|
|
131
|
+
const session = await requireAuth(c);
|
|
132
|
+
const actor = session ? `human:${session.email}` : "human:unknown";
|
|
133
|
+
const logger = getLogger();
|
|
134
|
+
logger.log({
|
|
135
|
+
kind: ContextKinds.MEMORY_UPDATE,
|
|
136
|
+
actor,
|
|
137
|
+
subject: `context:memory.md`,
|
|
138
|
+
tags: ["context", "memory"],
|
|
139
|
+
payload: {
|
|
140
|
+
title,
|
|
141
|
+
summary: generateSummary(body.content),
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
catch (logError) {
|
|
146
|
+
console.error('Error logging memory update:', logError);
|
|
147
|
+
}
|
|
148
|
+
return c.json({
|
|
149
|
+
success: true,
|
|
150
|
+
document: {
|
|
151
|
+
filename: 'memory.md',
|
|
152
|
+
title,
|
|
153
|
+
metadata: updatedMetadata,
|
|
154
|
+
content: body.content
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
console.error('Error updating memory document:', error);
|
|
160
|
+
return c.json({ success: false, error: 'Failed to update memory document' }, 500);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
export default app;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import { promises as fs } from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import matter from 'gray-matter';
|
|
5
|
+
import { findGaitDirectory } from '../../../../../lib/gait-path.js';
|
|
6
|
+
import { getLogger, ContextKinds } from '@lovelybunch/core/logging';
|
|
7
|
+
import { requireAuth } from '../../../../../middleware/auth.js';
|
|
8
|
+
function generateSummary(content, maxLines = 3, maxChars = 200) {
|
|
9
|
+
const cleanContent = content
|
|
10
|
+
.replace(/^#+\s+/gm, '')
|
|
11
|
+
.replace(/[*_`]/g, '')
|
|
12
|
+
.replace(/\[([^\]]+)\]\([^)]+\)/g, '$1')
|
|
13
|
+
.trim();
|
|
14
|
+
const lines = cleanContent.split('\n').filter(line => line.trim().length > 0);
|
|
15
|
+
const summary = lines.slice(0, maxLines).join(' ');
|
|
16
|
+
return summary.length > maxChars
|
|
17
|
+
? summary.substring(0, maxChars) + '...'
|
|
18
|
+
: summary;
|
|
19
|
+
}
|
|
20
|
+
const app = new Hono();
|
|
21
|
+
async function getTeamPath() {
|
|
22
|
+
const gaitDir = await findGaitDirectory();
|
|
23
|
+
if (!gaitDir)
|
|
24
|
+
return null;
|
|
25
|
+
return path.join(gaitDir, 'context');
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* GET /api/v1/context/team
|
|
29
|
+
*/
|
|
30
|
+
app.get('/', async (c) => {
|
|
31
|
+
try {
|
|
32
|
+
const teamPath = await getTeamPath();
|
|
33
|
+
if (!teamPath) {
|
|
34
|
+
return c.json({ success: false, error: 'GAIT directory not found' }, 404);
|
|
35
|
+
}
|
|
36
|
+
await fs.mkdir(teamPath, { recursive: true });
|
|
37
|
+
const filePath = path.join(teamPath, 'team.md');
|
|
38
|
+
try {
|
|
39
|
+
const fileContent = await fs.readFile(filePath, 'utf-8');
|
|
40
|
+
const { data, content } = matter(fileContent);
|
|
41
|
+
const title = content.match(/^#\s+(.+)$/m)?.[1] || 'Team';
|
|
42
|
+
const document = {
|
|
43
|
+
filename: 'team.md',
|
|
44
|
+
metadata: {
|
|
45
|
+
...data,
|
|
46
|
+
updated: data.updated || new Date().toISOString().split('T')[0],
|
|
47
|
+
type: 'team',
|
|
48
|
+
category: 'context',
|
|
49
|
+
tags: data.tags || []
|
|
50
|
+
},
|
|
51
|
+
content,
|
|
52
|
+
title
|
|
53
|
+
};
|
|
54
|
+
return c.json({ success: true, document });
|
|
55
|
+
}
|
|
56
|
+
catch (fileError) {
|
|
57
|
+
const defaultContent = `# Team
|
|
58
|
+
|
|
59
|
+
This document describes the team structure and members.
|
|
60
|
+
|
|
61
|
+
## Team Members
|
|
62
|
+
|
|
63
|
+
List team members, their roles, and responsibilities.
|
|
64
|
+
|
|
65
|
+
## Communication
|
|
66
|
+
|
|
67
|
+
Team communication channels and conventions.
|
|
68
|
+
`;
|
|
69
|
+
const document = {
|
|
70
|
+
filename: 'team.md',
|
|
71
|
+
metadata: {
|
|
72
|
+
version: '1.0',
|
|
73
|
+
updated: new Date().toISOString().split('T')[0],
|
|
74
|
+
type: 'team',
|
|
75
|
+
category: 'context',
|
|
76
|
+
tags: []
|
|
77
|
+
},
|
|
78
|
+
content: defaultContent,
|
|
79
|
+
title: 'Team'
|
|
80
|
+
};
|
|
81
|
+
return c.json({ success: true, document });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
console.error('Error loading team document:', error);
|
|
86
|
+
return c.json({ success: false, error: 'Failed to load team document' }, 500);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
/**
|
|
90
|
+
* PUT /api/v1/context/team
|
|
91
|
+
*/
|
|
92
|
+
app.put('/', async (c) => {
|
|
93
|
+
try {
|
|
94
|
+
const body = await c.req.json();
|
|
95
|
+
if (!body.content) {
|
|
96
|
+
return c.json({ success: false, error: 'Content is required' }, 400);
|
|
97
|
+
}
|
|
98
|
+
const teamPath = await getTeamPath();
|
|
99
|
+
if (!teamPath) {
|
|
100
|
+
return c.json({ success: false, error: 'GAIT directory not found' }, 404);
|
|
101
|
+
}
|
|
102
|
+
await fs.mkdir(teamPath, { recursive: true });
|
|
103
|
+
const filePath = path.join(teamPath, 'team.md');
|
|
104
|
+
let currentData = {};
|
|
105
|
+
try {
|
|
106
|
+
const currentContent = await fs.readFile(filePath, 'utf-8');
|
|
107
|
+
const { data } = matter(currentContent);
|
|
108
|
+
currentData = data;
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
// File doesn't exist, use defaults
|
|
112
|
+
}
|
|
113
|
+
const updatedMetadata = {
|
|
114
|
+
...currentData,
|
|
115
|
+
...body.metadata,
|
|
116
|
+
updated: new Date().toISOString().split('T')[0],
|
|
117
|
+
type: 'team',
|
|
118
|
+
category: 'context',
|
|
119
|
+
version: currentData.version || '1.0'
|
|
120
|
+
};
|
|
121
|
+
const fileContent = matter.stringify(body.content, updatedMetadata);
|
|
122
|
+
await fs.writeFile(filePath, fileContent, 'utf-8');
|
|
123
|
+
const title = body.title ||
|
|
124
|
+
body.content.match(/^#\s+(.+)$/m)?.[1] ||
|
|
125
|
+
'Team';
|
|
126
|
+
try {
|
|
127
|
+
const session = await requireAuth(c);
|
|
128
|
+
const actor = session ? `human:${session.email}` : "human:unknown";
|
|
129
|
+
const logger = getLogger();
|
|
130
|
+
logger.log({
|
|
131
|
+
kind: ContextKinds.TEAM_UPDATE,
|
|
132
|
+
actor,
|
|
133
|
+
subject: `context:team.md`,
|
|
134
|
+
tags: ["context", "team"],
|
|
135
|
+
payload: {
|
|
136
|
+
title,
|
|
137
|
+
summary: generateSummary(body.content),
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
catch (logError) {
|
|
142
|
+
console.error('Error logging team update:', logError);
|
|
143
|
+
}
|
|
144
|
+
return c.json({
|
|
145
|
+
success: true,
|
|
146
|
+
document: {
|
|
147
|
+
filename: 'team.md',
|
|
148
|
+
title,
|
|
149
|
+
metadata: updatedMetadata,
|
|
150
|
+
content: body.content
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
console.error('Error updating team document:', error);
|
|
156
|
+
return c.json({ success: false, error: 'Failed to update team document' }, 500);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
export default app;
|
|
@@ -3,6 +3,7 @@ import { promises as fs } from 'fs';
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import matter from 'gray-matter';
|
|
5
5
|
import filenameRoute from './[filename]/index.js';
|
|
6
|
+
import { listKnowledge } from '@lovelybunch/core';
|
|
6
7
|
import { getLogger, KnowledgeKinds } from '@lovelybunch/core/logging';
|
|
7
8
|
import { requireAuth } from '../../../../middleware/auth.js';
|
|
8
9
|
// Helper function to generate a simple summary from content
|
|
@@ -50,43 +51,36 @@ function generateFilename(title) {
|
|
|
50
51
|
}
|
|
51
52
|
/**
|
|
52
53
|
* GET /api/v1/knowledge
|
|
53
|
-
* Load all knowledge documents
|
|
54
|
+
* Load all knowledge documents.
|
|
55
|
+
*
|
|
56
|
+
* Query params:
|
|
57
|
+
* q - search/filter query (fuzzy match on title, content, tags, category)
|
|
58
|
+
* full - set to "true" to include the full markdown content (default: summary only)
|
|
59
|
+
* limit - max results per page (1-100)
|
|
60
|
+
* offset - number of results to skip (for pagination, default: 0)
|
|
54
61
|
*/
|
|
55
62
|
app.get('/', async (c) => {
|
|
56
63
|
try {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
]);
|
|
69
|
-
const { data, content } = matter(fileContent);
|
|
70
|
-
// Extract title from metadata, first heading, or use filename
|
|
71
|
-
const title = data.title ||
|
|
72
|
-
content.match(/^#\s+(.+)$/m)?.[1] ||
|
|
73
|
-
file.replace('.md', '').replace(/[_-]/g, ' ').replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());
|
|
74
|
-
return {
|
|
75
|
-
filename: file,
|
|
76
|
-
metadata: {
|
|
77
|
-
...data,
|
|
78
|
-
title, // Include title in metadata
|
|
79
|
-
updated: stats.mtime.toISOString(),
|
|
80
|
-
tags: data.tags || [],
|
|
81
|
-
sources: data.sources || []
|
|
82
|
-
},
|
|
83
|
-
content,
|
|
84
|
-
title
|
|
85
|
-
};
|
|
86
|
-
}));
|
|
64
|
+
const query = c.req.query('q') || undefined;
|
|
65
|
+
const full = c.req.query('full') === 'true';
|
|
66
|
+
const limitParam = c.req.query('limit');
|
|
67
|
+
const limit = limitParam ? Math.min(Math.max(1, parseInt(limitParam, 10) || 20), 100) : undefined;
|
|
68
|
+
const offsetParam = c.req.query('offset');
|
|
69
|
+
const offset = offsetParam ? Math.max(0, parseInt(offsetParam, 10) || 0) : 0;
|
|
70
|
+
let documents = await listKnowledge({ query, full });
|
|
71
|
+
const totalCount = documents.length;
|
|
72
|
+
if (limit !== undefined || offset > 0) {
|
|
73
|
+
documents = documents.slice(offset, limit !== undefined ? offset + limit : undefined);
|
|
74
|
+
}
|
|
87
75
|
return c.json({
|
|
88
76
|
success: true,
|
|
89
|
-
|
|
77
|
+
query,
|
|
78
|
+
full,
|
|
79
|
+
totalCount,
|
|
80
|
+
count: documents.length,
|
|
81
|
+
...(limit !== undefined && { limit }),
|
|
82
|
+
offset,
|
|
83
|
+
documents,
|
|
90
84
|
});
|
|
91
85
|
}
|
|
92
86
|
catch (error) {
|
|
@@ -116,7 +116,7 @@ export declare function setMailStatusHandler(c: Context): Promise<(Response & im
|
|
|
116
116
|
}, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
|
|
117
117
|
success: false;
|
|
118
118
|
error: any;
|
|
119
|
-
},
|
|
119
|
+
}, 404 | 500, "json">)>;
|
|
120
120
|
/**
|
|
121
121
|
* POST /api/v1/mail/:id/reply
|
|
122
122
|
* Reply to an email
|
|
@@ -154,7 +154,7 @@ export declare function replyMailHandler(c: Context): Promise<(Response & import
|
|
|
154
154
|
}, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
|
|
155
155
|
success: false;
|
|
156
156
|
error: any;
|
|
157
|
-
},
|
|
157
|
+
}, 404 | 500, "json">)>;
|
|
158
158
|
/**
|
|
159
159
|
* POST /api/v1/mail/send
|
|
160
160
|
* Send an email (coming soon)
|
|
@@ -217,7 +217,7 @@ export declare function setMailActionHandler(c: Context): Promise<(Response & im
|
|
|
217
217
|
}, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
|
|
218
218
|
success: false;
|
|
219
219
|
error: any;
|
|
220
|
-
},
|
|
220
|
+
}, 404 | 500, "json">)>;
|
|
221
221
|
/**
|
|
222
222
|
* GET /api/v1/mail/:id/processing
|
|
223
223
|
* Get processing status and log tail for an email
|
|
@@ -3,10 +3,36 @@ import { promises as fs } from 'fs';
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { ZodError } from 'zod';
|
|
5
5
|
import { listTasks, getTask, createTask, updateTask, deleteTask, getContext, updateContext, appendContext, replaceContextSection, listKnowledge, getKnowledge, createKnowledge, updateKnowledge, listEvents, } from '@lovelybunch/core';
|
|
6
|
-
import { tasksFullTool, knowledgeTool, normalizeKnowledgeMetadata, eventsTool, projectContextTool, architectureContextTool, roleContextTool, resourcesTool } from '@lovelybunch/mcp';
|
|
6
|
+
import { tasksFullTool, knowledgeTool, normalizeKnowledgeMetadata, eventsTool, projectContextTool, architectureContextTool, roleContextTool, resourcesTool, listConnectorsTool, connectorRequestTool, resolveConnectorUrl } from '@lovelybunch/mcp';
|
|
7
7
|
import { FileStorageAdapter } from '../../../../lib/storage/file-storage.js';
|
|
8
|
+
import { homedir } from 'os';
|
|
9
|
+
import { readFileSync, existsSync } from 'fs';
|
|
8
10
|
const app = new Hono();
|
|
9
11
|
const storage = new FileStorageAdapter();
|
|
12
|
+
const COCONUT_HOST = 'https://app.coconut.dev';
|
|
13
|
+
function getCallbackToken() {
|
|
14
|
+
try {
|
|
15
|
+
const platform = process.platform;
|
|
16
|
+
let configDir;
|
|
17
|
+
if (platform === 'win32') {
|
|
18
|
+
configDir = path.join(process.env.APPDATA || homedir(), 'coconuts');
|
|
19
|
+
}
|
|
20
|
+
else if (platform === 'darwin') {
|
|
21
|
+
configDir = path.join(homedir(), 'Library', 'Application Support', 'coconuts');
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
configDir = path.join(process.env.XDG_CONFIG_HOME || path.join(homedir(), '.config'), 'coconuts');
|
|
25
|
+
}
|
|
26
|
+
const configFile = path.join(configDir, 'config.json');
|
|
27
|
+
if (!existsSync(configFile))
|
|
28
|
+
return null;
|
|
29
|
+
const config = JSON.parse(readFileSync(configFile, 'utf-8'));
|
|
30
|
+
return config.apiKeys?.callbackToken || null;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
10
36
|
function resolveGaitPath() {
|
|
11
37
|
let basePath;
|
|
12
38
|
if (process.env.NODE_ENV === 'development' && process.env.GAIT_DEV_ROOT) {
|
|
@@ -86,7 +112,9 @@ app.get('/', async (c) => {
|
|
|
86
112
|
project_context: projectContextTool,
|
|
87
113
|
architecture_context: architectureContextTool,
|
|
88
114
|
role_context: roleContextTool,
|
|
89
|
-
resources: resourcesTool
|
|
115
|
+
resources: resourcesTool,
|
|
116
|
+
list_connectors: listConnectorsTool,
|
|
117
|
+
connector_request: connectorRequestTool
|
|
90
118
|
};
|
|
91
119
|
return c.json({
|
|
92
120
|
success: true,
|
|
@@ -115,7 +143,9 @@ app.get('/schema', async (c) => {
|
|
|
115
143
|
project_context: projectContextTool,
|
|
116
144
|
architecture_context: architectureContextTool,
|
|
117
145
|
role_context: roleContextTool,
|
|
118
|
-
resources: resourcesTool
|
|
146
|
+
resources: resourcesTool,
|
|
147
|
+
list_connectors: listConnectorsTool,
|
|
148
|
+
connector_request: connectorRequestTool
|
|
119
149
|
}
|
|
120
150
|
};
|
|
121
151
|
return c.json(schema);
|
|
@@ -156,6 +186,12 @@ app.post('/execute', async (c) => {
|
|
|
156
186
|
if (tool === 'resources') {
|
|
157
187
|
return await executeResourcesTool(c, args);
|
|
158
188
|
}
|
|
189
|
+
if (tool === 'list_connectors') {
|
|
190
|
+
return await executeListConnectorsTool(c);
|
|
191
|
+
}
|
|
192
|
+
if (tool === 'connector_request') {
|
|
193
|
+
return await executeConnectorRequestTool(c, args);
|
|
194
|
+
}
|
|
159
195
|
return c.json({ success: false, error: 'Unknown tool' }, 400);
|
|
160
196
|
}
|
|
161
197
|
catch (error) {
|
|
@@ -260,10 +296,11 @@ async function executeKnowledgeTool(c, args) {
|
|
|
260
296
|
switch (operation) {
|
|
261
297
|
case 'list': {
|
|
262
298
|
const searchQuery = query && typeof query === 'string' ? query : undefined;
|
|
263
|
-
const documents = await listKnowledge({ query: searchQuery });
|
|
299
|
+
const documents = await listKnowledge({ query: searchQuery, full: false });
|
|
264
300
|
return c.json({
|
|
265
301
|
success: true,
|
|
266
302
|
data: documents,
|
|
303
|
+
count: documents.length,
|
|
267
304
|
message: searchQuery
|
|
268
305
|
? `Found ${documents.length} knowledge documents matching "${searchQuery}"`
|
|
269
306
|
: `Found ${documents.length} knowledge documents`
|
|
@@ -524,6 +561,135 @@ async function executeResourcesTool(c, args) {
|
|
|
524
561
|
return c.json({ success: false, error: error.message || 'Resources tool execution failed' }, 500);
|
|
525
562
|
}
|
|
526
563
|
}
|
|
564
|
+
async function executeListConnectorsTool(c) {
|
|
565
|
+
const token = getCallbackToken();
|
|
566
|
+
if (!token) {
|
|
567
|
+
return c.json({
|
|
568
|
+
success: false,
|
|
569
|
+
error: 'Callback token not configured. Set it via PUT /api/v1/config?type=global with { "apiKeys": { "callbackToken": "cpt_xxx" } }'
|
|
570
|
+
}, 400);
|
|
571
|
+
}
|
|
572
|
+
try {
|
|
573
|
+
const res = await fetch(`${COCONUT_HOST}/api/connectors/accounts`, {
|
|
574
|
+
headers: { 'X-Callback-Token': token }
|
|
575
|
+
});
|
|
576
|
+
if (!res.ok) {
|
|
577
|
+
const body = await res.text().catch(() => '');
|
|
578
|
+
return c.json({
|
|
579
|
+
success: false,
|
|
580
|
+
error: `Control plane returned ${res.status}: ${body || res.statusText}`
|
|
581
|
+
}, res.status >= 500 ? 502 : 400);
|
|
582
|
+
}
|
|
583
|
+
const data = await res.json();
|
|
584
|
+
const accounts = Array.isArray(data) ? data : (data.accounts ?? data.data ?? []);
|
|
585
|
+
return c.json({
|
|
586
|
+
success: true,
|
|
587
|
+
data: accounts,
|
|
588
|
+
count: accounts.length,
|
|
589
|
+
message: `Found ${accounts.length} connected service${accounts.length === 1 ? '' : 's'}`
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
catch (error) {
|
|
593
|
+
console.error('Error listing connectors:', error);
|
|
594
|
+
return c.json({ success: false, error: error.message || 'Failed to list connectors' }, 500);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
async function executeConnectorRequestTool(c, args) {
|
|
598
|
+
const { app: appSlug, method, path: apiPath, body, headers: extraHeaders } = args;
|
|
599
|
+
if (!appSlug || !method || !apiPath) {
|
|
600
|
+
return c.json({ success: false, error: 'app, method, and path are required' }, 400);
|
|
601
|
+
}
|
|
602
|
+
const token = getCallbackToken();
|
|
603
|
+
if (!token) {
|
|
604
|
+
return c.json({
|
|
605
|
+
success: false,
|
|
606
|
+
error: 'Callback token not configured. Set it via PUT /api/v1/config?type=global with { "apiKeys": { "callbackToken": "cpt_xxx" } }'
|
|
607
|
+
}, 400);
|
|
608
|
+
}
|
|
609
|
+
try {
|
|
610
|
+
const accounts = await fetchConnectorAccounts(token);
|
|
611
|
+
const account = accounts.find((a) => a.appSlug === appSlug || a.appName?.toLowerCase() === appSlug.toLowerCase());
|
|
612
|
+
if (!account) {
|
|
613
|
+
return c.json({
|
|
614
|
+
success: false,
|
|
615
|
+
error: `No connected account found for "${appSlug}"`,
|
|
616
|
+
available: accounts.map((a) => a.appSlug || a.appName)
|
|
617
|
+
}, 404);
|
|
618
|
+
}
|
|
619
|
+
const url = resolveConnectorUrl(appSlug, apiPath);
|
|
620
|
+
if (!url) {
|
|
621
|
+
return c.json({
|
|
622
|
+
success: false,
|
|
623
|
+
error: `Unknown app "${appSlug}" and path is not a full URL. Use a full URL (https://...) or a known app slug.`
|
|
624
|
+
}, 400);
|
|
625
|
+
}
|
|
626
|
+
let parsedBody = undefined;
|
|
627
|
+
if (body) {
|
|
628
|
+
try {
|
|
629
|
+
parsedBody = typeof body === 'string' ? JSON.parse(body) : body;
|
|
630
|
+
}
|
|
631
|
+
catch {
|
|
632
|
+
return c.json({ success: false, error: 'Invalid JSON in body parameter' }, 400);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
let parsedHeaders = {};
|
|
636
|
+
if (extraHeaders) {
|
|
637
|
+
try {
|
|
638
|
+
parsedHeaders = typeof extraHeaders === 'string' ? JSON.parse(extraHeaders) : extraHeaders;
|
|
639
|
+
}
|
|
640
|
+
catch {
|
|
641
|
+
return c.json({ success: false, error: 'Invalid JSON in headers parameter' }, 400);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
const proxyPayload = {
|
|
645
|
+
accountId: account.accountId,
|
|
646
|
+
url,
|
|
647
|
+
method: method.toUpperCase()
|
|
648
|
+
};
|
|
649
|
+
if (parsedBody !== undefined)
|
|
650
|
+
proxyPayload.body = parsedBody;
|
|
651
|
+
if (Object.keys(parsedHeaders).length > 0)
|
|
652
|
+
proxyPayload.headers = parsedHeaders;
|
|
653
|
+
const proxyRes = await fetch(`${COCONUT_HOST}/api/connectors/proxy`, {
|
|
654
|
+
method: 'POST',
|
|
655
|
+
headers: {
|
|
656
|
+
'Content-Type': 'application/json',
|
|
657
|
+
'X-Callback-Token': token
|
|
658
|
+
},
|
|
659
|
+
body: JSON.stringify(proxyPayload)
|
|
660
|
+
});
|
|
661
|
+
if (!proxyRes.ok) {
|
|
662
|
+
const errBody = await proxyRes.text().catch(() => '');
|
|
663
|
+
return c.json({
|
|
664
|
+
success: false,
|
|
665
|
+
error: `Proxy request failed (${proxyRes.status}): ${errBody || proxyRes.statusText}`
|
|
666
|
+
}, proxyRes.status >= 500 ? 502 : 400);
|
|
667
|
+
}
|
|
668
|
+
const responseData = await proxyRes.json().catch(async () => {
|
|
669
|
+
return await proxyRes.text().catch(() => null);
|
|
670
|
+
});
|
|
671
|
+
return c.json({
|
|
672
|
+
success: true,
|
|
673
|
+
data: responseData,
|
|
674
|
+
message: `${method.toUpperCase()} ${apiPath} via ${appSlug}`
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
catch (error) {
|
|
678
|
+
console.error('Error executing connector request:', error);
|
|
679
|
+
return c.json({ success: false, error: error.message || 'Connector request failed' }, 500);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
async function fetchConnectorAccounts(token) {
|
|
683
|
+
const res = await fetch(`${COCONUT_HOST}/api/connectors/accounts`, {
|
|
684
|
+
headers: { 'X-Callback-Token': token }
|
|
685
|
+
});
|
|
686
|
+
if (!res.ok) {
|
|
687
|
+
const body = await res.text().catch(() => '');
|
|
688
|
+
throw new Error(`Failed to fetch accounts (${res.status}): ${body || res.statusText}`);
|
|
689
|
+
}
|
|
690
|
+
const data = await res.json();
|
|
691
|
+
return Array.isArray(data) ? data : (data.accounts ?? data.data ?? []);
|
|
692
|
+
}
|
|
527
693
|
/**
|
|
528
694
|
* GET /api/v1/mcp/raw-config
|
|
529
695
|
* Returns the raw MCP configuration for editing in settings UI
|