visual-living-plan 0.1.0 → 2.33.0

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