@mailwoman/registry 10.8.0 → 11.0.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 (399) hide show
  1. package/README.md +93 -98
  2. package/data/manifests/artifacts.json +32 -0
  3. package/data/manifests/coverage.json +56 -0
  4. package/data/manifests/sources.lock.json +48 -0
  5. package/data/normalized/iata-airports.json +126749 -0
  6. package/data/normalized/iso3166-1.json +2035 -0
  7. package/definitions/namespaces.json +63 -0
  8. package/definitions/sections.json +73 -0
  9. package/docs/data-policy.md +81 -0
  10. package/docs/performance.md +146 -0
  11. package/docs/rgy1.md +144 -0
  12. package/lib/artifacts/country-airport-collision.ts +26 -0
  13. package/lib/artifacts/iata-airport/membership.ts +26 -0
  14. package/lib/artifacts/iata-airport/records.ts +26 -0
  15. package/lib/artifacts/iso3166-1/alpha2-membership.ts +26 -0
  16. package/lib/artifacts/iso3166-1/alpha3-membership.ts +26 -0
  17. package/lib/artifacts/iso3166-1/records.ts +26 -0
  18. package/lib/errors.ts +44 -0
  19. package/lib/iata/airports/records.ts +174 -0
  20. package/lib/iata/airports/validate.ts +49 -0
  21. package/lib/index.ts +25 -15
  22. package/lib/inspect.ts +56 -0
  23. package/lib/iso3166/alpha2.ts +48 -0
  24. package/lib/iso3166/alpha3.ts +51 -0
  25. package/lib/iso3166/records.ts +149 -0
  26. package/lib/iso3166/relations.ts +30 -0
  27. package/lib/key.ts +146 -0
  28. package/lib/normalize.ts +31 -0
  29. package/lib/overlap/country-airport.ts +108 -0
  30. package/lib/rgy1/base64.ts +24 -0
  31. package/lib/rgy1/reader.ts +316 -0
  32. package/lib/rgy1/sections.generated.ts +79 -0
  33. package/lib/rgy1/views.ts +267 -0
  34. package/lib/types.ts +88 -74
  35. package/lib/wasm.ts +285 -0
  36. package/out/artifacts/country-airport-collision.d.ts +15 -0
  37. package/out/artifacts/country-airport-collision.d.ts.map +1 -0
  38. package/out/artifacts/country-airport-collision.js +21 -0
  39. package/out/artifacts/country-airport-collision.js.map +1 -0
  40. package/out/artifacts/iata-airport/membership.d.ts +15 -0
  41. package/out/artifacts/iata-airport/membership.d.ts.map +1 -0
  42. package/out/artifacts/iata-airport/membership.js +21 -0
  43. package/out/artifacts/iata-airport/membership.js.map +1 -0
  44. package/out/artifacts/iata-airport/records.d.ts +15 -0
  45. package/out/artifacts/iata-airport/records.d.ts.map +1 -0
  46. package/out/artifacts/iata-airport/records.js +21 -0
  47. package/out/artifacts/iata-airport/records.js.map +1 -0
  48. package/out/artifacts/iso3166-1/alpha2-membership.d.ts +15 -0
  49. package/out/artifacts/iso3166-1/alpha2-membership.d.ts.map +1 -0
  50. package/out/artifacts/iso3166-1/alpha2-membership.js +21 -0
  51. package/out/artifacts/iso3166-1/alpha2-membership.js.map +1 -0
  52. package/out/artifacts/iso3166-1/alpha3-membership.d.ts +15 -0
  53. package/out/artifacts/iso3166-1/alpha3-membership.d.ts.map +1 -0
  54. package/out/artifacts/iso3166-1/alpha3-membership.js +21 -0
  55. package/out/artifacts/iso3166-1/alpha3-membership.js.map +1 -0
  56. package/out/artifacts/iso3166-1/records.d.ts +15 -0
  57. package/out/artifacts/iso3166-1/records.d.ts.map +1 -0
  58. package/out/artifacts/iso3166-1/records.js +21 -0
  59. package/out/artifacts/iso3166-1/records.js.map +1 -0
  60. package/out/errors.d.ts +38 -0
  61. package/out/errors.d.ts.map +1 -0
  62. package/out/errors.js +35 -0
  63. package/out/errors.js.map +1 -0
  64. package/out/iata/airports/records.d.ts +44 -0
  65. package/out/iata/airports/records.d.ts.map +1 -0
  66. package/out/iata/airports/records.js +137 -0
  67. package/out/iata/airports/records.js.map +1 -0
  68. package/out/iata/airports/validate.d.ts +27 -0
  69. package/out/iata/airports/validate.d.ts.map +1 -0
  70. package/out/iata/airports/validate.js +42 -0
  71. package/out/iata/airports/validate.js.map +1 -0
  72. package/out/index.d.ts +19 -15
  73. package/out/index.d.ts.map +1 -1
  74. package/out/index.js +14 -15
  75. package/out/index.js.map +1 -1
  76. package/out/inspect.d.ts +38 -0
  77. package/out/inspect.d.ts.map +1 -0
  78. package/out/inspect.js +33 -0
  79. package/out/inspect.js.map +1 -0
  80. package/out/iso3166/alpha2.d.ts +24 -0
  81. package/out/iso3166/alpha2.d.ts.map +1 -0
  82. package/out/iso3166/alpha2.js +41 -0
  83. package/out/iso3166/alpha2.js.map +1 -0
  84. package/out/iso3166/alpha3.d.ts +29 -0
  85. package/out/iso3166/alpha3.d.ts.map +1 -0
  86. package/out/iso3166/alpha3.js +44 -0
  87. package/out/iso3166/alpha3.js.map +1 -0
  88. package/out/iso3166/records.d.ts +38 -0
  89. package/out/iso3166/records.d.ts.map +1 -0
  90. package/out/iso3166/records.js +105 -0
  91. package/out/iso3166/records.js.map +1 -0
  92. package/out/iso3166/relations.d.ts +20 -0
  93. package/out/iso3166/relations.d.ts.map +1 -0
  94. package/out/iso3166/relations.js +27 -0
  95. package/out/iso3166/relations.js.map +1 -0
  96. package/out/key.d.ts +68 -0
  97. package/out/key.d.ts.map +1 -0
  98. package/out/key.js +122 -0
  99. package/out/key.js.map +1 -0
  100. package/out/normalize.d.ts +25 -0
  101. package/out/normalize.d.ts.map +1 -0
  102. package/out/normalize.js +21 -0
  103. package/out/normalize.js.map +1 -0
  104. package/out/overlap/country-airport.d.ts +57 -0
  105. package/out/overlap/country-airport.d.ts.map +1 -0
  106. package/out/overlap/country-airport.js +71 -0
  107. package/out/overlap/country-airport.js.map +1 -0
  108. package/out/rgy1/base64.d.ts +15 -0
  109. package/out/rgy1/base64.d.ts.map +1 -0
  110. package/out/rgy1/base64.js +22 -0
  111. package/out/rgy1/base64.js.map +1 -0
  112. package/out/rgy1/reader.d.ts +103 -0
  113. package/out/rgy1/reader.d.ts.map +1 -0
  114. package/out/rgy1/reader.js +230 -0
  115. package/out/rgy1/reader.js.map +1 -0
  116. package/out/rgy1/sections.generated.d.ts +54 -0
  117. package/out/rgy1/sections.generated.d.ts.map +1 -0
  118. package/out/rgy1/sections.generated.js +69 -0
  119. package/out/rgy1/sections.generated.js.map +1 -0
  120. package/out/rgy1/views.d.ts +96 -0
  121. package/out/rgy1/views.d.ts.map +1 -0
  122. package/out/rgy1/views.js +218 -0
  123. package/out/rgy1/views.js.map +1 -0
  124. package/out/sdk/fetch.d.ts +53 -0
  125. package/out/sdk/fetch.d.ts.map +1 -0
  126. package/out/sdk/fetch.js +107 -0
  127. package/out/sdk/fetch.js.map +1 -0
  128. package/out/sdk/fetch.run.d.ts +14 -0
  129. package/out/sdk/fetch.run.d.ts.map +1 -0
  130. package/out/sdk/fetch.run.js +20 -0
  131. package/out/sdk/fetch.run.js.map +1 -0
  132. package/out/sdk/sources.d.ts +111 -0
  133. package/out/sdk/sources.d.ts.map +1 -0
  134. package/out/sdk/sources.js +98 -0
  135. package/out/sdk/sources.js.map +1 -0
  136. package/out/tools/artifact-path.d.ts +10 -0
  137. package/out/tools/artifact-path.d.ts.map +1 -0
  138. package/out/tools/artifact-path.js +12 -0
  139. package/out/tools/artifact-path.js.map +1 -0
  140. package/out/tools/bench.run.d.ts +19 -0
  141. package/out/tools/bench.run.d.ts.map +1 -0
  142. package/out/tools/bench.run.js +204 -0
  143. package/out/tools/bench.run.js.map +1 -0
  144. package/out/tools/build-wasm.run.d.ts +18 -0
  145. package/out/tools/build-wasm.run.d.ts.map +1 -0
  146. package/out/tools/build-wasm.run.js +71 -0
  147. package/out/tools/build-wasm.run.js.map +1 -0
  148. package/out/tools/generate-sections.run.d.ts +13 -0
  149. package/out/tools/generate-sections.run.d.ts.map +1 -0
  150. package/out/tools/generate-sections.run.js +136 -0
  151. package/out/tools/generate-sections.run.js.map +1 -0
  152. package/out/tools/generate.run.d.ts +18 -0
  153. package/out/tools/generate.run.d.ts.map +1 -0
  154. package/out/tools/generate.run.js +118 -0
  155. package/out/tools/generate.run.js.map +1 -0
  156. package/out/tools/normalize.d.ts +155 -0
  157. package/out/tools/normalize.d.ts.map +1 -0
  158. package/out/tools/normalize.js +303 -0
  159. package/out/tools/normalize.js.map +1 -0
  160. package/out/tools/normalize.run.d.ts +14 -0
  161. package/out/tools/normalize.run.d.ts.map +1 -0
  162. package/out/tools/normalize.run.js +29 -0
  163. package/out/tools/normalize.run.js.map +1 -0
  164. package/out/types.d.ts +90 -76
  165. package/out/types.d.ts.map +1 -1
  166. package/out/types.js +20 -4
  167. package/out/types.js.map +1 -1
  168. package/out/wasm.d.ts +98 -0
  169. package/out/wasm.d.ts.map +1 -0
  170. package/out/wasm.js +137 -0
  171. package/out/wasm.js.map +1 -0
  172. package/package.json +48 -27
  173. package/sdk/fetch.run.ts +24 -0
  174. package/sdk/fetch.ts +146 -0
  175. package/sdk/sources.ts +162 -0
  176. package/tools/artifact-path.ts +12 -0
  177. package/tools/bench.run.ts +265 -0
  178. package/tools/build-wasm.run.ts +82 -0
  179. package/tools/generate-sections.run.ts +152 -0
  180. package/tools/generate.run.ts +146 -0
  181. package/tools/normalize.run.ts +36 -0
  182. package/tools/normalize.ts +474 -0
  183. package/wasm/registry-simd.wasm +0 -0
  184. package/wasm/registry.wasm +0 -0
  185. package/lib/address-key.ts +0 -46
  186. package/lib/geocode-handler.ts +0 -37
  187. package/lib/geojson.ts +0 -72
  188. package/lib/ingest.ts +0 -349
  189. package/lib/learned-scorer.ts +0 -134
  190. package/lib/map-html.ts +0 -287
  191. package/lib/models/crosssource-gbt-en-us.ts +0 -43
  192. package/lib/models/dedup-gbt-en-us.ts +0 -47
  193. package/lib/models/org-crosssource-gbt-en-us.ts +0 -43
  194. package/lib/reconcile.ts +0 -239
  195. package/lib/resolve.ts +0 -569
  196. package/out/address-key.d.ts +0 -34
  197. package/out/address-key.d.ts.map +0 -1
  198. package/out/address-key.js +0 -41
  199. package/out/address-key.js.map +0 -1
  200. package/out/geocode-handler.d.ts +0 -20
  201. package/out/geocode-handler.d.ts.map +0 -1
  202. package/out/geocode-handler.js +0 -29
  203. package/out/geocode-handler.js.map +0 -1
  204. package/out/geojson.d.ts +0 -28
  205. package/out/geojson.d.ts.map +0 -1
  206. package/out/geojson.js +0 -62
  207. package/out/geojson.js.map +0 -1
  208. package/out/ingest.d.ts +0 -173
  209. package/out/ingest.d.ts.map +0 -1
  210. package/out/ingest.js +0 -185
  211. package/out/ingest.js.map +0 -1
  212. package/out/learned-scorer.d.ts +0 -61
  213. package/out/learned-scorer.d.ts.map +0 -1
  214. package/out/learned-scorer.js +0 -91
  215. package/out/learned-scorer.js.map +0 -1
  216. package/out/map-html.d.ts +0 -39
  217. package/out/map-html.d.ts.map +0 -1
  218. package/out/map-html.js +0 -220
  219. package/out/map-html.js.map +0 -1
  220. package/out/models/crosssource-gbt-en-us.d.ts +0 -45
  221. package/out/models/crosssource-gbt-en-us.d.ts.map +0 -1
  222. package/out/models/crosssource-gbt-en-us.js +0 -40
  223. package/out/models/crosssource-gbt-en-us.js.map +0 -1
  224. package/out/models/dedup-gbt-en-us.d.ts +0 -44
  225. package/out/models/dedup-gbt-en-us.d.ts.map +0 -1
  226. package/out/models/dedup-gbt-en-us.js +0 -44
  227. package/out/models/dedup-gbt-en-us.js.map +0 -1
  228. package/out/models/org-crosssource-gbt-en-us.d.ts +0 -45
  229. package/out/models/org-crosssource-gbt-en-us.d.ts.map +0 -1
  230. package/out/models/org-crosssource-gbt-en-us.js +0 -40
  231. package/out/models/org-crosssource-gbt-en-us.js.map +0 -1
  232. package/out/reconcile.d.ts +0 -96
  233. package/out/reconcile.d.ts.map +0 -1
  234. package/out/reconcile.js +0 -127
  235. package/out/reconcile.js.map +0 -1
  236. package/out/resolve.d.ts +0 -264
  237. package/out/resolve.d.ts.map +0 -1
  238. package/out/resolve.js +0 -282
  239. package/out/resolve.js.map +0 -1
  240. package/out/tools/coverage-reconciliation.d.ts +0 -67
  241. package/out/tools/coverage-reconciliation.d.ts.map +0 -1
  242. package/out/tools/coverage-reconciliation.js +0 -113
  243. package/out/tools/coverage-reconciliation.js.map +0 -1
  244. package/out/tools/cross/dataset-correlation.d.ts +0 -61
  245. package/out/tools/cross/dataset-correlation.d.ts.map +0 -1
  246. package/out/tools/cross/dataset-correlation.js +0 -244
  247. package/out/tools/cross/dataset-correlation.js.map +0 -1
  248. package/out/tools/cross/source-threshold-sweep.d.ts +0 -60
  249. package/out/tools/cross/source-threshold-sweep.d.ts.map +0 -1
  250. package/out/tools/cross/source-threshold-sweep.js +0 -264
  251. package/out/tools/cross/source-threshold-sweep.js.map +0 -1
  252. package/out/tools/dedup-ceiling.d.ts +0 -62
  253. package/out/tools/dedup-ceiling.d.ts.map +0 -1
  254. package/out/tools/dedup-ceiling.js +0 -171
  255. package/out/tools/dedup-ceiling.js.map +0 -1
  256. package/out/tools/eval-geocoder.d.ts +0 -68
  257. package/out/tools/eval-geocoder.d.ts.map +0 -1
  258. package/out/tools/eval-geocoder.js +0 -13
  259. package/out/tools/eval-geocoder.js.map +0 -1
  260. package/out/tools/geocoder/namesake-probe.d.ts +0 -33
  261. package/out/tools/geocoder/namesake-probe.d.ts.map +0 -1
  262. package/out/tools/geocoder/namesake-probe.js +0 -60
  263. package/out/tools/geocoder/namesake-probe.js.map +0 -1
  264. package/out/tools/geocoder/vs-provided-coords.d.ts +0 -53
  265. package/out/tools/geocoder/vs-provided-coords.d.ts.map +0 -1
  266. package/out/tools/geocoder/vs-provided-coords.js +0 -161
  267. package/out/tools/geocoder/vs-provided-coords.js.map +0 -1
  268. package/out/tools/gold-set-sample.d.ts +0 -67
  269. package/out/tools/gold-set-sample.d.ts.map +0 -1
  270. package/out/tools/gold-set-sample.js +0 -81
  271. package/out/tools/gold-set-sample.js.map +0 -1
  272. package/out/tools/learned/scorer/clustering-eval.d.ts +0 -77
  273. package/out/tools/learned/scorer/clustering-eval.d.ts.map +0 -1
  274. package/out/tools/learned/scorer/clustering-eval.js +0 -207
  275. package/out/tools/learned/scorer/clustering-eval.js.map +0 -1
  276. package/out/tools/learned/scorer/crossstate-eval.d.ts +0 -65
  277. package/out/tools/learned/scorer/crossstate-eval.d.ts.map +0 -1
  278. package/out/tools/learned/scorer/crossstate-eval.js +0 -168
  279. package/out/tools/learned/scorer/crossstate-eval.js.map +0 -1
  280. package/out/tools/learned/scorer/eval.d.ts +0 -64
  281. package/out/tools/learned/scorer/eval.d.ts.map +0 -1
  282. package/out/tools/learned/scorer/eval.js +0 -275
  283. package/out/tools/learned/scorer/eval.js.map +0 -1
  284. package/out/tools/matcher-scale.d.ts +0 -40
  285. package/out/tools/matcher-scale.d.ts.map +0 -1
  286. package/out/tools/matcher-scale.js +0 -111
  287. package/out/tools/matcher-scale.js.map +0 -1
  288. package/out/tools/nppes/dedup-benchmark.d.ts +0 -82
  289. package/out/tools/nppes/dedup-benchmark.d.ts.map +0 -1
  290. package/out/tools/nppes/dedup-benchmark.js +0 -226
  291. package/out/tools/nppes/dedup-benchmark.js.map +0 -1
  292. package/out/tools/nppes/org-name.d.ts +0 -15
  293. package/out/tools/nppes/org-name.d.ts.map +0 -1
  294. package/out/tools/nppes/org-name.js +0 -6
  295. package/out/tools/nppes/org-name.js.map +0 -1
  296. package/out/tools/nppes/overmerge-packet.d.ts +0 -43
  297. package/out/tools/nppes/overmerge-packet.d.ts.map +0 -1
  298. package/out/tools/nppes/overmerge-packet.js +0 -54
  299. package/out/tools/nppes/overmerge-packet.js.map +0 -1
  300. package/out/tools/nppes/report.d.ts +0 -97
  301. package/out/tools/nppes/report.d.ts.map +0 -1
  302. package/out/tools/nppes/report.js +0 -178
  303. package/out/tools/nppes/report.js.map +0 -1
  304. package/out/tools/nppes/sample.d.ts +0 -101
  305. package/out/tools/nppes/sample.d.ts.map +0 -1
  306. package/out/tools/nppes/sample.js +0 -127
  307. package/out/tools/nppes/sample.js.map +0 -1
  308. package/out/tools/nppes/scoring.d.ts +0 -37
  309. package/out/tools/nppes/scoring.d.ts.map +0 -1
  310. package/out/tools/nppes/scoring.js +0 -81
  311. package/out/tools/nppes/scoring.js.map +0 -1
  312. package/out/tools/nppes/settings.d.ts +0 -41
  313. package/out/tools/nppes/settings.d.ts.map +0 -1
  314. package/out/tools/nppes/settings.js +0 -79
  315. package/out/tools/nppes/settings.js.map +0 -1
  316. package/out/tools/nppes/truth-grains.d.ts +0 -63
  317. package/out/tools/nppes/truth-grains.d.ts.map +0 -1
  318. package/out/tools/nppes/truth-grains.js +0 -142
  319. package/out/tools/nppes/truth-grains.js.map +0 -1
  320. package/out/tools/shared.d.ts +0 -325
  321. package/out/tools/shared.d.ts.map +0 -1
  322. package/out/tools/shared.js +0 -453
  323. package/out/tools/shared.js.map +0 -1
  324. package/out/tools/train/cross-gbt.d.ts +0 -89
  325. package/out/tools/train/cross-gbt.d.ts.map +0 -1
  326. package/out/tools/train/cross-gbt.js +0 -132
  327. package/out/tools/train/cross-gbt.js.map +0 -1
  328. package/out/tools/train/gbt.d.ts +0 -85
  329. package/out/tools/train/gbt.d.ts.map +0 -1
  330. package/out/tools/train/gbt.js +0 -155
  331. package/out/tools/train/gbt.js.map +0 -1
  332. package/out/tools/train/org-cross-gbt.d.ts +0 -85
  333. package/out/tools/train/org-cross-gbt.d.ts.map +0 -1
  334. package/out/tools/train/org-cross-gbt.js +0 -122
  335. package/out/tools/train/org-cross-gbt.js.map +0 -1
  336. package/out/tools/txhhsc-to-oarow.d.ts +0 -42
  337. package/out/tools/txhhsc-to-oarow.d.ts.map +0 -1
  338. package/out/tools/txhhsc-to-oarow.js +0 -78
  339. package/out/tools/txhhsc-to-oarow.js.map +0 -1
  340. package/out/tools/viz/browser.d.ts +0 -31
  341. package/out/tools/viz/browser.d.ts.map +0 -1
  342. package/out/tools/viz/browser.js +0 -26
  343. package/out/tools/viz/browser.js.map +0 -1
  344. package/out/tools/viz/cross-dataset-map.d.ts +0 -39
  345. package/out/tools/viz/cross-dataset-map.d.ts.map +0 -1
  346. package/out/tools/viz/cross-dataset-map.js +0 -84
  347. package/out/tools/viz/cross-dataset-map.js.map +0 -1
  348. package/out/tools/viz/geocode-first-surface.d.ts +0 -36
  349. package/out/tools/viz/geocode-first-surface.d.ts.map +0 -1
  350. package/out/tools/viz/geocode-first-surface.js +0 -234
  351. package/out/tools/viz/geocode-first-surface.js.map +0 -1
  352. package/out/tools/viz/render/map.d.ts +0 -42
  353. package/out/tools/viz/render/map.d.ts.map +0 -1
  354. package/out/tools/viz/render/map.js +0 -40
  355. package/out/tools/viz/render/map.js.map +0 -1
  356. package/out/tools/viz/render.d.ts +0 -46
  357. package/out/tools/viz/render.d.ts.map +0 -1
  358. package/out/tools/viz/render.js +0 -49
  359. package/out/tools/viz/render.js.map +0 -1
  360. package/out/tools/viz/source-provenance-map.d.ts +0 -57
  361. package/out/tools/viz/source-provenance-map.d.ts.map +0 -1
  362. package/out/tools/viz/source-provenance-map.js +0 -82
  363. package/out/tools/viz/source-provenance-map.js.map +0 -1
  364. package/out/tools/viz/yardstick-figure.d.ts +0 -22
  365. package/out/tools/viz/yardstick-figure.d.ts.map +0 -1
  366. package/out/tools/viz/yardstick-figure.js +0 -106
  367. package/out/tools/viz/yardstick-figure.js.map +0 -1
  368. package/tools/coverage-reconciliation.ts +0 -192
  369. package/tools/cross/dataset-correlation.ts +0 -380
  370. package/tools/cross/source-threshold-sweep.ts +0 -416
  371. package/tools/dedup-ceiling.ts +0 -225
  372. package/tools/eval-geocoder.ts +0 -77
  373. package/tools/geocoder/namesake-probe.ts +0 -91
  374. package/tools/geocoder/vs-provided-coords.ts +0 -232
  375. package/tools/gold-set-sample.ts +0 -147
  376. package/tools/learned/scorer/clustering-eval.ts +0 -349
  377. package/tools/learned/scorer/crossstate-eval.ts +0 -280
  378. package/tools/learned/scorer/eval.ts +0 -429
  379. package/tools/matcher-scale.ts +0 -185
  380. package/tools/nppes/dedup-benchmark.ts +0 -364
  381. package/tools/nppes/org-name.ts +0 -15
  382. package/tools/nppes/overmerge-packet.ts +0 -98
  383. package/tools/nppes/report.ts +0 -380
  384. package/tools/nppes/sample.ts +0 -250
  385. package/tools/nppes/scoring.ts +0 -115
  386. package/tools/nppes/settings.ts +0 -102
  387. package/tools/nppes/truth-grains.ts +0 -185
  388. package/tools/shared.ts +0 -743
  389. package/tools/train/cross-gbt.ts +0 -214
  390. package/tools/train/gbt.ts +0 -261
  391. package/tools/train/org-cross-gbt.ts +0 -189
  392. package/tools/txhhsc-to-oarow.ts +0 -118
  393. package/tools/viz/browser.ts +0 -41
  394. package/tools/viz/cross-dataset-map.ts +0 -133
  395. package/tools/viz/geocode-first-surface.ts +0 -305
  396. package/tools/viz/render/map.ts +0 -61
  397. package/tools/viz/render.ts +0 -103
  398. package/tools/viz/source-provenance-map.ts +0 -154
  399. package/tools/viz/yardstick-figure.ts +0 -197
