@dooc-dev/dooc 0.0.6 → 0.0.8

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 (395) hide show
  1. package/dist/client.global.js +1 -0
  2. package/dist/code-worker.global.js +11 -11
  3. package/dist/code.global.js +75 -75
  4. package/dist/edit.global.js +234 -231
  5. package/dist/{compiler → engine/compiler}/bundle-urls.js +1 -4
  6. package/dist/{compiler → engine/compiler}/check-prose.d.ts +1 -1
  7. package/dist/{compiler → engine/compiler}/check-prose.js +1 -1
  8. package/dist/{compiler → engine/compiler}/check.js +15 -27
  9. package/dist/{compiler → engine/compiler}/code-blocks.js +3 -1
  10. package/dist/{compiler → engine/compiler}/code-languages.js +1 -2
  11. package/dist/{compiler → engine/compiler}/compile.d.ts +5 -4
  12. package/dist/{compiler → engine/compiler}/compile.js +91 -32
  13. package/dist/{compiler → engine/compiler}/config.js +1 -3
  14. package/dist/{compiler → engine/compiler}/dialect.d.ts +1 -3
  15. package/dist/{compiler → engine/compiler}/dialect.js +8 -52
  16. package/dist/{compiler → engine/compiler}/dxf.js +1 -1
  17. package/dist/{compiler → engine/compiler}/export.js +15 -8
  18. package/dist/{compiler → engine/compiler}/figures.js +26 -22
  19. package/dist/{compiler → engine/compiler}/file-cache.d.ts +1 -2
  20. package/dist/{compiler → engine/compiler}/file-cache.js +8 -15
  21. package/dist/{compiler → engine/compiler}/files.js +49 -38
  22. package/dist/{compiler → engine/compiler}/fonts.js +1 -3
  23. package/dist/{compiler → engine/compiler}/from-mdast.js +1 -1
  24. package/dist/engine/compiler/host.d.ts +10 -0
  25. package/dist/engine/compiler/host.js +16 -0
  26. package/dist/{compiler → engine/compiler}/icons.d.ts +3 -0
  27. package/dist/{compiler → engine/compiler}/icons.js +28 -10
  28. package/dist/{compiler → engine/compiler}/ignored-files.d.ts +2 -0
  29. package/dist/{compiler → engine/compiler}/ignored-files.js +12 -3
  30. package/dist/{compiler → engine/compiler}/locales.js +2 -8
  31. package/dist/{compiler → engine/compiler}/manifest.d.ts +3 -2
  32. package/dist/engine/compiler/manifest.js +46 -0
  33. package/dist/{compiler → engine/compiler}/ops.d.ts +4 -1
  34. package/dist/{compiler → engine/compiler}/ops.js +36 -21
  35. package/dist/engine/compiler/schema-file-references.d.ts +2 -0
  36. package/dist/engine/compiler/schema-file-references.js +82 -0
  37. package/dist/engine/compiler/serialize.d.ts +2 -0
  38. package/dist/engine/compiler/serialize.js +5 -0
  39. package/dist/{compiler → engine/compiler}/subformat-schema.js +1 -3
  40. package/dist/{compiler → engine/compiler}/subformats.d.ts +10 -0
  41. package/dist/{compiler → engine/compiler}/subformats.js +122 -18
  42. package/dist/{compiler → engine/compiler}/textfile-remote.js +1 -2
  43. package/dist/{compiler → engine/compiler}/textfile.js +4 -6
  44. package/dist/{compiler → engine/compiler}/theme-variants.js +1 -1
  45. package/dist/{compiler → engine/compiler}/zip.js +1 -1
  46. package/dist/{core → engine/core}/blocks.d.ts +6 -4
  47. package/dist/{core → engine/core}/content-metadata.d.ts +6 -1
  48. package/dist/{core → engine/core}/content-metadata.js +84 -18
  49. package/dist/{core → engine/core}/content-types.d.ts +4 -2
  50. package/dist/{core → engine/core}/html.d.ts +7 -0
  51. package/dist/{core → engine/core}/html.js +44 -3
  52. package/dist/{core → engine/core}/icons.d.ts +3 -0
  53. package/dist/engine/core/icons.js +20 -0
  54. package/dist/{core → engine/core}/routing.d.ts +2 -0
  55. package/dist/{core → engine/core}/routing.js +9 -0
  56. package/dist/{core → engine/core}/schema-refs.d.ts +1 -1
  57. package/dist/{core → engine/core}/schema-refs.js +3 -1
  58. package/dist/engine/core/subformat-references.d.ts +5 -0
  59. package/dist/engine/core/subformat-references.js +33 -0
  60. package/dist/{core → engine/core}/subformats.d.ts +7 -0
  61. package/dist/{core → engine/core}/subformats.js +5 -1
  62. package/dist/{core → engine/core}/taxonomy.d.ts +2 -3
  63. package/dist/{core → engine/core}/taxonomy.js +1 -5
  64. package/dist/flow.global.js +1031 -1057
  65. package/dist/frontend/application-request.d.ts +14 -0
  66. package/dist/frontend/application-request.js +36 -0
  67. package/dist/frontend/document-application.d.ts +200 -0
  68. package/dist/{viewer/serve.js → frontend/document-application.js} +1611 -1670
  69. package/dist/frontend/figure-preview.d.ts +4 -0
  70. package/dist/{viewer → frontend}/figure-preview.js +4 -4
  71. package/dist/{viewer → frontend}/file-references.d.ts +1 -1
  72. package/dist/{viewer → frontend}/file-references.js +3 -3
  73. package/dist/{viewer → frontend}/font-picker.d.ts +1 -1
  74. package/dist/{viewer → frontend}/font-settings.d.ts +1 -1
  75. package/dist/{viewer → frontend}/language-picker.js +112 -18
  76. package/dist/{viewer → frontend}/locales/eng.json +16 -2
  77. package/dist/{viewer → frontend}/locales/jpn.json +16 -2
  78. package/dist/{viewer → frontend}/locales/zho.json +16 -2
  79. package/dist/{viewer → frontend}/nav-focus.js +2 -0
  80. package/dist/{viewer → frontend}/plugin-blocks.js +2 -2
  81. package/dist/{viewer → frontend}/resize.js +14 -2
  82. package/dist/frontend/resource-download.d.ts +2 -0
  83. package/dist/frontend/resource-download.js +43 -0
  84. package/dist/{viewer → frontend}/resource-library.d.ts +9 -2
  85. package/dist/{viewer → frontend}/resource-library.js +133 -37
  86. package/dist/{core → frontend}/schema-graph-flow.d.ts +1 -1
  87. package/dist/{core → frontend}/schema-graph-flow.js +1 -1
  88. package/dist/{viewer → frontend}/search.d.ts +2 -2
  89. package/dist/{viewer → frontend}/search.js +26 -8
  90. package/dist/graph/{abnfDiagram-S7VZAUFO-ASBULSKE.js → abnfDiagram-S7VZAUFO-GAGCW2J5.js} +1 -1
  91. package/dist/graph/{architecture-WOLXFQ4H-V57EDXXY.js → architecture-WOLXFQ4H-AWAC3VBS.js} +1 -1
  92. package/dist/graph/{architectureDiagram-YGSQEFNW-GIMP347N.js → architectureDiagram-YGSQEFNW-WQ7QKSUJ.js} +1 -1
  93. package/dist/graph/{blockDiagram-APKKGZFW-RDL2T4JW.js → blockDiagram-APKKGZFW-H7ZNJMOM.js} +1 -1
  94. package/dist/graph/{bpmnIcons-APHXDYXF-TWOSQNUQ.js → bpmnIcons-APHXDYXF-EAVPNTFE.js} +1 -1
  95. package/dist/graph/{c4Diagram-KJ2TOQU5-75LIUC4F.js → c4Diagram-KJ2TOQU5-3IYS34YL.js} +1 -1
  96. package/dist/graph/{chunk-KU6GTEMS.js → chunk-3CJU2RDX.js} +1 -1
  97. package/dist/graph/{chunk-ISO77HML.js → chunk-5N2X2DXU.js} +1 -1
  98. package/dist/graph/{chunk-YCRLJT2S.js → chunk-67BPVAXC.js} +1 -1
  99. package/dist/graph/{chunk-26TUJSYJ.js → chunk-6CDZONCA.js} +1 -1
  100. package/dist/graph/{chunk-I3DMZIHV.js → chunk-7ASYMKN2.js} +1 -1
  101. package/dist/graph/{chunk-K2KLZU7M.js → chunk-7JQUFVT4.js} +2 -2
  102. package/dist/graph/{chunk-BBD5CEDC.js → chunk-7LSMJ4VU.js} +1 -1
  103. package/dist/graph/{chunk-EG5UVNOC.js → chunk-7UKJADAE.js} +1 -1
  104. package/dist/graph/{chunk-BZAMCJ6B.js → chunk-AARGNXTW.js} +1 -1
  105. package/dist/graph/{chunk-HOPPTA6H.js → chunk-BOXAA5AP.js} +2 -2
  106. package/dist/graph/{chunk-N3OHKGRZ.js → chunk-BTMPKSGF.js} +1 -1
  107. package/dist/graph/{chunk-QCJUF4YA.js → chunk-DIDARDST.js} +1 -1
  108. package/dist/graph/{chunk-R63JUMUK.js → chunk-EWYECPNJ.js} +1 -1
  109. package/dist/graph/{chunk-3YJHMOOA.js → chunk-FD7ZFC7R.js} +1 -1
  110. package/dist/graph/chunk-GWYODWCE.js +1 -0
  111. package/dist/graph/{chunk-IC23EEF6.js → chunk-HKRJKXEE.js} +1 -1
  112. package/dist/graph/{chunk-PW2RGZ3O.js → chunk-I5LEUF24.js} +1 -1
  113. package/dist/graph/{chunk-OFZLK5G4.js → chunk-ICJPOOXG.js} +1 -1
  114. package/dist/graph/{chunk-KT4VPQD5.js → chunk-IVZHB6RS.js} +2 -2
  115. package/dist/graph/{chunk-VM2H7G2R.js → chunk-JZGXHT3J.js} +1 -1
  116. package/dist/graph/{chunk-HJG2HUYJ.js → chunk-LSRL537V.js} +1 -1
  117. package/dist/graph/{chunk-C6J4A356.js → chunk-N44XPVUD.js} +1 -1
  118. package/dist/graph/{chunk-JD7ZBJD2.js → chunk-NDAMZVXQ.js} +1 -1
  119. package/dist/graph/{chunk-QEEA3KYY.js → chunk-QLS7NIYR.js} +1 -1
  120. package/dist/graph/{chunk-JRSH5GNS.js → chunk-QQIGL7OP.js} +1 -1
  121. package/dist/graph/chunk-SQE76S5B.js +1 -0
  122. package/dist/graph/{chunk-ZMCB7VP2.js → chunk-WQHTQAFY.js} +1 -1
  123. package/dist/graph/{classDiagram-v2-L25IHNXF-JL7LVDZH.js → classDiagram-v2-L25IHNXF-HNTCDTNK.js} +1 -1
  124. package/dist/graph/{cose-bilkent-JH36ORCC-PNM3EYPB.js → cose-bilkent-JH36ORCC-2GVA7XKO.js} +1 -1
  125. package/dist/graph/{cynefin-EF2NZ3EQ-PSXP3DXL.js → cynefin-EF2NZ3EQ-TCI65RAQ.js} +1 -1
  126. package/dist/graph/{cynefinDiagram-L36ESFBY-QVY54CXO.js → cynefinDiagram-L36ESFBY-OKQ5BLVF.js} +1 -1
  127. package/dist/graph/{dagre-SPEB5RXH-HPGQXBZJ.js → dagre-SPEB5RXH-KZEBD52K.js} +1 -1
  128. package/dist/graph/{diagram-3B7GL73J-DWH5WS2P.js → diagram-3B7GL73J-ESCBJM3O.js} +1 -1
  129. package/dist/graph/{diagram-DNEMPZML-TEGH2U5I.js → diagram-DNEMPZML-ZIBUSQZI.js} +1 -1
  130. package/dist/graph/{diagram-L3MUGCDN-X4MREUWR.js → diagram-L3MUGCDN-IGK62IPN.js} +1 -1
  131. package/dist/graph/{diagram-LA4NIPWU-NXT746HG.js → diagram-LA4NIPWU-2KZCOFJ5.js} +1 -1
  132. package/dist/graph/{diagram-MHCOC4E2-JGHXSAGS.js → diagram-MHCOC4E2-EYAAB236.js} +1 -1
  133. package/dist/graph/{diagram-XPFHEONP-ZHZPBLT4.js → diagram-XPFHEONP-OZ5ARGMG.js} +1 -1
  134. package/dist/graph/{ebnfDiagram-UZSYDL2S-SMF6KJ43.js → ebnfDiagram-UZSYDL2S-M3XJHARD.js} +1 -1
  135. package/dist/graph/{erDiagram-EYBAPDEH-B3JNJ357.js → erDiagram-EYBAPDEH-Y7KUBH7A.js} +1 -1
  136. package/dist/graph/{eventmodeling-K75KTNOO-WG6DDYMC.js → eventmodeling-K75KTNOO-ROLYRDEP.js} +1 -1
  137. package/dist/graph/flowDiagram-MALGAFMO-AAUEIPCR.js +1 -0
  138. package/dist/graph/{ganttDiagram-23REXITY-YXBYWFOJ.js → ganttDiagram-23REXITY-JSBTFSSJ.js} +1 -1
  139. package/dist/graph/{gitGraph-VSP46ZUC-VBFWJBBT.js → gitGraph-VSP46ZUC-ZCBCDVNF.js} +1 -1
  140. package/dist/graph/{gitGraphDiagram-STJD7YCW-4FZDCFGV.js → gitGraphDiagram-STJD7YCW-3ZA5FT3G.js} +1 -1
  141. package/dist/graph/{info-OHQRW6UA-ALVDUVYV.js → info-OHQRW6UA-JKJGOQNY.js} +1 -1
  142. package/dist/graph/infoDiagram-KBXO4MBG-6LFMPP2O.js +2 -0
  143. package/dist/graph/{ishikawaDiagram-M35NCXHK-FRZD2PWQ.js → ishikawaDiagram-M35NCXHK-YLEU44DY.js} +1 -1
  144. package/dist/graph/{journeyDiagram-OPLOXDXO-7Z66JCPR.js → journeyDiagram-OPLOXDXO-ZHJV66ZT.js} +1 -1
  145. package/dist/graph/{kanban-definition-BZKZHSQY-NN5AIKTE.js → kanban-definition-BZKZHSQY-SDU25WUM.js} +1 -1
  146. package/dist/graph/{katex-DXDNVO6V.js → katex-WSLZOTY7.js} +1 -1
  147. package/dist/graph/{mindmap-definition-I2QAS2VK-HDPCABN2.js → mindmap-definition-I2QAS2VK-XQNBCYHN.js} +1 -1
  148. package/dist/graph/{packet-JDAUHWVQ-5MQIBWAH.js → packet-JDAUHWVQ-Y3H77ERD.js} +1 -1
  149. package/dist/graph/{pegDiagram-FD4XPPHP-H2BFNCKT.js → pegDiagram-FD4XPPHP-YO4VWH6V.js} +1 -1
  150. package/dist/graph/{pie-XZMESJXO-T5VRKHVT.js → pie-XZMESJXO-PRER4XL5.js} +1 -1
  151. package/dist/graph/{pieDiagram-J4AKIIQI-O3NJSVD3.js → pieDiagram-J4AKIIQI-TJ5WOOSV.js} +1 -1
  152. package/dist/graph/{quadrantDiagram-XTYBLID2-TMTZJI3P.js → quadrantDiagram-XTYBLID2-G6MSSZLW.js} +1 -1
  153. package/dist/graph/{radar-ABXABTNO-C6FXIBYW.js → radar-ABXABTNO-M6MV34GM.js} +1 -1
  154. package/dist/graph/{railroad-I3PHUGI6-ZSO5JXB3.js → railroad-I3PHUGI6-YIWPGN6Q.js} +1 -1
  155. package/dist/graph/{railroad-abnf-LNEFI6M7-CI4GQRHB.js → railroad-abnf-LNEFI6M7-7JHLZ2R7.js} +1 -1
  156. package/dist/graph/{railroad-ebnf-DWYD2UWJ-MUENNCGK.js → railroad-ebnf-DWYD2UWJ-V55BXEWY.js} +1 -1
  157. package/dist/graph/{railroad-peg-JR7BVNR7-N3X5GGIX.js → railroad-peg-JR7BVNR7-XCGKDRMK.js} +1 -1
  158. package/dist/graph/{railroadDiagram-MRQ6NCDL-JHWS23UO.js → railroadDiagram-MRQ6NCDL-RACSFXC4.js} +1 -1
  159. package/dist/graph/{requirementDiagram-Y7LWUY3S-7DVLPO4B.js → requirementDiagram-Y7LWUY3S-4LQIQWHQ.js} +1 -1
  160. package/dist/graph/{sankeyDiagram-WGJFYUXA-Z5L4R5TR.js → sankeyDiagram-WGJFYUXA-K3RXG5FB.js} +1 -1
  161. package/dist/graph/schema-graph-global.js +17 -17
  162. package/dist/graph/{sequenceDiagram-5NDRBG5M-RCTU25NT.js → sequenceDiagram-5NDRBG5M-Y6RBHRS3.js} +1 -1
  163. package/dist/graph/{sizeCapture-INFHLROL-RROY32P5.js → sizeCapture-INFHLROL-TJW3VUGH.js} +1 -1
  164. package/dist/graph/{stateDiagram-v2-FJ4FJNEA-BXUSPWDK.js → stateDiagram-v2-FJ4FJNEA-4M5WZORG.js} +1 -1
  165. package/dist/graph/swimlanes-UMQ2AFYF-O4W6U4RO.js +1 -0
  166. package/dist/graph/swimlanesDiagram-OMPLPG4O-HZAKM45N.js +8 -0
  167. package/dist/graph/{timeline-definition-SEUHKTQE-ZQSMIVAS.js → timeline-definition-SEUHKTQE-IHISQ4Q7.js} +1 -1
  168. package/dist/graph/{treeView-D4JQ5SDB-42S7U73N.js → treeView-D4JQ5SDB-EVGY4VYS.js} +1 -1
  169. package/dist/graph/{treemap-SAJKECNS-RUBYQ7XF.js → treemap-SAJKECNS-LN3SMFRX.js} +1 -1
  170. package/dist/graph/{usecaseDiagram-AFA6YXN4-57RDRYXF.js → usecaseDiagram-AFA6YXN4-B645A3J6.js} +1 -1
  171. package/dist/graph/{vennDiagram-NNMJR3RB-5C3LVAV6.js → vennDiagram-NNMJR3RB-K3HWMON6.js} +1 -1
  172. package/dist/graph/{wardley-7MLQ67FV-NV5HXTTC.js → wardley-7MLQ67FV-RRWOELC6.js} +1 -1
  173. package/dist/graph/{wardleyDiagram-S7YFUSEH-6D5BKXHM.js → wardleyDiagram-S7YFUSEH-DMMWKJEK.js} +1 -1
  174. package/dist/graph/{xychartDiagram-GGNKY7IX-6ET3ZM67.js → xychartDiagram-GGNKY7IX-K6MUQVXR.js} +1 -1
  175. package/dist/install.sh +68 -0
  176. package/dist/plugins.global.js +62 -62
  177. package/dist/{viewer → server}/assets.d.ts +2 -0
  178. package/dist/server/assets.js +7 -0
  179. package/dist/{viewer → server}/build-plugins.js +4 -4
  180. package/dist/{viewer → server}/build.d.ts +2 -1
  181. package/dist/{viewer → server}/build.js +31 -15
  182. package/dist/{cli.js → server/cli.js} +223 -56
  183. package/dist/server/editor-tools.d.ts +1 -0
  184. package/dist/server/editor-tools.js +1 -0
  185. package/dist/{viewer → server}/extension-pack.js +2 -2
  186. package/dist/{viewer → server}/extensions.d.ts +1 -1
  187. package/dist/{viewer → server}/extensions.js +3 -3
  188. package/dist/server/git-diff.d.ts +10 -0
  189. package/dist/{viewer → server}/git-diff.js +45 -10
  190. package/dist/server/git-origin.d.ts +4 -0
  191. package/dist/server/git-origin.js +103 -0
  192. package/dist/server/git.d.ts +9 -0
  193. package/dist/{viewer → server}/git.js +50 -6
  194. package/dist/server/history.d.ts +14 -0
  195. package/dist/server/history.js +205 -0
  196. package/dist/{viewer → server}/hmr.d.ts +0 -22
  197. package/dist/server/hmr.js +168 -0
  198. package/dist/server/index.d.ts +17 -0
  199. package/dist/{index.js → server/index.js} +16 -16
  200. package/dist/{viewer → server}/ja-lint.d.ts +1 -1
  201. package/dist/{viewer → server}/languages.d.ts +1 -1
  202. package/dist/{viewer → server}/languages.js +3 -3
  203. package/dist/{mcp.d.ts → server/mcp.d.ts} +2 -2
  204. package/dist/{mcp.js → server/mcp.js} +60 -21
  205. package/dist/{viewer → server}/plugin-config.d.ts +2 -2
  206. package/dist/{viewer → server}/plugin-config.js +2 -2
  207. package/dist/{plugins → server/plugins}/local-storage.d.ts +1 -1
  208. package/dist/{plugins → server/plugins}/local-storage.js +1 -1
  209. package/dist/{plugins → server/plugins}/runtime.d.ts +4 -4
  210. package/dist/{plugins → server/plugins}/runtime.js +4 -4
  211. package/dist/{viewer → server}/plugins.d.ts +3 -3
  212. package/dist/{viewer → server}/plugins.js +14 -13
  213. package/dist/server/resource-library.d.ts +1 -0
  214. package/dist/server/resource-library.js +1 -0
  215. package/dist/server/self.d.ts +5 -0
  216. package/dist/server/self.js +98 -0
  217. package/dist/server/serve.d.ts +61 -0
  218. package/dist/server/serve.js +503 -0
  219. package/dist/server/static-client.d.ts +4 -0
  220. package/dist/server/static-client.js +117 -0
  221. package/dist/server/workspace-server.d.ts +16 -0
  222. package/dist/server/workspace-server.js +266 -0
  223. package/dist/{viewer → server}/workspace.d.ts +6 -1
  224. package/dist/{viewer → server}/workspace.js +46 -0
  225. package/dist/subformats.global.js +92 -6
  226. package/dist/ui.global.js +85 -72
  227. package/dist/workspace/client.d.ts +13 -0
  228. package/dist/workspace/client.js +114 -0
  229. package/dist/{viewer → workspace}/code-file.d.ts +1 -1
  230. package/dist/{viewer → workspace}/code-file.js +7 -7
  231. package/dist/workspace/connection.d.ts +27 -0
  232. package/dist/workspace/connection.js +38 -0
  233. package/dist/{viewer → workspace}/editor-tools.d.ts +7 -1
  234. package/dist/{viewer → workspace}/editor-tools.js +12 -9
  235. package/dist/{viewer → workspace}/git-types.d.ts +7 -0
  236. package/dist/workspace/github.d.ts +4 -0
  237. package/dist/workspace/github.js +99 -0
  238. package/dist/workspace/history.d.ts +46 -0
  239. package/dist/workspace/history.js +86 -0
  240. package/dist/workspace/protocol.d.ts +38 -0
  241. package/dist/workspace/protocol.js +20 -0
  242. package/dist/workspace/resource-download.d.ts +1 -0
  243. package/dist/workspace/resource-download.js +8 -0
  244. package/dist/workspace/server.d.ts +9 -0
  245. package/dist/workspace/server.js +48 -0
  246. package/dist/{viewer → workspace}/site-icon.js +9 -10
  247. package/dist/{viewer → workspace}/site-title.js +6 -7
  248. package/dist/{viewer → workspace}/textfile.d.ts +1 -1
  249. package/dist/{viewer → workspace}/textfile.js +5 -5
  250. package/dist/workspace-worker.global.js +2859 -0
  251. package/package.json +43 -21
  252. package/dist/compiler/manifest.js +0 -37
  253. package/dist/compiler/serialize.d.ts +0 -3
  254. package/dist/compiler/serialize.js +0 -16
  255. package/dist/core/icons.js +0 -5
  256. package/dist/graph/chunk-3RNHDNP5.js +0 -1
  257. package/dist/graph/chunk-5UUEAHTN.js +0 -1
  258. package/dist/graph/chunk-6T55RVVR.js +0 -1
  259. package/dist/graph/elk-XV6XMXQE-AZ4HLCWI.js +0 -27
  260. package/dist/graph/flowDiagram-MALGAFMO-2R7EYAQI.js +0 -1
  261. package/dist/graph/infoDiagram-KBXO4MBG-7EHX2GQG.js +0 -2
  262. package/dist/graph/swimlanes-UMQ2AFYF-LDD74Q2S.js +0 -1
  263. package/dist/graph/swimlanesDiagram-OMPLPG4O-ZYULLJSU.js +0 -8
  264. package/dist/index.d.ts +0 -17
  265. package/dist/viewer/assets.js +0 -3
  266. package/dist/viewer/figure-preview.d.ts +0 -4
  267. package/dist/viewer/git-diff.d.ts +0 -6
  268. package/dist/viewer/git.d.ts +0 -5
  269. package/dist/viewer/hmr.js +0 -341
  270. package/dist/viewer/serve.d.ts +0 -216
  271. /package/dist/{compiler → engine/compiler}/asset-references.d.ts +0 -0
  272. /package/dist/{compiler → engine/compiler}/asset-references.js +0 -0
  273. /package/dist/{compiler → engine/compiler}/bundle-urls.d.ts +0 -0
  274. /package/dist/{compiler → engine/compiler}/check-types.d.ts +0 -0
  275. /package/dist/{compiler → engine/compiler}/check-types.js +0 -0
  276. /package/dist/{compiler → engine/compiler}/check.d.ts +0 -0
  277. /package/dist/{compiler → engine/compiler}/code-blocks.d.ts +0 -0
  278. /package/dist/{compiler → engine/compiler}/code-languages.d.ts +0 -0
  279. /package/dist/{compiler → engine/compiler}/config.d.ts +0 -0
  280. /package/dist/{compiler → engine/compiler}/drawio.d.ts +0 -0
  281. /package/dist/{compiler → engine/compiler}/drawio.js +0 -0
  282. /package/dist/{compiler → engine/compiler}/dxf.d.ts +0 -0
  283. /package/dist/{compiler → engine/compiler}/export.d.ts +0 -0
  284. /package/dist/{compiler → engine/compiler}/figures.d.ts +0 -0
  285. /package/dist/{compiler → engine/compiler}/files.d.ts +0 -0
  286. /package/dist/{compiler → engine/compiler}/fonts.d.ts +0 -0
  287. /package/dist/{compiler → engine/compiler}/format.d.ts +0 -0
  288. /package/dist/{compiler → engine/compiler}/format.js +0 -0
  289. /package/dist/{compiler → engine/compiler}/from-mdast.d.ts +0 -0
  290. /package/dist/{compiler → engine/compiler}/language-codes.d.ts +0 -0
  291. /package/dist/{compiler → engine/compiler}/language-codes.js +0 -0
  292. /package/dist/{compiler → engine/compiler}/locales.d.ts +0 -0
  293. /package/dist/{compiler → engine/compiler}/public-file.d.ts +0 -0
  294. /package/dist/{compiler → engine/compiler}/public-file.js +0 -0
  295. /package/dist/{compiler → engine/compiler}/subformat-schema.d.ts +0 -0
  296. /package/dist/{compiler → engine/compiler}/terms.d.ts +0 -0
  297. /package/dist/{compiler → engine/compiler}/terms.js +0 -0
  298. /package/dist/{compiler → engine/compiler}/textfile-remote.d.ts +0 -0
  299. /package/dist/{compiler → engine/compiler}/textfile.d.ts +0 -0
  300. /package/dist/{compiler → engine/compiler}/theme-variants.d.ts +0 -0
  301. /package/dist/{compiler → engine/compiler}/zip.d.ts +0 -0
  302. /package/dist/{core → engine/core}/blocks.js +0 -0
  303. /package/dist/{core → engine/core}/code-file.d.ts +0 -0
  304. /package/dist/{core → engine/core}/code-file.js +0 -0
  305. /package/dist/{core → engine/core}/code-grammars.d.ts +0 -0
  306. /package/dist/{core → engine/core}/code-grammars.js +0 -0
  307. /package/dist/{core → engine/core}/content-types.js +0 -0
  308. /package/dist/{core → engine/core}/escape-html.d.ts +0 -0
  309. /package/dist/{core → engine/core}/escape-html.js +0 -0
  310. /package/dist/{core → engine/core}/extension-package.d.ts +0 -0
  311. /package/dist/{core → engine/core}/extension-package.js +0 -0
  312. /package/dist/{core → engine/core}/figure-frame.d.ts +0 -0
  313. /package/dist/{core → engine/core}/figure-frame.js +0 -0
  314. /package/dist/{core → engine/core}/file-embed.d.ts +0 -0
  315. /package/dist/{core → engine/core}/file-embed.js +0 -0
  316. /package/dist/{core → engine/core}/files.d.ts +0 -0
  317. /package/dist/{core → engine/core}/files.js +0 -0
  318. /package/dist/{core → engine/core}/graph-common.d.ts +0 -0
  319. /package/dist/{core → engine/core}/graph-common.js +0 -0
  320. /package/dist/{core → engine/core}/graph.d.ts +0 -0
  321. /package/dist/{core → engine/core}/graph.js +0 -0
  322. /package/dist/{core → engine/core}/inline.d.ts +0 -0
  323. /package/dist/{core → engine/core}/inline.js +0 -0
  324. /package/dist/{core → engine/core}/json-tools.d.ts +0 -0
  325. /package/dist/{core → engine/core}/json-tools.js +0 -0
  326. /package/dist/{core → engine/core}/language.d.ts +0 -0
  327. /package/dist/{core → engine/core}/language.js +0 -0
  328. /package/dist/{core → engine/core}/languages/ja.d.ts +0 -0
  329. /package/dist/{core → engine/core}/languages/ja.js +0 -0
  330. /package/dist/{core → engine/core}/markdown.d.ts +0 -0
  331. /package/dist/{core → engine/core}/markdown.js +0 -0
  332. /package/dist/{core → engine/core}/previewers.d.ts +0 -0
  333. /package/dist/{core → engine/core}/previewers.js +0 -0
  334. /package/dist/{core → engine/core}/schema-comments.d.ts +0 -0
  335. /package/dist/{core → engine/core}/schema-comments.js +0 -0
  336. /package/dist/{core → engine/core}/schema-fields.d.ts +0 -0
  337. /package/dist/{core → engine/core}/schema-fields.js +0 -0
  338. /package/dist/{core → engine/core}/schema-graph.d.ts +0 -0
  339. /package/dist/{core → engine/core}/schema-graph.js +0 -0
  340. /package/dist/{core → engine/core}/subformat-record.d.ts +0 -0
  341. /package/dist/{core → engine/core}/subformat-record.js +0 -0
  342. /package/dist/{core → engine/core}/term-reference.d.ts +0 -0
  343. /package/dist/{core → engine/core}/term-reference.js +0 -0
  344. /package/dist/{core → engine/core}/textfile.d.ts +0 -0
  345. /package/dist/{core → engine/core}/textfile.js +0 -0
  346. /package/dist/{core → engine/core}/theme-variants.d.ts +0 -0
  347. /package/dist/{core → engine/core}/theme-variants.js +0 -0
  348. /package/dist/{core → engine/core}/workspace.d.ts +0 -0
  349. /package/dist/{core → engine/core}/workspace.js +0 -0
  350. /package/dist/{viewer → frontend}/bundle-network.d.ts +0 -0
  351. /package/dist/{viewer → frontend}/bundle-network.js +0 -0
  352. /package/dist/{core → frontend}/flow-base-css.generated.d.ts +0 -0
  353. /package/dist/{core → frontend}/flow-base-css.generated.js +0 -0
  354. /package/dist/{core → frontend}/flow-css.d.ts +0 -0
  355. /package/dist/{core → frontend}/flow-css.js +0 -0
  356. /package/dist/{viewer → frontend}/font-picker.js +0 -0
  357. /package/dist/{viewer → frontend}/font-settings.js +0 -0
  358. /package/dist/{viewer → frontend}/i18n.d.ts +0 -0
  359. /package/dist/{viewer → frontend}/i18n.js +0 -0
  360. /package/dist/{viewer → frontend}/language-picker.d.ts +0 -0
  361. /package/dist/{viewer → frontend}/lazy-preview.d.ts +0 -0
  362. /package/dist/{viewer → frontend}/lazy-preview.js +0 -0
  363. /package/dist/{viewer → frontend}/nav-focus.d.ts +0 -0
  364. /package/dist/{viewer → frontend}/nav-update.d.ts +0 -0
  365. /package/dist/{viewer → frontend}/nav-update.js +0 -0
  366. /package/dist/{viewer → frontend}/plugin-blocks.d.ts +0 -0
  367. /package/dist/{viewer → frontend}/plugin-style.d.ts +0 -0
  368. /package/dist/{viewer → frontend}/plugin-style.js +0 -0
  369. /package/dist/{viewer → frontend}/plugin-view.d.ts +0 -0
  370. /package/dist/{viewer → frontend}/plugin-view.js +0 -0
  371. /package/dist/{viewer → frontend}/resize.d.ts +0 -0
  372. /package/dist/{core → frontend}/schema-graph-mount.d.ts +0 -0
  373. /package/dist/{core → frontend}/schema-graph-mount.js +0 -0
  374. /package/dist/{core → frontend}/table-ui.d.ts +0 -0
  375. /package/dist/{core → frontend}/table-ui.js +0 -0
  376. /package/dist/{core → frontend}/terms-ui.d.ts +0 -0
  377. /package/dist/{core → frontend}/terms-ui.js +0 -0
  378. /package/dist/{viewer → frontend}/theme-picker.d.ts +0 -0
  379. /package/dist/{viewer → frontend}/theme-picker.js +0 -0
  380. /package/dist/{core → frontend}/toc-ui.d.ts +0 -0
  381. /package/dist/{core → frontend}/toc-ui.js +0 -0
  382. /package/dist/{core → frontend}/video-ui.d.ts +0 -0
  383. /package/dist/{core → frontend}/video-ui.js +0 -0
  384. /package/dist/graph/{chunk-GYT4IYBZ.js → chunk-RJFVWYCA.js} +0 -0
  385. /package/dist/{viewer → server}/build-plugins.d.ts +0 -0
  386. /package/dist/{cli.d.ts → server/cli.d.ts} +0 -0
  387. /package/dist/{viewer → server}/extension-pack.d.ts +0 -0
  388. /package/dist/{viewer → server}/fonts/LICENSE.txt +0 -0
  389. /package/dist/{viewer → server}/fonts/udev-gothic-regular.woff2 +0 -0
  390. /package/dist/{viewer → server}/fonts.d.ts +0 -0
  391. /package/dist/{viewer → server}/fonts.js +0 -0
  392. /package/dist/{viewer → server}/ja-lint.js +0 -0
  393. /package/dist/{viewer → workspace}/git-types.js +0 -0
  394. /package/dist/{viewer → workspace}/site-icon.d.ts +0 -0
  395. /package/dist/{viewer → workspace}/site-title.d.ts +0 -0
