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,46 @@
|
|
|
1
|
+
export const LINKABLE_PROVIDERS = ['github', 'google'];
|
|
2
|
+
const PROVIDER_NAME = {
|
|
3
|
+
github: 'GitHub',
|
|
4
|
+
google: 'Google',
|
|
5
|
+
};
|
|
6
|
+
/** Trust only the providers this host is configured to run. A different email is never attached. */
|
|
7
|
+
export function accountLinkingConfig(providers) {
|
|
8
|
+
const trustedProviders = [];
|
|
9
|
+
if (providers.github)
|
|
10
|
+
trustedProviders.push('github');
|
|
11
|
+
if (providers.google)
|
|
12
|
+
trustedProviders.push('google');
|
|
13
|
+
return {
|
|
14
|
+
enabled: true,
|
|
15
|
+
trustedProviders,
|
|
16
|
+
allowDifferentEmails: false,
|
|
17
|
+
updateUserInfoOnLink: false,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export function providerIsLinked(accounts, provider) {
|
|
21
|
+
return accounts.some((account) => account.providerId === provider);
|
|
22
|
+
}
|
|
23
|
+
export function providerLabel(provider) {
|
|
24
|
+
return PROVIDER_NAME[provider];
|
|
25
|
+
}
|
|
26
|
+
/** Where Better Auth returns after the signed-in user finishes or abandons linking. */
|
|
27
|
+
export function linkSocialRequest(provider, email) {
|
|
28
|
+
return {
|
|
29
|
+
provider,
|
|
30
|
+
callbackURL: '/settings',
|
|
31
|
+
errorCallbackURL: '/settings',
|
|
32
|
+
loginHint: email,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** Map Better Auth's OAuth callback `error` codes. Unknown codes stay generic. */
|
|
36
|
+
export function linkAccountErrorMessage(code) {
|
|
37
|
+
if (!code)
|
|
38
|
+
return '';
|
|
39
|
+
if (code === 'email_does_not_match' || code === 'email_not_found') {
|
|
40
|
+
return 'That provider email does not match this account, so it was not linked.';
|
|
41
|
+
}
|
|
42
|
+
if (code === 'account_already_linked_to_different_user') {
|
|
43
|
+
return 'That provider account is already linked to someone else.';
|
|
44
|
+
}
|
|
45
|
+
return 'Could not link that provider. Try again.';
|
|
46
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { PlanSubmissionEvent } from './types';
|
|
2
|
+
export type AgentEvent = {
|
|
3
|
+
event: string;
|
|
4
|
+
data: unknown;
|
|
5
|
+
};
|
|
6
|
+
/** A stored submission row from `hello.pending` or a `notice` event. */
|
|
7
|
+
export declare function submissionEvent(value: unknown): PlanSubmissionEvent | null;
|
|
8
|
+
/** Submissions still waiting for the CLI. `delivered_at` is empty on the server. */
|
|
9
|
+
export declare function pendingFromHello(data: unknown): PlanSubmissionEvent[];
|
|
10
|
+
/** Tell the server these submissions were printed. Sets `delivered_at`. */
|
|
11
|
+
export declare function ackPlanEvents(planUrl: string, token: string | undefined, ids: string[]): Promise<void>;
|
|
12
|
+
/** Resolve an API path against a plan URL, including `/plans/:id/` on the shared service. */
|
|
13
|
+
export declare function planApiUrl(planUrl: string, apiPath: string): URL;
|
|
14
|
+
export declare function planIdFromPlanUrl(planUrl: string): string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Submissions the service pushes to one plan's CLI clients.
|
|
17
|
+
* A late client also hears answers already stored in `hello`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function planClientNotices(event: AgentEvent): AgentEvent[];
|
|
20
|
+
/**
|
|
21
|
+
* The host refused the agent stream for a reason a retry does not change: a wrong token, a plan
|
|
22
|
+
* that is not there, or a full account. Reconnecting stops on this error.
|
|
23
|
+
*/
|
|
24
|
+
export declare class AgentStreamRefused extends Error {
|
|
25
|
+
readonly status: number;
|
|
26
|
+
constructor(status: number, message: string);
|
|
27
|
+
}
|
|
28
|
+
/** Statuses that come back the same on every try. A 5xx or a dropped connection is worth retrying. */
|
|
29
|
+
export declare function refusalIsFinal(status: number): boolean;
|
|
30
|
+
/** Read the plan service event stream until the signal aborts or the server closes it. */
|
|
31
|
+
export declare function readAgentEvents(planUrl: string, token: string | undefined, onEvent: (event: AgentEvent) => void, signal: AbortSignal): Promise<void>;
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { cloudCredential, readCloudFile } from './cloudStore';
|
|
2
|
+
/** A stored submission row from `hello.pending` or a `notice` event. */
|
|
3
|
+
export function submissionEvent(value) {
|
|
4
|
+
if (!value || typeof value !== 'object')
|
|
5
|
+
return null;
|
|
6
|
+
const record = value;
|
|
7
|
+
if (typeof record.id !== 'string' || !record.id)
|
|
8
|
+
return null;
|
|
9
|
+
if (typeof record.seq !== 'number' || !Number.isFinite(record.seq))
|
|
10
|
+
return null;
|
|
11
|
+
if (record.event !== 'interaction' && record.event !== 'review' && record.event !== 'comment' && record.event !== 'edit')
|
|
12
|
+
return null;
|
|
13
|
+
return {
|
|
14
|
+
id: record.id,
|
|
15
|
+
seq: record.seq,
|
|
16
|
+
event: record.event,
|
|
17
|
+
data: record.data,
|
|
18
|
+
createdAt: typeof record.createdAt === 'number' ? record.createdAt : 0,
|
|
19
|
+
deliveredAt: typeof record.deliveredAt === 'number' ? record.deliveredAt : null,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/** Submissions still waiting for the CLI. `delivered_at` is empty on the server. */
|
|
23
|
+
export function pendingFromHello(data) {
|
|
24
|
+
if (!data || typeof data !== 'object')
|
|
25
|
+
return [];
|
|
26
|
+
const pending = data.pending;
|
|
27
|
+
if (!Array.isArray(pending))
|
|
28
|
+
return [];
|
|
29
|
+
return pending.flatMap((entry) => {
|
|
30
|
+
const submission = submissionEvent(entry);
|
|
31
|
+
return submission && submission.deliveredAt == null ? [submission] : [];
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/** Tell the server these submissions were printed. Sets `delivered_at`. */
|
|
35
|
+
export async function ackPlanEvents(planUrl, token, ids) {
|
|
36
|
+
if (ids.length === 0)
|
|
37
|
+
return;
|
|
38
|
+
const headers = { 'content-type': 'application/json' };
|
|
39
|
+
if (token)
|
|
40
|
+
headers.authorization = `Bearer ${token}`;
|
|
41
|
+
const response = await fetch(planApiUrl(planUrl, 'api/agent-events/ack'), {
|
|
42
|
+
method: 'POST',
|
|
43
|
+
headers,
|
|
44
|
+
body: JSON.stringify({ ids }),
|
|
45
|
+
});
|
|
46
|
+
if (!response.ok) {
|
|
47
|
+
const text = await response.text();
|
|
48
|
+
throw new Error(text || `Ack failed (${response.status})`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** Resolve an API path against a plan URL, including `/plans/:id/` on the shared service. */
|
|
52
|
+
export function planApiUrl(planUrl, apiPath) {
|
|
53
|
+
const base = planUrl.endsWith('/') ? planUrl : `${planUrl}/`;
|
|
54
|
+
return new URL(apiPath.replace(/^\//, ''), base);
|
|
55
|
+
}
|
|
56
|
+
export function planIdFromPlanUrl(planUrl) {
|
|
57
|
+
try {
|
|
58
|
+
const url = new URL(planUrl);
|
|
59
|
+
const match = url.pathname.match(/^\/plans\/([A-Za-z0-9_-]{8,80})(?:\/|$)/);
|
|
60
|
+
return match?.[1] ?? null;
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Submissions the service pushes to one plan's CLI clients.
|
|
68
|
+
* A late client also hears answers already stored in `hello`.
|
|
69
|
+
*/
|
|
70
|
+
export function planClientNotices(event) {
|
|
71
|
+
if (event.event === 'interaction' || event.event === 'review' || event.event === 'comment' || event.event === 'edit')
|
|
72
|
+
return [event];
|
|
73
|
+
if (event.event !== 'hello' || !event.data || typeof event.data !== 'object')
|
|
74
|
+
return [];
|
|
75
|
+
const hello = event.data;
|
|
76
|
+
const notices = [];
|
|
77
|
+
for (const data of Object.values(hello.responses ?? {})) {
|
|
78
|
+
notices.push({ event: 'interaction', data });
|
|
79
|
+
}
|
|
80
|
+
if (hello.review && typeof hello.review === 'object' && hello.review.decision) {
|
|
81
|
+
notices.push({ event: 'review', data: hello.review });
|
|
82
|
+
}
|
|
83
|
+
for (const data of hello.comments ?? []) {
|
|
84
|
+
notices.push({ event: 'comment', data });
|
|
85
|
+
}
|
|
86
|
+
return notices;
|
|
87
|
+
}
|
|
88
|
+
function parseSseChunk(chunk) {
|
|
89
|
+
let event = 'message';
|
|
90
|
+
const dataLines = [];
|
|
91
|
+
for (const line of chunk.split('\n')) {
|
|
92
|
+
if (!line || line.startsWith(':'))
|
|
93
|
+
continue;
|
|
94
|
+
if (line.startsWith('event:'))
|
|
95
|
+
event = line.slice(6).trim();
|
|
96
|
+
else if (line.startsWith('data:'))
|
|
97
|
+
dataLines.push(line.slice(5).trim());
|
|
98
|
+
}
|
|
99
|
+
if (dataLines.length === 0)
|
|
100
|
+
return null;
|
|
101
|
+
const raw = dataLines.join('\n');
|
|
102
|
+
try {
|
|
103
|
+
return { event, data: JSON.parse(raw) };
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
return { event, data: raw };
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function agentSocketUrl(planUrl) {
|
|
110
|
+
const url = planApiUrl(planUrl, 'api/agent-events');
|
|
111
|
+
url.protocol = url.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
112
|
+
return url.toString();
|
|
113
|
+
}
|
|
114
|
+
async function hostedPlanUrl(planUrl) {
|
|
115
|
+
return cloudCredential(await readCloudFile(), planUrl) !== null;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The host refused the agent stream for a reason a retry does not change: a wrong token, a plan
|
|
119
|
+
* that is not there, or a full account. Reconnecting stops on this error.
|
|
120
|
+
*/
|
|
121
|
+
export class AgentStreamRefused extends Error {
|
|
122
|
+
status;
|
|
123
|
+
constructor(status, message) {
|
|
124
|
+
super(message);
|
|
125
|
+
this.name = 'AgentStreamRefused';
|
|
126
|
+
this.status = status;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/** Statuses that come back the same on every try. A 5xx or a dropped connection is worth retrying. */
|
|
130
|
+
export function refusalIsFinal(status) {
|
|
131
|
+
return status === 400 || status === 401 || status === 402 || status === 403 || status === 404 || status === 410;
|
|
132
|
+
}
|
|
133
|
+
/** The hosted object answers this frame itself, so the CLI can tell a live socket from a dead one. */
|
|
134
|
+
const SOCKET_PING = 'ping';
|
|
135
|
+
const SOCKET_PONG = 'pong';
|
|
136
|
+
const SOCKET_PING_MS = 25_000;
|
|
137
|
+
/** Read hello and notice frames from the hosted plan socket. A `pong` is passed on as a `ping` event. */
|
|
138
|
+
async function readAgentSocket(planUrl, token, onEvent, signal) {
|
|
139
|
+
const Socket = globalThis.WebSocket;
|
|
140
|
+
if (!Socket)
|
|
141
|
+
throw new Error('This runtime has no WebSocket. Run live-plan with Bun.');
|
|
142
|
+
await new Promise((resolveRead, reject) => {
|
|
143
|
+
const headers = token ? { authorization: `Bearer ${token}` } : undefined;
|
|
144
|
+
const socket = new Socket(agentSocketUrl(planUrl), headers ? { headers } : undefined);
|
|
145
|
+
let keepAlive;
|
|
146
|
+
let refused = null;
|
|
147
|
+
let settled = false;
|
|
148
|
+
// A failed upgrade fires `error` and then `close`. Wait for the reason before the read ends.
|
|
149
|
+
const settle = (error) => {
|
|
150
|
+
if (settled)
|
|
151
|
+
return;
|
|
152
|
+
settled = true;
|
|
153
|
+
if (keepAlive)
|
|
154
|
+
clearInterval(keepAlive);
|
|
155
|
+
signal.removeEventListener('abort', onAbort);
|
|
156
|
+
if (error)
|
|
157
|
+
reject(error);
|
|
158
|
+
else
|
|
159
|
+
resolveRead();
|
|
160
|
+
};
|
|
161
|
+
const onAbort = () => {
|
|
162
|
+
socket.close();
|
|
163
|
+
settle();
|
|
164
|
+
};
|
|
165
|
+
if (signal.aborted) {
|
|
166
|
+
onAbort();
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
signal.addEventListener('abort', onAbort);
|
|
170
|
+
socket.addEventListener('open', () => {
|
|
171
|
+
keepAlive = setInterval(() => {
|
|
172
|
+
try {
|
|
173
|
+
socket.send(SOCKET_PING);
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
// The close event ends the read.
|
|
177
|
+
}
|
|
178
|
+
}, SOCKET_PING_MS);
|
|
179
|
+
});
|
|
180
|
+
socket.addEventListener('message', (message) => {
|
|
181
|
+
const raw = String(message.data);
|
|
182
|
+
if (raw === SOCKET_PONG) {
|
|
183
|
+
onEvent({ event: 'ping', data: null });
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
try {
|
|
187
|
+
const parsed = JSON.parse(raw);
|
|
188
|
+
if (parsed.event)
|
|
189
|
+
onEvent({ event: parsed.event, data: parsed.data });
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
// Ignore a frame that is not a plan event.
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
socket.addEventListener('error', () => {
|
|
196
|
+
refused ??= socketRefusal(planUrl, token);
|
|
197
|
+
void refused.then(settle);
|
|
198
|
+
});
|
|
199
|
+
socket.addEventListener('close', () => {
|
|
200
|
+
if (refused)
|
|
201
|
+
void refused.then(settle);
|
|
202
|
+
else
|
|
203
|
+
settle();
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* A refused WebSocket upgrade hides the response body. Ask again over plain HTTP so a refusal the
|
|
209
|
+
* host explains, such as the account's agent limit, reaches the person. Only the Worker answers that
|
|
210
|
+
* request the way it answers the upgrade, so only its 402 counts as final.
|
|
211
|
+
*/
|
|
212
|
+
async function socketRefusal(planUrl, token) {
|
|
213
|
+
try {
|
|
214
|
+
const response = await fetch(planApiUrl(planUrl, 'api/agent-events'), {
|
|
215
|
+
headers: token ? { authorization: `Bearer ${token}` } : {},
|
|
216
|
+
});
|
|
217
|
+
if (response.status !== 402)
|
|
218
|
+
return new Error('Agent socket failed');
|
|
219
|
+
return new AgentStreamRefused(402, (await response.text()).trim() || 'This account has no free agent slot.');
|
|
220
|
+
}
|
|
221
|
+
catch {
|
|
222
|
+
return new Error('Agent socket failed');
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
/** Read the plan service event stream until the signal aborts or the server closes it. */
|
|
226
|
+
export async function readAgentEvents(planUrl, token, onEvent, signal) {
|
|
227
|
+
if (await hostedPlanUrl(planUrl)) {
|
|
228
|
+
await readAgentSocket(planUrl, token, onEvent, signal);
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
const headers = { accept: 'text/event-stream' };
|
|
232
|
+
if (token)
|
|
233
|
+
headers.authorization = `Bearer ${token}`;
|
|
234
|
+
// Bun resets an idle fetch after five minutes. events and watch have to stay open until a person submits or the process is stopped.
|
|
235
|
+
const response = await fetch(planApiUrl(planUrl, 'api/agent-events'), { headers, signal, timeout: false });
|
|
236
|
+
if (!response.ok || !response.body) {
|
|
237
|
+
const text = (await response.text()).trim();
|
|
238
|
+
const message = text || `Agent event stream failed (${response.status})`;
|
|
239
|
+
if (refusalIsFinal(response.status))
|
|
240
|
+
throw new AgentStreamRefused(response.status, message);
|
|
241
|
+
throw new Error(message);
|
|
242
|
+
}
|
|
243
|
+
const reader = response.body.getReader();
|
|
244
|
+
const decoder = new TextDecoder();
|
|
245
|
+
let buffer = '';
|
|
246
|
+
while (!signal.aborted) {
|
|
247
|
+
const { done, value } = await reader.read();
|
|
248
|
+
if (done)
|
|
249
|
+
break;
|
|
250
|
+
buffer += decoder.decode(value, { stream: true });
|
|
251
|
+
let splitAt = buffer.indexOf('\n\n');
|
|
252
|
+
while (splitAt !== -1) {
|
|
253
|
+
const parsed = parseSseChunk(buffer.slice(0, splitAt));
|
|
254
|
+
buffer = buffer.slice(splitAt + 2);
|
|
255
|
+
if (parsed)
|
|
256
|
+
onEvent(parsed);
|
|
257
|
+
splitAt = buffer.indexOf('\n\n');
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether an agent is connected to a plan right now.
|
|
3
|
+
*
|
|
4
|
+
* An agent is connected while a CLI command holds the plan's agent stream open: `serve`,
|
|
5
|
+
* `events`, `wait`, `watch`, and `review` all do while they wait for the next plan action.
|
|
6
|
+
* The host counts those streams. A plan whose page is open but whose agent is not waiting
|
|
7
|
+
* on it is open, not active.
|
|
8
|
+
*/
|
|
9
|
+
export type AgentPresence = {
|
|
10
|
+
/** At least one agent stream is open. */
|
|
11
|
+
connected: boolean;
|
|
12
|
+
/** How many agent streams are open. */
|
|
13
|
+
clients: number;
|
|
14
|
+
/** When an agent stream last opened or closed. Null when no agent has connected yet. */
|
|
15
|
+
seenAt: number | null;
|
|
16
|
+
};
|
|
17
|
+
/** The page waits this long before it shows a drop, so `events` exiting and starting again does not flicker. */
|
|
18
|
+
export declare const AGENT_DISCONNECT_GRACE_MS = 4000;
|
|
19
|
+
/** A live agent stream gets a ping this often, so a peer that went away is noticed and removed. */
|
|
20
|
+
export declare const AGENT_KEEPALIVE_MS = 20000;
|
|
21
|
+
/**
|
|
22
|
+
* A hosted plan saves its presence on the dashboard row and renews it this often while an agent
|
|
23
|
+
* is connected. A row whose renewal is older than `AGENT_LEASE_MS` reads as disconnected, so a
|
|
24
|
+
* plan object that restarted without seeing its sockets close does not stay active.
|
|
25
|
+
*/
|
|
26
|
+
export declare const AGENT_LEASE_REFRESH_MS = 60000;
|
|
27
|
+
export declare const AGENT_LEASE_MS: number;
|
|
28
|
+
export declare const AGENT_PRESENCE_LABEL: {
|
|
29
|
+
readonly connected: "Agent connected";
|
|
30
|
+
readonly disconnected: "No agent connected";
|
|
31
|
+
};
|
|
32
|
+
export declare function agentPresence(clients: number, seenAt: number | null): AgentPresence;
|
|
33
|
+
/** Presence from an untrusted payload, such as a stream event or a stored row. */
|
|
34
|
+
export declare function readAgentPresence(value: unknown): AgentPresence | null;
|
|
35
|
+
/** Short "5m ago" text for when the agent was last seen. */
|
|
36
|
+
export declare function agentSeenAgo(seenAt: number | null | undefined, now?: number): string;
|
|
37
|
+
/** The text a page or a dashboard row shows for the agent. */
|
|
38
|
+
export declare function agentPresenceText(presence: Pick<AgentPresence, 'connected' | 'seenAt'> | null | undefined, now?: number): string;
|
|
39
|
+
/** The agent icon: a robot while connected, a struck-through robot while not. */
|
|
40
|
+
export declare function agentIconSvg(connected: boolean): string;
|
|
41
|
+
/** Both icons, for markup whose state CSS switches on `body[data-agent]`. */
|
|
42
|
+
export declare const AGENT_ICONS_SVG: string;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** The page waits this long before it shows a drop, so `events` exiting and starting again does not flicker. */
|
|
2
|
+
export const AGENT_DISCONNECT_GRACE_MS = 4000;
|
|
3
|
+
/** A live agent stream gets a ping this often, so a peer that went away is noticed and removed. */
|
|
4
|
+
export const AGENT_KEEPALIVE_MS = 20_000;
|
|
5
|
+
/**
|
|
6
|
+
* A hosted plan saves its presence on the dashboard row and renews it this often while an agent
|
|
7
|
+
* is connected. A row whose renewal is older than `AGENT_LEASE_MS` reads as disconnected, so a
|
|
8
|
+
* plan object that restarted without seeing its sockets close does not stay active.
|
|
9
|
+
*/
|
|
10
|
+
export const AGENT_LEASE_REFRESH_MS = 60_000;
|
|
11
|
+
export const AGENT_LEASE_MS = 3 * 60_000;
|
|
12
|
+
export const AGENT_PRESENCE_LABEL = {
|
|
13
|
+
connected: 'Agent connected',
|
|
14
|
+
disconnected: 'No agent connected',
|
|
15
|
+
};
|
|
16
|
+
export function agentPresence(clients, seenAt) {
|
|
17
|
+
const count = Math.max(0, Math.round(Number(clients) || 0));
|
|
18
|
+
return { connected: count > 0, clients: count, seenAt: seenAt ?? null };
|
|
19
|
+
}
|
|
20
|
+
/** Presence from an untrusted payload, such as a stream event or a stored row. */
|
|
21
|
+
export function readAgentPresence(value) {
|
|
22
|
+
if (!value || typeof value !== 'object')
|
|
23
|
+
return null;
|
|
24
|
+
const raw = value;
|
|
25
|
+
if (typeof raw.connected !== 'boolean')
|
|
26
|
+
return null;
|
|
27
|
+
const clients = Number(raw.clients);
|
|
28
|
+
const seenAt = Number(raw.seenAt);
|
|
29
|
+
return {
|
|
30
|
+
connected: raw.connected,
|
|
31
|
+
clients: Number.isFinite(clients) ? Math.max(0, Math.round(clients)) : raw.connected ? 1 : 0,
|
|
32
|
+
seenAt: raw.seenAt != null && Number.isFinite(seenAt) && seenAt > 0 ? seenAt : null,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** Short "5m ago" text for when the agent was last seen. */
|
|
36
|
+
export function agentSeenAgo(seenAt, now = Date.now()) {
|
|
37
|
+
if (!seenAt)
|
|
38
|
+
return '';
|
|
39
|
+
const seconds = Math.max(0, Math.round((now - seenAt) / 1000));
|
|
40
|
+
if (seconds < 60)
|
|
41
|
+
return 'just now';
|
|
42
|
+
const minutes = Math.floor(seconds / 60);
|
|
43
|
+
if (minutes < 60)
|
|
44
|
+
return `${minutes}m ago`;
|
|
45
|
+
const hours = Math.floor(minutes / 60);
|
|
46
|
+
if (hours < 48)
|
|
47
|
+
return `${hours}h ago`;
|
|
48
|
+
return `${Math.floor(hours / 24)}d ago`;
|
|
49
|
+
}
|
|
50
|
+
/** The text a page or a dashboard row shows for the agent. */
|
|
51
|
+
export function agentPresenceText(presence, now = Date.now()) {
|
|
52
|
+
if (presence?.connected)
|
|
53
|
+
return AGENT_PRESENCE_LABEL.connected;
|
|
54
|
+
const ago = agentSeenAgo(presence?.seenAt, now);
|
|
55
|
+
return ago ? `${AGENT_PRESENCE_LABEL.disconnected} · last seen ${ago}` : AGENT_PRESENCE_LABEL.disconnected;
|
|
56
|
+
}
|
|
57
|
+
const ICON_PATHS = {
|
|
58
|
+
// Lucide `bot`.
|
|
59
|
+
on: '<path d="M12 8V4H8"/><rect width="16" height="12" x="4" y="8" rx="2"/><path d="M2 14h2"/><path d="M20 14h2"/><path d="M15 13v2"/><path d="M9 13v2"/>',
|
|
60
|
+
// Lucide `bot-off`: the same robot, struck through, so the state reads without color.
|
|
61
|
+
off: '<path d="M13.67 8H18a2 2 0 0 1 2 2v4.33"/><path d="M2 14h2"/><path d="M20 14h2"/><path d="M22 22 2 2"/><path d="M8 8H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 1.414-.586"/><path d="M9 13v2"/><path d="M9.67 4H12v2.33"/>',
|
|
62
|
+
};
|
|
63
|
+
/** The agent icon: a robot while connected, a struck-through robot while not. */
|
|
64
|
+
export function agentIconSvg(connected) {
|
|
65
|
+
const state = connected ? 'on' : 'off';
|
|
66
|
+
return `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-agent-icon="${state}">${ICON_PATHS[state]}</svg>`;
|
|
67
|
+
}
|
|
68
|
+
/** Both icons, for markup whose state CSS switches on `body[data-agent]`. */
|
|
69
|
+
export const AGENT_ICONS_SVG = agentIconSvg(true) + agentIconSvg(false);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const SKILL_NAME = "live-plan";
|
|
2
|
+
export type AgentHarness = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
/** The harness's own folder under home. When it exists, the harness is in use on this machine. */
|
|
6
|
+
home: string;
|
|
7
|
+
/** The skills folder under home. */
|
|
8
|
+
skills: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const AGENT_HARNESSES: readonly AgentHarness[];
|
|
11
|
+
export type HarnessStatus = {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
/** Where the skill is, or would be, installed. */
|
|
15
|
+
path: string;
|
|
16
|
+
/** The harness has a folder on this machine. */
|
|
17
|
+
detected: boolean;
|
|
18
|
+
installed: boolean;
|
|
19
|
+
/** The installed `SKILL.md` is the one this package ships. */
|
|
20
|
+
current: boolean;
|
|
21
|
+
};
|
|
22
|
+
/** `skills/live-plan` in the package that holds this module (`dist/cli.js` or `src/`). */
|
|
23
|
+
export declare function bundledSkillDir(moduleUrl?: string): string;
|
|
24
|
+
export declare function harnessById(id: string): AgentHarness | undefined;
|
|
25
|
+
export declare function skillPath(harness: AgentHarness, home?: string): string;
|
|
26
|
+
export type SkillsOptions = {
|
|
27
|
+
home?: string;
|
|
28
|
+
source?: string;
|
|
29
|
+
};
|
|
30
|
+
export declare function harnessStatuses(options?: SkillsOptions): Promise<HarnessStatus[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Copy the skill into each named harness. With no ids, into every harness found on this machine.
|
|
33
|
+
* Throws when an id is unknown or the package does not carry the skill.
|
|
34
|
+
*/
|
|
35
|
+
export declare function installSkill(ids: readonly string[], options?: SkillsOptions): Promise<HarnessStatus[]>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install the `live-plan` skill where coding agents look for skills (`live-plan skills install`).
|
|
3
|
+
*
|
|
4
|
+
* The skill ships in the package as `skills/live-plan`, beside `dist/`. Each harness reads skills
|
|
5
|
+
* from a folder under the home directory, one folder per skill with a `SKILL.md`. An install
|
|
6
|
+
* replaces this skill's folder and leaves every other skill in place.
|
|
7
|
+
*/
|
|
8
|
+
import { cp, mkdir, readFile, rm, stat } from 'node:fs/promises';
|
|
9
|
+
import { homedir } from 'node:os';
|
|
10
|
+
import { dirname, join, resolve } from 'node:path';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
export const SKILL_NAME = 'live-plan';
|
|
13
|
+
export const AGENT_HARNESSES = [
|
|
14
|
+
{ id: 'claude-code', label: 'Claude Code', home: '.claude', skills: '.claude/skills' },
|
|
15
|
+
{ id: 'codex', label: 'Codex', home: '.codex', skills: '.codex/skills' },
|
|
16
|
+
{ id: 'cursor', label: 'Cursor', home: '.cursor', skills: '.cursor/skills' },
|
|
17
|
+
{ id: 'gemini', label: 'Gemini CLI', home: '.gemini', skills: '.gemini/skills' },
|
|
18
|
+
{ id: 'opencode', label: 'OpenCode', home: '.config/opencode', skills: '.config/opencode/skills' },
|
|
19
|
+
{ id: 'agents', label: 'Other agents (~/.agents)', home: '.agents', skills: '.agents/skills' },
|
|
20
|
+
];
|
|
21
|
+
/** `skills/live-plan` in the package that holds this module (`dist/cli.js` or `src/`). */
|
|
22
|
+
export function bundledSkillDir(moduleUrl = import.meta.url) {
|
|
23
|
+
return join(resolve(dirname(fileURLToPath(moduleUrl)), '..'), 'skills', SKILL_NAME);
|
|
24
|
+
}
|
|
25
|
+
export function harnessById(id) {
|
|
26
|
+
return AGENT_HARNESSES.find((harness) => harness.id === id);
|
|
27
|
+
}
|
|
28
|
+
export function skillPath(harness, home = homedir()) {
|
|
29
|
+
return join(home, ...harness.skills.split('/'), SKILL_NAME);
|
|
30
|
+
}
|
|
31
|
+
async function isDirectory(path) {
|
|
32
|
+
try {
|
|
33
|
+
return (await stat(path)).isDirectory();
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function readText(path) {
|
|
40
|
+
try {
|
|
41
|
+
return await readFile(path, 'utf8');
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export async function harnessStatuses(options = {}) {
|
|
48
|
+
const home = options.home ?? homedir();
|
|
49
|
+
const shipped = await readText(join(options.source ?? bundledSkillDir(), 'SKILL.md'));
|
|
50
|
+
return Promise.all(AGENT_HARNESSES.map(async (harness) => {
|
|
51
|
+
const path = skillPath(harness, home);
|
|
52
|
+
const installed = await readText(join(path, 'SKILL.md'));
|
|
53
|
+
return {
|
|
54
|
+
id: harness.id,
|
|
55
|
+
label: harness.label,
|
|
56
|
+
path,
|
|
57
|
+
detected: await isDirectory(join(home, ...harness.home.split('/'))),
|
|
58
|
+
installed: installed !== null,
|
|
59
|
+
current: installed !== null && installed === shipped,
|
|
60
|
+
};
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Copy the skill into each named harness. With no ids, into every harness found on this machine.
|
|
65
|
+
* Throws when an id is unknown or the package does not carry the skill.
|
|
66
|
+
*/
|
|
67
|
+
export async function installSkill(ids, options = {}) {
|
|
68
|
+
const home = options.home ?? homedir();
|
|
69
|
+
const source = options.source ?? bundledSkillDir();
|
|
70
|
+
if ((await readText(join(source, 'SKILL.md'))) === null) {
|
|
71
|
+
throw new Error(`The ${SKILL_NAME} skill is missing from this install (${source}).`);
|
|
72
|
+
}
|
|
73
|
+
const unknown = ids.filter((id) => !harnessById(id));
|
|
74
|
+
if (unknown.length) {
|
|
75
|
+
throw new Error(`Unknown harness: ${unknown.join(', ')}. Choose from ${AGENT_HARNESSES.map((harness) => harness.id).join(', ')}.`);
|
|
76
|
+
}
|
|
77
|
+
const wanted = ids.length
|
|
78
|
+
? new Set(ids)
|
|
79
|
+
: new Set((await harnessStatuses({ home, source })).filter((status) => status.detected).map((status) => status.id));
|
|
80
|
+
for (const harness of AGENT_HARNESSES) {
|
|
81
|
+
if (!wanted.has(harness.id))
|
|
82
|
+
continue;
|
|
83
|
+
const destination = skillPath(harness, home);
|
|
84
|
+
await mkdir(dirname(destination), { recursive: true });
|
|
85
|
+
await rm(destination, { recursive: true, force: true });
|
|
86
|
+
await cp(source, destination, { recursive: true });
|
|
87
|
+
}
|
|
88
|
+
return (await harnessStatuses({ home, source })).filter((status) => wanted.has(status.id));
|
|
89
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type AgentEvent } from './agentEvents';
|
|
2
|
+
/** A line that has shown it pings, then goes this long without a word, is treated as dead. */
|
|
3
|
+
export declare const STREAM_STALE_MS = 70000;
|
|
4
|
+
/** A stream that never connected in this process fails after this many tries, so a wrong URL still fails fast. */
|
|
5
|
+
export declare const FIRST_CONNECT_TRIES = 4;
|
|
6
|
+
/** The bearer the stream and its acks send. `retoken` may replace it after a refusal. */
|
|
7
|
+
export type StreamToken = {
|
|
8
|
+
current: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
export type StreamNotices = {
|
|
11
|
+
/**
|
|
12
|
+
* A try failed. Called once per outage, with the wait before the next try. `wasConnected` is false
|
|
13
|
+
* while the stream has not connected once in this process.
|
|
14
|
+
*/
|
|
15
|
+
lost?: (reason: string, delayMs: number, wasConnected: boolean) => void;
|
|
16
|
+
/** A hello arrived again after `lost`. */
|
|
17
|
+
restored?: () => void;
|
|
18
|
+
/** Called once per outage after a few failed tries. Starts a local service that went away. */
|
|
19
|
+
revive?: () => Promise<void>;
|
|
20
|
+
/** Called on a 401. A different token is tried at once. The same token, or none, ends the stream. */
|
|
21
|
+
retoken?: () => Promise<string | undefined>;
|
|
22
|
+
};
|
|
23
|
+
/** Wait before try `attempt` (0 based): 1s, 2s, 4s, up to 30s, with a little spread so clients do not reconnect in step. */
|
|
24
|
+
export declare function retryDelay(attempt: number, random?: () => number): number;
|
|
25
|
+
/**
|
|
26
|
+
* Read a plan's agent stream until `signal` aborts.
|
|
27
|
+
*
|
|
28
|
+
* A closed stream, a service restart, a crash, or a network change is retried with a growing wait.
|
|
29
|
+
* Every connect starts with a `hello` that carries the submissions still pending on the server, so a
|
|
30
|
+
* gap loses nothing. `ping` frames are swallowed here and only keep the line alive.
|
|
31
|
+
*
|
|
32
|
+
* It throws only for a refusal that a retry does not change (`AgentStreamRefused`), or when the stream
|
|
33
|
+
* never connected in this process after `FIRST_CONNECT_TRIES` tries.
|
|
34
|
+
*/
|
|
35
|
+
export declare function followAgentEvents(planUrl: string, token: StreamToken, onEvent: (event: AgentEvent) => void, signal: AbortSignal, notices?: StreamNotices): Promise<void>;
|