@mailwoman/core 10.1.0 → 10.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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
@@ -5,12 +5,12 @@
5
5
  *
6
6
  * Declares the types for the runtime pipeline and its injected stages.
7
7
  */
8
- import type { AddressTree } from "#decoder/types";
8
+ import type { NormalizedInputLite } from "@mailwoman/query-shape";
9
+ import { z } from "zod";
10
+ import { type AddressTree } from "#decoder/types";
9
11
  import type { MachinePreferences } from "#pipeline/preferences";
10
12
  import type { ResolveOpts, Resolver, ResolverBackend } from "#resolver/types";
11
13
  import type { Section } from "#types/classifier";
12
- export { type PipelineFault, type PipelineResult } from "#pipeline/result";
13
- export { type MachinePreferences } from "#pipeline/preferences";
14
14
  /**
15
15
  * The user's location.
16
16
  * The resolver may use it for scoring.
@@ -25,9 +25,93 @@ export type UserLocation = {
25
25
  country: string;
26
26
  };
27
27
  /**
28
- * A placetype-pair prior that core passes to the classifier without inspecting it.
28
+ * The placetype-pair prior for one parse.
29
+ *
30
+ * - `"inherit"` uses the classifier's configured prior, if it has one.
31
+ * - `"off"` disables the prior for the parse.
32
+ * - A prior object replaces the configured one.
33
+ * Core passes it to the classifier without inspecting it.
34
+ */
35
+ export type PlacetypePairSelection<Prior extends object = object> = "inherit" | "off" | Prior;
36
+ /**
37
+ * How the classifier treats letter case before inference.
38
+ *
39
+ * - `"title-case"` title-cases detected all-caps ASCII input.
40
+ * Mixed-case input is unchanged.
41
+ * - `"preserve"` passes the raw case to the model.
42
+ */
43
+ export type CaseNormalization = "title-case" | "preserve";
44
+ /**
45
+ * How a caller sources an optional stage.
46
+ *
47
+ * - `"auto"` loads the bundled default, usually on the first parse.
48
+ * - `"none"` disables the stage.
49
+ * - Any other value is the stage itself.
50
+ */
51
+ export type StageSource<T extends object> = "auto" | "none" | T;
52
+ /**
53
+ * How the pipeline uses the coarse placer's country guess.
54
+ *
55
+ * - `"filter"` turns a confident guess for a country in the hard-country safelist
56
+ * into a hard country filter, and keeps the soft prior otherwise.
57
+ * - `"prior"` only adds the guess as a soft country prior.
58
+ */
59
+ export type PlacerCountryUse = "filter" | "prior";
60
+ /**
61
+ * The placer-country use every parse and geocode applies unless a caller chooses otherwise.
62
+ */
63
+ export declare const DEFAULT_PLACER_COUNTRY_USE = "filter";
64
+ /**
65
+ * The case normalization every parse uses unless a caller chooses otherwise.
66
+ */
67
+ export declare const DEFAULT_CASE_NORMALIZATION = "title-case";
68
+ /**
69
+ * Every {@link CaseNormalization} value, for flag choices and validation.
70
+ */
71
+ export declare const CASE_NORMALIZATIONS: readonly ["title-case", "preserve"];
72
+ /**
73
+ * Reads a flag value as a {@link CaseNormalization}, falling back to
74
+ * {@link DEFAULT_CASE_NORMALIZATION} when unset and throwing on anything else.
75
+ */
76
+ export declare function caseNormalizationOf(value: string | undefined): CaseNormalization;
77
+ /**
78
+ * Limits which words the word-consistency repair relabels.
79
+ *
80
+ * An empty object relabels every word whose pieces disagree on entity type.
29
81
  */
