@ifc-lite/ids-authoring 0.0.0-stage → 0.2.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 (447) hide show
  1. package/LICENSE +373 -0
  2. package/README.md +469 -2
  3. package/dist/bsdd/cache.d.ts +37 -0
  4. package/dist/bsdd/cache.d.ts.map +1 -0
  5. package/dist/bsdd/cache.js +116 -0
  6. package/dist/bsdd/cache.js.map +1 -0
  7. package/dist/bsdd/contract.d.ts +31 -0
  8. package/dist/bsdd/contract.d.ts.map +1 -0
  9. package/dist/bsdd/contract.js +185 -0
  10. package/dist/bsdd/contract.js.map +1 -0
  11. package/dist/bsdd/dictionary.d.ts +42 -0
  12. package/dist/bsdd/dictionary.d.ts.map +1 -0
  13. package/dist/bsdd/dictionary.js +115 -0
  14. package/dist/bsdd/dictionary.js.map +1 -0
  15. package/dist/bsdd/generator.d.ts +82 -0
  16. package/dist/bsdd/generator.d.ts.map +1 -0
  17. package/dist/bsdd/generator.js +155 -0
  18. package/dist/bsdd/generator.js.map +1 -0
  19. package/dist/bsdd/http-source.d.ts +15 -0
  20. package/dist/bsdd/http-source.d.ts.map +1 -0
  21. package/dist/bsdd/http-source.js +196 -0
  22. package/dist/bsdd/http-source.js.map +1 -0
  23. package/dist/bsdd/idb-store.d.ts +16 -0
  24. package/dist/bsdd/idb-store.d.ts.map +1 -0
  25. package/dist/bsdd/idb-store.js +58 -0
  26. package/dist/bsdd/idb-store.js.map +1 -0
  27. package/dist/bsdd/insert.d.ts +55 -0
  28. package/dist/bsdd/insert.d.ts.map +1 -0
  29. package/dist/bsdd/insert.js +105 -0
  30. package/dist/bsdd/insert.js.map +1 -0
  31. package/dist/bsdd/mapping.d.ts +62 -0
  32. package/dist/bsdd/mapping.d.ts.map +1 -0
  33. package/dist/bsdd/mapping.js +163 -0
  34. package/dist/bsdd/mapping.js.map +1 -0
  35. package/dist/bsdd/picker.d.ts +91 -0
  36. package/dist/bsdd/picker.d.ts.map +1 -0
  37. package/dist/bsdd/picker.js +151 -0
  38. package/dist/bsdd/picker.js.map +1 -0
  39. package/dist/bsdd/types.d.ts +162 -0
  40. package/dist/bsdd/types.d.ts.map +1 -0
  41. package/dist/bsdd/types.js +26 -0
  42. package/dist/bsdd/types.js.map +1 -0
  43. package/dist/bsdd/uri-health.d.ts +65 -0
  44. package/dist/bsdd/uri-health.d.ts.map +1 -0
  45. package/dist/bsdd/uri-health.js +110 -0
  46. package/dist/bsdd/uri-health.js.map +1 -0
  47. package/dist/canonical-json.d.ts +7 -0
  48. package/dist/canonical-json.d.ts.map +1 -0
  49. package/dist/canonical-json.js +20 -0
  50. package/dist/canonical-json.js.map +1 -0
  51. package/dist/comments/view.d.ts +37 -0
  52. package/dist/comments/view.d.ts.map +1 -0
  53. package/dist/comments/view.js +61 -0
  54. package/dist/comments/view.js.map +1 -0
  55. package/dist/compound/expand.d.ts +5 -0
  56. package/dist/compound/expand.d.ts.map +1 -0
  57. package/dist/compound/expand.js +135 -0
  58. package/dist/compound/expand.js.map +1 -0
  59. package/dist/compound/from-bsdd.d.ts +9 -0
  60. package/dist/compound/from-bsdd.d.ts.map +1 -0
  61. package/dist/compound/from-bsdd.js +166 -0
  62. package/dist/compound/from-bsdd.js.map +1 -0
  63. package/dist/diff/align.d.ts +42 -0
  64. package/dist/diff/align.d.ts.map +1 -0
  65. package/dist/diff/align.js +78 -0
  66. package/dist/diff/align.js.map +1 -0
  67. package/dist/diff/changelog-text.d.ts +39 -0
  68. package/dist/diff/changelog-text.d.ts.map +1 -0
  69. package/dist/diff/changelog-text.js +120 -0
  70. package/dist/diff/changelog-text.js.map +1 -0
  71. package/dist/diff/changelog.d.ts +28 -0
  72. package/dist/diff/changelog.d.ts.map +1 -0
  73. package/dist/diff/changelog.js +173 -0
  74. package/dist/diff/changelog.js.map +1 -0
  75. package/dist/diff/compare.d.ts +25 -0
  76. package/dist/diff/compare.d.ts.map +1 -0
  77. package/dist/diff/compare.js +150 -0
  78. package/dist/diff/compare.js.map +1 -0
  79. package/dist/diff/diff.d.ts +13 -0
  80. package/dist/diff/diff.d.ts.map +1 -0
  81. package/dist/diff/diff.js +140 -0
  82. package/dist/diff/diff.js.map +1 -0
  83. package/dist/diff/index.d.ts +5 -0
  84. package/dist/diff/index.d.ts.map +1 -0
  85. package/dist/diff/index.js +7 -0
  86. package/dist/diff/index.js.map +1 -0
  87. package/dist/diff/patch.d.ts +10 -0
  88. package/dist/diff/patch.d.ts.map +1 -0
  89. package/dist/diff/patch.js +177 -0
  90. package/dist/diff/patch.js.map +1 -0
  91. package/dist/diff/types.d.ts +201 -0
  92. package/dist/diff/types.d.ts.map +1 -0
  93. package/dist/diff/types.js +5 -0
  94. package/dist/diff/types.js.map +1 -0
  95. package/dist/document/fields.d.ts +33 -0
  96. package/dist/document/fields.d.ts.map +1 -0
  97. package/dist/document/fields.js +117 -0
  98. package/dist/document/fields.js.map +1 -0
  99. package/dist/document/from-ids.d.ts +32 -0
  100. package/dist/document/from-ids.d.ts.map +1 -0
  101. package/dist/document/from-ids.js +47 -0
  102. package/dist/document/from-ids.js.map +1 -0
  103. package/dist/document/node-index.d.ts +32 -0
  104. package/dist/document/node-index.d.ts.map +1 -0
  105. package/dist/document/node-index.js +127 -0
  106. package/dist/document/node-index.js.map +1 -0
  107. package/dist/document/types.d.ts +170 -0
  108. package/dist/document/types.d.ts.map +1 -0
  109. package/dist/document/types.js +19 -0
  110. package/dist/document/types.js.map +1 -0
  111. package/dist/gate/bsdd.d.ts +12 -0
  112. package/dist/gate/bsdd.d.ts.map +1 -0
  113. package/dist/gate/bsdd.js +17 -0
  114. package/dist/gate/bsdd.js.map +1 -0
  115. package/dist/gate/check.d.ts +6 -0
  116. package/dist/gate/check.d.ts.map +1 -0
  117. package/dist/gate/check.js +125 -0
  118. package/dist/gate/check.js.map +1 -0
  119. package/dist/gate/context.d.ts +51 -0
  120. package/dist/gate/context.d.ts.map +1 -0
  121. package/dist/gate/context.js +74 -0
  122. package/dist/gate/context.js.map +1 -0
  123. package/dist/gate/grounding-pset.d.ts +5 -0
  124. package/dist/gate/grounding-pset.d.ts.map +1 -0
  125. package/dist/gate/grounding-pset.js +179 -0
  126. package/dist/gate/grounding-pset.js.map +1 -0
  127. package/dist/gate/grounding.d.ts +48 -0
  128. package/dist/gate/grounding.d.ts.map +1 -0
  129. package/dist/gate/grounding.js +146 -0
  130. package/dist/gate/grounding.js.map +1 -0
  131. package/dist/gate/rank.d.ts +28 -0
  132. package/dist/gate/rank.d.ts.map +1 -0
  133. package/dist/gate/rank.js +68 -0
  134. package/dist/gate/rank.js.map +1 -0
  135. package/dist/gate/structural.d.ts +43 -0
  136. package/dist/gate/structural.d.ts.map +1 -0
  137. package/dist/gate/structural.js +175 -0
  138. package/dist/gate/structural.js.map +1 -0
  139. package/dist/gate/types.d.ts +45 -0
  140. package/dist/gate/types.d.ts.map +1 -0
  141. package/dist/gate/types.js +5 -0
  142. package/dist/gate/types.js.map +1 -0
  143. package/dist/gate/values.d.ts +19 -0
  144. package/dist/gate/values.d.ts.map +1 -0
  145. package/dist/gate/values.js +124 -0
  146. package/dist/gate/values.js.map +1 -0
  147. package/dist/headless/apply-gated.d.ts +32 -0
  148. package/dist/headless/apply-gated.d.ts.map +1 -0
  149. package/dist/headless/apply-gated.js +26 -0
  150. package/dist/headless/apply-gated.js.map +1 -0
  151. package/dist/headless/diff.d.ts +41 -0
  152. package/dist/headless/diff.d.ts.map +1 -0
  153. package/dist/headless/diff.js +116 -0
  154. package/dist/headless/diff.js.map +1 -0
  155. package/dist/headless/node-path.d.ts +10 -0
  156. package/dist/headless/node-path.d.ts.map +1 -0
  157. package/dist/headless/node-path.js +24 -0
  158. package/dist/headless/node-path.js.map +1 -0
  159. package/dist/headless/read.d.ts +26 -0
  160. package/dist/headless/read.d.ts.map +1 -0
  161. package/dist/headless/read.js +78 -0
  162. package/dist/headless/read.js.map +1 -0
  163. package/dist/headless/schema-lookup.d.ts +52 -0
  164. package/dist/headless/schema-lookup.d.ts.map +1 -0
  165. package/dist/headless/schema-lookup.js +77 -0
  166. package/dist/headless/schema-lookup.js.map +1 -0
  167. package/dist/headless/write.d.ts +46 -0
  168. package/dist/headless/write.d.ts.map +1 -0
  169. package/dist/headless/write.js +103 -0
  170. package/dist/headless/write.js.map +1 -0
  171. package/dist/history/history.d.ts +90 -0
  172. package/dist/history/history.d.ts.map +1 -0
  173. package/dist/history/history.js +86 -0
  174. package/dist/history/history.js.map +1 -0
  175. package/dist/history/persistence.d.ts +33 -0
  176. package/dist/history/persistence.d.ts.map +1 -0
  177. package/dist/history/persistence.js +71 -0
  178. package/dist/history/persistence.js.map +1 -0
  179. package/dist/index.d.ts +55 -0
  180. package/dist/index.d.ts.map +1 -0
  181. package/dist/index.js +75 -0
  182. package/dist/index.js.map +1 -0
  183. package/dist/lint/context.d.ts +15 -0
  184. package/dist/lint/context.d.ts.map +1 -0
  185. package/dist/lint/context.js +24 -0
  186. package/dist/lint/context.js.map +1 -0
  187. package/dist/lint/docs.d.ts +18 -0
  188. package/dist/lint/docs.d.ts.map +1 -0
  189. package/dist/lint/docs.js +117 -0
  190. package/dist/lint/docs.js.map +1 -0
  191. package/dist/lint/engine.d.ts +21 -0
  192. package/dist/lint/engine.d.ts.map +1 -0
  193. package/dist/lint/engine.js +123 -0
  194. package/dist/lint/engine.js.map +1 -0
  195. package/dist/lint/fix.d.ts +27 -0
  196. package/dist/lint/fix.d.ts.map +1 -0
  197. package/dist/lint/fix.js +22 -0
  198. package/dist/lint/fix.js.map +1 -0
  199. package/dist/lint/precision.d.ts +51 -0
  200. package/dist/lint/precision.d.ts.map +1 -0
  201. package/dist/lint/precision.js +64 -0
  202. package/dist/lint/precision.js.map +1 -0
  203. package/dist/lint/rules/bsdd.d.ts +5 -0
  204. package/dist/lint/rules/bsdd.d.ts.map +1 -0
  205. package/dist/lint/rules/bsdd.js +123 -0
  206. package/dist/lint/rules/bsdd.js.map +1 -0
  207. package/dist/lint/rules/card.d.ts +10 -0
  208. package/dist/lint/rules/card.d.ts.map +1 -0
  209. package/dist/lint/rules/card.js +140 -0
  210. package/dist/lint/rules/card.js.map +1 -0
  211. package/dist/lint/rules/doc-ver-part.d.ts +7 -0
  212. package/dist/lint/rules/doc-ver-part.d.ts.map +1 -0
  213. package/dist/lint/rules/doc-ver-part.js +155 -0
  214. package/dist/lint/rules/doc-ver-part.js.map +1 -0
  215. package/dist/lint/rules/entity.d.ts +12 -0
  216. package/dist/lint/rules/entity.d.ts.map +1 -0
  217. package/dist/lint/rules/entity.js +215 -0
  218. package/dist/lint/rules/entity.js.map +1 -0
  219. package/dist/lint/rules/index.d.ts +4 -0
  220. package/dist/lint/rules/index.d.ts.map +1 -0
  221. package/dist/lint/rules/index.js +63 -0
  222. package/dist/lint/rules/index.js.map +1 -0
  223. package/dist/lint/rules/pdt-att.d.ts +7 -0
  224. package/dist/lint/rules/pdt-att.d.ts.map +1 -0
  225. package/dist/lint/rules/pdt-att.js +209 -0
  226. package/dist/lint/rules/pdt-att.js.map +1 -0
  227. package/dist/lint/rules/pset.d.ts +12 -0
  228. package/dist/lint/rules/pset.d.ts.map +1 -0
  229. package/dist/lint/rules/pset.js +263 -0
  230. package/dist/lint/rules/pset.js.map +1 -0
  231. package/dist/lint/rules/regex.d.ts +6 -0
  232. package/dist/lint/rules/regex.d.ts.map +1 -0
  233. package/dist/lint/rules/regex.js +184 -0
  234. package/dist/lint/rules/regex.js.map +1 -0
  235. package/dist/lint/rules/spec-doc.d.ts +5 -0
  236. package/dist/lint/rules/spec-doc.d.ts.map +1 -0
  237. package/dist/lint/rules/spec-doc.js +132 -0
  238. package/dist/lint/rules/spec-doc.js.map +1 -0
  239. package/dist/lint/rules/spec.d.ts +24 -0
  240. package/dist/lint/rules/spec.d.ts.map +1 -0
  241. package/dist/lint/rules/spec.js +162 -0
  242. package/dist/lint/rules/spec.js.map +1 -0
  243. package/dist/lint/rules/units.d.ts +4 -0
  244. package/dist/lint/rules/units.d.ts.map +1 -0
  245. package/dist/lint/rules/units.js +101 -0
  246. package/dist/lint/rules/units.js.map +1 -0
  247. package/dist/lint/rules/util.d.ts +37 -0
  248. package/dist/lint/rules/util.d.ts.map +1 -0
  249. package/dist/lint/rules/util.js +117 -0
  250. package/dist/lint/rules/util.js.map +1 -0
  251. package/dist/lint/rules/value-sites.d.ts +28 -0
  252. package/dist/lint/rules/value-sites.d.ts.map +1 -0
  253. package/dist/lint/rules/value-sites.js +81 -0
  254. package/dist/lint/rules/value-sites.js.map +1 -0
  255. package/dist/lint/rules/values.d.ts +22 -0
  256. package/dist/lint/rules/values.d.ts.map +1 -0
  257. package/dist/lint/rules/values.js +237 -0
  258. package/dist/lint/rules/values.js.map +1 -0
  259. package/dist/lint/rules/xsd-regex.d.ts +34 -0
  260. package/dist/lint/rules/xsd-regex.d.ts.map +1 -0
  261. package/dist/lint/rules/xsd-regex.js +149 -0
  262. package/dist/lint/rules/xsd-regex.js.map +1 -0
  263. package/dist/lint/solver/sample.d.ts +3 -0
  264. package/dist/lint/solver/sample.d.ts.map +1 -0
  265. package/dist/lint/solver/sample.js +134 -0
  266. package/dist/lint/solver/sample.js.map +1 -0
  267. package/dist/lint/solver/solver.d.ts +39 -0
  268. package/dist/lint/solver/solver.d.ts.map +1 -0
  269. package/dist/lint/solver/solver.js +126 -0
  270. package/dist/lint/solver/solver.js.map +1 -0
  271. package/dist/lint/suppress.d.ts +12 -0
  272. package/dist/lint/suppress.d.ts.map +1 -0
  273. package/dist/lint/suppress.js +56 -0
  274. package/dist/lint/suppress.js.map +1 -0
  275. package/dist/lint/types.d.ts +162 -0
  276. package/dist/lint/types.d.ts.map +1 -0
  277. package/dist/lint/types.js +5 -0
  278. package/dist/lint/types.js.map +1 -0
  279. package/dist/lint/walk.d.ts +20 -0
  280. package/dist/lint/walk.d.ts.map +1 -0
  281. package/dist/lint/walk.js +47 -0
  282. package/dist/lint/walk.js.map +1 -0
  283. package/dist/match/cascade.d.ts +53 -0
  284. package/dist/match/cascade.d.ts.map +1 -0
  285. package/dist/match/cascade.js +135 -0
  286. package/dist/match/cascade.js.map +1 -0
  287. package/dist/match/reidentify.d.ts +46 -0
  288. package/dist/match/reidentify.d.ts.map +1 -0
  289. package/dist/match/reidentify.js +67 -0
  290. package/dist/match/reidentify.js.map +1 -0
  291. package/dist/merge/comments.d.ts +13 -0
  292. package/dist/merge/comments.d.ts.map +1 -0
  293. package/dist/merge/comments.js +61 -0
  294. package/dist/merge/comments.js.map +1 -0
  295. package/dist/merge/index.d.ts +4 -0
  296. package/dist/merge/index.d.ts.map +1 -0
  297. package/dist/merge/index.js +6 -0
  298. package/dist/merge/index.js.map +1 -0
  299. package/dist/merge/keys.d.ts +22 -0
  300. package/dist/merge/keys.d.ts.map +1 -0
  301. package/dist/merge/keys.js +54 -0
  302. package/dist/merge/keys.js.map +1 -0
  303. package/dist/merge/merge.d.ts +8 -0
  304. package/dist/merge/merge.d.ts.map +1 -0
  305. package/dist/merge/merge.js +206 -0
  306. package/dist/merge/merge.js.map +1 -0
  307. package/dist/merge/order.d.ts +11 -0
  308. package/dist/merge/order.d.ts.map +1 -0
  309. package/dist/merge/order.js +117 -0
  310. package/dist/merge/order.js.map +1 -0
  311. package/dist/merge/sidecar.d.ts +12 -0
  312. package/dist/merge/sidecar.d.ts.map +1 -0
  313. package/dist/merge/sidecar.js +64 -0
  314. package/dist/merge/sidecar.js.map +1 -0
  315. package/dist/merge/types.d.ts +50 -0
  316. package/dist/merge/types.d.ts.map +1 -0
  317. package/dist/merge/types.js +5 -0
  318. package/dist/merge/types.js.map +1 -0
  319. package/dist/merge/view.d.ts +28 -0
  320. package/dist/merge/view.d.ts.map +1 -0
  321. package/dist/merge/view.js +35 -0
  322. package/dist/merge/view.js.map +1 -0
  323. package/dist/ops/draft.d.ts +33 -0
  324. package/dist/ops/draft.d.ts.map +1 -0
  325. package/dist/ops/draft.js +253 -0
  326. package/dist/ops/draft.js.map +1 -0
  327. package/dist/ops/json-schema-lite.d.ts +41 -0
  328. package/dist/ops/json-schema-lite.d.ts.map +1 -0
  329. package/dist/ops/json-schema-lite.js +119 -0
  330. package/dist/ops/json-schema-lite.js.map +1 -0
  331. package/dist/ops/schema-values.d.ts +5 -0
  332. package/dist/ops/schema-values.d.ts.map +1 -0
  333. package/dist/ops/schema-values.js +233 -0
  334. package/dist/ops/schema-values.js.map +1 -0
  335. package/dist/ops/schema.d.ts +27 -0
  336. package/dist/ops/schema.d.ts.map +1 -0
  337. package/dist/ops/schema.js +258 -0
  338. package/dist/ops/schema.js.map +1 -0
  339. package/dist/ops/sidecar-ops.d.ts +85 -0
  340. package/dist/ops/sidecar-ops.d.ts.map +1 -0
  341. package/dist/ops/sidecar-ops.js +5 -0
  342. package/dist/ops/sidecar-ops.js.map +1 -0
  343. package/dist/ops/types.d.ts +400 -0
  344. package/dist/ops/types.d.ts.map +1 -0
  345. package/dist/ops/types.js +5 -0
  346. package/dist/ops/types.js.map +1 -0
  347. package/dist/ops/units.d.ts +4 -0
  348. package/dist/ops/units.d.ts.map +1 -0
  349. package/dist/ops/units.js +75 -0
  350. package/dist/ops/units.js.map +1 -0
  351. package/dist/reducer/apply.d.ts +33 -0
  352. package/dist/reducer/apply.d.ts.map +1 -0
  353. package/dist/reducer/apply.js +123 -0
  354. package/dist/reducer/apply.js.map +1 -0
  355. package/dist/reducer/comment-ops.d.ts +18 -0
  356. package/dist/reducer/comment-ops.d.ts.map +1 -0
  357. package/dist/reducer/comment-ops.js +104 -0
  358. package/dist/reducer/comment-ops.js.map +1 -0
  359. package/dist/reducer/edit.d.ts +38 -0
  360. package/dist/reducer/edit.d.ts.map +1 -0
  361. package/dist/reducer/edit.js +126 -0
  362. package/dist/reducer/edit.js.map +1 -0
  363. package/dist/reducer/facet-ops.d.ts +20 -0
  364. package/dist/reducer/facet-ops.d.ts.map +1 -0
  365. package/dist/reducer/facet-ops.js +184 -0
  366. package/dist/reducer/facet-ops.js.map +1 -0
  367. package/dist/reducer/meta-ops.d.ts +20 -0
  368. package/dist/reducer/meta-ops.d.ts.map +1 -0
  369. package/dist/reducer/meta-ops.js +52 -0
  370. package/dist/reducer/meta-ops.js.map +1 -0
  371. package/dist/reducer/spec-ops.d.ts +29 -0
  372. package/dist/reducer/spec-ops.d.ts.map +1 -0
  373. package/dist/reducer/spec-ops.js +181 -0
  374. package/dist/reducer/spec-ops.js.map +1 -0
  375. package/dist/reducer/test-ops.d.ts +15 -0
  376. package/dist/reducer/test-ops.d.ts.map +1 -0
  377. package/dist/reducer/test-ops.js +90 -0
  378. package/dist/reducer/test-ops.js.map +1 -0
  379. package/dist/reducer/value-ops.d.ts +26 -0
  380. package/dist/reducer/value-ops.d.ts.map +1 -0
  381. package/dist/reducer/value-ops.js +173 -0
  382. package/dist/reducer/value-ops.js.map +1 -0
  383. package/dist/render/describe.d.ts +20 -0
  384. package/dist/render/describe.d.ts.map +1 -0
  385. package/dist/render/describe.js +47 -0
  386. package/dist/render/describe.js.map +1 -0
  387. package/dist/revision/index.d.ts +4 -0
  388. package/dist/revision/index.d.ts.map +1 -0
  389. package/dist/revision/index.js +7 -0
  390. package/dist/revision/index.js.map +1 -0
  391. package/dist/revision/revision.d.ts +79 -0
  392. package/dist/revision/revision.d.ts.map +1 -0
  393. package/dist/revision/revision.js +120 -0
  394. package/dist/revision/revision.js.map +1 -0
  395. package/dist/revision/sha256.d.ts +3 -0
  396. package/dist/revision/sha256.d.ts.map +1 -0
  397. package/dist/revision/sha256.js +69 -0
  398. package/dist/revision/sha256.js.map +1 -0
  399. package/dist/revision/verify.d.ts +21 -0
  400. package/dist/revision/verify.d.ts.map +1 -0
  401. package/dist/revision/verify.js +51 -0
  402. package/dist/revision/verify.js.map +1 -0
  403. package/dist/revision/view.d.ts +36 -0
  404. package/dist/revision/view.d.ts.map +1 -0
  405. package/dist/revision/view.js +32 -0
  406. package/dist/revision/view.js.map +1 -0
  407. package/dist/sidecar/idsz.d.ts +14 -0
  408. package/dist/sidecar/idsz.d.ts.map +1 -0
  409. package/dist/sidecar/idsz.js +58 -0
  410. package/dist/sidecar/idsz.js.map +1 -0
  411. package/dist/sidecar/sidecar-schema.d.ts +4 -0
  412. package/dist/sidecar/sidecar-schema.d.ts.map +1 -0
  413. package/dist/sidecar/sidecar-schema.js +69 -0
  414. package/dist/sidecar/sidecar-schema.js.map +1 -0
  415. package/dist/sidecar/sidecar.d.ts +102 -0
  416. package/dist/sidecar/sidecar.d.ts.map +1 -0
  417. package/dist/sidecar/sidecar.js +160 -0
  418. package/dist/sidecar/sidecar.js.map +1 -0
  419. package/dist/testing/index.d.ts +6 -0
  420. package/dist/testing/index.d.ts.map +1 -0
  421. package/dist/testing/index.js +8 -0
  422. package/dist/testing/index.js.map +1 -0
  423. package/dist/testing/junit.d.ts +10 -0
  424. package/dist/testing/junit.d.ts.map +1 -0
  425. package/dist/testing/junit.js +51 -0
  426. package/dist/testing/junit.js.map +1 -0
  427. package/dist/testing/outcome.d.ts +10 -0
  428. package/dist/testing/outcome.d.ts.map +1 -0
  429. package/dist/testing/outcome.js +22 -0
  430. package/dist/testing/outcome.js.map +1 -0
  431. package/dist/testing/runner.d.ts +72 -0
  432. package/dist/testing/runner.d.ts.map +1 -0
  433. package/dist/testing/runner.js +60 -0
  434. package/dist/testing/runner.js.map +1 -0
  435. package/dist/testing/types.d.ts +60 -0
  436. package/dist/testing/types.d.ts.map +1 -0
  437. package/dist/testing/types.js +5 -0
  438. package/dist/testing/types.js.map +1 -0
  439. package/dist/testing/view.d.ts +31 -0
  440. package/dist/testing/view.d.ts.map +1 -0
  441. package/dist/testing/view.js +30 -0
  442. package/dist/testing/view.js.map +1 -0
  443. package/dist/uuid.d.ts +39 -0
  444. package/dist/uuid.d.ts.map +1 -0
  445. package/dist/uuid.js +84 -0
  446. package/dist/uuid.js.map +1 -0
  447. package/package.json +56 -3
