@mailwoman/core 11.2.0 → 11.3.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 (463) hide show
  1. package/README.md +2 -2
  2. package/lib/api/ckan.ts +1 -1
  3. package/lib/api/disk-storage.ts +2 -2
  4. package/lib/api/ogc.ts +1 -1
  5. package/lib/api/retry.ts +7 -2
  6. package/lib/api/test/transport.ts +1 -1
  7. package/lib/{binary-frame.ts → asset/binary-frame.ts} +1 -1
  8. package/lib/async/abort.ts +100 -0
  9. package/lib/{memoize.ts → async/memoize.ts} +2 -2
  10. package/lib/{promises.ts → async/promises.ts} +1 -1
  11. package/lib/cloudflare/tokens.ts +1 -1
  12. package/lib/cloudflare/wrangler.ts +3 -3
  13. package/lib/crypto/digest.ts +1 -1
  14. package/lib/crypto/ed25519.ts +8 -0
  15. package/lib/crypto/node.ts +1 -1
  16. package/lib/data-root.ts +16 -3
  17. package/lib/decoder/containment.ts +4 -1
  18. package/lib/decoder/serialize/outline.ts +19 -6
  19. package/lib/decoder/types.ts +9 -1
  20. package/lib/env/schema.ts +5 -0
  21. package/lib/fs/deflate64.ts +1 -1
  22. package/lib/fs/lock.ts +183 -25
  23. package/lib/fs/readers.ts +1 -1
  24. package/lib/fs/writers.ts +1 -1
  25. package/lib/geocode/result.ts +50 -6
  26. package/lib/html/text.ts +2 -2
  27. package/lib/index.ts +0 -1
  28. package/lib/layers/artifact.ts +2 -2
  29. package/lib/layers/coverage.ts +1 -1
  30. package/lib/layers/manifest.ts +94 -2
  31. package/lib/layers/provenance.ts +246 -0
  32. package/lib/layers/publication.ts +4 -3
  33. package/lib/layers/selection.ts +2 -2
  34. package/lib/license/branch.ts +66 -0
  35. package/lib/license/configured.ts +4 -2
  36. package/lib/license/declaration.ts +1 -1
  37. package/lib/license/key/file.ts +1 -1
  38. package/lib/license/key.ts +148 -201
  39. package/lib/license/provenance.ts +193 -0
  40. package/lib/license/register.ts +7 -78
  41. package/lib/license/stamp.ts +8 -2
  42. package/lib/license/text-url.ts +55 -0
  43. package/lib/license/training.ts +67 -0
  44. package/lib/license.ts +7 -6
  45. package/lib/locale/registry.ts +1 -1
  46. package/lib/locale/zh-cn-units.ts +1 -1
  47. package/lib/module/workspace.ts +1 -1
  48. package/lib/{routing.ts → network/routing.ts} +1 -1
  49. package/lib/pipeline/result.ts +6 -25
  50. package/lib/pipeline/runtime-pipeline.ts +129 -144
  51. package/lib/pipeline/stage.ts +290 -0
  52. package/lib/pipeline/types.ts +33 -14
  53. package/lib/pipeline.ts +14 -2
  54. package/lib/{git.ts → repo/git.ts} +21 -1
  55. package/lib/{release-config.ts → repo/release-config.ts} +8 -0
  56. package/lib/{spdx-header.ts → repo/spdx-header.ts} +8 -0
  57. package/lib/{workspaces.ts → repo/workspaces.ts} +1 -1
  58. package/lib/resolver/lookup-types.ts +1 -1
  59. package/lib/resolver/region-database-provider.ts +33 -0
  60. package/lib/resolver/synthetic-id-ranges.ts +19 -9
  61. package/lib/resolver/types.ts +220 -7
  62. package/lib/resolver.ts +14 -1
  63. package/lib/state-machine.ts +1 -1
  64. package/lib/strings/python-json.ts +3 -2
  65. package/lib/utils/chunk-process.ts +2 -2
  66. package/lib/utils/geodatabase-archive.ts +1 -1
  67. package/lib/utils/time.ts +136 -12
  68. package/lib/utils.ts +4 -4
  69. package/out/api/ckan.js +1 -1
  70. package/out/api/ckan.js.map +1 -1
  71. package/out/api/disk-storage.d.ts.map +1 -1
  72. package/out/api/disk-storage.js +2 -2
  73. package/out/api/disk-storage.js.map +1 -1
  74. package/out/api/ogc.js +1 -1
  75. package/out/api/ogc.js.map +1 -1
  76. package/out/api/retry.d.ts.map +1 -1
  77. package/out/api/retry.js +6 -2
  78. package/out/api/retry.js.map +1 -1
  79. package/out/api/test/transport.js +1 -1
  80. package/out/api/test/transport.js.map +1 -1
  81. package/out/asset/binary-frame.d.ts.map +1 -0
  82. package/out/{binary-frame.js → asset/binary-frame.js} +1 -1
  83. package/out/asset/binary-frame.js.map +1 -0
  84. package/out/asset/load-ledger.d.ts.map +1 -0
  85. package/out/asset/load-ledger.js.map +1 -0
  86. package/out/asset/overture-pins.d.ts.map +1 -0
  87. package/out/asset/overture-pins.js.map +1 -0
  88. package/out/asset/postcode-prefix-files.d.ts.map +1 -0
  89. package/out/asset/postcode-prefix-files.js.map +1 -0
  90. package/out/async/abort.d.ts +57 -0
  91. package/out/async/abort.d.ts.map +1 -0
  92. package/out/async/abort.js +89 -0
  93. package/out/async/abort.js.map +1 -0
  94. package/out/async/memoize.d.ts.map +1 -0
  95. package/out/{memoize.js → async/memoize.js} +2 -2
  96. package/out/async/memoize.js.map +1 -0
  97. package/out/{promises.d.ts → async/promises.d.ts} +1 -1
  98. package/out/async/promises.d.ts.map +1 -0
  99. package/out/{promises.js → async/promises.js} +1 -1
  100. package/out/async/promises.js.map +1 -0
  101. package/out/cloudflare/tokens.js +1 -1
  102. package/out/cloudflare/tokens.js.map +1 -1
  103. package/out/cloudflare/wrangler.js +3 -3
  104. package/out/cloudflare/wrangler.js.map +1 -1
  105. package/out/crypto/digest.d.ts +1 -1
  106. package/out/crypto/digest.js +1 -1
  107. package/out/crypto/ed25519.d.ts +7 -0
  108. package/out/crypto/ed25519.d.ts.map +1 -1
  109. package/out/crypto/ed25519.js +7 -0
  110. package/out/crypto/ed25519.js.map +1 -1
  111. package/out/crypto/hash.d.ts.map +1 -0
  112. package/out/crypto/hash.js.map +1 -0
  113. package/out/crypto/node.js +1 -1
  114. package/out/crypto/node.js.map +1 -1
  115. package/out/data-root.d.ts +11 -3
  116. package/out/data-root.d.ts.map +1 -1
  117. package/out/data-root.js +14 -3
  118. package/out/data-root.js.map +1 -1
  119. package/out/decoder/containment.d.ts.map +1 -1
  120. package/out/decoder/containment.js +1 -1
  121. package/out/decoder/containment.js.map +1 -1
  122. package/out/decoder/serialize/outline.d.ts +9 -0
  123. package/out/decoder/serialize/outline.d.ts.map +1 -1
  124. package/out/decoder/serialize/outline.js +16 -6
  125. package/out/decoder/serialize/outline.js.map +1 -1
  126. package/out/decoder/types.d.ts +8 -0
  127. package/out/decoder/types.d.ts.map +1 -1
  128. package/out/decoder/types.js +1 -1
  129. package/out/decoder/types.js.map +1 -1
  130. package/out/env/schema.d.ts +1 -0
  131. package/out/env/schema.d.ts.map +1 -1
  132. package/out/env/schema.js +4 -0
  133. package/out/env/schema.js.map +1 -1
  134. package/out/env.d.ts +1 -0
  135. package/out/env.d.ts.map +1 -1
  136. package/out/fs/deflate64.js +1 -1
  137. package/out/fs/deflate64.js.map +1 -1
  138. package/out/fs/lock.d.ts +73 -4
  139. package/out/fs/lock.d.ts.map +1 -1
  140. package/out/fs/lock.js +96 -19
  141. package/out/fs/lock.js.map +1 -1
  142. package/out/fs/readers.js +1 -1
  143. package/out/fs/readers.js.map +1 -1
  144. package/out/fs/writers.d.ts +1 -1
  145. package/out/fs/writers.d.ts.map +1 -1
  146. package/out/fs/writers.js +1 -1
  147. package/out/fs/writers.js.map +1 -1
  148. package/out/geocode/result.d.ts +25 -1
  149. package/out/geocode/result.d.ts.map +1 -1
  150. package/out/geocode/result.js +49 -6
  151. package/out/geocode/result.js.map +1 -1
  152. package/out/html/text.js +2 -2
  153. package/out/html/trust-policies.d.ts.map +1 -0
  154. package/out/html/trust-policies.js.map +1 -0
  155. package/out/index.d.ts +0 -1
  156. package/out/index.d.ts.map +1 -1
  157. package/out/index.js +0 -1
  158. package/out/index.js.map +1 -1
  159. package/out/layers/artifact.js +2 -2
  160. package/out/layers/artifact.js.map +1 -1
  161. package/out/layers/coverage.d.ts.map +1 -1
  162. package/out/layers/coverage.js +1 -1
  163. package/out/layers/coverage.js.map +1 -1
  164. package/out/layers/manifest.d.ts +53 -0
  165. package/out/layers/manifest.d.ts.map +1 -1
  166. package/out/layers/manifest.js +68 -2
  167. package/out/layers/manifest.js.map +1 -1
  168. package/out/layers/provenance.d.ts +127 -0
  169. package/out/layers/provenance.d.ts.map +1 -0
  170. package/out/layers/provenance.js +122 -0
  171. package/out/layers/provenance.js.map +1 -0
  172. package/out/layers/publication.d.ts.map +1 -1
  173. package/out/layers/publication.js +3 -3
  174. package/out/layers/publication.js.map +1 -1
  175. package/out/layers/selection.d.ts.map +1 -1
  176. package/out/layers/selection.js +2 -2
  177. package/out/layers/selection.js.map +1 -1
  178. package/out/license/branch.d.ts +33 -0
  179. package/out/license/branch.d.ts.map +1 -0
  180. package/out/license/branch.js +52 -0
  181. package/out/license/branch.js.map +1 -0
  182. package/out/license/configured.d.ts +1 -1
  183. package/out/license/configured.d.ts.map +1 -1
  184. package/out/license/configured.js +1 -9
  185. package/out/license/configured.js.map +1 -1
  186. package/out/license/declaration.d.ts +1 -1
  187. package/out/license/declaration.d.ts.map +1 -1
  188. package/out/license/key/file.js +1 -1
  189. package/out/license/key/file.js.map +1 -1
  190. package/out/license/key.d.ts +27 -115
  191. package/out/license/key.d.ts.map +1 -1
  192. package/out/license/key.js +98 -164
  193. package/out/license/key.js.map +1 -1
  194. package/out/license/provenance.d.ts +47 -0
  195. package/out/license/provenance.d.ts.map +1 -0
  196. package/out/license/provenance.js +134 -0
  197. package/out/license/provenance.js.map +1 -0
  198. package/out/license/register.d.ts +6 -47
  199. package/out/license/register.d.ts.map +1 -1
  200. package/out/license/register.js +7 -58
  201. package/out/license/register.js.map +1 -1
  202. package/out/license/stamp.d.ts +7 -1
  203. package/out/license/stamp.d.ts.map +1 -1
  204. package/out/license/stamp.js +2 -2
  205. package/out/license/stamp.js.map +1 -1
  206. package/out/license/text-url.d.ts +9 -0
  207. package/out/license/text-url.d.ts.map +1 -0
  208. package/out/license/text-url.js +49 -0
  209. package/out/license/text-url.js.map +1 -0
  210. package/out/license/training.d.ts +29 -0
  211. package/out/license/training.d.ts.map +1 -0
  212. package/out/license/training.js +52 -0
  213. package/out/license/training.js.map +1 -0
  214. package/out/license.d.ts +7 -6
  215. package/out/license.d.ts.map +1 -1
  216. package/out/license.js +7 -6
  217. package/out/license.js.map +1 -1
  218. package/out/locale/registry.d.ts.map +1 -1
  219. package/out/locale/registry.js +1 -1
  220. package/out/locale/registry.js.map +1 -1
  221. package/out/locale/zh-cn-units.js +1 -1
  222. package/out/locale/zh-cn-units.js.map +1 -1
  223. package/out/math/numeric.d.ts.map +1 -0
  224. package/out/math/numeric.js.map +1 -0
  225. package/out/math/random.d.ts.map +1 -0
  226. package/out/math/random.js.map +1 -0
  227. package/out/math/stats.d.ts.map +1 -0
  228. package/out/math/stats.js.map +1 -0
  229. package/out/module/workspace.js +1 -1
  230. package/out/module/workspace.js.map +1 -1
  231. package/out/network/routing.d.ts.map +1 -0
  232. package/out/{routing.js → network/routing.js} +1 -1
  233. package/out/network/routing.js.map +1 -0
  234. package/out/pipeline/result.d.ts +7 -24
  235. package/out/pipeline/result.d.ts.map +1 -1
  236. package/out/pipeline/runtime-pipeline.d.ts +7 -2
  237. package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
  238. package/out/pipeline/runtime-pipeline.js +56 -103
  239. package/out/pipeline/runtime-pipeline.js.map +1 -1
  240. package/out/pipeline/stage.d.ts +180 -0
  241. package/out/pipeline/stage.d.ts.map +1 -0
  242. package/out/pipeline/stage.js +130 -0
  243. package/out/pipeline/stage.js.map +1 -0
  244. package/out/pipeline/types.d.ts +31 -12
  245. package/out/pipeline/types.d.ts.map +1 -1
  246. package/out/pipeline/types.js +0 -8
  247. package/out/pipeline/types.js.map +1 -1
  248. package/out/pipeline.d.ts +5 -3
  249. package/out/pipeline.d.ts.map +1 -1
  250. package/out/pipeline.js +2 -1
  251. package/out/pipeline.js.map +1 -1
  252. package/out/{git.d.ts → repo/git.d.ts} +10 -1
  253. package/out/repo/git.d.ts.map +1 -0
  254. package/out/{git.js → repo/git.js} +14 -1
  255. package/out/repo/git.js.map +1 -0
  256. package/out/{release-config.d.ts → repo/release-config.d.ts} +8 -0
  257. package/out/repo/release-config.d.ts.map +1 -0
  258. package/out/repo/release-config.js.map +1 -0
  259. package/out/repo/scope-config.d.ts.map +1 -0
  260. package/out/repo/scope-config.js.map +1 -0
  261. package/out/repo/spdx-header.d.ts.map +1 -0
  262. package/out/{spdx-header.js → repo/spdx-header.js} +7 -0
  263. package/out/repo/spdx-header.js.map +1 -0
  264. package/out/repo/vale.d.ts.map +1 -0
  265. package/out/repo/vale.js.map +1 -0
  266. package/out/repo/workspaces.d.ts.map +1 -0
  267. package/out/{workspaces.js → repo/workspaces.js} +1 -1
  268. package/out/repo/workspaces.js.map +1 -0
  269. package/out/resolver/lookup-types.d.ts +1 -1
  270. package/out/resolver/region-database-provider.d.ts +30 -0
  271. package/out/resolver/region-database-provider.d.ts.map +1 -1
  272. package/out/resolver/synthetic-id-ranges.d.ts +15 -8
  273. package/out/resolver/synthetic-id-ranges.d.ts.map +1 -1
  274. package/out/resolver/synthetic-id-ranges.js +18 -9
  275. package/out/resolver/synthetic-id-ranges.js.map +1 -1
  276. package/out/resolver/types.d.ts +192 -8
  277. package/out/resolver/types.d.ts.map +1 -1
  278. package/out/resolver/types.js +56 -0
  279. package/out/resolver/types.js.map +1 -1
  280. package/out/resolver.d.ts +3 -3
  281. package/out/resolver.d.ts.map +1 -1
  282. package/out/resolver.js +1 -1
  283. package/out/resolver.js.map +1 -1
  284. package/out/scripting/process.d.ts.map +1 -0
  285. package/out/scripting/process.js.map +1 -0
  286. package/out/scripting/workers.d.ts.map +1 -0
  287. package/out/scripting/workers.js.map +1 -0
  288. package/out/state-machine.d.ts +1 -1
  289. package/out/strings/python-json.d.ts +2 -1
  290. package/out/strings/python-json.d.ts.map +1 -1
  291. package/out/strings/python-json.js +1 -1
  292. package/out/strings/python-json.js.map +1 -1
  293. package/out/tools/build-deflate64-wasm.run.js +2 -2
  294. package/out/tools/build-deflate64-wasm.run.js.map +1 -1
  295. package/out/tools/coarse-placer/build/dataset.js +1 -1
  296. package/out/tools/coarse-placer/build/dataset.js.map +1 -1
  297. package/out/tools/coarse-placer/build/outlier/exposure.js +1 -1
  298. package/out/tools/coarse-placer/build/outlier/exposure.js.map +1 -1
  299. package/out/tools/coarse-placer/build/outlier/latin.d.ts.map +1 -1
  300. package/out/tools/coarse-placer/build/outlier/latin.js +5 -1
  301. package/out/tools/coarse-placer/build/outlier/latin.js.map +1 -1
  302. package/out/tools/coarse-placer/country-sets.d.ts +2 -2
  303. package/out/tools/coarse-placer/country-sets.js +2 -2
  304. package/out/tools/coarse-placer/outlier-rows.js +2 -2
  305. package/out/tools/coarse-placer/outlier-rows.js.map +1 -1
  306. package/out/tools/coarse-placer/train.js +1 -1
  307. package/out/tools/coarse-placer/train.js.map +1 -1
  308. package/out/tools/generate-language-types.js +2 -2
  309. package/out/tools/generate-language-types.js.map +1 -1
  310. package/out/tools/license/product-fixtures.run.d.ts +2 -0
  311. package/out/tools/license/product-fixtures.run.d.ts.map +1 -0
  312. package/out/tools/license/product-fixtures.run.js +350 -0
  313. package/out/tools/license/product-fixtures.run.js.map +1 -0
  314. package/out/utils/chunk-process.js +2 -2
  315. package/out/utils/chunk-process.js.map +1 -1
  316. package/out/utils/geodatabase-archive.js +1 -1
  317. package/out/utils/geodatabase-archive.js.map +1 -1
  318. package/out/utils/time.d.ts +15 -4
  319. package/out/utils/time.d.ts.map +1 -1
  320. package/out/utils/time.js +114 -12
  321. package/out/utils/time.js.map +1 -1
  322. package/out/utils.d.ts +4 -4
  323. package/out/utils.d.ts.map +1 -1
  324. package/out/utils.js +4 -4
  325. package/out/utils.js.map +1 -1
  326. package/out/values/identical.d.ts.map +1 -0
  327. package/out/values/identical.js.map +1 -0
  328. package/out/values/json.d.ts.map +1 -0
  329. package/out/values/json.js.map +1 -0
  330. package/out/values/objects.d.ts.map +1 -0
  331. package/out/values/objects.js.map +1 -0
  332. package/package.json +278 -243
  333. package/tools/build-deflate64-wasm.run.ts +2 -2
  334. package/tools/coarse-placer/build/dataset.ts +1 -1
  335. package/tools/coarse-placer/build/outlier/exposure.ts +1 -1
  336. package/tools/coarse-placer/build/outlier/latin.ts +5 -1
  337. package/tools/coarse-placer/country-sets.ts +2 -2
  338. package/tools/coarse-placer/outlier-rows.ts +2 -2
  339. package/tools/coarse-placer/train.ts +1 -1
  340. package/tools/generate-language-types.ts +2 -2
  341. package/tools/license/product-fixtures.run.ts +449 -0
  342. package/lib/collections.ts +0 -5
  343. package/lib/license/decision.ts +0 -329
  344. package/lib/license/obligations.ts +0 -256
  345. package/lib/license/record.ts +0 -277
  346. package/lib/scripting/ingest-chunk-script.ts +0 -87
  347. package/out/binary-frame.d.ts.map +0 -1
  348. package/out/binary-frame.js.map +0 -1
  349. package/out/collections.d.ts +0 -2
  350. package/out/collections.d.ts.map +0 -1
  351. package/out/collections.js +0 -5
  352. package/out/collections.js.map +0 -1
  353. package/out/git.d.ts.map +0 -1
  354. package/out/git.js.map +0 -1
  355. package/out/hash.d.ts.map +0 -1
  356. package/out/hash.js.map +0 -1
  357. package/out/identical.d.ts.map +0 -1
  358. package/out/identical.js.map +0 -1
  359. package/out/json.d.ts.map +0 -1
  360. package/out/json.js.map +0 -1
  361. package/out/license/decision.d.ts +0 -179
  362. package/out/license/decision.d.ts.map +0 -1
  363. package/out/license/decision.js +0 -169
  364. package/out/license/decision.js.map +0 -1
  365. package/out/license/obligations.d.ts +0 -102
  366. package/out/license/obligations.d.ts.map +0 -1
  367. package/out/license/obligations.js +0 -188
  368. package/out/license/obligations.js.map +0 -1
  369. package/out/license/record.d.ts +0 -136
  370. package/out/license/record.d.ts.map +0 -1
  371. package/out/license/record.js +0 -222
  372. package/out/license/record.js.map +0 -1
  373. package/out/load-ledger.d.ts.map +0 -1
  374. package/out/load-ledger.js.map +0 -1
  375. package/out/memoize.d.ts.map +0 -1
  376. package/out/memoize.js.map +0 -1
  377. package/out/numeric.d.ts.map +0 -1
  378. package/out/numeric.js.map +0 -1
  379. package/out/objects.d.ts.map +0 -1
  380. package/out/objects.js.map +0 -1
  381. package/out/overture-pins.d.ts.map +0 -1
  382. package/out/overture-pins.js.map +0 -1
  383. package/out/postcode-prefix-files.d.ts.map +0 -1
  384. package/out/postcode-prefix-files.js.map +0 -1
  385. package/out/process.d.ts.map +0 -1
  386. package/out/process.js.map +0 -1
  387. package/out/promises.d.ts.map +0 -1
  388. package/out/promises.js.map +0 -1
  389. package/out/random.d.ts.map +0 -1
  390. package/out/random.js.map +0 -1
  391. package/out/release-config.d.ts.map +0 -1
  392. package/out/release-config.js.map +0 -1
  393. package/out/routing.d.ts.map +0 -1
  394. package/out/routing.js.map +0 -1
  395. package/out/scope-config.d.ts.map +0 -1
  396. package/out/scope-config.js.map +0 -1
  397. package/out/scripting/ingest-chunk-script.d.ts +0 -58
  398. package/out/scripting/ingest-chunk-script.d.ts.map +0 -1
  399. package/out/scripting/ingest-chunk-script.js +0 -47
  400. package/out/scripting/ingest-chunk-script.js.map +0 -1
  401. package/out/spdx-header.d.ts.map +0 -1
  402. package/out/spdx-header.js.map +0 -1
  403. package/out/stats.d.ts.map +0 -1
  404. package/out/stats.js.map +0 -1
  405. package/out/trust-policies.d.ts.map +0 -1
  406. package/out/trust-policies.js.map +0 -1
  407. package/out/vale.d.ts.map +0 -1
  408. package/out/vale.js.map +0 -1
  409. package/out/workers.d.ts.map +0 -1
  410. package/out/workers.js.map +0 -1
  411. package/out/workspaces.d.ts.map +0 -1
  412. package/out/workspaces.js.map +0 -1
  413. /package/lib/{load-ledger.ts → asset/load-ledger.ts} +0 -0
  414. /package/lib/{overture-pins.ts → asset/overture-pins.ts} +0 -0
  415. /package/lib/{postcode-prefix-files.ts → asset/postcode-prefix-files.ts} +0 -0
  416. /package/lib/{hash.ts → crypto/hash.ts} +0 -0
  417. /package/lib/{trust-policies.ts → html/trust-policies.ts} +0 -0
  418. /package/lib/{numeric.ts → math/numeric.ts} +0 -0
  419. /package/lib/{random.ts → math/random.ts} +0 -0
  420. /package/lib/{stats.ts → math/stats.ts} +0 -0
  421. /package/lib/{scope-config.ts → repo/scope-config.ts} +0 -0
  422. /package/lib/{vale.ts → repo/vale.ts} +0 -0
  423. /package/lib/{process.ts → scripting/process.ts} +0 -0
  424. /package/lib/{workers.ts → scripting/workers.ts} +0 -0
  425. /package/lib/{identical.ts → values/identical.ts} +0 -0
  426. /package/lib/{json.ts → values/json.ts} +0 -0
  427. /package/lib/{objects.ts → values/objects.ts} +0 -0
  428. /package/out/{binary-frame.d.ts → asset/binary-frame.d.ts} +0 -0
  429. /package/out/{load-ledger.d.ts → asset/load-ledger.d.ts} +0 -0
  430. /package/out/{load-ledger.js → asset/load-ledger.js} +0 -0
  431. /package/out/{overture-pins.d.ts → asset/overture-pins.d.ts} +0 -0
  432. /package/out/{overture-pins.js → asset/overture-pins.js} +0 -0
  433. /package/out/{postcode-prefix-files.d.ts → asset/postcode-prefix-files.d.ts} +0 -0
  434. /package/out/{postcode-prefix-files.js → asset/postcode-prefix-files.js} +0 -0
  435. /package/out/{memoize.d.ts → async/memoize.d.ts} +0 -0
  436. /package/out/{hash.d.ts → crypto/hash.d.ts} +0 -0
  437. /package/out/{hash.js → crypto/hash.js} +0 -0
  438. /package/out/{trust-policies.d.ts → html/trust-policies.d.ts} +0 -0
  439. /package/out/{trust-policies.js → html/trust-policies.js} +0 -0
  440. /package/out/{numeric.d.ts → math/numeric.d.ts} +0 -0
  441. /package/out/{numeric.js → math/numeric.js} +0 -0
  442. /package/out/{random.d.ts → math/random.d.ts} +0 -0
  443. /package/out/{random.js → math/random.js} +0 -0
  444. /package/out/{stats.d.ts → math/stats.d.ts} +0 -0
  445. /package/out/{stats.js → math/stats.js} +0 -0
  446. /package/out/{routing.d.ts → network/routing.d.ts} +0 -0
  447. /package/out/{release-config.js → repo/release-config.js} +0 -0
  448. /package/out/{scope-config.d.ts → repo/scope-config.d.ts} +0 -0
  449. /package/out/{scope-config.js → repo/scope-config.js} +0 -0
  450. /package/out/{spdx-header.d.ts → repo/spdx-header.d.ts} +0 -0
  451. /package/out/{vale.d.ts → repo/vale.d.ts} +0 -0
  452. /package/out/{vale.js → repo/vale.js} +0 -0
  453. /package/out/{workspaces.d.ts → repo/workspaces.d.ts} +0 -0
  454. /package/out/{process.d.ts → scripting/process.d.ts} +0 -0
  455. /package/out/{process.js → scripting/process.js} +0 -0
  456. /package/out/{workers.d.ts → scripting/workers.d.ts} +0 -0
  457. /package/out/{workers.js → scripting/workers.js} +0 -0
  458. /package/out/{identical.d.ts → values/identical.d.ts} +0 -0
  459. /package/out/{identical.js → values/identical.js} +0 -0
  460. /package/out/{json.d.ts → values/json.d.ts} +0 -0
  461. /package/out/{json.js → values/json.js} +0 -0
  462. /package/out/{objects.d.ts → values/objects.d.ts} +0 -0
  463. /package/out/{objects.js → values/objects.js} +0 -0
