@cliwant/mcp-sam-gov 1.4.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.
- package/LICENSE +21 -21
- package/README.ja.md +240 -231
- package/README.ko.md +240 -231
- package/README.md +725 -706
- package/dist/cbp-border.d.ts +51 -0
- package/dist/cbp-border.d.ts.map +1 -0
- package/dist/cbp-border.js +123 -0
- package/dist/cbp-border.js.map +1 -0
- package/dist/datagov-catalog.d.ts.map +1 -1
- package/dist/datagov-catalog.js +16 -2
- package/dist/datagov-catalog.js.map +1 -1
- package/dist/ecfr.d.ts +2 -2
- package/dist/ecfr.d.ts.map +1 -1
- package/dist/ecfr.js +24 -10
- package/dist/ecfr.js.map +1 -1
- package/dist/edgar.d.ts.map +1 -1
- package/dist/edgar.js +26 -6
- package/dist/edgar.js.map +1 -1
- package/dist/epa-envirofacts.d.ts.map +1 -1
- package/dist/epa-envirofacts.js +14 -1
- package/dist/epa-envirofacts.js.map +1 -1
- package/dist/errors.d.ts +10 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +11 -0
- package/dist/errors.js.map +1 -1
- package/dist/far.d.ts.map +1 -1
- package/dist/far.js +3 -1
- package/dist/far.js.map +1 -1
- package/dist/federal-register.d.ts +2 -2
- package/dist/federal-register.d.ts.map +1 -1
- package/dist/federal-register.js +26 -10
- package/dist/federal-register.js.map +1 -1
- package/dist/feedback.d.ts +64 -0
- package/dist/feedback.d.ts.map +1 -0
- package/dist/feedback.js +131 -0
- package/dist/feedback.js.map +1 -0
- package/dist/fema.d.ts +36 -0
- package/dist/fema.d.ts.map +1 -1
- package/dist/fema.js +124 -0
- package/dist/fema.js.map +1 -1
- package/dist/gov-domains.d.ts +66 -0
- package/dist/gov-domains.d.ts.map +1 -0
- package/dist/gov-domains.js +211 -0
- package/dist/gov-domains.js.map +1 -0
- package/dist/nist-controls.d.ts +48 -0
- package/dist/nist-controls.d.ts.map +1 -0
- package/dist/nist-controls.js +174 -0
- package/dist/nist-controls.js.map +1 -0
- package/dist/nws-weather.d.ts +57 -0
- package/dist/nws-weather.d.ts.map +1 -0
- package/dist/nws-weather.js +131 -0
- package/dist/nws-weather.js.map +1 -0
- package/dist/openfda-drugsfda.d.ts +72 -0
- package/dist/openfda-drugsfda.d.ts.map +1 -0
- package/dist/openfda-drugsfda.js +230 -0
- package/dist/openfda-drugsfda.js.map +1 -0
- package/dist/openfda.d.ts.map +1 -1
- package/dist/openfda.js +31 -8
- package/dist/openfda.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +374 -11
- package/dist/server.js.map +1 -1
- package/dist/treasury.d.ts +2 -0
- package/dist/treasury.d.ts.map +1 -1
- package/dist/treasury.js +7 -0
- package/dist/treasury.js.map +1 -1
- package/dist/usaspending.d.ts +32 -1
- package/dist/usaspending.d.ts.map +1 -1
- package/dist/usaspending.js +143 -16
- package/dist/usaspending.js.map +1 -1
- package/package.json +111 -111
- package/src/attachments.ts +652 -652
- package/src/bea.ts +372 -372
- package/src/bls.ts +1943 -1943
- package/src/cache.ts +73 -73
- package/src/cbp-border.ts +177 -0
- package/src/census-economic.ts +431 -431
- package/src/census.ts +735 -735
- package/src/ckan.ts +495 -495
- package/src/clinicaltrials.ts +923 -923
- package/src/cms-facility.ts +379 -379
- package/src/cms-hospital.ts +344 -344
- package/src/cms-supplier.ts +527 -527
- package/src/cms-utilization.ts +389 -389
- package/src/cms.ts +634 -634
- package/src/coerce.ts +47 -47
- package/src/courtlistener.ts +465 -465
- package/src/cpsc.ts +333 -333
- package/src/datagov-catalog.ts +312 -296
- package/src/datagov.ts +907 -907
- package/src/datagovKey.ts +68 -68
- package/src/datasource.ts +721 -721
- package/src/disclosure.ts +61 -61
- package/src/dol.ts +515 -515
- package/src/ecfr.ts +248 -231
- package/src/echo.ts +496 -496
- package/src/edgar.ts +3046 -3014
- package/src/epa-envirofacts.ts +358 -342
- package/src/errors.ts +324 -303
- package/src/fac.ts +529 -529
- package/src/far.ts +1009 -1007
- package/src/fdic.ts +2052 -2052
- package/src/federal-register.ts +725 -706
- package/src/feedback.ts +160 -0
- package/src/fema.ts +680 -541
- package/src/fpds.ts +620 -620
- package/src/fred.ts +464 -464
- package/src/gao.ts +744 -744
- package/src/gov-domains.ts +237 -0
- package/src/govinfo.ts +497 -497
- package/src/grants.ts +290 -290
- package/src/gsa-csv.ts +992 -992
- package/src/gsa-perdiem.ts +361 -361
- package/src/integrity.ts +928 -928
- package/src/keys.ts +268 -268
- package/src/lda.ts +385 -385
- package/src/meta.ts +292 -292
- package/src/nhtsa.ts +352 -352
- package/src/nih.ts +375 -375
- package/src/nist-controls.ts +219 -0
- package/src/nonprofit.ts +460 -460
- package/src/nppes.ts +834 -834
- package/src/nsf.ts +706 -706
- package/src/nvd.ts +1124 -1124
- package/src/nws-weather.ts +167 -0
- package/src/ofac.ts +1166 -1166
- package/src/openfda-device.ts +356 -356
- package/src/openfda-drugsfda.ts +313 -0
- package/src/openfda.ts +518 -495
- package/src/pricing.ts +1075 -1075
- package/src/sam-gov/client.ts +774 -774
- package/src/sam-gov/index.ts +32 -32
- package/src/sam-gov/types.ts +152 -152
- package/src/sba.ts +357 -357
- package/src/server.ts +6688 -6297
- package/src/snapshot.ts +223 -223
- package/src/socrata.ts +532 -532
- package/src/treasury.ts +582 -575
- package/src/usaspending.ts +2852 -2680
- package/src/usitc.ts +420 -420
package/src/disclosure.ts
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* disclosure.ts — the single audited disclosure-note TOKENIZER shared across the
|
|
3
|
-
* keyless DataSources (ADR-0022: an honesty-layer primitive, split into its own
|
|
4
|
-
* tiny single-concern module — the sibling of coerce.ts's map-layer primitives).
|
|
5
|
-
*
|
|
6
|
-
* WHY IT EXISTS: two independent sources (NSF Awards C108 = the OR-note,
|
|
7
|
-
* ClinicalTrials.gov C109 = the AND-note) each built a mandatory multi-token
|
|
8
|
-
* disclosure note from the SAME character-for-character delimiter class, and
|
|
9
|
-
* adversarial verification caught the SAME latent gap on BOTH — a whitespace-only
|
|
10
|
-
* `.split(/\s+/)` misses the API's PUNCTUATION delimiters, so a compound that only
|
|
11
|
-
* LOOKS like one token ("coral-reef" = coral OR reef; "Sanofi-Aventis" = Sanofi
|
|
12
|
-
* AND Aventis) leaks through and the mandatory note is silently SKIPPED. Hoisting
|
|
13
|
-
* ONE audited tokenizer removes the drift risk (a class regression now fails NSF
|
|
14
|
-
* AND ClinicalTrials suites at once instead of silently in one) and gives the lint
|
|
15
|
-
* guardrail (lint-invariants.mjs) + the parity fault test a single home to point
|
|
16
|
-
* at: "the ONLY sanctioned way to tokenize a disclosure value lives here."
|
|
17
|
-
*
|
|
18
|
-
* THE CLASS (`DISCLOSURE_SPLIT_RE`) is the PRECISE ES/Essie confirmed-splitter set,
|
|
19
|
-
* live-verified byte-identically on BOTH sources 2026-07-12:
|
|
20
|
-
* - SPLIT (→ multi-token, the note fires): whitespace + `- , / ; + & | @ # =`
|
|
21
|
-
* - DO NOT split (→ one token, no note): `. : _ '` (NSF also `\` `*`)
|
|
22
|
-
* It is deliberately NOT a `[^A-Za-z0-9]+` superset — that would over-disclose a
|
|
23
|
-
* split the APIs did NOT make on `.`/`_`/`'` (a fabricated union/conjunction). `-`
|
|
24
|
-
* is placed LAST (a literal, not a range); `/` is escaped for the regex delimiter.
|
|
25
|
-
*
|
|
26
|
-
* NOTE-AGNOSTIC BY DESIGN: this returns ONLY the token array. The `.length > 1`
|
|
27
|
-
* decision, the per-source note WORDING (NSF = OR-union, ClinicalTrials = AND
|
|
28
|
-
* co-occurrence), and any downstream suppression (ClinicalTrials' sponsor
|
|
29
|
-
* broadening-note) stay in each CALLER — they are genuinely source-specific and do
|
|
30
|
-
* NOT belong to the tokenizer.
|
|
31
|
-
*
|
|
32
|
-
* THE OPTIONAL `splitRe` PARAM is the sanctioned, honest escape hatch: a FUTURE
|
|
33
|
-
* source whose analyzer genuinely splits on a DIFFERENT class routes through THIS
|
|
34
|
-
* helper with its own `splitRe` (explicit, greppable, reviewable) rather than
|
|
35
|
-
* re-inlining a raw `.split(/\s+/)`. That is exactly what lets the lint ban the
|
|
36
|
-
* bare whitespace split outright (there is one sanctioned tokenizer, not many).
|
|
37
|
-
*
|
|
38
|
-
* No new dep, no I/O, pure function — the exact shape of a coerce.ts primitive.
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The shared ES/Essie confirmed-splitter class (byte-identical to NSF's former
|
|
43
|
-
* `NSF_KEYWORD_SPLIT_RE` and ClinicalTrials' former `CT_TOKEN_SPLIT_RE`). Stateless
|
|
44
|
-
* (no `/g`), so a single module-level RegExp is safe to share across callers.
|
|
45
|
-
*/
|
|
46
|
-
export const DISCLOSURE_SPLIT_RE = /[\s,;+&|@#=\/-]+/;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Tokenize a disclosure value for a multi-token honesty note: trim, split on the
|
|
50
|
-
* confirmed-splitter class (default `DISCLOSURE_SPLIT_RE`), and drop empty tokens.
|
|
51
|
-
* Returns ONLY the token array — the caller owns the `.length > 1` gate + note
|
|
52
|
-
* wording. `tokenizeForDisclosure("coral-reef")` → `["coral", "reef"]`;
|
|
53
|
-
* `tokenizeForDisclosure("web_service")` → `["web_service"]` (the class does NOT
|
|
54
|
-
* split `_`); `tokenizeForDisclosure("robotics")` → `["robotics"]`.
|
|
55
|
-
*/
|
|
56
|
-
export function tokenizeForDisclosure(
|
|
57
|
-
value: string,
|
|
58
|
-
splitRe: RegExp = DISCLOSURE_SPLIT_RE,
|
|
59
|
-
): string[] {
|
|
60
|
-
return value.trim().split(splitRe).filter((t) => t.length > 0);
|
|
61
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* disclosure.ts — the single audited disclosure-note TOKENIZER shared across the
|
|
3
|
+
* keyless DataSources (ADR-0022: an honesty-layer primitive, split into its own
|
|
4
|
+
* tiny single-concern module — the sibling of coerce.ts's map-layer primitives).
|
|
5
|
+
*
|
|
6
|
+
* WHY IT EXISTS: two independent sources (NSF Awards C108 = the OR-note,
|
|
7
|
+
* ClinicalTrials.gov C109 = the AND-note) each built a mandatory multi-token
|
|
8
|
+
* disclosure note from the SAME character-for-character delimiter class, and
|
|
9
|
+
* adversarial verification caught the SAME latent gap on BOTH — a whitespace-only
|
|
10
|
+
* `.split(/\s+/)` misses the API's PUNCTUATION delimiters, so a compound that only
|
|
11
|
+
* LOOKS like one token ("coral-reef" = coral OR reef; "Sanofi-Aventis" = Sanofi
|
|
12
|
+
* AND Aventis) leaks through and the mandatory note is silently SKIPPED. Hoisting
|
|
13
|
+
* ONE audited tokenizer removes the drift risk (a class regression now fails NSF
|
|
14
|
+
* AND ClinicalTrials suites at once instead of silently in one) and gives the lint
|
|
15
|
+
* guardrail (lint-invariants.mjs) + the parity fault test a single home to point
|
|
16
|
+
* at: "the ONLY sanctioned way to tokenize a disclosure value lives here."
|
|
17
|
+
*
|
|
18
|
+
* THE CLASS (`DISCLOSURE_SPLIT_RE`) is the PRECISE ES/Essie confirmed-splitter set,
|
|
19
|
+
* live-verified byte-identically on BOTH sources 2026-07-12:
|
|
20
|
+
* - SPLIT (→ multi-token, the note fires): whitespace + `- , / ; + & | @ # =`
|
|
21
|
+
* - DO NOT split (→ one token, no note): `. : _ '` (NSF also `\` `*`)
|
|
22
|
+
* It is deliberately NOT a `[^A-Za-z0-9]+` superset — that would over-disclose a
|
|
23
|
+
* split the APIs did NOT make on `.`/`_`/`'` (a fabricated union/conjunction). `-`
|
|
24
|
+
* is placed LAST (a literal, not a range); `/` is escaped for the regex delimiter.
|
|
25
|
+
*
|
|
26
|
+
* NOTE-AGNOSTIC BY DESIGN: this returns ONLY the token array. The `.length > 1`
|
|
27
|
+
* decision, the per-source note WORDING (NSF = OR-union, ClinicalTrials = AND
|
|
28
|
+
* co-occurrence), and any downstream suppression (ClinicalTrials' sponsor
|
|
29
|
+
* broadening-note) stay in each CALLER — they are genuinely source-specific and do
|
|
30
|
+
* NOT belong to the tokenizer.
|
|
31
|
+
*
|
|
32
|
+
* THE OPTIONAL `splitRe` PARAM is the sanctioned, honest escape hatch: a FUTURE
|
|
33
|
+
* source whose analyzer genuinely splits on a DIFFERENT class routes through THIS
|
|
34
|
+
* helper with its own `splitRe` (explicit, greppable, reviewable) rather than
|
|
35
|
+
* re-inlining a raw `.split(/\s+/)`. That is exactly what lets the lint ban the
|
|
36
|
+
* bare whitespace split outright (there is one sanctioned tokenizer, not many).
|
|
37
|
+
*
|
|
38
|
+
* No new dep, no I/O, pure function — the exact shape of a coerce.ts primitive.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The shared ES/Essie confirmed-splitter class (byte-identical to NSF's former
|
|
43
|
+
* `NSF_KEYWORD_SPLIT_RE` and ClinicalTrials' former `CT_TOKEN_SPLIT_RE`). Stateless
|
|
44
|
+
* (no `/g`), so a single module-level RegExp is safe to share across callers.
|
|
45
|
+
*/
|
|
46
|
+
export const DISCLOSURE_SPLIT_RE = /[\s,;+&|@#=\/-]+/;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Tokenize a disclosure value for a multi-token honesty note: trim, split on the
|
|
50
|
+
* confirmed-splitter class (default `DISCLOSURE_SPLIT_RE`), and drop empty tokens.
|
|
51
|
+
* Returns ONLY the token array — the caller owns the `.length > 1` gate + note
|
|
52
|
+
* wording. `tokenizeForDisclosure("coral-reef")` → `["coral", "reef"]`;
|
|
53
|
+
* `tokenizeForDisclosure("web_service")` → `["web_service"]` (the class does NOT
|
|
54
|
+
* split `_`); `tokenizeForDisclosure("robotics")` → `["robotics"]`.
|
|
55
|
+
*/
|
|
56
|
+
export function tokenizeForDisclosure(
|
|
57
|
+
value: string,
|
|
58
|
+
splitRe: RegExp = DISCLOSURE_SPLIT_RE,
|
|
59
|
+
): string[] {
|
|
60
|
+
return value.trim().split(splitRe).filter((t) => t.length > 0);
|
|
61
|
+
}
|