@kya-os/mcp-i 1.12.3 → 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.
@@ -75,8 +75,34 @@ export declare class IdentityManager {
75
75
  /**
76
76
  * Generate new development identity
77
77
  * Requirements: 4.1, 4.4
78
+ *
79
+ * @param preserveDid - use this DID instead of minting a fresh
80
+ * did:web:localhost:... one. Added for `rotateDevIdentity()`'s benefit
81
+ * (a rotation keeps the agent's DID stable by default); every existing
82
+ * caller passes no argument and is unaffected.
78
83
  */
79
84
  private generateDevIdentity;
85
+ /**
86
+ * Force-generate a fresh Ed25519 keypair and persist it to
87
+ * `devIdentityPath`, unconditionally overwriting whatever identity (if
88
+ * any) is already there. Unlike `ensureIdentity()`, which loads an
89
+ * existing valid identity rather than replacing it, this always mints a
90
+ * new one -- the primitive `mcpi keys rotate` needs.
91
+ *
92
+ * Deliberately reuses this same jose-based, 32-byte-raw-key generation
93
+ * path (rather than a second, independent key generator) so a rotated
94
+ * identity file is always in the one format every other identity path in
95
+ * this codebase already produces and consumes -- `CLIIdentityFileSchema`
96
+ * (`packages/contracts/src/cli.ts`) requires exactly 44 base64 characters
97
+ * (a raw 32-byte key), which the CLI's own `node:crypto`-based DER
98
+ * keypair (PKCS8/SPKI, `utils/identity-manager.ts`'s `generateKeyPair`)
99
+ * does not produce -- confirmed by direct inspection, not assumed.
100
+ *
101
+ * @param preserveDid - reuse this DID instead of minting a fresh one,
102
+ * mirroring `mcpi keys rotate`'s own default of keeping the DID stable
103
+ * across a rotation unless `--new-did` is passed.
104
+ */
105
+ rotateDevIdentity(preserveDid?: string): Promise<AgentIdentity>;
80
106
  /**
81
107
  * Generate multibase-encoded key identifier (z-prefix base58btc)
82
108
  */
@@ -120,8 +120,13 @@ class IdentityManager {
120
120
  /**
121
121
  * Generate new development identity
122
122
  * Requirements: 4.1, 4.4
123
+ *
124
+ * @param preserveDid - use this DID instead of minting a fresh
125
+ * did:web:localhost:... one. Added for `rotateDevIdentity()`'s benefit
126
+ * (a rotation keeps the agent's DID stable by default); every existing
127
+ * caller passes no argument and is unaffected.
123
128
  */
124
- async generateDevIdentity() {
129
+ async generateDevIdentity(preserveDid) {
125
130
  // Generate Ed25519 keypair
126
131
  const keyPair = await (0, jose_1.generateKeyPair)("EdDSA", { crv: "Ed25519" });
127
132
  // Export keys to JWK format
@@ -133,10 +138,11 @@ class IdentityManager {
133
138
  const publicKey = Buffer.from(privateKeyJwk.x, "base64url").toString("base64");
134
139
  // Generate multibase-encoded key ID
135
140
  const kid = this.generateMultibaseKid(publicKey);
136
- // Generate DID (for dev, use localhost)
137
- // Extract a short identifier for the DID path (first 8 chars of hash for readability)
141
+ // Generate DID (for dev, use localhost), unless the caller wants to
142
+ // keep an existing one. Extract a short identifier for the DID path
143
+ // (first 8 chars of hash for readability).
138
144
  const shortId = (0, crypto_1.createHash)("sha256").update(publicKey).digest("hex").substring(0, 8);
139
- const did = `did:web:localhost:3000:agents:${shortId}`;
145
+ const did = preserveDid ?? `did:web:localhost:3000:agents:${shortId}`;
140
146
  const now = new Date().toISOString();
141
147
  const identity = {
142
148
  did,
@@ -149,6 +155,33 @@ class IdentityManager {
149
155
  await this.saveDevIdentity(identity);
150
156
  return identity;
151
157
  }
158
+ /**
159
+ * Force-generate a fresh Ed25519 keypair and persist it to
160
+ * `devIdentityPath`, unconditionally overwriting whatever identity (if
161
+ * any) is already there. Unlike `ensureIdentity()`, which loads an
162
+ * existing valid identity rather than replacing it, this always mints a
163
+ * new one -- the primitive `mcpi keys rotate` needs.
164
+ *
165
+ * Deliberately reuses this same jose-based, 32-byte-raw-key generation
166
+ * path (rather than a second, independent key generator) so a rotated
167
+ * identity file is always in the one format every other identity path in
168
+ * this codebase already produces and consumes -- `CLIIdentityFileSchema`
169
+ * (`packages/contracts/src/cli.ts`) requires exactly 44 base64 characters
170
+ * (a raw 32-byte key), which the CLI's own `node:crypto`-based DER
171
+ * keypair (PKCS8/SPKI, `utils/identity-manager.ts`'s `generateKeyPair`)
172
+ * does not produce -- confirmed by direct inspection, not assumed.
173
+ *
174
+ * @param preserveDid - reuse this DID instead of minting a fresh one,
175
+ * mirroring `mcpi keys rotate`'s own default of keeping the DID stable
176
+ * across a rotation unless `--new-did` is passed.
177
+ */
178
+ async rotateDevIdentity(preserveDid) {
179
+ const identity = await this.generateDevIdentity(preserveDid);
180
+ const rotated = { ...identity, lastRotated: identity.createdAt };
181
+ await this.saveDevIdentity(rotated);
182
+ this.cachedIdentity = rotated;
183
+ return rotated;
184
+ }
152
185
  /**
153
186
  * Generate multibase-encoded key identifier (z-prefix base58btc)
154
187
  */
@@ -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, AgentShieldProofDestination, PartialProofSubmissionError, createProofBatchQueue, } from "./proof-batch-queue";
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 { AgentShieldAPIDelegationVerifier, } from "./delegation-verifier-agentshield";
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, AgentShieldToolProtectionSource, } from "./tool-protection";
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" };
@@ -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.AgentShieldToolProtectionSource = exports.FileToolProtectionSource = exports.InlineToolProtectionSource = exports.createToolProtectionResolver = exports.ToolProtectionResolver = exports.MemoryDelegationVerifier = exports.AgentShieldAPIDelegationVerifier = exports.CloudflareKVDelegationVerifier = exports.createProofBatchQueue = exports.PartialProofSubmissionError = exports.AgentShieldProofDestination = 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;
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, "AgentShieldProofDestination", { enumerable: true, get: function () { return proof_batch_queue_1.AgentShieldProofDestination; } });
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 delegation_verifier_agentshield_1 = require("./delegation-verifier-agentshield");
83
- Object.defineProperty(exports, "AgentShieldAPIDelegationVerifier", { enumerable: true, get: function () { return delegation_verifier_agentshield_1.AgentShieldAPIDelegationVerifier; } });
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, "AgentShieldToolProtectionSource", { enumerable: true, get: function () { return tool_protection_1.AgentShieldToolProtectionSource; } });
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; } });
@@ -14,6 +14,7 @@ exports.createMCPIRuntime = createMCPIRuntime;
14
14
  const mcp_i_runtime_1 = require("@kya-os/mcp-i-runtime");
