@mailwoman/core 9.3.0 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (441) hide show
  1. package/lib/coarse-placer/tools/{build-dataset.ts → build/dataset.ts} +2 -1
  2. package/lib/coarse-placer/tools/{build-outlier-latin.ts → build/outlier/latin.ts} +4 -3
  3. package/lib/coarse-placer/tools/{eval-openset.ts → eval/openset.ts} +11 -7
  4. package/lib/coarse-placer/tools/{eval-quant-compare.ts → eval/quant-compare.ts} +2 -1
  5. package/lib/coarse-placer/tools/eval.ts +2 -2
  6. package/lib/coarse-placer/tools/index.ts +7 -7
  7. package/lib/coarse-placer/tools/train.ts +4 -6
  8. package/lib/decoder/build-tree.ts +2 -1
  9. package/lib/decoder/containment.ts +2 -1
  10. package/lib/decoder/index.ts +5 -5
  11. package/lib/decoder/parse-diff.ts +1 -1
  12. package/lib/decoder/proposals-to-tree.ts +3 -1
  13. package/lib/decoder/{serialize-json.ts → serialize/json.ts} +3 -2
  14. package/lib/decoder/{serialize-tuples.ts → serialize/tuples.ts} +2 -1
  15. package/lib/decoder/{tree-shape.ts → tree/shape.ts} +7 -10
  16. package/lib/decoder/types.ts +1 -3
  17. package/lib/decoder/unknown-spans.ts +1 -1
  18. package/lib/decoder/validate-tree.ts +2 -1
  19. package/lib/fs/readers/stat.ts +244 -0
  20. package/lib/fs/readers.ts +38 -270
  21. package/lib/fs/streams.ts +58 -0
  22. package/lib/fs/writers.ts +5 -5
  23. package/lib/fs/zip.ts +64 -8
  24. package/lib/git.ts +26 -0
  25. package/lib/layers/coverage.ts +3 -2
  26. package/lib/layers/manifest.ts +2 -4
  27. package/lib/layers/schema.ts +0 -1
  28. package/lib/license/configured.ts +2 -2
  29. package/lib/license/docs-site.ts +1 -15
  30. package/lib/license/index.ts +2 -2
  31. package/lib/license/obligations.ts +4 -1
  32. package/lib/license/stamp.ts +1 -1
  33. package/lib/license/status.ts +1 -1
  34. package/lib/locale/locale.ts +2 -1
  35. package/lib/locale/registry.ts +2 -1
  36. package/lib/module/resolve-from.ts +16 -4
  37. package/lib/objects.ts +9 -1
  38. package/lib/overture-pins.ts +24 -0
  39. package/lib/pipeline/client-result.ts +82 -0
  40. package/lib/pipeline/index.ts +1 -1
  41. package/lib/pipeline/preferences.ts +13 -0
  42. package/lib/pipeline/result.ts +84 -0
  43. package/lib/pipeline/runtime-pipeline.ts +10 -17
  44. package/lib/pipeline/types.ts +28 -88
  45. package/lib/policy/defaults.ts +2 -1
  46. package/lib/policy/policy.ts +3 -1
  47. package/lib/policy/registry.ts +3 -1
  48. package/lib/process.ts +3 -1
  49. package/lib/resolver/authoritative-provider.ts +1 -1
  50. package/lib/resolver/index.ts +1 -8
  51. package/lib/resolver/lookup-types.ts +8 -0
  52. package/lib/resolver/synthetic-id-ranges.ts +83 -0
  53. package/lib/resolver/types.ts +2 -9
  54. package/lib/resources/whosonfirst/placetypes/Placetype.ts +7 -6
  55. package/lib/scripting/arguments.ts +34 -0
  56. package/lib/scripting/utils/index.ts +1 -1
  57. package/lib/strings/case.ts +13 -2
  58. package/lib/strings/format.ts +15 -0
  59. package/lib/tokenization/Graph.ts +3 -4
  60. package/lib/tools/{download-libpostal-resources.ts → download/libpostal-resources.ts} +3 -2
  61. package/lib/tools/generate-language-types.ts +3 -4
  62. package/lib/tools/index.ts +2 -2
  63. package/lib/types/classifier.ts +2 -1
  64. package/lib/types/index.ts +0 -1
  65. package/lib/types/mapping.ts +2 -1
  66. package/lib/workspaces.ts +104 -0
  67. package/out/api/APIClient.d.ts.map +1 -1
  68. package/out/api/arcgis.d.ts.map +1 -1
  69. package/out/api/defaults.d.ts.map +1 -1
  70. package/out/api/headless.d.ts.map +1 -1
  71. package/out/api/ogc.d.ts.map +1 -1
  72. package/out/api/paced-client.js.map +1 -1
  73. package/out/api/pacer.d.ts.map +1 -1
  74. package/out/api/pacer.js.map +1 -1
  75. package/out/api/responses.d.ts.map +1 -1
  76. package/out/api/{test-clocks.d.ts → test/clocks.d.ts} +1 -1
  77. package/out/api/test/clocks.d.ts.map +1 -0
  78. package/out/api/{test-clocks.js → test/clocks.js} +1 -1
  79. package/out/api/test/clocks.js.map +1 -0
  80. package/out/api/{test-transport.d.ts → test/transport.d.ts} +1 -1
  81. package/out/api/test/transport.d.ts.map +1 -0
  82. package/out/api/{test-transport.js → test/transport.js} +1 -1
  83. package/out/api/test/transport.js.map +1 -0
  84. package/out/coarse-placer/coarse-placer.d.ts.map +1 -1
  85. package/out/coarse-placer/coarse-placer.js.map +1 -1
  86. package/out/coarse-placer/featurize.d.ts.map +1 -1
  87. package/out/coarse-placer/tools/{build-dataset.d.ts → build/dataset.d.ts} +1 -1
  88. package/out/coarse-placer/tools/build/dataset.d.ts.map +1 -0
  89. package/out/coarse-placer/tools/{build-dataset.js → build/dataset.js} +3 -2
  90. package/out/coarse-placer/tools/build/dataset.js.map +1 -0
  91. package/out/coarse-placer/tools/{build-outlier-exposure.d.ts → build/outlier/exposure.d.ts} +1 -1
  92. package/out/coarse-placer/tools/build/outlier/exposure.d.ts.map +1 -0
  93. package/out/coarse-placer/tools/{build-outlier-exposure.js → build/outlier/exposure.js} +1 -1
  94. package/out/coarse-placer/tools/build/outlier/exposure.js.map +1 -0
  95. package/out/coarse-placer/tools/{build-outlier-latin.d.ts → build/outlier/latin.d.ts} +3 -3
  96. package/out/coarse-placer/tools/build/outlier/latin.d.ts.map +1 -0
  97. package/out/coarse-placer/tools/{build-outlier-latin.js → build/outlier/latin.js} +4 -3
  98. package/out/coarse-placer/tools/build/outlier/latin.js.map +1 -0
  99. package/out/coarse-placer/tools/{build-outlier-oa.d.ts → build/outlier/oa.d.ts} +1 -1
  100. package/out/coarse-placer/tools/build/outlier/oa.d.ts.map +1 -0
  101. package/out/coarse-placer/tools/{build-outlier-oa.js → build/outlier/oa.js} +1 -1
  102. package/out/coarse-placer/tools/build/outlier/oa.js.map +1 -0
  103. package/out/coarse-placer/tools/country-sets.d.ts.map +1 -1
  104. package/out/coarse-placer/tools/{eval-latin-offmap.d.ts → eval/latin-offmap.d.ts} +1 -1
  105. package/out/coarse-placer/tools/eval/latin-offmap.d.ts.map +1 -0
  106. package/out/coarse-placer/tools/{eval-latin-offmap.js → eval/latin-offmap.js} +1 -1
  107. package/out/coarse-placer/tools/eval/latin-offmap.js.map +1 -0
  108. package/out/coarse-placer/tools/{eval-openset.d.ts → eval/openset.d.ts} +1 -1
  109. package/out/coarse-placer/tools/eval/openset.d.ts.map +1 -0
  110. package/out/coarse-placer/tools/{eval-openset.js → eval/openset.js} +10 -7
  111. package/out/coarse-placer/tools/eval/openset.js.map +1 -0
  112. package/out/coarse-placer/tools/{eval-quant-compare.d.ts → eval/quant-compare.d.ts} +1 -1
  113. package/out/coarse-placer/tools/eval/quant-compare.d.ts.map +1 -0
  114. package/out/coarse-placer/tools/{eval-quant-compare.js → eval/quant-compare.js} +2 -2
  115. package/out/coarse-placer/tools/eval/quant-compare.js.map +1 -0
  116. package/out/coarse-placer/tools/eval.js +2 -2
  117. package/out/coarse-placer/tools/eval.js.map +1 -1
  118. package/out/coarse-placer/tools/index.d.ts +7 -7
  119. package/out/coarse-placer/tools/index.js +7 -7
  120. package/out/coarse-placer/tools/probe-frontier.js.map +1 -1
  121. package/out/coarse-placer/tools/quantize.js.map +1 -1
  122. package/out/coarse-placer/tools/train.d.ts.map +1 -1
  123. package/out/coarse-placer/tools/train.js +2 -3
  124. package/out/coarse-placer/tools/train.js.map +1 -1
  125. package/out/data-root.js.map +1 -1
  126. package/out/decoder/build-tree.d.ts.map +1 -1
  127. package/out/decoder/build-tree.js.map +1 -1
  128. package/out/decoder/containment.d.ts +2 -2
  129. package/out/decoder/containment.d.ts.map +1 -1
  130. package/out/decoder/containment.js.map +1 -1
  131. package/out/decoder/index.d.ts +5 -5
  132. package/out/decoder/index.js +5 -5
  133. package/out/decoder/parse-diff.js +1 -1
  134. package/out/decoder/parse-diff.js.map +1 -1
  135. package/out/decoder/proposals-to-tree.d.ts +2 -1
  136. package/out/decoder/proposals-to-tree.d.ts.map +1 -1
  137. package/out/decoder/proposals-to-tree.js.map +1 -1
  138. package/out/decoder/{serialize-json.d.ts → serialize/json.d.ts} +2 -2
  139. package/out/decoder/serialize/json.d.ts.map +1 -0
  140. package/out/decoder/{serialize-json.js → serialize/json.js} +2 -2
  141. package/out/decoder/serialize/json.js.map +1 -0
  142. package/out/decoder/{serialize-tuples.d.ts → serialize/tuples.d.ts} +2 -2
  143. package/out/decoder/serialize/tuples.d.ts.map +1 -0
  144. package/out/decoder/{serialize-tuples.js → serialize/tuples.js} +1 -1
  145. package/out/decoder/serialize/tuples.js.map +1 -0
  146. package/out/decoder/{serialize-xml.d.ts → serialize/xml.d.ts} +1 -1
  147. package/out/decoder/serialize/xml.d.ts.map +1 -0
  148. package/out/decoder/{serialize-xml.js → serialize/xml.js} +1 -1
  149. package/out/decoder/serialize/xml.js.map +1 -0
  150. package/out/decoder/{tree-shape.d.ts → tree/shape.d.ts} +5 -9
  151. package/out/decoder/tree/shape.d.ts.map +1 -0
  152. package/out/decoder/{tree-shape.js → tree/shape.js} +6 -10
  153. package/out/decoder/tree/shape.js.map +1 -0
  154. package/out/decoder/{tree-walk.d.ts → tree/walk.d.ts} +1 -1
  155. package/out/decoder/tree/walk.d.ts.map +1 -0
  156. package/out/decoder/{tree-walk.js → tree/walk.js} +1 -1
  157. package/out/decoder/tree/walk.js.map +1 -0
  158. package/out/decoder/types.d.ts +1 -2
  159. package/out/decoder/types.d.ts.map +1 -1
  160. package/out/decoder/types.js +1 -1
  161. package/out/decoder/types.js.map +1 -1
  162. package/out/decoder/unknown-spans.js +1 -1
  163. package/out/decoder/validate-tree.d.ts +1 -1
  164. package/out/decoder/validate-tree.d.ts.map +1 -1
  165. package/out/decoder/validate-tree.js.map +1 -1
  166. package/out/env/index.d.ts +1 -1
  167. package/out/env/schema.d.ts +4 -4
  168. package/out/errors/schema.d.ts.map +1 -1
  169. package/out/errors/schema.js.map +1 -1
  170. package/out/fs/formatters.d.ts.map +1 -1
  171. package/out/fs/formatters.js.map +1 -1
  172. package/out/fs/readers/stat.d.ts +126 -0
  173. package/out/fs/readers/stat.d.ts.map +1 -0
  174. package/out/fs/readers/stat.js +202 -0
  175. package/out/fs/readers/stat.js.map +1 -0
  176. package/out/fs/readers.d.ts +16 -149
  177. package/out/fs/readers.d.ts.map +1 -1
  178. package/out/fs/readers.js +19 -230
  179. package/out/fs/readers.js.map +1 -1
  180. package/out/fs/streams.d.ts +33 -0
  181. package/out/fs/streams.d.ts.map +1 -1
  182. package/out/fs/streams.js +49 -0
  183. package/out/fs/streams.js.map +1 -1
  184. package/out/fs/writers.d.ts +5 -5
  185. package/out/fs/writers.js +5 -5
  186. package/out/fs/zip.d.ts +21 -2
  187. package/out/fs/zip.d.ts.map +1 -1
  188. package/out/fs/zip.js +36 -8
  189. package/out/fs/zip.js.map +1 -1
  190. package/out/git.d.ts +15 -0
  191. package/out/git.d.ts.map +1 -1
  192. package/out/git.js +22 -0
  193. package/out/git.js.map +1 -1
  194. package/out/html/document.js.map +1 -1
  195. package/out/json.d.ts.map +1 -1
  196. package/out/layers/coverage.d.ts +1 -1
  197. package/out/layers/coverage.d.ts.map +1 -1
  198. package/out/layers/coverage.js +1 -2
  199. package/out/layers/coverage.js.map +1 -1
  200. package/out/layers/manifest.d.ts +2 -2
  201. package/out/layers/manifest.d.ts.map +1 -1
  202. package/out/layers/manifest.js +2 -3
  203. package/out/layers/manifest.js.map +1 -1
  204. package/out/layers/schema.d.ts +0 -1
  205. package/out/layers/schema.d.ts.map +1 -1
  206. package/out/layers/schema.js +0 -3
  207. package/out/layers/schema.js.map +1 -1
  208. package/out/license/configured.d.ts +1 -1
  209. package/out/license/configured.d.ts.map +1 -1
  210. package/out/license/configured.js +2 -2
  211. package/out/license/configured.js.map +1 -1
  212. package/out/license/docs-site.d.ts +0 -6
  213. package/out/license/docs-site.d.ts.map +1 -1
  214. package/out/license/docs-site.js +1 -12
  215. package/out/license/docs-site.js.map +1 -1
  216. package/out/license/index.d.ts +2 -2
  217. package/out/license/index.d.ts.map +1 -1
  218. package/out/license/index.js +2 -2
  219. package/out/license/index.js.map +1 -1
  220. package/out/license/{key-file.d.ts → key/file.d.ts} +1 -1
  221. package/out/license/key/file.d.ts.map +1 -0
  222. package/out/license/{key-file.js → key/file.js} +1 -1
  223. package/out/license/key/file.js.map +1 -0
  224. package/out/license/{key.d.ts → key/index.d.ts} +1 -1
  225. package/out/license/key/index.d.ts.map +1 -0
  226. package/out/license/{key.js → key/index.js} +1 -1
  227. package/out/license/key/index.js.map +1 -0
  228. package/out/license/obligations.d.ts +1 -1
  229. package/out/license/obligations.d.ts.map +1 -1
  230. package/out/license/obligations.js +3 -0
  231. package/out/license/obligations.js.map +1 -1
  232. package/out/license/publication.js.map +1 -1
  233. package/out/license/register.d.ts.map +1 -1
  234. package/out/license/stamp.d.ts +1 -1
  235. package/out/license/stamp.d.ts.map +1 -1
  236. package/out/license/status.js +1 -1
  237. package/out/license/status.js.map +1 -1
  238. package/out/locale/locale.d.ts +1 -1
  239. package/out/locale/locale.d.ts.map +1 -1
  240. package/out/locale/registry.d.ts.map +1 -1
  241. package/out/locale/registry.js +1 -1
  242. package/out/locale/registry.js.map +1 -1
  243. package/out/locale/zh-cn-units.d.ts.map +1 -1
  244. package/out/logging/shared.d.ts.map +1 -1
  245. package/out/module/resolve-from.d.ts +12 -3
  246. package/out/module/resolve-from.d.ts.map +1 -1
  247. package/out/module/resolve-from.js.map +1 -1
  248. package/out/module/resolvers.js.map +1 -1
  249. package/out/objects.d.ts +6 -0
  250. package/out/objects.d.ts.map +1 -1
  251. package/out/objects.js +8 -1
  252. package/out/objects.js.map +1 -1
  253. package/out/overture-pins.d.ts +24 -0
  254. package/out/overture-pins.d.ts.map +1 -0
  255. package/out/overture-pins.js +24 -0
  256. package/out/overture-pins.js.map +1 -0
  257. package/out/paths.js.map +1 -1
  258. package/out/pipeline/client-result.d.ts +84 -0
  259. package/out/pipeline/client-result.d.ts.map +1 -0
  260. package/out/pipeline/client-result.js +12 -0
  261. package/out/pipeline/client-result.js.map +1 -0
  262. package/out/pipeline/index.d.ts +1 -1
  263. package/out/pipeline/index.d.ts.map +1 -1
  264. package/out/pipeline/preferences.d.ts +13 -0
  265. package/out/pipeline/preferences.d.ts.map +1 -0
  266. package/out/pipeline/preferences.js +7 -0
  267. package/out/pipeline/preferences.js.map +1 -0
  268. package/out/pipeline/result.d.ts +72 -0
  269. package/out/pipeline/result.d.ts.map +1 -0
  270. package/out/pipeline/result.js +7 -0
  271. package/out/pipeline/result.js.map +1 -0
  272. package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
  273. package/out/pipeline/runtime-pipeline.js +7 -13
  274. package/out/pipeline/runtime-pipeline.js.map +1 -1
  275. package/out/pipeline/span-proposer.js.map +1 -1
  276. package/out/pipeline/types.d.ts +23 -85
  277. package/out/pipeline/types.d.ts.map +1 -1
  278. package/out/pipeline/types.js +2 -0
  279. package/out/pipeline/types.js.map +1 -1
  280. package/out/policy/defaults.d.ts +1 -1
  281. package/out/policy/defaults.d.ts.map +1 -1
  282. package/out/policy/defaults.js +1 -1
  283. package/out/policy/defaults.js.map +1 -1
  284. package/out/policy/policy.d.ts +2 -1
  285. package/out/policy/policy.d.ts.map +1 -1
  286. package/out/policy/proposal-collection.js.map +1 -1
  287. package/out/policy/registry.d.ts +2 -1
  288. package/out/policy/registry.d.ts.map +1 -1
  289. package/out/policy/registry.js.map +1 -1
  290. package/out/process.d.ts +2 -2
  291. package/out/process.d.ts.map +1 -1
  292. package/out/process.js.map +1 -1
  293. package/out/random.d.ts.map +1 -1
  294. package/out/release-config.js.map +1 -1
  295. package/out/resolver/authoritative-provider.d.ts +1 -1
  296. package/out/resolver/authoritative-provider.d.ts.map +1 -1
  297. package/out/resolver/fixture-authoritative-provider.js.map +1 -1
  298. package/out/resolver/index.d.ts +2 -2
  299. package/out/resolver/index.d.ts.map +1 -1
  300. package/out/resolver/index.js +1 -1
  301. package/out/resolver/index.js.map +1 -1
  302. package/out/resolver/lookup-types.d.ts +8 -0
  303. package/out/resolver/lookup-types.d.ts.map +1 -1
  304. package/out/resolver/synthetic-id-ranges.d.ts +66 -0
  305. package/out/resolver/synthetic-id-ranges.d.ts.map +1 -0
  306. package/out/resolver/synthetic-id-ranges.js +73 -0
  307. package/out/resolver/synthetic-id-ranges.js.map +1 -0
  308. package/out/resolver/types.d.ts +1 -2
  309. package/out/resolver/types.d.ts.map +1 -1
  310. package/out/resolver/types.js +0 -1
  311. package/out/resolver/types.js.map +1 -1
  312. package/out/resources/languages/index.js.map +1 -1
  313. package/out/resources/languages/types.gen.d.ts.map +1 -1
  314. package/out/resources/locale.d.ts.map +1 -1
  315. package/out/resources/set.d.ts.map +1 -1
  316. package/out/resources/set.js.map +1 -1
  317. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts +1 -1
  318. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts.map +1 -1
  319. package/out/resources/whosonfirst/placetypes/Placetype.d.ts.map +1 -1
  320. package/out/resources/whosonfirst/placetypes/Placetype.js +7 -6
  321. package/out/resources/whosonfirst/placetypes/Placetype.js.map +1 -1
  322. package/out/resources/whosonfirst/placetypes/admin.d.ts +1 -1
  323. package/out/resources/whosonfirst/placetypes/admin.d.ts.map +1 -1
  324. package/out/resources/whosonfirst/placetypes/definition.d.ts.map +1 -1
  325. package/out/resources/whosonfirst/placetypes/mermaid.d.ts.map +1 -1
  326. package/out/resources/whosonfirst/placetypes/mermaid.js.map +1 -1
  327. package/out/routing/index.d.ts.map +1 -1
  328. package/out/routing/index.js.map +1 -1
  329. package/out/scripting/arguments.d.ts +7 -0
  330. package/out/scripting/arguments.d.ts.map +1 -1
  331. package/out/scripting/arguments.js +29 -0
  332. package/out/scripting/arguments.js.map +1 -1
  333. package/out/scripting/command.d.ts.map +1 -1
  334. package/out/scripting/ingest-chunk-script.d.ts.map +1 -1
  335. package/out/scripting/utils/index.d.ts +1 -1
  336. package/out/scripting/utils/index.d.ts.map +1 -1
  337. package/out/scripting/utils/index.js +1 -1
  338. package/out/scripting/utils/index.js.map +1 -1
  339. package/out/strings/case.d.ts +3 -0
  340. package/out/strings/case.d.ts.map +1 -1
  341. package/out/strings/case.js +12 -2
  342. package/out/strings/case.js.map +1 -1
  343. package/out/strings/format.d.ts +6 -0
  344. package/out/strings/format.d.ts.map +1 -1
  345. package/out/strings/format.js +12 -0
  346. package/out/strings/format.js.map +1 -1
  347. package/out/strings/python-json.js.map +1 -1
  348. package/out/tokenization/Graph.d.ts +3 -0
  349. package/out/tokenization/Graph.d.ts.map +1 -1
  350. package/out/tokenization/Graph.js +0 -4
  351. package/out/tokenization/Graph.js.map +1 -1
  352. package/out/tokenization/Span.d.ts.map +1 -1
  353. package/out/tokenization/Span.js.map +1 -1
  354. package/out/tokenization/normalizer.d.ts.map +1 -1
  355. package/out/tokenization/normalizer.js.map +1 -1
  356. package/out/tools/{download-libpostal-resources.d.ts → download/libpostal-resources.d.ts} +1 -1
  357. package/out/tools/download/libpostal-resources.d.ts.map +1 -0
  358. package/out/tools/{download-libpostal-resources.js → download/libpostal-resources.js} +4 -3
  359. package/out/tools/download/libpostal-resources.js.map +1 -0
  360. package/out/tools/{download-ssl-address.d.ts → download/ssl-address.d.ts} +1 -1
  361. package/out/tools/download/ssl-address.d.ts.map +1 -0
  362. package/out/tools/{download-ssl-address.js → download/ssl-address.js} +1 -1
  363. package/out/tools/download/ssl-address.js.map +1 -0
  364. package/out/tools/generate-language-types.d.ts.map +1 -1
  365. package/out/tools/generate-language-types.js +3 -4
  366. package/out/tools/generate-language-types.js.map +1 -1
  367. package/out/tools/index.d.ts +2 -2
  368. package/out/tools/index.js +2 -2
  369. package/out/types/Classification.d.ts +2 -2
  370. package/out/types/Classification.d.ts.map +1 -1
  371. package/out/types/classifier.d.ts +1 -1
  372. package/out/types/classifier.d.ts.map +1 -1
  373. package/out/types/index.d.ts +0 -1
  374. package/out/types/index.d.ts.map +1 -1
  375. package/out/types/index.js +0 -1
  376. package/out/types/index.js.map +1 -1
  377. package/out/types/mapping.d.ts +1 -1
  378. package/out/types/mapping.d.ts.map +1 -1
  379. package/out/types/mapping.js.map +1 -1
  380. package/out/utils/time.js.map +1 -1
  381. package/out/workspaces.d.ts +31 -0
  382. package/out/workspaces.d.ts.map +1 -0
  383. package/out/workspaces.js +72 -0
  384. package/out/workspaces.js.map +1 -0
  385. package/package.json +84 -55
  386. package/lib/resolver/placetype-map.ts +0 -130
  387. package/lib/types/component.ts +0 -96
  388. package/out/api/test-clocks.d.ts.map +0 -1
  389. package/out/api/test-clocks.js.map +0 -1
  390. package/out/api/test-transport.d.ts.map +0 -1
  391. package/out/api/test-transport.js.map +0 -1
  392. package/out/coarse-placer/tools/build-dataset.d.ts.map +0 -1
  393. package/out/coarse-placer/tools/build-dataset.js.map +0 -1
  394. package/out/coarse-placer/tools/build-outlier-exposure.d.ts.map +0 -1
  395. package/out/coarse-placer/tools/build-outlier-exposure.js.map +0 -1
  396. package/out/coarse-placer/tools/build-outlier-latin.d.ts.map +0 -1
  397. package/out/coarse-placer/tools/build-outlier-latin.js.map +0 -1
  398. package/out/coarse-placer/tools/build-outlier-oa.d.ts.map +0 -1
  399. package/out/coarse-placer/tools/build-outlier-oa.js.map +0 -1
  400. package/out/coarse-placer/tools/eval-latin-offmap.d.ts.map +0 -1
  401. package/out/coarse-placer/tools/eval-latin-offmap.js.map +0 -1
  402. package/out/coarse-placer/tools/eval-openset.d.ts.map +0 -1
  403. package/out/coarse-placer/tools/eval-openset.js.map +0 -1
  404. package/out/coarse-placer/tools/eval-quant-compare.d.ts.map +0 -1
  405. package/out/coarse-placer/tools/eval-quant-compare.js.map +0 -1
  406. package/out/decoder/serialize-json.d.ts.map +0 -1
  407. package/out/decoder/serialize-json.js.map +0 -1
  408. package/out/decoder/serialize-tuples.d.ts.map +0 -1
  409. package/out/decoder/serialize-tuples.js.map +0 -1
  410. package/out/decoder/serialize-xml.d.ts.map +0 -1
  411. package/out/decoder/serialize-xml.js.map +0 -1
  412. package/out/decoder/tree-shape.d.ts.map +0 -1
  413. package/out/decoder/tree-shape.js.map +0 -1
  414. package/out/decoder/tree-walk.d.ts.map +0 -1
  415. package/out/decoder/tree-walk.js.map +0 -1
  416. package/out/license/key-file.d.ts.map +0 -1
  417. package/out/license/key-file.js.map +0 -1
  418. package/out/license/key.d.ts.map +0 -1
  419. package/out/license/key.js.map +0 -1
  420. package/out/resolver/placetype-map.d.ts +0 -76
  421. package/out/resolver/placetype-map.d.ts.map +0 -1
  422. package/out/resolver/placetype-map.js +0 -106
  423. package/out/resolver/placetype-map.js.map +0 -1
  424. package/out/tools/download-libpostal-resources.d.ts.map +0 -1
  425. package/out/tools/download-libpostal-resources.js.map +0 -1
  426. package/out/tools/download-ssl-address.d.ts.map +0 -1
  427. package/out/tools/download-ssl-address.js.map +0 -1
  428. package/out/types/component.d.ts +0 -50
  429. package/out/types/component.d.ts.map +0 -1
  430. package/out/types/component.js +0 -84
  431. package/out/types/component.js.map +0 -1
  432. /package/lib/api/{test-clocks.ts → test/clocks.ts} +0 -0
  433. /package/lib/api/{test-transport.ts → test/transport.ts} +0 -0
  434. /package/lib/coarse-placer/tools/{build-outlier-exposure.ts → build/outlier/exposure.ts} +0 -0
  435. /package/lib/coarse-placer/tools/{build-outlier-oa.ts → build/outlier/oa.ts} +0 -0
  436. /package/lib/coarse-placer/tools/{eval-latin-offmap.ts → eval/latin-offmap.ts} +0 -0
  437. /package/lib/decoder/{serialize-xml.ts → serialize/xml.ts} +0 -0
  438. /package/lib/decoder/{tree-walk.ts → tree/walk.ts} +0 -0
  439. /package/lib/license/{key-file.ts → key/file.ts} +0 -0
  440. /package/lib/license/{key.ts → key/index.ts} +0 -0
  441. /package/lib/tools/{download-ssl-address.ts → download/ssl-address.ts} +0 -0
