@lovelybunch/api 1.0.76-alpha.11 → 1.0.76-alpha.12
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/routes/api/v1/ai/route.js +56 -149
- package/dist/routes/api/v1/jobs/[id]/route.d.ts +12 -18
- package/dist/routes/api/v1/jobs/[id]/route.js +3 -3
- package/dist/routes/api/v1/jobs/route.d.ts +19 -19
- package/dist/routes/api/v1/jobs/route.js +17 -2
- package/dist/routes/api/v1/mcp/index.js +27 -19
- package/package.json +4 -4
- package/static/assets/{ActivityPage-CUPUsmhW.js → ActivityPage-BJJTUKh9.js} +1 -1
- package/static/assets/{AgentsContextEditPage-CBZaG033.js → AgentsContextEditPage-DdBAbiaZ.js} +1 -1
- package/static/assets/{AgentsContextPage-BWzSvM5V.js → AgentsContextPage-C49ImhHO.js} +1 -1
- package/static/assets/{ApiKeysSettingsPage-CauZEPsx.js → ApiKeysSettingsPage-CYl8BKyY.js} +1 -1
- package/static/assets/{ArchitectureEditPage-DZhYQihz.js → ArchitectureEditPage-Bj3Bg_pV.js} +1 -1
- package/static/assets/{ArchitecturePage-Cvj4j0Mo.js → ArchitecturePage-B4REANhO.js} +1 -1
- package/static/assets/{AuthSettingsPage-22eaC7la.js → AuthSettingsPage-CvobAtkW.js} +1 -1
- package/static/assets/{CallbackPage-DCf0WTl0.js → CallbackPage-Cg68HItO.js} +1 -1
- package/static/assets/{CodePage-CuyF2xDA.js → CodePage-BgIQAm3x.js} +1 -1
- package/static/assets/{CollapsibleSection-CUHXgJIe.js → CollapsibleSection-B80EDHZL.js} +1 -1
- package/static/assets/{DashboardPage-DIU-4dPO.js → DashboardPage-KtwwIk4u.js} +1 -1
- package/static/assets/{GitPage-BGHRNljT.js → GitPage-U50MBUc2.js} +1 -1
- package/static/assets/{GitSettingsPage-A4ty6ftB.js → GitSettingsPage-CVJFc5Cz.js} +1 -1
- package/static/assets/{IdentityPage-4xn0DPW8.js → IdentityPage-B_prxEfP.js} +1 -1
- package/static/assets/{ImplementationStepsEditor-CaMsbJPb.js → ImplementationStepsEditor-7737WSoi.js} +1 -1
- package/static/assets/{IntegrationsSettingsPage-B1sX003q.js → IntegrationsSettingsPage-CzmVKesF.js} +1 -1
- package/static/assets/JobDetailPage-61LKyh2y.js +1 -0
- package/static/assets/{KnowledgeDetailPage-Dvk-QAJJ.js → KnowledgeDetailPage-DF8VINWX.js} +1 -1
- package/static/assets/{KnowledgeEditPage-CN0wPWMV.js → KnowledgeEditPage-BPqv8dm5.js} +1 -1
- package/static/assets/{KnowledgePage-BLe2lXja.js → KnowledgePage-DK2ZmTOW.js} +1 -1
- package/static/assets/{LoginPage-BkZt_pMw.js → LoginPage-BJoMiSzz.js} +1 -1
- package/static/assets/MailInboxPage-D7kppimo.js +1 -0
- package/static/assets/MailProcessingModal-CiU2tPrl.js +1 -0
- package/static/assets/MailReadPage-C6Uk8fuE.js +1 -0
- package/static/assets/{MailSentPage-DIJJ8I5v.js → MailSentPage-BC08nLUD.js} +1 -1
- package/static/assets/{McpSettingsPage-CgOnXuHZ.js → McpSettingsPage-CdNU_m5E.js} +1 -1
- package/static/assets/{MemoryEditPage-CR6SmDXU.js → MemoryEditPage-CrMnRGDo.js} +1 -1
- package/static/assets/{MemoryPage-BcWVGuiS.js → MemoryPage-BXzS3NzY.js} +1 -1
- package/static/assets/{NewKnowledgePage-BE4X0pSc.js → NewKnowledgePage-Ia0GhoF_.js} +1 -1
- package/static/assets/{NewSkillPage-B3prwJ_n.js → NewSkillPage-B-lKmYIT.js} +1 -1
- package/static/assets/{NewTaskPage-DszXfHrv.js → NewTaskPage-B9sYSebW.js} +1 -1
- package/static/assets/{NotFoundPage-D3K7UoeF.js → NotFoundPage-CFh8ZpUq.js} +1 -1
- package/static/assets/{NotificationsSettingsPage-C4Gthita.js → NotificationsSettingsPage-CkW0hhZp.js} +1 -1
- package/static/assets/{ProjectEditPage-DTdhZKQg.js → ProjectEditPage-CERVEYfa.js} +1 -1
- package/static/assets/{ProjectPage-BIk487-h.js → ProjectPage-smlgt2WA.js} +1 -1
- package/static/assets/{PromptsSettingsPage-4iJoggN0.js → PromptsSettingsPage-rmH7tCbI.js} +1 -1
- package/static/assets/{ResourceDetailPage-DKs83OyV.js → ResourceDetailPage-JYYH_eYN.js} +1 -1
- package/static/assets/{ResourcesPage-CO45MzEx.js → ResourcesPage-Bxo0L-YJ.js} +1 -1
- package/static/assets/{RoleEditPage-B0pm5rVn.js → RoleEditPage-DUxyu-Pf.js} +1 -1
- package/static/assets/{RolePage-B7JswOZC.js → RolePage-Bxtbnhzq.js} +1 -1
- package/static/assets/{RulesSettingsPage-CB6YdyhI.js → RulesSettingsPage-Bq85g3dZ.js} +1 -1
- package/static/assets/RunDetailPage-Bmr-OpEH.js +1 -0
- package/static/assets/SchedulePage-DVFrtK_u.js +4 -0
- package/static/assets/{SkillDetailPage-7EzSwjPh.js → SkillDetailPage-DLVeAMHh.js} +1 -1
- package/static/assets/{SkillEditPage-CpouyjFV.js → SkillEditPage-L8qO7aXB.js} +1 -1
- package/static/assets/{SkillsPage-DP8zSnPo.js → SkillsPage-Dbk0ZdCj.js} +1 -1
- package/static/assets/{SkillsSettingsPage-CktzJBa7.js → SkillsSettingsPage-D1LF96aM.js} +1 -1
- package/static/assets/{SourceInput-CQnyDxzl.js → SourceInput-s6cvxCld.js} +1 -1
- package/static/assets/{TagInput-DoO2Dwj6.js → TagInput-B6t8mWa1.js} +1 -1
- package/static/assets/{TaskDetailPage-C6xKC_IM.js → TaskDetailPage-CFKiBp4N.js} +1 -1
- package/static/assets/{TaskEditPage-DPLOeh7K.js → TaskEditPage-CU1Nh5Wt.js} +1 -1
- package/static/assets/{TasksPage-C-toKZIZ.js → TasksPage-ChyoBFb1.js} +1 -1
- package/static/assets/{TeamEditPage-B8qk6fWu.js → TeamEditPage-BiH1cvW_.js} +1 -1
- package/static/assets/{TeamPage-CQ4EE1rP.js → TeamPage-CZgCevCv.js} +1 -1
- package/static/assets/{TerminalPage-C0CSp8st.js → TerminalPage-CnMHrceg.js} +1 -1
- package/static/assets/{TerminalSessionPage-BQOMLYPX.js → TerminalSessionPage-CWRmxO5F.js} +1 -1
- package/static/assets/{UserPreferencesPage-1l5T8TaE.js → UserPreferencesPage-DBAMcnVw.js} +1 -1
- package/static/assets/{UserSettingsPage-CS7BrEZJ.js → UserSettingsPage-DaJ5ULZ6.js} +1 -1
- package/static/assets/{UtilitiesPage-D1YCA1eC.js → UtilitiesPage-DK2tA2dg.js} +1 -1
- package/static/assets/{alert-DOfUEE4H.js → alert-BLA1YxSF.js} +1 -1
- package/static/assets/{arrow-down-DumN-Nal.js → arrow-down-BS_gkmFX.js} +1 -1
- package/static/assets/{arrow-left-B_QwfLPP.js → arrow-left-BMmwy6t5.js} +1 -1
- package/static/assets/{arrow-up-B3Oj7MxZ.js → arrow-up-DEdQz7h4.js} +1 -1
- package/static/assets/{arrow-up-down-D8T0kR2Q.js → arrow-up-down-BfLyyRID.js} +1 -1
- package/static/assets/{badge-BmHXIBBB.js → badge-DXtacKLi.js} +1 -1
- package/static/assets/{browser-modal-4AfJ98X7.js → browser-modal-C-EJH5-l.js} +1 -1
- package/static/assets/{card-BpqK1BMM.js → card-T1Zl_t-O.js} +1 -1
- package/static/assets/{chevron-left-CSCdB-iz.js → chevron-left-CHIuYPig.js} +1 -1
- package/static/assets/{chevron-up-DaWWwb87.js → chevron-up-C1j8XcMS.js} +1 -1
- package/static/assets/{chevrons-up-B2GdB4F7.js → chevrons-up-CJo8Mkrm.js} +1 -1
- package/static/assets/{circle-alert-CQ-Ir4mS.js → circle-alert-C-TQDAZH.js} +1 -1
- package/static/assets/{circle-check-01UufaGN.js → circle-check-D4Eo7NeP.js} +1 -1
- package/static/assets/{circle-check-big-CVbQ_zpj.js → circle-check-big-Dw0wgLkY.js} +1 -1
- package/static/assets/{circle-play-COMPwZ00.js → circle-play-XYouMl6A.js} +1 -1
- package/static/assets/{circle-x-Cs5S3HID.js → circle-x-i-p09ZTc.js} +1 -1
- package/static/assets/{clipboard-C-VV2jbC.js → clipboard-CAJMRUqv.js} +1 -1
- package/static/assets/{clock-BKOkXNLP.js → clock-t6EXtqFH.js} +1 -1
- package/static/assets/{code-CmFlYUo3.js → code-CQveJCBf.js} +1 -1
- package/static/assets/{download-Cg0a1Yh4.js → download-gURwTJ4j.js} +1 -1
- package/static/assets/{external-link-BSAlwNHq.js → external-link-B6lRGdDG.js} +1 -1
- package/static/assets/{eye-AP4j25wH.js → eye-BmQvWYqM.js} +1 -1
- package/static/assets/{folder-git-2-CMtTePKY.js → folder-git-2-Y7dQhpIc.js} +1 -1
- package/static/assets/{globe-CJrZCIc6.js → globe-DZ1sD-ad.js} +1 -1
- package/static/assets/index-6zt5f3rT.js +502 -0
- package/static/assets/{index-BpQ9T8mu.js → index-B-EQGkgp.js} +1 -1
- package/static/assets/{index-ZJ8xZq44.js → index-BDAqiMeO.js} +1 -1
- package/static/assets/{index-BZvWD4ai.js → index-BKsuLLw3.js} +1 -1
- package/static/assets/{index-CL_XsRD7.js → index-BQ6h7obM.js} +1 -1
- package/static/assets/index-BcCuKdbf.css +1 -0
- package/static/assets/{index-oKV7MVo_.js → index-C7-vaKc0.js} +1 -1
- package/static/assets/{index-DoDazQp9.js → index-CEVCklYW.js} +1 -1
- package/static/assets/{index-Brkkhgwq.js → index-CdbMr7EO.js} +1 -1
- package/static/assets/{index-DBS4Ya9k.js → index-Cop1vyXt.js} +1 -1
- package/static/assets/{index-CtnO1D9D.js → index-Ct1TqN9g.js} +1 -1
- package/static/assets/{index-BMie63_b.js → index-CvaJ85WT.js} +1 -1
- package/static/assets/{index-Digxc7bT.js → index-DHyZkKDt.js} +1 -1
- package/static/assets/{index-vk3KOxHi.js → index-DeFIoxHB.js} +1 -1
- package/static/assets/{index-Dz52SxOy.js → index-DiWum-Qk.js} +1 -1
- package/static/assets/{index-DgeHIphZ.js → index-DkcxAJRd.js} +1 -1
- package/static/assets/{index-CiyjdZHh.js → index-JMlWoOlR.js} +1 -1
- package/static/assets/{index-D3hMbDtK.js → index-d2atEU4g.js} +1 -1
- package/static/assets/{index-J8MrpD0P.js → index-p7Qpxih7.js} +1 -1
- package/static/assets/{index-BFEMYO_w.js → index-q465oP8l.js} +1 -1
- package/static/assets/{info-D-7cQBbP.js → info-gGFJAYNn.js} +1 -1
- package/static/assets/{label-bMzKAcdZ.js → label-CSt-eWXG.js} +1 -1
- package/static/assets/{markdown-editor-B3gIcmI2.js → markdown-editor-C6ZusrL3.js} +3 -3
- package/static/assets/{message-square-Ca07XC8m.js → message-square-B-XWYk3x.js} +1 -1
- package/static/assets/{paperclip-BICwD8BW.js → paperclip-Drtxq0HD.js} +1 -1
- package/static/assets/{pause-CZwBxJjx.js → pause-fdtoI1yQ.js} +1 -1
- package/static/assets/{play-BjDbhEcg.js → play-BjJrEDlO.js} +1 -1
- package/static/assets/{radio-group-BpmJzTM1.js → radio-group-CLFgSQkD.js} +1 -1
- package/static/assets/{refresh-cw-CZLHY6zD.js → refresh-cw-DF2wDnWT.js} +1 -1
- package/static/assets/{search-Cz2_2BkO.js → search-CYS9xEgy.js} +1 -1
- package/static/assets/{select-9YyUa5YH.js → select-C7W_IjpH.js} +1 -1
- package/static/assets/{switch-Bhm5em7I.js → switch-CeUexKh7.js} +1 -1
- package/static/assets/{tabs-oeAz0IIg.js → tabs-CqVmSyiJ.js} +1 -1
- package/static/assets/{tag-D5LBbacJ.js → tag-Mob815Ck.js} +1 -1
- package/static/assets/{terminal-preview-BZXyNaM9.js → terminal-preview-Byv2z2nW.js} +1 -1
- package/static/assets/triangle-alert-DW7a6_v9.js +6 -0
- package/static/assets/{use-terminal-CSttRkql.js → use-terminal-CQe1dgj2.js} +1 -1
- package/static/assets/{video-D7SzAtAp.js → video-Ovebr1Iq.js} +1 -1
- package/static/index.html +2 -2
- package/static/assets/ActivityPage-DGW0f70r.js +0 -1
- package/static/assets/AgentsContextEditPage-CJbx9qwA.js +0 -9
- package/static/assets/AgentsContextPage-C1wcPVUs.js +0 -1
- package/static/assets/ApiKeysSettingsPage-Ceww_YUR.js +0 -2
- package/static/assets/ArchitectureEditPage-Dk8NNc4k.js +0 -15
- package/static/assets/ArchitecturePage-D0gLaPg5.js +0 -1
- package/static/assets/AuthSettingsPage-BHPV0uSB.js +0 -11
- package/static/assets/CallbackPage-buKCnkYC.js +0 -1
- package/static/assets/CodePage-x32C4yuN.js +0 -2
- package/static/assets/CollapsibleSection-DMf0wWjc.js +0 -1
- package/static/assets/DashboardPage-Dr4S3wVm.js +0 -41
- package/static/assets/GitPage-DpCcZosR.js +0 -16
- package/static/assets/GitSettingsPage-BRuP4Ihk.js +0 -6
- package/static/assets/IdentityPage-Bps9Zjk3.js +0 -6
- package/static/assets/ImplementationStepsEditor-KJkRc2Jn.js +0 -6
- package/static/assets/IntegrationsSettingsPage-CpTuAA-H.js +0 -1
- package/static/assets/JobDetailPage-BdYlGn4G.js +0 -1
- package/static/assets/JobDetailPage-C5N3IyX3.js +0 -1
- package/static/assets/KnowledgeDetailPage-Dy0M4FgC.js +0 -1
- package/static/assets/KnowledgeEditPage-DEP0bweP.js +0 -1
- package/static/assets/KnowledgePage-_bvnWXPU.js +0 -3
- package/static/assets/LoginPage-VfOnXGad.js +0 -1
- package/static/assets/MailInboxPage-DklkHMyO.js +0 -1
- package/static/assets/MailInboxPage-UF82OTOE.js +0 -1
- package/static/assets/MailProcessingModal-BHFYVTQc.js +0 -6
- package/static/assets/MailProcessingModal-rKHRB-wC.js +0 -6
- package/static/assets/MailReadPage-B-vLDq-6.js +0 -1
- package/static/assets/MailReadPage-mg3Wqvqh.js +0 -1
- package/static/assets/MailSentPage-OJeb1vU9.js +0 -1
- package/static/assets/McpSettingsPage-Mi2-nB-i.js +0 -1
- package/static/assets/MemoryEditPage-D8i7XQ5l.js +0 -13
- package/static/assets/MemoryPage-vbCtMG4L.js +0 -1
- package/static/assets/NewKnowledgePage-CL3dpMwb.js +0 -1
- package/static/assets/NewSkillPage-BCJ68pFK.js +0 -1
- package/static/assets/NewTaskPage-vj0LvAb_.js +0 -91
- package/static/assets/NotFoundPage-DqwQiMc8.js +0 -6
- package/static/assets/NotificationsSettingsPage-BSuXKPiG.js +0 -1
- package/static/assets/ProjectEditPage-ia6zDqUf.js +0 -11
- package/static/assets/ProjectPage-DJ5wGekX.js +0 -1
- package/static/assets/PromptsSettingsPage-COjiXPsT.js +0 -1
- package/static/assets/ResourceDetailPage-DJN3Rax4.js +0 -1
- package/static/assets/ResourcesPage-DF8x1i_a.js +0 -41
- package/static/assets/RoleEditPage-CBl-M2s3.js +0 -13
- package/static/assets/RolePage-IVBtcgCf.js +0 -1
- package/static/assets/RulesSettingsPage-CKUt1JkO.js +0 -16
- package/static/assets/SchedulePage-TCeGDlnw.js +0 -4
- package/static/assets/SchedulePage-_NAbasKs.js +0 -4
- package/static/assets/SkillDetailPage-jTeSohec.js +0 -1
- package/static/assets/SkillEditPage-D_e69AQk.js +0 -1
- package/static/assets/SkillsPage-xfv43oJ4.js +0 -8
- package/static/assets/SkillsSettingsPage-jhNVgVSA.js +0 -1
- package/static/assets/SourceInput-KeAQ1PMl.js +0 -1
- package/static/assets/TagInput-ZyP8Rq8B.js +0 -1
- package/static/assets/TaskDetailPage-z557zwfE.js +0 -16
- package/static/assets/TaskEditPage-XuWzVm-k.js +0 -1
- package/static/assets/TasksPage-CwfLwTAV.js +0 -17
- package/static/assets/TeamEditPage-Dk7Yxh1i.js +0 -9
- package/static/assets/TeamPage-Dmrjf_RA.js +0 -1
- package/static/assets/TerminalPage-Y59DZGfZ.js +0 -1
- package/static/assets/TerminalSessionPage-HvnYJEpU.js +0 -3
- package/static/assets/UserPreferencesPage-BSIvW5UI.js +0 -1
- package/static/assets/UserSettingsPage-o4ikmR9k.js +0 -1
- package/static/assets/UtilitiesPage-O5kjW0V2.js +0 -1
- package/static/assets/alert-u79hLEuY.js +0 -1
- package/static/assets/arrow-down-Y539lEoZ.js +0 -6
- package/static/assets/arrow-left-DmNgC0xD.js +0 -6
- package/static/assets/arrow-up-BbDrY9nh.js +0 -6
- package/static/assets/arrow-up-down-DDTTwJEF.js +0 -6
- package/static/assets/badge-BzEwwrAP.js +0 -1
- package/static/assets/browser-modal-CY4F-Mm8.js +0 -6
- package/static/assets/card-Btt3HmXT.js +0 -1
- package/static/assets/chevron-left-DztJMlwc.js +0 -6
- package/static/assets/chevron-up-gnoSEbf_.js +0 -6
- package/static/assets/chevrons-up-D7gsSI9g.js +0 -11
- package/static/assets/circle-alert-Coa2ulVd.js +0 -6
- package/static/assets/circle-check-C9wy7OAO.js +0 -6
- package/static/assets/circle-check-big-DqKKs8fZ.js +0 -6
- package/static/assets/circle-play-DoomwgYb.js +0 -6
- package/static/assets/circle-x-Du7Cp5MD.js +0 -6
- package/static/assets/clipboard-CqRqQoij.js +0 -11
- package/static/assets/clock-ehUSUqcI.js +0 -6
- package/static/assets/code-kQPD6ttp.js +0 -6
- package/static/assets/download-D8TKj0Hc.js +0 -6
- package/static/assets/external-link-BVrPPG_7.js +0 -6
- package/static/assets/eye-DWC_Vybx.js +0 -6
- package/static/assets/folder-git-2-Ds9p-D0Q.js +0 -6
- package/static/assets/globe-DwQuaM7_.js +0 -6
- package/static/assets/index-0sq0wwbr.js +0 -1
- package/static/assets/index-B0Cea36W.js +0 -1
- package/static/assets/index-B0g-CMWG.js +0 -1
- package/static/assets/index-BFevJCwl.js +0 -1
- package/static/assets/index-BK1-hIKa.js +0 -1
- package/static/assets/index-BlyysfDZ.js +0 -7
- package/static/assets/index-Bpm_mSd3.js +0 -2
- package/static/assets/index-Bvj_HZmE.js +0 -1
- package/static/assets/index-CE8kBKLn.js +0 -1
- package/static/assets/index-C_KCaLlP.js +0 -502
- package/static/assets/index-CfcUrE_I.js +0 -1
- package/static/assets/index-CisT9m8F.js +0 -3
- package/static/assets/index-DEmcF6vO.js +0 -1
- package/static/assets/index-DYBGl9Zy.js +0 -1
- package/static/assets/index-Dih0CGHs.js +0 -1
- package/static/assets/index-DvviZzdo.js +0 -1
- package/static/assets/index-NgkIT4SV.js +0 -1
- package/static/assets/index-PBkZiuRI.js +0 -1
- package/static/assets/index-oRAlpULD.css +0 -1
- package/static/assets/index-opozMhku.js +0 -502
- package/static/assets/index-wmWBSeOM.js +0 -1
- package/static/assets/info-NEnL4zqX.js +0 -6
- package/static/assets/label-wtSCiOqT.js +0 -1
- package/static/assets/markdown-editor-D_er7zWv.js +0 -111
- package/static/assets/message-square-CvZFZAL0.js +0 -6
- package/static/assets/paperclip-D9bkHCO9.js +0 -6
- package/static/assets/pause-DrtOMeDr.js +0 -6
- package/static/assets/play-CQk31OJN.js +0 -6
- package/static/assets/radio-group-DqCmfTij.js +0 -1
- package/static/assets/refresh-cw-yMcSYdEF.js +0 -6
- package/static/assets/search-_5ueAoCg.js +0 -6
- package/static/assets/select-BKdFrV6O.js +0 -1
- package/static/assets/switch-D7e1drXt.js +0 -1
- package/static/assets/tabs-qMSIjEoX.js +0 -1
- package/static/assets/tag-dBrNwRvH.js +0 -6
- package/static/assets/terminal-preview-C3WCC5tV.js +0 -1
- package/static/assets/use-terminal-FzuSKCnc.js +0 -1
- package/static/assets/video-DKqt_ev6.js +0 -36
|
@@ -7,7 +7,7 @@ import { ZodError } from 'zod';
|
|
|
7
7
|
import { streamText, tool, jsonSchema, stepCountIs } from 'ai';
|
|
8
8
|
import { createAnthropic } from '@ai-sdk/anthropic';
|
|
9
9
|
import { getLogsDir, listTasks, getTask, createTask, updateTask, deleteTask, } from '@lovelybunch/core';
|
|
10
|
-
import { tasksFullTool, knowledgeTool, normalizeKnowledgeMetadata, eventsTool,
|
|
10
|
+
import { tasksFullTool, knowledgeTool, normalizeKnowledgeMetadata, eventsTool, roleContextTool, agentsContextTool, teamContextTool, memoryContextTool, resourcesTool, listConnectorsTool, connectorRequestTool, resolveConnectorUrl } from '@lovelybunch/mcp';
|
|
11
11
|
import matter from 'gray-matter';
|
|
12
12
|
import Fuse from 'fuse.js';
|
|
13
13
|
import { FileStorageAdapter } from '../../../../lib/storage/file-storage.js';
|
|
@@ -120,27 +120,35 @@ export async function POST(c) {
|
|
|
120
120
|
return JSON.stringify(result);
|
|
121
121
|
},
|
|
122
122
|
}),
|
|
123
|
-
|
|
124
|
-
description:
|
|
125
|
-
inputSchema: jsonSchema(
|
|
123
|
+
role_context: tool({
|
|
124
|
+
description: roleContextTool.description,
|
|
125
|
+
inputSchema: jsonSchema(roleContextTool.parameters),
|
|
126
126
|
execute: async (args) => {
|
|
127
|
-
const result = await
|
|
127
|
+
const result = await executeRoleContextToolDirect(args);
|
|
128
128
|
return JSON.stringify(result);
|
|
129
129
|
},
|
|
130
130
|
}),
|
|
131
|
-
|
|
132
|
-
description:
|
|
133
|
-
inputSchema: jsonSchema(
|
|
131
|
+
agents_context: tool({
|
|
132
|
+
description: agentsContextTool.description,
|
|
133
|
+
inputSchema: jsonSchema(agentsContextTool.parameters),
|
|
134
134
|
execute: async (args) => {
|
|
135
|
-
const result = await
|
|
135
|
+
const result = await executeAgentsContextToolDirect(args);
|
|
136
136
|
return JSON.stringify(result);
|
|
137
137
|
},
|
|
138
138
|
}),
|
|
139
|
-
|
|
140
|
-
description:
|
|
141
|
-
inputSchema: jsonSchema(
|
|
139
|
+
team_context: tool({
|
|
140
|
+
description: teamContextTool.description,
|
|
141
|
+
inputSchema: jsonSchema(teamContextTool.parameters),
|
|
142
142
|
execute: async (args) => {
|
|
143
|
-
const result = await
|
|
143
|
+
const result = await executeTeamContextToolDirect(args);
|
|
144
|
+
return JSON.stringify(result);
|
|
145
|
+
},
|
|
146
|
+
}),
|
|
147
|
+
memory_context: tool({
|
|
148
|
+
description: memoryContextTool.description,
|
|
149
|
+
inputSchema: jsonSchema(memoryContextTool.parameters),
|
|
150
|
+
execute: async (args) => {
|
|
151
|
+
const result = await executeMemoryContextToolDirect(args);
|
|
144
152
|
return JSON.stringify(result);
|
|
145
153
|
},
|
|
146
154
|
}),
|
|
@@ -537,12 +545,12 @@ async function executeEventsToolDirect(args) {
|
|
|
537
545
|
return { success: false, error: error.message || 'Events tool execution failed' };
|
|
538
546
|
}
|
|
539
547
|
}
|
|
540
|
-
//
|
|
541
|
-
async function
|
|
548
|
+
// Role context tool - read/write the role definition document
|
|
549
|
+
async function executeRoleContextToolDirect(args) {
|
|
542
550
|
const { operation, content, old_text, new_text } = args;
|
|
543
551
|
try {
|
|
544
552
|
const contextPath = getContextBasePath();
|
|
545
|
-
const filePath = join(contextPath, '
|
|
553
|
+
const filePath = join(contextPath, 'role.md');
|
|
546
554
|
switch (operation) {
|
|
547
555
|
case 'get': {
|
|
548
556
|
try {
|
|
@@ -555,7 +563,7 @@ async function executeProjectContextToolDirect(args) {
|
|
|
555
563
|
frontmatter: parsed.data,
|
|
556
564
|
raw: fileContent
|
|
557
565
|
},
|
|
558
|
-
message: 'Retrieved
|
|
566
|
+
message: 'Retrieved role context'
|
|
559
567
|
};
|
|
560
568
|
}
|
|
561
569
|
catch (err) {
|
|
@@ -563,7 +571,7 @@ async function executeProjectContextToolDirect(args) {
|
|
|
563
571
|
return {
|
|
564
572
|
success: true,
|
|
565
573
|
data: { content: '', frontmatter: {}, raw: '' },
|
|
566
|
-
message: '
|
|
574
|
+
message: 'Role context document does not exist yet. You can create it with an update operation.'
|
|
567
575
|
};
|
|
568
576
|
}
|
|
569
577
|
throw err;
|
|
@@ -590,7 +598,7 @@ async function executeProjectContextToolDirect(args) {
|
|
|
590
598
|
await fs.writeFile(filePath, newContent, 'utf-8');
|
|
591
599
|
return {
|
|
592
600
|
success: true,
|
|
593
|
-
message: 'Appended content to
|
|
601
|
+
message: 'Appended content to role context document'
|
|
594
602
|
};
|
|
595
603
|
}
|
|
596
604
|
case 'replace_section': {
|
|
@@ -604,7 +612,7 @@ async function executeProjectContextToolDirect(args) {
|
|
|
604
612
|
}
|
|
605
613
|
catch (err) {
|
|
606
614
|
if (err.code === 'ENOENT') {
|
|
607
|
-
return { success: false, error: '
|
|
615
|
+
return { success: false, error: 'Role context document does not exist. Use append or update to create it first.' };
|
|
608
616
|
}
|
|
609
617
|
throw err;
|
|
610
618
|
}
|
|
@@ -614,7 +622,7 @@ async function executeProjectContextToolDirect(args) {
|
|
|
614
622
|
success: false,
|
|
615
623
|
error: 'Could not find the specified text in the document. The text may have been paraphrased or changed.',
|
|
616
624
|
fallback_markdown: new_text,
|
|
617
|
-
suggestion: 'Here is the replacement text. You can copy it and manually edit the document at /context/
|
|
625
|
+
suggestion: 'Here is the replacement text. You can copy it and manually edit the document at /context/role'
|
|
618
626
|
};
|
|
619
627
|
}
|
|
620
628
|
// Replace the text
|
|
@@ -622,7 +630,7 @@ async function executeProjectContextToolDirect(args) {
|
|
|
622
630
|
await fs.writeFile(filePath, updatedContent, 'utf-8');
|
|
623
631
|
return {
|
|
624
632
|
success: true,
|
|
625
|
-
message: 'Replaced section in
|
|
633
|
+
message: 'Replaced section in role context document'
|
|
626
634
|
};
|
|
627
635
|
}
|
|
628
636
|
case 'update': {
|
|
@@ -633,7 +641,7 @@ async function executeProjectContextToolDirect(args) {
|
|
|
633
641
|
await fs.writeFile(filePath, content, 'utf-8');
|
|
634
642
|
return {
|
|
635
643
|
success: true,
|
|
636
|
-
message: 'Updated
|
|
644
|
+
message: 'Updated role context document'
|
|
637
645
|
};
|
|
638
646
|
}
|
|
639
647
|
default:
|
|
@@ -641,124 +649,28 @@ async function executeProjectContextToolDirect(args) {
|
|
|
641
649
|
}
|
|
642
650
|
}
|
|
643
651
|
catch (error) {
|
|
644
|
-
console.error('Error executing
|
|
645
|
-
return { success: false, error: error.message || '
|
|
652
|
+
console.error('Error executing role context tool:', error);
|
|
653
|
+
return { success: false, error: error.message || 'Role context tool execution failed' };
|
|
646
654
|
}
|
|
647
655
|
}
|
|
648
|
-
//
|
|
649
|
-
async function
|
|
650
|
-
|
|
651
|
-
try {
|
|
652
|
-
const contextPath = getContextBasePath();
|
|
653
|
-
const filePath = join(contextPath, 'architecture.md');
|
|
654
|
-
switch (operation) {
|
|
655
|
-
case 'get': {
|
|
656
|
-
try {
|
|
657
|
-
const fileContent = await fs.readFile(filePath, 'utf-8');
|
|
658
|
-
const parsed = matter(fileContent);
|
|
659
|
-
return {
|
|
660
|
-
success: true,
|
|
661
|
-
data: {
|
|
662
|
-
content: parsed.content,
|
|
663
|
-
frontmatter: parsed.data,
|
|
664
|
-
raw: fileContent
|
|
665
|
-
},
|
|
666
|
-
message: 'Retrieved architecture context'
|
|
667
|
-
};
|
|
668
|
-
}
|
|
669
|
-
catch (err) {
|
|
670
|
-
if (err.code === 'ENOENT') {
|
|
671
|
-
return {
|
|
672
|
-
success: true,
|
|
673
|
-
data: { content: '', frontmatter: {}, raw: '' },
|
|
674
|
-
message: 'Architecture context document does not exist yet. You can create it with an update operation.'
|
|
675
|
-
};
|
|
676
|
-
}
|
|
677
|
-
throw err;
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
case 'append': {
|
|
681
|
-
if (!content) {
|
|
682
|
-
return { success: false, error: 'Content is required for append operation' };
|
|
683
|
-
}
|
|
684
|
-
await fs.mkdir(contextPath, { recursive: true });
|
|
685
|
-
// Read existing content if file exists
|
|
686
|
-
let existingContent = '';
|
|
687
|
-
try {
|
|
688
|
-
existingContent = await fs.readFile(filePath, 'utf-8');
|
|
689
|
-
}
|
|
690
|
-
catch (err) {
|
|
691
|
-
if (err.code !== 'ENOENT')
|
|
692
|
-
throw err;
|
|
693
|
-
}
|
|
694
|
-
// Append new content with a newline separator
|
|
695
|
-
const newContent = existingContent
|
|
696
|
-
? existingContent.trimEnd() + '\n\n' + content
|
|
697
|
-
: content;
|
|
698
|
-
await fs.writeFile(filePath, newContent, 'utf-8');
|
|
699
|
-
return {
|
|
700
|
-
success: true,
|
|
701
|
-
message: 'Appended content to architecture context document'
|
|
702
|
-
};
|
|
703
|
-
}
|
|
704
|
-
case 'replace_section': {
|
|
705
|
-
if (!old_text || !new_text) {
|
|
706
|
-
return { success: false, error: 'Both old_text and new_text are required for replace_section operation' };
|
|
707
|
-
}
|
|
708
|
-
// Read existing content
|
|
709
|
-
let existingContent = '';
|
|
710
|
-
try {
|
|
711
|
-
existingContent = await fs.readFile(filePath, 'utf-8');
|
|
712
|
-
}
|
|
713
|
-
catch (err) {
|
|
714
|
-
if (err.code === 'ENOENT') {
|
|
715
|
-
return { success: false, error: 'Architecture context document does not exist. Use append or update to create it first.' };
|
|
716
|
-
}
|
|
717
|
-
throw err;
|
|
718
|
-
}
|
|
719
|
-
// Check if old_text exists in the document
|
|
720
|
-
if (!existingContent.includes(old_text)) {
|
|
721
|
-
return {
|
|
722
|
-
success: false,
|
|
723
|
-
error: 'Could not find the specified text in the document. The text may have been paraphrased or changed.',
|
|
724
|
-
fallback_markdown: new_text,
|
|
725
|
-
suggestion: 'Here is the replacement text. You can copy it and manually edit the document at /context/architecture'
|
|
726
|
-
};
|
|
727
|
-
}
|
|
728
|
-
// Replace the text
|
|
729
|
-
const updatedContent = existingContent.replace(old_text, new_text);
|
|
730
|
-
await fs.writeFile(filePath, updatedContent, 'utf-8');
|
|
731
|
-
return {
|
|
732
|
-
success: true,
|
|
733
|
-
message: 'Replaced section in architecture context document'
|
|
734
|
-
};
|
|
735
|
-
}
|
|
736
|
-
case 'update': {
|
|
737
|
-
if (!content) {
|
|
738
|
-
return { success: false, error: 'Content is required for update operation' };
|
|
739
|
-
}
|
|
740
|
-
await fs.mkdir(contextPath, { recursive: true });
|
|
741
|
-
await fs.writeFile(filePath, content, 'utf-8');
|
|
742
|
-
return {
|
|
743
|
-
success: true,
|
|
744
|
-
message: 'Updated architecture context document'
|
|
745
|
-
};
|
|
746
|
-
}
|
|
747
|
-
default:
|
|
748
|
-
return { success: false, error: `Unknown operation: ${operation}. Use 'get', 'append', 'replace_section', or 'update'.` };
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
catch (error) {
|
|
752
|
-
console.error('Error executing architecture context tool:', error);
|
|
753
|
-
return { success: false, error: error.message || 'Architecture context tool execution failed' };
|
|
754
|
-
}
|
|
656
|
+
// Agents context tool - read/write the agents definition document
|
|
657
|
+
async function executeAgentsContextToolDirect(args) {
|
|
658
|
+
return executeGenericContextToolDirect('agents', args);
|
|
755
659
|
}
|
|
756
|
-
//
|
|
757
|
-
async function
|
|
660
|
+
// Team context tool - read/write the team definition document
|
|
661
|
+
async function executeTeamContextToolDirect(args) {
|
|
662
|
+
return executeGenericContextToolDirect('team', args);
|
|
663
|
+
}
|
|
664
|
+
// Memory context tool - read/write the memory document
|
|
665
|
+
async function executeMemoryContextToolDirect(args) {
|
|
666
|
+
return executeGenericContextToolDirect('memory', args);
|
|
667
|
+
}
|
|
668
|
+
async function executeGenericContextToolDirect(contextType, args) {
|
|
758
669
|
const { operation, content, old_text, new_text } = args;
|
|
670
|
+
const label = contextType.charAt(0).toUpperCase() + contextType.slice(1);
|
|
759
671
|
try {
|
|
760
672
|
const contextPath = getContextBasePath();
|
|
761
|
-
const filePath = join(contextPath,
|
|
673
|
+
const filePath = join(contextPath, `${contextType}.md`);
|
|
762
674
|
switch (operation) {
|
|
763
675
|
case 'get': {
|
|
764
676
|
try {
|
|
@@ -771,7 +683,7 @@ async function executeRoleContextToolDirect(args) {
|
|
|
771
683
|
frontmatter: parsed.data,
|
|
772
684
|
raw: fileContent
|
|
773
685
|
},
|
|
774
|
-
message:
|
|
686
|
+
message: `Retrieved ${contextType} context`
|
|
775
687
|
};
|
|
776
688
|
}
|
|
777
689
|
catch (err) {
|
|
@@ -779,7 +691,7 @@ async function executeRoleContextToolDirect(args) {
|
|
|
779
691
|
return {
|
|
780
692
|
success: true,
|
|
781
693
|
data: { content: '', frontmatter: {}, raw: '' },
|
|
782
|
-
message:
|
|
694
|
+
message: `${label} context document does not exist yet. You can create it with an update operation.`
|
|
783
695
|
};
|
|
784
696
|
}
|
|
785
697
|
throw err;
|
|
@@ -790,7 +702,6 @@ async function executeRoleContextToolDirect(args) {
|
|
|
790
702
|
return { success: false, error: 'Content is required for append operation' };
|
|
791
703
|
}
|
|
792
704
|
await fs.mkdir(contextPath, { recursive: true });
|
|
793
|
-
// Read existing content if file exists
|
|
794
705
|
let existingContent = '';
|
|
795
706
|
try {
|
|
796
707
|
existingContent = await fs.readFile(filePath, 'utf-8');
|
|
@@ -799,46 +710,42 @@ async function executeRoleContextToolDirect(args) {
|
|
|
799
710
|
if (err.code !== 'ENOENT')
|
|
800
711
|
throw err;
|
|
801
712
|
}
|
|
802
|
-
// Append new content with a newline separator
|
|
803
713
|
const newContent = existingContent
|
|
804
714
|
? existingContent.trimEnd() + '\n\n' + content
|
|
805
715
|
: content;
|
|
806
716
|
await fs.writeFile(filePath, newContent, 'utf-8');
|
|
807
717
|
return {
|
|
808
718
|
success: true,
|
|
809
|
-
message:
|
|
719
|
+
message: `Appended content to ${contextType} context document`
|
|
810
720
|
};
|
|
811
721
|
}
|
|
812
722
|
case 'replace_section': {
|
|
813
723
|
if (!old_text || !new_text) {
|
|
814
724
|
return { success: false, error: 'Both old_text and new_text are required for replace_section operation' };
|
|
815
725
|
}
|
|
816
|
-
// Read existing content
|
|
817
726
|
let existingContent = '';
|
|
818
727
|
try {
|
|
819
728
|
existingContent = await fs.readFile(filePath, 'utf-8');
|
|
820
729
|
}
|
|
821
730
|
catch (err) {
|
|
822
731
|
if (err.code === 'ENOENT') {
|
|
823
|
-
return { success: false, error:
|
|
732
|
+
return { success: false, error: `${label} context document does not exist. Use append or update to create it first.` };
|
|
824
733
|
}
|
|
825
734
|
throw err;
|
|
826
735
|
}
|
|
827
|
-
// Check if old_text exists in the document
|
|
828
736
|
if (!existingContent.includes(old_text)) {
|
|
829
737
|
return {
|
|
830
738
|
success: false,
|
|
831
739
|
error: 'Could not find the specified text in the document. The text may have been paraphrased or changed.',
|
|
832
740
|
fallback_markdown: new_text,
|
|
833
|
-
suggestion:
|
|
741
|
+
suggestion: `Here is the replacement text. You can copy it and manually edit the document at /context/${contextType}`
|
|
834
742
|
};
|
|
835
743
|
}
|
|
836
|
-
// Replace the text
|
|
837
744
|
const updatedContent = existingContent.replace(old_text, new_text);
|
|
838
745
|
await fs.writeFile(filePath, updatedContent, 'utf-8');
|
|
839
746
|
return {
|
|
840
747
|
success: true,
|
|
841
|
-
message:
|
|
748
|
+
message: `Replaced section in ${contextType} context document`
|
|
842
749
|
};
|
|
843
750
|
}
|
|
844
751
|
case 'update': {
|
|
@@ -849,7 +756,7 @@ async function executeRoleContextToolDirect(args) {
|
|
|
849
756
|
await fs.writeFile(filePath, content, 'utf-8');
|
|
850
757
|
return {
|
|
851
758
|
success: true,
|
|
852
|
-
message:
|
|
759
|
+
message: `Updated ${contextType} context document`
|
|
853
760
|
};
|
|
854
761
|
}
|
|
855
762
|
default:
|
|
@@ -857,8 +764,8 @@ async function executeRoleContextToolDirect(args) {
|
|
|
857
764
|
}
|
|
858
765
|
}
|
|
859
766
|
catch (error) {
|
|
860
|
-
console.error(
|
|
861
|
-
return { success: false, error: error.message ||
|
|
767
|
+
console.error(`Error executing ${contextType} context tool:`, error);
|
|
768
|
+
return { success: false, error: error.message || `${label} context tool execution failed` };
|
|
862
769
|
}
|
|
863
770
|
}
|
|
864
771
|
// ─── Resources Tool ─────────────────────────────────────────────────────────
|
|
@@ -33,23 +33,20 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
|
|
|
33
33
|
lastRunAt?: string;
|
|
34
34
|
nextRunAt?: string;
|
|
35
35
|
};
|
|
36
|
+
tags?: string[];
|
|
37
|
+
contextPaths?: string[];
|
|
38
|
+
agentId?: string;
|
|
39
|
+
agentIds?: string[];
|
|
40
|
+
mcpServers?: string[];
|
|
36
41
|
runs: {
|
|
37
42
|
id: string;
|
|
43
|
+
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
38
44
|
jobId: string;
|
|
39
45
|
trigger: import("@lovelybunch/types").ScheduledJobTrigger;
|
|
40
|
-
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
41
46
|
startedAt: string;
|
|
42
47
|
finishedAt?: string;
|
|
43
|
-
outputPath?: string;
|
|
44
|
-
summary?: string;
|
|
45
48
|
error?: string;
|
|
46
|
-
cliCommand?: string;
|
|
47
49
|
}[];
|
|
48
|
-
tags?: string[];
|
|
49
|
-
contextPaths?: string[];
|
|
50
|
-
agentId?: string;
|
|
51
|
-
agentIds?: string[];
|
|
52
|
-
mcpServers?: string[];
|
|
53
50
|
};
|
|
54
51
|
}, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
|
|
55
52
|
success: false;
|
|
@@ -97,23 +94,20 @@ export declare function PATCH(c: Context): Promise<(Response & import("hono").Ty
|
|
|
97
94
|
lastRunAt?: string;
|
|
98
95
|
nextRunAt?: string;
|
|
99
96
|
};
|
|
97
|
+
tags?: string[];
|
|
98
|
+
contextPaths?: string[];
|
|
99
|
+
agentId?: string;
|
|
100
|
+
agentIds?: string[];
|
|
101
|
+
mcpServers?: string[];
|
|
100
102
|
runs: {
|
|
101
103
|
id: string;
|
|
104
|
+
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
102
105
|
jobId: string;
|
|
103
106
|
trigger: import("@lovelybunch/types").ScheduledJobTrigger;
|
|
104
|
-
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
105
107
|
startedAt: string;
|
|
106
108
|
finishedAt?: string;
|
|
107
|
-
outputPath?: string;
|
|
108
|
-
summary?: string;
|
|
109
109
|
error?: string;
|
|
110
|
-
cliCommand?: string;
|
|
111
110
|
}[];
|
|
112
|
-
tags?: string[];
|
|
113
|
-
contextPaths?: string[];
|
|
114
|
-
agentId?: string;
|
|
115
|
-
agentIds?: string[];
|
|
116
|
-
mcpServers?: string[];
|
|
117
111
|
};
|
|
118
112
|
}, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
|
|
119
113
|
success: false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JobStore } from '../../../../../lib/jobs/job-store.js';
|
|
2
2
|
import { getGlobalJobScheduler } from '../../../../../lib/jobs/global-job-scheduler.js';
|
|
3
|
-
import { normalizeSchedule, normalizeStatus, } from '../route.js';
|
|
3
|
+
import { normalizeSchedule, normalizeStatus, withLightweightRuns, } from '../route.js';
|
|
4
4
|
const store = new JobStore();
|
|
5
5
|
const scheduler = getGlobalJobScheduler();
|
|
6
6
|
function normalizeScheduleUpdate(current, incoming) {
|
|
@@ -32,7 +32,7 @@ export async function GET(c) {
|
|
|
32
32
|
}
|
|
33
33
|
}, 404);
|
|
34
34
|
}
|
|
35
|
-
return c.json({ success: true, data: job });
|
|
35
|
+
return c.json({ success: true, data: withLightweightRuns(job) });
|
|
36
36
|
}
|
|
37
37
|
catch (error) {
|
|
38
38
|
console.error('Failed to fetch job:', error);
|
|
@@ -101,7 +101,7 @@ export async function PATCH(c) {
|
|
|
101
101
|
const reloaded = await store.getJob(updated.id);
|
|
102
102
|
return c.json({
|
|
103
103
|
success: true,
|
|
104
|
-
data: reloaded ?? updated
|
|
104
|
+
data: withLightweightRuns(reloaded ?? updated)
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
catch (error) {
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { Context } from 'hono';
|
|
2
|
-
import { DayOfWeek, ScheduledJobSchedule, ScheduledJobStatus } from '@lovelybunch/types';
|
|
2
|
+
import { DayOfWeek, ScheduledJobRun, ScheduledJobRunMeta, ScheduledJobSchedule, ScheduledJobStatus } from '@lovelybunch/types';
|
|
3
3
|
export declare function normalizeSchedule(schedule?: Partial<ScheduledJobSchedule>): ScheduledJobSchedule;
|
|
4
4
|
export declare function normalizeStatus(status?: ScheduledJobStatus): ScheduledJobStatus;
|
|
5
|
+
export declare function toRunMeta(run: ScheduledJobRun): ScheduledJobRunMeta;
|
|
6
|
+
export declare function withLightweightRuns<T extends {
|
|
7
|
+
runs: ScheduledJobRun[];
|
|
8
|
+
}>(job: T): Omit<T, 'runs'> & {
|
|
9
|
+
runs: ScheduledJobRunMeta[];
|
|
10
|
+
};
|
|
5
11
|
export declare function GET(c: Context): Promise<(Response & import("hono").TypedResponse<{
|
|
6
12
|
success: true;
|
|
7
13
|
data: {
|
|
@@ -29,23 +35,20 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
|
|
|
29
35
|
lastRunAt?: string;
|
|
30
36
|
nextRunAt?: string;
|
|
31
37
|
};
|
|
38
|
+
tags?: string[];
|
|
39
|
+
contextPaths?: string[];
|
|
40
|
+
agentId?: string;
|
|
41
|
+
agentIds?: string[];
|
|
42
|
+
mcpServers?: string[];
|
|
32
43
|
runs: {
|
|
33
44
|
id: string;
|
|
45
|
+
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
34
46
|
jobId: string;
|
|
35
47
|
trigger: import("@lovelybunch/types").ScheduledJobTrigger;
|
|
36
|
-
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
37
48
|
startedAt: string;
|
|
38
49
|
finishedAt?: string;
|
|
39
|
-
outputPath?: string;
|
|
40
|
-
summary?: string;
|
|
41
50
|
error?: string;
|
|
42
|
-
cliCommand?: string;
|
|
43
51
|
}[];
|
|
44
|
-
tags?: string[];
|
|
45
|
-
contextPaths?: string[];
|
|
46
|
-
agentId?: string;
|
|
47
|
-
agentIds?: string[];
|
|
48
|
-
mcpServers?: string[];
|
|
49
52
|
}[];
|
|
50
53
|
}, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
|
|
51
54
|
success: false;
|
|
@@ -87,23 +90,20 @@ export declare function POST(c: Context): Promise<(Response & import("hono").Typ
|
|
|
87
90
|
lastRunAt?: string;
|
|
88
91
|
nextRunAt?: string;
|
|
89
92
|
};
|
|
93
|
+
tags?: string[];
|
|
94
|
+
contextPaths?: string[];
|
|
95
|
+
agentId?: string;
|
|
96
|
+
agentIds?: string[];
|
|
97
|
+
mcpServers?: string[];
|
|
90
98
|
runs: {
|
|
91
99
|
id: string;
|
|
100
|
+
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
92
101
|
jobId: string;
|
|
93
102
|
trigger: import("@lovelybunch/types").ScheduledJobTrigger;
|
|
94
|
-
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
95
103
|
startedAt: string;
|
|
96
104
|
finishedAt?: string;
|
|
97
|
-
outputPath?: string;
|
|
98
|
-
summary?: string;
|
|
99
105
|
error?: string;
|
|
100
|
-
cliCommand?: string;
|
|
101
106
|
}[];
|
|
102
|
-
tags?: string[];
|
|
103
|
-
contextPaths?: string[];
|
|
104
|
-
agentId?: string;
|
|
105
|
-
agentIds?: string[];
|
|
106
|
-
mcpServers?: string[];
|
|
107
107
|
};
|
|
108
108
|
}, 201, "json">) | (Response & import("hono").TypedResponse<{
|
|
109
109
|
success: false;
|
|
@@ -58,12 +58,27 @@ export function normalizeSchedule(schedule) {
|
|
|
58
58
|
export function normalizeStatus(status) {
|
|
59
59
|
return status === 'active' ? 'active' : 'paused';
|
|
60
60
|
}
|
|
61
|
+
export function toRunMeta(run) {
|
|
62
|
+
return {
|
|
63
|
+
id: run.id,
|
|
64
|
+
jobId: run.jobId,
|
|
65
|
+
trigger: run.trigger,
|
|
66
|
+
status: run.status,
|
|
67
|
+
startedAt: run.startedAt,
|
|
68
|
+
finishedAt: run.finishedAt,
|
|
69
|
+
error: run.error,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export function withLightweightRuns(job) {
|
|
73
|
+
const { runs, ...rest } = job;
|
|
74
|
+
return { ...rest, runs: runs.map(toRunMeta) };
|
|
75
|
+
}
|
|
61
76
|
export async function GET(c) {
|
|
62
77
|
try {
|
|
63
78
|
const jobs = await store.listJobs();
|
|
64
79
|
return c.json({
|
|
65
80
|
success: true,
|
|
66
|
-
data: jobs
|
|
81
|
+
data: jobs.map(withLightweightRuns)
|
|
67
82
|
});
|
|
68
83
|
}
|
|
69
84
|
catch (error) {
|
|
@@ -131,7 +146,7 @@ export async function POST(c) {
|
|
|
131
146
|
const created = await store.getJob(job.id);
|
|
132
147
|
return c.json({
|
|
133
148
|
success: true,
|
|
134
|
-
data: created ?? job
|
|
149
|
+
data: withLightweightRuns(created ?? job)
|
|
135
150
|
}, 201);
|
|
136
151
|
}
|
|
137
152
|
catch (error) {
|
|
@@ -3,7 +3,7 @@ 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,
|
|
6
|
+
import { tasksFullTool, knowledgeTool, normalizeKnowledgeMetadata, eventsTool, roleContextTool, agentsContextTool, teamContextTool, memoryContextTool, resourcesTool, listConnectorsTool, connectorRequestTool, resolveConnectorUrl } from '@lovelybunch/mcp';
|
|
7
7
|
import { FileStorageAdapter } from '../../../../lib/storage/file-storage.js';
|
|
8
8
|
import { homedir } from 'os';
|
|
9
9
|
import { readFileSync, existsSync } from 'fs';
|
|
@@ -104,14 +104,15 @@ app.get('/', async (c) => {
|
|
|
104
104
|
}
|
|
105
105
|
const names = Object.keys(externalServers);
|
|
106
106
|
// Add built-in tools (include full JSON schema for parameters)
|
|
107
|
-
// Note: tasks now supports full CRUD, knowledge/
|
|
107
|
+
// Note: tasks now supports full CRUD, knowledge/context tools are read+write, events is read-only
|
|
108
108
|
const builtInTools = {
|
|
109
109
|
tasks: tasksFullTool,
|
|
110
110
|
knowledge_documents: knowledgeTool,
|
|
111
111
|
activity_events: eventsTool,
|
|
112
|
-
project_context: projectContextTool,
|
|
113
|
-
architecture_context: architectureContextTool,
|
|
114
112
|
role_context: roleContextTool,
|
|
113
|
+
agents_context: agentsContextTool,
|
|
114
|
+
team_context: teamContextTool,
|
|
115
|
+
memory_context: memoryContextTool,
|
|
115
116
|
resources: resourcesTool,
|
|
116
117
|
list_connectors: listConnectorsTool,
|
|
117
118
|
connector_request: connectorRequestTool
|
|
@@ -134,15 +135,16 @@ app.get('/', async (c) => {
|
|
|
134
135
|
*/
|
|
135
136
|
app.get('/schema', async (c) => {
|
|
136
137
|
try {
|
|
137
|
-
// Note: tasks now supports full CRUD, knowledge/
|
|
138
|
+
// Note: tasks now supports full CRUD, knowledge/context tools are read+write, events is read-only
|
|
138
139
|
const schema = {
|
|
139
140
|
tools: {
|
|
140
141
|
tasks: tasksFullTool,
|
|
141
142
|
knowledge_documents: knowledgeTool,
|
|
142
143
|
activity_events: eventsTool,
|
|
143
|
-
project_context: projectContextTool,
|
|
144
|
-
architecture_context: architectureContextTool,
|
|
145
144
|
role_context: roleContextTool,
|
|
145
|
+
agents_context: agentsContextTool,
|
|
146
|
+
team_context: teamContextTool,
|
|
147
|
+
memory_context: memoryContextTool,
|
|
146
148
|
resources: resourcesTool,
|
|
147
149
|
list_connectors: listConnectorsTool,
|
|
148
150
|
connector_request: connectorRequestTool
|
|
@@ -174,15 +176,18 @@ app.post('/execute', async (c) => {
|
|
|
174
176
|
if (tool === 'activity_events') {
|
|
175
177
|
return await executeEventsTool(c, args);
|
|
176
178
|
}
|
|
177
|
-
if (tool === 'project_context') {
|
|
178
|
-
return await executeProjectContextTool(c, args);
|
|
179
|
-
}
|
|
180
|
-
if (tool === 'architecture_context') {
|
|
181
|
-
return await executeArchitectureContextTool(c, args);
|
|
182
|
-
}
|
|
183
179
|
if (tool === 'role_context') {
|
|
184
180
|
return await executeRoleContextTool(c, args);
|
|
185
181
|
}
|
|
182
|
+
if (tool === 'agents_context') {
|
|
183
|
+
return await executeAgentsContextTool(c, args);
|
|
184
|
+
}
|
|
185
|
+
if (tool === 'team_context') {
|
|
186
|
+
return await executeTeamContextTool(c, args);
|
|
187
|
+
}
|
|
188
|
+
if (tool === 'memory_context') {
|
|
189
|
+
return await executeMemoryContextTool(c, args);
|
|
190
|
+
}
|
|
186
191
|
if (tool === 'resources') {
|
|
187
192
|
return await executeResourcesTool(c, args);
|
|
188
193
|
}
|
|
@@ -482,15 +487,18 @@ async function executeContextTool(c, contextType, args) {
|
|
|
482
487
|
}
|
|
483
488
|
}
|
|
484
489
|
// Wrapper functions for each context type (maintain API compatibility)
|
|
485
|
-
async function executeProjectContextTool(c, args) {
|
|
486
|
-
return executeContextTool(c, 'project', args);
|
|
487
|
-
}
|
|
488
|
-
async function executeArchitectureContextTool(c, args) {
|
|
489
|
-
return executeContextTool(c, 'architecture', args);
|
|
490
|
-
}
|
|
491
490
|
async function executeRoleContextTool(c, args) {
|
|
492
491
|
return executeContextTool(c, 'role', args);
|
|
493
492
|
}
|
|
493
|
+
async function executeAgentsContextTool(c, args) {
|
|
494
|
+
return executeContextTool(c, 'agents', args);
|
|
495
|
+
}
|
|
496
|
+
async function executeTeamContextTool(c, args) {
|
|
497
|
+
return executeContextTool(c, 'team', args);
|
|
498
|
+
}
|
|
499
|
+
async function executeMemoryContextTool(c, args) {
|
|
500
|
+
return executeContextTool(c, 'memory', args);
|
|
501
|
+
}
|
|
494
502
|
// Resources tool executor — proxies to the resource API endpoints on the same server
|
|
495
503
|
async function executeResourcesTool(c, args) {
|
|
496
504
|
const { operation, query, type_filter, resource_id, prompt, model, aspect_ratio, text, voice, duration, resolution, url, tags, description } = args;
|