@metaphase-tech/fedspeak 0.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.
@@ -0,0 +1,10 @@
1
+ import type { DecodedResult, DecodeResponse } from './types';
2
+ export declare function lookupAcronym(query: string): DecodedResult | null;
3
+ export declare function scanText(text: string): DecodedResult[];
4
+ export declare function decode(request: {
5
+ acronym?: string;
6
+ text?: string;
7
+ }): DecodeResponse;
8
+ export declare function getAllAcronyms(): string[];
9
+ export declare function getAcronymCount(): number;
10
+ //# sourceMappingURL=decoder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decoder.d.ts","sourceRoot":"","sources":["../../src/shared/decoder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA2B1E,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAKjE;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,CAyBtD;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,cAAc,CAiCnF;AAED,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAEzC;AAED,wBAAgB,eAAe,IAAI,MAAM,CAExC"}
@@ -0,0 +1,92 @@
1
+ import acronymsData from './data/acronyms.json';
2
+ const acronyms = acronymsData;
3
+ // Build alias lookup map
4
+ const aliasMap = new Map();
5
+ for (const [key, entry] of Object.entries(acronyms)) {
6
+ aliasMap.set(key.toUpperCase(), key);
7
+ if (entry.aliases) {
8
+ for (const alias of entry.aliases) {
9
+ aliasMap.set(alias.toUpperCase(), key);
10
+ }
11
+ }
12
+ }
13
+ function toResult(key) {
14
+ const entry = acronyms[key];
15
+ return {
16
+ acronym: key,
17
+ full: entry.full,
18
+ description: entry.description,
19
+ agency: entry.agency,
20
+ category: entry.category,
21
+ ...(entry.url && { url: entry.url }),
22
+ };
23
+ }
24
+ export function lookupAcronym(query) {
25
+ const normalized = query.trim().toUpperCase();
26
+ const key = aliasMap.get(normalized);
27
+ if (!key)
28
+ return null;
29
+ return toResult(key);
30
+ }
31
+ export function scanText(text) {
32
+ // Extract potential acronyms: sequences of 2+ uppercase letters, digits, &, or -
33
+ // Also handle things like "8(a)" and multi-word keys
34
+ const words = text.split(/\s+/);
35
+ const found = new Map();
36
+ // Check individual words
37
+ for (const word of words) {
38
+ const cleaned = word.replace(/[.,;:!?()[\]{}'"]+$/g, '').replace(/^[.,;:!?()[\]{}'"]+/g, '');
39
+ const upper = cleaned.toUpperCase();
40
+ const key = aliasMap.get(upper);
41
+ if (key && !found.has(key)) {
42
+ found.set(key, toResult(key));
43
+ }
44
+ }
45
+ // Check multi-word keys (e.g., "DATA Act", "NIST SP")
46
+ const textUpper = text.toUpperCase();
47
+ for (const [key] of Object.entries(acronyms)) {
48
+ if (key.includes(' ') && textUpper.includes(key.toUpperCase()) && !found.has(key)) {
49
+ found.set(key, toResult(key));
50
+ }
51
+ }
52
+ return Array.from(found.values());
53
+ }
54
+ export function decode(request) {
55
+ if (request.acronym) {
56
+ const result = lookupAcronym(request.acronym);
57
+ return {
58
+ success: !!result,
59
+ query: request.acronym,
60
+ mode: 'single',
61
+ results: result ? [result] : [],
62
+ count: result ? 1 : 0,
63
+ truncated: false,
64
+ };
65
+ }
66
+ if (request.text) {
67
+ const results = scanText(request.text);
68
+ return {
69
+ success: results.length > 0,
70
+ query: request.text,
71
+ mode: 'scan',
72
+ results,
73
+ count: results.length,
74
+ truncated: false,
75
+ };
76
+ }
77
+ return {
78
+ success: false,
79
+ query: '',
80
+ mode: 'single',
81
+ results: [],
82
+ count: 0,
83
+ truncated: false,
84
+ };
85
+ }
86
+ export function getAllAcronyms() {
87
+ return Object.keys(acronyms).sort();
88
+ }
89
+ export function getAcronymCount() {
90
+ return Object.keys(acronyms).length;
91
+ }
92
+ //# sourceMappingURL=decoder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decoder.js","sourceRoot":"","sources":["../../src/shared/decoder.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAGhD,MAAM,QAAQ,GAAgB,YAA2B,CAAC;AAE1D,yBAAyB;AACzB,MAAM,QAAQ,GAAwB,IAAI,GAAG,EAAE,CAAC;AAChD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IACpD,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,GAAG,CAAC,CAAC;IACrC,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,GAAG,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,GAAW;IAC3B,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC5B,OAAO;QACL,OAAO,EAAE,GAAG;QACZ,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC;KACrC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,UAA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AACtC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { EncodedResult, EncodeResponse } from './types';
2
+ export declare function lookupName(query: string): EncodedResult | null;
3
+ export declare function scanTextForNames(text: string): EncodedResult[];
4
+ export declare function encode(request: {
5
+ name?: string;
6
+ text?: string;
7
+ }): EncodeResponse;
8
+ //# sourceMappingURL=encoder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encoder.d.ts","sourceRoot":"","sources":["../../src/shared/encoder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAsB1E,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAK9D;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,CAgB9D;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,cAAc,CAiChF"}
@@ -0,0 +1,70 @@
1
+ import acronymsData from './data/acronyms.json';
2
+ const acronyms = acronymsData;
3
+ // Build reverse lookup map: lowercase full name → acronym key
4
+ const reverseMap = new Map();
5
+ for (const [key, entry] of Object.entries(acronyms)) {
6
+ reverseMap.set(entry.full.toLowerCase(), key);
7
+ }
8
+ function toResult(key) {
9
+ const entry = acronyms[key];
10
+ return {
11
+ acronym: key,
12
+ full: entry.full,
13
+ description: entry.description,
14
+ agency: entry.agency,
15
+ category: entry.category,
16
+ ...(entry.url && { url: entry.url }),
17
+ };
18
+ }
19
+ export function lookupName(query) {
20
+ const normalized = query.trim().toLowerCase();
21
+ const key = reverseMap.get(normalized);
22
+ if (!key)
23
+ return null;
24
+ return toResult(key);
25
+ }
26
+ export function scanTextForNames(text) {
27
+ const found = new Map();
28
+ const textLower = text.toLowerCase();
29
+ // Check each full name against the text (longest first to prefer specific matches)
30
+ const entries = Array.from(reverseMap.entries()).sort((a, b) => b[0].length - a[0].length);
31
+ for (const [fullLower, key] of entries) {
32
+ if (textLower.includes(fullLower) && !found.has(key)) {
33
+ found.set(key, toResult(key));
34
+ }
35
+ }
36
+ return Array.from(found.values());
37
+ }
38
+ export function encode(request) {
39
+ if (request.name) {
40
+ const result = lookupName(request.name);
41
+ return {
42
+ success: !!result,
43
+ query: request.name,
44
+ mode: 'single',
45
+ results: result ? [result] : [],
46
+ count: result ? 1 : 0,
47
+ truncated: false,
48
+ };
49
+ }
50
+ if (request.text) {
51
+ const results = scanTextForNames(request.text);
52
+ return {
53
+ success: results.length > 0,
54
+ query: request.text,
55
+ mode: 'scan',
56
+ results,
57
+ count: results.length,
58
+ truncated: false,
59
+ };
60
+ }
61
+ return {
62
+ success: false,
63
+ query: '',
64
+ mode: 'single',
65
+ results: [],
66
+ count: 0,
67
+ truncated: false,
68
+ };
69
+ }
70
+ //# sourceMappingURL=encoder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encoder.js","sourceRoot":"","sources":["../../src/shared/encoder.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAGhD,MAAM,QAAQ,GAAgB,YAA2B,CAAC;AAE1D,8DAA8D;AAC9D,MAAM,UAAU,GAAwB,IAAI,GAAG,EAAE,CAAC;AAClD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IACpD,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,GAAG,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,QAAQ,CAAC,GAAW;IAC3B,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC5B,OAAO;QACL,OAAO,EAAE,GAAG;QACZ,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,WAAW,EAAE,KAAK,CAAC,WAAW;QA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AU,MAAM,CAAC,OAAyC;IAC9D,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACxC,OAAO;YACL,OAAO,EAAE,CAAC,CAAC,MAAM;YACjB,KAAK,EAAE,OAAO,CAAC,IAAI;YACnB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;YAC/B,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACrB,SAAS,EAAE,KAAK;SACjB,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/C,OAAO;YACL,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC;YAC3B,KAAK,EAAE,OAAO,CAAC,IAAI;YACnB,IAAI,EAAE,MAAM;YACZ,OAAO;YACP,KAAK,EAAE,OAAO,CAAC,MAAM;YACrB,SAAS,EAAE,KAAK;SACjB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,KAAK;KACjB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { DecodeResponse, EncodeResponse } from './types';
2
+ type TruncatableResponse = DecodeResponse | EncodeResponse;
3
+ /**
4
+ * Progressive truncation for Join39 2000-char compliance:
5
+ * 1. Shorten descriptions to first sentence
6
+ * 2. Drop descriptions entirely
7
+ * 3. Trim results array
8
+ */
9
+ export declare function truncateForJoin39<T extends TruncatableResponse>(response: T): T;
10
+ export {};
11
+ //# sourceMappingURL=truncate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"truncate.d.ts","sourceRoot":"","sources":["../../src/shared/truncate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI9D,KAAK,mBAAmB,GAAG,cAAc,GAAG,cAAc,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,mBAAmB,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CA+C/E"}
@@ -0,0 +1,47 @@
1
+ const JOIN39_CHAR_LIMIT = 2000;
2
+ /**
3
+ * Progressive truncation for Join39 2000-char compliance:
4
+ * 1. Shorten descriptions to first sentence
5
+ * 2. Drop descriptions entirely
6
+ * 3. Trim results array
7
+ */
8
+ export function truncateForJoin39(response) {
9
+ let json = JSON.stringify(response);
10
+ if (json.length <= JOIN39_CHAR_LIMIT) {
11
+ return response;
12
+ }
13
+ // Step 1: Shorten descriptions to first sentence
14
+ const shortened = {
15
+ ...response,
16
+ results: response.results.map((r) => ({
17
+ ...r,
18
+ description: r.description.split('. ')[0] + '.',
19
+ })),
20
+ truncated: true,
21
+ };
22
+ json = JSON.stringify(shortened);
23
+ if (json.length <= JOIN39_CHAR_LIMIT) {
24
+ return shortened;
25
+ }
26
+ // Step 2: Drop descriptions entirely
27
+ const noDesc = {
28
+ ...shortened,
29
+ results: shortened.results.map((r) => ({
30
+ ...r,
31
+ description: '',
32
+ })),
33
+ };
34
+ json = JSON.stringify(noDesc);
35
+ if (json.length <= JOIN39_CHAR_LIMIT) {
36
+ return noDesc;
37
+ }
38
+ // Step 3: Trim results array until under limit
39
+ const trimmed = { ...noDesc };
40
+ while (trimmed.results.length > 0 &&
41
+ JSON.stringify(trimmed).length > JOIN39_CHAR_LIMIT) {
42
+ trimmed.results = trimmed.results.slice(0, -1);
43
+ }
44
+ trimmed.count = trimmed.results.length;
45
+ return trimmed;
46
+ }
47
+ //# sourceMappingURL=truncate.js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EAAE,GAAG,MAAM,EAAE,CAAC;IAC9B,OACE,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;QAC1B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,iBAAiB,EAClD,CAAC;QACD,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;IAEvC,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,53 @@
1
+ export type AcronymCategory = 'department' | 'agency' | 'office' | 'bureau' | 'program' | 'process' | 'regulation' | 'system' | 'general';
2
+ export interface AcronymEntry {
3
+ full: string;
4
+ description: string;
5
+ agency: string;
6
+ category: AcronymCategory;
7
+ url?: string;
8
+ aliases?: string[];
9
+ }
10
+ export interface AcronymData {
11
+ [key: string]: AcronymEntry;
12
+ }
13
+ export interface DecodedResult {
14
+ acronym: string;
15
+ full: string;
16
+ description: string;
17
+ agency: string;
18
+ category: AcronymCategory;
19
+ url?: string;
20
+ }
21
+ export interface DecodeResponse {
22
+ success: boolean;
23
+ query: string;
24
+ mode: 'single' | 'scan';
25
+ results: DecodedResult[];
26
+ count: number;
27
+ truncated: boolean;
28
+ }
29
+ export interface DecodeRequest {
30
+ acronym?: string;
31
+ text?: string;
32
+ }
33
+ export interface EncodedResult {
34
+ acronym: string;
35
+ full: string;
36
+ description: string;
37
+ agency: string;
38
+ category: AcronymCategory;
39
+ url?: string;
40
+ }
41
+ export interface EncodeResponse {
42
+ success: boolean;
43
+ query: string;
44
+ mode: 'single' | 'scan';
45
+ results: EncodedResult[];
46
+ count: number;
47
+ truncated: boolean;
48
+ }
49
+ export interface EncodeRequest {
50
+ name?: string;
51
+ text?: string;
52
+ }
53
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,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CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@metaphase-tech/fedspeak",
3
+ "version": "0.1.0",
4
+ "description": "Federal Acronym Decoder — decode U.S. government acronyms from text or single lookups",
5
+ "keywords": [
6
+ "federal",
7
+ "government",
8
+ "acronyms",
9
+ "decoder",
10
+ "api"
11
+ ],
12
+ "author": "MetaPhase Consulting",
13
+ "license": "MIT",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/MetaPhase-Consulting/fedspeak.git"
17
+ },
18
+ "homepage": "https://fedspeak.dev",
19
+ "bugs": {
20
+ "url": "https://github.com/MetaPhase-Consulting/fedspeak/issues"
21
+ },
22
+ "type": "module",
23
+ "main": "dist/index.js",
24
+ "types": "dist/index.d.ts",
25
+ "exports": {
26
+ ".": {
27
+ "import": "./dist/index.js",
28
+ "types": "./dist/index.d.ts"
29
+ }
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "README.md",
34
+ "LICENSE"
35
+ ]
36
+ }