30
- export type PlacetypePairPassthrough = object | false;
82
+ export interface WordConsistencyOpts {
83
+ /**
84
+ * Leaves a word unchanged when the winning type's mean probability across its
85
+ * pieces falls below this floor; `0` or unset never skips.
86
+ *
87
+ * A low-confidence vote marks rows where per-piece confidence is unreliable.
88
+ * A relabelled row would amplify noise.
89
+ */
90
+ minMeanConfidence?: number;
91
+ /**
92
+ * Leaves any word containing a byte-fallback piece (`<0xNN>`) unchanged.
93
+ *
94
+ * Its surviving pieces are not trustworthy voters.
95
+ *
96
+ * @defaultValue `false`
97
+ */
98
+ skipByteFallbackWords?: boolean;
99
+ /**
100
+ * Treats a punctuation-only piece as a word separator, like whitespace.
101
+ *
102
+ * Otherwise a continuation piece such as the `,` in `Ave,` joins the word.
103
+ * Its `O` label can outvote a real span.
104
+ *
105
+ * The halves of a slash compound such as `12/345` can also vote independently.
106
+ *
107
+ * @defaultValue `false`
108
+ */
109
+ splitOnPunctuation?: boolean;
110
+ }
111
+ /**
112
+ * The word-consistency repair setting: `"off"`, or the options of the vote to run.
113
+ */
114
+ export type WordConsistencySetting = "off" | WordConsistencyOpts;
31
115
  /**
32
116
  * Per-call options for the runtime pipeline.
33
117
  */
@@ -36,9 +120,9 @@ export interface PipelineOpts {
36
120
  userLocation?: UserLocation;
37
121
  /**
38
122
  * The input register.
39
- * When unset, the pipeline derives it from the query kind.
123
+ * The default `"auto"` derives it from the query kind.
40
124
  */
41
- inputMode?: InputMode;
125
+ inputMode?: InputModeSelection;
42
126
  /**
43
127
  * Disables the postcode and locality fast paths.
44
128
  * POI routing still applies.
@@ -50,33 +134,29 @@ export interface PipelineOpts {
50
134
  */
51
135
  resolveOpts?: ResolveOpts;
52
136
  /**
53
- * Normalizes all-caps ASCII input before classification.
54
- * Pass `false` to keep the raw case.
137
+ * How the classifier treats letter case.
138
+ *
139
+ * @defaultValue {@linkcode DEFAULT_CASE_NORMALIZATION}
55
140
  */
56
- normalizeCase?: boolean;
141
+ caseNormalization?: CaseNormalization;
57
142
  /**
58
- * A per-parse placetype-pair prior for the classifier.
59
- * An unset value disables the prior.
143
+ * The placetype-pair prior for this parse.
144
+ *
145
+ * The default `"inherit"` uses the classifier's configured prior.
60
146
  */
61
- placetypePair?: PlacetypePairPassthrough;
147
+ placetypePair?: PlacetypePairSelection;
62
148
  /**
63
- * Allows a confident placer result for a safelisted country to become a hard country filter.
149
+ * How the coarse placer's country guess constrains resolution.
150
+ *
151
+ * @defaultValue {@linkcode DEFAULT_PLACER_COUNTRY_USE}
64
152
  */
65
- hardPlaceCountry?: boolean;
153
+ placerCountryUse?: PlacerCountryUse;
66
154
  /**
67
155
  * Replaces the artifact's hard-country safelist.
68
156
  */
69
157
  hardCountrySafelist?: ReadonlySet<string>;
70
158
  signal?: AbortSignal;
71
159
  }
72
- /**
73
- * The fields of a normalized input that the pipeline reads.
74
- */
75
- export interface NormalizedInputLite {
76
- raw: string;
77
- normalized: string;
78
- appliedLocale?: string;
79
- }
80
160
  /**
81
161
  * The fields of a query shape that the pipeline reads.
82
162
  */
@@ -89,22 +169,26 @@ export interface QueryShapeLite {
89
169
  };
90
170
  confidence: number;
91
171
  }>;
92
- segments?: ReadonlyArray<{
172
+ segments: ReadonlyArray<{
93
173
  body: string;
94
174
  index: number;
95
- }>;
96
- characterClass?: string;
175
+ span: {
176
+ start: number;
177
+ end: number;
178
+ } | null;
179
+ }> | null;
180
+ characterClass: string | null;
97
181
  /**
98
182
  * ISO 15924 scripts ranked by share of script-bearing characters.
99
183
  */
100
- scripts?: ReadonlyArray<{
184
+ scripts: ReadonlyArray<{
101
185
  script: string;
102
186
  share: number;
103
- }>;
187
+ }> | null;
104
188
  /**
105
189
  * The class and script of each token.
106
190
  */
107
- tokenClasses?: ReadonlyArray<{
191
+ tokenClasses: ReadonlyArray<{
108
192
  span: {
109
193
  start: number;
110
194
  end: number;
@@ -112,9 +196,9 @@ export interface QueryShapeLite {
112
196
  };
113
197
  class: string;
114
198
  length: number;
115
- script?: string;
116
- }>;
117
- totalLength?: number;
199
+ script: string | null;
200
+ }> | null;
201
+ totalLength: number | null;
118
202
  }