package/out/key.d.ts ADDED
@@ -0,0 +1,68 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Key encodings: the position of a code in its direct-address key space, mirroring `crates/registry-core/src/key.rs`.
7
+ *
8
+ * Two or three upper-case ASCII letters encode base-26 with the first letter in the highest place. A three-digit
9
+ * numeric code encodes as its decimal value. Every encoder checks length and alphabet first and answers `-1` for
10
+ * anything else. A caller normalizes case or whitespace before calling, never here.
11
+ */
12
+ /**
13
+ * The number of two-letter keys, 26².
14
+ */
15
+ export declare const KEY_SPACE_2 = 676;
16
+ /**
17
+ * The number of three-letter keys, 26³.
18
+ */
19
+ export declare const KEY_SPACE_3 = 17576;
20
+ /**
21
+ * The number of three-digit numeric keys.
22
+ */
23
+ export declare const KEY_SPACE_NUMERIC = 1000;
24
+ /**
25
+ * The arity value a section's `aux` field holds for a numeric key space.
26
+ */
27
+ export declare const ARITY_NUMERIC = 0;
28
+ /**
29
+ * The value an encoder answers for a code outside its grammar.
30
+ */
31
+ export declare const NO_KEY = -1;
32
+ /**
33
+ * The length of a two-letter code.
34
+ */
35
+ export declare const CODE_LENGTH_2 = 2;
36
+ /**
37
+ * The length of a three-letter or three-digit code.
38
+ */
39
+ export declare const CODE_LENGTH_3 = 3;
40
+ /**
41
+ * Encodes two upper-case ASCII letters, or answers {@link NO_KEY}.
42
+ */
43
+ export declare function encode2(code: string): number;
44
+ /**
45
+ * Encodes three upper-case ASCII letters, or answers {@link NO_KEY}.
46
+ */
47
+ export declare function encode3(code: string): number;
48
+ /**
49
+ * Encodes three ASCII digits, keeping a leading zero's position, or answers {@link NO_KEY}.
50
+ */
51
+ export declare function encodeNumeric(code: string): number;
52
+ /**
53
+ * Encodes a code for the arity a section declares.
54
+ */
55
+ export declare function encodeForArity(arity: number, code: string): number;
56
+ /**
57
+ * The three letters of a three-letter key.
58
+ */
59
+ export declare function decode3(key: number): string;
60
+ /**
61
+ * The two letters of a two-letter key.
62
+ */
63
+ export declare function decode2(key: number): string;
64
+ /**
65
+ * The three digits of a numeric key, with its leading zeroes.
66
+ */
67
+ export declare function decodeNumeric(key: number): string;
68
+ //# sourceMappingURL=key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../lib/key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW,MAAM,CAAA;AAE9B;;GAEG;AACH,eAAO,MAAM,WAAW,QAAS,CAAA;AAEjC;;GAEG;AACH,eAAO,MAAM,iBAAiB,OAAO,CAAA;AAErC;;GAEG;AACH,eAAO,MAAM,aAAa,IAAI,CAAA;AAE9B;;GAEG;AACH,eAAO,MAAM,MAAM,KAAK,CAAA;AAExB;;GAEG;AACH,eAAO,MAAM,aAAa,IAAI,CAAA;AAE9B;;GAEG;AACH,eAAO,MAAM,aAAa,IAAI,CAAA;AAa9B;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAS5C;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAU5C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAclD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAWlE;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAM3C;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjD"}
package/out/key.js ADDED
@@ -0,0 +1,122 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Key encodings: the position of a code in its direct-address key space, mirroring `crates/registry-core/src/key.rs`.
7
+ *
8
+ * Two or three upper-case ASCII letters encode base-26 with the first letter in the highest place. A three-digit
9
+ * numeric code encodes as its decimal value. Every encoder checks length and alphabet first and answers `-1` for
10
+ * anything else. A caller normalizes case or whitespace before calling, never here.
11
+ */
12
+ /**
13
+ * The number of two-letter keys, 26².
14
+ */
15
+ export const KEY_SPACE_2 = 676;
16
+ /**
17
+ * The number of three-letter keys, 26³.
18
+ */
19
+ export const KEY_SPACE_3 = 17_576;
20
+ /**
21
+ * The number of three-digit numeric keys.
22
+ */
23
+ export const KEY_SPACE_NUMERIC = 1000;
24
+ /**
25
+ * The arity value a section's `aux` field holds for a numeric key space.
26
+ */
27
+ export const ARITY_NUMERIC = 0;
28
+ /**
29
+ * The value an encoder answers for a code outside its grammar.
30
+ */
31
+ export const NO_KEY = -1;
32
+ /**
33
+ * The length of a two-letter code.
34
+ */
35
+ export const CODE_LENGTH_2 = 2;
36
+ /**
37
+ * The length of a three-letter or three-digit code.
38
+ */
39
+ export const CODE_LENGTH_3 = 3;
40
+ const LETTERS = 26;
41
+ const A = 65;
42
+ const Z = 90;
43
+ const ZERO = 48;
44
+ const NINE = 57;
45
+ const DECIMAL = 10;
46
+ function isUpperLetter(charCode) {
47
+ return charCode >= A && charCode <= Z;
48
+ }
49
+ /**
50
+ * Encodes two upper-case ASCII letters, or answers {@link NO_KEY}.
51
+ */
52
+ export function encode2(code) {
53
+ if (code.length !== CODE_LENGTH_2)
54
+ return NO_KEY;
55
+ const a = code.charCodeAt(0);
56
+ const b = code.charCodeAt(1);
57
+ if (!isUpperLetter(a) || !isUpperLetter(b))
58
+ return NO_KEY;
59
+ return (a - A) * LETTERS + (b - A);
60
+ }
61
+ /**
62
+ * Encodes three upper-case ASCII letters, or answers {@link NO_KEY}.
63
+ */
64
+ export function encode3(code) {
65
+ if (code.length !== CODE_LENGTH_3)
66
+ return NO_KEY;
67
+ const a = code.charCodeAt(0);
68
+ const b = code.charCodeAt(1);
69
+ const c = code.charCodeAt(2);
70
+ if (!isUpperLetter(a) || !isUpperLetter(b) || !isUpperLetter(c))
71
+ return NO_KEY;
72
+ return ((a - A) * LETTERS + (b - A)) * LETTERS + (c - A);
73
+ }
74
+ /**
75
+ * Encodes three ASCII digits, keeping a leading zero's position, or answers {@link NO_KEY}.
76
+ */
77
+ export function encodeNumeric(code) {
78
+ if (code.length !== CODE_LENGTH_3)
79
+ return NO_KEY;
80
+ let value = 0;
81
+ for (let index = 0; index < CODE_LENGTH_3; index++) {
82
+ const digit = code.charCodeAt(index);
83
+ if (digit < ZERO || digit > NINE)
84
+ return NO_KEY;
85
+ value = value * DECIMAL + (digit - ZERO);
86
+ }
87
+ return value;
88
+ }
89
+ /**
90
+ * Encodes a code for the arity a section declares.
91
+ */
92
+ export function encodeForArity(arity, code) {
93
+ switch (arity) {
94
+ case ARITY_NUMERIC:
95
+ return encodeNumeric(code);
96
+ case CODE_LENGTH_2:
97
+ return encode2(code);
98
+ case CODE_LENGTH_3:
99
+ return encode3(code);
100
+ default:
101
+ return NO_KEY;
102
+ }
103
+ }
104
+ /**
105
+ * The three letters of a three-letter key.
106
+ */
107
+ export function decode3(key) {
108
+ return String.fromCharCode(A + Math.floor(key / KEY_SPACE_2), A + (Math.floor(key / LETTERS) % LETTERS), A + (key % LETTERS));
109
+ }
110
+ /**
111
+ * The two letters of a two-letter key.
112
+ */
113
+ export function decode2(key) {
114
+ return String.fromCharCode(A + Math.floor(key / LETTERS), A + (key % LETTERS));
115
+ }
116
+ /**
117
+ * The three digits of a numeric key, with its leading zeroes.
118
+ */
119
+ export function decodeNumeric(key) {
120
+ return String(key).padStart(CODE_LENGTH_3, "0");
121
+ }
122
+ //# sourceMappingURL=key.js.map
package/out/key.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key.js","sourceRoot":"","sources":["../lib/key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;AAE9B;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAA;AAEjC;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAA;AAErC;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAA;AAE9B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,CAAA;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAA;AAE9B;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAA;AAE9B,MAAM,OAAO,GAAG,EAAE,CAAA;AAClB,MAAM,CAAC,GAAG,EAAE,CAAA;AACZ,MAAM,CAAC,GAAG,EAAE,CAAA;AACZ,MAAM,IAAI,GAAG,EAAE,CAAA;AACf,MAAM,IAAI,GAAG,EAAE,CAAA;AACf,MAAM,OAAO,GAAG,EAAE,CAAA;AAElB,SAAS,aAAa,CAAC,QAAgB;IACtC,OAAO,QAAQ,IAAI,CAAC,IAAI,QAAQ,IAAI,CAAC,CAAA;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,IAAY;IACnC,IAAI,IAAI,CAAC,MAAM,KAAK,aAAa;QAAE,OAAO,MAAM,CAAA;IAEhD,MAAM,CAAC,GAAG,IAAI,CAAC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2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Explicit input normalization, separate from the strict predicates.
7
+ *
8
+ * `canonicalSpelling` trims ASCII whitespace and upper-cases ASCII letters. It reports each change. A caller who
9
+ * wants `" aus "` to reach `AUS` asks for that step. Every other character stays as written. A dot, a dash or a
10
+ * non-ASCII letter reaches the strict predicate unchanged and is refused there with `shape`. Free-text tokenization
11
+ * belongs to Mailwoman, outside this package.
12
+ */
13
+ /**
14
+ * What {@link canonicalSpelling} changed.
15
+ */
16
+ export interface Normalization {
17
+ value: string;
18
+ trimmed: boolean;
19
+ uppercased: boolean;
20
+ }
21
+ /**
22
+ * Trims ASCII whitespace and upper-cases ASCII letters, reporting each change.
23
+ */
24
+ export declare function canonicalSpelling(input: string): Normalization;
25
+ //# sourceMappingURL=normalize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../lib/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,OAAO,CAAA;CACnB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAK9D"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Explicit input normalization, separate from the strict predicates.
7
+ *
8
+ * `canonicalSpelling` trims ASCII whitespace and upper-cases ASCII letters. It reports each change. A caller who
9
+ * wants `" aus "` to reach `AUS` asks for that step. Every other character stays as written. A dot, a dash or a
10
+ * non-ASCII letter reaches the strict predicate unchanged and is refused there with `shape`. Free-text tokenization
11
+ * belongs to Mailwoman, outside this package.
12
+ */
13
+ /**
14
+ * Trims ASCII whitespace and upper-cases ASCII letters, reporting each change.
15
+ */
16
+ export function canonicalSpelling(input) {
17
+ const trimmedValue = input.replaceAll(/^[ \t\r\n]+|[ \t\r\n]+$/g, "");
18
+ const value = trimmedValue.replaceAll(/[a-z]+/g, (run) => run.toUpperCase());
19
+ return { value, trimmed: trimmedValue !== input, uppercased: value !== trimmedValue };
20
+ }
21
+ //# sourceMappingURL=normalize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize.js","sourceRoot":"","sources":["../lib/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC9C,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAAC,0BAA0B,EAAE,EAAE,CAAC,CAAA;IACrE,MAAM,KAAK,GAAG,YAAY,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAA;IAE5E,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,KAAK,KAAK,EAAE,UAAU,EAAE,KAAK,KAAK,YAAY,EAAE,CAAA;AACtF,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * The country/airport collision index: codes that are both an officially assigned ISO 3166-1 alpha-3 code and an
7
+ * IATA airport code in the profile.
8
+ *
9
+ * `isCountryAirportCollision` reads only the 2,197-byte collision bitset. `interpretCountryOrAirportCode` reads the
10
+ * records artifacts and answers every interpretation as a discriminated union, each branch with its own brand and
11
+ * entity, so `AUS` is Australia under one namespace and an airport in the United States under another. The two
12
+ * relations are separate: `same-spelling-as` is the collision, `located-in` is each branch's `country`. The caller
13
+ * ranks the interpretations, and the resolver in Mailwoman does it.
14
+ */
15
+ import { BitsetView } from "#rgy1/views";
16
+ import { type AirportCountryStatus, type IATA, type ISO } from "#types";
17
+ /**
18
+ * Returns the collision bitset, parsing the artifact on first use.
19
+ */
20
+ export declare function collisionMembership(): BitsetView;
21
+ /**
22
+ * Whether a three-letter code in its canonical spelling is both a current country code and an airport code.
23
+ */
24
+ export declare function isCountryAirportCollision(input: string): boolean;
25
+ /**
26
+ * One interpretation of a three-letter spelling.
27
+ */
28
+ export type CodeMatch = {
29
+ system: "iso3166-1-alpha3";
30
+ code: ISO.CountryCode_3166_1_Alpha3;
31
+ /**
32
+ * The alpha-2 code of the same entity.
33
+ */
34
+ country: string;
35
+ entityID: string;
36
+ name: string;
37
+ } | {
38
+ system: "iata-location";
39
+ code: IATA.AirportCode;
40
+ kind: "airport";
41
+ /**
42
+ * The alpha-2 code the source places the airport in, or null for an extension or an unstated country.
43
+ */
44
+ country: string | null;
45
+ countryStatus: AirportCountryStatus;
46
+ entityID: string;
47
+ name: string;
48
+ };
49
+ /**
50
+ * Every namespace that holds the spelling, in namespace order: country first, then airport.
51
+ *
52
+ * The order is the namespace list's and is not a ranking.
53
+ * An empty array is `not-found-in-snapshot` in every namespace, and a former country code
54
+ * is not an interpretation here because the current-assignment brand leaves it out.
55
+ */
56
+ export declare function interpretCountryOrAirportCode(input: string): CodeMatch[];
57
+ //# sourceMappingURL=country-airport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"country-airport.d.ts","sourceRoot":"","sources":["../../lib/overlap/country-airport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,KAAK,oBAAoB,EAAiB,KAAK,IAAI,EAAE,KAAK,GAAG,EAAE,MAAM,QAAQ,CAAA;AAItF;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,UAAU,CAIhD;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAClB;IACA,MAAM,EAAE,kBAAkB,CAAA;IAC1B,IAAI,EAAE,GAAG,CAAC,yBAAyB,CAAA;IACnC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;CACX,GACD;IACA,MAAM,EAAE,eAAe,CAAA;IACvB,IAAI,EAAE,IAAI,CAAC,WAAW,CAAA;IACtB,IAAI,EAAE,SAAS,CAAA;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,aAAa,EAAE,oBAAoB,CAAA;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;CACX,CAAA;AAEJ;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,CAgCxE"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * The country/airport collision index: codes that are both an officially assigned ISO 3166-1 alpha-3 code and an
7
+ * IATA airport code in the profile.
8
+ *
9
+ * `isCountryAirportCollision` reads only the 2,197-byte collision bitset. `interpretCountryOrAirportCode` reads the
10
+ * records artifacts and answers every interpretation as a discriminated union, each branch with its own brand and
11
+ * entity, so `AUS` is Australia under one namespace and an airport in the United States under another. The two
12
+ * relations are separate: `same-spelling-as` is the collision, `located-in` is each branch's `country`. The caller
13
+ * ranks the interpretations, and the resolver in Mailwoman does it.
14
+ */
15
+ import { countryAirportCollisionArtifact } from "#artifacts/country-airport-collision";
16
+ import { airportRowByIATA, getAirportByIATA } from "#iata/airports/records";
17
+ import { getCountryByAlpha3 } from "#iso3166/records";
18
+ import { encode3 } from "#key";
19
+ import { Artifact } from "#rgy1/reader";
20
+ import { BitsetView } from "#rgy1/views";
21
+ import { CountryStatus } from "#types";
22
+ let bitset = null;
23
+ /**
24
+ * Returns the collision bitset, parsing the artifact on first use.
25
+ */
26
+ export function collisionMembership() {
27
+ bitset ??= BitsetView.of(Artifact.parse(countryAirportCollisionArtifact()));
28
+ return bitset;
29
+ }
30
+ /**
31
+ * Whether a three-letter code in its canonical spelling is both a current country code and an airport code.
32
+ */
33
+ export function isCountryAirportCollision(input) {
34
+ return collisionMembership().test(encode3(input));
35
+ }
36
+ /**
37
+ * Every namespace that holds the spelling, in namespace order: country first, then airport.
38
+ *
39
+ * The order is the namespace list's and is not a ranking.
40
+ * An empty array is `not-found-in-snapshot` in every namespace, and a former country code
41
+ * is not an interpretation here because the current-assignment brand leaves it out.
42
+ */
43
+ export function interpretCountryOrAirportCode(input) {
44
+ const matches = [];
45
+ if (encode3(input) < 0)
46
+ return matches;
47
+ const country = getCountryByAlpha3(input);
48
+ if (country && country.status === CountryStatus.OfficiallyAssigned) {
49
+ matches.push({
50
+ system: "iso3166-1-alpha3",
51
+ code: input,
52
+ country: country.alpha2,
53
+ entityID: country.entityID,
54
+ name: country.name,
55
+ });
56
+ }
57
+ if (airportRowByIATA(input) >= 0) {
58
+ const airport = getAirportByIATA(input);
59
+ matches.push({
60
+ system: "iata-location",
61
+ code: airport.iata,
62
+ kind: "airport",
63
+ country: airport.countryStatus === "iso3166-1" ? airport.country : null,
64
+ countryStatus: airport.countryStatus,
65
+ entityID: airport.entityID,
66
+ name: airport.name,
67
+ });
68
+ }
69
+ return matches;
70
+ }
71
+ //# sourceMappingURL=country-airport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"country-airport.js","sourceRoot":"","sources":["../../lib/overlap/country-airport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAA;AACtF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;A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O,CAAC,IAAI;YAClB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,OAAO,CAAC,aAAa,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;YACvE,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;SAClB,CAAC,CAAA;IACH,CAAC;IAED,OAAO,OAAO,CAAA;AACf,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Decodes a generated artifact module's base64 text into bytes, on the platforms the readers run on.
7
+ */
8
+ /**
9
+ * Decodes standard base64 into a fresh `Uint8Array`.
10
+ *
11
+ * `atob` is a global in Node 16 and later and in every browser, so the decoder
12
+ * needs no `Buffer` and no `node:` import.
13
+ */
14
+ export declare function decodeBase64(text: string): Uint8Array;
15
+ //# sourceMappingURL=base64.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../lib/rgy1/base64.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CASrD"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Decodes a generated artifact module's base64 text into bytes, on the platforms the readers run on.
7
+ */
8
+ /**
9
+ * Decodes standard base64 into a fresh `Uint8Array`.
10
+ *
11
+ * `atob` is a global in Node 16 and later and in every browser, so the decoder
12
+ * needs no `Buffer` and no `node:` import.
13
+ */
14
+ export function decodeBase64(text) {
15
+ const binary = atob(text);
16
+ const bytes = new Uint8Array(binary.length);
17
+ for (let index = 0; index < binary.length; index++) {
18
+ bytes[index] = binary.charCodeAt(index);
19
+ }
20
+ return bytes;
21
+ }
22
+ //# sourceMappingURL=base64.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64.js","sourceRoot":"","sources":["../../lib/rgy1/base64.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACxC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAA;IACzB,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAE3C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QACpD,KAAK,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;IACxC,CAAC;IAED,OAAO,KAAK,CAAA;AACb,CAAC"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * The synchronous RGY1 reader: validate an artifact once, then probe its tables in place.
7
+ *
8
+ * The reader mirrors `crates/registry-core/src/artifact.rs` and follows `docs/rgy1.md`. It reads through a
9
+ * `DataView` over the caller's bytes, honoring `byteOffset`, so an artifact handed over as a subarray behaves as the
10
+ * same bytes would in their own buffer. No `Map` is rebuilt: a probe is an arithmetic index into the section's payload.
11
+ */
12
+ /**
13
+ * Why bytes are not an RGY1 artifact this reader accepts.
14
+ */
15
+ export declare class RGY1Error extends Error {
16
+ readonly code: string;
17
+ constructor(code: string, message: string);
18
+ }
19
+ /**
20
+ * One directory entry with its payload view.
21
+ */
22
+ export interface Section {
23
+ kind: number;
24
+ encoding: number;
25
+ elementWidth: number;
26
+ flags: number;
27
+ offset: number;
28
+ length: number;
29
+ count: number;
30
+ aux: number;
31
+ payload: Uint8Array;
32
+ view: DataView;
33
+ }
34
+ /**
35
+ * The header fields every artifact holds.
36
+ * A records artifact adds `columns`, `rows` and `relations`.
37
+ */
38
+ export interface ArtifactHeader {
39
+ artifact: string;
40
+ profile: string;
41
+ namespaces: string[];
42
+ sources: Array<{
43
+ id: string;
44
+ sha256: string;
45
+ publication: string;
46
+ }>;
47
+ coverage: Record<string, number>;
48
+ schemaVersion: number;
49
+ normalizationVersion: number;
50
+ envelopeVersion: number;
51
+ encodings: Record<string, number>;
52
+ generator: string;
53
+ status?: string;
54
+ kinds?: string[];
55
+ meaning?: string;
56
+ rows?: number;
57
+ columns?: Array<{
58
+ name: string;
59
+ type: string;
60
+ width: number;
61
+ values?: string[];
62
+ absent?: number;
63
+ }>;
64
+ relations?: Array<{
65
+ name: string;
66
+ source: string;
67
+ targets: string;
68
+ }>;
69
+ }
70
+ /**
71
+ * Rounds up to the section alignment.
72
+ */
73
+ export declare function align(value: number): number;
74
+ /**
75
+ * A validated artifact over the caller's bytes.
76
+ */
77
+ export declare class Artifact {
78
+ readonly bytes: Uint8Array;
79
+ readonly header: ArtifactHeader;
80
+ readonly sections: readonly Section[];
81
+ private constructor();
82
+ /**
83
+ * Parses and validates the envelope, directory and every section's framing.
84
+ */
85
+ static parse(bytes: Uint8Array): Artifact;
86
+ /**
87
+ * The first section of a kind with the given `aux`, or `null`.
88
+ */
89
+ section(kind: number, aux: number): Section | null;
90
+ /**
91
+ * The first section of a kind, whatever its `aux`, or `null`.
92
+ */
93
+ firstSection(kind: number): Section | null;
94
+ /**
95
+ * The section a lookup needs, or an error naming it.
96
+ */
97
+ require(kind: number, aux?: number): Section;
98
+ }
99
+ /**
100
+ * Reads the unsigned element at `index` of a section of width 1, 2 or 4.
101
+ */
102
+ export declare function element(section: Section, index: number): number;
103
+ //# sourceMappingURL=reader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../lib/rgy1/reader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAaH;;GAEG;AACH,qBAA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