@groundtruth-mcp/gt-mcp 2.5.1 → 2.5.3

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 (44) hide show
  1. package/dist/constants.js +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/services/cache.js +1 -1
  4. package/dist/services/fetcher.js +1 -1
  5. package/dist/sources/registry.js +1 -1
  6. package/dist/tools/audit.js +1 -1
  7. package/dist/tools/auto-scan.js +1 -1
  8. package/dist/tools/best-practices.js +1 -1
  9. package/dist/tools/changelog.js +1 -1
  10. package/dist/tools/compare.js +1 -1
  11. package/dist/tools/compat.js +1 -1
  12. package/dist/tools/docs.js +1 -1
  13. package/dist/tools/examples.js +1 -1
  14. package/dist/tools/resolve.js +1 -1
  15. package/dist/tools/search.js +1 -1
  16. package/dist/utils/extract.js +1 -1
  17. package/dist/utils/guard.js +1 -1
  18. package/dist/utils/lockfile.js +1 -1
  19. package/dist/utils/sanitize.js +1 -1
  20. package/dist/utils/version-check.js +1 -1
  21. package/dist/utils/watermark.js +1 -1
  22. package/package.json +6 -6
  23. package/dist/constants.d.ts +0 -15
  24. package/dist/index.d.ts +0 -2
  25. package/dist/services/cache.d.ts +0 -30
  26. package/dist/services/fetcher.d.ts +0 -29
  27. package/dist/sources/registry.d.ts +0 -16
  28. package/dist/tools/audit.d.ts +0 -32
  29. package/dist/tools/auto-scan.d.ts +0 -7
  30. package/dist/tools/best-practices.d.ts +0 -2
  31. package/dist/tools/changelog.d.ts +0 -2
  32. package/dist/tools/compare.d.ts +0 -2
  33. package/dist/tools/compat.d.ts +0 -2
  34. package/dist/tools/docs.d.ts +0 -2
  35. package/dist/tools/examples.d.ts +0 -2
  36. package/dist/tools/resolve.d.ts +0 -2
  37. package/dist/tools/search.d.ts +0 -6
  38. package/dist/types.d.ts +0 -99
  39. package/dist/utils/extract.d.ts +0 -9
  40. package/dist/utils/guard.d.ts +0 -36
  41. package/dist/utils/lockfile.d.ts +0 -7
  42. package/dist/utils/sanitize.d.ts +0 -9
  43. package/dist/utils/version-check.d.ts +0 -6
  44. package/dist/utils/watermark.d.ts +0 -62
