@mailwoman/core 10.1.0 → 10.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 (429) hide show
  1. package/lib/api/APIClient.ts +5 -6
  2. package/lib/api/arcgis.ts +5 -5
  3. package/lib/api/ckan.ts +2 -1
  4. package/lib/api/disk-storage.ts +3 -3
  5. package/lib/api/ogc.ts +56 -52
  6. package/lib/api/pacer.ts +1 -1
  7. package/lib/api/retry.ts +6 -4
  8. package/lib/api/test/transport.ts +20 -20
  9. package/lib/api.ts +1 -0
  10. package/lib/coarse-placer/coarse-placer.ts +4 -3
  11. package/lib/crypto/node.ts +1 -2
  12. package/lib/decoder/build-tree.ts +5 -5
  13. package/lib/decoder/parse-diff.ts +47 -31
  14. package/lib/decoder/proposals-to-tree.ts +1 -0
  15. package/lib/decoder/serialize/json.ts +9 -6
  16. package/lib/decoder/serialize/tuples.ts +2 -1
  17. package/lib/decoder/serialize/xml.ts +15 -14
  18. package/lib/decoder/tree/shape.ts +14 -14
  19. package/lib/decoder/tree/walk.ts +2 -2
  20. package/lib/decoder/types.ts +48 -2
  21. package/lib/env/schema.ts +21 -23
  22. package/lib/env/utils.ts +4 -3
  23. package/lib/env.ts +4 -4
  24. package/lib/fs/delimited.ts +35 -1
  25. package/lib/fs/readers.ts +2 -5
  26. package/lib/fs/zip.ts +1 -1
  27. package/lib/geocode/result.ts +337 -0
  28. package/lib/git.ts +1 -1
  29. package/lib/html/document.ts +6 -6
  30. package/lib/html/elements.ts +26 -23
  31. package/lib/identical.ts +20 -0
  32. package/lib/json.ts +5 -7
  33. package/lib/layers/coverage.ts +28 -1
  34. package/lib/layers/feature-count.ts +3 -3
  35. package/lib/layers/manifest.ts +22 -21
  36. package/lib/layers/schema.ts +25 -1
  37. package/lib/license/configured.ts +3 -3
  38. package/lib/license/key/file.ts +2 -1
  39. package/lib/license/key.ts +3 -3
  40. package/lib/license/stamp.ts +4 -4
  41. package/lib/locale/locale.ts +1 -1
  42. package/lib/locale/registry.ts +2 -2
  43. package/lib/module/compiled-freshness.ts +1 -1
  44. package/lib/module/package-command.ts +4 -2
  45. package/lib/module/packaged-data.ts +1 -1
  46. package/lib/module/resolve-from.ts +1 -1
  47. package/lib/numeric.ts +4 -4
  48. package/lib/objects.ts +3 -0
  49. package/lib/paths.ts +16 -1
  50. package/lib/pipeline/client-result.ts +14 -14
  51. package/lib/pipeline/result.ts +5 -4
  52. package/lib/pipeline/runtime-pipeline.ts +65 -42
  53. package/lib/pipeline/span-proposer.ts +1 -1
  54. package/lib/pipeline/types.ts +328 -161
  55. package/lib/pipeline.ts +32 -7
  56. package/lib/policy/proposal-collection.ts +1 -1
  57. package/lib/policy/registry.ts +5 -3
  58. package/lib/resolver/authoritative-provider.ts +17 -17
  59. package/lib/resolver/coverage-facts.ts +3 -3
  60. package/lib/resolver/fixture-authoritative-provider.ts +4 -0
  61. package/lib/resolver/lookup-types.ts +54 -14
  62. package/lib/resolver/postcode-format.ts +9 -9
  63. package/lib/resolver/referential.ts +2 -2
  64. package/lib/resolver/types.ts +155 -51
  65. package/lib/resolver.ts +22 -20
  66. package/lib/resources/git.ts +1 -1
  67. package/lib/resources/languages.ts +0 -2
  68. package/lib/resources/libpostal.ts +1 -1
  69. package/lib/resources/whosonfirst/PlacetypeDataSource.ts +2 -6
  70. package/lib/resources/whosonfirst/extract-repo.ts +2 -1
  71. package/lib/resources/whosonfirst/placetypes/admin.ts +20 -25
  72. package/lib/resources/whosonfirst/placetypes/mermaid.ts +4 -3
  73. package/lib/resources/whosonfirst/placetypes/specificity.ts +7 -7
  74. package/lib/resources.ts +1 -0
  75. package/lib/scripting/arguments.ts +6 -5
  76. package/lib/scripting/command.ts +3 -2
  77. package/lib/scripting/operation.ts +2 -2
  78. package/lib/scripting/utils.ts +3 -5
  79. package/lib/strings/python-json.ts +1 -1
  80. package/lib/tokenization/Span.ts +1 -1
  81. package/lib/trust-policies.ts +0 -2
  82. package/lib/types/Classification.ts +1 -1
  83. package/lib/types/classifier.ts +1 -1
  84. package/lib/utils/geodatabase-archive.ts +13 -5
  85. package/lib/utils/sqlite-rows.ts +3 -3
  86. package/lib/utils/stream-to-disk.ts +1 -3
  87. package/lib/utils/union-find.ts +1 -1
  88. package/lib/vale.ts +1 -1
  89. package/lib/workspaces.ts +2 -2
  90. package/out/api/APIClient.d.ts +3 -3
  91. package/out/api/APIClient.d.ts.map +1 -1
  92. package/out/api/APIClient.js +2 -3
  93. package/out/api/APIClient.js.map +1 -1
  94. package/out/api/arcgis.d.ts +2 -2
  95. package/out/api/arcgis.d.ts.map +1 -1
  96. package/out/api/arcgis.js +6 -6
  97. package/out/api/arcgis.js.map +1 -1
  98. package/out/api/ckan.d.ts +2 -1
  99. package/out/api/ckan.d.ts.map +1 -1
  100. package/out/api/ckan.js.map +1 -1
  101. package/out/api/disk-storage.d.ts +1 -1
  102. package/out/api/disk-storage.js +2 -2
  103. package/out/api/disk-storage.js.map +1 -1
  104. package/out/api/ogc.d.ts +32 -27
  105. package/out/api/ogc.d.ts.map +1 -1
  106. package/out/api/ogc.js +41 -46
  107. package/out/api/ogc.js.map +1 -1
  108. package/out/api/pacer.d.ts +1 -1
  109. package/out/api/pacer.js +1 -1
  110. package/out/api/retry.d.ts +6 -4
  111. package/out/api/retry.d.ts.map +1 -1
  112. package/out/api/retry.js +1 -1
  113. package/out/api/retry.js.map +1 -1
  114. package/out/api/test/transport.d.ts +11 -11
  115. package/out/api/test/transport.d.ts.map +1 -1
  116. package/out/api/test/transport.js +16 -16
  117. package/out/api/test/transport.js.map +1 -1
  118. package/out/api.d.ts +1 -0
  119. package/out/api.d.ts.map +1 -1
  120. package/out/api.js +1 -0
  121. package/out/api.js.map +1 -1
  122. package/out/coarse-placer/coarse-placer.d.ts +3 -2
  123. package/out/coarse-placer/coarse-placer.d.ts.map +1 -1
  124. package/out/coarse-placer/coarse-placer.js +1 -1
  125. package/out/coarse-placer/coarse-placer.js.map +1 -1
  126. package/out/crypto/node.d.ts +1 -2
  127. package/out/crypto/node.d.ts.map +1 -1
  128. package/out/crypto/node.js +1 -2
  129. package/out/crypto/node.js.map +1 -1
  130. package/out/decoder/build-tree.js +5 -5
  131. package/out/decoder/build-tree.js.map +1 -1
  132. package/out/decoder/parse-diff.d.ts +19 -19
  133. package/out/decoder/parse-diff.d.ts.map +1 -1
  134. package/out/decoder/parse-diff.js +28 -12
  135. package/out/decoder/parse-diff.js.map +1 -1
  136. package/out/decoder/proposals-to-tree.d.ts.map +1 -1
  137. package/out/decoder/proposals-to-tree.js +1 -0
  138. package/out/decoder/proposals-to-tree.js.map +1 -1
  139. package/out/decoder/serialize/json.d.ts +35 -17
  140. package/out/decoder/serialize/json.d.ts.map +1 -1
  141. package/out/decoder/serialize/json.js +28 -0
  142. package/out/decoder/serialize/json.js.map +1 -1
  143. package/out/decoder/serialize/tuples.d.ts +2 -1
  144. package/out/decoder/serialize/tuples.d.ts.map +1 -1
  145. package/out/decoder/serialize/tuples.js.map +1 -1
  146. package/out/decoder/serialize/xml.d.ts +12 -11
  147. package/out/decoder/serialize/xml.d.ts.map +1 -1
  148. package/out/decoder/serialize/xml.js +3 -3
  149. package/out/decoder/serialize/xml.js.map +1 -1
  150. package/out/decoder/tree/shape.d.ts +6 -6
  151. package/out/decoder/tree/shape.d.ts.map +1 -1
  152. package/out/decoder/tree/shape.js +8 -8
  153. package/out/decoder/tree/shape.js.map +1 -1
  154. package/out/decoder/tree/walk.d.ts +1 -1
  155. package/out/decoder/tree/walk.d.ts.map +1 -1
  156. package/out/decoder/tree/walk.js +1 -1
  157. package/out/decoder/tree/walk.js.map +1 -1
  158. package/out/decoder/types.d.ts +55 -2
  159. package/out/decoder/types.d.ts.map +1 -1
  160. package/out/decoder/types.js +39 -1
  161. package/out/decoder/types.js.map +1 -1
  162. package/out/env/schema.d.ts +11 -12
  163. package/out/env/schema.d.ts.map +1 -1
  164. package/out/env/schema.js +15 -17
  165. package/out/env/schema.js.map +1 -1
  166. package/out/env/utils.d.ts +2 -2
  167. package/out/env/utils.d.ts.map +1 -1
  168. package/out/env/utils.js +2 -2
  169. package/out/env/utils.js.map +1 -1
  170. package/out/env.js +4 -4
  171. package/out/env.js.map +1 -1
  172. package/out/fs/delimited.d.ts +18 -0
  173. package/out/fs/delimited.d.ts.map +1 -1
  174. package/out/fs/delimited.js +31 -1
  175. package/out/fs/delimited.js.map +1 -1
  176. package/out/fs/readers.d.ts +2 -4
  177. package/out/fs/readers.d.ts.map +1 -1
  178. package/out/fs/readers.js +2 -4
  179. package/out/fs/readers.js.map +1 -1
  180. package/out/fs/zip.js +1 -1
  181. package/out/fs/zip.js.map +1 -1
  182. package/out/geocode/result.d.ts +475 -0
  183. package/out/geocode/result.d.ts.map +1 -0
  184. package/out/geocode/result.js +280 -0
  185. package/out/geocode/result.js.map +1 -0
  186. package/out/git.js +1 -1
  187. package/out/git.js.map +1 -1
  188. package/out/html/document.d.ts +3 -3
  189. package/out/html/document.d.ts.map +1 -1
  190. package/out/html/document.js +4 -4
  191. package/out/html/document.js.map +1 -1
  192. package/out/html/elements.d.ts +18 -15
  193. package/out/html/elements.d.ts.map +1 -1
  194. package/out/html/elements.js +17 -16
  195. package/out/html/elements.js.map +1 -1
  196. package/out/identical.d.ts +16 -0
  197. package/out/identical.d.ts.map +1 -0
  198. package/out/identical.js +19 -0
  199. package/out/identical.js.map +1 -0
  200. package/out/json.d.ts +3 -5
  201. package/out/json.d.ts.map +1 -1
  202. package/out/json.js +3 -5
  203. package/out/json.js.map +1 -1
  204. package/out/layers/coverage.d.ts +26 -1
  205. package/out/layers/coverage.d.ts.map +1 -1
  206. package/out/layers/coverage.js.map +1 -1
  207. package/out/layers/feature-count.d.ts +1 -1
  208. package/out/layers/feature-count.d.ts.map +1 -1
  209. package/out/layers/feature-count.js +2 -2
  210. package/out/layers/feature-count.js.map +1 -1
  211. package/out/layers/manifest.d.ts +11 -10
  212. package/out/layers/manifest.d.ts.map +1 -1
  213. package/out/layers/manifest.js +12 -13
  214. package/out/layers/manifest.js.map +1 -1
  215. package/out/layers/schema.d.ts +23 -0
  216. package/out/layers/schema.d.ts.map +1 -1
  217. package/out/layers/schema.js +1 -1
  218. package/out/layers/schema.js.map +1 -1
  219. package/out/license/configured.d.ts +1 -1
  220. package/out/license/configured.d.ts.map +1 -1
  221. package/out/license/configured.js +2 -2
  222. package/out/license/configured.js.map +1 -1
  223. package/out/license/key/file.d.ts.map +1 -1
  224. package/out/license/key/file.js +2 -1
  225. package/out/license/key/file.js.map +1 -1
  226. package/out/license/key.d.ts +1 -1
  227. package/out/license/key.d.ts.map +1 -1
  228. package/out/license/key.js +2 -2
  229. package/out/license/key.js.map +1 -1
  230. package/out/license/stamp.d.ts +2 -2
  231. package/out/license/stamp.d.ts.map +1 -1
  232. package/out/license/stamp.js +2 -2
  233. package/out/license/stamp.js.map +1 -1
  234. package/out/locale/locale.d.ts +1 -1
  235. package/out/locale/locale.d.ts.map +1 -1
  236. package/out/locale/registry.d.ts +1 -1
  237. package/out/locale/registry.d.ts.map +1 -1
  238. package/out/locale/registry.js +1 -1
  239. package/out/locale/registry.js.map +1 -1
  240. package/out/module/compiled-freshness.js +1 -1
  241. package/out/module/compiled-freshness.js.map +1 -1
  242. package/out/module/package-command.d.ts +3 -2
  243. package/out/module/package-command.d.ts.map +1 -1
  244. package/out/module/package-command.js +3 -2
  245. package/out/module/package-command.js.map +1 -1
  246. package/out/module/packaged-data.js +1 -1
  247. package/out/module/packaged-data.js.map +1 -1
  248. package/out/module/resolve-from.js +1 -1
  249. package/out/module/resolve-from.js.map +1 -1
  250. package/out/numeric.d.ts +1 -1
  251. package/out/numeric.d.ts.map +1 -1
  252. package/out/numeric.js +3 -3
  253. package/out/numeric.js.map +1 -1
  254. package/out/objects.d.ts +3 -0
  255. package/out/objects.d.ts.map +1 -1
  256. package/out/objects.js +3 -0
  257. package/out/objects.js.map +1 -1
  258. package/out/paths.d.ts +20 -1
  259. package/out/paths.d.ts.map +1 -1
  260. package/out/paths.js +1 -1
  261. package/out/paths.js.map +1 -1
  262. package/out/pipeline/client-result.d.ts +15 -15
  263. package/out/pipeline/client-result.d.ts.map +1 -1
  264. package/out/pipeline/client-result.js +1 -1
  265. package/out/pipeline/result.d.ts +4 -3
  266. package/out/pipeline/result.d.ts.map +1 -1
  267. package/out/pipeline/runtime-pipeline.d.ts +16 -9
  268. package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
  269. package/out/pipeline/runtime-pipeline.js +43 -27
  270. package/out/pipeline/runtime-pipeline.js.map +1 -1
  271. package/out/pipeline/span-proposer.js +1 -1
  272. package/out/pipeline/span-proposer.js.map +1 -1
  273. package/out/pipeline/types.d.ts +394 -175
  274. package/out/pipeline/types.d.ts.map +1 -1
  275. package/out/pipeline/types.js +199 -4
  276. package/out/pipeline/types.js.map +1 -1
  277. package/out/pipeline.d.ts +4 -2
  278. package/out/pipeline.d.ts.map +1 -1
  279. package/out/pipeline.js +1 -1
  280. package/out/pipeline.js.map +1 -1
  281. package/out/policy/proposal-collection.d.ts +1 -1
  282. package/out/policy/proposal-collection.d.ts.map +1 -1
  283. package/out/policy/proposal-collection.js.map +1 -1
  284. package/out/policy/registry.d.ts +3 -1
  285. package/out/policy/registry.d.ts.map +1 -1
  286. package/out/policy/registry.js +4 -2
  287. package/out/policy/registry.js.map +1 -1
  288. package/out/resolver/authoritative-provider.d.ts +17 -17
  289. package/out/resolver/authoritative-provider.d.ts.map +1 -1
  290. package/out/resolver/authoritative-provider.js +2 -2
  291. package/out/resolver/coverage-facts.d.ts +3 -3
  292. package/out/resolver/coverage-facts.d.ts.map +1 -1
  293. package/out/resolver/fixture-authoritative-provider.d.ts.map +1 -1
  294. package/out/resolver/fixture-authoritative-provider.js +4 -0
  295. package/out/resolver/fixture-authoritative-provider.js.map +1 -1
  296. package/out/resolver/lookup-types.d.ts +52 -15
  297. package/out/resolver/lookup-types.d.ts.map +1 -1
  298. package/out/resolver/postcode-format.d.ts +3 -3
  299. package/out/resolver/postcode-format.d.ts.map +1 -1
  300. package/out/resolver/postcode-format.js +7 -7
  301. package/out/resolver/postcode-format.js.map +1 -1
  302. package/out/resolver/referential.d.ts +2 -2
  303. package/out/resolver/referential.d.ts.map +1 -1
  304. package/out/resolver/types.d.ts +126 -40
  305. package/out/resolver/types.d.ts.map +1 -1
  306. package/out/resolver/types.js +43 -1
  307. package/out/resolver/types.js.map +1 -1
  308. package/out/resolver.d.ts +5 -3
  309. package/out/resolver.d.ts.map +1 -1
  310. package/out/resolver.js +2 -2
  311. package/out/resolver.js.map +1 -1
  312. package/out/resources/git.js +1 -1
  313. package/out/resources/git.js.map +1 -1
  314. package/out/resources/languages.d.ts +0 -1
  315. package/out/resources/languages.d.ts.map +1 -1
  316. package/out/resources/languages.js +0 -1
  317. package/out/resources/languages.js.map +1 -1
  318. package/out/resources/libpostal.d.ts +1 -1
  319. package/out/resources/libpostal.d.ts.map +1 -1
  320. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts +1 -1
  321. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts.map +1 -1
  322. package/out/resources/whosonfirst/PlacetypeDataSource.js +2 -1
  323. package/out/resources/whosonfirst/PlacetypeDataSource.js.map +1 -1
  324. package/out/resources/whosonfirst/extract-repo.d.ts.map +1 -1
  325. package/out/resources/whosonfirst/extract-repo.js +2 -1
  326. package/out/resources/whosonfirst/extract-repo.js.map +1 -1
  327. package/out/resources/whosonfirst/placetypes/admin.d.ts +12 -12
  328. package/out/resources/whosonfirst/placetypes/admin.d.ts.map +1 -1
  329. package/out/resources/whosonfirst/placetypes/admin.js +9 -8
  330. package/out/resources/whosonfirst/placetypes/admin.js.map +1 -1
  331. package/out/resources/whosonfirst/placetypes/mermaid.d.ts +2 -1
  332. package/out/resources/whosonfirst/placetypes/mermaid.d.ts.map +1 -1
  333. package/out/resources/whosonfirst/placetypes/mermaid.js +1 -1
  334. package/out/resources/whosonfirst/placetypes/mermaid.js.map +1 -1
  335. package/out/resources/whosonfirst/placetypes/specificity.d.ts +3 -3
  336. package/out/resources/whosonfirst/placetypes/specificity.d.ts.map +1 -1
  337. package/out/resources/whosonfirst/placetypes/specificity.js +6 -6
  338. package/out/resources/whosonfirst/placetypes/specificity.js.map +1 -1
  339. package/out/resources.d.ts +1 -0
  340. package/out/resources.d.ts.map +1 -1
  341. package/out/resources.js +1 -0
  342. package/out/resources.js.map +1 -1
  343. package/out/scripting/arguments.d.ts +5 -4
  344. package/out/scripting/arguments.d.ts.map +1 -1
  345. package/out/scripting/arguments.js +5 -4
  346. package/out/scripting/arguments.js.map +1 -1
  347. package/out/scripting/command.d.ts +2 -2
  348. package/out/scripting/command.d.ts.map +1 -1
  349. package/out/scripting/command.js +1 -0
  350. package/out/scripting/command.js.map +1 -1
  351. package/out/scripting/operation.d.ts +1 -1
  352. package/out/scripting/operation.d.ts.map +1 -1
  353. package/out/scripting/operation.js +1 -1
  354. package/out/scripting/operation.js.map +1 -1
  355. package/out/scripting/utils.d.ts +3 -4
  356. package/out/scripting/utils.d.ts.map +1 -1
  357. package/out/scripting/utils.js +3 -4
  358. package/out/scripting/utils.js.map +1 -1
  359. package/out/strings/python-json.js +1 -1
  360. package/out/strings/python-json.js.map +1 -1
  361. package/out/tokenization/Span.d.ts +1 -1
  362. package/out/tokenization/Span.d.ts.map +1 -1
  363. package/out/tools/coarse-placer/build/dataset.d.ts +4 -2
  364. package/out/tools/coarse-placer/build/dataset.d.ts.map +1 -1
  365. package/out/tools/coarse-placer/build/dataset.js.map +1 -1
  366. package/out/tools/coarse-placer/build/outlier/exposure.d.ts +5 -3
  367. package/out/tools/coarse-placer/build/outlier/exposure.d.ts.map +1 -1
  368. package/out/tools/coarse-placer/build/outlier/exposure.js.map +1 -1
  369. package/out/tools/coarse-placer/build/outlier/latin.d.ts +3 -3
  370. package/out/tools/coarse-placer/build/outlier/oa.d.ts +3 -3
  371. package/out/tools/coarse-placer/eval/latin-offmap.d.ts +3 -3
  372. package/out/tools/coarse-placer/eval/openset.js +2 -2
  373. package/out/tools/coarse-placer/eval/openset.js.map +1 -1
  374. package/out/tools/coarse-placer/eval/quant-compare.d.ts +4 -4
  375. package/out/tools/coarse-placer/eval.d.ts +3 -3
  376. package/out/tools/coarse-placer/paths.js +1 -1
  377. package/out/tools/coarse-placer/paths.js.map +1 -1
  378. package/out/tools/coarse-placer/probe-frontier.d.ts +2 -2
  379. package/out/tools/coarse-placer/quantize.d.ts +2 -2
  380. package/out/tools/coarse-placer/train.d.ts +5 -5
  381. package/out/tools/download/libpostal-resources.d.ts.map +1 -1
  382. package/out/tools/download/libpostal-resources.js +2 -1
  383. package/out/tools/download/libpostal-resources.js.map +1 -1
  384. package/out/tools/download/ssl-address.d.ts +2 -2
  385. package/out/tools/generate-language-types.d.ts +1 -1
  386. package/out/tools/generate-language-types.js +1 -1
  387. package/out/tools/generate-language-types.js.map +1 -1
  388. package/out/trust-policies.d.ts +0 -1
  389. package/out/trust-policies.d.ts.map +1 -1
  390. package/out/trust-policies.js +0 -1
  391. package/out/trust-policies.js.map +1 -1
  392. package/out/types/Classification.d.ts +1 -1
  393. package/out/types/Classification.d.ts.map +1 -1
  394. package/out/types/classifier.d.ts +1 -1
  395. package/out/types/classifier.d.ts.map +1 -1
  396. package/out/utils/geodatabase-archive.d.ts +11 -4
  397. package/out/utils/geodatabase-archive.d.ts.map +1 -1
  398. package/out/utils/geodatabase-archive.js +1 -1
  399. package/out/utils/geodatabase-archive.js.map +1 -1
  400. package/out/utils/sqlite-rows.d.ts +2 -2
  401. package/out/utils/sqlite-rows.d.ts.map +1 -1
  402. package/out/utils/sqlite-rows.js +2 -2
  403. package/out/utils/sqlite-rows.js.map +1 -1
  404. package/out/utils/stream-to-disk.d.ts.map +1 -1
  405. package/out/utils/stream-to-disk.js +1 -1
  406. package/out/utils/stream-to-disk.js.map +1 -1
  407. package/out/utils/union-find.js +1 -1
  408. package/out/utils/union-find.js.map +1 -1
  409. package/out/vale.js +1 -1
  410. package/out/vale.js.map +1 -1
  411. package/out/workspaces.d.ts +1 -1
  412. package/out/workspaces.js +1 -1
  413. package/out/workspaces.js.map +1 -1
  414. package/package.json +46 -14
  415. package/tools/coarse-placer/build/dataset.ts +4 -2
  416. package/tools/coarse-placer/build/outlier/exposure.ts +5 -3
  417. package/tools/coarse-placer/build/outlier/latin.ts +3 -3
  418. package/tools/coarse-placer/build/outlier/oa.ts +3 -3
  419. package/tools/coarse-placer/eval/latin-offmap.ts +3 -3
  420. package/tools/coarse-placer/eval/openset.ts +3 -3
  421. package/tools/coarse-placer/eval/quant-compare.ts +4 -4
  422. package/tools/coarse-placer/eval.ts +3 -3
  423. package/tools/coarse-placer/paths.ts +1 -1
  424. package/tools/coarse-placer/probe-frontier.ts +2 -2
  425. package/tools/coarse-placer/quantize.ts +2 -2
  426. package/tools/coarse-placer/train.ts +5 -5
  427. package/tools/download/libpostal-resources.ts +2 -1
  428. package/tools/download/ssl-address.ts +2 -2
  429. package/tools/generate-language-types.ts +3 -3
