@dooc-dev/dooc 0.0.5 → 0.0.7

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 (174) hide show
  1. package/dist/cli.js +162 -67
  2. package/dist/code-worker.global.js +152 -0
  3. package/dist/code.global.js +101 -101
  4. package/dist/compiler/bundle-urls.js +2 -0
  5. package/dist/compiler/check.js +2 -0
  6. package/dist/compiler/compile.js +13 -3
  7. package/dist/compiler/dxf.d.ts +1 -0
  8. package/dist/compiler/dxf.js +81 -0
  9. package/dist/compiler/export.js +22 -15
  10. package/dist/compiler/figures.js +39 -10
  11. package/dist/compiler/files.js +2 -0
  12. package/dist/compiler/ignored-files.d.ts +2 -0
  13. package/dist/compiler/ignored-files.js +30 -0
  14. package/dist/compiler/ops.js +1 -1
  15. package/dist/compiler/subformat-schema.d.ts +14 -0
  16. package/dist/compiler/subformat-schema.js +92 -0
  17. package/dist/compiler/subformats.d.ts +5 -7
  18. package/dist/compiler/subformats.js +115 -75
  19. package/dist/core/code-file.js +7 -5
  20. package/dist/core/code-grammars.d.ts +5 -0
  21. package/dist/core/code-grammars.js +34 -0
  22. package/dist/core/content-metadata.d.ts +2 -1
  23. package/dist/core/content-metadata.js +7 -2
  24. package/dist/core/content-types.d.ts +1 -1
  25. package/dist/core/escape-html.d.ts +1 -0
  26. package/dist/core/escape-html.js +1 -0
  27. package/dist/core/figure-frame.js +1 -1
  28. package/dist/core/file-embed.js +7 -3
  29. package/dist/core/html.d.ts +4 -1
  30. package/dist/core/html.js +8 -7
  31. package/dist/core/language.js +5 -2
  32. package/dist/core/markdown.js +3 -1
  33. package/dist/core/previewers.d.ts +8 -0
  34. package/dist/core/previewers.js +2 -0
  35. package/dist/core/schema-fields.d.ts +13 -0
  36. package/dist/core/schema-fields.js +175 -0
  37. package/dist/core/schema-graph-mount.js +26 -3
  38. package/dist/core/schema-refs.d.ts +8 -0
  39. package/dist/core/schema-refs.js +82 -0
  40. package/dist/core/toc-ui.js +1 -1
  41. package/dist/edit.global.js +266 -285
  42. package/dist/flow.global.js +1031 -1057
  43. package/dist/graph/abnfDiagram-S7VZAUFO-GAGCW2J5.js +1 -0
  44. package/dist/graph/architecture-WOLXFQ4H-AWAC3VBS.js +1 -0
  45. package/dist/graph/architectureDiagram-YGSQEFNW-WQ7QKSUJ.js +36 -0
  46. package/dist/graph/blockDiagram-APKKGZFW-H7ZNJMOM.js +140 -0
  47. package/dist/graph/bpmnIcons-APHXDYXF-EAVPNTFE.js +1 -0
  48. package/dist/graph/c4Diagram-KJ2TOQU5-3IYS34YL.js +38 -0
  49. package/dist/graph/chunk-3CJU2RDX.js +1 -0
  50. package/dist/graph/chunk-3LU66YMI.js +1 -0
  51. package/dist/graph/chunk-3Y2PDVDE.js +1 -0
  52. package/dist/graph/chunk-4KILFWYV.js +339 -0
  53. package/dist/graph/chunk-4QDE4SUK.js +1 -0
  54. package/dist/graph/chunk-5N2X2DXU.js +1 -0
  55. package/dist/graph/chunk-5OO6DATX.js +1 -0
  56. package/dist/graph/chunk-67BPVAXC.js +1 -0
  57. package/dist/graph/chunk-6CDZONCA.js +1 -0
  58. package/dist/graph/chunk-7ASYMKN2.js +1 -0
  59. package/dist/graph/chunk-7JQUFVT4.js +10 -0
  60. package/dist/graph/chunk-7LSMJ4VU.js +72 -0
  61. package/dist/graph/chunk-7UKJADAE.js +213 -0
  62. package/dist/graph/chunk-AARGNXTW.js +32 -0
  63. package/dist/graph/chunk-ARAJTKOH.js +2 -0
  64. package/dist/graph/chunk-BOXAA5AP.js +62 -0
  65. package/dist/graph/chunk-BTMPKSGF.js +1 -0
  66. package/dist/graph/chunk-BVXT562I.js +1 -0
  67. package/dist/graph/chunk-DIDARDST.js +1 -0
  68. package/dist/graph/chunk-EWYECPNJ.js +1 -0
  69. package/dist/graph/chunk-FD7ZFC7R.js +3 -0
  70. package/dist/graph/chunk-GF4TOPUK.js +1 -0
  71. package/dist/graph/chunk-GWYODWCE.js +1 -0
  72. package/dist/graph/chunk-HKRJKXEE.js +1 -0
  73. package/dist/graph/chunk-I5LEUF24.js +1 -0
  74. package/dist/graph/chunk-ICJPOOXG.js +1 -0
  75. package/dist/graph/chunk-IVZHB6RS.js +135 -0
  76. package/dist/graph/chunk-JSHWCPFJ.js +1 -0
  77. package/dist/graph/chunk-JZGXHT3J.js +1 -0
  78. package/dist/graph/chunk-K4I76XBX.js +14 -0
  79. package/dist/graph/chunk-LSRL537V.js +88 -0
  80. package/dist/graph/chunk-LT6LXKCR.js +136 -0
  81. package/dist/graph/chunk-MPR575IN.js +1 -0
  82. package/dist/graph/chunk-N44XPVUD.js +15 -0
  83. package/dist/graph/chunk-NDAMZVXQ.js +1 -0
  84. package/dist/graph/chunk-O656ZI37.js +1 -0
  85. package/dist/graph/chunk-PDH25ALM.js +2 -0
  86. package/dist/graph/chunk-QLS7NIYR.js +2 -0
  87. package/dist/graph/chunk-QQIGL7OP.js +1 -0
  88. package/dist/graph/chunk-QYAXYFNI.js +1 -0
  89. package/dist/graph/chunk-QYTM6GY3.js +1 -0
  90. package/dist/graph/chunk-RJFVWYCA.js +1 -0
  91. package/dist/graph/chunk-SCEY3ZPT.js +1 -0
  92. package/dist/graph/chunk-SQE76S5B.js +1 -0
  93. package/dist/graph/chunk-WQHTQAFY.js +1 -0
  94. package/dist/graph/chunk-XQS73SBQ.js +1 -0
  95. package/dist/graph/chunk-Z4FIZ7CR.js +1 -0
  96. package/dist/graph/chunk-ZSZXN4BT.js +2 -0
  97. package/dist/graph/classDiagram-v2-L25IHNXF-HNTCDTNK.js +217 -0
  98. package/dist/graph/cose-bilkent-JH36ORCC-2GVA7XKO.js +1 -0
  99. package/dist/graph/cynefin-EF2NZ3EQ-TCI65RAQ.js +1 -0
  100. package/dist/graph/cynefinDiagram-L36ESFBY-OKQ5BLVF.js +62 -0
  101. package/dist/graph/dagre-SPEB5RXH-KZEBD52K.js +4 -0
  102. package/dist/graph/diagram-3B7GL73J-ESCBJM3O.js +200 -0
  103. package/dist/graph/diagram-DNEMPZML-ZIBUSQZI.js +24 -0
  104. package/dist/graph/diagram-L3MUGCDN-IGK62IPN.js +41 -0
  105. package/dist/graph/diagram-LA4NIPWU-2KZCOFJ5.js +24 -0
  106. package/dist/graph/diagram-MHCOC4E2-EYAAB236.js +3 -0
  107. package/dist/graph/diagram-XPFHEONP-OZ5ARGMG.js +30 -0
  108. package/dist/graph/ebnfDiagram-UZSYDL2S-M3XJHARD.js +1 -0
  109. package/dist/graph/erDiagram-EYBAPDEH-Y7KUBH7A.js +99 -0
  110. package/dist/graph/eventmodeling-K75KTNOO-ROLYRDEP.js +1 -0
  111. package/dist/graph/flowDiagram-MALGAFMO-AAUEIPCR.js +1 -0
  112. package/dist/graph/ganttDiagram-23REXITY-JSBTFSSJ.js +292 -0
  113. package/dist/graph/gitGraph-VSP46ZUC-ZCBCDVNF.js +1 -0
  114. package/dist/graph/gitGraphDiagram-STJD7YCW-3ZA5FT3G.js +106 -0
  115. package/dist/graph/info-OHQRW6UA-JKJGOQNY.js +1 -0
  116. package/dist/graph/infoDiagram-KBXO4MBG-6LFMPP2O.js +2 -0
  117. package/dist/graph/ishikawaDiagram-M35NCXHK-YLEU44DY.js +70 -0
  118. package/dist/graph/journeyDiagram-OPLOXDXO-ZHJV66ZT.js +139 -0
  119. package/dist/graph/kanban-definition-BZKZHSQY-SDU25WUM.js +89 -0
  120. package/dist/graph/katex-WSLZOTY7.js +257 -0
  121. package/dist/graph/mindmap-definition-I2QAS2VK-XQNBCYHN.js +98 -0
  122. package/dist/graph/packet-JDAUHWVQ-Y3H77ERD.js +1 -0
  123. package/dist/graph/pegDiagram-FD4XPPHP-YO4VWH6V.js +1 -0
  124. package/dist/graph/pie-XZMESJXO-PRER4XL5.js +1 -0
  125. package/dist/graph/pieDiagram-J4AKIIQI-TJ5WOOSV.js +39 -0
  126. package/dist/graph/quadrantDiagram-XTYBLID2-G6MSSZLW.js +7 -0
  127. package/dist/graph/radar-ABXABTNO-M6MV34GM.js +1 -0
  128. package/dist/graph/railroad-I3PHUGI6-YIWPGN6Q.js +1 -0
  129. package/dist/graph/railroad-abnf-LNEFI6M7-7JHLZ2R7.js +1 -0
  130. package/dist/graph/railroad-ebnf-DWYD2UWJ-V55BXEWY.js +1 -0
  131. package/dist/graph/railroad-peg-JR7BVNR7-XCGKDRMK.js +1 -0
  132. package/dist/graph/railroadDiagram-MRQ6NCDL-RACSFXC4.js +1 -0
  133. package/dist/graph/requirementDiagram-Y7LWUY3S-4LQIQWHQ.js +84 -0
  134. package/dist/graph/sankeyDiagram-WGJFYUXA-K3RXG5FB.js +40 -0
  135. package/dist/graph/schema-graph-global.js +639 -0
  136. package/dist/graph/sequenceDiagram-5NDRBG5M-Y6RBHRS3.js +169 -0
  137. package/dist/graph/sizeCapture-INFHLROL-TJW3VUGH.js +1 -0
  138. package/dist/graph/stateDiagram-v2-FJ4FJNEA-4M5WZORG.js +291 -0
  139. package/dist/graph/swimlanes-UMQ2AFYF-O4W6U4RO.js +1 -0
  140. package/dist/graph/swimlanesDiagram-OMPLPG4O-HZAKM45N.js +8 -0
  141. package/dist/graph/timeline-definition-SEUHKTQE-IHISQ4Q7.js +120 -0
  142. package/dist/graph/treeView-D4JQ5SDB-EVGY4VYS.js +1 -0
  143. package/dist/graph/treemap-SAJKECNS-LN3SMFRX.js +1 -0
  144. package/dist/graph/usecaseDiagram-AFA6YXN4-B645A3J6.js +370 -0
  145. package/dist/graph/vennDiagram-NNMJR3RB-K3HWMON6.js +34 -0
  146. package/dist/graph/wardley-7MLQ67FV-RRWOELC6.js +1 -0
  147. package/dist/graph/wardleyDiagram-S7YFUSEH-DMMWKJEK.js +78 -0
  148. package/dist/graph/xychartDiagram-GGNKY7IX-K6MUQVXR.js +7 -0
  149. package/dist/mcp.js +5 -4
  150. package/dist/plugins.global.js +71 -104
  151. package/dist/subformats.global.js +6 -112
  152. package/dist/ui.global.js +75 -108
  153. package/dist/viewer/build.d.ts +2 -0
  154. package/dist/viewer/build.js +22 -8
  155. package/dist/viewer/code-file.js +7 -2
  156. package/dist/viewer/figure-preview.d.ts +4 -0
  157. package/dist/viewer/figure-preview.js +54 -0
  158. package/dist/viewer/hmr.js +4 -3
  159. package/dist/viewer/lazy-preview.d.ts +2 -0
  160. package/dist/viewer/lazy-preview.js +43 -0
  161. package/dist/viewer/locales/eng.json +26 -3
  162. package/dist/viewer/locales/jpn.json +26 -3
  163. package/dist/viewer/locales/zho.json +26 -3
  164. package/dist/viewer/plugin-blocks.js +1 -1
  165. package/dist/viewer/plugins.js +1 -1
  166. package/dist/viewer/resource-library.d.ts +1 -1
  167. package/dist/viewer/resource-library.js +5 -4
  168. package/dist/viewer/serve.d.ts +2 -1
  169. package/dist/viewer/serve.js +148 -41
  170. package/dist/viewer/textfile.d.ts +2 -0
  171. package/dist/viewer/textfile.js +20 -5
  172. package/package.json +14 -4
  173. package/dist/viewer/lazy-graph.d.ts +0 -2
  174. package/dist/viewer/lazy-graph.js +0 -30
