@kya-os/mcp-i 1.9.0 → 1.11.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/dist/227.js +1 -0
- package/dist/{263.js → 242.js} +1 -1
- package/dist/283.js +1 -0
- package/dist/317.js +1 -0
- package/dist/354.js +1 -0
- package/dist/361.js +1 -0
- package/dist/452.js +1 -0
- package/dist/533.js +1 -0
- package/dist/622.js +1 -0
- package/dist/65.js +1 -0
- package/dist/839.js +1 -0
- package/dist/843.js +1 -0
- package/dist/{644.js → 861.js} +1 -1
- package/dist/914.js +1 -0
- package/dist/95.js +1 -0
- package/dist/cli-adapter/index.js +1 -1
- package/dist/runtime/102.js +1 -0
- package/dist/runtime/adapter-express.js +3 -3
- package/dist/runtime/adapter-nextjs.js +5 -5
- package/dist/runtime/audit.d.ts +1 -1
- package/dist/runtime/debug.d.ts +1 -1
- package/dist/runtime/debug.js +3 -2
- package/dist/runtime/delegation-hooks.d.ts +1 -1
- package/dist/runtime/http.js +3 -3
- package/dist/runtime/identity.d.ts +4 -4
- package/dist/runtime/identity.js +4 -4
- package/dist/runtime/index.d.ts +6 -2
- package/dist/runtime/index.js +10 -2
- package/dist/runtime/mcpi-runtime.d.ts +9 -1
- package/dist/runtime/mcpi-runtime.js +20 -3
- package/dist/runtime/outbound-delegation.d.ts +5 -3
- package/dist/runtime/outbound-delegation.js +14 -8
- package/dist/runtime/outbound-identity-bridge.d.ts +40 -0
- package/dist/runtime/outbound-identity-bridge.js +114 -0
- package/dist/runtime/proof-batch-queue.d.ts +1 -1
- package/dist/runtime/request-context.d.ts +10 -0
- package/dist/runtime/request-context.js +4 -0
- package/dist/runtime/resume-token-store-kv.d.ts +44 -0
- package/dist/runtime/resume-token-store-kv.js +93 -0
- package/dist/runtime/resume-token-store.d.ts +30 -0
- package/dist/runtime/resume-token-store.js +46 -0
- package/dist/runtime/session.js +6 -0
- package/dist/runtime/stdio.js +3 -3
- package/dist/runtime/utils/tools.d.ts +1 -1
- package/dist/runtime/utils/tools.js +29 -7
- package/dist/runtime/well-known.d.ts +12 -1
- package/dist/runtime/well-known.js +13 -2
- package/package.json +7 -5
- package/dist/114.js +0 -1
- package/dist/139.js +0 -1
- package/dist/200.js +0 -1
- package/dist/202.js +0 -1
- package/dist/238.js +0 -1
- package/dist/294.js +0 -1
- package/dist/374.js +0 -1
- package/dist/529.js +0 -1
- package/dist/627.js +0 -1
- package/dist/669.js +0 -1
- package/dist/857.js +0 -1
- package/dist/997.js +0 -1
- package/dist/runtime/verifier-middleware.d.ts +0 -99
- package/dist/runtime/verifier-middleware.js +0 -416
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Resume Token Store Factory
|
|
4
|
+
*
|
|
5
|
+
* Selects a {@link ResumeTokenStore} implementation from config, mirroring the
|
|
6
|
+
* delegation-verifier factory (`createDelegationVerifier`). This replaces the
|
|
7
|
+
* hardcoded in-memory store in the runtime so consent→reuse can be made durable
|
|
8
|
+
* (Cloudflare KV) on multi-instance / serverless deployments, while keeping the
|
|
9
|
+
* in-memory store as an EXPLICIT single-process dev default.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.createResumeTokenStore = createResumeTokenStore;
|
|
13
|
+
const mcp_i_core_1 = require("@kya-os/mcp-i-core");
|
|
14
|
+
const resume_token_store_kv_1 = require("./resume-token-store-kv");
|
|
15
|
+
const DEFAULT_TTL_MS = 600_000;
|
|
16
|
+
function invalidConfig(message) {
|
|
17
|
+
const runtimeError = {
|
|
18
|
+
error: "invalid_config",
|
|
19
|
+
message,
|
|
20
|
+
httpStatus: 500,
|
|
21
|
+
};
|
|
22
|
+
const error = new Error(runtimeError.message);
|
|
23
|
+
Object.assign(error, runtimeError);
|
|
24
|
+
return error;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Create a resume-token store from config. Memory is an explicit opt-in for
|
|
28
|
+
* single-process development; durable stores must be selected deliberately.
|
|
29
|
+
*/
|
|
30
|
+
function createResumeTokenStore(config) {
|
|
31
|
+
const ttlMs = config.ttlMs ?? DEFAULT_TTL_MS;
|
|
32
|
+
switch (config.type) {
|
|
33
|
+
case "cloudflare-kv": {
|
|
34
|
+
if (!config.kvNamespace) {
|
|
35
|
+
throw invalidConfig("Resume token store 'cloudflare-kv' requires kvNamespace in config");
|
|
36
|
+
}
|
|
37
|
+
return new resume_token_store_kv_1.CloudflareKVResumeTokenStore(config.kvNamespace, ttlMs);
|
|
38
|
+
}
|
|
39
|
+
case "memory":
|
|
40
|
+
return new mcp_i_core_1.MemoryResumeTokenStore(ttlMs);
|
|
41
|
+
default: {
|
|
42
|
+
const configType = "type" in config ? config.type : "unknown";
|
|
43
|
+
throw invalidConfig(`Unknown resume token store type: ${configType}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
package/dist/runtime/session.js
CHANGED
|
@@ -14,6 +14,12 @@ const mcp_i_core_1 = require("@kya-os/mcp-i-core");
|
|
|
14
14
|
Object.defineProperty(exports, "createHandshakeRequest", { enumerable: true, get: function () { return mcp_i_core_1.createHandshakeRequest; } });
|
|
15
15
|
Object.defineProperty(exports, "validateHandshakeFormat", { enumerable: true, get: function () { return mcp_i_core_1.validateHandshakeFormat; } });
|
|
16
16
|
const mcp_i_core_2 = require("@kya-os/mcp-i-core");
|
|
17
|
+
// C2 (#2916): the CJS/ESM (TS1479) blocker is resolved — PR-0's loadDifCore()
|
|
18
|
+
// seam (mcp-i-core/src/runtime/dif-core.ts) reaches the ESM-only @kya-os/mcp from
|
|
19
|
+
// CJS. The SessionManager re-home stays deferred on the remaining blocker: DIF
|
|
20
|
+
// emits kyaos_* session IDs, a wire-format change owned by the C4 (#2918)
|
|
21
|
+
// dual-accept window. Keep importing the OLD SessionManager from @kya-os/mcp-i-core
|
|
22
|
+
// until then.
|
|
17
23
|
const node_providers_1 = require("../providers/node-providers");
|
|
18
24
|
function resolveNodeConfig(config) {
|
|
19
25
|
const skewEnv = process.env["XMCP_I_TS_SKEW_SEC"];
|