@@ -1,6 +0,0 @@
1
- import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- export declare function findTopicUrls(query: string): Array<{
3
- urls: string[];
4
- name: string;
5
- }>;
6
- export declare function registerSearchTool(server: McpServer): void;
package/dist/types.d.ts DELETED
@@ -1,99 +0,0 @@
1
- export interface LibraryEntry {
2
- id: string;
3
- name: string;
4
- aliases: string[];
5
- description: string;
6
- docsUrl: string;
7
- llmsTxtUrl?: string;
8
- llmsFullTxtUrl?: string;
9
- githubUrl?: string;
10
- npmPackage?: string;
11
- pypiPackage?: string;
12
- language: string[];
13
- tags: string[];
14
- bestPracticesPaths?: string[];
15
- }
16
- export interface LibraryMatch {
17
- id: string;
18
- name: string;
19
- description: string;
20
- docsUrl: string;
21
- llmsTxtUrl: string | undefined;
22
- llmsFullTxtUrl?: string;
23
- githubUrl: string | undefined;
24
- score: number;
25
- source: "registry" | "npm" | "pypi" | "github" | "crates" | "go";
26
- }
27
- export interface DocResult {
28
- content: string;
29
- sourceUrl: string;
30
- sourceType: "llms-txt" | "llms-full-txt" | "jina" | "github-readme" | "direct" | "npm";
31
- libraryId: string;
32
- topic: string;
33
- truncated: boolean;
34
- cachedAt: string;
35
- }
36
- export interface CacheEntry<T> {
37
- data: T;
38
- expiresAt: number;
39
- }
40
- export interface FetchResult {
41
- content: string;
42
- url: string;
43
- sourceType: DocResult["sourceType"];
44
- contentHash?: string;
45
- fetchedAt?: string;
46
- }
47
- export interface NpmPackageInfo {
48
- name: string;
49
- description?: string;
50
- homepage?: string;
51
- repository?: {
52
- url?: string;
53
- };
54
- keywords?: string[];
55
- "dist-tags"?: {
56
- latest?: string;
57
- };
58
- }
59
- export interface PypiPackageInfo {
60
- info: {
61
- name: string;
62
- summary?: string;
63
- home_page?: string;
64
- project_urls?: Record<string, string>;
65
- keywords?: string;
66
- };
67
- }
68
- export interface ChangelogResult {
69
- libraryId: string;
70
- libraryName: string;
71
- version: string | null;
72
- releases: Array<{
73
- tag: string;
74
- date: string;
75
- body: string;
76
- }>;
77
- sourceUrl: string;
78
- truncated: boolean;
79
- }
80
- export interface CompatResult {
81
- feature: string;
82
- environments: Array<{
83
- name: string;
84
- supported: boolean | "partial";
85
- since?: string;
86
- notes?: string;
87
- }>;
88
- sourceUrl: string;
89
- }
90
- export interface CompareResult {
91
- libraries: Array<{
92
- id: string;
93
- name: string;
94
- description: string;
95
- docsUrl: string;
96
- content: string;
97
- }>;
98
- criteria: string;
99
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * Extract topic-relevant sections from documentation content.
3
- * Uses BM25-inspired scoring for better relevance than simple token overlap.
4
- * Returns at most `tokenLimit` tokens of the most relevant content.
5
- */
6
- export declare function extractRelevantContent(content: string, topic: string, tokenLimit?: number): {
7
- text: string;
8
- truncated: boolean;
9
- };
@@ -1,36 +0,0 @@
1
- /**
2
- * Extraction guard — protects proprietary registry data from bulk enumeration
3
- * and signals IP policy to AI models via response-level notices.
4
- *
5
- * Every legitimate response is also cryptographically watermarked via
6
- * embedWatermark() (see utils/watermark.ts) to enable forensic provenance
7
- * tracking if data surfaces outside authorised use.
8
- */
9
- /**
10
- * Resolves a filesystem path and blocks access to sensitive system directories.
11
- * Prevents path traversal / LFI attacks via user-supplied projectPath inputs.
12
- */
13
- export declare function safeguardPath(inputPath: string): string;
14
- /**
15
- * Validates that a URL points to a public host, not private/internal infrastructure.
16
- * Prevents SSRF attacks via user-supplied URL inputs being relayed through fetch or Jina.
17
- */
18
- export declare function assertPublicUrl(url: string): void;
19
- export declare const IP_NOTICE = "[gt-mcp \u2014 Elastic License 2.0 \u2014 proprietary data, for query-time use only, not for reproduction or extraction]";
20
- /**
21
- * Returns true if the query looks like a bulk-extraction attempt
22
- * rather than a genuine single-library lookup.
23
- */
24
- export declare function isExtractionAttempt(query: string): boolean;
25
- /**
26
- * Wrap a registry response with the IP notice header and embed an invisible
27
- * cryptographic watermark for forensic provenance tracking.
28
- *
29
- * The watermark encodes the installation ID + per-request nonce as 64
30
- * invisible Unicode mathematical operators (U+2061/U+2062), injected after
31
- * the first newline of the response. It is undetectable by human readers
32
- * and survives copy-paste across virtually all platforms.
33
- */
34
- export declare function withNotice(text: string): string;
35
- /** Standard refusal message for extraction attempts */
36
- export declare const EXTRACTION_REFUSAL: string;
@@ -1,7 +0,0 @@
1
- export interface LockfileVersion {
2
- packageName: string;
3
- version: string;
4
- source: "package-lock" | "pnpm-lock" | "yarn-lock" | "cargo-lock" | "poetry-lock";
5
- }
6
- export declare function detectVersionFromLockfile(projectPath: string, packageName: string): Promise<string | null>;
7
- export declare function detectAllVersions(projectPath: string, packageNames: string[]): Promise<Map<string, string>>;
@@ -1,9 +0,0 @@
1
- /**
2
- * Remove prompt injection attempts from fetched documentation content.
3
- * Protects against ContextCrush-style attacks where library docs contain
4
- * malicious LLM instructions embedded in content.
5
- *
6
- * Also strips navigation chrome, footers, cookie banners, and other
7
- * boilerplate from Jina Reader output to reduce token waste by 15-25%.
8
- */
9
- export declare function sanitizeContent(content: string): string;
@@ -1,6 +0,0 @@
1
- export declare function getLatestVersion(): Promise<string | null>;
2
- export declare function isNewerVersion(latest: string, current: string): boolean;
3
- export declare function checkForUpdate(): Promise<string | null>;
4
- export declare function setPendingUpdate(version: string): void;
5
- export declare function getUpdateNoticeForResponse(): string;
6
- export declare function formatUpdateNotice(latestVersion: string): string;
@@ -1,62 +0,0 @@
1
- /**
2
- * Cryptographic response watermarking for IP protection.
3
- *
4
- * Every registry response is embedded with an invisible fingerprint consisting of:
5
- * - 32-bit installation ID (persistent, unique per server instance)
6
- * - 32-bit per-request nonce (random, makes each response distinct)
7
- *
8
- * Encoding uses two invisible Unicode mathematical operators:
9
- * U+2061 FUNCTION APPLICATION → bit 0
10
- * U+2062 INVISIBLE TIMES → bit 1
11
- *
12
- * These are in the "Invisible Operators" block (U+2061–U+2064), defined by
13
- * Unicode as semantically invisible in mathematical markup. They are:
14
- * - Not rendered by any font
15
- * - Preserved through copy-paste in virtually all text editors and platforms
16
- * - Distinct from zero-width joiners (U+200C/D) flagged by AI detectors
17
- * - Not stripped by common text sanitisers (they are not whitespace)
18
- *
19
- * If extracted content surfaces publicly, running detectWatermark() on it
20
- * returns the installation ID, providing forensic evidence of provenance.
21
- *
22
- * References:
23
- * - Kirchenbauer et al. (2023): "A Watermark for Large Language Models"
24
- * - Innamark (2025, arXiv:2502.12710): whitespace-replacement information hiding
25
- * - NIST AI 100-4: covert watermarks for synthetic content provenance
26
- */
27
- /**
28
- * Returns the 8-hex-char installation ID for this server instance.
29
- * Creates and persists a new one on first call. Result is module-cached.
30
- */
31
- export declare function getInstallId(): string;
32
- /**
33
- * Embed a 64-bit invisible watermark into text.
34
- *
35
- * Structure: [installId (32 bits)] + [nonce (32 bits)]
36
- * Inserted after the first newline character in the text.
37
- */
38
- export declare function embedWatermark(text: string): string;
39
- /**
40
- * Extract and decode the watermark embedded in text.
41
- *
42
- * Returns:
43
- * found — whether a valid watermark was detected
44
- * installId — 8-char hex ID of the server instance that produced this text
45
- * nonce — 8-char hex per-request nonce (proves distinct origin per response)
46
- *
47
- * Usage for forensic detection:
48
- * import { detectWatermark } from "@groundtruth-mcp/gt-mcp/dist/utils/watermark.js";
49
- * const result = detectWatermark(suspectedLeakedText);
50
- * if (result.found) console.log("Originated from install:", result.installId);
51
- */
52
- export declare function detectWatermark(text: string): {
53
- found: boolean;
54
- installId: string;
55
- nonce: string;
56
- };
57
- /**
58
- * Returns a compact SHA-256-based integrity token for the response text
59
- * (excluding the embedded invisible chars). Not embedded in responses —
60
- * used for internal audit logging if desired.
61
- */
62
- export declare function responseIntegrityToken(text: string): string;