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,1006 @@
|
|
|
1
|
+
import { agentIconSvg } from './agentPresence';
|
|
2
|
+
import { openQuestions } from './dashboard';
|
|
3
|
+
import { durationPhrase, emptyPlansText, filesText, outcomeLabel, planPlace, progressDetail, questionsText, rangeText, startedText, statusSegments, } from './dashboardFormat';
|
|
4
|
+
import { ACTIVITY_GLYPH_SVG, BRANCH_ICON_SVG, FOLDER_ICON_SVG, progressTone } from './dashboardOverview';
|
|
5
|
+
import { rowSkeletonHtml, searchSkeletonHtml } from './dashboardLoading';
|
|
6
|
+
import { highlightParts, hitHref, hitWhere, planOpenUrl, SEARCH_MIN_TYPED, SEARCH_THROTTLE_MS, searchSummary, throttle, versionLabel, } from './dashboardSearchView';
|
|
7
|
+
/** Browser runtime for the plan dashboard. Loopback and the Start route share it. */
|
|
8
|
+
export function dashboardClientScript(apiPath) {
|
|
9
|
+
return ` (() => {
|
|
10
|
+
const apiPath = ${JSON.stringify(apiPath)};
|
|
11
|
+
const agentIcons = ${JSON.stringify({ on: agentIconSvg(true), off: agentIconSvg(false) })};
|
|
12
|
+
if (window.__livingPlanDashboardTimer) clearInterval(window.__livingPlanDashboardTimer);
|
|
13
|
+
const activityGlyphs = ${JSON.stringify(ACTIVITY_GLYPH_SVG)};
|
|
14
|
+
const placeIcons = ${JSON.stringify({ folder: FOLDER_ICON_SVG, branch: BRANCH_ICON_SVG })};
|
|
15
|
+
const stats = document.getElementById('stats');
|
|
16
|
+
const status = document.getElementById('status');
|
|
17
|
+
const plansCount = document.getElementById('plans-count');
|
|
18
|
+
const periodButtons = Array.from(document.querySelectorAll('[data-period]'));
|
|
19
|
+
const filterButtons = Array.from(document.querySelectorAll('[data-filter]'));
|
|
20
|
+
const tableWrap = document.querySelector('.table-wrap');
|
|
21
|
+
const headRow = document.querySelector('.table-wrap thead tr');
|
|
22
|
+
const table = tableWrap.querySelector('table');
|
|
23
|
+
const statusSpinner = document.getElementById('status-spinner');
|
|
24
|
+
const refreshButton = document.getElementById('refresh');
|
|
25
|
+
const refreshSpinner = document.getElementById('refresh-spinner');
|
|
26
|
+
const refreshLabel = document.getElementById('refresh-label');
|
|
27
|
+
const emptyPlansText = (${emptyPlansText.toString()});
|
|
28
|
+
const openQuestions = (${openQuestions.toString()});
|
|
29
|
+
const startedText = (${startedText.toString()});
|
|
30
|
+
const statusSegments = (${statusSegments.toString()});
|
|
31
|
+
const outcomeLabel = (${outcomeLabel.toString()});
|
|
32
|
+
const planPlace = (${planPlace.toString()});
|
|
33
|
+
const progressDetail = (${progressDetail.toString()});
|
|
34
|
+
const questionsText = (${questionsText.toString()});
|
|
35
|
+
const durationPhrase = (${durationPhrase.toString()});
|
|
36
|
+
const filesText = (${filesText.toString()});
|
|
37
|
+
const rangeText = (${rangeText.toString()});
|
|
38
|
+
const progressTone = (${progressTone.toString()});
|
|
39
|
+
const rowSkeleton = ${JSON.stringify(rowSkeletonHtml())};
|
|
40
|
+
const periodPhrase = { day: 'today', week: 'this week', month: 'this month' };
|
|
41
|
+
let period = 'day';
|
|
42
|
+
let filter = 'all';
|
|
43
|
+
let latest = null;
|
|
44
|
+
let motion = 'enter';
|
|
45
|
+
// True once real rows replaced the skeleton. Until then a failed read shows Try again.
|
|
46
|
+
let painted = false;
|
|
47
|
+
// A read that answered and has not been painted yet. Its paint ends the loading state.
|
|
48
|
+
let awaitingPaint = false;
|
|
49
|
+
let refreshToken = 0;
|
|
50
|
+
|
|
51
|
+
const initial = new URLSearchParams(window.location.search).get('period');
|
|
52
|
+
if (initial === 'day' || initial === 'week' || initial === 'month') period = initial;
|
|
53
|
+
|
|
54
|
+
function text(tag, className, value) {
|
|
55
|
+
const node = document.createElement(tag);
|
|
56
|
+
if (className) node.className = className;
|
|
57
|
+
if (value != null) node.textContent = value;
|
|
58
|
+
return node;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function pathNode(className, value) {
|
|
62
|
+
const node = document.createElement('span');
|
|
63
|
+
node.className = className;
|
|
64
|
+
const parts = String(value).split('/');
|
|
65
|
+
for (let index = 0; index < parts.length; index += 1) {
|
|
66
|
+
if (index > 0) {
|
|
67
|
+
node.append('/');
|
|
68
|
+
node.append(document.createElement('wbr'));
|
|
69
|
+
}
|
|
70
|
+
node.append(parts[index]);
|
|
71
|
+
}
|
|
72
|
+
return node;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function safeUrl(value) {
|
|
76
|
+
try {
|
|
77
|
+
const url = new URL(value);
|
|
78
|
+
if (url.protocol !== 'http:' && url.protocol !== 'https:') return '';
|
|
79
|
+
return url.href;
|
|
80
|
+
} catch (error) {
|
|
81
|
+
return '';
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function formatWhen(ms) {
|
|
86
|
+
if (!ms) return '';
|
|
87
|
+
return new Intl.DateTimeFormat(undefined, {
|
|
88
|
+
month: 'short',
|
|
89
|
+
day: 'numeric',
|
|
90
|
+
hour: 'numeric',
|
|
91
|
+
minute: '2-digit',
|
|
92
|
+
}).format(new Date(ms));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function formatDuration(ms) {
|
|
96
|
+
const seconds = Math.max(0, Math.round(Number(ms) / 1000));
|
|
97
|
+
if (seconds < 60) return seconds + 's';
|
|
98
|
+
const minutes = Math.floor(seconds / 60);
|
|
99
|
+
if (minutes < 60) return minutes + 'm';
|
|
100
|
+
const hours = Math.floor(minutes / 60);
|
|
101
|
+
if (hours < 48) return hours + 'h ' + (minutes % 60) + 'm';
|
|
102
|
+
return Math.floor(hours / 24) + 'd ' + (hours % 24) + 'h';
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const activityLabel = { active: 'Active', idle: 'Idle', executed: 'Executed', interrupted: 'Interrupted' };
|
|
106
|
+
|
|
107
|
+
// Same rule as planActivity in src/dashboard.ts: an open plan is active only while an agent is connected.
|
|
108
|
+
function activityOf(record) {
|
|
109
|
+
if (record.status === 'executed' || record.status === 'interrupted') return record.status;
|
|
110
|
+
return record.agentConnected ? 'active' : 'idle';
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// How long ago the agent was last seen, as agentSeenAgo in src/agentPresence.ts reads it.
|
|
114
|
+
function seenAgo(record) {
|
|
115
|
+
const seen = Number(record.agentSeenAt) || 0;
|
|
116
|
+
if (!seen) return '';
|
|
117
|
+
const seconds = Math.max(0, Math.round((Date.now() - seen) / 1000));
|
|
118
|
+
if (seconds < 60) return 'just now';
|
|
119
|
+
const minutes = Math.floor(seconds / 60);
|
|
120
|
+
const hours = Math.floor(minutes / 60);
|
|
121
|
+
return minutes < 60 ? minutes + 'm ago' : hours < 48 ? hours + 'h ago' : Math.floor(hours / 24) + 'd ago';
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Same text as agentPresenceText in src/agentPresence.ts.
|
|
125
|
+
function agentText(record) {
|
|
126
|
+
if (record.agentConnected) return 'Agent connected';
|
|
127
|
+
const ago = seenAgo(record);
|
|
128
|
+
return ago ? 'No agent connected · last seen ' + ago : 'No agent connected';
|
|
129
|
+
}
|
|
130
|
+
const completionLabel = {
|
|
131
|
+
idle: 'Not started',
|
|
132
|
+
in_progress: 'In progress',
|
|
133
|
+
partial: 'Partial',
|
|
134
|
+
complete: 'Complete',
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
function count(value) {
|
|
138
|
+
return (Number(value) || 0).toLocaleString();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function ofCount(done, total) {
|
|
142
|
+
return count(done) + ' of ' + count(total);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function card(label, className) {
|
|
146
|
+
const node = text('article', className ? 'dash-card ' + className : 'dash-card');
|
|
147
|
+
node.append(text('h2', 'dash-eyebrow', label));
|
|
148
|
+
return node;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function figure(value, caption, hero) {
|
|
152
|
+
const node = text('p', hero ? 'dash-figure hero' : 'dash-figure');
|
|
153
|
+
node.append(text('strong', '', value), text('span', '', caption));
|
|
154
|
+
return node;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Label and value rows under a card's figure.
|
|
158
|
+
function facts(entries) {
|
|
159
|
+
const list = text('dl', 'dash-facts');
|
|
160
|
+
for (const entry of entries) {
|
|
161
|
+
const row = document.createElement('div');
|
|
162
|
+
row.append(text('dt', '', entry[0]), text('dd', '', entry[1]));
|
|
163
|
+
list.append(row);
|
|
164
|
+
}
|
|
165
|
+
return list;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// The period's plans split by status, one part per status with any plans. The legend under it
|
|
169
|
+
// carries the names and counts, so the bar itself is a picture of the split.
|
|
170
|
+
function statusBar(segments, total) {
|
|
171
|
+
const bar = text('div', 'dash-seg');
|
|
172
|
+
bar.setAttribute('role', 'img');
|
|
173
|
+
bar.setAttribute('aria-label', total
|
|
174
|
+
? 'Plans by status: ' + segments.map((part) => part.label + ' ' + part.count).join(', ')
|
|
175
|
+
: 'No plans');
|
|
176
|
+
const parts = segments.filter((part) => part.count > 0);
|
|
177
|
+
if (parts.length === 0) {
|
|
178
|
+
bar.append(text('span', 'dash-seg-part empty'));
|
|
179
|
+
return bar;
|
|
180
|
+
}
|
|
181
|
+
for (const part of parts) {
|
|
182
|
+
const node = text('span', 'dash-seg-part');
|
|
183
|
+
node.dataset.activity = part.id;
|
|
184
|
+
node.style.setProperty('--dash-count', String(part.count));
|
|
185
|
+
node.title = part.label + ' · ' + part.count + ' of ' + total + ' (' + part.share + '%)';
|
|
186
|
+
bar.append(node);
|
|
187
|
+
}
|
|
188
|
+
return bar;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function legend(segments) {
|
|
192
|
+
const list = text('ul', 'dash-legend');
|
|
193
|
+
for (const part of segments) {
|
|
194
|
+
const item = document.createElement('li');
|
|
195
|
+
item.dataset.activity = part.id;
|
|
196
|
+
const swatch = text('span', 'dash-swatch');
|
|
197
|
+
swatch.setAttribute('aria-hidden', 'true');
|
|
198
|
+
item.append(swatch, part.label + ' ', text('strong', '', count(part.count)));
|
|
199
|
+
list.append(item);
|
|
200
|
+
}
|
|
201
|
+
return list;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Three cards: the period's plans by status, what is open and waiting on the person now, and
|
|
205
|
+
// the work the runs did.
|
|
206
|
+
function paintSummary(summary, animate) {
|
|
207
|
+
const segments = statusSegments(summary);
|
|
208
|
+
const total = segments.reduce((sum, part) => sum + part.count, 0);
|
|
209
|
+
const plansCard = card('Plans', 'dash-card-plans');
|
|
210
|
+
plansCard.append(
|
|
211
|
+
figure(count(summary.plans ?? total), startedText(summary), true),
|
|
212
|
+
statusBar(segments, total),
|
|
213
|
+
legend(segments),
|
|
214
|
+
);
|
|
215
|
+
const questions = Number(summary.questions) || 0;
|
|
216
|
+
const openCard = card('Open now');
|
|
217
|
+
openCard.append(
|
|
218
|
+
figure(count(questions), questions === 1 ? 'question waiting on you' : 'questions waiting on you'),
|
|
219
|
+
facts([
|
|
220
|
+
['Open plans', count(summary.running)],
|
|
221
|
+
['Plans waiting on you', count(summary.waiting)],
|
|
222
|
+
['Agents connected', ofCount(summary.active, summary.running)],
|
|
223
|
+
]),
|
|
224
|
+
);
|
|
225
|
+
const workCard = card('Work');
|
|
226
|
+
workCard.append(
|
|
227
|
+
figure(formatDuration(summary.durationMs), 'execution time'),
|
|
228
|
+
facts([
|
|
229
|
+
['Phases done', ofCount(summary.phaseDone, summary.phaseTotal)],
|
|
230
|
+
['Answers given', ofCount(summary.interactionDone, summary.interactionTotal)],
|
|
231
|
+
['Files modified', count(summary.filesModified)],
|
|
232
|
+
['Folders', count(summary.folders)],
|
|
233
|
+
]),
|
|
234
|
+
);
|
|
235
|
+
stats.replaceChildren(plansCard, openCard, workCard);
|
|
236
|
+
if (!animate) return;
|
|
237
|
+
const cards = stats.querySelectorAll('.dash-card');
|
|
238
|
+
for (let index = 0; index < cards.length; index += 1) {
|
|
239
|
+
cards[index].classList.add('enter');
|
|
240
|
+
cards[index].style.animationDelay = Math.min(index, 6) * 40 + 'ms';
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// A trusted icon string from src/dashboardOverview.ts in its own span.
|
|
245
|
+
function glyph(svg) {
|
|
246
|
+
const node = text('span', 'dash-glyph');
|
|
247
|
+
node.setAttribute('aria-hidden', 'true');
|
|
248
|
+
node.innerHTML = svg;
|
|
249
|
+
return node;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function iconText(className, svg, value, title) {
|
|
253
|
+
const node = text('span', className);
|
|
254
|
+
node.append(glyph(svg), text('span', '', value));
|
|
255
|
+
if (title) node.title = title;
|
|
256
|
+
return node;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// Title, then mode, folder, and branch, then the plan file inside its folder.
|
|
260
|
+
function planCell(record) {
|
|
261
|
+
const cell = text('td', 'plan-cell');
|
|
262
|
+
const site = record.status === 'running' ? safeUrl(record.url || '') : '';
|
|
263
|
+
if (site) {
|
|
264
|
+
const link = text('a', 'title title-link', record.title || 'Untitled plan');
|
|
265
|
+
link.href = site;
|
|
266
|
+
cell.append(link);
|
|
267
|
+
} else {
|
|
268
|
+
cell.append(text('span', 'title', record.title || 'Untitled plan'));
|
|
269
|
+
}
|
|
270
|
+
const meta = text('span', 'plan-meta');
|
|
271
|
+
meta.append(text('span', 'plan-mode', record.mode || 'watch'));
|
|
272
|
+
const place = planPlace(record);
|
|
273
|
+
if (place.folder) meta.append(iconText('plan-meta-item', placeIcons.folder, place.folder, record.directory));
|
|
274
|
+
const git = record.git || {};
|
|
275
|
+
if (git.isRepo && git.branch) meta.append(iconText('plan-meta-item mono', placeIcons.branch, git.branch, git.summary || 'Branch ' + git.branch));
|
|
276
|
+
cell.append(meta);
|
|
277
|
+
if (place.file) {
|
|
278
|
+
const file = pathNode('plan-file', place.file);
|
|
279
|
+
file.title = record.planPath;
|
|
280
|
+
cell.append(file);
|
|
281
|
+
}
|
|
282
|
+
return cell;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// The status pill, then what an open plan waits on or the verdict a finished run got.
|
|
286
|
+
function statusCell(record) {
|
|
287
|
+
const cell = text('td', 'plan-status-cell');
|
|
288
|
+
const activity = activityOf(record);
|
|
289
|
+
const line = text('span', 'status-line');
|
|
290
|
+
const pill = text('span', 'dash-pill');
|
|
291
|
+
pill.dataset.activity = activity;
|
|
292
|
+
pill.append(glyph(activityGlyphs[activity]), activityLabel[activity]);
|
|
293
|
+
line.append(pill);
|
|
294
|
+
if (record.status === 'running') {
|
|
295
|
+
// A robot while an agent is connected, a struck-through robot while not. The words are the tooltip.
|
|
296
|
+
const label = agentText(record);
|
|
297
|
+
const icon = text('span', record.agentConnected ? 'agent-icon on' : 'agent-icon');
|
|
298
|
+
icon.setAttribute('role', 'img');
|
|
299
|
+
icon.setAttribute('aria-label', label);
|
|
300
|
+
icon.title = label;
|
|
301
|
+
icon.innerHTML = record.agentConnected ? agentIcons.on : agentIcons.off;
|
|
302
|
+
line.append(icon);
|
|
303
|
+
}
|
|
304
|
+
cell.append(line);
|
|
305
|
+
if (record.status === 'running') {
|
|
306
|
+
const asking = openQuestions(record);
|
|
307
|
+
if (asking > 0) cell.append(text('span', 'sub plan-ask', questionsText(asking)));
|
|
308
|
+
const ago = seenAgo(record);
|
|
309
|
+
if (record.executionActive && record.executionStep) cell.append(text('span', 'sub', 'Step · ' + record.executionStep));
|
|
310
|
+
else if (!record.agentConnected && ago) cell.append(text('span', 'sub', 'Agent last seen ' + ago));
|
|
311
|
+
} else {
|
|
312
|
+
const verdict = outcomeLabel(record.outcome);
|
|
313
|
+
if (verdict) cell.append(text('span', 'sub', 'Review · ' + verdict));
|
|
314
|
+
}
|
|
315
|
+
return cell;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function progressCell(record) {
|
|
319
|
+
const cell = text('td', 'plan-progress-cell');
|
|
320
|
+
const ratio = Math.max(0, Math.min(100, Number(record.completionRatio) || 0));
|
|
321
|
+
const row = text('span', 'plan-progress');
|
|
322
|
+
row.dataset.tone = progressTone(record);
|
|
323
|
+
const meter = text('span', 'plan-meter');
|
|
324
|
+
meter.setAttribute('aria-hidden', 'true');
|
|
325
|
+
const bar = document.createElement('span');
|
|
326
|
+
bar.style.width = ratio + '%';
|
|
327
|
+
meter.append(bar);
|
|
328
|
+
row.append(meter, text('span', 'plan-percent', ratio + '%'));
|
|
329
|
+
cell.append(row, text('span', 'sub', completionLabel[record.completionState] || 'Not started'), text('span', 'sub', progressDetail(record)));
|
|
330
|
+
return cell;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
function timeCell(record) {
|
|
334
|
+
const cell = text('td', 'plan-time-cell');
|
|
335
|
+
const when = text('time', 'plan-time', formatWhen(record.startedAt));
|
|
336
|
+
if (record.startedAt) when.dateTime = new Date(Number(record.startedAt)).toISOString();
|
|
337
|
+
cell.append(when, text('span', 'sub', durationPhrase(record.status, formatDuration(record.durationMs))));
|
|
338
|
+
const files = Number(record.filesModified) || 0;
|
|
339
|
+
if (files > 0) cell.append(text('span', 'sub', filesText(files)));
|
|
340
|
+
return cell;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function actionIcon(kind) {
|
|
344
|
+
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
345
|
+
svg.setAttribute('viewBox', '0 0 24 24');
|
|
346
|
+
svg.setAttribute('fill', 'none');
|
|
347
|
+
svg.setAttribute('stroke', 'currentColor');
|
|
348
|
+
svg.setAttribute('stroke-width', '2');
|
|
349
|
+
svg.setAttribute('stroke-linecap', 'round');
|
|
350
|
+
svg.setAttribute('stroke-linejoin', 'round');
|
|
351
|
+
svg.setAttribute('aria-hidden', 'true');
|
|
352
|
+
const paths = iconPaths[kind] || [];
|
|
353
|
+
for (let index = 0; index < paths.length; index += 1) {
|
|
354
|
+
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
355
|
+
path.setAttribute('d', paths[index]);
|
|
356
|
+
svg.append(path);
|
|
357
|
+
}
|
|
358
|
+
if (kind === 'more') {
|
|
359
|
+
for (const cx of ['5', '12', '19']) {
|
|
360
|
+
const dot = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
|
|
361
|
+
dot.setAttribute('cx', cx);
|
|
362
|
+
dot.setAttribute('cy', '12');
|
|
363
|
+
dot.setAttribute('r', '1');
|
|
364
|
+
svg.append(dot);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
return svg;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// Lucide paths: file-text, trash-2. "more" adds three dots.
|
|
371
|
+
const iconPaths = {
|
|
372
|
+
file: ['M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z', 'M14 2v4a2 2 0 0 0 2 2h4', 'M10 9H8', 'M16 13H8', 'M16 17H8'],
|
|
373
|
+
trash: ['M3 6h18', 'M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6', 'M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2', 'M10 11v6', 'M14 11v6'],
|
|
374
|
+
more: [],
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
function menuLabel(label, kind) {
|
|
378
|
+
const node = text('span', 'plan-menu-label');
|
|
379
|
+
node.append(actionIcon(kind), label);
|
|
380
|
+
return node;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// The open row menu. Polling does not repaint the table while it is open.
|
|
384
|
+
let openMenu = null;
|
|
385
|
+
let pendingPaint = null;
|
|
386
|
+
|
|
387
|
+
function closeMenu(focusTrigger) {
|
|
388
|
+
if (!openMenu) return;
|
|
389
|
+
const menu = openMenu;
|
|
390
|
+
openMenu = null;
|
|
391
|
+
menu.popup.remove();
|
|
392
|
+
menu.trigger.setAttribute('aria-expanded', 'false');
|
|
393
|
+
if (focusTrigger) menu.trigger.focus();
|
|
394
|
+
if (pendingPaint) {
|
|
395
|
+
const payload = pendingPaint;
|
|
396
|
+
pendingPaint = null;
|
|
397
|
+
paint(payload);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
function showMenu(trigger, record) {
|
|
402
|
+
const popup = text('div', 'plan-menu-popup plan-row-menu');
|
|
403
|
+
popup.setAttribute('role', 'menu');
|
|
404
|
+
if (record.storedPath && record.id) {
|
|
405
|
+
const item = document.createElement('a');
|
|
406
|
+
item.className = 'plan-menu-item';
|
|
407
|
+
item.setAttribute('role', 'menuitem');
|
|
408
|
+
item.href = record.fileUrl || ('/archive/' + encodeURIComponent(record.id));
|
|
409
|
+
item.append(menuLabel('Plan file', 'file'));
|
|
410
|
+
popup.append(item);
|
|
411
|
+
const line = text('div', 'plan-menu-separator');
|
|
412
|
+
line.setAttribute('role', 'separator');
|
|
413
|
+
popup.append(line);
|
|
414
|
+
}
|
|
415
|
+
const remove = text('button', 'plan-menu-item plan-menu-danger');
|
|
416
|
+
remove.type = 'button';
|
|
417
|
+
remove.setAttribute('role', 'menuitem');
|
|
418
|
+
remove.append(menuLabel('Delete', 'trash'));
|
|
419
|
+
remove.addEventListener('click', () => {
|
|
420
|
+
closeMenu(false);
|
|
421
|
+
askDelete(record);
|
|
422
|
+
});
|
|
423
|
+
popup.append(remove);
|
|
424
|
+
// Fixed to the trigger, so the scrolling table does not clip it.
|
|
425
|
+
const box = trigger.getBoundingClientRect();
|
|
426
|
+
popup.style.right = Math.round(document.documentElement.clientWidth - box.right) + 'px';
|
|
427
|
+
document.body.append(popup);
|
|
428
|
+
// Open upward when there is no room below.
|
|
429
|
+
const below = window.innerHeight - box.bottom - 4;
|
|
430
|
+
const top = popup.offsetHeight > below ? box.top - 4 - popup.offsetHeight : box.bottom + 4;
|
|
431
|
+
popup.style.top = Math.round(Math.max(4, top)) + 'px';
|
|
432
|
+
trigger.setAttribute('aria-expanded', 'true');
|
|
433
|
+
openMenu = { trigger, popup };
|
|
434
|
+
const first = popup.querySelector('.plan-menu-item');
|
|
435
|
+
if (first) first.focus({ preventScroll: true });
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
function moreButton(record) {
|
|
439
|
+
const button = document.createElement('button');
|
|
440
|
+
button.type = 'button';
|
|
441
|
+
button.className = 'plan-btn plan-btn-ghost plan-action';
|
|
442
|
+
button.setAttribute('aria-label', 'More actions');
|
|
443
|
+
button.setAttribute('aria-haspopup', 'menu');
|
|
444
|
+
button.setAttribute('aria-expanded', 'false');
|
|
445
|
+
button.title = 'More actions';
|
|
446
|
+
button.append(actionIcon('more'));
|
|
447
|
+
button.addEventListener('click', (event) => {
|
|
448
|
+
event.stopPropagation();
|
|
449
|
+
const wasOpen = openMenu && openMenu.trigger === button;
|
|
450
|
+
closeMenu(false);
|
|
451
|
+
if (!wasOpen) showMenu(button, record);
|
|
452
|
+
});
|
|
453
|
+
return button;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// Confirmation dialog for Delete. Same look as the hosted dashboard's alert dialog.
|
|
457
|
+
const confirmDialog = document.getElementById('delete-dialog');
|
|
458
|
+
const confirmName = document.getElementById('delete-dialog-name');
|
|
459
|
+
const confirmError = document.getElementById('delete-dialog-error');
|
|
460
|
+
const confirmButton = document.getElementById('delete-dialog-confirm');
|
|
461
|
+
const cancelButton = document.getElementById('delete-dialog-cancel');
|
|
462
|
+
let confirming = null;
|
|
463
|
+
let deleting = false;
|
|
464
|
+
|
|
465
|
+
function askDelete(record) {
|
|
466
|
+
confirming = record;
|
|
467
|
+
confirmName.textContent = record.title || 'Untitled plan';
|
|
468
|
+
confirmError.hidden = true;
|
|
469
|
+
confirmButton.disabled = false;
|
|
470
|
+
cancelButton.disabled = false;
|
|
471
|
+
confirmButton.textContent = 'Delete';
|
|
472
|
+
confirmDialog.showModal();
|
|
473
|
+
cancelButton.focus();
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
cancelButton.addEventListener('click', () => confirmDialog.close());
|
|
477
|
+
confirmDialog.addEventListener('cancel', (event) => {
|
|
478
|
+
if (deleting) event.preventDefault();
|
|
479
|
+
});
|
|
480
|
+
confirmDialog.addEventListener('click', (event) => {
|
|
481
|
+
if (event.target === confirmDialog && !deleting) confirmDialog.close();
|
|
482
|
+
});
|
|
483
|
+
confirmButton.addEventListener('click', async () => {
|
|
484
|
+
if (!confirming || deleting) return;
|
|
485
|
+
const record = confirming;
|
|
486
|
+
deleting = true;
|
|
487
|
+
confirmButton.disabled = true;
|
|
488
|
+
cancelButton.disabled = true;
|
|
489
|
+
confirmButton.textContent = 'Deleting…';
|
|
490
|
+
const ok = await deletePlan(record);
|
|
491
|
+
deleting = false;
|
|
492
|
+
if (ok) {
|
|
493
|
+
confirmDialog.close();
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
confirmButton.disabled = false;
|
|
497
|
+
cancelButton.disabled = false;
|
|
498
|
+
confirmButton.textContent = 'Delete';
|
|
499
|
+
confirmError.hidden = false;
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
// Hide a plan from the dashboard. The service keeps its rows and files. False when the request failed.
|
|
503
|
+
async function deletePlan(record) {
|
|
504
|
+
try {
|
|
505
|
+
const response = await fetch('/api/dashboard/plans/' + encodeURIComponent(record.id), { method: 'DELETE' });
|
|
506
|
+
if (!response.ok) throw new Error('Request failed');
|
|
507
|
+
} catch (error) {
|
|
508
|
+
return false;
|
|
509
|
+
}
|
|
510
|
+
if (latest && Array.isArray(latest.plans)) {
|
|
511
|
+
motion = 'filter';
|
|
512
|
+
paint({ ...latest, plans: latest.plans.filter((plan) => plan.id !== record.id) });
|
|
513
|
+
}
|
|
514
|
+
refresh();
|
|
515
|
+
return true;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
document.addEventListener('click', (event) => {
|
|
519
|
+
if (openMenu && !openMenu.popup.contains(event.target)) closeMenu(false);
|
|
520
|
+
});
|
|
521
|
+
document.addEventListener('keydown', (event) => {
|
|
522
|
+
if (event.key === 'Escape') closeMenu(true);
|
|
523
|
+
});
|
|
524
|
+
window.addEventListener('resize', () => closeMenu(false));
|
|
525
|
+
document.addEventListener('scroll', () => closeMenu(false), true);
|
|
526
|
+
|
|
527
|
+
function actions(record) {
|
|
528
|
+
const cell = document.createElement('td');
|
|
529
|
+
cell.className = 'plan-actions-cell';
|
|
530
|
+
const row = document.createElement('div');
|
|
531
|
+
row.className = 'plan-actions';
|
|
532
|
+
if (record.id) row.append(moreButton(record));
|
|
533
|
+
if (row.childElementCount) cell.append(row);
|
|
534
|
+
return cell;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
function renderRow(record) {
|
|
538
|
+
const row = document.createElement('tr');
|
|
539
|
+
row.dataset.activity = activityOf(record);
|
|
540
|
+
row.append(planCell(record), statusCell(record), progressCell(record), timeCell(record), actions(record));
|
|
541
|
+
return row;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
// A group heading row: Open or Finished, and how many plans are in it.
|
|
545
|
+
function groupRow(label, size) {
|
|
546
|
+
const row = text('tr', 'plan-group');
|
|
547
|
+
const head = text('th', '', label);
|
|
548
|
+
head.scope = 'rowgroup';
|
|
549
|
+
head.colSpan = 5;
|
|
550
|
+
head.append(text('span', '', String(size)));
|
|
551
|
+
row.append(head);
|
|
552
|
+
return row;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
function bodyOf(rowList) {
|
|
556
|
+
const body = document.createElement('tbody');
|
|
557
|
+
body.append(...rowList);
|
|
558
|
+
return body;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
// The table holds one body per group. The first keeps the rows id.
|
|
562
|
+
function setBodies(bodies) {
|
|
563
|
+
for (const body of Array.from(table.tBodies)) body.remove();
|
|
564
|
+
if (bodies[0]) bodies[0].id = 'rows';
|
|
565
|
+
table.append(...bodies);
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
function skeletonBody() {
|
|
569
|
+
const body = document.createElement('tbody');
|
|
570
|
+
body.innerHTML = rowSkeleton;
|
|
571
|
+
return body;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
function visiblePlans(plans) {
|
|
575
|
+
if (filter === 'all') return plans;
|
|
576
|
+
return plans.filter((plan) => activityOf(plan) === filter);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
function motionOff() {
|
|
580
|
+
return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
// A period switch keeps the last rows on screen, dimmed, until the new ones are painted.
|
|
584
|
+
function setPending(on) {
|
|
585
|
+
for (const node of [stats, tableWrap]) {
|
|
586
|
+
node.classList.toggle('dash-pending', on);
|
|
587
|
+
if (on) node.setAttribute('aria-busy', 'true');
|
|
588
|
+
else node.removeAttribute('aria-busy');
|
|
589
|
+
}
|
|
590
|
+
statusSpinner.hidden = !on;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
function setRefreshing(on) {
|
|
594
|
+
refreshButton.disabled = on;
|
|
595
|
+
refreshSpinner.hidden = !on;
|
|
596
|
+
refreshLabel.textContent = on ? 'Refreshing…' : 'Refresh';
|
|
597
|
+
if (on) refreshButton.setAttribute('aria-busy', 'true');
|
|
598
|
+
else refreshButton.removeAttribute('aria-busy');
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
function showLoadError() {
|
|
602
|
+
const row = document.createElement('tr');
|
|
603
|
+
const cell = text('td', 'empty', 'Could not read the dashboard.');
|
|
604
|
+
cell.colSpan = 5;
|
|
605
|
+
const retry = text('button', 'plan-btn plan-btn-secondary dash-retry', 'Try again');
|
|
606
|
+
retry.type = 'button';
|
|
607
|
+
retry.addEventListener('click', () => {
|
|
608
|
+
setBodies([skeletonBody()]);
|
|
609
|
+
stats.setAttribute('aria-busy', 'true');
|
|
610
|
+
tableWrap.setAttribute('aria-busy', 'true');
|
|
611
|
+
statusSpinner.hidden = false;
|
|
612
|
+
status.textContent = 'Loading plans…';
|
|
613
|
+
refresh('first');
|
|
614
|
+
});
|
|
615
|
+
cell.append(retry);
|
|
616
|
+
row.append(cell);
|
|
617
|
+
setBodies([bodyOf([row])]);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
// reveal: the first rows rise in, staggered. fade: the new rows fade in place, all at once,
|
|
621
|
+
// while the caption, the counts, and the status line stay where they are.
|
|
622
|
+
function applyPaint(payload, reveal, fade) {
|
|
623
|
+
latest = payload;
|
|
624
|
+
painted = true;
|
|
625
|
+
if (awaitingPaint) {
|
|
626
|
+
awaitingPaint = false;
|
|
627
|
+
setPending(false);
|
|
628
|
+
}
|
|
629
|
+
const summary = payload.summary || {};
|
|
630
|
+
const plans = Array.isArray(payload.plans) ? payload.plans : [];
|
|
631
|
+
paintSummary(summary, reveal);
|
|
632
|
+
const shown = visiblePlans(plans);
|
|
633
|
+
// Same text as dashboardStatusLine and plansCountText in src/dashboardFormat.ts.
|
|
634
|
+
const range = summary.from ? rangeText(summary.from, summary.to) : '';
|
|
635
|
+
status.textContent = (summary.label || 'Period') + (range ? ' · ' + range : '');
|
|
636
|
+
plansCount.textContent = filter === 'all' ? String(plans.length) : shown.length + ' of ' + plans.length;
|
|
637
|
+
// The columns resize to fit the new rows, so the header fades with them rather than jump.
|
|
638
|
+
if (fade) {
|
|
639
|
+
for (const animation of headRow.getAnimations()) animation.cancel();
|
|
640
|
+
headRow.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 150, easing: 'cubic-bezier(0.23, 1, 0.32, 1)' });
|
|
641
|
+
}
|
|
642
|
+
if (shown.length === 0) {
|
|
643
|
+
const row = document.createElement('tr');
|
|
644
|
+
const cell = text('td', 'empty', emptyPlansText(filter, period));
|
|
645
|
+
cell.colSpan = 5;
|
|
646
|
+
if (reveal || fade) row.classList.add('enter');
|
|
647
|
+
row.append(cell);
|
|
648
|
+
setBodies([bodyOf([row])]);
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
// Open plans first, then finished runs, each under its heading when both are shown.
|
|
652
|
+
const open = shown.filter((plan) => plan.status === 'running');
|
|
653
|
+
const finished = shown.filter((plan) => plan.status !== 'running');
|
|
654
|
+
const groups = open.length && finished.length ? [['Open', open], ['Finished', finished]] : [['', shown]];
|
|
655
|
+
let index = 0;
|
|
656
|
+
setBodies(groups.map((group) => {
|
|
657
|
+
const rowList = group[0] ? [groupRow(group[0], group[1].length)] : [];
|
|
658
|
+
for (const record of group[1]) {
|
|
659
|
+
const row = renderRow(record);
|
|
660
|
+
if (reveal || fade) row.classList.add('enter');
|
|
661
|
+
if (reveal) row.style.animationDelay = Math.min(index, 8) * 30 + 'ms';
|
|
662
|
+
index += 1;
|
|
663
|
+
rowList.push(row);
|
|
664
|
+
}
|
|
665
|
+
return bodyOf(rowList);
|
|
666
|
+
}));
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
// Nothing slides and nothing fades out first: the new rows replace the old ones in the same
|
|
670
|
+
// frame and fade in there. A new period also brightens the counts and the table frame from
|
|
671
|
+
// their dimmed state as .dash-pending comes off (the transition is on the view itself).
|
|
672
|
+
function paint(payload) {
|
|
673
|
+
if (openMenu) {
|
|
674
|
+
pendingPaint = payload;
|
|
675
|
+
latest = payload;
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
const kind = motion;
|
|
679
|
+
motion = 'quiet';
|
|
680
|
+
const still = motionOff();
|
|
681
|
+
applyPaint(payload, kind === 'enter' && !still, (kind === 'filter' || kind === 'period') && !still);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
function followInternalPage(event) {
|
|
685
|
+
if (motionOff()) return;
|
|
686
|
+
if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
|
|
687
|
+
const target = event.target;
|
|
688
|
+
const link = target && target.closest ? target.closest('a[href]') : null;
|
|
689
|
+
if (!link || link.target === '_blank' || link.hasAttribute('download')) return;
|
|
690
|
+
let url;
|
|
691
|
+
try {
|
|
692
|
+
url = new URL(link.href, window.location.href);
|
|
693
|
+
} catch (error) {
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
if (url.origin !== window.location.origin) return;
|
|
697
|
+
if (url.pathname !== '/' && url.pathname !== '/dashboard') return;
|
|
698
|
+
if (url.pathname === window.location.pathname) return;
|
|
699
|
+
event.preventDefault();
|
|
700
|
+
const main = document.querySelector('main');
|
|
701
|
+
const leaving = main.animate(
|
|
702
|
+
[
|
|
703
|
+
{ opacity: 1, transform: 'translateY(0px)' },
|
|
704
|
+
{ opacity: 0, transform: 'translateY(8px)' },
|
|
705
|
+
],
|
|
706
|
+
{ duration: 200, easing: 'cubic-bezier(0.23, 1, 0.32, 1)', fill: 'forwards' },
|
|
707
|
+
);
|
|
708
|
+
leaving.finished.then(() => {
|
|
709
|
+
window.location.assign(url.href);
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
function syncPressed() {
|
|
714
|
+
for (const button of periodButtons) {
|
|
715
|
+
button.setAttribute('aria-pressed', button.getAttribute('data-period') === period ? 'true' : 'false');
|
|
716
|
+
}
|
|
717
|
+
for (const button of filterButtons) {
|
|
718
|
+
button.setAttribute('aria-pressed', button.getAttribute('data-filter') === filter ? 'true' : 'false');
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
// kind: 'first' (skeleton on screen), 'period' (dim the last rows), 'manual' (the Refresh
|
|
723
|
+
// button spins), or nothing for a poll, which changes nothing on screen until it answers.
|
|
724
|
+
async function refresh(kind) {
|
|
725
|
+
syncPressed();
|
|
726
|
+
const mine = ++refreshToken;
|
|
727
|
+
if (kind === 'period' && painted) {
|
|
728
|
+
setPending(true);
|
|
729
|
+
status.textContent = 'Loading ' + (periodPhrase[period] || 'this period') + '…';
|
|
730
|
+
}
|
|
731
|
+
if (kind === 'manual') setRefreshing(true);
|
|
732
|
+
try {
|
|
733
|
+
const response = await fetch(apiPath + '?period=' + encodeURIComponent(period), { cache: 'no-store' });
|
|
734
|
+
if (!response.ok) throw new Error('Request failed');
|
|
735
|
+
const payload = await response.json();
|
|
736
|
+
// A newer read is on the way. It paints instead.
|
|
737
|
+
if (mine !== refreshToken) return;
|
|
738
|
+
awaitingPaint = true;
|
|
739
|
+
stats.removeAttribute('aria-busy');
|
|
740
|
+
if (!painted) tableWrap.removeAttribute('aria-busy');
|
|
741
|
+
statusSpinner.hidden = !tableWrap.classList.contains('dash-pending');
|
|
742
|
+
paint(payload);
|
|
743
|
+
} catch (error) {
|
|
744
|
+
if (mine !== refreshToken) return;
|
|
745
|
+
setPending(false);
|
|
746
|
+
stats.removeAttribute('aria-busy');
|
|
747
|
+
status.textContent = 'Could not read the dashboard.';
|
|
748
|
+
if (!painted) {
|
|
749
|
+
stats.replaceChildren();
|
|
750
|
+
showLoadError();
|
|
751
|
+
}
|
|
752
|
+
} finally {
|
|
753
|
+
if (kind === 'manual') setRefreshing(false);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
for (const button of periodButtons) {
|
|
758
|
+
button.addEventListener('click', () => {
|
|
759
|
+
const nextPeriod = button.getAttribute('data-period') || 'day';
|
|
760
|
+
if (nextPeriod === period) return;
|
|
761
|
+
period = nextPeriod;
|
|
762
|
+
motion = 'period';
|
|
763
|
+
const next = new URL(window.location.href);
|
|
764
|
+
next.searchParams.set('period', period);
|
|
765
|
+
history.replaceState(null, '', next);
|
|
766
|
+
refresh('period');
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
for (const button of filterButtons) {
|
|
770
|
+
button.addEventListener('click', () => {
|
|
771
|
+
const nextFilter = button.getAttribute('data-filter') || 'all';
|
|
772
|
+
if (nextFilter === filter) return;
|
|
773
|
+
filter = nextFilter;
|
|
774
|
+
motion = 'filter';
|
|
775
|
+
syncPressed();
|
|
776
|
+
if (latest) paint(latest);
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
refreshButton.addEventListener('click', () => {
|
|
780
|
+
if (refreshButton.disabled) return;
|
|
781
|
+
motion = 'filter';
|
|
782
|
+
refresh('manual');
|
|
783
|
+
});
|
|
784
|
+
document.addEventListener('click', followInternalPage);
|
|
785
|
+
|
|
786
|
+
// Search across the listed plans by title and text, with fuzzy matching. The service runs
|
|
787
|
+
// the search. The field searches while someone types, at most once per SEARCH_THROTTLE_MS,
|
|
788
|
+
// and Enter searches at once. Live text only unless "Include saved versions" is checked.
|
|
789
|
+
const highlightParts = (${highlightParts.toString()});
|
|
790
|
+
const hitHref = (${hitHref.toString()});
|
|
791
|
+
const hitWhere = (${hitWhere.toString()});
|
|
792
|
+
const planOpenUrl = (${planOpenUrl.toString()});
|
|
793
|
+
const searchSummary = (${searchSummary.toString()});
|
|
794
|
+
const versionLabel = (${versionLabel.toString()});
|
|
795
|
+
const throttle = (${throttle.toString()});
|
|
796
|
+
const searchMinTyped = ${JSON.stringify(SEARCH_MIN_TYPED)};
|
|
797
|
+
const searchThrottleMs = ${JSON.stringify(SEARCH_THROTTLE_MS)};
|
|
798
|
+
const searchSkeleton = ${JSON.stringify(searchSkeletonHtml())};
|
|
799
|
+
const searchForm = document.getElementById('search-form');
|
|
800
|
+
const searchBox = document.getElementById('search-box');
|
|
801
|
+
const searchQuery = document.getElementById('search-query');
|
|
802
|
+
const searchVersions = document.getElementById('search-versions');
|
|
803
|
+
const searchAny = document.getElementById('search-any');
|
|
804
|
+
const searchActions = document.getElementById('search-actions');
|
|
805
|
+
const searchClear = document.getElementById('search-clear');
|
|
806
|
+
const searchRetry = document.getElementById('search-retry');
|
|
807
|
+
const searchView = document.getElementById('search-view');
|
|
808
|
+
const searchStatus = document.getElementById('search-status');
|
|
809
|
+
const searchResults = document.getElementById('search-results');
|
|
810
|
+
let searchToken = 0;
|
|
811
|
+
let searchAbort = null;
|
|
812
|
+
// The results on screen. A new search keeps them, dimmed, until its own arrive.
|
|
813
|
+
let shownResult = null;
|
|
814
|
+
const typedSearch = throttle((value) => {
|
|
815
|
+
runSearch(value);
|
|
816
|
+
}, searchThrottleMs);
|
|
817
|
+
|
|
818
|
+
function stopSearch() {
|
|
819
|
+
typedSearch.cancel();
|
|
820
|
+
searchToken += 1;
|
|
821
|
+
if (searchAbort) searchAbort.abort();
|
|
822
|
+
searchAbort = null;
|
|
823
|
+
delete searchBox.dataset.busy;
|
|
824
|
+
searchResults.removeAttribute('aria-busy');
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
function showTable() {
|
|
828
|
+
stopSearch();
|
|
829
|
+
searchView.hidden = true;
|
|
830
|
+
searchActions.hidden = true;
|
|
831
|
+
searchRetry.hidden = true;
|
|
832
|
+
tableWrap.hidden = false;
|
|
833
|
+
searchResults.replaceChildren();
|
|
834
|
+
shownResult = null;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
function markedNode(tag, className, value, terms, ranges) {
|
|
838
|
+
const node = text(tag, className);
|
|
839
|
+
for (const part of highlightParts(value, terms, ranges)) {
|
|
840
|
+
node.append(part.match ? text('mark', '', part.text) : part.text);
|
|
841
|
+
}
|
|
842
|
+
return node;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
function relativeUrl(value) {
|
|
846
|
+
if (!value) return '';
|
|
847
|
+
try {
|
|
848
|
+
const url = new URL(value, window.location.href);
|
|
849
|
+
return url.protocol === 'http:' || url.protocol === 'https:' ? url.href : '';
|
|
850
|
+
} catch (error) {
|
|
851
|
+
return '';
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
function renderSearch(result) {
|
|
856
|
+
shownResult = result;
|
|
857
|
+
searchStatus.textContent = searchSummary(result);
|
|
858
|
+
searchResults.replaceChildren();
|
|
859
|
+
for (const plan of result.plans) {
|
|
860
|
+
const card = text('article', 'dash-search-plan');
|
|
861
|
+
const heading = document.createElement('h3');
|
|
862
|
+
const title = plan.title || 'Untitled plan';
|
|
863
|
+
const matched = Array.isArray(plan.titleMatched) ? plan.titleMatched : [];
|
|
864
|
+
const label = matched.length > 0 ? markedNode('span', '', title, matched, plan.titleRanges) : document.createTextNode(title);
|
|
865
|
+
const planUrl = relativeUrl(planOpenUrl(plan));
|
|
866
|
+
if (planUrl) {
|
|
867
|
+
const link = document.createElement('a');
|
|
868
|
+
link.href = planUrl;
|
|
869
|
+
link.append(label);
|
|
870
|
+
heading.append(link);
|
|
871
|
+
} else {
|
|
872
|
+
heading.append(label);
|
|
873
|
+
}
|
|
874
|
+
card.append(heading);
|
|
875
|
+
if (plan.versions.length === 0 && matched.length > 0) card.append(text('span', 'dash-search-title-match', 'Title match'));
|
|
876
|
+
for (const version of plan.versions) {
|
|
877
|
+
const block = text('section', 'dash-search-version');
|
|
878
|
+
block.append(text('span', version.live ? 'dash-search-version-label' : 'dash-search-version-label saved', versionLabel(version)));
|
|
879
|
+
const list = text('ul', 'dash-search-hits');
|
|
880
|
+
for (const hit of version.hits) {
|
|
881
|
+
const item = document.createElement('li');
|
|
882
|
+
const href = relativeUrl(hitHref(version, hit));
|
|
883
|
+
const row = href ? document.createElement('a') : document.createElement('div');
|
|
884
|
+
row.className = 'dash-search-hit';
|
|
885
|
+
if (href) row.href = href;
|
|
886
|
+
row.append(text('span', 'dash-search-where', hitWhere(hit)), markedNode('span', 'dash-search-snippet', hit.snippet, result.terms, hit.ranges));
|
|
887
|
+
item.append(row);
|
|
888
|
+
list.append(item);
|
|
889
|
+
}
|
|
890
|
+
block.append(list);
|
|
891
|
+
card.append(block);
|
|
892
|
+
}
|
|
893
|
+
searchResults.append(card);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
function searchFailed(message) {
|
|
898
|
+
shownResult = null;
|
|
899
|
+
searchResults.replaceChildren();
|
|
900
|
+
searchStatus.textContent = message;
|
|
901
|
+
searchRetry.hidden = false;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
async function runSearch(value) {
|
|
905
|
+
const query = (typeof value === 'string' ? value : searchQuery.value).trim();
|
|
906
|
+
if (!query) {
|
|
907
|
+
showTable();
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
910
|
+
stopSearch();
|
|
911
|
+
const token = searchToken;
|
|
912
|
+
const controller = typeof AbortController === 'function' ? new AbortController() : null;
|
|
913
|
+
searchAbort = controller;
|
|
914
|
+
const params = new URLSearchParams({ q: query, fuzzy: 'on' });
|
|
915
|
+
if (searchVersions.checked) params.set('version', 'all');
|
|
916
|
+
if (searchAny.checked) params.set('match', 'any');
|
|
917
|
+
tableWrap.hidden = true;
|
|
918
|
+
searchView.hidden = false;
|
|
919
|
+
searchActions.hidden = false;
|
|
920
|
+
searchRetry.hidden = true;
|
|
921
|
+
searchBox.dataset.busy = '';
|
|
922
|
+
searchStatus.textContent = 'Searching…';
|
|
923
|
+
if (shownResult) searchResults.setAttribute('aria-busy', 'true');
|
|
924
|
+
else searchResults.innerHTML = searchSkeleton;
|
|
925
|
+
try {
|
|
926
|
+
const response = await fetch(apiPath + '/search?' + params.toString(), {
|
|
927
|
+
cache: 'no-store',
|
|
928
|
+
signal: controller ? controller.signal : undefined,
|
|
929
|
+
});
|
|
930
|
+
const body = await response.json().catch(() => null);
|
|
931
|
+
if (token !== searchToken) return;
|
|
932
|
+
delete searchBox.dataset.busy;
|
|
933
|
+
searchResults.removeAttribute('aria-busy');
|
|
934
|
+
searchAbort = null;
|
|
935
|
+
if (!response.ok) {
|
|
936
|
+
searchFailed((body && body.error) || 'Could not search the plans.');
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
renderSearch(body);
|
|
940
|
+
} catch (error) {
|
|
941
|
+
if (token !== searchToken) return;
|
|
942
|
+
delete searchBox.dataset.busy;
|
|
943
|
+
searchResults.removeAttribute('aria-busy');
|
|
944
|
+
searchAbort = null;
|
|
945
|
+
searchFailed('Could not search the plans.');
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
searchForm.addEventListener('submit', (event) => {
|
|
950
|
+
event.preventDefault();
|
|
951
|
+
typedSearch.cancel();
|
|
952
|
+
runSearch();
|
|
953
|
+
});
|
|
954
|
+
searchQuery.addEventListener('input', () => {
|
|
955
|
+
const value = searchQuery.value.trim();
|
|
956
|
+
if (!value) {
|
|
957
|
+
if (!searchView.hidden) showTable();
|
|
958
|
+
else typedSearch.cancel();
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
if (value.length < searchMinTyped) {
|
|
962
|
+
typedSearch.cancel();
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
typedSearch(searchQuery.value);
|
|
966
|
+
});
|
|
967
|
+
// A changed option reruns a search that is already shown.
|
|
968
|
+
for (const option of [searchVersions, searchAny]) {
|
|
969
|
+
option.addEventListener('change', () => {
|
|
970
|
+
if (!searchView.hidden) {
|
|
971
|
+
typedSearch.cancel();
|
|
972
|
+
runSearch();
|
|
973
|
+
}
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
searchRetry.addEventListener('click', () => runSearch());
|
|
977
|
+
searchClear.addEventListener('click', () => {
|
|
978
|
+
searchQuery.value = '';
|
|
979
|
+
showTable();
|
|
980
|
+
searchQuery.focus();
|
|
981
|
+
});
|
|
982
|
+
searchQuery.addEventListener('keydown', (event) => {
|
|
983
|
+
if (event.key === 'Escape' && (!searchView.hidden || searchQuery.value)) {
|
|
984
|
+
event.stopPropagation();
|
|
985
|
+
searchQuery.value = '';
|
|
986
|
+
showTable();
|
|
987
|
+
}
|
|
988
|
+
});
|
|
989
|
+
searchQuery.addEventListener('search', () => {
|
|
990
|
+
if (!searchQuery.value.trim()) showTable();
|
|
991
|
+
});
|
|
992
|
+
// Poll only while this tab is on screen. A hidden tab sends no dashboard requests.
|
|
993
|
+
function startPolling() {
|
|
994
|
+
if (window.__livingPlanDashboardTimer) clearInterval(window.__livingPlanDashboardTimer);
|
|
995
|
+
window.__livingPlanDashboardTimer = null;
|
|
996
|
+
if (document.visibilityState === 'hidden') return;
|
|
997
|
+
window.__livingPlanDashboardTimer = setInterval(refresh, 4000);
|
|
998
|
+
}
|
|
999
|
+
document.addEventListener('visibilitychange', () => {
|
|
1000
|
+
if (document.visibilityState !== 'hidden') refresh();
|
|
1001
|
+
startPolling();
|
|
1002
|
+
});
|
|
1003
|
+
refresh('first');
|
|
1004
|
+
startPolling();
|
|
1005
|
+
})();`;
|
|
1006
|
+
}
|