@driftsys/markspec 0.10.3 → 0.12.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 (458) hide show
  1. package/README.md +11 -2
  2. package/esm/ast/normalize.d.ts +4 -5
  3. package/esm/ast/normalize.d.ts.map +1 -1
  4. package/esm/ast/normalize.js +6 -37
  5. package/esm/collect/mod.d.ts +29 -9
  6. package/esm/collect/mod.d.ts.map +1 -1
  7. package/esm/collect/mod.js +36 -10
  8. package/esm/compiler/deserialize.d.ts +49 -0
  9. package/esm/compiler/deserialize.d.ts.map +1 -0
  10. package/esm/compiler/deserialize.js +139 -0
  11. package/esm/compiler/manifest.d.ts +3 -0
  12. package/esm/compiler/manifest.d.ts.map +1 -1
  13. package/esm/compiler/manifest.js +9 -3
  14. package/esm/compiler/mod.d.ts.map +1 -1
  15. package/esm/compiler/mod.js +18 -13
  16. package/esm/config/markspec.d.ts +40 -1
  17. package/esm/config/markspec.d.ts.map +1 -1
  18. package/esm/config/markspec.js +127 -2
  19. package/esm/config/mod.d.ts.map +1 -1
  20. package/esm/config/mod.js +143 -147
  21. package/esm/decl/duplicates.d.ts +29 -0
  22. package/esm/decl/duplicates.d.ts.map +1 -0
  23. package/esm/decl/duplicates.js +28 -0
  24. package/esm/decl/mod.d.ts +4 -2
  25. package/esm/decl/mod.d.ts.map +1 -1
  26. package/esm/decl/mod.js +2 -1
  27. package/esm/decl/surfaces.d.ts +29 -7
  28. package/esm/decl/surfaces.d.ts.map +1 -1
  29. package/esm/decl/surfaces.js +31 -18
  30. package/esm/discovery/mod.d.ts +24 -8
  31. package/esm/discovery/mod.d.ts.map +1 -1
  32. package/esm/discovery/mod.js +57 -21
  33. package/esm/discovery/projects.d.ts +109 -0
  34. package/esm/discovery/projects.d.ts.map +1 -0
  35. package/esm/discovery/projects.js +232 -0
  36. package/esm/formatter/entry_body.d.ts +86 -0
  37. package/esm/formatter/entry_body.d.ts.map +1 -0
  38. package/esm/formatter/entry_body.js +287 -0
  39. package/esm/formatter/mod.d.ts +13 -9
  40. package/esm/formatter/mod.d.ts.map +1 -1
  41. package/esm/formatter/mod.js +126 -50
  42. package/esm/gates/mod.d.ts +13 -2
  43. package/esm/gates/mod.d.ts.map +1 -1
  44. package/esm/gates/mod.js +41 -13
  45. package/esm/lint/runner.d.ts.map +1 -1
  46. package/esm/lint/runner.js +7 -5
  47. package/esm/lock/acquire_compile.d.ts +31 -0
  48. package/esm/lock/acquire_compile.d.ts.map +1 -0
  49. package/esm/lock/acquire_compile.js +83 -0
  50. package/esm/lock/cache_check.d.ts +28 -0
  51. package/esm/lock/cache_check.d.ts.map +1 -0
  52. package/esm/lock/cache_check.js +51 -0
  53. package/esm/lock/check.d.ts +14 -3
  54. package/esm/lock/check.d.ts.map +1 -1
  55. package/esm/lock/check.js +43 -4
  56. package/esm/lock/edge_drift.d.ts +2 -0
  57. package/esm/lock/edge_drift.d.ts.map +1 -1
  58. package/esm/lock/edge_drift.js +4 -0
  59. package/esm/lock/git_intent.d.ts +46 -0
  60. package/esm/lock/git_intent.d.ts.map +1 -0
  61. package/esm/lock/git_intent.js +111 -0
  62. package/esm/lock/mod.d.ts +11 -4
  63. package/esm/lock/mod.d.ts.map +1 -1
  64. package/esm/lock/mod.js +8 -2
  65. package/esm/lock/model.d.ts +24 -1
  66. package/esm/lock/model.d.ts.map +1 -1
  67. package/esm/lock/parser.d.ts.map +1 -1
  68. package/esm/lock/parser.js +32 -0
  69. package/esm/lock/pin_assurance.d.ts +20 -0
  70. package/esm/lock/pin_assurance.d.ts.map +1 -0
  71. package/esm/lock/pin_assurance.js +34 -0
  72. package/esm/lock/resolve.d.ts +8 -17
  73. package/esm/lock/resolve.d.ts.map +1 -1
  74. package/esm/lock/resolve.js +7 -67
  75. package/esm/lock/serializer.d.ts.map +1 -1
  76. package/esm/lock/serializer.js +23 -0
  77. package/esm/lock/upstream_common.d.ts +29 -0
  78. package/esm/lock/upstream_common.d.ts.map +1 -0
  79. package/esm/lock/upstream_common.js +38 -0
  80. package/esm/lock/upstream_deps.d.ts +63 -0
  81. package/esm/lock/upstream_deps.d.ts.map +1 -0
  82. package/esm/lock/upstream_deps.js +172 -0
  83. package/esm/lock/upstream_refs.d.ts +69 -0
  84. package/esm/lock/upstream_refs.d.ts.map +1 -0
  85. package/esm/lock/upstream_refs.js +238 -0
  86. package/esm/mod.d.ts +23 -11
  87. package/esm/mod.d.ts.map +1 -1
  88. package/esm/mod.js +20 -8
  89. package/esm/model/mod.d.ts +114 -28
  90. package/esm/model/mod.d.ts.map +1 -1
  91. package/esm/model/mod.js +76 -13
  92. package/esm/model/profile.d.ts +13 -0
  93. package/esm/model/profile.d.ts.map +1 -1
  94. package/esm/parser/code_regions.d.ts +29 -0
  95. package/esm/parser/code_regions.d.ts.map +1 -0
  96. package/esm/parser/code_regions.js +38 -0
  97. package/esm/parser/markdown.d.ts.map +1 -1
  98. package/esm/parser/markdown.js +110 -91
  99. package/esm/parser/mod.d.ts.map +1 -1
  100. package/esm/parser/mod.js +7 -1
  101. package/esm/parser/translate.d.ts.map +1 -1
  102. package/esm/parser/translate.js +5 -0
  103. package/esm/profile/manifest.d.ts.map +1 -1
  104. package/esm/profile/manifest.js +20 -3
  105. package/esm/profile/merge.js +7 -0
  106. package/esm/refs/mod.d.ts.map +1 -1
  107. package/esm/refs/mod.js +8 -19
  108. package/esm/reporter/mod.d.ts +11 -0
  109. package/esm/reporter/mod.d.ts.map +1 -1
  110. package/esm/reporter/mod.js +20 -9
  111. package/esm/typl/assemble.d.ts +53 -0
  112. package/esm/typl/assemble.d.ts.map +1 -0
  113. package/esm/typl/assemble.js +238 -0
  114. package/esm/typl/ast.d.ts +7 -1
  115. package/esm/typl/ast.d.ts.map +1 -1
  116. package/esm/typl/ast.js +3 -0
  117. package/esm/typl/bullet.d.ts +9 -7
  118. package/esm/typl/bullet.d.ts.map +1 -1
  119. package/esm/typl/bullet.js +6 -4
  120. package/esm/typl/citations.d.ts +27 -0
  121. package/esm/typl/citations.d.ts.map +1 -0
  122. package/esm/typl/citations.js +16 -0
  123. package/esm/typl/diagnostics.d.ts +2 -2
  124. package/esm/typl/diagnostics.d.ts.map +1 -1
  125. package/esm/typl/diagnostics.js +18 -0
  126. package/esm/typl/grammar.d.ts.map +1 -1
  127. package/esm/typl/grammar.js +6 -0
  128. package/esm/typl/lexer.d.ts.map +1 -1
  129. package/esm/typl/lexer.js +25 -4
  130. package/esm/typl/mod.d.ts +8 -2
  131. package/esm/typl/mod.d.ts.map +1 -1
  132. package/esm/typl/mod.js +5 -1
  133. package/esm/typl/recognize.js +2 -2
  134. package/esm/typl/registry.d.ts +1 -1
  135. package/esm/typl/resolve.d.ts +31 -0
  136. package/esm/typl/resolve.d.ts.map +1 -0
  137. package/esm/typl/resolve.js +27 -0
  138. package/esm/typl/table.d.ts +52 -0
  139. package/esm/typl/table.d.ts.map +1 -0
  140. package/esm/typl/table.js +69 -0
  141. package/esm/typl/validator.d.ts +24 -5
  142. package/esm/typl/validator.d.ts.map +1 -1
  143. package/esm/typl/validator.js +55 -75
  144. package/esm/upstream/mod.d.ts +45 -0
  145. package/esm/upstream/mod.d.ts.map +1 -0
  146. package/esm/upstream/mod.js +98 -0
  147. package/esm/upstream/project.d.ts +33 -0
  148. package/esm/upstream/project.d.ts.map +1 -0
  149. package/esm/upstream/project.js +38 -0
  150. package/esm/upstream/refs.d.ts +23 -0
  151. package/esm/upstream/refs.d.ts.map +1 -0
  152. package/esm/upstream/refs.js +71 -0
  153. package/esm/util/fence.d.ts +20 -29
  154. package/esm/util/fence.d.ts.map +1 -1
  155. package/esm/util/fence.js +42 -50
  156. package/esm/util/modals.d.ts +6 -0
  157. package/esm/util/modals.d.ts.map +1 -1
  158. package/esm/util/modals.js +37 -0
  159. package/esm/util/paths.d.ts +14 -0
  160. package/esm/util/paths.d.ts.map +1 -0
  161. package/esm/util/paths.js +22 -0
  162. package/esm/uxil/assemble.d.ts +38 -0
  163. package/esm/uxil/assemble.d.ts.map +1 -0
  164. package/esm/uxil/assemble.js +268 -0
  165. package/esm/uxil/ast.d.ts +63 -0
  166. package/esm/uxil/ast.d.ts.map +1 -0
  167. package/esm/uxil/ast.js +9 -0
  168. package/esm/uxil/citations.d.ts +27 -0
  169. package/esm/uxil/citations.d.ts.map +1 -0
  170. package/esm/uxil/citations.js +25 -0
  171. package/esm/uxil/diagnostics.d.ts +39 -0
  172. package/esm/uxil/diagnostics.d.ts.map +1 -0
  173. package/esm/uxil/diagnostics.js +135 -0
  174. package/esm/uxil/grammar.d.ts +72 -0
  175. package/esm/uxil/grammar.d.ts.map +1 -0
  176. package/esm/uxil/grammar.js +505 -0
  177. package/esm/uxil/lexer.d.ts +23 -0
  178. package/esm/uxil/lexer.d.ts.map +1 -0
  179. package/esm/uxil/lexer.js +58 -0
  180. package/esm/uxil/mod.d.ts +32 -0
  181. package/esm/uxil/mod.d.ts.map +1 -0
  182. package/esm/uxil/mod.js +11 -0
  183. package/esm/uxil/projection.d.ts +40 -0
  184. package/esm/uxil/projection.d.ts.map +1 -0
  185. package/esm/uxil/projection.js +41 -0
  186. package/esm/uxil/recognize.d.ts +16 -0
  187. package/esm/uxil/recognize.d.ts.map +1 -0
  188. package/esm/uxil/recognize.js +28 -0
  189. package/esm/uxil/registry.d.ts +37 -0
  190. package/esm/uxil/registry.d.ts.map +1 -0
  191. package/esm/uxil/registry.js +29 -0
  192. package/esm/uxil/surfaces.d.ts +36 -0
  193. package/esm/uxil/surfaces.d.ts.map +1 -0
  194. package/esm/uxil/surfaces.js +34 -0
  195. package/esm/uxil/validator.d.ts +36 -0
  196. package/esm/uxil/validator.d.ts.map +1 -0
  197. package/esm/uxil/validator.js +139 -0
  198. package/esm/uxil/vocab.d.ts +33 -0
  199. package/esm/uxil/vocab.d.ts.map +1 -0
  200. package/esm/uxil/vocab.js +36 -0
  201. package/esm/validator/body_blocks.d.ts +2 -1
  202. package/esm/validator/body_blocks.d.ts.map +1 -1
  203. package/esm/validator/body_blocks.js +80 -2
  204. package/esm/validator/caption_convention.d.ts +2 -1
  205. package/esm/validator/caption_convention.d.ts.map +1 -1
  206. package/esm/validator/caption_convention.js +2 -1
  207. package/esm/validator/corpus.d.ts +6 -0
  208. package/esm/validator/corpus.d.ts.map +1 -1
  209. package/esm/validator/corpus.js +55 -20
  210. package/esm/validator/discipline.d.ts +6 -4
  211. package/esm/validator/discipline.d.ts.map +1 -1
  212. package/esm/validator/discipline.js +6 -4
  213. package/esm/validator/mod.d.ts +1 -1
  214. package/esm/validator/mod.d.ts.map +1 -1
  215. package/esm/validator/mod.js +29 -16
  216. package/esm/validator/pipeline.d.ts +11 -1
  217. package/esm/validator/pipeline.d.ts.map +1 -1
  218. package/esm/validator/pipeline.js +76 -23
  219. package/esm/validator/trace_types.d.ts +9 -2
  220. package/esm/validator/trace_types.d.ts.map +1 -1
  221. package/esm/validator/trace_types.js +21 -5
  222. package/esm/validator/traceability.d.ts +15 -3
  223. package/esm/validator/traceability.d.ts.map +1 -1
  224. package/esm/validator/traceability.js +39 -4
  225. package/esm/validator/types.d.ts.map +1 -1
  226. package/esm/validator/types.js +11 -1
  227. package/esm/validator/uxil_family.d.ts +43 -0
  228. package/esm/validator/uxil_family.d.ts.map +1 -0
  229. package/esm/validator/uxil_family.js +52 -0
  230. package/package.json +1 -1
  231. package/script/ast/normalize.d.ts +4 -5
  232. package/script/ast/normalize.d.ts.map +1 -1
  233. package/script/ast/normalize.js +5 -36
  234. package/script/collect/mod.d.ts +29 -9
  235. package/script/collect/mod.d.ts.map +1 -1
  236. package/script/collect/mod.js +38 -10
  237. package/script/compiler/deserialize.d.ts +49 -0
  238. package/script/compiler/deserialize.d.ts.map +1 -0
  239. package/script/compiler/deserialize.js +144 -0
  240. package/script/compiler/manifest.d.ts +3 -0
  241. package/script/compiler/manifest.d.ts.map +1 -1
  242. package/script/compiler/manifest.js +10 -3
  243. package/script/compiler/mod.d.ts.map +1 -1
  244. package/script/compiler/mod.js +16 -11
  245. package/script/config/markspec.d.ts +40 -1
  246. package/script/config/markspec.d.ts.map +1 -1
  247. package/script/config/markspec.js +129 -3
  248. package/script/config/mod.d.ts.map +1 -1
  249. package/script/config/mod.js +143 -147
  250. package/script/decl/duplicates.d.ts +29 -0
  251. package/script/decl/duplicates.d.ts.map +1 -0
  252. package/script/decl/duplicates.js +31 -0
  253. package/script/decl/mod.d.ts +4 -2
  254. package/script/decl/mod.d.ts.map +1 -1
  255. package/script/decl/mod.js +4 -2
  256. package/script/decl/surfaces.d.ts +29 -7
  257. package/script/decl/surfaces.d.ts.map +1 -1
  258. package/script/decl/surfaces.js +32 -19
  259. package/script/discovery/mod.d.ts +24 -8
  260. package/script/discovery/mod.d.ts.map +1 -1
  261. package/script/discovery/mod.js +56 -20
  262. package/script/discovery/projects.d.ts +109 -0
  263. package/script/discovery/projects.d.ts.map +1 -0
  264. package/script/discovery/projects.js +240 -0
  265. package/script/formatter/entry_body.d.ts +86 -0
  266. package/script/formatter/entry_body.d.ts.map +1 -0
  267. package/script/formatter/entry_body.js +292 -0
  268. package/script/formatter/mod.d.ts +13 -9
  269. package/script/formatter/mod.d.ts.map +1 -1
  270. package/script/formatter/mod.js +124 -48
  271. package/script/gates/mod.d.ts +13 -2
  272. package/script/gates/mod.d.ts.map +1 -1
  273. package/script/gates/mod.js +50 -22
  274. package/script/lint/runner.d.ts.map +1 -1
  275. package/script/lint/runner.js +6 -4
  276. package/script/lock/acquire_compile.d.ts +31 -0
  277. package/script/lock/acquire_compile.d.ts.map +1 -0
  278. package/script/lock/acquire_compile.js +86 -0
  279. package/script/lock/cache_check.d.ts +28 -0
  280. package/script/lock/cache_check.d.ts.map +1 -0
  281. package/script/lock/cache_check.js +54 -0
  282. package/script/lock/check.d.ts +14 -3
  283. package/script/lock/check.d.ts.map +1 -1
  284. package/script/lock/check.js +43 -4
  285. package/script/lock/edge_drift.d.ts +2 -0
  286. package/script/lock/edge_drift.d.ts.map +1 -1
  287. package/script/lock/edge_drift.js +5 -0
  288. package/script/lock/git_intent.d.ts +46 -0
  289. package/script/lock/git_intent.d.ts.map +1 -0
  290. package/script/lock/git_intent.js +115 -0
  291. package/script/lock/mod.d.ts +11 -4
  292. package/script/lock/mod.d.ts.map +1 -1
  293. package/script/lock/mod.js +17 -2
  294. package/script/lock/model.d.ts +24 -1
  295. package/script/lock/model.d.ts.map +1 -1
  296. package/script/lock/parser.d.ts.map +1 -1
  297. package/script/lock/parser.js +32 -0
  298. package/script/lock/pin_assurance.d.ts +20 -0
  299. package/script/lock/pin_assurance.d.ts.map +1 -0
  300. package/script/lock/pin_assurance.js +37 -0
  301. package/script/lock/resolve.d.ts +8 -17
  302. package/script/lock/resolve.d.ts.map +1 -1
  303. package/script/lock/resolve.js +7 -68
  304. package/script/lock/serializer.d.ts.map +1 -1
  305. package/script/lock/serializer.js +23 -0
  306. package/script/lock/upstream_common.d.ts +29 -0
  307. package/script/lock/upstream_common.d.ts.map +1 -0
  308. package/script/lock/upstream_common.js +42 -0
  309. package/script/lock/upstream_deps.d.ts +63 -0
  310. package/script/lock/upstream_deps.d.ts.map +1 -0
  311. package/script/lock/upstream_deps.js +175 -0
  312. package/script/lock/upstream_refs.d.ts +69 -0
  313. package/script/lock/upstream_refs.d.ts.map +1 -0
  314. package/script/lock/upstream_refs.js +244 -0
  315. package/script/mod.d.ts +23 -11
  316. package/script/mod.d.ts.map +1 -1
  317. package/script/mod.js +55 -7
  318. package/script/model/mod.d.ts +114 -28
  319. package/script/model/mod.d.ts.map +1 -1
  320. package/script/model/mod.js +81 -14
  321. package/script/model/profile.d.ts +13 -0
  322. package/script/model/profile.d.ts.map +1 -1
  323. package/script/parser/code_regions.d.ts +29 -0
  324. package/script/parser/code_regions.d.ts.map +1 -0
  325. package/script/parser/code_regions.js +41 -0
  326. package/script/parser/markdown.d.ts.map +1 -1
  327. package/script/parser/markdown.js +108 -89
  328. package/script/parser/mod.d.ts.map +1 -1
  329. package/script/parser/mod.js +7 -1
  330. package/script/parser/translate.d.ts.map +1 -1
  331. package/script/parser/translate.js +5 -0
  332. package/script/profile/manifest.d.ts.map +1 -1
  333. package/script/profile/manifest.js +20 -3
  334. package/script/profile/merge.js +7 -0
  335. package/script/refs/mod.d.ts.map +1 -1
  336. package/script/refs/mod.js +7 -18
  337. package/script/reporter/mod.d.ts +11 -0
  338. package/script/reporter/mod.d.ts.map +1 -1
  339. package/script/reporter/mod.js +19 -8
  340. package/script/typl/assemble.d.ts +53 -0
  341. package/script/typl/assemble.d.ts.map +1 -0
  342. package/script/typl/assemble.js +241 -0
  343. package/script/typl/ast.d.ts +7 -1
  344. package/script/typl/ast.d.ts.map +1 -1
  345. package/script/typl/ast.js +3 -0
  346. package/script/typl/bullet.d.ts +9 -7
  347. package/script/typl/bullet.d.ts.map +1 -1
  348. package/script/typl/bullet.js +6 -4
  349. package/script/typl/citations.d.ts +27 -0
  350. package/script/typl/citations.d.ts.map +1 -0
  351. package/script/typl/citations.js +20 -0
  352. package/script/typl/diagnostics.d.ts +2 -2
  353. package/script/typl/diagnostics.d.ts.map +1 -1
  354. package/script/typl/diagnostics.js +18 -0
  355. package/script/typl/grammar.d.ts.map +1 -1
  356. package/script/typl/grammar.js +6 -0
  357. package/script/typl/lexer.d.ts.map +1 -1
  358. package/script/typl/lexer.js +25 -4
  359. package/script/typl/mod.d.ts +8 -2
  360. package/script/typl/mod.d.ts.map +1 -1
  361. package/script/typl/mod.js +14 -2
  362. package/script/typl/recognize.js +2 -2
  363. package/script/typl/registry.d.ts +1 -1
  364. package/script/typl/resolve.d.ts +31 -0
  365. package/script/typl/resolve.d.ts.map +1 -0
  366. package/script/typl/resolve.js +33 -0
  367. package/script/typl/table.d.ts +52 -0
  368. package/script/typl/table.d.ts.map +1 -0
  369. package/script/typl/table.js +75 -0
  370. package/script/typl/validator.d.ts +24 -5
  371. package/script/typl/validator.d.ts.map +1 -1
  372. package/script/typl/validator.js +55 -75
  373. package/script/upstream/mod.d.ts +45 -0
  374. package/script/upstream/mod.d.ts.map +1 -0
  375. package/script/upstream/mod.js +101 -0
  376. package/script/upstream/project.d.ts +33 -0
  377. package/script/upstream/project.d.ts.map +1 -0
  378. package/script/upstream/project.js +41 -0
  379. package/script/upstream/refs.d.ts +23 -0
  380. package/script/upstream/refs.d.ts.map +1 -0
  381. package/script/upstream/refs.js +74 -0
  382. package/script/util/fence.d.ts +20 -29
  383. package/script/util/fence.d.ts.map +1 -1
  384. package/script/util/fence.js +47 -54
  385. package/script/util/modals.d.ts +6 -0
  386. package/script/util/modals.d.ts.map +1 -1
  387. package/script/util/modals.js +38 -0
  388. package/script/util/paths.d.ts +14 -0
  389. package/script/util/paths.d.ts.map +1 -0
  390. package/script/util/paths.js +25 -0
  391. package/script/uxil/assemble.d.ts +38 -0
  392. package/script/uxil/assemble.d.ts.map +1 -0
  393. package/script/uxil/assemble.js +272 -0
  394. package/script/uxil/ast.d.ts +63 -0
  395. package/script/uxil/ast.d.ts.map +1 -0
  396. package/script/uxil/ast.js +10 -0
  397. package/script/uxil/citations.d.ts +27 -0
  398. package/script/uxil/citations.d.ts.map +1 -0
  399. package/script/uxil/citations.js +29 -0
  400. package/script/uxil/diagnostics.d.ts +39 -0
  401. package/script/uxil/diagnostics.d.ts.map +1 -0
  402. package/script/uxil/diagnostics.js +140 -0
  403. package/script/uxil/grammar.d.ts +72 -0
  404. package/script/uxil/grammar.d.ts.map +1 -0
  405. package/script/uxil/grammar.js +511 -0
  406. package/script/uxil/lexer.d.ts +23 -0
  407. package/script/uxil/lexer.d.ts.map +1 -0
  408. package/script/uxil/lexer.js +61 -0
  409. package/script/uxil/mod.d.ts +32 -0
  410. package/script/uxil/mod.d.ts.map +1 -0
  411. package/script/uxil/mod.js +37 -0
  412. package/script/uxil/projection.d.ts +40 -0
  413. package/script/uxil/projection.d.ts.map +1 -0
  414. package/script/uxil/projection.js +44 -0
  415. package/script/uxil/recognize.d.ts +16 -0
  416. package/script/uxil/recognize.d.ts.map +1 -0
  417. package/script/uxil/recognize.js +31 -0
  418. package/script/uxil/registry.d.ts +37 -0
  419. package/script/uxil/registry.d.ts.map +1 -0
  420. package/script/uxil/registry.js +32 -0
  421. package/script/uxil/surfaces.d.ts +36 -0
  422. package/script/uxil/surfaces.d.ts.map +1 -0
  423. package/script/uxil/surfaces.js +39 -0
  424. package/script/uxil/validator.d.ts +36 -0
  425. package/script/uxil/validator.d.ts.map +1 -0
  426. package/script/uxil/validator.js +142 -0
  427. package/script/uxil/vocab.d.ts +33 -0
  428. package/script/uxil/vocab.d.ts.map +1 -0
  429. package/script/uxil/vocab.js +41 -0
  430. package/script/validator/body_blocks.d.ts +2 -1
  431. package/script/validator/body_blocks.d.ts.map +1 -1
  432. package/script/validator/body_blocks.js +80 -2
  433. package/script/validator/caption_convention.d.ts +2 -1
  434. package/script/validator/caption_convention.d.ts.map +1 -1
  435. package/script/validator/caption_convention.js +2 -1
  436. package/script/validator/corpus.d.ts +6 -0
  437. package/script/validator/corpus.d.ts.map +1 -1
  438. package/script/validator/corpus.js +55 -19
  439. package/script/validator/discipline.d.ts +6 -4
  440. package/script/validator/discipline.d.ts.map +1 -1
  441. package/script/validator/discipline.js +6 -4
  442. package/script/validator/mod.d.ts +1 -1
  443. package/script/validator/mod.d.ts.map +1 -1
  444. package/script/validator/mod.js +29 -15
  445. package/script/validator/pipeline.d.ts +11 -1
  446. package/script/validator/pipeline.d.ts.map +1 -1
  447. package/script/validator/pipeline.js +75 -22
  448. package/script/validator/trace_types.d.ts +9 -2
  449. package/script/validator/trace_types.d.ts.map +1 -1
  450. package/script/validator/trace_types.js +20 -4
  451. package/script/validator/traceability.d.ts +15 -3
  452. package/script/validator/traceability.d.ts.map +1 -1
  453. package/script/validator/traceability.js +38 -3
  454. package/script/validator/types.d.ts.map +1 -1
  455. package/script/validator/types.js +10 -0
  456. package/script/validator/uxil_family.d.ts +43 -0
  457. package/script/validator/uxil_family.d.ts.map +1 -0
  458. package/script/validator/uxil_family.js +56 -0
