@kya-os/mcp-i 1.6.15 → 1.6.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.
- 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/session.d.ts +1 -0
- package/dist/runtime/session.js +9 -3
- package/dist/runtime/stdio.js +3 -3
- package/dist/runtime/transports/http/stateless-streamable-http.js +7 -0
- package/dist/test/deterministic-keys.d.ts +1 -0
- package/dist/test/deterministic-keys.js +9 -4
- package/package.json +3 -3
package/dist/runtime/session.js
CHANGED
|
@@ -141,11 +141,17 @@ class SessionManager {
|
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
143
|
* Generate a unique session ID
|
|
144
|
+
* Uses mcpi_{uuid} format for MCP protocol compliance and traceability
|
|
144
145
|
*/
|
|
145
146
|
generateSessionId() {
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
|
|
147
|
+
// Generate UUID v4 using crypto random bytes
|
|
148
|
+
const bytes = (0, crypto_1.randomBytes)(16);
|
|
149
|
+
// Set version (4) and variant (RFC4122)
|
|
150
|
+
bytes[6] = (bytes[6] & 0x0f) | 0x40;
|
|
151
|
+
bytes[8] = (bytes[8] & 0x3f) | 0x80;
|
|
152
|
+
const hex = bytes.toString("hex");
|
|
153
|
+
const uuid = `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20, 32)}`;
|
|
154
|
+
return `mcpi_${uuid}`;
|
|
149
155
|
}
|
|
150
156
|
/**
|
|
151
157
|
* Generate a deterministic client identifier when the client
|