@@ -10,8 +10,8 @@
10
10
  * every invocation.
11
11
  */
12
12
 
13
- import { verifyLicenseKey, type LicenseKeyVerification } from "#license/key"
14
- import { readConfiguredLicenseToken } from "#license/key-file"
13
+ import { readConfiguredLicenseToken } from "#license/key/file"
14
+ import { verifyLicenseKey, type LicenseKeyVerification } from "#license/key/index"
15
15
  import { trustedLicenseSigningKeys } from "#license/register"
16
16
 
17
17
  /**
@@ -8,27 +8,13 @@
8
8
  */
9
9
 
10
10
  import { $public } from "#env"
11
+ import { withoutTrailingSlashes } from "#strings/format"
11
12
 
12
13
  /**
13
14
  * The docs site when `MAILWOMAN_DOCS_URL` is unset.
14
15
  */
15
16
  export const DEFAULT_DOCS_URL = "https://mailwoman.ai"
16
17
 
17
- /**
18
- * An origin with its trailing slashes removed, so a path can be appended by concatenation. A loop rather than
19
- * `/\/+$/u`: the input is configuration, and a regex anchored after a repeated class backtracks in time quadratic in
20
- * the run of slashes it is handed.
21
- */
22
- export function withoutTrailingSlashes(url: string): string {
23
- let end = url.length
24
-
25
- while (end > 0 && url[end - 1] === "/") {
26
- end -= 1
27
- }
28
-
29
- return url.slice(0, end)
30
- }
31
-
32
18
  /**
33
19
  * The docs site's base URL with no trailing slash.
34
20
  */
