@pcircle/footprint 1.2.2 → 1.5.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 +1 -1
- package/README.md +125 -161
- package/SKILL.md +50 -50
- package/dist/src/analyzers/content-analyzer.d.ts.map +1 -1
- package/dist/src/analyzers/content-analyzer.js +20 -4
- package/dist/src/analyzers/content-analyzer.js.map +1 -1
- package/dist/src/cli/constants.d.ts +20 -0
- package/dist/src/cli/constants.d.ts.map +1 -0
- package/dist/src/cli/constants.js +25 -0
- package/dist/src/cli/constants.js.map +1 -0
- package/dist/src/cli/index.d.ts +3 -0
- package/dist/src/cli/index.d.ts.map +1 -0
- package/dist/src/cli/index.js +25 -0
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/cli/setup.d.ts +6 -0
- package/dist/src/cli/setup.d.ts.map +1 -0
- package/dist/src/cli/setup.js +356 -0
- package/dist/src/cli/setup.js.map +1 -0
- package/dist/src/cli/types.d.ts +38 -0
- package/dist/src/cli/types.d.ts.map +1 -0
- package/dist/src/cli/types.js +5 -0
- package/dist/src/cli/types.js.map +1 -0
- package/dist/src/cli/utils/config.d.ts +19 -0
- package/dist/src/cli/utils/config.d.ts.map +1 -0
- package/dist/src/cli/utils/config.js +86 -0
- package/dist/src/cli/utils/config.js.map +1 -0
- package/dist/src/cli/utils/detect.d.ts +14 -0
- package/dist/src/cli/utils/detect.d.ts.map +1 -0
- package/dist/src/cli/utils/detect.js +57 -0
- package/dist/src/cli/utils/detect.js.map +1 -0
- package/dist/src/cli/utils/env.d.ts +15 -0
- package/dist/src/cli/utils/env.d.ts.map +1 -0
- package/dist/src/cli/utils/env.js +85 -0
- package/dist/src/cli/utils/env.js.map +1 -0
- package/dist/src/cli/utils/validation.d.ts +17 -0
- package/dist/src/cli/utils/validation.d.ts.map +1 -0
- package/dist/src/cli/utils/validation.js +77 -0
- package/dist/src/cli/utils/validation.js.map +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +53 -38
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib/crypto/decrypt.d.ts.map +1 -1
- package/dist/src/lib/crypto/decrypt.js +12 -8
- package/dist/src/lib/crypto/decrypt.js.map +1 -1
- package/dist/src/lib/crypto/encrypt.d.ts.map +1 -1
- package/dist/src/lib/crypto/encrypt.js +6 -3
- package/dist/src/lib/crypto/encrypt.js.map +1 -1
- package/dist/src/lib/crypto/key-derivation.d.ts +1 -1
- package/dist/src/lib/crypto/key-derivation.d.ts.map +1 -1
- package/dist/src/lib/crypto/key-derivation.js +11 -11
- package/dist/src/lib/crypto/key-derivation.js.map +1 -1
- package/dist/src/lib/storage/database.d.ts +46 -3
- package/dist/src/lib/storage/database.d.ts.map +1 -1
- package/dist/src/lib/storage/database.js +175 -80
- package/dist/src/lib/storage/database.js.map +1 -1
- package/dist/src/lib/storage/export.d.ts +3 -4
- package/dist/src/lib/storage/export.d.ts.map +1 -1
- package/dist/src/lib/storage/export.js +75 -62
- package/dist/src/lib/storage/export.js.map +1 -1
- package/dist/src/lib/storage/salt-storage.d.ts +1 -1
- package/dist/src/lib/storage/salt-storage.d.ts.map +1 -1
- package/dist/src/lib/storage/salt-storage.js +26 -18
- package/dist/src/lib/storage/salt-storage.js.map +1 -1
- package/dist/src/lib/storage/schema.d.ts +1 -1
- package/dist/src/lib/storage/schema.d.ts.map +1 -1
- package/dist/src/lib/storage/schema.js +29 -47
- package/dist/src/lib/storage/schema.js.map +1 -1
- package/dist/src/lib/tool-wrapper.d.ts.map +1 -1
- package/dist/src/lib/tool-wrapper.js +2 -2
- package/dist/src/lib/tool-wrapper.js.map +1 -1
- package/dist/src/prompts/skill-prompt.d.ts +6 -0
- package/dist/src/prompts/skill-prompt.d.ts.map +1 -0
- package/dist/src/prompts/skill-prompt.js +125 -0
- package/dist/src/prompts/skill-prompt.js.map +1 -0
- package/dist/src/tools/capture-footprint.d.ts +2 -2
- package/dist/src/tools/capture-footprint.d.ts.map +1 -1
- package/dist/src/tools/capture-footprint.js +53 -12
- package/dist/src/tools/capture-footprint.js.map +1 -1
- package/dist/src/tools/delete-footprints.d.ts +19 -2
- package/dist/src/tools/delete-footprints.d.ts.map +1 -1
- package/dist/src/tools/delete-footprints.js +56 -8
- package/dist/src/tools/delete-footprints.js.map +1 -1
- package/dist/src/tools/export-footprints.d.ts +14 -6
- package/dist/src/tools/export-footprints.d.ts.map +1 -1
- package/dist/src/tools/export-footprints.js +54 -15
- package/dist/src/tools/export-footprints.js.map +1 -1
- package/dist/src/tools/get-footprint.d.ts +1 -7
- package/dist/src/tools/get-footprint.d.ts.map +1 -1
- package/dist/src/tools/get-footprint.js +26 -22
- package/dist/src/tools/get-footprint.js.map +1 -1
- package/dist/src/tools/index.d.ts +1 -3
- package/dist/src/tools/index.d.ts.map +1 -1
- package/dist/src/tools/index.js +1 -3
- package/dist/src/tools/index.js.map +1 -1
- package/dist/src/tools/list-footprints.d.ts +3 -17
- package/dist/src/tools/list-footprints.d.ts.map +1 -1
- package/dist/src/tools/list-footprints.js +27 -16
- package/dist/src/tools/list-footprints.js.map +1 -1
- package/dist/src/tools/manage-tags.d.ts +47 -0
- package/dist/src/tools/manage-tags.d.ts.map +1 -0
- package/dist/src/tools/manage-tags.js +109 -0
- package/dist/src/tools/manage-tags.js.map +1 -0
- package/dist/src/tools/search-footprints.d.ts +4 -18
- package/dist/src/tools/search-footprints.d.ts.map +1 -1
- package/dist/src/tools/search-footprints.js +32 -16
- package/dist/src/tools/search-footprints.js.map +1 -1
- package/dist/src/tools/suggest-capture.d.ts +1 -1
- package/dist/src/tools/suggest-capture.d.ts.map +1 -1
- package/dist/src/tools/suggest-capture.js +6 -2
- package/dist/src/tools/suggest-capture.js.map +1 -1
- package/dist/src/tools/verify-footprint.d.ts +7 -54
- package/dist/src/tools/verify-footprint.d.ts.map +1 -1
- package/dist/src/tools/verify-footprint.js +22 -19
- package/dist/src/tools/verify-footprint.js.map +1 -1
- package/dist/src/types.d.ts +4 -4
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/ui/register.js +3 -3
- package/dist/src/ui/register.js.map +1 -1
- package/dist/ui/dashboard.html +78 -65
- package/dist/ui/detail.html +69 -56
- package/dist/ui/export.html +72 -59
- package/package.json +28 -16
- package/dist/src/lib/errors/base-error.d.ts +0 -15
- package/dist/src/lib/errors/base-error.d.ts.map +0 -1
- package/dist/src/lib/errors/base-error.js +0 -34
- package/dist/src/lib/errors/base-error.js.map +0 -1
- package/dist/src/lib/errors/crypto-error.d.ts +0 -29
- package/dist/src/lib/errors/crypto-error.d.ts.map +0 -1
- package/dist/src/lib/errors/crypto-error.js +0 -43
- package/dist/src/lib/errors/crypto-error.js.map +0 -1
- package/dist/src/lib/errors/index.d.ts +0 -26
- package/dist/src/lib/errors/index.d.ts.map +0 -1
- package/dist/src/lib/errors/index.js +0 -26
- package/dist/src/lib/errors/index.js.map +0 -1
- package/dist/src/lib/errors/storage-error.d.ts +0 -25
- package/dist/src/lib/errors/storage-error.d.ts.map +0 -1
- package/dist/src/lib/errors/storage-error.js +0 -38
- package/dist/src/lib/errors/storage-error.js.map +0 -1
- package/dist/src/lib/errors/validation-error.d.ts +0 -21
- package/dist/src/lib/errors/validation-error.d.ts.map +0 -1
- package/dist/src/lib/errors/validation-error.js +0 -29
- package/dist/src/lib/errors/validation-error.js.map +0 -1
- package/dist/src/test-helpers.d.ts +0 -33
- package/dist/src/test-helpers.d.ts.map +0 -1
- package/dist/src/test-helpers.js +0 -108
- package/dist/src/test-helpers.js.map +0 -1
- package/dist/src/tools/get-tag-stats.d.ts +0 -30
- package/dist/src/tools/get-tag-stats.d.ts.map +0 -1
- package/dist/src/tools/get-tag-stats.js +0 -33
- package/dist/src/tools/get-tag-stats.js.map +0 -1
- package/dist/src/tools/remove-tag.d.ts +0 -22
- package/dist/src/tools/remove-tag.d.ts.map +0 -1
- package/dist/src/tools/remove-tag.js +0 -30
- package/dist/src/tools/remove-tag.js.map +0 -1
- package/dist/src/tools/rename-tag.d.ts +0 -24
- package/dist/src/tools/rename-tag.d.ts.map +0 -1
- package/dist/src/tools/rename-tag.js +0 -34
- package/dist/src/tools/rename-tag.js.map +0 -1
- package/dist/tests/error-handling.test.d.ts +0 -2
- package/dist/tests/error-handling.test.d.ts.map +0 -1
- package/dist/tests/error-handling.test.js +0 -114
- package/dist/tests/error-handling.test.js.map +0 -1
- package/dist/tests/fixtures.d.ts +0 -87
- package/dist/tests/fixtures.d.ts.map +0 -1
- package/dist/tests/fixtures.js +0 -130
- package/dist/tests/fixtures.js.map +0 -1
- package/dist/tests/integration.test.d.ts +0 -2
- package/dist/tests/integration.test.d.ts.map +0 -1
- package/dist/tests/integration.test.js +0 -115
- package/dist/tests/integration.test.js.map +0 -1
- package/dist/tests/resources.test.d.ts +0 -2
- package/dist/tests/resources.test.d.ts.map +0 -1
- package/dist/tests/resources.test.js +0 -73
- package/dist/tests/resources.test.js.map +0 -1
- package/dist/tests/setup.d.ts +0 -8
- package/dist/tests/setup.d.ts.map +0 -1
- package/dist/tests/setup.js +0 -8
- package/dist/tests/setup.js.map +0 -1
- package/dist/tests/tools.test.d.ts +0 -2
- package/dist/tests/tools.test.d.ts.map +0 -1
- package/dist/tests/tools.test.js +0 -224
- package/dist/tests/tools.test.js.map +0 -1
- package/dist/ui-tmp/ui/export.html +0 -409
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pcircle/footprint",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "MCP server for Footprint - automatic audit trails and encrypted
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"description": "MCP server for Footprint - automatic audit trails and encrypted evidence for AI conversations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
7
7
|
"model-context-protocol",
|
|
8
8
|
"llm",
|
|
9
9
|
"audit",
|
|
10
|
-
"
|
|
10
|
+
"evidence",
|
|
11
11
|
"encryption",
|
|
12
12
|
"footprint",
|
|
13
13
|
"claude",
|
|
@@ -20,21 +20,29 @@
|
|
|
20
20
|
"type": "module",
|
|
21
21
|
"main": "./dist/src/index.js",
|
|
22
22
|
"types": "./dist/src/index.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/src/index.d.ts",
|
|
26
|
+
"import": "./dist/src/index.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
23
29
|
"bin": {
|
|
24
|
-
"footprint": "./dist/src/index.js"
|
|
30
|
+
"footprint": "./dist/src/cli/index.js"
|
|
25
31
|
},
|
|
26
32
|
"files": [
|
|
27
|
-
"dist",
|
|
33
|
+
"dist/src",
|
|
34
|
+
"!dist/src/test-helpers*",
|
|
35
|
+
"dist/ui",
|
|
28
36
|
"SKILL.md",
|
|
29
37
|
"README.md",
|
|
30
38
|
"LICENSE"
|
|
31
39
|
],
|
|
32
40
|
"repository": {
|
|
33
41
|
"type": "git",
|
|
34
|
-
"url": "https://github.com/PCIRCLE-AI/footprint
|
|
42
|
+
"url": "https://github.com/PCIRCLE-AI/footprint.git"
|
|
35
43
|
},
|
|
36
44
|
"bugs": {
|
|
37
|
-
"url": "https://github.com/PCIRCLE-AI/footprint
|
|
45
|
+
"url": "https://github.com/PCIRCLE-AI/footprint/issues"
|
|
38
46
|
},
|
|
39
47
|
"homepage": "https://footprint.memesh.ai",
|
|
40
48
|
"scripts": {
|
|
@@ -51,26 +59,30 @@
|
|
|
51
59
|
},
|
|
52
60
|
"dependencies": {
|
|
53
61
|
"@modelcontextprotocol/ext-apps": "^1.0.1",
|
|
54
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
55
|
-
"@noble/ciphers": "^
|
|
56
|
-
"@noble/hashes": "^
|
|
62
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
63
|
+
"@noble/ciphers": "^2.1.1",
|
|
64
|
+
"@noble/hashes": "^2.0.1",
|
|
57
65
|
"better-sqlite3": "^12.6.2",
|
|
58
|
-
"
|
|
66
|
+
"chalk": "^5.6.2",
|
|
67
|
+
"isomorphic-git": "^1.37.1",
|
|
59
68
|
"jszip": "^3.10.1",
|
|
60
|
-
"
|
|
69
|
+
"ora": "^9.3.0",
|
|
70
|
+
"prompts": "^2.4.2",
|
|
71
|
+
"zod": "^4.3.6",
|
|
72
|
+
"zxcvbn": "^4.4.2"
|
|
61
73
|
},
|
|
62
74
|
"devDependencies": {
|
|
63
75
|
"@types/better-sqlite3": "^7.6.9",
|
|
64
|
-
"@types/
|
|
65
|
-
"@types/
|
|
66
|
-
"@types/
|
|
76
|
+
"@types/node": "^22.19.11",
|
|
77
|
+
"@types/prompts": "^2.4.9",
|
|
78
|
+
"@types/zxcvbn": "^4.4.5",
|
|
67
79
|
"concurrently": "^9.2.1",
|
|
68
80
|
"cross-env": "^10.1.0",
|
|
69
81
|
"tsx": "^4.21.0",
|
|
70
82
|
"typescript": "^5.9.3",
|
|
71
83
|
"vite": "^7.3.1",
|
|
72
84
|
"vite-plugin-singlefile": "^2.3.0",
|
|
73
|
-
"vitest": "^
|
|
85
|
+
"vitest": "^4.0.18"
|
|
74
86
|
},
|
|
75
87
|
"engines": {
|
|
76
88
|
"node": ">=22.0.0"
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base error class for all Footprint errors
|
|
3
|
-
* Provides structured error information with error codes and HTTP-like status codes
|
|
4
|
-
*/
|
|
5
|
-
export declare abstract class FootprintError extends Error {
|
|
6
|
-
readonly code: string;
|
|
7
|
-
readonly statusCode: number;
|
|
8
|
-
readonly context?: Record<string, unknown> | undefined;
|
|
9
|
-
constructor(message: string, code: string, statusCode: number, context?: Record<string, unknown> | undefined);
|
|
10
|
-
/**
|
|
11
|
-
* Convert error to JSON format for logging or API responses
|
|
12
|
-
*/
|
|
13
|
-
toJSON(): Record<string, unknown>;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=base-error.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-error.d.ts","sourceRoot":"","sources":["../../../../src/lib/errors/base-error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,8BAAsB,cAAe,SAAQ,KAAK;aAG9B,IAAI,EAAE,MAAM;aACZ,UAAU,EAAE,MAAM;aAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBAHjD,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAA;IAWnD;;OAEG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAUlC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base error class for all Footprint errors
|
|
3
|
-
* Provides structured error information with error codes and HTTP-like status codes
|
|
4
|
-
*/
|
|
5
|
-
export class FootprintError extends Error {
|
|
6
|
-
code;
|
|
7
|
-
statusCode;
|
|
8
|
-
context;
|
|
9
|
-
constructor(message, code, statusCode, context) {
|
|
10
|
-
super(message);
|
|
11
|
-
this.code = code;
|
|
12
|
-
this.statusCode = statusCode;
|
|
13
|
-
this.context = context;
|
|
14
|
-
this.name = this.constructor.name;
|
|
15
|
-
// Maintains proper stack trace for where error was thrown (V8 only)
|
|
16
|
-
if (Error.captureStackTrace) {
|
|
17
|
-
Error.captureStackTrace(this, this.constructor);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Convert error to JSON format for logging or API responses
|
|
22
|
-
*/
|
|
23
|
-
toJSON() {
|
|
24
|
-
return {
|
|
25
|
-
name: this.name,
|
|
26
|
-
message: this.message,
|
|
27
|
-
code: this.code,
|
|
28
|
-
statusCode: this.statusCode,
|
|
29
|
-
context: this.context,
|
|
30
|
-
stack: this.stack
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=base-error.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-error.js","sourceRoot":"","sources":["../../../../src/lib/errors/base-error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,OAAgB,cAAe,SAAQ,KAAK;IAG9B;IACA;IACA;IAJlB,YACE,OAAe,EACC,IAAY,EACZ,UAAkB,EAClB,OAAiC;QAEjD,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,SAAI,GAAJ,IAAI,CAAQ;QACZ,eAAU,GAAV,UAAU,CAAQ;QAClB,YAAO,GAAP,OAAO,CAA0B;QAGjD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAElC,oEAAoE;QACpE,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { FootprintError } from './base-error.js';
|
|
2
|
-
/**
|
|
3
|
-
* Cryptography error for encryption, decryption, and key operations
|
|
4
|
-
* HTTP status code: 500 (Internal Server Error)
|
|
5
|
-
*/
|
|
6
|
-
export declare class CryptoError extends FootprintError {
|
|
7
|
-
constructor(message: string, context?: Record<string, unknown>);
|
|
8
|
-
/**
|
|
9
|
-
* Create a crypto error for encryption failures
|
|
10
|
-
*/
|
|
11
|
-
static encryptionFailed(originalError: Error): CryptoError;
|
|
12
|
-
/**
|
|
13
|
-
* Create a crypto error for decryption failures
|
|
14
|
-
*/
|
|
15
|
-
static decryptionFailed(reason?: string): CryptoError;
|
|
16
|
-
/**
|
|
17
|
-
* Create a crypto error for key derivation failures
|
|
18
|
-
*/
|
|
19
|
-
static keyDerivationFailed(originalError: Error): CryptoError;
|
|
20
|
-
/**
|
|
21
|
-
* Create a crypto error for invalid key
|
|
22
|
-
*/
|
|
23
|
-
static invalidKey(reason: string): CryptoError;
|
|
24
|
-
/**
|
|
25
|
-
* Create a crypto error for invalid nonce
|
|
26
|
-
*/
|
|
27
|
-
static invalidNonce(reason: string): CryptoError;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=crypto-error.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crypto-error.d.ts","sourceRoot":"","sources":["../../../../src/lib/errors/crypto-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,qBAAa,WAAY,SAAQ,cAAc;gBACjC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAI9D;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,aAAa,EAAE,KAAK,GAAG,WAAW;IAO1D;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW;IASrD;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,aAAa,EAAE,KAAK,GAAG,WAAW;IAO7D;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW;IAI9C;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW;CAGjD"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { FootprintError } from './base-error.js';
|
|
2
|
-
/**
|
|
3
|
-
* Cryptography error for encryption, decryption, and key operations
|
|
4
|
-
* HTTP status code: 500 (Internal Server Error)
|
|
5
|
-
*/
|
|
6
|
-
export class CryptoError extends FootprintError {
|
|
7
|
-
constructor(message, context) {
|
|
8
|
-
super(message, 'CRYPTO_ERROR', 500, context);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Create a crypto error for encryption failures
|
|
12
|
-
*/
|
|
13
|
-
static encryptionFailed(originalError) {
|
|
14
|
-
return new CryptoError(`Encryption failed: ${originalError.message}`, { originalError: originalError.message });
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Create a crypto error for decryption failures
|
|
18
|
-
*/
|
|
19
|
-
static decryptionFailed(reason) {
|
|
20
|
-
return new CryptoError(reason
|
|
21
|
-
? `Decryption failed: ${reason}`
|
|
22
|
-
: 'Decryption failed: invalid key or tampered data', { reason });
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Create a crypto error for key derivation failures
|
|
26
|
-
*/
|
|
27
|
-
static keyDerivationFailed(originalError) {
|
|
28
|
-
return new CryptoError(`Key derivation failed: ${originalError.message}`, { originalError: originalError.message });
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Create a crypto error for invalid key
|
|
32
|
-
*/
|
|
33
|
-
static invalidKey(reason) {
|
|
34
|
-
return new CryptoError(`Invalid key: ${reason}`, { reason });
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Create a crypto error for invalid nonce
|
|
38
|
-
*/
|
|
39
|
-
static invalidNonce(reason) {
|
|
40
|
-
return new CryptoError(`Invalid nonce: ${reason}`, { reason });
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=crypto-error.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crypto-error.js","sourceRoot":"","sources":["../../../../src/lib/errors/crypto-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,cAAc;IAC7C,YAAY,OAAe,EAAE,OAAiC;QAC5D,KAAK,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,aAAoB;QAC1C,OAAO,IAAI,WAAW,CACpB,sBAAsB,aAAa,CAAC,OAAO,EAAE,EAC7C,EAAE,aAAa,EAAE,aAAa,CAAC,OAAO,EAAE,CACzC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAe;QACrC,OAAO,IAAI,WAAW,CACpB,MAAM;YACJ,CAAC,CAAC,sBAAsB,MAAM,EAAE;YAChC,CAAC,CAAC,iDAAiD,EACrD,EAAE,MAAM,EAAE,CACX,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,aAAoB;QAC7C,OAAO,IAAI,WAAW,CACpB,0BAA0B,aAAa,CAAC,OAAO,EAAE,EACjD,EAAE,aAAa,EAAE,aAAa,CAAC,OAAO,EAAE,CACzC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAc;QAC9B,OAAO,IAAI,WAAW,CAAC,gBAAgB,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,MAAc;QAChC,OAAO,IAAI,WAAW,CAAC,kBAAkB,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACjE,CAAC;CACF"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Structured error hierarchy for Footprint MCP server
|
|
3
|
-
*
|
|
4
|
-
* Usage:
|
|
5
|
-
* ```typescript
|
|
6
|
-
* import { ValidationError, StorageError, CryptoError } from './lib/errors/index.js';
|
|
7
|
-
*
|
|
8
|
-
* // Validation errors (HTTP 400)
|
|
9
|
-
* throw ValidationError.required('conversationId');
|
|
10
|
-
* throw ValidationError.invalidFormat('tags', 'comma-separated string');
|
|
11
|
-
* throw new ValidationError('Content cannot be empty', { field: 'content' });
|
|
12
|
-
*
|
|
13
|
-
* // Storage errors (HTTP 500)
|
|
14
|
-
* throw StorageError.notFound('Evidence', id);
|
|
15
|
-
* throw StorageError.databaseOperation('insert', error);
|
|
16
|
-
*
|
|
17
|
-
* // Crypto errors (HTTP 500)
|
|
18
|
-
* throw CryptoError.decryptionFailed();
|
|
19
|
-
* throw CryptoError.invalidKey('Key must be 32 bytes');
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export { FootprintError } from './base-error.js';
|
|
23
|
-
export { ValidationError } from './validation-error.js';
|
|
24
|
-
export { StorageError } from './storage-error.js';
|
|
25
|
-
export { CryptoError } from './crypto-error.js';
|
|
26
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/errors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Structured error hierarchy for Footprint MCP server
|
|
3
|
-
*
|
|
4
|
-
* Usage:
|
|
5
|
-
* ```typescript
|
|
6
|
-
* import { ValidationError, StorageError, CryptoError } from './lib/errors/index.js';
|
|
7
|
-
*
|
|
8
|
-
* // Validation errors (HTTP 400)
|
|
9
|
-
* throw ValidationError.required('conversationId');
|
|
10
|
-
* throw ValidationError.invalidFormat('tags', 'comma-separated string');
|
|
11
|
-
* throw new ValidationError('Content cannot be empty', { field: 'content' });
|
|
12
|
-
*
|
|
13
|
-
* // Storage errors (HTTP 500)
|
|
14
|
-
* throw StorageError.notFound('Evidence', id);
|
|
15
|
-
* throw StorageError.databaseOperation('insert', error);
|
|
16
|
-
*
|
|
17
|
-
* // Crypto errors (HTTP 500)
|
|
18
|
-
* throw CryptoError.decryptionFailed();
|
|
19
|
-
* throw CryptoError.invalidKey('Key must be 32 bytes');
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export { FootprintError } from './base-error.js';
|
|
23
|
-
export { ValidationError } from './validation-error.js';
|
|
24
|
-
export { StorageError } from './storage-error.js';
|
|
25
|
-
export { CryptoError } from './crypto-error.js';
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/errors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { FootprintError } from './base-error.js';
|
|
2
|
-
/**
|
|
3
|
-
* Storage error for database and file system operations
|
|
4
|
-
* HTTP status code: 500 (Internal Server Error)
|
|
5
|
-
*/
|
|
6
|
-
export declare class StorageError extends FootprintError {
|
|
7
|
-
constructor(message: string, context?: Record<string, unknown>);
|
|
8
|
-
/**
|
|
9
|
-
* Create a storage error for resource not found
|
|
10
|
-
*/
|
|
11
|
-
static notFound(resource: string, id: string): StorageError;
|
|
12
|
-
/**
|
|
13
|
-
* Create a storage error for database operations
|
|
14
|
-
*/
|
|
15
|
-
static databaseOperation(operation: string, originalError: Error): StorageError;
|
|
16
|
-
/**
|
|
17
|
-
* Create a storage error for file operations
|
|
18
|
-
*/
|
|
19
|
-
static fileOperation(operation: string, filePath: string, originalError: Error): StorageError;
|
|
20
|
-
/**
|
|
21
|
-
* Create a storage error for resource already exists
|
|
22
|
-
*/
|
|
23
|
-
static alreadyExists(resource: string, id: string): StorageError;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=storage-error.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage-error.d.ts","sourceRoot":"","sources":["../../../../src/lib/errors/storage-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,qBAAa,YAAa,SAAQ,cAAc;gBAClC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAI9D;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY;IAI3D;;OAEG;IACH,MAAM,CAAC,iBAAiB,CACtB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,KAAK,GACnB,YAAY;IAOf;;OAEG;IACH,MAAM,CAAC,aAAa,CAClB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,KAAK,GACnB,YAAY;IAOf;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY;CAMjE"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { FootprintError } from './base-error.js';
|
|
2
|
-
/**
|
|
3
|
-
* Storage error for database and file system operations
|
|
4
|
-
* HTTP status code: 500 (Internal Server Error)
|
|
5
|
-
*/
|
|
6
|
-
export class StorageError extends FootprintError {
|
|
7
|
-
constructor(message, context) {
|
|
8
|
-
super(message, 'STORAGE_ERROR', 500, context);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Create a storage error for resource not found
|
|
12
|
-
*/
|
|
13
|
-
static notFound(resource, id) {
|
|
14
|
-
return new StorageError(`${resource} not found: ${id}`, { resource, id });
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Create a storage error for database operations
|
|
18
|
-
*/
|
|
19
|
-
static databaseOperation(operation, originalError) {
|
|
20
|
-
return new StorageError(`Database ${operation} failed: ${originalError.message}`, { operation, originalError: originalError.message });
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Create a storage error for file operations
|
|
24
|
-
*/
|
|
25
|
-
static fileOperation(operation, filePath, originalError) {
|
|
26
|
-
return new StorageError(`File ${operation} failed for ${filePath}: ${originalError.message}`, { operation, filePath, originalError: originalError.message });
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Create a storage error for resource already exists
|
|
30
|
-
*/
|
|
31
|
-
static alreadyExists(resource, id) {
|
|
32
|
-
return new StorageError(`${resource} already exists: ${id}`, {
|
|
33
|
-
resource,
|
|
34
|
-
id
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=storage-error.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage-error.js","sourceRoot":"","sources":["../../../../src/lib/errors/storage-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,cAAc;IAC9C,YAAY,OAAe,EAAE,OAAiC;QAC5D,KAAK,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,QAAgB,EAAE,EAAU;QAC1C,OAAO,IAAI,YAAY,CAAC,GAAG,QAAQ,eAAe,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,iBAAiB,CACtB,SAAiB,EACjB,aAAoB;QAEpB,OAAO,IAAI,YAAY,CACrB,YAAY,SAAS,YAAY,aAAa,CAAC,OAAO,EAAE,EACxD,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,CAAC,OAAO,EAAE,CACpD,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,aAAa,CAClB,SAAiB,EACjB,QAAgB,EAChB,aAAoB;QAEpB,OAAO,IAAI,YAAY,CACrB,QAAQ,SAAS,eAAe,QAAQ,KAAK,aAAa,CAAC,OAAO,EAAE,EACpE,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,CAAC,OAAO,EAAE,CAC9D,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,QAAgB,EAAE,EAAU;QAC/C,OAAO,IAAI,YAAY,CAAC,GAAG,QAAQ,oBAAoB,EAAE,EAAE,EAAE;YAC3D,QAAQ;YACR,EAAE;SACH,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { FootprintError } from './base-error.js';
|
|
2
|
-
/**
|
|
3
|
-
* Validation error for invalid user input
|
|
4
|
-
* HTTP status code: 400 (Bad Request)
|
|
5
|
-
*/
|
|
6
|
-
export declare class ValidationError extends FootprintError {
|
|
7
|
-
constructor(message: string, context?: Record<string, unknown>);
|
|
8
|
-
/**
|
|
9
|
-
* Create a validation error for empty/missing required fields
|
|
10
|
-
*/
|
|
11
|
-
static required(field: string): ValidationError;
|
|
12
|
-
/**
|
|
13
|
-
* Create a validation error for invalid format
|
|
14
|
-
*/
|
|
15
|
-
static invalidFormat(field: string, expectedFormat: string): ValidationError;
|
|
16
|
-
/**
|
|
17
|
-
* Create a validation error for out of range values
|
|
18
|
-
*/
|
|
19
|
-
static outOfRange(field: string, value: number, min?: number, max?: number): ValidationError;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=validation-error.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validation-error.d.ts","sourceRoot":"","sources":["../../../../src/lib/errors/validation-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,cAAc;gBACrC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAI9D;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe;IAI/C;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,eAAe;IAO5E;;OAEG;IACH,MAAM,CAAC,UAAU,CACf,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,GACX,eAAe;CAMnB"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { FootprintError } from './base-error.js';
|
|
2
|
-
/**
|
|
3
|
-
* Validation error for invalid user input
|
|
4
|
-
* HTTP status code: 400 (Bad Request)
|
|
5
|
-
*/
|
|
6
|
-
export class ValidationError extends FootprintError {
|
|
7
|
-
constructor(message, context) {
|
|
8
|
-
super(message, 'VALIDATION_ERROR', 400, context);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Create a validation error for empty/missing required fields
|
|
12
|
-
*/
|
|
13
|
-
static required(field) {
|
|
14
|
-
return new ValidationError(`${field} is required`, { field });
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Create a validation error for invalid format
|
|
18
|
-
*/
|
|
19
|
-
static invalidFormat(field, expectedFormat) {
|
|
20
|
-
return new ValidationError(`${field} has invalid format, expected: ${expectedFormat}`, { field, expectedFormat });
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Create a validation error for out of range values
|
|
24
|
-
*/
|
|
25
|
-
static outOfRange(field, value, min, max) {
|
|
26
|
-
return new ValidationError(`${field} is out of range (value: ${value}, min: ${min}, max: ${max})`, { field, value, min, max });
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=validation-error.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validation-error.js","sourceRoot":"","sources":["../../../../src/lib/errors/validation-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,cAAc;IACjD,YAAY,OAAe,EAAE,OAAiC;QAC5D,KAAK,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAa;QAC3B,OAAO,IAAI,eAAe,CAAC,GAAG,KAAK,cAAc,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,KAAa,EAAE,cAAsB;QACxD,OAAO,IAAI,eAAe,CACxB,GAAG,KAAK,kCAAkC,cAAc,EAAE,EAC1D,EAAE,KAAK,EAAE,cAAc,EAAE,CAC1B,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CACf,KAAa,EACb,KAAa,EACb,GAAY,EACZ,GAAY;QAEZ,OAAO,IAAI,eAAe,CACxB,GAAG,KAAK,4BAA4B,KAAK,UAAU,GAAG,UAAU,GAAG,GAAG,EACtE,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,CAC3B,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Test Helper Utilities for Footprint Server
|
|
3
|
-
*/
|
|
4
|
-
import type { FootprintServer } from './index.js';
|
|
5
|
-
export interface ToolInfo {
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
}
|
|
9
|
-
export interface ResourceInfo {
|
|
10
|
-
name: string;
|
|
11
|
-
uriTemplate: string;
|
|
12
|
-
description: string;
|
|
13
|
-
mimeType: string;
|
|
14
|
-
}
|
|
15
|
-
export declare class FootprintTestHelpers {
|
|
16
|
-
private server;
|
|
17
|
-
constructor(server: FootprintServer);
|
|
18
|
-
private getServerInternal;
|
|
19
|
-
getTools(): Promise<ToolInfo[]>;
|
|
20
|
-
getResources(): Promise<ResourceInfo[]>;
|
|
21
|
-
readResource(uri: string): Promise<{
|
|
22
|
-
contents: Array<{
|
|
23
|
-
uri: string;
|
|
24
|
-
mimeType: string;
|
|
25
|
-
text: string;
|
|
26
|
-
}>;
|
|
27
|
-
}>;
|
|
28
|
-
executeTool(toolName: string, params: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
29
|
-
callTool(name: string, params: Record<string, unknown>): Promise<{
|
|
30
|
-
structuredContent: Record<string, unknown>;
|
|
31
|
-
}>;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=test-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-helpers.d.ts","sourceRoot":"","sources":["../../src/test-helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAuDD,qBAAa,oBAAoB;IACnB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,eAAe;IAE3C,OAAO,CAAC,iBAAiB;IAInB,QAAQ,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAS/B,YAAY,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAiBvC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,KAAK,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC;IA0BxG,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAmBhG,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;QAAE,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;CAIvH"}
|
package/dist/src/test-helpers.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Test Helper Utilities for Footprint Server
|
|
3
|
-
*/
|
|
4
|
-
function getFromRegistry(registry, finder) {
|
|
5
|
-
if (!registry)
|
|
6
|
-
return null;
|
|
7
|
-
if (registry instanceof Map) {
|
|
8
|
-
for (const [key, value] of registry.entries()) {
|
|
9
|
-
const result = finder(key, value);
|
|
10
|
-
if (result)
|
|
11
|
-
return result;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
else if (Array.isArray(registry)) {
|
|
15
|
-
for (const item of registry) {
|
|
16
|
-
const result = finder(item.name, item);
|
|
17
|
-
if (result)
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
else if (typeof registry === 'object') {
|
|
22
|
-
for (const [key, value] of Object.entries(registry)) {
|
|
23
|
-
const result = finder(key, value);
|
|
24
|
-
if (result)
|
|
25
|
-
return result;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
function mapRegistry(registry, mapper) {
|
|
31
|
-
if (!registry)
|
|
32
|
-
return [];
|
|
33
|
-
if (registry instanceof Map) {
|
|
34
|
-
return Array.from(registry.entries()).map(([key, value]) => mapper(key, value));
|
|
35
|
-
}
|
|
36
|
-
if (Array.isArray(registry)) {
|
|
37
|
-
return registry.map((item) => mapper(item.name, item));
|
|
38
|
-
}
|
|
39
|
-
if (typeof registry === 'object') {
|
|
40
|
-
return Object.entries(registry).map(([key, value]) => mapper(key, value));
|
|
41
|
-
}
|
|
42
|
-
return [];
|
|
43
|
-
}
|
|
44
|
-
export class FootprintTestHelpers {
|
|
45
|
-
server;
|
|
46
|
-
constructor(server) {
|
|
47
|
-
this.server = server;
|
|
48
|
-
}
|
|
49
|
-
getServerInternal() {
|
|
50
|
-
return this.server;
|
|
51
|
-
}
|
|
52
|
-
async getTools() {
|
|
53
|
-
const tools = Reflect.get(this.getServerInternal().server, '_registeredTools');
|
|
54
|
-
return mapRegistry(tools, (name, tool) => ({
|
|
55
|
-
name,
|
|
56
|
-
description: (tool.description || tool.title)
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
async getResources() {
|
|
60
|
-
const templates = Reflect.get(this.getServerInternal().server, '_registeredResourceTemplates');
|
|
61
|
-
return mapRegistry(templates, (name, template) => ({
|
|
62
|
-
name,
|
|
63
|
-
uriTemplate: template.resourceTemplate?._uriTemplate?.template
|
|
64
|
-
|| template.uriTemplate
|
|
65
|
-
|| '',
|
|
66
|
-
description: template.metadata?.description
|
|
67
|
-
|| template.description
|
|
68
|
-
|| '',
|
|
69
|
-
mimeType: template.metadata?.mimeType
|
|
70
|
-
|| template.mimeType
|
|
71
|
-
|| 'text/plain'
|
|
72
|
-
}));
|
|
73
|
-
}
|
|
74
|
-
async readResource(uri) {
|
|
75
|
-
const templates = Reflect.get(this.getServerInternal().server, '_registeredResourceTemplates');
|
|
76
|
-
const match = uri.match(/^(\w+):\/\/(.+)$/);
|
|
77
|
-
if (!match) {
|
|
78
|
-
throw new Error('Unknown resource');
|
|
79
|
-
}
|
|
80
|
-
const [, resourceName, id] = match;
|
|
81
|
-
const handler = getFromRegistry(templates, (key, value) => key === resourceName ? value : null);
|
|
82
|
-
if (!handler) {
|
|
83
|
-
throw new Error('Unknown resource');
|
|
84
|
-
}
|
|
85
|
-
const handlerFn = handler.readCallback || handler.handler;
|
|
86
|
-
if (!handlerFn || typeof handlerFn !== 'function') {
|
|
87
|
-
throw new Error('Unknown resource');
|
|
88
|
-
}
|
|
89
|
-
return handlerFn({ href: uri }, { id });
|
|
90
|
-
}
|
|
91
|
-
async executeTool(toolName, params) {
|
|
92
|
-
const tools = Reflect.get(this.getServerInternal().server, '_registeredTools');
|
|
93
|
-
if (!tools) {
|
|
94
|
-
throw new Error('No tools registered');
|
|
95
|
-
}
|
|
96
|
-
const tool = getFromRegistry(tools, (key, value) => key === toolName ? value : null);
|
|
97
|
-
if (!tool || !tool.handler || typeof tool.handler !== 'function') {
|
|
98
|
-
throw new Error(`Tool ${toolName} not found`);
|
|
99
|
-
}
|
|
100
|
-
const result = await tool.handler(params);
|
|
101
|
-
return (result.structuredContent || result);
|
|
102
|
-
}
|
|
103
|
-
async callTool(name, params) {
|
|
104
|
-
const result = await this.executeTool(name, params);
|
|
105
|
-
return { structuredContent: result };
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=test-helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-helpers.js","sourceRoot":"","sources":["../../src/test-helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;A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AC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,QAAgB,EAAE,MAA+B;QACjE,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;QAE/E,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QAED,MAAM,IAAI,GAAG,eAAe,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CACjD,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAChC,CAAC;QAEF,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;YACjE,MAAM,IAAI,KAAK,CAAC,QAAQ,QAAQ,YAAY,CAAC,CAAC;QAChD,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC1C,OAAO,CAAC,MAAM,CAAC,iBAAiB,IAAI,MAAM,CAA4B,CAAC;IACzE,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,IAAY,EAAE,MAA+B;QAC1D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
import type { EvidenceDatabase } from "../lib/storage/index.js";
|
|
3
|
-
export declare const getTagStatsSchema: {
|
|
4
|
-
inputSchema: {};
|
|
5
|
-
outputSchema: {
|
|
6
|
-
tags: z.ZodArray<z.ZodObject<{
|
|
7
|
-
tag: z.ZodString;
|
|
8
|
-
count: z.ZodNumber;
|
|
9
|
-
}, "strip", z.ZodTypeAny, {
|
|
10
|
-
tag: string;
|
|
11
|
-
count: number;
|
|
12
|
-
}, {
|
|
13
|
-
tag: string;
|
|
14
|
-
count: number;
|
|
15
|
-
}>, "many">;
|
|
16
|
-
totalTags: z.ZodNumber;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export declare const getTagStatsMetadata: {
|
|
20
|
-
title: string;
|
|
21
|
-
description: string;
|
|
22
|
-
};
|
|
23
|
-
export declare function createGetTagStatsHandler(db: EvidenceDatabase): (params: unknown) => Promise<import("../lib/tool-response.js").ToolResponse<{
|
|
24
|
-
tags: {
|
|
25
|
-
tag: string;
|
|
26
|
-
count: number;
|
|
27
|
-
}[];
|
|
28
|
-
totalTags: number;
|
|
29
|
-
}>>;
|
|
30
|
-
//# sourceMappingURL=get-tag-stats.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-tag-stats.d.ts","sourceRoot":"","sources":["../../../src/tools/get-tag-stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;CAW7B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;CAG/B,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,gBAAgB;;;;;;IAqB5D"}
|