@mailwoman/resolver-wof-wasm 11.2.0 → 11.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/lib/browser-cascade.ts +1 -1
  2. package/lib/host-assets.ts +4 -2
  3. package/lib/httpvfs/database.ts +207 -28
  4. package/lib/httpvfs/poi.ts +1 -1
  5. package/lib/httpvfs/resolver.ts +12 -8
  6. package/lib/httpvfs/street/table.ts +2 -2
  7. package/lib/httpvfs/street.ts +12 -13
  8. package/lib/loader.ts +3 -2
  9. package/lib/lookup.ts +2 -2
  10. package/lib/remote/street.ts +2 -2
  11. package/out/browser-cascade.d.ts +1 -1
  12. package/out/env.d.ts +1 -0
  13. package/out/env.d.ts.map +1 -1
  14. package/out/host-assets.d.ts +1 -1
  15. package/out/host-assets.d.ts.map +1 -1
  16. package/out/host-assets.js +4 -2
  17. package/out/host-assets.js.map +1 -1
  18. package/out/httpvfs/database.d.ts +28 -0
  19. package/out/httpvfs/database.d.ts.map +1 -1
  20. package/out/httpvfs/database.js +157 -24
  21. package/out/httpvfs/database.js.map +1 -1
  22. package/out/httpvfs/poi.js +1 -1
  23. package/out/httpvfs/poi.js.map +1 -1
  24. package/out/httpvfs/resolver.d.ts +1 -0
  25. package/out/httpvfs/resolver.d.ts.map +1 -1
  26. package/out/httpvfs/resolver.js +12 -8
  27. package/out/httpvfs/resolver.js.map +1 -1
  28. package/out/httpvfs/street/table.d.ts +1 -1
  29. package/out/httpvfs/street/table.d.ts.map +1 -1
  30. package/out/httpvfs/street/table.js +2 -2
  31. package/out/httpvfs/street/table.js.map +1 -1
  32. package/out/httpvfs/street.d.ts +3 -5
  33. package/out/httpvfs/street.d.ts.map +1 -1
  34. package/out/httpvfs/street.js +10 -12
  35. package/out/httpvfs/street.js.map +1 -1
  36. package/out/loader.d.ts +3 -2
  37. package/out/loader.d.ts.map +1 -1
  38. package/out/loader.js +3 -2
  39. package/out/loader.js.map +1 -1
  40. package/out/lookup.js +2 -2
  41. package/out/lookup.js.map +1 -1
  42. package/out/remote/street.d.ts +2 -2
  43. package/out/remote/street.d.ts.map +1 -1
  44. package/package.json +8 -8
