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,34 @@
1
+ export type PlanSnapshotReason = 'create' | 'edit' | 'restore';
2
+ export type PlanSnapshotDocument = {
3
+ id: string;
4
+ title: string;
5
+ body: string;
6
+ createdAt: number;
7
+ updatedAt: number;
8
+ headSnapshotId: string;
9
+ };
10
+ export type PlanSnapshotRecord = {
11
+ id: string;
12
+ documentId: string;
13
+ seq: number;
14
+ parentId: string | null;
15
+ title: string;
16
+ body: string;
17
+ reason: PlanSnapshotReason;
18
+ restoredFromId: string | null;
19
+ createdAt: number;
20
+ };
21
+ export type PlanSnapshotChange = {
22
+ changed: boolean;
23
+ plan: PlanSnapshotDocument;
24
+ snapshot: PlanSnapshotRecord | null;
25
+ };
26
+ export type PlanSnapshotStore = {
27
+ sync: (title: string, body: string) => PlanSnapshotChange;
28
+ restore: (snapshotId: string) => PlanSnapshotChange;
29
+ list: () => PlanSnapshotRecord[];
30
+ head: () => PlanSnapshotDocument | null;
31
+ close: () => void;
32
+ };
33
+ /** Append-only plan source history in the shared `plan_versions` table. */
34
+ export declare function openPlanSnapshots(path: string, documentId: string): PlanSnapshotStore;
@@ -0,0 +1,113 @@
1
+ import { desc, eq } from 'drizzle-orm';
2
+ import { drizzle } from 'drizzle-orm/bun-sqlite';
3
+ import { nanoid } from 'nanoid';
4
+ import { migratePlanDatabase } from './store/migrate';
5
+ import { openSqliteStore } from './store/sqlite';
6
+ import { planVersions } from './store/tables';
7
+ const maxTitle = 200;
8
+ const maxBody = 500_000;
9
+ /** Append-only plan source history in the shared `plan_versions` table. */
10
+ export function openPlanSnapshots(path, documentId) {
11
+ const sqlite = openSqliteStore(path);
12
+ migratePlanDatabase(sqlite);
13
+ const db = drizzle(sqlite.database);
14
+ return {
15
+ sync(title, body) {
16
+ const current = readDocument(db, documentId);
17
+ const nextTitle = checkedTitle(title);
18
+ const nextBody = checkedBody(body);
19
+ if (!current)
20
+ return insertChange(db, documentId, 'create', nextTitle, nextBody, null, null);
21
+ if (current.title === nextTitle && current.body === nextBody)
22
+ return { changed: false, plan: current, snapshot: null };
23
+ return insertChange(db, documentId, 'edit', nextTitle, nextBody, current.headSnapshotId, null);
24
+ },
25
+ restore(snapshotId) {
26
+ const current = readDocument(db, documentId);
27
+ if (!current)
28
+ throw new Error('Plan snapshot document is missing');
29
+ const snapshot = readSnapshot(db, snapshotId);
30
+ if (!snapshot || snapshot.documentId !== documentId)
31
+ throw new Error('Snapshot not found');
32
+ if (snapshot.id === current.headSnapshotId)
33
+ return { changed: false, plan: current, snapshot: null };
34
+ return insertChange(db, documentId, 'restore', snapshot.title, snapshot.body, current.headSnapshotId, snapshot.id);
35
+ },
36
+ list: () => listSnapshots(db, documentId),
37
+ head: () => readDocument(db, documentId),
38
+ close() {
39
+ sqlite.close();
40
+ },
41
+ };
42
+ }
43
+ function insertChange(db, documentId, reason, title, body, parentId, restoredFromId) {
44
+ const now = Date.now();
45
+ const snapshotId = `snap_${nanoid(12)}`;
46
+ const latest = db
47
+ .select({ seq: planVersions.seq })
48
+ .from(planVersions)
49
+ .where(eq(planVersions.planId, documentId))
50
+ .orderBy(desc(planVersions.seq))
51
+ .limit(1)
52
+ .get();
53
+ const seq = (latest?.seq ?? 0) + 1;
54
+ db.insert(planVersions)
55
+ .values({ id: snapshotId, planId: documentId, seq, title, body, createdAt: now, parentId, reason, restoredFromId })
56
+ .run();
57
+ const plan = readDocument(db, documentId);
58
+ const snapshot = readSnapshot(db, snapshotId);
59
+ if (!plan || !snapshot)
60
+ throw new Error('Snapshot write did not persist');
61
+ return { changed: true, plan, snapshot };
62
+ }
63
+ function readDocument(db, id) {
64
+ const rows = db.select().from(planVersions).where(eq(planVersions.planId, id)).orderBy(planVersions.seq).all();
65
+ const head = rows.at(-1);
66
+ const first = rows[0];
67
+ if (!head || !first)
68
+ return null;
69
+ return {
70
+ id,
71
+ title: head.title,
72
+ body: head.body,
73
+ createdAt: first.createdAt,
74
+ updatedAt: head.createdAt,
75
+ headSnapshotId: head.id,
76
+ };
77
+ }
78
+ function readSnapshot(db, id) {
79
+ const row = db.select().from(planVersions).where(eq(planVersions.id, id)).get();
80
+ return row ? mapSnapshot(row) : null;
81
+ }
82
+ function listSnapshots(db, documentId) {
83
+ return db
84
+ .select()
85
+ .from(planVersions)
86
+ .where(eq(planVersions.planId, documentId))
87
+ .orderBy(planVersions.seq)
88
+ .all()
89
+ .map(mapSnapshot);
90
+ }
91
+ function mapSnapshot(row) {
92
+ const reason = row.reason === 'edit' || row.reason === 'restore' ? row.reason : 'create';
93
+ return {
94
+ id: row.id,
95
+ documentId: row.planId,
96
+ seq: row.seq,
97
+ parentId: row.parentId,
98
+ title: row.title,
99
+ body: row.body,
100
+ reason,
101
+ restoredFromId: row.restoredFromId,
102
+ createdAt: row.createdAt,
103
+ };
104
+ }
105
+ function checkedTitle(title) {
106
+ const trimmed = title.trim() || 'Untitled plan';
107
+ return trimmed.slice(0, maxTitle);
108
+ }
109
+ function checkedBody(body) {
110
+ if (body.length > maxBody)
111
+ throw new Error('Plan source is too large to snapshot');
112
+ return body;
113
+ }
@@ -0,0 +1,26 @@
1
+ import { type ExecutionState } from './execution';
2
+ /**
3
+ * The plan's status, shown on the title bar chip, as a dot on the logo, and on the tab icon.
4
+ * Checked in this order:
5
+ *
6
+ * - `executing`: a run is active.
7
+ * - `review`: the plan waits for a verdict, or the agent is revising it after Iterate.
8
+ * - `stopped`: the plan was denied, or a workflow step failed.
9
+ * - `completed`: every workflow step is done.
10
+ * - `paused`: the plan was approved or work has started, and no run is active.
11
+ * - `review` again: nothing has started yet, so the plan is still being shaped.
12
+ */
13
+ export type PlanStatus = 'review' | 'executing' | 'paused' | 'stopped' | 'completed';
14
+ /** How far the workflow has come, read from the step statuses the Workflow tab shows. */
15
+ export type WorkState = 'idle' | 'started' | 'failed' | 'completed';
16
+ export declare const PLAN_STATUS_LABEL: Record<PlanStatus, string>;
17
+ /** Dot colors. The tab icon is drawn on a canvas, so it cannot read CSS tokens. Keep in step with src/planPage.css. */
18
+ export declare const PLAN_STATUS_COLOR: Record<PlanStatus, string>;
19
+ /** The plan's workflow with the live run on top, the same merge the Workflow tab draws. */
20
+ export declare function workState(execution: Pick<ExecutionState, 'planned' | 'graph'> | null | undefined): WorkState;
21
+ export declare function planStatus(input: {
22
+ mode?: string | null;
23
+ decision?: string | null;
24
+ active?: boolean | null;
25
+ work?: WorkState | null;
26
+ }): PlanStatus;
@@ -0,0 +1,46 @@
1
+ import { mergePlannedExecution } from './execution';
2
+ export const PLAN_STATUS_LABEL = {
3
+ review: 'Review',
4
+ executing: 'Executing',
5
+ paused: 'Paused',
6
+ stopped: 'Stopped',
7
+ completed: 'Completed',
8
+ };
9
+ /** Dot colors. The tab icon is drawn on a canvas, so it cannot read CSS tokens. Keep in step with src/planPage.css. */
10
+ export const PLAN_STATUS_COLOR = {
11
+ review: '#f59e0b',
12
+ executing: '#04b54b',
13
+ paused: '#a1a1aa',
14
+ stopped: '#ef4d3e',
15
+ completed: '#7c3aed',
16
+ };
17
+ /** The plan's workflow with the live run on top, the same merge the Workflow tab draws. */
18
+ export function workState(execution) {
19
+ const nodes = mergePlannedExecution(execution?.planned, execution?.graph)?.nodes ?? [];
20
+ if (nodes.length === 0)
21
+ return 'idle';
22
+ const statuses = nodes.map((node) => node.status ?? 'pending');
23
+ if (statuses.includes('failed'))
24
+ return 'failed';
25
+ if (statuses.every((status) => status === 'done'))
26
+ return 'completed';
27
+ if (statuses.some((status) => status !== 'pending'))
28
+ return 'started';
29
+ return 'idle';
30
+ }
31
+ export function planStatus(input) {
32
+ if (input.active)
33
+ return 'executing';
34
+ const decision = input.decision || '';
35
+ if (input.mode === 'review' && decision !== 'approve' && decision !== 'deny')
36
+ return 'review';
37
+ if (decision === 'deny')
38
+ return 'stopped';
39
+ if (input.work === 'failed')
40
+ return 'stopped';
41
+ if (input.work === 'completed')
42
+ return 'completed';
43
+ if (input.work === 'started' || decision === 'approve')
44
+ return 'paused';
45
+ return 'review';
46
+ }
@@ -0,0 +1,16 @@
1
+ /** Split a leading "7. Title" into the step number and the label under it. */
2
+ export declare function splitStepHeading(title: string): {
3
+ number: string | null;
4
+ label: string;
5
+ };
6
+ export declare function stepNumberFor(title: string, ordinal: number): {
7
+ number: string;
8
+ label: string;
9
+ };
10
+ /**
11
+ * Status icon for static plan HTML. Matches the lucide icons `StatusIcon`
12
+ * draws in the app (CircleCheck, CircleX, Ban, CircleDashed) and the spinner.
13
+ */
14
+ export declare function stepStatusIconHtml(status: string): string;
15
+ /** Same spinner the workflow diagram draws beside an active step. */
16
+ export declare function activeStepSpinnerHtml(): string;
@@ -0,0 +1,34 @@
1
+ /** Split a leading "7. Title" into the step number and the label under it. */
2
+ export function splitStepHeading(title) {
3
+ const match = /^(\d+)\.\s+([\s\S]+)$/.exec(title.trim());
4
+ if (!match?.[1] || !match[2])
5
+ return { number: null, label: title };
6
+ return { number: match[1], label: match[2].trim() };
7
+ }
8
+ export function stepNumberFor(title, ordinal) {
9
+ const split = splitStepHeading(title);
10
+ return {
11
+ number: split.number ?? String(Math.max(1, ordinal)),
12
+ label: split.label,
13
+ };
14
+ }
15
+ const STATUS_ICON_PATHS = {
16
+ done: '<circle cx="12" cy="12" r="10"></circle><path d="m16 9-5.5 5.5L8 12"></path>',
17
+ failed: '<circle cx="12" cy="12" r="10"></circle><path d="m15 9-6 6"></path><path d="m9 9 6 6"></path>',
18
+ blocked: '<circle cx="12" cy="12" r="10"></circle><path d="M4.929 4.929 19.07 19.071"></path>',
19
+ pending: '<path d="M10.1 2.182a10 10 0 0 1 3.8 0"></path><path d="M13.9 21.818a10 10 0 0 1-3.8 0"></path><path d="M17.609 3.721a10 10 0 0 1 2.69 2.7"></path><path d="M2.182 13.9a10 10 0 0 1 0-3.8"></path><path d="M20.279 17.609a10 10 0 0 1-2.7 2.69"></path><path d="M21.818 10.1a10 10 0 0 1 0 3.8"></path><path d="M3.721 6.391a10 10 0 0 1 2.7-2.69"></path><path d="M6.391 20.279a10 10 0 0 1-2.69-2.7"></path>',
20
+ };
21
+ /**
22
+ * Status icon for static plan HTML. Matches the lucide icons `StatusIcon`
23
+ * draws in the app (CircleCheck, CircleX, Ban, CircleDashed) and the spinner.
24
+ */
25
+ export function stepStatusIconHtml(status) {
26
+ if (status === 'active')
27
+ return activeStepSpinnerHtml();
28
+ const paths = STATUS_ICON_PATHS[status] ?? STATUS_ICON_PATHS.pending;
29
+ return `<svg class="status-icon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${paths}</svg>`;
30
+ }
31
+ /** Same spinner the workflow diagram draws beside an active step. */
32
+ export function activeStepSpinnerHtml() {
33
+ return '<svg class="rf-progress-icon" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><circle cx="8" cy="8" r="6" fill="none" stroke="currentColor" stroke-width="2" opacity="0.28"></circle><path d="M14 8a6 6 0 0 0-6-6" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg>';
34
+ }
@@ -0,0 +1,16 @@
1
+ /** The arguments that are neither a flag nor a flag's value. */
2
+ export declare function positionalArgs(args: string[]): string[];
3
+ /** The plan file a command was given: `--plan <file>`, or a `.md` path among its arguments. */
4
+ export declare function planFileArg(args: string[]): string | undefined;
5
+ /**
6
+ * The plan URL a command acts on. `--url` wins. Otherwise the plan file, given as `--plan <file>` or
7
+ * as a `.md` path among the arguments, maps to:
8
+ *
9
+ * - its hosted URL, when this machine served it with `--cloud` (the record in `cloud.json`, found by
10
+ * the `cloudId` in the file or by its path);
11
+ * - its URL on this machine's service otherwise. The service lists it by path while it runs, and the
12
+ * same path always maps to the same plan id, so the URL is known even while the service is down.
13
+ *
14
+ * Returns null when the command was given neither. Throws when the file does not exist.
15
+ */
16
+ export declare function resolvePlanUrl(args: string[], home?: string): Promise<string | null>;
@@ -0,0 +1,92 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { resolve } from 'node:path';
3
+ import { cloudIdInSource } from './cloudFrontmatter';
4
+ import { readCloudFile } from './cloudStore';
5
+ import { planIdForPath } from './planId';
6
+ import { defaultRegistryHome, listProcesses, readRegistryLock, registryBindUrl } from './registryClient';
7
+ import { DEFAULT_REGISTRY_HOST, DEFAULT_REGISTRY_PORT } from './registryConstants';
8
+ /** Flags that take no value. Any other `--flag` is followed by its value. */
9
+ const SWITCHES = new Set([
10
+ '--any',
11
+ '--cloud',
12
+ '--detach',
13
+ '--follow',
14
+ '--fuzzy',
15
+ '--headless',
16
+ '--json',
17
+ '--keep-open',
18
+ '--listen',
19
+ '--no-open',
20
+ '--no-registry',
21
+ '--open',
22
+ ]);
23
+ /** The arguments that are neither a flag nor a flag's value. */
24
+ export function positionalArgs(args) {
25
+ const positional = [];
26
+ for (let index = 0; index < args.length; index += 1) {
27
+ const arg = args[index] ?? '';
28
+ if (arg.startsWith('-')) {
29
+ if (!SWITCHES.has(arg) && !arg.includes('='))
30
+ index += 1;
31
+ continue;
32
+ }
33
+ positional.push(arg);
34
+ }
35
+ return positional;
36
+ }
37
+ /** The plan file a command was given: `--plan <file>`, or a `.md` path among its arguments. */
38
+ export function planFileArg(args) {
39
+ const index = args.indexOf('--plan');
40
+ if (index !== -1)
41
+ return args[index + 1];
42
+ return positionalArgs(args).find((arg) => /\.md$/i.test(arg));
43
+ }
44
+ /**
45
+ * The plan URL a command acts on. `--url` wins. Otherwise the plan file, given as `--plan <file>` or
46
+ * as a `.md` path among the arguments, maps to:
47
+ *
48
+ * - its hosted URL, when this machine served it with `--cloud` (the record in `cloud.json`, found by
49
+ * the `cloudId` in the file or by its path);
50
+ * - its URL on this machine's service otherwise. The service lists it by path while it runs, and the
51
+ * same path always maps to the same plan id, so the URL is known even while the service is down.
52
+ *
53
+ * Returns null when the command was given neither. Throws when the file does not exist.
54
+ */
55
+ export async function resolvePlanUrl(args, home = defaultRegistryHome()) {
56
+ const index = args.indexOf('--url');
57
+ if (index !== -1)
58
+ return args[index + 1] ?? null;
59
+ const file = planFileArg(args);
60
+ if (!file)
61
+ return null;
62
+ const planPath = resolve(file);
63
+ let source;
64
+ try {
65
+ source = await readFile(planPath, 'utf8');
66
+ }
67
+ catch {
68
+ throw new Error(`No plan file at ${planPath}. Pass the plan file you served, or --url <plan-url>.`);
69
+ }
70
+ const cloud = await readCloudFile(home);
71
+ const cloudId = cloudIdInSource(source);
72
+ const hosted = (cloudId ? cloud.plans[cloudId] : undefined) ??
73
+ Object.values(cloud.plans).find((record) => record.planPath && resolve(record.planPath) === planPath);
74
+ if (hosted?.url)
75
+ return hosted.url;
76
+ return localPlanUrl(planPath, home);
77
+ }
78
+ async function localPlanUrl(planPath, home) {
79
+ const lock = await readRegistryLock(home);
80
+ const base = lock ? registryBindUrl(lock) : `http://${DEFAULT_REGISTRY_HOST}:${DEFAULT_REGISTRY_PORT}`;
81
+ if (lock) {
82
+ try {
83
+ const listed = (await listProcesses(base)).find((record) => record.planPath && resolve(record.planPath) === planPath);
84
+ if (listed?.url)
85
+ return listed.url;
86
+ }
87
+ catch {
88
+ // The service is down or busy. The id below is the one it gives this path.
89
+ }
90
+ }
91
+ return `${base}/plans/${planIdForPath(planPath)}/`;
92
+ }
@@ -0,0 +1,24 @@
1
+ import type { PhaseStatus } from './types';
2
+ export type PlanTocKind = 'section' | 'workflow' | 'workflow-step';
3
+ export type PlanTocIcon = 'heading' | 'workflow' | 'choice' | 'form' | 'questions' | 'approve' | 'checklist' | `phase-${PhaseStatus}` | `callout-${'note' | 'tip' | 'risk' | 'decision' | 'warning'}`;
4
+ export type PlanTocItem = {
5
+ label: string;
6
+ depth: number;
7
+ kind: PlanTocKind;
8
+ /** Value passed to the plan or workflow history jump. */
9
+ target: string;
10
+ href: string;
11
+ /** DOM id for a markdown heading, in document order. */
12
+ headingId?: string;
13
+ icon: PlanTocIcon;
14
+ /** Step glyph follows phase or execution progress. */
15
+ tracksProgress?: boolean;
16
+ };
17
+ /** Sections of a plan, then the Workflow page and its steps. */
18
+ export declare function buildPlanToc(source: string): PlanTocItem[];
19
+ export declare function planTocHeadingIds(items: readonly PlanTocItem[]): string[];
20
+ /** Give markdown headings the ids the contents list points at. */
21
+ export declare function stampPlanHeadingIds(html: string, items: readonly PlanTocItem[]): string;
22
+ export declare function renderTocItemsHtml(items: readonly PlanTocItem[]): string;
23
+ /** Contents chrome. It is a sibling of the plan column, not a child of it. */
24
+ export declare function renderPlanTocHtml(items: readonly PlanTocItem[]): string;
@@ -0,0 +1,258 @@
1
+ import { buildMdxOutline } from './planMdx/outline';
2
+ import { phaseStatus } from './planMdx/payload';
3
+ import { planRefHash, workflowStepHash } from './planRefNavigation';
4
+ const PHASE_PROGRESS = ['pending', 'active', 'done', 'blocked', 'failed'];
5
+ function headingTag() {
6
+ return /<h([1-3])\b([^>]*)>([\s\S]*?)<\/h\1>/gi;
7
+ }
8
+ /** Sections of a plan, then the Workflow page and its steps. */
9
+ export function buildPlanToc(source) {
10
+ const outline = buildMdxOutline(stripFrontmatter(source));
11
+ return planTocFromBlocks(outline.blocks);
12
+ }
13
+ export function planTocHeadingIds(items) {
14
+ return items.flatMap((item) => (item.headingId ? [item.headingId] : []));
15
+ }
16
+ /** Give markdown headings the ids the contents list points at. */
17
+ export function stampPlanHeadingIds(html, items) {
18
+ const ids = planTocHeadingIds(items);
19
+ let index = 0;
20
+ return html.replace(headingTag(), (match, level, attrs) => {
21
+ if (!/\bdata-plan-kind="heading"/.test(attrs) || /\bid=/.test(attrs))
22
+ return match;
23
+ const id = ids[index];
24
+ index += 1;
25
+ if (!id)
26
+ return match;
27
+ return `<h${level}${attrs} id="${escapeAttr(id)}">`;
28
+ });
29
+ }
30
+ export function renderTocItemsHtml(items) {
31
+ return items
32
+ .map((item) => {
33
+ const step = item.tracksProgress ? ' data-toc-step' : '';
34
+ return `<li><a href="${escapeAttr(item.href)}" data-toc="${item.kind}" data-toc-target="${escapeAttr(item.target)}" data-toc-icon="${item.icon}"${step} data-depth="${item.depth}"><span class="plan-toc-icon" aria-hidden="true">${tocIconHtml(item)}</span><span class="plan-toc-label">${escapeHtml(item.label)}</span></a></li>`;
35
+ })
36
+ .join('');
37
+ }
38
+ const TOC_ICON = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 6h13"/><path d="M8 12h13"/><path d="M8 18h13"/><path d="M3 6h.01"/><path d="M3 12h.01"/><path d="M3 18h.01"/></svg>';
39
+ /** Contents chrome. It is a sibling of the plan column, not a child of it. */
40
+ export function renderPlanTocHtml(items) {
41
+ return `<nav id="plan-toc" class="plan-toc" aria-label="Contents" data-open="false" tabindex="-1" inert data-plan-grab-ignore>
42
+ <ul class="plan-toc-list" id="plan-toc-list">${renderTocItemsHtml(items)}</ul>
43
+ </nav>
44
+ <button type="button" class="plan-toc-backdrop" id="plan-toc-backdrop" hidden data-plan-grab-ignore aria-label="Close contents"></button>
45
+ <button type="button" class="plan-toc-toggle" data-toc-toggle aria-expanded="false" aria-controls="plan-toc" data-plan-grab-ignore>${TOC_ICON}<span class="sr">Contents</span></button>`;
46
+ }
47
+ function planTocFromBlocks(blocks) {
48
+ const used = new Set();
49
+ const marks = new Map();
50
+ for (const block of blocks) {
51
+ if ('id' in block && block.id) {
52
+ used.add(`plan-${block.id}`);
53
+ const mark = markForBlock(block);
54
+ if (mark)
55
+ marks.set(block.id, mark);
56
+ }
57
+ }
58
+ const items = [];
59
+ const steps = [];
60
+ for (const block of blocks) {
61
+ if (block.type === 'markdown') {
62
+ items.push(...headingItems(block.html, used));
63
+ continue;
64
+ }
65
+ if (block.type === 'phase') {
66
+ items.push(sectionItem(block.title, block.id, 0, markForBlock(block)));
67
+ items.push(...headingItems(block.bodyHtml, used));
68
+ continue;
69
+ }
70
+ if (block.type === 'callout') {
71
+ if (block.id)
72
+ items.push(sectionItem(block.title || block.kind, block.id, 0, markForBlock(block)));
73
+ items.push(...headingItems(block.bodyHtml, used));
74
+ continue;
75
+ }
76
+ if (block.type === 'choice') {
77
+ items.push(sectionItem(block.prompt, block.id, 0, markForBlock(block)));
78
+ continue;
79
+ }
80
+ if (block.type === 'form') {
81
+ items.push(sectionItem(block.prompt, block.id, 0, markForBlock(block)));
82
+ continue;
83
+ }
84
+ if (block.type === 'questions') {
85
+ items.push(sectionItem(block.prompt || 'Questions', block.id, 0, markForBlock(block)));
86
+ continue;
87
+ }
88
+ if (block.type === 'approve') {
89
+ items.push(sectionItem(block.prompt, block.id, 0, markForBlock(block)));
90
+ items.push(...headingItems(block.bodyHtml, used));
91
+ continue;
92
+ }
93
+ if (block.type === 'checklist') {
94
+ if (block.id)
95
+ items.push(sectionItem(block.title || 'Checklist', block.id, 0, markForBlock(block)));
96
+ continue;
97
+ }
98
+ for (const node of block.nodes) {
99
+ const target = node.ref || node.id;
100
+ const label = (node.label || node.id).trim();
101
+ if (!target || !label)
102
+ continue;
103
+ const mark = stepMark(node, marks.get(target));
104
+ steps.push({
105
+ label,
106
+ depth: 1,
107
+ kind: 'workflow-step',
108
+ target,
109
+ href: workflowStepHash(target),
110
+ icon: mark.icon,
111
+ tracksProgress: mark.tracksProgress,
112
+ });
113
+ }
114
+ }
115
+ items.push({
116
+ label: 'Workflow',
117
+ depth: 0,
118
+ kind: 'workflow',
119
+ target: 'workflow',
120
+ href: '#workflow',
121
+ icon: 'workflow',
122
+ });
123
+ items.push(...steps);
124
+ return items;
125
+ }
126
+ function markForBlock(block) {
127
+ switch (block.type) {
128
+ case 'phase':
129
+ return { icon: `phase-${block.status}`, tracksProgress: true };
130
+ case 'callout':
131
+ return { icon: `callout-${block.kind}` };
132
+ case 'choice':
133
+ return { icon: 'choice' };
134
+ case 'form':
135
+ return { icon: 'form' };
136
+ case 'questions':
137
+ return { icon: 'questions' };
138
+ case 'approve':
139
+ return { icon: 'approve' };
140
+ case 'checklist':
141
+ return { icon: 'checklist' };
142
+ case 'workflow':
143
+ return { icon: 'workflow' };
144
+ case 'markdown':
145
+ return { icon: 'heading' };
146
+ }
147
+ }
148
+ function stepMark(node, linked) {
149
+ if (linked?.tracksProgress) {
150
+ const status = node.status ? phaseStatus(node.status) : undefined;
151
+ return { icon: status ? `phase-${status}` : linked.icon, tracksProgress: true };
152
+ }
153
+ if (linked)
154
+ return linked;
155
+ return { icon: `phase-${phaseStatus(node.status)}`, tracksProgress: true };
156
+ }
157
+ function sectionItem(label, id, depth, mark) {
158
+ return {
159
+ label: label.trim() || 'Section',
160
+ depth,
161
+ kind: 'section',
162
+ target: id,
163
+ href: planRefHash(id),
164
+ icon: mark.icon,
165
+ tracksProgress: mark.tracksProgress,
166
+ };
167
+ }
168
+ function headingItems(html, used) {
169
+ const items = [];
170
+ for (const match of html.matchAll(headingTag())) {
171
+ const attrs = match[2] ?? '';
172
+ if (!/\bdata-plan-kind="heading"/.test(attrs))
173
+ continue;
174
+ const level = Number(match[1]);
175
+ const label = htmlText(match[3] ?? '');
176
+ if (!label)
177
+ continue;
178
+ const headingId = allocateHeadingId(label, used);
179
+ items.push({
180
+ label,
181
+ depth: Math.max(0, Math.min(2, level - 1)),
182
+ kind: 'section',
183
+ target: headingId,
184
+ href: `#${encodeURIComponent(headingId)}`,
185
+ headingId,
186
+ icon: 'heading',
187
+ });
188
+ }
189
+ return items;
190
+ }
191
+ function allocateHeadingId(label, used) {
192
+ const slug = label
193
+ .toLowerCase()
194
+ .replace(/[^a-z0-9]+/g, '-')
195
+ .replace(/^-|-$/g, '')
196
+ .slice(0, 48) || 'section';
197
+ let id = `plan-${slug}`;
198
+ let suffix = 2;
199
+ while (used.has(id)) {
200
+ id = `plan-${slug}-${suffix}`;
201
+ suffix += 1;
202
+ }
203
+ used.add(id);
204
+ return id;
205
+ }
206
+ const TOC_CHECK = '<path d="m8 12.5 2.5 2.5 5.5-6" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>';
207
+ function tocSvg(body) {
208
+ return `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${body}</svg>`;
209
+ }
210
+ const TOC_ICONS = {
211
+ 'phase-pending': tocSvg('<circle cx="12" cy="12" r="8"/>'),
212
+ 'phase-active': tocSvg('<circle cx="12" cy="12" r="8" opacity="0.28"/><circle cx="12" cy="12" r="8" pathLength="100" stroke-dasharray="32 68" transform="rotate(-90 12 12)"/>'),
213
+ 'phase-done': tocSvg(`<circle cx="12" cy="12" r="8" fill="currentColor" stroke="none"/>${TOC_CHECK}`),
214
+ 'phase-blocked': tocSvg('<circle cx="12" cy="12" r="8"/><path d="M10 9v6"/><path d="M14 9v6"/>'),
215
+ 'phase-failed': tocSvg('<circle cx="12" cy="12" r="8"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/>'),
216
+ 'callout-risk': tocSvg('<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/>'),
217
+ 'callout-warning': tocSvg('<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/>'),
218
+ 'callout-decision': tocSvg('<rect width="16" height="16" x="4" y="4" rx="3"/>'),
219
+ 'callout-note': tocSvg('<circle cx="12" cy="12" r="8"/><path d="M12 16v-4"/><path d="M12 8h.01"/>'),
220
+ 'callout-tip': tocSvg('<path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6"/><path d="M10 22h4"/>'),
221
+ choice: tocSvg('<circle cx="12" cy="12" r="8"/><circle cx="12" cy="12" r="3" fill="currentColor" stroke="none"/>'),
222
+ form: tocSvg('<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/>'),
223
+ questions: tocSvg('<circle cx="12" cy="12" r="8"/><path d="M12 16v-4"/><path d="M12 8h.01"/>'),
224
+ approve: tocSvg(`<rect width="16" height="16" x="4" y="4" rx="4" fill="currentColor" stroke="none"/>${TOC_CHECK}`),
225
+ checklist: tocSvg('<path d="M8 6h13"/><path d="M8 12h13"/><path d="M8 18h13"/><path d="M3 6h.01"/><path d="M3 12h.01"/><path d="M3 18h.01"/>'),
226
+ workflow: tocSvg('<rect width="8" height="8" x="3" y="3" rx="2"/><path d="M7 11v4a2 2 0 0 0 2 2h4"/><rect width="8" height="8" x="13" y="13" rx="2"/>'),
227
+ };
228
+ function tocIconHtml(item) {
229
+ if (item.icon === 'heading')
230
+ return '';
231
+ if (!item.tracksProgress)
232
+ return TOC_ICONS[item.icon];
233
+ return PHASE_PROGRESS.map((status) => {
234
+ const icon = `phase-${status}`;
235
+ return `<span data-icon="${icon}">${TOC_ICONS[icon]}</span>`;
236
+ }).join('');
237
+ }
238
+ function htmlText(value) {
239
+ return value
240
+ .replace(/<[^>]+>/g, '')
241
+ .replace(/&quot;/g, '"')
242
+ .replace(/&#39;/g, "'")
243
+ .replace(/&lt;/g, '<')
244
+ .replace(/&gt;/g, '>')
245
+ .replace(/&amp;/g, '&')
246
+ .replace(/\s+/g, ' ')
247
+ .trim();
248
+ }
249
+ function stripFrontmatter(source) {
250
+ const match = /^---\r?\n[\s\S]*?\r?\n---\r?\n?/.exec(source);
251
+ return match ? source.slice(match[0].length) : source;
252
+ }
253
+ function escapeHtml(value) {
254
+ return value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
255
+ }
256
+ function escapeAttr(value) {
257
+ return escapeHtml(value).replace(/"/g, '&quot;');
258
+ }