@@ -6,14 +6,14 @@
6
6
  * Declares the types for the runtime pipeline and its injected stages.
7
7
  */
8
8
 
9
- import type { AddressTree } from "#decoder/types"
9
+ import type { NormalizedInputLite } from "@mailwoman/query-shape"
10
+ import { z } from "zod"
11
+
12
+ import { type AddressTree, AddressTreeSchema } from "#decoder/types"
10
13
  import type { MachinePreferences } from "#pipeline/preferences"
11
14
  import type { ResolveOpts, Resolver, ResolverBackend } from "#resolver/types"
12
15
  import type { Section } from "#types/classifier"
13
16
 
14
- export { type PipelineFault, type PipelineResult } from "#pipeline/result"
15
- export { type MachinePreferences } from "#pipeline/preferences"
16
-
17
17
  /**
18
18
  * The user's location.
19
19
  * The resolver may use it for scoring.
@@ -21,9 +21,112 @@ export { type MachinePreferences } from "#pipeline/preferences"
21
21
  export type UserLocation = { lat: number; lon: number } | { country: string } | { region: string; country: string }
22
22
 
23
23
  /**
24
- * A placetype-pair prior that core passes to the classifier without inspecting it.
24
+ * The placetype-pair prior for one parse.
25
+ *
26
+ * - `"inherit"` uses the classifier's configured prior, if it has one.
27
+ * - `"off"` disables the prior for the parse.
28
+ * - A prior object replaces the configured one.
29
+ * Core passes it to the classifier without inspecting it.
30
+ */
31
+ export type PlacetypePairSelection<Prior extends object = object> = "inherit" | "off" | Prior
32
+
33
+ /**
34
+ * How the classifier treats letter case before inference.
35
+ *
36
+ * - `"title-case"` title-cases detected all-caps ASCII input.
37
+ * Mixed-case input is unchanged.
38
+ * - `"preserve"` passes the raw case to the model.
39
+ */
40
+ export type CaseNormalization = "title-case" | "preserve"
41
+
42
+ /**
43
+ * How a caller sources an optional stage.
44
+ *
45
+ * - `"auto"` loads the bundled default, usually on the first parse.
46
+ * - `"none"` disables the stage.
47
+ * - Any other value is the stage itself.
48
+ */
49
+ export type StageSource<T extends object> = "auto" | "none" | T
50
+
51
+ /**
52
+ * How the pipeline uses the coarse placer's country guess.
53
+ *
54
+ * - `"filter"` turns a confident guess for a country in the hard-country safelist
55
+ * into a hard country filter, and keeps the soft prior otherwise.
56
+ * - `"prior"` only adds the guess as a soft country prior.
57
+ */
58
+ export type PlacerCountryUse = "filter" | "prior"
59
+
60
+ /**
61
+ * The placer-country use every parse and geocode applies unless a caller chooses otherwise.
25
62
  */