package/dist/cli.js CHANGED
@@ -4,31 +4,40 @@ 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
6
  import { projectRoot } from "./compiler/manifest.js";
7
+ import { MANIFEST_FILE, serializeManifest } from "./core/content-metadata.js";
7
8
  import { prebuilt } from "./viewer/assets.js";
8
9
  process.env.NODE_ENV = prebuilt ? "production" : "development";
9
10
  const USAGE = `usage: dooc <command>
10
11
 
11
- edit [dooc.yaml] [port] open dooc in edit mode
12
- view [dooc.yaml] [port] open dooc in view mode
13
- --viewer-plugins <module> inject an external viewer plugin module
14
- build html [dooc.yaml] [out-dir] build bundle.html (default <project>/dist)
15
- export [dooc.yaml] [out-dir] collect source dependencies into bundle.zip
16
- build zip [dooc.yaml] [out-dir] build bundle.zip (default <project>/dist)
17
- --url_preview embed|network URL handling for either format (default: embed)
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 in HTML
21
- check [dooc.yaml] [options] JSON consistency report (check --help for options)
22
- plugin pack <built-dir> [zip] package bundled JS and assets as a plugin ZIP
23
- plugin add <zip> [dooc.yaml] [port] install a local plugin and print login links
24
- plugin login <id> [dooc.yaml] [port] open a local login flow for an installed plugin
25
- font add <file> [dooc.yaml] register a font in the project (.dooc/fonts/)
26
- font list [dooc.yaml] list registered project fonts
27
- font remove <name> [dooc.yaml] remove a registered project font
28
- mcp [dooc.yaml] stdio MCP server (all read / write operations)
29
- --git-origin <module> inject gitOrigin from an external viewer plugin module
30
- help, --help, -h show this help
12
+ commands:
13
+ ├─ init create dooc.yaml in the current directory
14
+ ├─ edit [dooc.yaml] [port] open dooc in edit mode
15
+ │ └─ --viewer-plugins <module> inject an external viewer plugin module
16
+ ├─ view [dooc.yaml] [port] open dooc in view mode
17
+ │ └─ --viewer-plugins <module> inject an external viewer plugin module
18
+ ├─ build build the selected bundle (default <project>/dist)
19
+ │ ├─ html [dooc.yaml] [out-dir] build bundle.html
20
+ │ │ ├─ --mode static|live HTML snapshot or runtime plugin API
21
+ │ │ ├─ --auth external host supplies live HTML authentication and transport
22
+ │ │ └─ --source-url <url> source directory URL for card copy links
23
+ │ ├─ zip [dooc.yaml] [out-dir] build bundle.zip
24
+ │ ├─ --url_preview embed|network URL handling for either format (default: embed)
25
+ │ └─ --viewer-plugins <module> inject an external build plugin module
26
+ ├─ export [dooc.yaml] [out-dir] collect source dependencies into bundle.zip
27
+ ├─ check [dooc.yaml] [options] JSON consistency report (check --help for options)
28
+ ├─ plugin manage local plugins
29
+ │ ├─ pack <built-dir> [zip] package bundled JS and assets as a plugin ZIP
30
+ │ ├─ add <zip> [dooc.yaml] [port] install a local plugin and print login links
31
+ │ └─ login <id> [dooc.yaml] [port] open a local login flow for an installed plugin
32
+ ├─ font manage project fonts (.dooc/fonts/)
33
+ │ ├─ add <file> [dooc.yaml] register a font in the project
34
+ │ ├─ list [dooc.yaml] list registered project fonts
35
+ │ └─ remove <name> [dooc.yaml] remove a registered project font
36
+ ├─ mcp [dooc.yaml] stdio MCP server (all read / write operations)
37
+ │ └─ --git-origin <module> inject gitOrigin from an external viewer plugin module
38
+ └─ help, --help, -h show this help
31
39
 
40
+ Details: dooc <command> --help (init, build, check, plugin, font, mcp).
32
41
  Default manifest: ./dooc.yaml. Paths and .dooc/ are relative to its directory.`;