119
203
  /**
120
204
  * A locale from detection or a caller hint, with alternatives.
@@ -133,42 +217,47 @@ export interface LocaleHint {
133
217
  * The array is empty when the input has no script-bearing text.
134
218
  * `locale` stays a BCP-47 language tag.
135
219
  */
136
- script?: ReadonlyArray<{
220
+ script: ReadonlyArray<{
137
221
  script: string;
138
222
  confidence: number;
139
223
  }>;
140
224
  /**
141
- * Diagnostic values that fed the inferred preferences.
225
+ * Diagnostic values that fed the inferred preferences, or null when none did.
142
226
  * Locale and time zone are independent signals.
143
227
  */
144
- evidence?: {
145
- intlLocale?: string;
146
- timeZone?: string;
147
- environmentLocale?: Intl.UnicodeBCP47LocaleIdentifier;
148
- };
228
+ evidence: {
229
+ intlLocale: string | null;
230
+ timeZone: string | null;
231
+ environmentLocale: Intl.UnicodeBCP47LocaleIdentifier | null;
232
+ } | null;
149
233
  }
150
234
  /**
151
235
  * The query kinds the kind classifier emits.
152
236
  *
153
- * The last four kinds describe the requested operation instead of the input's structure.
154
- */
155
- export type QueryKind = "postcode_only" | "locality_only" | "structured_address" | "intersection" | "po_box" | "landmark" | "poi_query" | "vague"
156
- /**
157
- * A bare place name with no address components. Resolution uses it to report ambiguity.
158
- */
159
- | "bare_toponym"
160
- /**
161
- * Two place names with no address grammar between them. The pipeline reports both readings and does no routing.
162
- */
163
- | "route_pair"
164
- /**
165
- * A relative location query that needs the caller's position.
166
- */
167
- | "near_me"
168
- /**
169
- * A POI category query with no search anchor.
170
- */
171
- | "poi_category";
237
+ * The last four kinds describe the requested operation instead of the input's structure:
238
+ *
239
+ * - `bare_toponym`: a bare place name with no address components.
240
+ * Resolution uses it to report ambiguity.
241
+ * - `route_pair`: two place names with no address grammar between them.
242
+ * The pipeline reports both readings and does no routing.
243
+ * - `near_me`: a relative location query that needs the caller's position.
244
+ * - `poi_category`: a POI category query with no search anchor.
245
+ */
246
+ export declare const QueryKindSchema: z.ZodEnum<{
247
+ bare_toponym: "bare_toponym";
248
+ intersection: "intersection";
249
+ landmark: "landmark";
250
+ locality_only: "locality_only";
251
+ near_me: "near_me";
252
+ po_box: "po_box";
253
+ poi_category: "poi_category";
254
+ poi_query: "poi_query";
255
+ postcode_only: "postcode_only";
256
+ route_pair: "route_pair";
257
+ structured_address: "structured_address";
258
+ vague: "vague";
259
+ }>;
260
+ export type QueryKind = z.infer<typeof QueryKindSchema>;
172
261
  /**
173
262
  * Advisory codes that report how a query was interpreted or what evidence is missing.
174
263
  */
@@ -204,34 +293,98 @@ export declare const QueryIntentCode: {
204
293
  readonly DeclaredCoarserAnswer: "declared_coarser_answer";
205
294
  };
206
295
  /**
207
- * One of the {@link QueryIntentCode} values.
208
- */
209
- export type QueryIntentCode = (typeof QueryIntentCode)[keyof typeof QueryIntentCode];
210
- /**
211
- * An advisory from query-intent logic.
212
- * It leaves the selected answer unchanged.
296
+ * {@link QueryIntentCode} as a schema.
213
297
  */