package/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  **The foundation of the Mailwoman address parser** — types, tokenization,
4
4
  classification primitives, solver, decoder, and the staged pipeline coordinator.
5
- Ships ~9 MB of provenance-tracked reference dictionaries (libpostal, Who's On First
6
- , chromium-i18n) consumed by the resolver and classifiers.
5
+ It ships about 9 MB of provenance-tracked reference dictionaries (libpostal, Who's On First,
6
+ and chromium-i18n) consumed by the resolver and classifiers.
7
7
 
8
8
  ```ts
9
9
  import { createRuntimePipeline, AddressParser, ComponentTag, Classification, Span } from "@mailwoman/core"
package/lib/api/ckan.ts CHANGED
@@ -12,7 +12,7 @@
12
12
  */
13
13
 
14
14
  import type { APIClient } from "#api/APIClient"
15
- import { parseJSONArray, stringifyJSON } from "#json"
15
+ import { parseJSONArray, stringifyJSON } from "#values/json"
16
16
 
17
17
  /**
18
18
  * The CKAN catalogue API base URL.
@@ -24,12 +24,12 @@
24
24
  import { type AxiosStorage, buildStorage, type NotEmptyStorageValue, type StorageValue } from "axios-cache-interceptor"
25
25
  import { PathBuilder, type PathBuilderLike } from "path-ts"
26
26
 
27
+ import { sha256Hex } from "#crypto/hash"
27
28
  import { errorMessage } from "#errors/schema"
28
29
  import { readLocalTextFile } from "#fs/readers"
29
30
  import { makeDirectories, movePath, removePath, removePathIfPresent, writeLocalFile } from "#fs/writers"
30
- import { sha256Hex } from "#hash"
31
- import { tryParsingJSON, stringifyJSON } from "#json"
32
31
  import { ConsoleLogger, type IRuntimeLogger } from "#logging"
32
+ import { tryParsingJSON, stringifyJSON } from "#values/json"
33
33
 
34
34
  /**
35
35
  * Options for {@linkcode buildDiskStorage}.
package/lib/api/ogc.ts CHANGED
@@ -14,7 +14,7 @@ import { decodeXML } from "entities"
14
14
 
15
15
  import type { APIClient } from "#api/APIClient"
16
16
  import { rootAttribute } from "#html/document"
17
- import { stringifyJSON } from "#json"
17
+ import { stringifyJSON } from "#values/json"
18
18
 
19
19
  /**
20
20
  * The error an OGC `ServiceExceptionReport` becomes.
package/lib/api/retry.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * @file Bounded retry policy for `APIClient`, including RFC 9110 `Retry-After` parsing and Axios error classification.
6
6
  */
7
7
 
8
- import { AxiosError, isAxiosError } from "axios"
8
+ import { AxiosError, HttpStatusCode, isAxiosError } from "axios"
9
9
 
10
10
  /**
11
11
  * HTTP status for rate limiting.
@@ -157,7 +157,12 @@ export function classifyAxiosFailure(error: unknown): RetryDirective {
157
157
  const retryAfterMs = retryAfterFrom(error)
158
158
 
159
159
  if (error.response) {
160
- return { retryable: isRetryableStatus(error.response.status), retryAfterMs }
160
+ const { status } = error.response
161
+
162
+ // A 2xx status on an error means the body failed after the headers arrived, a mid-transfer drop.
163
+ if (status >= HttpStatusCode.Ok && status < HttpStatusCode.MultipleChoices) return { retryable: true, retryAfterMs }
164
+
165
+ return { retryable: isRetryableStatus(status), retryAfterMs }
161
166
  }
162
167
 
163
168
  // No response at all: a network-class failure, unless the caller cancelled it themselves.
@@ -23,7 +23,7 @@
23
23
  import type { AxiosResponse } from "axios"
24
24
 
25
25
  import type { APIClient, APIClientConfig } from "#api/APIClient"
26
- import { stringifyJSON } from "#json"
26
+ import { stringifyJSON } from "#values/json"
27
27
 
28
28
  const HTTP_OK = 200
29
29
  const HTTP_MULTIPLE_CHOICES = 300
@@ -1,7 +1,7 @@
1
1
  // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
2
  // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
3
3
 
4
- import { parseJSONStrict, stringifyJSON } from "#json"
4
+ import { parseJSONStrict, stringifyJSON } from "#values/json"
5
5
 
6
6
  /**
7
7
  * Reads little-endian values sequentially from a byte buffer, advancing `offset` after each read.
@@ -0,0 +1,100 @@
1
+ // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
3
+
4
+ /**
5
+ * Typed reasons for an aborted `AbortSignal`.
6
+ *
7
+ * A signal reports only that it aborted, and its `reason` is whatever the aborting code passed.
8
+ * Code that reacts differently to a cancelled query, a passed deadline, a newer request
9
+ * and a disposed scope otherwise has to compare signal identities or match error names.
10
+ *
11
+ * {@linkcode AbortReason} is the reason this repository's code aborts with, and
12
+ * {@linkcode abortKindOf} reads the kind back from any signal, including one a platform API aborted.
13
+ *
14
+ * The module imports no other module, so it adds only its own bytes to a browser or Worker bundle.
15
+ */
16
+
17
+ /**
18
+ * Why a signal aborted.
19
+ */
20
+ export const AbortKind = {
21
+ /**
22
+ * The caller cancelled the work, as when a reader types a new query or leaves the page.
23
+ */
24
+ Caller: "caller",
25
+ /**
26
+ * A time limit passed before the work finished.
27
+ */
28
+ Deadline: "deadline",
29
+ /**
30
+ * Newer work replaced this work, as when a second load starts before the first has finished.
31
+ */
32
+ Superseded: "superseded",
33
+ /**
34
+ * The scope that owned the work was disposed, as when a service registry shuts down.
35
+ */
36
+ ScopeDisposed: "scope-disposed",
37
+ } as const
38
+
39
+ export type AbortKind = (typeof AbortKind)[keyof typeof AbortKind]
40
+
41
+ const DEFAULT_MESSAGES: Record<AbortKind, string> = {
42
+ [AbortKind.Caller]: "The caller cancelled the operation.",
43
+ [AbortKind.Deadline]: "The operation passed its deadline.",
44
+ [AbortKind.Superseded]: "A newer operation replaced this one.",
45
+ [AbortKind.ScopeDisposed]: "The scope that owned the operation was disposed.",
46
+ }
47
+
48
+ /**
49
+ * The reason to abort a controller with: `controller.abort(new AbortReason(AbortKind.Superseded))`.
50
+ *
51
+ * Its `name` is `AbortError`, the name `fetch` and the platform's own aborts use,
52
+ * so code that already tests for that name keeps working.
53
+ */
54
+ export class AbortReason extends Error {
55
+ readonly kind: AbortKind
56
+
57
+ constructor(kind: AbortKind, message: string = DEFAULT_MESSAGES[kind], options?: ErrorOptions) {
58
+ super(message, options)
59
+
60
+ this.name = "AbortError"
61
+ this.kind = kind
62
+ }
63
+ }
64
+
65
+ /**
66
+ * The name the platform gives the reason of `AbortSignal.timeout()`.
67
+ */
68
+ const TIMEOUT_ERROR_NAME = "TimeoutError"
69
+
70
+ /**
71
+ * The code `async-init` gives the reason a disposing `ServiceRegistry` aborts its signal with.
72
+ */
73
+ const DISPOSED_ERROR_CODE = "E_DISPOSED"
74
+
75
+ /**
76
+ * Why `signal` aborted, or `null` for a signal that's still live.
77
+ *
78
+ * - An {@linkcode AbortReason} answers its own kind.
79
+ * - The reason of `AbortSignal.timeout()` answers {@linkcode AbortKind.Deadline}.
80
+ * - The reason of a disposing `async-init` registry answers {@linkcode AbortKind.ScopeDisposed}.
81
+ * - Any other reason, including the platform's default, answers {@linkcode AbortKind.Caller}.
82
+ *
83
+ * A signal from `AbortSignal.any()` has the reason of the source that aborted first,
84
+ * so this reads which of a caller's signal and a deadline ended the work.
85
+ */
86
+ export function abortKindOf(signal: AbortSignal): AbortKind | null {
87
+ if (!signal.aborted) return null
88
+
89
+ const reason: unknown = signal.reason
90
+
91
+ if (reason instanceof AbortReason) return reason.kind
92
+
93
+ if (typeof reason === "object" && reason !== null) {
94
+ if ("name" in reason && reason.name === TIMEOUT_ERROR_NAME) return AbortKind.Deadline
95
+
96
+ if ("code" in reason && reason.code === DISPOSED_ERROR_CODE) return AbortKind.ScopeDisposed
97
+ }
98
+
99
+ return AbortKind.Caller
100
+ }
@@ -4,8 +4,8 @@
4
4
  /**
5
5
  * Memoized async loads built on `async-init`'s `Service`.
6
6
  *
7
- * This module sits apart from `@mailwoman/core/promises` so that the dependency-free
8
- * promise helpers keep `async-init` off every graph that imports them,
7
+ * This module sits apart from `@mailwoman/core/async/promises` so that the
8
+ * dependency-free promise helpers keep `async-init` off every graph that imports them,
9
9
  * among them the launcher path of `mailwoman --version`.
10
10
  */
11
11
 
@@ -4,7 +4,7 @@
4
4
  /**
5
5
  * Promise helpers with no runtime dependency, so a launcher graph can import them.
6
6
  *
7
- * `memoizeResettable` lives in `@mailwoman/core/memoize` because it depends on `async-init`.
7
+ * `memoizeResettable` lives in `@mailwoman/core/async/memoize` because it depends on `async-init`.
8
8
  */
9
9
 
10
10
  /**
@@ -7,7 +7,7 @@
7
7
  * API lists, and the short key a dashboard template link takes.
8
8
  */
9
9
 
10
- import { stringifyJSON } from "#json"
10
+ import { stringifyJSON } from "#values/json"
11
11
 
12
12
  const DASHBOARD = "https://dash.cloudflare.com/"
13
13
 
@@ -11,10 +11,10 @@
11
11
  import { resolvePath } from "path-ts"
12
12
 
13
13
  import { statPath } from "#fs/readers/stat"
14
- import { parseJSONStrict } from "#json"
15
14
  import { resolvePackageDirectory } from "#module/resolvers"
16
- import { isPresent } from "#objects"
17
- import { runFile } from "#process"
15
+ import { runFile } from "#scripting/process"
16
+ import { parseJSONStrict } from "#values/json"
17
+ import { isPresent } from "#values/objects"
18
18
 
19
19
  /**
20
20
  * The largest object `wrangler r2 object put` accepts.
@@ -5,7 +5,7 @@
5
5
  * SHA-256 on `crypto.subtle` and the hex rendering of a byte string: the digest
6
6
  * the license key id, the register and the license worker share.
7
7
  *
8
- * `@mailwoman/core/hash` keeps the synchronous `node:crypto` digests for files
8
+ * `@mailwoman/core/crypto/hash` keeps the synchronous `node:crypto` digests for files
9
9
  * and build scripts. this module is the one a Worker or a browser can import.
10
10
  */
11
11
 
@@ -20,6 +20,14 @@ export interface Ed25519KeyPairPEM {
20
20
 
21
21
  const ALGORITHM = { name: "Ed25519" } as const
22
22
 
23
+ /**
24
+ * The byte length of an Ed25519 signature (RFC 8032 section 5.1.6).
25
+ *
26
+ * A verifier refuses a signature of another length before it calls WebCrypto,
27
+ * as the Rust verifier's `Signature::from_slice` does.
28
+ */
29
+ export const ED25519_SIGNATURE_BYTES = 64
30
+
23
31
  /**
24
32
  * PEM wraps its base64 at this width; `node:crypto` writes the same,
25
33
  * so a key round-trips through either writer.
@@ -3,7 +3,7 @@
3
3
 
4
4
  import { createHash } from "node:crypto"
5
5
 
6
- import { isPresent } from "#objects"
6
+ import { isPresent } from "#values/objects"
7
7
 
8
8
  /**
9
9
  * A value that can be used as input to {@link simpleSHA3}.
package/lib/data-root.ts CHANGED
@@ -116,16 +116,29 @@ export function snapshotSourcePath(source: string, vintage: string, ...segments:
116
116
  }
117
117
 
118
118
  /**
119
- * The dev-weights overlay for a locale is `$MAILWOMAN_DATA_ROOT/weights/<locale>/`.
119
+ * The dev-weights overlay root, `$MAILWOMAN_WEIGHTS_OVERLAY_ROOT` when set
120
+ * and `$MAILWOMAN_DATA_ROOT/weights/` otherwise.
120
121
  *
121
- * Multiple `link-dev-weights.ts` scripts write here.
122
+ * The data root is shared by every checkout on a host, so a CI job points this variable
123
+ * at a per-job directory and keeps reading the shared databases.
124
+ */
125
+ export function weightsOverlayRootPath(): PathBuilder {
126
+ const root = $public.MAILWOMAN_WEIGHTS_OVERLAY_ROOT
127
+
128
+ return root ? PathBuilder.from(resolvePath(root)) : dataRootPath("weights")
129
+ }
130
+
131
+ /**
132
+ * The dev-weights overlay for a locale, `<overlay root>/<locale>/` (see {@link weightsOverlayRootPath}).
133
+ *
134
+ * Each `link-dev-weights.ts` script writes its own locale's directory.
122
135
  * `@mailwoman/neural` (`resolveWeights`) reads from this directory.
123
136
  *
124
137
  * It lives outside git because the data root is shared across local checkouts and never packaged.
125
138
  * Weight binaries stay outside the repository.
126
139
  */
127
140
  export function weightsOverlayPath(locale: string, ...segments: string[]) {
128
- return dataRootPath("weights", locale.toLowerCase(), ...segments)
141
+ return weightsOverlayRootPath()(locale.toLowerCase(), ...segments)
129
142
  }
130
143
 
131
144
  /**
@@ -31,7 +31,10 @@
31
31
  */
32
32
 
33
33
  import type { ComponentTag } from "@mailwoman/codex/component"
34
- import { numbersHousesInSettlements, SETTLEMENT_HOUSE_NUMBER_PARENTS } from "@mailwoman/codex/settlement-house-numbers"
34
+ import {
35
+ numbersHousesInSettlements,
36
+ SETTLEMENT_HOUSE_NUMBER_PARENTS,
37
+ } from "@mailwoman/codex/labels/house-number/settlement"
35
38
 
36
39
  import type { AddressSystem } from "#decoder/types"
37
40
 
@@ -6,13 +6,16 @@
6
6
  */
7
7
 
8
8
  import type { AddressNode, AddressTree } from "#decoder/types"
9
- import { stringifyJSON } from "#json"
9
+ import { stringifyJSON } from "#values/json"
10
10
 
11
- function outlineLines(node: AddressNode, depth: number, lines: string[]): void {
12
- lines.push(`${" ".repeat(depth)}${node.tag} [${node.start}, ${node.end}): ${stringifyJSON(node.value)}`)
11
+ function outlineLines(node: AddressNode, depth: number, lines: string[], metadata: boolean): void {
12
+ const stated =
13
+ metadata && node.metadata && Object.keys(node.metadata).length ? ` ${stringifyJSON(node.metadata)}` : ""
14
+
15
+ lines.push(`${" ".repeat(depth)}${node.tag} [${node.start}, ${node.end}): ${stringifyJSON(node.value)}${stated}`)
13
16
 
14
17
  for (const child of node.children) {
15
- outlineLines(child, depth + 1, lines)
18
+ outlineLines(child, depth + 1, lines, metadata)
16
19
  }
17
20
  }
18
21
 
@@ -25,13 +28,23 @@ function outlineLines(node: AddressNode, depth: number, lines: string[]): void {
25
28
  * region [28, 30): "NY"
26
29
  * locality [19, 27): "New York"
27
30
  * ```