15
15
  const node_providers_1 = require("../providers/node-providers");
16
16
  const path_1 = __importDefault(require("path"));
17
+ const config_1 = require("@kya-os/contracts/config");
17
18
  /**
18
19
  * Convert legacy config to provider-based config
19
20
  */
@@ -67,8 +68,9 @@ class MCPINodeRuntimeWrapper extends mcp_i_runtime_1.MCPIRuntimeBase {
67
68
  timestampSkewSeconds: coreConfig.session?.timestampSkewSeconds || 120,
68
69
  });
69
70
  // Instantiate AccessControlApiService if API key is available
70
- const apiKey = process.env.AGENTSHIELD_API_KEY;
71
- const apiUrl = process.env.AGENTSHIELD_API_URL || "https://kya.vouched.id";
71
+ const checkpoint = (0, config_1.withCheckpointNames)(process.env);
72
+ const apiKey = checkpoint.CHECKPOINT_API_KEY;
73
+ const apiUrl = checkpoint.CHECKPOINT_API_URL || "https://kya.vouched.id";
72
74
  if (apiKey) {
73
75
  this.accessControlService = new mcp_i_runtime_1.AccessControlApiService({
74
76
  baseUrl: apiUrl,
@@ -47,10 +47,11 @@ export interface MCPIRuntimeConfig {
47
47
  enabled?: boolean;
48
48
  /** Proof batch queue configuration */
49
49
  batchQueue?: {
50
- /** Proof submission destinations (AgentShield, KTA, etc.) */
50
+ /** Proof submission destinations (Checkpoint, KTA, etc.) */
51
51
  destinations?: Array<{
52
52
  /** Destination type */
53
- type: "agentshield" | "kta";
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 */
@@ -101,7 +102,12 @@ export interface MCPIRuntimeConfig {
101
102
  toolProtections?: ToolProtectionMap;
102
103
  /** Local tool protection file path (default: tool-protections.json) */
103
104
  toolProtectionsFile?: string | false;
104
- /** AgentShield API configuration for fetching tool protections */
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;
@@ -66,7 +66,7 @@ class MCPIRuntime {
66
66
  this.delegationVerifier = (0, delegation_verifier_1.createDelegationVerifier)(config.delegation.verifier);
67
67
  }
68
68
  // NOTE: Tool protection resolver is created in initialize()
69
- // after identity is loaded, because AgentShield API needs the agent DID
69
+ // after identity is loaded, because Checkpoint API needs the agent DID
70
70
  }
71
71
  /**
72
72
  * Initialize the runtime (async setup)
@@ -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
- agentShield: this.config.delegation.agentShield
87
+ checkpoint: checkpointApi
87
88
  ? {
88
- apiUrl: this.config.delegation.agentShield.apiUrl,
89
+ apiUrl: checkpointApi.apiUrl,
89
90
  agentDid: this.cachedIdentity.did, // ← FIX: Use actual DID!
90
- apiKey: this.config.delegation.agentShield.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://agentshield.example.com/consent",
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://agentshield.example.com/consent",
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,
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Proof Batch Queue
3
3
  *
4
- * Collects proofs in memory and submits them in batches to KTA and AgentShield.
4
+ * Collects proofs in memory and submits them in batches to KTA and Checkpoint.
5
5
  * This prevents blocking tool execution while ensuring proofs are eventually submitted.
6
6
  *
7
7
  * Performance:
@@ -74,12 +74,12 @@ export declare class KTAProofDestination implements ProofDestination {
74
74
  private submitOne;
75
75
  }
76
76
  /**
77
- * AgentShield proof submission destination
77
+ * Checkpoint proof submission destination
78
78
  *
79
- * Submits proofs to AgentShield's /api/v1/bouncer/proofs endpoint
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 AgentShieldProofDestination implements ProofDestination {
82
+ export declare class CheckpointProofDestination implements ProofDestination {
83
83
  name: string;
84
84
  private apiUrl;
85
85
  private apiKey;
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * Proof Batch Queue
4
4
  *
5
- * Collects proofs in memory and submits them in batches to KTA and AgentShield.
5
+ * Collects proofs in memory and submits them in batches to KTA and Checkpoint.
6
6
  * This prevents blocking tool execution while ensuring proofs are eventually submitted.
7
7
  *
8
8
  * Performance:
@@ -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.AgentShieldProofDestination = exports.KTAProofDestination = exports.PartialProofSubmissionError = void 0;
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
@@ -121,13 +121,13 @@ class KTAProofDestination {
121
121
  }
122
122
  exports.KTAProofDestination = KTAProofDestination;
123
123
  /**
124
- * AgentShield proof submission destination
124
+ * Checkpoint proof submission destination
125
125
  *
126
- * Submits proofs to AgentShield's /api/v1/bouncer/proofs endpoint
126
+ * Submits proofs to Checkpoint's /api/v1/bouncer/proofs endpoint
127
127
  * with proper authentication and session grouping.
128
128
  */
129
- class AgentShieldProofDestination {
130
- name = "AgentShield";
129
+ class CheckpointProofDestination {
130
+ name = "Checkpoint";
131
131
  apiUrl;
132
132
  apiKey;
133
133
  constructor(apiUrl, apiKey) {
@@ -139,13 +139,13 @@ class AgentShieldProofDestination {
139
139
  return;
140
140
  }
141
141
  const proofs = submissions.map((submission) => submission.proof);
142
- // Extract session_id from first proof for AgentShield session grouping
143
- // AgentShield uses this for analytics and detection monitoring
142
+ // Extract session_id from first proof for Checkpoint session grouping
143
+ // Checkpoint uses this for analytics and detection monitoring
144
144
  const sessionId = proofs[0]?.meta?.sessionId || "unknown";
145
- // AgentShield API format requires delegation_id and session_id wrapper
145
+ // Checkpoint API format requires delegation_id and session_id wrapper
146
146
  const requestBody = {
147
147
  delegation_id: null, // null for proofs without delegation context
148
- session_id: sessionId, // AgentShield session grouping (same as meta.sessionId)
148
+ session_id: sessionId, // Checkpoint session grouping (same as meta.sessionId)
149
149
  proofs: proofs,
150
150
  };
151
151
  const response = await fetch(`${this.apiUrl}/api/v1/bouncer/proofs`, {
@@ -161,11 +161,11 @@ class AgentShieldProofDestination {
161
161
  const errorBody = await response
162
162
  .text()
163
163
  .catch(() => "Unable to read error body");
164
- throw new Error(`AgentShield proof submission failed: ${response.status} ${response.statusText}\n${errorBody}`);
164
+ throw new Error(`Checkpoint proof submission failed: ${response.status} ${response.statusText}\n${errorBody}`);
165
165
  }
166
166
  }
167
167
  }
168
- exports.AgentShieldProofDestination = AgentShieldProofDestination;
168
+ exports.CheckpointProofDestination = CheckpointProofDestination;
169
169
  /**
170
170
  * Proof Batch Queue
171
171
  *