214
- export interface QueryIntentMarker {
298
+ export declare const QueryIntentCodeSchema: z.ZodEnum<{
215
299
  /**
216
- * The query kind that produced the marker.
217
- * It must appear in the classifier result.
300
+ * Resolution found no decisive candidate for a place with a recognized name.
218
301
  */
219
- kind: QueryKind;
220
- code: QueryIntentCode;
302
+ readonly DeclaredAmbiguity: "declared_ambiguity";
221
303
  /**
222
- * A `family:rule` identifier for the producer.
304
+ * The query has two readings, listed in `evidence.interpretations`.
223
305
  */
224
- mechanism: string;
306
+ readonly DeclaredFork: "declared_fork";
225
307
  /**
226
- * Human-readable text.
227
- * Branch on `code`, which is stable.
308
+ * A relative query lacks the focus point it needs.
228
309
  */
229
- message: string;
310
+ readonly FocusPointRequired: "focus_point_required";
230
311
  /**
231
- * Measurements from supporting sources, when available.
312
+ * The query resolved to a POI category.
232
313
  */
233
- evidence?: Record<string, unknown>;
234
- }
314
+ readonly POICategory: "poi_category";
315
+ /**
316
+ * No matching feature exists in a cell whose coverage is complete enough to rule it out.
317
+ */
318
+ readonly CoverageQualifiedAbsence: "coverage_qualified_absence";
319
+ /**
320
+ * An authority's designation for the resolved coordinate, backed by the authority's coverage record.
321
+ */
322
+ readonly AuthorityDesignation: "authority_designation";
323
+ /**
324
+ * The resolved result is coarser than the parsed address.
325
+ * The evidence lists the unused components and both tiers.
326
+ */
327
+ readonly DeclaredCoarserAnswer: "declared_coarser_answer";
328
+ }>;
329
+ /**
330
+ * One of the {@link QueryIntentCode} values.
331
+ */
332
+ export type QueryIntentCode = z.infer<typeof QueryIntentCodeSchema>;
333
+ /**
334
+ * An advisory from query-intent logic.
335
+ * It leaves the selected answer unchanged.
336
+ */
337
+ export declare const QueryIntentMarkerSchema: z.ZodObject<{
338
+ kind: z.ZodEnum<{
339
+ bare_toponym: "bare_toponym";
340
+ intersection: "intersection";
341
+ landmark: "landmark";
342
+ locality_only: "locality_only";
343
+ near_me: "near_me";
344
+ po_box: "po_box";
345
+ poi_category: "poi_category";
346
+ poi_query: "poi_query";
347
+ postcode_only: "postcode_only";
348
+ route_pair: "route_pair";
349
+ structured_address: "structured_address";
350
+ vague: "vague";
351
+ }>;
352
+ code: z.ZodEnum<{
353
+ /**
354
+ * Resolution found no decisive candidate for a place with a recognized name.
355
+ */
356
+ readonly DeclaredAmbiguity: "declared_ambiguity";
357
+ /**
358
+ * The query has two readings, listed in `evidence.interpretations`.
359
+ */
360
+ readonly DeclaredFork: "declared_fork";
361
+ /**
362
+ * A relative query lacks the focus point it needs.
363
+ */
364
+ readonly FocusPointRequired: "focus_point_required";
365
+ /**
366
+ * The query resolved to a POI category.
367
+ */
368
+ readonly POICategory: "poi_category";
369
+ /**
370
+ * No matching feature exists in a cell whose coverage is complete enough to rule it out.
371
+ */
372
+ readonly CoverageQualifiedAbsence: "coverage_qualified_absence";
373
+ /**
374
+ * An authority's designation for the resolved coordinate, backed by the authority's coverage record.
375
+ */
376
+ readonly AuthorityDesignation: "authority_designation";
377
+ /**
378
+ * The resolved result is coarser than the parsed address.
379
+ * The evidence lists the unused components and both tiers.
380
+ */
381
+ readonly DeclaredCoarserAnswer: "declared_coarser_answer";
382
+ }>;
383
+ mechanism: z.ZodString;
384
+ message: z.ZodString;
385
+ evidence: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
386
+ }, z.core.$strip>;
387
+ export type QueryIntentMarker = z.infer<typeof QueryIntentMarkerSchema>;
235
388
  /**
236
389
  * The kind classifier's result.
237
390
  */
@@ -245,106 +398,170 @@ export interface QueryKindResult {
245
398
  /**
246
399
  * Advisories raised during kind classification.
247
400
  */
248
- intentMarkers?: ReadonlyArray<QueryIntentMarker>;
401
+ intentMarkers: ReadonlyArray<QueryIntentMarker> | null;
249
402
  }
