@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
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
import { wrapToolHandler } from "../lib/tool-wrapper.js";
|
|
3
|
-
import { createToolResponse } from "../lib/tool-response.js";
|
|
4
|
-
export const getTagStatsSchema = {
|
|
5
|
-
inputSchema: {},
|
|
6
|
-
outputSchema: {
|
|
7
|
-
tags: z.array(z.object({
|
|
8
|
-
tag: z.string(),
|
|
9
|
-
count: z.number(),
|
|
10
|
-
})),
|
|
11
|
-
totalTags: z.number(),
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
export const getTagStatsMetadata = {
|
|
15
|
-
title: "Get Tag Statistics",
|
|
16
|
-
description: "Get all unique tags with their usage counts",
|
|
17
|
-
};
|
|
18
|
-
export function createGetTagStatsHandler(db) {
|
|
19
|
-
return wrapToolHandler("get-tag-stats", "Check database connectivity.", async () => {
|
|
20
|
-
const tagCounts = db.getTagCounts();
|
|
21
|
-
const tags = Array.from(tagCounts.entries())
|
|
22
|
-
.map(([tag, count]) => ({ tag, count }))
|
|
23
|
-
.sort((a, b) => b.count - a.count);
|
|
24
|
-
const resultText = tags.length > 0
|
|
25
|
-
? `📊 Tag Statistics:\n${tags.map((t) => ` • ${t.tag}: ${t.count}`).join("\n")}`
|
|
26
|
-
: `📊 No tags found in any footprint records`;
|
|
27
|
-
return createToolResponse(resultText, {
|
|
28
|
-
tags,
|
|
29
|
-
totalTags: tags.length,
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=get-tag-stats.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-tag-stats.js","sourceRoot":"","sources":["../../../src/tools/get-tag-stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,WAAW,EAAE,EAAE;IACf,YAAY,EAAE;QACZ,IAAI,EAAE,CAAC,CAAC,KAAK,CACX,CAAC,CAAC,MAAM,CAAC;YACP,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;YACf,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;SAClB,CAAC,CACH;QACD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;KACtB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EAAE,6CAA6C;CAC3D,CAAC;AAEF,MAAM,UAAU,wBAAwB,CAAC,EAAoB;IAC3D,OAAO,eAAe,CACpB,eAAe,EACf,8BAA8B,EAC9B,KAAK,IAAI,EAAE;QACT,MAAM,SAAS,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;aACzC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;aACvC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QAErC,MAAM,UAAU,GACd,IAAI,CAAC,MAAM,GAAG,CAAC;YACb,CAAC,CAAC,uBAAuB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACjF,CAAC,CAAC,2CAA2C,CAAC;QAElD,OAAO,kBAAkB,CAAC,UAAU,EAAE;YACpC,IAAI;YACJ,SAAS,EAAE,IAAI,CAAC,MAAM;SACvB,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
import type { EvidenceDatabase } from "../lib/storage/index.js";
|
|
3
|
-
export declare const removeTagSchema: {
|
|
4
|
-
inputSchema: {
|
|
5
|
-
tag: z.ZodString;
|
|
6
|
-
};
|
|
7
|
-
outputSchema: {
|
|
8
|
-
updatedCount: z.ZodNumber;
|
|
9
|
-
success: z.ZodBoolean;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export declare const removeTagMetadata: {
|
|
13
|
-
title: string;
|
|
14
|
-
description: string;
|
|
15
|
-
};
|
|
16
|
-
export declare function createRemoveTagHandler(db: EvidenceDatabase): (params: {
|
|
17
|
-
tag: string;
|
|
18
|
-
}) => Promise<import("../lib/tool-response.js").ToolResponse<{
|
|
19
|
-
updatedCount: number;
|
|
20
|
-
success: boolean;
|
|
21
|
-
}>>;
|
|
22
|
-
//# sourceMappingURL=remove-tag.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-tag.d.ts","sourceRoot":"","sources":["../../../src/tools/remove-tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,eAAO,MAAM,eAAe;;;;;;;;CAQ3B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;CAG7B,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,gBAAgB;SAIjC,MAAM;;;;IAe/B"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
import { wrapToolHandler } from "../lib/tool-wrapper.js";
|
|
3
|
-
import { createToolResponse } from "../lib/tool-response.js";
|
|
4
|
-
export const removeTagSchema = {
|
|
5
|
-
inputSchema: {
|
|
6
|
-
tag: z.string().min(1).describe("Tag name to remove"),
|
|
7
|
-
},
|
|
8
|
-
outputSchema: {
|
|
9
|
-
updatedCount: z.number(),
|
|
10
|
-
success: z.boolean(),
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
export const removeTagMetadata = {
|
|
14
|
-
title: "Remove Tag",
|
|
15
|
-
description: "Remove a tag from all footprint records",
|
|
16
|
-
};
|
|
17
|
-
export function createRemoveTagHandler(db) {
|
|
18
|
-
return wrapToolHandler("remove-tag", "Ensure tag name is valid.", async (params) => {
|
|
19
|
-
if (!params.tag) {
|
|
20
|
-
throw new Error("Tag name is required");
|
|
21
|
-
}
|
|
22
|
-
const updatedCount = db.removeTag(params.tag.trim());
|
|
23
|
-
const success = updatedCount > 0;
|
|
24
|
-
const resultText = success
|
|
25
|
-
? `🗑️ Removed tag "${params.tag}" from ${updatedCount} footprint record${updatedCount > 1 ? "s" : ""}`
|
|
26
|
-
: `⚠️ No footprint records found with tag "${params.tag}"`;
|
|
27
|
-
return createToolResponse(resultText, { updatedCount, success });
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=remove-tag.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-tag.js","sourceRoot":"","sources":["../../../src/tools/remove-tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,WAAW,EAAE;QACX,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC;KACtD;IACD,YAAY,EAAE;QACZ,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;QACxB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;KACrB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,yCAAyC;CACvD,CAAC;AAEF,MAAM,UAAU,sBAAsB,CAAC,EAAoB;IACzD,OAAO,eAAe,CACpB,YAAY,EACZ,2BAA2B,EAC3B,KAAK,EAAE,MAAuB,EAAE,EAAE;QAChC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC1C,CAAC;QAED,MAAM,YAAY,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QACrD,MAAM,OAAO,GAAG,YAAY,GAAG,CAAC,CAAC;QAEjC,MAAM,UAAU,GAAG,OAAO;YACxB,CAAC,CAAC,oBAAoB,MAAM,CAAC,GAAG,UAAU,YAAY,oBAAoB,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACvG,CAAC,CAAC,2CAA2C,MAAM,CAAC,GAAG,GAAG,CAAC;QAE7D,OAAO,kBAAkB,CAAC,UAAU,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
import type { EvidenceDatabase } from "../lib/storage/index.js";
|
|
3
|
-
export declare const renameTagSchema: {
|
|
4
|
-
inputSchema: {
|
|
5
|
-
oldTag: z.ZodString;
|
|
6
|
-
newTag: z.ZodString;
|
|
7
|
-
};
|
|
8
|
-
outputSchema: {
|
|
9
|
-
updatedCount: z.ZodNumber;
|
|
10
|
-
success: z.ZodBoolean;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export declare const renameTagMetadata: {
|
|
14
|
-
title: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
export declare function createRenameTagHandler(db: EvidenceDatabase): (params: {
|
|
18
|
-
oldTag: string;
|
|
19
|
-
newTag: string;
|
|
20
|
-
}) => Promise<import("../lib/tool-response.js").ToolResponse<{
|
|
21
|
-
updatedCount: number;
|
|
22
|
-
success: boolean;
|
|
23
|
-
}>>;
|
|
24
|
-
//# sourceMappingURL=rename-tag.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rename-tag.d.ts","sourceRoot":"","sources":["../../../src/tools/rename-tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,eAAO,MAAM,eAAe;;;;;;;;;CAS3B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;CAG7B,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,gBAAgB;YAI9B,MAAM;YAAU,MAAM;;;;IAsBlD"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
import { wrapToolHandler } from "../lib/tool-wrapper.js";
|
|
3
|
-
import { createToolResponse } from "../lib/tool-response.js";
|
|
4
|
-
export const renameTagSchema = {
|
|
5
|
-
inputSchema: {
|
|
6
|
-
oldTag: z.string().min(1).describe("Current tag name to rename"),
|
|
7
|
-
newTag: z.string().min(1).describe("New tag name"),
|
|
8
|
-
},
|
|
9
|
-
outputSchema: {
|
|
10
|
-
updatedCount: z.number(),
|
|
11
|
-
success: z.boolean(),
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
export const renameTagMetadata = {
|
|
15
|
-
title: "Rename Tag",
|
|
16
|
-
description: "Rename a tag across all footprint records",
|
|
17
|
-
};
|
|
18
|
-
export function createRenameTagHandler(db) {
|
|
19
|
-
return wrapToolHandler("rename-tag", "Ensure tag names are valid and different.", async (params) => {
|
|
20
|
-
if (!params.oldTag || !params.newTag) {
|
|
21
|
-
throw new Error("Both old and new tag names are required");
|
|
22
|
-
}
|
|
23
|
-
if (params.oldTag.trim() === params.newTag.trim()) {
|
|
24
|
-
throw new Error("New tag must be different from old tag");
|
|
25
|
-
}
|
|
26
|
-
const updatedCount = db.renameTag(params.oldTag.trim(), params.newTag.trim());
|
|
27
|
-
const success = updatedCount > 0;
|
|
28
|
-
const resultText = success
|
|
29
|
-
? `🏷️ Renamed tag "${params.oldTag}" to "${params.newTag}" in ${updatedCount} footprint record${updatedCount > 1 ? "s" : ""}`
|
|
30
|
-
: `⚠️ No footprint records found with tag "${params.oldTag}"`;
|
|
31
|
-
return createToolResponse(resultText, { updatedCount, success });
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=rename-tag.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rename-tag.js","sourceRoot":"","sources":["../../../src/tools/rename-tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,WAAW,EAAE;QACX,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,4BAA4B,CAAC;QAChE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC;KACnD;IACD,YAAY,EAAE;QACZ,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;QACxB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;KACrB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,2CAA2C;CACzD,CAAC;AAEF,MAAM,UAAU,sBAAsB,CAAC,EAAoB;IACzD,OAAO,eAAe,CACpB,YAAY,EACZ,2CAA2C,EAC3C,KAAK,EAAE,MAA0C,EAAE,EAAE;QACnD,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC7D,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;YAClD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC5D,CAAC;QAED,MAAM,YAAY,GAAG,EAAE,CAAC,SAAS,CAC/B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EACpB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CACrB,CAAC;QACF,MAAM,OAAO,GAAG,YAAY,GAAG,CAAC,CAAC;QAEjC,MAAM,UAAU,GAAG,OAAO;YACxB,CAAC,CAAC,oBAAoB,MAAM,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,QAAQ,YAAY,oBAAoB,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YAC9H,CAAC,CAAC,2CAA2C,MAAM,CAAC,MAAM,GAAG,CAAC;QAEhE,OAAO,kBAAkB,CAAC,UAAU,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-handling.test.d.ts","sourceRoot":"","sources":["../../tests/error-handling.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
2
|
-
import { FootprintServer, FootprintTestHelpers } from '../src/index.js';
|
|
3
|
-
import * as fs from 'fs';
|
|
4
|
-
import * as path from 'path';
|
|
5
|
-
describe('Error Handling & Edge Cases', () => {
|
|
6
|
-
let server;
|
|
7
|
-
let helpers;
|
|
8
|
-
const testDbPath = path.join(process.cwd(), `test-edge-cases-${Date.now()}-${Math.random().toString(36).substring(7)}.db`);
|
|
9
|
-
const testPassword = 'edge-case-password';
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
if (fs.existsSync(testDbPath)) {
|
|
12
|
-
fs.unlinkSync(testDbPath);
|
|
13
|
-
}
|
|
14
|
-
const config = {
|
|
15
|
-
dbPath: testDbPath,
|
|
16
|
-
password: testPassword
|
|
17
|
-
};
|
|
18
|
-
server = new FootprintServer(config);
|
|
19
|
-
helpers = new FootprintTestHelpers(server);
|
|
20
|
-
});
|
|
21
|
-
afterEach(() => {
|
|
22
|
-
if (fs.existsSync(testDbPath)) {
|
|
23
|
-
fs.unlinkSync(testDbPath);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
describe('Input Validation', () => {
|
|
27
|
-
it('should reject empty conversation content', async () => {
|
|
28
|
-
await expect(helpers.callTool('capture-footprint', {
|
|
29
|
-
conversationId: 'conv-1',
|
|
30
|
-
llmProvider: 'Claude',
|
|
31
|
-
content: '',
|
|
32
|
-
messageCount: 0
|
|
33
|
-
})).rejects.toThrow();
|
|
34
|
-
});
|
|
35
|
-
it('should reject negative message count', async () => {
|
|
36
|
-
await expect(helpers.callTool('capture-footprint', {
|
|
37
|
-
conversationId: 'conv-1',
|
|
38
|
-
llmProvider: 'Claude',
|
|
39
|
-
content: 'test',
|
|
40
|
-
messageCount: -1
|
|
41
|
-
})).rejects.toThrow();
|
|
42
|
-
});
|
|
43
|
-
it('should reject invalid pagination parameters', async () => {
|
|
44
|
-
await expect(helpers.callTool('list-footprints', { limit: -1 })).rejects.toThrow();
|
|
45
|
-
await expect(helpers.callTool('list-footprints', { offset: -5 })).rejects.toThrow();
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
describe('Large Content Handling', () => {
|
|
49
|
-
it('should handle large conversation content (>1MB)', async () => {
|
|
50
|
-
const largeContent = 'x'.repeat(2 * 1024 * 1024); // 2MB
|
|
51
|
-
const result = await helpers.callTool('capture-footprint', {
|
|
52
|
-
conversationId: 'large-conv',
|
|
53
|
-
llmProvider: 'Claude',
|
|
54
|
-
content: largeContent,
|
|
55
|
-
messageCount: 100
|
|
56
|
-
});
|
|
57
|
-
expect(result.structuredContent.success).toBe(true);
|
|
58
|
-
// Verify retrieval
|
|
59
|
-
const retrieved = await helpers.callTool('get-footprint', {
|
|
60
|
-
id: result.structuredContent.id
|
|
61
|
-
});
|
|
62
|
-
expect(retrieved.structuredContent.content).toBe(largeContent);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
describe('Special Characters', () => {
|
|
66
|
-
it('should handle UTF-8, emoji, and special characters', async () => {
|
|
67
|
-
const specialContent = '你好 🔐 测试 \n\t Special: <>&"\'';
|
|
68
|
-
const result = await helpers.callTool('capture-footprint', {
|
|
69
|
-
conversationId: 'special-conv',
|
|
70
|
-
llmProvider: 'Claude Sonnet 4.5',
|
|
71
|
-
content: specialContent,
|
|
72
|
-
messageCount: 1,
|
|
73
|
-
tags: 'emoji-✨,中文-测试'
|
|
74
|
-
});
|
|
75
|
-
const retrieved = await helpers.callTool('get-footprint', {
|
|
76
|
-
id: result.structuredContent.id
|
|
77
|
-
});
|
|
78
|
-
expect(retrieved.structuredContent.content).toBe(specialContent);
|
|
79
|
-
expect(retrieved.structuredContent.tags).toBe('emoji-✨,中文-测试');
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
describe('Database Errors', () => {
|
|
83
|
-
it('should handle database corruption gracefully', async () => {
|
|
84
|
-
// Corrupt database by writing garbage
|
|
85
|
-
fs.writeFileSync(testDbPath, 'CORRUPTED_DATA');
|
|
86
|
-
// Also remove WAL files if they exist (WAL mode creates these)
|
|
87
|
-
const walPath = `${testDbPath}-wal`;
|
|
88
|
-
const shmPath = `${testDbPath}-shm`;
|
|
89
|
-
if (fs.existsSync(walPath))
|
|
90
|
-
fs.unlinkSync(walPath);
|
|
91
|
-
if (fs.existsSync(shmPath))
|
|
92
|
-
fs.unlinkSync(shmPath);
|
|
93
|
-
// Create new server instance (should fail gracefully)
|
|
94
|
-
expect(() => {
|
|
95
|
-
new FootprintServer({
|
|
96
|
-
dbPath: testDbPath,
|
|
97
|
-
password: testPassword
|
|
98
|
-
});
|
|
99
|
-
}).toThrow();
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
describe('Empty Database', () => {
|
|
103
|
-
it('should handle empty database correctly', async () => {
|
|
104
|
-
const result = await helpers.callTool('list-footprints', {});
|
|
105
|
-
expect(result.structuredContent.total).toBe(0);
|
|
106
|
-
expect(result.structuredContent.footprints).toEqual([]);
|
|
107
|
-
});
|
|
108
|
-
it('should handle export of empty database', async () => {
|
|
109
|
-
const result = await helpers.callTool('export-footprints', {});
|
|
110
|
-
expect(result.structuredContent.footprintCount).toBe(0);
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
//# sourceMappingURL=error-handling.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-handling.test.js","sourceRoot":"","sources":["../../tests/error-handling.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAExE,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,IAAI,MAAuB,CAAC;IAC5B,IAAI,OAA6B,CAAC;IAClC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,mBAAmB,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC3H,MAAM,YAAY,GAAG,oBAAoB,CAAC;IAE1C,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC9B,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAC5B,CAAC;QAED,MAAM,MAAM,GAAiB;YAC3B,MAAM,EAAE,UA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AM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;YAE7D,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC/C,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;YACtD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;YAE/D,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/tests/fixtures.d.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Test fixtures and utilities for Footprint MCP Server tests
|
|
3
|
-
* Provides shared setup, teardown, and test data generation
|
|
4
|
-
*/
|
|
5
|
-
import { FootprintServer, FootprintTestHelpers } from "../src/index.js";
|
|
6
|
-
/**
|
|
7
|
-
* Test environment setup result
|
|
8
|
-
*/
|
|
9
|
-
export interface TestEnvironment {
|
|
10
|
-
server: FootprintServer;
|
|
11
|
-
helpers: FootprintTestHelpers;
|
|
12
|
-
testDbPath: string;
|
|
13
|
-
tempDir: string;
|
|
14
|
-
testPassword: string;
|
|
15
|
-
cleanup: () => void;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Create a test environment with temporary database
|
|
19
|
-
*
|
|
20
|
-
* @param password - Optional custom password (default: 'test-password-123')
|
|
21
|
-
* @returns Test environment with server, helpers, and cleanup function
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```typescript
|
|
25
|
-
* const env = createTestEnvironment();
|
|
26
|
-
* // ... use env.server, env.helpers
|
|
27
|
-
* env.cleanup(); // Clean up when done
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
export declare function createTestEnvironment(password?: string): TestEnvironment;
|
|
31
|
-
/**
|
|
32
|
-
* Sample conversation content for testing
|
|
33
|
-
*/
|
|
34
|
-
export declare const SAMPLE_CONVERSATION: {
|
|
35
|
-
basic: string;
|
|
36
|
-
withIP: string;
|
|
37
|
-
withLegal: string;
|
|
38
|
-
withBusiness: string;
|
|
39
|
-
withResearch: string;
|
|
40
|
-
withCompliance: string;
|
|
41
|
-
casual: string;
|
|
42
|
-
multiKeyword: string;
|
|
43
|
-
large: string;
|
|
44
|
-
withSpecialChars: string;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Sample evidence parameters for testing capture-footprint
|
|
48
|
-
*/
|
|
49
|
-
export declare function createSampleEvidence(overrides?: {
|
|
50
|
-
conversationId?: string;
|
|
51
|
-
llmProvider?: string;
|
|
52
|
-
content?: string;
|
|
53
|
-
messageCount?: number;
|
|
54
|
-
tags?: string;
|
|
55
|
-
}): {
|
|
56
|
-
conversationId: string;
|
|
57
|
-
llmProvider: string;
|
|
58
|
-
content: string;
|
|
59
|
-
messageCount: number;
|
|
60
|
-
tags: string;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Create multiple sample evidences for batch testing
|
|
64
|
-
*
|
|
65
|
-
* @param count - Number of evidences to create
|
|
66
|
-
* @returns Array of evidence parameters
|
|
67
|
-
*/
|
|
68
|
-
export declare function createMultipleSampleEvidences(count: number): {
|
|
69
|
-
conversationId: string;
|
|
70
|
-
llmProvider: string;
|
|
71
|
-
content: string;
|
|
72
|
-
messageCount: number;
|
|
73
|
-
tags: string;
|
|
74
|
-
}[];
|
|
75
|
-
/**
|
|
76
|
-
* Wait for a condition to be true (useful for async operations)
|
|
77
|
-
*
|
|
78
|
-
* @param condition - Function that returns true when condition is met
|
|
79
|
-
* @param timeout - Maximum time to wait in milliseconds
|
|
80
|
-
* @param interval - Check interval in milliseconds
|
|
81
|
-
*/
|
|
82
|
-
export declare function waitFor(condition: () => boolean | Promise<boolean>, timeout?: number, interval?: number): Promise<void>;
|
|
83
|
-
/**
|
|
84
|
-
* Generate a random test database name
|
|
85
|
-
*/
|
|
86
|
-
export declare function generateTestDbName(prefix?: string): string;
|
|
87
|
-
//# sourceMappingURL=fixtures.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../tests/fixtures.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAMxE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,GAAE,MAA4B,GACrC,eAAe,CA4CjB;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;CAgB/B,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,CAAC,EAAE;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;;;;;;EAQA;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM;;;;;;IAQ1D;AAED;;;;;;GAMG;AACH,wBAAsB,OAAO,CAC3B,SAAS,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EAC3C,OAAO,GAAE,MAAa,EACtB,QAAQ,GAAE,MAAY,GACrB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,GAAE,MAAe,GAAG,MAAM,CAIlE"}
|
package/dist/tests/fixtures.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Test fixtures and utilities for Footprint MCP Server tests
|
|
3
|
-
* Provides shared setup, teardown, and test data generation
|
|
4
|
-
*/
|
|
5
|
-
import { FootprintServer, FootprintTestHelpers } from "../src/index.js";
|
|
6
|
-
import * as fs from "fs";
|
|
7
|
-
import * as path from "path";
|
|
8
|
-
import { tmpdir } from "node:os";
|
|
9
|
-
/**
|
|
10
|
-
* Create a test environment with temporary database
|
|
11
|
-
*
|
|
12
|
-
* @param password - Optional custom password (default: 'test-password-123')
|
|
13
|
-
* @returns Test environment with server, helpers, and cleanup function
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```typescript
|
|
17
|
-
* const env = createTestEnvironment();
|
|
18
|
-
* // ... use env.server, env.helpers
|
|
19
|
-
* env.cleanup(); // Clean up when done
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export function createTestEnvironment(password = "test-password-123") {
|
|
23
|
-
// Create unique temporary directory for each test
|
|
24
|
-
const tempDir = fs.mkdtempSync(path.join(tmpdir(), "footprint-mcp-test-"));
|
|
25
|
-
const testDbPath = path.join(tempDir, "test-footprint.db");
|
|
26
|
-
// Clean up any existing test database
|
|
27
|
-
if (fs.existsSync(testDbPath)) {
|
|
28
|
-
fs.unlinkSync(testDbPath);
|
|
29
|
-
}
|
|
30
|
-
const config = {
|
|
31
|
-
dbPath: testDbPath,
|
|
32
|
-
password,
|
|
33
|
-
};
|
|
34
|
-
const server = new FootprintServer(config);
|
|
35
|
-
const helpers = new FootprintTestHelpers(server);
|
|
36
|
-
const cleanup = () => {
|
|
37
|
-
try {
|
|
38
|
-
if (server) {
|
|
39
|
-
// Close any database connections if the server has them
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
// Ignore close errors
|
|
44
|
-
}
|
|
45
|
-
try {
|
|
46
|
-
if (tempDir && fs.existsSync(tempDir)) {
|
|
47
|
-
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
catch (error) {
|
|
51
|
-
// Ignore cleanup errors
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
return {
|
|
55
|
-
server,
|
|
56
|
-
helpers,
|
|
57
|
-
testDbPath,
|
|
58
|
-
tempDir,
|
|
59
|
-
testPassword: password,
|
|
60
|
-
cleanup,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Sample conversation content for testing
|
|
65
|
-
*/
|
|
66
|
-
export const SAMPLE_CONVERSATION = {
|
|
67
|
-
basic: "This is a test conversation about a project milestone.",
|
|
68
|
-
withIP: "We discussed the new algorithm for patent filing and proprietary technology.",
|
|
69
|
-
withLegal: "The contract terms and license agreement were reviewed by our legal team.",
|
|
70
|
-
withBusiness: "Strategic decision on the roadmap and approval of the budget.",
|
|
71
|
-
withResearch: "Our research findings and experiment data show promising results.",
|
|
72
|
-
withCompliance: "Audit requirements and documentation for compliance with regulations.",
|
|
73
|
-
casual: "Hey, how are you doing? The weather is nice today.",
|
|
74
|
-
multiKeyword: "Contract agreement for proprietary algorithm research with compliance requirements.",
|
|
75
|
-
large: "A".repeat(1024 * 1024 + 100), // >1MB content
|
|
76
|
-
withSpecialChars: "Test with UTF-8: 你好 🎉 and emoji 🚀",
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* Sample evidence parameters for testing capture-footprint
|
|
80
|
-
*/
|
|
81
|
-
export function createSampleEvidence(overrides) {
|
|
82
|
-
return {
|
|
83
|
-
conversationId: overrides?.conversationId || "test-conversation-001",
|
|
84
|
-
llmProvider: overrides?.llmProvider || "Claude Sonnet 4.5",
|
|
85
|
-
content: overrides?.content || SAMPLE_CONVERSATION.basic,
|
|
86
|
-
messageCount: overrides?.messageCount || 10,
|
|
87
|
-
tags: overrides?.tags || "test,milestone",
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Create multiple sample evidences for batch testing
|
|
92
|
-
*
|
|
93
|
-
* @param count - Number of evidences to create
|
|
94
|
-
* @returns Array of evidence parameters
|
|
95
|
-
*/
|
|
96
|
-
export function createMultipleSampleEvidences(count) {
|
|
97
|
-
return Array.from({ length: count }, (_, i) => ({
|
|
98
|
-
conversationId: `test-conversation-${String(i + 1).padStart(3, "0")}`,
|
|
99
|
-
llmProvider: i % 2 === 0 ? "Claude Sonnet 4.5" : "GPT-4",
|
|
100
|
-
content: `Test conversation content ${i + 1}`,
|
|
101
|
-
messageCount: (i + 1) * 5,
|
|
102
|
-
tags: i % 2 === 0 ? "test,even" : "test,odd",
|
|
103
|
-
}));
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Wait for a condition to be true (useful for async operations)
|
|
107
|
-
*
|
|
108
|
-
* @param condition - Function that returns true when condition is met
|
|
109
|
-
* @param timeout - Maximum time to wait in milliseconds
|
|
110
|
-
* @param interval - Check interval in milliseconds
|
|
111
|
-
*/
|
|
112
|
-
export async function waitFor(condition, timeout = 5000, interval = 100) {
|
|
113
|
-
const startTime = Date.now();
|
|
114
|
-
while (Date.now() - startTime < timeout) {
|
|
115
|
-
if (await condition()) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
await new Promise((resolve) => setTimeout(resolve, interval));
|
|
119
|
-
}
|
|
120
|
-
throw new Error(`Timeout waiting for condition after ${timeout}ms`);
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Generate a random test database name
|
|
124
|
-
*/
|
|
125
|
-
export function generateTestDbName(prefix = "test") {
|
|
126
|
-
const timestamp = Date.now();
|
|
127
|
-
const random = Math.random().toString(36).substring(7);
|
|
128
|
-
return `${prefix}-${timestamp}-${random}.db`;
|
|
129
|
-
}
|
|
130
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../tests/fixtures.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAExE,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAcjC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,qBAAqB,CACnC,WAAmB,mBAAmB;IAEtC,kDAAkD;IAClD,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAC3E,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;IAE3D,sCAAsC;IACtC,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9B,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC;IAED,MAAM,MAAM,GAAiB;QAC3B,MAAM,EAAE,UAAU;QAClB,QAAQ;KACT,CAAC;IAEF,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAEjD,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,IAAI,CAAC;YACH,IAAI,MAAM,EAAE,CAAC;gBACX,wDAAwD;YAC1D,CAAC;QACH,CA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GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACvD,OAAO,GAAG,MAAM,IAAI,SAAS,IAAI,MAAM,KAAK,CAAC;AAC/C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"integration.test.d.ts","sourceRoot":"","sources":["../../tests/integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
-
import { FootprintServer, FootprintTestHelpers } from "../src/index.js";
|
|
3
|
-
import * as fs from "fs";
|
|
4
|
-
import * as path from "path";
|
|
5
|
-
describe("TraceGuard MCP Server Integration", () => {
|
|
6
|
-
let server;
|
|
7
|
-
let helpers;
|
|
8
|
-
let testDbPath;
|
|
9
|
-
const testPassword = "integration-test-password";
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
// Use unique database path for each test to avoid conflicts
|
|
12
|
-
testDbPath = path.join(process.cwd(), `test-footprint-${Date.now()}-${Math.random().toString(36).substring(7)}.db`);
|
|
13
|
-
if (fs.existsSync(testDbPath)) {
|
|
14
|
-
fs.unlinkSync(testDbPath);
|
|
15
|
-
}
|
|
16
|
-
const config = {
|
|
17
|
-
dbPath: testDbPath,
|
|
18
|
-
password: testPassword,
|
|
19
|
-
};
|
|
20
|
-
server = new FootprintServer(config);
|
|
21
|
-
helpers = new FootprintTestHelpers(server);
|
|
22
|
-
});
|
|
23
|
-
afterEach(() => {
|
|
24
|
-
if (fs.existsSync(testDbPath)) {
|
|
25
|
-
fs.unlinkSync(testDbPath);
|
|
26
|
-
}
|
|
27
|
-
// Clean up exported files
|
|
28
|
-
const exports = fs
|
|
29
|
-
.readdirSync(".")
|
|
30
|
-
.filter((f) => f.startsWith("footprint-export-"));
|
|
31
|
-
exports.forEach((f) => fs.unlinkSync(f));
|
|
32
|
-
});
|
|
33
|
-
it("should complete full evidence lifecycle: capture → list → get → export", async () => {
|
|
34
|
-
// 1. Capture evidence
|
|
35
|
-
const captureResult = await helpers.callTool("capture-footprint", {
|
|
36
|
-
conversationId: "test-conv-001",
|
|
37
|
-
llmProvider: "Claude Sonnet 4.5",
|
|
38
|
-
content: "User: Hello\nAssistant: Hi! How can I help?",
|
|
39
|
-
messageCount: 2,
|
|
40
|
-
tags: "test,integration",
|
|
41
|
-
});
|
|
42
|
-
expect(captureResult.structuredContent).toMatchObject({
|
|
43
|
-
success: true,
|
|
44
|
-
id: expect.any(String),
|
|
45
|
-
});
|
|
46
|
-
const evidenceId = captureResult.structuredContent.id;
|
|
47
|
-
// 2. List evidences
|
|
48
|
-
const listResult = await helpers.callTool("list-footprints", {});
|
|
49
|
-
expect(listResult.structuredContent.total).toBe(1);
|
|
50
|
-
expect(listResult.structuredContent.footprints[0]).toMatchObject({
|
|
51
|
-
id: evidenceId,
|
|
52
|
-
conversationId: "test-conv-001",
|
|
53
|
-
llmProvider: "Claude Sonnet 4.5",
|
|
54
|
-
messageCount: 2,
|
|
55
|
-
});
|
|
56
|
-
// 3. Get evidence (decrypt)
|
|
57
|
-
const getResult = await helpers.callTool("get-footprint", {
|
|
58
|
-
id: evidenceId,
|
|
59
|
-
});
|
|
60
|
-
expect(getResult.structuredContent).toMatchObject({
|
|
61
|
-
id: evidenceId,
|
|
62
|
-
content: "User: Hello\nAssistant: Hi! How can I help?",
|
|
63
|
-
messageCount: 2,
|
|
64
|
-
});
|
|
65
|
-
// 4. Export evidences
|
|
66
|
-
const exportResult = await helpers.callTool("export-footprints", {
|
|
67
|
-
ids: [evidenceId],
|
|
68
|
-
includeGitInfo: true,
|
|
69
|
-
});
|
|
70
|
-
expect(exportResult.structuredContent).toMatchObject({
|
|
71
|
-
success: true,
|
|
72
|
-
footprintCount: 1,
|
|
73
|
-
filename: expect.stringMatching(/^footprint-export-/),
|
|
74
|
-
checksum: expect.stringMatching(/^[0-9a-f]{64}$/),
|
|
75
|
-
});
|
|
76
|
-
// Verify ZIP file created
|
|
77
|
-
expect(fs.existsSync(exportResult.structuredContent.filename)).toBe(true);
|
|
78
|
-
});
|
|
79
|
-
it("should handle multiple evidences correctly", async () => {
|
|
80
|
-
// Capture 3 evidences
|
|
81
|
-
const ids = [];
|
|
82
|
-
for (let i = 1; i <= 3; i++) {
|
|
83
|
-
const result = await helpers.callTool("capture-footprint", {
|
|
84
|
-
conversationId: `conv-${i}`,
|
|
85
|
-
llmProvider: "Claude Sonnet 4.5",
|
|
86
|
-
content: `Conversation ${i} content`,
|
|
87
|
-
messageCount: i,
|
|
88
|
-
});
|
|
89
|
-
ids.push(result.structuredContent.id);
|
|
90
|
-
}
|
|
91
|
-
// List with pagination
|
|
92
|
-
const page1 = await helpers.callTool("list-footprints", {
|
|
93
|
-
limit: 2,
|
|
94
|
-
offset: 0,
|
|
95
|
-
});
|
|
96
|
-
expect(page1.structuredContent.total).toBe(2);
|
|
97
|
-
const page2 = await helpers.callTool("list-footprints", {
|
|
98
|
-
limit: 2,
|
|
99
|
-
offset: 2,
|
|
100
|
-
});
|
|
101
|
-
expect(page2.structuredContent.total).toBe(1);
|
|
102
|
-
// Export subset
|
|
103
|
-
const exportResult = await helpers.callTool("export-footprints", {
|
|
104
|
-
ids: [ids[0], ids[2]],
|
|
105
|
-
});
|
|
106
|
-
expect(exportResult.structuredContent.footprintCount).toBe(2);
|
|
107
|
-
});
|
|
108
|
-
it("should handle errors gracefully", async () => {
|
|
109
|
-
// Try to get non-existent footprint
|
|
110
|
-
await expect(helpers.callTool("get-footprint", { id: "nonexistent-id" })).rejects.toThrow("Footprint not found");
|
|
111
|
-
// Try to export non-existent footprint
|
|
112
|
-
await expect(helpers.callTool("export-footprints", { ids: ["bad-id"] })).rejects.toThrow("Footprint IDs not found");
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
//# sourceMappingURL=integration.test.js.map
|