@cliwant/mcp-sam-gov 1.5.0 → 1.6.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 (84) hide show
  1. package/LICENSE +21 -21
  2. package/README.ja.md +240 -231
  3. package/README.ko.md +240 -231
  4. package/README.md +725 -714
  5. package/dist/errors.d.ts +10 -0
  6. package/dist/errors.d.ts.map +1 -1
  7. package/dist/errors.js.map +1 -1
  8. package/dist/feedback.d.ts +64 -0
  9. package/dist/feedback.d.ts.map +1 -0
  10. package/dist/feedback.js +131 -0
  11. package/dist/feedback.js.map +1 -0
  12. package/dist/server.d.ts.map +1 -1
  13. package/dist/server.js +44 -2
  14. package/dist/server.js.map +1 -1
  15. package/package.json +111 -111
  16. package/src/attachments.ts +652 -652
  17. package/src/bea.ts +372 -372
  18. package/src/bls.ts +1943 -1943
  19. package/src/cache.ts +73 -73
  20. package/src/cbp-border.ts +177 -177
  21. package/src/census-economic.ts +431 -431
  22. package/src/census.ts +735 -735
  23. package/src/ckan.ts +495 -495
  24. package/src/clinicaltrials.ts +923 -923
  25. package/src/cms-facility.ts +379 -379
  26. package/src/cms-hospital.ts +344 -344
  27. package/src/cms-supplier.ts +527 -527
  28. package/src/cms-utilization.ts +389 -389
  29. package/src/cms.ts +634 -634
  30. package/src/coerce.ts +47 -47
  31. package/src/courtlistener.ts +465 -465
  32. package/src/cpsc.ts +333 -333
  33. package/src/datagov-catalog.ts +312 -312
  34. package/src/datagov.ts +907 -907
  35. package/src/datagovKey.ts +68 -68
  36. package/src/datasource.ts +721 -721
  37. package/src/disclosure.ts +61 -61
  38. package/src/dol.ts +515 -515
  39. package/src/ecfr.ts +248 -248
  40. package/src/echo.ts +496 -496
  41. package/src/edgar.ts +3046 -3046
  42. package/src/epa-envirofacts.ts +358 -358
  43. package/src/errors.ts +324 -314
  44. package/src/fac.ts +529 -529
  45. package/src/far.ts +1009 -1009
  46. package/src/fdic.ts +2052 -2052
  47. package/src/federal-register.ts +725 -725
  48. package/src/feedback.ts +160 -0
  49. package/src/fema.ts +680 -680
  50. package/src/fpds.ts +620 -620
  51. package/src/fred.ts +464 -464
  52. package/src/gao.ts +744 -744
  53. package/src/gov-domains.ts +237 -237
  54. package/src/govinfo.ts +497 -497
  55. package/src/grants.ts +290 -290
  56. package/src/gsa-csv.ts +992 -992
  57. package/src/gsa-perdiem.ts +361 -361
  58. package/src/integrity.ts +928 -928
  59. package/src/keys.ts +268 -268
  60. package/src/lda.ts +385 -385
  61. package/src/meta.ts +292 -292
  62. package/src/nhtsa.ts +352 -352
  63. package/src/nih.ts +375 -375
  64. package/src/nist-controls.ts +219 -219
  65. package/src/nonprofit.ts +460 -460
  66. package/src/nppes.ts +834 -834
  67. package/src/nsf.ts +706 -706
  68. package/src/nvd.ts +1124 -1124
  69. package/src/nws-weather.ts +167 -167
  70. package/src/ofac.ts +1166 -1166
  71. package/src/openfda-device.ts +356 -356
  72. package/src/openfda-drugsfda.ts +313 -313
  73. package/src/openfda.ts +518 -518
  74. package/src/pricing.ts +1075 -1075
  75. package/src/sam-gov/client.ts +774 -774
  76. package/src/sam-gov/index.ts +32 -32
  77. package/src/sam-gov/types.ts +152 -152
  78. package/src/sba.ts +357 -357
  79. package/src/server.ts +6688 -6639
  80. package/src/snapshot.ts +223 -223
  81. package/src/socrata.ts +532 -532
  82. package/src/treasury.ts +582 -582
  83. package/src/usaspending.ts +2852 -2852
  84. package/src/usitc.ts +420 -420