250
403
  /**
251
404
  * The parse register.
252
405
  *
253
406
  * `fragmented` suits search input and `formatted` suits complete postal records.
407
+ */
408
+ export declare const InputModeSchema: z.ZodEnum<{
409
+ formatted: "formatted";
410
+ fragmented: "fragmented";
411
+ }>;
412
+ export type InputMode = z.infer<typeof InputModeSchema>;
413
+ /**
414
+ * A parse register, or `"auto"` to let {@link deriveInputMode} derive it from the query kind.
415
+ */
416
+ export declare const InputModeSelectionSchema: z.ZodEnum<{
417
+ auto: "auto";
418
+ formatted: "formatted";
419
+ fragmented: "fragmented";
420
+ }>;
421
+ export type InputModeSelection = z.infer<typeof InputModeSelectionSchema>;
422
+ /**
423
+ * Resolves an input-mode selection.
254
424
  *
255
- * When unset, {@link deriveInputMode} derives it from the query kind.
425
+ * An explicit register passes through.
426
+ * `"auto"` maps complete-address kinds to `formatted` and every other kind to `fragmented`.
256
427
  */
257
- export type InputMode = "fragmented" | "formatted";
428
+ export declare function deriveInputMode(selection: InputModeSelection, kind: QueryKind): InputMode;
258
429
  /**
259
- * Maps complete-address kinds to `formatted` and every other kind to `fragmented`.
430
+ * The relation between a POI subject and its anchor, as the query phrased it.
260
431
  */
261
- export declare function deriveInputMode(kind: QueryKind): InputMode;
432
+ export declare const POISpatialRelationSchema: z.ZodEnum<{
433
+ around: "around";
434
+ at: "at";
435
+ comma: "comma";
436
+ in: "in";
437
+ near: "near";
438
+ to: "to";
439
+ }>;
440
+ export type POISpatialRelation = z.infer<typeof POISpatialRelationSchema>;
262
441
  /**
263
442
  * A structured POI query that classification hands to search executors.
264
443
  */
265
- export interface POIIntent {
266
- subject: {
267
- kind: "category";
268
- /**
269
- * Category IDs to search together.
270
- * The order does not rank these values.
271
- */
272
- categoryIDs: string[];
273
- matched: string;
274
- /**
275
- * Categories that the resolved anchor country excludes.
276
- */
277
- countryBinding?: {
278
- anchorCountry: string | null;
279
- excludedCategoryIDs: string[];
280
- };
281
- } | {
282
- kind: "brand";
283
- name: string;
284
- wikidata?: string;
285
- matched: string;
286
- } | {
287
- kind: "name";
288
- text: string;
289
- };
290
- /**
291
- * The relation between the subject and the anchor.
292
- */
293
- relation?: "comma" | "near" | "in" | "at" | "around" | "to";
294
- /**
295
- * The parsed spatial anchor, when the query has one.
296
- */
297
- anchor?: {
298
- text?: string;
299
- tree?: AddressTree;
300
- /**
301
- * A caller-supplied location, used when no anchor tree is available.
302
- */
303
- biasPoint?: {
304
- latitude: number;
305
- longitude: number;
306
- };
307
- radiusM?: number;
308
- };
309
- limit?: number;
310
- }
444
+ export declare const POIIntentSchema: z.ZodObject<{
445
+ subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
446
+ kind: z.ZodLiteral<"category">;
447
+ categoryIDs: z.ZodArray<z.ZodString>;
448
+ matched: z.ZodString;
449
+ countryBinding: z.ZodNullable<z.ZodObject<{
450
+ anchorCountry: z.ZodNullable<z.ZodString>;
451
+ excludedCategoryIDs: z.ZodArray<z.ZodString>;
452
+ }, z.core.$strip>>;
453
+ }, z.core.$strip>, z.ZodObject<{
454
+ kind: z.ZodLiteral<"brand">;
455
+ name: z.ZodString;
456
+ wikidata: z.ZodNullable<z.ZodString>;
457
+ matched: z.ZodString;
458
+ }, z.core.$strip>, z.ZodObject<{
459
+ kind: z.ZodLiteral<"name">;
460
+ text: z.ZodString;
461
+ }, z.core.$strip>], "kind">;
462
+ relation: z.ZodNullable<z.ZodEnum<{
463
+ around: "around";
464
+ at: "at";
465
+ comma: "comma";
466
+ in: "in";
467
+ near: "near";
468
+ to: "to";
469
+ }>>;
470
+ anchor: z.ZodNullable<z.ZodObject<{
471
+ text: z.ZodNullable<z.ZodString>;
472
+ tree: z.ZodNullable<z.ZodCustom<AddressTree, AddressTree>>;
473
+ biasPoint: z.ZodNullable<z.ZodObject<{
474
+ latitude: z.ZodNumber;
475
+ longitude: z.ZodNumber;
476
+ }, z.core.$strip>>;
477
+ radiusM: z.ZodNullable<z.ZodNumber>;
478
+ }, z.core.$strip>>;
479
+ limit: z.ZodNullable<z.ZodNumber>;
480
+ }, z.core.$strip>;
481
+ export type POIIntent = z.infer<typeof POIIntentSchema>;
311
482
  /**
312
483
  * One POI search result.
313
484
  */
