@mailwoman/core 4.16.2 → 5.1.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 (332) hide show
  1. package/data/chromium-i18n/ssl-address-download.ts +110 -0
  2. package/data/libpostal/resources-download.ts +121 -0
  3. package/out/api/APIClient.d.ts +2 -2
  4. package/out/api/APIClient.d.ts.map +1 -1
  5. package/out/api/APIClient.js +2 -2
  6. package/out/api/APIClient.js.map +1 -1
  7. package/out/api/responses.d.ts.map +1 -1
  8. package/out/api/responses.js.map +1 -1
  9. package/out/classification/Classification.d.ts +3 -4
  10. package/out/classification/Classification.d.ts.map +1 -1
  11. package/out/classification/Classification.js.map +1 -1
  12. package/out/classification/CompositeClassifier.d.ts +1 -1
  13. package/out/classification/CompositeClassifier.d.ts.map +1 -1
  14. package/out/classification/CompositeClassifier.js +1 -1
  15. package/out/classification/CompositeClassifier.js.map +1 -1
  16. package/out/classification/PhraseClassifier.d.ts.map +1 -1
  17. package/out/classification/PhraseClassifier.js.map +1 -1
  18. package/out/classification/SectionClassifier.d.ts.map +1 -1
  19. package/out/classification/SectionClassifier.js.map +1 -1
  20. package/out/classification/WordClassifier.d.ts.map +1 -1
  21. package/out/classification/WordClassifier.js.map +1 -1
  22. package/out/classification/scheme.d.ts.map +1 -1
  23. package/out/classification/scheme.js.map +1 -1
  24. package/out/coarse-placer/coarse-placer.d.ts +28 -34
  25. package/out/coarse-placer/coarse-placer.d.ts.map +1 -1
  26. package/out/coarse-placer/coarse-placer.js +19 -21
  27. package/out/coarse-placer/coarse-placer.js.map +1 -1
  28. package/out/coarse-placer/featurize.d.ts +17 -19
  29. package/out/coarse-placer/featurize.d.ts.map +1 -1
  30. package/out/coarse-placer/featurize.js +17 -19
  31. package/out/coarse-placer/featurize.js.map +1 -1
  32. package/out/collections.d.ts +1 -2
  33. package/out/collections.d.ts.map +1 -1
  34. package/out/collections.js +1 -2
  35. package/out/collections.js.map +1 -1
  36. package/out/data/chromium-i18n/ssl-address-download.d.ts +30 -0
  37. package/out/data/chromium-i18n/ssl-address-download.d.ts.map +1 -0
  38. package/out/data/chromium-i18n/ssl-address-download.js +98 -0
  39. package/out/data/chromium-i18n/ssl-address-download.js.map +1 -0
  40. package/out/data/libpostal/resources-download.d.ts +29 -0
  41. package/out/data/libpostal/resources-download.d.ts.map +1 -0
  42. package/out/data/libpostal/resources-download.js +107 -0
  43. package/out/data/libpostal/resources-download.js.map +1 -0
  44. package/out/db/schema.d.ts +2 -2
  45. package/out/decoder/arbitrate-tree.d.ts +3 -3
  46. package/out/decoder/arbitrate-tree.d.ts.map +1 -1
  47. package/out/decoder/arbitrate-tree.js +5 -5
  48. package/out/decoder/arbitrate-tree.js.map +1 -1
  49. package/out/decoder/build-tree.d.ts +12 -14
  50. package/out/decoder/build-tree.d.ts.map +1 -1
  51. package/out/decoder/build-tree.js +4 -5
  52. package/out/decoder/build-tree.js.map +1 -1
  53. package/out/decoder/calibration.d.ts +3 -4
  54. package/out/decoder/calibration.d.ts.map +1 -1
  55. package/out/decoder/calibration.js +3 -4
  56. package/out/decoder/calibration.js.map +1 -1
  57. package/out/decoder/containment.d.ts +5 -6
  58. package/out/decoder/containment.d.ts.map +1 -1
  59. package/out/decoder/containment.js +5 -6
  60. package/out/decoder/containment.js.map +1 -1
  61. package/out/decoder/index.d.ts +1 -0
  62. package/out/decoder/index.d.ts.map +1 -1
  63. package/out/decoder/index.js +1 -0
  64. package/out/decoder/index.js.map +1 -1
  65. package/out/decoder/proposals-to-tree.d.ts +9 -9
  66. package/out/decoder/proposals-to-tree.d.ts.map +1 -1
  67. package/out/decoder/proposals-to-tree.js +11 -11
  68. package/out/decoder/proposals-to-tree.js.map +1 -1
  69. package/out/decoder/resolve-proposal-overlaps.d.ts +3 -5
  70. package/out/decoder/resolve-proposal-overlaps.d.ts.map +1 -1
  71. package/out/decoder/resolve-proposal-overlaps.js +5 -6
  72. package/out/decoder/resolve-proposal-overlaps.js.map +1 -1
  73. package/out/decoder/serialize-json.d.ts +13 -1
  74. package/out/decoder/serialize-json.d.ts.map +1 -1
  75. package/out/decoder/serialize-json.js +6 -2
  76. package/out/decoder/serialize-json.js.map +1 -1
  77. package/out/decoder/serialize-tuples.d.ts +10 -1
  78. package/out/decoder/serialize-tuples.d.ts.map +1 -1
  79. package/out/decoder/serialize-tuples.js +13 -5
  80. package/out/decoder/serialize-tuples.js.map +1 -1
  81. package/out/decoder/serialize-xml.d.ts +15 -9
  82. package/out/decoder/serialize-xml.d.ts.map +1 -1
  83. package/out/decoder/serialize-xml.js +29 -12
  84. package/out/decoder/serialize-xml.js.map +1 -1
  85. package/out/decoder/types.d.ts +52 -61
  86. package/out/decoder/types.d.ts.map +1 -1
  87. package/out/decoder/types.js +2 -2
  88. package/out/decoder/unknown-spans.d.ts +46 -0
  89. package/out/decoder/unknown-spans.d.ts.map +1 -0
  90. package/out/decoder/unknown-spans.js +56 -0
  91. package/out/decoder/unknown-spans.js.map +1 -0
  92. package/out/decoder/validate-tree.d.ts.map +1 -1
  93. package/out/decoder/validate-tree.js +2 -3
  94. package/out/decoder/validate-tree.js.map +1 -1
  95. package/out/env/index.d.ts +80 -0
  96. package/out/env/index.d.ts.map +1 -0
  97. package/out/env/index.js +35 -0
  98. package/out/env/index.js.map +1 -0
  99. package/out/env/load.d.ts +7 -0
  100. package/out/env/load.d.ts.map +1 -0
  101. package/out/env/load.js +13 -0
  102. package/out/env/load.js.map +1 -0
  103. package/out/env/paths.d.ts +13 -0
  104. package/out/env/paths.d.ts.map +1 -0
  105. package/out/env/paths.js +34 -0
  106. package/out/env/paths.js.map +1 -0
  107. package/out/env/schema.d.ts +81 -0
  108. package/out/env/schema.d.ts.map +1 -0
  109. package/out/env/schema.js +92 -0
  110. package/out/env/schema.js.map +1 -0
  111. package/out/errors/schema.d.ts +1 -2
  112. package/out/errors/schema.d.ts.map +1 -1
  113. package/out/errors/schema.js +1 -2
  114. package/out/errors/schema.js.map +1 -1
  115. package/out/filters/RelationshipFilter.d.ts.map +1 -1
  116. package/out/filters/RelationshipFilter.js.map +1 -1
  117. package/out/formatter/index.d.ts.map +1 -1
  118. package/out/formatter/index.js.map +1 -1
  119. package/out/identifiers.d.ts.map +1 -1
  120. package/out/identifiers.js.map +1 -1
  121. package/out/kysley/client.d.ts +3 -4
  122. package/out/kysley/client.d.ts.map +1 -1
  123. package/out/kysley/client.js +3 -4
  124. package/out/kysley/client.js.map +1 -1
  125. package/out/kysley/dialect-config.d.ts +1 -1
  126. package/out/kysley/dialect-config.d.ts.map +1 -1
  127. package/out/kysley/dialect.d.ts +4 -4
  128. package/out/kysley/dialect.js +4 -4
  129. package/out/kysley/driver.d.ts.map +1 -1
  130. package/out/kysley/driver.js +1 -1
  131. package/out/kysley/driver.js.map +1 -1
  132. package/out/lifecycle/ServiceSymbol.d.ts +2 -4
  133. package/out/lifecycle/ServiceSymbol.d.ts.map +1 -1
  134. package/out/lifecycle/ServiceSymbol.js +2 -4
  135. package/out/lifecycle/ServiceSymbol.js.map +1 -1
  136. package/out/lifecycle/services.d.ts +7 -8
  137. package/out/lifecycle/services.d.ts.map +1 -1
  138. package/out/lifecycle/services.js +5 -4
  139. package/out/lifecycle/services.js.map +1 -1
  140. package/out/locale/locale.d.ts +5 -6
  141. package/out/locale/locale.d.ts.map +1 -1
  142. package/out/locale/registry.d.ts.map +1 -1
  143. package/out/locale/registry.js.map +1 -1
  144. package/out/logging/index.d.ts +1 -0
  145. package/out/logging/index.d.ts.map +1 -1
  146. package/out/logging/index.js +1 -0
  147. package/out/logging/index.js.map +1 -1
  148. package/out/logging/shared.d.ts +2 -2
  149. package/out/logging/shared.js +2 -2
  150. package/out/logging/utils.d.ts +30 -0
  151. package/out/logging/utils.d.ts.map +1 -0
  152. package/out/logging/utils.js +30 -0
  153. package/out/logging/utils.js.map +1 -0
  154. package/out/objects.d.ts +3 -4
  155. package/out/objects.d.ts.map +1 -1
  156. package/out/objects.js +1 -2
  157. package/out/objects.js.map +1 -1
  158. package/out/parser/AddressParser.d.ts +12 -16
  159. package/out/parser/AddressParser.d.ts.map +1 -1
  160. package/out/parser/AddressParser.js.map +1 -1
  161. package/out/parser/proposal-pipeline.d.ts +12 -12
  162. package/out/parser/proposal-pipeline.d.ts.map +1 -1
  163. package/out/parser/proposal-pipeline.js +12 -12
  164. package/out/parser/proposal-pipeline.js.map +1 -1
  165. package/out/parser/solution-to-proposals.d.ts +4 -4
  166. package/out/parser/solution-to-proposals.d.ts.map +1 -1
  167. package/out/parser/solution-to-proposals.js +5 -5
  168. package/out/parser/solution-to-proposals.js.map +1 -1
  169. package/out/pipeline/index.d.ts +1 -1
  170. package/out/pipeline/reconcile-lookups.d.ts +4 -4
  171. package/out/pipeline/reconcile-lookups.d.ts.map +1 -1
  172. package/out/pipeline/reconcile-lookups.js +4 -4
  173. package/out/pipeline/reconcile-lookups.js.map +1 -1
  174. package/out/pipeline/reconcile.d.ts +21 -23
  175. package/out/pipeline/reconcile.d.ts.map +1 -1
  176. package/out/pipeline/reconcile.js +49 -51
  177. package/out/pipeline/reconcile.js.map +1 -1
  178. package/out/pipeline/runtime-pipeline.d.ts +14 -16
  179. package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
  180. package/out/pipeline/runtime-pipeline.js +33 -37
  181. package/out/pipeline/runtime-pipeline.js.map +1 -1
  182. package/out/pipeline/span-logit-aggregation.d.ts +5 -6
  183. package/out/pipeline/span-logit-aggregation.d.ts.map +1 -1
  184. package/out/pipeline/span-logit-aggregation.js +7 -8
  185. package/out/pipeline/span-logit-aggregation.js.map +1 -1
  186. package/out/pipeline/span-proposer.d.ts +18 -22
  187. package/out/pipeline/span-proposer.d.ts.map +1 -1
  188. package/out/pipeline/span-proposer.js +21 -22
  189. package/out/pipeline/span-proposer.js.map +1 -1
  190. package/out/pipeline/types.d.ts +77 -86
  191. package/out/pipeline/types.d.ts.map +1 -1
  192. package/out/policy/defaults.d.ts +5 -6
  193. package/out/policy/defaults.d.ts.map +1 -1
  194. package/out/policy/defaults.js +5 -6
  195. package/out/policy/defaults.js.map +1 -1
  196. package/out/policy/from-config.d.ts +8 -9
  197. package/out/policy/from-config.d.ts.map +1 -1
  198. package/out/policy/from-config.js +8 -9
  199. package/out/policy/from-config.js.map +1 -1
  200. package/out/policy/input-shape-router.d.ts +15 -19
  201. package/out/policy/input-shape-router.d.ts.map +1 -1
  202. package/out/policy/input-shape-router.js +11 -14
  203. package/out/policy/input-shape-router.js.map +1 -1
  204. package/out/policy/policy.d.ts +10 -13
  205. package/out/policy/policy.d.ts.map +1 -1
  206. package/out/policy/registry.d.ts +4 -5
  207. package/out/policy/registry.d.ts.map +1 -1
  208. package/out/policy/registry.js +6 -7
  209. package/out/policy/registry.js.map +1 -1
  210. package/out/resolver/index.d.ts +1 -1
  211. package/out/resolver/index.js +1 -1
  212. package/out/resolver/types.d.ts +212 -216
  213. package/out/resolver/types.d.ts.map +1 -1
  214. package/out/resolver/types.js +32 -39
  215. package/out/resolver/types.js.map +1 -1
  216. package/out/resources/LocaleIndex.d.ts +1 -2
  217. package/out/resources/LocaleIndex.d.ts.map +1 -1
  218. package/out/resources/LocaleIndex.js +1 -2
  219. package/out/resources/LocaleIndex.js.map +1 -1
  220. package/out/resources/ResourceMapCache.d.ts.map +1 -1
  221. package/out/resources/ResourceMapCache.js.map +1 -1
  222. package/out/resources/collections.d.ts +1 -2
  223. package/out/resources/collections.d.ts.map +1 -1
  224. package/out/resources/collections.js +1 -2
  225. package/out/resources/collections.js.map +1 -1
  226. package/out/resources/fs.d.ts.map +1 -1
  227. package/out/resources/fs.js.map +1 -1
  228. package/out/resources/git.d.ts.map +1 -1
  229. package/out/resources/git.js.map +1 -1
  230. package/out/resources/libaddressinput.d.ts +2 -2
  231. package/out/resources/libaddressinput.js +2 -2
  232. package/out/resources/libpostal.d.ts +4 -5
  233. package/out/resources/libpostal.d.ts.map +1 -1
  234. package/out/resources/libpostal.js +6 -7
  235. package/out/resources/libpostal.js.map +1 -1
  236. package/out/resources/set.d.ts +1 -2
  237. package/out/resources/set.d.ts.map +1 -1
  238. package/out/resources/set.js +1 -2
  239. package/out/resources/set.js.map +1 -1
  240. package/out/resources/whosonfirst/DataSourceCache.d.ts.map +1 -1
  241. package/out/resources/whosonfirst/DataSourceCache.js.map +1 -1
  242. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts +1 -1
  243. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts.map +1 -1
  244. package/out/resources/whosonfirst/PlacetypeDataSource.js +1 -1
  245. package/out/resources/whosonfirst/PlacetypeDataSource.js.map +1 -1
  246. package/out/resources/whosonfirst/loader.d.ts +1 -2
  247. package/out/resources/whosonfirst/loader.d.ts.map +1 -1
  248. package/out/resources/whosonfirst/loader.js.map +1 -1
  249. package/out/resources/whosonfirst/placetypes/Placetype.d.ts +6 -9
  250. package/out/resources/whosonfirst/placetypes/Placetype.d.ts.map +1 -1
  251. package/out/resources/whosonfirst/placetypes/Placetype.js +7 -10
  252. package/out/resources/whosonfirst/placetypes/Placetype.js.map +1 -1
  253. package/out/resources/whosonfirst/placetypes/admin.d.ts +1 -2
  254. package/out/resources/whosonfirst/placetypes/admin.d.ts.map +1 -1
  255. package/out/resources/whosonfirst/placetypes/admin.js +1 -2
  256. package/out/resources/whosonfirst/placetypes/admin.js.map +1 -1
  257. package/out/resources/whosonfirst/placetypes/graph.d.ts +10 -10
  258. package/out/resources/whosonfirst/placetypes/graph.d.ts.map +1 -1
  259. package/out/resources/whosonfirst/placetypes/graph.js +0 -0
  260. package/out/resources/whosonfirst/placetypes/graph.js.map +1 -1
  261. package/out/resources/whosonfirst/placetypes/mermaid.d.ts +16 -19
  262. package/out/resources/whosonfirst/placetypes/mermaid.d.ts.map +1 -1
  263. package/out/resources/whosonfirst/placetypes/mermaid.js +15 -16
  264. package/out/resources/whosonfirst/placetypes/mermaid.js.map +1 -1
  265. package/out/resources/whosonfirst/placetypes/tree.d.ts +6 -7
  266. package/out/resources/whosonfirst/placetypes/tree.d.ts.map +1 -1
  267. package/out/resources/whosonfirst/placetypes/tree.js +3 -4
  268. package/out/resources/whosonfirst/placetypes/tree.js.map +1 -1
  269. package/out/routing/index.d.ts +2 -3
  270. package/out/routing/index.d.ts.map +1 -1
  271. package/out/routing/index.js +1 -1
  272. package/out/routing/index.js.map +1 -1
  273. package/out/solver/HashMapSolver.d.ts.map +1 -1
  274. package/out/solver/HashMapSolver.js.map +1 -1
  275. package/out/solver/Solution.d.ts +2 -2
  276. package/out/solver/Solution.d.ts.map +1 -1
  277. package/out/solver/Solution.js +2 -2
  278. package/out/solver/Solution.js.map +1 -1
  279. package/out/solver/mask.d.ts.map +1 -1
  280. package/out/solver/mask.js.map +1 -1
  281. package/out/solvers/LeadingAreaDeclassifier.d.ts.map +1 -1
  282. package/out/solvers/LeadingAreaDeclassifier.js.map +1 -1
  283. package/out/solvers/MultiStreetSolver.d.ts +10 -15
  284. package/out/solvers/MultiStreetSolver.d.ts.map +1 -1
  285. package/out/solvers/MultiStreetSolver.js +10 -15
  286. package/out/solvers/MultiStreetSolver.js.map +1 -1
  287. package/out/solvers/PostcodePositionPenalty.d.ts +2 -2
  288. package/out/solvers/PostcodePositionPenalty.d.ts.map +1 -1
  289. package/out/solvers/PostcodePositionPenalty.js +2 -2
  290. package/out/solvers/PostcodePositionPenalty.js.map +1 -1
  291. package/out/tokenization/Span.d.ts +1 -3
  292. package/out/tokenization/Span.d.ts.map +1 -1
  293. package/out/tokenization/Span.js +1 -3
  294. package/out/tokenization/Span.js.map +1 -1
  295. package/out/tokenization/context.d.ts +1 -2
  296. package/out/tokenization/context.d.ts.map +1 -1
  297. package/out/tokenization/context.js +1 -2
  298. package/out/tokenization/context.js.map +1 -1
  299. package/out/tokenization/normalizer.js +2 -2
  300. package/out/tokenization/permutate.d.ts +2 -3
  301. package/out/tokenization/permutate.d.ts.map +1 -1
  302. package/out/tokenization/permutate.js +4 -5
  303. package/out/tokenization/permutate.js.map +1 -1
  304. package/out/types/classifier.d.ts +21 -23
  305. package/out/types/classifier.d.ts.map +1 -1
  306. package/out/types/component.d.ts +6 -7
  307. package/out/types/component.d.ts.map +1 -1
  308. package/out/types/component.js +5 -6
  309. package/out/types/component.js.map +1 -1
  310. package/out/types/mapping.d.ts +8 -8
  311. package/out/types/mapping.d.ts.map +1 -1
  312. package/out/types/mapping.js +13 -13
  313. package/out/types/mapping.js.map +1 -1
  314. package/out/utils/data-root.d.ts +5 -5
  315. package/out/utils/data-root.js +7 -7
  316. package/out/utils/repo.d.ts +3 -3
  317. package/out/utils/repo.d.ts.map +1 -1
  318. package/out/utils/repo.js +16 -19
  319. package/out/utils/repo.js.map +1 -1
  320. package/out/vitest.config.d.ts.map +1 -1
  321. package/out/vitest.config.js.map +1 -1
  322. package/package.json +21 -19
  323. package/data/chromium-i18n/ssl-address-download.sh +0 -15
  324. package/data/libpostal/resources-download.sh +0 -44
  325. package/out/logging/tables.d.ts +0 -7
  326. package/out/logging/tables.d.ts.map +0 -1
  327. package/out/logging/tables.js +0 -75
  328. package/out/logging/tables.js.map +0 -1
  329. package/out/sets.d.ts +0 -2
  330. package/out/sets.d.ts.map +0 -1
  331. package/out/sets.js +0 -2
  332. package/out/sets.js.map +0 -1
