@cyanheads/faa-aircraft-registry-mcp-server 0.1.4 → 0.1.6

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 (48) hide show
  1. package/AGENTS.md +1 -1
  2. package/CLAUDE.md +1 -1
  3. package/Dockerfile +1 -1
  4. package/README.md +1 -1
  5. package/changelog/0.1.x/0.1.5.md +15 -0
  6. package/changelog/0.1.x/0.1.6.md +12 -0
  7. package/dist/mcp-server/resources/definitions/index.d.ts +5 -0
  8. package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -1
  9. package/dist/mcp-server/resources/definitions/registration.resource.d.ts +5 -0
  10. package/dist/mcp-server/resources/definitions/registration.resource.d.ts.map +1 -1
  11. package/dist/mcp-server/resources/definitions/registration.resource.js +10 -1
  12. package/dist/mcp-server/resources/definitions/registration.resource.js.map +1 -1
  13. package/dist/mcp-server/tools/definitions/get-aircraft-type.tool.d.ts +6 -1
  14. package/dist/mcp-server/tools/definitions/get-aircraft-type.tool.d.ts.map +1 -1
  15. package/dist/mcp-server/tools/definitions/get-aircraft-type.tool.js +8 -2
  16. package/dist/mcp-server/tools/definitions/get-aircraft-type.tool.js.map +1 -1
  17. package/dist/mcp-server/tools/definitions/get-registration-status.tool.d.ts +7 -1
  18. package/dist/mcp-server/tools/definitions/get-registration-status.tool.d.ts.map +1 -1
  19. package/dist/mcp-server/tools/definitions/get-registration-status.tool.js +10 -1
  20. package/dist/mcp-server/tools/definitions/get-registration-status.tool.js.map +1 -1
  21. package/dist/mcp-server/tools/definitions/index.d.ts +17 -2
  22. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  23. package/dist/mcp-server/tools/definitions/lookup-registration.tool.d.ts +5 -0
  24. package/dist/mcp-server/tools/definitions/lookup-registration.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/lookup-registration.tool.js +7 -1
  26. package/dist/mcp-server/tools/definitions/lookup-registration.tool.js.map +1 -1
  27. package/dist/services/registry/csv.d.ts +11 -5
  28. package/dist/services/registry/csv.d.ts.map +1 -1
  29. package/dist/services/registry/csv.js +38 -39
  30. package/dist/services/registry/csv.js.map +1 -1
  31. package/dist/services/registry/ingest.d.ts +18 -6
  32. package/dist/services/registry/ingest.d.ts.map +1 -1
  33. package/dist/services/registry/ingest.js +144 -101
  34. package/dist/services/registry/ingest.js.map +1 -1
  35. package/dist/services/registry/normalize.d.ts +11 -0
  36. package/dist/services/registry/normalize.d.ts.map +1 -1
  37. package/dist/services/registry/normalize.js +33 -0
  38. package/dist/services/registry/normalize.js.map +1 -1
  39. package/dist/services/registry/registry-service.d.ts +9 -0
  40. package/dist/services/registry/registry-service.d.ts.map +1 -1
  41. package/dist/services/registry/registry-service.js +39 -7
  42. package/dist/services/registry/registry-service.js.map +1 -1
  43. package/dist/services/registry/zip.d.ts +30 -12
  44. package/dist/services/registry/zip.d.ts.map +1 -1
  45. package/dist/services/registry/zip.js +58 -28
  46. package/dist/services/registry/zip.js.map +1 -1
  47. package/package.json +1 -1
  48. package/server.json +3 -3
package/AGENTS.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Server:** faa-aircraft-registry-mcp-server
4
- **Version:** 0.1.4
4
+ **Version:** 0.1.6
5
5
  **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.10.14`
6
6
  **Engines:** Bun ≥1.3.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
package/CLAUDE.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Server:** faa-aircraft-registry-mcp-server
4
- **Version:** 0.1.4
4
+ **Version:** 0.1.6
5
5
  **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.10.14`
6
6
  **Engines:** Bun ≥1.3.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
package/Dockerfile CHANGED
@@ -44,7 +44,7 @@ ENV NODE_ENV=production
44
44
  # OCI image metadata (https://github.com/opencontainers/image-spec/blob/main/annotations.md)
45
45
  ARG APP_VERSION
46
46
  LABEL org.opencontainers.image.title="faa-aircraft-registry-mcp-server"
47
- LABEL org.opencontainers.image.description="Decode N-numbers to aircraft, engine, status, and owner, and search the US civil aircraft registry (FAA Releasable Aircraft Database) by owner, type, or state — offline and keyless over an embedded SQLite + FTS5 mirror, with fail-safe owner-PII redaction."
47
+ LABEL org.opencontainers.image.description="Decode N-numbers to aircraft, engine, status, and owner; search the US civil aircraft registry by owner, type, or state; resolve active/deregistered/reserved status — offline via MCP. STDIO or Streamable HTTP."
48
48
  LABEL org.opencontainers.image.licenses="Apache-2.0"
49
49
  LABEL org.opencontainers.image.version="${APP_VERSION}"