33
42
  const fail = (message) => {
34
43
  console.error(message);
@@ -40,6 +49,38 @@ const writeOut = (out, data) => {
40
49
  };
41
50
  const [command, ...args] = process.argv.slice(2);
42
51
  switch (command) {
52
+ case "init": {
53
+ try {
54
+ const { positionals, values } = parseArgs({
55
+ args,
56
+ allowPositionals: true,
57
+ options: { help: { type: "boolean", short: "h" } },
58
+ });
59
+ if (values.help) {
60
+ console.log(`usage: dooc init
61
+
62
+ Create dooc.yaml in the current directory. Existing files are never overwritten.
63
+ Run dooc edit to add your first document.
64
+
65
+ options:
66
+ --help, -h show this help`);
67
+ break;
68
+ }
69
+ if (positionals.length)
70
+ throw new Error("init does not accept positional arguments");
71
+ const file = resolve(MANIFEST_FILE);
72
+ writeFileSync(file, serializeManifest([], { format: "nested" }), { flag: "wx" });
73
+ console.log(`Created ${file}\nRun dooc edit to add your first document.`);
74
+ }
75
+ catch (error) {
76
+ fail(error instanceof Error && "code" in error && error.code === "EEXIST"
77
+ ? `${MANIFEST_FILE} already exists; nothing was overwritten.`
78
+ : error instanceof Error
79
+ ? error.message
80
+ : String(error));
81
+ }
82
+ break;
83
+ }
43
84
  case "plugin": {
44
85
  try {
45
86
  const { positionals, values } = parseArgs({
@@ -49,17 +90,27 @@ switch (command) {
49
90
  });
50
91
  const [action, value, rootArg, portArg] = positionals;
51
92
  if (values.help) {
52
- console.log(`usage: dooc plugin pack <built-dir> [output.zip]
53
- dooc plugin add <zip> [dooc.yaml] [port]
54
- dooc plugin login <plugin-id> [dooc.yaml] [port]
93
+ console.log(`usage: dooc plugin <command>
94
+
95
+ commands:
96
+ ├─ pack <built-dir> [output.zip] package bundled JS and assets as a plugin ZIP
97
+ ├─ add <zip> [dooc.yaml] [port] install a local plugin and print login links
98
+ └─ login <plugin-id> [dooc.yaml] [port] open a local login flow for an installed plugin
99
+
100
+ options:
101
+ --help, -h show this help
55
102
 
56
- ZIP root: package.json with name, version, type: module and main pointing to bundled .js/.mjs.
57
- Optional icon: path to a bundled SVG asset up to 64 KiB.
58
- Include relative assets (SVG, JSON, etc.); dependencies must already be bundled. Limit: 16 MiB / 256 files.
59
- Default output: <built-dir>.zip. Installed ZIPs: <project>/.dooc/plugins/.
60
- Personal logins and plugin approvals: ~/.dooc/plugins/ (override with DOOC_USER_DIR).
61
- Add/login starts a local editor and prints browser login links. Keep it running while signing in.
62
- Tokens stay on this computer and never enter exported documents.`);
103
+ Package:
104
+ ZIP root: package.json with name, version, type: module and main pointing to bundled .js/.mjs.
105
+ Optional icon: path to a bundled SVG asset up to 64 KiB.
106
+ Include relative assets (SVG, JSON, etc.); dependencies must already be bundled.
107
+ Limit: 16 MiB / 256 files. Default output: <built-dir>.zip.
108
+
109
+ Storage and login:
110
+ Installed ZIPs: <project>/.dooc/plugins/.
111
+ Personal logins and plugin approvals: ~/.dooc/plugins/ (override with DOOC_USER_DIR).
112
+ Add/login starts a local editor and prints browser login links. Keep it running while signing in.
113
+ Tokens stay on this computer and never enter exported documents.`);
63
114
  break;
64
115
  }
65
116
  if (action === "pack" && value && positionals.length <= 3) {
@@ -113,7 +164,20 @@ Tokens stay on this computer and never enter exported documents.`);
113
164
  options: { help: { type: "boolean", short: "h" } },
114
165
  });
115
166
  if (values.help) {
116
- console.log("usage: dooc font add <file> [dooc.yaml] | list [dooc.yaml] | remove <name> [dooc.yaml]\n\nFonts are copied to <project>/.dooc/fonts/ and included in ZIP and HTML bundles.\nSupported formats: TTF, OTF, WOFF, WOFF2. Existing names are never overwritten.\nReload the viewer after changing registered fonts. Default manifest: ./dooc.yaml.");
167
+ console.log(`usage: dooc font <command>
168
+
169
+ commands:
170
+ ├─ add <file> [dooc.yaml] register a font in the project
171
+ ├─ list [dooc.yaml] list registered project fonts
172
+ └─ remove <name> [dooc.yaml] remove a registered project font
173
+
174
+ options:
175
+ --help, -h show this help
176
+
177
+ Fonts:
178
+ Fonts are copied to <project>/.dooc/fonts/ and included in ZIP and HTML bundles.
179
+ Supported formats: TTF, OTF, WOFF, WOFF2. Existing names are never overwritten.
180
+ Reload the viewer after changing registered fonts. Default manifest: ./dooc.yaml.`);
117
181
  break;
118
182
  }
119
183
  const [action, value, rootArg] = positionals;
@@ -152,27 +216,31 @@ Tokens stay on this computer and never enter exported documents.`);
152
216
  if (values.help) {
153
217
  console.log(`usage: dooc check [dooc.yaml] [options]
154
218
 
219
+ options:
155
220
  --only render,languages,themes select checks (default: all three)
156
221
  manifest validity is always checked
157
- --allow-shared-svg allow identical SVG bytes across themes (missing variants still fail)
158
- --warnings-as-errors fail on warnings as well as errors
159
- --help, -h show this help
222
+ --allow-shared-svg allow identical SVG bytes across themes (missing variants still fail)
223
+ --warnings-as-errors fail on warnings as well as errors
224
+ --help, -h show this help
160
225
 
161
226
  dooc.yaml example:
162
227
  defaultLang: jpn
163
228
  languages: [jpn, eng]
164
229
  themes: [light, dark]
165
230
 
166
- Translations: locales/<ISO 639-3>/<source path>.
167
- Theme variants: themes/<theme>/<asset path>.
168
- stdout: one JSON CheckReport with schemaVersion=1, checks, diagnostics, summary and exitCode.
169
- render uses the viewer compiler; languages checks availability and prose; themes checks variants.
170
- Site declarations determine the expected languages and themes, never CLI overrides.
171
- Diagnostic codes, relative file paths, sourceFile, language, theme and one-based lines are
172
- machine-readable; message text is for humans. Prose detection is heuristic and offline.
173
- Short text, unsupported formats and remote content are reported as unchecked/inconclusive.
174
- Exit codes: 0 passed; 1 errors (or warnings with --warnings-as-errors); 2 invocation/execution failure.
175
- Node API: import { checkSite } from "@dooc-dev/dooc/check".`);
231
+ Checks:
232
+ render uses the viewer compiler
233
+ languages checks availability and prose; translations: locales/<ISO 639-3>/<source path>
234
+ themes checks variants: themes/<theme>/<asset path>
235
+ Site declarations determine the expected languages and themes, never CLI overrides.
236
+
237
+ Report:
238
+ stdout: one JSON CheckReport with schemaVersion=1, checks, diagnostics, summary and exitCode.
239
+ Diagnostic codes, relative file paths, sourceFile, language, theme and one-based lines are
240
+ machine-readable; message text is for humans. Prose detection is heuristic and offline.
241
+ Short text, unsupported formats and remote content are reported as unchecked/inconclusive.
242
+ Exit codes: 0 passed; 1 errors (or warnings with --warnings-as-errors); 2 invocation/execution failure.
243
+ Node API: import { checkSite } from "@dooc-dev/dooc/check".`);
176
244
  break;
177
245
  }
178
246
  if (positionals.length > 1)
@@ -260,31 +328,45 @@ Node API: import { checkSite } from "@dooc-dev/dooc/check".`);
260
328
  },
261
329
  });
262
330
  if (values.help) {
263
- console.log(`usage: dooc build html [dooc.yaml] [out-dir] [--url_preview embed|network]
264
- dooc build html [dooc.yaml] [out-dir] --mode static
265
- dooc build html [dooc.yaml] [out-dir] --mode live --auth external
266
- dooc build zip [dooc.yaml] [out-dir] [--url_preview embed|network]
331
+ console.log(`usage: dooc build <html|zip> [dooc.yaml] [out-dir] [options]
332
+
333
+ commands:
334
+ ├─ html [dooc.yaml] [out-dir] build bundle.html
335
+ │ ├─ --mode static|live HTML snapshot or runtime plugin API
336
+ │ ├─ --auth external host supplies live HTML authentication and transport
337
+ │ └─ --source-url <url> HTTP(S) directory URL for card copy links
338
+ │ paths are relative to dooc.yaml; overrides GitHub origin/HEAD
339
+ └─ zip [dooc.yaml] [out-dir] build bundle.zip
340
+
341
+ options (html and zip):
342
+ --url_preview embed|network URL handling (default: embed; live HTML: network)
343
+ embed snapshot URL content and assets into the selected artifact
344
+ network preserve URL references without downloading them at build time
345
+ --viewer-plugins <module> inject trusted build plugins
346
+ --help, -h show this help
267
347
 
268
- A bundle is dooc.yaml and its managed content. Builds only the selected format.
269
- Default output directory: <project>/dist. Source files are never rewritten.
270
- Static builds resolve enabled local plugins using build-time credentials and embed their views.
271
- Live HTML exposes window.dooc.setPluginTransport(request), without a login UI or credentials.
272
- Use --viewer-plugins <module> to inject trusted build plugins; installed, enabled packages are discovered automatically.
273
- Use dooc export for source dependencies without plugin execution or remote downloads.
274
- --source-url <url> inject an HTTP(S) directory URL for card copy links (HTML only)
275
- paths are relative to dooc.yaml; overrides GitHub origin/HEAD discovery
276
- --url_preview embed snapshot URL content and assets into the selected artifact (default)
277
- --url_preview network preserve URL references without downloading them at build time
348
+ Output:
349
+ A bundle is dooc.yaml and its managed content. Builds only the selected format.
350
+ Default output directory: <project>/dist. Source files are never rewritten.
351
+ Use dooc export for source dependencies without plugin execution or remote downloads.
278
352
 
279
- HTML embed: no network when opened. HTML network: fetch URLs when opened (text requires CORS).
280
- ZIP embed: save URL content and rewrite references. ZIP network: keep the original URLs.
353
+ HTML modes:
354
+ static resolve enabled local plugins using build-time credentials and embed their views
355
+ installed, enabled packages are discovered automatically
356
+ live expose window.dooc.setPluginTransport(request), without a login UI or credentials
357
+ Examples:
358
+ dooc build html --mode static
359
+ dooc build html --mode live --auth external
281
360
 
282
- Only embedded references such as ![](url) are downloaded; ordinary hyperlinks remain links.
283
- Snapshots use public HTTPS without credentials or redirects. Static HTML captures the server's
284
- HTML and declarative assets; it does not execute the source site's JavaScript or perform login.
285
- Remote files are limited to 2 MiB each and 64 MiB / 256 assets total.
286
- A failed download or invalid source stops the build before replacing the selected artifact.
287
- Use --url_preview network with either format to build without downloading URL content.`);
361
+ URL handling:
362
+ HTML embed: no network when opened. HTML network: fetch URLs when opened (text requires CORS).
363
+ ZIP embed: save URL content and rewrite references. ZIP network: keep the original URLs.
364
+ Only embedded references such as ![](url) are downloaded; ordinary hyperlinks remain links.
365
+ Snapshots use public HTTPS without credentials or redirects. Static HTML captures the server's
366
+ HTML and declarative assets; it does not execute the source site's JavaScript or perform login.
367
+ Remote files are limited to 2 MiB each and 64 MiB / 256 assets total.
368
+ A failed download or invalid source stops the build before replacing the selected artifact.
369
+ Use --url_preview network with either format to build without downloading URL content.`);
288
370
  break;
289
371
  }
290
372
  const [format, rootArg, outArg] = positionals;
@@ -325,7 +407,20 @@ Use --url_preview network with either format to build without downloading URL co
325
407
  },
326
408
  });
327
409
  if (values.help) {
328
- console.log("usage: dooc mcp [dooc.yaml] [--git-origin <module>]\n\nExposes docs, files, Statics, fonts, check, build and Git over stdio.\nBuild accepts format=html|zip and url_preview=embed|network (default embed).\nThe external module's default export must contain gitOrigin (the same provider used by edit/view).\nOnly gitOrigin is used; viewer setup and data plugins are not started. Authentication stays in the provider.");
410
+ console.log(`usage: dooc mcp [dooc.yaml] [options]
411
+
412
+ options:
413
+ --git-origin <module> inject gitOrigin from an external viewer plugin module
414
+ --help, -h show this help
415
+
416
+ Server:
417
+ Exposes docs, files, Statics, fonts, check, build and Git over stdio.
418
+ Build accepts format=html|zip and url_preview=embed|network (default embed).
419
+
420
+ Git origin:
421
+ The external module's default export must contain gitOrigin (the same provider used by edit/view).
422
+ Only gitOrigin is used; viewer setup and data plugins are not started.
423
+ Authentication stays in the provider.`);
329
424
  break;
330
425
  }
331
426
  if (positionals.length > 1)