@hawkeyexl/manni 4.4.1 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/README.md +1 -1
  2. package/dist/batch-OZOACN4G.js +41 -0
  3. package/dist/build-Z5VOVADH.js +32 -0
  4. package/dist/calibrate-TZYT42DR.js +36 -0
  5. package/dist/capture-SL4MNDDP.js +34 -0
  6. package/dist/check-5OMA42Y6.js +26 -0
  7. package/dist/{check-HYNGXYJV.js → check-OAJWC3WD.js} +7 -5
  8. package/dist/{check-ASPIHA6B.js → check-PKY7KTQE.js} +13 -14
  9. package/dist/check-WB2QDHJQ.js +880 -0
  10. package/dist/check-WB2QDHJQ.js.map +1 -0
  11. package/dist/{chunk-MWJLZMBL.js → chunk-2JFPBZJK.js} +11 -11
  12. package/dist/{chunk-QQUKGCAJ.js → chunk-2KRB3EG7.js} +2 -2
  13. package/dist/{chunk-DXNZS72W.js → chunk-2M6DVNI5.js} +10 -6
  14. package/dist/{chunk-DXNZS72W.js.map → chunk-2M6DVNI5.js.map} +1 -1
  15. package/dist/{chunk-QZ6LRSNV.js → chunk-3NWX34ZI.js} +19 -19
  16. package/dist/{chunk-IDV6HJCB.js → chunk-5G53XATW.js} +4 -4
  17. package/dist/{chunk-M2JCK5F6.js → chunk-6KKZXB2O.js} +19 -6
  18. package/dist/chunk-6KKZXB2O.js.map +1 -0
  19. package/dist/{chunk-PNPQTHBT.js → chunk-733Y2STG.js} +2 -2
  20. package/dist/{chunk-WB3QM6PP.js → chunk-73TC4DYH.js} +332 -2522
  21. package/dist/chunk-73TC4DYH.js.map +1 -0
  22. package/dist/{chunk-EPH54CAY.js → chunk-7WRP5FFP.js} +4 -4
  23. package/dist/{chunk-NXV7WE2D.js → chunk-APKH2T6E.js} +29 -591
  24. package/dist/chunk-APKH2T6E.js.map +1 -0
  25. package/dist/{chunk-I2AH3CJJ.js → chunk-B3TS4WRM.js} +17 -15
  26. package/dist/{chunk-I2AH3CJJ.js.map → chunk-B3TS4WRM.js.map} +1 -1
  27. package/dist/chunk-BWCWTHYS.js +146 -0
  28. package/dist/chunk-BWCWTHYS.js.map +1 -0
  29. package/dist/{chunk-MMTSSTG7.js → chunk-C3B2VJNC.js} +2 -2
  30. package/dist/{chunk-PU6DFJMY.js → chunk-C73RSUIC.js} +4 -4
  31. package/dist/chunk-CU57HT2E.js +116 -0
  32. package/dist/chunk-CU57HT2E.js.map +1 -0
  33. package/dist/chunk-CWXZ2MRT.js +222 -0
  34. package/dist/chunk-CWXZ2MRT.js.map +1 -0
  35. package/dist/{chunk-GCQRPUSB.js → chunk-DC5DDJVE.js} +6 -6
  36. package/dist/{chunk-6OYEI2VV.js → chunk-ECVQNGTH.js} +3 -3
  37. package/dist/chunk-FLAO4ZS3.js +502 -0
  38. package/dist/chunk-FLAO4ZS3.js.map +1 -0
  39. package/dist/chunk-FQGLRJGX.js +174 -0
  40. package/dist/chunk-FQGLRJGX.js.map +1 -0
  41. package/dist/{chunk-7UKO3ASZ.js → chunk-GAJIJKET.js} +3 -3
  42. package/dist/{chunk-6JSSEWBG.js → chunk-GREQKO6M.js} +202 -54
  43. package/dist/chunk-GREQKO6M.js.map +1 -0
  44. package/dist/chunk-HX44GB4Z.js +30 -0
  45. package/dist/chunk-HX44GB4Z.js.map +1 -0
  46. package/dist/{chunk-4IUC2MNL.js → chunk-IY7NYNPZ.js} +9 -11
  47. package/dist/{chunk-4IUC2MNL.js.map → chunk-IY7NYNPZ.js.map} +1 -1
  48. package/dist/{chunk-57NEQRVO.js → chunk-KCOFEWV5.js} +8 -6
  49. package/dist/{chunk-57NEQRVO.js.map → chunk-KCOFEWV5.js.map} +1 -1
  50. package/dist/chunk-M2RLHZ4J.js +849 -0
  51. package/dist/chunk-M2RLHZ4J.js.map +1 -0
  52. package/dist/{chunk-NLXTXE5Y.js → chunk-M6GSS72T.js} +185 -33
  53. package/dist/chunk-M6GSS72T.js.map +1 -0
  54. package/dist/{chunk-YTURO7SI.js → chunk-MHM4QEBV.js} +4 -4
  55. package/dist/{chunk-RL5XWQOL.js → chunk-MOWMCEOJ.js} +143 -54
  56. package/dist/chunk-MOWMCEOJ.js.map +1 -0
  57. package/dist/{chunk-C4SQM22E.js → chunk-MWBJ3KTF.js} +13 -11
  58. package/dist/chunk-MWBJ3KTF.js.map +1 -0
  59. package/dist/chunk-N7JSEDSC.js +233 -0
  60. package/dist/chunk-N7JSEDSC.js.map +1 -0
  61. package/dist/{chunk-JCDXE76J.js → chunk-NBMPHD4I.js} +2 -2
  62. package/dist/{chunk-37LP5HMZ.js → chunk-NHHOPZRA.js} +12 -10
  63. package/dist/{chunk-37LP5HMZ.js.map → chunk-NHHOPZRA.js.map} +1 -1
  64. package/dist/{chunk-YB4IBW3M.js → chunk-NTWW7J76.js} +2 -2
  65. package/dist/{chunk-UJCVAWP7.js → chunk-PCFG7E6B.js} +3 -3
  66. package/dist/{chunk-UJCVAWP7.js.map → chunk-PCFG7E6B.js.map} +1 -1
  67. package/dist/{chunk-FBEQCK47.js → chunk-PL4UAF4S.js} +73 -1304
  68. package/dist/chunk-PL4UAF4S.js.map +1 -0
  69. package/dist/chunk-QCHVR4ZM.js +286 -0
  70. package/dist/chunk-QCHVR4ZM.js.map +1 -0
  71. package/dist/{chunk-PIKOVN6W.js → chunk-QW77LCOU.js} +10 -10
  72. package/dist/{chunk-2B7ZNTPV.js → chunk-SM6NOMJS.js} +2 -2
  73. package/dist/chunk-SWSTHZBI.js +2464 -0
  74. package/dist/chunk-SWSTHZBI.js.map +1 -0
  75. package/dist/{chunk-JXLTXMJ7.js → chunk-T6SYGLWR.js} +3 -3
  76. package/dist/{chunk-CK7SKVHR.js → chunk-TBAMBLF3.js} +3 -12
  77. package/dist/chunk-TBAMBLF3.js.map +1 -0
  78. package/dist/chunk-TH4JVQPF.js +133 -0
  79. package/dist/chunk-TH4JVQPF.js.map +1 -0
  80. package/dist/{chunk-QRWGPQKO.js → chunk-TLXE7LYK.js} +4 -4
  81. package/dist/{chunk-M3W7J6MU.js → chunk-TUAAR3MM.js} +3280 -283
  82. package/dist/chunk-TUAAR3MM.js.map +1 -0
  83. package/dist/{chunk-SKSDRUUK.js → chunk-UAKNZVCD.js} +4 -4
  84. package/dist/{chunk-YJOGUXGP.js → chunk-UJSGS2Y5.js} +8 -6
  85. package/dist/{chunk-YJOGUXGP.js.map → chunk-UJSGS2Y5.js.map} +1 -1
  86. package/dist/{chunk-UQISLDAV.js → chunk-UWQ2UVHE.js} +8 -6
  87. package/dist/{chunk-UQISLDAV.js.map → chunk-UWQ2UVHE.js.map} +1 -1
  88. package/dist/chunk-WQWKYAAK.js +86 -0
  89. package/dist/chunk-WQWKYAAK.js.map +1 -0
  90. package/dist/{chunk-LJ2RDH3F.js → chunk-XG6PVB5S.js} +1 -23
  91. package/dist/chunk-XG6PVB5S.js.map +1 -0
  92. package/dist/{chunk-Q35YIDBV.js → chunk-XKBEHKWO.js} +29 -264
  93. package/dist/chunk-XKBEHKWO.js.map +1 -0
  94. package/dist/chunk-XPEWUK7J.js +532 -0
  95. package/dist/chunk-XPEWUK7J.js.map +1 -0
  96. package/dist/{chunk-MYMBCTDE.js → chunk-XXDXIIQ4.js} +2 -2
  97. package/dist/chunk-YGFIQ6Y5.js +17 -0
  98. package/dist/chunk-YGFIQ6Y5.js.map +1 -0
  99. package/dist/chunk-YLK2J5YK.js +610 -0
  100. package/dist/chunk-YLK2J5YK.js.map +1 -0
  101. package/dist/{chunk-3VK37OR2.js → chunk-Z4IZGEM3.js} +16 -12
  102. package/dist/{chunk-3VK37OR2.js.map → chunk-Z4IZGEM3.js.map} +1 -1
  103. package/dist/{cli-6HIDIFVT.js → cli-6EWVMEN6.js} +5 -3
  104. package/dist/{cli-6HIDIFVT.js.map → cli-6EWVMEN6.js.map} +1 -1
  105. package/dist/{cli-VI7VHWNZ.js → cli-6H7HVDMQ.js} +113 -20
  106. package/dist/{cli-VI7VHWNZ.js.map → cli-6H7HVDMQ.js.map} +1 -1
  107. package/dist/{cli-RPM5PELX.js → cli-EPVZHAZS.js} +24 -20
  108. package/dist/cli-EPVZHAZS.js.map +1 -0
  109. package/dist/{cli-MN7PYMBI.js → cli-LUCSGTVI.js} +17 -19
  110. package/dist/{cli-MN7PYMBI.js.map → cli-LUCSGTVI.js.map} +1 -1
  111. package/dist/{cli-LFP5ZGYS.js → cli-NIG4N3XM.js} +16 -15
  112. package/dist/{cli-LFP5ZGYS.js.map → cli-NIG4N3XM.js.map} +1 -1
  113. package/dist/{cli-PYPX6O6E.js → cli-PSKNB66T.js} +225 -58
  114. package/dist/cli-PSKNB66T.js.map +1 -0
  115. package/dist/{cli-3BIBYHFK.js → cli-UO4NHIB3.js} +17 -17
  116. package/dist/{cli-6UB5N6CU.js → cli-UQ7A3YA2.js} +17 -18
  117. package/dist/{cli-6UB5N6CU.js.map → cli-UQ7A3YA2.js.map} +1 -1
  118. package/dist/{cli-673OTRGE.js → cli-YHYDLQAF.js} +10 -10
  119. package/dist/cli.js +11 -11
  120. package/dist/config-P4HDNTYD.js +26 -0
  121. package/dist/conformance-ZFCMKM6M.js +18 -0
  122. package/dist/docmeta.js +9 -9
  123. package/dist/github-7ZCH5PSO.js +26 -0
  124. package/dist/github-POT6724K.js +31 -0
  125. package/dist/host-6GURH5HE.js +23 -0
  126. package/dist/index.d.ts +102 -12
  127. package/dist/index.js +185 -171
  128. package/dist/index.js.map +1 -1
  129. package/dist/{json-SY7KLNC7.js → json-KT2K62L5.js} +12 -13
  130. package/dist/lint-5AQ5C2BV.js +29 -0
  131. package/dist/list-5JZKX2NK.js +28 -0
  132. package/dist/list-SWPFXQMU.js +30 -0
  133. package/dist/{page-KSGV5RD4.js → page-UPSXRP75.js} +11 -12
  134. package/dist/prepare-6GNEWCNH.js +155 -0
  135. package/dist/prepare-6GNEWCNH.js.map +1 -0
  136. package/dist/{pretty-CXSDXNAS.js → pretty-Q6FQAOK4.js} +13 -14
  137. package/dist/{pretty-A5EGTN35.js → pretty-SQRPFPSQ.js} +12 -13
  138. package/dist/provider-AMGRDY6V.js +34 -0
  139. package/dist/release-IECYCLTD.js +36 -0
  140. package/dist/release-IECYCLTD.js.map +1 -0
  141. package/dist/{reporters-HUY7UXFS.js → reporters-45MMC2ID.js} +13 -13
  142. package/dist/{reporters-K2VUKSAK.js → reporters-XUV4MM64.js} +7 -5
  143. package/dist/reporters-XUV4MM64.js.map +1 -0
  144. package/dist/run-KMWY2IAN.js +32 -0
  145. package/dist/run-KMWY2IAN.js.map +1 -0
  146. package/dist/{term-BIQUPMOR.js → term-PCJUCWNF.js} +16 -17
  147. package/dist/{term-BIQUPMOR.js.map → term-PCJUCWNF.js.map} +1 -1
  148. package/dist/validate-IMNCZNWG.js +17 -0
  149. package/dist/validate-IMNCZNWG.js.map +1 -0
  150. package/package.json +2 -2
  151. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  152. package/plugin/manni/hooks/hooks.json +47 -0
  153. package/dist/batch-GFNLTGOH.js +0 -36
  154. package/dist/build-COYIQ25L.js +0 -31
  155. package/dist/calibrate-MDBLJKEE.js +0 -31
  156. package/dist/capture-LRML2PKV.js +0 -32
  157. package/dist/check-EDLBYL5N.js +0 -27
  158. package/dist/chunk-6JSSEWBG.js.map +0 -1
  159. package/dist/chunk-A5ULMVHQ.js +0 -164
  160. package/dist/chunk-A5ULMVHQ.js.map +0 -1
  161. package/dist/chunk-C4SQM22E.js.map +0 -1
  162. package/dist/chunk-CK7SKVHR.js.map +0 -1
  163. package/dist/chunk-FBEQCK47.js.map +0 -1
  164. package/dist/chunk-LJ2RDH3F.js.map +0 -1
  165. package/dist/chunk-M2JCK5F6.js.map +0 -1
  166. package/dist/chunk-M3W7J6MU.js.map +0 -1
  167. package/dist/chunk-NLXTXE5Y.js.map +0 -1
  168. package/dist/chunk-NXV7WE2D.js.map +0 -1
  169. package/dist/chunk-Q35YIDBV.js.map +0 -1
  170. package/dist/chunk-RL5XWQOL.js.map +0 -1
  171. package/dist/chunk-TK3FC4RF.js +0 -3090
  172. package/dist/chunk-TK3FC4RF.js.map +0 -1
  173. package/dist/chunk-TU2WUBVZ.js +0 -2
  174. package/dist/chunk-WB3QM6PP.js.map +0 -1
  175. package/dist/cli-PYPX6O6E.js.map +0 -1
  176. package/dist/cli-RPM5PELX.js.map +0 -1
  177. package/dist/github-6QMYOHC3.js +0 -27
  178. package/dist/github-SXPGP5DB.js +0 -32
  179. package/dist/lint-ASMJLLPA.js +0 -28
  180. package/dist/list-KZNVTNVC.js +0 -31
  181. package/dist/list-Q57YTFUQ.js +0 -29
  182. package/dist/run-3DYJNRIG.js +0 -33
  183. package/dist/validate-53RKM2XG.js +0 -16
  184. /package/dist/{batch-GFNLTGOH.js.map → batch-OZOACN4G.js.map} +0 -0
  185. /package/dist/{build-COYIQ25L.js.map → build-Z5VOVADH.js.map} +0 -0
  186. /package/dist/{calibrate-MDBLJKEE.js.map → calibrate-TZYT42DR.js.map} +0 -0
  187. /package/dist/{capture-LRML2PKV.js.map → capture-SL4MNDDP.js.map} +0 -0
  188. /package/dist/{check-ASPIHA6B.js.map → check-5OMA42Y6.js.map} +0 -0
  189. /package/dist/{check-EDLBYL5N.js.map → check-OAJWC3WD.js.map} +0 -0
  190. /package/dist/{check-HYNGXYJV.js.map → check-PKY7KTQE.js.map} +0 -0
  191. /package/dist/{chunk-MWJLZMBL.js.map → chunk-2JFPBZJK.js.map} +0 -0
  192. /package/dist/{chunk-QQUKGCAJ.js.map → chunk-2KRB3EG7.js.map} +0 -0
  193. /package/dist/{chunk-QZ6LRSNV.js.map → chunk-3NWX34ZI.js.map} +0 -0
  194. /package/dist/{chunk-IDV6HJCB.js.map → chunk-5G53XATW.js.map} +0 -0
  195. /package/dist/{chunk-PNPQTHBT.js.map → chunk-733Y2STG.js.map} +0 -0
  196. /package/dist/{chunk-EPH54CAY.js.map → chunk-7WRP5FFP.js.map} +0 -0
  197. /package/dist/{chunk-MMTSSTG7.js.map → chunk-C3B2VJNC.js.map} +0 -0
  198. /package/dist/{chunk-PU6DFJMY.js.map → chunk-C73RSUIC.js.map} +0 -0
  199. /package/dist/{chunk-GCQRPUSB.js.map → chunk-DC5DDJVE.js.map} +0 -0
  200. /package/dist/{chunk-6OYEI2VV.js.map → chunk-ECVQNGTH.js.map} +0 -0
  201. /package/dist/{chunk-7UKO3ASZ.js.map → chunk-GAJIJKET.js.map} +0 -0
  202. /package/dist/{chunk-YTURO7SI.js.map → chunk-MHM4QEBV.js.map} +0 -0
  203. /package/dist/{chunk-JCDXE76J.js.map → chunk-NBMPHD4I.js.map} +0 -0
  204. /package/dist/{chunk-YB4IBW3M.js.map → chunk-NTWW7J76.js.map} +0 -0
  205. /package/dist/{chunk-PIKOVN6W.js.map → chunk-QW77LCOU.js.map} +0 -0
  206. /package/dist/{chunk-2B7ZNTPV.js.map → chunk-SM6NOMJS.js.map} +0 -0
  207. /package/dist/{chunk-JXLTXMJ7.js.map → chunk-T6SYGLWR.js.map} +0 -0
  208. /package/dist/{chunk-QRWGPQKO.js.map → chunk-TLXE7LYK.js.map} +0 -0
  209. /package/dist/{chunk-SKSDRUUK.js.map → chunk-UAKNZVCD.js.map} +0 -0
  210. /package/dist/{chunk-MYMBCTDE.js.map → chunk-XXDXIIQ4.js.map} +0 -0
  211. /package/dist/{cli-3BIBYHFK.js.map → cli-UO4NHIB3.js.map} +0 -0
  212. /package/dist/{chunk-TU2WUBVZ.js.map → cli-YHYDLQAF.js.map} +0 -0
  213. /package/dist/{cli-673OTRGE.js.map → config-P4HDNTYD.js.map} +0 -0
  214. /package/dist/{github-6QMYOHC3.js.map → conformance-ZFCMKM6M.js.map} +0 -0
  215. /package/dist/{github-SXPGP5DB.js.map → github-7ZCH5PSO.js.map} +0 -0
  216. /package/dist/{json-SY7KLNC7.js.map → github-POT6724K.js.map} +0 -0
  217. /package/dist/{lint-ASMJLLPA.js.map → host-6GURH5HE.js.map} +0 -0
  218. /package/dist/{list-KZNVTNVC.js.map → json-KT2K62L5.js.map} +0 -0
  219. /package/dist/{list-Q57YTFUQ.js.map → lint-5AQ5C2BV.js.map} +0 -0
  220. /package/dist/{page-KSGV5RD4.js.map → list-5JZKX2NK.js.map} +0 -0
  221. /package/dist/{pretty-A5EGTN35.js.map → list-SWPFXQMU.js.map} +0 -0
  222. /package/dist/{pretty-CXSDXNAS.js.map → page-UPSXRP75.js.map} +0 -0
  223. /package/dist/{reporters-HUY7UXFS.js.map → pretty-Q6FQAOK4.js.map} +0 -0
  224. /package/dist/{reporters-K2VUKSAK.js.map → pretty-SQRPFPSQ.js.map} +0 -0
  225. /package/dist/{run-3DYJNRIG.js.map → provider-AMGRDY6V.js.map} +0 -0
  226. /package/dist/{validate-53RKM2XG.js.map → reporters-45MMC2ID.js.map} +0 -0
