wiki-graph-core 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (576) hide show
  1. package/LICENSE +201 -0
  2. package/data/editor/clue_reviewer.jinja +410 -0
  3. package/data/editor/clue_reviewer_generator.jinja +428 -0
  4. package/data/editor/revision_feedback.jinja +5 -0
  5. package/data/editor/text_compressor.jinja +127 -0
  6. package/data/guaranteed/response_intent_classifier.jinja +8 -0
  7. package/data/help/commands/archive/next.jinja +29 -0
  8. package/data/help/commands/gc.jinja +38 -0
  9. package/data/help/commands/legacy/migrate.jinja +20 -0
  10. package/data/help/commands/legacy.jinja +19 -0
  11. package/data/help/commands/maintenance/chapter/add.jinja +41 -0
  12. package/data/help/commands/maintenance/chapter/list.jinja +33 -0
  13. package/data/help/commands/maintenance/chapter/move.jinja +36 -0
  14. package/data/help/commands/maintenance/chapter/remove.jinja +26 -0
  15. package/data/help/commands/maintenance/chapter/reset.jinja +29 -0
  16. package/data/help/commands/maintenance/chapter/set-source.jinja +34 -0
  17. package/data/help/commands/maintenance/chapter/set-summary.jinja +31 -0
  18. package/data/help/commands/maintenance/chapter/set-title.jinja +29 -0
  19. package/data/help/commands/maintenance/chapter/tree.jinja +58 -0
  20. package/data/help/commands/maintenance/chapter.jinja +59 -0
  21. package/data/help/commands/maintenance/cover.jinja +28 -0
  22. package/data/help/commands/maintenance/meta.jinja +55 -0
  23. package/data/help/commands/predicate.jinja +460 -0
  24. package/data/help/commands/root.jinja +83 -0
  25. package/data/help/commands/transform.jinja +34 -0
  26. package/data/help/commands/uri.jinja +274 -0
  27. package/data/help/topics/config.jinja +88 -0
  28. package/data/help/topics/format.jinja +72 -0
  29. package/data/help/topics/readiness.jinja +99 -0
  30. package/data/help/topics/recipe.jinja +151 -0
  31. package/data/help/topics/runtime.jinja +62 -0
  32. package/data/help/topics/uri.jinja +178 -0
  33. package/data/output/epub/cover.xhtml.jinja +13 -0
  34. package/data/output/epub/nav.xhtml.jinja +12 -0
  35. package/data/output/epub/package.opf.xml.jinja +39 -0
  36. package/data/output/epub/section.xhtml.jinja +12 -0
  37. package/data/topologization/book_coherence_extraction.jinja +223 -0
  38. package/data/topologization/chunk_extraction.jinja +233 -0
  39. package/data/topologization/evidence_choice.jinja +38 -0
  40. package/data/topologization/translate_chunks.jinja +138 -0
  41. package/data/topologization/user_focused_extraction.jinja +378 -0
  42. package/dist/archive/query/archive-view.d.ts +26 -0
  43. package/dist/archive/query/archive-view.js +4540 -0
  44. package/dist/archive/query/archive-view.js.map +1 -0
  45. package/dist/archive/query/continuation-cursor.d.ts +61 -0
  46. package/dist/archive/query/continuation-cursor.js +363 -0
  47. package/dist/archive/query/continuation-cursor.js.map +1 -0
  48. package/dist/archive/query/index.d.ts +29 -0
  49. package/dist/archive/query/index.js +63 -0
  50. package/dist/archive/query/index.js.map +1 -0
  51. package/dist/archive/query/lexical-search.d.ts +22 -0
  52. package/dist/archive/query/lexical-search.js +137 -0
  53. package/dist/archive/query/lexical-search.js.map +1 -0
  54. package/dist/archive/query/search-cache.d.ts +192 -0
  55. package/dist/archive/query/search-cache.js +1248 -0
  56. package/dist/archive/query/search-cache.js.map +1 -0
  57. package/dist/archive/search-index/index.d.ts +26 -0
  58. package/dist/archive/search-index/index.js +29 -0
  59. package/dist/archive/search-index/index.js.map +1 -0
  60. package/dist/archive/search-index/search-index.d.ts +26 -0
  61. package/dist/archive/search-index/search-index.js +555 -0
  62. package/dist/archive/search-index/search-index.js.map +1 -0
  63. package/dist/archive/search-index/search-tokenizer.d.ts +16 -0
  64. package/dist/archive/search-index/search-tokenizer.js +225 -0
  65. package/dist/archive/search-index/search-tokenizer.js.map +1 -0
  66. package/dist/common/cli-command.d.ts +4 -0
  67. package/dist/common/cli-command.js +7 -0
  68. package/dist/common/cli-command.js.map +1 -0
  69. package/dist/common/data-dir.d.ts +3 -0
  70. package/dist/common/data-dir.js +48 -0
  71. package/dist/common/data-dir.js.map +1 -0
  72. package/dist/common/language.d.ts +55 -0
  73. package/dist/common/language.js +208 -0
  74. package/dist/common/language.js.map +1 -0
  75. package/dist/common/llm-scope.d.ts +19 -0
  76. package/dist/common/llm-scope.js +31 -0
  77. package/dist/common/llm-scope.js.map +1 -0
  78. package/dist/common/logging.d.ts +22 -0
  79. package/dist/common/logging.js +141 -0
  80. package/dist/common/logging.js.map +1 -0
  81. package/dist/common/template.d.ts +8 -0
  82. package/dist/common/template.js +54 -0
  83. package/dist/common/template.js.map +1 -0
  84. package/dist/common/tinyld-language.d.ts +6 -0
  85. package/dist/common/tinyld-language.js +34 -0
  86. package/dist/common/tinyld-language.js.map +1 -0
  87. package/dist/common/wiki-graph-dir.d.ts +10 -0
  88. package/dist/common/wiki-graph-dir.js +41 -0
  89. package/dist/common/wiki-graph-dir.js.map +1 -0
  90. package/dist/common/wiki-graph-temp.d.ts +6 -0
  91. package/dist/common/wiki-graph-temp.js +21 -0
  92. package/dist/common/wiki-graph-temp.js.map +1 -0
  93. package/dist/common/wiki-graph-uri.d.ts +28 -0
  94. package/dist/common/wiki-graph-uri.js +171 -0
  95. package/dist/common/wiki-graph-uri.js.map +1 -0
  96. package/dist/context/index.d.ts +1 -0
  97. package/dist/context/index.js +13 -0
  98. package/dist/context/index.js.map +1 -0
  99. package/dist/context/task-context.d.ts +41 -0
  100. package/dist/context/task-context.js +111 -0
  101. package/dist/context/task-context.js.map +1 -0
  102. package/dist/document/database.d.ts +30 -0
  103. package/dist/document/database.js +273 -0
  104. package/dist/document/database.js.map +1 -0
  105. package/dist/document/document.d.ts +153 -0
  106. package/dist/document/document.js +615 -0
  107. package/dist/document/document.js.map +1 -0
  108. package/dist/document/fragments.d.ts +63 -0
  109. package/dist/document/fragments.js +371 -0
  110. package/dist/document/fragments.js.map +1 -0
  111. package/dist/document/index.d.ts +13 -0
  112. package/dist/document/index.js +62 -0
  113. package/dist/document/index.js.map +1 -0
  114. package/dist/document/schema.d.ts +8 -0
  115. package/dist/document/schema.js +472 -0
  116. package/dist/document/schema.js.map +1 -0
  117. package/dist/document/shared-state-database.d.ts +9 -0
  118. package/dist/document/shared-state-database.js +193 -0
  119. package/dist/document/shared-state-database.js.map +1 -0
  120. package/dist/document/stores.d.ts +203 -0
  121. package/dist/document/stores.js +1678 -0
  122. package/dist/document/stores.js.map +1 -0
  123. package/dist/document/text-streams.d.ts +86 -0
  124. package/dist/document/text-streams.js +515 -0
  125. package/dist/document/text-streams.js.map +1 -0
  126. package/dist/document/types.d.ts +148 -0
  127. package/dist/document/types.js +69 -0
  128. package/dist/document/types.js.map +1 -0
  129. package/dist/editor/clue.d.ts +27 -0
  130. package/dist/editor/clue.js +158 -0
  131. package/dist/editor/clue.js.map +1 -0
  132. package/dist/editor/compressor.d.ts +18 -0
  133. package/dist/editor/compressor.js +68 -0
  134. package/dist/editor/compressor.js.map +1 -0
  135. package/dist/editor/editor.d.ts +39 -0
  136. package/dist/editor/editor.js +253 -0
  137. package/dist/editor/editor.js.map +1 -0
  138. package/dist/editor/feedback.d.ts +16 -0
  139. package/dist/editor/feedback.js +104 -0
  140. package/dist/editor/feedback.js.map +1 -0
  141. package/dist/editor/index.d.ts +17 -0
  142. package/dist/editor/index.js +5 -0
  143. package/dist/editor/index.js.map +1 -0
  144. package/dist/editor/language-review.d.ts +14 -0
  145. package/dist/editor/language-review.js +35 -0
  146. package/dist/editor/language-review.js.map +1 -0
  147. package/dist/editor/log.d.ts +37 -0
  148. package/dist/editor/log.js +202 -0
  149. package/dist/editor/log.js.map +1 -0
  150. package/dist/editor/markup.d.ts +20 -0
  151. package/dist/editor/markup.js +294 -0
  152. package/dist/editor/markup.js.map +1 -0
  153. package/dist/editor/prompt-templates.d.ts +6 -0
  154. package/dist/editor/prompt-templates.js +11 -0
  155. package/dist/editor/prompt-templates.js.map +1 -0
  156. package/dist/editor/response.d.ts +5 -0
  157. package/dist/editor/response.js +31 -0
  158. package/dist/editor/response.js.map +1 -0
  159. package/dist/editor/review.d.ts +34 -0
  160. package/dist/editor/review.js +189 -0
  161. package/dist/editor/review.js.map +1 -0
  162. package/dist/editor/types.d.ts +31 -0
  163. package/dist/editor/types.js +21 -0
  164. package/dist/editor/types.js.map +1 -0
  165. package/dist/evidence-selection/anchor-resolver.d.ts +43 -0
  166. package/dist/evidence-selection/anchor-resolver.js +783 -0
  167. package/dist/evidence-selection/anchor-resolver.js.map +1 -0
  168. package/dist/evidence-selection/anchor-types.d.ts +27 -0
  169. package/dist/evidence-selection/anchor-types.js +1 -0
  170. package/dist/evidence-selection/anchor-types.js.map +1 -0
  171. package/dist/evidence-selection/index.d.ts +8 -0
  172. package/dist/evidence-selection/index.js +32 -0
  173. package/dist/evidence-selection/index.js.map +1 -0
  174. package/dist/evidence-selection/prompt.d.ts +18 -0
  175. package/dist/evidence-selection/prompt.js +54 -0
  176. package/dist/evidence-selection/prompt.js.map +1 -0
  177. package/dist/evidence-selection/quote-score.d.ts +29 -0
  178. package/dist/evidence-selection/quote-score.js +331 -0
  179. package/dist/evidence-selection/quote-score.js.map +1 -0
  180. package/dist/evidence-selection/selection-resolver.d.ts +19 -0
  181. package/dist/evidence-selection/selection-resolver.js +303 -0
  182. package/dist/evidence-selection/selection-resolver.js.map +1 -0
  183. package/dist/evidence-selection/text.d.ts +4 -0
  184. package/dist/evidence-selection/text.js +66 -0
  185. package/dist/evidence-selection/text.js.map +1 -0
  186. package/dist/evidence-selection/types.d.ts +36 -0
  187. package/dist/evidence-selection/types.js +1 -0
  188. package/dist/evidence-selection/types.js.map +1 -0
  189. package/dist/facade/app.d.ts +75 -0
  190. package/dist/facade/app.js +141 -0
  191. package/dist/facade/app.js.map +1 -0
  192. package/dist/facade/build-queue.d.ts +181 -0
  193. package/dist/facade/build-queue.js +1442 -0
  194. package/dist/facade/build-queue.js.map +1 -0
  195. package/dist/facade/chapter-build.d.ts +60 -0
  196. package/dist/facade/chapter-build.js +1020 -0
  197. package/dist/facade/chapter-build.js.map +1 -0
  198. package/dist/facade/chapter.d.ts +168 -0
  199. package/dist/facade/chapter.js +944 -0
  200. package/dist/facade/chapter.js.map +1 -0
  201. package/dist/facade/digest.d.ts +55 -0
  202. package/dist/facade/digest.js +168 -0
  203. package/dist/facade/digest.js.map +1 -0
  204. package/dist/facade/graph.d.ts +60 -0
  205. package/dist/facade/graph.js +203 -0
  206. package/dist/facade/graph.js.map +1 -0
  207. package/dist/facade/import.d.ts +49 -0
  208. package/dist/facade/import.js +262 -0
  209. package/dist/facade/import.js.map +1 -0
  210. package/dist/facade/index.d.ts +39 -0
  211. package/dist/facade/index.js +171 -0
  212. package/dist/facade/index.js.map +1 -0
  213. package/dist/facade/knowledge-graph-build.d.ts +75 -0
  214. package/dist/facade/knowledge-graph-build.js +897 -0
  215. package/dist/facade/knowledge-graph-build.js.map +1 -0
  216. package/dist/facade/llm-sampling.d.ts +11 -0
  217. package/dist/facade/llm-sampling.js +58 -0
  218. package/dist/facade/llm-sampling.js.map +1 -0
  219. package/dist/facade/types.d.ts +8 -0
  220. package/dist/facade/types.js +1 -0
  221. package/dist/facade/types.js.map +1 -0
  222. package/dist/facade/wiki-graph-archive.d.ts +41 -0
  223. package/dist/facade/wiki-graph-archive.js +130 -0
  224. package/dist/facade/wiki-graph-archive.js.map +1 -0
  225. package/dist/gc/files.d.ts +15 -0
  226. package/dist/gc/files.js +141 -0
  227. package/dist/gc/files.js.map +1 -0
  228. package/dist/gc/index.d.ts +2 -0
  229. package/dist/gc/index.js +5 -0
  230. package/dist/gc/index.js.map +1 -0
  231. package/dist/gc/lock.d.ts +3 -0
  232. package/dist/gc/lock.js +137 -0
  233. package/dist/gc/lock.js.map +1 -0
  234. package/dist/gc/runner.d.ts +9 -0
  235. package/dist/gc/runner.js +129 -0
  236. package/dist/gc/runner.js.map +1 -0
  237. package/dist/gc/tmp-gc.d.ts +5 -0
  238. package/dist/gc/tmp-gc.js +57 -0
  239. package/dist/gc/tmp-gc.js.map +1 -0
  240. package/dist/gc/types.d.ts +24 -0
  241. package/dist/gc/types.js +1 -0
  242. package/dist/gc/types.js.map +1 -0
  243. package/dist/gc.cjs +10041 -0
  244. package/dist/gc.cjs.map +1 -0
  245. package/dist/gc.d.cts +10 -0
  246. package/dist/gc.d.ts +2 -0
  247. package/dist/gc.js +5 -0
  248. package/dist/gc.js.map +1 -0
  249. package/dist/guaranteed/classifier.d.ts +10 -0
  250. package/dist/guaranteed/classifier.js +88 -0
  251. package/dist/guaranteed/classifier.js.map +1 -0
  252. package/dist/guaranteed/errors.d.ts +38 -0
  253. package/dist/guaranteed/errors.js +73 -0
  254. package/dist/guaranteed/errors.js.map +1 -0
  255. package/dist/guaranteed/index.d.ts +7 -0
  256. package/dist/guaranteed/index.js +21 -0
  257. package/dist/guaranteed/index.js.map +1 -0
  258. package/dist/guaranteed/request.d.ts +8 -0
  259. package/dist/guaranteed/request.js +206 -0
  260. package/dist/guaranteed/request.js.map +1 -0
  261. package/dist/guaranteed/response.d.ts +12 -0
  262. package/dist/guaranteed/response.js +98 -0
  263. package/dist/guaranteed/response.js.map +1 -0
  264. package/dist/guaranteed/types.d.ts +20 -0
  265. package/dist/guaranteed/types.js +1 -0
  266. package/dist/guaranteed/types.js.map +1 -0
  267. package/dist/index-B8NNnQ8P.d.ts +424 -0
  268. package/dist/index.cjs +34774 -0
  269. package/dist/index.cjs.map +1 -0
  270. package/dist/index.d.cts +2462 -0
  271. package/dist/index.d.ts +79 -0
  272. package/dist/index.js +168 -0
  273. package/dist/index.js.map +1 -0
  274. package/dist/legacy-sdpub/upgrade.d.ts +7 -0
  275. package/dist/legacy-sdpub/upgrade.js +795 -0
  276. package/dist/legacy-sdpub/upgrade.js.map +1 -0
  277. package/dist/llm/cache.d.ts +13 -0
  278. package/dist/llm/cache.js +35 -0
  279. package/dist/llm/cache.js.map +1 -0
  280. package/dist/llm/client.d.ts +26 -0
  281. package/dist/llm/client.js +572 -0
  282. package/dist/llm/client.js.map +1 -0
  283. package/dist/llm/context.d.ts +22 -0
  284. package/dist/llm/context.js +78 -0
  285. package/dist/llm/context.js.map +1 -0
  286. package/dist/llm/errors.d.ts +7 -0
  287. package/dist/llm/errors.js +12 -0
  288. package/dist/llm/errors.js.map +1 -0
  289. package/dist/llm/index.d.ts +7 -0
  290. package/dist/llm/index.js +17 -0
  291. package/dist/llm/index.js.map +1 -0
  292. package/dist/llm/request-log.d.ts +9 -0
  293. package/dist/llm/request-log.js +35 -0
  294. package/dist/llm/request-log.js.map +1 -0
  295. package/dist/llm/sampling.d.ts +11 -0
  296. package/dist/llm/sampling.js +67 -0
  297. package/dist/llm/sampling.js.map +1 -0
  298. package/dist/llm/types.d.ts +50 -0
  299. package/dist/llm/types.js +1 -0
  300. package/dist/llm/types.js.map +1 -0
  301. package/dist/output/epub/archive.d.ts +9 -0
  302. package/dist/output/epub/archive.js +81 -0
  303. package/dist/output/epub/archive.js.map +1 -0
  304. package/dist/output/epub/book.d.ts +15 -0
  305. package/dist/output/epub/book.js +76 -0
  306. package/dist/output/epub/book.js.map +1 -0
  307. package/dist/output/epub/content.d.ts +9 -0
  308. package/dist/output/epub/content.js +35 -0
  309. package/dist/output/epub/content.js.map +1 -0
  310. package/dist/output/epub/index.d.ts +20 -0
  311. package/dist/output/epub/index.js +14 -0
  312. package/dist/output/epub/index.js.map +1 -0
  313. package/dist/output/epub/model.d.ts +24 -0
  314. package/dist/output/epub/model.js +1 -0
  315. package/dist/output/epub/model.js.map +1 -0
  316. package/dist/output/epub/navigation.d.ts +10 -0
  317. package/dist/output/epub/navigation.js +39 -0
  318. package/dist/output/epub/navigation.js.map +1 -0
  319. package/dist/output/epub/package.d.ts +17 -0
  320. package/dist/output/epub/package.js +29 -0
  321. package/dist/output/epub/package.js.map +1 -0
  322. package/dist/output/epub/shared.d.ts +4 -0
  323. package/dist/output/epub/shared.js +12 -0
  324. package/dist/output/epub/shared.js.map +1 -0
  325. package/dist/output/epub/templates.d.ts +35 -0
  326. package/dist/output/epub/templates.js +26 -0
  327. package/dist/output/epub/templates.js.map +1 -0
  328. package/dist/output/index.d.ts +14 -0
  329. package/dist/output/index.js +11 -0
  330. package/dist/output/index.js.map +1 -0
  331. package/dist/output/plain-text.d.ts +18 -0
  332. package/dist/output/plain-text.js +56 -0
  333. package/dist/output/plain-text.js.map +1 -0
  334. package/dist/progress/index.d.ts +3 -0
  335. package/dist/progress/index.js +14 -0
  336. package/dist/progress/index.js.map +1 -0
  337. package/dist/progress/reporter.d.ts +10 -0
  338. package/dist/progress/reporter.js +79 -0
  339. package/dist/progress/reporter.js.map +1 -0
  340. package/dist/progress/tracker.d.ts +37 -0
  341. package/dist/progress/tracker.js +119 -0
  342. package/dist/progress/tracker.js.map +1 -0
  343. package/dist/progress/types.d.ts +28 -0
  344. package/dist/progress/types.js +1 -0
  345. package/dist/progress/types.js.map +1 -0
  346. package/dist/reader/attention/attention.d.ts +39 -0
  347. package/dist/reader/attention/attention.js +123 -0
  348. package/dist/reader/attention/attention.js.map +1 -0
  349. package/dist/reader/attention/index.d.ts +9 -0
  350. package/dist/reader/attention/index.js +5 -0
  351. package/dist/reader/attention/index.js.map +1 -0
  352. package/dist/reader/attention/wave-reflection.d.ts +21 -0
  353. package/dist/reader/attention/wave-reflection.js +153 -0
  354. package/dist/reader/attention/wave-reflection.js.map +1 -0
  355. package/dist/reader/attention/working-memory.d.ts +28 -0
  356. package/dist/reader/attention/working-memory.js +62 -0
  357. package/dist/reader/attention/working-memory.js.map +1 -0
  358. package/dist/reader/chunk-batch/extract.d.ts +13 -0
  359. package/dist/reader/chunk-batch/extract.js +14 -0
  360. package/dist/reader/chunk-batch/extract.js.map +1 -0
  361. package/dist/reader/chunk-batch/extractor.d.ts +17 -0
  362. package/dist/reader/chunk-batch/extractor.js +337 -0
  363. package/dist/reader/chunk-batch/extractor.js.map +1 -0
  364. package/dist/reader/chunk-batch/fragment-projection.d.ts +34 -0
  365. package/dist/reader/chunk-batch/fragment-projection.js +94 -0
  366. package/dist/reader/chunk-batch/fragment-projection.js.map +1 -0
  367. package/dist/reader/chunk-batch/index.d.ts +12 -0
  368. package/dist/reader/chunk-batch/index.js +13 -0
  369. package/dist/reader/chunk-batch/index.js.map +1 -0
  370. package/dist/reader/chunk-batch/language.d.ts +9 -0
  371. package/dist/reader/chunk-batch/language.js +23 -0
  372. package/dist/reader/chunk-batch/language.js.map +1 -0
  373. package/dist/reader/chunk-batch/parser.d.ts +94 -0
  374. package/dist/reader/chunk-batch/parser.js +640 -0
  375. package/dist/reader/chunk-batch/parser.js.map +1 -0
  376. package/dist/reader/chunk-batch/prompt-templates.d.ts +6 -0
  377. package/dist/reader/chunk-batch/prompt-templates.js +11 -0
  378. package/dist/reader/chunk-batch/prompt-templates.js.map +1 -0
  379. package/dist/reader/chunk-batch/types.d.ts +85 -0
  380. package/dist/reader/chunk-batch/types.js +1 -0
  381. package/dist/reader/chunk-batch/types.js.map +1 -0
  382. package/dist/reader/index.d.ts +13 -0
  383. package/dist/reader/index.js +7 -0
  384. package/dist/reader/index.js.map +1 -0
  385. package/dist/reader/reader.d.ts +37 -0
  386. package/dist/reader/reader.js +82 -0
  387. package/dist/reader/reader.js.map +1 -0
  388. package/dist/reader/segment/index.d.ts +2 -0
  389. package/dist/reader/segment/index.js +5 -0
  390. package/dist/reader/segment/index.js.map +1 -0
  391. package/dist/reader/segment/intl-segmenter.d.ts +5 -0
  392. package/dist/reader/segment/intl-segmenter.js +102 -0
  393. package/dist/reader/segment/intl-segmenter.js.map +1 -0
  394. package/dist/reader/segment/segment.d.ts +5 -0
  395. package/dist/reader/segment/segment.js +9 -0
  396. package/dist/reader/segment/segment.js.map +1 -0
  397. package/dist/reader/segment/types.d.ts +14 -0
  398. package/dist/reader/segment/types.js +1 -0
  399. package/dist/reader/segment/types.js.map +1 -0
  400. package/dist/reader/types.d.ts +29 -0
  401. package/dist/reader/types.js +1 -0
  402. package/dist/reader/types.js.map +1 -0
  403. package/dist/serial.d.ts +89 -0
  404. package/dist/serial.js +476 -0
  405. package/dist/serial.js.map +1 -0
  406. package/dist/source/adapter.d.ts +15 -0
  407. package/dist/source/adapter.js +1 -0
  408. package/dist/source/adapter.js.map +1 -0
  409. package/dist/source/epub/archive.d.ts +27 -0
  410. package/dist/source/epub/archive.js +189 -0
  411. package/dist/source/epub/archive.js.map +1 -0
  412. package/dist/source/epub/content.d.ts +22 -0
  413. package/dist/source/epub/content.js +183 -0
  414. package/dist/source/epub/content.js.map +1 -0
  415. package/dist/source/epub/document.d.ts +55 -0
  416. package/dist/source/epub/document.js +179 -0
  417. package/dist/source/epub/document.js.map +1 -0
  418. package/dist/source/epub/index.d.ts +10 -0
  419. package/dist/source/epub/index.js +6 -0
  420. package/dist/source/epub/index.js.map +1 -0
  421. package/dist/source/epub/navigation.d.ts +16 -0
  422. package/dist/source/epub/navigation.js +215 -0
  423. package/dist/source/epub/navigation.js.map +1 -0
  424. package/dist/source/epub/package.d.ts +33 -0
  425. package/dist/source/epub/package.js +237 -0
  426. package/dist/source/epub/package.js.map +1 -0
  427. package/dist/source/epub/xml.d.ts +16 -0
  428. package/dist/source/epub/xml.js +111 -0
  429. package/dist/source/epub/xml.js.map +1 -0
  430. package/dist/source/index.d.ts +12 -0
  431. package/dist/source/index.js +32 -0
  432. package/dist/source/index.js.map +1 -0
  433. package/dist/source/meta.d.ts +30 -0
  434. package/dist/source/meta.js +22 -0
  435. package/dist/source/meta.js.map +1 -0
  436. package/dist/source/plain-text.d.ts +16 -0
  437. package/dist/source/plain-text.js +86 -0
  438. package/dist/source/plain-text.js.map +1 -0
  439. package/dist/source/toc.d.ts +16 -0
  440. package/dist/source/toc.js +17 -0
  441. package/dist/source/toc.js.map +1 -0
  442. package/dist/source/types.d.ts +16 -0
  443. package/dist/source/types.js +1 -0
  444. package/dist/source/types.js.map +1 -0
  445. package/dist/topology/grouping.d.ts +15 -0
  446. package/dist/topology/grouping.js +18 -0
  447. package/dist/topology/grouping.js.map +1 -0
  448. package/dist/topology/index.d.ts +21 -0
  449. package/dist/topology/index.js +5 -0
  450. package/dist/topology/index.js.map +1 -0
  451. package/dist/topology/resource-segmentation.d.ts +13 -0
  452. package/dist/topology/resource-segmentation.js +111 -0
  453. package/dist/topology/resource-segmentation.js.map +1 -0
  454. package/dist/topology/segment-incision.d.ts +18 -0
  455. package/dist/topology/segment-incision.js +197 -0
  456. package/dist/topology/segment-incision.js.map +1 -0
  457. package/dist/topology/snake-detector.d.ts +13 -0
  458. package/dist/topology/snake-detector.js +520 -0
  459. package/dist/topology/snake-detector.js.map +1 -0
  460. package/dist/topology/snake-graph-builder.d.ts +14 -0
  461. package/dist/topology/snake-graph-builder.js +76 -0
  462. package/dist/topology/snake-graph-builder.js.map +1 -0
  463. package/dist/topology/topology.d.ts +29 -0
  464. package/dist/topology/topology.js +348 -0
  465. package/dist/topology/topology.js.map +1 -0
  466. package/dist/topology/weights.d.ts +10 -0
  467. package/dist/topology/weights.js +84 -0
  468. package/dist/topology/weights.js.map +1 -0
  469. package/dist/types-FVIqiLC9.d.cts +24 -0
  470. package/dist/utils/async-semaphore.d.ts +7 -0
  471. package/dist/utils/async-semaphore.js +40 -0
  472. package/dist/utils/async-semaphore.js.map +1 -0
  473. package/dist/utils/enum.d.ts +5 -0
  474. package/dist/utils/enum.js +18 -0
  475. package/dist/utils/enum.js.map +1 -0
  476. package/dist/utils/hash.d.ts +3 -0
  477. package/dist/utils/hash.js +132 -0
  478. package/dist/utils/hash.js.map +1 -0
  479. package/dist/utils/node-error.d.ts +4 -0
  480. package/dist/utils/node-error.js +59 -0
  481. package/dist/utils/node-error.js.map +1 -0
  482. package/dist/wikg/archive-uri.d.ts +1 -0
  483. package/dist/wikg/archive-uri.js +37 -0
  484. package/dist/wikg/archive-uri.js.map +1 -0
  485. package/dist/wikg/archive.d.ts +28 -0
  486. package/dist/wikg/archive.js +496 -0
  487. package/dist/wikg/archive.js.map +1 -0
  488. package/dist/wikg/index.d.ts +31 -0
  489. package/dist/wikg/index.js +60 -0
  490. package/dist/wikg/index.js.map +1 -0
  491. package/dist/wikg/wikg-coordinator.d.ts +45 -0
  492. package/dist/wikg/wikg-coordinator.js +1687 -0
  493. package/dist/wikg/wikg-coordinator.js.map +1 -0
  494. package/dist/wikg/wiki-graph-archive-file.d.ts +42 -0
  495. package/dist/wikg/wiki-graph-archive-file.js +78 -0
  496. package/dist/wikg/wiki-graph-archive-file.js.map +1 -0
  497. package/dist/wikilink/index.d.ts +10 -0
  498. package/dist/wikilink/index.js +7 -0
  499. package/dist/wikilink/index.js.map +1 -0
  500. package/dist/wikilink/relation-discovery.d.ts +31 -0
  501. package/dist/wikilink/relation-discovery.js +477 -0
  502. package/dist/wikilink/relation-discovery.js.map +1 -0
  503. package/dist/wikilink/types.d.ts +23 -0
  504. package/dist/wikilink/types.js +1 -0
  505. package/dist/wikilink/types.js.map +1 -0
  506. package/dist/wikilink/window.d.ts +7 -0
  507. package/dist/wikilink/window.js +53 -0
  508. package/dist/wikilink/window.js.map +1 -0
  509. package/dist/wikimatch/enrichment.d.ts +10 -0
  510. package/dist/wikimatch/enrichment.js +55 -0
  511. package/dist/wikimatch/enrichment.js.map +1 -0
  512. package/dist/wikimatch/index.d.ts +16 -0
  513. package/dist/wikimatch/index.js +66 -0
  514. package/dist/wikimatch/index.js.map +1 -0
  515. package/dist/wikimatch/option-narrowing.d.ts +17 -0
  516. package/dist/wikimatch/option-narrowing.js +208 -0
  517. package/dist/wikimatch/option-narrowing.js.map +1 -0
  518. package/dist/wikimatch/options.d.ts +14 -0
  519. package/dist/wikimatch/options.js +155 -0
  520. package/dist/wikimatch/options.js.map +1 -0
  521. package/dist/wikimatch/policy-judge.d.ts +17 -0
  522. package/dist/wikimatch/policy-judge.js +430 -0
  523. package/dist/wikimatch/policy-judge.js.map +1 -0
  524. package/dist/wikimatch/range-suppression.d.ts +9 -0
  525. package/dist/wikimatch/range-suppression.js +27 -0
  526. package/dist/wikimatch/range-suppression.js.map +1 -0
  527. package/dist/wikimatch/surface-screening.d.ts +16 -0
  528. package/dist/wikimatch/surface-screening.js +168 -0
  529. package/dist/wikimatch/surface-screening.js.map +1 -0
  530. package/dist/wikimatch/surface-window.d.ts +6 -0
  531. package/dist/wikimatch/surface-window.js +44 -0
  532. package/dist/wikimatch/surface-window.js.map +1 -0
  533. package/dist/wikimatch/types.d.ts +151 -0
  534. package/dist/wikimatch/types.js +1 -0
  535. package/dist/wikimatch/types.js.map +1 -0
  536. package/dist/wikimatch/wikispine.d.ts +43 -0
  537. package/dist/wikimatch/wikispine.js +399 -0
  538. package/dist/wikimatch/wikispine.js.map +1 -0
  539. package/dist/wikimatch/window.d.ts +6 -0
  540. package/dist/wikimatch/window.js +83 -0
  541. package/dist/wikimatch/window.js.map +1 -0
  542. package/dist/wikimatch/words.d.ts +16 -0
  543. package/dist/wikimatch/words.js +66 -0
  544. package/dist/wikimatch/words.js.map +1 -0
  545. package/dist/wikipage/cache.d.ts +18 -0
  546. package/dist/wikipage/cache.js +404 -0
  547. package/dist/wikipage/cache.js.map +1 -0
  548. package/dist/wikipage/fetch-log.d.ts +17 -0
  549. package/dist/wikipage/fetch-log.js +143 -0
  550. package/dist/wikipage/fetch-log.js.map +1 -0
  551. package/dist/wikipage/index.d.ts +14 -0
  552. package/dist/wikipage/index.js +17 -0
  553. package/dist/wikipage/index.js.map +1 -0
  554. package/dist/wikipage/normalizer.d.ts +14 -0
  555. package/dist/wikipage/normalizer.js +147 -0
  556. package/dist/wikipage/normalizer.js.map +1 -0
  557. package/dist/wikipage/rate-limiter.d.ts +13 -0
  558. package/dist/wikipage/rate-limiter.js +84 -0
  559. package/dist/wikipage/rate-limiter.js.map +1 -0
  560. package/dist/wikipage/resolver.d.ts +26 -0
  561. package/dist/wikipage/resolver.js +325 -0
  562. package/dist/wikipage/resolver.js.map +1 -0
  563. package/dist/wikipage/types.d.ts +96 -0
  564. package/dist/wikipage/types.js +1 -0
  565. package/dist/wikipage/types.js.map +1 -0
  566. package/dist/wikipage/wikimedia-client.d.ts +48 -0
  567. package/dist/wikipage/wikimedia-client.js +397 -0
  568. package/dist/wikipage/wikimedia-client.js.map +1 -0
  569. package/dist/worker-BgQ0Xl8T.d.cts +181 -0
  570. package/dist/worker.cjs +5259 -0
  571. package/dist/worker.cjs.map +1 -0
  572. package/dist/worker.d.cts +2 -0
  573. package/dist/worker.d.ts +2 -0
  574. package/dist/worker.js +5 -0
  575. package/dist/worker.js.map +1 -0
  576. package/package.json +78 -0