26
- export type PlacetypePairPassthrough = object | false
63
+ export const DEFAULT_PLACER_COUNTRY_USE = "filter" satisfies PlacerCountryUse
64
+
65
+ /**
66
+ * The case normalization every parse uses unless a caller chooses otherwise.
67
+ */
68
+ export const DEFAULT_CASE_NORMALIZATION = "title-case" satisfies CaseNormalization
69
+
70
+ /**
71
+ * Every {@link CaseNormalization} value, for flag choices and validation.
72
+ */
73
+ export const CASE_NORMALIZATIONS = ["title-case", "preserve"] as const satisfies readonly CaseNormalization[]
74
+
75
+ /**
76
+ * Reads a flag value as a {@link CaseNormalization}, falling back to
77
+ * {@link DEFAULT_CASE_NORMALIZATION} when unset and throwing on anything else.
78
+ */
79
+ export function caseNormalizationOf(value: string | undefined): CaseNormalization {
80
+ if (!value) return DEFAULT_CASE_NORMALIZATION
81
+
82
+ if (!(CASE_NORMALIZATIONS as readonly string[]).includes(value)) {
83
+ throw new Error(`unknown case normalization "${value}"; expected one of ${CASE_NORMALIZATIONS.join(", ")}`)
84
+ }
85
+
86
+ return value as CaseNormalization
87
+ }
88
+
89
+ /**
90
+ * Limits which words the word-consistency repair relabels.
91
+ *
92
+ * An empty object relabels every word whose pieces disagree on entity type.
93
+ */
94
+ export interface WordConsistencyOpts {
95
+ /**
96
+ * Leaves a word unchanged when the winning type's mean probability across its
97
+ * pieces falls below this floor; `0` or unset never skips.
98
+ *
99
+ * A low-confidence vote marks rows where per-piece confidence is unreliable.
100
+ * A relabelled row would amplify noise.
101
+ */
102
+ minMeanConfidence?: number
103
+
104
+ /**
105
+ * Leaves any word containing a byte-fallback piece (`<0xNN>`) unchanged.
106
+ *
107
+ * Its surviving pieces are not trustworthy voters.
108
+ *
109
+ * @defaultValue `false`
110
+ */
111
+ skipByteFallbackWords?: boolean
112
+
113
+ /**
114
+ * Treats a punctuation-only piece as a word separator, like whitespace.
115
+ *
116
+ * Otherwise a continuation piece such as the `,` in `Ave,` joins the word.
117
+ * Its `O` label can outvote a real span.
118
+ *
119
+ * The halves of a slash compound such as `12/345` can also vote independently.
120
+ *
121
+ * @defaultValue `false`
122
+ */
123
+ splitOnPunctuation?: boolean
124
+ }
125
+
126
+ /**
127
+ * The word-consistency repair setting: `"off"`, or the options of the vote to run.
128
+ */
129
+ export type WordConsistencySetting = "off" | WordConsistencyOpts
27
130
 
