@kya-os/mcp-i-core 1.3.15 → 1.3.17
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.
|
@@ -33,6 +33,13 @@ export interface TokenUsageMetadata {
|
|
|
33
33
|
cookieFormat?: string;
|
|
34
34
|
/** Additional headers to include in API calls */
|
|
35
35
|
apiHeaders?: Record<string, string>;
|
|
36
|
+
/**
|
|
37
|
+
* User ID extracted from credential provider response
|
|
38
|
+
*
|
|
39
|
+
* For credential providers, this is the userId extracted via responseFields.userId.
|
|
40
|
+
* This is passed to tool handlers via ToolExecutionContext.userId.
|
|
41
|
+
*/
|
|
42
|
+
userId?: string;
|
|
36
43
|
}
|
|
37
44
|
/**
|
|
38
45
|
* Extended IdpTokens with usage metadata (CRED-003)
|
|
@@ -86,6 +86,7 @@ class ToolContextBuilder {
|
|
|
86
86
|
// CRED-003: Build headers based on tokenUsage
|
|
87
87
|
const idpHeaders = this.buildAuthHeaders(tokenData);
|
|
88
88
|
// Build context with token and headers
|
|
89
|
+
// Include userId from token metadata (extracted from credential provider response)
|
|
89
90
|
const context = {
|
|
90
91
|
idpToken: tokenData.access_token,
|
|
91
92
|
idpHeaders,
|
|
@@ -94,12 +95,15 @@ class ToolContextBuilder {
|
|
|
94
95
|
userDid,
|
|
95
96
|
sessionId,
|
|
96
97
|
delegationToken,
|
|
98
|
+
// CRED-003: Include userId from credential provider's extracted user ID
|
|
99
|
+
userId: tokenData.userId,
|
|
97
100
|
};
|
|
98
101
|
this.config.logger("[ToolContextBuilder] Context built successfully", {
|
|
99
102
|
toolName,
|
|
100
103
|
userDid: userDid.substring(0, 20) + "...",
|
|
101
104
|
provider,
|
|
102
105
|
hasToken: !!tokenData.access_token,
|
|
106
|
+
hasUserId: !!tokenData.userId,
|
|
103
107
|
tokenUsage: tokenData.tokenUsage,
|
|
104
108
|
headerKeys: Object.keys(idpHeaders),
|
|
105
109
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kya-os/mcp-i-core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.17",
|
|
4
4
|
"description": "Core runtime and types for MCP-I framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"prepublishOnly": "npm run build && node ../create-mcpi-app/scripts/validate-no-workspace.js"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@kya-os/contracts": "^1.6.
|
|
31
|
+
"@kya-os/contracts": "^1.6.10",
|
|
32
32
|
"jose": "^5.6.3",
|
|
33
33
|
"json-canonicalize": "^2.0.0",
|
|
34
34
|
"zod": "^3.25.76"
|