@@ -11,8 +11,8 @@
11
11
 
12
12
  export * from "#license/configured"
13
13
  export * from "#license/docs-site"
14
- export * from "#license/key"
15
- export * from "#license/key-file"
14
+ export * from "#license/key/index"
15
+ export * from "#license/key/file"
16
16
  export * from "#license/obligations"
17
17
  export * from "#license/register"
18
18
  export * from "#license/stamp"
@@ -8,7 +8,7 @@
8
8
  * known to carry, and it says `recognized: false` for an identifier it does not know rather than guessing.
9
9
  */
10
10
 
11
- import type { LicenseKeyVerification } from "#license/key"
11
+ import type { LicenseKeyVerification } from "#license/key/index"
12
12
  import type { LicenseKeyPublication } from "#license/publication"
13
13
 
14
14
  /**
@@ -52,6 +52,9 @@ const KNOWN_OBLIGATIONS: ReadonlyMap<string, readonly LicenseObligation[]> = new
52
52
  ["LicenseRef-USGov-Public-Domain", []],
53
53
  // Licence Ouverte 2.0 (etalab), BAN's elected license.
54
54
  ["etalab-2.0", [LicenseObligation.Attribution]],
55
+ // 政府資料開放授權條款-第1版, the Taiwanese civil-affairs address registers behind Overture-TW. Attribution is the
56
+ // condition of the grant itself: the license voids without the 顯名聲明, so the per-agency list travels with the data.
57
+ ["OGDL-Taiwan-1.0", [LicenseObligation.Attribution]],
55
58
  ["MIT", [LicenseObligation.Attribution]],
56
59
  ["Apache-2.0", [LicenseObligation.Attribution]],
57
60
  ])
@@ -14,7 +14,7 @@
14
14
  */
