@lovelybunch/api 1.0.75-alpha.1 → 1.0.75-alpha.11
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.d.ts +5 -0
- package/dist/lib/auth/auth-manager.js +9 -0
- package/dist/lib/jobs/job-scheduler.js +21 -0
- package/dist/lib/mcp-client.d.ts +39 -0
- package/dist/lib/mcp-client.js +131 -0
- package/dist/lib/slack/slack-service.d.ts +2 -0
- package/dist/lib/slack/slack-service.js +3 -0
- package/dist/lib/storage/file-storage.d.ts +16 -16
- package/dist/lib/storage/file-storage.js +84 -79
- package/dist/lib/terminal/terminal-manager.d.ts +3 -5
- package/dist/lib/terminal/terminal-manager.js +19 -63
- package/dist/middleware/auth.js +36 -0
- package/dist/routes/api/v1/ai/index.js +0 -2
- package/dist/routes/api/v1/ai/route.js +445 -259
- package/dist/routes/api/v1/ai/tools.js +49 -232
- package/dist/routes/api/v1/chats/[id]/index.js +2 -1
- package/dist/routes/api/v1/chats/[id]/route.d.ts +7 -0
- package/dist/routes/api/v1/chats/[id]/route.js +30 -1
- package/dist/routes/api/v1/context/index.js +0 -2
- package/dist/routes/api/v1/events/route.js +1 -1
- package/dist/routes/api/v1/events/status/route.d.ts +1 -1
- package/dist/routes/api/v1/git/index.js +23 -0
- package/dist/routes/api/v1/jobs/[id]/run/route.d.ts +2 -2
- package/dist/routes/api/v1/jobs/[id]/runs/[runId]/route.d.ts +2 -2
- package/dist/routes/api/v1/jobs/status/route.d.ts +1 -1
- package/dist/routes/api/v1/knowledge/[filename]/index.d.ts +1 -0
- package/dist/routes/api/v1/knowledge/[filename]/index.js +1 -0
- package/dist/routes/api/v1/knowledge/[filename]/route.d.ts +3 -0
- package/dist/routes/api/v1/knowledge/[filename]/route.js +254 -0
- package/dist/routes/api/v1/knowledge/index.d.ts +1 -0
- package/dist/routes/api/v1/knowledge/index.js +1 -0
- package/dist/routes/api/v1/knowledge/route.d.ts +3 -0
- package/dist/routes/api/v1/knowledge/route.js +176 -0
- package/dist/routes/api/v1/mcp/index.js +109 -34
- package/dist/routes/api/v1/proposals/[id]/route.d.ts +2 -16
- 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/skills/[id]/index.d.ts +1 -0
- package/dist/routes/api/v1/skills/[id]/index.js +1 -0
- package/dist/routes/api/v1/skills/[id]/route.d.ts +3 -0
- package/dist/routes/api/v1/skills/[id]/route.js +199 -0
- package/dist/routes/api/v1/skills/index.d.ts +1 -0
- package/dist/routes/api/v1/skills/index.js +1 -0
- package/dist/routes/api/v1/skills/route.d.ts +3 -0
- package/dist/routes/api/v1/skills/route.js +329 -0
- package/dist/routes/api/v1/slack/index.d.ts +3 -0
- package/dist/routes/api/v1/slack/index.js +15 -0
- package/dist/routes/api/v1/slack/route.d.ts +124 -0
- package/dist/routes/api/v1/slack/route.js +192 -0
- package/dist/routes/api/v1/tasks/[id]/route.d.ts +351 -0
- package/dist/routes/api/v1/tasks/[id]/route.js +166 -0
- package/dist/routes/api/v1/tasks/index.d.ts +3 -0
- package/dist/routes/api/v1/tasks/index.js +10 -0
- package/dist/routes/api/v1/tasks/route.d.ts +329 -0
- package/dist/routes/api/v1/tasks/route.js +135 -0
- package/dist/routes/api/v1/terminal/[taskId]/create/index.d.ts +3 -0
- package/dist/routes/api/v1/terminal/[taskId]/create/index.js +5 -0
- package/dist/routes/api/v1/terminal/[taskId]/create/route.d.ts +10 -0
- package/dist/routes/api/v1/terminal/[taskId]/create/route.js +27 -0
- package/dist/routes/api/v1/terminal/[taskId]/destroy/index.d.ts +3 -0
- package/dist/routes/api/v1/terminal/[taskId]/destroy/index.js +5 -0
- package/dist/routes/api/v1/terminal/[taskId]/destroy/route.d.ts +10 -0
- package/dist/routes/api/v1/terminal/[taskId]/destroy/route.js +21 -0
- package/dist/routes/api/v1/terminal/[taskId]/resize/index.d.ts +3 -0
- package/dist/routes/api/v1/terminal/[taskId]/resize/index.js +5 -0
- package/dist/routes/api/v1/terminal/[taskId]/resize/route.d.ts +10 -0
- package/dist/routes/api/v1/terminal/[taskId]/resize/route.js +21 -0
- package/dist/routes/api/v1/terminal/sessions/route.js +4 -4
- package/dist/server-with-static.js +20 -14
- package/dist/server.js +17 -13
- package/package.json +8 -4
- package/static/assets/{ActivityPage-BYrDJlH6.js → ActivityPage-D2Zn5d46.js} +1 -1
- package/static/assets/ApiKeysSettingsPage-0lTMGFnh.js +2 -0
- package/static/assets/{ArchitectureEditPage-Bw2d_hmk.js → ArchitectureEditPage-D_zjOlNp.js} +4 -4
- package/static/assets/{ArchitecturePage-36wO0UD7.js → ArchitecturePage-Dl9wMPRA.js} +1 -1
- package/static/assets/{AuthSettingsPage-CKifiWsx.js → AuthSettingsPage-DN-0d5JC.js} +2 -2
- package/static/assets/{CallbackPage-Ck0dddEW.js → CallbackPage-pSUHwS6c.js} +1 -1
- package/static/assets/CodePage-BmEgabxr.js +2 -0
- package/static/assets/{CollapsibleSection-BKY-lfsm.js → CollapsibleSection-C1zNDYCh.js} +1 -1
- package/static/assets/DashboardPage-CdFJwMmF.js +41 -0
- package/static/assets/{GitPage-BgCxzm-C.js → GitPage-ANlhUZHS.js} +2 -2
- package/static/assets/GitSettingsPage-DNxK8DVa.js +6 -0
- package/static/assets/IdentityPage-9pFdjcFE.js +11 -0
- package/static/assets/{ImplementationStepsEditor-iqrCqyOb.js → ImplementationStepsEditor-DEHSnp5F.js} +2 -2
- package/static/assets/IntegrationsSettingsPage-CwkwL5dd.js +1 -0
- package/static/assets/JobDetailPage-BLlAzyE-.js +1 -0
- package/static/assets/KnowledgeDetailPage-CFJNJhhN.js +1 -0
- package/static/assets/KnowledgeEditPage-DVtiPXb_.js +1 -0
- package/static/assets/KnowledgePage-CuTDH9Bh.js +8 -0
- package/static/assets/{LoginPage-DqbNxfY6.js → LoginPage-3DBi_hwv.js} +1 -1
- package/static/assets/McpSettingsPage-BxHz335r.js +1 -0
- package/static/assets/NewKnowledgePage-9sB6TdTV.js +9 -0
- package/static/assets/NewSkillPage-BYBe6r4d.js +1 -0
- package/static/assets/NewTaskPage-BE5Yj7RD.js +90 -0
- package/static/assets/NotificationsSettingsPage-CPtkulC9.js +1 -0
- package/static/assets/ProjectEditPage-D9VtPWSD.js +11 -0
- package/static/assets/ProjectPage-Bk8hmnzz.js +1 -0
- package/static/assets/PromptsSettingsPage-B-Li6zb3.js +1 -0
- package/static/assets/ResourceDetailPage-Bn4NqBh7.js +1 -0
- package/static/assets/ResourcesPage-CbaDzx36.js +41 -0
- package/static/assets/{RoleEditPage-DhVneoNR.js → RoleEditPage-BljkqDbs.js} +1 -1
- package/static/assets/{RolePage-BOI2T8QG.js → RolePage-CDuVbr3S.js} +1 -1
- package/static/assets/{RulesSettingsPage-VsteFA-j.js → RulesSettingsPage-DtUPyjeR.js} +3 -3
- package/static/assets/SchedulePage-DEsE75St.js +4 -0
- package/static/assets/SkillDetailPage-BcISA93H.js +1 -0
- package/static/assets/SkillEditPage-BTEUvSu8.js +1 -0
- package/static/assets/SkillsPage-C6L7hMMN.js +8 -0
- package/static/assets/SkillsSettingsPage-Blc14fBy.js +1 -0
- package/static/assets/SourceInput-BtfMG5Wi.js +1 -0
- package/static/assets/{TagInput-BWLBdW8h.js → TagInput-DilIgbMg.js} +1 -1
- package/static/assets/TaskDetailPage-DEx9t61F.js +1 -0
- package/static/assets/TaskEditPage-tdpsj4yx.js +1 -0
- package/static/assets/TasksPage-DmLPtmET.js +17 -0
- package/static/assets/TerminalPage-A9Y67fNY.js +1 -0
- package/static/assets/TerminalSessionPage-CDqHiRaw.js +8 -0
- package/static/assets/UserPreferencesPage-DxUovKgK.js +1 -0
- package/static/assets/UserSettingsPage-1tv40FUQ.js +1 -0
- package/static/assets/UtilitiesPage-CrIhyr9_.js +1 -0
- package/static/assets/{alert-C7sSXJf0.js → alert-CXesMmyn.js} +1 -1
- package/static/assets/{arrow-down-DNa4SyO2.js → arrow-down-D9etuMoO.js} +1 -1
- package/static/assets/{arrow-left-DkoECaEJ.js → arrow-left-DkTfMrSs.js} +1 -1
- package/static/assets/{arrow-up-DQlu6uQE.js → arrow-up-DFr-vJJy.js} +1 -1
- package/static/assets/{badge-2ZOe5ynf.js → badge-HE5_fZGv.js} +1 -1
- package/static/assets/{browser-modal-DUCXGaha.js → browser-modal-88xCtQmC.js} +2 -2
- package/static/assets/{card-By4vbQ_f.js → card-B9S2Vx-U.js} +1 -1
- package/static/assets/{chevron-left-CJfNRqcH.js → chevron-left-B5rTh5xo.js} +1 -1
- package/static/assets/{plus-D0SUNNMH.js → chevron-up-CtmGm2DE.js} +2 -2
- package/static/assets/{chevrons-up-DoBrp0tt.js → chevrons-up-GjZHuxUC.js} +1 -1
- package/static/assets/{circle-alert-B4JJ0jKl.js → circle-alert-ZaSVIm5w.js} +1 -1
- package/static/assets/{circle-check-DC5Ek4MP.js → circle-check-OAMs0qqg.js} +1 -1
- package/static/assets/{circle-check-big-Dw4YJZos.js → circle-check-big-Csdz5GpZ.js} +1 -1
- package/static/assets/{circle-play-D9VS6Vdc.js → circle-play-DJyQPZbX.js} +1 -1
- package/static/assets/{circle-x-BReHgv4g.js → circle-x-DTr1fuxL.js} +1 -1
- package/static/assets/{clipboard-CuF9OlXN.js → clipboard-CwF3EWpN.js} +1 -1
- package/static/assets/{clock-CDTi2Cen.js → clock-e7nPzZrg.js} +1 -1
- package/static/assets/{download-DHIAgGlY.js → download-CmRC-PIa.js} +1 -1
- package/static/assets/droid-GYYyVzN-.js +18 -0
- package/static/assets/external-link-Bd24IGgw.js +6 -0
- package/static/assets/{eye-Ch7ecV9Z.js → eye-3OOczSrt.js} +1 -1
- package/static/assets/{folder-git-2-BYI_osdA.js → folder-git-2-C56Y-a-e.js} +1 -1
- package/static/assets/index-C_PmFIdi.css +2 -0
- package/static/assets/index-DzkC23id.js +477 -0
- package/static/assets/info-DOwvZM1c.js +6 -0
- package/static/assets/{label-BUv8Ltyw.js → label-BuTjh35X.js} +1 -1
- package/static/assets/{markdown-editor-BP8Xkecg.js → markdown-editor-DjkUR4bk.js} +1 -1
- package/static/assets/message-square-BKOo6mJX.js +6 -0
- package/static/assets/{pause-B0clczfE.js → pause-DTfqRkj4.js} +1 -1
- package/static/assets/{play-BHUpJCX1.js → play-CsdqpNIM.js} +1 -1
- package/static/assets/{radio-group-CSBH8ca-.js → radio-group-CkPIdZF9.js} +1 -1
- package/static/assets/{refresh-cw-C-yGwsHL.js → refresh-cw-5otO2hn8.js} +1 -1
- package/static/assets/{search-DFtqbVgP.js → search-B9lSaTJ3.js} +1 -1
- package/static/assets/select-BCvXvaCZ.js +1 -0
- package/static/assets/status-utils-CDkPeVfP.js +1 -0
- package/static/assets/{switch-WtOd8h5Z.js → switch-ME5yEkkm.js} +1 -1
- package/static/assets/{tabs-D93ZjKR7.js → tabs-CzKrO1bf.js} +1 -1
- package/static/assets/{tag-EEDDoCc_.js → tag-BCm1ofRX.js} +1 -1
- package/static/assets/{terminal-preview-sns5QTN_.js → terminal-preview-6VAQZGAD.js} +1 -1
- package/static/assets/use-terminal-D1ZnDkIm.js +1 -0
- package/static/assets/video-Yeqgj72x.js +36 -0
- package/static/assets/{zap-BYFYWzmj.js → zap-BQdeicHZ.js} +1 -1
- 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/AgentDetailPage-D6yg4CtT.js +0 -1
- package/static/assets/AgentEditPage-CTnjxjX7.js +0 -1
- package/static/assets/AgentsPage-NdB5OB1C.js +0 -3
- package/static/assets/AgentsSettingsPage-CYXp908g.js +0 -6
- package/static/assets/ApiKeysSettingsPage-Jl6vvVmW.js +0 -7
- package/static/assets/CodePage-b3JR4eWW.js +0 -2
- package/static/assets/DashboardPage-Cv2-duAx.js +0 -41
- package/static/assets/GitSettingsPage-CKIWkAnw.js +0 -6
- package/static/assets/IdentityPage-BsZnszF-.js +0 -11
- package/static/assets/IntegrationsSettingsPage-C1dC_vVy.js +0 -1
- package/static/assets/JobDetailPage-BgGQJkND.js +0 -1
- package/static/assets/KnowledgeDetailPage-Dzy2V7yT.js +0 -1
- package/static/assets/KnowledgeEditPage-av1ALt0h.js +0 -1
- package/static/assets/KnowledgePage-C_UDfD9X.js +0 -8
- package/static/assets/McpSettingsPage-BqbErEWS.js +0 -1
- package/static/assets/NewAgentPage-UEVIYkt3.js +0 -1
- package/static/assets/NewKnowledgePage-CzYXdoDb.js +0 -9
- package/static/assets/NewProposalPage-DrU0ihJX.js +0 -90
- package/static/assets/ProjectEditPage-j4KporiC.js +0 -11
- package/static/assets/ProjectPage-BQNa0qA-.js +0 -1
- package/static/assets/PromptsSettingsPage-sYphs8Dn.js +0 -1
- package/static/assets/ProposalDetailPage-CHR1MmwC.js +0 -1
- package/static/assets/ProposalEditPage-CkcZqgax.js +0 -1
- package/static/assets/ProposalsPage-CUB_aLXW.js +0 -17
- package/static/assets/ResourcesPage-DzjwPoyS.js +0 -71
- package/static/assets/SchedulePage-_v4YfdHo.js +0 -4
- package/static/assets/SourceInput-BFxoOvqS.js +0 -1
- package/static/assets/TerminalPage-DtVDWX7G.js +0 -1
- package/static/assets/TerminalSessionPage-BUHzje8A.js +0 -13
- package/static/assets/UserPreferencesPage-CkXJuogz.js +0 -1
- package/static/assets/UserSettingsPage-Dz-R1ijS.js +0 -1
- package/static/assets/UtilitiesPage-CRqQYVsb.js +0 -1
- package/static/assets/calendar-tNgwmWmG.js +0 -6
- package/static/assets/droid-BvMEm3eg.js +0 -8
- package/static/assets/index-CCs6x1Au.js +0 -468
- package/static/assets/index-CzjbtPHw.css +0 -2
- package/static/assets/use-terminal-BW9XYY8N.js +0 -1
|
@@ -128,3 +128,8 @@ export declare class AuthManager {
|
|
|
128
128
|
* @param configPath - Optional custom path to auth.json. If not provided, uses OS app data directory.
|
|
129
129
|
*/
|
|
130
130
|
export declare function getAuthManager(configPath?: string): AuthManager;
|
|
131
|
+
/**
|
|
132
|
+
* Reset the singleton AuthManager (for testing isolation).
|
|
133
|
+
* Only effective when NODE_ENV is 'test'.
|
|
134
|
+
*/
|
|
135
|
+
export declare function resetAuthManagerForTesting(): void;
|
|
@@ -420,3 +420,12 @@ export function getAuthManager(configPath) {
|
|
|
420
420
|
}
|
|
421
421
|
return authManagerInstance;
|
|
422
422
|
}
|
|
423
|
+
/**
|
|
424
|
+
* Reset the singleton AuthManager (for testing isolation).
|
|
425
|
+
* Only effective when NODE_ENV is 'test'.
|
|
426
|
+
*/
|
|
427
|
+
export function resetAuthManagerForTesting() {
|
|
428
|
+
if (process.env.NODE_ENV === 'test') {
|
|
429
|
+
authManagerInstance = null;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
@@ -195,6 +195,18 @@ export class JobScheduler {
|
|
|
195
195
|
catch (logError) {
|
|
196
196
|
console.error('Error logging job run end:', logError);
|
|
197
197
|
}
|
|
198
|
+
// Send Slack notification for job completion (non-blocking)
|
|
199
|
+
const notificationType = result.status === 'succeeded' ? 'job.completed' : 'job.failed';
|
|
200
|
+
import('../slack/slack-service.js').then(({ getSlackService }) => {
|
|
201
|
+
const duration = runRecord.finishedAt.getTime() - start.getTime();
|
|
202
|
+
getSlackService().sendNotification({
|
|
203
|
+
type: notificationType,
|
|
204
|
+
jobId: job.id,
|
|
205
|
+
jobName: job.name || job.id,
|
|
206
|
+
duration,
|
|
207
|
+
error: result.error,
|
|
208
|
+
}).catch(err => console.warn('[jobs] Slack notification failed:', err));
|
|
209
|
+
}).catch(() => { });
|
|
198
210
|
}
|
|
199
211
|
catch (error) {
|
|
200
212
|
runRecord.status = 'failed';
|
|
@@ -223,6 +235,15 @@ export class JobScheduler {
|
|
|
223
235
|
catch (logError) {
|
|
224
236
|
console.error('Error logging job run error:', logError);
|
|
225
237
|
}
|
|
238
|
+
// Send Slack notification for job failure (non-blocking)
|
|
239
|
+
import('../slack/slack-service.js').then(({ getSlackService }) => {
|
|
240
|
+
getSlackService().sendNotification({
|
|
241
|
+
type: 'job.failed',
|
|
242
|
+
jobId: job.id,
|
|
243
|
+
jobName: job.name || job.id,
|
|
244
|
+
error: error?.message || 'Unknown error',
|
|
245
|
+
}).catch(err => console.warn('[jobs] Slack notification failed:', err));
|
|
246
|
+
}).catch(() => { });
|
|
226
247
|
}
|
|
227
248
|
try {
|
|
228
249
|
await this.store.saveJob(job);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Client helper for connecting to HTTP/SSE MCP servers
|
|
3
|
+
* Provides tool discovery and execution proxying
|
|
4
|
+
*/
|
|
5
|
+
export interface McpServerConfig {
|
|
6
|
+
name?: string;
|
|
7
|
+
type?: 'http' | 'sse' | 'stdio';
|
|
8
|
+
url?: string;
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
env?: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
export interface DiscoveredTool {
|
|
13
|
+
name: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
inputSchema?: object;
|
|
16
|
+
serverName: string;
|
|
17
|
+
serverUrl: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ToolCallResult {
|
|
20
|
+
content: Array<{
|
|
21
|
+
type: string;
|
|
22
|
+
text?: string;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}>;
|
|
25
|
+
isError?: boolean;
|
|
26
|
+
structuredContent?: unknown;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Connect to an HTTP/SSE MCP server and discover its available tools
|
|
30
|
+
*/
|
|
31
|
+
export declare function discoverToolsFromServer(serverName: string, config: McpServerConfig): Promise<DiscoveredTool[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Execute a tool on an HTTP/SSE MCP server
|
|
34
|
+
*/
|
|
35
|
+
export declare function executeToolOnServer(serverName: string, config: McpServerConfig, toolName: string, args: Record<string, unknown>): Promise<ToolCallResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Close all cached client connections (for cleanup)
|
|
38
|
+
*/
|
|
39
|
+
export declare function closeAllConnections(): void;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Client helper for connecting to HTTP/SSE MCP servers
|
|
3
|
+
* Provides tool discovery and execution proxying
|
|
4
|
+
*/
|
|
5
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
6
|
+
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
7
|
+
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
|
|
8
|
+
// Cache for active client connections
|
|
9
|
+
const clientCache = new Map();
|
|
10
|
+
// Clean up stale connections after 5 minutes
|
|
11
|
+
const CONNECTION_TTL_MS = 5 * 60 * 1000;
|
|
12
|
+
/**
|
|
13
|
+
* Get or create a client connection to an MCP server
|
|
14
|
+
*/
|
|
15
|
+
async function getOrCreateClient(serverName, config) {
|
|
16
|
+
const cacheKey = `${serverName}:${config.url}`;
|
|
17
|
+
const cached = clientCache.get(cacheKey);
|
|
18
|
+
if (cached) {
|
|
19
|
+
cached.lastUsed = Date.now();
|
|
20
|
+
return cached.client;
|
|
21
|
+
}
|
|
22
|
+
const client = new Client({
|
|
23
|
+
name: 'coconut-api',
|
|
24
|
+
version: '1.0.0'
|
|
25
|
+
});
|
|
26
|
+
const url = new URL(config.url);
|
|
27
|
+
// Try StreamableHTTP first (newer), fall back to SSE (legacy)
|
|
28
|
+
let transport;
|
|
29
|
+
if (config.type === 'sse') {
|
|
30
|
+
// Explicitly SSE
|
|
31
|
+
transport = new SSEClientTransport(url);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
// Default to StreamableHTTP for 'http' type or unspecified
|
|
35
|
+
transport = new StreamableHTTPClientTransport(url);
|
|
36
|
+
}
|
|
37
|
+
await client.connect(transport);
|
|
38
|
+
clientCache.set(cacheKey, { client, lastUsed: Date.now() });
|
|
39
|
+
// Schedule cleanup
|
|
40
|
+
scheduleCleanup();
|
|
41
|
+
return client;
|
|
42
|
+
}
|
|
43
|
+
let cleanupScheduled = false;
|
|
44
|
+
function scheduleCleanup() {
|
|
45
|
+
if (cleanupScheduled)
|
|
46
|
+
return;
|
|
47
|
+
cleanupScheduled = true;
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
cleanupScheduled = false;
|
|
50
|
+
const now = Date.now();
|
|
51
|
+
for (const [key, entry] of clientCache.entries()) {
|
|
52
|
+
if (now - entry.lastUsed > CONNECTION_TTL_MS) {
|
|
53
|
+
try {
|
|
54
|
+
entry.client.close();
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
// Ignore close errors
|
|
58
|
+
}
|
|
59
|
+
clientCache.delete(key);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Reschedule if there are still cached connections
|
|
63
|
+
if (clientCache.size > 0) {
|
|
64
|
+
scheduleCleanup();
|
|
65
|
+
}
|
|
66
|
+
}, CONNECTION_TTL_MS);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Connect to an HTTP/SSE MCP server and discover its available tools
|
|
70
|
+
*/
|
|
71
|
+
export async function discoverToolsFromServer(serverName, config) {
|
|
72
|
+
if (!config.url) {
|
|
73
|
+
throw new Error(`Server ${serverName} has no URL configured`);
|
|
74
|
+
}
|
|
75
|
+
if (config.enabled === false) {
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
const client = await getOrCreateClient(serverName, config);
|
|
80
|
+
const toolsResult = await client.listTools();
|
|
81
|
+
return toolsResult.tools.map(tool => ({
|
|
82
|
+
name: tool.name,
|
|
83
|
+
description: tool.description,
|
|
84
|
+
inputSchema: tool.inputSchema,
|
|
85
|
+
serverName,
|
|
86
|
+
serverUrl: config.url
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
console.error(`Failed to discover tools from ${serverName}:`, error);
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Execute a tool on an HTTP/SSE MCP server
|
|
96
|
+
*/
|
|
97
|
+
export async function executeToolOnServer(serverName, config, toolName, args) {
|
|
98
|
+
if (!config.url) {
|
|
99
|
+
throw new Error(`Server ${serverName} has no URL configured`);
|
|
100
|
+
}
|
|
101
|
+
try {
|
|
102
|
+
const client = await getOrCreateClient(serverName, config);
|
|
103
|
+
const result = await client.callTool({
|
|
104
|
+
name: toolName,
|
|
105
|
+
arguments: args
|
|
106
|
+
});
|
|
107
|
+
return {
|
|
108
|
+
content: result.content,
|
|
109
|
+
isError: result.isError,
|
|
110
|
+
structuredContent: result.structuredContent
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
console.error(`Failed to execute tool ${toolName} on ${serverName}:`, error);
|
|
115
|
+
throw error;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Close all cached client connections (for cleanup)
|
|
120
|
+
*/
|
|
121
|
+
export function closeAllConnections() {
|
|
122
|
+
for (const [key, entry] of clientCache.entries()) {
|
|
123
|
+
try {
|
|
124
|
+
entry.client.close();
|
|
125
|
+
}
|
|
126
|
+
catch (e) {
|
|
127
|
+
// Ignore close errors
|
|
128
|
+
}
|
|
129
|
+
clientCache.delete(key);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { SlackService, getSlackService, DEFAULT_SLACK_CONFIG, } from '@lovelybunch/core';
|
|
2
|
+
export type { SlackConfig, SlackNotificationSettings, SlackChannel, ProposalNotificationPayload, JobNotificationPayload, GitNotificationPayload, NotificationPayload, NotificationType, FreeformMessageOptions, } from '@lovelybunch/core';
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface
|
|
3
|
-
status?:
|
|
1
|
+
import { Task, TaskStatus } from '@lovelybunch/types';
|
|
2
|
+
export interface TaskFilter {
|
|
3
|
+
status?: TaskStatus;
|
|
4
4
|
author?: string;
|
|
5
5
|
priority?: string;
|
|
6
6
|
tags?: string[];
|
|
7
7
|
search?: string;
|
|
8
8
|
}
|
|
9
9
|
export interface StorageAdapter {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
createTask(task: Task): Promise<void>;
|
|
11
|
+
getTask(id: string): Promise<Task | null>;
|
|
12
|
+
updateTask(id: string, task: Partial<Task>): Promise<void>;
|
|
13
|
+
deleteTask(id: string): Promise<void>;
|
|
14
|
+
listTasks(filter?: TaskFilter): Promise<Task[]>;
|
|
15
|
+
searchTasks(query: string): Promise<Task[]>;
|
|
16
16
|
}
|
|
17
17
|
export declare class FileStorageAdapter implements StorageAdapter {
|
|
18
18
|
private basePath;
|
|
19
19
|
private sanitizeForYAML;
|
|
20
20
|
constructor(basePath?: string);
|
|
21
21
|
ensureDirectories(): Promise<void>;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
private
|
|
22
|
+
createTask(task: Task): Promise<void>;
|
|
23
|
+
getTask(id: string): Promise<Task | null>;
|
|
24
|
+
updateTask(id: string, updates: Partial<Task>): Promise<void>;
|
|
25
|
+
deleteTask(id: string): Promise<void>;
|
|
26
|
+
listTasks(filter?: TaskFilter): Promise<Task[]>;
|
|
27
|
+
searchTasks(query: string): Promise<Task[]>;
|
|
28
|
+
private frontmatterToTask;
|
|
29
29
|
private getDefaultContent;
|
|
30
30
|
}
|
|
@@ -49,68 +49,76 @@ export class FileStorageAdapter {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
async ensureDirectories() {
|
|
52
|
-
const dirs = ['
|
|
52
|
+
const dirs = ['tasks', 'specs', 'flags', 'experiments', 'templates', 'jobs'];
|
|
53
53
|
for (const dir of dirs) {
|
|
54
54
|
await fs.mkdir(path.join(this.basePath, dir), { recursive: true });
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
async
|
|
57
|
+
async createTask(task) {
|
|
58
58
|
await this.ensureDirectories();
|
|
59
|
-
// Extract content from the
|
|
60
|
-
const { content, ...frontmatter } =
|
|
59
|
+
// Extract content from the task if it exists
|
|
60
|
+
const { content, ...frontmatter } = task;
|
|
61
61
|
// Normalize date fields to Date instances in case callers provide ISO strings
|
|
62
|
-
const createdAt =
|
|
63
|
-
?
|
|
64
|
-
: new Date(
|
|
65
|
-
const updatedAt =
|
|
66
|
-
?
|
|
67
|
-
: new Date(
|
|
68
|
-
// Convert the
|
|
62
|
+
const createdAt = task.metadata.createdAt instanceof Date
|
|
63
|
+
? task.metadata.createdAt
|
|
64
|
+
: new Date(task.metadata.createdAt);
|
|
65
|
+
const updatedAt = task.metadata.updatedAt instanceof Date
|
|
66
|
+
? task.metadata.updatedAt
|
|
67
|
+
: new Date(task.metadata.updatedAt);
|
|
68
|
+
// Convert the task to markdown with YAML frontmatter
|
|
69
69
|
const frontmatterData = this.sanitizeForYAML({
|
|
70
70
|
// Required fields
|
|
71
|
-
id:
|
|
72
|
-
title:
|
|
71
|
+
id: task.id,
|
|
72
|
+
title: task.title,
|
|
73
73
|
// Deprecated: intent is kept for backward compatibility during migration
|
|
74
74
|
// TODO: Remove intent field in future version
|
|
75
|
-
...(
|
|
75
|
+
...(task.intent && { intent: task.intent }),
|
|
76
76
|
createdAt: createdAt.toISOString(),
|
|
77
77
|
updatedAt: updatedAt.toISOString(),
|
|
78
|
-
status:
|
|
79
|
-
priority:
|
|
78
|
+
status: task.status,
|
|
79
|
+
priority: task.metadata.priority || 'medium',
|
|
80
80
|
// Author information
|
|
81
81
|
author: {
|
|
82
|
-
id:
|
|
83
|
-
name:
|
|
84
|
-
email:
|
|
82
|
+
id: task.author.id,
|
|
83
|
+
name: task.author.name,
|
|
84
|
+
email: task.author.email || '',
|
|
85
85
|
role: 'engineer', // Default role
|
|
86
|
-
type:
|
|
87
|
-
},
|
|
88
|
-
// Plan
|
|
89
|
-
plan: {
|
|
90
|
-
estimatedDuration: 'TBD',
|
|
91
|
-
dependencies: [],
|
|
92
|
-
steps: cp.planSteps.map(step => ({
|
|
93
|
-
id: step.id,
|
|
94
|
-
description: step.description,
|
|
95
|
-
status: step.status
|
|
96
|
-
}))
|
|
86
|
+
type: task.author.type
|
|
97
87
|
},
|
|
88
|
+
// Steps (top-level for consistency with CLI storage format)
|
|
89
|
+
steps: task.planSteps.map(step => ({
|
|
90
|
+
id: step.id,
|
|
91
|
+
description: step.description,
|
|
92
|
+
status: step.status,
|
|
93
|
+
...(step.command && { command: step.command }),
|
|
94
|
+
...(step.expectedOutcome && { expectedOutcome: step.expectedOutcome }),
|
|
95
|
+
...(step.output && { output: step.output }),
|
|
96
|
+
...(step.executedAt && { executedAt: step.executedAt instanceof Date ? step.executedAt.toISOString() : step.executedAt }),
|
|
97
|
+
})),
|
|
98
98
|
// Metadata
|
|
99
|
-
tags:
|
|
99
|
+
tags: task.metadata.tags || [],
|
|
100
100
|
labels: [],
|
|
101
|
-
|
|
101
|
+
// Comments use consistent field names: id, author, content, createdAt
|
|
102
|
+
comments: (task.comments || [])
|
|
103
|
+
.filter((c) => c !== undefined)
|
|
104
|
+
.map((c) => ({
|
|
105
|
+
id: c.id,
|
|
106
|
+
author: typeof c.author === 'string' ? c.author : c.author?.name || 'Unknown',
|
|
107
|
+
content: c.content || c.text || '',
|
|
108
|
+
createdAt: c.createdAt || c.timestamp || new Date().toISOString(),
|
|
109
|
+
}))
|
|
102
110
|
});
|
|
103
|
-
const markdown = matter.stringify(content || this.getDefaultContent(
|
|
104
|
-
const filePath = path.join(this.basePath, '
|
|
111
|
+
const markdown = matter.stringify(content || this.getDefaultContent(task), frontmatterData);
|
|
112
|
+
const filePath = path.join(this.basePath, 'tasks', `${task.id}.md`);
|
|
105
113
|
await fs.writeFile(filePath, markdown, 'utf-8');
|
|
106
114
|
}
|
|
107
|
-
async
|
|
115
|
+
async getTask(id) {
|
|
108
116
|
try {
|
|
109
|
-
const filePath = path.join(this.basePath, '
|
|
117
|
+
const filePath = path.join(this.basePath, 'tasks', `${id}.md`);
|
|
110
118
|
const fileContent = await fs.readFile(filePath, 'utf-8');
|
|
111
119
|
const { data, content } = matter(fileContent);
|
|
112
|
-
// Convert the frontmatter back to a
|
|
113
|
-
return this.
|
|
120
|
+
// Convert the frontmatter back to a Task
|
|
121
|
+
return this.frontmatterToTask(data, content);
|
|
114
122
|
}
|
|
115
123
|
catch (error) {
|
|
116
124
|
if (error.code === 'ENOENT')
|
|
@@ -118,21 +126,19 @@ export class FileStorageAdapter {
|
|
|
118
126
|
throw error;
|
|
119
127
|
}
|
|
120
128
|
}
|
|
121
|
-
async
|
|
122
|
-
const existing = await this.
|
|
129
|
+
async updateTask(id, updates) {
|
|
130
|
+
const existing = await this.getTask(id);
|
|
123
131
|
if (!existing)
|
|
124
|
-
throw new Error(`
|
|
125
|
-
// Never allow id to be updated to prevent overwriting other
|
|
132
|
+
throw new Error(`Task ${id} not found`);
|
|
133
|
+
// Never allow id to be updated to prevent overwriting other tasks
|
|
126
134
|
const { id: _, ...safeUpdates } = updates;
|
|
127
|
-
//
|
|
128
|
-
//
|
|
129
|
-
let commentsToStore = existing.
|
|
135
|
+
// Comments live at root level on Task (not in metadata).
|
|
136
|
+
// Accept comments from root level or metadata.comments for backward compat.
|
|
137
|
+
let commentsToStore = existing.comments || [];
|
|
130
138
|
if (safeUpdates.comments) {
|
|
131
|
-
// If comments are provided at root level, use them
|
|
132
139
|
commentsToStore = safeUpdates.comments;
|
|
133
140
|
}
|
|
134
141
|
else if (safeUpdates.metadata?.comments) {
|
|
135
|
-
// If comments are provided in metadata, use them
|
|
136
142
|
commentsToStore = safeUpdates.metadata.comments;
|
|
137
143
|
}
|
|
138
144
|
const updated = {
|
|
@@ -142,41 +148,39 @@ export class FileStorageAdapter {
|
|
|
142
148
|
...existing.metadata,
|
|
143
149
|
...safeUpdates.metadata,
|
|
144
150
|
updatedAt: new Date(),
|
|
145
|
-
comments: commentsToStore
|
|
146
151
|
},
|
|
147
|
-
// Store comments at the root level for the file format
|
|
148
152
|
comments: commentsToStore
|
|
149
153
|
};
|
|
150
|
-
await this.
|
|
154
|
+
await this.createTask(updated);
|
|
151
155
|
}
|
|
152
|
-
async
|
|
153
|
-
const filePath = path.join(this.basePath, '
|
|
156
|
+
async deleteTask(id) {
|
|
157
|
+
const filePath = path.join(this.basePath, 'tasks', `${id}.md`);
|
|
154
158
|
await fs.unlink(filePath);
|
|
155
159
|
}
|
|
156
|
-
async
|
|
157
|
-
const
|
|
160
|
+
async listTasks(filter) {
|
|
161
|
+
const tasksDir = path.join(this.basePath, 'tasks');
|
|
158
162
|
try {
|
|
159
|
-
const files = await fs.readdir(
|
|
160
|
-
const
|
|
163
|
+
const files = await fs.readdir(tasksDir);
|
|
164
|
+
const tasks = await Promise.all(files
|
|
161
165
|
.filter(f => f.endsWith('.md'))
|
|
162
166
|
.map(async (file) => {
|
|
163
|
-
const content = await fs.readFile(path.join(
|
|
167
|
+
const content = await fs.readFile(path.join(tasksDir, file), 'utf-8');
|
|
164
168
|
const { data, content: body } = matter(content);
|
|
165
|
-
return this.
|
|
169
|
+
return this.frontmatterToTask(data, body);
|
|
166
170
|
}));
|
|
167
171
|
// Apply filters
|
|
168
|
-
let filtered =
|
|
169
|
-
if (!
|
|
172
|
+
let filtered = tasks.filter(task => {
|
|
173
|
+
if (!task)
|
|
170
174
|
return false;
|
|
171
|
-
if (filter?.status &&
|
|
175
|
+
if (filter?.status && task.status !== filter.status)
|
|
172
176
|
return false;
|
|
173
|
-
if (filter?.author &&
|
|
177
|
+
if (filter?.author && task.author.id !== filter.author)
|
|
174
178
|
return false;
|
|
175
|
-
if (filter?.priority &&
|
|
179
|
+
if (filter?.priority && task.metadata.priority !== filter.priority)
|
|
176
180
|
return false;
|
|
177
181
|
if (filter?.tags && filter.tags.length > 0) {
|
|
178
|
-
const
|
|
179
|
-
if (!filter.tags.some(tag =>
|
|
182
|
+
const taskTags = task.metadata.tags || [];
|
|
183
|
+
if (!filter.tags.some(tag => taskTags.includes(tag)))
|
|
180
184
|
return false;
|
|
181
185
|
}
|
|
182
186
|
return true;
|
|
@@ -204,9 +208,9 @@ export class FileStorageAdapter {
|
|
|
204
208
|
throw error;
|
|
205
209
|
}
|
|
206
210
|
}
|
|
207
|
-
async
|
|
208
|
-
const
|
|
209
|
-
const fuse = new Fuse(
|
|
211
|
+
async searchTasks(query) {
|
|
212
|
+
const allTasks = await this.listTasks();
|
|
213
|
+
const fuse = new Fuse(allTasks, {
|
|
210
214
|
keys: [
|
|
211
215
|
{ name: 'title', weight: 2 },
|
|
212
216
|
{ name: 'intent', weight: 2 }, // Deprecated fallback
|
|
@@ -219,15 +223,16 @@ export class FileStorageAdapter {
|
|
|
219
223
|
});
|
|
220
224
|
return fuse.search(query).map(result => result.item);
|
|
221
225
|
}
|
|
222
|
-
|
|
223
|
-
// Handle both old and new format
|
|
224
|
-
const steps = data.
|
|
225
|
-
//
|
|
226
|
-
|
|
226
|
+
frontmatterToTask(data, content) {
|
|
227
|
+
// Handle both old format (plan.steps) and new format (top-level steps)
|
|
228
|
+
const steps = data.steps || data.plan?.steps || [];
|
|
229
|
+
// Normalize comments using consistent field names (content/createdAt).
|
|
230
|
+
// Also handle legacy format (text/timestamp) for backward compatibility.
|
|
231
|
+
const normalizedComments = (data.comments || []).map((comment) => ({
|
|
227
232
|
id: comment.id,
|
|
228
|
-
text: comment.content || comment.text || '', // Handle both content and text fields
|
|
229
233
|
author: typeof comment.author === 'string' ? comment.author : comment.author?.name || 'Unknown',
|
|
230
|
-
|
|
234
|
+
content: comment.content || comment.text || '',
|
|
235
|
+
createdAt: comment.createdAt || comment.timestamp || new Date().toISOString(),
|
|
231
236
|
}));
|
|
232
237
|
// Use title as primary, fall back to deprecated intent for backward compatibility
|
|
233
238
|
const titleValue = data.title || data.intent || '';
|
|
@@ -260,6 +265,7 @@ export class FileStorageAdapter {
|
|
|
260
265
|
telemetryContracts: data.telemetryContracts || [],
|
|
261
266
|
releasePlan: data.releasePlan || { strategy: 'immediate' },
|
|
262
267
|
status: data.status || 'draft',
|
|
268
|
+
comments: normalizedComments,
|
|
263
269
|
metadata: {
|
|
264
270
|
createdAt: new Date(data.createdAt || Date.now()),
|
|
265
271
|
updatedAt: new Date(data.updatedAt || Date.now()),
|
|
@@ -267,16 +273,15 @@ export class FileStorageAdapter {
|
|
|
267
273
|
aiInteractions: data.aiInteractions || [],
|
|
268
274
|
tags: data.tags || [],
|
|
269
275
|
priority: data.priority || 'medium',
|
|
270
|
-
comments: transformedComments
|
|
271
276
|
},
|
|
272
277
|
content // Store the markdown content
|
|
273
278
|
};
|
|
274
279
|
}
|
|
275
|
-
getDefaultContent(
|
|
276
|
-
return `# ${
|
|
280
|
+
getDefaultContent(task) {
|
|
281
|
+
return `# ${task.title}
|
|
277
282
|
|
|
278
283
|
## Problem Statement
|
|
279
|
-
Describe the problem this
|
|
284
|
+
Describe the problem this task addresses.
|
|
280
285
|
|
|
281
286
|
## Proposed Solution
|
|
282
287
|
Describe the solution you're proposing.
|
|
@@ -2,13 +2,11 @@ import { WebSocket } from 'ws';
|
|
|
2
2
|
import { ShellType } from './shell-utils.js';
|
|
3
3
|
export interface TerminalSession {
|
|
4
4
|
id: string;
|
|
5
|
-
|
|
5
|
+
taskId: string;
|
|
6
6
|
pty: any;
|
|
7
7
|
websocket?: WebSocket;
|
|
8
8
|
createdAt: Date;
|
|
9
9
|
lastActivity: Date;
|
|
10
|
-
enableLogging?: boolean;
|
|
11
|
-
logFilePath?: string;
|
|
12
10
|
backlog: string;
|
|
13
11
|
previewSockets?: Set<WebSocket>;
|
|
14
12
|
previewBuffer?: string;
|
|
@@ -21,9 +19,9 @@ export declare class TerminalManager {
|
|
|
21
19
|
private cleanupInterval;
|
|
22
20
|
private static readonly MAX_BACKLOG_BYTES;
|
|
23
21
|
constructor();
|
|
24
|
-
createSession(
|
|
22
|
+
createSession(taskId: string, shellPreference?: ShellType, startupCommand?: string): Promise<TerminalSession>;
|
|
25
23
|
getSession(sessionId: string): TerminalSession | undefined;
|
|
26
|
-
|
|
24
|
+
getSessionsByTask(taskId: string): TerminalSession[];
|
|
27
25
|
attachWebSocket(sessionId: string, ws: WebSocket): boolean;
|
|
28
26
|
destroySession(sessionId: string): boolean;
|
|
29
27
|
resizeSession(sessionId: string, cols: number, rows: number): boolean;
|