31
+ *
28
32
  */
29
33
  export function decodeAsOutline(tree: AddressTree): string {
34
+ return decodeAsOutlineLines(tree).join("\n")
35
+ }
36
+
37
+ /**
38
+ * Returns the lines of {@linkcode decodeAsOutline}, one per node.
39
+ *
40
+ * With `metadata`, a node that has metadata prints it as JSON after its value.
41
+ */
42
+ export function decodeAsOutlineLines(tree: AddressTree, options: { metadata?: boolean } = {}): string[] {
30
43
  const lines: string[] = []
31
44
 
32
45
  for (const root of tree.roots) {
33
- outlineLines(root, 0, lines)
46
+ outlineLines(root, 0, lines, options.metadata ?? false)
34
47
  }
35
48
 
36
- return lines.join("\n")
49
+ return lines
37
50
  }
@@ -8,7 +8,7 @@
8
8
  import { type BIOLabel, COMPONENT_TAGS, type ComponentTag } from "@mailwoman/codex/component"
9
9
  import { z } from "zod"
10
10
 
11
- import { isRecordLike } from "#objects"
11
+ import { isRecordLike } from "#values/objects"
12
12
 
13
13
  /**
14
14
  * One token with its predicted label, confidence and offsets into the original input.
@@ -78,6 +78,14 @@ export interface AddressNode {
78
78
  * The type is `unknown` so this module doesn't import the resolver's `ResolvedPlace`.
79
79
  */
