@mailwoman/mcp 10.0.0 → 10.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.
package/out/cli.js DELETED
@@ -1,282 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * @copyright Sister Software
4
- * @license AGPL-3.0
5
- * @author Teffen Ellis, et al.
6
- *
7
- * `mailwoman-mcp` — boot the MCP server over stdio. Wires the real `MCPToolDeps` (`tools.ts`) from the mailwoman
8
- * library: `createRuntimePipeline` for parse/POI-intent, `geocode-core`'s `geocodeAddress` for geocode,
9
- * `mailwoman/poi-overpass`'s `emitOverpassQL` for the export tool, `@mailwoman/core/layers` for the layer
10
- * manifest tool, and `@mailwoman/bdc`'s `filingLandscape`/`plausibilityCheck` for the two BDC tools.
11
- *
12
- * Deps are LAZY: nothing here loads the neural weights or opens a gazetteer db at startup — an MCP client
13
- * connects, lists tools, and may never call one (or may call only the layer-database tools, none of which touch the
14
- * classifier). The shared classifier+resolver are built once, on the FIRST call to any tool that needs them, and
15
- * cached for the process lifetime. `mailwoman_overpass_export` DOES need them despite never executing a query — it
16
- * parses the input to find the subject and anchor before it can emit OverpassQL.
17
- *
18
- * **Laziness moves the first failure into a tool call, so `loadCore` owns the friendly-failure messages** that
19
- * `photon`/`nominatim`/`mailwoman serve` print at boot. Both are thrown, not printed: `server.ts` catches a handler
20
- * throw and returns it as an `isError` tool result, so a thrown message reaches the agent where a `console.error` +
21
- * `process.exit(1)` would just kill the transport mid-conversation. See `loadCore` for the two.
22
- *
23
- * **Graceful layer-absent guards (decision 6).** Both BDC-backed tools treat a missing/unreadable
24
- * database file as absence, never a raw `node:sqlite` throw ("unable to open database file"): `bdcFilingLandscape`
25
- * requires bdc.db unconditionally, so a missing file becomes one friendly thrown `Error` naming the layer;
26
- * `plausibilityCheck`'s `bdcDB`/`poi` deps are each OPTIONAL, so a missing/absent `bdc_database_path`/
27
- * `poi_database_path` degrades to the SAME typed-abstain evidence entry (`{type:"abstain",
28
- * reason:"requires_bdc_layer"|"requires_build_local_layer"}`) the scorer already produces for an omitted dep. The
29
- * guards themselves (`assertBDCDatabaseExists`, `openBDCDatabaseIfPresent`, `openPlausibilityPOIDeps`) live in
30
- * `./layer-guards.ts`, NOT here — they're pure, transport-independent logic with no need for the stdio connection
31
- * this file opens at import time (which is exactly why THIS file can't be unit-tested directly; see
32
- * `layer-guards.test.ts` for their branch coverage).
33
- *
34
- * `mailwoman_filer_lookup` follows the SAME "requires the layer unconditionally" discipline as
35
- * `mailwoman_bdc_filing_landscape` (`assertFilerDatabaseExists` + `openFilerDatabaseIfPresent`, mirroring
36
- * `assertBDCDatabaseExists` + the BDC open) — `filerLookup` itself has no optional-dep abstain shape (criterion 4 makes
37
- * it throw rather than answer unstamped), so a missing filer.db becomes one friendly thrown Error naming the layer.
38
- *
39
- * `mailwoman_filer_family` follows the IDENTICAL discipline, reusing the same two guards — `familyRollup`
40
- * has no optional-dep abstain shape either (it throws on a bad `familyID`/`nodeID` XOR or a pre-`filer_family`
41
- * schema), so filer.db is required unconditionally here too. Its result — always `FamilyRollup[]`, never `null` or
42
- * a bare object — is passed through untouched: this data is who-owns-whom, and a silent reshape here would be a
43
- * fabricated relationship claim.
44
- *
45
- * ```sh
46
- * mailwoman-mcp # geocode/poi_search degrade gracefully with no poi.db wired
47
- * mailwoman-mcp --poi-db poi.db # mailwoman_poi_search additionally executes against poi.db
48
- * ```
49
- */
50
- import { filingLandscape, plausibilityCheck } from "@mailwoman/bdc";
51
- import { pathExists } from "@mailwoman/core/fs/readers";
52
- import { readLayerManifest } from "@mailwoman/core/layers";
53
- import { parseArguments } from "@mailwoman/core/scripting/arguments";
54
- import { mailwomanDataRoot, wofExtractPaths } from "@mailwoman/core/utils";
55
- import { familyRollup } from "@mailwoman/filer/family-rollup";
56
- import { filerLookup } from "@mailwoman/filer/filer-lookup";
57
- import { toFRN } from "@mailwoman/filer/frn";
58
- import { NeuralAddressClassifier } from "@mailwoman/neural";
59
- import { getPOICategory } from "@mailwoman/poi-taxonomy";
60
- import { emitOverpassQL } from "@mailwoman/poi-taxonomy/overpass";
61
- import { createWOFResolver } from "@mailwoman/resolver";
62
- import { DatabaseClient } from "@mailwoman/sqlite/client";
63
- import { createRuntimePipeline } from "mailwoman";
64
- import { geocodeAddress, RegionDatabaseProvider } from "mailwoman/geocode";
65
- import { buildNoGazetteerMessage, createResolverBackend, resolveCandidateDBPath } from "mailwoman/resolver-backend";
66
- import { assertBDCDatabaseExists, assertFilerDatabaseExists, openBDCDatabaseIfPresent, openFilerDatabaseIfPresent, openPlausibilityPOIDeps, } from "#layer-guards";
67
- import { createMCPServer } from "#server";
68
- const { values } = parseArguments({
69
- options: {
70
- "poi-db": { type: "string" },
71
- },
72
- allowPositionals: true,
73
- });
74
- /**
75
- * `--poi-db` wires `mailwoman_poi_search` (and, via the same pipeline, `mailwoman_parse`'s `poi: true` path) to a real
76
- * `poi.db`. Absent → intent-only (parses the query, extracts the subject/anchor, never executes a lookup).
77
- */
78
- const poiDatabasePath = values["poi-db"];
79
- /**
80
- * The shared classifier + resolver, built exactly once on the first call that needs them (see the module header).
81
- * `NeuralAddressClassifier.loadFromWeights` auto-resolves the bundled `en-US` weights; the resolver backend prefers a
82
- * configured candidate gazetteer (`$MAILWOMAN_CANDIDATE_DB`) and otherwise falls back to the admin-only WOF extracts
83
- * already on the data root — same selection `nominatim`/`photon`'s CLIs make.
84
- */
85
- let corePromise;
86
- /**
87
- * The four tools that need {@link loadCore} — every path through `getPlainPipeline`/`getPoiPipeline`/`resolveGeocode`.
88
- * `mailwoman_layer_manifest`, `mailwoman_bdc_filing_landscape`, `mailwoman_filer_lookup` and `mailwoman_filer_family`
89
- * never call it, so they keep working when this fails; `mailwoman_plausibility_check` only reaches it when it geocodes.
90
- * Named in both guard messages below because an agent that just got one needs to know what it can still do.
91
- */
92
- const CORE_BACKED_TOOLS = "mailwoman_parse, mailwoman_geocode, mailwoman_poi_search, mailwoman_overpass_export";
93
- const CORE_FREE_TOOLS = "mailwoman_layer_manifest, mailwoman_bdc_filing_landscape, mailwoman_filer_lookup, mailwoman_filer_family";
94
- function loadCore() {
95
- corePromise ??= (async () => {
96
- const resolverMod = await import("@mailwoman/resolver-wof-sqlite");
97
- const wofPaths = [];
98
- for (const extractPath of wofExtractPaths()) {
99
- if (await pathExists(extractPath)) {
100
- wofPaths.push(extractPath);
101
- }
102
- }
103
- const candidateDB = await resolveCandidateDBPath();
104
- // #1009 friendly-failure discipline, the MCP shape of it. `server.ts` turns a thrown Error into an
105
- // `isError` tool result carrying `error.message`, so the message an agent reads IS whatever is thrown
106
- // here — which made the raw internal `resolveExtracts: at least one extract is required` the first thing a
107
- // stranger saw from `mailwoman_parse` on a fresh install (measured 2026-08-03 against a standalone
108
- // `npm install @mailwoman/mcp`). Same preflight as `photon`/`nominatim`/`mailwoman serve`, and the same
109
- // discovery: #1444 moved the `<data-root>/wof/candidate.db` convention fallback INTO
110
- // `resolveCandidateDBPath`, so this bare call picks a pulled gazetteer up with nothing exported. The
111
- // `MAILWOMAN_DATA_ROOT` in the client's `env` block is enough on its own.
112
- if (!candidateDB && !wofPaths.length) {
113
- throw new Error(`${buildNoGazetteerMessage({
114
- dataRoot: mailwomanDataRoot(),
115
- docsPath: "/docs/developers/how-to/use-the-mcp-server",
116
- })}\n\n Needs it: ${CORE_BACKED_TOOLS}\n Works without it: ${CORE_FREE_TOOLS}`);
117
- }
118
- const backend = await createResolverBackend(resolverMod, { wofPaths, candidateDB });
119
- const resolver = createWOFResolver(backend);
120
- // Same discipline for the model weights. `@mailwoman/neural-weights-en-us` is a declared dependency of
121
- // this package as of 2026-08-03 — before that a standalone `npm install @mailwoman/mcp` resolved
122
- // nothing and every core-backed tool answered with `resolveWeights`' raw not-found text. The guard keeps
123
- // that text (it already names the exact fix command) and adds what an agent mid-conversation needs next:
124
- // which tools are down and which are not.
125
- let classifier;
126
- try {
127
- classifier = await NeuralAddressClassifier.loadRoutedFromWeights({ locale: "en-US" });
128
- }
129
- catch (error) {
130
- throw new Error(`✗ ${error instanceof Error ? error.message : String(error)}\n\n` +
131
- ` Needs it: ${CORE_BACKED_TOOLS}\n Works without it: ${CORE_FREE_TOOLS}`);
132
- }
133
- const databases = await RegionDatabaseProvider.create(resolverMod, mailwomanDataRoot());
134
- return { classifier, resolver, databases };
135
- })();
136
- return corePromise;
137
- }
138
- let plainPipeline;
139
- /**
140
- * Keyed by the poi.db path used to build it (`""` = intent-only, no db) — `mailwoman_poi_search` can be called with a
141
- * `poiDatabasePath` that differs from the server's `--poi-db`, in which case a fresh one-off pipeline is built and
142
- * cached under that path instead of reusing the default.
143
- */
144
- const poiPipelines = new Map();
145
- async function getPlainPipeline() {
146
- if (!plainPipeline) {
147
- const { classifier, resolver } = await loadCore();
148
- plainPipeline = createRuntimePipeline({ classifier, resolver });
149
- }
150
- return plainPipeline;
151
- }
152
- async function getPoiPipeline(dbPath) {
153
- const key = dbPath ?? "";
154
- const cached = poiPipelines.get(key);
155
- if (cached)
156
- return cached;
157
- const { classifier, resolver } = await loadCore();
158
- const pipeline = createRuntimePipeline({
159
- classifier,
160
- resolver,
161
- poiQueryKind: dbPath ? { poiDatabasePath: dbPath } : true,
162
- });
163
- poiPipelines.set(key, pipeline);
164
- return pipeline;
165
- }
166
- /**
167
- * `plausibilityCheck`'s geocode dep — reuses the SAME shared classifier+resolver `deps.geocode` builds from (see the
168
- * module header's laziness note). `deriveGeocodeRegister`/the formatted register is the geocode dep's concern, so it is
169
- * wired at this CLI/MCP layer rather than inside `plausibility.ts`. The real return type (`GeocodeResult`) is
170
- * structurally assignable to `plausibility.ts`'s minimal `GeocodeLike` — no adapter needed.
171
- */
172
- async function resolveGeocode(address) {
173
- const { classifier, resolver, databases } = await loadCore();
174
- return geocodeAddress(address, { classifier, resolver, databases: databases.for });
175
- }
176
- const deps = {
177
- async parse(text, opts) {
178
- const pipeline = opts?.poi ? await getPoiPipeline(poiDatabasePath) : await getPlainPipeline();
179
- return pipeline(text);
180
- },
181
- async geocode(text) {
182
- return resolveGeocode(text);
183
- },
184
- async poiSearch(q) {
185
- const pipeline = await getPoiPipeline(q.poiDatabasePath ?? poiDatabasePath);
186
- const result = await pipeline(q.query);
187
- return result.poiIntent ?? { type: "abstain", reason: "not_poi_shaped" };
188
- },
189
- async overpassExport(query) {
190
- // Intent-only is enough here — the export just needs the parsed subject/anchor, never executed results
191
- // ("we print the query; we never run it", poi-overpass.ts). Reuses the server's wired poi pipeline (a
192
- // real poi.db doesn't change the emitted OverpassQL) instead of forcing a second one-off pipeline.
193
- const pipeline = await getPoiPipeline(poiDatabasePath);
194
- const result = await pipeline(query);
195
- const outcome = result.poiIntent;
196
- if (!outcome || outcome.type !== "intent") {
197
- const reason = outcome?.type === "abstain" ? `: ${outcome.reason}` : "";
198
- throw new Error(`mailwoman_overpass_export: query is not POI-shaped (${outcome?.type ?? "no poi intent"}${reason})`);
199
- }
200
- const { subject } = outcome.intent;
201
- // One tag per category the subject reaches, and only when EVERY member carries one: a union emitted from the
202
- // subset that happens to have an `osmTag` is a narrower query than the POI branch ran.
203
- const osmTags = subject.kind === "category"
204
- ? subject.categoryIDs.map((id) => getPOICategory(id)?.osmTag).filter((tag) => tag !== undefined)
205
- : [];
206
- return emitOverpassQL(outcome.intent, subject.kind === "category" && osmTags.length === subject.categoryIDs.length ? { osmTags } : {});
207
- },
208
- async layerManifest(databasePath) {
209
- using db = new DatabaseClient(databasePath, { readOnly: true });
210
- const manifest = await readLayerManifest(db);
211
- const coverage = await db
212
- .selectFrom("layer_coverage")
213
- .select((eb) => [
214
- eb.fn.count("h3_cell").as("surveyedCellCount"),
215
- eb.fn.avg("completeness").as("averageCompleteness"),
216
- eb.fn.sum("observed_rows").as("totalObservedRows"),
217
- ])
218
- .executeTakeFirst();
219
- return { manifest, coverage };
220
- },
221
- async bdcFilingLandscape(q) {
222
- // Decision 6: `mailwoman_bdc_filing_landscape` requires bdc.db unconditionally (no optional-dep
223
- // abstain shape exists for this tool), so a missing file becomes a friendly thrown Error naming the layer —
224
- // never the raw `node:sqlite` "unable to open database file" message.
225
- await assertBDCDatabaseExists("mailwoman_bdc_filing_landscape", q.databasePath);
226
- using db = new DatabaseClient(q.databasePath, { readOnly: true });
227
- return filingLandscape(db, { geoids: q.geoids, h3Cells: q.h3Cells });
228
- },
229
- async plausibilityCheck(q) {
230
- const bdcDB = await openBDCDatabaseIfPresent(q.bdcDatabasePath);
231
- const poi = await openPlausibilityPOIDeps(q.poiDatabasePath);
232
- try {
233
- return await plausibilityCheck({
234
- address: q.address,
235
- point: q.point,
236
- geoid: q.geoid,
237
- technologyCode: q.technologyCode,
238
- claimedDownloadMbps: q.claimedDownloadMbps,
239
- }, { bdcDB, poi, geocode: resolveGeocode });
240
- }
241
- finally {
242
- bdcDB?.destroy();
243
- poi?.contractDB.destroy();
244
- }
245
- },
246
- async filerLookup(q) {
247
- // Decision 6 / criterion 4: filerLookup has no optional-dep abstain shape — it throws rather than
248
- // answer unstamped — so filer.db is required unconditionally, same discipline as bdc.db is for
249
- // mailwoman_bdc_filing_landscape.
250
- await assertFilerDatabaseExists("mailwoman_filer_lookup", q.databasePath);
251
- using db = (await openFilerDatabaseIfPresent(q.databasePath));
252
- let frn;
253
- if (q.frn !== undefined) {
254
- const parsed = toFRN(q.frn);
255
- if (!parsed) {
256
- throw new Error(`mailwoman_filer_lookup: "${q.frn}" is not a valid FRN`);
257
- }
258
- frn = parsed;
259
- }
260
- return await filerLookup(db, {
261
- frn,
262
- form499ID: q.form499ID,
263
- bdcProviderID: q.bdcProviderID,
264
- asOf: q.asOf,
265
- });
266
- },
267
- async filerFamily(q) {
268
- // Same discipline as mailwoman_filer_lookup — familyRollup has no optional-dep abstain shape
269
- // either, so filer.db is required unconditionally.
270
- await assertFilerDatabaseExists("mailwoman_filer_family", q.databasePath);
271
- using db = (await openFilerDatabaseIfPresent(q.databasePath));
272
- return familyRollup(db, {
273
- familyID: q.familyID,
274
- nodeID: q.nodeID,
275
- asOf: q.asOf,
276
- });
277
- },
278
- };
279
- const server = createMCPServer(deps);
280
- const { StdioServerTransport } = await import("@modelcontextprotocol/sdk/server/stdio.js");
281
- await server.connect(new StdioServerTransport());
282
- //# sourceMappingURL=cli.js.map
package/out/cli.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../lib/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAoB,MAAM,gBAAgB,CAAA;AAErF,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAA8B,MAAM,wBAAwB,CAAA;AAEtF,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAY,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,uBAAuB,EAA+B,MAAM,mBAAmB,CAAA;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AAEnH,OAAO,EACN,uBAAuB,EACvB,yBAAyB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