@@ -10,18 +10,21 @@ import {
10
10
  documentBase,
11
11
  documentSetPatterns,
12
12
  emitLocalizations,
13
+ extractorFor,
13
14
  formatOf,
14
15
  isLanguageTag,
15
16
  isSafeRelativePath,
16
17
  mergePage,
18
+ metadataOf,
19
+ mintTreeSections,
17
20
  openMetaView,
18
- ownMetadata,
19
21
  parseLocalizations,
22
+ parseTree,
20
23
  resolveDocumentSet,
21
24
  routesFrom,
22
25
  searchIndexFilename,
23
26
  vectorIndexFilename
24
- } from "./chunk-NLXTXE5Y.js";
27
+ } from "./chunk-M6GSS72T.js";
25
28
  import {
26
29
  bundledShapesPath,
27
30
  compactIri,
@@ -29,7 +32,7 @@ import {
29
32
  loadGraph,
30
33
  storeToQuads,
31
34
  validateGraph
32
- } from "./chunk-MYMBCTDE.js";
35
+ } from "./chunk-XXDXIIQ4.js";
33
36
  import {
34
37
  COVERAGE_FIELDS,
35
38
  DEFAULT_MODEL,
@@ -69,29 +72,32 @@ import {
69
72
  loadRunConfig,
70
73
  profileFor,
71
74
  withPrefix
72
- } from "./chunk-M2JCK5F6.js";
75
+ } from "./chunk-6KKZXB2O.js";
73
76
  import {
74
77
  mergeMetaProvenance
75
- } from "./chunk-A5ULMVHQ.js";
78
+ } from "./chunk-GREQKO6M.js";
76
79
  import {
77
80
  isMissing,
78
81
  spliceManifestValue
79
- } from "./chunk-M3W7J6MU.js";
82
+ } from "./chunk-TUAAR3MM.js";
80
83
  import {
84
+ DocmetaError,
81
85
  urlManifestMessage,
82
86
  writeFileAtomic
83
- } from "./chunk-57NEQRVO.js";
87
+ } from "./chunk-KCOFEWV5.js";
88
+ import {
89
+ noticeOnce,
90
+ warn
91
+ } from "./chunk-HX44GB4Z.js";
84
92
  import {
85
93
  assertKnownProvider,
86
94
  assertLocalFlag,
87
95
  assertModelHasProvider,
88
96
  localNotice,
89
- noticeOnce,
90
97
  providerSpecFor,
91
98
  resolveIdentity,
92
- selectProvider,
93
- warn
94
- } from "./chunk-Q35YIDBV.js";
99
+ selectProvider
100
+ } from "./chunk-QCHVR4ZM.js";
95
101
  import {
96
102
  errorMessage
97
103
  } from "./chunk-G3T47CFV.js";