314
- export interface POIResult {
315
- name: string | null;
316
- categoryID: string | null;
317
- brandWikidata: string | null;
318
- latitude: number;
319
- longitude: number;
320
- country: string;
321
- confidence: number;
322
- /**
323
- * The Overture GERS ID.
324
- */
325
- gersID: string | null;
326
- /**
327
- * WOF ancestry, deepest first.
328
- * It is absent when no reverse geocoder is configured.
329
- */
330
- ancestry?: ReadonlyArray<{
331
- placetype: string;
332
- name: string;
333
- wofID: number;
334
- }>;
335
- distanceM?: number;
336
- }
337
- /**
338
- * The outcome of POI handling: an intent with optional results, or an abstention with a reason.
339
- */
340
- export type POIIntentOutcome = {
341
- type: "intent";
342
- intent: POIIntent;
343
- results?: POIResult[];
344
- } | {
345
- type: "abstain";
346
- reason: string;
347
- };
485
+ export declare const POIResultSchema: z.ZodObject<{
486
+ name: z.ZodNullable<z.ZodString>;
487
+ categoryID: z.ZodNullable<z.ZodString>;
488
+ brandWikidata: z.ZodNullable<z.ZodString>;
489
+ latitude: z.ZodNumber;
490
+ longitude: z.ZodNumber;
491
+ country: z.ZodString;
492
+ confidence: z.ZodNumber;
493
+ gersID: z.ZodNullable<z.ZodString>;
494
+ ancestry: z.ZodNullable<z.ZodReadonly<z.ZodArray<z.ZodObject<{
495
+ placetype: z.ZodString;
496
+ name: z.ZodString;
497
+ wofID: z.ZodNumber;
498
+ }, z.core.$strip>>>>;
499
+ distanceM: z.ZodNullable<z.ZodNumber>;
500
+ }, z.core.$strip>;
501
+ export type POIResult = z.infer<typeof POIResultSchema>;
502
+ /**
503
+ * The result of POI handling: an intent with optional results, or an abstention with a reason.
504
+ */
505
+ export declare const POIQueryResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
506
+ type: z.ZodLiteral<"intent">;
507
+ intent: z.ZodObject<{
508
+ subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
509
+ kind: z.ZodLiteral<"category">;
510
+ categoryIDs: z.ZodArray<z.ZodString>;
511
+ matched: z.ZodString;
512
+ countryBinding: z.ZodNullable<z.ZodObject<{
513
+ anchorCountry: z.ZodNullable<z.ZodString>;
514
+ excludedCategoryIDs: z.ZodArray<z.ZodString>;
515
+ }, z.core.$strip>>;
516
+ }, z.core.$strip>, z.ZodObject<{
517
+ kind: z.ZodLiteral<"brand">;
518
+ name: z.ZodString;
519
+ wikidata: z.ZodNullable<z.ZodString>;
520
+ matched: z.ZodString;
521
+ }, z.core.$strip>, z.ZodObject<{
522
+ kind: z.ZodLiteral<"name">;
523
+ text: z.ZodString;
524
+ }, z.core.$strip>], "kind">;
525
+ relation: z.ZodNullable<z.ZodEnum<{
526
+ around: "around";
527
+ at: "at";
528
+ comma: "comma";
529
+ in: "in";
530
+ near: "near";
531
+ to: "to";
532
+ }>>;
533
+ anchor: z.ZodNullable<z.ZodObject<{
534
+ text: z.ZodNullable<z.ZodString>;
535
+ tree: z.ZodNullable<z.ZodCustom<AddressTree, AddressTree>>;
536
+ biasPoint: z.ZodNullable<z.ZodObject<{
537
+ latitude: z.ZodNumber;
538
+ longitude: z.ZodNumber;
539
+ }, z.core.$strip>>;
540
+ radiusM: z.ZodNullable<z.ZodNumber>;
541
+ }, z.core.$strip>>;
542
+ limit: z.ZodNullable<z.ZodNumber>;
543
+ }, z.core.$strip>;
544
+ results: z.ZodNullable<z.ZodArray<z.ZodObject<{
545
+ name: z.ZodNullable<z.ZodString>;
546
+ categoryID: z.ZodNullable<z.ZodString>;
547
+ brandWikidata: z.ZodNullable<z.ZodString>;
548
+ latitude: z.ZodNumber;
549
+ longitude: z.ZodNumber;
550
+ country: z.ZodString;
551
+ confidence: z.ZodNumber;
552
+ gersID: z.ZodNullable<z.ZodString>;
553
+ ancestry: z.ZodNullable<z.ZodReadonly<z.ZodArray<z.ZodObject<{
554
+ placetype: z.ZodString;
555
+ name: z.ZodString;
556
+ wofID: z.ZodNumber;
557
+ }, z.core.$strip>>>>;
558
+ distanceM: z.ZodNullable<z.ZodNumber>;
559
+ }, z.core.$strip>>>;
560
+ }, z.core.$strip>, z.ZodObject<{
561
+ type: z.ZodLiteral<"abstain">;
562
+ reason: z.ZodString;
563
+ }, z.core.$strip>], "type">;
564
+ export type POIQueryResult = z.infer<typeof POIQueryResultSchema>;
348
565
  /**
349
566
  * Structural phrase shapes that the phrase grouper proposes before classification.
350
567
  */