@@ -1,67 +1,60 @@
1
1
  "use strict";
2
- /**
3
- * @module core/util/fence
4
- *
5
- * Prose-line walker that skips lines inside fenced code blocks.
6
- * Several validator and formatter passes (body-block exclusions,
7
- * caption adjacency, `$Identifier` extraction, modal-keyword
8
- * normalisation) all needed to walk an entry body line-by-line while
9
- * treating fenced code as verbatim. This helper centralises that
10
- * pattern so the fence-toggle semantics stay consistent.
11
- *
12
- * Fence detection follows CommonMark §4.5 — a line whose first
13
- * non-whitespace content is three or more backticks or tildes opens
14
- * (or closes) a fenced block. The language tag that may follow the
15
- * opening fence does not affect detection: we toggle on every fence
16
- * marker regardless. (Mismatched marker types — ``` opener / ~~~
17
- * closer — are accepted by the walker because real Markdown parsers
18
- * already reject those upstream.)
19
- */
20
2
  Object.defineProperty(exports, "__esModule", { value: true });
21
3
  exports.FENCE_RE = void 0;
4
+ exports.fencedCodeLines = fencedCodeLines;
22
5
  exports.walkProseLines = walkProseLines;
23
6
  exports.isLineFenced = isLineFenced;
24
- /** Three or more backticks or tildes at the start of a line. */
7
+ /**
8
+ * @module core/util/fence
9
+ *
10
+ * Prose-line helpers using fenced-code boundaries from the CommonMark AST.
11
+ * Containers, matching delimiters and implicit container endings are handled
12
+ * by remark. Indented code is not fenced code: MarkSpec trailers must remain
13
+ * available to reference and validation passes.
14
+ */
15
+ const code_regions_js_1 = require("../parser/code_regions.js");
16
+ /**
17
+ * Legacy fence-prefix candidate used by the LSP source-file scanner.
18
+ * Markdown fence membership uses the AST-backed helpers below.
19
+ */
25
20
  exports.FENCE_RE = /^\s*(```|~~~)/;
21
+ const FENCE_CACHE_CAPACITY = 64;
22
+ const fencedLineCache = new Map();
26
23
  /**
27
- * Walk `body` line by line, invoking `cb` for every line that's NOT
28
- * inside a fenced code block. The first fence marker opens the block;
29
- * the next closes it. The fence-marker lines themselves are also
30
- * skipped (they're structural, not prose).
24
+ * Compute zero-based fenced-code lines, including opening and closing lines.
25
+ * Cache the sets for the 64 most recently queried exact document texts. Each
26
+ * call returns a new copy, so a caller that changes it cannot alter the cache.
27
+ * Callers making multiple membership queries should compute this set once and
28
+ * pass it to {@linkcode isLineFenced} or {@linkcode walkProseLines}.
31
29
  */
32
- function walkProseLines(body, cb) {
33
- const lines = body.split("\n");
34
- let inFence = false;
35
- for (let i = 0; i < lines.length; i++) {
36
- const line = lines[i];
37
- if (exports.FENCE_RE.test(line)) {
38
- inFence = !inFence;
39
- continue;
40
- }
41
- if (inFence)
42
- continue;
43
- cb(line, i);
30
+ function fencedCodeLines(body) {
31
+ const cached = fencedLineCache.get(body);
32
+ if (cached !== undefined) {
33
+ fencedLineCache.delete(body);
34
+ fencedLineCache.set(body, cached);
35
+ return new Set(cached);
36
+ }
37
+ const lines = (0, code_regions_js_1.parseCodeRegions)(body).fencedLines;
38
+ fencedLineCache.set(body, lines);
39
+ if (fencedLineCache.size > FENCE_CACHE_CAPACITY) {
40
+ fencedLineCache.delete(fencedLineCache.keys().next().value);
44
41
  }
42
+ return new Set(lines);
45
43
  }
46
44
  /**
47
- * Return whether `lineIndex` (0-based) is a line {@linkcode walkProseLines}
48
- * would skip — either a fence-marker line itself, or content inside a
49
- * fenced block. Single-line-membership counterpart to `walkProseLines`'s
50
- * full-body callback walk, for callers that only need a yes/no answer for
51
- * one position (e.g. an LSP request gating a cursor position, #680).
45
+ * Walk lines outside fenced code, using the cached CommonMark line set unless
46
+ * a precomputed set for this exact text is supplied. Indented code is yielded.
52
47
  */
53
- function isLineFenced(body, lineIndex) {
54
- const lines = body.split("\n");
55
- let inFence = false;
56
- for (let i = 0; i <= lineIndex && i < lines.length; i++) {
57
- if (exports.FENCE_RE.test(lines[i])) {
58
- inFence = !inFence;
59
- if (i === lineIndex)
60
- return true;
61
- continue;
62
- }
63
- if (i === lineIndex)
64
- return inFence;
65
- }
66
- return false;
48
+ function walkProseLines(body, cb, fencedLines = fencedCodeLines(body)) {
49
+ body.split("\n").forEach((line, index) => {
50
+ if (!fencedLines.has(index))
51
+ cb(line, index);
52
+ });
53
+ }
54
+ /**
55
+ * Return whether a zero-based document line belongs to the fenced-line set.
56
+ * Supply the set for this exact text when querying multiple positions.
57
+ */
58
+ function isLineFenced(body, lineIndex, fencedLines = fencedCodeLines(body)) {
59
+ return fencedLines.has(lineIndex);
67
60
  }
@@ -26,4 +26,10 @@ export declare const EARS_KEYWORD_RE: RegExp;
26
26
  * punctuation character (`.`, `!`, `?`).
27
27
  */
28
28
  export declare function isSentenceInitial(line: string, offset: number): boolean;
29
+ /**
30
+ * Normalize modal keywords in prose while preserving CommonMark fenced and
31
+ * inline code. Four-space and tab-indented lines remain verbatim as before.
32
+ * The document is parsed once; both code exclusions use that same AST.
33
+ */
34
+ export declare function normalizeProseModals(text: string): string;
29
35
  //# sourceMappingURL=modals.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"modals.d.ts","sourceRoot":"","sources":["../../src/util/modals.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,QAA0C,CAAC;AAExE;;;;;GAKG;AACH,eAAO,MAAM,eAAe,QAAmC,CAAC;AAEhE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAOvE"}
1
+ {"version":3,"file":"modals.d.ts","sourceRoot":"","sources":["../../src/util/modals.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,QAA0C,CAAC;AAExE;;;;;GAKG;AACH,eAAO,MAAM,eAAe,QAAmC,CAAC;AAEhE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAOvE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA4CzD"}
@@ -10,6 +10,9 @@
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.EARS_KEYWORD_RE = exports.RFC2119_MODAL_RE = void 0;
12
12
  exports.isSentenceInitial = isSentenceInitial;
13
+ exports.normalizeProseModals = normalizeProseModals;
14
+ const code_regions_js_1 = require("../parser/code_regions.js");
15
+ const fence_js_1 = require("./fence.js");
13
16
  /**
14
17
  * RFC 2119 modal keywords in uppercase form, with optional ` NOT` suffix.
15
18
  * Captured for canonical-form normalisation per spec §3.4.1: uppercase
@@ -40,3 +43,38 @@ function isSentenceInitial(line, offset) {
40
43
  const prev = line[i];
41
44
  return prev === "." || prev === "!" || prev === "?";
42
45
  }
46
+ /**
47
+ * Normalize modal keywords in prose while preserving CommonMark fenced and
48
+ * inline code. Four-space and tab-indented lines remain verbatim as before.
49
+ * The document is parsed once; both code exclusions use that same AST.
50
+ */
51
+ function normalizeProseModals(text) {
52
+ const { fencedLines, inlineCode } = (0, code_regions_js_1.parseCodeRegions)(text);
53
+ const lines = text.split("\n");
54
+ let lineOffset = 0;
55
+ let rangeIndex = 0;
56
+ // Record offsets before walking: the callback skips fenced lines.
57
+ const offsets = lines.map((line) => {
58
+ const offset = lineOffset;
59
+ lineOffset += line.length + 1;
60
+ return offset;
61
+ });
62
+ (0, fence_js_1.walkProseLines)(text, (line, i) => {
63
+ if (/^( {4}|\t)/.test(line))
64
+ return;
65
+ const start = offsets[i];
66
+ while (rangeIndex < inlineCode.length && inlineCode[rangeIndex].end <= start)
67
+ rangeIndex++;
68
+ const protectedRanges = [];
69
+ for (let j = rangeIndex; j < inlineCode.length && inlineCode[j].start < start + line.length; j++) {
70
+ protectedRanges.push(inlineCode[j]);
71
+ }
72
+ const isCode = (offset, length) => protectedRanges.some((range) => range.start < start + offset + length && range.end > start + offset);
73
+ let normalized = line.replace(exports.RFC2119_MODAL_RE, (match, _keyword, _not, offset) => isCode(offset, match.length) ? match : match.toLowerCase());
74
+ normalized = normalized.replace(exports.EARS_KEYWORD_RE, (match, _keyword, offset) => isCode(offset, match.length) || isSentenceInitial(normalized, offset)
75
+ ? match
76
+ : match.toLowerCase());
77
+ lines[i] = normalized;
78
+ }, fencedLines);
79
+ return lines.join("\n");
80
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @module util/paths
3
+ *
4
+ * Path-containment guard shared by every loader that joins an
5
+ * externally-controlled relative path onto a trusted base directory
6
+ * (upstream snapshot cache, profile `delivers:` lists).
7
+ */
8
+ /**
9
+ * Reject an externally-controlled relative path that could escape its
10
+ * base directory when joined as `${base}/${relPath}` — an absolute path
11
+ * or any `..` segment both qualify.
12
+ */
13
+ export declare function isUnsafeRelPath(relPath: string): boolean;
14
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/util/paths.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExD"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /**
3
+ * @module util/paths
4
+ *
5
+ * Path-containment guard shared by every loader that joins an
6
+ * externally-controlled relative path onto a trusted base directory
7
+ * (upstream snapshot cache, profile `delivers:` lists).
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.isUnsafeRelPath = isUnsafeRelPath;
11
+ /** Absolute path prefix — a POSIX `/…` root, a leading backslash (Windows
12
+ * drive-root-relative `\foo` and UNC `\\server\share`), or a Windows
13
+ * drive-letter prefix `C:` (drive-absolute `C:\…` / `C:/…` and
14
+ * drive-relative `C:foo`). */
15
+ const ABSOLUTE_PATH_RE = /^(\/|\\|[A-Za-z]:)/;
16
+ /** A `..` path segment anywhere in the string, POSIX or Windows separators. */
17
+ const PARENT_SEGMENT_RE = /(^|[\\/])\.\.([\\/]|$)/;
18
+ /**
19
+ * Reject an externally-controlled relative path that could escape its
20
+ * base directory when joined as `${base}/${relPath}` — an absolute path
21
+ * or any `..` segment both qualify.
22
+ */
23
+ function isUnsafeRelPath(relPath) {
24
+ return ABSOLUTE_PATH_RE.test(relPath) || PARENT_SEGMENT_RE.test(relPath);
25
+ }
@@ -0,0 +1,38 @@
1
+ import type { Diagnostic, Entry, SourceLocation } from "../model/mod.js";
2
+ import type { UxKey } from "./ast.js";
3
+ import { type RefOps } from "../decl/mod.js";
4
+ /** Reference operations for uxil's dotted internal surface paths. Child
5
+ * surfaces are always relative (the leading-dot grammar has no absolute
6
+ * form), so `isAbsolute` never fires in practice for a child-surface join —
7
+ * kept for API symmetry with the DSL-agnostic `core/decl` engine. */
8
+ export declare const UX_REF_OPS: RefOps;
9
+ /** One declared interaction element on a surface. */
10
+ export interface UxElement {
11
+ readonly name: string;
12
+ readonly verbs: readonly string[];
13
+ readonly keyTemplate?: UxKey;
14
+ readonly navTarget?: string;
15
+ readonly states: readonly string[];
16
+ readonly eventDictionary: string;
17
+ readonly location: SourceLocation;
18
+ }
19
+ /** One declared surface (root or child), with its elements. */
20
+ export interface UxSurface {
21
+ readonly path: string;
22
+ readonly kind: string;
23
+ readonly states: readonly string[];
24
+ readonly elements: readonly UxElement[];
25
+ readonly location: SourceLocation;
26
+ }
27
+ /** Result of assembling one entry's uxil declarations. */
28
+ export interface UxSurfaceTree {
29
+ readonly surfaces: readonly UxSurface[];
30
+ readonly diagnostics: readonly Diagnostic[];
31
+ }
32
+ /**
33
+ * Assemble one entry's uxil declarations into its surface tree. Reads
34
+ * `entry.bodyTokens` (root spans) and `entry.bodyAst` (element/child
35
+ * bullets) — no parser or model change; S8 is a pure downstream reader.
36
+ */
37
+ export declare function assembleUxSurface(entry: Entry): UxSurfaceTree;
38
+ //# sourceMappingURL=assemble.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assemble.d.ts","sourceRoot":"","sources":["../../src/uxil/assemble.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAIL,KAAK,MAAM,EAEZ,MAAM,gBAAgB,CAAC;AAcxB;;;qEAGqE;AACrE,eAAO,MAAM,UAAU,EAAE,MAGxB,CAAC;AAEF,qDAAqD;AACrD,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;CACnC;AAED,+DAA+D;AAC/D,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,SAAS,SAAS,EAAE,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;CACnC;AAED,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,SAAS,EAAE,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AA0ED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAoP7D"}
@@ -0,0 +1,272 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UX_REF_OPS = void 0;
4
+ exports.assembleUxSurface = assembleUxSurface;
5
+ const mod_js_1 = require("../decl/mod.js");
6
+ const diagnostics_js_1 = require("./diagnostics.js");
7
+ const grammar_js_1 = require("./grammar.js");
8
+ const recognize_js_1 = require("./recognize.js");
9
+ const surfaces_js_1 = require("./surfaces.js");
10
+ /** Reference operations for uxil's dotted internal surface paths. Child
11
+ * surfaces are always relative (the leading-dot grammar has no absolute
12
+ * form), so `isAbsolute` never fires in practice for a child-surface join —
13
+ * kept for API symmetry with the DSL-agnostic `core/decl` engine. */
14
+ exports.UX_REF_OPS = {
15
+ isAbsolute: (r) => r.startsWith("ux:"),
16
+ join: (b, r) => `${b}.${r}`,
17
+ };
18
+ function toLocation(entry, range) {
19
+ return {
20
+ file: entry.location.file,
21
+ line: (entry.bodyStartLine ?? 1) + range.start.line - 1,
22
+ column: range.start.column,
23
+ };
24
+ }
25
+ /**
26
+ * Anchor a span-relative grammar diagnostic at its inline span's file
27
+ * location (#727). Line always composes; column composes only on the
28
+ * diagnostic's first line (grammar positions currently always carry
29
+ * line 1 — the line math is defensive).
30
+ */
31
+ function anchorSpanDiagnostic(file, span, d) {
32
+ return {
33
+ code: d.code,
34
+ severity: d.severity,
35
+ message: d.message,
36
+ location: {
37
+ file,
38
+ line: span.location.line + (d.position.line - 1),
39
+ column: d.position.line === 1
40
+ ? span.innerColumn + (d.position.column - 1)
41
+ : d.position.column,
42
+ },
43
+ };
44
+ }
45
+ /**
46
+ * Anchor a paragraph-relative grammar diagnostic (#781) at its bullet's
47
+ * file location (#727). Columns are body-indent-relative — the same
48
+ * accepted dedent wart typl's bridge documents; line math is exact.
49
+ */
50
+ function anchorBulletDiagnostic(entry, range, d) {
51
+ const base = toLocation(entry, range);
52
+ return {
53
+ code: d.code,
54
+ severity: d.severity,
55
+ message: d.message,
56
+ location: {
57
+ file: base.file,
58
+ line: base.line + (d.position.line - 1),
59
+ column: d.position.line === 1
60
+ ? base.column + (d.position.column - 1)
61
+ : d.position.column,
62
+ },
63
+ };
64
+ }
65
+ /**
66
+ * Assemble one entry's uxil declarations into its surface tree. Reads
67
+ * `entry.bodyTokens` (root spans) and `entry.bodyAst` (element/child
68
+ * bullets) — no parser or model change; S8 is a pure downstream reader.
69
+ */
70
+ function assembleUxSurface(entry) {
71
+ const diagnostics = [];
72
+ // ── Root ──────────────────────────────────────────────────────────────
73
+ const rootSpans = (0, surfaces_js_1.extractUxRootSpans)(entry.bodyTokens);
74
+ const rootCandidates = [];
75
+ for (const span of rootSpans) {
76
+ const { decl, diagnostics: parseDiags } = (0, grammar_js_1.parseRootDecl)(span.source);
77
+ diagnostics.push(...parseDiags.map((d) => anchorSpanDiagnostic(entry.location.file, span, d)));
78
+ if (decl && parseDiags.length === 0) {
79
+ rootCandidates.push({
80
+ surface: decl.surface,
81
+ kind: decl.kind,
82
+ states: decl.states,
83
+ location: span.location,
84
+ });
85
+ }
86
+ }
87
+ let rootPath;
88
+ let rootKind;
89
+ let rootStates = [];
90
+ let rootLocation;
91
+ const bullets = (0, surfaces_js_1.extractUxBullets)(entry.bodyAst ?? []);
92
+ if (rootCandidates.length === 0) {
93
+ // A malformed root span already reports its own specific parse
94
+ // diagnostic (e.g. UXIL-004) — adding "no root found" on top would be
95
+ // redundant noise for the same defect. UXIL-011 is reserved for the
96
+ // distinct case: uxil content exists (bullets) but no root span was
97
+ // ever written at all. An entry with no uxil content whatsoever is not
98
+ // this module's concern (ADR-009: entry-type policy is S9/profile's).
99
+ if (rootSpans.length === 0 && bullets.length > 0) {
100
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnosticAt)("UXIL-011", {}, {
101
+ file: entry.location.file,
102
+ line: entry.bodyStartLine ?? 1,
103
+ column: 1,
104
+ }));
105
+ }
106
+ }
107
+ else {
108
+ const check = (0, mod_js_1.checkSingleRoot)(rootCandidates);
109
+ const first = rootCandidates[0];
110
+ rootPath = first.surface.join(".");
111
+ rootKind = first.kind;
112
+ rootStates = first.states;
113
+ rootLocation = first.location;
114
+ if (!check.ok) {
115
+ // multiple-roots: first wins (source order); every extra is UXIL-012.
116
+ for (let k = 1; k < check.roots.length; k++) {
117
+ const extra = check.roots[k];
118
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnosticAt)("UXIL-012", { first: `ux:${rootPath}` }, extra.location));
119
+ }
120
+ }
121
+ }
122
+ // ── Element / child-surface bullets ─────────────────────────────────────
123
+ const bulletInfo = bullets.map((bullet) => {
124
+ const span = (0, surfaces_js_1.stripUxilLeadingSpan)(bullet.source);
125
+ const form = span !== undefined ? (0, recognize_js_1.classifyUxilForm)(span) : undefined;
126
+ if (form === "child") {
127
+ const { decl, diagnostics: parseDiags } = (0, grammar_js_1.parseChildSurfaceDecl)(span);
128
+ diagnostics.push(...parseDiags.map((d) => anchorBulletDiagnostic(entry, bullet.range, d)));
129
+ if (decl && parseDiags.length === 0) {
130
+ return {
131
+ form: "child",
132
+ childPath: decl.path,
133
+ childStates: decl.states,
134
+ };
135
+ }
136
+ return { form: "child" };
137
+ }
138
+ // form === "element" (extractUxBullets only returns element/child spans).
139
+ const { decl, diagnostics: parseDiags } = (0, grammar_js_1.parseElementBullet)(bullet.source);
140
+ diagnostics.push(...parseDiags.map((d) => anchorBulletDiagnostic(entry, bullet.range, d)));
141
+ if (decl && parseDiags.length === 0) {
142
+ return {
143
+ form: "element",
144
+ elementName: decl.element,
145
+ verbs: decl.verbs,
146
+ keyTemplate: decl.keyTemplate,
147
+ navTarget: decl.nav ? decl.nav.surface.join(".") : undefined,
148
+ elementStates: decl.states,
149
+ eventDictionary: decl.eventDictionary,
150
+ };
151
+ }
152
+ return { form: "element" };
153
+ });
154
+ // Nearest ancestor base for a bullet's `.parent` chain: the closest
155
+ // "child" ancestor (skipping over "element" ancestors, which never
156
+ // establish a base — core/decl/resolve rule 1), or root when there is
157
+ // none. A "child" ancestor whose OWN declaration failed to resolve
158
+ // reports `blocked: true` rather than being skipped past — everything
159
+ // nested beneath a broken intermediate declaration is unscopeable, and
160
+ // must not silently reattach to a grandparent or root (that would
161
+ // produce a plausible-looking but wrong path with no diagnostic
162
+ // explaining the reparenting). `resolveRef` only ever consults the
163
+ // single nearest base (rule 3, "not accumulated up the chain"), so
164
+ // finding just this one ancestor is sufficient — no chain to build.
165
+ const nearestAncestorBase = (parent) => {
166
+ let p = parent;
167
+ while (p !== undefined) {
168
+ const info = bulletInfo[p];
169
+ if (info.form === "child") {
170
+ return info.resolvedPath !== undefined
171
+ ? { path: info.resolvedPath }
172
+ : { blocked: true };
173
+ }
174
+ p = bullets[p].parent;
175
+ }
176
+ return undefined;
177
+ };
178
+ const scopeFor = (parent) => {
179
+ const nearest = nearestAncestorBase(parent);
180
+ if (nearest && "blocked" in nearest)
181
+ return undefined;
182
+ const base = nearest?.path ?? rootPath;
183
+ return base !== undefined ? { base } : undefined;
184
+ };
185
+ // Resolve child-surface paths in source order. Parents always precede
186
+ // children in the depth-first extraction order (core/decl/surfaces.ts
187
+ // guarantee), so a single forward pass suffices — no fixpoint needed.
188
+ for (let i = 0; i < bullets.length; i++) {
189
+ const info = bulletInfo[i];
190
+ if (info.form !== "child" || info.childPath === undefined)
191
+ continue;
192
+ const res = (0, mod_js_1.resolveRef)(info.childPath.join("."), scopeFor(bullets[i].parent), exports.UX_REF_OPS);
193
+ if (res.ok) {
194
+ info.resolvedPath = res.ref;
195
+ continue;
196
+ }
197
+ // UXIL-024 (S9 #727), reserved: emitted only when a relative ref's
198
+ // failure is NOT attributable to a missing/broken root (already
199
+ // UXIL-011 or a root parse diagnostic) or a blocked ancestor (its own
200
+ // diagnostic) — the cascade suppression S8 chose. With the root as the
201
+ // universal fallback base this branch is structurally unreachable
202
+ // today; it becomes live when a surface with a non-root base (the
203
+ // table caption base, epic §A) lands.
204
+ const nearest = nearestAncestorBase(bullets[i].parent);
205
+ const blocked = nearest !== undefined && "blocked" in nearest;
206
+ if (!blocked && rootCandidates.length > 0) {
207
+ diagnostics.push((0, diagnostics_js_1.uxilDiagnosticAt)("UXIL-024", { ref: `.${info.childPath.join(".")}` }, toLocation(entry, bullets[i].range)));
208
+ }
209
+ }
210
+ // Nearest enclosing surface path for a bullet's `.parent` — the closest
211
+ // resolved child-surface ancestor, or the root when there is none (or
212
+ // `undefined` when the nearest ancestor is itself unresolved — see
213
+ // nearestAncestorBase).
214
+ const enclosingSurfacePath = (parent) => {
215
+ const nearest = nearestAncestorBase(parent);
216
+ if (nearest && "blocked" in nearest)
217
+ return undefined;
218
+ return nearest?.path ?? rootPath;
219
+ };
220
+ // ── Group elements under their enclosing surface ────────────────────────
221
+ const elementsByPath = new Map();
222
+ for (let i = 0; i < bullets.length; i++) {
223
+ const info = bulletInfo[i];
224
+ if (info.form !== "element" || info.elementName === undefined)
225
+ continue;
226
+ const path = enclosingSurfacePath(bullets[i].parent);
227
+ if (path === undefined)
228
+ continue; // no root in scope — see note above
229
+ const element = {
230
+ name: info.elementName,
231
+ verbs: info.verbs ?? [],
232
+ ...(info.keyTemplate ? { keyTemplate: info.keyTemplate } : {}),
233
+ ...(info.navTarget !== undefined ? { navTarget: info.navTarget } : {}),
234
+ states: info.elementStates ?? [],
235
+ eventDictionary: info.eventDictionary ?? "",
236
+ location: toLocation(entry, bullets[i].range),
237
+ };
238
+ const list = elementsByPath.get(path);
239
+ if (list)
240
+ list.push(element);
241
+ else
242
+ elementsByPath.set(path, [element]);
243
+ }
244
+ // ── Build the surface list ───────────────────────────────────────────────
245
+ const surfaces = [];
246
+ if (rootPath !== undefined && rootKind !== undefined &&
247
+ rootLocation !== undefined) {
248
+ surfaces.push({
249
+ path: rootPath,
250
+ kind: rootKind,
251
+ states: rootStates,
252
+ elements: elementsByPath.get(rootPath) ?? [],
253
+ location: rootLocation,
254
+ });
255
+ }
256
+ for (let i = 0; i < bullets.length; i++) {
257
+ const info = bulletInfo[i];
258
+ if (info.form !== "child" || info.resolvedPath === undefined)
259
+ continue;
260
+ surfaces.push({
261
+ path: info.resolvedPath,
262
+ // A resolved child-surface implies rootPath (hence rootKind) is
263
+ // defined — the only source of a base in this model is the root
264
+ // fallback (see scopeFor); every resolved path traces back to it.
265
+ kind: rootKind,
266
+ states: info.childStates ?? [],
267
+ elements: elementsByPath.get(info.resolvedPath) ?? [],
268
+ location: toLocation(entry, bullets[i].range),
269
+ });
270
+ }
271
+ return { surfaces, diagnostics };
272
+ }
@@ -0,0 +1,63 @@
1
+ /**
2
+ * @module uxil/ast
3
+ *
4
+ * AST node types for the uxil DSL (parse-only, S7 #725). A `UxRef` is a
5
+ * parsed `ux:` reference (citation, nav target, or the surface head of a
6
+ * declaration); the three `*Decl` shapes are the authored declaration forms.
7
+ * All values are captured raw — kind/verb/state vocabulary checks are S8.
8
+ */
9
+ /** 1-based source position within a single uxil source string (line is always 1). */
10
+ export interface Position {
11
+ readonly line: number;
12
+ readonly column: number;
13
+ }
14
+ /** A ref key: a concrete value or a `{name}` template. */
15
+ export type UxKey = {
16
+ readonly kind: "concrete";
17
+ readonly value: string;
18
+ } | {
19
+ readonly kind: "template";
20
+ readonly name: string;
21
+ };
22
+ /**
23
+ * A parsed `ux:` reference. `hasScheme` records whether the literal `ux:`
24
+ * scheme was present; the scheme-less wire form parses to an otherwise
25
+ * identical node (wire-compatibility contract).
26
+ */
27
+ export interface UxRef {
28
+ readonly hasScheme: boolean;
29
+ readonly surface: readonly string[];
30
+ readonly state?: string;
31
+ readonly element?: string;
32
+ readonly key?: UxKey;
33
+ readonly verb?: string;
34
+ readonly position: Position;
35
+ }
36
+ /** Root declaration: `ux:surface : kind @ state, state, …` (exactly one per entry — enforced in S8). */
37
+ export interface RootDecl {
38
+ readonly form: "root";
39
+ readonly surface: readonly string[];
40
+ readonly kind: string;
41
+ readonly states: readonly string[];
42
+ readonly position: Position;
43
+ }
44
+ /** Element declaration from a bullet: `/element : verb, … : {key} @state -> nav` plus a trailing event dictionary. */
45
+ export interface ElementDecl {
46
+ readonly form: "element";
47
+ readonly element: string;
48
+ readonly keyTemplate?: UxKey;
49
+ readonly verbs: readonly string[];
50
+ readonly states?: readonly string[];
51
+ readonly nav?: UxRef;
52
+ readonly eventDictionary: string;
53
+ readonly position: Position;
54
+ }
55
+ /** Child-surface declaration from a bullet: `.path @state` (its nested bullets are its elements — stitched in S8). */
56
+ export interface ChildSurfaceDecl {
57
+ readonly form: "child";
58
+ readonly path: readonly string[];
59
+ readonly states?: readonly string[];
60
+ readonly position: Position;
61
+ }
62
+ export type UxilDecl = RootDecl | ElementDecl | ChildSurfaceDecl;
63
+ //# sourceMappingURL=ast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/uxil/ast.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,qFAAqF;AACrF,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,0DAA0D;AAC1D,MAAM,MAAM,KAAK,GACb;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACrD;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzD;;;;GAIG;AACH,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAED,wGAAwG;AACxG,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAED,sHAAsH;AACtH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAED,sHAAsH;AACtH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAED,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,gBAAgB,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * @module uxil/ast
4
+ *
5
+ * AST node types for the uxil DSL (parse-only, S7 #725). A `UxRef` is a
6
+ * parsed `ux:` reference (citation, nav target, or the surface head of a
7
+ * declaration); the three `*Decl` shapes are the authored declaration forms.
8
+ * All values are captured raw — kind/verb/state vocabulary checks are S8.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @module uxil/citations
3
+ *
4
+ * Citation extraction (S8 #726): a *citation* is a bare `ux:` reference in
5
+ * an inline code span with no declaration clause — e.g.
6
+ * `` `ux:media.home/play!activate` ``. Plain root/element/child
7
+ * declarations are excluded (`classifyUxilForm` recognizes them). Mirrors
8
+ * typl/citations.ts's inline half.
9
+ */
10
+ import type { BodyToken, SourceLocation } from "../model/mod.js";
11
+ import type { UxRef } from "./ast.js";
12
+ /** One `ux:` citation: the parsed ref and its file location. */
13
+ export interface UxCitation {
14
+ readonly ref: UxRef;
15
+ readonly location: SourceLocation;
16
+ }
17
+ /** True when a code span's (trimmed) text is a `ux:` citation, not a declaration. */
18
+ export declare function isUxCitationText(text: string): boolean;
19
+ /**
20
+ * Filter `Entry.bodyTokens` to `ux:` citations, in source order. Reuses
21
+ * the shared inline-declaration walker with the citation recognizer; a
22
+ * citation that fails to parse cleanly (e.g. a reserved character) is
23
+ * dropped rather than surfaced — parse-level diagnostics are S7's
24
+ * concern, not this extractor's.
25
+ */
26
+ export declare function extractUxCitations(bodyTokens: readonly BodyToken[]): readonly UxCitation[];
27
+ //# sourceMappingURL=citations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"citations.d.ts","sourceRoot":"","sources":["../../src/uxil/citations.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAItC,gEAAgE;AAChE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;CACnC;AAED,qFAAqF;AACrF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGtD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,SAAS,SAAS,EAAE,GAC/B,SAAS,UAAU,EAAE,CASvB"}