@@ -14,13 +14,13 @@
14
14
  * - `conf` — aggregated confidence in [0, 1], two decimal places.
15
15
  * - `start` / `end` — character offsets in the raw input. Preserves source order alongside the
16
16
  * containment-derived element order.
17
- * - `src` — provenance for the assertion. Formatted as `<source>:<sourceId>` when both fields are
17
+ * - `src` — provenance for the assertion. Formatted as `<source>:<sourceID>` when both fields are
18
18
  * present on the node, `<source>` when only the broad category is set, omitted when neither
19
19
  * is. Phase 4.1 surfaces classifier provenance (`rule:whos_on_first`, `neural:v0.3.1-en-us`);
20
20
  * Phase 4.3 overlays resolver provenance (`resolver:wof-admin:101751119`).
21
21
  * - `lat` / `lon` — resolver-supplied centroid (Phase 4.3). Emitted only when both are set.
22
22
  * - `place` — resolver-supplied normalized place URI like `wof:101751119` (Phase 4.3). Emitted only
23
- * when `node.placeId` is set; distinct from `src` so callers that want the bare place id
23
+ * when `node.placeID` is set; distinct from `src` so callers that want the bare place id
24
24
  * without the vendor prefix have a direct attribute to read.
25
25
  * - Root `<address>` carries `raw` — the full input string for round-trip.