@@ -1,2 +1,4 @@
1
1
  export declare const prebuilt: boolean;
2
+ export declare const standalone = false;
3
+ export declare const readInstaller: () => Buffer;
2
4
  export declare const readViewerAsset: (name: string) => Buffer;
@@ -0,0 +1,7 @@
1
+ import { readFileSync } from "node:fs";
2
+ export const prebuilt = import.meta.url.endsWith(".js");
3
+ export const standalone = false;
4
+ export const readInstaller = () => readFileSync(new URL(prebuilt ? "../install.sh" : "../../../scripts/release/install.sh", import.meta.url));
5
+ export const readViewerAsset = (name) => readFileSync(new URL(name.startsWith("fonts/")
6
+ ? `./${name}`
7
+ : `${prebuilt ? ".." : "../../../dist"}/${name}`, import.meta.url));
@@ -1,9 +1,9 @@
1
- import { createLocalPluginStorage } from "../plugins/local-storage.js";
2
- import { createPluginRuntime } from "../plugins/runtime.js";
1
+ import { PLUGIN_BLOCK_CSS } from "../frontend/plugin-style.js";
2
+ import { pluginViewHtml } from "../frontend/plugin-view.js";
3
3
  import { createExtensionManager } from "./extensions.js";
4
4
  import { loadViewerPlugins } from "./plugin-config.js";
