@kya-os/mcp-i 1.12.0 → 1.12.2
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/README.md +7 -9
- package/dist/runtime/adapter-express.js +3 -3
- package/dist/runtime/adapter-nextjs.js +3 -3
- package/dist/runtime/http.js +3 -3
- package/dist/runtime/identity.d.ts +11 -0
- package/dist/runtime/identity.js +57 -8
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +3 -2
- package/dist/runtime/proof-batch-queue.d.ts +60 -6
- package/dist/runtime/proof-batch-queue.js +154 -21
- package/dist/runtime/stdio.js +3 -3
- package/dist/runtime/utils/tools.js +19 -2
- package/dist/test/examples/test-usage-example.d.ts +14 -14
- package/package.json +6 -6
|
@@ -107,7 +107,15 @@ async function initializeProofBatchQueue(debug) {
|
|
|
107
107
|
console.error(`[MCPI] Added AgentShield destination: ${destConfig.apiUrl}`);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
else if (destConfig.type === "kta") {
|
|
111
|
+
destinations.push(new proof_batch_queue_1.KTAProofDestination(destConfig.apiUrl, destConfig.apiKey));
|
|
112
|
+
if (debug) {
|
|
113
|
+
console.error(`[MCPI] Added KTA destination: ${destConfig.apiUrl}`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
console.warn(`[MCPI] Unsupported proof destination type "${destConfig.type}" - skipping`);
|
|
118
|
+
}
|
|
111
119
|
}
|
|
112
120
|
if (destinations.length === 0) {
|
|
113
121
|
if (debug) {
|
|
@@ -713,6 +721,8 @@ async function addToolsToServer(server, toolModules, identityConfig, clientMessa
|
|
|
713
721
|
const proof = await proofGen.generateProof(toolRequest, toolResponse, proofSession, {
|
|
714
722
|
scopeId, // Pass scopeId for tool auto-discovery
|
|
715
723
|
clientDid: session?.clientDid,
|
|
724
|
+
toolName: name,
|
|
725
|
+
submissionOutcome: "success",
|
|
716
726
|
});
|
|
717
727
|
if (identityConfig?.debug) {
|
|
718
728
|
console.error(`[MCPI] Generated proof for tool "${name}" - DID: ${proof.meta.did}`);
|
|
@@ -720,7 +730,14 @@ async function addToolsToServer(server, toolModules, identityConfig, clientMessa
|
|
|
720
730
|
// Submit proof to ProofBatchQueue (if initialized)
|
|
721
731
|
if (globalProofQueue) {
|
|
722
732
|
try {
|
|
723
|
-
globalProofQueue.enqueue(
|
|
733
|
+
globalProofQueue.enqueue({
|
|
734
|
+
proof,
|
|
735
|
+
toolName: name,
|
|
736
|
+
// Derive from the signed proof metadata so the
|
|
737
|
+
// submitted value can never diverge from what the
|
|
738
|
+
// server's verifier checks against the JWS payload.
|
|
739
|
+
outcome: proof.meta.submissionOutcome ?? "success",
|
|
740
|
+
});
|
|
724
741
|
if (identityConfig?.debug) {
|
|
725
742
|
console.error(`[MCPI] Proof enqueued for submission to AgentShield`);
|
|
726
743
|
}
|
|
@@ -19,6 +19,13 @@ export declare function exampleMockIdentityProvider(): MockIdentityProvider;
|
|
|
19
19
|
export declare function exampleProofTesting(): Promise<{
|
|
20
20
|
valid: boolean;
|
|
21
21
|
warnings: string[];
|
|
22
|
+
proof: {
|
|
23
|
+
valid: boolean;
|
|
24
|
+
structure: boolean;
|
|
25
|
+
timestamps: boolean;
|
|
26
|
+
hashes: boolean;
|
|
27
|
+
error?: string | undefined;
|
|
28
|
+
};
|
|
22
29
|
session: {
|
|
23
30
|
valid: boolean;
|
|
24
31
|
expired: boolean;
|
|
@@ -29,13 +36,6 @@ export declare function exampleProofTesting(): Promise<{
|
|
|
29
36
|
algorithm: string;
|
|
30
37
|
error?: string | undefined;
|
|
31
38
|
};
|
|
32
|
-
proof: {
|
|
33
|
-
valid: boolean;
|
|
34
|
-
structure: boolean;
|
|
35
|
-
timestamps: boolean;
|
|
36
|
-
hashes: boolean;
|
|
37
|
-
error?: string | undefined;
|
|
38
|
-
};
|
|
39
39
|
errors: string[];
|
|
40
40
|
did?: string | undefined;
|
|
41
41
|
kid?: string | undefined;
|
|
@@ -85,6 +85,13 @@ export declare function exampleCompleteTestScenario(): Promise<{
|
|
|
85
85
|
proofResult: {
|
|
86
86
|
valid: boolean;
|
|
87
87
|
warnings: string[];
|
|
88
|
+
proof: {
|
|
89
|
+
valid: boolean;
|
|
90
|
+
structure: boolean;
|
|
91
|
+
timestamps: boolean;
|
|
92
|
+
hashes: boolean;
|
|
93
|
+
error?: string | undefined;
|
|
94
|
+
};
|
|
88
95
|
session: {
|
|
89
96
|
valid: boolean;
|
|
90
97
|
expired: boolean;
|
|
@@ -95,13 +102,6 @@ export declare function exampleCompleteTestScenario(): Promise<{
|
|
|
95
102
|
algorithm: string;
|
|
96
103
|
error?: string | undefined;
|
|
97
104
|
};
|
|
98
|
-
proof: {
|
|
99
|
-
valid: boolean;
|
|
100
|
-
structure: boolean;
|
|
101
|
-
timestamps: boolean;
|
|
102
|
-
hashes: boolean;
|
|
103
|
-
error?: string | undefined;
|
|
104
|
-
};
|
|
105
105
|
errors: string[];
|
|
106
106
|
did?: string | undefined;
|
|
107
107
|
kid?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kya-os/mcp-i",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.2",
|
|
4
4
|
"description": "The TypeScript MCP framework with identity features built-in",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"model-context-protocol"
|
|
64
64
|
],
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@kya-os/contracts": "^1.
|
|
67
|
-
"@kya-os/mcp-i-core": "^1.9.
|
|
68
|
-
"@kya-os/mcp-i-runtime": "^1.2.
|
|
66
|
+
"@kya-os/contracts": "^1.12.1",
|
|
67
|
+
"@kya-os/mcp-i-core": "^1.9.2",
|
|
68
|
+
"@kya-os/mcp-i-runtime": "^1.2.4",
|
|
69
69
|
"@modelcontextprotocol/sdk": "^1.11.4",
|
|
70
70
|
"@swc/core": "^1.15.11",
|
|
71
71
|
"@types/express": "^5.0.6",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"glob": "^13.0.3",
|
|
89
89
|
"handlebars": "^4.7.9",
|
|
90
90
|
"jose": "^5.2.0",
|
|
91
|
-
"json-canonicalize": "
|
|
91
|
+
"json-canonicalize": "2.0.0",
|
|
92
92
|
"json5": "^2.2.3",
|
|
93
93
|
"jsonwebtoken": "^9.0.3",
|
|
94
94
|
"memfs": "^4.17.2",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"node": ">=20.0.0"
|
|
126
126
|
},
|
|
127
127
|
"peerDependencies": {
|
|
128
|
-
"json-canonicalize": "
|
|
128
|
+
"json-canonicalize": "2.0.0",
|
|
129
129
|
"swc-loader": "^0.2.6",
|
|
130
130
|
"zod": "^3.25.76"
|
|
131
131
|
},
|