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,490 @@
|
|
|
1
|
+
import { execFile, spawn } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
import { closeSync, openSync } from 'node:fs';
|
|
4
|
+
import { mkdir, open, readFile, rm, stat } from 'node:fs/promises';
|
|
5
|
+
import { dirname, join } from 'node:path';
|
|
6
|
+
import { readGitSnapshot } from './gitStatus';
|
|
7
|
+
import { isPidAlive } from './pid';
|
|
8
|
+
import { chooseBindHost, readLanEnabled } from './lanConfig';
|
|
9
|
+
import { formatHttpOrigin } from './localName';
|
|
10
|
+
import { DEFAULT_REGISTRY_PORT, HEARTBEAT_MS } from './registryConstants';
|
|
11
|
+
import { defaultRegistryHome, readRegistryLock, registryStartingPath, } from './registryLock';
|
|
12
|
+
export { defaultRegistryHome, readRegistryLock } from './registryLock';
|
|
13
|
+
const STARTING_STALE_MS = 8_000;
|
|
14
|
+
function authHeaders(token) {
|
|
15
|
+
return {
|
|
16
|
+
authorization: `Bearer ${token}`,
|
|
17
|
+
'content-type': 'application/json',
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** Address the CLI uses to reach the service. The published URL may still name a legacy `.local` host. */
|
|
21
|
+
export function registryBindUrl(lock) {
|
|
22
|
+
const normalized = lock.host.trim().toLowerCase();
|
|
23
|
+
const host = normalized === '0.0.0.0' || normalized === '::' || normalized === '[::]' || normalized === 'localhost'
|
|
24
|
+
? '127.0.0.1'
|
|
25
|
+
: lock.host.trim();
|
|
26
|
+
return formatHttpOrigin(host, lock.port);
|
|
27
|
+
}
|
|
28
|
+
/** Hosts previously published for this service. Resolving them goes through mDNS. */
|
|
29
|
+
const LEGACY_MDNS_HOSTS = new Set(['living-plan.local', 'visual-living-plan.local']);
|
|
30
|
+
function isLegacyMdnsHost(hostname) {
|
|
31
|
+
return LEGACY_MDNS_HOSTS.has(hostname.trim().toLowerCase().replace(/\.$/, ''));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Dial 127.0.0.1 for a legacy `.local` URL when no service lock is available.
|
|
35
|
+
* Other URLs are left alone.
|
|
36
|
+
*/
|
|
37
|
+
export function preferLoopbackUrl(publicUrl) {
|
|
38
|
+
let target;
|
|
39
|
+
try {
|
|
40
|
+
target = new URL(publicUrl);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return publicUrl;
|
|
44
|
+
}
|
|
45
|
+
if (!isLegacyMdnsHost(target.hostname))
|
|
46
|
+
return publicUrl;
|
|
47
|
+
target.hostname = '127.0.0.1';
|
|
48
|
+
if (!target.port)
|
|
49
|
+
target.port = String(DEFAULT_REGISTRY_PORT);
|
|
50
|
+
return target.toString();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Keep a plan or service URL's path, but dial the bind address.
|
|
54
|
+
* A legacy `.local` host is always rewritten so the CLI does not wait on mDNS.
|
|
55
|
+
* A different origin is left alone.
|
|
56
|
+
*/
|
|
57
|
+
export function rewriteToBindUrl(lock, publicUrl) {
|
|
58
|
+
let published;
|
|
59
|
+
let target;
|
|
60
|
+
try {
|
|
61
|
+
published = new URL(lock.url);
|
|
62
|
+
target = new URL(publicUrl);
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return preferLoopbackUrl(publicUrl);
|
|
66
|
+
}
|
|
67
|
+
if (target.origin !== published.origin && !isLegacyMdnsHost(target.hostname))
|
|
68
|
+
return publicUrl;
|
|
69
|
+
const bind = new URL(registryBindUrl(lock));
|
|
70
|
+
target.protocol = bind.protocol;
|
|
71
|
+
target.hostname = bind.hostname;
|
|
72
|
+
target.port = bind.port;
|
|
73
|
+
return target.toString();
|
|
74
|
+
}
|
|
75
|
+
/** Rewrite a published service URL onto the running registry's bind address. */
|
|
76
|
+
export async function localServiceUrl(publicUrl, home = defaultRegistryHome()) {
|
|
77
|
+
const lock = await readRegistryLock(home);
|
|
78
|
+
if (!lock)
|
|
79
|
+
return preferLoopbackUrl(publicUrl);
|
|
80
|
+
return rewriteToBindUrl(lock, publicUrl);
|
|
81
|
+
}
|
|
82
|
+
export async function registryHealthy(url) {
|
|
83
|
+
try {
|
|
84
|
+
const response = await fetch(new URL('/api/health', url), {
|
|
85
|
+
signal: AbortSignal.timeout(800),
|
|
86
|
+
});
|
|
87
|
+
if (!response.ok)
|
|
88
|
+
return false;
|
|
89
|
+
const body = (await response.json());
|
|
90
|
+
return body.ok === true;
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async function runningRegistry(home) {
|
|
97
|
+
const lock = await readRegistryLock(home);
|
|
98
|
+
if (!lock || !isPidAlive(lock.pid))
|
|
99
|
+
return null;
|
|
100
|
+
// Dial the bind address. A published *.local name is answered by mDNS and can outlast this probe.
|
|
101
|
+
if (!(await registryHealthy(registryBindUrl(lock))))
|
|
102
|
+
return null;
|
|
103
|
+
return lock;
|
|
104
|
+
}
|
|
105
|
+
async function waitForRunning(home, timeoutMs) {
|
|
106
|
+
const started = Date.now();
|
|
107
|
+
while (Date.now() - started < timeoutMs) {
|
|
108
|
+
const lock = await runningRegistry(home);
|
|
109
|
+
if (lock)
|
|
110
|
+
return lock;
|
|
111
|
+
await new Promise((resolveDelay) => setTimeout(resolveDelay, 100));
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
async function startingLockAge(home) {
|
|
116
|
+
try {
|
|
117
|
+
const info = await stat(registryStartingPath(home));
|
|
118
|
+
return Date.now() - info.mtimeMs;
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
async function acquireStartingLock(home) {
|
|
125
|
+
try {
|
|
126
|
+
const handle = await open(registryStartingPath(home), 'wx');
|
|
127
|
+
await handle.writeFile(String(process.pid));
|
|
128
|
+
await handle.close();
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
const code = error && typeof error === 'object' && 'code' in error ? error.code : '';
|
|
133
|
+
if (code === 'EEXIST')
|
|
134
|
+
return false;
|
|
135
|
+
throw error;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function onBun() {
|
|
139
|
+
return typeof process.versions.bun === 'string';
|
|
140
|
+
}
|
|
141
|
+
function loaderArgs() {
|
|
142
|
+
const args = process.execArgv;
|
|
143
|
+
const kept = [];
|
|
144
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
145
|
+
const arg = args[index] ?? '';
|
|
146
|
+
if (arg === '--test' || arg.startsWith('--test-'))
|
|
147
|
+
continue;
|
|
148
|
+
if (arg === '--experimental-strip-types' || arg === '--experimental-sqlite') {
|
|
149
|
+
kept.push(arg);
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
if (arg === '--require' || arg === '-r' || arg === '--import' || arg === '--loader') {
|
|
153
|
+
const next = args[index + 1];
|
|
154
|
+
if (next && !next.startsWith('-')) {
|
|
155
|
+
kept.push(arg, next);
|
|
156
|
+
index += 1;
|
|
157
|
+
}
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
if (arg.startsWith('--require=') || arg.startsWith('--import=') || arg.startsWith('--loader=')) {
|
|
161
|
+
kept.push(arg);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return kept;
|
|
165
|
+
}
|
|
166
|
+
function childArgs(entryFile, commandArgs) {
|
|
167
|
+
if (onBun())
|
|
168
|
+
return [entryFile, ...commandArgs];
|
|
169
|
+
const loaders = loaderArgs();
|
|
170
|
+
if (loaders.length > 0)
|
|
171
|
+
return [...loaders, entryFile, ...commandArgs];
|
|
172
|
+
if (entryFile.endsWith('.ts') || entryFile.endsWith('.tsx') || entryFile.endsWith('.mts')) {
|
|
173
|
+
return ['--experimental-strip-types', entryFile, ...commandArgs];
|
|
174
|
+
}
|
|
175
|
+
return [entryFile, ...commandArgs];
|
|
176
|
+
}
|
|
177
|
+
const execFileAsync = promisify(execFile);
|
|
178
|
+
async function processCommand(pid) {
|
|
179
|
+
try {
|
|
180
|
+
return await readFile(`/proc/${pid}/cmdline`, 'utf8');
|
|
181
|
+
}
|
|
182
|
+
catch {
|
|
183
|
+
// macOS has no /proc. `ps` is the fallback so `lan on` can restart the service there.
|
|
184
|
+
}
|
|
185
|
+
try {
|
|
186
|
+
const { stdout } = await execFileAsync('ps', ['-p', String(pid), '-o', 'command='], { timeout: 1_000 });
|
|
187
|
+
return stdout;
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
return '';
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
async function looksLikeRegistryProcess(pid) {
|
|
194
|
+
if (!isPidAlive(pid))
|
|
195
|
+
return false;
|
|
196
|
+
const command = await processCommand(pid);
|
|
197
|
+
return command.includes('registry');
|
|
198
|
+
}
|
|
199
|
+
/** Drop a lock whose process is gone. Stop a wedged registry only when its command line is ours. */
|
|
200
|
+
async function retireUnhealthyRegistry(home) {
|
|
201
|
+
const lock = await readRegistryLock(home);
|
|
202
|
+
if (!lock)
|
|
203
|
+
return;
|
|
204
|
+
if (await runningRegistry(home))
|
|
205
|
+
return;
|
|
206
|
+
if (isPidAlive(lock.pid) && (await looksLikeRegistryProcess(lock.pid))) {
|
|
207
|
+
try {
|
|
208
|
+
process.kill(lock.pid, 'SIGTERM');
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
// The process already exited.
|
|
212
|
+
}
|
|
213
|
+
const started = Date.now();
|
|
214
|
+
while (isPidAlive(lock.pid) && Date.now() - started < 1_500) {
|
|
215
|
+
await new Promise((resolveDelay) => setTimeout(resolveDelay, 50));
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (!isPidAlive(lock.pid)) {
|
|
219
|
+
await rm(join(home, 'registry.json'), { force: true });
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
export async function readPackageVersion(entryFile) {
|
|
223
|
+
try {
|
|
224
|
+
const raw = await readFile(join(dirname(entryFile), '..', 'package.json'), 'utf8');
|
|
225
|
+
const parsed = JSON.parse(raw);
|
|
226
|
+
return typeof parsed.version === 'string' && parsed.version ? parsed.version : '0.0.0';
|
|
227
|
+
}
|
|
228
|
+
catch {
|
|
229
|
+
return '0.0.0';
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/** Stop a registry this package started. Used when its package version is stale or LAN bind changes. */
|
|
233
|
+
export async function stopRegistry(home) {
|
|
234
|
+
const lock = await readRegistryLock(home);
|
|
235
|
+
if (!lock)
|
|
236
|
+
return;
|
|
237
|
+
if (isPidAlive(lock.pid) && (await looksLikeRegistryProcess(lock.pid))) {
|
|
238
|
+
try {
|
|
239
|
+
process.kill(lock.pid, 'SIGTERM');
|
|
240
|
+
}
|
|
241
|
+
catch {
|
|
242
|
+
// The process already exited.
|
|
243
|
+
}
|
|
244
|
+
const started = Date.now();
|
|
245
|
+
while (isPidAlive(lock.pid) && Date.now() - started < 1_500) {
|
|
246
|
+
await new Promise((resolveDelay) => setTimeout(resolveDelay, 50));
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (!isPidAlive(lock.pid)) {
|
|
250
|
+
await rm(join(home, 'registry.json'), { force: true });
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
/** Start the service in its own session, with stdio pointed at the registry log. */
|
|
254
|
+
function spawnDetachedRegistry(entryFile, port, host, home, env) {
|
|
255
|
+
const logPath = join(home, 'registry.log');
|
|
256
|
+
const stdoutFd = openSync(logPath, 'a');
|
|
257
|
+
const stderrFd = openSync(logPath, 'a');
|
|
258
|
+
try {
|
|
259
|
+
const spawnOptions = {
|
|
260
|
+
detached: true,
|
|
261
|
+
stdio: ['ignore', stdoutFd, stderrFd],
|
|
262
|
+
env: { ...env, LIVE_PLAN_HOME: home, LIVE_PLAN_DAEMON: '1' },
|
|
263
|
+
windowsHide: true,
|
|
264
|
+
};
|
|
265
|
+
const child = spawn(process.execPath, childArgs(entryFile, ['registry', '--port', String(port), '--host', host]), spawnOptions);
|
|
266
|
+
child.unref();
|
|
267
|
+
return child;
|
|
268
|
+
}
|
|
269
|
+
finally {
|
|
270
|
+
closeSync(stdoutFd);
|
|
271
|
+
closeSync(stderrFd);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Connect to the shared plan service, starting a detached one when none is running.
|
|
276
|
+
* One service hosts every plan. It keeps running after the spawning CLI and later clients exit.
|
|
277
|
+
*/
|
|
278
|
+
export async function ensureRegistry(options) {
|
|
279
|
+
const home = options.home ?? defaultRegistryHome();
|
|
280
|
+
const host = chooseBindHost(options.host, await readLanEnabled(home));
|
|
281
|
+
const port = options.port ?? DEFAULT_REGISTRY_PORT;
|
|
282
|
+
const version = await readPackageVersion(options.entryFile);
|
|
283
|
+
const usable = (lock) => lock !== null && (options.anyVersion === true || lock.version === version);
|
|
284
|
+
await mkdir(home, { recursive: true, mode: 0o700 });
|
|
285
|
+
const already = await runningRegistry(home);
|
|
286
|
+
if (usable(already))
|
|
287
|
+
return already;
|
|
288
|
+
if (already)
|
|
289
|
+
await stopRegistry(home);
|
|
290
|
+
const age = await startingLockAge(home);
|
|
291
|
+
if (age !== null && age < STARTING_STALE_MS) {
|
|
292
|
+
const waited = await waitForRunning(home, STARTING_STALE_MS);
|
|
293
|
+
if (usable(waited))
|
|
294
|
+
return waited;
|
|
295
|
+
if (waited)
|
|
296
|
+
await stopRegistry(home);
|
|
297
|
+
}
|
|
298
|
+
await rm(registryStartingPath(home), { force: true });
|
|
299
|
+
const stillThere = await runningRegistry(home);
|
|
300
|
+
if (usable(stillThere))
|
|
301
|
+
return stillThere;
|
|
302
|
+
if (stillThere)
|
|
303
|
+
await stopRegistry(home);
|
|
304
|
+
await retireUnhealthyRegistry(home);
|
|
305
|
+
const acquired = await acquireStartingLock(home);
|
|
306
|
+
if (!acquired) {
|
|
307
|
+
const waited = await waitForRunning(home, STARTING_STALE_MS);
|
|
308
|
+
if (waited)
|
|
309
|
+
return waited;
|
|
310
|
+
throw new Error('Timed out waiting for the live-plan registry to start');
|
|
311
|
+
}
|
|
312
|
+
const child = spawnDetachedRegistry(options.entryFile, port, host, home, process.env);
|
|
313
|
+
const waited = await waitForRunning(home, STARTING_STALE_MS);
|
|
314
|
+
await rm(registryStartingPath(home), { force: true });
|
|
315
|
+
if (waited?.version === version)
|
|
316
|
+
return waited;
|
|
317
|
+
if (waited)
|
|
318
|
+
await stopRegistry(home);
|
|
319
|
+
const late = await runningRegistry(home);
|
|
320
|
+
if (late?.version === version)
|
|
321
|
+
return late;
|
|
322
|
+
if (late)
|
|
323
|
+
await stopRegistry(home);
|
|
324
|
+
if (child.pid && isPidAlive(child.pid)) {
|
|
325
|
+
try {
|
|
326
|
+
process.kill(child.pid, 'SIGTERM');
|
|
327
|
+
}
|
|
328
|
+
catch {
|
|
329
|
+
// The child already exited.
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
throw new Error(`Timed out starting the live-plan registry. See ${join(home, 'registry.log')}`);
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Start the service again for a client whose stream it dropped, when it died without cleaning up.
|
|
336
|
+
*
|
|
337
|
+
* It acts only when the lock is still there and its process is gone, which is what a crash leaves.
|
|
338
|
+
* A service that stopped on purpose (`stopRegistry`, a version restart, a test) removes its lock, and
|
|
339
|
+
* one that is starting holds the starting lock: both are left alone. It never stops a running service,
|
|
340
|
+
* whatever its version, so two CLI versions do not take turns restarting it. The new process binds the
|
|
341
|
+
* same host and port the lock recorded. Returns true when a service is running again.
|
|
342
|
+
*/
|
|
343
|
+
export async function reviveRegistry(options) {
|
|
344
|
+
const home = options.home ?? defaultRegistryHome();
|
|
345
|
+
const lock = await readRegistryLock(home);
|
|
346
|
+
if (!lock || isPidAlive(lock.pid))
|
|
347
|
+
return false;
|
|
348
|
+
const age = await startingLockAge(home);
|
|
349
|
+
if (age !== null && age < STARTING_STALE_MS)
|
|
350
|
+
return false;
|
|
351
|
+
await rm(registryStartingPath(home), { force: true });
|
|
352
|
+
if (!(await acquireStartingLock(home)))
|
|
353
|
+
return false;
|
|
354
|
+
try {
|
|
355
|
+
const current = await readRegistryLock(home);
|
|
356
|
+
if (!current || isPidAlive(current.pid))
|
|
357
|
+
return false;
|
|
358
|
+
await rm(join(home, 'registry.json'), { force: true });
|
|
359
|
+
spawnDetachedRegistry(options.entryFile, lock.port, lock.host, home, process.env);
|
|
360
|
+
return (await waitForRunning(home, STARTING_STALE_MS)) !== null;
|
|
361
|
+
}
|
|
362
|
+
finally {
|
|
363
|
+
await rm(registryStartingPath(home), { force: true });
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
export async function registerHostedPlan(registryUrl, token, body) {
|
|
367
|
+
const response = await fetch(new URL('/api/plans', registryUrl), {
|
|
368
|
+
method: 'POST',
|
|
369
|
+
headers: authHeaders(token),
|
|
370
|
+
body: JSON.stringify(body),
|
|
371
|
+
signal: AbortSignal.timeout(5_000),
|
|
372
|
+
});
|
|
373
|
+
if (!response.ok)
|
|
374
|
+
throw new Error(await response.text());
|
|
375
|
+
const payload = (await response.json());
|
|
376
|
+
return payload.plan;
|
|
377
|
+
}
|
|
378
|
+
export async function closeHostedPlan(registryUrl, token, id) {
|
|
379
|
+
const response = await fetch(new URL(`/api/plans/${encodeURIComponent(id)}`, registryUrl), {
|
|
380
|
+
method: 'DELETE',
|
|
381
|
+
headers: authHeaders(token),
|
|
382
|
+
signal: AbortSignal.timeout(5_000),
|
|
383
|
+
});
|
|
384
|
+
if (response.status === 404 || response.ok)
|
|
385
|
+
return;
|
|
386
|
+
throw new Error(await response.text());
|
|
387
|
+
}
|
|
388
|
+
export async function listProcesses(registryUrl) {
|
|
389
|
+
const response = await fetch(new URL('/api/processes', registryUrl), {
|
|
390
|
+
signal: AbortSignal.timeout(1_500),
|
|
391
|
+
});
|
|
392
|
+
if (!response.ok)
|
|
393
|
+
throw new Error(await response.text());
|
|
394
|
+
const payload = (await response.json());
|
|
395
|
+
return payload.processes ?? [];
|
|
396
|
+
}
|
|
397
|
+
export async function registerProcess(registryUrl, token, record) {
|
|
398
|
+
const response = await fetch(new URL('/api/processes', registryUrl), {
|
|
399
|
+
method: 'POST',
|
|
400
|
+
headers: authHeaders(token),
|
|
401
|
+
body: JSON.stringify(record),
|
|
402
|
+
signal: AbortSignal.timeout(2_000),
|
|
403
|
+
});
|
|
404
|
+
if (!response.ok)
|
|
405
|
+
throw new Error(await response.text());
|
|
406
|
+
const payload = (await response.json());
|
|
407
|
+
return payload.process;
|
|
408
|
+
}
|
|
409
|
+
export async function heartbeatProcess(registryUrl, token, id, pulse) {
|
|
410
|
+
const response = await fetch(new URL(`/api/processes/${encodeURIComponent(id)}/heartbeat`, registryUrl), {
|
|
411
|
+
method: 'POST',
|
|
412
|
+
headers: authHeaders(token),
|
|
413
|
+
body: JSON.stringify(pulse),
|
|
414
|
+
signal: AbortSignal.timeout(2_000),
|
|
415
|
+
});
|
|
416
|
+
if (response.status === 404)
|
|
417
|
+
return false;
|
|
418
|
+
if (!response.ok)
|
|
419
|
+
throw new Error(await response.text());
|
|
420
|
+
return true;
|
|
421
|
+
}
|
|
422
|
+
export async function unregisterProcess(registryUrl, token, id, outcome) {
|
|
423
|
+
const response = await fetch(new URL(`/api/processes/${encodeURIComponent(id)}`, registryUrl), {
|
|
424
|
+
method: 'DELETE',
|
|
425
|
+
headers: authHeaders(token),
|
|
426
|
+
body: JSON.stringify({ outcome: outcome ?? null }),
|
|
427
|
+
signal: AbortSignal.timeout(2_000),
|
|
428
|
+
});
|
|
429
|
+
if (response.status === 404 || response.ok)
|
|
430
|
+
return;
|
|
431
|
+
throw new Error(await response.text());
|
|
432
|
+
}
|
|
433
|
+
export async function watchRegisteredPlan(options) {
|
|
434
|
+
const git = options.record.git ?? readGitSnapshot(options.record.directory);
|
|
435
|
+
await registerProcess(options.registryUrl, options.token, { ...options.record, git });
|
|
436
|
+
let stopped = false;
|
|
437
|
+
const timer = setInterval(() => {
|
|
438
|
+
void pulse();
|
|
439
|
+
}, HEARTBEAT_MS);
|
|
440
|
+
timer.unref();
|
|
441
|
+
async function pulse() {
|
|
442
|
+
if (stopped)
|
|
443
|
+
return;
|
|
444
|
+
const live = options.describe?.();
|
|
445
|
+
const nextGit = readGitSnapshot(options.record.directory);
|
|
446
|
+
const beat = {
|
|
447
|
+
git: nextGit,
|
|
448
|
+
filesModified: nextGit.changedFiles,
|
|
449
|
+
title: live?.title,
|
|
450
|
+
summary: live?.summary,
|
|
451
|
+
agent: live?.agent,
|
|
452
|
+
pendingCount: live?.pendingCount,
|
|
453
|
+
executionActive: live?.executionActive,
|
|
454
|
+
executionStep: live?.executionStep,
|
|
455
|
+
phaseTotal: live?.phaseTotal,
|
|
456
|
+
phaseDone: live?.phaseDone,
|
|
457
|
+
interactionTotal: live?.interactionTotal,
|
|
458
|
+
interactionDone: live?.interactionDone,
|
|
459
|
+
completionRatio: live?.completionRatio,
|
|
460
|
+
completionState: live?.completionState,
|
|
461
|
+
};
|
|
462
|
+
try {
|
|
463
|
+
const ok = await heartbeatProcess(options.registryUrl, options.token, options.record.id, beat);
|
|
464
|
+
if (!ok) {
|
|
465
|
+
await registerProcess(options.registryUrl, options.token, {
|
|
466
|
+
...options.record,
|
|
467
|
+
...live,
|
|
468
|
+
git: nextGit,
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
catch {
|
|
473
|
+
// The next interval tries again. Stale rows are pruned by the registry.
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return {
|
|
477
|
+
async stop(outcome) {
|
|
478
|
+
if (stopped)
|
|
479
|
+
return;
|
|
480
|
+
stopped = true;
|
|
481
|
+
clearInterval(timer);
|
|
482
|
+
try {
|
|
483
|
+
await unregisterProcess(options.registryUrl, options.token, options.record.id, outcome);
|
|
484
|
+
}
|
|
485
|
+
catch {
|
|
486
|
+
// Heartbeats stop, and the registry marks the row interrupted once it is stale.
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
};
|
|
490
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Loopback port for the shared plan registry. Override with `--registry-port`. */
|
|
2
|
+
export declare const DEFAULT_REGISTRY_PORT = 9477;
|
|
3
|
+
export declare const DEFAULT_REGISTRY_HOST = "127.0.0.1";
|
|
4
|
+
/** How often a serve/review process tells the registry it is still alive. */
|
|
5
|
+
export declare const HEARTBEAT_MS = 5000;
|
|
6
|
+
/** Drop a plan when its heartbeat is older than this, or when its pid is gone. */
|
|
7
|
+
export declare const STALE_MS = 20000;
|
|
8
|
+
/** Close a hosted plan after this long with no browser and no agent stream. */
|
|
9
|
+
export declare const SESSION_IDLE_MS: number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Loopback port for the shared plan registry. Override with `--registry-port`. */
|
|
2
|
+
export const DEFAULT_REGISTRY_PORT = 9477;
|
|
3
|
+
export const DEFAULT_REGISTRY_HOST = '127.0.0.1';
|
|
4
|
+
/** How often a serve/review process tells the registry it is still alive. */
|
|
5
|
+
export const HEARTBEAT_MS = 5_000;
|
|
6
|
+
/** Drop a plan when its heartbeat is older than this, or when its pid is gone. */
|
|
7
|
+
export const STALE_MS = 20_000;
|
|
8
|
+
/** Close a hosted plan after this long with no browser and no agent stream. */
|
|
9
|
+
export const SESSION_IDLE_MS = 6 * 60 * 60 * 1000;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type RegistryLock = {
|
|
2
|
+
pid: number;
|
|
3
|
+
port: number;
|
|
4
|
+
host: string;
|
|
5
|
+
url: string;
|
|
6
|
+
token: string;
|
|
7
|
+
startedAt: number;
|
|
8
|
+
/** Package version that started this process. A mismatch restarts the service. */
|
|
9
|
+
version?: string;
|
|
10
|
+
};
|
|
11
|
+
/** Service data directory. See `configHome.ts` for XDG defaults and legacy migration. */
|
|
12
|
+
export declare function defaultRegistryHome(): string;
|
|
13
|
+
export declare function registryLockPath(home: string): string;
|
|
14
|
+
export declare function registryDatabasePath(home: string): string;
|
|
15
|
+
/** Copies of plan files, one per run, kept beside the registry database. */
|
|
16
|
+
export declare function registryPlansDir(home: string): string;
|
|
17
|
+
export declare function registryStartingPath(home: string): string;
|
|
18
|
+
export declare function readRegistryLock(home: string): Promise<RegistryLock | null>;
|
|
19
|
+
export declare function writeRegistryLock(home: string, lock: RegistryLock): Promise<void>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { defaultRegistryHome as resolveRegistryHome } from './configHome';
|
|
4
|
+
/** Service data directory. See `configHome.ts` for XDG defaults and legacy migration. */
|
|
5
|
+
export function defaultRegistryHome() {
|
|
6
|
+
return resolveRegistryHome();
|
|
7
|
+
}
|
|
8
|
+
export function registryLockPath(home) {
|
|
9
|
+
return join(home, 'registry.json');
|
|
10
|
+
}
|
|
11
|
+
export function registryDatabasePath(home) {
|
|
12
|
+
return join(home, 'registry.sqlite');
|
|
13
|
+
}
|
|
14
|
+
/** Copies of plan files, one per run, kept beside the registry database. */
|
|
15
|
+
export function registryPlansDir(home) {
|
|
16
|
+
return join(home, 'plans');
|
|
17
|
+
}
|
|
18
|
+
export function registryStartingPath(home) {
|
|
19
|
+
return join(home, 'registry.starting');
|
|
20
|
+
}
|
|
21
|
+
export async function readRegistryLock(home) {
|
|
22
|
+
try {
|
|
23
|
+
const raw = await readFile(registryLockPath(home), 'utf8');
|
|
24
|
+
const parsed = JSON.parse(raw);
|
|
25
|
+
if (typeof parsed.url !== 'string' || typeof parsed.token !== 'string')
|
|
26
|
+
return null;
|
|
27
|
+
if (typeof parsed.pid !== 'number' || typeof parsed.port !== 'number')
|
|
28
|
+
return null;
|
|
29
|
+
return {
|
|
30
|
+
pid: parsed.pid,
|
|
31
|
+
port: parsed.port,
|
|
32
|
+
host: typeof parsed.host === 'string' ? parsed.host : '127.0.0.1',
|
|
33
|
+
url: parsed.url,
|
|
34
|
+
token: parsed.token,
|
|
35
|
+
startedAt: typeof parsed.startedAt === 'number' ? parsed.startedAt : 0,
|
|
36
|
+
version: typeof parsed.version === 'string' ? parsed.version : undefined,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export async function writeRegistryLock(home, lock) {
|
|
44
|
+
await mkdir(home, { recursive: true, mode: 0o700 });
|
|
45
|
+
const path = registryLockPath(home);
|
|
46
|
+
await writeFile(path, `${JSON.stringify(lock, null, 2)}\n`, { encoding: 'utf8', mode: 0o600 });
|
|
47
|
+
await chmod(path, 0o600);
|
|
48
|
+
}
|