28
131
  /**
29
132
  * Per-call options for the runtime pipeline.
@@ -33,9 +136,9 @@ export interface PipelineOpts {
33
136
  userLocation?: UserLocation
34
137
  /**
35
138
  * The input register.
36
- * When unset, the pipeline derives it from the query kind.
139
+ * The default `"auto"` derives it from the query kind.
37
140
  */
38
- inputMode?: InputMode
141
+ inputMode?: InputModeSelection
39
142
  /**
40
143
  * Disables the postcode and locality fast paths.
41
144
  * POI routing still applies.
@@ -47,19 +150,23 @@ export interface PipelineOpts {
47
150
  */
48
151
  resolveOpts?: ResolveOpts
49
152
  /**
50
- * Normalizes all-caps ASCII input before classification.
51
- * Pass `false` to keep the raw case.
153
+ * How the classifier treats letter case.
154
+ *
155
+ * @defaultValue {@linkcode DEFAULT_CASE_NORMALIZATION}
52
156
  */
53
- normalizeCase?: boolean
157
+ caseNormalization?: CaseNormalization
54
158
  /**
55
- * A per-parse placetype-pair prior for the classifier.
56
- * An unset value disables the prior.
159
+ * The placetype-pair prior for this parse.
160
+ *
161
+ * The default `"inherit"` uses the classifier's configured prior.
57
162
  */
