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,384 @@
|
|
|
1
|
+
import { isLinkLocalAddress, isPrivateLanAddress } from './lanAddress';
|
|
2
|
+
export const MDNS_INSTANCE = 'Living Plan';
|
|
3
|
+
export const MDNS_SERVICE = '_http._tcp';
|
|
4
|
+
export const MDNS_HOST = 'living-plan.local';
|
|
5
|
+
export const MDNS_PRODUCT = 'Living Plan';
|
|
6
|
+
const TYPE_A = 1;
|
|
7
|
+
const TYPE_PTR = 12;
|
|
8
|
+
const TYPE_TXT = 16;
|
|
9
|
+
const TYPE_AAAA = 28;
|
|
10
|
+
const TYPE_SRV = 33;
|
|
11
|
+
const TYPE_ANY = 255;
|
|
12
|
+
const CLASS_IN = 1;
|
|
13
|
+
const CACHE_FLUSH = 0x8001;
|
|
14
|
+
const TYPE_NAME = {
|
|
15
|
+
[TYPE_A]: 'A',
|
|
16
|
+
[TYPE_PTR]: 'PTR',
|
|
17
|
+
[TYPE_TXT]: 'TXT',
|
|
18
|
+
[TYPE_AAAA]: 'AAAA',
|
|
19
|
+
[TYPE_SRV]: 'SRV',
|
|
20
|
+
[TYPE_ANY]: 'ANY',
|
|
21
|
+
};
|
|
22
|
+
function encodeName(name) {
|
|
23
|
+
const out = [];
|
|
24
|
+
const labels = name.replace(/\.$/, '').split('.');
|
|
25
|
+
for (const label of labels) {
|
|
26
|
+
const bytes = Buffer.from(label, 'utf8');
|
|
27
|
+
if (bytes.length === 0 || bytes.length > 63)
|
|
28
|
+
throw new Error(`DNS label is invalid: ${label}`);
|
|
29
|
+
out.push(bytes.length, ...bytes);
|
|
30
|
+
}
|
|
31
|
+
out.push(0);
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
function encodeTxt(values) {
|
|
35
|
+
const parts = values.map((value) => {
|
|
36
|
+
const bytes = Buffer.from(value, 'utf8');
|
|
37
|
+
if (bytes.length > 255)
|
|
38
|
+
throw new Error('TXT string is too long');
|
|
39
|
+
return Buffer.concat([Buffer.from([bytes.length]), bytes]);
|
|
40
|
+
});
|
|
41
|
+
return Buffer.concat(parts);
|
|
42
|
+
}
|
|
43
|
+
function ipv4Bytes(address) {
|
|
44
|
+
const parts = address.split('.').map((part) => Number(part));
|
|
45
|
+
if (parts.length !== 4 || parts.some((part) => !Number.isInteger(part) || part < 0 || part > 255)) {
|
|
46
|
+
throw new Error(`Not an IPv4 address: ${address}`);
|
|
47
|
+
}
|
|
48
|
+
return Buffer.from(parts);
|
|
49
|
+
}
|
|
50
|
+
function ipv6Bytes(address) {
|
|
51
|
+
const zone = address.split('%')[0] ?? address;
|
|
52
|
+
const halves = zone.split('::');
|
|
53
|
+
if (halves.length > 2)
|
|
54
|
+
throw new Error(`Not an IPv6 address: ${address}`);
|
|
55
|
+
const parse = (side) => (side ? side.split(':').filter((part) => part.length > 0) : []);
|
|
56
|
+
const left = parse(halves[0] ?? '');
|
|
57
|
+
const right = halves.length === 2 ? parse(halves[1] ?? '') : [];
|
|
58
|
+
const missing = halves.length === 2 ? 8 - (left.length + right.length) : 0;
|
|
59
|
+
if (missing < 0)
|
|
60
|
+
throw new Error(`Not an IPv6 address: ${address}`);
|
|
61
|
+
const groups = halves.length === 2 ? [...left, ...Array.from({ length: missing }, () => '0'), ...right] : left;
|
|
62
|
+
if (groups.length !== 8)
|
|
63
|
+
throw new Error(`Not an IPv6 address: ${address}`);
|
|
64
|
+
const bytes = Buffer.alloc(16);
|
|
65
|
+
groups.forEach((group, index) => {
|
|
66
|
+
if (!/^[0-9a-fA-F]{1,4}$/.test(group))
|
|
67
|
+
throw new Error(`Not an IPv6 address: ${address}`);
|
|
68
|
+
bytes.writeUInt16BE(Number.parseInt(group, 16), index * 2);
|
|
69
|
+
});
|
|
70
|
+
return bytes;
|
|
71
|
+
}
|
|
72
|
+
function assertAdvertisable(address) {
|
|
73
|
+
if (!isPrivateLanAddress(address) || isLinkLocalAddress(address)) {
|
|
74
|
+
throw new Error(`Refusing to advertise ${address}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function instanceName(input) {
|
|
78
|
+
return `${input.instance ?? MDNS_INSTANCE}.${input.service ?? MDNS_SERVICE}.local`;
|
|
79
|
+
}
|
|
80
|
+
function typeName(input) {
|
|
81
|
+
return `${input.service ?? MDNS_SERVICE}.local`;
|
|
82
|
+
}
|
|
83
|
+
function hostName(input) {
|
|
84
|
+
const host = input.host ?? MDNS_HOST;
|
|
85
|
+
return host.endsWith('.') ? host.slice(0, -1) : host;
|
|
86
|
+
}
|
|
87
|
+
function serviceRecords(input) {
|
|
88
|
+
assertAdvertisable(input.address);
|
|
89
|
+
const ttl = input.ttl ?? 120;
|
|
90
|
+
const instance = instanceName(input);
|
|
91
|
+
const type = typeName(input);
|
|
92
|
+
const host = hostName(input);
|
|
93
|
+
const port = input.port;
|
|
94
|
+
const srv = Buffer.alloc(6);
|
|
95
|
+
srv.writeUInt16BE(0, 0);
|
|
96
|
+
srv.writeUInt16BE(0, 2);
|
|
97
|
+
srv.writeUInt16BE(port, 4);
|
|
98
|
+
const txt = encodeTxt([`port=${port}`, `product=${input.product ?? MDNS_PRODUCT}`]);
|
|
99
|
+
const records = [
|
|
100
|
+
{ name: type, type: TYPE_PTR, flush: false, ttl, rdata: Buffer.from(encodeName(instance)) },
|
|
101
|
+
{ name: instance, type: TYPE_SRV, flush: true, ttl, rdata: Buffer.concat([srv, Buffer.from(encodeName(host))]) },
|
|
102
|
+
{ name: instance, type: TYPE_TXT, flush: true, ttl, rdata: txt },
|
|
103
|
+
];
|
|
104
|
+
if (input.address.includes(':')) {
|
|
105
|
+
records.push({ name: host, type: TYPE_AAAA, flush: true, ttl, rdata: ipv6Bytes(input.address) });
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
records.push({ name: host, type: TYPE_A, flush: true, ttl, rdata: ipv4Bytes(input.address) });
|
|
109
|
+
}
|
|
110
|
+
return records;
|
|
111
|
+
}
|
|
112
|
+
function writeRecord(writer, record) {
|
|
113
|
+
writer.write(record.name);
|
|
114
|
+
const header = Buffer.alloc(10);
|
|
115
|
+
header.writeUInt16BE(record.type, 0);
|
|
116
|
+
header.writeUInt16BE(record.flush ? CACHE_FLUSH : CLASS_IN, 2);
|
|
117
|
+
header.writeUInt32BE(record.ttl, 4);
|
|
118
|
+
header.writeUInt16BE(record.rdata.length, 8);
|
|
119
|
+
writer.bytes.push(...header, ...record.rdata);
|
|
120
|
+
}
|
|
121
|
+
function encodeMessage(options) {
|
|
122
|
+
const writer = {
|
|
123
|
+
bytes: [],
|
|
124
|
+
write(name) {
|
|
125
|
+
this.bytes.push(...encodeName(name));
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
const flags = options.response ? 0x8400 : 0;
|
|
129
|
+
const header = Buffer.alloc(12);
|
|
130
|
+
header.writeUInt16BE(options.id, 0);
|
|
131
|
+
header.writeUInt16BE(flags, 2);
|
|
132
|
+
header.writeUInt16BE(options.questions.length, 4);
|
|
133
|
+
header.writeUInt16BE(options.answers.length, 6);
|
|
134
|
+
header.writeUInt16BE(0, 8);
|
|
135
|
+
header.writeUInt16BE(options.additional.length, 10);
|
|
136
|
+
writer.bytes.push(...header);
|
|
137
|
+
for (const question of options.questions) {
|
|
138
|
+
writer.write(question.name);
|
|
139
|
+
const tail = Buffer.alloc(4);
|
|
140
|
+
tail.writeUInt16BE(question.type, 0);
|
|
141
|
+
tail.writeUInt16BE(CLASS_IN, 2);
|
|
142
|
+
writer.bytes.push(...tail);
|
|
143
|
+
}
|
|
144
|
+
for (const record of options.answers)
|
|
145
|
+
writeRecord(writer, record);
|
|
146
|
+
for (const record of options.additional)
|
|
147
|
+
writeRecord(writer, record);
|
|
148
|
+
return Buffer.from(writer.bytes);
|
|
149
|
+
}
|
|
150
|
+
function readName(packet, offset, depth = 0) {
|
|
151
|
+
if (depth > 10)
|
|
152
|
+
throw new Error('DNS name is too nested');
|
|
153
|
+
const labels = [];
|
|
154
|
+
let cursor = offset;
|
|
155
|
+
let jumped = false;
|
|
156
|
+
let end = offset;
|
|
157
|
+
while (cursor < packet.length) {
|
|
158
|
+
const length = packet[cursor] ?? 0;
|
|
159
|
+
if (length === 0) {
|
|
160
|
+
if (!jumped)
|
|
161
|
+
end = cursor + 1;
|
|
162
|
+
return { name: labels.join('.'), offset: end };
|
|
163
|
+
}
|
|
164
|
+
if ((length & 0xc0) === 0xc0) {
|
|
165
|
+
if (cursor + 1 >= packet.length)
|
|
166
|
+
throw new Error('Truncated DNS pointer');
|
|
167
|
+
const pointer = ((length & 0x3f) << 8) | (packet[cursor + 1] ?? 0);
|
|
168
|
+
if (!jumped)
|
|
169
|
+
end = cursor + 2;
|
|
170
|
+
const target = readName(packet, pointer, depth + 1);
|
|
171
|
+
if (target.name)
|
|
172
|
+
labels.push(target.name);
|
|
173
|
+
return { name: labels.join('.'), offset: end };
|
|
174
|
+
}
|
|
175
|
+
if ((length & 0xc0) !== 0)
|
|
176
|
+
throw new Error('Bad DNS label');
|
|
177
|
+
const start = cursor + 1;
|
|
178
|
+
const stop = start + length;
|
|
179
|
+
if (stop > packet.length)
|
|
180
|
+
throw new Error('Truncated DNS label');
|
|
181
|
+
labels.push(packet.subarray(start, stop).toString('utf8'));
|
|
182
|
+
cursor = stop;
|
|
183
|
+
if (!jumped)
|
|
184
|
+
end = cursor;
|
|
185
|
+
}
|
|
186
|
+
throw new Error('Truncated DNS name');
|
|
187
|
+
}
|
|
188
|
+
function readRecords(packet, offset, count) {
|
|
189
|
+
const records = [];
|
|
190
|
+
let cursor = offset;
|
|
191
|
+
for (let index = 0; index < count; index += 1) {
|
|
192
|
+
const name = readName(packet, cursor);
|
|
193
|
+
cursor = name.offset;
|
|
194
|
+
if (cursor + 10 > packet.length)
|
|
195
|
+
throw new Error('Truncated DNS record');
|
|
196
|
+
const type = packet.readUInt16BE(cursor);
|
|
197
|
+
const klass = packet.readUInt16BE(cursor + 2);
|
|
198
|
+
const ttl = packet.readUInt32BE(cursor + 4);
|
|
199
|
+
const length = packet.readUInt16BE(cursor + 8);
|
|
200
|
+
cursor += 10;
|
|
201
|
+
const rdata = packet.subarray(cursor, cursor + length);
|
|
202
|
+
if (rdata.length !== length)
|
|
203
|
+
throw new Error('Truncated DNS rdata');
|
|
204
|
+
cursor += length;
|
|
205
|
+
records.push(describeRecord(name.name, type, klass, ttl, rdata));
|
|
206
|
+
}
|
|
207
|
+
return { records, offset: cursor };
|
|
208
|
+
}
|
|
209
|
+
function formatIpv6(bytes) {
|
|
210
|
+
const groups = [];
|
|
211
|
+
for (let index = 0; index < 16; index += 2)
|
|
212
|
+
groups.push(bytes.readUInt16BE(index).toString(16));
|
|
213
|
+
return groups.join(':');
|
|
214
|
+
}
|
|
215
|
+
function decodeTxt(rdata) {
|
|
216
|
+
const values = [];
|
|
217
|
+
let cursor = 0;
|
|
218
|
+
while (cursor < rdata.length) {
|
|
219
|
+
const length = rdata[cursor] ?? 0;
|
|
220
|
+
cursor += 1;
|
|
221
|
+
values.push(rdata.subarray(cursor, cursor + length).toString('utf8'));
|
|
222
|
+
cursor += length;
|
|
223
|
+
}
|
|
224
|
+
return values;
|
|
225
|
+
}
|
|
226
|
+
function describeRecord(name, type, klass, ttl, rdata) {
|
|
227
|
+
const kind = TYPE_NAME[type] ?? 'OTHER';
|
|
228
|
+
let value = '';
|
|
229
|
+
let texts;
|
|
230
|
+
if (type === TYPE_A && rdata.length === 4)
|
|
231
|
+
value = [...rdata].join('.');
|
|
232
|
+
else if (type === TYPE_AAAA && rdata.length === 16)
|
|
233
|
+
value = formatIpv6(rdata);
|
|
234
|
+
else if (type === TYPE_PTR)
|
|
235
|
+
value = readName(rdata, 0).name;
|
|
236
|
+
else if (type === TYPE_SRV && rdata.length >= 6) {
|
|
237
|
+
const port = rdata.readUInt16BE(4);
|
|
238
|
+
const target = readName(rdata, 6).name;
|
|
239
|
+
value = `${rdata.readUInt16BE(0)} ${rdata.readUInt16BE(2)} ${port} ${target}`;
|
|
240
|
+
}
|
|
241
|
+
else if (type === TYPE_TXT) {
|
|
242
|
+
texts = decodeTxt(rdata);
|
|
243
|
+
value = texts.join('|');
|
|
244
|
+
}
|
|
245
|
+
else
|
|
246
|
+
value = rdata.toString('hex');
|
|
247
|
+
return { name, type: kind, ttl, flush: (klass & CACHE_FLUSH) === CACHE_FLUSH, value, texts };
|
|
248
|
+
}
|
|
249
|
+
export function decodeMessage(packet) {
|
|
250
|
+
if (packet.length < 12)
|
|
251
|
+
throw new Error('DNS message is too short');
|
|
252
|
+
const id = packet.readUInt16BE(0);
|
|
253
|
+
const flags = packet.readUInt16BE(2);
|
|
254
|
+
const questions = [];
|
|
255
|
+
let cursor = 12;
|
|
256
|
+
const questionCount = packet.readUInt16BE(4);
|
|
257
|
+
for (let index = 0; index < questionCount; index += 1) {
|
|
258
|
+
const name = readName(packet, cursor);
|
|
259
|
+
cursor = name.offset;
|
|
260
|
+
if (cursor + 4 > packet.length)
|
|
261
|
+
throw new Error('Truncated DNS question');
|
|
262
|
+
const type = packet.readUInt16BE(cursor);
|
|
263
|
+
const klass = packet.readUInt16BE(cursor + 2);
|
|
264
|
+
cursor += 4;
|
|
265
|
+
questions.push({ name: name.name, type: TYPE_NAME[type] ?? 'OTHER', qu: (klass & 0x8000) !== 0 });
|
|
266
|
+
}
|
|
267
|
+
return decodeSections(packet, id, flags, questions);
|
|
268
|
+
}
|
|
269
|
+
function decodeSections(packet, id, flags, questions) {
|
|
270
|
+
let cursor = 12;
|
|
271
|
+
for (let index = 0; index < packet.readUInt16BE(4); index += 1) {
|
|
272
|
+
cursor = readName(packet, cursor).offset + 4;
|
|
273
|
+
}
|
|
274
|
+
const answers = readRecords(packet, cursor, packet.readUInt16BE(6));
|
|
275
|
+
const authority = readRecords(packet, answers.offset, packet.readUInt16BE(8));
|
|
276
|
+
const additional = readRecords(packet, authority.offset, packet.readUInt16BE(10));
|
|
277
|
+
return {
|
|
278
|
+
id,
|
|
279
|
+
response: (flags & 0x8000) !== 0,
|
|
280
|
+
questions,
|
|
281
|
+
answers: answers.records,
|
|
282
|
+
additional: additional.records,
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
export function announcementPacket(input) {
|
|
286
|
+
return encodeMessage({
|
|
287
|
+
id: 0,
|
|
288
|
+
response: true,
|
|
289
|
+
questions: [],
|
|
290
|
+
answers: serviceRecords(input),
|
|
291
|
+
additional: [],
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
export function goodbyePacket(input) {
|
|
295
|
+
return announcementPacket({ ...input, ttl: 0 });
|
|
296
|
+
}
|
|
297
|
+
const QUERY_TYPE = {
|
|
298
|
+
A: TYPE_A,
|
|
299
|
+
PTR: TYPE_PTR,
|
|
300
|
+
TXT: TYPE_TXT,
|
|
301
|
+
AAAA: TYPE_AAAA,
|
|
302
|
+
SRV: TYPE_SRV,
|
|
303
|
+
ANY: TYPE_ANY,
|
|
304
|
+
};
|
|
305
|
+
export function queryPacket(name, type) {
|
|
306
|
+
const code = QUERY_TYPE[type];
|
|
307
|
+
if (!code)
|
|
308
|
+
throw new Error(`Unknown query type ${type}`);
|
|
309
|
+
return encodeMessage({
|
|
310
|
+
id: 0,
|
|
311
|
+
response: false,
|
|
312
|
+
questions: [{ name, type: code }],
|
|
313
|
+
answers: [],
|
|
314
|
+
additional: [],
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
function recordKey(record) {
|
|
318
|
+
return `${record.name.toLowerCase()} ${record.type}`;
|
|
319
|
+
}
|
|
320
|
+
export function responseForQuery(packet, service) {
|
|
321
|
+
let decoded;
|
|
322
|
+
try {
|
|
323
|
+
decoded = decodeMessage(packet);
|
|
324
|
+
}
|
|
325
|
+
catch {
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
328
|
+
if (decoded.response || decoded.questions.length === 0)
|
|
329
|
+
return null;
|
|
330
|
+
const records = serviceRecords(service);
|
|
331
|
+
const answers = [];
|
|
332
|
+
const seen = new Set();
|
|
333
|
+
const take = (record) => {
|
|
334
|
+
const key = recordKey(record);
|
|
335
|
+
if (seen.has(key))
|
|
336
|
+
return;
|
|
337
|
+
seen.add(key);
|
|
338
|
+
answers.push(record);
|
|
339
|
+
};
|
|
340
|
+
for (const question of decoded.questions) {
|
|
341
|
+
const qtype = QUERY_TYPE[question.type] ?? 0;
|
|
342
|
+
for (const record of records) {
|
|
343
|
+
if (record.name.toLowerCase() !== question.name.toLowerCase())
|
|
344
|
+
continue;
|
|
345
|
+
if (qtype !== TYPE_ANY && record.type !== qtype)
|
|
346
|
+
continue;
|
|
347
|
+
take(record);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
if (answers.length === 0)
|
|
351
|
+
return null;
|
|
352
|
+
const additional = [];
|
|
353
|
+
const have = new Set(answers.map(recordKey));
|
|
354
|
+
const add = (record) => {
|
|
355
|
+
const key = recordKey(record);
|
|
356
|
+
if (have.has(key))
|
|
357
|
+
return;
|
|
358
|
+
have.add(key);
|
|
359
|
+
additional.push(record);
|
|
360
|
+
};
|
|
361
|
+
for (const answer of answers) {
|
|
362
|
+
if (answer.type === TYPE_PTR || answer.type === TYPE_SRV) {
|
|
363
|
+
for (const record of records) {
|
|
364
|
+
if (record.type === TYPE_PTR)
|
|
365
|
+
continue;
|
|
366
|
+
add(record);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return encodeMessage({
|
|
371
|
+
id: decoded.id,
|
|
372
|
+
response: true,
|
|
373
|
+
questions: decoded.questions.map((question) => ({ name: question.name, type: QUERY_TYPE[question.type] ?? TYPE_A })),
|
|
374
|
+
answers,
|
|
375
|
+
additional,
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
export function chooseMdnsBackend(input) {
|
|
379
|
+
if (input.platform === 'darwin' && input.udp5353OwnedBySystem)
|
|
380
|
+
return 'dns-sd';
|
|
381
|
+
if (input.platform === 'linux' && input.avahiRunning)
|
|
382
|
+
return 'avahi';
|
|
383
|
+
return 'process';
|
|
384
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function mdnsPublishAttempts(): number;
|
|
2
|
+
export type LanPublisher = {
|
|
3
|
+
publishing: boolean;
|
|
4
|
+
stop: () => Promise<void>;
|
|
5
|
+
};
|
|
6
|
+
export declare function attachLanPublisher(options: {
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
advertise: boolean;
|
|
9
|
+
bindHost: string;
|
|
10
|
+
port: number;
|
|
11
|
+
home: string;
|
|
12
|
+
}): Promise<LanPublisher>;
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { createSocket } from 'node:dgram';
|
|
3
|
+
import { networkInterfaces } from 'node:os';
|
|
4
|
+
import { detectDefaultInterface, nicsFromNetworkInterfaces, selectLanAddress } from './lanAddress';
|
|
5
|
+
import { isWildcardHost, removeLanRuntime, writeLanRuntime } from './lanConfig';
|
|
6
|
+
import { isLoopbackHost } from './localName';
|
|
7
|
+
import { recordLog } from './serviceLog';
|
|
8
|
+
import { MDNS_HOST, MDNS_INSTANCE, MDNS_PRODUCT, MDNS_SERVICE, announcementPacket, chooseMdnsBackend, goodbyePacket, responseForQuery, } from './mdnsPacket';
|
|
9
|
+
let publishAttempts = 0;
|
|
10
|
+
export function mdnsPublishAttempts() {
|
|
11
|
+
return publishAttempts;
|
|
12
|
+
}
|
|
13
|
+
function noteAttempt() {
|
|
14
|
+
publishAttempts += 1;
|
|
15
|
+
}
|
|
16
|
+
const NO_ADDRESS = 'This machine has no private LAN address to advertise.';
|
|
17
|
+
function serviceFor(port, address) {
|
|
18
|
+
return {
|
|
19
|
+
instance: MDNS_INSTANCE,
|
|
20
|
+
service: MDNS_SERVICE,
|
|
21
|
+
host: MDNS_HOST,
|
|
22
|
+
product: MDNS_PRODUCT,
|
|
23
|
+
port,
|
|
24
|
+
address,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function udpPortBusy(port) {
|
|
28
|
+
return new Promise((resolve) => {
|
|
29
|
+
const socket = createSocket({ type: 'udp4', reuseAddr: false });
|
|
30
|
+
let settled = false;
|
|
31
|
+
const finish = (busy) => {
|
|
32
|
+
if (settled)
|
|
33
|
+
return;
|
|
34
|
+
settled = true;
|
|
35
|
+
clearTimeout(timer);
|
|
36
|
+
resolve(busy);
|
|
37
|
+
};
|
|
38
|
+
const timer = setTimeout(() => {
|
|
39
|
+
try {
|
|
40
|
+
socket.close();
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// The socket never opened.
|
|
44
|
+
}
|
|
45
|
+
finish(true);
|
|
46
|
+
}, 1_000);
|
|
47
|
+
socket.once('error', () => {
|
|
48
|
+
try {
|
|
49
|
+
socket.close();
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// Already closed.
|
|
53
|
+
}
|
|
54
|
+
finish(true);
|
|
55
|
+
});
|
|
56
|
+
socket.bind(port, () => {
|
|
57
|
+
socket.close(() => finish(false));
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function commandOk(command, args) {
|
|
62
|
+
return new Promise((resolve) => {
|
|
63
|
+
const child = spawn(command, args, { stdio: 'ignore' });
|
|
64
|
+
child.once('error', () => resolve(false));
|
|
65
|
+
child.once('exit', (code) => resolve(code === 0));
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
async function warn(message, detail) {
|
|
69
|
+
await recordLog({ level: 'warn', message, detail, source: 'lan', echo: false }).catch(() => undefined);
|
|
70
|
+
}
|
|
71
|
+
function sendTo(socket, packet, port, address) {
|
|
72
|
+
return new Promise((resolve) => {
|
|
73
|
+
socket.send(packet, port, address, () => resolve());
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
async function stopChildren(children) {
|
|
77
|
+
for (const child of children) {
|
|
78
|
+
if (child.exitCode !== null)
|
|
79
|
+
continue;
|
|
80
|
+
try {
|
|
81
|
+
child.kill('SIGINT');
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// The helper already exited.
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const deadline = Date.now() + 400;
|
|
88
|
+
while (children.some((child) => child.exitCode === null) && Date.now() < deadline) {
|
|
89
|
+
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
90
|
+
}
|
|
91
|
+
for (const child of children) {
|
|
92
|
+
if (child.exitCode !== null)
|
|
93
|
+
continue;
|
|
94
|
+
try {
|
|
95
|
+
child.kill('SIGTERM');
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
// The helper already exited.
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function listenProcess(service, address) {
|
|
103
|
+
const ipv6 = address.includes(':');
|
|
104
|
+
const socket = createSocket({ type: ipv6 ? 'udp6' : 'udp4', reuseAddr: true });
|
|
105
|
+
const group = ipv6 ? 'ff02::fb' : '224.0.0.251';
|
|
106
|
+
noteAttempt();
|
|
107
|
+
return new Promise((resolve, reject) => {
|
|
108
|
+
const fail = (error) => {
|
|
109
|
+
try {
|
|
110
|
+
socket.close();
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
// Not bound yet.
|
|
114
|
+
}
|
|
115
|
+
reject(error);
|
|
116
|
+
};
|
|
117
|
+
socket.once('error', fail);
|
|
118
|
+
socket.bind(5353, () => {
|
|
119
|
+
socket.off('error', fail);
|
|
120
|
+
socket.on('error', (error) => {
|
|
121
|
+
void warn('mDNS socket error', error.message);
|
|
122
|
+
});
|
|
123
|
+
try {
|
|
124
|
+
socket.addMembership(group);
|
|
125
|
+
socket.setMulticastTTL(255);
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
// Membership can fail when the interface is not ready. Direct replies still work.
|
|
129
|
+
}
|
|
130
|
+
const announce = announcementPacket(service);
|
|
131
|
+
const repeat = setTimeout(() => {
|
|
132
|
+
void sendTo(socket, announce, 5353, group);
|
|
133
|
+
}, 1_000);
|
|
134
|
+
repeat.unref?.();
|
|
135
|
+
socket.on('message', (message, rinfo) => {
|
|
136
|
+
const response = responseForQuery(message, service);
|
|
137
|
+
if (!response)
|
|
138
|
+
return;
|
|
139
|
+
void sendTo(socket, response, rinfo.port, rinfo.address);
|
|
140
|
+
});
|
|
141
|
+
void sendTo(socket, announce, 5353, group);
|
|
142
|
+
resolve({
|
|
143
|
+
async stop() {
|
|
144
|
+
clearTimeout(repeat);
|
|
145
|
+
try {
|
|
146
|
+
await sendTo(socket, goodbyePacket(service), 5353, group);
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
// The socket is already closing.
|
|
150
|
+
}
|
|
151
|
+
await new Promise((done) => {
|
|
152
|
+
try {
|
|
153
|
+
socket.close(() => done());
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
done();
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
async function spawnHelper(command, args) {
|
|
165
|
+
noteAttempt();
|
|
166
|
+
const child = spawn(command, args, { stdio: 'ignore' });
|
|
167
|
+
const failed = await new Promise((resolve) => {
|
|
168
|
+
const timer = setTimeout(() => resolve(null), 400);
|
|
169
|
+
child.once('error', (error) => {
|
|
170
|
+
clearTimeout(timer);
|
|
171
|
+
resolve(error instanceof Error ? error : new Error(String(error)));
|
|
172
|
+
});
|
|
173
|
+
child.once('exit', (code) => {
|
|
174
|
+
clearTimeout(timer);
|
|
175
|
+
resolve(new Error(`${command} exited ${code ?? 'unknown'}`));
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
if (failed)
|
|
179
|
+
throw failed;
|
|
180
|
+
return child;
|
|
181
|
+
}
|
|
182
|
+
async function startBackend(service, address) {
|
|
183
|
+
const busy = await udpPortBusy(5353);
|
|
184
|
+
const avahi = process.platform === 'linux' ? await commandOk('avahi-daemon', ['--check']) : false;
|
|
185
|
+
const backend = chooseMdnsBackend({ platform: process.platform, udp5353OwnedBySystem: busy, avahiRunning: avahi });
|
|
186
|
+
const port = String(service.port);
|
|
187
|
+
const txt = [`port=${service.port}`, `product=${MDNS_PRODUCT}`];
|
|
188
|
+
if (backend === 'dns-sd') {
|
|
189
|
+
const child = await spawnHelper('dns-sd', ['-P', MDNS_INSTANCE, MDNS_SERVICE, 'local', port, MDNS_HOST, address, ...txt]);
|
|
190
|
+
return { backend, stop: async () => stopChildren([child]) };
|
|
191
|
+
}
|
|
192
|
+
if (backend === 'avahi') {
|
|
193
|
+
const addressChild = await spawnHelper('avahi-publish', ['-a', MDNS_HOST, address]);
|
|
194
|
+
const serviceChild = await spawnHelper('avahi-publish', [
|
|
195
|
+
'-s',
|
|
196
|
+
'-H',
|
|
197
|
+
MDNS_HOST,
|
|
198
|
+
MDNS_INSTANCE,
|
|
199
|
+
MDNS_SERVICE,
|
|
200
|
+
port,
|
|
201
|
+
...txt,
|
|
202
|
+
]);
|
|
203
|
+
return { backend, stop: async () => stopChildren([addressChild, serviceChild]) };
|
|
204
|
+
}
|
|
205
|
+
if (busy) {
|
|
206
|
+
throw new Error('UDP 5353 is already in use and no mDNS daemon is available');
|
|
207
|
+
}
|
|
208
|
+
const listener = await listenProcess(service, address);
|
|
209
|
+
return { backend: 'process', stop: listener.stop };
|
|
210
|
+
}
|
|
211
|
+
export async function attachLanPublisher(options) {
|
|
212
|
+
if (!options.enabled || !options.advertise) {
|
|
213
|
+
return { publishing: false, stop: async () => { } };
|
|
214
|
+
}
|
|
215
|
+
const nics = nicsFromNetworkInterfaces(networkInterfaces());
|
|
216
|
+
const explicit = isWildcardHost(options.bindHost) || isLoopbackHost(options.bindHost) ? null : options.bindHost;
|
|
217
|
+
let address = null;
|
|
218
|
+
try {
|
|
219
|
+
address = selectLanAddress(nics, await detectDefaultInterface(nics), explicit);
|
|
220
|
+
}
|
|
221
|
+
catch (error) {
|
|
222
|
+
const message = error instanceof Error ? error.message : 'Could not choose a LAN address';
|
|
223
|
+
await warn(message);
|
|
224
|
+
await writeLanRuntime(options.home, {
|
|
225
|
+
pid: process.pid,
|
|
226
|
+
address: null,
|
|
227
|
+
port: options.port,
|
|
228
|
+
backend: 'none',
|
|
229
|
+
error: message,
|
|
230
|
+
}).catch(() => undefined);
|
|
231
|
+
return {
|
|
232
|
+
publishing: false,
|
|
233
|
+
async stop() {
|
|
234
|
+
await removeLanRuntime(options.home);
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
if (!address) {
|
|
239
|
+
await warn(NO_ADDRESS);
|
|
240
|
+
await writeLanRuntime(options.home, {
|
|
241
|
+
pid: process.pid,
|
|
242
|
+
address: null,
|
|
243
|
+
port: options.port,
|
|
244
|
+
backend: 'none',
|
|
245
|
+
error: NO_ADDRESS,
|
|
246
|
+
}).catch(() => undefined);
|
|
247
|
+
return {
|
|
248
|
+
publishing: false,
|
|
249
|
+
async stop() {
|
|
250
|
+
await removeLanRuntime(options.home);
|
|
251
|
+
},
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
try {
|
|
255
|
+
const started = await startBackend(serviceFor(options.port, address), address);
|
|
256
|
+
await writeLanRuntime(options.home, {
|
|
257
|
+
pid: process.pid,
|
|
258
|
+
address,
|
|
259
|
+
port: options.port,
|
|
260
|
+
backend: started.backend,
|
|
261
|
+
});
|
|
262
|
+
return {
|
|
263
|
+
publishing: true,
|
|
264
|
+
async stop() {
|
|
265
|
+
await Promise.race([
|
|
266
|
+
started.stop(),
|
|
267
|
+
new Promise((resolve) => setTimeout(resolve, 500)),
|
|
268
|
+
]);
|
|
269
|
+
await removeLanRuntime(options.home);
|
|
270
|
+
},
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
catch (error) {
|
|
274
|
+
const message = error instanceof Error ? error.message : 'Could not advertise the plan service';
|
|
275
|
+
await warn('Could not advertise the plan service', message);
|
|
276
|
+
await writeLanRuntime(options.home, {
|
|
277
|
+
pid: process.pid,
|
|
278
|
+
address: null,
|
|
279
|
+
port: options.port,
|
|
280
|
+
backend: 'none',
|
|
281
|
+
error: message,
|
|
282
|
+
}).catch(() => undefined);
|
|
283
|
+
return {
|
|
284
|
+
publishing: false,
|
|
285
|
+
async stop() {
|
|
286
|
+
await removeLanRuntime(options.home);
|
|
287
|
+
},
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
}
|