@@ -0,0 +1,41 @@
1
+ Help Type: command
2
+ Command: {{ commandName }} <archive-uri>/chapter add
3
+
4
+ chapter add
5
+
6
+ Purpose:
7
+ Insert a new chapter into an existing `.wikg` chapter tree.
8
+
9
+ Usage:
10
+ {{ commandName }} <archive-uri>/chapter add [--title <title>] [--parent <chapter-uri>] [--input <path|->] [--llm <json>] [--json] [--help|-h]
11
+
12
+ Behavior:
13
+ - Without `--input`, creates an empty planned chapter with no source, graph, or summary.
14
+ - Empty planned chapters can be used as chapter directories, groups, or drafting placeholders.
15
+ - With `--input <path>`, creates a chapter and writes normalized source text.
16
+ - With `--input -`, reads source text from stdin.
17
+ - Source input must not be empty or whitespace-only when `--input` is used.
18
+ - Omitting `--title` creates an untitled planned chapter.
19
+ - Omitting `--parent` adds the chapter at the top level.
20
+ - `--parent <chapter-uri>` adds the chapter under an existing chapter.
21
+ - Does not call an LLM provider.
22
+
23
+ Output shape:
24
+ Prints the new chapter status.
25
+ The `Chapter: <id>` line is the new chapter id for later commands.
26
+ With `--json`, prints the new chapter status as one JSON object.
27
+
28
+ Typical next step:
29
+ {{ commandName }} wikg://local/job add --input <archive-uri|chapter-uri> --task reading-graph --accept-cost
30
+
31
+ Examples:
32
+ {{ commandName }} wikg://book.wikg/chapter add --title "Part I"
33
+ {{ commandName }} wikg://book.wikg/chapter add --title "Chapter 1" --input ./chapter.txt --parent wikg://book.wikg/chapter/3
34
+ cat chapter.txt | {{ commandName }} wikg://book.wikg/chapter add --title "Chapter 1" --input -
35
+
36
+ See also:
37
+ - {{ commandName }} wikg://book.wikg/chapter --help
38
+ - {{ commandName }} wikg://book.wikg/chapter/3/source set --help
39
+ - {{ commandName }} help format
40
+ - {{ commandName }} help readiness
41
+ - {{ commandName }} --help
@@ -0,0 +1,33 @@
1
+ Help Type: command
2
+ Command: {{ commandName }} <archive-uri>/chapter
3
+
4
+ chapter collection
5
+
6
+ Purpose:
7
+ List every chapter and its stored artifact readiness.
8
+
9
+ Usage:
10
+ {{ commandName }} <archive-uri>/chapter [--all] [--limit <n>] [--cursor <token>] [--json|--jsonl] [--llm <json>] [--help|-h]
11
+
12
+ Output shape:
13
+ wikg://chapter/<id> <title-or-[untitled]> source:<ready|missing> reading-graph:<ready|missing> reading-summary:<ready|missing> knowledge-graph:<ready|missing>
14
+
15
+ With machine-readable output, each chapter object includes `uri`, `title`, and `state`.
16
+
17
+ Behavior:
18
+ - Includes sourced, generated, and unfinished chapters.
19
+ - Some chapters are structural table-of-contents nodes that organize child chapters; missing generated artifacts alone does not make them abnormal.
20
+ - Read `{{ commandName }} help uri` before choosing `--limit`, `--all`, `--json`, or `--jsonl`.
21
+ - Chapter ids are encoded in the returned `wikg://chapter/<id>` URIs.
22
+ - Does not call an LLM provider.
23
+ - Does not mutate chapter content or summaries.
24
+
25
+ Use this before mutation:
26
+ Discover ids and missing generated artifacts with:
27
+ {{ commandName }} <archive-uri>/chapter
28
+
29
+ See also:
30
+ - {{ commandName }} wikg://book.wikg/chapter/3/state --help
31
+ - {{ commandName }} help readiness
32
+ - {{ commandName }} help uri
33
+ - {{ commandName }} --help
@@ -0,0 +1,36 @@
1
+ Help Type: command
2
+ Command: {{ commandName }} <chapter-uri> move
3
+
4
+ chapter move
5
+
6
+ Purpose:
7
+ Move one existing chapter to a new parent or sibling position.
8
+
9
+ Usage:
10
+ {{ commandName }} <chapter-uri> move --parent <chapter-uri> [--first|--last] [--llm <json>] [--help|-h]
11
+ {{ commandName }} <chapter-uri> move --root [--first|--last] [--llm <json>] [--help|-h]
12
+ {{ commandName }} <chapter-uri> move --before <chapter-uri> [--llm <json>] [--help|-h]
13
+ {{ commandName }} <chapter-uri> move --after <chapter-uri> [--llm <json>] [--help|-h]
14
+ {{ commandName }} <chapter-uri> move --first [--llm <json>] [--help|-h]
15
+ {{ commandName }} <chapter-uri> move --last [--llm <json>] [--help|-h]
16
+
17
+ Behavior:
18
+ - Moves only the chapter tree node. Source text, Reading Graph data, and summary stay attached to the same chapter id.
19
+ - `--parent <chapter-uri>` moves the chapter under another chapter.
20
+ - `--root` moves the chapter to the top level.
21
+ - `--before <chapter-uri>` or `--after <chapter-uri>` moves the chapter next to the target chapter.
22
+ - `--first` or `--last` moves within the target parent when combined with `--parent` or `--root`.
23
+ - Without `--parent` or `--root`, `--first` and `--last` reorder within the current parent.
24
+ - Cannot move a chapter into or next to its own descendant.
25
+ - Does not call an LLM provider.
26
+
27
+ Examples:
28
+ {{ commandName }} wikg://book.wikg/chapter/8 move --parent wikg://book.wikg/chapter/3 --first
29
+ {{ commandName }} wikg://book.wikg/chapter/8 move --root --last
30
+ {{ commandName }} wikg://book.wikg/chapter/8 move --before wikg://book.wikg/chapter/9
31
+
32
+ See also:
33
+ - {{ commandName }} wikg://book.wikg/chapter --help
34
+ - {{ commandName }} wikg://book.wikg/chapter/tree --help
35
+ - {{ commandName }} help uri
36
+ - {{ commandName }} --help
@@ -0,0 +1,26 @@
1
+ Help Type: command
2
+ Command: {{ commandName }} <chapter-uri> remove
3
+
4
+ chapter remove
5
+
6
+ Purpose:
7
+ Remove a chapter from the `.wikg` chapter tree.
8
+
9
+ Usage:
10
+ {{ commandName }} <chapter-uri> remove [--recursive] [--llm <json>] [--help|-h]
11
+
12
+ Behavior:
13
+ - Removes the target chapter from the TOC tree.
14
+ - Removes that chapter's source text, Reading Graph data, and summary.
15
+ - Fails when the chapter has children unless `--recursive` is provided.
16
+ - With `--recursive`, removes the whole selected subtree and its stored data.
17
+ - Does not call an LLM provider.
18
+
19
+ Safety:
20
+ This is a destructive in-place edit. Read `<archive-uri>/chapter` first and keep your own copy if the archive is important.
21
+
22
+ See also:
23
+ - {{ commandName }} wikg://book.wikg/chapter --help
24
+ - {{ commandName }} wikg://book.wikg/chapter/3 reset --help
25
+ - {{ commandName }} help readiness
26
+ - {{ commandName }} --help
@@ -0,0 +1,29 @@
1
+ Help Type: command
2
+ Command: {{ commandName }} <chapter-uri> reset
3
+
4
+ chapter reset
5
+
6
+ Purpose:
7
+ Move a chapter backward by deleting later-stage artifacts.
8
+
9
+ Usage:
10
+ {{ commandName }} <chapter-uri> reset --to <planned|source|reading-graph> [--llm <json>] [--help|-h]
11
+
12
+ Targets:
13
+ planned Delete source text, Reading Graph data, and summary.
14
+ source Keep source text; delete Reading Graph data and summary.
15
+ reading-graph Keep source text and Reading Graph data; delete summary.
16
+
17
+ Behavior:
18
+ - `reading-summary` is not supported because reset is a backward operation.
19
+ - Reset is destructive and may discard work.
20
+ - Does not call an LLM provider.
21
+ - After resetting to `source` or `reading-graph`, use `{{ commandName }} wikg://local/job add --input <archive-uri|chapter-uri> --task <reading-graph|reading-summary|knowledge-graph> --accept-cost` to generate again.
22
+ - After resetting to `planned`, restore source text before starting generated tasks.
23
+
24
+ See also:
25
+ - {{ commandName }} wikg://local/job --help
26
+ - {{ commandName }} wikg://book.wikg/chapter/3/state --help
27
+ - {{ commandName }} help readiness
28
+ - {{ commandName }} help runtime
29
+ - {{ commandName }} --help
@@ -0,0 +1,34 @@
1
+ Help Type: command
2
+ Command: {{ commandName }} <chapter-uri>/source set
3
+
4
+ Purpose:
5
+ Fill a planned chapter with normalized source text.
6
+
7
+ Usage:
8
+ {{ commandName }} <chapter-uri>/source set [text] [--input <path|->] [--llm <json>] [--json] [--help|-h]
9
+
10
+ Input:
11
+ - Source text is read from a positional value, `--input <path>`, or `--input -` for stdin.
12
+
13
+ Preconditions:
14
+ - The chapter must be `planned`.
15
+ - To replace source on a later-stage chapter, first reset it to `planned`.
16
+
17
+ Behavior:
18
+ - Writes normalized source text.
19
+ - Moves the chapter to `source`.
20
+ - Does not generate Reading Graph data.
21
+ - Does not generate or modify a summary.
22
+ - Does not call an LLM provider.
23
+ - With `--json`, prints the updated chapter status as one JSON object.
24
+
25
+ Typical next step:
26
+ {{ commandName }} wikg://local/job add --input <archive-uri|chapter-uri> --task reading-graph --accept-cost
27
+
28
+ See also:
29
+ - {{ commandName }} wikg://book.wikg/chapter/3/state --help
30
+ - {{ commandName }} wikg://book.wikg/chapter/3 reset --help
31
+ - {{ commandName }} wikg://local/job --help
32
+ - {{ commandName }} help format
33
+ - {{ commandName }} help readiness
34
+ - {{ commandName }} --help
@@ -0,0 +1,31 @@
1
+ Help Type: command
2
+ Command: {{ commandName }} <chapter-uri>/summary set
3
+
4
+ Purpose:
5
+ Fill a Reading Graph-stage chapter with a manual final summary.
6
+
7
+ Usage:
8
+ {{ commandName }} <chapter-uri>/summary set [text] [--input <path|->] [--llm <json>] [--json] [--help|-h]
9
+
10
+ Input:
11
+ - Summary text is read from a positional value, `--input <path>`, or `--input -` for stdin.
12
+ - Summary text is stored as the chapter's final summary.
13
+ - A common workflow is `read > /tmp/summary.md`, edit the file, then pass it back with `--input`.
14
+
15
+ Preconditions:
16
+ - The chapter must be `reading-graph`.
17
+ - If the chapter is `source`, run:
18
+ {{ commandName }} wikg://local/job add --input <archive-uri|chapter-uri> --task reading-graph --accept-cost
19
+
20
+ Behavior:
21
+ - Moves the chapter to `reading-summary`.
22
+ - Does not generate or modify Reading Graph data.
23
+ - Does not call an LLM provider.
24
+ - With `--json`, prints the updated chapter status as one JSON object.
25
+
26
+ See also:
27
+ - {{ commandName }} wikg://local/job --help
28
+ - {{ commandName }} wikg://book.wikg/chapter/3/state --help
29
+ - {{ commandName }} help readiness
30
+ - {{ commandName }} help runtime
31
+ - {{ commandName }} --help
@@ -0,0 +1,29 @@
1
+ Help Type: command
2
+ Command: {{ commandName }} <chapter-uri>/title set
3
+
4
+ Purpose:
5
+ Rename an existing chapter in the archive TOC.
6
+
7
+ Usage:
8
+ {{ commandName }} <chapter-uri>/title set <title> [--help|-h]
9
+ {{ commandName }} <chapter-uri>/title clear [--help|-h]
10
+
11
+ Behavior:
12
+ - Updates only the chapter title stored in the TOC.
13
+ - Does not change source text, graph nodes, summaries, or metadata.
14
+ - `set <title>` sets the explicit title.
15
+ - `clear` removes the explicit title and shows `[untitled]`.
16
+ - Does not call an LLM provider.
17
+
18
+ Output shape:
19
+ Prints the updated chapter object.
20
+
21
+ Examples:
22
+ {{ commandName }} wikg://book.wikg/chapter/12/title set "New Chapter Title"
23
+ {{ commandName }} wikg://book.wikg/chapter/12/title clear
24
+
25
+ See also:
26
+ - {{ commandName }} wikg://book.wikg/chapter --help
27
+ - {{ commandName }} wikg://book.wikg/chapter/12/state --help
28
+ - {{ commandName }} help uri
29
+ - {{ commandName }} --help
@@ -0,0 +1,58 @@
1
+ Help Type: command
2
+ Command: {{ commandName }} <archive-uri>/chapter/tree
3
+
4
+ chapter tree
5
+
6
+ Purpose:
7
+ Get or set the complete chapter tree.
8
+
9
+ Usage:
10
+ {{ commandName }} <archive-uri>/chapter/tree [--json] [--llm <json>] [--help|-h]
11
+ {{ commandName }} <archive-uri>/chapter/tree set --input <path|-> [--dry-run] [--llm <json>] [--help|-h]
12
+
13
+ Tree JSON shape:
14
+ Reading without `--json` prints a readable tree. Add `--json` when you need editable tree JSON.
15
+
16
+ {
17
+ "chapters": [
18
+ {
19
+ "id": 1,
20
+ "title": "Part I",
21
+ "children": [
22
+ { "id": 2, "title": null, "children": [] }
23
+ ]
24
+ }
25
+ ]
26
+ }
27
+
28
+ Apply rules:
29
+ - `set` reads tree JSON from `--input <path>` or `--input -` for stdin.
30
+ - Every existing chapter id must appear exactly once.
31
+ - Unknown, duplicated, or missing chapter ids are rejected.
32
+ - `children` is required on every node.
33
+ - `title` is optional when setting the tree.
34
+ - Omitted `title` means keep the current title.
35
+ - `title: "text"` sets or replaces the chapter title.
36
+ - `title: null` clears the chapter title.
37
+ - Extra fields are rejected.
38
+ - Applying a tree never creates chapters, deletes chapters, or edits source, graph, or summary data.
39
+
40
+ Dry run:
41
+ `--dry-run` validates the input and prints moved, renamed, and unchanged counts without changing the archive.
42
+
43
+ Structural chapters:
44
+ Some chapters are table-of-contents nodes that organize child chapters. Check this tree before treating a chapter with missing generated artifacts as abnormal.
45
+
46
+ Examples:
47
+ {{ commandName }} wikg://book.wikg/chapter/tree
48
+ {{ commandName }} wikg://book.wikg/chapter/tree --json > tree.json
49
+ {{ commandName }} wikg://book.wikg/chapter/tree set --input tree.json --dry-run
50
+ {{ commandName }} wikg://book.wikg/chapter/tree set --input tree.json
51
+ cat tree.json | {{ commandName }} wikg://book.wikg/chapter/tree set --input -
52
+
53
+ See also:
54
+ - {{ commandName }} wikg://book.wikg/chapter/3 move --help
55
+ - {{ commandName }} wikg://book.wikg/chapter/3/title set --help
56
+ - {{ commandName }} help readiness
57
+ - {{ commandName }} help uri
58
+ - {{ commandName }} --help
@@ -0,0 +1,59 @@
1
+ Help Type: command
2
+ Command: {{ commandName }} <chapter-uri> / <archive-uri>/chapter
3
+
4
+ Edit chapters inside an existing `.wikg` archive.
5
+
6
+ Usage:
7
+ {{ commandName }} <archive-uri>/chapter [--llm <json>] [--help|-h]
8
+ {{ commandName }} <chapter-uri>/state [--json] [--help|-h]
9
+ {{ commandName }} <chapter-uri>/state/<source|reading-graph|reading-summary|knowledge-graph> [--json] [--help|-h]
10
+ {{ commandName }} <archive-uri>/chapter add [--title <title>] [--parent <id>] [--input <path|->] [--llm <json>] [--json] [--help|-h]
11
+ {{ commandName }} <chapter-uri> move (--parent <id>|--root|--before <id>|--after <id>|--first|--last) [--llm <json>] [--help|-h]
12
+ {{ commandName }} <chapter-uri> remove [--recursive] [--llm <json>] [--help|-h]
13
+ {{ commandName }} <chapter-uri> reset --to <planned|source|reading-graph> [--llm <json>] [--help|-h]
14
+ {{ commandName }} <chapter-uri>/source set [text] [--input <path|->] [--llm <json>] [--json] [--help|-h]
15
+ {{ commandName }} <chapter-uri>/summary set [text] [--input <path|->] [--llm <json>] [--json] [--help|-h]
16
+ {{ commandName }} <chapter-uri>/title set <title> [--llm <json>] [--help|-h]
17
+ {{ commandName }} <chapter-uri>/title clear [--llm <json>] [--help|-h]
18
+ {{ commandName }} <archive-uri>/chapter/tree [--json] [--llm <json>] [--help|-h]
19
+ {{ commandName }} <archive-uri>/chapter/tree set --input <path|-> [--dry-run] [--llm <json>] [--help|-h]
20
+
21
+ Chapter stages:
22
+ planned TOC chapter exists, but no source is stored.
23
+ source Normalized source text is stored.
24
+ reading-graph Source plus generated Reading Graph are stored.
25
+ reading-summary Source, Reading Graph, and final summary are stored.
26
+
27
+ Input rules:
28
+ - Use Wiki Graph URIs; bare `.wikg` filesystem paths are not accepted.
29
+ - `<chapter-uri>` includes the numeric chapter id printed by the chapter collection or `add`.
30
+ - `add` creates an empty planned chapter. Use this for chapter directories, groups, and drafting placeholders.
31
+ - `add --input <path>` creates a chapter and fills it from source text; use `--input -` for stdin.
32
+ - `<chapter-uri>/source set` and `<chapter-uri>/summary set` read a positional value, `--input <path>`, or `--input -` for stdin.
33
+ - `<chapter-uri>/title set <title>` renames a chapter in the tree; `<chapter-uri>/title clear` removes the explicit title.
34
+ - `move` changes parent/order only; it does not edit source, graph, or summary data.
35
+ - `tree` prints the chapter tree as JSON with `title: null` for untitled chapters.
36
+ - `<archive-uri>/chapter/tree set --input <path|->` applies a complete chapter tree JSON. It can reorder chapters and change titles when a node includes `title`.
37
+ - `reset --to` accepts `planned`, `source`, or `reading-graph`.
38
+ - Structure edits, `/title set`, `/source set`, `/summary set`, and `reset` do not call an LLM provider.
39
+ - To generate reading-graph, reading-summary, or knowledge-graph, use `{{ commandName }} wikg://local/job add --input <archive-uri|chapter-uri> --task <reading-graph|reading-summary|knowledge-graph> --accept-cost`.
40
+ - `<chapter-uri>/state` shows the aggregate chapter state. `<chapter-uri>/state/<target>` checks one target.
41
+ - Append `--help` after an action for action-specific details, for example `{{ commandName }} wikg://book.wikg/chapter/3 reset --help`.
42
+
43
+ See also:
44
+ - {{ commandName }} wikg://book.wikg/chapter
45
+ - {{ commandName }} wikg://book.wikg/chapter/3/state
46
+ - {{ commandName }} wikg://book.wikg/chapter/3/state/knowledge-graph
47
+ - {{ commandName }} wikg://book.wikg/chapter/tree
48
+ - {{ commandName }} wikg://book.wikg/chapter/3/title set "New Title"
49
+ - {{ commandName }} wikg://book.wikg/chapter/3/title clear
50
+ - {{ commandName }} wikg://book.wikg/chapter add --input chapter.txt
51
+ - {{ commandName }} wikg://book.wikg/chapter/3/source set --input chapter.txt
52
+ - {{ commandName }} wikg://book.wikg/chapter/3/summary set --input summary.md
53
+ - cat tree.json | {{ commandName }} wikg://book.wikg/chapter/tree set --input -
54
+ - {{ commandName }} wikg://local/job --help
55
+ - {{ commandName }} help format
56
+ - {{ commandName }} help readiness
57
+ - {{ commandName }} help runtime
58
+ - {{ commandName }} help uri
59
+ - {{ commandName }} --help
@@ -0,0 +1,28 @@
1
+ Help Type: command
2
+ Command: {{ commandName }} <cover-uri>
3
+
4
+ cover
5
+
6
+ Purpose:
7
+ Write the raw cover bytes stored in the archive.
8
+
9
+ Usage:
10
+ {{ commandName }} <cover-uri> [--llm <json>] [--help|-h]
11
+
12
+ Output shape:
13
+ - Raw binary bytes on stdout
14
+
15
+ Notes:
16
+ - Redirect or pipe stdout.
17
+ - The command refuses to write binary data to an interactive terminal.
18
+ - The command fails if the archive has no cover.
19
+ - Use `{{ commandName }} <archive-uri>/meta` first when you need stored metadata.
20
+ - For multimodal agents, project the cover to a normal image file, then inspect that file with image/OCR tools.
21
+
22
+ Examples:
23
+ {{ commandName }} wikg://book.wikg/cover > /tmp/cover.bin
24
+ {{ commandName }} wikg:///books/book.wikg/cover > ./cover.bin
25
+
26
+ Related help:
27
+ - Runtime stdout behavior and binary-output safety:
28
+ {{ commandName }} help runtime
@@ -0,0 +1,55 @@
1
+ Help Type: command
2
+ Command: {{ commandName }} <object-uri>/meta
3
+
4
+ meta
5
+
6
+ Purpose:
7
+ Read or edit metadata attached to any Wiki Graph object.
8
+
9
+ Usage:
10
+ {{ commandName }} <object-uri>/meta [--json] [--help|-h]
11
+ {{ commandName }} <object-uri>/meta set --json <object> [--help|-h]
12
+ {{ commandName }} <object-uri>/meta set --json --input <path|-> [--help|-h]
13
+ {{ commandName }} <object-uri>/meta set --json-input <object> [--json] [--help|-h]
14
+ {{ commandName }} <object-uri>/meta put <key> <value> [--help|-h]
15
+ {{ commandName }} <object-uri>/meta put <key> --json <value> [--help|-h]
16
+ {{ commandName }} <object-uri>/meta put <key> --input <path|-> [--help|-h]
17
+ {{ commandName }} <object-uri>/meta put <key> --json-input <value> [--json] [--help|-h]
18
+ {{ commandName }} <object-uri>/meta delete <key> [--json] [--help|-h]
19
+ {{ commandName }} <object-uri>/meta clear [--json] [--help|-h]
20
+
21
+ Input:
22
+ - `set` replaces the whole metadata map and requires a JSON object.
23
+ - `put` writes one key. Without `--json`, the value is stored as a string.
24
+ - `--json-input <json>` reads an inline JSON value.
25
+ - `--json --input <path>` reads JSON from a file.
26
+ - Use `--input -` to read from stdin.
27
+ - Metadata keys are command arguments, not URI segments.
28
+
29
+ Behavior:
30
+ - Archive-level metadata is addressed as `wikg://book.wikg/meta`.
31
+ - Object metadata is addressed as `<object-uri>/meta`, for example `wikg://book.wikg/entity/Q42/meta`.
32
+ - Without `--json`, output is one `<key>: <value>` line per metadata entry.
33
+ - Array values are printed as space-joined item strings in text output.
34
+ - Add `--json` for a stable machine-readable metadata map.
35
+ - `--jsonl` is not supported.
36
+ - `<object-uri>/meta/<key>` is rejected. Read the metadata object and filter the result.
37
+ - Deleting an object may remove metadata attached to that object.
38
+ - This command does not call an LLM provider.
39
+
40
+ Examples:
41
+ {{ commandName }} wikg://book.wikg/meta
42
+ {{ commandName }} wikg://book.wikg/meta --json
43
+ {{ commandName }} wikg://book.wikg/meta put title "New Title"
44
+ {{ commandName }} wikg://book.wikg/entity/Q42/meta put note "reviewed"
45
+ {{ commandName }} wikg://book.wikg/entity/Q42/meta put rank --json 7
46
+ {{ commandName }} wikg://book.wikg/entity/Q42/meta delete note
47
+ {{ commandName }} wikg://book.wikg/entity/Q42/meta clear
48
+
49
+ Where to go next:
50
+ - Need chapter tree editing:
51
+ {{ commandName }} wikg://book.wikg/chapter/tree --help
52
+ - Need URI object boundaries and machine-readable output:
53
+ {{ commandName }} help uri
54
+ - Need archive-vs-source mental model:
55
+ {{ commandName }} --help