58
- placetypePair?: PlacetypePairPassthrough
163
+ placetypePair?: PlacetypePairSelection
59
164
  /**
60
- * Allows a confident placer result for a safelisted country to become a hard country filter.
165
+ * How the coarse placer's country guess constrains resolution.
166
+ *
167
+ * @defaultValue {@linkcode DEFAULT_PLACER_COUNTRY_USE}
61
168
  */
62
- hardPlaceCountry?: boolean
169
+ placerCountryUse?: PlacerCountryUse
63
170
  /**
64
171
  * Replaces the artifact's hard-country safelist.
65
172
  */
@@ -67,15 +174,6 @@ export interface PipelineOpts {
67
174
  signal?: AbortSignal
68
175
  }
69
176
 
70
- /**
71
- * The fields of a normalized input that the pipeline reads.
72
- */
73
- export interface NormalizedInputLite {
74
- raw: string
75
- normalized: string
76
- appliedLocale?: string
77
- }
78
-
79
177
  /**
80
178
  * The fields of a query shape that the pipeline reads.
81
179
  */
@@ -85,22 +183,22 @@ export interface QueryShapeLite {
85
183
  span: { start: number; end: number }
86
184
  confidence: number
87
185
  }>
88
- segments?: ReadonlyArray<{ body: string; index: number }>
89
- characterClass?: string
186
+ segments: ReadonlyArray<{ body: string; index: number; span: { start: number; end: number } | null }> | null
187
+ characterClass: string | null
90
188
  /**
91
189
  * ISO 15924 scripts ranked by share of script-bearing characters.
92
190
  */