5
- import { PLUGIN_BLOCK_CSS } from "./plugin-style.js";
6
- import { pluginViewHtml } from "./plugin-view.js";
5
+ import { createLocalPluginStorage } from "./plugins/local-storage.js";
6
+ import { createPluginRuntime } from "./plugins/runtime.js";
7
7
  /** Only previously enabled packages execute; personal credentials never enter the artifact. */
8
8
  export const loadBuildPlugins = async (root, module) => {
9
9
  const initial = await loadViewerPlugins(module);
@@ -1,5 +1,5 @@
1
- import { type PreviewSettings } from "../core/previewers.js";
2
1
  import type { PluginTransport } from "../plugins/transport.js";
2
+ import { type PreviewSettings } from "../engine/core/previewers.js";
3
3
  export interface BuildOptions {
4
4
  format: "html" | "zip";
5
5
  urlPreview?: "embed" | "network";
@@ -7,6 +7,7 @@ export interface BuildOptions {
7
7
  auth?: "external";
8
8
  /** Public directory URL corresponding to the manifest directory, embedded in HTML. */
9
9
  sourceUrl?: string;
10
+ easyDownload?: boolean;
10
11
  /** Trusted server module used for static snapshots, never serialized into HTML. */
11
12
  pluginModule?: string;
12
13
  /** Build-time authenticated reads; live HTML receives its transport at runtime. */
@@ -1,15 +1,17 @@
1
- import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
1
+ import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
2
2
  import { tmpdir } from "node:os";
3
3
  import { dirname, join } from "node:path";
4
- import { embedBundleUrls } from "../compiler/bundle-urls.js";
5
- import { compileSite } from "../compiler/compile.js";
6
- import { exportEntries } from "../compiler/export.js";
7
- import { loadProjectFonts } from "../compiler/fonts.js";
8
- import { textfilePath } from "../compiler/textfile.js";
9
- import { zip } from "../compiler/zip.js";
10
- import { walkBlocks } from "../core/blocks.js";
11
- import { selectCodeGrammars } from "../core/code-grammars.js";
12
- import { parsePreviewSettings } from "../core/previewers.js";
4
+ import { embedBundleUrls } from "../engine/compiler/bundle-urls.js";
5
+ import { compileSite } from "../engine/compiler/compile.js";
6
+ import { exportEntries } from "../engine/compiler/export.js";
7
+ import { filesSnapshot } from "../engine/compiler/files.js";
8
+ import { loadProjectFonts } from "../engine/compiler/fonts.js";
9
+ import { manifestFile, projectRoot } from "../engine/compiler/manifest.js";
10
+ import { textfilePath } from "../engine/compiler/textfile.js";
11
+ import { zip } from "../engine/compiler/zip.js";
12
+ import { walkBlocks } from "../engine/core/blocks.js";
13
+ import { selectCodeGrammars } from "../engine/core/code-grammars.js";
14
+ import { parsePreviewSettings } from "../engine/core/previewers.js";
13
15
  import { loadBuildPlugins, pluginSnapshot } from "./build-plugins.js";
14
16
  import { loadSiteLanguages } from "./languages.js";
15
17
  import { loadViewerPlugins } from "./plugin-config.js";
@@ -17,6 +19,10 @@ import { sourceFileBase } from "./workspace.js";
17
19
  /** Build one artifact from the manifest and its managed content. */
18
20
  export const buildBundle = async (root, options) => {
19
21
  const { format } = options;
22
+ if (options.easyDownload !== undefined && typeof options.easyDownload !== "boolean")
23
+ throw new Error("Easy download must be a boolean");
24
+ if (options.easyDownload !== undefined && format !== "html")
25
+ throw new Error("Easy download applies to HTML builds only");
20
26
  if (options.sourceUrl !== undefined && format !== "html")
21
27
  throw new Error("Source URL applies to HTML builds only");
22
28
  const sourceBase = format === "html" ? sourceFileBase(root, options.sourceUrl) : undefined;
@@ -46,6 +52,9 @@ export const buildBundle = async (root, options) => {
46
52
  return compiled;
47
53
  };
48
54
  let entries = exportEntries(root);
55
+ const downloadSources = options.easyDownload
56
+ ? new Map(entries.map(({ name, data }) => [name, data]))
57
+ : undefined;
49
58
  let compiled = validate(root);
50
59
  if (urlPreview === "embed") {
51
60
  const plugins = format === "html" && !options.pluginTransport
@@ -65,7 +74,7 @@ export const buildBundle = async (root, options) => {
65
74
  mkdirSync(dirname(path), { recursive: true });
66
75
  writeFileSync(path, entry.data);
67
76
  }
68
- compiled = validate(temp);
77
+ compiled = validate(projectRoot(join(temp, manifestFile(root))));
69
78
  }
70
79
  finally {
71
80
  rmSync(temp, { recursive: true, force: true });
@@ -75,21 +84,28 @@ export const buildBundle = async (root, options) => {
75
84
  return { data: zip(entries), docs: compiled.docs.length };
76
85
  const config = await loadSiteLanguages(root);
77
86
  const { bundleClient, publishHtml, siteFrom } = await import("./serve.js");
87
+ const linkable = new Set(filesSnapshot(root).files.map((file) => file.path));
78
88
  const site = {
79
89
  ...siteFrom(compiled, config.languages, config),
80
90
  sourceBase,
81
91
  fonts: loadProjectFonts(root),
92
+ readLinkedFile: (file) => linkable.has(file) ? readFileSync(textfilePath(root, file)) : undefined,
82
93
  };
94
+ if (options.easyDownload)
95
+ site.ctx.downloads = new Map(entries.map(({ name, data }) => [
96
+ name,
97
+ `data:application/octet-stream;base64,${(downloadSources?.get(name) ?? data).toString("base64")}`,
98
+ ]));
83
99
  const blocks = walkBlocks(site.entries.flatMap((entry) => entry.blocks));
84
100
  const code = blocks.flatMap((block) => block.type === "code" && block.lang !== "mermaid" && !block.unavailable ? [block] : []);
85
101
  site.codeGrammars = selectCodeGrammars(site.codeGrammars ?? [], code.map((block) => block.lang ?? "text"));
86
102
  const diagrams = blocks.some((block) => block.type === "schemaGraph" ||
87
103
  (block.type === "code" && block.lang === "mermaid" && !block.unavailable));
88
104
  return {
89
- data: publishHtml(site, diagrams ? await bundleClient("core/schema-graph-global.tsx") : "", undefined, code.length ? await bundleClient("viewer/code-highlight.ts") : "", options.mode === "live" ? "live" : urlPreview === "embed" ? "static" : "network", options.mode === "live" && blocks.some((block) => block.type === "external")
90
- ? await bundleClient("viewer/published-plugins.ts")
91
- : "", compiled.docs.some((doc) => doc.subformat)
92
- ? await bundleClient("viewer/published-subformats.ts")
105
+ data: publishHtml(site, diagrams ? await bundleClient("schema-graph-global.tsx") : "", undefined, code.length ? await bundleClient("code-highlight.ts") : "", options.mode === "live" ? "live" : urlPreview === "embed" ? "static" : "network", options.mode === "live" && blocks.some((block) => block.type === "external")
106
+ ? await bundleClient("published-plugins.ts")
107
+ : "", compiled.docs.some((doc) => doc.subformat || doc.library)
108
+ ? await bundleClient("published-subformats.ts")
93
109
  : ""),
94
110
  docs: compiled.docs.length,
95
111
  };
@@ -3,40 +3,56 @@
3
3
  import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
4
4
  import { basename, dirname, join, resolve } from "node:path";
5
5
  import { parseArgs } from "node:util";
6
- import { projectRoot } from "./compiler/manifest.js";
7
- import { prebuilt } from "./viewer/assets.js";
6
+ import { projectRoot } from "../engine/compiler/manifest.js";
7
+ import { isManifestFile, MANIFEST_FILE, serializeManifest, } from "../engine/core/content-metadata.js";
8
+ import { prebuilt } from "./assets.js";
8
9
  process.env.NODE_ENV = prebuilt ? "production" : "development";
9
10
  const USAGE = `usage: dooc <command>
10
11
 
11
12
  commands:
12
- ├─ edit [dooc.yaml] [port] open dooc in edit mode
13
- │ └─ --viewer-plugins <module> inject an external viewer plugin module
14
- ├─ view [dooc.yaml] [port] open dooc in view mode
15
- │ └─ --viewer-plugins <module> inject an external viewer plugin module
16
- ├─ build build the selected bundle (default <project>/dist)
17
- │ ├─ html [dooc.yaml] [out-dir] build bundle.html
18
- │ │ ├─ --mode static|live HTML snapshot or runtime plugin API
19
- │ │ ├─ --auth external host supplies live HTML authentication and transport
20
- │ │ └─ --source-url <url> source directory URL for card copy links
21
- │ ├─ zip [dooc.yaml] [out-dir] build bundle.zip
22
- │ ├─ --url_preview embed|network URL handling for either format (default: embed)
23
- │ └─ --viewer-plugins <module> inject an external build plugin module
24
- ├─ export [dooc.yaml] [out-dir] collect source dependencies into bundle.zip
25
- ├─ check [dooc.yaml] [options] JSON consistency report (check --help for options)
26
- ├─ plugin manage local plugins
27
- │ ├─ pack <built-dir> [zip] package bundled JS and assets as a plugin ZIP
28
- │ ├─ add <zip> [dooc.yaml] [port] install a local plugin and print login links
29
- │ └─ login <id> [dooc.yaml] [port] open a local login flow for an installed plugin
30
- ├─ font manage project fonts (.dooc/fonts/)
31
- │ ├─ add <file> [dooc.yaml] register a font in the project
32
- │ ├─ list [dooc.yaml] list registered project fonts
33
- │ └─ remove <name> [dooc.yaml] remove a registered project font
34
- ├─ mcp [dooc.yaml] stdio MCP server (all read / write operations)
35
- │ └─ --git-origin <module> inject gitOrigin from an external viewer plugin module
36
- └─ help, --help, -h show this help
13
+ init [path] create a manifest in a directory or at a manifest path
14
+ edit [dooc.yaml] [port] open dooc in edit mode
15
+ --viewer-plugins <module> inject an external viewer plugin module
16
+ --shared <branch> several people edit; snapshots are recorded on <branch>
17
+ --tls-cert <pem> --tls-key <pem> serve over HTTPS (or DOOC_TLS_CERT / DOOC_TLS_KEY)
18
+ server [dooc.yaml] [port] serve the workspace socket only (default: 5179)
19
+ --client-origin <origin> permit the static client origin (default: http://localhost:5180)
20
+ client [port] serve the static client only (default: 5180)
21
+ --server <ws-url> connect to an optional workspace server
22
+ view [dooc.yaml] [port] open dooc in view mode
23
+ --viewer-plugins <module> inject an external viewer plugin module
24
+ --tls-cert <pem> --tls-key <pem> serve over HTTPS (or DOOC_TLS_CERT / DOOC_TLS_KEY)
25
+ build build the selected bundle (default <project>/dist)
26
+ html [dooc.yaml] [out-dir] build bundle.html
27
+ --mode static|live HTML snapshot or runtime plugin API
28
+ --auth external host supplies live HTML authentication and transport
29
+ --source-url <url> source directory URL for card copy links
30
+ --easy-download enable resource downloads in HTML
31
+ client [out-dir] build the standalone static editor
32
+ --server <ws-url> preconfigure an optional workspace socket
33
+ zip [dooc.yaml] [out-dir] build bundle.zip
34
+ --url_preview embed|network URL handling for either format (default: embed)
35
+ --viewer-plugins <module> inject an external build plugin module
36
+ export [dooc.yaml] [out-dir] collect source dependencies into bundle.zip
37
+ check [dooc.yaml] [options] JSON consistency report (check --help for options)
38
+ plugin manage local plugins
39
+ pack <built-dir> [zip] package bundled JS and assets as a plugin ZIP
40
+ add <zip> [dooc.yaml] [port] install a local plugin and print login links
41
+ login <id> [dooc.yaml] [port] open a local login flow for an installed plugin
42
+ font manage project fonts (.dooc/fonts/)
43
+ add <file> [dooc.yaml] register a font in the project
44
+ list [dooc.yaml] list registered project fonts
45
+ remove <name> [dooc.yaml] remove a registered project font
46
+ self manage this dooc installation
47
+ update update dooc to the latest release
48
+ docs download GitHub docs and open the local viewer
49
+ mcp [dooc.yaml] stdio MCP server (all read / write operations)
50
+ --git-origin <module> inject gitOrigin from an external viewer plugin module
51
+ help, --help, -h show this help
37
52
 
38
- Details: dooc <command> --help (build, check, plugin, font, mcp).
39
- Default manifest: ./dooc.yaml. Paths and .dooc/ are relative to its directory.`;
53
+ Details: dooc <command> --help (init, build, check, plugin, font, self, mcp).
54
+ Default manifest: ./dooc.yaml. Named manifests (<name>.dooc.yaml) are also accepted.
55
+ Paths and .dooc/ are relative to the selected manifest's directory.`;
40
56
  const fail = (message) => {
41
57
  console.error(message);
42
58
  process.exit(1);
@@ -47,6 +63,86 @@ const writeOut = (out, data) => {
47
63
  };
48
64
  const [command, ...args] = process.argv.slice(2);
49
65
  switch (command) {
66
+ case "self": {
67
+ try {
68
+ const { positionals, values } = parseArgs({
69
+ args,
70
+ allowPositionals: true,
71
+ options: { help: { type: "boolean", short: "h" } },
72
+ });
73
+ if (values.help) {
74
+ console.log(`usage: dooc self <command>
75
+
76
+ commands:
77
+ update update a standalone executable or global npm installation to the latest release
78
+ docs download documentation from GitHub and open the local read-only viewer
79
+
80
+ Homebrew and mise installations must be updated through their package manager.
81
+ Documentation requires a network connection. Keep this command running while using the viewer.
82
+
83
+ options:
84
+ --help, -h show this help`);
85
+ break;
86
+ }
87
+ if (positionals.length !== 1 || !["update", "docs"].includes(positionals[0] ?? ""))
88
+ throw new Error("Expected: dooc self update or dooc self docs");
89
+ const { prepareSelfDocs, selfUpdate } = await import("./self.js");
90
+ if (positionals[0] === "update") {
91
+ selfUpdate();
92
+ }
93
+ else {
94
+ console.log("Downloading documentation from GitHub...");
95
+ const { root, dispose } = await prepareSelfDocs();
96
+ process.once("exit", dispose);
97
+ process.once("SIGINT", () => process.exit(130));
98
+ process.once("SIGTERM", () => process.exit(143));
99
+ process.env.DOCS_ROOT = root;
100
+ process.env.DOCS_HMR = "0";
101
+ const { startServer } = await import("./serve.js");
102
+ await startServer("preview", 5179, undefined, { open: true });
103
+ }
104
+ }
105
+ catch (error) {
106
+ fail(error instanceof Error ? error.message : String(error));
107
+ }
108
+ break;
109
+ }
110
+ case "init": {
111
+ let file = resolve(MANIFEST_FILE);
112
+ try {
113
+ const { positionals, values } = parseArgs({
114
+ args,
115
+ allowPositionals: true,
116
+ options: { help: { type: "boolean", short: "h" } },
117
+ });
118
+ if (values.help) {
119
+ console.log(`usage: dooc init [path]
120
+
121
+ Create dooc.yaml in the selected directory (default: current directory), or specify
122
+ a dooc.yaml / <name>.dooc.yaml file path. Missing directories are created.
123
+ Existing files are never overwritten. Run dooc edit <manifest-path> to add your first document.
124
+
125
+ options:
126
+ --help, -h show this help`);
127
+ break;
128
+ }
129
+ if (positionals.length > 1)
130
+ throw new Error("init accepts at most one path");
131
+ const target = resolve(positionals[0] ?? ".");
132
+ file = isManifestFile(basename(target)) ? target : join(target, MANIFEST_FILE);
133
+ mkdirSync(dirname(file), { recursive: true });
134
+ writeFileSync(file, serializeManifest([], { format: "nested" }), { flag: "wx" });
135
+ console.log(`Created ${file}\nRun dooc edit '${file.replaceAll("'", "'\\''")}' to add your first document.`);
136
+ }
137
+ catch (error) {
138
+ fail(error instanceof Error && "code" in error && error.code === "EEXIST"
139
+ ? `${file} already exists; nothing was overwritten.`
140
+ : error instanceof Error
141
+ ? error.message
142
+ : String(error));
143
+ }
144
+ break;
145
+ }
50
146
  case "plugin": {
51
147
  try {
52
148
  const { positionals, values } = parseArgs({
@@ -59,9 +155,9 @@ switch (command) {
59
155
  console.log(`usage: dooc plugin <command>
60
156
 
61
157
  commands:
62
- ├─ pack <built-dir> [output.zip] package bundled JS and assets as a plugin ZIP
63
- ├─ add <zip> [dooc.yaml] [port] install a local plugin and print login links
64
- └─ login <plugin-id> [dooc.yaml] [port] open a local login flow for an installed plugin
158
+ pack <built-dir> [output.zip] package bundled JS and assets as a plugin ZIP
159
+ add <zip> [dooc.yaml] [port] install a local plugin and print login links
160
+ login <plugin-id> [dooc.yaml] [port] open a local login flow for an installed plugin
65
161
 
66
162
  options:
67
163
  --help, -h show this help
@@ -80,8 +176,8 @@ Storage and login:
80
176
  break;
81
177
  }
82
178
  if (action === "pack" && value && positionals.length <= 3) {
83
- const { packExtension } = await import("./viewer/extension-pack.js");
84
- const { extensionFile } = await import("./core/extension-package.js");
179
+ const { packExtension } = await import("./extension-pack.js");
180
+ const { extensionFile } = await import("../engine/core/extension-package.js");
85
181
  const output = resolve(rootArg ?? `${resolve(value)}.zip`);
86
182
  extensionFile(basename(output));
87
183
  writeOut(output, await packExtension(resolve(value), output));
@@ -90,13 +186,13 @@ Storage and login:
90
186
  else if ((action === "add" || action === "login") &&
91
187
  value &&
92
188
  positionals.length <= 4) {
93
- const { extensionFile, MAX_EXTENSION_BYTES } = await import("./core/extension-package.js");
189
+ const { extensionFile, MAX_EXTENSION_BYTES } = await import("../engine/core/extension-package.js");
94
190
  const port = Number(portArg ?? 5179);
95
191
  if (!Number.isInteger(port) || port < 1024 || port > 65535)
96
192
  throw new Error("Choose a local port between 1024 and 65535");
97
193
  process.env.DOCS_ROOT = projectRoot(rootArg);
98
194
  process.env.DOCS_HMR = "1";
99
- const { startServer } = await import("./viewer/serve.js");
195
+ const { startServer } = await import("./serve.js");
100
196
  if (action === "add") {
101
197
  const file = extensionFile(basename(value));
102
198
  const data = readFileSync(resolve(value));
@@ -122,7 +218,7 @@ Storage and login:
122
218
  break;
123
219
  }
124
220
  case "font": {
125
- const { addProjectFont, listProjectFonts, removeProjectFont } = await import("./compiler/fonts.js");
221
+ const { addProjectFont, listProjectFonts, removeProjectFont } = await import("../engine/compiler/fonts.js");
126
222
  try {
127
223
  const { positionals, values } = parseArgs({
128
224
  args,
@@ -133,9 +229,9 @@ Storage and login:
133
229
  console.log(`usage: dooc font <command>
134
230
 
135
231
  commands:
136
- ├─ add <file> [dooc.yaml] register a font in the project
137
- ├─ list [dooc.yaml] list registered project fonts
138
- └─ remove <name> [dooc.yaml] remove a registered project font
232
+ add <file> [dooc.yaml] register a font in the project
233
+ list [dooc.yaml] list registered project fonts
234
+ remove <name> [dooc.yaml] remove a registered project font
139
235
 
140
236
  options:
141
237
  --help, -h show this help
@@ -166,7 +262,7 @@ Fonts:
166
262
  break;
167
263
  }
168
264
  case "check": {
169
- const { checkSite } = await import("./compiler/check.js");
265
+ const { checkSite } = await import("../engine/compiler/check.js");
170
266
  let report;
171
267
  try {
172
268
  const { positionals, values } = parseArgs({
@@ -245,19 +341,75 @@ Report:
245
341
  process.exitCode = report.exitCode;
246
342
  break;
247
343
  }
344
+ case "server":
345
+ case "client": {
346
+ try {
347
+ const { positionals, values } = parseArgs({
348
+ args,
349
+ allowPositionals: true,
350
+ options: {
351
+ "client-origin": { type: "string" },
352
+ server: { type: "string" },
353
+ "viewer-plugins": { type: "string" },
354
+ help: { type: "boolean", short: "h" },
355
+ },
356
+ });
357
+ if (values.help) {
358
+ console.log(command === "server"
359
+ ? "usage: dooc server [dooc.yaml] [port] [--client-origin http://localhost:5180] [--viewer-plugins module]\nServes /api/workspace over WebSocket on loopback. No frontend assets."
360
+ : "usage: dooc client [port] [--server ws://localhost:5179/api/workspace]\nServes static assets only. Open local storage or connect to an optional workspace server.");
361
+ break;
362
+ }
363
+ if (positionals.length > (command === "server" ? 2 : 1))
364
+ throw new Error("Too many positional arguments");
365
+ const port = Number(positionals[command === "server" ? 1 : 0] ?? (command === "server" ? 5179 : 5180));
366
+ if (!Number.isInteger(port) || port < 1024 || port > 65535)
367
+ throw new Error("Choose a port between 1024 and 65535");
368
+ if (command === "server") {
369
+ const { startWorkspaceServer } = await import("./workspace-server.js");
370
+ await startWorkspaceServer(positionals[0] ?? "dooc.yaml", port, values["client-origin"], values["viewer-plugins"]);
371
+ }
372
+ else {
373
+ const { startStaticClient } = await import("./static-client.js");
374
+ await startStaticClient(port, values.server);
375
+ }
376
+ }
377
+ catch (error) {
378
+ fail(error instanceof Error ? error.message : String(error));
379
+ }
380
+ break;
381
+ }
248
382
  case "view":
249
383
  case "edit": {
250
384
  try {
251
385
  const { positionals, values } = parseArgs({
252
386
  args,
253
387
  allowPositionals: true,
254
- options: { "viewer-plugins": { type: "string" } },
388
+ options: {
389
+ "viewer-plugins": { type: "string" },
390
+ "tls-cert": { type: "string" },
391
+ "tls-key": { type: "string" },
392
+ shared: { type: "string" },
393
+ },
255
394
  });
395
+ const cert = values["tls-cert"] ?? process.env.DOOC_TLS_CERT;
396
+ const key = values["tls-key"] ?? process.env.DOOC_TLS_KEY;
397
+ if (!cert !== !key)
398
+ throw new Error("--tls-cert and --tls-key must be given together");
256
399
  process.env.DOCS_ROOT = projectRoot(positionals[0]);
257
400
  process.env.DOCS_HMR = "1";
258
401
  // serve.ts reads DOCS_ROOT at import time, so import it after the env is set.
259
- const { startServer } = await import("./viewer/serve.js");
260
- await startServer(command === "view" ? "preview" : "edit", Number(positionals[1] ?? 5179), values["viewer-plugins"] ?? process.env.DOOC_VIEWER_PLUGINS);
402
+ const { startServer } = await import("./serve.js");
403
+ await startServer(command === "view" ? "preview" : "edit", Number(positionals[1] ?? 5179), values["viewer-plugins"] ?? process.env.DOOC_VIEWER_PLUGINS, ...((cert && key) || values.shared !== undefined
404
+ ? [
405
+ {
406
+ ...(cert && key
407
+ ? { tls: { cert: resolve(cert), key: resolve(key) } }
408
+ : {}),
409
+ ...(values.shared === undefined ? {} : { shared: values.shared }),
410
+ },
411
+ ]
412
+ : []));
261
413
  }
262
414
  catch (error) {
263
415
  fail(error instanceof Error ? error.message : String(error));
@@ -270,7 +422,7 @@ Report:
270
422
  throw new Error("export accepts a dooc.yaml path and an output directory");
271
423
  const root = projectRoot(args[0]);
272
424
  const out = join(resolve(args[1] ?? join(root, "dist")), "bundle.zip");
273
- const { exportBundle } = await import("./compiler/export.js");
425
+ const { exportBundle } = await import("../engine/compiler/export.js");
274
426
  writeOut(out, exportBundle(root));
275
427
  console.log(out);
276
428
  }
@@ -285,24 +437,29 @@ Report:
285
437
  args,
286
438
  allowPositionals: true,
287
439
  options: {
440
+ server: { type: "string" },
288
441
  url_preview: { type: "string" },
289
442
  mode: { type: "string" },
290
443
  auth: { type: "string" },
291
444
  "viewer-plugins": { type: "string" },
292
445
  "source-url": { type: "string" },
446
+ "easy-download": { type: "boolean" },
293
447
  help: { type: "boolean", short: "h" },
294
448
  },
295
449
  });
296
450
  if (values.help) {
297
- console.log(`usage: dooc build <html|zip> [dooc.yaml] [out-dir] [options]
451
+ console.log(`usage: dooc build <html|zip|client> [dooc.yaml] [out-dir] [options]
298
452
 
299
453
  commands:
300
- ├─ html [dooc.yaml] [out-dir] build bundle.html
301
- │ ├─ --mode static|live HTML snapshot or runtime plugin API
302
- │ ├─ --auth external host supplies live HTML authentication and transport
303
- │ └─ --source-url <url> HTTP(S) directory URL for card copy links
304
- │ paths are relative to dooc.yaml; overrides GitHub origin/HEAD
305
- └─ zip [dooc.yaml] [out-dir] build bundle.zip
454
+ html [dooc.yaml] [out-dir] build bundle.html
455
+ --mode static|live HTML snapshot or runtime plugin API
456
+ --auth external host supplies live HTML authentication and transport
457
+ --source-url <url> HTTP(S) directory URL for card copy links
458
+ paths are relative to dooc.yaml; overrides GitHub origin/HEAD
459
+ --easy-download enable resource downloads (default: off)
460
+ client [out-dir] build a standalone static editor (default: ./dooc-client)
461
+ --server <ws-url> optional workspace socket
462
+ zip [dooc.yaml] [out-dir] build bundle.zip
306
463
 
307
464
  options (html and zip):
308
465
  --url_preview embed|network URL handling (default: embed; live HTML: network)
@@ -336,8 +493,17 @@ URL handling:
336
493
  break;
337
494
  }
338
495
  const [format, rootArg, outArg] = positionals;
496
+ if (format === "client") {
497
+ if (positionals.length > 2)
498
+ throw new Error("build client accepts one output directory");
499
+ const { buildStaticClient } = await import("./static-client.js");
500
+ const out = resolve(rootArg ?? "dooc-client");
501
+ await buildStaticClient(out, values.server);
502
+ console.log(`${out} — static client (serve index.html for document routes)`);
503
+ break;
504
+ }
339
505
  if (format !== "html" && format !== "zip")
340
- throw new Error("build format must be html | zip");
506
+ throw new Error("build format must be html | zip | client");
341
507
  if (positionals.length > 3)
342
508
  throw new Error(`build ${format} accepts a dooc.yaml path and an output directory`);
343
509
  const urlPreview = values.url_preview ?? (values.mode === "live" ? "network" : "embed");
@@ -345,7 +511,7 @@ URL handling:
345
511
  throw new Error("--url_preview must be embed | network");
346
512
  const root = projectRoot(rootArg);
347
513
  const out = join(resolve(outArg ?? join(root, "dist")), `bundle.${format}`);
348
- const { buildBundle } = await import("./viewer/build.js");
514
+ const { buildBundle } = await import("./build.js");
349
515
  const bundle = await buildBundle(root, {
350
516
  format,
351
517
  urlPreview,
@@ -353,6 +519,7 @@ URL handling:
353
519
  auth: values.auth,
354
520
  pluginModule: values["viewer-plugins"],
355
521
  sourceUrl: values["source-url"],
522
+ easyDownload: values["easy-download"],
356
523
  });
357
524
  writeOut(out, bundle.data);
358
525
  console.log(`${out} — ${bundle.docs} docs (url_preview=${urlPreview})`);
@@ -380,7 +547,7 @@ options:
380
547
  --help, -h show this help
381
548
 
382
549
  Server:
383
- Exposes docs, files, Statics, fonts, check, build and Git over stdio.
550
+ Exposes docs, files, Library, fonts, check, build and Git over stdio.
384
551
  Build accepts format=html|zip and url_preview=embed|network (default embed).
385
552
 
386
553
  Git origin:
@@ -392,7 +559,7 @@ Git origin:
392
559
  if (positionals.length > 1)
393
560
  throw new Error("mcp accepts at most one dooc.yaml path");
394
561
  const { startMcp } = await import("./mcp.js");
395
- const { loadViewerPlugins } = await import("./viewer/plugin-config.js");
562
+ const { loadViewerPlugins } = await import("./plugin-config.js");
396
563
  const { gitOrigin } = await loadViewerPlugins(values["git-origin"]);
397
564
  if (values["git-origin"] && !gitOrigin)
398
565
  throw new Error("Module must provide gitOrigin");
@@ -0,0 +1 @@
1
+ export * from "../workspace/editor-tools.js";
@@ -0,0 +1 @@
1
+ export * from "../workspace/editor-tools.js";
@@ -1,8 +1,8 @@
1
1
  import { lstatSync, readdirSync, readFileSync } from "node:fs";
2
2
  import { join, resolve } from "node:path";
3
3
  import { inflateRawSync } from "node:zlib";
4
- import { zip } from "../compiler/zip.js";
5
- import { MAX_EXTENSION_BYTES, MAX_EXTENSION_FILES, readExtensionZip, } from "../core/extension-package.js";
4
+ import { zip } from "../engine/compiler/zip.js";
5
+ import { MAX_EXTENSION_BYTES, MAX_EXTENSION_FILES, readExtensionZip, } from "../engine/core/extension-package.js";
6
6
  /** Package an already bundled module and its relative assets without running build scripts. */
7
7
  export const packExtension = async (root, output) => {
8
8
  const entries = [];
@@ -1,5 +1,5 @@
1
- import type { LocalPluginStorage } from "../plugins/local-storage.js";
2
1
  import { type ViewerPluginRegistry, type ViewerPlugins } from "./plugin-config.js";
2
+ import type { LocalPluginStorage } from "./plugins/local-storage.js";
3
3
  export declare const EXTENSIONS_DIR = ".dooc/plugins";
4
4
  /** ZIPs found on disk stay inactive until the browser approves their exact content hash. */
5
5
  export declare const createExtensionManager: (root: string, registry: ViewerPluginRegistry & {
@@ -4,9 +4,9 @@ import { tmpdir } from "node:os";
4
4
  import { dirname, join } from "node:path";
5
5
  import { pathToFileURL } from "node:url";
6
6
  import { inflateRawSync } from "node:zlib";
7
- import { textfilePath } from "../compiler/textfile.js";
8
- import { zip } from "../compiler/zip.js";
9
- import { extensionFile, extensionManifest, MAX_EXTENSION_BYTES, readExtensionZip, } from "../core/extension-package.js";
7
+ import { textfilePath } from "../engine/compiler/textfile.js";
8
+ import { zip } from "../engine/compiler/zip.js";
9
+ import { extensionFile, extensionManifest, MAX_EXTENSION_BYTES, readExtensionZip, } from "../engine/core/extension-package.js";
10
10
  import { validateViewerPlugins, } from "./plugin-config.js";
11
11
  export const EXTENSIONS_DIR = ".dooc/plugins";
12
12
  const hash = (source) => createHash("sha256").update(source).digest("hex");
@@ -0,0 +1,10 @@
1
+ import type { SubformatCollection } from "../engine/core/subformats.js";
2
+ /**
3
+ * `revision` identifies the working tree contents (filesSnapshot); with it the status is reused
4
+ * until the files, the index or HEAD change.
5
+ */
6
+ export declare const gitFileChanges: (root: string, revision?: string) => Map<string, "added" | "modified">;
7
+ /** Compare against HEAD so saving or staging does not clear the editor's changes. */
8
+ export declare const gitBaseText: (root: string, file: string) => string | null;
9
+ export declare const gitBaseBody: (root: string, file: string) => string | null;
10
+ export declare const setSubformatChanges: (root: string, collections: SubformatCollection[], revision?: string) => void;