@kya-os/mcp-i 1.12.4 → 1.13.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/README.md +9 -9
- package/dist/227.js +1 -1
- package/dist/283.js +1 -1
- package/dist/295.js +1 -1
- package/dist/317.js +1 -1
- package/dist/65.js +1 -1
- package/dist/843.js +1 -1
- package/dist/runtime/adapter-express.js +3 -3
- package/dist/runtime/adapter-nextjs.js +5 -5
- package/dist/runtime/{delegation-verifier-agentshield.d.ts → delegation-verifier-checkpoint.d.ts} +8 -13
- package/dist/runtime/{delegation-verifier-agentshield.js → delegation-verifier-checkpoint.js} +23 -103
- package/dist/runtime/delegation-verifier.d.ts +15 -7
- package/dist/runtime/delegation-verifier.js +6 -5
- package/dist/runtime/former-names.d.ts +20 -0
- package/dist/runtime/former-names.js +17 -0
- package/dist/runtime/http.js +2 -2
- package/dist/runtime/index.d.ts +4 -3
- package/dist/runtime/index.js +21 -5
- package/dist/runtime/mcpi-runtime.d.ts +7 -1
- package/dist/runtime/mcpi-runtime.js +6 -5
- package/dist/runtime/proof-batch-queue.d.ts +1 -1
- package/dist/runtime/proof-batch-queue.js +3 -3
- package/dist/runtime/stdio.js +3 -3
- package/dist/runtime/tool-protection.d.ts +7 -1
- package/dist/runtime/tool-protection.js +7 -6
- package/dist/runtime/utils/tools.js +3 -3
- package/package.json +3 -3
package/dist/runtime/index.d.ts
CHANGED
|
@@ -18,11 +18,12 @@ export { type AuthHandshakeConfig, type VerifyOrHintsResult, type AgentReputatio
|
|
|
18
18
|
export { createResumeTokenStore, type ResumeTokenStoreConfig, } from "./resume-token-store";
|
|
19
19
|
export { CloudflareKVResumeTokenStore, type ResumeTokenKVNamespace, } from "./resume-token-store-kv";
|
|
20
20
|
export { ensureOutboundIdentityBridge } from "./outbound-identity-bridge";
|
|
21
|
-
export { type ProofDestination, type ProofSubmission, type ProofBatchQueueConfig, ProofBatchQueue, KTAProofDestination,
|
|
21
|
+
export { type ProofDestination, type ProofSubmission, type ProofBatchQueueConfig, ProofBatchQueue, KTAProofDestination, CheckpointProofDestination, PartialProofSubmissionError, createProofBatchQueue, } from "./proof-batch-queue";
|
|
22
22
|
export { CloudflareKVDelegationVerifier, } from "./delegation-verifier-kv";
|
|
23
|
-
export {
|
|
23
|
+
export { CheckpointAPIDelegationVerifier, } from "./delegation-verifier-checkpoint";
|
|
24
24
|
export { MemoryDelegationVerifier, } from "./delegation-verifier-memory";
|
|
25
|
-
export { type ToolProtectionConfig, type ToolProtectionMap, type ToolProtectionConfigSource, ToolProtectionResolver, createToolProtectionResolver, InlineToolProtectionSource, FileToolProtectionSource,
|
|
25
|
+
export { type ToolProtectionConfig, type ToolProtectionMap, type ToolProtectionConfigSource, ToolProtectionResolver, createToolProtectionResolver, InlineToolProtectionSource, FileToolProtectionSource, CheckpointToolProtectionSource, } from "./tool-protection";
|
|
26
|
+
export * from "./former-names";
|
|
26
27
|
export { toolProtectionRegistry, isToolProtected, getToolProtection, } from "./tool-protection-registry";
|
|
27
28
|
export type { HandshakeRequest, SessionContext, NonceCache, NonceCacheEntry, NonceCacheConfig, } from "@kya-os/contracts/handshake";
|
|
28
29
|
export type { ProofMeta, DetachedProof, CanonicalHashes, AuditRecord, } from "@kya-os/mcp/types" with { "resolution-mode": "import" };
|
package/dist/runtime/index.js
CHANGED
|
@@ -5,8 +5,22 @@
|
|
|
5
5
|
* Identity-aware MCP runtime with proof generation, session management,
|
|
6
6
|
* canonical audit trails, and well-known endpoints.
|
|
7
7
|
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
8
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
23
|
+
exports.CheckpointToolProtectionSource = exports.FileToolProtectionSource = exports.InlineToolProtectionSource = exports.createToolProtectionResolver = exports.ToolProtectionResolver = exports.MemoryDelegationVerifier = exports.CheckpointAPIDelegationVerifier = exports.CloudflareKVDelegationVerifier = exports.createProofBatchQueue = exports.PartialProofSubmissionError = exports.CheckpointProofDestination = exports.KTAProofDestination = exports.ProofBatchQueue = exports.ensureOutboundIdentityBridge = exports.CloudflareKVResumeTokenStore = exports.createResumeTokenStore = exports.MemoryResumeTokenStore = exports.hasSensitiveScopes = exports.verifyOrHints = exports.extractScopes = exports.validateDelegation = exports.checkScopes = exports.createDelegationVerifier = exports.formatVerifyLink = exports.DemoConsole = exports.createDemoManager = exports.DemoManager = exports.createDebugEndpoint = exports.DebugManager = exports.extractDIDFromPath = exports.validateAgentDocument = exports.validateDIDDocument = exports.createWellKnownHandler = exports.WellKnownManager = exports.extractCanonicalData = exports.createProofResponse = exports.ProofGenerator = exports.validateHandshakeFormat = exports.createHandshakeRequest = exports.defaultSessionManager = exports.SessionManager = exports.IDENTITY_ERRORS = exports.ensureIdentity = exports.defaultIdentityManager = exports.IdentityManager = exports.RUNTIME_ERRORS = exports.RuntimeFactory = exports.createMCPIRuntime = exports.MCPIRuntime = exports.MCPINodeRuntimeWrapper = void 0;
|
|
10
24
|
exports.getToolProtection = exports.isToolProtected = exports.toolProtectionRegistry = void 0;
|
|
11
25
|
// Main runtime - Node.js implementation with providers
|
|
12
26
|
var mcpi_runtime_wrapper_1 = require("./mcpi-runtime-wrapper");
|
|
@@ -74,13 +88,13 @@ Object.defineProperty(exports, "ensureOutboundIdentityBridge", { enumerable: tru
|
|
|
74
88
|
var proof_batch_queue_1 = require("./proof-batch-queue");
|
|
75
89
|
Object.defineProperty(exports, "ProofBatchQueue", { enumerable: true, get: function () { return proof_batch_queue_1.ProofBatchQueue; } });
|
|
76
90
|
Object.defineProperty(exports, "KTAProofDestination", { enumerable: true, get: function () { return proof_batch_queue_1.KTAProofDestination; } });
|
|
77
|
-
Object.defineProperty(exports, "
|
|
91
|
+
Object.defineProperty(exports, "CheckpointProofDestination", { enumerable: true, get: function () { return proof_batch_queue_1.CheckpointProofDestination; } });
|
|
78
92
|
Object.defineProperty(exports, "PartialProofSubmissionError", { enumerable: true, get: function () { return proof_batch_queue_1.PartialProofSubmissionError; } });
|
|
79
93
|
Object.defineProperty(exports, "createProofBatchQueue", { enumerable: true, get: function () { return proof_batch_queue_1.createProofBatchQueue; } });
|
|
80
94
|
var delegation_verifier_kv_1 = require("./delegation-verifier-kv");
|
|
81
95
|
Object.defineProperty(exports, "CloudflareKVDelegationVerifier", { enumerable: true, get: function () { return delegation_verifier_kv_1.CloudflareKVDelegationVerifier; } });
|
|
82
|
-
var
|
|
83
|
-
Object.defineProperty(exports, "
|
|
96
|
+
var delegation_verifier_checkpoint_1 = require("./delegation-verifier-checkpoint");
|
|
97
|
+
Object.defineProperty(exports, "CheckpointAPIDelegationVerifier", { enumerable: true, get: function () { return delegation_verifier_checkpoint_1.CheckpointAPIDelegationVerifier; } });
|
|
84
98
|
var delegation_verifier_memory_1 = require("./delegation-verifier-memory");
|
|
85
99
|
Object.defineProperty(exports, "MemoryDelegationVerifier", { enumerable: true, get: function () { return delegation_verifier_memory_1.MemoryDelegationVerifier; } });
|
|
86
100
|
// Tool protection (NEW - Phase 1.5)
|
|
@@ -89,7 +103,9 @@ Object.defineProperty(exports, "ToolProtectionResolver", { enumerable: true, get
|
|
|
89
103
|
Object.defineProperty(exports, "createToolProtectionResolver", { enumerable: true, get: function () { return tool_protection_1.createToolProtectionResolver; } });
|
|
90
104
|
Object.defineProperty(exports, "InlineToolProtectionSource", { enumerable: true, get: function () { return tool_protection_1.InlineToolProtectionSource; } });
|
|
91
105
|
Object.defineProperty(exports, "FileToolProtectionSource", { enumerable: true, get: function () { return tool_protection_1.FileToolProtectionSource; } });
|
|
92
|
-
Object.defineProperty(exports, "
|
|
106
|
+
Object.defineProperty(exports, "CheckpointToolProtectionSource", { enumerable: true, get: function () { return tool_protection_1.CheckpointToolProtectionSource; } });
|
|
107
|
+
// Former AgentShield names, kept as deprecated aliases.
|
|
108
|
+
__exportStar(require("./former-names"), exports);
|
|
93
109
|
var tool_protection_registry_1 = require("./tool-protection-registry");
|
|
94
110
|
Object.defineProperty(exports, "toolProtectionRegistry", { enumerable: true, get: function () { return tool_protection_registry_1.toolProtectionRegistry; } });
|
|
95
111
|
Object.defineProperty(exports, "isToolProtected", { enumerable: true, get: function () { return tool_protection_registry_1.isToolProtected; } });
|
|
@@ -50,7 +50,8 @@ export interface MCPIRuntimeConfig {
|
|
|
50
50
|
/** Proof submission destinations (Checkpoint, KTA, etc.) */
|
|
51
51
|
destinations?: Array<{
|
|
52
52
|
/** Destination type */
|
|
53
|
-
|
|
53
|
+
/** `"agentshield"` is the former name of `"checkpoint"`. */
|
|
54
|
+
type: "checkpoint" | "agentshield" | "kta";
|
|
54
55
|
/** API base URL */
|
|
55
56
|
apiUrl: string;
|
|
56
57
|
/** API key for authentication */
|
|
@@ -102,6 +103,11 @@ export interface MCPIRuntimeConfig {
|
|
|
102
103
|
/** Local tool protection file path (default: tool-protections.json) */
|
|
103
104
|
toolProtectionsFile?: string | false;
|
|
104
105
|
/** Checkpoint API configuration for fetching tool protections */
|
|
106
|
+
checkpoint?: {
|
|
107
|
+
apiUrl: string;
|
|
108
|
+
apiKey?: string;
|
|
109
|
+
};
|
|
110
|
+
/** @deprecated Use `checkpoint`; read only when `checkpoint` is absent. */
|
|
105
111
|
agentShield?: {
|
|
106
112
|
apiUrl: string;
|
|
107
113
|
apiKey?: string;
|
|
@@ -80,14 +80,15 @@ class MCPIRuntime {
|
|
|
80
80
|
this.sessionManager.setServerDid(this.cachedIdentity.did);
|
|
81
81
|
// Create tool protection resolver NOW that we have the agent DID (NEW - Phase 1.5)
|
|
82
82
|
if (this.config.delegation?.enabled) {
|
|
83
|
+
const checkpointApi = this.config.delegation.checkpoint ?? this.config.delegation.agentShield;
|
|
83
84
|
this.toolProtectionResolver = (0, tool_protection_1.createToolProtectionResolver)({
|
|
84
85
|
inline: this.config.delegation.toolProtections,
|
|
85
86
|
localFile: this.config.delegation.toolProtectionsFile,
|
|
86
|
-
|
|
87
|
+
checkpoint: checkpointApi
|
|
87
88
|
? {
|
|
88
|
-
apiUrl:
|
|
89
|
+
apiUrl: checkpointApi.apiUrl,
|
|
89
90
|
agentDid: this.cachedIdentity.did, // ← FIX: Use actual DID!
|
|
90
|
-
apiKey:
|
|
91
|
+
apiKey: checkpointApi.apiKey,
|
|
91
92
|
}
|
|
92
93
|
: undefined,
|
|
93
94
|
debug: this.config.identity?.environment === 'development',
|
|
@@ -135,7 +136,7 @@ class MCPIRuntime {
|
|
|
135
136
|
kta: this.config.delegation?.authorization?.kta,
|
|
136
137
|
bouncer: {
|
|
137
138
|
authorizationUrl: this.config.delegation?.authorization?.authorizationUrl ||
|
|
138
|
-
"https://
|
|
139
|
+
"https://checkpoint.example.com/consent",
|
|
139
140
|
resumeTokenTtl: this.config.delegation?.authorization?.resumeTokenTtl,
|
|
140
141
|
minReputationScore: this.config.delegation?.authorization?.minReputationScore,
|
|
141
142
|
requireAuthForUnknown: this.config.delegation?.authorization?.requireAuthForUnknown,
|
|
@@ -196,7 +197,7 @@ class MCPIRuntime {
|
|
|
196
197
|
kta: this.config.delegation.authorization?.kta,
|
|
197
198
|
bouncer: {
|
|
198
199
|
authorizationUrl: this.config.delegation.authorization?.authorizationUrl ||
|
|
199
|
-
"https://
|
|
200
|
+
"https://checkpoint.example.com/consent",
|
|
200
201
|
resumeTokenTtl: this.config.delegation.authorization?.resumeTokenTtl,
|
|
201
202
|
minReputationScore: this.config.delegation.authorization?.minReputationScore,
|
|
202
203
|
requireAuthForUnknown: this.config.delegation.authorization?.requireAuthForUnknown,
|
|
@@ -79,7 +79,7 @@ export declare class KTAProofDestination implements ProofDestination {
|
|
|
79
79
|
* Submits proofs to Checkpoint's /api/v1/bouncer/proofs endpoint
|
|
80
80
|
* with proper authentication and session grouping.
|
|
81
81
|
*/
|
|
82
|
-
export declare class
|
|
82
|
+
export declare class CheckpointProofDestination implements ProofDestination {
|
|
83
83
|
name: string;
|
|
84
84
|
private apiUrl;
|
|
85
85
|
private apiKey;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* Related: PHASE_1_XMCP_I_SERVER.md Epic 3 (Proof Batching)
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.ProofBatchQueue = exports.
|
|
21
|
+
exports.ProofBatchQueue = exports.CheckpointProofDestination = exports.KTAProofDestination = exports.PartialProofSubmissionError = void 0;
|
|
22
22
|
exports.createProofBatchQueue = createProofBatchQueue;
|
|
23
23
|
/**
|
|
24
24
|
* Thrown by a ProofDestination whose submit() made independent per-item
|
|
@@ -126,7 +126,7 @@ exports.KTAProofDestination = KTAProofDestination;
|
|
|
126
126
|
* Submits proofs to Checkpoint's /api/v1/bouncer/proofs endpoint
|
|
127
127
|
* with proper authentication and session grouping.
|
|
128
128
|
*/
|
|
129
|
-
class
|
|
129
|
+
class CheckpointProofDestination {
|
|
130
130
|
name = "Checkpoint";
|
|
131
131
|
apiUrl;
|
|
132
132
|
apiKey;
|
|
@@ -165,7 +165,7 @@ class AgentShieldProofDestination {
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
exports.
|
|
168
|
+
exports.CheckpointProofDestination = CheckpointProofDestination;
|
|
169
169
|
/**
|
|
170
170
|
* Proof Batch Queue
|
|
171
171
|
*
|