93
- scripts?: ReadonlyArray<{ script: string; share: number }>
191
+ scripts: ReadonlyArray<{ script: string; share: number }> | null
94
192
  /**
95
193
  * The class and script of each token.
96
194
  */
97
- tokenClasses?: ReadonlyArray<{
195
+ tokenClasses: ReadonlyArray<{
98
196
  span: { start: number; end: number; body: string }
99
197
  class: string
100
198
  length: number
101
- script?: string
102
- }>
103
- totalLength?: number
199
+ script: string | null
200
+ }> | null
201
+ totalLength: number | null
104
202
  }
105
203
 
106
204
  /**
@@ -117,48 +215,48 @@ export interface LocaleHint {
117
215
  * The array is empty when the input has no script-bearing text.
118
216
  * `locale` stays a BCP-47 language tag.
119
217
  */
120
- script?: ReadonlyArray<{ script: string; confidence: number }>
218
+ script: ReadonlyArray<{ script: string; confidence: number }>
121
219
  /**
122
- * Diagnostic values that fed the inferred preferences.
220
+ * Diagnostic values that fed the inferred preferences, or null when none did.
123
221
  * Locale and time zone are independent signals.
124
222
  */
125
- evidence?: {
126
- intlLocale?: string
127
- timeZone?: string
128
- environmentLocale?: Intl.UnicodeBCP47LocaleIdentifier
129
- }
223
+ evidence: {
224
+ intlLocale: string | null
225
+ timeZone: string | null
226
+ environmentLocale: Intl.UnicodeBCP47LocaleIdentifier | null
227
+ } | null
130
228
  }
131
229
 
132
230
  /**
133
231
  * The query kinds the kind classifier emits.
134
232
  *
135
- * The last four kinds describe the requested operation instead of the input's structure.
233
+ * The last four kinds describe the requested operation instead of the input's structure:
234
+ *
235
+ * - `bare_toponym`: a bare place name with no address components.
236
+ * Resolution uses it to report ambiguity.
237
+ * - `route_pair`: two place names with no address grammar between them.
238
+ * The pipeline reports both readings and does no routing.
239
+ * - `near_me`: a relative location query that needs the caller's position.
240
+ * - `poi_category`: a POI category query with no search anchor.
136
241
  */
137
- export type QueryKind =
138
- | "postcode_only"
139
- | "locality_only"
140
- | "structured_address"
141
- | "intersection"
142
- | "po_box"
143
- | "landmark"
144
- | "poi_query"
145
- | "vague"
146
- /**
147
- * A bare place name with no address components. Resolution uses it to report ambiguity.
148
- */
149
- | "bare_toponym"
150
- /**
151
- * Two place names with no address grammar between them. The pipeline reports both readings and does no routing.
152
- */
153
- | "route_pair"
154
- /**
155
- * A relative location query that needs the caller's position.
156
- */
157
- | "near_me"
158
- /**
159
- * A POI category query with no search anchor.
160
- */
161
- | "poi_category"
242
+ export const QueryKindSchema = z
243
+ .enum([
244
+ "postcode_only",
245
+ "locality_only",
246
+ "structured_address",
247
+ "intersection",
248
+ "po_box",
249
+ "landmark",
250
+ "poi_query",
251
+ "vague",
252
+ "bare_toponym",
253
+ "route_pair",
254
+ "near_me",
255
+ "poi_category",
256
+ ])
257
+ .meta({ id: "QueryKind", description: "The query kind the kind classifier assigned." })
258
+
259
+ export type QueryKind = z.infer<typeof QueryKindSchema>
162
260
 
163
261
  /**
164
262
  * Advisory codes that report how a query was interpreted or what evidence is missing.
@@ -195,36 +293,47 @@ export const QueryIntentCode = {
195
293
  DeclaredCoarserAnswer: "declared_coarser_answer",
196
294
  } as const
197
295
 
296
+ /**
297
+ * {@link QueryIntentCode} as a schema.
298
+ */
299
+ export const QueryIntentCodeSchema = z.enum(QueryIntentCode).meta({ id: "QueryIntentCode" })
300
+
198
301
  /**
199
302
  * One of the {@link QueryIntentCode} values.
200
303
  */
201
- export type QueryIntentCode = (typeof QueryIntentCode)[keyof typeof QueryIntentCode]
304
+ export type QueryIntentCode = z.infer<typeof QueryIntentCodeSchema>
202
305
 
203
306
  /**
204
307
  * An advisory from query-intent logic.
205
308
  * It leaves the selected answer unchanged.
206
309
  */