50
50
  LABEL org.opencontainers.image.source="https://github.com/cyanheads/faa-aircraft-registry-mcp-server"
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![Version](https://img.shields.io/badge/Version-0.1.4-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/faa-aircraft-registry-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/%40cyanheads%2Ffaa-aircraft-registry-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/faa-aircraft-registry-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.14-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![Version](https://img.shields.io/badge/Version-0.1.6-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/faa-aircraft-registry-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/%40cyanheads%2Ffaa-aircraft-registry-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/faa-aircraft-registry-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.14-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -0,0 +1,15 @@
1
+ ---
2
+ summary: "Bounds registry rebuild peak memory to the largest single file via lazy ZIP inflation, streamed line parsing, and chunked auxiliary transactions (measured ~2.35 GiB to ~0.74 GiB); syncs the Dockerfile OCI description label to package.json."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.1.5 — 2026-07-16
8
+
9
+ ## Changed
10
+
11
+ - **Dockerfile** — `org.opencontainers.image.description` OCI label synced to `package.json`'s current description (previously carried older wording).
12
+
13
+ ## Fixed
14
+
15
+ - **Registry rebuild** — full mirror rebuild (`mirror:init`/`mirror:refresh`) peak memory now scales with the **largest single file** in the FAA archive instead of the sum of all files, via lazy per-entry ZIP inflation (`zip.ts`'s `openZipArchive`/`readEntry`, replacing eager `readZipEntries`), streamed latin1 line decoding (`csv.ts`'s `parseCsv` now takes the raw entry `Buffer`), and `PAGE_SIZE`-chunked auxiliary-table transactions. Measured peak RSS on a real `mirror:refresh` dropped from ~2.35 GiB to ~0.74 GiB, with identical row counts ([#6](https://github.com/cyanheads/faa-aircraft-registry-mcp-server/issues/6)).
@@ -0,0 +1,12 @@
1
+ ---
2
+ summary: "Rejects malformed N-numbers and aircraft codes with an actionable validation error instead of a misleading not-found/unknown answer, and blanks the FAA's 0-sentinel numeric fields (cruise speed, year manufactured, seats) instead of rendering them as real values."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.1.6 — 2026-07-16
8
+
9
+ ## Fixed
10
+
11
+ - **FAA zero-sentinel fields** — `cruise_speed`, `year_mfr`, and `num_seats` values of literal `0` (the FAA's blank/unknown convention for these permissible fields) now render as absent instead of a fabricated `0 mph` cruise or a `year 0` aircraft; `num_engines = 0` is left untouched since it's a real value on unpowered aircraft (gliders, balloons) ([#1](https://github.com/cyanheads/faa-aircraft-registry-mcp-server/issues/1)).
12
+ - **Malformed identifiers** — `faa_lookup_registration`, `faa_get_registration_status`, `faa_get_aircraft_type`, and the `faa://registration/{nNumber}` resource now reject structurally invalid N-numbers and manufacturer/model/series codes with an `InvalidParams` error and a recovery hint, instead of a misleading `not_found`/`unknown` answer. Shape patterns were validated against the full registry corpus (313,930 active N-numbers, 93,817 aircraft reference codes) with zero false rejections ([#5](https://github.com/cyanheads/faa-aircraft-registry-mcp-server/issues/5)).
@@ -68,5 +68,10 @@ export declare const allResourceDefinitions: import("@cyanheads/mcp-ts-core").Re
68
68
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
69
69
  readonly when: "The N-number is well-formed but has no active registration in the MASTER file.";
70
70
  readonly recovery: "Use the faa_get_registration_status tool to check for deregistered/reserved status, or faa_search_registrations to find the right N-number.";
71
+ }, {
72
+ readonly reason: "invalid_n_number";
73
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
74
+ readonly when: "The N-number is not structurally valid (after the optional leading \"N\": 1–5 characters, a leading digit 1–9, then digits, optionally 1–2 trailing letters; I and O are unused).";
75
+ readonly recovery: "Request a valid N-number such as \"N172SP\" or \"N12345\" (leading N optional), or use faa_search_registrations to find one by make/model, state, or Mode S code.";
71
76
  }]>[];
72
77
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAAyB,CAAC"}
@@ -72,5 +72,10 @@ export declare const registrationResource: import("@cyanheads/mcp-ts-core").Reso
72
72
  readonly code: JsonRpcErrorCode.NotFound;
73
73
  readonly when: "The N-number is well-formed but has no active registration in the MASTER file.";
74
74
  readonly recovery: "Use the faa_get_registration_status tool to check for deregistered/reserved status, or faa_search_registrations to find the right N-number.";
75
+ }, {
76
+ readonly reason: "invalid_n_number";
77
+ readonly code: JsonRpcErrorCode.InvalidParams;
78
+ readonly when: "The N-number is not structurally valid (after the optional leading \"N\": 1–5 characters, a leading digit 1–9, then digits, optionally 1–2 trailing letters; I and O are unused).";
79
+ readonly recovery: "Request a valid N-number such as \"N172SP\" or \"N12345\" (leading N optional), or use faa_search_registrations to find one by make/model, state, or Mode S code.";
75
80
  }]>;
76
81
  //# sourceMappingURL=registration.resource.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registration.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/registration.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8B/B,CAAC"}
1
+ {"version":3,"file":"registration.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/registration.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0C/B,CAAC"}
@@ -15,7 +15,10 @@ export const registrationResource = resource('faa://registration/{nNumber}', {
15
15
  description: 'Fetch the full registration record for one US civil aircraft N-number — the same decoded, pre-joined payload as faa_lookup_registration. Owner PII is redacted unless the deployment opts in.',
16
16
  mimeType: 'application/json',
17
17
  params: z.object({
18
- nNumber: z.string().min(1).describe('US registration N-number. Accepts "N12345" or "12345".'),
18
+ nNumber: z
19
+ .string()
20
+ .min(1)
21
+ .describe('US registration N-number. Accepts "N12345" or "12345" (leading N optional). Shape: 1–5 characters — a leading digit 1–9, then digits, optionally ending in 1–2 letters (I and O are unused).'),
19
22
  }),
20
23
  output: registrationRecordSchema,
21
24
  errors: [
@@ -25,6 +28,12 @@ export const registrationResource = resource('faa://registration/{nNumber}', {
25
28
  when: 'The N-number is well-formed but has no active registration in the MASTER file.',
26
29
  recovery: 'Use the faa_get_registration_status tool to check for deregistered/reserved status, or faa_search_registrations to find the right N-number.',
27
30
  },
31
+ {
32
+ reason: 'invalid_n_number',
33
+ code: JsonRpcErrorCode.InvalidParams,
34
+ when: 'The N-number is not structurally valid (after the optional leading "N": 1–5 characters, a leading digit 1–9, then digits, optionally 1–2 trailing letters; I and O are unused).',
35
+ recovery: 'Request a valid N-number such as "N172SP" or "N12345" (leading N optional), or use faa_search_registrations to find one by make/model, state, or Mode S code.',
36
+ },
28
37
  ],
29
38
  async handler(params, ctx) {
30
39
  const record = await getRegistryService().lookupRegistration(params.nNumber, ctx);
@@ -1 +1 @@
1
- {"version":3,"file":"registration.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/registration.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC,8BAA8B,EAAE;IAC3E,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,uDAAuD;IAC9D,WAAW,EACT,+LAA+L;IACjM,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,wDAAwD,CAAC;KAC9F,CAAC;IACF,MAAM,EAAE,wBAAwB;IAEhC,MAAM,EAAE;QACN;YACE,MAAM,EAAE,WAAW;YACnB,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,gFAAgF;YACtF,QAAQ,EACN,6IAA6I;SAChJ;KACF;IAED,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,MAAM,MAAM,GAAG,MAAM,kBAAkB,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAClF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,wCAAwC,MAAM,CAAC,OAAO,IAAI,EAAE;gBACtF,GAAG,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC;aAChC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"registration.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/registration.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC,8BAA8B,EAAE;IAC3E,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,uDAAuD;IAC9D,WAAW,EACT,+LAA+L;IACjM,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,8LAA8L,CAC/L;KACJ,CAAC;IACF,MAAM,EAAE,wBAAwB;IAEhC,MAAM,EAAE;QACN;YACE,MAAM,EAAE,WAAW;YACnB,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,gFAAgF;YACtF,QAAQ,EACN,6IAA6I;SAChJ;QACD;YACE,MAAM,EAAE,kBAAkB;YAC1B,IAAI,EAAE,gBAAgB,CAAC,aAAa;YACpC,IAAI,EAAE,iLAAiL;YACvL,QAAQ,EACN,+JAA+J;SAClK;KACF;IAED,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,MAAM,MAAM,GAAG,MAAM,kBAAkB,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAClF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,wCAAwC,MAAM,CAAC,OAAO,IAAI,EAAE;gBACtF,GAAG,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC;aAChC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
@@ -38,7 +38,12 @@ export declare const getAircraftTypeTool: import("@cyanheads/mcp-ts-core").ToolD
38
38
  }, z.core.$strip>, readonly [{
39
39
  readonly reason: "not_found";
40
40
  readonly code: JsonRpcErrorCode.NotFound;
41
- readonly when: "The 7-char code is well-formed but absent from the aircraft reference table.";
41
+ readonly when: "The code is well-formed but absent from the aircraft reference table.";
42
42
  readonly recovery: "Use faa_search_aircraft_types to discover valid manufacturer/model codes by name.";
43
+ }, {
44
+ readonly reason: "invalid_code";
45
+ readonly code: JsonRpcErrorCode.InvalidParams;
46
+ readonly when: "The input is not a structurally valid code (expected 6–7 uppercase alphanumeric characters).";
47
+ readonly recovery: "Use faa_search_aircraft_types to discover a valid manufacturer/model code by name, then pass its code here.";
43
48
  }], undefined>;
44
49
  //# sourceMappingURL=get-aircraft-type.tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-aircraft-type.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-aircraft-type.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2F9B,CAAC"}
1
+ {"version":3,"file":"get-aircraft-type.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-aircraft-type.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkG9B,CAAC"}
@@ -17,7 +17,7 @@ export const getAircraftTypeTool = tool('faa_get_aircraft_type', {
17
17
  code: z
18
18
  .string()
19
19
  .min(1)
20
- .describe('7-character manufacturer/model/series code (e.g. "2072714"). Discover codes via faa_search_aircraft_types.'),
20
+ .describe('Manufacturer/model/series code (e.g. "2072714") — 6–7 uppercase alphanumeric characters, usually 7. Discover codes via faa_search_aircraft_types.'),
21
21
  }),
22
22
  output: z.object({
23
23
  code: z.string().describe('The 7-char manufacturer/model/series code.'),
@@ -57,9 +57,15 @@ export const getAircraftTypeTool = tool('faa_get_aircraft_type', {
57
57
  {
58
58
  reason: 'not_found',
59
59
  code: JsonRpcErrorCode.NotFound,
60
- when: 'The 7-char code is well-formed but absent from the aircraft reference table.',
60
+ when: 'The code is well-formed but absent from the aircraft reference table.',
61
61
  recovery: 'Use faa_search_aircraft_types to discover valid manufacturer/model codes by name.',
62
62
  },
63
+ {
64
+ reason: 'invalid_code',
65
+ code: JsonRpcErrorCode.InvalidParams,
66
+ when: 'The input is not a structurally valid code (expected 6–7 uppercase alphanumeric characters).',
67
+ recovery: 'Use faa_search_aircraft_types to discover a valid manufacturer/model code by name, then pass its code here.',
68
+ },
63
69
  ],
64
70
  async handler(input, ctx) {
65
71
  const service = getRegistryService();
@@ -1 +1 @@
1
- {"version":3,"file":"get-aircraft-type.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-aircraft-type.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,E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KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC;QACrF,IAAI,CAAC,CAAC,aAAa,KAAK,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC;QAC/E,IAAI,CAAC,CAAC,WAAW;YAAE,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QACpE,IAAI,CAAC,CAAC,cAAc,KAAK,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,cAAc,MAAM,CAAC,CAAC;QAC5F,IAAI,CAAC,CAAC,wBAAwB;YAAE,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,wBAAwB,EAAE,CAAC,CAAC;QAC/F,IAAI,CAAC,CAAC,yBAAyB;YAC7B,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,yBAAyB,EAAE,CAAC,CAAC;QACnE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
@@ -13,6 +13,7 @@
13
13
  * @module mcp-server/tools/definitions/get-registration-status.tool
14
14
  */
15
15
  import { z } from '@cyanheads/mcp-ts-core';
16
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
16
17
  export declare const getRegistrationStatusTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
17
18
  nNumber: z.ZodString;
18
19
  }, z.core.$strip>, z.ZodObject<{
@@ -47,5 +48,10 @@ export declare const getRegistrationStatusTool: import("@cyanheads/mcp-ts-core")
47
48
  expirationNoticeDate: z.ZodOptional<z.ZodString>;
48
49
  purgeDate: z.ZodOptional<z.ZodString>;
49
50
  nNumberForChange: z.ZodOptional<z.ZodString>;
50
- }, z.core.$strip>, undefined, undefined>;
51
+ }, z.core.$strip>, readonly [{
52
+ readonly reason: "invalid_n_number";
53
+ readonly code: JsonRpcErrorCode.InvalidParams;
54
+ readonly when: "The input is not a structurally valid N-number (after the optional leading \"N\": 1–5 characters, a leading digit 1–9, then digits, optionally 1–2 trailing letters; I and O are unused).";
55
+ readonly recovery: "Supply a valid N-number such as \"N172SP\" or \"N12345\" (leading N optional), or use faa_search_registrations to find one by make/model, state, or Mode S code.";
56
+ }], undefined>;
51
57
  //# sourceMappingURL=get-registration-status.tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-registration-status.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-registration-status.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAIjD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA2HpC,CAAC"}
1
+ {"version":3,"file":"get-registration-status.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-registration-status.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqIpC,CAAC"}
@@ -13,6 +13,7 @@
13
13
  * @module mcp-server/tools/definitions/get-registration-status.tool
14
14
  */
15
15
  import { tool, z } from '@cyanheads/mcp-ts-core';
16
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
16
17
  import { getRegistryService } from '../../../services/registry/registry-service.js';
17
18
  import { codedValueSchema, renderCoded } from './_schemas.js';
18
19
  export const getRegistrationStatusTool = tool('faa_get_registration_status', {
@@ -23,7 +24,7 @@ export const getRegistrationStatusTool = tool('faa_get_registration_status', {
23
24
  nNumber: z
24
25
  .string()
25
26
  .min(1)
26
- .describe('US registration N-number to resolve. Accepts "N12345" or "12345"; the leading N is optional.'),
27
+ .describe('US registration N-number to resolve. Accepts "N12345" or "12345" (leading N optional). Shape: 1–5 characters — a leading digit 1–9, then digits, optionally ending in 1–2 letters (I and O are unused).'),
27
28
  }),
28
29
  output: z.object({
29
30
  recordType: z
@@ -85,6 +86,14 @@ export const getRegistrationStatusTool = tool('faa_get_registration_status', {
85
86
  .optional()
86
87
  .describe('The N-number this reservation changes to/from (reserved records).'),
87
88
  }),
89
+ errors: [
90
+ {
91
+ reason: 'invalid_n_number',
92
+ code: JsonRpcErrorCode.InvalidParams,
93
+ when: 'The input is not a structurally valid N-number (after the optional leading "N": 1–5 characters, a leading digit 1–9, then digits, optionally 1–2 trailing letters; I and O are unused).',
94
+ recovery: 'Supply a valid N-number such as "N172SP" or "N12345" (leading N optional), or use faa_search_registrations to find one by make/model, state, or Mode S code.',
95
+ },
96
+ ],
88
97
  async handler(input, ctx) {
89
98
  const service = getRegistryService();
90
99
  const result = await service.getRegistrationStatus(input.nNumber, ctx);
@@ -1 +1 @@
1
- {"version":3,"file":"get-registration-status.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-registration-status.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9D,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC,6BAA6B,EAAE;IAC3E,KAAK,EAAE,2DAA2D;IAClE,WAAW,EACT,2hBAA2hB;IAC7hB,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,E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CAAC,SAAS,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,CAAC,gBAAgB;YAAE,IAAI,CAAC,4BAA4B,CAAC,CAAC,gBAAgB,EAAE,CAAC,CAAC;QAC/E,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"get-registration-status.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-registration-status.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9D,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC,6BAA6B,EAAE;IAC3E,KAAK,EAAE,2DAA2D;IAClE,WAAW,EACT,2hBAA2hB;IAC7hB,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;IAE/E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,yMAAyM,CAC1M;KACJ,CAAC;IAEF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,UAAU,EAAE,CAAC;aACV,IAAI,CAAC,CAAC,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;aACvD,QAAQ,CACP,mHAAmH,CACpH;QACH,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,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ACF,CAAC,CAAC"}
@@ -34,8 +34,13 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
34
34
  }, import("zod/v4/core").$strip>, readonly [{
35
35
  readonly reason: "not_found";
36
36
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
37
- readonly when: "The 7-char code is well-formed but absent from the aircraft reference table.";
37
+ readonly when: "The code is well-formed but absent from the aircraft reference table.";
38
38
  readonly recovery: "Use faa_search_aircraft_types to discover valid manufacturer/model codes by name.";
39
+ }, {
40
+ readonly reason: "invalid_code";
41
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
42
+ readonly when: "The input is not a structurally valid code (expected 6–7 uppercase alphanumeric characters).";
43
+ readonly recovery: "Use faa_search_aircraft_types to discover a valid manufacturer/model code by name, then pass its code here.";
39
44
  }], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
40
45
  nNumber: import("zod").ZodString;
41
46
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
@@ -70,7 +75,12 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
70
75
  expirationNoticeDate: import("zod").ZodOptional<import("zod").ZodString>;
71
76
  purgeDate: import("zod").ZodOptional<import("zod").ZodString>;
72
77
  nNumberForChange: import("zod").ZodOptional<import("zod").ZodString>;
73
- }, import("zod/v4/core").$strip>, undefined, undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
78
+ }, import("zod/v4/core").$strip>, readonly [{
79
+ readonly reason: "invalid_n_number";
80
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
81
+ readonly when: "The input is not a structurally valid N-number (after the optional leading \"N\": 1–5 characters, a leading digit 1–9, then digits, optionally 1–2 trailing letters; I and O are unused).";
82
+ readonly recovery: "Supply a valid N-number such as \"N172SP\" or \"N12345\" (leading N optional), or use faa_search_registrations to find one by make/model, state, or Mode S code.";
83
+ }], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
74
84
  nNumber: import("zod").ZodString;
75
85
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
76
86
  nNumber: import("zod").ZodString;
@@ -135,6 +145,11 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
135
145
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
136
146
  readonly when: "The N-number is well-formed but has no active registration in the MASTER file.";
137
147
  readonly recovery: "Call faa_get_registration_status to check whether the number is deregistered or reserved, or faa_search_registrations to find the right N-number.";
148
+ }, {
149
+ readonly reason: "invalid_n_number";
150
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidParams;
151
+ readonly when: "The input is not a structurally valid N-number (after the optional leading \"N\": 1–5 characters, a leading digit 1–9, then digits, optionally 1–2 trailing letters; I and O are unused).";
152
+ readonly recovery: "Supply a valid N-number such as \"N172SP\" or \"N12345\" (leading N optional), or use faa_search_registrations to find one by make/model, state, or Mode S code.";
138
153
  }], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
139
154
  query: import("zod").ZodOptional<import("zod").ZodString>;
140
155
  aircraftType: import("zod").ZodOptional<import("zod").ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAM9B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAM9B,CAAC"}
@@ -74,5 +74,10 @@ export declare const lookupRegistrationTool: import("@cyanheads/mcp-ts-core").To
74
74
  readonly code: JsonRpcErrorCode.NotFound;
75
75
  readonly when: "The N-number is well-formed but has no active registration in the MASTER file.";
76
76
  readonly recovery: "Call faa_get_registration_status to check whether the number is deregistered or reserved, or faa_search_registrations to find the right N-number.";
77
+ }, {
78
+ readonly reason: "invalid_n_number";
79
+ readonly code: JsonRpcErrorCode.InvalidParams;
80
+ readonly when: "The input is not a structurally valid N-number (after the optional leading \"N\": 1–5 characters, a leading digit 1–9, then digits, optionally 1–2 trailing letters; I and O are unused).";
81
+ readonly recovery: "Supply a valid N-number such as \"N172SP\" or \"N12345\" (leading N optional), or use faa_search_registrations to find one by make/model, state, or Mode S code.";
77
82
  }], undefined>;
78
83
  //# sourceMappingURL=lookup-registration.tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lookup-registration.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/lookup-registration.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuCjC,CAAC"}
1
+ {"version":3,"file":"lookup-registration.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/lookup-registration.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA8CjC,CAAC"}
@@ -19,7 +19,7 @@ export const lookupRegistrationTool = tool('faa_lookup_registration', {
19
19
  nNumber: z
20
20
  .string()
21
21
  .min(1)
22
- .describe('US registration N-number to decode. Accepts "N12345" or "12345"; the leading N is optional.'),
22
+ .describe('US registration N-number to decode. Accepts "N12345" or "12345" (leading N optional). Shape: 1–5 characters — a leading digit 1–9, then digits, optionally ending in 1–2 letters (I and O are unused).'),
23
23
  }),
24
24
  output: registrationRecordSchema,
25
25
  errors: [
@@ -29,6 +29,12 @@ export const lookupRegistrationTool = tool('faa_lookup_registration', {
29
29
  when: 'The N-number is well-formed but has no active registration in the MASTER file.',
30
30
  recovery: 'Call faa_get_registration_status to check whether the number is deregistered or reserved, or faa_search_registrations to find the right N-number.',
31
31
  },
32
+ {
33
+ reason: 'invalid_n_number',
34
+ code: JsonRpcErrorCode.InvalidParams,
35
+ when: 'The input is not a structurally valid N-number (after the optional leading "N": 1–5 characters, a leading digit 1–9, then digits, optionally 1–2 trailing letters; I and O are unused).',
36
+ recovery: 'Supply a valid N-number such as "N172SP" or "N12345" (leading N optional), or use faa_search_registrations to find one by make/model, state, or Mode S code.',
37
+ },
32
38
  ],
33
39
  async handler(input, ctx) {
34
40
  const service = getRegistryService();
@@ -1 +1 @@
1
- {"version":3,"file":"lookup-registration.tool.js","sourceRoot":"","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ChC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;CAC/E,CAAC,CAAC"}
1
+ {"version":3,"file":"lookup-registration.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/lookup-registration.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAEnF,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,yBAAyB,EAAE;IACpE,KAAK,EAAE,uDAAuD;IAC9D,WAAW,EACT,ikBAAikB;IACnkB,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;IAE/E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,wMAAwM,CACzM;KACJ,CAAC;IAEF,MAAM,EAAE,wBAAwB;IAEhC,MAAM,EAAE;QACN;YACE,MAAM,EAAE,WAAW;YACnB,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,gFAAgF;YACtF,QAAQ,EACN,mJAAmJ;SACtJ;QACD;YACE,MAAM,EAAE,kBAAkB;YAC1B,IAAI,EAAE,gBAAgB,CAAC,aAAa;YACpC,IAAI,EAAE,yLAAyL;YAC/L,QAAQ,EACN,8JAA8J;SACjK;KACF;IAED,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG;QACtB,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;QACrC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACpE,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,wCAAwC,KAAK,CAAC,OAAO,IAAI,EAAE;gBACrF,GAAG,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC;aAChC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;CAC/E,CAAC,CAAC"}
@@ -5,6 +5,12 @@
5
5
  * honors double-quote escaping defensively so a quoted field with an embedded
6
6
  * comma can't shift every downstream column. Header-keyed rows tolerate the
7
7
  * FAA's occasional column reordering better than fixed character positions.
8
+ *
9
+ * Reads the raw entry `Buffer` directly, decoding one line at a time as latin1 —
10
+ * never a whole-file `.toString()` + `.split(/\r?\n/)`. For the multi-hundred-MB
11
+ * files (`DEREG.txt`, `MASTER.txt`) that keeps the per-file transient a single
12
+ * line wide instead of ~2–3× the file's bytes (a UTF-16 string plus a full line
13
+ * array), which is a primary lever on the ingest's peak memory.
8
14
  * @module services/registry/csv
9
15
  */
10
16
  /** A header-keyed CSV row: normalized header name → raw cell value. */
@@ -12,10 +18,10 @@ export type CsvRow = Record<string, string>;
12
18
  /** Normalize a header cell to a stable lookup key: upper-case, collapsed spaces. */
13
19
  export declare function normalizeHeader(header: string): string;
14
20
  /**
15
- * Parse FAA `.txt` content into header-keyed rows. Yields one {@link CsvRow} per
16
- * data line (the header row drives the keys). Blank trailing lines are skipped.
17
- * Generator-based so a multi-megabyte MASTER part streams without materializing
18
- * every row at once.
21
+ * Parse FAA `.txt` bytes into header-keyed rows. Yields one {@link CsvRow} per
22
+ * data line (the header row drives the keys). Blank lines are skipped. Consumes
23
+ * the entry buffer as a stream (see {@link latin1Lines}) so a multi-megabyte
24
+ * file never materializes every row — or the whole decoded file — at once.
19
25
  */
20
- export declare function parseCsv(content: string): Generator<CsvRow>;
26
+ export declare function parseCsv(content: Buffer): Generator<CsvRow>;
21
27
  //# sourceMappingURL=csv.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"csv.d.ts","sourceRoot":"","sources":["../../../src/services/registry/csv.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,uEAAuE;AACvE,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AA4D5C,oFAAoF;AACpF,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;;GAKG;AACH,wBAAiB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CA6B5D"}
1
+ {"version":3,"file":"csv.d.ts","sourceRoot":"","sources":["../../../src/services/registry/csv.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,uEAAuE;AACvE,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAuC5C,oFAAoF;AACpF,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtD;AAwBD;;;;;GAKG;AACH,wBAAiB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAiB5D"}
@@ -5,6 +5,12 @@
5
5
  * honors double-quote escaping defensively so a quoted field with an embedded
6
6
  * comma can't shift every downstream column. Header-keyed rows tolerate the
7
7
  * FAA's occasional column reordering better than fixed character positions.
8
+ *
9
+ * Reads the raw entry `Buffer` directly, decoding one line at a time as latin1 —
10
+ * never a whole-file `.toString()` + `.split(/\r?\n/)`. For the multi-hundred-MB
11
+ * files (`DEREG.txt`, `MASTER.txt`) that keeps the per-file transient a single
12
+ * line wide instead of ~2–3× the file's bytes (a UTF-16 string plus a full line
13
+ * array), which is a primary lever on the ingest's peak memory.
8
14
  * @module services/registry/csv
9
15
  */
10
16
  /**
@@ -48,54 +54,47 @@ function splitLine(line) {
48
54
  fields.push(current);
49
55
  return fields;
50
56
  }
51
- /**
52
- * Strip a leading byte-order mark from the file content. The FAA ships every
53
- * `.txt` with a UTF-8 BOM (`EF BB BF`); decoded as latin1 (how the ingester reads
54
- * these files) that becomes the three characters `\xEF\xBB\xBF`, decoded as UTF-8
55
- * it's ``. Either way it prefixes the very first header cell — so without
56
- * stripping it, the first column key becomes e.g. `N-NUMBER` instead of
57
- * `N-NUMBER`, every `pick()` for that column misses, and the whole file silently
58
- * ingests zero rows.
59
- */
60
- function stripBom(content) {
61
- if (content.charCodeAt(0) === 0xfeff)
62
- return content.slice(1);
63
- if (content.charCodeAt(0) === 0xef &&
64
- content.charCodeAt(1) === 0xbb &&
65
- content.charCodeAt(2) === 0xbf) {
66
- return content.slice(3);
67
- }
68
- return content;
69
- }
70
57
  /** Normalize a header cell to a stable lookup key: upper-case, collapsed spaces. */
71
58
  export function normalizeHeader(header) {
72
59
  return header.trim().toUpperCase().replace(/\s+/g, ' ');
73
60
  }
74
61
  /**
75
- * Parse FAA `.txt` content into header-keyed rows. Yields one {@link CsvRow} per
76
- * data line (the header row drives the keys). Blank trailing lines are skipped.
77
- * Generator-based so a multi-megabyte MASTER part streams without materializing
78
- * every row at once.
62
+ * Yield the latin1-decoded lines of a raw FAA entry buffer one at a time,
63
+ * matching `String.prototype.split(/\r?\n/)` semantics: `\n` terminates a line,
64
+ * a `\r` is consumed only when it immediately precedes `\n`, and a lone `\r`
65
+ * stays in the line. A leading UTF-8 BOM (`EF BB BF`) — which every FAA `.txt`
66
+ * ships and which, decoded as latin1, would otherwise corrupt the first header
67
+ * cell — is stripped once at the start. Streaming so a large file never
68
+ * materializes as a single decoded string or a full array of lines.
79
69
  */
80
- export function* parseCsv(content) {
81
- const lines = stripBom(content).split(/\r?\n/);
82
- let headerLine;
83
- let cursor = 0;
84
- for (; cursor < lines.length; cursor++) {
85
- const candidate = lines[cursor];
86
- if (candidate !== undefined && candidate.trim() !== '') {
87
- headerLine = candidate;
88
- cursor++;
89
- break;
70
+ function* latin1Lines(buf) {
71
+ let start = buf.length >= 3 && buf[0] === 0xef && buf[1] === 0xbb && buf[2] === 0xbf ? 3 : 0;
72
+ const len = buf.length;
73
+ for (let i = start; i <= len; i++) {
74
+ if (i === len || buf[i] === 0x0a /* \n */) {
75
+ let end = i;
76
+ if (end > start && buf[end - 1] === 0x0d /* \r */)
77
+ end--; // drop the \r of a \r\n
78
+ yield buf.toString('latin1', start, end);
79
+ start = i + 1;
90
80
  }
91
81
  }
92
- if (headerLine === undefined)
93
- return;
94
- const headers = splitLine(headerLine).map(normalizeHeader);
95
- for (let i = cursor; i < lines.length; i++) {
96
- const line = lines[i];
97
- if (line === undefined || line.trim() === '')
82
+ }
83
+ /**
84
+ * Parse FAA `.txt` bytes into header-keyed rows. Yields one {@link CsvRow} per
85
+ * data line (the header row drives the keys). Blank lines are skipped. Consumes
86
+ * the entry buffer as a stream (see {@link latin1Lines}) so a multi-megabyte
87
+ * file never materializes every row — or the whole decoded file — at once.
88
+ */
89
+ export function* parseCsv(content) {
90
+ let headers;
91
+ for (const line of latin1Lines(content)) {
92
+ if (line.trim() === '')
98
93
  continue;
94
+ if (headers === undefined) {
95
+ headers = splitLine(line).map(normalizeHeader);
96
+ continue;
97
+ }
99
98
  const cells = splitLine(line);
100
99
  const row = {};
101
100
  for (let c = 0; c < headers.length; c++) {
@@ -1 +1 @@
1
- {"version":3,"file":"csv.js","sourceRoot":"","sources":["../../../src/services/registry/csv.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH;;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GAAG,CAAC,CAAC;YACZ,IAAI,GAAG,GAAG,KAAK,IAAI,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,QAAQ;gBAAE,GAAG,EAAE,CAAC,CAAC,wBAAwB;YAClF,MAAM,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YACzC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;QAChB,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,SAAS,CAAC,CAAC,QAAQ,CAAC,OAAe;IACvC,IAAI,OAA6B,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE;YAAE,SAAS;QACjC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;YAC/C,SAAS;QACX,CAAC;QACD,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;QAC9B,MAAM,GAAG,GAAW,EAAE,CAAC;QACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACxC,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,MAAM,KAAK,SAAS;gBAAE,SAAS;YACnC,GAAG,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC/B,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -1,9 +1,21 @@
1
1
  /**
2
2
  * @fileoverview The FAA registry ingester — the one irreducibly per-source part
3
- * of the mirror. Downloads `ReleasableAircraft.zip`, reads the entries, parses
4
- * the reference files (ACFTREF/ENGINE) and the status files (DEREG/RESERVED),
5
- * then streams the pre-joined `registration` rows (MASTER-1…MASTER-9) as mirror
6
- * pages with decoded make/model/engine labels resolved from the reference maps.
3
+ * of the mirror. Downloads `ReleasableAircraft.zip`, opens the archive, and reads
4
+ * each entry on demand — one decompressed file resident at a time — parsing the
5
+ * reference files (ACFTREF/ENGINE) and the status files (DEREG/RESERVED), then
6
+ * streaming the pre-joined `registration` rows (MASTER-1…MASTER-9, or a single
7
+ * legacy MASTER.txt) as mirror pages with decoded make/model/engine labels
8
+ * resolved from the reference maps.
9
+ *
10
+ * Peak memory is bounded by the largest single file, not the sum of all of them.
11
+ * Four levers, in order of measured impact: entries are inflated lazily (one file
12
+ * resident at a time), with zlib's output sized to the known length so it never
13
+ * transiently doubles its buffer; a synchronous GC hint runs on each batch
14
+ * boundary so the parse churn doesn't ratchet the heap (and thus RSS) up toward
15
+ * the total processed size; each file is parsed as a line stream (never a
16
+ * whole-file decode); and the auxiliary inserts are chunked into bounded
17
+ * transactions. Together they keep the rebuild within a fixed budget as the
18
+ * dataset grows.
7
19
  *
8
20
  * The FAA daily ZIP is a full snapshot, not a delta — so both `init` and
9
21
  * `refresh` perform a full rebuild. The ingester wipes the primary and auxiliary
@@ -15,8 +27,8 @@ import type { SqliteHandle, SyncContext, SyncPage } from '@cyanheads/mcp-ts-core
15
27
  /**
16
28
  * Build the FAA registry ingester. The returned generator wipes the tables, loads
17
29
  * the reference + status files, then streams pre-joined `registration` pages from
18
- * all nine MASTER parts. It closes over a `getHandle` accessor so it can populate
19
- * the auxiliary tables (which the framework's `query()` does not manage).
30
+ * the MASTER file(s). It closes over a `getHandle` accessor so it can populate the
31
+ * auxiliary tables (which the framework's `query()` does not manage).
20
32
  *
21
33
  * @param getHandle - Accessor for the mirror's opened raw SQLite handle.
22
34
  * @param sourceUrl - URL of `ReleasableAircraft.zip`.