@mailwoman/core 9.0.0 → 9.2.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 (380) hide show
  1. package/README.md +1 -1
  2. package/api/responses.ts +12 -0
  3. package/coarse-placer/featurize.ts +0 -2
  4. package/coarse-placer/tools/build-dataset.ts +2 -2
  5. package/coarse-placer/tools/build-outlier-exposure.ts +2 -2
  6. package/coarse-placer/tools/build-outlier-latin.ts +14 -8
  7. package/coarse-placer/tools/build-outlier-oa.ts +12 -6
  8. package/coarse-placer/tools/eval-latin-offmap.ts +3 -4
  9. package/coarse-placer/tools/eval-openset.ts +3 -3
  10. package/coarse-placer/tools/eval-quant-compare.ts +3 -3
  11. package/coarse-placer/tools/eval.ts +3 -3
  12. package/coarse-placer/tools/fnv-hash.ts +1 -6
  13. package/coarse-placer/tools/index.ts +1 -1
  14. package/coarse-placer/tools/probe-frontier.ts +3 -4
  15. package/coarse-placer/tools/quantize.ts +3 -2
  16. package/coarse-placer/tools/train.ts +2 -2
  17. package/crypto/node.ts +3 -1
  18. package/data/internal/dictionaries/languages.csv +184 -184
  19. package/data/libpostal/README.md +8 -2
  20. package/db/schema.ts +12 -3
  21. package/decoder/build-tree.ts +19 -0
  22. package/decoder/containment.ts +5 -1
  23. package/decoder/index.ts +1 -0
  24. package/decoder/parse-diff.ts +347 -0
  25. package/decoder/proposals-to-tree.ts +1 -1
  26. package/decoder/serialize-json.ts +51 -7
  27. package/decoder/serialize-tuples.ts +7 -1
  28. package/decoder/serialize-xml.ts +1 -1
  29. package/decoder/tree-shape.ts +144 -0
  30. package/decoder/types.ts +8 -0
  31. package/decoder/validate-tree.ts +15 -3
  32. package/env/index.ts +3 -1
  33. package/env/paths.ts +21 -33
  34. package/env/schema.ts +35 -3
  35. package/fs/utils/formatters.ts +107 -0
  36. package/fs/utils/index.ts +7 -0
  37. package/fs/zip.ts +297 -0
  38. package/layers/manifest.ts +56 -15
  39. package/layers/schema.ts +54 -2
  40. package/locale/locale.ts +1 -1
  41. package/locale/registry.ts +1 -1
  42. package/objects.ts +20 -8
  43. package/out/api/responses.d.ts +9 -0
  44. package/out/api/responses.d.ts.map +1 -1
  45. package/out/api/responses.js +11 -0
  46. package/out/api/responses.js.map +1 -1
  47. package/out/coarse-placer/featurize.d.ts +0 -1
  48. package/out/coarse-placer/featurize.d.ts.map +1 -1
  49. package/out/coarse-placer/featurize.js.map +1 -1
  50. package/out/coarse-placer/tools/build-dataset.js +1 -2
  51. package/out/coarse-placer/tools/build-dataset.js.map +1 -1
  52. package/out/coarse-placer/tools/build-outlier-exposure.js +1 -2
  53. package/out/coarse-placer/tools/build-outlier-exposure.js.map +1 -1
  54. package/out/coarse-placer/tools/build-outlier-latin.d.ts.map +1 -1
  55. package/out/coarse-placer/tools/build-outlier-latin.js +12 -8
  56. package/out/coarse-placer/tools/build-outlier-latin.js.map +1 -1
  57. package/out/coarse-placer/tools/build-outlier-oa.d.ts.map +1 -1
  58. package/out/coarse-placer/tools/build-outlier-oa.js +10 -6
  59. package/out/coarse-placer/tools/build-outlier-oa.js.map +1 -1
  60. package/out/coarse-placer/tools/eval-latin-offmap.d.ts.map +1 -1
  61. package/out/coarse-placer/tools/eval-latin-offmap.js +2 -4
  62. package/out/coarse-placer/tools/eval-latin-offmap.js.map +1 -1
  63. package/out/coarse-placer/tools/eval-openset.js +2 -3
  64. package/out/coarse-placer/tools/eval-openset.js.map +1 -1
  65. package/out/coarse-placer/tools/eval-quant-compare.js +2 -3
  66. package/out/coarse-placer/tools/eval-quant-compare.js.map +1 -1
  67. package/out/coarse-placer/tools/eval.js +2 -3
  68. package/out/coarse-placer/tools/eval.js.map +1 -1
  69. package/out/coarse-placer/tools/fnv-hash.d.ts +1 -6
  70. package/out/coarse-placer/tools/fnv-hash.d.ts.map +1 -1
  71. package/out/coarse-placer/tools/fnv-hash.js +1 -6
  72. package/out/coarse-placer/tools/fnv-hash.js.map +1 -1
  73. package/out/coarse-placer/tools/index.d.ts +1 -1
  74. package/out/coarse-placer/tools/index.js +1 -1
  75. package/out/coarse-placer/tools/probe-frontier.d.ts.map +1 -1
  76. package/out/coarse-placer/tools/probe-frontier.js +2 -4
  77. package/out/coarse-placer/tools/probe-frontier.js.map +1 -1
  78. package/out/coarse-placer/tools/quantize.d.ts.map +1 -1
  79. package/out/coarse-placer/tools/quantize.js +2 -2
  80. package/out/coarse-placer/tools/quantize.js.map +1 -1
  81. package/out/coarse-placer/tools/train.js +1 -2
  82. package/out/coarse-placer/tools/train.js.map +1 -1
  83. package/out/crypto/node.d.ts.map +1 -1
  84. package/out/crypto/node.js +2 -1
  85. package/out/crypto/node.js.map +1 -1
  86. package/out/db/schema.d.ts +12 -3
  87. package/out/db/schema.d.ts.map +1 -1
  88. package/out/db/schema.js +6 -0
  89. package/out/db/schema.js.map +1 -1
  90. package/out/decoder/build-tree.d.ts.map +1 -1
  91. package/out/decoder/build-tree.js +17 -0
  92. package/out/decoder/build-tree.js.map +1 -1
  93. package/out/decoder/containment.d.ts.map +1 -1
  94. package/out/decoder/containment.js +5 -1
  95. package/out/decoder/containment.js.map +1 -1
  96. package/out/decoder/index.d.ts +1 -0
  97. package/out/decoder/index.d.ts.map +1 -1
  98. package/out/decoder/index.js +1 -0
  99. package/out/decoder/index.js.map +1 -1
  100. package/out/decoder/parse-diff.d.ts +125 -0
  101. package/out/decoder/parse-diff.d.ts.map +1 -0
  102. package/out/decoder/parse-diff.js +219 -0
  103. package/out/decoder/parse-diff.js.map +1 -0
  104. package/out/decoder/proposals-to-tree.js.map +1 -1
  105. package/out/decoder/serialize-json.d.ts +29 -0
  106. package/out/decoder/serialize-json.d.ts.map +1 -1
  107. package/out/decoder/serialize-json.js +20 -4
  108. package/out/decoder/serialize-json.js.map +1 -1
  109. package/out/decoder/serialize-tuples.d.ts +8 -1
  110. package/out/decoder/serialize-tuples.d.ts.map +1 -1
  111. package/out/decoder/serialize-tuples.js +7 -1
  112. package/out/decoder/serialize-tuples.js.map +1 -1
  113. package/out/decoder/serialize-xml.js +1 -1
  114. package/out/decoder/serialize-xml.js.map +1 -1
  115. package/out/decoder/tree-shape.d.ts +84 -0
  116. package/out/decoder/tree-shape.d.ts.map +1 -0
  117. package/out/decoder/tree-shape.js +98 -0
  118. package/out/decoder/tree-shape.js.map +1 -0
  119. package/out/decoder/types.d.ts +11 -0
  120. package/out/decoder/types.d.ts.map +1 -1
  121. package/out/decoder/validate-tree.d.ts +8 -0
  122. package/out/decoder/validate-tree.d.ts.map +1 -1
  123. package/out/decoder/validate-tree.js +4 -3
  124. package/out/decoder/validate-tree.js.map +1 -1
  125. package/out/env/index.d.ts +13 -1
  126. package/out/env/index.d.ts.map +1 -1
  127. package/out/env/index.js +2 -1
  128. package/out/env/index.js.map +1 -1
  129. package/out/env/paths.d.ts +15 -8
  130. package/out/env/paths.d.ts.map +1 -1
  131. package/out/env/paths.js +19 -29
  132. package/out/env/paths.js.map +1 -1
  133. package/out/env/schema.d.ts +12 -1
  134. package/out/env/schema.d.ts.map +1 -1
  135. package/out/env/schema.js +33 -3
  136. package/out/env/schema.js.map +1 -1
  137. package/out/fs/utils/formatters.d.ts +57 -0
  138. package/out/fs/utils/formatters.d.ts.map +1 -0
  139. package/out/fs/utils/formatters.js +79 -0
  140. package/out/fs/utils/formatters.js.map +1 -0
  141. package/out/fs/utils/index.d.ts +7 -0
  142. package/out/fs/utils/index.d.ts.map +1 -0
  143. package/out/fs/utils/index.js +7 -0
  144. package/out/fs/utils/index.js.map +1 -0
  145. package/out/fs/zip.d.ts +116 -0
  146. package/out/fs/zip.d.ts.map +1 -0
  147. package/out/fs/zip.js +216 -0
  148. package/out/fs/zip.js.map +1 -0
  149. package/out/layers/manifest.d.ts +32 -7
  150. package/out/layers/manifest.d.ts.map +1 -1
  151. package/out/layers/manifest.js +31 -6
  152. package/out/layers/manifest.js.map +1 -1
  153. package/out/layers/schema.d.ts +48 -2
  154. package/out/layers/schema.d.ts.map +1 -1
  155. package/out/layers/schema.js +32 -0
  156. package/out/layers/schema.js.map +1 -1
  157. package/out/locale/locale.d.ts +1 -1
  158. package/out/locale/locale.d.ts.map +1 -1
  159. package/out/locale/registry.js +1 -1
  160. package/out/locale/registry.js.map +1 -1
  161. package/out/objects.d.ts +12 -6
  162. package/out/objects.d.ts.map +1 -1
  163. package/out/objects.js +4 -1
  164. package/out/objects.js.map +1 -1
  165. package/out/pipeline/index.d.ts +3 -7
  166. package/out/pipeline/index.d.ts.map +1 -1
  167. package/out/pipeline/index.js +2 -4
  168. package/out/pipeline/index.js.map +1 -1
  169. package/out/pipeline/runtime-pipeline.d.ts +51 -9
  170. package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
  171. package/out/pipeline/runtime-pipeline.js +46 -133
  172. package/out/pipeline/runtime-pipeline.js.map +1 -1
  173. package/out/pipeline/span-proposer.js +1 -1
  174. package/out/pipeline/span-proposer.js.map +1 -1
  175. package/out/pipeline/types.d.ts +137 -16
  176. package/out/pipeline/types.d.ts.map +1 -1
  177. package/out/pipeline/types.js +30 -0
  178. package/out/pipeline/types.js.map +1 -1
  179. package/out/policy/defaults.d.ts +1 -1
  180. package/out/policy/defaults.d.ts.map +1 -1
  181. package/out/policy/defaults.js +1 -1
  182. package/out/policy/defaults.js.map +1 -1
  183. package/out/policy/policy.d.ts +1 -1
  184. package/out/policy/policy.d.ts.map +1 -1
  185. package/out/policy/registry.d.ts +1 -1
  186. package/out/policy/registry.d.ts.map +1 -1
  187. package/out/resolver/coverage-facts.d.ts +89 -0
  188. package/out/resolver/coverage-facts.d.ts.map +1 -0
  189. package/out/resolver/coverage-facts.js +22 -0
  190. package/out/resolver/coverage-facts.js.map +1 -0
  191. package/out/resolver/index.d.ts +4 -1
  192. package/out/resolver/index.d.ts.map +1 -1
  193. package/out/resolver/index.js +2 -0
  194. package/out/resolver/index.js.map +1 -1
  195. package/out/resolver/lookup-types.d.ts +178 -0
  196. package/out/resolver/lookup-types.d.ts.map +1 -0
  197. package/out/resolver/lookup-types.js +11 -0
  198. package/out/resolver/lookup-types.js.map +1 -0
  199. package/out/resolver/placetype-map.d.ts +71 -0
  200. package/out/resolver/placetype-map.d.ts.map +1 -0
  201. package/out/resolver/placetype-map.js +98 -0
  202. package/out/resolver/placetype-map.js.map +1 -0
  203. package/out/resolver/postcode-format.d.ts +38 -0
  204. package/out/resolver/postcode-format.d.ts.map +1 -0
  205. package/out/resolver/postcode-format.js +83 -0
  206. package/out/resolver/postcode-format.js.map +1 -0
  207. package/out/resolver/referential.d.ts +73 -0
  208. package/out/resolver/referential.d.ts.map +1 -0
  209. package/out/resolver/referential.js +71 -0
  210. package/out/resolver/referential.js.map +1 -0
  211. package/out/resolver/types.d.ts +401 -264
  212. package/out/resolver/types.d.ts.map +1 -1
  213. package/out/resolver/types.js +4 -97
  214. package/out/resolver/types.js.map +1 -1
  215. package/out/resources/git.d.ts +8 -1
  216. package/out/resources/git.d.ts.map +1 -1
  217. package/out/resources/git.js +4 -3
  218. package/out/resources/git.js.map +1 -1
  219. package/out/resources/languages/types.gen.d.ts +1 -1
  220. package/out/resources/languages/types.gen.d.ts.map +1 -1
  221. package/out/resources/languages/types.gen.js +40 -0
  222. package/out/resources/languages/types.gen.js.map +1 -1
  223. package/out/resources/libpostal.d.ts +2 -2
  224. package/out/resources/libpostal.d.ts.map +1 -1
  225. package/out/resources/libpostal.js +2 -2
  226. package/out/resources/libpostal.js.map +1 -1
  227. package/out/resources/whosonfirst/DataSourceCache.d.ts.map +1 -1
  228. package/out/resources/whosonfirst/DataSourceCache.js.map +1 -1
  229. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts +2 -2
  230. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts.map +1 -1
  231. package/out/resources/whosonfirst/PlacetypeDataSource.js +28 -3
  232. package/out/resources/whosonfirst/PlacetypeDataSource.js.map +1 -1
  233. package/out/resources/whosonfirst/loader.d.ts +2 -2
  234. package/out/resources/whosonfirst/loader.d.ts.map +1 -1
  235. package/out/resources/whosonfirst/loader.js.map +1 -1
  236. package/out/resources/whosonfirst/placetypes/Placetype.d.ts.map +1 -1
  237. package/out/resources/whosonfirst/placetypes/Placetype.js +1 -1
  238. package/out/resources/whosonfirst/placetypes/Placetype.js.map +1 -1
  239. package/out/resources/whosonfirst/placetypes/admin.d.ts +9 -1
  240. package/out/resources/whosonfirst/placetypes/admin.d.ts.map +1 -1
  241. package/out/resources/whosonfirst/placetypes/admin.js +1 -1
  242. package/out/resources/whosonfirst/placetypes/admin.js.map +1 -1
  243. package/out/resources/whosonfirst/placetypes/definition.d.ts.map +1 -1
  244. package/out/resources/whosonfirst/placetypes/definition.js +1 -1
  245. package/out/resources/whosonfirst/placetypes/definition.js.map +1 -1
  246. package/out/resources/whosonfirst/placetypes/index.d.ts +1 -0
  247. package/out/resources/whosonfirst/placetypes/index.d.ts.map +1 -1
  248. package/out/resources/whosonfirst/placetypes/index.js +1 -0
  249. package/out/resources/whosonfirst/placetypes/index.js.map +1 -1
  250. package/out/resources/whosonfirst/placetypes/specificity.d.ts +65 -0
  251. package/out/resources/whosonfirst/placetypes/specificity.d.ts.map +1 -0
  252. package/out/resources/whosonfirst/placetypes/specificity.js +101 -0
  253. package/out/resources/whosonfirst/placetypes/specificity.js.map +1 -0
  254. package/out/resources/whosonfirst/sharded-repo.d.ts +28 -0
  255. package/out/resources/whosonfirst/sharded-repo.d.ts.map +1 -1
  256. package/out/resources/whosonfirst/sharded-repo.js +46 -2
  257. package/out/resources/whosonfirst/sharded-repo.js.map +1 -1
  258. package/out/scripting/arguments.d.ts +27 -0
  259. package/out/scripting/arguments.d.ts.map +1 -0
  260. package/out/scripting/arguments.js +32 -0
  261. package/out/scripting/arguments.js.map +1 -0
  262. package/out/scripting/command.d.ts +28 -0
  263. package/out/scripting/command.d.ts.map +1 -0
  264. package/out/scripting/command.js +47 -0
  265. package/out/scripting/command.js.map +1 -0
  266. package/out/scripting/index.js +3 -3
  267. package/out/scripting/index.js.map +1 -1
  268. package/out/scripting/utils/index.d.ts +1 -12
  269. package/out/scripting/utils/index.d.ts.map +1 -1
  270. package/out/scripting/utils/index.js +4 -21
  271. package/out/scripting/utils/index.js.map +1 -1
  272. package/out/tools/download-libpostal-resources.d.ts.map +1 -1
  273. package/out/tools/download-libpostal-resources.js +4 -7
  274. package/out/tools/download-libpostal-resources.js.map +1 -1
  275. package/out/tools/download-ssl-address.d.ts +3 -3
  276. package/out/tools/download-ssl-address.d.ts.map +1 -1
  277. package/out/tools/download-ssl-address.js +26 -13
  278. package/out/tools/download-ssl-address.js.map +1 -1
  279. package/out/tools/generate-language-types.d.ts +16 -1
  280. package/out/tools/generate-language-types.d.ts.map +1 -1
  281. package/out/tools/generate-language-types.js +38 -5
  282. package/out/tools/generate-language-types.js.map +1 -1
  283. package/out/tools/index.d.ts +1 -2
  284. package/out/tools/index.d.ts.map +1 -1
  285. package/out/tools/index.js +1 -2
  286. package/out/tools/index.js.map +1 -1
  287. package/out/utils/data-root.d.ts +27 -7
  288. package/out/utils/data-root.d.ts.map +1 -1
  289. package/out/utils/data-root.js +36 -13
  290. package/out/utils/data-root.js.map +1 -1
  291. package/out/utils/hash.d.ts +2 -3
  292. package/out/utils/hash.d.ts.map +1 -1
  293. package/out/utils/hash.js +3 -3
  294. package/out/utils/hash.js.map +1 -1
  295. package/out/utils/index.d.ts +1 -0
  296. package/out/utils/index.d.ts.map +1 -1
  297. package/out/utils/index.js +1 -0
  298. package/out/utils/index.js.map +1 -1
  299. package/out/utils/jsonl.js +1 -1
  300. package/out/utils/jsonl.js.map +1 -1
  301. package/out/utils/repo.d.ts +8 -0
  302. package/out/utils/repo.d.ts.map +1 -1
  303. package/out/utils/repo.js +10 -1
  304. package/out/utils/repo.js.map +1 -1
  305. package/out/utils/sealed-db.d.ts +11 -0
  306. package/out/utils/sealed-db.d.ts.map +1 -1
  307. package/out/utils/sealed-db.js +28 -1
  308. package/out/utils/sealed-db.js.map +1 -1
  309. package/out/utils/sqlite-rows.d.ts +34 -0
  310. package/out/utils/sqlite-rows.d.ts.map +1 -0
  311. package/out/utils/sqlite-rows.js +37 -0
  312. package/out/utils/sqlite-rows.js.map +1 -0
  313. package/out/utils/stats.d.ts +1 -6
  314. package/out/utils/stats.d.ts.map +1 -1
  315. package/out/utils/stats.js +1 -6
  316. package/out/utils/stats.js.map +1 -1
  317. package/package.json +488 -8
  318. package/pipeline/index.ts +14 -15
  319. package/pipeline/runtime-pipeline.ts +48 -184
  320. package/pipeline/span-proposer.ts +1 -1
  321. package/pipeline/types.ts +143 -16
  322. package/policy/defaults.ts +1 -1
  323. package/policy/policy.ts +1 -1
  324. package/policy/registry.ts +1 -1
  325. package/resolver/coverage-facts.ts +102 -0
  326. package/resolver/index.ts +18 -0
  327. package/resolver/lookup-types.ts +174 -0
  328. package/resolver/placetype-map.ts +122 -0
  329. package/resolver/postcode-format.ts +89 -0
  330. package/resolver/referential.ts +84 -0
  331. package/resolver/types.ts +423 -315
  332. package/resources/git.ts +18 -4
  333. package/resources/languages/types.gen.ts +60 -0
  334. package/resources/libpostal.ts +4 -3
  335. package/resources/whosonfirst/DataSourceCache.ts +2 -1
  336. package/resources/whosonfirst/PlacetypeDataSource.ts +36 -11
  337. package/resources/whosonfirst/loader.ts +3 -2
  338. package/resources/whosonfirst/placetypes/Placetype.ts +2 -1
  339. package/resources/whosonfirst/placetypes/admin.ts +11 -2
  340. package/resources/whosonfirst/placetypes/definition.ts +4 -3
  341. package/resources/whosonfirst/placetypes/index.ts +1 -0
  342. package/resources/whosonfirst/placetypes/specificity.ts +114 -0
  343. package/resources/whosonfirst/sharded-repo.ts +55 -2
  344. package/scripting/arguments.ts +38 -0
  345. package/scripting/command.ts +55 -0
  346. package/scripting/index.ts +3 -3
  347. package/scripting/utils/index.ts +5 -23
  348. package/tools/download-libpostal-resources.ts +4 -7
  349. package/tools/download-ssl-address.ts +28 -12
  350. package/tools/generate-language-types.ts +39 -5
  351. package/tools/index.ts +1 -2
  352. package/utils/data-root.ts +40 -14
  353. package/utils/hash.ts +5 -4
  354. package/utils/index.ts +1 -0
  355. package/utils/jsonl.ts +1 -1
  356. package/utils/repo.ts +12 -1
  357. package/utils/sealed-db.ts +30 -1
  358. package/utils/sqlite-rows.ts +40 -0
  359. package/utils/stats.ts +1 -6
  360. package/data/libpostal/dictionaries/all/chains.txt +0 -504
  361. package/kysley/adapter.ts +0 -29
  362. package/out/kysley/adapter.d.ts +0 -13
  363. package/out/kysley/adapter.d.ts.map +0 -1
  364. package/out/kysley/adapter.js +0 -25
  365. package/out/kysley/adapter.js.map +0 -1
  366. package/out/pipeline/reconcile-lookups.d.ts +0 -39
  367. package/out/pipeline/reconcile-lookups.d.ts.map +0 -1
  368. package/out/pipeline/reconcile-lookups.js +0 -88
  369. package/out/pipeline/reconcile-lookups.js.map +0 -1
  370. package/out/pipeline/reconcile.d.ts +0 -153
  371. package/out/pipeline/reconcile.d.ts.map +0 -1
  372. package/out/pipeline/reconcile.js +0 -388
  373. package/out/pipeline/reconcile.js.map +0 -1
  374. package/out/pipeline/span-logit-aggregation.d.ts +0 -58
  375. package/out/pipeline/span-logit-aggregation.d.ts.map +0 -1
  376. package/out/pipeline/span-logit-aggregation.js +0 -117
  377. package/out/pipeline/span-logit-aggregation.js.map +0 -1
  378. package/pipeline/reconcile-lookups.ts +0 -111
  379. package/pipeline/reconcile.ts +0 -583
  380. package/pipeline/span-logit-aggregation.ts +0 -156