207
- export interface QueryIntentMarker {
208
- /**
209
- * The query kind that produced the marker.
210
- * It must appear in the classifier result.
211
- */
212
- kind: QueryKind
213
- code: QueryIntentCode
214
- /**
215
- * A `family:rule` identifier for the producer.
216
- */
217
- mechanism: string
218
- /**
219
- * Human-readable text.
220
- * Branch on `code`, which is stable.
221
- */
222
- message: string
223
- /**
224
- * Measurements from supporting sources, when available.
225
- */
226
- evidence?: Record<string, unknown>
227
- }
310
+ export const QueryIntentMarkerSchema = z
311
+ .object({
312
+ /**
313
+ * The query kind that produced the marker.
314
+ * It must appear in the classifier result.
315
+ */
316
+ kind: QueryKindSchema,
317
+ code: QueryIntentCodeSchema,
318
+ /**
319
+ * A `family:rule` identifier for the producer.
320
+ */
321
+ mechanism: z.string(),
322
+ /**
323
+ * Human-readable text.
324
+ * Branch on `code`, which is stable.
325
+ */
326
+ message: z.string(),
327
+ /**
328
+ * Measurements from supporting sources, when available.
329
+ *
330
+ * Each `code` has its own measurement, so the record stays open.
331
+ */
332
+ evidence: z.record(z.string(), z.unknown()).nullable(),
333
+ })
334
+ .meta({ id: "QueryIntentMarker", description: "A query-intent advisory; it never changes the answer." })
335
+
336
+ export type QueryIntentMarker = z.infer<typeof QueryIntentMarkerSchema>
228
337
 
229
338
  /**
230
339
  * The kind classifier's result.
@@ -236,22 +345,38 @@ export interface QueryKindResult {
236
345
  /**
237
346
  * Advisories raised during kind classification.
238
347
  */
239
- intentMarkers?: ReadonlyArray<QueryIntentMarker>
348
+ intentMarkers: ReadonlyArray<QueryIntentMarker> | null
240
349
  }
241
350
 
242
351
  /**
243
352
  * The parse register.
244
353
  *
245
354
  * `fragmented` suits search input and `formatted` suits complete postal records.
246
- *
247
- * When unset, {@link deriveInputMode} derives it from the query kind.
248
355
  */
249
- export type InputMode = "fragmented" | "formatted"
356
+ export const InputModeSchema = z
357
+ .enum(["fragmented", "formatted"])
358
+ .meta({ id: "InputMode", description: "The parse register." })
359
+
360
+ export type InputMode = z.infer<typeof InputModeSchema>
361
+
362
+ /**
363
+ * A parse register, or `"auto"` to let {@link deriveInputMode} derive it from the query kind.
364
+ */
365
+ export const InputModeSelectionSchema = z
366
+ .enum(["fragmented", "formatted", "auto"])
367
+ .meta({ id: "InputModeSelection", description: 'The parse register, or `"auto"` to derive it from the input.' })
368
+
369
+ export type InputModeSelection = z.infer<typeof InputModeSelectionSchema>
250
370
 
251
371
  /**
252
- * Maps complete-address kinds to `formatted` and every other kind to `fragmented`.
372
+ * Resolves an input-mode selection.
373
+ *
374
+ * An explicit register passes through.
375
+ * `"auto"` maps complete-address kinds to `formatted` and every other kind to `fragmented`.
253
376
  */