@@ -253,7 +259,7 @@ function emitRdfXml(quads, prefixes) {
253
259
 
254
260
  // src/graph/core/iirds-package.ts
255
261
  import { existsSync } from "node:fs";
256
- import { resolve } from "node:path";
262
+ import { extname, resolve } from "node:path";
257
263
  import { DataFactory } from "n3";
258
264
 
259
265
  // src/graph/core/zip.ts
@@ -330,6 +336,19 @@ function writeZip(entries) {
330
336
  // src/graph/core/iirds-package.ts
331
337
  var GRAPH_DOCUMENT = `${NS.graph}Document`;
332
338
  var XSD_STRING3 = `${NS.xsd}string`;
339
+ var MEDIA_TYPES = {
340
+ ".html": "text/html",
341
+ ".htm": "text/html",
342
+ ".adoc": "text/asciidoc",
343
+ ".asciidoc": "text/asciidoc",
344
+ ".rst": "text/x-rst",
345
+ ".dita": "application/dita+xml",
346
+ ".ditamap": "application/dita+xml",
347
+ ".xml": "application/xml"
348
+ };
349
+ function mediaTypeOf(path2) {
350
+ return MEDIA_TYPES[extname(path2).toLowerCase()] ?? "text/markdown";
351
+ }
333
352
  var CARRIED = [
334
353
  IIRDS_HAS_TOPIC_TYPE,
335
354
  IIRDS_HAS_SUBJECT,
@@ -390,7 +409,7 @@ function projectPackage(store, opts, cwd) {
390
409
  add(doc, IIRDS_HAS_RENDITION, iri(rendition));
391
410
  add(rendition, RDF_TYPE, iri(IIRDS_RENDITION));
392
411
  add(rendition, IIRDS_SOURCE, lit(zipPath));
393
- add(rendition, IIRDS_FORMAT, lit("text/markdown"));
412
+ add(rendition, IIRDS_FORMAT, lit(mediaTypeOf(path2)));
394
413
  contentFiles.push({ zipPath, absPath });
395
414
  } else {
396
415
  warnings.push(
@@ -720,6 +739,21 @@ var FRONTMATTER = /^---[ \t]*\r?\n(?:[\s\S]*?\r?\n)?(?:---|\.\.\.)[ \t]*(?:\r?\n
720
739
  function stripFrontmatter(markdown) {
721
740
  return markdown.replace(FRONTMATTER, "");
722
741
  }
742
+ function plainText(nodes) {
743
+ return nodes.map((n) => n.text.replace(/\r\n/g, "\n").trim()).filter((t) => t !== "");
744
+ }
745
+ function treeText(source, path2) {
746
+ const format = formatOf(path2);
747
+ if (format === "markdown" || format === "mdx") return void 0;
748
+ const minted = mintTreeSections(parseTree(source, path2, format).sections);
749
+ const sections = /* @__PURE__ */ new Map();
750
+ for (const [n, section] of minted.sections.entries()) {
751
+ const own = plainText(minted.owned[n] ?? []);
752
+ sections.set(section.slug, [section.title, ...own].join("\n\n"));
753
+ }
754
+ const lead = plainText(minted.unowned);
755
+ return { doc: lead.length > 0 ? lead.join("\n\n") : void 0, sections };
756
+ }
723
757
  function entry(id, type, fields) {
724
758
  const out = { id, type };
725
759
  if (fields.title !== void 0) out.title = fields.title;
@@ -736,6 +770,7 @@ function buildSearchIndex(graph, cwd, options = {}) {
736
770
  });
737
771
  const entries = [];
738
772
  const sourceOf = /* @__PURE__ */ new Map();
773
+ const treeTextOf = /* @__PURE__ */ new Map();
739
774
  const allSections = graph.instancesOf(GRAPH_SECTION);
740
775
  const sectionsOf = /* @__PURE__ */ new Map();
741
776
  for (const section of allSections) {
@@ -755,8 +790,10 @@ function buildSearchIndex(graph, cwd, options = {}) {
755
790
  `Source not found for ${path2} \u2014 indexed without body text.`
756
791
  );
757
792
  }
793
+ const tree = source === void 0 || path2 === void 0 ? void 0 : treeText(source, path2);
794
+ if (tree) treeTextOf.set(doc, tree);
758
795
  const body = source === void 0 ? void 0 : stripFrontmatter(source).replace(/\r\n/g, "\n");
759
- const text = body === void 0 ? void 0 : (sectionsOf.get(doc)?.length ?? 0) > 0 ? documentPreamble(body) : body;
796
+ const text = tree ? tree.doc : body === void 0 ? void 0 : (sectionsOf.get(doc)?.length ?? 0) > 0 ? documentPreamble(body) : body;
760
797
  entries.push(
761
798
  entry(doc, compactIri(GRAPH_DOCUMENT2), {
762
799
  title: graph.literal(doc, DCTERMS_TITLE2),
@@ -779,7 +816,8 @@ function buildSearchIndex(graph, cwd, options = {}) {
779
816
  occurrences = sectionOccurrences(graph, doc);
780
817
  occurrencesOf.set(doc, occurrences);
781
818
  }
782
- const text = source !== void 0 && title !== void 0 ? sectionOwnText(source, title, level, occurrences.get(section) ?? 0) : void 0;
819
+ const tree = treeTextOf.get(doc);
820
+ const text = tree ? tree.sections.get(section.slice(hash + 1)) : source !== void 0 && title !== void 0 ? sectionOwnText(source, title, level, occurrences.get(section) ?? 0) : void 0;
783
821
  entries.push(entry(section, compactIri(GRAPH_SECTION), { title, text }));
784
822
  }
785
823
  for (const concept of graph.instancesOf(SKOS_CONCEPT)) {
@@ -1243,6 +1281,7 @@ import { resolve as resolve6 } from "node:path";
1243
1281
 
1244
1282
  // src/graph/core/frontmatter-edit.ts
1245
1283
  import { Document, YAMLMap, YAMLSeq, isMap, parseDocument } from "yaml";
1284
+ var GRAPH_KEY = "graph";
1246
1285
  function frontmatterKind(content) {
1247
1286
  const body = content.charCodeAt(0) === 65279 ? content.slice(1) : content;
1248
1287
  if (/^---(\r?\n)/.test(body)) return "yaml";
@@ -1286,9 +1325,7 @@ function setField(doc, map, field, value) {
1286
1325
  map.set(field, node);
1287
1326
  }
1288
1327
  function applyGraphFields(content, path2, values, options = {}) {
1289
- const entries = Object.entries(values).filter(
1290
- ([, v]) => v !== void 0 && v !== null && !(Array.isArray(v) && v.length === 0)
1291
- );
1328
+ const entries = writable(values);
1292
1329
  const pageEntries = Object.entries(options.page ?? {});
1293
1330
  if (entries.length === 0 && pageEntries.length === 0) {
1294
1331
  return { content, applied: [], skipped: [] };
@@ -1340,6 +1377,23 @@ function applyGraphFields(content, path2, values, options = {}) {
1340
1377
  doc.set("graph", graph);
1341
1378
  }
1342
1379
  const graphMap = graph ?? doc.createNode({});
1380
+ const { applied, skipped } = mergeFields(doc, graphMap, entries, options.force);
1381
+ for (const [key, value] of pageEntries) {
1382
+ doc.set(key, doc.createNode(value));
1383
+ }
1384
+ if (applied.length === 0 && pageEntries.length === 0) {
1385
+ return { content, applied, skipped };
1386
+ }
1387
+ let newBlock = doc.toString();
1388
+ if (split.eol === "\r\n") newBlock = newBlock.replace(/(?<!\r)\n/g, "\r\n");
1389
+ return { content: split.open + newBlock + split.suffix, applied, skipped };
1390
+ }
1391
+ function writable(values) {
1392
+ return Object.entries(values).filter(
1393
+ ([, v]) => v !== void 0 && v !== null && !(Array.isArray(v) && v.length === 0)
1394
+ );
1395
+ }
1396
+ function mergeFields(doc, graphMap, entries, force) {
1343
1397
  const applied = [];
1344
1398
  const skipped = [];
1345
1399
  for (const [field, value] of entries) {
@@ -1364,22 +1418,45 @@ function applyGraphFields(content, path2, values, options = {}) {
1364
1418
  skipped.push(field);
1365
1419
  continue;
1366
1420
  }
1367
- if (target.has(leaf) && !options.force) {
1421
+ if (target.has(leaf) && !force) {
1368
1422
  skipped.push(field);
1369
1423
  continue;
1370
1424
  }
1371
1425
  setField(doc, target, leaf, value);
1372
1426
  applied.push(field);
1373
1427
  }
1374
- for (const [key, value] of pageEntries) {
1375
- doc.set(key, doc.createNode(value));
1428
+ return { applied, skipped };
1429
+ }
1430
+ function writeGraphFields(content, path2, format, values, options = {}) {
1431
+ if (format === "markdown" || format === "mdx") {
1432
+ return applyGraphFields(content, path2, values, options);
1376
1433
  }
1377
- if (applied.length === 0 && pageEntries.length === 0) {
1378
- return { content, applied, skipped };
1434
+ const entries = writable(values);
1435
+ const patch = {};
1436
+ let applied = [];
1437
+ let skipped = [];
1438
+ if (entries.length > 0) {
1439
+ const doc = new Document(
1440
+ metadataOf(content, path2, format).data[GRAPH_KEY] ?? {}
1441
+ );
1442
+ if (!isMap(doc.contents)) {
1443
+ throw new GraphError(`${path2}: metadata key "graph" is not a map`);
1444
+ }
1445
+ ({ applied, skipped } = mergeFields(
1446
+ doc,
1447
+ doc.contents,
1448
+ entries,
1449
+ options.force
1450
+ ));
1451
+ if (applied.length > 0) patch[GRAPH_KEY] = doc.toJS();
1379
1452
  }
1380
- let newBlock = doc.toString();
1381
- if (split.eol === "\r\n") newBlock = newBlock.replace(/(?<!\r)\n/g, "\r\n");
1382
- return { content: split.open + newBlock + split.suffix, applied, skipped };
1453
+ Object.assign(patch, options.page);
1454
+ if (Object.keys(patch).length === 0) return { content, applied, skipped };
1455
+ const apply = extractorFor(format)?.apply;
1456
+ if (apply === void 0) {
1457
+ throw new GraphError(`${path2}: manni cannot write ${format} metadata`);
1458
+ }
1459
+ return { content: apply(content, patch, { filePath: path2 }), applied, skipped };
1383
1460
  }
1384
1461
  function frontmatterData(content) {
1385
1462
  const split = splitYamlFrontmatter(content, "");
@@ -1579,9 +1656,13 @@ var FillGuard = class _FillGuard {
1579
1656
  if (guarded().length === 0) return { values: current, rejected };
1580
1657
  const baseline = await this.baseline();
1581
1658
  while (guarded().length > 0) {
1582
- const applied = applyGraphFields(content, path2, current, {
1583
- force: this.force
1584
- });
1659
+ const applied = writeGraphFields(
1660
+ content,
1661
+ path2,
1662
+ formatOf(path2, this.analyzeOptions.format),
1663
+ current,
1664
+ { force: this.force }
1665
+ );
1585
1666
  const model = analyzeDoc(
1586
1667
  applied.content,
1587
1668
  path2,
@@ -2153,7 +2234,8 @@ async function runFill(opts = {}) {
2153
2234
  ...stdinDocument === void 0 ? {} : { stdinDocument }
2154
2235
  };
2155
2236
  async function fillOne(path2, absPath, content) {
2156
- if (frontmatterKind(content) === "unsupported") {
2237
+ const pageFormat = formatOf(path2, format);
2238
+ if ((pageFormat === "markdown" || pageFormat === "mdx") && frontmatterKind(content) === "unsupported") {
2157
2239
  throw new GraphError(
2158
2240
  "only YAML frontmatter can be edited (found a TOML/JSON fence) \u2014 exclude this file or convert its frontmatter"
2159
2241
  );
@@ -2164,17 +2246,21 @@ async function runFill(opts = {}) {
2164
2246
  throw failure instanceof Error ? failure : new GraphError(errorMessage(failure));
2165
2247
  }
2166
2248
  if (absPath !== void 0) {
2167
- const own2 = ownMetadata(content).data;
2168
- if (GRAPH_KEY in own2) {
2169
- const home = await view.home(path2, own2, GRAPH_KEY);
2249
+ const own2 = metadataOf(content, path2, pageFormat).data;
2250
+ if (GRAPH_KEY2 in own2) {
2251
+ const home = await view.home(path2, own2, GRAPH_KEY2);
2170
2252
  if (home.kind !== "unowned") {
2171
2253
  throw new GraphError(
2172
- `"${GRAPH_KEY}" is owned by manifest ${home.file} (collection ${home.collection}); remove it from the document`
2254
+ `"${GRAPH_KEY2}" is owned by manifest ${home.file} (collection ${home.collection}); remove it from the document`
2173
2255
  );
2174
2256
  }
2175
2257
  }
2176
2258
  }
2177
- const present = new Set(existingGraphFields(effective));
2259
+ const held = metadataOf(effective, path2, pageFormat).data;
2260
+ const heldGraph = held[GRAPH_KEY2];
2261
+ const present = new Set(
2262
+ heldGraph !== null && typeof heldGraph === "object" && !Array.isArray(heldGraph) ? Object.keys(heldGraph) : []
2263
+ );
2178
2264
  const missing = opts.force ? fields : fields.filter((f) => !present.has(f));
2179
2265
  if (missing.length === 0 && !withSections) {
2180
2266
  return {
@@ -2305,8 +2391,8 @@ async function runFill(opts = {}) {
2305
2391
  if (config.fill.writeProvenance) {
2306
2392
  const recordable = realFields.filter((f) => !f.includes(".")).sort();
2307
2393
  if (recordable.length < realFields.length) sectionsUnrecorded.push(path2);
2308
- const held = existingMetaProvenance(effective);
2309
- const priorEntry = Array.isArray(held) ? held.find(
2394
+ const heldProvenance = held[META_PROVENANCE_KEY];
2395
+ const priorEntry = Array.isArray(heldProvenance) ? heldProvenance.find(
2310
2396
  (e) => !!e && typeof e === "object" && !Array.isArray(e) && e["generated-by"] === identity.model
2311
2397
  ) : void 0;
2312
2398
  const priorConfidence = numberMap(priorEntry?.["confidence"]);
@@ -2322,7 +2408,7 @@ async function runFill(opts = {}) {
2322
2408
  ([f, name]) => confidence[f] === void 0 && priorConfidence[name] === void 0
2323
2409
  ).map(([, name]) => name);
2324
2410
  const merged = mergeMetaProvenance(
2325
- held,
2411
+ heldProvenance,
2326
2412
  identity.model,
2327
2413
  "fields",
2328
2414
  proposed
@@ -2333,7 +2419,7 @@ async function runFill(opts = {}) {
2333
2419
  provenanceList = merged.list;
2334
2420
  }
2335
2421
  }
2336
- const applied = applyGraphFields(effective, path2, narrowed, {
2422
+ const applied = writeGraphFields(effective, path2, pageFormat, narrowed, {
2337
2423
  force: opts.force
2338
2424
  });
2339
2425
  const reportedFields = applied.applied;
@@ -2349,10 +2435,10 @@ async function runFill(opts = {}) {
2349
2435
  cached
2350
2436
  };
2351
2437
  }
2352
- const own = ownMetadata(content).data;
2353
- const graphHome = absPath === void 0 ? void 0 : await view.home(path2, own, GRAPH_KEY);
2438
+ const own = metadataOf(content, path2, pageFormat).data;
2439
+ const graphHome = absPath === void 0 ? void 0 : await view.home(path2, own, GRAPH_KEY2);
2354
2440
  const provenanceHome = absPath === void 0 || provenanceList === void 0 ? void 0 : await view.home(path2, own, META_PROVENANCE_KEY);
2355
- const graphTarget = writeTarget(path2, graphHome, GRAPH_KEY);
2441
+ const graphTarget = writeTarget(path2, graphHome, GRAPH_KEY2);
2356
2442
  if (typeof graphTarget === "string") throw new GraphError(graphTarget);
2357
2443
  let provenanceTarget = writeTarget(path2, provenanceHome, META_PROVENANCE_KEY);
2358
2444
  if (typeof provenanceTarget === "string") {
@@ -2364,9 +2450,10 @@ async function runFill(opts = {}) {
2364
2450
  if (provenanceList !== void 0 && provenanceTarget === null) {
2365
2451
  pageKeys[META_PROVENANCE_KEY] = provenanceList;
2366
2452
  }
2367
- const pageContent = applyGraphFields(
2453
+ const pageContent = writeGraphFields(
2368
2454
  content,
2369
2455
  path2,
2456
+ pageFormat,
2370
2457
  graphTarget === null ? narrowed : {},
2371
2458
  { force: opts.force, page: pageKeys }
2372
2459
  ).content;
@@ -2374,8 +2461,8 @@ async function runFill(opts = {}) {
2374
2461
  if (graphTarget !== null) {
2375
2462
  manifestWrites.push({
2376
2463
  home: graphTarget,
2377
- key: GRAPH_KEY,
2378
- value: ownMetadata(applied.content).data[GRAPH_KEY]
2464
+ key: GRAPH_KEY2,
2465
+ value: metadataOf(applied.content, path2, pageFormat).data[GRAPH_KEY2]
2379
2466
  });
2380
2467
  }
2381
2468
  if (provenanceList !== void 0 && provenanceTarget !== null) {
@@ -2408,7 +2495,7 @@ async function runFill(opts = {}) {
2408
2495
  };
2409
2496
  }
2410
2497
  }
2411
- var GRAPH_KEY = "graph";
2498
+ var GRAPH_KEY2 = "graph";
2412
2499
  function writeTarget(path2, home, key) {
2413
2500
  if (home === void 0 || home.kind === "unowned") return null;
2414
2501
  if (home.kind === "url") return urlManifestMessage(key, home.file);
@@ -2455,16 +2542,18 @@ async function spliceAll(writes) {
2455
2542
  return [...out.values()];
2456
2543
  }
2457
2544
  async function mergedText(view, path2, content, format) {
2458
- if (frontmatterKind(content) === "unsupported") return content;
2459
- let own;
2545
+ const markdown = format === "markdown" || format === "mdx";
2546
+ if (markdown && frontmatterKind(content) === "unsupported") return content;
2547
+ const own = metadataOf(content, path2, format);
2548
+ const { supplied } = await mergePage(view, path2, own.data, own.present, format);
2549
+ if (Object.keys(supplied).length === 0) return content;
2460
2550
  try {
2461
- own = ownMetadata(content);
2551
+ return writeGraphFields(content, path2, format, {}, { page: supplied }).content;
2462
2552
  } catch (e) {
2463
- throw new GraphError(`${path2}: ${errorMessage(e)}`);
2553
+ const noFence = (format === "asciidoc" || format === "rst") && e instanceof DocmetaError;
2554
+ if (!noFence) throw e;
2555
+ return applyGraphFields(content, path2, {}, { page: supplied }).content;
2464
2556
  }
2465
- const { supplied } = await mergePage(view, path2, own.data, own.present, format);
2466
- if (Object.keys(supplied).length === 0) return content;
2467
- return applyGraphFields(content, path2, {}, { page: supplied }).content;
2468
2557
  }
2469
2558
  async function openMetaViewPerPage(source, cwd, paths, base2, failures) {
2470
2559
  try {
@@ -3869,4 +3958,4 @@ export {
3869
3958
  runTraverse,
3870
3959
  renderTraverse
3871
3960
  };
3872
- //# sourceMappingURL=chunk-RL5XWQOL.js.map
3961
+ //# sourceMappingURL=chunk-MOWMCEOJ.js.map