15
15
 
16
16
  import { docsSiteURL } from "#license/docs-site"
17
- import type { LicenseKeyVerification } from "#license/key"
17
+ import type { LicenseKeyVerification } from "#license/key/index"
18
18
  import { appliedLicenseBranch } from "#license/obligations"
19
19
 
20
20
  /**
@@ -14,8 +14,8 @@ import type { CacheRequestConfig } from "axios-cache-interceptor"
14
14
  import { APIClient, type APIClientConfig } from "#api/APIClient"
15
15
  import { $public } from "#env"
16
16
  import { ResourceError } from "#errors/schema"
17
- import { withoutTrailingSlashes } from "#license/docs-site"
18
17
  import { silentLogger } from "#logging/index"
18
+ import { withoutTrailingSlashes } from "#strings/format"
19
19
 
20
20
  /**
21
21
  * The license worker when `MAILWOMAN_LICENSE_URL` is unset.
@@ -13,8 +13,9 @@
13
13
  * task-3 follow-up in DECISIONS.md).
14
14
  */
15
15
 
16
+ import type { ComponentTag } from "@mailwoman/codex/component"
17
+
16
18
  import type { ClassifierPolicy } from "#policy/policy"
17
- import type { ComponentTag } from "#types"
18
19
 
19
20
  export interface LocaleProfile {
20
21
  /**
@@ -9,8 +9,9 @@
9
9
  * §LocaleProfile validation rule).
10
10
  */
11
11
 
12
+ import { COMPONENT_TAGS, type ComponentTag } from "@mailwoman/codex/component"
13
+
12
14
  import type { LocaleProfile, LocaleRegistry } from "#locale/locale"
13
- import { COMPONENT_TAGS, type ComponentTag } from "#types"
14
15
 
15
16
  const COMPONENT_TAG_SET = new Set<ComponentTag>(COMPONENT_TAGS)
16
17
 
@@ -47,22 +47,34 @@ export function resolvePackagePathFrom(base: string, packageName: string, ...seg
47
47
  return resolvePath(dirname(resolvePackageJSON(base, packageName)), ...segments)
48
48
  }
49
49
 
50
- export type PackageJSONLike<D extends object = object> = PackageJson & D
50
+ /**
51
+ * The `mailwoman` block this repository's own manifests may carry. A data-only weights overlay names the base package
52
+ * it shares `model.onnx` and `tokenizer.model` with, which is the field `@mailwoman/neural` follows to find them.
53
+ */
54
+ export interface MailwomanManifestFields {
55
+ mailwoman?: {
56
+ baseWeights?: string
57
+ }
58
+ }
59
+
60
+ export type PackageJSONLike<D extends object = MailwomanManifestFields> = PackageJson & D
51
61
 
52
62
  /**
53
63
  * Read and parse a package's `package.json`, given its path from {@link resolvePackageJSON}.
54
64
  */
55
- export async function readPackageJSON<D extends object = object>(manifestPath: string): Promise<PackageJSONLike<D>>
65
+ export async function readPackageJSON<D extends object = MailwomanManifestFields>(
66
+ manifestPath: string
67
+ ): Promise<PackageJSONLike<D>>
56
68
 
57
69
  /**
58
70
  * Read and parse a package's `package.json`, resolving the package from the caller's `import.meta.url`.
59
71
  */
60
- export async function readPackageJSON<D extends object = object>(
72
+ export async function readPackageJSON<D extends object = MailwomanManifestFields>(
61
73
  base: string,
62
74
  packageName: string
63
75
  ): Promise<PackageJSONLike<D>>
64
76
 
65
- export async function readPackageJSON<D extends object = object>(
77
+ export async function readPackageJSON<D extends object = MailwomanManifestFields>(
66
78
  first: string,
67
79
  packageName?: string
68
80
  ): Promise<PackageJSONLike<D>> {
package/lib/objects.ts CHANGED
@@ -6,9 +6,17 @@
6
6
  * Utility functions for working with objects.
7
7
  */
8
8
 
9
- import { isIterable } from "spliterator"
10
9
  import type { JsonObject } from "type-fest"
11
10
 
11
+ /**
12
+ * True when `value` carries `Symbol.iterator`: arrays, sets, maps, strings, generators. `null` and `undefined` answer
13
+ * false. The same predicate exists in `spliterator`, whose barrel also carries that library's Node fs, worker-thread
14
+ * and XLSX readers; this module is on the browser client's static import path, so it must not reach that barrel.
15
+ */
16
+ export function isIterable(value: unknown): value is Iterable<unknown> {
17
+ return Symbol.iterator in new Object(value)
18
+ }
19
+
12
20
  export function isPlainObject(value: unknown): value is Record<string, unknown> {
13
21
  return typeof value === "object" && value !== null && !Array.isArray(value)
14
22
  }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ * @file The pinned Overture release for the ADDRESSES theme.
6
+ *
7
+ * Overture publishes one release tag across its themes and prunes old releases from the bucket on roughly a monthly
8
+ * window, so every reader carries a pin. The pins are per THEME, not per tool: the divisions theme (the admin
9
+ * gazetteer) and the places theme (poi.db) are pinned together in `mailwoman`'s gazetteer pipeline (`defaults.ts`,
10
+ * `poi/defaults.ts`), and bumping them is a new-vintage decision for those artifacts. This is the third pin, for the
11
+ * addresses theme every address-point, postcode-centroid, district and coarse-placer build reads, and it lives in
12
+ * core because readers exist on both sides of the `mailwoman` boundary.
13
+ *
14
+ * Five tools carried their own literal before this constant existed, at two different releases, and one of them
15
+ * would have defaulted to a directory that holds no addresses parquet at all: on the lab data root the addresses
16
+ * theme is fetched at `2026-06-17.0` (53 country parquets), the older `2026-05-20.0` holds 23, and the divisions
17
+ * pin's directory holds none. A tool that needs another vintage takes it through its own `--release` option; the
18
+ * default is this one, so the vintage a build read is the vintage the corpus and the CJK board were built from.
19
+ */
20
+
21
+ /**
22
+ * The addresses-theme release directory under `<data-root>/overture/`.
23
+ */
24
+ export const OVERTURE_ADDRESSES_RELEASE = "2026-06-17.0"
@@ -0,0 +1,82 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * The parse result as a client renders it: what the browser runtime produces after classify + resolve, and what
7
+ * `@mailwoman/react` takes as input. One definition, because a producer and a renderer that each write the shape
8
+ * agree only by accident. Every field a stage may leave unset is optional here; a renderer that needs a value it
9
+ * cannot see shows absence, never a default.
10
+ */
11
+
12
+ export interface ParsedComponent {
13
+ tag: string
14
+ value?: unknown
15
+ confidence?: number
16
+ start?: number
17
+ end?: number
18
+ }
19
+
20
+ export interface ResolvedPlaceView {
21
+ id: number
22
+ name: string
23
+ placetype: string
24
+ lat: number
25
+ lon: number
26
+ score: number
27
+ bbox?: { minLat: number; maxLat: number; minLon: number; maxLon: number }
28
+ /**
29
+ * How the coordinate was reached when a street-tier lookup answered: a rooftop point, or an interpolation along the
30
+ * segment. Absent for a gazetteer place.
31
+ */
32
+ tier?: "address_point" | "interpolated"
33
+ uncertaintyM?: number
34
+ }
35
+
36
+ export interface DualRoleView {
37
+ id: number
38
+ name: string
39
+ placetype: string
40
+ relationshipType: string
41
+ role: string
42
+ }
43
+
44
+ export interface StageTiming {
45
+ shape: number
46
+ classify: number
47
+ resolve?: number
48
+ }
49
+
50
+ export interface FSTProvenance {
51
+ builtAt: string
52
+ stateCount: number
53
+ placeCount: number
54
+ importanceMatches: number
55
+ }
56
+
57
+ /**
58
+ * The query kind as a client shows it. `kind` is any string here, where the pipeline's own `QueryKindResult` carries
59
+ * the typed union, because a renderer must show a kind it does not know rather than refuse the result.
60
+ */
61
+ export interface KindView {
62
+ kind: string
63
+ confidence: number
64
+ alternatives: ReadonlyArray<{ kind: string; confidence: number }>
65
+ }
66
+
67
+ export interface ParseResult {
68
+ input: string
69
+ /**
70
+ * The decoder's `AddressTree`, opaque here so this module stays free of the decoder's types; a renderer that walks it
71
+ * imports `@mailwoman/core/decoder/types`.
72
+ */
73
+ tree: unknown
74
+ nodes: ParsedComponent[]
75
+ kindResult?: KindView
76
+ timing?: StageTiming
77
+ resolved: ResolvedPlaceView | null
78
+ candidates: ResolvedPlaceView[]
79
+ fstActive: boolean
80
+ fstProvenance?: FSTProvenance | null
81
+ dualRoles?: DualRoleView[]
82
+ }
@@ -27,8 +27,8 @@ export type {
27
27
  ClassifierOpts,
28
28
  FSTMatcherLike,
29
29
  InputMode,
30
+ LocaleDetector,
30
31
  LocaleHint,
31
- LocaleTag,
32
32
  MachinePreferences,
33
33
  NormalizedInputLite,
34
34
  PhraseGrouper,
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @file Runtime pipeline host preferences.
5
+ */
6
+
7
+ /**
8
+ * Independent host/browser preferences. A timezone is evidence, never a locale conversion.
9
+ */
10
+ export interface MachinePreferences {
11
+ locale?: Intl.UnicodeBCP47LocaleIdentifier
12
+ timeZone?: string
13
+ }
@@ -0,0 +1,84 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @file Runtime pipeline result contract.
5
+ */
6
+
7
+ import type { AddressTree } from "#decoder/types"
8
+ import type {
9
+ LocaleHint,
10
+ NormalizedInputLite,
11
+ PhraseProposal,
12
+ PipelineTiming,
13
+ PipelineFaultStage,
14
+ QueryIntentMarker,
15
+ QueryKindResult,
16
+ QueryShapeLite,
17
+ POIIntentOutcome,
18
+ } from "#pipeline/types"
19
+
20
+ /**
21
+ * One stage crash the coordinator caught and degraded past.
22
+ *
23
+ * A fault is NOT an error return: `runPipeline` still resolves, and `tree` still carries whatever the remaining stages
24
+ * could prove. What the fault buys the caller is the ability to tell "the model faulted and the rule-based stages
25
+ * filled the tree back in" apart from "the model ran and found nothing" — which, before #40, was impossible from the
26
+ * outside. See the `safeClassify` docstring for the measured failure this was written against.
27
+ */
28
+ export interface PipelineFault {
29
+ stage: PipelineFaultStage
30
+ /**
31
+ * The thrown value's `name` (`TypeError`, `RangeError`, …), or `"Error"` when something that isn't an `Error` was
32
+ * thrown. Machine-stable enough to branch on; the `cause` carries the rest.
33
+ */
34
+ name: string
35
+ message: string
36
+ /**
37
+ * The value the stage threw, verbatim — kept so a caller can rethrow it or read its stack. Not JSON-serializable in
38
+ * the useful sense; serialize `stage`/`name`/`message` when you need this on a wire.
39
+ */
40
+ cause: unknown
41
+ }
42
+
43
+ /**
44
+ * Result of one `runPipeline` call.
45
+ */
46
+ export interface PipelineResult {
47
+ input: string
48
+ normalized: NormalizedInputLite
49
+ queryShape: QueryShapeLite
50
+ locale: LocaleHint
51
+ kind: QueryKindResult
52
+ /**
53
+ * Stage 2.7 phrase proposals when a grouper was wired. Empty array when the coordinator ran with no grouper
54
+ * (pre-v0.5.0 callers) or when the fast-path skipped Stage 2.7. Stage 3 consumes this as conditioning; Stage 5
55
+ * consumes it as boundary candidates.
56
+ */
57
+ phraseProposals: PhraseProposal[]
58
+ tree: AddressTree
59
+ /**
60
+ * Present only when the poi-intent stage produced an outcome (path === "poi").
61
+ */
62
+ poiIntent?: POIIntentOutcome
63
+ timing: PipelineTiming
64
+ /**
65
+ * Every stage crash the coordinator caught and degraded past, in the order they happened. **Always present** — an
66
+ * empty array is the coordinator stating that no stage faulted, which is a different claim from a missing field.
67
+ * Non-empty means the tree you are holding was produced with at least one stage down; see {@link PipelineFault}.
68
+ */
69
+ faults: PipelineFault[]
70
+ /**
71
+ * Query-intent advisories (ROAD_TO_V9 §4), lifted from the kind classifier's verdict. **Always present** — an empty
72
+ * array is the coordinator stating that the intent vocabulary examined this query and had nothing to say, which is a
73
+ * different claim from a missing field (the {@link faults} discipline, same reasoning).
74
+ *
75
+ * Nothing here changed which answer won. The markers are advisory by construction: the two intent kinds that could
76
+ * have displaced a structural incumbent are scored below it, and the two that do win the top slot (`near_me`,
77
+ * `poi_category`) route exactly as their incumbents did.
78
+ */
79
+ intentMarkers: QueryIntentMarker[]
80
+ /**
81
+ * Which path the coordinator took. `"fast-path"` skipped stages 3-5; `"poi"` took the intent branch.
82
+ */
83
+ path: "fast-path" | "full" | "poi"
84
+ }
@@ -12,7 +12,9 @@
12
12
  * Implementation contract per `docs/engineering/reference/STAGES.md`.
13
13
  */
14
14
 
15
- import { isBareTreeOf } from "#decoder/tree-shape"
15
+ import type { ComponentTag } from "@mailwoman/codex/component"
16
+
17
+ import { isBareTreeOf } from "#decoder/tree/shape"
16
18
  import type { AddressNode, AddressTree } from "#decoder/types"
17
19
  import { errorMessage } from "#errors/schema"
18
20
  import { PipelineFaultStage, WORD_CONSISTENCY_SHIP_DEFAULT, deriveInputMode } from "#pipeline/types"
@@ -21,7 +23,6 @@ import type {
21
23
  FSTMatcherLike,
22
24
  InputMode,
23
25
  LocaleHint,
24
- LocaleTag,
25
26
  NormalizedInputLite,
26
27
  PhraseProposal,
27
28
  PipelineFault,
@@ -33,7 +34,6 @@ import type {
33
34
  QueryShapeLite,
34
35
  RuntimePipelineStages,
35
36
  } from "#pipeline/types"
36
- import type { ComponentTag } from "#types/component"
37
37
 
38
38
  /**
39
39
  * Kind confidence required to skip the full pipeline. Set high deliberately: a short-circuit that fires on a wrong kind
@@ -49,21 +49,14 @@ const SHORT_CIRCUIT_MIN_CONFIDENCE = 0.95
49
49
  const SHORT_CIRCUIT_MAX_LOCALITY_LENGTH = 30
50
50
 
51
51
  /**
52
- * Known QueryShape format strings that indicate "this token is a postcode". Mirrors the set in
53
- * `@mailwoman/kind-classifier` — kept duplicated so core/pipeline has no dep on kind-classifier.
52
+ * Whether a QueryShape known-format name names a postcode shape. `@mailwoman/query-shape` owns the format table and its
53
+ * naming convention — `us_zip`, `us_zip4`, or `<cc>_postcode` — and its test pins every table entry to that convention;
54
+ * this package cannot depend on query-shape, so it reads the convention rather than a copied list. The copied list it
55
+ * replaces held seven of the table's twelve names, so a Dutch, Czech, Slovak, Swedish or Greek postcode passed the
56
+ * query-shape and kind-classifier checks and missed this pipeline's own.
54
57
  */
55
- const POSTCODE_FORMATS: ReadonlySet<string> = new Set([
56
- "us_zip",
57
- "us_zip4",
58
- "uk_postcode",
59
- "fr_postcode",
60
- "de_postcode",
61
- "ca_postcode",
62
- "jp_postcode",
63
- ])
64
-
65
58
  function isPostcodeFormat(format: string): boolean {
66
- return POSTCODE_FORMATS.has(format)
59
+ return format === "us_zip" || format === "us_zip4" || format.endsWith("_postcode")
67
60
  }
68
61
 
69
62
  /**
@@ -193,7 +186,7 @@ function emptyQueryShape(): QueryShapeLite {
193
186
  async function defaultDetectLocale(
194
187
  _input: NormalizedInputLite,
195
188
  _shape: QueryShapeLite,
196
- opts?: { hint?: LocaleTag }
189
+ opts?: { hint?: Intl.UnicodeBCP47LocaleIdentifier }
197
190
  ): Promise<LocaleHint> {
198
191
  const locale = opts?.hint ?? "und"
199
192
 
@@ -14,18 +14,12 @@
14
14
  */
15
15
 
16
16
  import type { AddressTree } from "#decoder/types"
17
+ import type { MachinePreferences } from "#pipeline/preferences"
17
18
  import type { ResolveOpts, Resolver, ResolverBackend } from "#resolver/types"
18
19
  import type { Section } from "#types/classifier"
19
20
 
20
- export type LocaleTag = string
21
-
22
- /**
23
- * Independent host/browser preferences. A timezone is evidence, never a locale conversion.
24
- */
25
- export interface MachinePreferences {
26
- locale?: LocaleTag
27
- timeZone?: string
28
- }
21
+ export { type PipelineFault, type PipelineResult } from "#pipeline/result"
22
+ export { type MachinePreferences } from "#pipeline/preferences"
29
23
 
30
24
  /**
31
25
  * Optional user-location signal for Stage 6 resolver scoring.
@@ -37,7 +31,8 @@ export type UserLocation = { lat: number; lon: number } | { country: string } |
37
31
  * so this is a PURE PASSTHROUGH: core never constructs or inspects it — it threads the value verbatim from
38
32
  * {@link PipelineOpts.placetypePair} into {@link ClassifierOpts.placetypePair}, and on into the neural classifier's
39
33
  * `parse` opts, where it is typed concretely (`PlacetypePairPriorOpts | false`). The browser demo produces it via
40
- * `neural-web`'s `LoadResult.selectPairIndexForText`. `undefined` (the default) is the byte-stable no-prior decode.
34
+ * `@mailwoman/neural/web-loader`'s `LoadResult.selectPairIndexForText`. `undefined` (the default) is the byte-stable
35
+ * no-prior decode.
41
36
  */
42
37
  export type PlacetypePairPassthrough = object | false
43
38
 
@@ -45,7 +40,7 @@ export type PlacetypePairPassthrough = object | false
45
40
  * Common opts threaded through every stage.
46
41
  */
47
42
  export interface PipelineOpts {
48
- locale?: LocaleTag
43
+ locale?: Intl.UnicodeBCP47LocaleIdentifier
49
44
  userLocation?: UserLocation
50
45
  /**
51
46
  * Explicit input register (operator Decision A / GTM B10 — see {@link InputMode}). When unset the pipeline derives it
@@ -74,9 +69,9 @@ export interface PipelineOpts {
74
69
  /**
75
70
  * Placetype-pair prior (placetype-pair-prior arc, #1278) — an opaque, per-parse decode-channel handle threaded
76
71
  * verbatim to `ClassifierOpts.placetypePair` (and on to the neural classifier's `parse`). The browser demo derives it
77
- * per input via `neural-web`'s `LoadResult.selectPairIndexForText` (locale-hint over the text shape) so a GB/NZ input
78
- * gets its dependent_locality-resurrecting prior while a US/FR input stays byte-stable. `undefined` (default) = no
79
- * prior. See {@link PlacetypePairPassthrough}.
72
+ * per input via `@mailwoman/neural/web-loader`'s `LoadResult.selectPairIndexForText` (locale-hint over the text
73
+ * shape) so a GB/NZ input gets its dependent_locality-resurrecting prior while a US/FR input stays byte-stable.
74
+ * `undefined` (default) = no prior. See {@link PlacetypePairPassthrough}.
80
75
  */
81
76
  placetypePair?: PlacetypePairPassthrough
82
77
  /**
@@ -128,9 +123,9 @@ export interface QueryShapeLite {
128
123
  * Detected (or asserted) locale + alternatives.
129
124
  */
130
125
  export interface LocaleHint {
131
- locale: LocaleTag
126
+ locale: Intl.UnicodeBCP47LocaleIdentifier
132
127
  confidence: number
133
- alternatives: ReadonlyArray<{ locale: LocaleTag; confidence: number }>
128
+ alternatives: ReadonlyArray<{ locale: Intl.UnicodeBCP47LocaleIdentifier; confidence: number }>
134
129
  source: "caller" | "environment" | "machine" | "detected" | "ensemble"
135
130
  /**
136
131
  * Diagnostic provenance for inferred preferences. Locale and timezone remain independent signals.
@@ -138,7 +133,7 @@ export interface LocaleHint {
138
133
  evidence?: {
139
134
  intlLocale?: string
140
135
  timeZone?: string
141
- environmentLocale?: string
136
+ environmentLocale?: Intl.UnicodeBCP47LocaleIdentifier
142
137
  }
143
138
  }
144
139
 
@@ -522,6 +517,21 @@ export interface AddressClassifier {
522
517
  parse(text: string, opts?: ClassifierOpts): Promise<AddressTree>
523
518
  }
524
519
 
520
+ /**
521
+ * The Stage-2 locale detector the coordinator calls: the normalized input and its shape in, a {@link LocaleHint} out.
522
+ * The caller's hint wins outright; an environment locale sits below it and above inferred machine preferences.
523
+ * `@mailwoman/locale-hint` implements it over the query shape alone.
524
+ */
525
+ export type LocaleDetector = (
526
+ input: NormalizedInputLite,
527
+ shape: QueryShapeLite,
528
+ opts?: {
529
+ hint?: Intl.UnicodeBCP47LocaleIdentifier
530
+ machinePreferences?: MachinePreferences
531
+ environmentLocale?: Intl.UnicodeBCP47LocaleIdentifier
532
+ }
533
+ ) => Promise<LocaleHint>
534
+
525
535
  /**
526
536
  * Injectable stage implementations. All optional — when a stage is absent, the coordinator either skips it (resolver)
527
537
  * or substitutes a no-op stub (normalize / queryShape / `@mailwoman/locale-check` stage / kind classifier). The
@@ -531,11 +541,7 @@ export interface AddressClassifier {
531
541
  export interface RuntimePipelineStages {
532
542
  normalize?: (raw: string, opts?: { locale?: string }) => NormalizedInputLite
533
543
  computeQueryShape?: (input: NormalizedInputLite | string, opts?: { locale?: string }) => QueryShapeLite
534
- detectLocale?: (
535
- input: NormalizedInputLite,
536
- shape: QueryShapeLite,
537
- opts?: { hint?: LocaleTag; machinePreferences?: MachinePreferences; environmentLocale?: LocaleTag }
538
- ) => Promise<LocaleHint>
544
+ detectLocale?: LocaleDetector
539
545
  classifyKind?: (input: NormalizedInputLite, shape: QueryShapeLite, locale: LocaleHint) => Promise<QueryKindResult>
540
546
  /**
541
547
  * Coarse country router (#244). A `(normalizedText) → { country, confidence, posterior? }` predictor (a
@@ -602,69 +608,3 @@ export const PipelineFaultStage = {
602
608
  } as const
603
609
 
604
610
  export type PipelineFaultStage = (typeof PipelineFaultStage)[keyof typeof PipelineFaultStage]
605
-
606
- /**
607
- * One stage crash the coordinator caught and degraded past.
608
- *
609
- * A fault is NOT an error return: `runPipeline` still resolves, and `tree` still carries whatever the remaining stages
610
- * could prove. What the fault buys the caller is the ability to tell "the model faulted and the rule-based stages
611
- * filled the tree back in" apart from "the model ran and found nothing" — which, before #40, was impossible from the
612
- * outside. See the `safeClassify` docstring for the measured failure this was written against.
613
- */
614
- export interface PipelineFault {
615
- stage: PipelineFaultStage
616
- /**
617
- * The thrown value's `name` (`TypeError`, `RangeError`, …), or `"Error"` when something that isn't an `Error` was
618
- * thrown. Machine-stable enough to branch on; the `cause` carries the rest.
619
- */
620
- name: string
621
- message: string
622
- /**
623
- * The value the stage threw, verbatim — kept so a caller can rethrow it or read its stack. Not JSON-serializable in
624
- * the useful sense; serialize `stage`/`name`/`message` when you need this on a wire.
625
- */
626
- cause: unknown
627
- }
628
-
629
- /**
630
- * Result of one `runPipeline` call.
631
- */
632
- export interface PipelineResult {
633
- input: string
634
- normalized: NormalizedInputLite
635
- queryShape: QueryShapeLite
636
- locale: LocaleHint
637
- kind: QueryKindResult
638
- /**
639
- * Stage 2.7 phrase proposals when a grouper was wired. Empty array when the coordinator ran with no grouper
640
- * (pre-v0.5.0 callers) or when the fast-path skipped Stage 2.7. Stage 3 consumes this as conditioning; Stage 5
641
- * consumes it as boundary candidates.
642
- */
643
- phraseProposals: PhraseProposal[]
644
- tree: AddressTree
645
- /**
646
- * Present only when the poi-intent stage produced an outcome (path === "poi").
647
- */
648
- poiIntent?: POIIntentOutcome
649
- timing: PipelineTiming
650
- /**
651
- * Every stage crash the coordinator caught and degraded past, in the order they happened. **Always present** — an
652
- * empty array is the coordinator stating that no stage faulted, which is a different claim from a missing field.
653
- * Non-empty means the tree you are holding was produced with at least one stage down; see {@link PipelineFault}.
654
- */
655
- faults: PipelineFault[]
656
- /**
657
- * Query-intent advisories (ROAD_TO_V9 §4), lifted from the kind classifier's verdict. **Always present** — an empty
658
- * array is the coordinator stating that the intent vocabulary examined this query and had nothing to say, which is a
659
- * different claim from a missing field (the {@link faults} discipline, same reasoning).
660
- *
661
- * Nothing here changed which answer won. The markers are advisory by construction: the two intent kinds that could
662
- * have displaced a structural incumbent are scored below it, and the two that do win the top slot (`near_me`,
663
- * `poi_category`) route exactly as their incumbents did.
664
- */
665
- intentMarkers: QueryIntentMarker[]
666
- /**
667
- * Which path the coordinator took. `"fast-path"` skipped stages 3-5; `"poi"` took the intent branch.
668
- */
669
- path: "fast-path" | "full" | "poi"
670
- }
@@ -8,8 +8,9 @@
8
8
  * edits one entry here with a commit-message rationale.
9
9
  */
10
10
 
11
+ import { COMPONENT_TAGS, type ComponentTag } from "@mailwoman/codex/component"
12
+
11
13
  import type { ClassifierPolicy, PolicyMode } from "#policy/policy"
12
- import { COMPONENT_TAGS, type ComponentTag } from "#types"
13
14
 
14
15
  /**
15
16
  * Build a fresh array of policies — one per `ComponentTag`, all in `mode`. Returns a new array on each call; callers
@@ -9,7 +9,9 @@
9
9
  * neural-backed modes happen one component at a time, conditioned on golden-set metrics.
10
10
  */
11
11
 
12
- import type { ClassificationProposal, ComponentTag } from "#types"
12
+ import type { ComponentTag } from "@mailwoman/codex/component"
13
+
14
+ import type { ClassificationProposal } from "#types"
13
15
 
14
16
  /**
15
17
  * How a component is sourced.