@@ -11,6 +11,34 @@
11
11
  * parsed record has.
12
12
  */
13
13
  import type { WOFFeature } from "./placetypes/admin.ts";
14
+ /**
15
+ * The GitHub organization holding the country data repositories.
16
+ */
17
+ export declare const WOF_DATA_OWNER = "whosonfirst-data";
18
+ /**
19
+ * The repository name for a country's data of one theme — `whosonfirst-data-admin-tr`.
20
+ *
21
+ * Four call sites used to build this string themselves, each with its own `toLowerCase()`, which is how a country code
22
+ * arriving uppercase became a directory that silently does not exist.
23
+ */
24
+ export declare function wofRepoName(theme: "admin" | "postalcode" | "venue", country: string): string;
25
+ /**
26
+ * Find a cloned repository under a repositories root, in either layout.
27
+ *
28
+ * Two are in use and both are legitimate. `gazetteer inspect sync` writes `<root>/<owner>/<name>`, which is what the
29
+ * admin ingest's depth-agnostic GeoJSON glob reads. The shipped postcode shards were built from repositories cloned by
30
+ * hand as `<root>/<name>`. A reader that knows one layout reports a repository that is present as MISSING, and every
31
+ * reader here treats missing as "no evidence" and continues — so the wrong layout is silent, not loud.
32
+ *
33
+ * Synchronous to match {@link readWOFFeature}: these readers run inside sync loops over database rows.
34
+ */
35
+ export declare function resolveWOFRepo(reposRoot: string, name: string, owner?: string): string | null;
36
+ /**
37
+ * The `data` directory of a country's repository, or `null` when the repository is not cloned.
38
+ *
39
+ * The pairing every reader needs: {@link readWOFFeature} takes roots that already point INTO `data`.
40
+ */
41
+ export declare function resolveWOFDataDir(reposRoot: string, theme: "admin" | "postalcode" | "venue", country: string): string | null;
14
42
  /**
15
43
  * A WOF id → its repo-relative path segments, ending in `<id>.geojson`.
16
44
  *
@@ -1 +1 @@
1
- {"version":3,"file":"sharded-repo.d.ts","sourceRoot":"","sources":["../../../resources/whosonfirst/sharded-repo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAQvD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAWtD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,GAAG,IAAI,CAiBtF"}
1
+ {"version":3,"file":"sharded-repo.d.ts","sourceRoot":"","sources":["../../../resources/whosonfirst/sharded-repo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD;;GAEG;AACH,eAAO,MAAM,cAAc,qBAAqB,CAAA;AAEhD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,GAAG,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE5F;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,SAAiB,GAAG,MAAM,GAAG,IAAI,CAUrG;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAChC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,OAAO,GAAG,YAAY,GAAG,OAAO,EACvC,OAAO,EAAE,MAAM,GACb,MAAM,GAAG,IAAI,CAIf;AAQD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAWtD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,GAAG,IAAI,CAiBtF"}
@@ -10,9 +10,53 @@
10
10
  * it is layout knowledge every reader has to carry — so it lives here once, next to the {@link WOFFeature} type the
11
11
  * parsed record has.
12
12
  */