package/README.md CHANGED
@@ -1,3 +1,470 @@
1
- # Temporary Holding Version
1
+ # @ifc-lite/ids-authoring
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Headless authoring core for IDS (buildingSMART Information Delivery
4
+ Specification) documents. A UI, an AI agent, an import or the CLI changes an
5
+ IDS only through the typed, invertible operations defined here. Every
6
+ operation passes a grounding gate first, which checks names against the IFC
7
+ schema tables of `@ifc-lite/data`.
8
+
9
+ - **`StudioDocument`**: the `@ifc-lite/ids` `IDSDocument`, plus a stable UUID
10
+ for every node (specification, applicability facet, requirement and
11
+ constraint) and the Studio sidecar (`meta`).
12
+ - **Operation vocabulary v1**: plain JSON ops. One JSON Schema is used both
13
+ to validate ops at runtime and as the tool schema handed to AI agents.
14
+ - **Reducer**: `apply(doc, ops)` is pure and records the exact inverse of
15
+ every op, so undo restores a deep-equal document.
16
+ - **Grounding gate**: `checkOps(ops, doc, ctx)` returns issues as data
17
+ (`code`, `path`, `message`, ranked `candidates`). It never throws on bad
18
+ input.
19
+ - **History**: transactions and undo/redo, plus a `PersistenceAdapter`
20
+ interface.
21
+ - **Sidecar**: `studio.json` and `.idsz` bundles.
22
+ - **Re-identification** of externally edited IDS files.
23
+ - **Plain-language rendering** of facets in English, German and French.
24
+
25
+ ## Quick example
26
+
27
+ ```ts
28
+ import {
29
+ checkOps,
30
+ commit,
31
+ createGateContext,
32
+ createStudioDocument,
33
+ createStudioState,
34
+ undo,
35
+ uuidv7,
36
+ type StudioOp,
37
+ } from '@ifc-lite/ids-authoring';
38
+
39
+ const ctx = await createGateContext();
40
+ let state = createStudioState(createStudioDocument({ title: 'Fire safety' }));
41
+
42
+ const specId = uuidv7();
43
+ const ops: StudioOp[] = [
44
+ { kind: 'spec.add', opId: uuidv7(), payload: { specId, name: 'Doors', ifcVersions: ['IFC4'] } },
45
+ {
46
+ kind: 'facet.add',
47
+ opId: uuidv7(),
48
+ payload: { specId, section: 'applicability', facetId: uuidv7(), facet: { type: 'entity', name: { kind: 'equals', value: 'IfcDoor' } } },
49
+ },
50
+ {
51
+ kind: 'facet.add',
52
+ opId: uuidv7(),
53
+ payload: {
54
+ specId,
55
+ section: 'requirements',
56
+ facetId: uuidv7(),
57
+ facet: {
58
+ type: 'property',
59
+ propertySet: { kind: 'equals', value: 'Pset_DoorCommon' },
60
+ baseName: { kind: 'equals', value: 'FireRatng' }, // typo
61
+ },
62
+ },
63
+ },
64
+ ];
65
+
66
+ const gate = checkOps(ops, state.doc, ctx);
67
+ // gate.ok === false
68
+ // gate.issues[0] → { code: 'GATE-PROP-001', path: 'ops[2].payload.facet.baseName',
69
+ // candidates: [{ value: 'FireRating', … }], … }
70
+
71
+ if (gate.ok) {
72
+ state = commit(state, ops, { source: { by: 'user' } }).state; // one history entry
73
+ state = undo(state); // reverts all three ops
74
+ }
75
+ ```
76
+
77
+ ## Operations (opsVersion 1)
78
+
79
+ All ops have the shape `{ kind, opId, payload }`. `getOpJsonSchema()` returns
80
+ the full JSON Schema and `validateOp(value)` checks an untrusted value
81
+ against it.
82
+
83
+ | Group | Kinds |
84
+ |---|---|
85
+ | Document | `doc.setInfo` |
86
+ | Specification | `spec.add`, `spec.remove`, `spec.duplicate`, `spec.move`, `spec.set`, `spec.setCardinality`, `spec.setIfcVersions` |
87
+ | Facet | `facet.add`, `facet.remove`, `facet.move`, `facet.replace`, `facet.setField`, `facet.setRelation`, `facet.setUri` |
88
+ | Requirement | `requirement.setOptionality`, `requirement.set` |
89
+ | Value | `value.set`, `value.addEnumValue`, `value.removeEnumValue` |
90
+ | Sidecar | `meta.custom.declarePset`, `meta.custom.removePset`, `meta.custom.declareUserDefinedType`, `meta.custom.removeUserDefinedType`, `meta.suppress`, `meta.unsuppress` |
91
+ | Comments | `meta.comment.add`, `meta.comment.reply`, `meta.comment.resolve`, `meta.comment.removeThread`, plus the inverses `meta.comment.removeReply` and `meta.comment.restoreThread` (sidecar only) |
92
+ | Test suites | `meta.test.add`, `meta.test.remove`, `meta.test.setExpectation`, plus the inverse `meta.test.restore` (sidecar only) |
93
+ | Compound | `bulk.renameProperty`, `bulk.retargetEntity`, `bulk.applyTemplate`, `bulk.fromBsddClass` (each expands to primitive ops and undoes in one step) |
94
+ | Fidelity | `spec.restore`, `spec.patch`, `facet.restore`, `facet.patch` (emitted as exact inverses; they carry raw IDS content and node ids) |
95
+
96
+ Values are written as a `ConstraintDraft`, which the reducer normalises into
97
+ an `IDSConstraint`:
98
+
99
+ - `any`, `equals`, `oneOf`, `pattern`;
100
+ - `range`, with an optional `unit` that is converted to SI;
101
+ - `length`, `digits`;
102
+ - `all`, a conjunction of the above;
103
+ - `{ kind: 'raw', constraint }`, a verbatim `IDSConstraint`.
104
+
105
+ Literal entity names and data types are stored in upper case, as they appear
106
+ in IDS XML.
107
+
108
+ ## Gate codes
109
+
110
+ | Code | Meaning |
111
+ |---|---|
112
+ | `GATE-OP-001` / `-002` | Malformed op / bad template parameters |
113
+ | `GATE-ENT-001` | Entity does not exist in every IFC version of the spec (also partOf entities) |
114
+ | `GATE-PDT-001` | Predefined type not in the entity's enumeration (user-defined values must be declared) |
115
+ | `GATE-ATT-001` | Attribute not on the applicability entity (inherited attributes included) |
116
+ | `GATE-PSET-001` | `Pset_`/`Qto_` name is not a standard set (`Qto_` is unverifiable for IFC2X3/IFC4 and accepted until P-01's IDS-009 schema rows exist) |
117
+ | `GATE-PROP-001` | Property not in the standard set |
118
+ | `GATE-ENUM-001` | Value not in the standard property's enumeration |
119
+ | `GATE-DT-001` | Unknown data type, or inconsistent with the standard property |
120
+ | `GATE-CUST-001…004` | Undeclared custom set / reserved prefix on a custom set / property not declared / nothing to remove |
121
+ | `GATE-SUP-001…003` | Suppressions: rule is not a lint code or wildcard / blank reason / nothing to remove |
122
+ | `GATE-STR-001…009` | Structure: unknown or duplicate node, required field, requirement-only data in applicability, partOf without entity, restricted dataType, index range, empty name or duplicate versions, optional entity requirement, `uri` outside a requirement |
123
+ | `GATE-VAL-001…009` | Values: draft error, min > max, pattern does not compile, ReDoS guard, length/digit facets, literal invalid for its base, author/date, enumeration edit on a non-enumeration, `uri` not absolute |
124
+ | `GATE-BSDD-001` | A facet `uri` the bSDD URI index knows to be unresolvable (blocking) or inactive (`severity: 'warning'`, not blocking). Unchecked URIs pass. |
125
+
126
+ Patterns on names (for example `Pset_.*Common`) are valid IDS and are never
127
+ blocked. Only literal names are grounded.
128
+
129
+ ## Lint
130
+
131
+ The audit in `@ifc-lite/ids` answers "is this a valid IDS 1.0 file?". Lint
132
+ answers "does it mean what the author intends?". `createLinter(ctx)` runs the
133
+ rule catalogue over a `StudioDocument` and returns `Diagnostic[]` (stable
134
+ `IDSL-<AREA>-<nnn>` code, severity, node id, message, rationale, docs URL,
135
+ quick fixes).
136
+
137
+ ```ts
138
+ import { checkQuickFix, createLintContext, createLinter, type StudioDocument } from '@ifc-lite/ids-authoring';
139
+
140
+ declare const doc: StudioDocument;
141
+ const ctx = await createLintContext();
142
+ const linter = createLinter(ctx); // keep one per open document
143
+ const { diagnostics, suppressed } = linter.lint(doc);
144
+ const fix = diagnostics[0]?.fixes?.[0];
145
+ if (fix && checkQuickFix(doc, fix, ctx.gate).ok) {
146
+ // commit(state, fix.ops) like any other edit; fixes are never auto-applied
147
+ }
148
+ ```
149
+
150
+ - **Incremental.** Specification-level findings are cached; a later pass
151
+ re-runs only the specifications whose content changed (pass the reducer's
152
+ `touched` set as a hint if you have it).
153
+ - **Quick fixes** are op batches. Every fix the catalogue offers passes the
154
+ grounding gate on the document it was computed for.
155
+ - **Suppressions** live in the sidecar, `meta.suppressions[nodeId]`, as
156
+ `{ rule, reason, by?, at }`. A suppression applies to the node and
157
+ everything below it, `rule` may be an area wildcard (`IDSL-SPEC-*`), and
158
+ one without a reason is ignored. Write them with the ops
159
+ `meta.suppress { nodeId, suppression, index? }` (a second suppression of
160
+ the same rule on the same node replaces the first) and
161
+ `meta.unsuppress { nodeId, rule }`. Both undo exactly. The gate refuses an
162
+ unknown node (`GATE-STR-001`), a rule that is not `IDSL-<AREA>-<nnn>`,
163
+ `IDSL-<AREA>-*` or `IDSL-*` (`GATE-SUP-001`) and a blank reason
164
+ (`GATE-SUP-002`). Removing a suppression that is not there is
165
+ `GATE-SUP-003`.
166
+ - **Severity.** Defaults are per rule; `createLinter(ctx, { severity: { code: 'off' | … } })`
167
+ overrides them. Rules that rest on an unverified IDS semantic ship at
168
+ `info`.
169
+ - **Opt-in rules** (`IDSL-ENT-003`, `IDSL-SPEC-008`) are off by default
170
+ because they fire on most real documents. Enable one by giving it a
171
+ severity (`severity: { 'IDSL-SPEC-008': 'info' }`) or by naming it in
172
+ `rules`.
173
+ - `explainXsdPattern(pattern)` explains an XSD pattern part by part.
174
+
175
+ Per-rule pages: `docs/guide/ids-lint/` (generated by
176
+ `scripts/generate-lint-docs.mjs`).
177
+
178
+ | Code | Severity | Rule | Quick fix |
179
+ |---|---|---|---|
180
+ | `IDSL-ENT-001` | error | Abstract entity in an entity facet | yes |
181
+ | `IDSL-ENT-002` | info | Entity removed in IFC4X3 | yes |
182
+ | `IDSL-ENT-003` | info (opt-in) | Entity has subtypes the author may also mean | yes |
183
+ | `IDSL-ENT-004` | warning | Type entity where an occurrence is meant | yes |
184
+ | `IDSL-ENT-005` | warning | Entity name not in upper case | yes |
185
+ | `IDSL-PDT-001` | error | Predefined type not in the entity enumeration | yes |
186
+ | `IDSL-PDT-002` | info | USERDEFINED predefined type without an ObjectType requirement | yes |
187
+ | `IDSL-PDT-003` | info | Undeclared user-defined predefined type | yes |
188
+ | `IDSL-ATT-001` | error | Attribute not defined on the entity | yes |
189
+ | `IDSL-ATT-002` | warning | Value check on an entity-typed attribute | yes |
190
+ | `IDSL-PSET-001` | warning | Standard property set not applicable to the entity | yes |
191
+ | `IDSL-PSET-002` | error | Custom property set with a reserved prefix | yes |
192
+ | `IDSL-PSET-003` | warning | Quantity set with a non-measure data type or value | yes |
193
+ | `IDSL-PROP-001` | error | Property not in the standard property set | yes |
194
+ | `IDSL-PROP-002` | warning | Data type differs from the standard property | yes |
195
+ | `IDSL-PROP-003` | info | Numeric constraint without a data type | yes |
196
+ | `IDSL-VAL-001` | error | Value not in the standard enumeration | yes |
197
+ | `IDSL-VAL-002` | warning | Restriction base incompatible with the data type | yes |
198
+ | `IDSL-VAL-003` | warning | Simple value that looks like a list | yes |
199
+ | `IDSL-VAL-004` | warning | Simple value that looks like a comparison | yes |
200
+ | `IDSL-VAL-005` | warning | Boolean literal in a form IDS does not accept | yes |
201
+ | `IDSL-VAL-006` | info | Leading or trailing whitespace, or invisible characters | yes |
202
+ | `IDSL-VAL-008` | info | Exact match on a real number | no |
203
+ | `IDSL-UNIT-001` | warning | Magnitude suggests a non-SI unit | yes |
204
+ | `IDSL-REGEX-001` | warning | ^ or $ in an XSD pattern | yes |
205
+ | `IDSL-REGEX-002` | warning | Pattern that is a plain value or matches everything | yes |
206
+ | `IDSL-REGEX-003` | warning | Construct not supported by XSD regex | yes |
207
+ | `IDSL-REGEX-004` | error | Catastrophic backtracking risk | no |
208
+ | `IDSL-CARD-001` | warning | Prohibited requirement with a value or data type | yes |
209
+ | `IDSL-CARD-002` | info | Optional requirement that checks nothing | yes |
210
+ | `IDSL-CARD-003` | warning | Prohibited specification with requirements | yes |
211
+ | `IDSL-CARD-004` | info | Required specification with a narrow applicability | yes |
212
+ | `IDSL-SPEC-001` | warning | Requirement that can never fail | yes |
213
+ | `IDSL-SPEC-002` | error | Contradictory requirements | no |
214
+ | `IDSL-SPEC-003` | warning | Applicability that can never match | no |
215
+ | `IDSL-SPEC-005` | warning | Duplicate specification | yes |
216
+ | `IDSL-SPEC-006` | warning | Overlapping specifications with conflicting requirements | no |
217
+ | `IDSL-SPEC-007` | info | Specification without requirements | no |
218
+ | `IDSL-SPEC-008` | info (opt-in) | Specification without description or instructions | no |
219
+ | `IDSL-SPEC-009` | warning | Duplicate identifier | yes |
220
+ | `IDSL-DOC-001` | error | Author is not an e-mail address, or date is not xs:date | yes |
221
+ | `IDSL-VER-001` | warning | Name valid in only some IFC versions of the specification | yes |
222
+ | `IDSL-PART-001` | info | Unlikely partOf relation for these entities | yes |
223
+ | `IDSL-BSDD-001` | warning | bSDD URI not found or inactive | yes |
224
+ | `IDSL-BSDD-002` | info | Classification system differs from the bSDD dictionary name | yes |
225
+ | `IDSL-BSDD-003` | warning | Value outside the allowed values bSDD publishes | yes |
226
+
227
+ ## bSDD
228
+
229
+ The buildingSMART Data Dictionary feeds the pickers, inserts and
230
+ generators; only search terms and URIs are sent to it, never model data.
231
+ Everything that changes the document goes through `bulk.fromBsddClass`
232
+ and the gate.
233
+
234
+ - **Source.** `createHttpBsddSource({ apiBase, fetch })` speaks the public
235
+ bSDD API v1 (in the viewer, `apiBase` is the `/api/bsdd` proxy). Any
236
+ object implementing `BsddSource` works.
237
+ - **Picker.** `initialPickerFilters` pre-fills the related IFC entity from
238
+ the specification; `createBsddSearch` debounces (250 ms), drops
239
+ superseded responses and hides inactive classes; `cardFromClass` /
240
+ `cardFromSummary` give the result cards.
241
+ - **Insert.** `snapshotBsddClass` + `bsddInsertOp` build a
242
+ `bulk.fromBsddClass` op: classification facet (`system` = dictionary
243
+ name, `value` = code, `uri` on a requirement), entity facet (bSDD's
244
+ `IfcWallSOLIDWALL` split into entity and predefined type), and property
245
+ requirements through the mapping table.
246
+ - **Mapping table.** `mapBsddProperty` maps a bSDD property to a property
247
+ requirement: data type (refined to a measure by dimension or unit),
248
+ allowed values, bounds (converted to SI), pattern, uri, required or
249
+ optional. What it cannot map faithfully is left out and reported as a
250
+ note.
251
+ - **Dictionary → IDS.** `loadClassesWithAncestors`, `buildClassTree`,
252
+ `planDictionaryIds` (one spec per class or per entity, inherited
253
+ properties, required/all scope) and `previewDictionaryIds` (gate, counts,
254
+ lint summary on a dry run). Commit the plan's ops as one transaction.
255
+ - **URI health.** `checkUriHealth` resolves the document's bSDD URIs
256
+ (`collectDocUris`) one at a time, pausing between requests, into a
257
+ `BsddUriIndex`; records stay fresh for 24 h, and an offline or
258
+ rate-limited answer stops the run. Pass the index to
259
+ `createLintContext({ bsdd })` / `createGateContext({ bsdd })` for
260
+ IDSL-BSDD-001…003 and GATE-BSDD-001.
261
+ - **Offline.** `createCachedBsddSource(source, { store })` caches searches,
262
+ classes, dictionaries and URI records (fresh for 24 h). When bSDD cannot
263
+ be reached it serves what it has, however old, and throws
264
+ `BsddUnavailableError` for the rest. `createIndexedDbBsddStore()` is the
265
+ browser store; `loadUriIndex(store)` restores the last URI-health results.
266
+
267
+ ```ts
268
+ import {
269
+ bsddInsertOp,
270
+ checkOps,
271
+ createGateContext,
272
+ createHttpBsddSource,
273
+ snapshotBsddClass,
274
+ type StudioDocument,
275
+ } from '@ifc-lite/ids-authoring';
276
+
277
+ declare const doc: StudioDocument;
278
+ declare const specId: string;
279
+ const source = createHttpBsddSource({ apiBase: '/api/bsdd' });
280
+ const gate = await createGateContext();
281
+ const cls = await source.getClass('https://identifier.buildingsmart.org/uri/buildingsmart/ifc/4.3/class/IfcWall');
282
+ if (cls) {
283
+ const op = bsddInsertOp({
284
+ classes: [snapshotBsddClass(cls, { dictionaryName: 'IFC', gate })],
285
+ target: { specId },
286
+ mode: 'both',
287
+ properties: { select: ['IsExternal'] },
288
+ });
289
+ const result = checkOps([op], doc, gate); // then commit([op]) when result.ok
290
+ }
291
+ ```
292
+
293
+ ## Diff and changelog
294
+
295
+ `diffDocuments(a, b)` compares two documents in IDS terms. Nodes are paired
296
+ with the same matcher as re-identification: by node id when both are
297
+ revisions of one Studio document (same `docId`), otherwise by identifier,
298
+ then name and applicability signature, then similarity.
299
+
300
+ ```ts
301
+ import { changelog, diffDocuments, diffToOps, type StudioDocument } from '@ifc-lite/ids-authoring';
302
+
303
+ declare const before: StudioDocument;
304
+ declare const after: StudioDocument;
305
+ const diff = diffDocuments(before, after);
306
+ // diff.entries: spec.added / spec.changed / facet.valueChanged / requirement.changed / …
307
+ // diff.specs: the side-by-side alignment (a row per spec and facet)
308
+ for (const line of changelog(diff, { locale: 'en' })) console.log(line.text);
309
+ // "Doors: FireRating (Pset_DoorCommon) changed from optional to required"
310
+ const ops = diffToOps(before, diff); // primitive ops that turn `before` into `after`
311
+ ```
312
+
313
+ - Every entry carries the data needed to reproduce it, so `diffToOps`
314
+ rebuilds `after` from `before` exactly. The tests use this as the diff's
315
+ completeness oracle on corpus revisions.
316
+ - A reorder is reported only for nodes off the longest run that kept its
317
+ order: moving one specification to the top is one move.
318
+ - `changelogMarkdown(diff)` groups the sentences by specification (for
319
+ `ids diff --md`). Sentences exist in English, German, French and Italian; facet
320
+ and value wording comes from `@ifc-lite/ids`.
321
+
322
+ ## Three-way merge
323
+
324
+ `mergeDocuments(base, ours, theirs)` merges two revisions of one Studio
325
+ document at the op level. Each side's diff entries are change units with a
326
+ key (a field of a node, a node's existence or place). Units only one side
327
+ changed merge automatically; identical changes merge once. The rest are
328
+ conflicts: `field` (both changed one field differently) or `deleteEdit`
329
+ (one side removed a node, or replaced a facet, that the other changed).
330
+
331
+ ```ts
332
+ import { conflictView, mergeDocuments, resolveConflict, type StudioDocument } from '@ifc-lite/ids-authoring';
333
+
334
+ declare const base: StudioDocument;
335
+ declare const ours: StudioDocument;
336
+ declare const theirs: StudioDocument;
337
+ let result = mergeDocuments(base, ours, theirs);
338
+ const view = conflictView(result); // cards with "ours" / "theirs" sentences
339
+ if (view.cards.length) {
340
+ const resolutions = resolveConflict(view.resolutions, view.cards[0].id, 'theirs');
341
+ result = mergeDocuments(base, ours, theirs, { resolutions });
342
+ }
343
+ // result.doc, result.ops (base → doc), result.clean
344
+ ```
345
+
346
+ - An unresolved conflict keeps the base value.
347
+ - Order is settled per list: the side that reordered wins; when both did,
348
+ theirs wins and `MERGE-ORDER-001` is reported.
349
+ - Pass `{ gate }` to re-check the merged ops with the grounding gate
350
+ (`MERGE-GATE-001`), e.g. one side narrowed the IFC versions while the
351
+ other added an entity that only exists in the old ones.
352
+ - `mergeOps(base, oursOps, theirsOps)` merges two op sequences.
353
+
354
+ ## Revisions and sign-off
355
+
356
+ A `RevisionLog` holds immutable snapshots chained by SHA-256: each
357
+ revision's hash covers its record and its parent's hash, and its
358
+ `contentHash` covers the normative content (IDS content without node ids,
359
+ custom declarations, test suites). Sign-offs are chained the same way.
360
+ Sign-off is an attestation, not a qualified electronic signature.
361
+
362
+ ```ts
363
+ import { commitRevision, createRevisionLog, signOff, verifyRevisionLog, type StudioDocument } from '@ifc-lite/ids-authoring';
364
+
365
+ declare const doc: StudioDocument;
366
+ let log = createRevisionLog(doc.docId);
367
+ const released = commitRevision(log, doc, { author: 'lead@example.com', label: 'released', message: 'v1.0' });
368
+ log = signOff(released.log, released.revision.revId, { by: 'Client', role: 'Reviewer', statement: 'Accepted' }).log;
369
+ verifyRevisionLog(log); // { ok: true, problems: [] }; any edit of a stored record is reported
370
+ ```
371
+
372
+ - A released revision is read-only: a later revision with different
373
+ content on top of it must be a `draft`.
374
+ - `revisionTimeline(log)` is the view model for a revision list (labels,
375
+ sign-offs, plain-language changes against the parent, verification).
376
+
377
+ ## Test suites
378
+
379
+ IDS test suites are "unit tests for information requirements": each
380
+ specification can carry cases (`meta.tests[specId]`), each an IFC fixture
381
+ and the verdict the specification must give on it (`pass`, `fail`, or
382
+ `notApplicable`; a `fail` case may name exactly the requirements that
383
+ fail). Fixtures are `synthetic` (a recipe for `@ifc-lite/ids-testgen`),
384
+ `snapshot` (a subset pinned from a real model) or `file`.
385
+
386
+ ```ts
387
+ import { junitXml, outcomeFromSpecResult, runTestSuites, testSuitesView, type CaseEvaluator, type StudioDocument } from '@ifc-lite/ids-authoring';
388
+
389
+ declare const doc: StudioDocument;
390
+ declare const evaluate: CaseEvaluator; // e.g. from @ifc-lite/ids-testgen, or a viewer worker
391
+ const report = await runTestSuites(doc, evaluate);
392
+ // report.summary: { total, passed, failed, error, skipped }
393
+ const xml = junitXml(report); // for CI
394
+ const panel = testSuitesView(doc, report); // rows per specification, with verdicts
395
+ void outcomeFromSpecResult; // maps a validateIDS specification result onto an outcome
396
+ ```
397
+
398
+ The runner does the bookkeeping; the host's `evaluate` turns a fixture
399
+ into a validator verdict. Test suites change only through `meta.test.*`
400
+ ops and outlive the specification they belong to (undo brings them back).
401
+
402
+ ## Comments
403
+
404
+ Comment threads live in the sidecar (`meta.comments[nodeId]`) and change
405
+ only through `meta.comment.*` ops, so they undo like any other edit and
406
+ never touch the IDS XML. A thread is opened on a live node but outlives
407
+ it: removing a specification keeps its discussion, and undo re-anchors it.
408
+ `commentThreads(doc)` is the view model (anchor, orphan flag, participants,
409
+ `@name` mentions, unresolved badges per node). In a three-way merge,
410
+ threads merge additively: new threads and replies from both sides are kept.
411
+ Lint suppressions and test cases merge per record (node and rule, or test id):
412
+ the side that changed a record relative to the base wins, theirs when both did.
413
+
414
+ ## Sidecar, bundles, re-identification
415
+
416
+ `parseSidecar` checks the node index and the metadata structures consumed by the
417
+ authoring core before attachment. Malformed same-format data throws with its
418
+ field path; `readIdsz` uses the same check for bundled `studio.json`. Valid
419
+ metadata, extension fields and opaque later-pitch payloads remain intact.
420
+
421
+ - `createSidecar(doc, xml)` and `attachSidecar(parsed, sidecar, { previous })`
422
+ persist node ids and `meta` next to the XML, never inside it.
423
+ - `studio.json` embeds a content snapshot (`snapshot: { version: 1, ids }`)
424
+ by default, so a standalone `.idsz` whose XML was edited elsewhere is
425
+ re-identified on its own (`binding: 'reidentified'`, `basis: 'snapshot'`).
426
+ An explicit `previous` document still wins. The field is additive and
427
+ versioned separately from `schemaVersion`: sidecars without it load as
428
+ before (an external edit then gives fresh ids), and a snapshot of a later
429
+ version is kept but ignored. `createSidecar(doc, xml, { snapshot: false })`
430
+ leaves it out.
431
+ - `writeIdsz` and `readIdsz` build a plain zip containing `ids.xml`,
432
+ `studio.json`, `fixtures/*` and `appendix.pdf`. The XML is stored byte for
433
+ byte.
434
+ - `reidentify(previous, incoming)` matches nodes by identifier, then by name
435
+ and signature, then by similarity. Comments and provenance therefore
436
+ survive a revised IDS sent back by a client.
437
+
438
+ ## Headless helpers
439
+
440
+ For the CLI, MCP server, SDK and Flow nodes, which hold no state between
441
+ calls:
442
+
443
+ - `readStudioDocument(xml)` derives node ids from the content, so reading
444
+ the same XML twice gives the same ids. An agent can read a document in one
445
+ call and address its nodes in the next.
446
+ - `parseStudioDocument(json)` accepts a document that crossed a process
447
+ boundary. It checks the shape and the node index and throws on anything
448
+ else.
449
+ - `writeStudioDocument(doc, writer)`, `writeIdsChecked(ids, writer)` and
450
+ `formatIds(xml, writer)` write through an injected `IdsWriter`, normally
451
+ `writeIdsXml` from `@ifc-lite/ids`. They then parse the output again
452
+ and return `{ ok: false, reason: 'lossy', lost }` when a value did not
453
+ survive, instead of handing back XML with less content. A writer that
454
+ refuses the document gives `{ ok: false, reason: 'refused', message }`.
455
+ - `nodePath(doc, nodeId)` gives a node's XML path, e.g.
456
+ `specifications[0].requirements[1].baseName`.
457
+
458
+ ```ts
459
+ import { writeIdsXml } from '@ifc-lite/ids';
460
+ import { formatIds } from '@ifc-lite/ids-authoring';
461
+
462
+ declare const xml: string;
463
+ const out = formatIds(xml, writeIdsXml);
464
+ if (out.ok === false) console.error(out.message, out.lost ?? []);
465
+ else if (out.changed) console.log(out.xml);
466
+ ```
467
+
468
+ ## License
469
+
470
+ MPL-2.0.
@@ -0,0 +1,37 @@
1
+ import { type BsddSource } from './types.js';
2
+ import { type BsddUriIndex } from './uri-health.js';
3
+ export declare const BSDD_CACHE_VERSION = 1;
4
+ export type BsddCacheKind = 'dictionaries' | 'dictionary' | 'classes' | 'search' | 'class' | 'uri';
5
+ export interface BsddCacheEntry {
6
+ v: number;
7
+ kind: BsddCacheKind;
8
+ /** Epoch milliseconds. */
9
+ storedAt: number;
10
+ value: unknown;
11
+ }
12
+ /** Persistent key/value storage for the cache. */
13
+ export interface BsddCacheStore {
14
+ /** The stored value, unchecked (`undefined` when absent). */
15
+ get(key: string): Promise<unknown>;
16
+ put(key: string, entry: BsddCacheEntry): Promise<void>;
17
+ delete(key: string): Promise<void>;
18
+ /** Keys starting with `prefix`. */
19
+ keys(prefix: string): Promise<string[]>;
20
+ }
21
+ export declare function createMemoryBsddStore(): BsddCacheStore;
22
+ export interface CachedBsddSourceOptions {
23
+ store: BsddCacheStore;
24
+ /** How long an entry is served without asking bSDD. Default 24 h. */
25
+ ttlMs?: number;
26
+ now?: () => number;
27
+ }
28
+ export interface CachedBsddSource extends BsddSource {
29
+ /** True when the last request was answered from the cache because bSDD was unreachable. */
30
+ readonly offline: boolean;
31
+ }
32
+ /** A failure that says "bSDD is not reachable right now", as opposed to a definitive answer. */
33
+ export declare function isTransportFailure(err: unknown): boolean;
34
+ export declare function createCachedBsddSource(source: BsddSource, options: CachedBsddSourceOptions): CachedBsddSource;
35
+ /** A URI index holding every URI record in the store (e.g. the last session's URI health). */
36
+ export declare function loadUriIndex(store: BsddCacheStore): Promise<BsddUriIndex>;
37
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/bsdd/cache.ts"],"names":[],"mappings":"AAeA,OAAO,EAAuC,KAAK,UAAU,EAAsB,MAAM,YAAY,CAAC;AACtG,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAExE,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AAEnG,MAAM,WAAW,cAAc;IAC7B,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,aAAa,CAAC;IACpB,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,kDAAkD;AAClD,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,mCAAmC;IACnC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACzC;AAED,wBAAgB,qBAAqB,IAAI,cAAc,CAQtD;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,cAAc,CAAC;IACtB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,2FAA2F;IAC3F,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,gGAAgG;AAChG,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAGxD;AAoBD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,CA6D7G;AAED,8FAA8F;AAC9F,wBAAsB,YAAY,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAO/E"}
@@ -0,0 +1,116 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ /**
5
+ * Offline cache for bSDD (05-bsdd.md §4, IDS-074). `createCachedBsddSource`
6
+ * wraps any `BsddSource` with a read-through cache over a persistent
7
+ * `BsddCacheStore` (IndexedDB in the browser, `createIndexedDbBsddStore`;
8
+ * memory in tests and on the CLI): search results, class details,
9
+ * dictionaries and URI records. When bSDD cannot be reached, a cached entry
10
+ * is served even past its freshness, so known classes stay usable offline;
11
+ * an uncached request fails with `BsddUnavailableError`.
12
+ */
13
+ import { isRecord } from './contract.js';
14
+ import { BsddHttpError, BsddUnavailableError } from './types.js';
15
+ import { createBsddUriIndex } from './uri-health.js';
16
+ export const BSDD_CACHE_VERSION = 1;
17
+ export function createMemoryBsddStore() {
18
+ const map = new Map();
19
+ return {
20
+ get: async (key) => map.get(key),
21
+ put: async (key, entry) => void map.set(key, entry),
22
+ delete: async (key) => void map.delete(key),
23
+ keys: async (prefix) => [...map.keys()].filter((k) => k.startsWith(prefix)),
24
+ };
25
+ }
26
+ /** A failure that says "bSDD is not reachable right now", as opposed to a definitive answer. */
27
+ export function isTransportFailure(err) {
28
+ if (err instanceof BsddHttpError)
29
+ return err.status === 429 || err.status >= 500;
30
+ return err instanceof TypeError || (err instanceof Error && err.name === 'AbortError');
31
+ }
32
+ function isCacheEntry(v) {
33
+ return isRecord(v) && v.v === BSDD_CACHE_VERSION && typeof v.kind === 'string' && typeof v.storedAt === 'number' && 'value' in v;
34
+ }
35
+ function isUriRecord(v) {
36
+ return isRecord(v) && typeof v.uri === 'string' && typeof v.state === 'string' && typeof v.checkedAt === 'number';
37
+ }
38
+ /** Shape checks for what the cache gives back: an entry from an older build or a damaged store is a miss, not a crash. */
39
+ const VALID = {
40
+ dictionaries: (v) => Array.isArray(v) && v.every((d) => isRecord(d) && typeof d.uri === 'string'),
41
+ dictionary: (v) => v === null || (isRecord(v) && typeof v.uri === 'string' && typeof v.name === 'string'),
42
+ classes: (v) => Array.isArray(v) && v.every((c) => isRecord(c) && typeof c.uri === 'string' && typeof c.code === 'string'),
43
+ search: (v) => isRecord(v) && Array.isArray(v.classes) && typeof v.total === 'number',
44
+ class: (v) => v === null || (isRecord(v) && typeof v.uri === 'string' && Array.isArray(v.properties) && Array.isArray(v.relatedIfcEntityNames)),
45
+ uri: isUriRecord,
46
+ };
47
+ export function createCachedBsddSource(source, options) {
48
+ const { store } = options;
49
+ const ttl = options.ttlMs ?? 24 * 60 * 60 * 1000;
50
+ const now = options.now ?? Date.now;
51
+ let offline = false;
52
+ async function read(key, kind) {
53
+ try {
54
+ const hit = await store.get(key);
55
+ return isCacheEntry(hit) && hit.kind === kind && VALID[kind](hit.value) ? hit : undefined;
56
+ }
57
+ catch (err) {
58
+ // A broken store degrades to "not cached"; the network answer still flows.
59
+ console.warn('[bsdd-cache] read failed', key, err);
60
+ return undefined;
61
+ }
62
+ }
63
+ async function write(key, kind, value) {
64
+ try {
65
+ await store.put(key, { v: BSDD_CACHE_VERSION, kind, storedAt: now(), value });
66
+ }
67
+ catch (err) {
68
+ console.warn('[bsdd-cache] write failed', key, err);
69
+ }
70
+ }
71
+ /** Read through the cache. `T` is what `fetcher` returns; the cached copy passed the shape check of `kind`. */
72
+ async function through(kind, key, fetcher) {
73
+ const hit = await read(key, kind);
74
+ if (hit && now() - hit.storedAt < ttl) {
75
+ offline = false;
76
+ return hit.value;
77
+ }
78
+ try {
79
+ const value = await fetcher();
80
+ offline = false;
81
+ await write(key, kind, value);
82
+ return value;
83
+ }
84
+ catch (err) {
85
+ if (!isTransportFailure(err))
86
+ throw err;
87
+ if (hit) {
88
+ offline = true;
89
+ return hit.value;
90
+ }
91
+ throw new BsddUnavailableError(key, { cause: err });
92
+ }
93
+ }
94
+ return {
95
+ get offline() {
96
+ return offline;
97
+ },
98
+ listDictionaries: () => through('dictionaries', 'dictionaries', () => source.listDictionaries()),
99
+ getDictionary: (uri) => through('dictionary', `dictionary:${uri}`, () => source.getDictionary(uri)),
100
+ listClasses: (uri) => through('classes', `classes:${uri}`, () => source.listClasses(uri)),
101
+ searchClasses: (q) => through('search', `search:${JSON.stringify([q.text.trim().toLowerCase(), [...(q.dictionaryUris ?? [])].sort(), q.relatedIfcEntity ?? '', q.languageCode ?? '', q.offset ?? 0, q.limit ?? 50])}`, () => source.searchClasses(q)),
102
+ getClass: (uri, opts) => through('class', `class:${opts?.languageCode ?? ''}:${uri}`, () => source.getClass(uri, opts)),
103
+ resolveUri: (uri) => through('uri', `uri:${uri}`, () => source.resolveUri(uri)),
104
+ };
105
+ }
106
+ /** A URI index holding every URI record in the store (e.g. the last session's URI health). */
107
+ export async function loadUriIndex(store) {
108
+ const records = [];
109
+ for (const key of await store.keys('uri:')) {
110
+ const entry = await store.get(key);
111
+ if (isCacheEntry(entry) && isUriRecord(entry.value))
112
+ records.push(entry.value);
113
+ }
114
+ return createBsddUriIndex(records);
115
+ }
116
+ //# sourceMappingURL=cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/bsdd/cache.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAuC,MAAM,YAAY,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAqB,MAAM,iBAAiB,CAAC;AAExE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAsBpC,MAAM,UAAU,qBAAqB;IACnC,MAAM,GAAG,GAAG,IAAI,GAAG,EAA0B,CAAC;IAC9C,OAAO;QACL,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;QAChC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;QACnD,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC;QAC3C,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;KAC5E,CAAC;AACJ,CAAC;AAcD,gGAAgG;AAChG,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC7C,IAAI,GAAG,YAAY,aAAa;QAAE,OAAO,GAAG,CAAC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC;IACjF,OAAO,GAAG,YAAY,SAAS,IAAI,CAAC,GAAG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