visual-living-plan 0.1.0 → 2.32.1
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/DESIGN.md +213 -0
- package/README.md +155 -28
- package/dist/AuthScreen.d.ts +9 -0
- package/dist/AuthScreen.js +7 -0
- package/dist/DesktopModeSwitch.d.ts +13 -0
- package/dist/DesktopModeSwitch.js +14 -0
- package/dist/OAuthMark.d.ts +6 -0
- package/dist/OAuthMark.js +8 -0
- package/dist/accountInitials.d.ts +5 -0
- package/dist/accountInitials.js +20 -0
- package/dist/accountLinking.d.ts +26 -0
- package/dist/accountLinking.js +46 -0
- package/dist/agentEvents.d.ts +31 -0
- package/dist/agentEvents.js +260 -0
- package/dist/agentPresence.d.ts +42 -0
- package/dist/agentPresence.js +69 -0
- package/dist/agentSkills.d.ts +35 -0
- package/dist/agentSkills.js +89 -0
- package/dist/agentStream.d.ts +35 -0
- package/dist/agentStream.js +133 -0
- package/dist/appearanceDom.d.ts +13 -0
- package/dist/appearanceDom.js +24 -0
- package/dist/appearanceSettings.d.ts +29 -0
- package/dist/appearanceSettings.js +293 -0
- package/dist/assets.d.ts +14 -0
- package/dist/assets.js +72 -0
- package/dist/authSearch.d.ts +11 -0
- package/dist/authSearch.js +30 -0
- package/dist/changelog.d.ts +11 -0
- package/dist/changelog.js +63 -0
- package/dist/changelogParse.d.ts +53 -0
- package/dist/changelogParse.js +226 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1684 -0
- package/dist/cliLauncher.d.ts +40 -0
- package/dist/cliLauncher.js +170 -0
- package/dist/cliToken.d.ts +11 -0
- package/dist/cliToken.js +15 -0
- package/dist/client/.vite/manifest.json +1780 -0
- package/dist/client/assets/BarChart-DtV3dIq4.js +1 -0
- package/dist/client/assets/BlockEditor-BklSUBjk.js +168 -0
- package/dist/client/assets/BlockEditor-K5h6xc4_.css +1 -0
- package/dist/client/assets/CodeBlock-BbI08MlQ.js +1 -0
- package/dist/client/assets/CodeBlock-BxRMnldw.js +175 -0
- package/dist/client/assets/LineChart-CQYMEbD6.js +1 -0
- package/dist/client/assets/Mermaid-Ciu9eIoG.js +1 -0
- package/dist/client/assets/Mermaid-jPWLXX7e.js +1 -0
- package/dist/client/assets/Popover-DbE4vUPG.js +1 -0
- package/dist/client/assets/ReactFlowExecutionCanvas-BhVs-adc.js +7 -0
- package/dist/client/assets/ReactFlowExecutionCanvas-DLioOiRN.css +1 -0
- package/dist/client/assets/StatusIcon-C_-Lm9b4.js +1 -0
- package/dist/client/assets/Workflow-C92OpLyf.js +1 -0
- package/dist/client/assets/agentPresence-D8asHrTp.js +1 -0
- package/dist/client/assets/andromeeda-DW8vo71h.js +1 -0
- package/dist/client/assets/andromeeda-vGVdxbeo.js +1 -0
- package/dist/client/assets/arrow-up-CEVVOXD5.js +1 -0
- package/dist/client/assets/arrow-up-down-BSjnQK2I.js +1 -0
- package/dist/client/assets/aurora-x-CDeNXAV0.js +1 -0
- package/dist/client/assets/aurora-x-rMvKqtYI.js +1 -0
- package/dist/client/assets/ayu-dark-CwczpL8O.js +1 -0
- package/dist/client/assets/ayu-dark-DluEY0Gj.js +1 -0
- package/dist/client/assets/ayu-light-C3h-C4tm.js +1 -0
- package/dist/client/assets/ayu-light-DSh22xiD.js +1 -0
- package/dist/client/assets/ayu-mirage-Bqwy1Gya.js +1 -0
- package/dist/client/assets/ayu-mirage-JE6hAyHG.js +1 -0
- package/dist/client/assets/browserStore-BDGKYoJj.js +435 -0
- package/dist/client/assets/button-BI07wqbi.css +1 -0
- package/dist/client/assets/button-DJWAGApe.js +1 -0
- package/dist/client/assets/catppuccin-frappe-C9Q5zVZY.js +1 -0
- package/dist/client/assets/catppuccin-frappe-pyXErRRU.js +1 -0
- package/dist/client/assets/catppuccin-latte-BILSUICr.js +1 -0
- package/dist/client/assets/catppuccin-latte-CtsyrtPq.js +1 -0
- package/dist/client/assets/catppuccin-macchiato-Ck60ZZQE.js +1 -0
- package/dist/client/assets/catppuccin-macchiato-R8nAf1vR.js +1 -0
- package/dist/client/assets/catppuccin-mocha-C_2G67cS.js +1 -0
- package/dist/client/assets/catppuccin-mocha-DjuaAJKi.js +1 -0
- package/dist/client/assets/ccount-nzzEXTrh.js +1 -0
- package/dist/client/assets/chartRows-CNjjLsAH.js +2 -0
- package/dist/client/assets/circle-x-BLGxA3gi.js +1 -0
- package/dist/client/assets/client-BsE_buVT.js +9 -0
- package/dist/client/assets/constants-CmGPilXJ.js +1 -0
- package/dist/client/assets/dark-plus-CHgc6GYj.js +1 -0
- package/dist/client/assets/dark-plus-Cs2F2srj.js +1 -0
- package/dist/client/assets/default-5FplaXL4.js +7 -0
- package/dist/client/assets/diffsTheme-PJJTu2Rq.js +1 -0
- package/dist/client/assets/dracula-BHWKrbxM.js +1 -0
- package/dist/client/assets/dracula-Cf1PG3MT.js +1 -0
- package/dist/client/assets/dracula-soft-5eyTD99u.js +1 -0
- package/dist/client/assets/dracula-soft-DXuNm1Kq.js +1 -0
- package/dist/client/assets/editSource-DQfw4nRm.js +1 -0
- package/dist/client/assets/editSource-U5AoD-Wo.js +14 -0
- package/dist/client/assets/engine-CLTPZlti.js +1 -0
- package/dist/client/assets/engine-DUyaiAMV.js +2 -0
- package/dist/client/assets/everforest-dark-CjdfwUBe.js +1 -0
- package/dist/client/assets/everforest-dark-sB-x3p7T.js +1 -0
- package/dist/client/assets/everforest-light-CfVwwCBP.js +1 -0
- package/dist/client/assets/everforest-light-Df2xbC6M.js +1 -0
- package/dist/client/assets/forgetDocuments-CIUBitCs.js +1 -0
- package/dist/client/assets/formatCSSVariablePrefix-KRh9vnZf.js +1 -0
- package/dist/client/assets/github-dark-BL6HSl_n.js +1 -0
- package/dist/client/assets/github-dark-C-LZuMrd.js +1 -0
- package/dist/client/assets/github-dark-default-DXG-b-1a.js +1 -0
- package/dist/client/assets/github-dark-default-zacuWV-M.js +1 -0
- package/dist/client/assets/github-dark-dimmed-Bx1FflLF.js +1 -0
- package/dist/client/assets/github-dark-dimmed-Mc0P9idi.js +1 -0
- package/dist/client/assets/github-dark-high-contrast-B_tTalzw.js +1 -0
- package/dist/client/assets/github-dark-high-contrast-IMKX2AVF.js +1 -0
- package/dist/client/assets/github-light-EUqPIrTm.js +1 -0
- package/dist/client/assets/github-light-default-BXViO-2h.js +1 -0
- package/dist/client/assets/github-light-default-DVlCqP3X.js +1 -0
- package/dist/client/assets/github-light-high-contrast-B68TUdTA.js +1 -0
- package/dist/client/assets/github-light-high-contrast-Dj6zTyWR.js +1 -0
- package/dist/client/assets/github-light-mYhEBkPo.js +1 -0
- package/dist/client/assets/gruvbox-dark-hard-C820rvS2.js +1 -0
- package/dist/client/assets/gruvbox-dark-hard-QTgQQZn-.js +1 -0
- package/dist/client/assets/gruvbox-dark-medium-9d5YdCTx.js +1 -0
- package/dist/client/assets/gruvbox-dark-medium-BPjhmG05.js +1 -0
- package/dist/client/assets/gruvbox-dark-soft-MrdJrrXF.js +1 -0
- package/dist/client/assets/gruvbox-dark-soft-XCkqeBhR.js +1 -0
- package/dist/client/assets/gruvbox-light-hard--5-nXqNp.js +1 -0
- package/dist/client/assets/gruvbox-light-hard-BC_s9l72.js +1 -0
- package/dist/client/assets/gruvbox-light-medium-BAWPOn9u.js +1 -0
- package/dist/client/assets/gruvbox-light-medium-COA1PZW2.js +1 -0
- package/dist/client/assets/gruvbox-light-soft-BSMLrYjP.js +1 -0
- package/dist/client/assets/gruvbox-light-soft-CIJpzjAO.js +1 -0
- package/dist/client/assets/hastToHtml-Dj8rXue9.js +11 -0
- package/dist/client/assets/highlight-cB-PkhyE.js +1 -0
- package/dist/client/assets/highlights-LLBF1DTm.js +1 -0
- package/dist/client/assets/horizon-Ba2cwkSy.js +1 -0
- package/dist/client/assets/horizon-CE9ld1lL.js +1 -0
- package/dist/client/assets/horizon-bright-DSNQnXHK.js +1 -0
- package/dist/client/assets/horizon-bright-DaEDgBmR.js +1 -0
- package/dist/client/assets/houston-B6x0XVpU.js +1 -0
- package/dist/client/assets/houston-CsvMBhTu.js +1 -0
- package/dist/client/assets/jsx-runtime-DKj5X9O4.js +1 -0
- package/dist/client/assets/kanagawa-dragon-Bozd7klA.js +1 -0
- package/dist/client/assets/kanagawa-dragon-DhTFvBMT.js +1 -0
- package/dist/client/assets/kanagawa-lotus--m8sdOxn.js +1 -0
- package/dist/client/assets/kanagawa-lotus-BmuOG9ZW.js +1 -0
- package/dist/client/assets/kanagawa-wave-BML5mF2J.js +1 -0
- package/dist/client/assets/kanagawa-wave-D-tTv4k2.js +1 -0
- package/dist/client/assets/laserwave-C_8bwKvT.js +1 -0
- package/dist/client/assets/laserwave-HSLx0L75.js +1 -0
- package/dist/client/assets/lib-COgu-QLX.js +33 -0
- package/dist/client/assets/lib-CdRiGVUZ.js +1 -0
- package/dist/client/assets/light-plus-CUjWrTSi.js +1 -0
- package/dist/client/assets/light-plus-DVQuIRkW.js +1 -0
- package/dist/client/assets/loader-CjL04K29.js +1 -0
- package/dist/client/assets/main-BGMX_GnZ.js +2 -0
- package/dist/client/assets/main-BTko4EvJ.css +1 -0
- package/dist/client/assets/material-theme-Bm3Qr25_.js +1 -0
- package/dist/client/assets/material-theme-CnthUGfg.js +1 -0
- package/dist/client/assets/material-theme-darker-2IIEA8gg.js +1 -0
- package/dist/client/assets/material-theme-darker-DUi03Qre.js +1 -0
- package/dist/client/assets/material-theme-lighter-D2-qr5Vw.js +1 -0
- package/dist/client/assets/material-theme-lighter-uhdI0v04.js +1 -0
- package/dist/client/assets/material-theme-ocean-CHQ94UKr.js +1 -0
- package/dist/client/assets/material-theme-ocean-CWR-LogA.js +1 -0
- package/dist/client/assets/material-theme-palenight-B5W6OYN7.js +1 -0
- package/dist/client/assets/material-theme-palenight-Cnv8m1ra.js +1 -0
- package/dist/client/assets/mdxEntries-BNTMP8ct.css +1 -0
- package/dist/client/assets/mdxEntries-L-V7bB6i.js +1 -0
- package/dist/client/assets/mermaid-Bjhs-krb.js +1 -0
- package/dist/client/assets/mermaid-Di4j-zgD.js +146 -0
- package/dist/client/assets/min-dark-BSWPekZh.js +1 -0
- package/dist/client/assets/min-dark-EXoM-6Xo.js +1 -0
- package/dist/client/assets/min-light-DDpmG2fV.js +1 -0
- package/dist/client/assets/min-light-DVOTDhnA.js +1 -0
- package/dist/client/assets/monokai-BscAjiQZ.js +1 -0
- package/dist/client/assets/monokai-DkggTbGy.js +1 -0
- package/dist/client/assets/mountChrome-BVWpsDCy.js +122 -0
- package/dist/client/assets/mountChrome-DhTDH3YM.css +1 -0
- package/dist/client/assets/night-owl-Bdcs0PMi.js +1 -0
- package/dist/client/assets/night-owl-DhmEMT88.js +1 -0
- package/dist/client/assets/night-owl-light-RoU30LE0.js +1 -0
- package/dist/client/assets/night-owl-light-eJ-hLW7d.js +1 -0
- package/dist/client/assets/noShiki-DB8hQ_W3.js +1 -0
- package/dist/client/assets/noShiki-GTG3tT8x.js +1 -0
- package/dist/client/assets/nord-Cb4Vim4T.js +1 -0
- package/dist/client/assets/nord-u7hMircQ.js +1 -0
- package/dist/client/assets/offlineSync-Cv3FVIlJ.js +1 -0
- package/dist/client/assets/one-dark-pro-08PdtLzi.js +1 -0
- package/dist/client/assets/one-dark-pro-C6YyR8OD.js +1 -0
- package/dist/client/assets/one-light-D7Lr4KcI.js +1 -0
- package/dist/client/assets/one-light-DgvUEtgI.js +1 -0
- package/dist/client/assets/opfs-worker-DuTOCgWR.js +5919 -0
- package/dist/client/assets/pierre-dark-B2jZWvHG.js +1 -0
- package/dist/client/assets/pierre-dark-CpLgRqie.js +1 -0
- package/dist/client/assets/pierre-dark-protanopia-deuteranopia-B35FxJx-.js +1 -0
- package/dist/client/assets/pierre-dark-protanopia-deuteranopia-CebgQdRf.js +1 -0
- package/dist/client/assets/pierre-dark-soft-DdE7dyP3.js +1 -0
- package/dist/client/assets/pierre-dark-soft-kZQmAZld.js +1 -0
- package/dist/client/assets/pierre-dark-tritanopia-CXimiT7X.js +1 -0
- package/dist/client/assets/pierre-dark-tritanopia-CpjhbsIL.js +1 -0
- package/dist/client/assets/pierre-dark-vibrant-CpQYzh95.js +1 -0
- package/dist/client/assets/pierre-dark-vibrant-DzBsxHvQ.js +1 -0
- package/dist/client/assets/pierre-light-CoaEpmwp.js +1 -0
- package/dist/client/assets/pierre-light-Vf__O3ev.js +1 -0
- package/dist/client/assets/pierre-light-protanopia-deuteranopia-0fSaH845.js +1 -0
- package/dist/client/assets/pierre-light-protanopia-deuteranopia-BUtWcCQC.js +1 -0
- package/dist/client/assets/pierre-light-soft-C3QCXKvN.js +1 -0
- package/dist/client/assets/pierre-light-soft-lWLdNTOI.js +1 -0
- package/dist/client/assets/pierre-light-tritanopia-CEbqgOJL.js +1 -0
- package/dist/client/assets/pierre-light-tritanopia-CKLy6XvA.js +1 -0
- package/dist/client/assets/pierre-light-vibrant-D80Fkn33.js +1 -0
- package/dist/client/assets/pierre-light-vibrant-DDuTEIhH.js +1 -0
- package/dist/client/assets/planEditButton-CbWGczbi.js +45 -0
- package/dist/client/assets/planEvents-cuzv9ELr.js +1 -0
- package/dist/client/assets/planMdx-Db1ze_nN.js +110 -0
- package/dist/client/assets/plastic-B8mE6BxX.js +1 -0
- package/dist/client/assets/plastic-DQwYfKfQ.js +1 -0
- package/dist/client/assets/poimandres-DRFjx7u4.js +1 -0
- package/dist/client/assets/poimandres-DUFjrgxT.js +1 -0
- package/dist/client/assets/preload-helper-Dx0-lKy1.js +1 -0
- package/dist/client/assets/queryClient-Bs5tSUJh.js +1 -0
- package/dist/client/assets/react-dom-DpzJPrWF.js +1 -0
- package/dist/client/assets/rebaseDraft-B2--cj1c.js +19 -0
- package/dist/client/assets/red-BJvdDEUx.js +1 -0
- package/dist/client/assets/red-CYlAq2b0.js +1 -0
- package/dist/client/assets/register-hZEIk3A9.css +1 -0
- package/dist/client/assets/register-htm5s8o9.js +1 -0
- package/dist/client/assets/rolldown-runtime-Dd_uD5pT.js +1 -0
- package/dist/client/assets/rose-pine-BSqRqUae.js +1 -0
- package/dist/client/assets/rose-pine-aMsaMD1D.js +1 -0
- package/dist/client/assets/rose-pine-dawn-8PwUyIlP.js +1 -0
- package/dist/client/assets/rose-pine-dawn-U6TBE82u.js +1 -0
- package/dist/client/assets/rose-pine-moon-CAU7u1h4.js +1 -0
- package/dist/client/assets/rose-pine-moon-DO-qXg-I.js +1 -0
- package/dist/client/assets/routeEdges-B2z8v0di.js +24 -0
- package/dist/client/assets/selector-CDsXW7SO.css +1 -0
- package/dist/client/assets/selector-tlBGWtQl.js +1 -0
- package/dist/client/assets/settingsChrome-NGUDtEIp.js +1 -0
- package/dist/client/assets/shiki-BOXJeUHI.js +2 -0
- package/dist/client/assets/slack-dark-CMu0smFa.js +1 -0
- package/dist/client/assets/slack-dark-DnToyrRv.js +1 -0
- package/dist/client/assets/slack-ochin-B2OO5cIa.js +1 -0
- package/dist/client/assets/slack-ochin-BBne7cjw.js +1 -0
- package/dist/client/assets/snazzy-light-4G7pJPwS.js +1 -0
- package/dist/client/assets/snazzy-light-CV8HUEmk.js +1 -0
- package/dist/client/assets/solarized-dark-CmYmhSgI.js +1 -0
- package/dist/client/assets/solarized-dark-b97czJOk.js +1 -0
- package/dist/client/assets/solarized-light-CjLLwxRp.js +1 -0
- package/dist/client/assets/solarized-light-DFPxpIYQ.js +1 -0
- package/dist/client/assets/stampPlanParts-DVXYCykw.js +15 -0
- package/dist/client/assets/stampPlanParts-ctZzxWdw.css +1 -0
- package/dist/client/assets/stream-tokenizer-C3n8hi1h.js +4 -0
- package/dist/client/assets/synthwave-84-nFMaYfgc.js +1 -0
- package/dist/client/assets/synthwave-84-wQeDKbzQ.js +1 -0
- package/dist/client/assets/textChildren-ZDSs1dod.js +1 -0
- package/dist/client/assets/themes-CdTJhjZf.js +2 -0
- package/dist/client/assets/tokyo-night-D4ZgDiA7.js +1 -0
- package/dist/client/assets/tokyo-night-oM2G3aXe.js +1 -0
- package/dist/client/assets/triangle-alert-C9Sgr3jF.js +1 -0
- package/dist/client/assets/unwrapDefault-ByDmBtHB.js +1 -0
- package/dist/client/assets/utils-C9Glzetk.js +2 -0
- package/dist/client/assets/versionView-zkSROPw7.js +1 -0
- package/dist/client/assets/vesper-DdrHHSXu.js +1 -0
- package/dist/client/assets/vesper-sUHevyKv.js +1 -0
- package/dist/client/assets/vitesse-black-CfklMpOb.js +1 -0
- package/dist/client/assets/vitesse-black-fwtXNY1n.js +1 -0
- package/dist/client/assets/vitesse-dark-BZCL-v6S.js +1 -0
- package/dist/client/assets/vitesse-dark-CJkzwmKT.js +1 -0
- package/dist/client/assets/vitesse-light-BxMp8E1Y.js +1 -0
- package/dist/client/assets/vitesse-light-VbXTXTou.js +1 -0
- package/dist/client/assets/wa-sqlite-Ba70bhIr.wasm +0 -0
- package/dist/client/assets/warmPlans-CYFrLwcX.js +1 -0
- package/dist/client/assets/with-selector-HIcjK0_d.js +1 -0
- package/dist/client/assets/workflowSource-LMsRuqF_.js +3 -0
- package/dist/client/favicon.png +0 -0
- package/dist/client/icons/apple-touch-icon-180x180.png +0 -0
- package/dist/client/icons/favicon.ico +0 -0
- package/dist/client/icons/maskable-icon-192x192.png +0 -0
- package/dist/client/icons/maskable-icon-512x512.png +0 -0
- package/dist/client/icons/pwa-16x16.png +0 -0
- package/dist/client/icons/pwa-192x192.png +0 -0
- package/dist/client/icons/pwa-32x32.png +0 -0
- package/dist/client/icons/pwa-512x512.png +0 -0
- package/dist/client/icons/pwa-64x64.png +0 -0
- package/dist/clientLog.d.ts +5 -0
- package/dist/clientLog.js +64 -0
- package/dist/cloudClient.d.ts +38 -0
- package/dist/cloudClient.js +185 -0
- package/dist/cloudCommand.d.ts +23 -0
- package/dist/cloudCommand.js +159 -0
- package/dist/cloudFrontmatter.d.ts +4 -0
- package/dist/cloudFrontmatter.js +30 -0
- package/dist/cloudStore.d.ts +28 -0
- package/dist/cloudStore.js +70 -0
- package/dist/cloudWatch.d.ts +12 -0
- package/dist/cloudWatch.js +103 -0
- package/dist/commentReply.d.ts +25 -0
- package/dist/commentReply.js +17 -0
- package/dist/configHome.d.ts +34 -0
- package/dist/configHome.js +136 -0
- package/dist/dashboard.d.ts +67 -0
- package/dist/dashboard.js +86 -0
- package/dist/dashboardClientScript.d.ts +2 -0
- package/dist/dashboardClientScript.js +1006 -0
- package/dist/dashboardDocument.d.ts +13 -0
- package/dist/dashboardDocument.js +40 -0
- package/dist/dashboardFormat.d.ts +98 -0
- package/dist/dashboardFormat.js +199 -0
- package/dist/dashboardLoading.d.ts +19 -0
- package/dist/dashboardLoading.js +94 -0
- package/dist/dashboardOverview.d.ts +28 -0
- package/dist/dashboardOverview.js +333 -0
- package/dist/dashboardPage.d.ts +2 -0
- package/dist/dashboardPage.js +11 -0
- package/dist/dashboardParts.d.ts +4 -0
- package/dist/dashboardParts.js +367 -0
- package/dist/dashboardSearchView.d.ts +38 -0
- package/dist/dashboardSearchView.js +255 -0
- package/dist/desktopApp.d.ts +23 -0
- package/dist/desktopApp.js +110 -0
- package/dist/desktopBridge.d.ts +21 -0
- package/dist/desktopBridge.js +78 -0
- package/dist/desktopCommand.d.ts +61 -0
- package/dist/desktopCommand.js +172 -0
- package/dist/desktopConfig.d.ts +54 -0
- package/dist/desktopConfig.js +164 -0
- package/dist/desktopNotices.d.ts +105 -0
- package/dist/desktopNotices.js +427 -0
- package/dist/diff.d.ts +2 -0
- package/dist/diff.js +46 -0
- package/dist/diffsTheme.d.ts +51 -0
- package/dist/diffsTheme.js +86 -0
- package/dist/diffsThemeCatalog.d.ts +3 -0
- package/dist/diffsThemeCatalog.js +78 -0
- package/dist/elkRuntime.node.d.ts +7 -0
- package/dist/elkRuntime.node.js +63 -0
- package/dist/execution.d.ts +78 -0
- package/dist/execution.js +139 -0
- package/dist/expectedWorkflow.d.ts +11 -0
- package/dist/expectedWorkflow.js +99 -0
- package/dist/favicon.d.ts +4 -0
- package/dist/favicon.js +40 -0
- package/dist/favicon.png +0 -0
- package/dist/faviconBase64.d.ts +1 -0
- package/dist/faviconBase64.js +1 -0
- package/dist/fileVersion.d.ts +8 -0
- package/dist/fileVersion.js +20 -0
- package/dist/formatBytes.d.ts +2 -0
- package/dist/formatBytes.js +13 -0
- package/dist/gitStatus.d.ts +12 -0
- package/dist/gitStatus.js +88 -0
- package/dist/hostToolbar.d.ts +38 -0
- package/dist/hostToolbar.js +249 -0
- package/dist/http.d.ts +8 -0
- package/dist/http.js +38 -0
- package/dist/httpServer.d.ts +13 -0
- package/dist/httpServer.js +40 -0
- package/dist/icons/apple-touch-icon-180x180.png +0 -0
- package/dist/icons/favicon.ico +0 -0
- package/dist/icons/maskable-icon-192x192.png +0 -0
- package/dist/icons/maskable-icon-512x512.png +0 -0
- package/dist/icons/pwa-16x16.png +0 -0
- package/dist/icons/pwa-192x192.png +0 -0
- package/dist/icons/pwa-32x32.png +0 -0
- package/dist/icons/pwa-512x512.png +0 -0
- package/dist/icons/pwa-64x64.png +0 -0
- package/dist/lanAccess.d.ts +31 -0
- package/dist/lanAccess.js +110 -0
- package/dist/lanAddress.d.ts +24 -0
- package/dist/lanAddress.js +174 -0
- package/dist/lanCommand.d.ts +25 -0
- package/dist/lanCommand.js +159 -0
- package/dist/lanConfig.d.ts +40 -0
- package/dist/lanConfig.js +130 -0
- package/dist/lanFirewall.d.ts +17 -0
- package/dist/lanFirewall.js +221 -0
- package/dist/layoutGraph.d.ts +13 -0
- package/dist/layoutGraph.js +55 -0
- package/dist/localName.d.ts +9 -0
- package/dist/localName.js +28 -0
- package/dist/lockBanner.d.ts +2 -0
- package/dist/lockBanner.js +2 -0
- package/dist/mdnsPacket.d.ts +44 -0
- package/dist/mdnsPacket.js +384 -0
- package/dist/mdnsPublish.d.ts +12 -0
- package/dist/mdnsPublish.js +290 -0
- package/dist/offlineSync.d.ts +249 -0
- package/dist/offlineSync.js +477 -0
- package/dist/openUrl.d.ts +40 -0
- package/dist/openUrl.js +147 -0
- package/dist/openedPages.d.ts +14 -0
- package/dist/openedPages.js +48 -0
- package/dist/pageEditPull.d.ts +9 -0
- package/dist/pageEditPull.js +29 -0
- package/dist/pageRoutes.d.ts +3 -0
- package/dist/pageRoutes.js +34 -0
- package/dist/parse.d.ts +7 -0
- package/dist/parse.js +100 -0
- package/dist/pid.d.ts +2 -0
- package/dist/pid.js +13 -0
- package/dist/planArchive.d.ts +4 -0
- package/dist/planArchive.js +28 -0
- package/dist/planEntries.d.ts +12 -0
- package/dist/planEntries.js +117 -0
- package/dist/planHost.d.ts +31 -0
- package/dist/planHost.js +286 -0
- package/dist/planId.d.ts +2 -0
- package/dist/planId.js +6 -0
- package/dist/planMdx/blockEdit.d.ts +41 -0
- package/dist/planMdx/blockEdit.js +60 -0
- package/dist/planMdx/cellPart.d.ts +14 -0
- package/dist/planMdx/cellPart.js +26 -0
- package/dist/planMdx/compilePlanMdx.d.ts +3 -0
- package/dist/planMdx/compilePlanMdx.js +22 -0
- package/dist/planMdx/editSource.d.ts +39 -0
- package/dist/planMdx/editSource.js +327 -0
- package/dist/planMdx/frontmatter.d.ts +5 -0
- package/dist/planMdx/frontmatter.js +15 -0
- package/dist/planMdx/markdown.d.ts +6 -0
- package/dist/planMdx/markdown.js +470 -0
- package/dist/planMdx/outline.d.ts +8 -0
- package/dist/planMdx/outline.js +548 -0
- package/dist/planMdx/payload.d.ts +4 -0
- package/dist/planMdx/payload.js +18 -0
- package/dist/planMdx/rebaseDraft.d.ts +54 -0
- package/dist/planMdx/rebaseDraft.js +675 -0
- package/dist/planMdx/recmaPlanComponents.d.ts +18 -0
- package/dist/planMdx/recmaPlanComponents.js +52 -0
- package/dist/planMdx/remarkBlockRanges.d.ts +104 -0
- package/dist/planMdx/remarkBlockRanges.js +275 -0
- package/dist/planMdx/remarkCodeMeta.d.ts +16 -0
- package/dist/planMdx/remarkCodeMeta.js +25 -0
- package/dist/planMdx/remarkGfmTable.d.ts +5 -0
- package/dist/planMdx/remarkGfmTable.js +15 -0
- package/dist/planMdx/remarkGfmTaskList.d.ts +5 -0
- package/dist/planMdx/remarkGfmTaskList.js +15 -0
- package/dist/planMdx/remarkMermaid.d.ts +16 -0
- package/dist/planMdx/remarkMermaid.js +56 -0
- package/dist/planMdx/source.d.ts +11 -0
- package/dist/planMdx/source.js +131 -0
- package/dist/planMdx/titleEdit.d.ts +35 -0
- package/dist/planMdx/titleEdit.js +112 -0
- package/dist/planPage.css +2125 -0
- package/dist/planProgress.d.ts +17 -0
- package/dist/planProgress.js +78 -0
- package/dist/planReady.d.ts +8 -0
- package/dist/planReady.js +20 -0
- package/dist/planRefNavigation.d.ts +4 -0
- package/dist/planRefNavigation.js +8 -0
- package/dist/planRoutes.d.ts +12 -0
- package/dist/planRoutes.js +141 -0
- package/dist/planSearch.d.ts +166 -0
- package/dist/planSearch.js +462 -0
- package/dist/planSession.d.ts +130 -0
- package/dist/planSession.js +1182 -0
- package/dist/planSnapshots.d.ts +34 -0
- package/dist/planSnapshots.js +113 -0
- package/dist/planStatus.d.ts +26 -0
- package/dist/planStatus.js +46 -0
- package/dist/planStepHeading.d.ts +16 -0
- package/dist/planStepHeading.js +34 -0
- package/dist/planTarget.d.ts +16 -0
- package/dist/planTarget.js +92 -0
- package/dist/planToc.d.ts +24 -0
- package/dist/planToc.js +258 -0
- package/dist/planVersionMenu.d.ts +12 -0
- package/dist/planVersionMenu.js +23 -0
- package/dist/processRecord.d.ts +108 -0
- package/dist/processRecord.js +68 -0
- package/dist/processesPanel.d.ts +7 -0
- package/dist/processesPanel.js +636 -0
- package/dist/pwaIconFile.d.ts +2 -0
- package/dist/pwaIconFile.js +42 -0
- package/dist/pwaIcons.d.ts +28 -0
- package/dist/pwaIcons.js +46 -0
- package/dist/registerServiceWorker.d.ts +25 -0
- package/dist/registerServiceWorker.js +26 -0
- package/dist/registryClient.d.ts +94 -0
- package/dist/registryClient.js +490 -0
- package/dist/registryConstants.d.ts +9 -0
- package/dist/registryConstants.js +9 -0
- package/dist/registryLock.d.ts +19 -0
- package/dist/registryLock.js +48 -0
- package/dist/registryPage.d.ts +2 -0
- package/dist/registryPage.js +284 -0
- package/dist/registryService.d.ts +21 -0
- package/dist/registryService.js +562 -0
- package/dist/registryStore.d.ts +63 -0
- package/dist/registryStore.js +398 -0
- package/dist/releaseNotes.d.ts +35 -0
- package/dist/releaseNotes.js +62 -0
- package/dist/render.d.ts +50 -0
- package/dist/render.js +1506 -0
- package/dist/requestGuard.d.ts +21 -0
- package/dist/requestGuard.js +42 -0
- package/dist/reviewRound.d.ts +12 -0
- package/dist/reviewRound.js +19 -0
- package/dist/runFollow.d.ts +28 -0
- package/dist/runFollow.js +33 -0
- package/dist/searchMatch.d.ts +35 -0
- package/dist/searchMatch.js +270 -0
- package/dist/server.d.ts +24 -0
- package/dist/server.js +114 -0
- package/dist/serviceLog.d.ts +56 -0
- package/dist/serviceLog.js +481 -0
- package/dist/shellCache.d.ts +69 -0
- package/dist/shellCache.js +289 -0
- package/dist/shellWorker.js +322 -0
- package/dist/shellWorkerResponse.d.ts +4 -0
- package/dist/shellWorkerResponse.js +15 -0
- package/dist/startServer.d.ts +2 -0
- package/dist/startServer.js +2 -0
- package/dist/store/meta.d.ts +53 -0
- package/dist/store/meta.js +140 -0
- package/dist/store/migrate.d.ts +3 -0
- package/dist/store/migrate.js +408 -0
- package/dist/store/rows.d.ts +4 -0
- package/dist/store/rows.js +100 -0
- package/dist/store/schema.d.ts +5 -0
- package/dist/store/schema.js +5 -0
- package/dist/store/sqlite.d.ts +19 -0
- package/dist/store/sqlite.js +57 -0
- package/dist/store/tables.d.ts +1892 -0
- package/dist/store/tables.js +136 -0
- package/dist/theme.d.ts +174 -0
- package/dist/theme.js +444 -0
- package/dist/themeBootstrap.d.ts +2 -0
- package/dist/themeBootstrap.js +11 -0
- package/dist/tui/DashboardApp.d.ts +19 -0
- package/dist/tui/DashboardApp.js +237 -0
- package/dist/tui/PaletteProvider.d.ts +12 -0
- package/dist/tui/PaletteProvider.js +36 -0
- package/dist/tui/PlanActions.d.ts +7 -0
- package/dist/tui/PlanActions.js +9 -0
- package/dist/tui/PlanCard.d.ts +13 -0
- package/dist/tui/PlanCard.js +31 -0
- package/dist/tui/PlanRow.d.ts +13 -0
- package/dist/tui/PlanRow.js +31 -0
- package/dist/tui/PlanTable.d.ts +13 -0
- package/dist/tui/PlanTable.js +24 -0
- package/dist/tui/ProcessCard.d.ts +9 -0
- package/dist/tui/ProcessCard.js +24 -0
- package/dist/tui/ProcessList.d.ts +9 -0
- package/dist/tui/ProcessList.js +12 -0
- package/dist/tui/SegmentButton.d.ts +7 -0
- package/dist/tui/SegmentButton.js +18 -0
- package/dist/tui/StatCard.d.ts +6 -0
- package/dist/tui/StatCard.js +17 -0
- package/dist/tui/dashboardView.d.ts +45 -0
- package/dist/tui/dashboardView.js +192 -0
- package/dist/tui/openExternal.d.ts +2 -0
- package/dist/tui/openExternal.js +5 -0
- package/dist/tui/palette.d.ts +27 -0
- package/dist/tui/palette.js +66 -0
- package/dist/tui/planColumns.d.ts +38 -0
- package/dist/tui/planColumns.js +14 -0
- package/dist/tui/readDashboard.d.ts +3 -0
- package/dist/tui/readDashboard.js +15 -0
- package/dist/tui/readProcesses.d.ts +3 -0
- package/dist/tui/readProcesses.js +23 -0
- package/dist/tui/registryView.d.ts +11 -0
- package/dist/tui/registryView.js +56 -0
- package/dist/tui/runTui.d.ts +21 -0
- package/dist/tui/runTui.js +86 -0
- package/dist/tui/systemTheme.d.ts +28 -0
- package/dist/tui/systemTheme.js +141 -0
- package/dist/types.d.ts +191 -0
- package/dist/types.js +0 -0
- package/dist/webManifest.d.ts +39 -0
- package/dist/webManifest.js +48 -0
- package/dist/workflow.d.ts +8 -0
- package/dist/workflow.js +42 -0
- package/dist/workflowLayoutShared.d.ts +25 -0
- package/dist/workflowLayoutShared.js +33 -0
- package/dist/workflowSource.d.ts +31 -0
- package/dist/workflowSource.js +90 -0
- package/docs/changelogs/changelog-2026-10-27.md +203 -0
- package/docs/changelogs/changelog-2026-10-28.md +181 -0
- package/docs/changelogs/changelog-2026-10-29.md +349 -0
- package/docs/changelogs/changelog-2026-10-30.md +303 -0
- package/docs/changelogs/changelog-2026-10-31.md +129 -0
- package/docs/changelogs/changelog-2026-11-01.md +155 -0
- package/docs/changelogs/changelog-2026-11-02.md +195 -0
- package/docs/changelogs/changelog-2026-11-03.md +209 -0
- package/docs/changelogs/changelog-2026-11-04.md +243 -0
- package/docs/changelogs/changelog-2026-11-05.md +172 -0
- package/docs/changelogs/changelog-2026-11-06.md +123 -0
- package/docs/changelogs/changelog-2026-11-07.md +138 -0
- package/docs/changelogs/changelog-2026-11-08.md +47 -0
- package/docs/changelogs/changelog-2026-11-10.md +219 -0
- package/docs/changelogs/changelog-2026-11-11.md +205 -0
- package/docs/changelogs/changelog-2026-11-12.md +44 -0
- package/docs/changelogs/changelog-2026-11-13.md +48 -0
- package/docs/changelogs/changelog-2026-11-14.md +116 -0
- package/docs/changelogs/changelog-2026-11-15.md +31 -0
- package/docs/changelogs/changelog-2026-11-16.md +41 -0
- package/docs/changelogs/changelog-2026-11-17.md +25 -0
- package/docs/changelogs/changelog-2026-11-18.md +71 -0
- package/docs/changelogs/changelog-2026-11-19.md +19 -0
- package/examples/cloud-showcase.plan.md +181 -0
- package/examples/component-showcase.plan.md +378 -0
- package/examples/component-tour.plan.md +168 -0
- package/examples/data-table.plan.md +917 -0
- package/examples/execution-graph.json +15 -5
- package/examples/form-controls.plan.md +51 -0
- package/examples/live-plan.config.json +5 -0
- package/examples/rate-limit.plan.md +110 -78
- package/examples/submission-delivery-runbook.md +122 -0
- package/examples/submission-delivery.plan.md +107 -0
- package/examples/tables.plan.md +61 -0
- package/package.json +86 -15
- package/skills/live-plan/SKILL.md +381 -0
- package/skills/live-plan/primitives.md +738 -0
- package/skills/living-plan/SKILL.md +0 -71
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
import { randomBytes, timingSafeEqual } from 'node:crypto';
|
|
2
|
+
import { readFile, rm } from 'node:fs/promises';
|
|
3
|
+
import { Elysia } from 'elysia';
|
|
4
|
+
import { buildDashboard, parsePeriod, periodRange } from './dashboard';
|
|
5
|
+
import { renderDashboardPage } from './dashboardPage';
|
|
6
|
+
import { assertBodyLimit, html, HttpError, jsonBody } from './http';
|
|
7
|
+
import { DASHBOARD_PLAN_LIMIT, DASHBOARD_VERSIONS_PER_PLAN, SearchRequestError, dashboardSearchParams, searchPlans, } from './planSearch';
|
|
8
|
+
import { acceptClientLog, installServiceLogCapture, readLogs, recordLog, recordUnexpectedError } from './serviceLog';
|
|
9
|
+
import { bindElysia } from './httpServer';
|
|
10
|
+
import { archivePlanFile, archivedPlanPath, isPathInside } from './planArchive';
|
|
11
|
+
import { createPlanHost } from './planHost';
|
|
12
|
+
import { registerPlanRoutes } from './planRoutes';
|
|
13
|
+
import { guardRequest } from './requestGuard';
|
|
14
|
+
import { readClientAsset } from './planSession';
|
|
15
|
+
import { authorizeLan, cookieValue, currentPeer, grantLanEntry, LAN_COOKIE } from './lanAccess';
|
|
16
|
+
import { readLanEnabled, readLanSecret } from './lanConfig';
|
|
17
|
+
import { attachLanPublisher } from './mdnsPublish';
|
|
18
|
+
import { registryBindUrl } from './registryClient';
|
|
19
|
+
import { DEFAULT_REGISTRY_HOST, STALE_MS } from './registryConstants';
|
|
20
|
+
import { registryDatabasePath, registryPlansDir, registryStartingPath, writeRegistryLock } from './registryLock';
|
|
21
|
+
import { renderRegistryPage } from './registryPage';
|
|
22
|
+
import { openRegistryStore } from './registryStore';
|
|
23
|
+
import { emptyGitSnapshot, finishedPlan, readProgress, runningPlan } from './processRecord';
|
|
24
|
+
const ID_PATTERN = /^[A-Za-z0-9_-]{8,80}$/;
|
|
25
|
+
function authorized(request, token) {
|
|
26
|
+
const header = request.headers.get('authorization');
|
|
27
|
+
if (!header)
|
|
28
|
+
return false;
|
|
29
|
+
const expected = Buffer.from(`Bearer ${token}`);
|
|
30
|
+
const actual = Buffer.from(header);
|
|
31
|
+
if (actual.length !== expected.length)
|
|
32
|
+
return false;
|
|
33
|
+
return timingSafeEqual(actual, expected);
|
|
34
|
+
}
|
|
35
|
+
function clip(value, max) {
|
|
36
|
+
if (typeof value !== 'string')
|
|
37
|
+
return null;
|
|
38
|
+
const trimmed = value.trim();
|
|
39
|
+
if (!trimmed)
|
|
40
|
+
return null;
|
|
41
|
+
return trimmed.slice(0, max);
|
|
42
|
+
}
|
|
43
|
+
function requireText(value, max) {
|
|
44
|
+
return clip(value, max);
|
|
45
|
+
}
|
|
46
|
+
function httpUrl(value) {
|
|
47
|
+
if (typeof value !== 'string' || !value.trim())
|
|
48
|
+
return null;
|
|
49
|
+
try {
|
|
50
|
+
const url = new URL(value.trim());
|
|
51
|
+
if (url.protocol !== 'http:' && url.protocol !== 'https:')
|
|
52
|
+
return null;
|
|
53
|
+
if ((url.pathname === '/' || url.pathname === '') && !url.search && !url.hash)
|
|
54
|
+
return url.origin;
|
|
55
|
+
return url.toString();
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function parseGit(value) {
|
|
62
|
+
if (!value || typeof value !== 'object')
|
|
63
|
+
return emptyGitSnapshot();
|
|
64
|
+
const git = value;
|
|
65
|
+
const changedPaths = Array.isArray(git.changedPaths)
|
|
66
|
+
? git.changedPaths
|
|
67
|
+
.filter((entry) => typeof entry === 'string')
|
|
68
|
+
.map((entry) => entry.slice(0, 300))
|
|
69
|
+
.slice(0, 12)
|
|
70
|
+
: [];
|
|
71
|
+
const snapshot = {
|
|
72
|
+
isRepo: Boolean(git.isRepo),
|
|
73
|
+
root: clip(git.root, 500),
|
|
74
|
+
branch: clip(git.branch, 200),
|
|
75
|
+
commit: clip(git.commit, 80),
|
|
76
|
+
dirty: Boolean(git.dirty),
|
|
77
|
+
ahead: Number.isFinite(Number(git.ahead)) ? Math.max(0, Math.round(Number(git.ahead))) : 0,
|
|
78
|
+
behind: Number.isFinite(Number(git.behind)) ? Math.max(0, Math.round(Number(git.behind))) : 0,
|
|
79
|
+
changedFiles: Number.isFinite(Number(git.changedFiles))
|
|
80
|
+
? Math.max(0, Math.round(Number(git.changedFiles)))
|
|
81
|
+
: changedPaths.length,
|
|
82
|
+
changedPaths,
|
|
83
|
+
summary: clip(git.summary, 400) ?? '',
|
|
84
|
+
};
|
|
85
|
+
if (!snapshot.isRepo)
|
|
86
|
+
return emptyGitSnapshot(snapshot.summary || 'not a git repository');
|
|
87
|
+
return snapshot;
|
|
88
|
+
}
|
|
89
|
+
function parseRegistration(body, now) {
|
|
90
|
+
if (!body || typeof body !== 'object')
|
|
91
|
+
return { error: 'Expected a JSON object' };
|
|
92
|
+
const raw = body;
|
|
93
|
+
const id = typeof raw.id === 'string' ? raw.id.trim() : '';
|
|
94
|
+
if (!ID_PATTERN.test(id))
|
|
95
|
+
return { error: 'Invalid process id' };
|
|
96
|
+
const pid = Number(raw.pid);
|
|
97
|
+
if (!Number.isInteger(pid) || pid <= 0)
|
|
98
|
+
return { error: 'Invalid pid' };
|
|
99
|
+
const port = Number(raw.port);
|
|
100
|
+
if (!Number.isInteger(port) || port <= 0 || port > 65_535)
|
|
101
|
+
return { error: 'Invalid port' };
|
|
102
|
+
const mode = raw.mode === 'review' ? 'review' : raw.mode === 'comment' ? 'comment' : raw.mode === 'watch' ? 'watch' : null;
|
|
103
|
+
if (!mode)
|
|
104
|
+
return { error: 'Invalid mode' };
|
|
105
|
+
const title = requireText(raw.title, 200);
|
|
106
|
+
const planPath = requireText(raw.planPath, 1000);
|
|
107
|
+
const directory = requireText(raw.directory, 1000);
|
|
108
|
+
const cwd = requireText(raw.cwd, 1000);
|
|
109
|
+
const url = httpUrl(raw.url);
|
|
110
|
+
const host = requireText(raw.host, 255);
|
|
111
|
+
if (!title || !planPath || !directory || !cwd || !url || !host) {
|
|
112
|
+
return { error: 'title, planPath, directory, cwd, url, and host are required' };
|
|
113
|
+
}
|
|
114
|
+
const pendingCount = Number(raw.pendingCount);
|
|
115
|
+
return {
|
|
116
|
+
id,
|
|
117
|
+
pid,
|
|
118
|
+
title,
|
|
119
|
+
summary: clip(raw.summary, 500),
|
|
120
|
+
agent: clip(raw.agent, 200),
|
|
121
|
+
mode,
|
|
122
|
+
planPath,
|
|
123
|
+
directory,
|
|
124
|
+
cwd,
|
|
125
|
+
url,
|
|
126
|
+
host,
|
|
127
|
+
port,
|
|
128
|
+
startedAt: now,
|
|
129
|
+
heartbeatAt: now,
|
|
130
|
+
pendingCount: Number.isFinite(pendingCount) ? Math.max(0, Math.round(pendingCount)) : 0,
|
|
131
|
+
executionActive: Boolean(raw.executionActive),
|
|
132
|
+
executionStep: clip(raw.executionStep, 200),
|
|
133
|
+
git: parseGit(raw.git),
|
|
134
|
+
...readProgress(raw),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function parsePulse(body) {
|
|
138
|
+
if (!body || typeof body !== 'object')
|
|
139
|
+
return {};
|
|
140
|
+
const raw = body;
|
|
141
|
+
const pulse = { ...readProgress(raw) };
|
|
142
|
+
const title = clip(raw.title, 200);
|
|
143
|
+
if (title)
|
|
144
|
+
pulse.title = title;
|
|
145
|
+
if ('summary' in raw)
|
|
146
|
+
pulse.summary = clip(raw.summary, 500);
|
|
147
|
+
if ('agent' in raw)
|
|
148
|
+
pulse.agent = clip(raw.agent, 200);
|
|
149
|
+
if ('pendingCount' in raw && Number.isFinite(Number(raw.pendingCount))) {
|
|
150
|
+
pulse.pendingCount = Math.max(0, Math.round(Number(raw.pendingCount)));
|
|
151
|
+
}
|
|
152
|
+
if ('executionActive' in raw)
|
|
153
|
+
pulse.executionActive = Boolean(raw.executionActive);
|
|
154
|
+
if ('executionStep' in raw)
|
|
155
|
+
pulse.executionStep = clip(raw.executionStep, 200);
|
|
156
|
+
if ('git' in raw)
|
|
157
|
+
pulse.git = parseGit(raw.git);
|
|
158
|
+
return pulse;
|
|
159
|
+
}
|
|
160
|
+
function routeId(value) {
|
|
161
|
+
if (!value)
|
|
162
|
+
return null;
|
|
163
|
+
try {
|
|
164
|
+
const id = decodeURIComponent(value);
|
|
165
|
+
return ID_PATTERN.test(id) ? id : null;
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
export async function startRegistryServer(options) {
|
|
172
|
+
installServiceLogCapture();
|
|
173
|
+
const host = options.host ?? DEFAULT_REGISTRY_HOST;
|
|
174
|
+
const token = options.token ?? randomBytes(24).toString('hex');
|
|
175
|
+
const lanEnabled = await readLanEnabled(options.home);
|
|
176
|
+
const lanSecret = lanEnabled ? await readLanSecret(options.home) : null;
|
|
177
|
+
const staleMs = options.staleMs ?? STALE_MS;
|
|
178
|
+
const store = await openRegistryStore(registryDatabasePath(options.home));
|
|
179
|
+
const plansDir = registryPlansDir(options.home);
|
|
180
|
+
const page = renderRegistryPage();
|
|
181
|
+
const dashboardPage = renderDashboardPage();
|
|
182
|
+
const originBox = { current: '' };
|
|
183
|
+
async function remember(record) {
|
|
184
|
+
const stored = await archivePlanFile(plansDir, record.id, record.planPath);
|
|
185
|
+
store.saveRun(stored ? { ...record, storedPath: stored } : record);
|
|
186
|
+
}
|
|
187
|
+
const planHost = await createPlanHost({
|
|
188
|
+
store,
|
|
189
|
+
serviceToken: token,
|
|
190
|
+
getOrigin: () => originBox.current,
|
|
191
|
+
onFinish: remember,
|
|
192
|
+
});
|
|
193
|
+
function dashboardPlans(window) {
|
|
194
|
+
// Plans deleted from the dashboard keep their rows. They are only left out here.
|
|
195
|
+
const deleted = store.deletedPlanIds();
|
|
196
|
+
const open = [...planHost.dashboardRecords(), ...store.list().map((record) => runningPlan(record))];
|
|
197
|
+
return [...open.filter((record) => !deleted.has(record.id)), ...store.listRuns(window)];
|
|
198
|
+
}
|
|
199
|
+
const app = registerPlanRoutes(new Elysia({ strictPath: true })
|
|
200
|
+
.onBeforeHandle(({ request, set }) => {
|
|
201
|
+
set.headers['cache-control'] = 'no-store';
|
|
202
|
+
const url = new URL(request.url);
|
|
203
|
+
const peer = options.resolvePeer ? (options.resolvePeer(request) ?? '') : currentPeer();
|
|
204
|
+
const guard = guardRequest({
|
|
205
|
+
method: request.method,
|
|
206
|
+
host: request.headers.get('host'),
|
|
207
|
+
origin: request.headers.get('origin'),
|
|
208
|
+
peer,
|
|
209
|
+
bindHost: host,
|
|
210
|
+
});
|
|
211
|
+
if (guard.action === 'deny') {
|
|
212
|
+
set.status = 403;
|
|
213
|
+
return { error: guard.reason };
|
|
214
|
+
}
|
|
215
|
+
const decision = authorizeLan({
|
|
216
|
+
enabled: lanEnabled,
|
|
217
|
+
secret: lanSecret,
|
|
218
|
+
method: request.method,
|
|
219
|
+
pathname: url.pathname,
|
|
220
|
+
peer,
|
|
221
|
+
cookie: cookieValue(request.headers.get('cookie'), LAN_COOKIE),
|
|
222
|
+
querySecret: url.searchParams.get('lan'),
|
|
223
|
+
});
|
|
224
|
+
if (decision.action === 'deny') {
|
|
225
|
+
set.status = 401;
|
|
226
|
+
return { error: 'Unauthorized' };
|
|
227
|
+
}
|
|
228
|
+
if (decision.setCookie)
|
|
229
|
+
set.headers['set-cookie'] = decision.setCookie;
|
|
230
|
+
})
|
|
231
|
+
.onError(({ code, error, set, request }) => {
|
|
232
|
+
if (error instanceof HttpError) {
|
|
233
|
+
set.status = error.status;
|
|
234
|
+
if (error.status >= 500)
|
|
235
|
+
recordUnexpectedError(error, request);
|
|
236
|
+
return { error: error.message };
|
|
237
|
+
}
|
|
238
|
+
if (code === 'NOT_FOUND') {
|
|
239
|
+
set.status = 404;
|
|
240
|
+
return { error: 'Not found' };
|
|
241
|
+
}
|
|
242
|
+
set.status = 500;
|
|
243
|
+
recordUnexpectedError(error, request);
|
|
244
|
+
return { error: error instanceof Error ? error.message : 'Unknown error' };
|
|
245
|
+
})
|
|
246
|
+
.get('/dashboard', () => html(dashboardPage))
|
|
247
|
+
.get('/api/dashboard', ({ request, set }) => {
|
|
248
|
+
const period = parsePeriod(new URL(request.url).searchParams.get('period') ?? 'day');
|
|
249
|
+
if (!period) {
|
|
250
|
+
set.status = 400;
|
|
251
|
+
return { error: 'period must be day, week, or month' };
|
|
252
|
+
}
|
|
253
|
+
store.prune({ staleMs });
|
|
254
|
+
const now = Date.now();
|
|
255
|
+
const range = periodRange(period, now);
|
|
256
|
+
return buildDashboard(dashboardPlans(range), period, now);
|
|
257
|
+
})
|
|
258
|
+
.get('/api/dashboard/search', ({ request }) => {
|
|
259
|
+
let params;
|
|
260
|
+
try {
|
|
261
|
+
params = dashboardSearchParams(new URL(request.url));
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
if (error instanceof SearchRequestError)
|
|
265
|
+
throw new HttpError(error.status, error.message);
|
|
266
|
+
throw error;
|
|
267
|
+
}
|
|
268
|
+
store.prune({ staleMs });
|
|
269
|
+
// The dashboard lists open plans first, then finished runs. One plan can have several runs.
|
|
270
|
+
const listed = new Map();
|
|
271
|
+
for (const record of dashboardPlans())
|
|
272
|
+
if (!listed.has(record.id))
|
|
273
|
+
listed.set(record.id, record);
|
|
274
|
+
const records = [...listed.values()];
|
|
275
|
+
const perPlan = params.version === 'all' ? DASHBOARD_VERSIONS_PER_PLAN : 1;
|
|
276
|
+
// searchPlans reads at most DASHBOARD_PLAN_LIMIT plans and reports the rest as truncated.
|
|
277
|
+
const documents = store.planDocuments(records.slice(0, DASHBOARD_PLAN_LIMIT).map((record) => record.id), perPlan);
|
|
278
|
+
return searchPlans({
|
|
279
|
+
...params,
|
|
280
|
+
plans: records.map((record) => ({
|
|
281
|
+
planId: record.id,
|
|
282
|
+
title: record.title,
|
|
283
|
+
url: record.status === 'running' ? record.url || null : null,
|
|
284
|
+
documents: documents.get(record.id) ?? [],
|
|
285
|
+
})),
|
|
286
|
+
});
|
|
287
|
+
})
|
|
288
|
+
.delete('/api/dashboard/plans/:id', ({ params, set }) => {
|
|
289
|
+
const id = routeId(params.id);
|
|
290
|
+
if (!id || !store.softDelete(id)) {
|
|
291
|
+
set.status = 404;
|
|
292
|
+
return { error: 'Plan not found' };
|
|
293
|
+
}
|
|
294
|
+
return { ok: true };
|
|
295
|
+
})
|
|
296
|
+
.get('/api/plans', () => {
|
|
297
|
+
store.prune({ staleMs });
|
|
298
|
+
return { plans: dashboardPlans() };
|
|
299
|
+
})
|
|
300
|
+
.get('/archive/:id', async ({ params, set }) => {
|
|
301
|
+
const id = routeId(params.id);
|
|
302
|
+
const target = id ? archivedPlanPath(plansDir, id) : null;
|
|
303
|
+
if (!target || !isPathInside(plansDir, target)) {
|
|
304
|
+
set.status = 404;
|
|
305
|
+
return { error: 'Archived plan not found' };
|
|
306
|
+
}
|
|
307
|
+
try {
|
|
308
|
+
const body = await readFile(target);
|
|
309
|
+
return new Response(body, {
|
|
310
|
+
headers: {
|
|
311
|
+
'content-type': 'text/markdown; charset=utf-8',
|
|
312
|
+
'cache-control': 'no-store',
|
|
313
|
+
},
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
catch {
|
|
317
|
+
set.status = 404;
|
|
318
|
+
return { error: 'Archived plan not found' };
|
|
319
|
+
}
|
|
320
|
+
})
|
|
321
|
+
.get('/lan/*', ({ params, request, set }) => {
|
|
322
|
+
if (!lanEnabled) {
|
|
323
|
+
set.status = 404;
|
|
324
|
+
return { error: 'Not found' };
|
|
325
|
+
}
|
|
326
|
+
const presented = String(params['*'] ?? '').replace(/\/$/, '');
|
|
327
|
+
if (!presented || presented.includes('/')) {
|
|
328
|
+
set.status = 404;
|
|
329
|
+
return { error: 'Not found' };
|
|
330
|
+
}
|
|
331
|
+
const next = new URL(request.url).searchParams.get('next');
|
|
332
|
+
const decision = grantLanEntry(presented, lanSecret, next);
|
|
333
|
+
if (decision.action === 'deny') {
|
|
334
|
+
set.status = 401;
|
|
335
|
+
return { error: 'Unauthorized' };
|
|
336
|
+
}
|
|
337
|
+
return new Response(null, {
|
|
338
|
+
status: 302,
|
|
339
|
+
headers: {
|
|
340
|
+
location: decision.location,
|
|
341
|
+
'set-cookie': decision.setCookie,
|
|
342
|
+
'cache-control': 'no-store',
|
|
343
|
+
},
|
|
344
|
+
});
|
|
345
|
+
})
|
|
346
|
+
.get('/api/health', () => ({
|
|
347
|
+
ok: true,
|
|
348
|
+
pid: process.pid,
|
|
349
|
+
processes: store.list().length + planHost.listRecords().length,
|
|
350
|
+
version: options.version ?? null,
|
|
351
|
+
}))
|
|
352
|
+
.get('/api/logs', async ({ request, set }) => {
|
|
353
|
+
const result = await readLogs(request);
|
|
354
|
+
set.status = result.status;
|
|
355
|
+
return result.body;
|
|
356
|
+
})
|
|
357
|
+
.post('/api/logs', async ({ request, body, set }) => {
|
|
358
|
+
assertBodyLimit(request, 16_384);
|
|
359
|
+
const result = await acceptClientLog(jsonBody(body, true));
|
|
360
|
+
set.status = result.status;
|
|
361
|
+
return result.body;
|
|
362
|
+
})
|
|
363
|
+
.get('/client/*', async ({ params, set }) => {
|
|
364
|
+
try {
|
|
365
|
+
const response = await readClientAsset(String(params['*'] ?? ''));
|
|
366
|
+
if (!response) {
|
|
367
|
+
set.status = 404;
|
|
368
|
+
return { error: 'Asset not found' };
|
|
369
|
+
}
|
|
370
|
+
return response;
|
|
371
|
+
}
|
|
372
|
+
catch (error) {
|
|
373
|
+
if (error instanceof HttpError) {
|
|
374
|
+
set.status = error.status;
|
|
375
|
+
return { error: error.message };
|
|
376
|
+
}
|
|
377
|
+
throw error;
|
|
378
|
+
}
|
|
379
|
+
})
|
|
380
|
+
.post('/api/plans', async ({ request, body, set }) => {
|
|
381
|
+
if (!authorized(request, token)) {
|
|
382
|
+
set.status = 401;
|
|
383
|
+
return { error: 'Unauthorized' };
|
|
384
|
+
}
|
|
385
|
+
assertBodyLimit(request);
|
|
386
|
+
const payload = jsonBody(body, true);
|
|
387
|
+
const planPath = requireText(payload.planPath, 1000);
|
|
388
|
+
const mode = payload.mode === 'review' ? 'review' : payload.mode === 'comment' ? 'comment' : payload.mode === 'watch' ? 'watch' : null;
|
|
389
|
+
if (!planPath || !mode) {
|
|
390
|
+
set.status = 400;
|
|
391
|
+
return { error: 'planPath and mode are required' };
|
|
392
|
+
}
|
|
393
|
+
const iteration = Number(payload.iteration);
|
|
394
|
+
try {
|
|
395
|
+
const hosted = await planHost.register({
|
|
396
|
+
planPath,
|
|
397
|
+
mode,
|
|
398
|
+
iteration: Number.isFinite(iteration) ? iteration : undefined,
|
|
399
|
+
cwd: requireText(payload.cwd, 1000) ?? undefined,
|
|
400
|
+
configPath: requireText(payload.configPath, 1000) ?? undefined,
|
|
401
|
+
});
|
|
402
|
+
return { ok: true, plan: hosted };
|
|
403
|
+
}
|
|
404
|
+
catch (error) {
|
|
405
|
+
const code = error && typeof error === 'object' && 'code' in error ? error.code : '';
|
|
406
|
+
set.status = code === 'ENOENT' ? 404 : 400;
|
|
407
|
+
return { error: error instanceof Error ? error.message : 'Unable to open plan' };
|
|
408
|
+
}
|
|
409
|
+
})
|
|
410
|
+
.delete('/api/plans/:id', async ({ request, params, set }) => {
|
|
411
|
+
if (!authorized(request, token)) {
|
|
412
|
+
set.status = 401;
|
|
413
|
+
return { error: 'Unauthorized' };
|
|
414
|
+
}
|
|
415
|
+
const id = routeId(params.id);
|
|
416
|
+
if (!id) {
|
|
417
|
+
set.status = 404;
|
|
418
|
+
return { error: 'Not found' };
|
|
419
|
+
}
|
|
420
|
+
const removed = await planHost.closePlan(id);
|
|
421
|
+
if (!removed) {
|
|
422
|
+
set.status = 404;
|
|
423
|
+
return { error: 'Not found' };
|
|
424
|
+
}
|
|
425
|
+
return { ok: true };
|
|
426
|
+
})
|
|
427
|
+
.get('/', () => html(page))
|
|
428
|
+
.get('/api/processes', () => {
|
|
429
|
+
store.prune({ staleMs });
|
|
430
|
+
return {
|
|
431
|
+
status: 'ok',
|
|
432
|
+
processes: [...planHost.listRecords(), ...store.list()],
|
|
433
|
+
};
|
|
434
|
+
})
|
|
435
|
+
.post('/api/processes', async ({ request, body, set }) => {
|
|
436
|
+
if (!authorized(request, token)) {
|
|
437
|
+
set.status = 401;
|
|
438
|
+
return { error: 'Unauthorized' };
|
|
439
|
+
}
|
|
440
|
+
assertBodyLimit(request);
|
|
441
|
+
const parsed = parseRegistration(jsonBody(body, true), Date.now());
|
|
442
|
+
if ('error' in parsed) {
|
|
443
|
+
set.status = 400;
|
|
444
|
+
return parsed;
|
|
445
|
+
}
|
|
446
|
+
const existing = store.get(parsed.id);
|
|
447
|
+
store.upsert(existing ? { ...parsed, startedAt: existing.startedAt } : parsed);
|
|
448
|
+
// A plan that registers again shows on the dashboard again.
|
|
449
|
+
store.restore(parsed.id);
|
|
450
|
+
await archivePlanFile(plansDir, parsed.id, parsed.planPath);
|
|
451
|
+
return { ok: true, process: store.get(parsed.id) };
|
|
452
|
+
})
|
|
453
|
+
.post('/api/processes/:id/heartbeat', ({ request, params, body, set }) => {
|
|
454
|
+
if (!authorized(request, token)) {
|
|
455
|
+
set.status = 401;
|
|
456
|
+
return { error: 'Unauthorized' };
|
|
457
|
+
}
|
|
458
|
+
assertBodyLimit(request);
|
|
459
|
+
const id = routeId(params.id);
|
|
460
|
+
if (!id) {
|
|
461
|
+
set.status = 404;
|
|
462
|
+
return { error: 'Not found' };
|
|
463
|
+
}
|
|
464
|
+
const updated = store.heartbeat(id, {
|
|
465
|
+
at: Date.now(),
|
|
466
|
+
...parsePulse(jsonBody(body, false)),
|
|
467
|
+
});
|
|
468
|
+
if (!updated) {
|
|
469
|
+
set.status = 404;
|
|
470
|
+
return { error: 'Not registered' };
|
|
471
|
+
}
|
|
472
|
+
return { ok: true, process: updated };
|
|
473
|
+
})
|
|
474
|
+
.delete('/api/processes/:id', async ({ request, params, body, set }) => {
|
|
475
|
+
if (!authorized(request, token)) {
|
|
476
|
+
set.status = 401;
|
|
477
|
+
return { error: 'Unauthorized' };
|
|
478
|
+
}
|
|
479
|
+
assertBodyLimit(request);
|
|
480
|
+
const id = routeId(params.id);
|
|
481
|
+
if (!id) {
|
|
482
|
+
set.status = 404;
|
|
483
|
+
return { error: 'Not found' };
|
|
484
|
+
}
|
|
485
|
+
const existing = store.get(id);
|
|
486
|
+
if (existing) {
|
|
487
|
+
const payload = jsonBody(body, false);
|
|
488
|
+
const outcome = payload.outcome === 'approve' || payload.outcome === 'deny' || payload.outcome === 'iterate'
|
|
489
|
+
? payload.outcome
|
|
490
|
+
: null;
|
|
491
|
+
await remember(finishedPlan(existing, 'executed', outcome));
|
|
492
|
+
}
|
|
493
|
+
store.remove(id);
|
|
494
|
+
return { ok: true };
|
|
495
|
+
}), {
|
|
496
|
+
hosted: true,
|
|
497
|
+
resolve: (id) => (id ? planHost.getSession(id) : undefined),
|
|
498
|
+
authorizeAgent: (request, session) => planHost.authorize(request, session),
|
|
499
|
+
});
|
|
500
|
+
let bound;
|
|
501
|
+
try {
|
|
502
|
+
bound = bindElysia(app, host, options.port ?? 0);
|
|
503
|
+
}
|
|
504
|
+
catch (error) {
|
|
505
|
+
await planHost.close();
|
|
506
|
+
store.close();
|
|
507
|
+
throw error;
|
|
508
|
+
}
|
|
509
|
+
const url = registryBindUrl({ host, port: bound.port });
|
|
510
|
+
originBox.current = url;
|
|
511
|
+
await writeRegistryLock(options.home, {
|
|
512
|
+
pid: process.pid,
|
|
513
|
+
port: bound.port,
|
|
514
|
+
host,
|
|
515
|
+
url,
|
|
516
|
+
token,
|
|
517
|
+
startedAt: Date.now(),
|
|
518
|
+
version: options.version,
|
|
519
|
+
});
|
|
520
|
+
await rm(registryStartingPath(options.home), { force: true });
|
|
521
|
+
const lan = await attachLanPublisher({
|
|
522
|
+
enabled: lanEnabled,
|
|
523
|
+
advertise: options.advertise !== false,
|
|
524
|
+
bindHost: host,
|
|
525
|
+
port: bound.port,
|
|
526
|
+
home: options.home,
|
|
527
|
+
});
|
|
528
|
+
const timer = setInterval(() => {
|
|
529
|
+
try {
|
|
530
|
+
store.prune({ staleMs });
|
|
531
|
+
}
|
|
532
|
+
catch (error) {
|
|
533
|
+
void recordLog({
|
|
534
|
+
level: 'warn',
|
|
535
|
+
message: 'Could not prune stale plans',
|
|
536
|
+
detail: error instanceof Error ? error.message : undefined,
|
|
537
|
+
source: 'server',
|
|
538
|
+
}).catch(() => undefined);
|
|
539
|
+
}
|
|
540
|
+
}, 5_000);
|
|
541
|
+
timer.unref();
|
|
542
|
+
return {
|
|
543
|
+
url,
|
|
544
|
+
port: bound.port,
|
|
545
|
+
host,
|
|
546
|
+
token,
|
|
547
|
+
home: options.home,
|
|
548
|
+
publishing: lan.publishing,
|
|
549
|
+
async close() {
|
|
550
|
+
clearInterval(timer);
|
|
551
|
+
await lan.stop();
|
|
552
|
+
const { readRegistryLock, registryLockPath } = await import('./registryLock');
|
|
553
|
+
const lock = await readRegistryLock(options.home);
|
|
554
|
+
if (lock?.pid === process.pid) {
|
|
555
|
+
await rm(registryLockPath(options.home), { force: true });
|
|
556
|
+
}
|
|
557
|
+
await planHost.close();
|
|
558
|
+
store.close();
|
|
559
|
+
await bound.stop();
|
|
560
|
+
},
|
|
561
|
+
};
|
|
562
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type PlanMode, type PlanRecord, type ProcessPulse, type ProcessRecord, type ProgressFields } from './processRecord';
|
|
2
|
+
import type { PlanSubmissionEvent } from './types';
|
|
3
|
+
export type StoredPlanSession = {
|
|
4
|
+
id: string;
|
|
5
|
+
token: string;
|
|
6
|
+
planPath: string;
|
|
7
|
+
mode: PlanMode;
|
|
8
|
+
iteration: number;
|
|
9
|
+
cwd: string;
|
|
10
|
+
configPath: string | null;
|
|
11
|
+
responsesJson: string;
|
|
12
|
+
executionJson: string;
|
|
13
|
+
reviewJson: string | null;
|
|
14
|
+
commentsJson: string;
|
|
15
|
+
startedAt: number;
|
|
16
|
+
lastSeenAt: number;
|
|
17
|
+
syncRevision?: number;
|
|
18
|
+
syncMutationsJson?: string;
|
|
19
|
+
themeUpdatedAt?: number;
|
|
20
|
+
};
|
|
21
|
+
/** Inclusive window. A finished run overlaps when it started at or before `to` and ended at or after `from`. */
|
|
22
|
+
export type RunWindow = {
|
|
23
|
+
from: number;
|
|
24
|
+
to: number;
|
|
25
|
+
};
|
|
26
|
+
/** A live process row with the progress it last reported. */
|
|
27
|
+
export type LiveProcess = ProcessRecord & ProgressFields;
|
|
28
|
+
export type RegistryStore = {
|
|
29
|
+
upsert(record: ProcessRecord & Partial<ProgressFields>): void;
|
|
30
|
+
get(id: string): LiveProcess | undefined;
|
|
31
|
+
list(): LiveProcess[];
|
|
32
|
+
heartbeat(id: string, pulse: ProcessPulse): LiveProcess | undefined;
|
|
33
|
+
remove(id: string): boolean;
|
|
34
|
+
prune(options?: {
|
|
35
|
+
now?: number;
|
|
36
|
+
staleMs?: number;
|
|
37
|
+
isAlive?: (pid: number) => boolean;
|
|
38
|
+
}): string[];
|
|
39
|
+
saveSession(session: StoredPlanSession, events?: PlanSubmissionEvent[]): void;
|
|
40
|
+
listEvents(planId: string): PlanSubmissionEvent[];
|
|
41
|
+
getSession(id: string): StoredPlanSession | undefined;
|
|
42
|
+
getSessionByPath(planPath: string): StoredPlanSession | undefined;
|
|
43
|
+
listSessions(): StoredPlanSession[];
|
|
44
|
+
deleteSession(id: string): boolean;
|
|
45
|
+
saveRun(record: PlanRecord): void;
|
|
46
|
+
/** Finished runs the dashboard shows. Runs deleted from the dashboard are left out. */
|
|
47
|
+
listRuns(window?: RunWindow): PlanRecord[];
|
|
48
|
+
/** Hide a plan and its finished runs from the dashboard. Nothing is removed. False when no row has that id. */
|
|
49
|
+
softDelete(id: string, at?: number): boolean;
|
|
50
|
+
/** Show the plan row again. Called when the plan is served again. Its earlier runs stay hidden. */
|
|
51
|
+
restore(id: string): void;
|
|
52
|
+
/** Ids of plan rows deleted from the dashboard. */
|
|
53
|
+
deletedPlanIds(): Set<string>;
|
|
54
|
+
/** Saved documents of each plan, newest first, at most `perPlan` each. The newest is the live file. */
|
|
55
|
+
planDocuments(planIds: string[], perPlan: number): Map<string, Array<{
|
|
56
|
+
seq: number;
|
|
57
|
+
title: string;
|
|
58
|
+
source: string;
|
|
59
|
+
createdAt: number;
|
|
60
|
+
}>>;
|
|
61
|
+
close(): void;
|
|
62
|
+
};
|
|
63
|
+
export declare function openRegistryStore(dbPath: string): Promise<RegistryStore>;
|