26
26
  *
@@ -30,7 +30,7 @@
30
30
  * parent's own value. Documented in the package README.
31
31
  */
32
32
  import type { AddressTree } from "./types.js";
33
- export interface SerializeXmlOpts {
33
+ export interface SerializeXMLOpts {
34
34
  /** Pretty-print with line breaks and indentation. Default true. */
35
35
  pretty?: boolean;
36
36
  /** Include `conf` attribute on every component. Default true. */
@@ -44,14 +44,20 @@ export interface SerializeXmlOpts {
44
44
  /** Include `place` resolver-supplied normalized place URI when set. Default true. */
45
45
  includePlace?: boolean;
46
46
  /**
47
- * Include `<alternative>` child elements for each runner-up resolver candidate on the node. When
48
- * set + node.alternatives is populated, each runner-up is emitted as a self-closing element with
49
- * `place`, `name`, `lat`, `lon`, `score` attributes. Default false — keeps output
50
- * libpostal-compat when not explicitly requested (Springfield-class disambiguation surfaces only
51
- * when the caller asks).
47
+ * Include `<alternative>` child elements for each runner-up resolver candidate on the node. When set +
48
+ * node.alternatives is populated, each runner-up is emitted as a self-closing element with `place`, `name`, `lat`,
49
+ * `lon`, `score` attributes. Default false — keeps output libpostal-compat when not explicitly requested
50
+ * (Springfield-class disambiguation surfaces only when the caller asks).
52
51
  */
53
52
  includeAlternatives?: boolean;
53
+ /**
54
+ * Emit `<unknown start end>…</unknown>` elements for the all-O runs no node covers — the input the model left
55
+ * unclassified (#493 lossless decomposition). Interleaved with the root components in source order, so the
56
+ * `<address>` children tile the raw input exactly. Default false — keeps output libpostal-compat / the existing shape
57
+ * when not explicitly requested (same posture as {@link includeAlternatives}).
58
+ */
59
+ includeUnknown?: boolean;
54
60
  }
55
61
  /** Project an `AddressTree` to nested XML with optional confidence/offset attributes. */
56
- export declare function decodeAsXml(tree: AddressTree, opts?: SerializeXmlOpts): string;
62
+ export declare function decodeAsXML(tree: AddressTree, opts?: SerializeXMLOpts): string;
57
63
  //# sourceMappingURL=serialize-xml.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"serialize-xml.d.ts","sourceRoot":"","sources":["../../decoder/serialize-xml.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,YAAY,CAAA;AAE1D,MAAM,WAAW,gBAAgB;IAChC,mEAAmE;IACnE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,iEAAiE;IACjE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,oEAAoE;IACpE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,0FAA0F;IAC1F,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,iGAAiG;IACjG,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,qFAAqF;IACrF,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC7B;AA0FD,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,GAAE,gBAAqB,GAAG,MAAM,CAelF"}
1
+ {"version":3,"file":"serialize-xml.d.ts","sourceRoot":"","sources":["../../decoder/serialize-xml.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,YAAY,CAAA;AAG1D,MAAM,WAAW,gBAAgB;IAChC,mEAAmE;IACnE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,iEAAiE;IACjE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,oEAAoE;IACpE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,0FAA0F;IAC1F,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,iGAAiG;IACjG,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,qFAAqF;IACrF,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;CACxB;AAwGD,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,GAAE,gBAAqB,GAAG,MAAM,CAmClF"}
@@ -14,13 +14,13 @@
14
14
  * - `conf` — aggregated confidence in [0, 1], two decimal places.
15
15
  * - `start` / `end` — character offsets in the raw input. Preserves source order alongside the
16
16
  * containment-derived element order.
17
- * - `src` — provenance for the assertion. Formatted as `<source>:<sourceId>` when both fields are
17
+ * - `src` — provenance for the assertion. Formatted as `<source>:<sourceID>` when both fields are
18
18
  * present on the node, `<source>` when only the broad category is set, omitted when neither
19
19
  * is. Phase 4.1 surfaces classifier provenance (`rule:whos_on_first`, `neural:v0.3.1-en-us`);
20
20
  * Phase 4.3 overlays resolver provenance (`resolver:wof-admin:101751119`).
21
21
  * - `lat` / `lon` — resolver-supplied centroid (Phase 4.3). Emitted only when both are set.
22
22
  * - `place` — resolver-supplied normalized place URI like `wof:101751119` (Phase 4.3). Emitted only
23
- * when `node.placeId` is set; distinct from `src` so callers that want the bare place id
23
+ * when `node.placeID` is set; distinct from `src` so callers that want the bare place id
24
24
  * without the vendor prefix have a direct attribute to read.
25
25
  * - Root `<address>` carries `raw` — the full input string for round-trip.
26
26
  *
@@ -29,21 +29,22 @@
29
29
  * n.nodeType === 3).map(n => n.nodeValue).join('').trim()` or XPath `text()` to get just the
30
30
  * parent's own value. Documented in the package README.
31
31
  */
32
+ import { unknownSpans } from "./unknown-spans.js";
32
33
  function escapeXml(s) {
33
34
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
34
35
  }
35
36
  function srcAttrValue(node) {
36
- if (node.source && node.sourceId)
37
- return `${node.source}:${node.sourceId}`;
37
+ if (node.source && node.sourceID)
38
+ return `${node.source}:${node.sourceID}`;
38
39
  if (node.source)
39
40
  return node.source;
40
- if (node.sourceId)
41
- return node.sourceId;
41
+ if (node.sourceID)
42
+ return node.sourceID;
42
43
  return null;
43
44
  }
44
45
  /**
45
- * Centroid precision for resolver-supplied lat/lon. 6 decimal places is ~11 cm at the equator —
46
- * more than enough for any postal-address resolver and short enough to stay readable.
46
+ * Centroid precision for resolver-supplied lat/lon. 6 decimal places is ~11 cm at the equator — more than enough for
47
+ * any postal-address resolver and short enough to stay readable.
47
48
  */
48
49
  const GEO_PRECISION = 6;
49
50
  function attrs(node, opts) {
@@ -62,8 +63,8 @@ function attrs(node, opts) {
62
63
  if (opts.includeGeo && node.lat !== undefined && node.lon !== undefined) {
63
64
  parts.push(`lat="${node.lat.toFixed(GEO_PRECISION)}"`, `lon="${node.lon.toFixed(GEO_PRECISION)}"`);
64
65
  }
65
- if (opts.includePlace && node.placeId !== undefined) {
66
- parts.push(`place="${escapeXml(node.placeId)}"`);
66
+ if (opts.includePlace && node.placeID !== undefined) {
67
+ parts.push(`place="${escapeXml(node.placeID)}"`);
67
68
  }
68
69
  // Multi-role node (#413): a city-state span tagged `region` that also plays `locality` lists every
69
70
  // role it holds, primary first — `roles="region locality"`. Emitted only when extra roles exist.
@@ -107,7 +108,7 @@ function serializeNode(node, indent, opts) {
107
108
  return `${indent}<${node.tag}${a}>${text}${nl}${inner}${nl}${indent}</${node.tag}>`;
108
109
  }
109
110
  /** Project an `AddressTree` to nested XML with optional confidence/offset attributes. */
110
- export function decodeAsXml(tree, opts = {}) {
111
+ export function decodeAsXML(tree, opts = {}) {
111
112
  const full = {
112
113
  pretty: opts.pretty ?? true,
113
114
  includeConf: opts.includeConf ?? true,
@@ -116,11 +117,27 @@ export function decodeAsXml(tree, opts = {}) {
116
117
  includeGeo: opts.includeGeo ?? true,
117
118
  includePlace: opts.includePlace ?? true,
118
119
  includeAlternatives: opts.includeAlternatives ?? false,
120
+ includeUnknown: opts.includeUnknown ?? false,
119
121
  };
120
122
  const rawAttr = escapeXml(tree.raw);
121
123
  const nl = full.pretty ? "\n" : "";
122
124
  const indent = full.pretty ? "\t" : "";
123
- const children = tree.roots.map((r) => serializeNode(r, indent, full)).join(nl);
125
+ // Source-ordered XML for the root components. When includeUnknown is set, interleave the all-O gaps as
126
+ // `<unknown>` elements by start offset so the children tile the raw input losslessly.
127
+ const entries = tree.roots.map((r) => ({
128
+ start: r.start,
129
+ xml: serializeNode(r, indent, full),
130
+ }));
131
+ if (full.includeUnknown) {
132
+ for (const u of unknownSpans(tree)) {
133
+ entries.push({
134
+ start: u.start,
135
+ xml: `${indent}<unknown start="${u.start}" end="${u.end}">${escapeXml(u.value)}</unknown>`,
136
+ });
137
+ }
138
+ entries.sort((a, b) => a.start - b.start);
139
+ }
140
+ const children = entries.map((e) => e.xml).join(nl);
124
141
  return `<address raw="${rawAttr}">${nl}${children}${nl}</address>`;
125
142
  }
126
143
  //# sourceMappingURL=serialize-xml.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"serialize-xml.js","sourceRoot":"","sources":["../../decoder/serialize-xml.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AA2BH,SAAS,SAAS,CAAC,CAAS;IAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AACpG,CAAC;AAED,SAAS,YAAY,CAAC,IAAiB;IACtC,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ;QAAE,OAAO,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAA;IAC1E,IAAI,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC,MAAM,CAAA;IACnC,IAAI,IAAI,CAAC,QAAQ;QAAE,OAAO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AG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAEnD,OAAO,iBAAiB,OAAO,KAAK,EAAE,GAAG,QAAQ,GAAG,EAAE,YAAY,CAAA;AACnE,CAAC"}
@@ -19,20 +19,19 @@
19
19
  *
20
20
  * See `containment.ts` for the parent-of mapping that drives nesting.
21
21
  *
22
- * Phase 4.1 added optional `source` / `sourceId` on `AddressNode` so the XML serializer can emit
23
- * provenance via `src="<source>:<sourceId>"`. The neural pipeline stamps these via
22
+ * Phase 4.1 added optional `source` / `sourceID` on `AddressNode` so the XML serializer can emit
23
+ * provenance via `src="<source>:<sourceID>"`. The neural pipeline stamps these via
24
24
  * `BuildTreeOpts`; the proposal-derived path threads them through from `ClassificationProposal`.
25
25
  * JSON / tuple projections deliberately do not surface provenance — libpostal compat is
26
26
  * essential.
27
27
  */
28
- import type { BioLabel, ComponentTag } from "../types/component.js";
29
- export type { BioLabel, ComponentTag };
28
+ import type { BIOLabel, ComponentTag } from "../types/component.js";
29
+ export type { BIOLabel, ComponentTag };
30
30
  /**
31
31
  * A single token emitted by the model, paired with its predicted label and confidence.
32
32
  *
33
- * `start`/`end` are character offsets into the original raw input. The tokenizer is responsible for
34
- * producing these (SentencePiece's `encode` returns offsets); they are NOT recomputed by the
35
- * decoder.
33
+ * `start`/`end` are character offsets into the original raw input. The tokenizer is responsible for producing these
34
+ * (SentencePiece's `encode` returns offsets); they are NOT recomputed by the decoder.
36
35
  */
37
36
  export interface DecoderToken {
38
37
  /** The token piece as the tokenizer emitted it (with any leading-space sentinel preserved). */
@@ -42,17 +41,16 @@ export interface DecoderToken {
42
41
  /** Exclusive end char offset in the original raw text. */
43
42
  end: number;
44
43
  /** The argmax BIO label for this token. */
45
- label: BioLabel;
44
+ label: BIOLabel;
46
45
  /** Softmax confidence for the chosen label, in [0, 1]. */
47
46
  confidence: number;
48
47
  }
49
48
  /**
50
49
  * One node of the address tree — a component span plus any nested child components.
51
50
  *
52
- * `value` is the raw text covered by this span, sliced from the original input by `[start, end)`.
53
- * `confidence` is aggregated across the span's tokens (currently mean; see `build-tree.ts`).
54
- * `children` are tagged subcomponents whose spans fall within this node's span AND whose tag's
55
- * containment rule names this node's tag as a permitted parent.
51
+ * `value` is the raw text covered by this span, sliced from the original input by `[start, end)`. `confidence` is
52
+ * aggregated across the span's tokens (currently mean; see `build-tree.ts`). `children` are tagged subcomponents whose
53
+ * spans fall within this node's span AND whose tag's containment rule names this node's tag as a permitted parent.
56
54
  */
57
55
  export interface AddressNode {
58
56
  tag: ComponentTag;
@@ -62,55 +60,50 @@ export interface AddressNode {
62
60
  confidence: number;
63
61
  children: AddressNode[];
64
62
  /**
65
- * Broad category of the assertion's origin. `"rule"` and `"neural"` come from classifier
66
- * proposals; `"resolver"` is set by Phase 4.3's resolver when it overwrites the classifier
67
- * attribution (the displaced classifier source lands in `metadata.classifier_source`).
63
+ * Broad category of the assertion's origin. `"rule"` and `"neural"` come from classifier proposals; `"resolver"` is
64
+ * set by Phase 4.3's resolver when it overwrites the classifier attribution (the displaced classifier source lands in
65
+ * `metadata.classifier_source`).
68
66
  */
69
67
  source?: string;
70
68
  /**
71
- * Specific identifier within `source`: a rule classifier id like `"whos_on_first"`, a neural
72
- * model card version like `"neural-v0.3.1-en-us"`, or a resolver-supplied place id like
73
- * `"wof-admin:101751119"`.
69
+ * Specific identifier within `source`: a rule classifier id like `"whos_on_first"`, a neural model card version like
70
+ * `"neural-v0.3.1-en-us"`, or a resolver-supplied place id like `"wof-admin:101751119"`.
74
71
  */
75
- sourceId?: string;
72
+ sourceID?: string;
76
73
  /** Resolver-supplied centroid latitude (Phase 4.3). Optional — only set when a resolver wins. */
77
74
  lat?: number;
78
75
  /** Resolver-supplied centroid longitude (Phase 4.3). Optional — only set when a resolver wins. */
79
76
  lon?: number;
80
77
  /**
81
- * Resolver-supplied normalized place URI (Phase 4.3) — `"wof:101751119"` for a WOF place.
82
- * Distinct from `sourceId` (which includes the resolver vendor) so consumers that want the
83
- * canonical place id without the vendor prefix have one.
78
+ * Resolver-supplied normalized place URI (Phase 4.3) — `"wof:101751119"` for a WOF place. Distinct from `sourceID`
79
+ * (which includes the resolver vendor) so consumers that want the canonical place id without the vendor prefix have
80
+ * one.
84
81
  */
85
- placeId?: string;
82
+ placeID?: string;
86
83
  /**
87
- * Opaque per-node metadata bag. Phase 4.3 uses keys `classifier_source` and
88
- * `classifier_source_id` to preserve the displaced classifier attribution when a resolver wins.
89
- * Never consulted by the decoder or serializers — debugging + downstream telemetry only.
84
+ * Opaque per-node metadata bag. Phase 4.3 uses keys `classifier_source` and `classifier_source_id` to preserve the
85
+ * displaced classifier attribution when a resolver wins. Never consulted by the decoder or serializers — debugging +
86
+ * downstream telemetry only.
90
87
  */
91
88
  metadata?: Record<string, unknown>;
92
89
  /**
93
- * Top-k alternative resolutions for this node, ranked by score (highest first). The winning
94
- * candidate is reflected in `placeId` / `lat` / `lon` / `sourceId`. Surfaced for failure mode #8
95
- * (Springfield-class ambiguity) — callers needing disambiguation see the runners-up. Empty /
96
- * absent when the resolver returned a single candidate.
90
+ * Top-k alternative resolutions for this node, ranked by score (highest first). The winning candidate is reflected in
91
+ * `placeID` / `lat` / `lon` / `sourceID`. Surfaced for failure mode #8 (Springfield-class ambiguity) — callers
92
+ * needing disambiguation see the runners-up. Empty / absent when the resolver returned a single candidate.
97
93
  *
98
- * Typed as `unknown[]` here to avoid a circular import on `ResolvedPlace`; resolver-emitting code
99
- * sets the concrete shape, consumers may cast to `ResolvedPlace[]` from
100
- * `@mailwoman/core/resolver`.
94
+ * Typed as `unknown[]` here to avoid a circular import on `ResolvedPlace`; resolver-emitting code sets the concrete
95
+ * shape, consumers may cast to `ResolvedPlace[]` from `@mailwoman/core/resolver`.
101
96
  */
102
97
  alternatives?: ReadonlyArray<unknown>;
103
98
  /**
104
- * ADDITIONAL roles this single span plays, beyond `tag` (#413). A place can hold multiple admin
105
- * tiers under one name — a city-state (Berlin is region AND locality) or a capital-seat province
106
- * (Milano province ~ Milano comune). Rather than synthesize a second node with a borrowed span,
107
- * the resolver records the extra role(s) here, so one node = one span = many roles (the model
108
- * Google's `address_components[].types` uses). `tag`/`placeId`/`lat`/`lon` remain the PRIMARY
109
- * role; each interpretation is a distinct secondary role with its own resolved place. Serializers
110
- * surface every role (a city-state emits both `region` and `locality`). Distinct from
111
- * `alternatives` — those are same-role runner-up places (Springfield IL vs MA); interpretations
112
- * are DIFFERENT tags, same span. Empty / absent for the common single-role node. Both completion
113
- * (#415) and a future concordance decode write into this one slot.
99
+ * ADDITIONAL roles this single span plays, beyond `tag` (#413). A place can hold multiple admin tiers under one name
100
+ * — a city-state (Berlin is region AND locality) or a capital-seat province (Milano province ~ Milano comune). Rather
101
+ * than synthesize a second node with a borrowed span, the resolver records the extra role(s) here, so one node = one
102
+ * span = many roles (the model Google's `address_components[].types` uses). `tag`/`placeID`/`lat`/`lon` remain the
103
+ * PRIMARY role; each interpretation is a distinct secondary role with its own resolved place. Serializers surface
104
+ * every role (a city-state emits both `region` and `locality`). Distinct from `alternatives` — those are same-role
105
+ * runner-up places (Springfield IL vs MA); interpretations are DIFFERENT tags, same span. Empty / absent for the
106
+ * common single-role node. Both completion (#415) and a future concordance decode write into this one slot.
114
107
  */
115
108
  interpretations?: ReadonlyArray<Interpretation>;
116
109
  }
@@ -118,8 +111,8 @@ export interface AddressNode {
118
111
  export interface Interpretation {
119
112
  tag: ComponentTag;
120
113
  /** Resolver-supplied normalized place URI for this role (e.g. `wof:101909779`). */
121
- placeId?: string;
122
- sourceId?: string;
114
+ placeID?: string;
115
+ sourceID?: string;
123
116
  /** Centroid for this role's place (a capital-seat comune differs from its province). */
124
117
  lat?: number;
125
118
  lon?: number;
@@ -129,9 +122,8 @@ export interface Interpretation {
129
122
  /**
130
123
  * The full decoded tree for one parsed address.
131
124
  *
132
- * `roots` is the list of top-level components in source order. Components that don't have a
133
- * containing parent in the labeled output become roots themselves (e.g. a bare "house_number" with
134
- * no labeled street parent).
125
+ * `roots` is the list of top-level components in source order. Components that don't have a containing parent in the
126
+ * labeled output become roots themselves (e.g. a bare "house_number" with no labeled street parent).
135
127
  */
136
128
  export interface AddressTree {
137
129
  /** The original raw input text — preserved for round-trip and XML root @raw attribute. */
@@ -139,24 +131,23 @@ export interface AddressTree {
139
131
  roots: AddressNode[];
140
132
  /**
141
133
  * The addressing SYSTEM this tree was decoded under, which selects the containment hierarchy
142
- * (`containmentFor(system)` in `./containment.ts`). Absent means the default Western hierarchy
143
- * (`house_number → street → locality → …`).
134
+ * (`containmentFor(system)` in `./containment.ts`). Absent means the default Western hierarchy (`house_number →
135
+ * street → locality → …`).
144
136
  *
145
- * This is forward-compat insurance, not yet a behavioral switch: every system currently resolves
146
- * to the same map, so an absent or present `system` produces identical trees today. It exists so
147
- * that when a distinct system lands (e.g. Japanese block addressing, where `building_number`
148
- * nests under `sub_block`/`block` with no `street` parent), consumers and the tree builder
149
- * already carry the discriminator — no `AddressTree` shape change later. A locale pre-classifier
150
- * (Phase 6+) is the intended source of this value.
137
+ * This is forward-compat insurance, not yet a behavioral switch: every system currently resolves to the same map, so
138
+ * an absent or present `system` produces identical trees today. It exists so that when a distinct system lands (e.g.
139
+ * Japanese block addressing, where `building_number` nests under `sub_block`/`block` with no `street` parent),
140
+ * consumers and the tree builder already carry the discriminator — no `AddressTree` shape change later. A locale
141
+ * pre-classifier (Phase 6+) is the intended source of this value.
151
142
  */
152
143
  system?: AddressSystem;
153
144
  }
154
145
  /**
155
- * The addressing system a tree was decoded under — selects the containment hierarchy. Western
156
- * covers US/EU/most-Latin-script street addressing (`house_number → street → locality`). `japanese`
157
- * is declared for forward-compat (block addressing: `building_number → sub_block → block →
158
- * district`, no street); it currently shares the Western map until Phase 6 gives it a distinct one.
159
- * Open string union so a new system can be added without a breaking enum change.
146
+ * The addressing system a tree was decoded under — selects the containment hierarchy. Western covers
147
+ * US/EU/most-Latin-script street addressing (`house_number → street → locality`). `japanese` is declared for
148
+ * forward-compat (block addressing: `building_number → sub_block → block → district`, no street); it currently shares
149
+ * the Western map until Phase 6 gives it a distinct one. Open string union so a new system can be added without a
150
+ * breaking enum change.
160
151
  */
161
152
  export type AddressSystem = "western" | "japanese" | (string & {});
162
153
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../decoder/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEnE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAA;AAEtC;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC5B,+FAA+F;IAC/F,KAAK,EAAE,MAAM,CAAA;IACb,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAA;IACb,0DAA0D;IAC1D,GAAG,EAAE,MAAM,CAAA;IACX,2CAA2C;IAC3C,KAAK,EAAE,QAAQ,CAAA;IACf,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC3B,GAAG,EAAE,YAAY,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,WAAW,EAAE,CAAA;IACvB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iGAAiG;IACjG,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,kGAAkG;IAClG,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM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;IAC1F,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,WAAW,EAAE,CAAA;IACpB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;CACtB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA"}
@@ -19,8 +19,8 @@
19
19
  *
20
20
  * See `containment.ts` for the parent-of mapping that drives nesting.
21
21
  *
22
- * Phase 4.1 added optional `source` / `sourceId` on `AddressNode` so the XML serializer can emit
23
- * provenance via `src="<source>:<sourceId>"`. The neural pipeline stamps these via
22
+ * Phase 4.1 added optional `source` / `sourceID` on `AddressNode` so the XML serializer can emit
23
+ * provenance via `src="<source>:<sourceID>"`. The neural pipeline stamps these via
24
24
  * `BuildTreeOpts`; the proposal-derived path threads them through from `ClassificationProposal`.
25
25
  * JSON / tuple projections deliberately do not surface provenance — libpostal compat is
26
26
  * essential.
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Lossless decomposition (#493) — the typed-`unknown`-span primitive. Every byte of the input belongs to
7
+ * exactly one segment: a span some node covers, or an `unknown` run the model left all-O. Those all-O runs
8
+ * are what `decodeAsJSON` silently drops (the JSON-hides-gaps trap) — surfacing them lets a consumer route
9
+ * them to fallback logic, display them, or aggregate them as the self-reporting corpus-gap detector.
10
+ *
11
+ * This is the PURE primitive: it reads `tree.raw` + node `[start,end)` ranges and returns the complement.
12
+ * It mutates nothing and changes no serializer — wiring `unknown` into the JSON/XML/tuple contracts + the
13
+ * demo is the focused follow-up (#493). Byte-stable by construction, so it ships ahead of that work.
14
+ */
15
+ import type { AddressTree } from "./types.js";
16
+ export interface UnknownSpan {
17
+ kind: "unknown";
18
+ value: string;
19
+ /** Inclusive start char offset into `tree.raw`. */
20
+ start: number;
21
+ /** Exclusive end char offset into `tree.raw`. */
22
+ end: number;
23
+ }
24
+ /** One tile of the lossless decomposition: a run that some node covers, or an `unknown` gap. */
25
+ export interface LosslessSegment {
26
+ kind: "covered" | "unknown";
27
+ value: string;
28
+ start: number;
29
+ end: number;
30
+ }
31
+ /**
32
+ * Tile `tree.raw` into maximal covered/unknown runs, in source order. The concatenation of the segment values
33
+ * reproduces `tree.raw` exactly — that is the #493 round-trip invariant ({@link isLossless}).
34
+ */
35
+ export declare function losslessSegments(tree: AddressTree): LosslessSegment[];
36
+ /**
37
+ * The all-O runs no node covers, as typed `unknown` spans, in source order. The complement of the node coverage over
38
+ * `tree.raw`.
39
+ */
40
+ export declare function unknownSpans(tree: AddressTree): UnknownSpan[];
41
+ /**
42
+ * The #493 round-trip guarantee: concatenating the lossless segments (covered + unknown), in order, reproduces the
43
+ * original input. Holds by construction unless a node span overshoots the input bounds.
44
+ */
45
+ export declare function isLossless(tree: AddressTree): boolean;
46
+ //# sourceMappingURL=unknown-spans.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unknown-spans.d.ts","sourceRoot":"","sources":["../../decoder/unknown-spans.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,YAAY,CAAA;AAE1D,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,SAAS,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAA;IACb,iDAAiD;IACjD,GAAG,EAAE,MAAM,CAAA;CACX;AAED,gGAAgG;AAChG,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,SAAS,GAAG,SAAS,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;CACX;AAqBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,eAAe,EAAE,CAkBrE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,EAAE,CAI7D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAMrD"}
@@ -0,0 +1,56 @@
1
+ /** Mark every char index `tree.raw` that any node's `[start,end)` covers (nesting overlaps merge naturally). */
2
+ function coveredMask(tree) {
3
+ const len = tree.raw.length;
4
+ const covered = new Uint8Array(len);
5
+ const stack = [...tree.roots];
6
+ while (stack.length > 0) {
7
+ const n = stack.pop();
8
+ const lo = Math.max(0, n.start);
9
+ const hi = Math.min(len, n.end);
10
+ for (let i = lo; i < hi; i++)
11
+ covered[i] = 1;
12
+ for (const c of n.children)
13
+ stack.push(c);
14
+ }
15
+ return covered;
16
+ }
17
+ /**
18
+ * Tile `tree.raw` into maximal covered/unknown runs, in source order. The concatenation of the segment values
19
+ * reproduces `tree.raw` exactly — that is the #493 round-trip invariant ({@link isLossless}).
20
+ */
21
+ export function losslessSegments(tree) {
22
+ const len = tree.raw.length;
23
+ if (len === 0)
24
+ return [];
25
+ const covered = coveredMask(tree);
26
+ const out = [];
27
+ let i = 0;
28
+ while (i < len) {
29
+ const kind = covered[i] ? "covered" : "unknown";
30
+ let j = i + 1;
31
+ while (j < len && !!covered[j] === !!covered[i])
32
+ j++;
33
+ out.push({ kind, value: tree.raw.slice(i, j), start: i, end: j });
34
+ i = j;
35
+ }
36
+ return out;
37
+ }
38
+ /**
39
+ * The all-O runs no node covers, as typed `unknown` spans, in source order. The complement of the node coverage over
40
+ * `tree.raw`.
41
+ */
42
+ export function unknownSpans(tree) {
43
+ return losslessSegments(tree)
44
+ .filter((s) => s.kind === "unknown")
45
+ .map((s) => ({ kind: "unknown", value: s.value, start: s.start, end: s.end }));
46
+ }
47
+ /**
48
+ * The #493 round-trip guarantee: concatenating the lossless segments (covered + unknown), in order, reproduces the
49
+ * original input. Holds by construction unless a node span overshoots the input bounds.
50
+ */
51
+ export function isLossless(tree) {
52
+ return (losslessSegments(tree)
53
+ .map((s) => s.value)
54
+ .join("") === tree.raw);
55
+ }
56
+ //# sourceMappingURL=unknown-spans.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unknown-spans.js","sourceRoot":"","sources":["../../decoder/unknown-spans.ts"],"names":[],"mappings":"AAiCA,gHAAgH;AAChH,SAAS,WAAW,CAAC,IAAiB;IACrC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAA;IAC3B,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAA;IACnC,MAAM,KAAK,GAAkB,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAA;IAE5C,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,EAAG,CAAA;QACtB,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAA;QAC/B,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAA;QAE/B,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE;YAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;QAE5C,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ;YAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC1C,CAAC;IAED,OAAO,OAAO,CAAA;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAiB;IACjD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAA;IAE3B,IAAI,GAAG,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IACxB,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,CAAA;IACjC,MA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,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,CACvB,CAAA;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"validate-tree.d.ts","sourceRoot":"","sources":["../../decoder/validate-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,YAAY,CAAA;AAoB1D,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,cAAc,GAAG,oBAAoB,CAAA;IAC3C,GAAG,EAAE,YAAY,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,OAAO,CAAA;IACd,UAAU,EAAE,aAAa,EAAE,CAAA;CAC3B;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,YAAY,CAwC5D"}
1
+ {"version":3,"file":"validate-tree.d.ts","sourceRoot":"","sources":["../../decoder/validate-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,YAAY,CAAA;AAmB1D,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,cAAc,GAAG,oBAAoB,CAAA;IAC3C,GAAG,EAAE,YAAY,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,OAAO,CAAA;IACd,UAAU,EAAE,aAAa,EAAE,CAAA;CAC3B;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,YAAY,CAwC5D"}
@@ -24,9 +24,8 @@
24
24
  */
25
25
  import { containmentFor } from "./containment.js";
26
26
  /**
27
- * Tags that cannot stand alone: each is a sub-component of a specific structural anchor (street /
28
- * locality / venue / postcode). If none of a tag's allowed parents appear anywhere in the tree, the
29
- * node is an orphan fragment.
27
+ * Tags that cannot stand alone: each is a sub-component of a specific structural anchor (street / locality / venue /
28
+ * postcode). If none of a tag's allowed parents appear anywhere in the tree, the node is an orphan fragment.
30
29
  */
31
30
  const STRICT_DEPENDENTS = new Set([
32
31
  "street_prefix",
@@ -1 +1 @@
1
- {"version":3,"file":"validate-tree.js","sourceRoot":"","sources":["../../decoder/validate-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGjD;;;;GAIG;AACH,MAAM,iBAAiB,GAA8B,IAAI,GAAG,CAAe;IAC1E,eAAe;IACf,wBAAwB;IACxB,eAAe;IACf,cAAc;IACd,MAAM;IACN,oBAAoB;IACpB,WAAW;IACX,OAAO;IACP,gBAAgB;IAChB,gBAAgB;CAChB,CAAC,CAAA;AAcF,8EAA8E;AAC9E,MAAM,UAAU,YAAY,CAAC,IAAiB;IAC7C,MAAM,UAAU,GAAoB,EAAE,CAAA;IACtC,uFAAuF;IACvF,MAAM,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAE5C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAgB,CAAA;IACvC,MAAM,OAAO,GAAG,CAAC,CAAc,EAAQ,EAAE;QACxC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;QAClB,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC5B,CAAC,CAAA;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAE3B,MAAM,IAAI,GAAG,CAAC,IAAiB,EAAE,MA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AU,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,cAAc;gBACpB,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,iBAAiB,MAAM,CAAC,GAAG,uBAAuB,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;aAClG,CAAC,CAAA;QACH,CAAC;QAED,gCAAgC;QAChC,IAAI,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACxF,UAAU,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,oBAAoB;gBAC1B,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,4BAA4B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAyB;aAC1F,CAAC,CAAA;QACH,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAA;IAC5C,CAAC,CAAA;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAA;IAExC,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,UAAU,EAAE,CAAA;AACtD,CAAC"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Publicly accessible environment — non-secret operational config (DB paths, batch tuning, `NODE_ENV`). Safe to log. A
3
+ * live, typed view over `process.env` layered on an optional `.env`; only keys in {@link PublicEnvSchema} appear.
4
+ *
5
+ * @see {@link $private} for secrets (tokens, upload credentials).
6
+ */
7
+ export declare const $public: {
8
+ NODE_ENV: "test" | "development" | "production";
9
+ CI: boolean;
10
+ MAILWOMAN_BATCH_CONCURRENCY: number;
11
+ MAILWOMAN_BATCH_MAX: number;
12
+ MAILWOMAN_WOF_DB?: string | undefined;
13
+ MAILWOMAN_WOF_ADMIN_DB?: string | undefined;
14
+ MAILWOMAN_WOF_POLYGONS_DB?: string | undefined;
15
+ MAILWOMAN_CANDIDATE_DB?: string | undefined;
16
+ MAILWOMAN_POSTAL_CITY_ALIAS_DB?: string | undefined;
17
+ MAILWOMAN_FST_BIN?: string | undefined;
18
+ MAILWOMAN_MODEL_CARD?: string | undefined;
19
+ MAILWOMAN_COARSE_PLACER_DIR?: string | undefined;
20
+ WOF_DATA_DIR?: string | undefined;
21
+ MAILWOMAN_DATA_ROOT?: string | undefined;
22
+ OUT_ROOT?: string | undefined;
23
+ NAD_MODE?: string | undefined;
24
+ NAD_URL?: string | undefined;
25
+ FS_END_OID?: string | undefined;
26
+ SKIP_STATE_FIPS?: string | undefined;
27
+ RATE_SLEEP?: string | undefined;
28
+ MAX_PARALLEL?: string | undefined;
29
+ DRY_RUN?: string | undefined;
30
+ MAX_ATTEMPTS?: string | undefined;
31
+ LOG?: string | undefined;
32
+ CONFIG?: string | undefined;
33
+ PYTHON?: string | undefined;
34
+ MAILWOMAN_RESUME?: string | undefined;
35
+ MAILWOMAN_DEV_MODEL?: string | undefined;
36
+ MAILWOMAN_DEV_TOKENIZER?: string | undefined;
37
+ MAILWOMAN_PUBLISH_MODEL?: string | undefined;
38
+ MAILWOMAN_PUBLISH_TOKENIZER?: string | undefined;
39
+ MAILWOMAN_SKIP_WEIGHTS_COPY?: string | undefined;
40
+ MAILWOMAN_SKIP_WEIGHTS?: string | undefined;
41
+ MAILWOMAN_NPM_PROVENANCE?: string | undefined;
42
+ RELEASE_IT_WORKSPACES_PATH_TO_WORKSPACE?: string | undefined;
43
+ RELEASE_IT_WORKSPACES_TAG?: string | undefined;
44
+ RELEASE_IT_WORKSPACES_ACCESS?: string | undefined;
45
+ RELEASE_IT_WORKSPACES_DRY_RUN?: string | undefined;
46
+ PLAYPEN_WOF_ADMIN_DB?: string | undefined;
47
+ PLAYPEN_WOF_POSTCODE_DB?: string | undefined;
48
+ SLIM_COUNTRIES?: string | undefined;
49
+ MAILWOMAN_DOCS_URL?: string | undefined;
50
+ MAILWOMAN_WOF_HOT_DB?: string | undefined;
51
+ MAILWOMAN_DIAG_INTERP?: string | undefined;
52
+ MAILWOMAN_DUMP_MISS_TAG?: string | undefined;
53
+ MAILWOMAN_WORD_CONSISTENCY?: string | undefined;
54
+ MW_DUMP_REGRESSIONS?: string | undefined;
55
+ PROBE_N?: string | undefined;
56
+ DEBUG?: string | undefined;
57
+ };
58
+ /**
59
+ * Privately accessible environment — secrets and credentials (HF token, API keys, rclone S3 creds). Do NOT log. A live,
60
+ * typed view over `process.env` layered on an optional `.env`; only keys in {@link PrivateEnvSchema} appear.
61
+ *
62
+ * @see {@link $public} for non-secret operational config.
63
+ */
64
+ export declare const $private: {
65
+ HF_BUCKET_URI?: string | undefined;
66
+ HF_ORG_NAME?: string | undefined;
67
+ HF_BUCKET_NAME?: string | undefined;
68
+ HF_BUCKET_RESOLVE_URL?: string | undefined;
69
+ HF_TOKEN?: string | undefined;
70
+ CF_AUTH_TOKEN?: string | undefined;
71
+ GEOCODE_EARTH_API_KEY?: string | undefined;
72
+ DEEPSEEK_API_KEY?: string | undefined;
73
+ ANTHROPIC_API_KEY?: string | undefined;
74
+ RCLONE_S3_ENDPOINT?: string | undefined;
75
+ RCLONE_S3_ACCESS_KEY_ID?: string | undefined;
76
+ RCLONE_S3_SECRET_ACCESS_KEY?: string | undefined;
77
+ OA_BATCH_TOKEN?: string | undefined;
78
+ RELEASE_IT_WORKSPACES_OTP?: string | undefined;
79
+ };
80
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../env/index.ts"],"names":[],"mappings":"AA0BA;;;;;GAKG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA2B,CAAA;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;CAA4B,CAAA"}