80
80
  alternatives?: ReadonlyArray<unknown>
81
+ /**
82
+ * Places the resolver weighed for this span beyond `alternatives`: the bare-toponym race and
83
+ * postcode-format probe losers, and each place a later pass replaced, with that place's runner-ups.
84
+ *
85
+ * Only the geocode result's candidate list reads it, so no ranking stage depends on its contents.
86
+ * The type is `unknown` for the reason `alternatives` gives.
87
+ */
88
+ considered?: ReadonlyArray<unknown>
81
89
  /**
82
90
  * Other tags assigned to the same span, each with its own resolved place.
83
91
  */
package/lib/env/schema.ts CHANGED
@@ -32,6 +32,11 @@ const StorageEnvSchema = object({
32
32
  title: "Temporary root",
33
33
  description: "Directory for named temporary outputs and evaluation staging.",
34
34
  }),
35
+ MAILWOMAN_WEIGHTS_OVERLAY_ROOT: blankAsAbsent(string().optional()).meta({
36
+ title: "Weights overlay root",
37
+ description:
38
+ "Directory that holds the dev weights overlay, one subdirectory per locale. Defaults to the data root's `weights/`. A CI job sets it to a per-job directory so its linkers leave the shared overlay alone.",
39
+ }),
35
40
  })
36
41
 
37
42
  // #endregion
@@ -11,8 +11,8 @@
11
11
  * 128 KiB window, so memory stays fixed whatever the member's size.
12
12
  */
13
13
 
14
+ import { memoizeResettable } from "#async/memoize"
14
15
  import { readLocalBuffer } from "#fs/readers"
15
- import { memoizeResettable } from "#memoize"
16
16
 
17
17
  /**
18
18
  * The location of the committed `wasm/deflate64.wasm`, resolved from this module.