@@ -51,7 +51,7 @@ export interface MailwomanLookupLike {
51
51
  lon: number
52
52
  score: number
53
53
  /**
54
- * True when the candidate's name, abbreviation, or an alias exactly matched
54
+ * Whether the candidate's name, abbreviation, or an alias exactly matched
55
55
  * the query rather than partially.
56
56
  */
57
57
  exactMatch?: boolean | null
@@ -6,7 +6,9 @@
6
6
  * compiled range worker and the `@sqlite.org/sqlite-wasm` runtime it imports,
7
7
  * all loaded at run time by URL, so no bundler ever sees them.
8
8
  *
9
- * Node-side, a build step, never the browser.
9
+ * A Node-side build step stages these assets.
10
+ * The browser only loads them.
11
+ *
10
12
  * `syncArtifact` is the idempotent copy every staged asset goes through: a byte-identical
11
13
  * destination remains unchanged so a dev server watching it sees no change.
12
14
  */
@@ -29,7 +31,7 @@ import { RANGE_WORKER_FILE, SQLITE_RUNTIME_MODULE_FILE } from "#httpvfs/database
29
31
  *
30
32
  * @param label - For logging
31
33
  *
32
- * @returns True if the file was copied
34
+ * @returns Whether the file was copied
33
35
  */
34
36
  export async function syncArtifact(
35
37
  sourcePath: PathBuilderLike,
@@ -131,8 +131,15 @@ const liveClients = new Set<RangeWorkerClient>()
131
131
  *
132
132
  * A worker that fails to answer is counted in `workers` and left out of `cachedBytes`,
133
133
  * and `unanswered` counts it, so a partial sum doesn't read as a complete one.
134
+ *
135
+ * `restarts` counts the workers this page has replaced after a failure.
134
136
  */
135
- export async function rangeWorkerMemory(): Promise<{ workers: number; cachedBytes: number; unanswered: number }> {
137
+ export async function rangeWorkerMemory(): Promise<{
138
+ workers: number
139
+ cachedBytes: number
140
+ unanswered: number
141
+ restarts: number
142
+ }> {
136
143
  const clients = [...liveClients]
137
144
  const replies = await Promise.allSettled(clients.map((client) => client.call({ type: "stats" })))
138
145
  let cachedBytes = 0
@@ -146,31 +153,107 @@ export async function rangeWorkerMemory(): Promise<{ workers: number; cachedByte
146
153
  }
147
154
  }
148
155
 
149
- return { workers: clients.length, cachedBytes, unanswered }
156
+ return { workers: clients.length, cachedBytes, unanswered, restarts: workerRestarts }
157
+ }
158
+
159
+ /**
160
+ * The most times a range worker is replaced inside {@link RANGE_WORKER_RESTART_WINDOW_MS}.
161
+ *
162
+ * It is a starting value with no measurement behind it.
163
+ *
164
+ * @public
165
+ */
166
+ export const RANGE_WORKER_RESTART_LIMIT = 3
167
+
168
+ /**
169
+ * The span over which {@link RANGE_WORKER_RESTART_LIMIT} counts replacements.
170
+ *
171
+ * @public
172
+ */
173
+ export const RANGE_WORKER_RESTART_WINDOW_MS = 60_000
174
+
175
+ /**
176
+ * A range worker failed again after {@link RANGE_WORKER_RESTART_LIMIT} replacements inside the window.
177
+ *
178
+ * The client stops replacing it, and every later call rejects with this error.
179
+ * `cause` holds the worker's last failure.
180
+ *
181
+ * @public
182
+ */
183
+ export class RangeWorkerUnavailableError extends Error {
184
+ constructor(cause: Error) {
185
+ super(
186
+ `The range worker failed ${RANGE_WORKER_RESTART_LIMIT + 1} times in ${RANGE_WORKER_RESTART_WINDOW_MS / 1000} seconds: ${cause.message}`,
187
+ { cause }
188
+ )
189
+
190
+ this.name = "RangeWorkerUnavailableError"
191
+ }
192
+ }
193
+
194
+ /**
195
+ * The count of range workers this page has replaced after a failure.
196
+ */
197
+ let workerRestarts = 0
198
+
199
+ /**
200
+ * One call awaiting the worker's reply.
201
+ */
202
+ interface PendingCall {
203
+ request: RangeWorkerRequest
204
+ resolve: (value: unknown) => void
205
+ reject: (error: Error) => void
206
+ /**
207
+ * Whether a worker failed while it held this call, and the call was posted again.
208
+ */
209
+ reissued: boolean
150
210
  }
151
211
 
152
212
  class RangeWorkerClient implements RangeDatabase {
153
- readonly #worker: Worker
154
- readonly #pending = new Map<number, { resolve: (value: unknown) => void; reject: (error: Error) => void }>()
213
+ readonly #workerURL: string
214
+ #worker: Worker
215
+ readonly #pending = new Map<number, PendingCall>()
155
216
  #nextID = 0
156
217
  /**
157
- * The error from the worker's `error` event.
218
+ * The open request the worker answered, replayed to each replacement worker.
219
+ *
220
+ * A range worker serves one read-only database, and this request determines its whole state.
221
+ */
222
+ #opened: RangeWorkerRequest | null = null
223
+ /**
224
+ * Whether a replacement worker is opening the database.
225
+ *
226
+ * A query the worker receives before its open finishes fails, so calls wait in `#held`.
227
+ */
228
+ #reopening = false
229
+ #held: PendingCall[] = []
230
+ /**
231
+ * When each replacement inside the window happened, in epoch milliseconds.
232
+ */
233
+ #restarts: number[] = []
234
+ /**
235
+ * Why the client stopped: the worker failed before its first open,
236
+ * failed past the restart bound, or was closed.
158
237
  *
159
- * The worker answers each call's own failure with a reply, so this event means the
160
- * worker itself failed and its database state is unknown.
161
238
  * Every later call rejects with this error.
162
239
  */
163
240
  #failure: Error | null = null
164
241
 
165
242
  constructor(workerURL: string) {
166
- this.#worker = new Worker(workerURL, { type: "module" })
243
+ this.#workerURL = workerURL
244
+ this.#worker = this.#start()
167
245
  liveClients.add(this)
246
+ }
168
247
 
169
- this.#worker.addEventListener("message", (event: MessageEvent<RangeWorkerReply>) => {
248
+ #start(): Worker {
249
+ const worker = new Worker(this.#workerURL, { type: "module" })
250
+
251
+ worker.addEventListener("message", (event: MessageEvent<RangeWorkerReply>) => {
170
252
  const reply = event.data
171
253
  const waiter = this.#pending.get(reply.id)
172
254
 
173
- if (!waiter) return
255
+ // A replaced worker's late reply finds no waiter, because its calls were taken back.
256
+ if (!waiter || worker !== this.#worker) return
174
257
 
175
258
  this.#pending.delete(reply.id)
176
259
 
@@ -181,19 +264,107 @@ class RangeWorkerClient implements RangeDatabase {
181
264
  }
182
265
  })
183
266
 
184
- this.#worker.addEventListener("error", (event) => {
185
- const error = new Error(event.message || `The range worker at ${workerURL} failed to load`)
267
+ worker.addEventListener("error", (event) => {
268
+ if (worker !== this.#worker || this.#failure) return
269
+
270
+ this.#recover(new Error(event.message || `The range worker at ${this.#workerURL} failed to load`))
271
+ })
272
+
273
+ return worker
274
+ }
275
+
276
+ /**
277
+ * Replaces a worker that failed, replays its open, and posts again each call the failed worker held.
278
+ *
279
+ * The worker answers each call's own failure with a reply, so an `error` event means
280
+ * the worker itself failed and its database state is unknown.
281
+ *
282
+ * Every call is a read of an immutable database, so posting one again is safe.
283
+ * A call is posted again once: a call that two workers failed on rejects with the second failure.
284
+ */
285
+ #recover(error: Error): void {
286
+ const interrupted = [...this.#pending.values()]
287
+
288
+ this.#pending.clear()
186
289
 
187
- this.#failure = error
290
+ // A worker that never opened has no state to replay, and the opener reports its failure.
291
+ if (!this.#opened) {
292
+ this.#stop(error, interrupted)
188
293
 
189
- for (const waiter of this.#pending.values()) {
190
- waiter.reject(error)
294
+ return
295
+ }
296
+
297
+ const now = Date.now()
298
+
299
+ this.#restarts = this.#restarts.filter((at) => now - at < RANGE_WORKER_RESTART_WINDOW_MS)
300
+
301
+ if (this.#restarts.length >= RANGE_WORKER_RESTART_LIMIT) {
302
+ this.#stop(new RangeWorkerUnavailableError(error), interrupted)
303
+
304
+ return
305
+ }
306
+
307
+ this.#restarts.push(now)
308
+
309
+ workerRestarts++
310
+
311
+ for (const call of interrupted) {
312
+ // The replayed open is the client's own call, and the next replacement replays it again.
313
+ if (call.request === this.#opened) continue
314
+
315
+ if (call.reissued) {
316
+ call.reject(error)
317
+ } else {
318
+ call.reissued = true
319
+ this.#held.push(call)
191
320
  }
321
+ }
192
322
 
193
- this.#pending.clear()
323
+ this.#worker.terminate()
324
+ this.#worker = this.#start()
325
+ this.#reopening = true
326
+
327
+ this.#post({
328
+ request: this.#opened,
329
+ reissued: true,
330
+ resolve: () => {
331
+ const held = this.#held
332
+
333
+ this.#held = []
334
+ this.#reopening = false
335
+
336
+ for (const call of held) {
337
+ this.#post(call)
338
+ }
339
+ },
340
+ reject: (openError) => this.#stop(openError, []),
194
341
  })
195
342
  }
196
343
 
344
+ /**
345
+ * Ends the client: rejects `calls` and every held call with `error`, and every later call too.
346
+ */
347
+ #stop(error: Error, calls: readonly PendingCall[]): void {
348
+ const held = this.#held
349
+
350
+ this.#failure = error
351
+ this.#held = []
352
+ this.#reopening = false
353
+ liveClients.delete(this)
354
+ this.#worker.terminate()
355
+
356
+ for (const call of [...calls, ...held]) {
357
+ call.reject(error)
358
+ }
359
+ }
360
+
361
+ #post(call: PendingCall): void {
362
+ const id = this.#nextID++
363
+
364
+ this.#pending.set(id, call)
365
+ this.#worker.postMessage({ ...call.request, id } as RangeWorkerCall)
366
+ }
367
+
197
368
  call<Request extends RangeWorkerRequest>(request: Request): Promise<RangeWorkerResults[Request["type"]]> {
198
369
  const reply = new Promise<unknown>((resolve, reject) => {
199
370
  if (this.#failure) {
@@ -202,14 +373,27 @@ class RangeWorkerClient implements RangeDatabase {
202
373
  return
203
374
  }
204
375
 
205
- const id = this.#nextID++
376
+ const call: PendingCall = { request, resolve, reject, reissued: false }
206
377
 
207
- this.#pending.set(id, { resolve, reject })
208
- this.#worker.postMessage({ ...request, id } satisfies RangeWorkerCall)
378
+ if (this.#reopening) {
379
+ this.#held.push(call)
380
+
381
+ return
382
+ }
383
+
384
+ this.#post(call)
209
385
  })
210
386
 
211
387
  // The worker answers each request type with that type's result.
212
- return reply as Promise<RangeWorkerResults[Request["type"]]>
388
+ const answered = reply as Promise<RangeWorkerResults[Request["type"]]>
389
+
390
+ if (request.type !== "open") return answered
391
+
392
+ return answered.then((result) => {
393
+ this.#opened = request
394
+
395
+ return result
396
+ })
213
397
  }
214
398
 
215
399
  query<Row = Record<string, SQLValue>>(sql: string, parameters: readonly SQLValue[] = []): Promise<Row[]> {
@@ -228,17 +412,12 @@ class RangeWorkerClient implements RangeDatabase {
228
412
  }
229
413
 
230
414
  close(): void {
231
- const error = new Error("The range database is closed")
415
+ if (this.#failure) return
232
416
 
233
- liveClients.delete(this)
234
- this.#failure ??= error
235
- this.#worker.terminate()
236
-
237
- for (const waiter of this.#pending.values()) {
238
- waiter.reject(error)
239
- }
417
+ const interrupted = [...this.#pending.values()]
240
418
 
241
419
  this.#pending.clear()
420
+ this.#stop(new Error("The range database is closed"), interrupted)
242
421
  }
243
422
  }
244
423
 
@@ -1,7 +1,7 @@
1
1
  // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
2
  // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
3
3
 
4
- import { memoizeResettable } from "@mailwoman/core/memoize"
4
+ import { memoizeResettable } from "@mailwoman/core/async/memoize"
5
5
  import type { POIDistanceHit } from "@mailwoman/core/resolver"
6
6
  import { haversine, shortCellToInt } from "@mailwoman/spatial"
7
7
  import { gridDisk, latLngToCell } from "@sister.software/h3"
@@ -1,19 +1,19 @@
1
1
  // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
2
  // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
3
3
 
4
- import { expandPlacetypeFilter } from "@mailwoman/codex/placetype-map"
5
- import { tryParsingJSON } from "@mailwoman/core/json"
6
- import { memoizeResettable } from "@mailwoman/core/memoize"
7
- import { isPresent } from "@mailwoman/core/objects"
8
- import { referentialFromPopulation } from "@mailwoman/core/resolver"
4
+ import { expandPlacetypeFilter } from "@mailwoman/codex/labels/placetype-map"
5
+ import { memoizeResettable } from "@mailwoman/core/async/memoize"
6
+ import { populationScoreUnmeasured, referentialFromPopulation } from "@mailwoman/core/resolver"
7
+ import { tryParsingJSON } from "@mailwoman/core/values/json"
8
+ import { isPresent } from "@mailwoman/core/values/objects"
9
9
  import type { CandidateTable } from "@mailwoman/resolver-wof-sqlite/candidate/schema"
10
+ import { normalizeLocalityForKey, stripLocalityQualifier } from "@mailwoman/resolver-wof-sqlite/labels/street/normalize"
10
11
  import {
11
12
  rankByPrimaryPreference,
12
13
  type RankedRow,
13
14
  RERANK_FETCH,
14
- } from "@mailwoman/resolver-wof-sqlite/primary-preference"
15
- import { applyProximityRerank } from "@mailwoman/resolver-wof-sqlite/proximity-rerank"
16
- import { normalizeLocalityForKey, stripLocalityQualifier } from "@mailwoman/resolver-wof-sqlite/street/normalize"
15
+ } from "@mailwoman/resolver-wof-sqlite/ranking/primary-preference"
16
+ import { applyProximityRerank } from "@mailwoman/resolver-wof-sqlite/ranking/proximity-rerank"
17
17
 
18
18
  import type { MailwomanLookupLike } from "#browser-cascade"
19
19
  import { type RangeDatabase, tableExists } from "#httpvfs/database"
@@ -232,6 +232,10 @@ export class WOFCandidateTableLookup implements MailwomanLookupLike {
232
232
  lon: Number(row.longitude),
233
233
 
234
234
  score: -(row.neg_rank as number),
235
+ // An artifact without the population column can't say whether `neg_rank` measured a population.
236
+ ...("population" in row && !(typeof row.population === "number" && row.population > 0)
237
+ ? { scoreUnmeasured: populationScoreUnmeasured(null, Number(row.neg_rank)) }
238
+ : {}),
235
239
  prominence: -Number(row.effectiveNegRank),
236
240
 
237
241
  exactMatch: !row.demoted,
@@ -1,7 +1,7 @@
1
1
  // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
2
  // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
3
3
 
4
- import { parseJSONStrict } from "@mailwoman/core/json"
4
+ import { parseJSONStrict } from "@mailwoman/core/values/json"
5
5
  import {
6
6
  crossingsStatement,
7
7
  streetsInPlacesStatement,
@@ -12,7 +12,7 @@ import {
12
12
  type StreetTableHit,
13
13
  type StreetTableLookup,
14
14
  type StreetTableQuery,
15
- } from "@mailwoman/resolver-wof-sqlite/street/table"
15
+ } from "@mailwoman/resolver-wof-sqlite/labels/street/table"
16
16
  import { haversine } from "@mailwoman/spatial/geometries/point/distance"
17
17
 
18
18
  import type { RangeDatabase } from "#httpvfs/database"
@@ -10,16 +10,17 @@
10
10
  * lockstep with `StreetInterpolator`.
11
11
  */
12
12
 
13
- import { parseJSONStrict } from "@mailwoman/core/json"
14
- import { memoizeResettable } from "@mailwoman/core/memoize"
13
+ import { memoizeResettable } from "@mailwoman/core/async/memoize"
14
+ import { parseJSONStrict } from "@mailwoman/core/values/json"
15
15
  import {
16
16
  canonicalizeRouteKey,
17
17
  normalizeLocalityForKey,
18
18
  normalizeStreetForKey,
19
19
  normalizeStreetForKeyLocale,
20
+ streetKeyRulesOf,
20
21
  type StreetLocale,
21
22
  stripArrondissement,
22
- } from "@mailwoman/resolver-wof-sqlite/street/normalize"
23
+ } from "@mailwoman/resolver-wof-sqlite/labels/street/normalize"
23
24
  import { clampFraction, pointAlong } from "@mailwoman/spatial/polyline"
24
25
 
25
26
  import { type RangeDatabase, tableExists } from "#httpvfs/database"
@@ -58,13 +59,11 @@ export class HTTPVFSAddressPointLookup {
58
59
 
59
60
  /**
60
61
  * `streetLocale` must match the extract's build locale (the node class's interface).
61
- *
62
- * @defaultValue `"us"`
63
62
  */
64
- constructor(database: RangeDatabase, opts: { streetLocale?: StreetLocale } = {}) {
63
+ constructor(database: RangeDatabase, opts: { streetLocale: StreetLocale }) {
65
64
  this.#database = database
66
65
  this.#hasTable = memoizeResettable(() => tableExists(database, "address_point"))
67
- this.#locale = opts.streetLocale ?? "us"
66
+ this.#locale = opts.streetLocale
68
67
  }
69
68
 
70
69
  async find(query: {
@@ -90,12 +89,12 @@ export class HTTPVFSAddressPointLookup {
90
89
  }
91
90
 
92
91
  if (!rows.length && query.locality) {
93
- // FR extracts fold arrondissement communes to the base city on both sides
94
- // (the node class and BAN builder discipline), so mirror it here to keep the twins in lockstep.
95
- const localityKey =
96
- this.#locale === "fr"
97
- ? stripArrondissement(normalizeLocalityForKey(query.locality))
98
- : normalizeLocalityForKey(query.locality)
92
+ // The node class reads the same rule, so the two readers key an arrondissement commune alike.
93
+ const written = normalizeLocalityForKey(query.locality)
94
+
95
+ const localityKey = streetKeyRulesOf(this.#locale).arrondissementAtBaseCity
96
+ ? stripArrondissement(written)
97
+ : written
99
98
 
100
99
  rows = await this.#database.query<StreetPointHit>(ADDRESS_POINT_BY_LOCALITY, [localityKey, streetNorm, number])
101
100
  }
package/lib/loader.ts CHANGED
@@ -51,13 +51,14 @@ export interface LoadSlimOpts {
51
51
  }
52
52
 
53
53
  /**
54
- * Loads + opens the slim WOF DB.
54
+ * Loads and opens the slim WOF database.
55
55
  *
56
56
  * Returns `{ db, sqlite3 }`.
57
57
  * `db` is the open Database; `sqlite3` is the runtime handle
58
58
  * (in case the caller wants to call other OO1 APIs on it).
59
59
  *
60
- * Caller is responsible for disposing the returned database with {@link disposeSlimWOFDatabase} when done.
60
+ * The caller must dispose of the returned database with {@link disposeSlimWOFDatabase}
61
+ * when it is no longer needed.
61
62
  */
62
63
  export async function loadSlimWOFDatabase(opts: LoadSlimOpts): Promise<{ db: Database; sqlite3: Sqlite3Static }> {
63
64
  const bytes = typeof opts.source === "string" ? await fetchBytes(opts.source, opts.fetchImpl) : opts.source
package/lib/lookup.ts CHANGED
@@ -18,14 +18,14 @@
18
18
  * implementation of each rather than a convention.
19
19
  */
20
20
 
21
- import { expandPlacetypeFilter } from "@mailwoman/codex/placetype-map"
21
+ import { expandPlacetypeFilter } from "@mailwoman/codex/labels/placetype-map"
22
22
  import type { FindPlaceQuery, PlaceCandidate, PlaceLookup, WOFPlacetype } from "@mailwoman/resolver-wof-sqlite"
23
23
  // Browser-safe subpath imports (fts.ts's only node:sqlite import is type-only).
24
24
  // The shared alias-bag parser and query fold keep this backend byte-identical to Node's exact tier.
25
25
  // The shared FTS sanitizer and ranking weights preserve its query and ranking behavior.
26
26
  import { aliasBagExactMatch, foldQueryText } from "@mailwoman/resolver-wof-sqlite/fts"
27
27
  import { normalizePlacetypes, sanitizeFTSQuery } from "@mailwoman/resolver-wof-sqlite/fts/query"
28
- import { DEFAULT_WEIGHTS, populationBoostTerm } from "@mailwoman/resolver-wof-sqlite/ranking-weights"
28
+ import { DEFAULT_WEIGHTS, populationBoostTerm } from "@mailwoman/resolver-wof-sqlite/ranking/weights"
29
29
  import type { Database } from "@sqlite.org/sqlite-wasm"
30
30
 
31
31
  import { disposeSlimWOFDatabase } from "#loader"
@@ -14,7 +14,7 @@ import type {
14
14
  StreetTableHit,
15
15
  StreetTableLookup,
16
16
  StreetTableQuery,
17
- } from "@mailwoman/resolver-wof-sqlite/street/table"
17
+ } from "@mailwoman/resolver-wof-sqlite/labels/street/table"
18
18
  import { haversine } from "@mailwoman/spatial/geometries/point/distance"
19
19
 
20
20
  /**
@@ -120,7 +120,7 @@ export interface StreetTableAnswer {
120
120
  */
121
121
  alternatives: StreetTableHit[]
122
122
  /**
123
- * True when the address states a postcode and no street of this name lies within reach of its point.
123
+ * Whether the address states a postcode and no street of this name lies within reach of its point.
124
124
  */
125
125
  postcodeDisagrees: boolean
126
126
  }
@@ -42,7 +42,7 @@ export interface MailwomanLookupLike {
42
42
  lon: number;
43
43
  score: number;
44
44
  /**
45
- * True when the candidate's name, abbreviation, or an alias exactly matched
45
+ * Whether the candidate's name, abbreviation, or an alias exactly matched
46
46
  * the query rather than partially.
47
47
  */
48
48
  exactMatch?: boolean | null;
package/out/env.d.ts CHANGED
@@ -13,6 +13,7 @@ export declare const $public: Record<never, never> & {
13
13
  MAILWOMAN_CONFIG_ROOT: string;
14
14
  MAILWOMAN_CACHE_ROOT: string;
15
15
  MAILWOMAN_TEMP_ROOT: string;
16
+ MAILWOMAN_WEIGHTS_OVERLAY_ROOT?: string | undefined;
16
17
  MAILWOMAN_COARSE_PLACER_DIR?: string | undefined;
17
18
  MAILWOMAN_DOCS_URL?: string | undefined;
18
19
  MAILWOMAN_LICENSE_KEY?: string | undefined;
package/out/env.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../lib/env.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;GAEG;AACH,eAAO,MAAM,sBAAsB;;iBAKjC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;CAA8C,CAAA"}
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../lib/env.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;GAEG;AACH,eAAO,MAAM,sBAAsB;;iBAKjC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;CAA8C,CAAA"}
@@ -8,7 +8,7 @@ import { type PathBuilderLike } from "path-ts";
8
8
  *
9
9
  * @param label - For logging
10
10
  *
11
- * @returns True if the file was copied
11
+ * @returns Whether the file was copied
12
12
  */
13
13
  export declare function syncArtifact(sourcePath: PathBuilderLike, destPath: PathBuilderLike, label: string): Promise<boolean>;
14
14
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"host-assets.d.ts","sourceRoot":"","sources":["../lib/host-assets.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAIpE;;;;;;;;;;GAUG;AACH,wBAAsB,YAAY,CACjC,UAAU,EAAE,eAAe,EAC3B,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC,CAsBlB;AAWD;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAkDzF"}
1
+ {"version":3,"file":"host-assets.d.ts","sourceRoot":"","sources":["../lib/host-assets.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAIpE;;;;;;;;;;GAUG;AACH,wBAAsB,YAAY,CACjC,UAAU,EAAE,eAAe,EAC3B,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC,CAsBlB;AAWD;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAkDzF"}
@@ -5,7 +5,9 @@
5
5
  * compiled range worker and the `@sqlite.org/sqlite-wasm` runtime it imports,
6
6
  * all loaded at run time by URL, so no bundler ever sees them.
7
7
  *
8
- * Node-side, a build step, never the browser.
8
+ * A Node-side build step stages these assets.
9
+ * The browser only loads them.
10
+ *
9
11
  * `syncArtifact` is the idempotent copy every staged asset goes through: a byte-identical
10
12
  * destination remains unchanged so a dev server watching it sees no change.
11
13
  */
@@ -25,7 +27,7 @@ import { RANGE_WORKER_FILE, SQLITE_RUNTIME_MODULE_FILE } from "#httpvfs/database
25
27
  *
26
28
  * @param label - For logging
27
29
  *
28
- * @returns True if the file was copied
30
+ * @returns Whether the file was copied
29
31
  */
30
32
  export async function syncArtifact(sourcePath, destPath, label) {
31
33
  if (!(await pathExists(sourcePath))) {
@@ -1 +1 @@
1
- {"version":3,"file":"host-assets.js","sourceRoot":"","sources":["../lib/host-assets.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAA;AAChF,OAAO,EAAE,OAAO,EAAE,WAAW,EAAwB,MAAM,SAAS,CAAA;AAEpE,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAA;AAEjF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CACjC,UAA2B,EAC3B,QAAyB,EACzB,KAAa;IAEb,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,iBAAiB,KAAK,uBAAuB,UAAU,EAAE,CAAC,CAAA;QAEvE,OAAO,KAAK,CAAA;IACb,CAAC;IAED,MAAM,UAAU,GAAG,CA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,CAAC,CAAC,CAAA;QAEpC,+DAA+D;QAC/D,mGAAmG;QACnG,oDAAoD;QACpD,2FAA2F;QAC3F,kFAAkF;QAClF,yEAAyE;QACzE,+DAA+D;QAC/D,iFAAiF;QACjF,IAAI,MAAM,YAAY,CAAC,GAAG,EAAE,IAAI,EAAE,gBAAgB,CAAC,EAAE,CAAC,EAAE,CAAC;YACxD,MAAM,EAAE,CAAA;QACT,CAAC;IACF,CAAC;IAED,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,sCAAsC,MAAM,mBAAmB,CAAC,CAAA;IAC7E,CAAC;IAED,OAAO,IAAI,CAAA;AACZ,CAAC"}
@@ -89,12 +89,40 @@ export declare const SQLITE_RUNTIME_MODULE_FILE = "index.mjs";
89
89
  *
90
90
  * A worker that fails to answer is counted in `workers` and left out of `cachedBytes`,
91
91
  * and `unanswered` counts it, so a partial sum doesn't read as a complete one.
92
+ *
93
+ * `restarts` counts the workers this page has replaced after a failure.
92
94
  */
93
95
  export declare function rangeWorkerMemory(): Promise<{
94
96
  workers: number;
95
97
  cachedBytes: number;
96
98
  unanswered: number;
99
+ restarts: number;
97
100
  }>;
101
+ /**
102
+ * The most times a range worker is replaced inside {@link RANGE_WORKER_RESTART_WINDOW_MS}.
103
+ *
104
+ * It is a starting value with no measurement behind it.
105
+ *
106
+ * @public
107
+ */
108
+ export declare const RANGE_WORKER_RESTART_LIMIT = 3;
109
+ /**
110
+ * The span over which {@link RANGE_WORKER_RESTART_LIMIT} counts replacements.
111
+ *
112
+ * @public
113
+ */
114
+ export declare const RANGE_WORKER_RESTART_WINDOW_MS = 60000;
115
+ /**
116
+ * A range worker failed again after {@link RANGE_WORKER_RESTART_LIMIT} replacements inside the window.
117
+ *
118
+ * The client stops replacing it, and every later call rejects with this error.
119
+ * `cause` holds the worker's last failure.
120
+ *
121
+ * @public
122
+ */
123
+ export declare class RangeWorkerUnavailableError extends Error {
124
+ constructor(cause: Error);
125
+ }
98
126
  /**
99
127
  * Opens the SQLite database at `databaseURL` by fetching the whole file into memory.
100
128
  *
@@ -1 +1 @@
1
- {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../lib/httpvfs/database.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH,OAAO,KAAK,EAMX,QAAQ,EACR,MAAM,0BAA0B,CAAA;AAEjC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,SAAS,QAAQ,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;IAEpG;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;IAE5B;;;;;OAKG;IACH,KAAK,CAAC,IAAI,IAAI,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,QAAmB,CAAA;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,QAAS,CAAA;AASxC;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IAElC,YAAY,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,EAIrD;CACD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE3D;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,oBAAoB,CAAA;AAElD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,cAAc,CAAA;AAOrD;;;;;GAKG;AACH,wBAAsB,iB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