13
- import { existsSync, readFileSync } from "node:fs";
13
+ import { existsSync, readFileSync, statSync } from "node:fs";
14
14
  import { resolvePath } from "path-ts";
15
- import { tryParsingJSON } from "../../objects.js";
15
+ import { tryParsingJSON } from "#objects";
16
+ /**
17
+ * The GitHub organization holding the country data repositories.
18
+ */
19
+ export const WOF_DATA_OWNER = "whosonfirst-data";
20
+ /**
21
+ * The repository name for a country's data of one theme — `whosonfirst-data-admin-tr`.
22
+ *
23
+ * Four call sites used to build this string themselves, each with its own `toLowerCase()`, which is how a country code
24
+ * arriving uppercase became a directory that silently does not exist.
25
+ */
26
+ export function wofRepoName(theme, country) {
27
+ return `${WOF_DATA_OWNER}-${theme}-${country.toLowerCase()}`;
28
+ }
29
+ /**
30
+ * Find a cloned repository under a repositories root, in either layout.
31
+ *
32
+ * Two are in use and both are legitimate. `gazetteer inspect sync` writes `<root>/<owner>/<name>`, which is what the
33
+ * admin ingest's depth-agnostic GeoJSON glob reads. The shipped postcode shards were built from repositories cloned by
34
+ * hand as `<root>/<name>`. A reader that knows one layout reports a repository that is present as MISSING, and every
35
+ * reader here treats missing as "no evidence" and continues — so the wrong layout is silent, not loud.
36
+ *
37
+ * Synchronous to match {@link readWOFFeature}: these readers run inside sync loops over database rows.
38
+ */
39
+ export function resolveWOFRepo(reposRoot, name, owner = WOF_DATA_OWNER) {
40
+ for (const candidate of [resolvePath(reposRoot, owner, name), resolvePath(reposRoot, name)]) {
41
+ try {
42
+ if (statSync(candidate).isDirectory())
43
+ return candidate.toString();
44
+ }
45
+ catch {
46
+ // Absent, or unreadable — try the other layout, then answer null.
47
+ }
48
+ }
49
+ return null;
50
+ }
51
+ /**
52
+ * The `data` directory of a country's repository, or `null` when the repository is not cloned.
53
+ *
54
+ * The pairing every reader needs: {@link readWOFFeature} takes roots that already point INTO `data`.
55
+ */
56
+ export function resolveWOFDataDir(reposRoot, theme, country) {
57
+ const repo = resolveWOFRepo(reposRoot, wofRepoName(theme, country));
58
+ return repo && resolvePath(repo, "data").toString();
59
+ }
16
60
  /**
17
61
  * Characters per directory level. A trailing group shorter than this is its own directory — `85977539` ends in `39`,
18
62
  * not `390`.
@@ -1 +1 @@
1
- {"version":3,"file":"sharded-repo.js","sourceRoot":"","sources":["../../../resources/whosonfirst/sharded-repo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGjD;;;GAGG;AACH,MAAM,QAAQ,GAAG,CAAC,CAAA;AAElB;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAU;IAC3C,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,CAA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AAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAA;IAC7C,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,UAAU,CAAC,CAAA;IAElC,OAAO,QAAQ,CAAA;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,EAAU,EAAE,KAAwB;IAClE,MAAM,QAAQ,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAA;IAEtC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC1B,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,CAAA;QAE3C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,SAAQ;QAE/B,IAAI,CAAC;YACJ,OAAO,cAAc,CAAa,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAA;QAC9D,CAAC;QAAC,MAAM,CAAC;YACR,uGAAuG;YACvG,OAAO,IAAI,CAAA;QACZ,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAA;AACZ,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Dependency-free process argument accessors. Kept separate from script cleanup/logging so latency-sensitive CLI
7
+ * dispatchers can read argv without loading the ResourceError, ConsoleLogger, and async-init graphs.
8
+ */
9
+ export type UnsafeCLIArgument = string & {
10
+ __unsafeCLIArgumentBrand: never;
11
+ };
12
+ export type UnsafeCLIArguments = ReadonlyArray<UnsafeCLIArgument>;
13
+ /**
14
+ * The one blessed accessor for user CLI arguments.
15
+ */
16
+ export declare function cliArguments(): UnsafeCLIArguments;
17
+ /**
18
+ * Forward the CLI arguments to a child process.
19
+ *
20
+ * Do not use this function unless its arguments are being passed to a child process.
21
+ */
22
+ export declare function passThroughCLIArguments(): readonly unknown[];
23
+ /**
24
+ * The path of the executing script (`argv[1]`).
25
+ */
26
+ export declare function scriptEntryPath(): string;
27
+ //# sourceMappingURL=arguments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arguments.d.ts","sourceRoot":"","sources":["../../scripting/arguments.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG;IAAE,wBAAwB,EAAE,KAAK,CAAA;CAAE,CAAA;AAE5E,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAAA;AAEjE;;GAEG;AACH,wBAAgB,YAAY,IAAI,kBAAkB,CAGjD;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,SAAS,OAAO,EAAE,CAG5D;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAGxC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Dependency-free process argument accessors. Kept separate from script cleanup/logging so latency-sensitive CLI
7
+ * dispatchers can read argv without loading the ResourceError, ConsoleLogger, and async-init graphs.
8
+ */
9
+ /**
10
+ * The one blessed accessor for user CLI arguments.
11
+ */
12
+ export function cliArguments() {
13
+ // oxlint-disable-next-line sister-software/no-process-globals -- this function is the blessed argv accessor
14
+ return process.argv.slice(2);
15
+ }
16
+ /**
17
+ * Forward the CLI arguments to a child process.
18
+ *
19
+ * Do not use this function unless its arguments are being passed to a child process.
20
+ */
21
+ export function passThroughCLIArguments() {
22
+ // oxlint-disable-next-line sister-software/no-process-globals -- Forwarding arguments to a child process.
23
+ return process.argv.slice(2);
24
+ }
25
+ /**
26
+ * The path of the executing script (`argv[1]`).
27
+ */
28
+ export function scriptEntryPath() {
29
+ // oxlint-disable-next-line sister-software/no-process-globals -- this function is the blessed argv entry-path accessor
30
+ return process.argv[1];
31
+ }
32
+ //# sourceMappingURL=arguments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arguments.js","sourceRoot":"","sources":["../../scripting/arguments.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;GAEG;AACH,MAAM,UAAU,YAAY;IAC3B,4GAA4G;IAC5G,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAkC,CAAA;AAC9D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB;IACtC,0GAA0G;IAC1G,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe;IAC9B,uHAAuH;IACvH,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAE,CAAA;AACxB,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Dependency-light lifecycle and error primitives for user-facing CLI commands. This is intentionally separate from
7
+ * `scripting/utils`, whose service disposal and structured logging are appropriate for long-running scripts.
8
+ */
9
+ /**
10
+ * An expected command failure whose message is safe to show directly. The original failure belongs in `cause`.
11
+ */
12
+ export declare class CommandError extends Error {
13
+ readonly exitCode = 1;
14
+ constructor(message: string, options?: ErrorOptions);
15
+ }
16
+ /**
17
+ * Format an expected command failure as guidance and preserve stacks for unexpected failures.
18
+ */
19
+ export declare function formatCommandError(error: unknown): string;
20
+ /**
21
+ * Log a command failure and the cause attached to expected guidance errors.
22
+ */
23
+ export declare function reportError(error: unknown): void;
24
+ /**
25
+ * Run a CLI command with one consistent stderr and exit-code boundary.
26
+ */
27
+ export declare function runCLICommand(command: () => number | undefined | Promise<number | undefined>): Promise<number | undefined>;
28
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../scripting/command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACtC,QAAQ,CAAC,QAAQ,KAAI;gBAET,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAInD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAIzD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAMhD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC5B,OAAO,EAAE,MAAM,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,GAC7D,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAQ7B"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Dependency-light lifecycle and error primitives for user-facing CLI commands. This is intentionally separate from
7
+ * `scripting/utils`, whose service disposal and structured logging are appropriate for long-running scripts.
8
+ */
9
+ /**
10
+ * An expected command failure whose message is safe to show directly. The original failure belongs in `cause`.
11
+ */
12
+ export class CommandError extends Error {
13
+ exitCode = 1;
14
+ constructor(message, options) {
15
+ super(message, options);
16
+ this.name = "CommandError";
17
+ }
18
+ }
19
+ /**
20
+ * Format an expected command failure as guidance and preserve stacks for unexpected failures.
21
+ */
22
+ export function formatCommandError(error) {
23
+ if (error instanceof CommandError)
24
+ return error.message;
25
+ return error instanceof Error ? (error.stack ?? error.message) : String(error);
26
+ }
27
+ /**
28
+ * Log a command failure and the cause attached to expected guidance errors.
29
+ */
30
+ export function reportError(error) {
31
+ console.error(formatCommandError(error));
32
+ if (error instanceof CommandError && error.cause !== undefined) {
33
+ console.error(`Caused by: ${formatCommandError(error.cause)}`);
34
+ }
35
+ }
36
+ /**
37
+ * Run a CLI command with one consistent stderr and exit-code boundary.
38
+ */
39
+ export function runCLICommand(command) {
40
+ return Promise.resolve()
41
+ .then(command)
42
+ .catch((error) => {
43
+ reportError(error);
44
+ return 1;
45
+ });
46
+ }
47
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../../scripting/command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IAC7B,QAAQ,GAAG,CAAC,CAAA;IAErB,YAAY,OAAe,EAAE,OAAsB;QAClD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACvB,IAAI,CAAC,IAAI,GAAG,cAAc,CAAA;IAC3B,CAAC;CACD;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAChD,IAAI,KAAK,YAAY,YAAY;QAAE,OAAO,KAAK,CAAC,OAAO,CAAA;IAEvD,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC/E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACzC,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAA;IAExC,IAAI,KAAK,YAAY,YAAY,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAChE,OAAO,CAAC,KAAK,CAAC,cAAc,kBAAkB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IAC/D,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAC5B,OAA+D;IAE/D,OAAO,OAAO,CAAC,OAAO,EAAE;SACtB,IAAI,CAAC,OAAO,CAAC;SACb,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QACzB,WAAW,CAAC,KAAK,CAAC,CAAA;QAElB,OAAO,CAAC,CAAA;IACT,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -21,9 +21,9 @@ export async function runIfScript(meta, scriptCallback) {
21
21
  if (!meta.main)
22
22
  return;
23
23
  const [{ $public }, { ConsoleLogger, stringifyLoggedObject }, { runScript }] = await Promise.all([
24
- import("@mailwoman/core/env"),
25
- import("@mailwoman/core/logging"),
26
- import("@mailwoman/core/scripting/utils"),
24
+ import("#env"),
25
+ import("#logging"),
26
+ import("#scripting/utils"),
27
27
  ]);
28
28
  ConsoleLogger.info(stringifyLoggedObject($public, {
29
29
  description: "Public Environment",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../scripting/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAgB,EAAE,cAA8B;IACjF,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACpC,yFAAyF;QACzF,sFAAsF;QACtF,IAAK,IAA0B,CAAC,GAAG;YAAE,OAAM;QAE3C,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAA;IACrF,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,IAAI;QAAE,OAAM;IAEtB,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,qBAAqB,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAChG,MAAM,CAAC,qBAAqB,CAAC;QAC7B,MAAM,CAAC,yBAAyB,CAAC;QACjC,MAAM,CAAC,iCAAiC,CAAC;KACzC,CAAC,CAAA;IAEF,aAAa,CAAC,IAAI,CACjB,qBAAqB,CAAC,OAAO,EAAE;QAC9B,WAAW,EAAE,oBAAoB;QACjC,UAAU,EAAE,IAAI;KAChB,CAAC,CACF,CAAA;IAED,OAAO,SAAS,CAAC,cAAc,CAAC,CAAA;AACjC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../scripting/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAgB,EAAE,cAA8B;IACjF,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACpC,yFAAyF;QACzF,sFAAsF;QACtF,IAAK,IAA0B,CAAC,GAAG;YAAE,OAAM;QAE3C,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAA;IACrF,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,IAAI;QAAE,OAAM;IAEtB,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,qBAAqB,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAChG,MAAM,CAAC,MAAM,CAAC;QACd,MAAM,CAAC,UAAU,CAAC;QAClB,MAAM,CAAC,kBAAkB,CAAC;KAC1B,CAAC,CAAA;IAEF,aAAa,CAAC,IAAI,CACjB,qBAAqB,CAAC,OAAO,EAAE;QAC9B,WAAW,EAAE,oBAAoB;QACjC,UAAU,EAAE,IAAI;KAChB,CAAC,CACF,CAAA;IAED,OAAO,SAAS,CAAC,cAAc,CAAC,CAAA;AACjC,CAAC"}
@@ -1,3 +1,4 @@
1
+ export { cliArguments, passThroughCLIArguments, scriptEntryPath } from "../arguments.ts";
1
2
  /**
2
3
  * Logs an error that occurred while running a script.
3
4
  */
@@ -22,22 +23,10 @@ export declare function postScriptCleanup(signal?: NodeJS.Signals, exitCode?: nu
22
23
  * @internal
23
24
  */
24
25
  export declare function runScript(scriptCallback: ScriptCallback): Promise<void>;
25
- /**
26
- * The ONE blessed accessor for CLI arguments. Everything outside `core/env` + this module is forbidden from touching
27
- * `process.argv` directly (enforced by the `sister-software/no-process-globals` oxlint rule) — prefer `node:util`
28
- * `parseArgs` (which reads this same slice by default) and reach for this only where `parseArgs` cannot express the
29
- * grammar (e.g. verbatim passthrough of undeclared flags to a child process — see
30
- * `corpus-python/scripts/train_with_resume.ts`).
31
- */
32
- export declare function cliArguments(): string[];
33
26
  /**
34
27
  * The ONE blessed way to build a child-process environment: the current environment with explicit overrides. Everything
35
28
  * outside `core/env` + this module is forbidden from touching `process.env` directly (enforced by
36
29
  * `scripts/lint-raw-env-argv.ts`) — read config through `$public`/`$private`.
37
30
  */
38
31
  export declare function childEnv(overrides?: Record<string, string | undefined>): NodeJS.ProcessEnv;
39
- /**
40
- * The path of the executing script (`argv[1]`) — for commands that re-spawn or reference their own CLI entry.
41
- */
42
- export declare function scriptEntryPath(): string;
43
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../scripting/utils/index.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAYnD;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAE/E;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,MAAM,CAAC,OAAmB,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBtG;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAevE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAGvC;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAM,GAAG,MAAM,CAAC,UAAU,CAG9F;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAGxC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../scripting/utils/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAExF;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAYnD;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAE/E;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,MAAM,CAAC,OAAmB,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBtG;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAevE;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAM,GAAG,MAAM,CAAC,UAAU,CAG9F"}
@@ -1,6 +1,7 @@
1
1
  import { defaultRegistry } from "async-init";
2
- import { ResourceError } from "../../errors/index.js";
3
- import { ConsoleLogger } from "../../logging/index.js";
2
+ import { ResourceError } from "#errors";
3
+ import { ConsoleLogger } from "#logging";
4
+ export { cliArguments, passThroughCLIArguments, scriptEntryPath } from "../arguments.js";
4
5
  /**
5
6
  * Logs an error that occurred while running a script.
6
7
  */
@@ -52,31 +53,13 @@ export function runScript(scriptCallback) {
52
53
  })
53
54
  .catch(() => postScriptCleanup("SIGTERM", 1));
54
55
  }
55
- /**
56
- * The ONE blessed accessor for CLI arguments. Everything outside `core/env` + this module is forbidden from touching
57
- * `process.argv` directly (enforced by the `sister-software/no-process-globals` oxlint rule) — prefer `node:util`
58
- * `parseArgs` (which reads this same slice by default) and reach for this only where `parseArgs` cannot express the
59
- * grammar (e.g. verbatim passthrough of undeclared flags to a child process — see
60
- * `corpus-python/scripts/train_with_resume.ts`).
61
- */
62
- export function cliArguments() {
63
- // oxlint-disable-next-line sister-software/no-process-globals
64
- return process.argv.slice(2);
65
- }
66
56
  /**
67
57
  * The ONE blessed way to build a child-process environment: the current environment with explicit overrides. Everything
68
58
  * outside `core/env` + this module is forbidden from touching `process.env` directly (enforced by
69
59
  * `scripts/lint-raw-env-argv.ts`) — read config through `$public`/`$private`.
70
60
  */
71
61
  export function childEnv(overrides = {}) {
72
- // oxlint-disable-next-line sister-software/no-process-globals
62
+ // oxlint-disable-next-line sister-software/no-process-globals -- this function is the blessed child-process environment boundary
73
63
  return { ...process.env, ...overrides };
74
64
  }
75
- /**
76
- * The path of the executing script (`argv[1]`) — for commands that re-spawn or reference their own CLI entry.
77
- */
78
- export function scriptEntryPath() {
79
- // oxlint-disable-next-line sister-software/no-process-globals
80
- return process.argv[1];
81
- }
82
65
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../scripting/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAEtD;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC5C,aAAa,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAA;IAElE,MAAM,eAAe,GAAG,KAAK,YAAY,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAE1F,aAAa,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;IAEpC,IAAI,eAAe,CAAC,KAAK,YAAY,KAAK,IAAI,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAC3E,aAAa,CAAC,KAAK,CAAC,oBAAoB,GAAG,eAAe,CAAC,KAAK,CAAC,KAAK,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EAAE,CAAC,CAAC,CAAC,CAAA;AAC/C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,YAAgD,EAAE;IAC1E,iIAAiI;IACjI,OAAO,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,SAAS,EAAE,CAAA;AACxC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"download-libpostal-resources.d.ts","sourceRoot":"","sources":["../../tools/download-libpostal-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AA+BH;;;;GAIG;AACH,wBAAsB,0BAA0B,CAC/C,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,EACjC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,IAAI,CAAC,CAoCf"}
1
+ {"version":3,"file":"download-libpostal-resources.d.ts","sourceRoot":"","sources":["../../tools/download-libpostal-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAgCH;;;;GAIG;AACH,wBAAsB,0BAA0B,CAC/C,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,EACjC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,IAAI,CAAC,CAgCf"}
@@ -26,8 +26,9 @@
26
26
  import { cp, mkdtemp, readdir, readFile, rm, writeFile } from "node:fs/promises";
27
27
  import { tmpdir } from "node:os";
28
28
  import { join } from "node:path";
29
- import { isDirectory } from "@mailwoman/core/fs";
30
- import { resourceDictionaryPath } from "@mailwoman/core/utils";
29
+ import { isDirectory } from "#fs";
30
+ import { CommandError } from "#scripting/command";
31
+ import { resourceDictionaryPath } from "#utils";
31
32
  const REPO_URL = "https://github.com/openvenues/libpostal.git";
32
33
  const DICTIONARIES_DIR = resourceDictionaryPath("libpostal");
33
34
  /**
@@ -59,11 +60,7 @@ export async function downloadLibpostalResources(options = {}, report) {
59
60
  await rm(DICTIONARIES_DIR, { recursive: true, force: true });
60
61
  }
61
62
  else {
62
- // Guidance-grade refusal: suppress the stack so the CLI renders just the message
63
- // (core can't import mailwoman/cli-kit's commandError — wrong dependency direction).
64
- const error = new Error("The dictionaries directory already exists. Remove it first or pass --force.");
65
- error.stack = error.message;
66
- throw error;
63
+ throw new CommandError("The dictionaries directory already exists. Remove it first or pass --force.");
67
64
  }
68
65
  }
69
66
  const { $ } = await import("zx");
@@ -1 +1 @@
1
- {"version":3,"file":"download-libpostal-resources.js","sourceRoot":"","sources":["../../tools/download-libpostal-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAE9D,MAAM,QAAQ,GAAG,6CAA6C,CAAA;AAC9D,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,WAAW,CAAC,CAAA;AAE5D;;;GAGG;AACH,KAAK,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACzC,MAAM,kBAAkB,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC9C,0IAA0I;IAC1I,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAE9B,+FAA+F;IAC/F,IAAI,kBAAkB,EAAE,CAAC;QACxB,KAAK,CAAC,GAA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AAG,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,CAAC,CAAA;QAE/D,6DAA6D;QAC7D,KAAK,MAAM,KAAK,IAAI,MAAM,OAAO,CAAC,WAAW,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;YACzE,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;gBACpB,MAAM,eAAe,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;YACrD,CAAC;QACF,CAAC;QAED,yEAAyE;QACzE,MAAM,EAAE,CAAC,WAAW,EAAE,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAC7D,CAAC;YAAS,CAAC;QACV,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IACpD,CAAC;AACF,CAAC"}
@@ -9,9 +9,9 @@
9
9
  *
10
10
  * See: https://github.com/google/libaddressinput/wiki/AddressValidationMetadata
11
11
  *
12
- * Replaces the bash `ssl-address-download.sh` (curl + jq) with native `fetch` + `JSON.parse`. The
13
- * country list lives at `…/ssl-address/data` as a `~`-delimited `.countries` string; each country's
14
- * record is then fetched from `…/ssl-address/data/<CC>` and written to `<out-dir>/<CC>.json`.
12
+ * Replaces the bash `ssl-address-download.sh` (curl + jq). The country list lives at
13
+ * `…/ssl-address/data` as a `~`-delimited `.countries` string; each country's record is then
14
+ * fetched from `…/ssl-address/data/<CC>` and written to `<out-dir>/<CC>.json`.
15
15
  *
16
16
  * ## Usage
17
17
  *
@@ -1 +1 @@
1
- {"version":3,"file":"download-ssl-address.d.ts","sourceRoot":"","sources":["../../tools/download-ssl-address.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AASH;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACpB;AAwBD;;;GAGG;AACH,wBAAsB,kBAAkB,CACvC,OAAO,GAAE,yBAA8B,EACvC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAiC9C"}
1
+ {"version":3,"file":"download-ssl-address.d.ts","sourceRoot":"","sources":["../../tools/download-ssl-address.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAyBH;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACpB;AAwBD;;;GAGG;AACH,wBAAsB,kBAAkB,CACvC,OAAO,GAAE,yBAA8B,EACvC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAiC9C"}
@@ -9,9 +9,9 @@
9
9
  *
10
10
  * See: https://github.com/google/libaddressinput/wiki/AddressValidationMetadata
11
11
  *
12
- * Replaces the bash `ssl-address-download.sh` (curl + jq) with native `fetch` + `JSON.parse`. The
13
- * country list lives at `…/ssl-address/data` as a `~`-delimited `.countries` string; each country's
14
- * record is then fetched from `…/ssl-address/data/<CC>` and written to `<out-dir>/<CC>.json`.
12
+ * Replaces the bash `ssl-address-download.sh` (curl + jq). The country list lives at
13
+ * `…/ssl-address/data` as a `~`-delimited `.countries` string; each country's record is then
14
+ * fetched from `…/ssl-address/data/<CC>` and written to `<out-dir>/<CC>.json`.
15
15
  *
16
16
  * ## Usage
17
17
  *
@@ -26,26 +26,39 @@
26
26
  */
27
27
  import { mkdir, writeFile } from "node:fs/promises";
28
28
  import { join } from "node:path";
29
- import { corePackagePath } from "@mailwoman/core/utils";
29
+ import { corePackagePath } from "#utils";
30
+ import { APIClient, pluckResponseData } from "../api/index.js";
30
31
  const BASE_URL = "https://chromium-i18n.appspot.com/ssl-address/data";
32
+ /**
33
+ * One host, ~250 small records, fetched `concurrency`-wide.
34
+ *
35
+ * Retry is the point: a throttle or a dropped connection on ONE country previously counted as a permanent failure for
36
+ * that country, and the run reported `written: 249, failed: 1` — indistinguishable from a country the source does not
37
+ * carry. No `minRequestIntervalMs`: the concurrency-wide burst is what this tool has always done and the host has not
38
+ * objected, and inventing a rate limit no measurement supports would only make a working tool slower.
39
+ */
40
+ const sslAddressClient = new APIClient({
41
+ displayName: "ssl-address",
42
+ retry: true,
43
+ axios: { timeout: 60_000 },
44
+ });
31
45
  /**
32
46
  * Fetch the `~`-delimited country list and return it as an array of ISO codes.
33
47
  */
34
48
  async function fetchCountryCodes() {
35
- const res = await fetch(BASE_URL, { signal: AbortSignal.timeout(60_000) });
36
- if (!res.ok)
37
- throw new Error(`HTTP ${res.status} ${res.statusText} fetching country list`);
38
- const data = (await res.json());
39
- return (data.countries ?? "").split("~").filter(Boolean);
49
+ const data = await sslAddressClient.fetch({ url: BASE_URL }).then(pluckResponseData);
50
+ return (data.countries ?? "").split("~").filter((code) => code.length > 0);
40
51
  }
41
52
  /**
42
53
  * Fetch a single country's metadata record and write its raw JSON body to `<outDir>/<cc>.json`.
43
54
  */
44
55
  async function fetchCountry(cc, outDir) {
45
- const res = await fetch(`${BASE_URL}/${cc}`, { signal: AbortSignal.timeout(60_000) });
46
- if (!res.ok)
47
- throw new Error(`HTTP ${res.status} ${res.statusText} on ${cc}`);
48
- await writeFile(join(outDir, `${cc}.json`), await res.text());
56
+ // `responseType: "text"` keeps the RAW body: these records are written to disk verbatim, and letting
57
+ // axios parse then re-serialize would rewrite key order and spacing in a checked-in artifact.
58
+ const body = await sslAddressClient
59
+ .fetch({ url: `${BASE_URL}/${cc}`, responseType: "text" })
60
+ .then(pluckResponseData);
61
+ await writeFile(join(outDir, `${cc}.json`), body);
49
62
  }
50
63
  /**
51
64
  * Download every country's ssl-address metadata record. Returns the failure count (the command maps `failed > 0` to
@@ -1 +1 @@
1
- {"version":3,"file":"download-ssl-address.js","sourceRoot":"","sources":["../../tools/download-ssl-address.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,MAAM,QAAQ,GAAG,oDAAoD,CAAA;AAgBrE;;GAEG;AACH,KAAK,UAAU,iBAAiB;IAC/B,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAE1E,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,QAAQ,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,UAAU,wBAAwB,CAAC,CAAA;IAC1F,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAA2B,CAAA;IAEzD,OAAO,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AACzD,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,YAAY,CAAC,EAAU,EAAE,MAAc;IACrD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,QAAQ,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAErF,IAA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EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,IAAI,EAAE;QACtF,OAAO,IAAI,EAAE,CAAC;YACb,MAAM,IAAI,GAAG,QAAQ,EAAE,CAAA;YAEvB,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM;gBAAE,OAAM;YAChC,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAE,CAAA;YAEvB,IAAI,CAAC;gBACJ,MAAM,YAAY,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;gBAC9B,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;YACtB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,QAAQ,EAAE,CAAA;gBACV,MAAM,EAAE,CAAC,OAAO,EAAE,KAAM,KAAe,CAAC,OAAO,EAAE,CAAC,CAAA;YACnD,CAAC;QACF,CAAC;IACF,CAAC,CAAC,CAAA;IAEF,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IAE1B,MAAM,EAAE,CAAC,aAAa,KAAK,CAAC,MAAM,GAAG,QAAQ,IAAI,KAAK,CAAC,MAAM,aAAa,QAAQ,SAAS,CAAC,CAAA;IAE5F,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAA;AAC9D,CAAC"}
@@ -3,9 +3,24 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Regenerate `core/resources/languages/types.gen.ts` — the ISO 639-1/639-2b language-code types +
6
+ * Regenerate `core/resources/languages/types.gen.ts` — the ISO 639-1 / 639-2 language-code types +
7
7
  * label maps — from the committed `internal/languages.csv` resource dictionary.
8
8
  *
9
+ * BOTH 639-2 standards are emitted, and the reason is data, not completeness. ISO 639-2 has two
10
+ * three-letter forms: /B (bibliographic) and /T (terminological, identical to 639-3). They differ
11
+ * for exactly 20 languages, and **Who's On First keys its name properties in /T** — so a /B-only
12
+ * union excluded `deu`, `fra` and `nld`, three tier-1 locales, while admitting spellings the data
13
+ * never uses. Measured over the built gazetteer's `names` table: 3,591,751 rows on the /T side of
14
+ * those 20 pairs against 247 on the /B side, a ratio of 14,542:1.
15
+ *
16
+ * /B is NOT dropped: `packages/codex/country/official-languages.ts` lists both forms deliberately
17
+ * (`DE: ["de","deu","ger"]`) and 247 real rows carry one, so the union accepts either and both map
18
+ * to the same label and the same alpha-2.
19
+ *
20
+ * NAME DEBT, deliberately not paid here: `Alpha3bLanguageCode`, `Alpha3bLabelMap`, `Alpha3bToAlpha2`
21
+ * and the CSV's `alpha3-b` header all still say "b" while holding both standards. Renaming them is a
22
+ * published-API break and belongs in a major.
23
+ *
9
24
  * Usage: mailwoman dev generate language-types
10
25
  */
11
26
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"generate-language-types.d.ts","sourceRoot":"","sources":["../../tools/generate-language-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC5C;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC5C,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CAC1C,OAAO,GAAE,4BAAiC,EAC1C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,4BAA4B,CAAC,CAsJvC"}
1
+ {"version":3,"file":"generate-language-types.d.ts","sourceRoot":"","sources":["../../tools/generate-language-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AASH;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC5C;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC5C,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CAC1C,OAAO,GAAE,4BAAiC,EAC1C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,4BAA4B,CAAC,CAyKvC"}