254
- export function deriveInputMode(kind: QueryKind): InputMode {
377
+ export function deriveInputMode(selection: InputModeSelection, kind: QueryKind): InputMode {
378
+ if (selection !== "auto") return selection
379
+
255
380
  switch (kind) {
256
381
  case "structured_address":
257
382
  case "po_box":
@@ -262,74 +387,112 @@ export function deriveInputMode(kind: QueryKind): InputMode {
262
387
  }
263
388
  }
264
389
 
390
+ /**
391
+ * The relation between a POI subject and its anchor, as the query phrased it.
392
+ */
393
+ export const POISpatialRelationSchema = z.enum(["comma", "near", "in", "at", "around", "to"])
394
+
395
+ export type POISpatialRelation = z.infer<typeof POISpatialRelationSchema>
396
+
397
+ const POICategorySubjectSchema = z.object({
398
+ kind: z.literal("category"),
399
+ /**
400
+ * Category IDs to search together.
401
+ * The order does not rank these values.
402
+ */
403
+ categoryIDs: z.array(z.string()),
404
+ matched: z.string(),
405
+ /**
406
+ * Categories that the resolved anchor country excludes.
407
+ */
408
+ countryBinding: z
409
+ .object({ anchorCountry: z.string().nullable(), excludedCategoryIDs: z.array(z.string()) })
410
+ .nullable(),
411
+ })
412
+
413
+ const POIBrandSubjectSchema = z.object({
414
+ kind: z.literal("brand"),
415
+ name: z.string(),
416
+ wikidata: z.string().nullable(),
417
+ matched: z.string(),
418
+ })
419
+
420
+ const POINameSubjectSchema = z.object({ kind: z.literal("name"), text: z.string() })
421
+
422
+ /**
423
+ * The parsed spatial anchor of a POI query.
424
+ */
425
+ const POIAnchorSchema = z.object({
426
+ text: z.string().nullable(),
427
+ tree: AddressTreeSchema.nullable(),
428
+ /**
429
+ * A caller-supplied location, used when no anchor tree is available.
430
+ */
431
+ biasPoint: z.object({ latitude: z.number(), longitude: z.number() }).nullable(),
432
+ radiusM: z.number().nullable(),
433
+ })
434
+
265
435
  /**
266
436
  * A structured POI query that classification hands to search executors.
267
437
  */
268
- export interface POIIntent {
269
- subject:
270
- | {
271
- kind: "category"
272
- /**
273
- * Category IDs to search together.
274
- * The order does not rank these values.
275
- */
276
- categoryIDs: string[]
277
- matched: string
278
- /**
279
- * Categories that the resolved anchor country excludes.
280
- */
281
- countryBinding?: { anchorCountry: string | null; excludedCategoryIDs: string[] }
282
- }
283
- | { kind: "brand"; name: string; wikidata?: string; matched: string }
284
- | { kind: "name"; text: string }
285
- /**
286
- * The relation between the subject and the anchor.
287
- */
288
- relation?: "comma" | "near" | "in" | "at" | "around" | "to"
289
- /**
290
- * The parsed spatial anchor, when the query has one.
291
- */
292
- anchor?: {
293
- text?: string
294
- tree?: AddressTree
438
+ export const POIIntentSchema = z
439
+ .object({
440
+ subject: z.discriminatedUnion("kind", [POICategorySubjectSchema, POIBrandSubjectSchema, POINameSubjectSchema]),
295
441
  /**
296
- * A caller-supplied location, used when no anchor tree is available.
442
+ * The relation between the subject and the anchor.
297
443
  */
298
- biasPoint?: { latitude: number; longitude: number }
299
- radiusM?: number
300
- }
301
- limit?: number
302
- }
444
+ relation: POISpatialRelationSchema.nullable(),
445
+ /**
446
+ * The parsed spatial anchor, when the query has one.
447
+ */
448
+ anchor: POIAnchorSchema.nullable(),
449
+ limit: z.number().nullable(),
450
+ })
451
+ .meta({ id: "POIIntent", description: "A structured POI query." })
452
+
453
+ export type POIIntent = z.infer<typeof POIIntentSchema>
303
454
 
304
455
  /**
305
456
  * One POI search result.
306
457
  */
307
- export interface POIResult {
308
- name: string | null
309
- categoryID: string | null
310
- brandWikidata: string | null
311
- latitude: number
312
- longitude: number
313
- country: string
314
- confidence: number
315
- /**
316
- * The Overture GERS ID.
317
- */
318
- gersID: string | null
319
- /**
320
- * WOF ancestry, deepest first.
321
- * It is absent when no reverse geocoder is configured.
322
- */
323
- ancestry?: ReadonlyArray<{ placetype: string; name: string; wofID: number }>
324
- distanceM?: number
325
- }
458
+ export const POIResultSchema = z
459
+ .object({
460
+ name: z.string().nullable(),
461
+ categoryID: z.string().nullable(),
462
+ brandWikidata: z.string().nullable(),
463
+ latitude: z.number(),
464
+ longitude: z.number(),
465
+ country: z.string(),
466
+ confidence: z.number(),
467
+ /**
468
+ * The Overture GERS ID.
469
+ */
470
+ gersID: z.string().nullable(),
471
+ /**
472
+ * WOF ancestry, deepest first.
473
+ * It is `null` when no reverse geocoder is configured.
474
+ */
475
+ ancestry: z
476
+ .array(z.object({ placetype: z.string(), name: z.string(), wofID: z.number() }))
477
+ .readonly()
478
+ .nullable(),
479
+ distanceM: z.number().nullable(),
480
+ })
481
+ .meta({ id: "POIResult", description: "One POI search result." })
482
+
483
+ export type POIResult = z.infer<typeof POIResultSchema>
326
484
 
327
485
  /**
328
- * The outcome of POI handling: an intent with optional results, or an abstention with a reason.
486
+ * The result of POI handling: an intent with optional results, or an abstention with a reason.
329
487
  */
330
- export type POIIntentOutcome =
331
- | { type: "intent"; intent: POIIntent; results?: POIResult[] }
332
- | { type: "abstain"; reason: string }
488
+ export const POIQueryResultSchema = z
489
+ .discriminatedUnion("type", [
490
+ z.object({ type: z.literal("intent"), intent: POIIntentSchema, results: z.array(POIResultSchema).nullable() }),
491
+ z.object({ type: z.literal("abstain"), reason: z.string() }),
492
+ ])
493
+ .meta({ id: "POIQueryResult", description: "A POI intent with its results, or an abstention." })
494
+
495
+ export type POIQueryResult = z.infer<typeof POIQueryResultSchema>
333
496
 
334
497
  /**
335
498
  * Structural phrase shapes that the phrase grouper proposes before classification.
@@ -375,9 +538,13 @@ export interface FSTMatcherLike {
375
538
  * Options for {@link AddressClassifier.parse}.
376
539
  */
377
540
  export interface ClassifierOpts {
378
- queryShape?: QueryShapeLite
541
+ /**
542
+ * The pipeline's query shape.
543
+ * Classifiers read its format hits.
544
+ */
545
+ queryShape?: Pick<QueryShapeLite, "knownFormats">
379
546
  inputMode?: InputMode
380
- fst?: FSTMatcherLike
547
+ fst?: FSTMatcherLike | null
381
548
  fstBiasScale?: number
382
549
  /**
383
550
  * The street-morphology matcher for the street-context check.
@@ -393,17 +560,16 @@ export interface ClassifierOpts {
393
560
  */
394
561
  postcodeRepair?: boolean
395
562
  /**
396
- * Title-cases all-caps ASCII input before classification.
397
- * Set `false` to keep the raw case.
563
+ * How the classifier treats letter case.
564
+ *
565
+ * @defaultValue {@linkcode DEFAULT_CASE_NORMALIZATION}
398
566
  */
399
- normalizeCase?: boolean
567
+ caseNormalization?: CaseNormalization
400
568
  /**
401
569
  * Reconciles differing BIO tags among the pieces of one word.
402
570
  */
403
- enforceWordConsistency?:
404
- | boolean
405
- | { minMeanConfidence?: number; skipByteFallbackWords?: boolean; splitOnPunctuation?: boolean }
406
- placetypePair?: PlacetypePairPassthrough
571
+ enforceWordConsistency?: WordConsistencySetting
572
+ placetypePair?: PlacetypePairSelection
407
573
  }
408
574
 
409
575
  /**
@@ -412,7 +578,7 @@ export interface ClassifierOpts {
412
578
  export const WORD_CONSISTENCY_SHIP_DEFAULT = {
413
579
  skipByteFallbackWords: true,
414
580
  splitOnPunctuation: true,
415
- } as const satisfies ClassifierOpts["enforceWordConsistency"]
581
+ } as const satisfies WordConsistencyOpts
416
582
 
417
583
  /**
418
584
  * A classifier that parses text into an address tree.
@@ -438,7 +604,8 @@ export type LocaleDetector = (
438
604
 
439
605
  /**
440
606
  * The stage implementations that the runtime pipeline composes.
441
- * Every stage is optional.
607
+ *
608
+ * Every stage is optional, and a missing stage is skipped or replaced by its built-in default.
442
609
  */
443
610
  export interface RuntimePipelineStages {
444
611
  normalize?: (raw: string, opts?: { locale?: string }) => NormalizedInputLite
@@ -462,7 +629,7 @@ export interface RuntimePipelineStages {
462
629
  * The POI handler.
463
630
  * A `null` result falls through to the full parse.
464
631
  */
465
- poiIntent?: (input: NormalizedInputLite, locale: LocaleHint, opts?: PipelineOpts) => Promise<POIIntentOutcome | null>
632
+ poiIntent?: (input: NormalizedInputLite, locale: LocaleHint, opts?: PipelineOpts) => Promise<POIQueryResult | null>
466
633
  /**
467
634
  * The phrase grouper.
468
635
  *