cognova 0.2.13 → 0.2.15
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/-mGU8_Hv.js +1 -0
- package/.output/public/_nuxt/0GqCtQ9S.js +1 -0
- package/.output/public/_nuxt/{DFpmIy6J.js → 1wCoXZ14.js} +1 -1
- package/.output/public/_nuxt/2J1KxdHv.js +1 -0
- package/.output/public/_nuxt/6VDUZECX.js +1 -0
- package/.output/public/_nuxt/{C7m9zGMG.js → 8WMJQbWG.js} +1 -1
- package/.output/public/_nuxt/9Rw88G6h.js +1 -0
- package/.output/public/_nuxt/{BjsKx597.js → B-yW4SD3.js} +1 -1
- package/.output/public/_nuxt/B20jNAhm.js +1 -0
- package/.output/public/_nuxt/B3OpTH_e.js +1 -0
- package/.output/public/_nuxt/B9Y3_B5G.js +1 -0
- package/.output/public/_nuxt/B9_vmatf.js +1 -0
- package/.output/public/_nuxt/B9o6sFST.js +1 -0
- package/.output/public/_nuxt/{CseYuM6E.js → BAY3_Hrq.js} +1 -1
- package/.output/public/_nuxt/{B_9zJTqe.js → BD5rPkc2.js} +3 -3
- package/.output/public/_nuxt/BGYoW3kO.js +1 -0
- package/.output/public/_nuxt/BHUy5EAj.js +1 -0
- package/.output/public/_nuxt/BLdMRpJD.js +1 -0
- package/.output/public/_nuxt/{D6tVZcRs.js → BOCn_SGf.js} +12 -12
- package/.output/public/_nuxt/BQi8LIrn.js +1 -0
- package/.output/public/_nuxt/BS1t375R.js +1 -0
- package/.output/public/_nuxt/BTGeP1bA.js +1 -0
- package/.output/public/_nuxt/{pdYvpiud.js → BVYYP4eQ.js} +5 -5
- package/.output/public/_nuxt/BWQ7zE01.js +1 -0
- package/.output/public/_nuxt/BWqJInD3.js +1 -0
- package/.output/public/_nuxt/BXdQ9ASJ.js +1 -0
- package/.output/public/_nuxt/{DQhm-UPG.js → BXxZokD_.js} +2 -2
- package/.output/public/_nuxt/BZ7DAtPi.js +1 -0
- package/.output/public/_nuxt/BZm9w7en.js +1 -0
- package/.output/public/_nuxt/B_hNqC64.js +1 -0
- package/.output/public/_nuxt/Be47YE2L.js +1 -0
- package/.output/public/_nuxt/BgIS9_ti.js +39 -0
- package/.output/public/_nuxt/BgavRUl_.js +1 -0
- package/.output/public/_nuxt/Bh0yGTzr.js +1 -0
- package/.output/public/_nuxt/BhhMUror.js +1 -0
- package/.output/public/_nuxt/Bj5e7QPz.js +1 -0
- package/.output/public/_nuxt/{9kAKMaPC.js → Bnn59-FS.js} +1 -1
- package/.output/public/_nuxt/BoCU3mWu.js +1 -0
- package/.output/public/_nuxt/Br6epbzY.js +1 -0
- package/.output/public/_nuxt/Br81Sr2R.js +1 -0
- package/.output/public/_nuxt/BrkEOLHu.js +9 -0
- package/.output/public/_nuxt/BtrNCc2S.js +1 -0
- package/.output/public/_nuxt/BxsQlbgl.js +1 -0
- package/.output/public/_nuxt/BzrhNhdT.js +1 -0
- package/.output/public/_nuxt/{B-DMcEU9.js → C-78dDNd.js} +1 -1
- package/.output/public/_nuxt/C1oaoi1p.js +1 -0
- package/.output/public/_nuxt/C2-_hcwB.js +1 -0
- package/.output/public/_nuxt/{TxMdabnL.js → C2Gh3qqr.js} +1 -1
- package/.output/public/_nuxt/C2OHaW6l.js +1 -0
- package/.output/public/_nuxt/C3szZmvA.js +1 -0
- package/.output/public/_nuxt/C3xzleKP.js +1 -0
- package/.output/public/_nuxt/C4sG6rdW.js +1 -0
- package/.output/public/_nuxt/C5Cu9Fx6.js +1 -0
- package/.output/public/_nuxt/{LRO7YHoH.js → C5gfF7J1.js} +1 -1
- package/.output/public/_nuxt/C6Eoiclo.js +1 -0
- package/.output/public/_nuxt/C7hFztZL.js +1 -0
- package/.output/public/_nuxt/CAVUAxNU.js +2 -0
- package/.output/public/_nuxt/{CiNxIhaq.js → CCeM5lW2.js} +1 -1
- package/.output/public/_nuxt/CDcQ31Eh.js +1 -0
- package/.output/public/_nuxt/CHbHVtCy.js +1 -0
- package/.output/public/_nuxt/CHnVFnBW.js +1 -0
- package/.output/public/_nuxt/CLNcmNQS.js +1 -0
- package/.output/public/_nuxt/{D7N3EZ-I.js → CPwCTHun.js} +1 -1
- package/.output/public/_nuxt/{CFmvNggn.js → CS8SdmH2.js} +1 -1
- package/.output/public/_nuxt/CTGm_mc8.js +1 -0
- package/.output/public/_nuxt/{DNcOC5zj.js → CTQFGHjS.js} +1 -1
- package/.output/public/_nuxt/{B0nzD8Sk.js → CVVtVzXC.js} +1 -1
- package/.output/public/_nuxt/CZNOaqeX.js +1 -0
- package/.output/public/_nuxt/C_A_NkeC.js +2 -0
- package/.output/public/_nuxt/{CGplHfmR.js → C_doutX-.js} +1 -1
- package/.output/public/_nuxt/{BrX-PnSK.js → CbDLhrNA.js} +2 -2
- package/.output/public/_nuxt/CePKCqSb.js +1 -0
- package/.output/public/_nuxt/Cet4T_yO.js +1 -0
- package/.output/public/_nuxt/{C6OSRpRd.js → CjJPkhbc.js} +1 -1
- package/.output/public/_nuxt/CkZT4LGq.js +1 -0
- package/.output/public/_nuxt/CkrW8sGL.js +1 -0
- package/.output/public/_nuxt/Co0UxVsx.js +1 -0
- package/.output/public/_nuxt/CqS0zXYQ.js +1 -0
- package/.output/public/_nuxt/CskGv_Km.js +1 -0
- package/.output/public/_nuxt/{DuzpliIL.js → CuvkTsqs.js} +1 -1
- package/.output/public/_nuxt/{B2wI_pYg.js → CxMuZEwX.js} +1 -1
- package/.output/public/_nuxt/{9O1MXkck.js → CxSijT71.js} +8 -8
- package/.output/public/_nuxt/Cywo6tZI.js +1 -0
- package/.output/public/_nuxt/D1reIfpX.js +1 -0
- package/.output/public/_nuxt/D1uV2uir.js +1 -0
- package/.output/public/_nuxt/{BWuL2CzO.js → D2edadpd.js} +1 -1
- package/.output/public/_nuxt/D3cEeQh7.js +1 -0
- package/.output/public/_nuxt/D41A2mE2.js +1 -0
- package/.output/public/_nuxt/D49P2RhG.js +1 -0
- package/.output/public/_nuxt/D867g6Ds.js +1 -0
- package/.output/public/_nuxt/DEFWIjWl.js +1 -0
- package/.output/public/_nuxt/DFTEBTzZ.js +1 -0
- package/.output/public/_nuxt/{-HePz7lp.js → DHRexj9X.js} +2 -2
- package/.output/public/_nuxt/DL4EpgqQ.js +1 -0
- package/.output/public/_nuxt/DLHnP6tw.js +1 -0
- package/.output/public/_nuxt/DM20WaLq.js +1 -0
- package/.output/public/_nuxt/{B8DFEjxA.js → DNAMjHbb.js} +1 -1
- package/.output/public/_nuxt/{CLkkdThv.js → DP8t9VWs.js} +24 -24
- package/.output/public/_nuxt/DTR31rjp.js +1 -0
- package/.output/public/_nuxt/{Bc8bTnkd.js → DTlSLSo1.js} +3 -3
- package/.output/public/_nuxt/{DowkFZ2V.js → DVdnhfXT.js} +1 -1
- package/.output/public/_nuxt/{DvHS7_h2.js → DZikIgHK.js} +1 -1
- package/.output/public/_nuxt/D_YGqvw_.js +1 -0
- package/.output/public/_nuxt/D_k1YwXm.js +1 -0
- package/.output/public/_nuxt/Daf2MbWG.js +7 -0
- package/.output/public/_nuxt/DcJ0GstJ.js +1 -0
- package/.output/public/_nuxt/DcYKh6QA.js +1 -0
- package/.output/public/_nuxt/DhN3_DYH.js +1 -0
- package/.output/public/_nuxt/DhSvBSt3.js +1 -0
- package/.output/public/_nuxt/DhlIWT8K.js +1 -0
- package/.output/public/_nuxt/DjsqyRqt.js +1 -0
- package/.output/public/_nuxt/DpSM97eH.js +1 -0
- package/.output/public/_nuxt/DqR9SdeU.js +1 -0
- package/.output/public/_nuxt/DqmQtg6Y.js +1 -0
- package/.output/public/_nuxt/Dsuag_iW.js +1 -0
- package/.output/public/_nuxt/Dtr_0IbE.js +1 -0
- package/.output/public/_nuxt/DwrmFEZN.js +1 -0
- package/.output/public/_nuxt/DxE8r3r4.js +1 -0
- package/.output/public/_nuxt/G_CsVlOR.js +1 -0
- package/.output/public/_nuxt/Gyw_2f6x.js +1 -0
- package/.output/public/_nuxt/HStC1ZyE.js +1 -0
- package/.output/public/_nuxt/Hh9mv0Ek.js +1 -0
- package/.output/public/_nuxt/LR0kCjbe.js +1 -0
- package/.output/public/_nuxt/MYeLvJGV.js +1 -0
- package/.output/public/_nuxt/NKs0EGrh.js +1 -0
- package/.output/public/_nuxt/PY5EGujn.js +1 -0
- package/.output/public/_nuxt/PamJNol9.js +1 -0
- package/.output/public/_nuxt/RlvwEbHv.js +1 -0
- package/.output/public/_nuxt/{BghuwIGa.js → TNpdJOlc.js} +1 -1
- package/.output/public/_nuxt/TSYrPbLR.js +1 -0
- package/.output/public/_nuxt/U-eBrbR4.js +1 -0
- package/.output/public/_nuxt/UuqXScSw.js +1 -0
- package/.output/public/_nuxt/V04-MrLN.js +1 -0
- package/.output/public/_nuxt/X0o5GcBb.js +1 -0
- package/.output/public/_nuxt/XQNzmQy9.js +1 -0
- package/.output/public/_nuxt/Y59XKprr.js +1 -0
- package/.output/public/_nuxt/YZQjZgsH.js +1 -0
- package/.output/public/_nuxt/_-TGPiLQ.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/7c42ae85-1cae-45f0-8cb9-ad3a10165c2c.json +1 -0
- package/.output/public/_nuxt/dashboard.ByJQ-Wzh.css +1 -0
- package/.output/public/_nuxt/entry.ZJxWCrU6.css +1 -0
- package/.output/public/_nuxt/{D12qPplu.js → hCeWb_38.js} +1 -1
- package/.output/public/_nuxt/{sBzyvWMJ.js → hrPTRWjM.js} +1 -1
- package/.output/public/_nuxt/jC4pIK1p.js +1 -0
- package/.output/public/_nuxt/jTT1R-Vz.js +1 -0
- package/.output/public/_nuxt/{CRRw0Thu.js → kkAMoB43.js} +1 -1
- package/.output/public/_nuxt/{h_bXa-f2.js → mzM4BGtv.js} +1 -1
- package/.output/public/_nuxt/o-s8JBm2.js +1 -0
- package/.output/public/_nuxt/pwJTkIQ4.js +1 -0
- package/.output/public/_nuxt/{BL1mkqgd.js → rIgg2Arf.js} +3 -3
- package/.output/public/_nuxt/subdxgSQ.js +1 -0
- package/.output/public/_nuxt/t8B72leH.js +1 -0
- package/.output/public/_nuxt/vCFAHwdt.js +1 -0
- package/.output/public/_nuxt/z-MP0bB7.js +1 -0
- package/.output/server/chunks/build/CodeIcon-CWD5HcV7.mjs +1 -1
- package/.output/server/chunks/build/DropdownMenu-BBrV9nXz.mjs +1 -1
- package/.output/server/chunks/build/{EditorToolbar-DIfb5arC.mjs → EditorToolbar-B9OwSI5e.mjs} +3 -3
- package/.output/server/chunks/build/{EditorToolbar-DIfb5arC.mjs.map → EditorToolbar-B9OwSI5e.mjs.map} +1 -1
- package/.output/server/chunks/build/Img-CWLmvN1t.mjs +1 -1
- package/.output/server/chunks/build/MDC-Dx0YPDhe.mjs +1 -1
- package/.output/server/chunks/build/Select-BB1oLrCD.mjs +1 -1
- package/.output/server/chunks/build/SelectMenu-DPssg6zD.mjs +1 -1
- package/.output/server/chunks/build/Table-DCwTlhCj.mjs +1 -1
- package/.output/server/chunks/build/Tooltip-TRyl6dje.mjs +1 -1
- package/.output/server/chunks/build/Tree-DUhXKd8y.mjs +1 -1
- package/.output/server/chunks/build/{_id_-DN00UDdO.mjs → _id_-CwBeklIM.mjs} +296 -430
- package/.output/server/chunks/build/_id_-CwBeklIM.mjs.map +1 -0
- package/.output/server/chunks/build/{_name_-BnS_KEfX.mjs → _name_-D7MtW4Vu.mjs} +2 -2
- package/.output/server/chunks/build/{_name_-BnS_KEfX.mjs.map → _name_-D7MtW4Vu.mjs.map} +1 -1
- package/.output/server/chunks/build/{_uuid_-DfJaumTE.mjs → _uuid_-lvG92ein.mjs} +4 -4
- package/.output/server/chunks/build/{_uuid_-DfJaumTE.mjs.map → _uuid_-lvG92ein.mjs.map} +1 -1
- package/.output/server/chunks/build/account-LDZ4TL6x.mjs +513 -0
- package/.output/server/chunks/build/account-LDZ4TL6x.mjs.map +1 -0
- package/.output/server/chunks/build/app-CGhRZPNT.mjs +252 -0
- package/.output/server/chunks/build/app-CGhRZPNT.mjs.map +1 -0
- package/.output/server/chunks/build/{chat-m4-n9vC6.mjs → chat-BphuYhvA.mjs} +18 -27
- package/.output/server/chunks/build/chat-BphuYhvA.mjs.map +1 -0
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/cookie-C_iulBi6.mjs +1 -1
- package/.output/server/chunks/build/{dashboard-CiVTAZuF.mjs → dashboard-nDujDyOg.mjs} +55 -16
- package/.output/server/chunks/build/{dashboard-CiVTAZuF.mjs.map → dashboard-nDujDyOg.mjs.map} +1 -1
- package/.output/server/chunks/build/{docs-ChGwOPg5.mjs → docs-Bwucwp0r.mjs} +664 -592
- package/.output/server/chunks/build/docs-Bwucwp0r.mjs.map +1 -0
- package/.output/server/chunks/build/fetch-BB7Qzkwe.mjs +1 -1
- package/.output/server/chunks/build/{hooks-D328DcO6.mjs → hooks-D6PmTth8.mjs} +19 -29
- package/.output/server/chunks/build/hooks-D6PmTth8.mjs.map +1 -0
- package/.output/server/chunks/build/{index-CAnGTRlu.mjs → index-CJkn2jiM.mjs} +2 -2
- package/.output/server/chunks/build/{index-CAnGTRlu.mjs.map → index-CJkn2jiM.mjs.map} +1 -1
- package/.output/server/chunks/build/index-CxDxc9fm.mjs +1 -1
- package/.output/server/chunks/build/index-Cz9Y6NwN.mjs +723 -0
- package/.output/server/chunks/build/index-Cz9Y6NwN.mjs.map +1 -0
- package/.output/server/chunks/build/index-hwhuKhuZ.mjs +76 -0
- package/.output/server/chunks/build/index-hwhuKhuZ.mjs.map +1 -0
- package/.output/server/chunks/build/integrations-D5JWURiJ.mjs +1499 -0
- package/.output/server/chunks/build/integrations-D5JWURiJ.mjs.map +1 -0
- package/.output/server/chunks/build/{library-Aeg7_Lsb.mjs → library-DxRdgP6X.mjs} +2 -2
- package/.output/server/chunks/build/{library-Aeg7_Lsb.mjs.map → library-DxRdgP6X.mjs.map} +1 -1
- package/.output/server/chunks/build/{login-DnnElTl2.mjs → login-BmER_VoU.mjs} +2 -2
- package/.output/server/chunks/build/{login-DnnElTl2.mjs.map → login-BmER_VoU.mjs.map} +1 -1
- package/.output/server/chunks/build/manage-secrets-BWzqc_-f.mjs +669 -0
- package/.output/server/chunks/build/manage-secrets-BWzqc_-f.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +65 -34
- package/.output/server/chunks/build/server.mjs.map +1 -1
- package/.output/server/chunks/build/settings-neokAVE5.mjs +154 -0
- package/.output/server/chunks/build/settings-neokAVE5.mjs.map +1 -0
- package/.output/server/chunks/build/styles.mjs +2 -2
- package/.output/server/chunks/build/{tasks-DnAFqbtt.mjs → tasks-CnpIQNpS.mjs} +27 -37
- package/.output/server/chunks/build/tasks-CnpIQNpS.mjs.map +1 -0
- package/.output/server/chunks/build/{useAgents-DHEXiFSc.mjs → useAgents-nmbkB9-_.mjs} +5 -26
- package/.output/server/chunks/build/useAgents-nmbkB9-_.mjs.map +1 -0
- package/.output/server/chunks/build/{view-n2sYa4Zh.mjs → view-mb0ISqfM.mjs} +3 -3
- package/.output/server/chunks/build/{view-n2sYa4Zh.mjs.map → view-mb0ISqfM.mjs.map} +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +1000 -858
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get.mjs +17 -2
- package/.output/server/chunks/routes/api/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get3.mjs +21 -3
- package/.output/server/chunks/routes/api/index.get3.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get4.mjs +10 -9
- package/.output/server/chunks/routes/api/index.get4.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get9.mjs +10 -8
- package/.output/server/chunks/routes/api/index.get9.mjs.map +1 -1
- package/.output/server/chunks/routes/api/memory/search.get.mjs +10 -5
- package/.output/server/chunks/routes/api/memory/search.get.mjs.map +1 -1
- package/.output/server/chunks/routes/renderer.mjs +1 -1
- package/.output/server/index.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/app/components/AssistantPanel.client.vue +16 -314
- package/app/components/agents/AgentCard.vue +111 -0
- package/app/components/agents/AgentInfoCard.vue +54 -0
- package/app/components/agents/AgentRunHistory.vue +103 -0
- package/app/components/agents/AgentRunModal.vue +1 -24
- package/app/components/agents/AgentStatsCards.vue +1 -26
- package/app/components/assistant/AssistantChat.vue +156 -0
- package/app/components/assistant/AssistantTerminal.client.vue +178 -0
- package/app/components/chat/ConversationList.vue +2 -12
- package/app/components/files/FileTree.vue +23 -202
- package/app/components/files/FileTreeModals.vue +226 -0
- package/app/components/hooks/HookStatsCards.vue +1 -6
- package/app/components/hooks/ToolBreakdownTable.vue +1 -6
- package/app/components/search/DashboardSearch.vue +38 -1
- package/app/components/tasks/TaskCard.vue +2 -7
- package/app/components/tasks/TaskDetail.vue +4 -9
- package/app/composables/useSearch.ts +21 -11
- package/app/layouts/dashboard.vue +1 -1
- package/app/pages/agents/[id].vue +6 -197
- package/app/pages/agents/index.vue +9 -142
- package/app/pages/settings/account.vue +243 -0
- package/app/pages/settings/app.vue +230 -0
- package/app/pages/settings/index.vue +12 -0
- package/app/pages/settings/integrations.vue +794 -0
- package/app/pages/settings/manage-secrets.vue +295 -0
- package/app/pages/settings.vue +20 -1581
- package/dist/cli/index.js +676 -212
- package/package.json +1 -1
- package/server/api/agents/index.get.ts +20 -1
- package/server/api/conversations/index.get.ts +23 -5
- package/server/api/documents/index.get.ts +11 -9
- package/server/api/memory/search.get.ts +11 -6
- package/server/api/tasks/index.get.ts +11 -9
- package/server/drizzle/migrations/0016_full_text_search.sql +127 -0
- package/server/drizzle/migrations/meta/_journal.json +7 -0
- package/shared/types/index.ts +7 -1
- package/shared/utils/formatting.ts +105 -0
- package/.output/public/_nuxt/4ALIM-zZ.js +0 -1
- package/.output/public/_nuxt/5sUbkh_6.js +0 -16
- package/.output/public/_nuxt/6bB8Ev7a.js +0 -1
- package/.output/public/_nuxt/7rT1DCe2.js +0 -1
- package/.output/public/_nuxt/B2PqR2Vu.js +0 -1
- package/.output/public/_nuxt/B5FuOh7E.js +0 -1
- package/.output/public/_nuxt/B6om4MW2.js +0 -1
- package/.output/public/_nuxt/B7ikW4eF.js +0 -1
- package/.output/public/_nuxt/B9kWNcU7.js +0 -1
- package/.output/public/_nuxt/BAZ8sewA.js +0 -1
- package/.output/public/_nuxt/BCPwL4ma.js +0 -1
- package/.output/public/_nuxt/BCrlmHh_.js +0 -1
- package/.output/public/_nuxt/BD-AFJWW.js +0 -1
- package/.output/public/_nuxt/BGcQMReV.js +0 -1
- package/.output/public/_nuxt/BNJJSRKh.js +0 -1
- package/.output/public/_nuxt/BNeeERBt.js +0 -1
- package/.output/public/_nuxt/BSJb5amZ.js +0 -1
- package/.output/public/_nuxt/BSsaE9Db.js +0 -1
- package/.output/public/_nuxt/BVO3XpHT.js +0 -1
- package/.output/public/_nuxt/B_Lr1vlV.js +0 -1
- package/.output/public/_nuxt/Bl0qBhCG.js +0 -1
- package/.output/public/_nuxt/Bl43dkDq.js +0 -1
- package/.output/public/_nuxt/BnMTFF5R.js +0 -1
- package/.output/public/_nuxt/BtV7oNn3.js +0 -1
- package/.output/public/_nuxt/BvFYnRMR.js +0 -1
- package/.output/public/_nuxt/BvTUBUNN.js +0 -1
- package/.output/public/_nuxt/ByLsRRoQ.js +0 -1
- package/.output/public/_nuxt/C1LcEMwB.js +0 -1
- package/.output/public/_nuxt/C2IiXp9N.js +0 -2
- package/.output/public/_nuxt/C796kFT9.js +0 -1
- package/.output/public/_nuxt/C8AtdrMH.js +0 -1
- package/.output/public/_nuxt/CAWbHTgy.js +0 -1
- package/.output/public/_nuxt/CJPrV25_.js +0 -1
- package/.output/public/_nuxt/CKKEWapF.js +0 -1
- package/.output/public/_nuxt/CNjv28J2.js +0 -1
- package/.output/public/_nuxt/CT8s4rqa.js +0 -1
- package/.output/public/_nuxt/CZSOrxUy.js +0 -1
- package/.output/public/_nuxt/CaNEL9JC.js +0 -39
- package/.output/public/_nuxt/CbTLg9oX.js +0 -1
- package/.output/public/_nuxt/CfCXpVn5.js +0 -1
- package/.output/public/_nuxt/ChmNlvWR.js +0 -1
- package/.output/public/_nuxt/Ck0QYdxe.js +0 -1
- package/.output/public/_nuxt/Ckb0pu4-.js +0 -1
- package/.output/public/_nuxt/CkwPRs1D.js +0 -1
- package/.output/public/_nuxt/CmEJg8C6.js +0 -2
- package/.output/public/_nuxt/CmL_vMJD.js +0 -1
- package/.output/public/_nuxt/Cq8zPxkT.js +0 -1
- package/.output/public/_nuxt/CxRnB4NC.js +0 -1
- package/.output/public/_nuxt/D0zMyG8n.js +0 -1
- package/.output/public/_nuxt/D1XYB283.js +0 -1
- package/.output/public/_nuxt/D2NxqyzW.js +0 -1
- package/.output/public/_nuxt/D5xyrvFu.js +0 -1
- package/.output/public/_nuxt/D8iBB0Py.js +0 -1
- package/.output/public/_nuxt/D8oIH8m1.js +0 -1
- package/.output/public/_nuxt/DB2zZev7.js +0 -1
- package/.output/public/_nuxt/DBrOAqkm.js +0 -1
- package/.output/public/_nuxt/DDXDFweK.js +0 -1
- package/.output/public/_nuxt/DFZkCmLQ.js +0 -1
- package/.output/public/_nuxt/DKZmgHNU.js +0 -1
- package/.output/public/_nuxt/DR8tGJhL.js +0 -1
- package/.output/public/_nuxt/DVAEVTjy.js +0 -1
- package/.output/public/_nuxt/DVqrPkCJ.js +0 -1
- package/.output/public/_nuxt/DWZ9ieYa.js +0 -1
- package/.output/public/_nuxt/DWj6VsZv.js +0 -1
- package/.output/public/_nuxt/DXJ9PxCv.js +0 -1
- package/.output/public/_nuxt/D_ziPROx.js +0 -1
- package/.output/public/_nuxt/Da2vwoYG.js +0 -1
- package/.output/public/_nuxt/Ddz3HcBB.js +0 -1
- package/.output/public/_nuxt/DgYei0bK.js +0 -1
- package/.output/public/_nuxt/Di_3GV_R.js +0 -1
- package/.output/public/_nuxt/Djog1f_e.js +0 -1
- package/.output/public/_nuxt/Dkap2-Pj.js +0 -7
- package/.output/public/_nuxt/DlJe_sHk.js +0 -1
- package/.output/public/_nuxt/DlPOQpH_.js +0 -1
- package/.output/public/_nuxt/DmYWMtVA.js +0 -1
- package/.output/public/_nuxt/DmxKU7sH.js +0 -1
- package/.output/public/_nuxt/DsodHRrQ.js +0 -1
- package/.output/public/_nuxt/DwSY6_2U.js +0 -1
- package/.output/public/_nuxt/DypJaSm-.js +0 -1
- package/.output/public/_nuxt/DzKaXH6P.js +0 -1
- package/.output/public/_nuxt/FK-jSuOT.js +0 -1
- package/.output/public/_nuxt/Fc2JsQt4.js +0 -1
- package/.output/public/_nuxt/IYCBGuRS.js +0 -1
- package/.output/public/_nuxt/NrRzUJNY.js +0 -1
- package/.output/public/_nuxt/OeVS0Rsb.js +0 -1
- package/.output/public/_nuxt/OlF0QnKF.js +0 -1
- package/.output/public/_nuxt/QuAoqY7t.js +0 -1
- package/.output/public/_nuxt/RlXHkmOd.js +0 -9
- package/.output/public/_nuxt/WZnvL9Dh.js +0 -1
- package/.output/public/_nuxt/ZvG7a1W3.js +0 -1
- package/.output/public/_nuxt/aPNZBVrG.js +0 -1
- package/.output/public/_nuxt/builds/meta/495aca73-bfa5-456e-b96a-f02e009c72d3.json +0 -1
- package/.output/public/_nuxt/dashboard.BxCOkJwt.css +0 -1
- package/.output/public/_nuxt/entry.C_udkZt9.css +0 -1
- package/.output/public/_nuxt/evY81hM3.js +0 -1
- package/.output/public/_nuxt/i6QBzaEi.js +0 -1
- package/.output/public/_nuxt/iTVKJ1kw.js +0 -1
- package/.output/public/_nuxt/j92uR3uR.js +0 -1
- package/.output/public/_nuxt/jdUkeAj_.js +0 -1
- package/.output/public/_nuxt/jeRvcMHU.js +0 -1
- package/.output/public/_nuxt/kuv0zpKq.js +0 -1
- package/.output/public/_nuxt/l3lKQs7b.js +0 -1
- package/.output/public/_nuxt/qIgZ7OXa.js +0 -1
- package/.output/public/_nuxt/qcVwZv8e.js +0 -1
- package/.output/public/_nuxt/ru8fqqWs.js +0 -1
- package/.output/public/_nuxt/sgmhgpCS.js +0 -1
- package/.output/public/_nuxt/y2jv0da-.js +0 -1
- package/.output/public/_nuxt/yyS4-kAX.js +0 -1
- package/.output/public/_nuxt/zIoBLBHF.js +0 -1
- package/.output/public/_nuxt/zpazwPgx.js +0 -1
- package/.output/server/chunks/build/_id_-DN00UDdO.mjs.map +0 -1
- package/.output/server/chunks/build/chat-m4-n9vC6.mjs.map +0 -1
- package/.output/server/chunks/build/docs-ChGwOPg5.mjs.map +0 -1
- package/.output/server/chunks/build/hooks-D328DcO6.mjs.map +0 -1
- package/.output/server/chunks/build/index-C9PuieXh.mjs +0 -820
- package/.output/server/chunks/build/index-C9PuieXh.mjs.map +0 -1
- package/.output/server/chunks/build/settings-B2KXoGcz.mjs +0 -3232
- package/.output/server/chunks/build/settings-B2KXoGcz.mjs.map +0 -1
- package/.output/server/chunks/build/tasks-DnAFqbtt.mjs.map +0 -1
- package/.output/server/chunks/build/useAgents-DHEXiFSc.mjs.map +0 -1
package/dist/cli/index.js
CHANGED
|
@@ -156,7 +156,7 @@ var require_src = __commonJS({
|
|
|
156
156
|
|
|
157
157
|
// src/commands/init.ts
|
|
158
158
|
import { execSync as execSync5 } from "child_process";
|
|
159
|
-
import { join as
|
|
159
|
+
import { join as join9 } from "path";
|
|
160
160
|
import crypto3 from "crypto";
|
|
161
161
|
|
|
162
162
|
// ../node_modules/.pnpm/@clack+core@1.0.1/node_modules/@clack/core/dist/index.mjs
|
|
@@ -1189,7 +1189,7 @@ ${l}
|
|
|
1189
1189
|
} }).prompt();
|
|
1190
1190
|
|
|
1191
1191
|
// src/commands/init.ts
|
|
1192
|
-
var
|
|
1192
|
+
var import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
1193
1193
|
|
|
1194
1194
|
// src/lib/prerequisites.ts
|
|
1195
1195
|
import { execSync } from "child_process";
|
|
@@ -1201,6 +1201,9 @@ function checkCommand(cmd) {
|
|
|
1201
1201
|
return null;
|
|
1202
1202
|
}
|
|
1203
1203
|
}
|
|
1204
|
+
function sleep(ms) {
|
|
1205
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1206
|
+
}
|
|
1204
1207
|
async function checkPrerequisites() {
|
|
1205
1208
|
R2.step("Checking prerequisites...");
|
|
1206
1209
|
const nodeOut = checkCommand("node --version");
|
|
@@ -1250,14 +1253,80 @@ async function checkPrerequisites() {
|
|
|
1250
1253
|
} else {
|
|
1251
1254
|
R2.success(`Claude Code ${claudeOut}`);
|
|
1252
1255
|
}
|
|
1256
|
+
let dockerInstalled = !!dockerOut;
|
|
1257
|
+
let dockerReady = false;
|
|
1253
1258
|
if (dockerOut) {
|
|
1254
|
-
|
|
1259
|
+
const daemonRunning = checkCommand("docker info");
|
|
1260
|
+
if (daemonRunning) {
|
|
1261
|
+
dockerReady = true;
|
|
1262
|
+
R2.success(`Docker available ${import_picocolors3.default.dim("(for local PostgreSQL)")}`);
|
|
1263
|
+
} else {
|
|
1264
|
+
R2.warn("Docker is installed but the daemon is not running");
|
|
1265
|
+
const startDocker = await Re({
|
|
1266
|
+
message: "Start Docker now?",
|
|
1267
|
+
initialValue: true
|
|
1268
|
+
});
|
|
1269
|
+
if (!Ct(startDocker) && startDocker) {
|
|
1270
|
+
const s = bt2();
|
|
1271
|
+
s.start("Starting Docker daemon");
|
|
1272
|
+
try {
|
|
1273
|
+
if (process.platform === "darwin") {
|
|
1274
|
+
execSync("open -a Docker", { stdio: "pipe" });
|
|
1275
|
+
} else if (process.platform === "linux") {
|
|
1276
|
+
execSync("sudo systemctl start docker", { stdio: "inherit" });
|
|
1277
|
+
}
|
|
1278
|
+
for (let i = 0; i < 30; i++) {
|
|
1279
|
+
await sleep(1e3);
|
|
1280
|
+
if (checkCommand("docker info")) {
|
|
1281
|
+
dockerReady = true;
|
|
1282
|
+
s.stop("Docker daemon is running");
|
|
1283
|
+
break;
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
if (!dockerReady) {
|
|
1287
|
+
s.stop("Docker daemon did not start in time");
|
|
1288
|
+
R2.warn("You can start it manually and continue with local PostgreSQL, or use remote PostgreSQL");
|
|
1289
|
+
}
|
|
1290
|
+
} catch {
|
|
1291
|
+
s.stop("Failed to start Docker daemon");
|
|
1292
|
+
R2.warn("Start Docker manually: https://docs.docker.com/get-docker/");
|
|
1293
|
+
}
|
|
1294
|
+
} else {
|
|
1295
|
+
R2.info("You can use a remote PostgreSQL instead");
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1255
1298
|
} else {
|
|
1256
|
-
|
|
1299
|
+
const installDocker = await Re({
|
|
1300
|
+
message: "Docker not found. Install it? (needed only for local PostgreSQL)",
|
|
1301
|
+
initialValue: false
|
|
1302
|
+
});
|
|
1303
|
+
if (!Ct(installDocker) && installDocker) {
|
|
1304
|
+
const s = bt2();
|
|
1305
|
+
s.start("Installing Docker");
|
|
1306
|
+
try {
|
|
1307
|
+
if (process.platform === "darwin") {
|
|
1308
|
+
execSync("brew install --cask docker", { stdio: "inherit" });
|
|
1309
|
+
s.stop("Docker Desktop installed \u2014 open it from Applications to finish setup");
|
|
1310
|
+
R2.info("Open Docker Desktop from Applications, then re-run this installer");
|
|
1311
|
+
} else {
|
|
1312
|
+
const cmd = process.platform === "linux" ? "sudo apt-get update -qq && sudo apt-get install -y -qq docker.io docker-compose-plugin" : "apt-get update -qq && apt-get install -y -qq docker.io docker-compose-plugin";
|
|
1313
|
+
execSync(cmd, { stdio: "inherit" });
|
|
1314
|
+
s.stop("Docker installed");
|
|
1315
|
+
}
|
|
1316
|
+
dockerInstalled = !!checkCommand("docker --version");
|
|
1317
|
+
dockerReady = !!checkCommand("docker info");
|
|
1318
|
+
} catch {
|
|
1319
|
+
s.stop("Docker installation failed");
|
|
1320
|
+
R2.warn("Install Docker manually: https://docs.docker.com/get-docker/");
|
|
1321
|
+
}
|
|
1322
|
+
} else {
|
|
1323
|
+
R2.info("Skipped \u2014 you can use a remote PostgreSQL instead");
|
|
1324
|
+
}
|
|
1257
1325
|
}
|
|
1258
1326
|
return {
|
|
1259
1327
|
ok: true,
|
|
1260
|
-
|
|
1328
|
+
dockerInstalled,
|
|
1329
|
+
dockerReady,
|
|
1261
1330
|
nodeVersion: nodeOut || "",
|
|
1262
1331
|
pythonVersion: pythonOut || "",
|
|
1263
1332
|
pnpmVersion: pnpmOut || "",
|
|
@@ -1447,13 +1516,15 @@ async function setupInstallDir(installDir) {
|
|
|
1447
1516
|
copyAppSource(packageDir, installDir);
|
|
1448
1517
|
s.stop("Application files installed");
|
|
1449
1518
|
}
|
|
1450
|
-
function writeMetadata(installDir, vaultPath, version) {
|
|
1519
|
+
function writeMetadata(installDir, vaultPath, version, dbPassword, dbPort) {
|
|
1451
1520
|
const metadata = {
|
|
1452
1521
|
version,
|
|
1453
1522
|
installedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1454
1523
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1455
1524
|
installDir,
|
|
1456
|
-
vaultPath
|
|
1525
|
+
vaultPath,
|
|
1526
|
+
dbPassword,
|
|
1527
|
+
dbPort
|
|
1457
1528
|
};
|
|
1458
1529
|
writeFileSync(join2(installDir, ".cognova"), JSON.stringify(metadata, null, 2));
|
|
1459
1530
|
const homeMeta = join2(process.env.HOME || "~", ".cognova");
|
|
@@ -1493,9 +1564,37 @@ async function setupVault() {
|
|
|
1493
1564
|
|
|
1494
1565
|
// src/lib/database.ts
|
|
1495
1566
|
import { execSync as execSync2 } from "child_process";
|
|
1567
|
+
import { existsSync as existsSync4, readFileSync as readFileSync2 } from "fs";
|
|
1568
|
+
import { join as join4 } from "path";
|
|
1496
1569
|
import crypto from "crypto";
|
|
1497
1570
|
var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
1498
|
-
|
|
1571
|
+
function checkPortInUse(port) {
|
|
1572
|
+
try {
|
|
1573
|
+
const containers = execSync2(`docker ps --filter "publish=${port}" --format "{{.Names}}"`, {
|
|
1574
|
+
encoding: "utf-8"
|
|
1575
|
+
}).trim();
|
|
1576
|
+
return containers.length > 0;
|
|
1577
|
+
} catch {
|
|
1578
|
+
try {
|
|
1579
|
+
execSync2(`lsof -i :${port}`, { stdio: "pipe" });
|
|
1580
|
+
return true;
|
|
1581
|
+
} catch {
|
|
1582
|
+
return false;
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
function readMetadata2() {
|
|
1587
|
+
try {
|
|
1588
|
+
const metaPath = join4(process.env.HOME || "~", ".cognova");
|
|
1589
|
+
if (!existsSync4(metaPath))
|
|
1590
|
+
return null;
|
|
1591
|
+
const content = readFileSync2(metaPath, "utf-8");
|
|
1592
|
+
return JSON.parse(content);
|
|
1593
|
+
} catch {
|
|
1594
|
+
return null;
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
async function setupDatabase(dockerReady) {
|
|
1499
1598
|
const dbType = await Je({
|
|
1500
1599
|
message: "Database setup",
|
|
1501
1600
|
options: [
|
|
@@ -1505,14 +1604,15 @@ async function setupDatabase(hasDocker) {
|
|
|
1505
1604
|
});
|
|
1506
1605
|
if (Ct(dbType)) process.exit(0);
|
|
1507
1606
|
if (dbType === "local") {
|
|
1508
|
-
if (!
|
|
1509
|
-
R2.error("Docker is
|
|
1510
|
-
R2.info("
|
|
1607
|
+
if (!dockerReady) {
|
|
1608
|
+
R2.error("Docker daemon is not running.");
|
|
1609
|
+
R2.info("Start Docker Desktop (macOS) or run: sudo systemctl start docker (Linux)");
|
|
1511
1610
|
R2.info('Or choose "Remote PostgreSQL" and use Neon: https://neon.tech');
|
|
1512
1611
|
process.exit(1);
|
|
1513
1612
|
}
|
|
1514
1613
|
const password = crypto.randomBytes(16).toString("hex");
|
|
1515
1614
|
const containerName = "cognova-db";
|
|
1615
|
+
let port = 5432;
|
|
1516
1616
|
try {
|
|
1517
1617
|
const existing = execSync2(`docker ps -a --filter name=${containerName} --format "{{.Status}}"`, {
|
|
1518
1618
|
encoding: "utf-8"
|
|
@@ -1527,6 +1627,17 @@ async function setupDatabase(hasDocker) {
|
|
|
1527
1627
|
if (reuse) {
|
|
1528
1628
|
if (!existing.startsWith("Up"))
|
|
1529
1629
|
execSync2(`docker start ${containerName}`, { stdio: "pipe" });
|
|
1630
|
+
const metadata = readMetadata2();
|
|
1631
|
+
if (metadata?.dbPassword && metadata?.dbPort) {
|
|
1632
|
+
const connectionString3 = `postgres://postgres:${metadata.dbPassword}@localhost:${metadata.dbPort}/cognova`;
|
|
1633
|
+
R2.info(`Using stored credentials (port ${metadata.dbPort})`);
|
|
1634
|
+
return {
|
|
1635
|
+
type: "local",
|
|
1636
|
+
connectionString: connectionString3,
|
|
1637
|
+
password: metadata.dbPassword,
|
|
1638
|
+
port: metadata.dbPort
|
|
1639
|
+
};
|
|
1640
|
+
}
|
|
1530
1641
|
R2.info("Using existing container. Ensure DATABASE_URL in .env matches its credentials.");
|
|
1531
1642
|
const connStr = await Ze({
|
|
1532
1643
|
message: "Connection string for existing container",
|
|
@@ -1540,6 +1651,23 @@ async function setupDatabase(hasDocker) {
|
|
|
1540
1651
|
}
|
|
1541
1652
|
} catch {
|
|
1542
1653
|
}
|
|
1654
|
+
if (checkPortInUse(port)) {
|
|
1655
|
+
R2.warn(`Port ${port} is already in use`);
|
|
1656
|
+
const altPort = await Ze({
|
|
1657
|
+
message: "Choose an alternative port",
|
|
1658
|
+
placeholder: "5433",
|
|
1659
|
+
defaultValue: "5433",
|
|
1660
|
+
validate: (v) => {
|
|
1661
|
+
const num = parseInt(v);
|
|
1662
|
+
if (isNaN(num) || num < 1024 || num > 65535)
|
|
1663
|
+
return "Port must be between 1024 and 65535";
|
|
1664
|
+
if (checkPortInUse(num))
|
|
1665
|
+
return `Port ${num} is also in use`;
|
|
1666
|
+
}
|
|
1667
|
+
});
|
|
1668
|
+
if (Ct(altPort)) process.exit(0);
|
|
1669
|
+
port = parseInt(altPort);
|
|
1670
|
+
}
|
|
1543
1671
|
const s = bt2();
|
|
1544
1672
|
s.start("Starting PostgreSQL container");
|
|
1545
1673
|
try {
|
|
@@ -1549,7 +1677,7 @@ async function setupDatabase(hasDocker) {
|
|
|
1549
1677
|
`-e POSTGRES_USER=postgres`,
|
|
1550
1678
|
`-e POSTGRES_PASSWORD=${password}`,
|
|
1551
1679
|
`-e POSTGRES_DB=cognova`,
|
|
1552
|
-
`-p
|
|
1680
|
+
`-p ${port}:5432`,
|
|
1553
1681
|
`--restart unless-stopped`,
|
|
1554
1682
|
`postgres:16-alpine`
|
|
1555
1683
|
].join(" "), { stdio: "pipe" });
|
|
@@ -1560,7 +1688,7 @@ async function setupDatabase(hasDocker) {
|
|
|
1560
1688
|
ready = true;
|
|
1561
1689
|
break;
|
|
1562
1690
|
} catch {
|
|
1563
|
-
await
|
|
1691
|
+
await sleep2(1e3);
|
|
1564
1692
|
}
|
|
1565
1693
|
}
|
|
1566
1694
|
if (!ready) {
|
|
@@ -1574,9 +1702,14 @@ async function setupDatabase(hasDocker) {
|
|
|
1574
1702
|
R2.error(`Docker error: ${err}`);
|
|
1575
1703
|
process.exit(1);
|
|
1576
1704
|
}
|
|
1577
|
-
const connectionString2 = `postgres://postgres:${password}@localhost
|
|
1705
|
+
const connectionString2 = `postgres://postgres:${password}@localhost:${port}/cognova`;
|
|
1578
1706
|
R2.info(`Connection: ${import_picocolors4.default.dim(connectionString2)}`);
|
|
1579
|
-
return {
|
|
1707
|
+
return {
|
|
1708
|
+
type: "local",
|
|
1709
|
+
connectionString: connectionString2,
|
|
1710
|
+
password,
|
|
1711
|
+
port
|
|
1712
|
+
};
|
|
1580
1713
|
}
|
|
1581
1714
|
const connectionString = await Ze({
|
|
1582
1715
|
message: "PostgreSQL connection string",
|
|
@@ -1589,13 +1722,13 @@ async function setupDatabase(hasDocker) {
|
|
|
1589
1722
|
if (Ct(connectionString)) process.exit(0);
|
|
1590
1723
|
return { type: "remote", connectionString };
|
|
1591
1724
|
}
|
|
1592
|
-
function
|
|
1725
|
+
function sleep2(ms) {
|
|
1593
1726
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1594
1727
|
}
|
|
1595
1728
|
|
|
1596
1729
|
// src/lib/config.ts
|
|
1597
|
-
import { readFileSync as
|
|
1598
|
-
import { join as
|
|
1730
|
+
import { readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
1731
|
+
import { join as join5 } from "path";
|
|
1599
1732
|
|
|
1600
1733
|
// src/templates/env.ts
|
|
1601
1734
|
import crypto2 from "crypto";
|
|
@@ -1634,11 +1767,11 @@ function generateEnvFile(config) {
|
|
|
1634
1767
|
// src/lib/config.ts
|
|
1635
1768
|
function writeEnvFile(config) {
|
|
1636
1769
|
const content = generateEnvFile(config);
|
|
1637
|
-
writeFileSync2(
|
|
1770
|
+
writeFileSync2(join5(config.installDir, ".env"), content);
|
|
1638
1771
|
}
|
|
1639
1772
|
function loadEnvFile(installDir) {
|
|
1640
1773
|
try {
|
|
1641
|
-
const content =
|
|
1774
|
+
const content = readFileSync3(join5(installDir, ".env"), "utf-8");
|
|
1642
1775
|
const env = {};
|
|
1643
1776
|
for (const line of content.split("\n")) {
|
|
1644
1777
|
const trimmed = line.trim();
|
|
@@ -1654,8 +1787,8 @@ function loadEnvFile(installDir) {
|
|
|
1654
1787
|
}
|
|
1655
1788
|
|
|
1656
1789
|
// src/lib/claude-config.ts
|
|
1657
|
-
import { cpSync as cpSync2, mkdirSync as mkdirSync3, existsSync as
|
|
1658
|
-
import { join as
|
|
1790
|
+
import { cpSync as cpSync2, mkdirSync as mkdirSync3, existsSync as existsSync5, writeFileSync as writeFileSync3, readFileSync as readFileSync4 } from "fs";
|
|
1791
|
+
import { join as join6 } from "path";
|
|
1659
1792
|
|
|
1660
1793
|
// src/templates/claude-md.ts
|
|
1661
1794
|
function generateClaudeMd(config) {
|
|
@@ -1899,27 +2032,27 @@ function generateSettingsJson(config) {
|
|
|
1899
2032
|
// src/lib/claude-config.ts
|
|
1900
2033
|
async function installClaudeConfig(config, options) {
|
|
1901
2034
|
const claudeDir = getClaudeDir();
|
|
1902
|
-
const sourceDir =
|
|
2035
|
+
const sourceDir = join6(getPackageDir(), "Claude");
|
|
1903
2036
|
const installAll = !options;
|
|
1904
2037
|
mkdirSync3(claudeDir, { recursive: true });
|
|
1905
2038
|
if (installAll || options?.skills) {
|
|
1906
|
-
const skillsSrc =
|
|
1907
|
-
if (
|
|
1908
|
-
cpSync2(skillsSrc,
|
|
2039
|
+
const skillsSrc = join6(sourceDir, "skills");
|
|
2040
|
+
if (existsSync5(skillsSrc))
|
|
2041
|
+
cpSync2(skillsSrc, join6(claudeDir, "skills"), { recursive: true, force: true });
|
|
1909
2042
|
}
|
|
1910
2043
|
if (installAll || options?.hooks) {
|
|
1911
|
-
const hooksSrc =
|
|
1912
|
-
if (
|
|
1913
|
-
cpSync2(hooksSrc,
|
|
2044
|
+
const hooksSrc = join6(sourceDir, "hooks");
|
|
2045
|
+
if (existsSync5(hooksSrc))
|
|
2046
|
+
cpSync2(hooksSrc, join6(claudeDir, "hooks"), { recursive: true, force: true });
|
|
1914
2047
|
}
|
|
1915
2048
|
if (installAll || options?.rules) {
|
|
1916
|
-
const rulesSrc =
|
|
1917
|
-
if (
|
|
1918
|
-
cpSync2(rulesSrc,
|
|
2049
|
+
const rulesSrc = join6(sourceDir, "rules");
|
|
2050
|
+
if (existsSync5(rulesSrc))
|
|
2051
|
+
cpSync2(rulesSrc, join6(claudeDir, "rules"), { recursive: true, force: true });
|
|
1919
2052
|
}
|
|
1920
2053
|
if (installAll || options?.claudeMd) {
|
|
1921
|
-
const claudeMdPath =
|
|
1922
|
-
if (
|
|
2054
|
+
const claudeMdPath = join6(claudeDir, "CLAUDE.md");
|
|
2055
|
+
if (existsSync5(claudeMdPath) && installAll) {
|
|
1923
2056
|
const overwrite = await Re({
|
|
1924
2057
|
message: "~/.claude/CLAUDE.md already exists. Overwrite?",
|
|
1925
2058
|
initialValue: false
|
|
@@ -1935,10 +2068,10 @@ async function installClaudeConfig(config, options) {
|
|
|
1935
2068
|
}
|
|
1936
2069
|
}
|
|
1937
2070
|
if (installAll || options?.settings) {
|
|
1938
|
-
const settingsPath =
|
|
1939
|
-
if (
|
|
2071
|
+
const settingsPath = join6(claudeDir, "settings.json");
|
|
2072
|
+
if (existsSync5(settingsPath) && installAll) {
|
|
1940
2073
|
try {
|
|
1941
|
-
const existing = JSON.parse(
|
|
2074
|
+
const existing = JSON.parse(readFileSync4(settingsPath, "utf-8"));
|
|
1942
2075
|
const generated = JSON.parse(generateSettingsJson(config));
|
|
1943
2076
|
const merged = mergeSettings(existing, generated);
|
|
1944
2077
|
writeFileSync3(settingsPath, JSON.stringify(merged, null, 2) + "\n");
|
|
@@ -1953,23 +2086,23 @@ async function installClaudeConfig(config, options) {
|
|
|
1953
2086
|
}
|
|
1954
2087
|
function syncClaudeConfig(sourceDir) {
|
|
1955
2088
|
const claudeDir = getClaudeDir();
|
|
1956
|
-
const claudeSrc =
|
|
1957
|
-
if (!
|
|
2089
|
+
const claudeSrc = join6(sourceDir, "Claude");
|
|
2090
|
+
if (!existsSync5(claudeSrc)) return;
|
|
1958
2091
|
mkdirSync3(claudeDir, { recursive: true });
|
|
1959
|
-
const skillsSrc =
|
|
1960
|
-
if (
|
|
1961
|
-
mkdirSync3(
|
|
1962
|
-
cpSync2(skillsSrc,
|
|
2092
|
+
const skillsSrc = join6(claudeSrc, "skills");
|
|
2093
|
+
if (existsSync5(skillsSrc)) {
|
|
2094
|
+
mkdirSync3(join6(claudeDir, "skills"), { recursive: true });
|
|
2095
|
+
cpSync2(skillsSrc, join6(claudeDir, "skills"), { recursive: true, force: true });
|
|
1963
2096
|
}
|
|
1964
|
-
const hooksSrc =
|
|
1965
|
-
if (
|
|
1966
|
-
mkdirSync3(
|
|
1967
|
-
cpSync2(hooksSrc,
|
|
2097
|
+
const hooksSrc = join6(claudeSrc, "hooks");
|
|
2098
|
+
if (existsSync5(hooksSrc)) {
|
|
2099
|
+
mkdirSync3(join6(claudeDir, "hooks"), { recursive: true });
|
|
2100
|
+
cpSync2(hooksSrc, join6(claudeDir, "hooks"), { recursive: true, force: true });
|
|
1968
2101
|
}
|
|
1969
|
-
const rulesSrc =
|
|
1970
|
-
if (
|
|
1971
|
-
mkdirSync3(
|
|
1972
|
-
cpSync2(rulesSrc,
|
|
2102
|
+
const rulesSrc = join6(claudeSrc, "rules");
|
|
2103
|
+
if (existsSync5(rulesSrc)) {
|
|
2104
|
+
mkdirSync3(join6(claudeDir, "rules"), { recursive: true });
|
|
2105
|
+
cpSync2(rulesSrc, join6(claudeDir, "rules"), { recursive: true, force: true });
|
|
1973
2106
|
}
|
|
1974
2107
|
}
|
|
1975
2108
|
function mergeSettings(existing, generated) {
|
|
@@ -1985,8 +2118,8 @@ function mergeSettings(existing, generated) {
|
|
|
1985
2118
|
|
|
1986
2119
|
// src/lib/process-manager.ts
|
|
1987
2120
|
import { execSync as execSync3 } from "child_process";
|
|
1988
|
-
import { writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, existsSync as
|
|
1989
|
-
import { join as
|
|
2121
|
+
import { writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, existsSync as existsSync6 } from "fs";
|
|
2122
|
+
import { join as join7 } from "path";
|
|
1990
2123
|
|
|
1991
2124
|
// src/templates/pm2-ecosystem.ts
|
|
1992
2125
|
function generatePm2Ecosystem(config) {
|
|
@@ -2058,11 +2191,11 @@ async function setupAndStart(config) {
|
|
|
2058
2191
|
return;
|
|
2059
2192
|
}
|
|
2060
2193
|
}
|
|
2061
|
-
const logsDir =
|
|
2062
|
-
if (!
|
|
2194
|
+
const logsDir = join7(config.installDir, "logs");
|
|
2195
|
+
if (!existsSync6(logsDir))
|
|
2063
2196
|
mkdirSync4(logsDir, { recursive: true });
|
|
2064
2197
|
const ecosystem = generatePm2Ecosystem(config);
|
|
2065
|
-
writeFileSync4(
|
|
2198
|
+
writeFileSync4(join7(config.installDir, "ecosystem.config.cjs"), ecosystem);
|
|
2066
2199
|
const s = bt2();
|
|
2067
2200
|
s.start("Starting Cognova with PM2");
|
|
2068
2201
|
try {
|
|
@@ -2099,103 +2232,278 @@ async function waitForHealth(url, maxWaitSeconds = 30) {
|
|
|
2099
2232
|
return false;
|
|
2100
2233
|
}
|
|
2101
2234
|
|
|
2235
|
+
// src/lib/progress.ts
|
|
2236
|
+
import { existsSync as existsSync7, readFileSync as readFileSync5, writeFileSync as writeFileSync5, unlinkSync } from "fs";
|
|
2237
|
+
import { join as join8 } from "path";
|
|
2238
|
+
var PROGRESS_FILE = join8(process.env.HOME || "~", ".cognova-setup.json");
|
|
2239
|
+
function loadProgress() {
|
|
2240
|
+
try {
|
|
2241
|
+
if (!existsSync7(PROGRESS_FILE))
|
|
2242
|
+
return null;
|
|
2243
|
+
const content = readFileSync5(PROGRESS_FILE, "utf-8");
|
|
2244
|
+
return JSON.parse(content);
|
|
2245
|
+
} catch {
|
|
2246
|
+
return null;
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
function saveProgress(progress) {
|
|
2250
|
+
try {
|
|
2251
|
+
const content = JSON.stringify(progress, null, 2);
|
|
2252
|
+
writeFileSync5(PROGRESS_FILE, content, "utf-8");
|
|
2253
|
+
} catch (err) {
|
|
2254
|
+
console.warn(`Failed to save progress: ${err}`);
|
|
2255
|
+
}
|
|
2256
|
+
}
|
|
2257
|
+
function clearProgress() {
|
|
2258
|
+
try {
|
|
2259
|
+
if (existsSync7(PROGRESS_FILE))
|
|
2260
|
+
unlinkSync(PROGRESS_FILE);
|
|
2261
|
+
} catch {
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
// src/lib/retry.ts
|
|
2266
|
+
var import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
2267
|
+
var SkipError = class extends Error {
|
|
2268
|
+
constructor() {
|
|
2269
|
+
super("Step skipped by user");
|
|
2270
|
+
this.name = "SkipError";
|
|
2271
|
+
}
|
|
2272
|
+
};
|
|
2273
|
+
async function withRetry(label, fn, options = {}) {
|
|
2274
|
+
const { maxRetries = 3, canSkip = true } = options;
|
|
2275
|
+
let attempt = 0;
|
|
2276
|
+
while (true) {
|
|
2277
|
+
try {
|
|
2278
|
+
return await fn();
|
|
2279
|
+
} catch (err) {
|
|
2280
|
+
attempt++;
|
|
2281
|
+
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
2282
|
+
R2.error(`${label} failed: ${errorMsg}`);
|
|
2283
|
+
if (attempt >= maxRetries) {
|
|
2284
|
+
R2.error(`Maximum retry attempts (${maxRetries}) reached`);
|
|
2285
|
+
if (!canSkip) {
|
|
2286
|
+
R2.error("This step cannot be skipped. Setup aborted.");
|
|
2287
|
+
process.exit(1);
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
const choices = [
|
|
2291
|
+
{ value: "retry", label: "Retry", hint: "Try again" }
|
|
2292
|
+
];
|
|
2293
|
+
if (canSkip) {
|
|
2294
|
+
choices.push({ value: "skip", label: "Skip", hint: "Continue without this step" });
|
|
2295
|
+
}
|
|
2296
|
+
choices.push({ value: "abort", label: "Abort", hint: "Exit setup" });
|
|
2297
|
+
const action = await Je({
|
|
2298
|
+
message: `${label} failed. What would you like to do?`,
|
|
2299
|
+
options: choices
|
|
2300
|
+
});
|
|
2301
|
+
if (Ct(action) || action === "abort") {
|
|
2302
|
+
R2.warn("Setup aborted by user");
|
|
2303
|
+
process.exit(1);
|
|
2304
|
+
}
|
|
2305
|
+
if (action === "skip") {
|
|
2306
|
+
throw new SkipError();
|
|
2307
|
+
}
|
|
2308
|
+
R2.info(import_picocolors5.default.dim(`Retrying ${label}...`));
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
|
|
2102
2313
|
// src/commands/init.ts
|
|
2103
2314
|
async function init() {
|
|
2104
|
-
We(
|
|
2105
|
-
const
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
const resolvedInstallDir = installDir.replace("~", process.env.HOME || "");
|
|
2117
|
-
await setupInstallDir(resolvedInstallDir);
|
|
2118
|
-
R2.step(import_picocolors5.default.bold("Vault"));
|
|
2119
|
-
const vault = await setupVault();
|
|
2120
|
-
R2.step(import_picocolors5.default.bold("Database"));
|
|
2121
|
-
const database = await setupDatabase(prereqs.hasDocker);
|
|
2122
|
-
R2.step(import_picocolors5.default.bold("Network Access"));
|
|
2123
|
-
const accessMode = await Je({
|
|
2124
|
-
message: "How will you access Cognova?",
|
|
2125
|
-
options: [
|
|
2126
|
-
{ value: "localhost", label: "Local only", hint: "http://localhost:3000" },
|
|
2127
|
-
{ value: "specific", label: "Specific IP or domain", hint: "LAN IP, hostname, or domain" },
|
|
2128
|
-
{ value: "any", label: "Any connection", hint: "Accepts requests from any origin (0.0.0.0)" }
|
|
2129
|
-
]
|
|
2130
|
-
});
|
|
2131
|
-
if (Ct(accessMode)) process.exit(0);
|
|
2132
|
-
let appUrl = "http://localhost:3000";
|
|
2133
|
-
if (accessMode === "specific") {
|
|
2134
|
-
const host = await Ze({
|
|
2135
|
-
message: "IP address or domain (include port if not 80/443)",
|
|
2136
|
-
placeholder: "192.168.1.100:3000"
|
|
2315
|
+
We(import_picocolors6.default.bgCyan(import_picocolors6.default.black(" Cognova Setup ")));
|
|
2316
|
+
const existingProgress = loadProgress();
|
|
2317
|
+
let progress = existingProgress || {
|
|
2318
|
+
completedSteps: [],
|
|
2319
|
+
partialConfig: {},
|
|
2320
|
+
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2321
|
+
};
|
|
2322
|
+
if (existingProgress) {
|
|
2323
|
+
R2.warn("Previous setup was interrupted");
|
|
2324
|
+
const resume = await Re({
|
|
2325
|
+
message: "Resume from where you left off?",
|
|
2326
|
+
initialValue: true
|
|
2137
2327
|
});
|
|
2138
|
-
if (Ct(
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2328
|
+
if (Ct(resume)) process.exit(0);
|
|
2329
|
+
if (!resume) {
|
|
2330
|
+
clearProgress();
|
|
2331
|
+
progress = {
|
|
2332
|
+
completedSteps: [],
|
|
2333
|
+
partialConfig: {},
|
|
2334
|
+
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2335
|
+
};
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
const prereqs = progress.completedSteps.includes("prerequisites") ? { ok: true, dockerInstalled: true, dockerReady: true, nodeVersion: "", pythonVersion: "", pnpmVersion: "", claudeInstalled: true } : await checkPrerequisites();
|
|
2339
|
+
if (!progress.completedSteps.includes("prerequisites")) {
|
|
2340
|
+
progress.completedSteps.push("prerequisites");
|
|
2341
|
+
saveProgress(progress);
|
|
2342
|
+
}
|
|
2343
|
+
R2.step(import_picocolors6.default.bold("Agent Personality"));
|
|
2344
|
+
const personality = progress.partialConfig.personality || await promptPersonality();
|
|
2345
|
+
if (!progress.completedSteps.includes("personality")) {
|
|
2346
|
+
progress.partialConfig.personality = personality;
|
|
2347
|
+
progress.completedSteps.push("personality");
|
|
2348
|
+
saveProgress(progress);
|
|
2349
|
+
}
|
|
2350
|
+
R2.step(import_picocolors6.default.bold("Installation"));
|
|
2351
|
+
const defaultDir = join9(process.env.HOME || "~", "cognova");
|
|
2352
|
+
let resolvedInstallDir;
|
|
2353
|
+
if (progress.partialConfig.installDir) {
|
|
2354
|
+
resolvedInstallDir = progress.partialConfig.installDir;
|
|
2355
|
+
R2.info(`Using install directory: ${resolvedInstallDir}`);
|
|
2356
|
+
} else {
|
|
2357
|
+
const installDir = await Ze({
|
|
2358
|
+
message: "Where should Cognova be installed?",
|
|
2359
|
+
placeholder: defaultDir,
|
|
2360
|
+
defaultValue: defaultDir
|
|
2361
|
+
});
|
|
2362
|
+
if (Ct(installDir)) process.exit(0);
|
|
2363
|
+
resolvedInstallDir = installDir.replace("~", process.env.HOME || "");
|
|
2364
|
+
await setupInstallDir(resolvedInstallDir);
|
|
2365
|
+
progress.partialConfig.installDir = resolvedInstallDir;
|
|
2366
|
+
progress.completedSteps.push("installDir");
|
|
2367
|
+
saveProgress(progress);
|
|
2368
|
+
}
|
|
2369
|
+
R2.step(import_picocolors6.default.bold("Vault"));
|
|
2370
|
+
const vault = progress.partialConfig.vault || await setupVault();
|
|
2371
|
+
if (!progress.completedSteps.includes("vault")) {
|
|
2372
|
+
progress.partialConfig.vault = vault;
|
|
2373
|
+
progress.completedSteps.push("vault");
|
|
2374
|
+
saveProgress(progress);
|
|
2375
|
+
}
|
|
2376
|
+
R2.step(import_picocolors6.default.bold("Database"));
|
|
2377
|
+
let database = progress.partialConfig.database;
|
|
2378
|
+
if (!database) {
|
|
2379
|
+
try {
|
|
2380
|
+
database = await withRetry(
|
|
2381
|
+
"Database setup",
|
|
2382
|
+
() => setupDatabase(prereqs.dockerReady),
|
|
2383
|
+
{ canSkip: false }
|
|
2384
|
+
);
|
|
2385
|
+
progress.partialConfig.database = database;
|
|
2386
|
+
progress.completedSteps.push("database");
|
|
2387
|
+
saveProgress(progress);
|
|
2388
|
+
} catch (err) {
|
|
2389
|
+
if (err instanceof SkipError) {
|
|
2390
|
+
R2.error("Database setup is required and cannot be skipped");
|
|
2175
2391
|
}
|
|
2392
|
+
process.exit(1);
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
R2.step(import_picocolors6.default.bold("Network Access"));
|
|
2396
|
+
let accessMode;
|
|
2397
|
+
let appUrl;
|
|
2398
|
+
if (progress.partialConfig.accessMode && progress.partialConfig.appUrl) {
|
|
2399
|
+
accessMode = progress.partialConfig.accessMode;
|
|
2400
|
+
appUrl = progress.partialConfig.appUrl;
|
|
2401
|
+
R2.info(`Using access mode: ${accessMode} (${appUrl})`);
|
|
2402
|
+
} else {
|
|
2403
|
+
accessMode = await Je({
|
|
2404
|
+
message: "How will you access Cognova?",
|
|
2405
|
+
options: [
|
|
2406
|
+
{ value: "localhost", label: "Local only", hint: "http://localhost:3000" },
|
|
2407
|
+
{ value: "specific", label: "Specific IP or domain", hint: "LAN IP, hostname, or domain" },
|
|
2408
|
+
{ value: "any", label: "Any connection", hint: "Accepts requests from any origin (0.0.0.0)" }
|
|
2409
|
+
]
|
|
2176
2410
|
});
|
|
2177
|
-
if (Ct(
|
|
2178
|
-
|
|
2179
|
-
|
|
2411
|
+
if (Ct(accessMode)) process.exit(0);
|
|
2412
|
+
appUrl = "http://localhost:3000";
|
|
2413
|
+
if (accessMode === "specific") {
|
|
2414
|
+
const host = await Ze({
|
|
2415
|
+
message: "IP address or domain (include port if not 80/443)",
|
|
2416
|
+
placeholder: "192.168.1.100:3000"
|
|
2417
|
+
});
|
|
2418
|
+
if (Ct(host)) process.exit(0);
|
|
2419
|
+
appUrl = host.startsWith("http") ? host : `http://${host}`;
|
|
2420
|
+
}
|
|
2421
|
+
progress.partialConfig.accessMode = accessMode;
|
|
2422
|
+
progress.partialConfig.appUrl = appUrl;
|
|
2423
|
+
progress.completedSteps.push("network");
|
|
2424
|
+
saveProgress(progress);
|
|
2425
|
+
}
|
|
2426
|
+
if (!progress.completedSteps.includes("security")) {
|
|
2427
|
+
R2.warn(import_picocolors6.default.yellow(import_picocolors6.default.bold("Security Notice")));
|
|
2428
|
+
R2.warn([
|
|
2429
|
+
"Cognova gives an AI agent unrestricted access to this machine.",
|
|
2430
|
+
"It can read, write, and execute anything via the embedded terminal",
|
|
2431
|
+
"and Claude Code CLI.",
|
|
2432
|
+
"",
|
|
2433
|
+
` ${import_picocolors6.default.dim("\u2022")} Do not run on a personal machine or alongside sensitive data`,
|
|
2434
|
+
` ${import_picocolors6.default.dim("\u2022")} Use a dedicated VM, container, or isolated environment`,
|
|
2435
|
+
` ${import_picocolors6.default.dim("\u2022")} Put a reverse proxy with TLS in front for remote access`,
|
|
2436
|
+
` ${import_picocolors6.default.dim("\u2022")} Do not store SSH keys, cloud creds, or production secrets here`
|
|
2437
|
+
].join("\n"));
|
|
2438
|
+
if (accessMode === "any") {
|
|
2439
|
+
R2.warn(import_picocolors6.default.red(
|
|
2440
|
+
"Binding to 0.0.0.0 exposes this to your entire network."
|
|
2441
|
+
));
|
|
2442
|
+
}
|
|
2443
|
+
const proceed = await Re({
|
|
2444
|
+
message: "I understand the risks. Continue?",
|
|
2445
|
+
initialValue: false
|
|
2446
|
+
});
|
|
2447
|
+
if (Ct(proceed) || !proceed) process.exit(0);
|
|
2448
|
+
progress.completedSteps.push("security");
|
|
2449
|
+
saveProgress(progress);
|
|
2450
|
+
}
|
|
2451
|
+
R2.step(import_picocolors6.default.bold("Authentication"));
|
|
2452
|
+
let adminEmail;
|
|
2453
|
+
let adminPassword;
|
|
2454
|
+
let adminName;
|
|
2455
|
+
if (progress.partialConfig.auth) {
|
|
2456
|
+
adminEmail = progress.partialConfig.auth.adminEmail;
|
|
2457
|
+
adminPassword = progress.partialConfig.auth.adminPassword;
|
|
2458
|
+
adminName = progress.partialConfig.auth.adminName;
|
|
2459
|
+
R2.info(`Using admin: ${adminEmail}`);
|
|
2460
|
+
} else {
|
|
2461
|
+
const emailInput = await Ze({
|
|
2462
|
+
message: "Admin email",
|
|
2463
|
+
placeholder: "admin@example.com",
|
|
2464
|
+
defaultValue: "admin@example.com"
|
|
2180
2465
|
});
|
|
2181
|
-
if (Ct(
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2466
|
+
if (Ct(emailInput)) process.exit(0);
|
|
2467
|
+
adminEmail = emailInput;
|
|
2468
|
+
while (true) {
|
|
2469
|
+
const pw = await He({
|
|
2470
|
+
message: "Admin password",
|
|
2471
|
+
validate: (v) => {
|
|
2472
|
+
if (!v || v.length < 8) return "Minimum 8 characters";
|
|
2473
|
+
}
|
|
2474
|
+
});
|
|
2475
|
+
if (Ct(pw)) process.exit(0);
|
|
2476
|
+
const confirm = await He({
|
|
2477
|
+
message: "Confirm password"
|
|
2478
|
+
});
|
|
2479
|
+
if (Ct(confirm)) process.exit(0);
|
|
2480
|
+
if (pw === confirm) {
|
|
2481
|
+
adminPassword = pw;
|
|
2482
|
+
break;
|
|
2483
|
+
}
|
|
2484
|
+
R2.warn("Passwords do not match. Try again.");
|
|
2185
2485
|
}
|
|
2186
|
-
|
|
2486
|
+
const nameInput = await Ze({
|
|
2487
|
+
message: "Admin display name",
|
|
2488
|
+
placeholder: personality.userName,
|
|
2489
|
+
defaultValue: personality.userName
|
|
2490
|
+
});
|
|
2491
|
+
if (Ct(nameInput)) process.exit(0);
|
|
2492
|
+
adminName = nameInput;
|
|
2493
|
+
progress.partialConfig.auth = {
|
|
2494
|
+
adminEmail,
|
|
2495
|
+
adminPassword,
|
|
2496
|
+
adminName,
|
|
2497
|
+
authSecret: crypto3.randomBytes(32).toString("base64")
|
|
2498
|
+
};
|
|
2499
|
+
progress.completedSteps.push("auth");
|
|
2500
|
+
saveProgress(progress);
|
|
2187
2501
|
}
|
|
2188
|
-
const adminName = await Ze({
|
|
2189
|
-
message: "Admin display name",
|
|
2190
|
-
placeholder: personality.userName,
|
|
2191
|
-
defaultValue: personality.userName
|
|
2192
|
-
});
|
|
2193
|
-
if (Ct(adminName)) process.exit(0);
|
|
2194
2502
|
const config = {
|
|
2195
2503
|
personality,
|
|
2196
2504
|
vault,
|
|
2197
2505
|
database,
|
|
2198
|
-
auth: {
|
|
2506
|
+
auth: progress.partialConfig.auth || {
|
|
2199
2507
|
adminEmail,
|
|
2200
2508
|
adminPassword,
|
|
2201
2509
|
adminName,
|
|
@@ -2205,7 +2513,7 @@ async function init() {
|
|
|
2205
2513
|
accessMode,
|
|
2206
2514
|
installDir: resolvedInstallDir
|
|
2207
2515
|
};
|
|
2208
|
-
R2.step(
|
|
2516
|
+
R2.step(import_picocolors6.default.bold("Configuration"));
|
|
2209
2517
|
const s = bt2();
|
|
2210
2518
|
s.start("Writing .env");
|
|
2211
2519
|
writeEnvFile(config);
|
|
@@ -2213,24 +2521,86 @@ async function init() {
|
|
|
2213
2521
|
s.start("Installing Claude Code configuration");
|
|
2214
2522
|
await installClaudeConfig(config);
|
|
2215
2523
|
s.stop("Claude config installed to ~/.claude/");
|
|
2216
|
-
writeMetadata(
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2524
|
+
writeMetadata(
|
|
2525
|
+
resolvedInstallDir,
|
|
2526
|
+
vault.path,
|
|
2527
|
+
getPackageVersion(),
|
|
2528
|
+
database.password,
|
|
2529
|
+
database.port
|
|
2530
|
+
);
|
|
2531
|
+
R2.step(import_picocolors6.default.bold("Setup"));
|
|
2532
|
+
if (!progress.completedSteps.includes("install")) {
|
|
2533
|
+
try {
|
|
2534
|
+
await withRetry(
|
|
2535
|
+
"Dependency installation",
|
|
2536
|
+
async () => {
|
|
2537
|
+
s.start("Installing dependencies");
|
|
2538
|
+
execSync5("pnpm install", { cwd: resolvedInstallDir, stdio: "pipe" });
|
|
2539
|
+
s.stop("Dependencies installed");
|
|
2540
|
+
},
|
|
2541
|
+
{ canSkip: false }
|
|
2542
|
+
);
|
|
2543
|
+
progress.completedSteps.push("install");
|
|
2544
|
+
saveProgress(progress);
|
|
2545
|
+
} catch (err) {
|
|
2546
|
+
s.stop("Dependency installation failed");
|
|
2547
|
+
if (err instanceof SkipError) {
|
|
2548
|
+
R2.error("Dependency installation is required and cannot be skipped");
|
|
2549
|
+
}
|
|
2550
|
+
process.exit(1);
|
|
2551
|
+
}
|
|
2552
|
+
} else {
|
|
2553
|
+
R2.info("Dependencies already installed");
|
|
2554
|
+
}
|
|
2555
|
+
R2.step(import_picocolors6.default.bold("Launch"));
|
|
2556
|
+
if (!progress.completedSteps.includes("pm2")) {
|
|
2557
|
+
try {
|
|
2558
|
+
await withRetry(
|
|
2559
|
+
"PM2 setup and start",
|
|
2560
|
+
() => setupAndStart(config),
|
|
2561
|
+
{ canSkip: false }
|
|
2562
|
+
);
|
|
2563
|
+
progress.completedSteps.push("pm2");
|
|
2564
|
+
saveProgress(progress);
|
|
2565
|
+
} catch (err) {
|
|
2566
|
+
if (err instanceof SkipError) {
|
|
2567
|
+
R2.error("PM2 setup is required and cannot be skipped");
|
|
2568
|
+
}
|
|
2569
|
+
process.exit(1);
|
|
2570
|
+
}
|
|
2571
|
+
} else {
|
|
2572
|
+
R2.info("PM2 already configured");
|
|
2573
|
+
}
|
|
2574
|
+
if (!progress.completedSteps.includes("health")) {
|
|
2575
|
+
try {
|
|
2576
|
+
await withRetry(
|
|
2577
|
+
"Health check",
|
|
2578
|
+
() => waitForHealth("http://localhost:3000"),
|
|
2579
|
+
{ canSkip: true }
|
|
2580
|
+
);
|
|
2581
|
+
progress.completedSteps.push("health");
|
|
2582
|
+
saveProgress(progress);
|
|
2583
|
+
} catch (err) {
|
|
2584
|
+
if (err instanceof SkipError) {
|
|
2585
|
+
R2.warn("Health check skipped - app may not be fully started");
|
|
2586
|
+
R2.info("Check status with: pm2 status");
|
|
2587
|
+
} else {
|
|
2588
|
+
process.exit(1);
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
} else {
|
|
2592
|
+
R2.info("App already healthy");
|
|
2593
|
+
}
|
|
2594
|
+
R2.step(import_picocolors6.default.bold("Summary"));
|
|
2225
2595
|
R2.info([
|
|
2226
2596
|
"",
|
|
2227
|
-
` ${
|
|
2228
|
-
` ${
|
|
2229
|
-
` ${
|
|
2230
|
-
` ${
|
|
2231
|
-
` ${
|
|
2597
|
+
` ${import_picocolors6.default.cyan("App URL:")} ${config.appUrl}`,
|
|
2598
|
+
` ${import_picocolors6.default.cyan("Admin Login:")} ${config.auth.adminEmail}`,
|
|
2599
|
+
` ${import_picocolors6.default.cyan("Vault:")} ${vault.path}`,
|
|
2600
|
+
` ${import_picocolors6.default.cyan("Install Dir:")} ${resolvedInstallDir}`,
|
|
2601
|
+
` ${import_picocolors6.default.cyan("Agent:")} ${personality.agentName}`,
|
|
2232
2602
|
"",
|
|
2233
|
-
` ${
|
|
2603
|
+
` ${import_picocolors6.default.dim("Manage:")}`,
|
|
2234
2604
|
` cognova start Start the app`,
|
|
2235
2605
|
` cognova stop Stop the app`,
|
|
2236
2606
|
` cognova restart Restart the app`,
|
|
@@ -2242,17 +2612,18 @@ async function init() {
|
|
|
2242
2612
|
` pm2 monit Monitor resources`,
|
|
2243
2613
|
""
|
|
2244
2614
|
].join("\n"));
|
|
2245
|
-
Le(`${personality.agentName} is ready. Open ${
|
|
2615
|
+
Le(`${personality.agentName} is ready. Open ${import_picocolors6.default.underline(config.appUrl)} to get started.`);
|
|
2616
|
+
clearProgress();
|
|
2246
2617
|
}
|
|
2247
2618
|
|
|
2248
2619
|
// src/commands/start.ts
|
|
2249
2620
|
import { execSync as execSync6 } from "child_process";
|
|
2250
|
-
import { existsSync as
|
|
2251
|
-
import { join as
|
|
2621
|
+
import { existsSync as existsSync8 } from "fs";
|
|
2622
|
+
import { join as join10 } from "path";
|
|
2252
2623
|
async function start() {
|
|
2253
2624
|
const installDir = findInstallDir();
|
|
2254
|
-
const ecosystem =
|
|
2255
|
-
if (!
|
|
2625
|
+
const ecosystem = join10(installDir, "ecosystem.config.cjs");
|
|
2626
|
+
if (!existsSync8(ecosystem)) {
|
|
2256
2627
|
console.error("No ecosystem.config.cjs found. Run `cognova init` first.");
|
|
2257
2628
|
process.exit(1);
|
|
2258
2629
|
}
|
|
@@ -2278,9 +2649,9 @@ async function restart() {
|
|
|
2278
2649
|
|
|
2279
2650
|
// src/commands/update.ts
|
|
2280
2651
|
import { execSync as execSync7 } from "child_process";
|
|
2281
|
-
import { existsSync as
|
|
2282
|
-
import { join as
|
|
2283
|
-
var
|
|
2652
|
+
import { existsSync as existsSync9, cpSync as cpSync3, rmSync } from "fs";
|
|
2653
|
+
import { join as join11 } from "path";
|
|
2654
|
+
var import_picocolors7 = __toESM(require_picocolors(), 1);
|
|
2284
2655
|
var BACKUP_ITEMS = [
|
|
2285
2656
|
"app",
|
|
2286
2657
|
"server",
|
|
@@ -2294,33 +2665,33 @@ var BACKUP_ITEMS = [
|
|
|
2294
2665
|
"pnpm-lock.yaml"
|
|
2295
2666
|
];
|
|
2296
2667
|
function createBackup(installDir) {
|
|
2297
|
-
const backupDir =
|
|
2298
|
-
if (
|
|
2668
|
+
const backupDir = join11(installDir, ".update-backup");
|
|
2669
|
+
if (existsSync9(backupDir))
|
|
2299
2670
|
rmSync(backupDir, { recursive: true });
|
|
2300
2671
|
for (const item of BACKUP_ITEMS) {
|
|
2301
|
-
const src =
|
|
2302
|
-
if (!
|
|
2303
|
-
const dest =
|
|
2672
|
+
const src = join11(installDir, item);
|
|
2673
|
+
if (!existsSync9(src)) continue;
|
|
2674
|
+
const dest = join11(backupDir, item);
|
|
2304
2675
|
cpSync3(src, dest, { recursive: true });
|
|
2305
2676
|
}
|
|
2306
2677
|
return backupDir;
|
|
2307
2678
|
}
|
|
2308
2679
|
function restoreBackup(installDir, backupDir) {
|
|
2309
2680
|
for (const item of BACKUP_ITEMS) {
|
|
2310
|
-
const src =
|
|
2311
|
-
if (!
|
|
2312
|
-
const dest =
|
|
2313
|
-
if (
|
|
2681
|
+
const src = join11(backupDir, item);
|
|
2682
|
+
if (!existsSync9(src)) continue;
|
|
2683
|
+
const dest = join11(installDir, item);
|
|
2684
|
+
if (existsSync9(dest))
|
|
2314
2685
|
rmSync(dest, { recursive: true });
|
|
2315
2686
|
cpSync3(src, dest, { recursive: true });
|
|
2316
2687
|
}
|
|
2317
2688
|
}
|
|
2318
2689
|
function cleanupBackup(backupDir) {
|
|
2319
|
-
if (
|
|
2690
|
+
if (existsSync9(backupDir))
|
|
2320
2691
|
rmSync(backupDir, { recursive: true });
|
|
2321
2692
|
}
|
|
2322
2693
|
async function update() {
|
|
2323
|
-
We(
|
|
2694
|
+
We(import_picocolors7.default.bgCyan(import_picocolors7.default.black(" Cognova Update ")));
|
|
2324
2695
|
const installDir = findInstallDir();
|
|
2325
2696
|
const metadata = readMetadata(installDir);
|
|
2326
2697
|
if (!metadata) {
|
|
@@ -2342,7 +2713,7 @@ async function update() {
|
|
|
2342
2713
|
Le("Nothing to update.");
|
|
2343
2714
|
return;
|
|
2344
2715
|
}
|
|
2345
|
-
s.stop(`Update available: ${metadata.version} \u2192 ${
|
|
2716
|
+
s.stop(`Update available: ${metadata.version} \u2192 ${import_picocolors7.default.green(latestVersion)}`);
|
|
2346
2717
|
s.start("Creating backup");
|
|
2347
2718
|
const backupDir = createBackup(installDir);
|
|
2348
2719
|
s.stop("Backup created");
|
|
@@ -2371,14 +2742,14 @@ async function update() {
|
|
|
2371
2742
|
s.stop("Migrations complete");
|
|
2372
2743
|
} catch (err) {
|
|
2373
2744
|
updateFailed = true;
|
|
2374
|
-
s.stop(
|
|
2745
|
+
s.stop(import_picocolors7.default.red("Update failed"));
|
|
2375
2746
|
const execErr = err;
|
|
2376
2747
|
R2.error(`Error: ${execErr.message || err}`);
|
|
2377
2748
|
if (execErr.stdout)
|
|
2378
|
-
R2.error(
|
|
2749
|
+
R2.error(import_picocolors7.default.dim(String(execErr.stdout).trim()));
|
|
2379
2750
|
if (execErr.stderr)
|
|
2380
|
-
R2.error(
|
|
2381
|
-
R2.step(
|
|
2751
|
+
R2.error(import_picocolors7.default.dim(String(execErr.stderr).trim()));
|
|
2752
|
+
R2.step(import_picocolors7.default.bold("Rolling back"));
|
|
2382
2753
|
const rollbackSpinner = bt2();
|
|
2383
2754
|
rollbackSpinner.start("Restoring previous version");
|
|
2384
2755
|
try {
|
|
@@ -2387,7 +2758,7 @@ async function update() {
|
|
|
2387
2758
|
rollbackSpinner.stop("Previous version restored");
|
|
2388
2759
|
R2.info("Your previous installation has been restored.");
|
|
2389
2760
|
} catch (rollbackErr) {
|
|
2390
|
-
rollbackSpinner.stop(
|
|
2761
|
+
rollbackSpinner.stop(import_picocolors7.default.red("Rollback failed"));
|
|
2391
2762
|
R2.error(`Rollback failed: ${rollbackErr instanceof Error ? rollbackErr.message : rollbackErr}`);
|
|
2392
2763
|
R2.error(`Manual recovery: backup is at ${backupDir}`);
|
|
2393
2764
|
Le("Update and rollback both failed. See errors above.");
|
|
@@ -2409,17 +2780,17 @@ async function update() {
|
|
|
2409
2780
|
} catch {
|
|
2410
2781
|
s.stop("PM2 restart failed \u2014 start manually with `cognova start`");
|
|
2411
2782
|
}
|
|
2412
|
-
R2.info(`Run ${
|
|
2783
|
+
R2.info(`Run ${import_picocolors7.default.cyan("cognova reset")} to regenerate CLAUDE.md or settings.json.`);
|
|
2413
2784
|
Le(`Updated to v${latestVersion}`);
|
|
2414
2785
|
}
|
|
2415
2786
|
|
|
2416
2787
|
// src/commands/doctor.ts
|
|
2417
2788
|
import { execSync as execSync8 } from "child_process";
|
|
2418
|
-
import { existsSync as
|
|
2419
|
-
import { join as
|
|
2420
|
-
var
|
|
2789
|
+
import { existsSync as existsSync10 } from "fs";
|
|
2790
|
+
import { join as join12 } from "path";
|
|
2791
|
+
var import_picocolors8 = __toESM(require_picocolors(), 1);
|
|
2421
2792
|
async function doctor() {
|
|
2422
|
-
We(
|
|
2793
|
+
We(import_picocolors8.default.bgCyan(import_picocolors8.default.black(" Cognova Doctor ")));
|
|
2423
2794
|
const installDir = findInstallDir();
|
|
2424
2795
|
const claudeDir = getClaudeDir();
|
|
2425
2796
|
const metadata = readMetadata(installDir);
|
|
@@ -2429,35 +2800,55 @@ async function doctor() {
|
|
|
2429
2800
|
const checks = [
|
|
2430
2801
|
{
|
|
2431
2802
|
name: ".env file",
|
|
2432
|
-
check: () =>
|
|
2803
|
+
check: () => existsSync10(join12(installDir, ".env")),
|
|
2804
|
+
fixDescription: 'Run "cognova reset" to regenerate'
|
|
2433
2805
|
},
|
|
2434
2806
|
{
|
|
2435
2807
|
name: "node_modules",
|
|
2436
|
-
check: () =>
|
|
2808
|
+
check: () => existsSync10(join12(installDir, "node_modules")),
|
|
2809
|
+
fix: async () => {
|
|
2810
|
+
const s = bt2();
|
|
2811
|
+
s.start("Installing dependencies");
|
|
2812
|
+
execSync8("pnpm install", { cwd: installDir, stdio: "inherit" });
|
|
2813
|
+
s.stop("Dependencies installed");
|
|
2814
|
+
},
|
|
2815
|
+
fixDescription: "Install dependencies"
|
|
2437
2816
|
},
|
|
2438
2817
|
{
|
|
2439
2818
|
name: "Build output",
|
|
2440
|
-
check: () =>
|
|
2819
|
+
check: () => existsSync10(join12(installDir, ".output", "server", "index.mjs")),
|
|
2820
|
+
fix: async () => {
|
|
2821
|
+
const s = bt2();
|
|
2822
|
+
s.start("Building application");
|
|
2823
|
+
execSync8("pnpm build", { cwd: installDir, stdio: "inherit" });
|
|
2824
|
+
s.stop("Build complete");
|
|
2825
|
+
},
|
|
2826
|
+
fixDescription: "Build the application"
|
|
2441
2827
|
},
|
|
2442
2828
|
{
|
|
2443
2829
|
name: "~/.claude/CLAUDE.md",
|
|
2444
|
-
check: () =>
|
|
2830
|
+
check: () => existsSync10(join12(claudeDir, "CLAUDE.md")),
|
|
2831
|
+
fixDescription: 'Run "cognova reset --claude" to reinstall'
|
|
2445
2832
|
},
|
|
2446
2833
|
{
|
|
2447
2834
|
name: "~/.claude/skills/",
|
|
2448
|
-
check: () =>
|
|
2835
|
+
check: () => existsSync10(join12(claudeDir, "skills")),
|
|
2836
|
+
fixDescription: 'Run "cognova reset --claude" to reinstall'
|
|
2449
2837
|
},
|
|
2450
2838
|
{
|
|
2451
2839
|
name: "~/.claude/hooks/",
|
|
2452
|
-
check: () =>
|
|
2840
|
+
check: () => existsSync10(join12(claudeDir, "hooks")),
|
|
2841
|
+
fixDescription: 'Run "cognova reset --claude" to reinstall'
|
|
2453
2842
|
},
|
|
2454
2843
|
{
|
|
2455
2844
|
name: "~/.claude/rules/",
|
|
2456
|
-
check: () =>
|
|
2845
|
+
check: () => existsSync10(join12(claudeDir, "rules")),
|
|
2846
|
+
fixDescription: 'Run "cognova reset --claude" to reinstall'
|
|
2457
2847
|
},
|
|
2458
2848
|
{
|
|
2459
2849
|
name: "~/.claude/settings.json",
|
|
2460
|
-
check: () =>
|
|
2850
|
+
check: () => existsSync10(join12(claudeDir, "settings.json")),
|
|
2851
|
+
fixDescription: 'Run "cognova reset --claude" to reinstall'
|
|
2461
2852
|
},
|
|
2462
2853
|
{
|
|
2463
2854
|
name: "Claude Code CLI",
|
|
@@ -2468,7 +2859,8 @@ async function doctor() {
|
|
|
2468
2859
|
} catch {
|
|
2469
2860
|
return false;
|
|
2470
2861
|
}
|
|
2471
|
-
}
|
|
2862
|
+
},
|
|
2863
|
+
fixDescription: "Install with: npm install -g @anthropic-ai/claude-code"
|
|
2472
2864
|
},
|
|
2473
2865
|
{
|
|
2474
2866
|
name: "Python 3",
|
|
@@ -2479,7 +2871,36 @@ async function doctor() {
|
|
|
2479
2871
|
} catch {
|
|
2480
2872
|
return false;
|
|
2481
2873
|
}
|
|
2482
|
-
}
|
|
2874
|
+
},
|
|
2875
|
+
fixDescription: "Install from https://python.org/"
|
|
2876
|
+
},
|
|
2877
|
+
{
|
|
2878
|
+
name: "Docker daemon",
|
|
2879
|
+
check: () => {
|
|
2880
|
+
try {
|
|
2881
|
+
execSync8("docker info", { stdio: "pipe" });
|
|
2882
|
+
return true;
|
|
2883
|
+
} catch {
|
|
2884
|
+
return false;
|
|
2885
|
+
}
|
|
2886
|
+
},
|
|
2887
|
+
fix: async () => {
|
|
2888
|
+
const s = bt2();
|
|
2889
|
+
s.start("Starting Docker daemon");
|
|
2890
|
+
try {
|
|
2891
|
+
if (process.platform === "darwin") {
|
|
2892
|
+
execSync8("open -a Docker", { stdio: "pipe" });
|
|
2893
|
+
R2.info("Docker Desktop is starting - this may take a moment");
|
|
2894
|
+
} else if (process.platform === "linux") {
|
|
2895
|
+
execSync8("sudo systemctl start docker", { stdio: "inherit" });
|
|
2896
|
+
}
|
|
2897
|
+
s.stop("Docker daemon start command issued");
|
|
2898
|
+
} catch (err) {
|
|
2899
|
+
s.stop("Failed to start Docker daemon");
|
|
2900
|
+
throw err;
|
|
2901
|
+
}
|
|
2902
|
+
},
|
|
2903
|
+
fixDescription: "Start Docker daemon"
|
|
2483
2904
|
},
|
|
2484
2905
|
{
|
|
2485
2906
|
name: "PM2 process",
|
|
@@ -2493,7 +2914,19 @@ async function doctor() {
|
|
|
2493
2914
|
} catch {
|
|
2494
2915
|
return false;
|
|
2495
2916
|
}
|
|
2496
|
-
}
|
|
2917
|
+
},
|
|
2918
|
+
fix: async () => {
|
|
2919
|
+
const s = bt2();
|
|
2920
|
+
s.start("Starting PM2 process");
|
|
2921
|
+
try {
|
|
2922
|
+
execSync8("pm2 start ecosystem.config.cjs", { cwd: installDir, stdio: "inherit" });
|
|
2923
|
+
s.stop("PM2 process started");
|
|
2924
|
+
} catch (err) {
|
|
2925
|
+
s.stop("Failed to start PM2");
|
|
2926
|
+
throw err;
|
|
2927
|
+
}
|
|
2928
|
+
},
|
|
2929
|
+
fixDescription: "Start the PM2 process"
|
|
2497
2930
|
},
|
|
2498
2931
|
{
|
|
2499
2932
|
name: "App health endpoint",
|
|
@@ -2523,7 +2956,7 @@ async function doctor() {
|
|
|
2523
2956
|
name: "Vault directory",
|
|
2524
2957
|
check: () => {
|
|
2525
2958
|
if (!metadata) return false;
|
|
2526
|
-
return
|
|
2959
|
+
return existsSync10(metadata.vaultPath);
|
|
2527
2960
|
}
|
|
2528
2961
|
},
|
|
2529
2962
|
{
|
|
@@ -2539,32 +2972,63 @@ async function doctor() {
|
|
|
2539
2972
|
}
|
|
2540
2973
|
}
|
|
2541
2974
|
];
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
for (const { name, check } of checks) {
|
|
2975
|
+
const results = [];
|
|
2976
|
+
for (const check of checks) {
|
|
2545
2977
|
try {
|
|
2546
|
-
const result = check();
|
|
2978
|
+
const result = check.check();
|
|
2547
2979
|
if (result === true) {
|
|
2548
|
-
R2.success(`${
|
|
2549
|
-
|
|
2980
|
+
R2.success(`${import_picocolors8.default.green("PASS")} ${check.name}`);
|
|
2981
|
+
results.push({ check, status: "pass" });
|
|
2550
2982
|
} else if (result === false) {
|
|
2551
|
-
R2.error(`${
|
|
2552
|
-
|
|
2983
|
+
R2.error(`${import_picocolors8.default.red("FAIL")} ${check.name}`);
|
|
2984
|
+
if (check.fixDescription)
|
|
2985
|
+
R2.info(` \u2192 ${import_picocolors8.default.dim(check.fixDescription)}`);
|
|
2986
|
+
results.push({ check, status: "fail" });
|
|
2553
2987
|
} else {
|
|
2554
|
-
R2.warn(`${
|
|
2988
|
+
R2.warn(`${import_picocolors8.default.yellow("WARN")} ${check.name}: ${result}`);
|
|
2989
|
+
results.push({ check, status: "warn", message: result });
|
|
2555
2990
|
}
|
|
2556
2991
|
} catch {
|
|
2557
|
-
R2.error(`${
|
|
2558
|
-
|
|
2992
|
+
R2.error(`${import_picocolors8.default.red("FAIL")} ${check.name}`);
|
|
2993
|
+
if (check.fixDescription)
|
|
2994
|
+
R2.info(` \u2192 ${import_picocolors8.default.dim(check.fixDescription)}`);
|
|
2995
|
+
results.push({ check, status: "fail" });
|
|
2996
|
+
}
|
|
2997
|
+
}
|
|
2998
|
+
const passed = results.filter((r) => r.status === "pass").length;
|
|
2999
|
+
const failed = results.filter((r) => r.status === "fail").length;
|
|
3000
|
+
const fixableFailures = results.filter((r) => r.status === "fail" && r.check.fix);
|
|
3001
|
+
if (fixableFailures.length > 0) {
|
|
3002
|
+
R2.info("");
|
|
3003
|
+
const runFixes = await Re({
|
|
3004
|
+
message: `${fixableFailures.length} issue(s) can be auto-fixed. Run fixes now?`,
|
|
3005
|
+
initialValue: true
|
|
3006
|
+
});
|
|
3007
|
+
if (!Ct(runFixes) && runFixes) {
|
|
3008
|
+
for (const { check } of fixableFailures) {
|
|
3009
|
+
if (!check.fix) continue;
|
|
3010
|
+
R2.step(import_picocolors8.default.bold(`Fixing: ${check.name}`));
|
|
3011
|
+
try {
|
|
3012
|
+
await check.fix();
|
|
3013
|
+
const result = check.check();
|
|
3014
|
+
if (result === true) {
|
|
3015
|
+
R2.success(`${import_picocolors8.default.green("\u2713")} ${check.name} is now fixed`);
|
|
3016
|
+
} else {
|
|
3017
|
+
R2.warn(`${import_picocolors8.default.yellow("!")} ${check.name} still failing after fix attempt`);
|
|
3018
|
+
}
|
|
3019
|
+
} catch (err) {
|
|
3020
|
+
R2.error(`${import_picocolors8.default.red("\u2717")} Failed to fix ${check.name}: ${err}`);
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
2559
3023
|
}
|
|
2560
3024
|
}
|
|
2561
3025
|
Le(`${passed} passed, ${failed} failed`);
|
|
2562
3026
|
}
|
|
2563
3027
|
|
|
2564
3028
|
// src/commands/reset.ts
|
|
2565
|
-
var
|
|
3029
|
+
var import_picocolors9 = __toESM(require_picocolors(), 1);
|
|
2566
3030
|
async function reset() {
|
|
2567
|
-
We(
|
|
3031
|
+
We(import_picocolors9.default.bgCyan(import_picocolors9.default.black(" Cognova Reset ")));
|
|
2568
3032
|
const installDir = findInstallDir();
|
|
2569
3033
|
const metadata = readMetadata(installDir);
|
|
2570
3034
|
if (!metadata) {
|