@@ -390,9 +607,13 @@ export interface FSTMatcherLike {
390
607
  * Options for {@link AddressClassifier.parse}.
391
608
  */
392
609
  export interface ClassifierOpts {
393
- queryShape?: QueryShapeLite;
610
+ /**
611
+ * The pipeline's query shape.
612
+ * Classifiers read its format hits.
613
+ */
614
+ queryShape?: Pick<QueryShapeLite, "knownFormats">;
394
615
  inputMode?: InputMode;
395
- fst?: FSTMatcherLike;
616
+ fst?: FSTMatcherLike | null;
396
617
  fstBiasScale?: number;
397
618
  /**
398
619
  * The street-morphology matcher for the street-context check.
@@ -411,19 +632,16 @@ export interface ClassifierOpts {
411
632
  */
412
633
  postcodeRepair?: boolean;
413
634
  /**
414
- * Title-cases all-caps ASCII input before classification.
415
- * Set `false` to keep the raw case.
635
+ * How the classifier treats letter case.
636
+ *
637
+ * @defaultValue {@linkcode DEFAULT_CASE_NORMALIZATION}
416
638
  */
417
- normalizeCase?: boolean;
639
+ caseNormalization?: CaseNormalization;
418
640
  /**
419
641
  * Reconciles differing BIO tags among the pieces of one word.
420
642
  */
421
- enforceWordConsistency?: boolean | {
422
- minMeanConfidence?: number;
423
- skipByteFallbackWords?: boolean;
424
- splitOnPunctuation?: boolean;
425
- };
426
- placetypePair?: PlacetypePairPassthrough;
643
+ enforceWordConsistency?: WordConsistencySetting;
644
+ placetypePair?: PlacetypePairSelection;
427
645
  }
428
646
  /**
429
647
  * The word-consistency settings that the runtime and evaluation paths both use.
@@ -450,7 +668,8 @@ export type LocaleDetector = (input: NormalizedInputLite, shape: QueryShapeLite,
450
668
  }) => Promise<LocaleHint>;
451
669
  /**
452
670
  * The stage implementations that the runtime pipeline composes.
453
- * Every stage is optional.
671
+ *
672
+ * Every stage is optional, and a missing stage is skipped or replaced by its built-in default.
454
673
  */
455
674
  export interface RuntimePipelineStages {
456
675
  normalize?: (raw: string, opts?: {
@@ -478,7 +697,7 @@ export interface RuntimePipelineStages {
478
697
  * The POI handler.
479
698
  * A `null` result falls through to the full parse.
480
699
  */
481
- poiIntent?: (input: NormalizedInputLite, locale: LocaleHint, opts?: PipelineOpts) => Promise<POIIntentOutcome | null>;
700
+ poiIntent?: (input: NormalizedInputLite, locale: LocaleHint, opts?: PipelineOpts) => Promise<POIQueryResult | null>;
482
701
  /**
483
702
  * The phrase grouper.
484
703
  *