package/src/coerce.ts CHANGED
@@ -1,47 +1,47 @@
1
- /**
2
- * coerce.ts — the honesty-critical value coercions shared across the keyless
3
- * DataSources (ADR-0005 v2 FIX-C: map-layer primitives, split out of the
4
- * fetch-envelope port so each module stays single-concern).
5
- *
6
- * `num`/`str` return **null (NEVER 0 / never a fabricated string)** for absent
7
- * values — a missing amount is an honest "unknown", never a data-absence-as-zero
8
- * masquerade (the project's forbidden failure class). This is the single most
9
- * duplicated honesty primitive across the sources; hoisting ONE audited copy
10
- * removes the 3-way drift risk (a `num` regression now fails Treasury AND Socrata
11
- * suites at once instead of silently in one).
12
- *
13
- * Byte-identical to Treasury's + Socrata's prior LOCAL copies:
14
- * - `num` is identical in both (and, per ADR-0005 v2, output-equivalent to
15
- * EDGAR's — "NULL" etc. reach null via Number(...)=NaN either way).
16
- * - `str` adopts the Treasury/Socrata convention (null for ""/"null"). It is
17
- * output-identical to BOTH over their real input domains. EDGAR's `str` does
18
- * NOT null the literal "null" (ADR-0005 v2 FIX-A), so EDGAR keeps its own
19
- * local `str` and is NOT migrated here (EDGAR is deferred anyway per FIX-B).
20
- */
21
-
22
- /**
23
- * Coerce an inconsistently-typed value field to `number | null`.
24
- *
25
- * Returns **null (NEVER 0)** for absent values: `null`/`undefined`, the literal
26
- * string `"null"`, `""`/whitespace (CRITICAL — `Number("")` is 0, so this MUST
27
- * be caught explicitly), and the `"(-)"`/`"-"` placeholders. Numeric strings
28
- * parse; numbers pass through (a non-finite number → null).
29
- */
30
- export function num(x: unknown): number | null {
31
- if (x === null || x === undefined) return null;
32
- if (typeof x === "number") return Number.isFinite(x) ? x : null;
33
- if (typeof x === "string") {
34
- const s = x.trim();
35
- if (s === "" || s === "null" || s === "(-)" || s === "-") return null;
36
- const n = Number(s);
37
- return Number.isFinite(n) ? n : null;
38
- }
39
- return null;
40
- }
41
-
42
- /** null for absent (null/undefined/""/whitespace/"null"), else the trimmed string. */
43
- export function str(x: unknown): string | null {
44
- if (x === null || x === undefined) return null;
45
- const s = String(x).trim();
46
- return s === "" || s === "null" ? null : s;
47
- }
1
+ /**
2
+ * coerce.ts — the honesty-critical value coercions shared across the keyless
3
+ * DataSources (ADR-0005 v2 FIX-C: map-layer primitives, split out of the
4
+ * fetch-envelope port so each module stays single-concern).
5
+ *
6
+ * `num`/`str` return **null (NEVER 0 / never a fabricated string)** for absent
7
+ * values — a missing amount is an honest "unknown", never a data-absence-as-zero
8
+ * masquerade (the project's forbidden failure class). This is the single most
9
+ * duplicated honesty primitive across the sources; hoisting ONE audited copy
10
+ * removes the 3-way drift risk (a `num` regression now fails Treasury AND Socrata
11
+ * suites at once instead of silently in one).
12
+ *
13
+ * Byte-identical to Treasury's + Socrata's prior LOCAL copies:
14
+ * - `num` is identical in both (and, per ADR-0005 v2, output-equivalent to
15
+ * EDGAR's — "NULL" etc. reach null via Number(...)=NaN either way).
16
+ * - `str` adopts the Treasury/Socrata convention (null for ""/"null"). It is
17
+ * output-identical to BOTH over their real input domains. EDGAR's `str` does
18
+ * NOT null the literal "null" (ADR-0005 v2 FIX-A), so EDGAR keeps its own
19
+ * local `str` and is NOT migrated here (EDGAR is deferred anyway per FIX-B).
20
+ */
21
+
22
+ /**
23
+ * Coerce an inconsistently-typed value field to `number | null`.
24
+ *
25
+ * Returns **null (NEVER 0)** for absent values: `null`/`undefined`, the literal
26
+ * string `"null"`, `""`/whitespace (CRITICAL — `Number("")` is 0, so this MUST
27
+ * be caught explicitly), and the `"(-)"`/`"-"` placeholders. Numeric strings
28
+ * parse; numbers pass through (a non-finite number → null).
29
+ */
30
+ export function num(x: unknown): number | null {
31
+ if (x === null || x === undefined) return null;
32
+ if (typeof x === "number") return Number.isFinite(x) ? x : null;
33
+ if (typeof x === "string") {
34
+ const s = x.trim();
35
+ if (s === "" || s === "null" || s === "(-)" || s === "-") return null;
36
+ const n = Number(s);
37
+ return Number.isFinite(n) ? n : null;
38
+ }
39
+ return null;
40
+ }
41
+
42
+ /** null for absent (null/undefined/""/whitespace/"null"), else the trimmed string. */
43
+ export function str(x: unknown): string | null {
44
+ if (x === null || x === undefined) return null;
45
+ const s = String(x).trim();
46
+ return s === "" || s === "null" ? null : s;
47
+ }