@kya-os/mcp-i-cloudflare 1.14.7 → 1.15.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.
Files changed (152) hide show
  1. package/README.md +8 -8
  2. package/dist/adapter.d.ts.map +1 -1
  3. package/dist/adapter.js +8 -4
  4. package/dist/adapter.js.map +1 -1
  5. package/dist/agent.d.ts +22 -5
  6. package/dist/agent.d.ts.map +1 -1
  7. package/dist/agent.js +88 -46
  8. package/dist/agent.js.map +1 -1
  9. package/dist/app.d.ts.map +1 -1
  10. package/dist/app.js +15 -8
  11. package/dist/app.js.map +1 -1
  12. package/dist/config.d.ts +101 -5
  13. package/dist/config.d.ts.map +1 -1
  14. package/dist/config.js +18 -12
  15. package/dist/config.js.map +1 -1
  16. package/dist/constants.d.ts +5 -3
  17. package/dist/constants.d.ts.map +1 -1
  18. package/dist/constants.js +6 -4
  19. package/dist/constants.js.map +1 -1
  20. package/dist/delegation-http/anchor-registration.d.ts +2 -2
  21. package/dist/delegation-http/anchor-registration.js +4 -4
  22. package/dist/delegation-http/anchor-registration.js.map +1 -1
  23. package/dist/delegation-http/consent-anchor-bridge.js +3 -3
  24. package/dist/delegation-http/consent-anchor-bridge.js.map +1 -1
  25. package/dist/delegation-http/credential-consent.d.ts +2 -2
  26. package/dist/delegation-http/credential-consent.js +14 -14
  27. package/dist/delegation-http/credential-consent.js.map +1 -1
  28. package/dist/delegation-http/native-http.js +5 -5
  29. package/dist/delegation-http/native-http.js.map +1 -1
  30. package/dist/delegation-http/native-oauth-state-do.d.ts +43 -0
  31. package/dist/delegation-http/native-oauth-state-do.d.ts.map +1 -0
  32. package/dist/delegation-http/native-oauth-state-do.js +175 -0
  33. package/dist/delegation-http/native-oauth-state-do.js.map +1 -0
  34. package/dist/delegation-http/native-oauth-state.d.ts +12 -0
  35. package/dist/delegation-http/native-oauth-state.d.ts.map +1 -0
  36. package/dist/delegation-http/native-oauth-state.js +131 -0
  37. package/dist/delegation-http/native-oauth-state.js.map +1 -0
  38. package/dist/delegation-http/native-oauth.d.ts.map +1 -1
  39. package/dist/delegation-http/native-oauth.js +22 -17
  40. package/dist/delegation-http/native-oauth.js.map +1 -1
  41. package/dist/delegation-http/register.js +1 -1
  42. package/dist/delegation-http/register.js.map +1 -1
  43. package/dist/delegation-http/registrar-auth.d.ts +1 -1
  44. package/dist/delegation-http/registrar-auth.js +2 -2
  45. package/dist/delegation-http/registrar-auth.js.map +1 -1
  46. package/dist/delegation-http/remote-issuer.d.ts +1 -1
  47. package/dist/delegation-http/remote-issuer.d.ts.map +1 -1
  48. package/dist/delegation-http/remote-issuer.js +4 -4
  49. package/dist/delegation-http/remote-issuer.js.map +1 -1
  50. package/dist/helpers/env-mapper.d.ts +2 -2
  51. package/dist/helpers/env-mapper.d.ts.map +1 -1
  52. package/dist/helpers/env-mapper.js +21 -14
  53. package/dist/helpers/env-mapper.js.map +1 -1
  54. package/dist/index.d.ts +3 -1
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +4 -3
  57. package/dist/index.js.map +1 -1
  58. package/dist/needs-authorization-meta.d.ts +5 -0
  59. package/dist/needs-authorization-meta.d.ts.map +1 -1
  60. package/dist/needs-authorization-meta.js +9 -0
  61. package/dist/needs-authorization-meta.js.map +1 -1
  62. package/dist/proof-generator.d.ts +3 -3
  63. package/dist/proof-generator.js +4 -4
  64. package/dist/proof-generator.js.map +1 -1
  65. package/dist/runtime/invoke-tool-handler.d.ts +26 -1
  66. package/dist/runtime/invoke-tool-handler.d.ts.map +1 -1
  67. package/dist/runtime/invoke-tool-handler.js +32 -0
  68. package/dist/runtime/invoke-tool-handler.js.map +1 -1
  69. package/dist/runtime/oauth-handler.d.ts +9 -7
  70. package/dist/runtime/oauth-handler.d.ts.map +1 -1
  71. package/dist/runtime/oauth-handler.js +53 -49
  72. package/dist/runtime/oauth-handler.js.map +1 -1
  73. package/dist/runtime/oidc/authorize-url.js +2 -2
  74. package/dist/runtime/oidc/authorize-url.js.map +1 -1
  75. package/dist/runtime/oidc/token-exchange.d.ts +1 -1
  76. package/dist/runtime/oidc/token-exchange.d.ts.map +1 -1
  77. package/dist/runtime/tool-activity.d.ts +56 -0
  78. package/dist/runtime/tool-activity.d.ts.map +1 -0
  79. package/dist/runtime/tool-activity.js +55 -0
  80. package/dist/runtime/tool-activity.js.map +1 -0
  81. package/dist/runtime.d.ts +30 -13
  82. package/dist/runtime.d.ts.map +1 -1
  83. package/dist/runtime.js +71 -18
  84. package/dist/runtime.js.map +1 -1
  85. package/dist/server.d.ts.map +1 -1
  86. package/dist/server.js +17 -15
  87. package/dist/server.js.map +1 -1
  88. package/dist/services/admin.service.d.ts +1 -1
  89. package/dist/services/admin.service.js +13 -13
  90. package/dist/services/admin.service.js.map +1 -1
  91. package/dist/services/consent-config.service.d.ts +5 -5
  92. package/dist/services/consent-config.service.js +12 -12
  93. package/dist/services/consent-config.service.js.map +1 -1
  94. package/dist/services/consent-templates/base/components.d.ts +1 -1
  95. package/dist/services/consent-templates/base/components.js +1 -1
  96. package/dist/services/consent-templates/base/styles.d.ts +2 -2
  97. package/dist/services/consent-templates/base/styles.js +4 -4
  98. package/dist/services/consent-templates/base/styles.js.map +1 -1
  99. package/dist/services/consent-templates/helpers.d.ts +3 -3
  100. package/dist/services/consent-templates/helpers.js +4 -4
  101. package/dist/services/consent-templates/helpers.js.map +1 -1
  102. package/dist/services/consent-templates/index.d.ts +1 -1
  103. package/dist/services/consent-templates/index.js +1 -1
  104. package/dist/services/consent-templates/modes/credentials.template.d.ts +5 -5
  105. package/dist/services/consent-templates/modes/credentials.template.js +9 -9
  106. package/dist/services/consent-templates/modes/credentials.template.js.map +1 -1
  107. package/dist/services/consent-templates/registry.d.ts +3 -3
  108. package/dist/services/consent-templates/registry.js +3 -3
  109. package/dist/services/consent-templates/template-renderer.d.ts +5 -3
  110. package/dist/services/consent-templates/template-renderer.d.ts.map +1 -1
  111. package/dist/services/consent-templates/template-renderer.js +5 -3
  112. package/dist/services/consent-templates/template-renderer.js.map +1 -1
  113. package/dist/services/consent-templates/types.d.ts +4 -4
  114. package/dist/services/consent-templates/types.js +2 -2
  115. package/dist/services/consent.service.d.ts +44 -24
  116. package/dist/services/consent.service.d.ts.map +1 -1
  117. package/dist/services/consent.service.js +197 -119
  118. package/dist/services/consent.service.js.map +1 -1
  119. package/dist/services/delegation-mandate.d.ts +40 -0
  120. package/dist/services/delegation-mandate.d.ts.map +1 -0
  121. package/dist/services/delegation-mandate.js +46 -0
  122. package/dist/services/delegation-mandate.js.map +1 -0
  123. package/dist/services/delegation.service.d.ts +28 -12
  124. package/dist/services/delegation.service.d.ts.map +1 -1
  125. package/dist/services/delegation.service.js +88 -99
  126. package/dist/services/delegation.service.js.map +1 -1
  127. package/dist/services/kya-os-events.service.d.ts +15 -3
  128. package/dist/services/kya-os-events.service.d.ts.map +1 -1
  129. package/dist/services/kya-os-events.service.js +14 -4
  130. package/dist/services/kya-os-events.service.js.map +1 -1
  131. package/dist/services/proof-batch-queue.d.ts +4 -4
  132. package/dist/services/proof-batch-queue.d.ts.map +1 -1
  133. package/dist/services/proof-batch-queue.js +10 -10
  134. package/dist/services/proof-batch-queue.js.map +1 -1
  135. package/dist/services/proof.service.d.ts +64 -5
  136. package/dist/services/proof.service.d.ts.map +1 -1
  137. package/dist/services/proof.service.js +127 -40
  138. package/dist/services/proof.service.js.map +1 -1
  139. package/dist/services/provider-loader.service.d.ts +6 -6
  140. package/dist/services/provider-loader.service.d.ts.map +1 -1
  141. package/dist/services/provider-loader.service.js +4 -4
  142. package/dist/services/provider-loader.service.js.map +1 -1
  143. package/dist/services/vault-resolver.d.ts +4 -4
  144. package/dist/services/vault-resolver.d.ts.map +1 -1
  145. package/dist/services/vault-resolver.js +2 -2
  146. package/dist/types.d.ts +6 -4
  147. package/dist/types.d.ts.map +1 -1
  148. package/dist/utils/day0-config.d.ts +1 -1
  149. package/dist/utils/day0-config.js +1 -1
  150. package/dist/utils/env-secret-resolver.d.ts +1 -1
  151. package/dist/utils/env-secret-resolver.js +1 -1
  152. package/package.json +5 -5
@@ -0,0 +1,56 @@
1
+ import { type DelegationDenial, type DelegationRequiredError } from "@kya-os/mcp-i-runtime";
2
+ /**
3
+ * The activity verdict for one tool dispatch, as sent on `tool.invoked`.
4
+ *
5
+ * A fail excerpt is always one of: a denial code with its default message, a
6
+ * refusal code, or `needs_authorization`. It is never built from handler
7
+ * output, the consent URL or upstream verifier text, because Checkpoint
8
+ * promises that tool args and results never appear on activity events.
9
+ */
10
+ export type ToolActivity = {
11
+ verdict: "pass";
12
+ } | FailedToolActivity;
13
+ /** A fail verdict and its safe excerpt. */
14
+ export interface FailedToolActivity {
15
+ verdict: "fail";
16
+ excerpt: string;
17
+ }
18
+ /** Excerpt for a protected call that arrived without a grant. */
19
+ export declare const NEEDS_AUTHORIZATION_EXCERPT = "needs_authorization";
20
+ /**
21
+ * True for the runtime's delegation-required signal. Matched by name, like
22
+ * the agent and the audit mapper, so a second bundled copy of the runtime
23
+ * package still matches.
24
+ */
25
+ export declare function isDelegationRequiredError(error: unknown): error is DelegationRequiredError;
26
+ /**
27
+ * Activity for a result the handler returned. A result carrying the refusal
28
+ * marker is a fail with exactly its code; anything else, including a bare
29
+ * `isError` result, is a pass.
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * activityForResult({ isError: true, _meta: markToolRefusal("SPEND_CAP_EXCEEDED") });
34
+ * // { verdict: "fail", excerpt: "SPEND_CAP_EXCEEDED" }
35
+ * activityForResult({ isError: true, content: [] }); // { verdict: "pass" }
36
+ * ```
37
+ */
38
+ export declare function activityForResult(result: unknown): ToolActivity;
39
+ /**
40
+ * Activity for a call the runtime refused before the handler ran. A verifier
41
+ * denial gives `${code}: ${DEFAULT_DENIAL_MESSAGES[code]}`; a missing grant
42
+ * (or a code outside the allowlist) gives `needs_authorization`.
43
+ *
44
+ * The message is looked up by code rather than read from the error, so the
45
+ * excerpt can only ever be one of the fixed default strings.
46
+ *
47
+ * @example
48
+ * ```typescript
49
+ * activityForDenial(revokedError);
50
+ * // { verdict: "fail", excerpt: "delegation_revoked: This authorization was revoked. Nothing was executed." }
51
+ * ```
52
+ */
53
+ export declare function activityForDenial(error: {
54
+ denial?: DelegationDenial;
55
+ }): FailedToolActivity;
56
+ //# sourceMappingURL=tool-activity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-activity.d.ts","sourceRoot":"","sources":["../../src/runtime/tool-activity.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC7B,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GACnB,kBAAkB,CAAC;AAEvB,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,iEAAiE;AACjE,eAAO,MAAM,2BAA2B,wBAAwB,CAAC;AAIjE;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,uBAAuB,CAElC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,CAG/D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B,GAAG,kBAAkB,CAYrB"}
@@ -0,0 +1,55 @@
1
+ import { readToolRefusal } from "@kya-os/contracts/config";
2
+ import { DEFAULT_DENIAL_MESSAGES, } from "@kya-os/mcp-i-runtime";
3
+ /** Excerpt for a protected call that arrived without a grant. */
4
+ export const NEEDS_AUTHORIZATION_EXCERPT = "needs_authorization";
5
+ const PASS = Object.freeze({ verdict: "pass" });
6
+ /**
7
+ * True for the runtime's delegation-required signal. Matched by name, like
8
+ * the agent and the audit mapper, so a second bundled copy of the runtime
9
+ * package still matches.
10
+ */
11
+ export function isDelegationRequiredError(error) {
12
+ return error instanceof Error && error.name === "DelegationRequiredError";
13
+ }
14
+ /**
15
+ * Activity for a result the handler returned. A result carrying the refusal
16
+ * marker is a fail with exactly its code; anything else, including a bare
17
+ * `isError` result, is a pass.
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * activityForResult({ isError: true, _meta: markToolRefusal("SPEND_CAP_EXCEEDED") });
22
+ * // { verdict: "fail", excerpt: "SPEND_CAP_EXCEEDED" }
23
+ * activityForResult({ isError: true, content: [] }); // { verdict: "pass" }
24
+ * ```
25
+ */
26
+ export function activityForResult(result) {
27
+ const refusal = readToolRefusal(result);
28
+ return refusal ? { verdict: "fail", excerpt: refusal.code } : PASS;
29
+ }
30
+ /**
31
+ * Activity for a call the runtime refused before the handler ran. A verifier
32
+ * denial gives `${code}: ${DEFAULT_DENIAL_MESSAGES[code]}`; a missing grant
33
+ * (or a code outside the allowlist) gives `needs_authorization`.
34
+ *
35
+ * The message is looked up by code rather than read from the error, so the
36
+ * excerpt can only ever be one of the fixed default strings.
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * activityForDenial(revokedError);
41
+ * // { verdict: "fail", excerpt: "delegation_revoked: This authorization was revoked. Nothing was executed." }
42
+ * ```
43
+ */
44
+ export function activityForDenial(error) {
45
+ const code = error.denial?.code;
46
+ if (code === undefined ||
47
+ !Object.prototype.hasOwnProperty.call(DEFAULT_DENIAL_MESSAGES, code)) {
48
+ return { verdict: "fail", excerpt: NEEDS_AUTHORIZATION_EXCERPT };
49
+ }
50
+ return {
51
+ verdict: "fail",
52
+ excerpt: `${code}: ${DEFAULT_DENIAL_MESSAGES[code]}`,
53
+ };
54
+ }
55
+ //# sourceMappingURL=tool-activity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-activity.js","sourceRoot":"","sources":["../../src/runtime/tool-activity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EACL,uBAAuB,GAGxB,MAAM,uBAAuB,CAAC;AAoB/B,iEAAiE;AACjE,MAAM,CAAC,MAAM,2BAA2B,GAAG,qBAAqB,CAAC;AAEjE,MAAM,IAAI,GAAiB,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAe,EAAE,CAAC,CAAC;AAEvE;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,KAAc;IAEd,OAAO,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,yBAAyB,CAAC;AAC5E,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAe;IAC/C,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACxC,OAAO,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACrE,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAEjC;IACC,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC;IAChC,IACE,IAAI,KAAK,SAAS;QAClB,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,uBAAuB,EAAE,IAAI,CAAC,EACpE,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC;IACnE,CAAC;IACD,OAAO;QACL,OAAO,EAAE,MAAM;QACf,OAAO,EAAE,GAAG,IAAI,KAAK,uBAAuB,CAAC,IAAI,CAAC,EAAE;KACrD,CAAC;AACJ,CAAC"}
package/dist/runtime.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This runtime automatically uses CloudflareProofGenerator for all proof generation,
8
8
  * producing full JWS compact format (header.payload.signature) compatible with
9
- * AgentShield and the MCP-I proof specification.
9
+ * Checkpoint and the MCP-I proof specification.
10
10
  */
11
11
  import { MCPIRuntimeBase, type ProviderRuntimeConfig, ToolProtectionService, type ToolProtectionServiceConfig, AccessControlApiService, ProofVerifier } from "@kya-os/mcp-i-runtime";
12
12
  import { CloudflareProofGenerator } from "./proof-generator";
@@ -14,11 +14,12 @@ import type { DetachedProof } from "@kya-os/contracts/proof";
14
14
  import { type KVNamespace } from "./cache/kv-tool-protection-cache";
15
15
  import type { CloudflareRuntimeConfig } from "./config";
16
16
  import type { AgentIdentity } from "@kya-os/mcp-i-runtime";
17
+ import type { VerifiedDelegation } from "@kya-os/contracts/config";
17
18
  /**
18
19
  * CloudflareRuntime extends MCPIRuntimeBase with CloudflareProofGenerator
19
20
  */
20
21
  /**
21
- * Tool call context for AgentShield dashboard
22
+ * Tool call context for Checkpoint dashboard
22
23
  */
23
24
  export interface ToolCallContext {
24
25
  tool: string;
@@ -48,6 +49,15 @@ export declare class CloudflareRuntime extends MCPIRuntimeBase {
48
49
  * Set AccessControlApiService (injected by createCloudflareRuntime)
49
50
  */
50
51
  setAccessControlService(service: AccessControlApiService): void;
52
+ /**
53
+ * The injected delegation verifier, or undefined without an API key.
54
+ *
55
+ * Agent subclasses reach it through MCPICloudflareAgent's protected
56
+ * getDelegationVerifier(); this getter stays out of the documented API.
57
+ *
58
+ * @internal
59
+ */
60
+ getAccessControlService(): AccessControlApiService | undefined;
51
61
  /**
52
62
  * Set ProofVerifier (injected by createCloudflareRuntime)
53
63
  */
@@ -68,21 +78,28 @@ export declare class CloudflareRuntime extends MCPIRuntimeBase {
68
78
  * - jws: Full compact JWS (header.payload.signature)
69
79
  * - meta: ProofMeta with all required fields
70
80
  *
71
- * The proof is compatible with AgentShield and follows MCP-I specification.
81
+ * The proof is compatible with Checkpoint and follows MCP-I specification.
72
82
  */
73
83
  createProof(data: any, session?: any): Promise<DetachedProof>;
74
84
  /**
75
85
  * Override processToolCall to pass tool metadata through session,
76
- * automatically submit proofs to AgentShield, and attach proofs to result for MCP Inspector.
86
+ * automatically submit proofs to Checkpoint, and attach proofs to result for MCP Inspector.
77
87
  *
78
88
  * This ensures that CloudflareProofGenerator has access to the tool name
79
89
  * and parameters for generating accurate proof hashes, proofs are automatically
80
- * submitted to AgentShield for dashboard integration, and proofs are included
90
+ * submitted to Checkpoint for dashboard integration, and proofs are included
81
91
  * in the response for MCP Inspector.
82
92
  *
83
93
  * Note: Creates a new session object to avoid mutating the input session.
84
94
  */
85
- processToolCall(toolName: string, args: any, handler: (args: any) => Promise<any>, session?: any): Promise<any>;
95
+ processToolCall(toolName: string, args: any, handler: (args: any, verified?: VerifiedDelegation) => Promise<any>, session?: any): Promise<any>;
96
+ /**
97
+ * Send the activity event for a protected call refused before its handler
98
+ * ran. The proof service decides whether to send anything (structured mode
99
+ * only). Awaited so a Durable Object does not cancel the POST, and guarded
100
+ * so a telemetry failure never replaces the refusal the caller rethrows.
101
+ */
102
+ private reportDeniedToolCall;
86
103
  /**
87
104
  * Get the CloudflareProofGenerator instance (for advanced usage)
88
105
  */
@@ -141,7 +158,7 @@ export declare class CloudflareRuntime extends MCPIRuntimeBase {
141
158
  /**
142
159
  * Get the last tool call context
143
160
  *
144
- * Returns plaintext tool execution data for AgentShield dashboard integration.
161
+ * Returns plaintext tool execution data for Checkpoint dashboard integration.
145
162
  * This context can be submitted alongside proofs for enhanced UX.
146
163
  */
147
164
  getLastToolCallContext(): ToolCallContext | undefined;
@@ -149,14 +166,14 @@ export declare class CloudflareRuntime extends MCPIRuntimeBase {
149
166
  * Override buildConsentUrl to use server-hosted consent page
150
167
  *
151
168
  * Auto-detects server URL from request origin (via session.serverOrigin),
152
- * falls back to MCP_SERVER_URL env var, then to AgentShield dashboard.
169
+ * falls back to MCP_SERVER_URL env var, then to Checkpoint dashboard.
153
170
  *
154
171
  * Priority:
155
172
  * 1. session.serverOrigin (auto-detected from request)
156
173
  * 2. this.serverUrl (from MCP_SERVER_URL env var)
157
- * 3. AgentShield dashboard (backward compatibility)
174
+ * 3. Checkpoint dashboard (backward compatibility)
158
175
  *
159
- * AgentShield consent endpoint requires:
176
+ * Checkpoint consent endpoint requires:
160
177
  * - snake_case parameter names (agent_did, session_id, project_id)
161
178
  * - project_id parameter (required)
162
179
  * - provider parameter (optional, for selecting specific auth method)
@@ -167,7 +184,7 @@ export declare class CloudflareRuntime extends MCPIRuntimeBase {
167
184
  /**
168
185
  * Create a ToolProtectionService with CloudFlare KV cache
169
186
  *
170
- * The service fetches tool protection config from AgentShield by agent DID.
187
+ * The service fetches tool protection config from Checkpoint by agent DID.
171
188
  * Config is cached in KV for 5 minutes to minimize API calls.
172
189
  *
173
190
  * Usage in CloudFlare Worker:
@@ -175,8 +192,8 @@ export declare class CloudflareRuntime extends MCPIRuntimeBase {
175
192
  * const toolProtectionService = CloudflareRuntime.createToolProtectionService(
176
193
  * env.TOOL_PROTECTION_KV, // KV namespace from wrangler.toml
177
194
  * {
178
- * apiUrl: env.AGENTSHIELD_API_URL || 'https://kya.vouched.id',
179
- * apiKey: env.AGENTSHIELD_API_KEY,
195
+ * apiUrl: env.CHECKPOINT_API_URL || 'https://kya.vouched.id',
196
+ * apiKey: env.CHECKPOINT_API_KEY,
180
197
  * cacheTtl: 300000, // 5 minutes (default)
181
198
  * debug: env.MCPI_ENV === 'development',
182
199
  * localConfig: {
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,KAAK,2BAA2B,EAChC,uBAAuB,EACvB,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,kCAAkC,CAAC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}
package/dist/runtime.js CHANGED
@@ -6,12 +6,13 @@
6
6
  *
7
7
  * This runtime automatically uses CloudflareProofGenerator for all proof generation,
8
8
  * producing full JWS compact format (header.payload.signature) compatible with
9
- * AgentShield and the MCP-I proof specification.
9
+ * Checkpoint and the MCP-I proof specification.
10
10
  */
11
11
  import { MCPIRuntimeBase, ToolProtectionService, } from "@kya-os/mcp-i-runtime";
12
12
  import { CloudflareProofGenerator } from "./proof-generator";
13
13
  import { KVToolProtectionCache, } from "./cache/kv-tool-protection-cache";
14
14
  import { ProofService } from "./services/proof.service";
15
+ import { activityForResult, isDelegationRequiredError, } from "./runtime/tool-activity";
15
16
  export class CloudflareRuntime extends MCPIRuntimeBase {
16
17
  proofGenerator;
17
18
  lastDetachedProof;
@@ -45,6 +46,17 @@ export class CloudflareRuntime extends MCPIRuntimeBase {
45
46
  // Protected members are accessible from subclasses in TypeScript
46
47
  this.accessControlService = service;
47
48
  }
49
+ /**
50
+ * The injected delegation verifier, or undefined without an API key.
51
+ *
52
+ * Agent subclasses reach it through MCPICloudflareAgent's protected
53
+ * getDelegationVerifier(); this getter stays out of the documented API.
54
+ *
55
+ * @internal
56
+ */
57
+ getAccessControlService() {
58
+ return this.accessControlService;
59
+ }
48
60
  /**
49
61
  * Set ProofVerifier (injected by createCloudflareRuntime)
50
62
  */
@@ -80,7 +92,7 @@ export class CloudflareRuntime extends MCPIRuntimeBase {
80
92
  * - jws: Full compact JWS (header.payload.signature)
81
93
  * - meta: ProofMeta with all required fields
82
94
  *
83
- * The proof is compatible with AgentShield and follows MCP-I specification.
95
+ * The proof is compatible with Checkpoint and follows MCP-I specification.
84
96
  */
85
97
  async createProof(data, session) {
86
98
  if (!this.proofGenerator) {
@@ -140,7 +152,7 @@ export class CloudflareRuntime extends MCPIRuntimeBase {
140
152
  if (auditInvocationId) {
141
153
  this.proofByInvocation.set(auditInvocationId, detachedProof);
142
154
  }
143
- // ✅ Store tool call context for AgentShield dashboard
155
+ // ✅ Store tool call context for Checkpoint dashboard
144
156
  this.lastToolCallContext = {
145
157
  tool: session.toolName || "unknown",
146
158
  args: session.toolParams || session.args || {},
@@ -164,11 +176,11 @@ export class CloudflareRuntime extends MCPIRuntimeBase {
164
176
  }
165
177
  /**
166
178
  * Override processToolCall to pass tool metadata through session,
167
- * automatically submit proofs to AgentShield, and attach proofs to result for MCP Inspector.
179
+ * automatically submit proofs to Checkpoint, and attach proofs to result for MCP Inspector.
168
180
  *
169
181
  * This ensures that CloudflareProofGenerator has access to the tool name
170
182
  * and parameters for generating accurate proof hashes, proofs are automatically
171
- * submitted to AgentShield for dashboard integration, and proofs are included
183
+ * submitted to Checkpoint for dashboard integration, and proofs are included
172
184
  * in the response for MCP Inspector.
173
185
  *
174
186
  * Note: Creates a new session object to avoid mutating the input session.
@@ -187,20 +199,35 @@ export class CloudflareRuntime extends MCPIRuntimeBase {
187
199
  auditInvocationId: invocationId,
188
200
  }
189
201
  : undefined;
202
+ // Set only when THIS call's verify passed. Local to the call, so concurrent
203
+ // calls on the same runtime never attribute a proof to another call's grant.
204
+ let verifiedDelegationId;
205
+ const handlerRecordingVerified = (handlerArgs, verified) => {
206
+ verifiedDelegationId = verified?.id;
207
+ // Keep the exact arity: an unverified call still receives only (args).
208
+ return verified ? handler(handlerArgs, verified) : handler(handlerArgs);
209
+ };
190
210
  try {
191
211
  // Call parent implementation with enhanced session (generates proof)
192
- const result = await super.processToolCall(toolName, args, handler, enhancedSession);
212
+ let result;
213
+ try {
214
+ result = await super.processToolCall(toolName, args, handlerRecordingVerified, enhancedSession);
215
+ }
216
+ catch (error) {
217
+ await this.reportDeniedToolCall(error, toolName, enhancedSession);
218
+ throw error;
219
+ }
193
220
  // Resolve only the proof created for this invocation. `lastDetachedProof`
194
221
  // is retained solely as a legacy observational accessor.
195
222
  const proof = this.proofByInvocation.get(invocationId);
196
- // Automatically submit proof to AgentShield if available
223
+ // Automatically submit proof to Checkpoint if available
197
224
  // CRITICAL FIX: Await the proof submission directly instead of using ctx.waitUntil()
198
225
  // In Durable Objects (McpAgent), ctx.waitUntil() doesn't reliably extend lifetime,
199
226
  // causing proof submissions to be cancelled before completion.
200
227
  if (proof && this.proofService && enhancedSession) {
201
228
  try {
202
229
  // Determine MCP server URL from session or stored serverUrl
203
- // Ensure URL has protocol (https://) for AgentShield tool discovery
230
+ // Ensure URL has protocol (https://) for Checkpoint tool discovery
204
231
  let mcpServerUrl = enhancedSession.serverOrigin || this.serverUrl;
205
232
  if (mcpServerUrl &&
206
233
  !mcpServerUrl.startsWith("http://") &&
@@ -220,6 +247,8 @@ export class CloudflareRuntime extends MCPIRuntimeBase {
220
247
  args,
221
248
  result,
222
249
  mcpServerUrl,
250
+ activity: activityForResult(result),
251
+ verifiedDelegationId,
223
252
  });
224
253
  console.error("[CloudflareRuntime] ✅ Proof submission completed");
225
254
  }
@@ -265,6 +294,30 @@ export class CloudflareRuntime extends MCPIRuntimeBase {
265
294
  this.proofByInvocation.delete(invocationId);
266
295
  }
267
296
  }
297
+ /**
298
+ * Send the activity event for a protected call refused before its handler
299
+ * ran. The proof service decides whether to send anything (structured mode
300
+ * only). Awaited so a Durable Object does not cancel the POST, and guarded
301
+ * so a telemetry failure never replaces the refusal the caller rethrows.
302
+ */
303
+ async reportDeniedToolCall(error, toolName, session) {
304
+ if (!this.proofService || !isDelegationRequiredError(error)) {
305
+ return;
306
+ }
307
+ try {
308
+ const identity = await this.getIdentity();
309
+ await this.proofService.reportDenied({
310
+ serverDid: identity.did,
311
+ sessionId: session?.id,
312
+ toolName,
313
+ error,
314
+ delegationId: session?.delegationId,
315
+ });
316
+ }
317
+ catch (reportError) {
318
+ console.error("[CloudflareRuntime] Failed to report denied tool call:", reportError);
319
+ }
320
+ }
268
321
  /**
269
322
  * Get the CloudflareProofGenerator instance (for advanced usage)
270
323
  */
@@ -336,7 +389,7 @@ export class CloudflareRuntime extends MCPIRuntimeBase {
336
389
  /**
337
390
  * Get the last tool call context
338
391
  *
339
- * Returns plaintext tool execution data for AgentShield dashboard integration.
392
+ * Returns plaintext tool execution data for Checkpoint dashboard integration.
340
393
  * This context can be submitted alongside proofs for enhanced UX.
341
394
  */
342
395
  getLastToolCallContext() {
@@ -346,14 +399,14 @@ export class CloudflareRuntime extends MCPIRuntimeBase {
346
399
  * Override buildConsentUrl to use server-hosted consent page
347
400
  *
348
401
  * Auto-detects server URL from request origin (via session.serverOrigin),
349
- * falls back to MCP_SERVER_URL env var, then to AgentShield dashboard.
402
+ * falls back to MCP_SERVER_URL env var, then to Checkpoint dashboard.
350
403
  *
351
404
  * Priority:
352
405
  * 1. session.serverOrigin (auto-detected from request)
353
406
  * 2. this.serverUrl (from MCP_SERVER_URL env var)
354
- * 3. AgentShield dashboard (backward compatibility)
407
+ * 3. Checkpoint dashboard (backward compatibility)
355
408
  *
356
- * AgentShield consent endpoint requires:
409
+ * Checkpoint consent endpoint requires:
357
410
  * - snake_case parameter names (agent_did, session_id, project_id)
358
411
  * - project_id parameter (required)
359
412
  * - provider parameter (optional, for selecting specific auth method)
@@ -371,7 +424,7 @@ export class CloudflareRuntime extends MCPIRuntimeBase {
371
424
  session_id: session?.id || "",
372
425
  agent_did: session?.agentDid || "",
373
426
  });
374
- // Add agent_name for AgentShield dashboard display
427
+ // Add agent_name for Checkpoint dashboard display
375
428
  // Priority: session.agentName > "Unknown Agent"
376
429
  const agentName = session?.agentName;
377
430
  if (agentName) {
@@ -393,7 +446,7 @@ export class CloudflareRuntime extends MCPIRuntimeBase {
393
446
  // Determine server URL with priority:
394
447
  // 1. Auto-detected from request origin (session.serverOrigin)
395
448
  // 2. From env var (this.serverUrl)
396
- // 3. Fallback to AgentShield dashboard
449
+ // 3. Fallback to Checkpoint dashboard
397
450
  let serverUrl;
398
451
  if (session?.serverOrigin) {
399
452
  // Use auto-detected origin from request
@@ -409,13 +462,13 @@ export class CloudflareRuntime extends MCPIRuntimeBase {
409
462
  const baseUrl = serverUrl.replace(/\/$/, "");
410
463
  return `${baseUrl}/consent?${params.toString()}`;
411
464
  }
412
- // Fallback to AgentShield dashboard (for backward compatibility or when server URL not available)
465
+ // Fallback to Checkpoint dashboard (for backward compatibility or when server URL not available)
413
466
  return `https://kya.vouched.id/bouncer/consent?${params.toString()}`;
414
467
  }
415
468
  /**
416
469
  * Create a ToolProtectionService with CloudFlare KV cache
417
470
  *
418
- * The service fetches tool protection config from AgentShield by agent DID.
471
+ * The service fetches tool protection config from Checkpoint by agent DID.
419
472
  * Config is cached in KV for 5 minutes to minimize API calls.
420
473
  *
421
474
  * Usage in CloudFlare Worker:
@@ -423,8 +476,8 @@ export class CloudflareRuntime extends MCPIRuntimeBase {
423
476
  * const toolProtectionService = CloudflareRuntime.createToolProtectionService(
424
477
  * env.TOOL_PROTECTION_KV, // KV namespace from wrangler.toml
425
478
  * {
426
- * apiUrl: env.AGENTSHIELD_API_URL || 'https://kya.vouched.id',
427
- * apiKey: env.AGENTSHIELD_API_KEY,
479
+ * apiUrl: env.CHECKPOINT_API_URL || 'https://kya.vouched.id',
480
+ * apiKey: env.CHECKPOINT_API_KEY,
428
481
  * cacheTtl: 300000, // 5 minutes (default)
429
482
  * debug: env.MCPI_ENV === 'development',
430
483
  * localConfig: {
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,eAAe,EAEf,qBAAqB,GAItB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EACL,qBAAqB,GAEtB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAkBxD,MAAM,OAAO,iBAAkB,SAAQ,eAAe;IAC5C,cAAc,CAA4B;IAC1C,iBAAiB,CAAiB;IAClC,mBAAmB,CAAmB;IAC7B,iBAAiB,GAAG,IAAI,GAAG,EAAyB,CAAC;IAC9D,SAAS,CAAU,CAAC,4CAA4C;IA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ACH,eAAe,IAAI,YAAY;IAI/B;;OAEG;IACH,eAAe,IAAI,YAAY,GAAG,SAAS;IAI3C;;OAEG;IACH,iBAAiB,IAAI,cAAc;IAInC;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;IAWxB;;;;;OAKG;YACW,WAAW;CAmB1B"}
package/dist/server.js CHANGED
@@ -15,6 +15,7 @@ import { WebCryptoProvider } from "./providers/crypto";
15
15
  // at module load time, preventing esbuild from tree-shaking the OAuth services
16
16
  import { getOAuthServices, isOAuthServicesAvailable, } from "./utils/oauth-service-registry";
17
17
  import { WorkersClockProvider, WorkersFetchProvider, KVNonceCacheProvider, } from "./providers/storage";
18
+ import { withCheckpointNames } from "@kya-os/contracts/config";
18
19
  // CRITICAL: Force OAuth registry evaluation at module load time
19
20
  // This creates an observable side effect that esbuild cannot tree-shake
20
21
  // Without this, esbuild may eliminate oauth-service-registry.ts entirely
@@ -38,7 +39,7 @@ export class MCPICloudflareServer {
38
39
  // Store the initialization promise so consent routes can wait for it
39
40
  providerServicesInitPromise;
40
41
  constructor(options) {
41
- this.env = options.env;
42
+ this.env = withCheckpointNames(options.env);
42
43
  this.config = options.config;
43
44
  this.runtime = options.runtime;
44
45
  // Initialize all services
@@ -47,30 +48,30 @@ export class MCPICloudflareServer {
47
48
  // Phase 2: Initialize provider services if OAuth is configured
48
49
  // Note: These are initialized lazily in an async method to avoid await in constructor
49
50
  this.consentService = new ConsentService(this.env, this.runtime, undefined, // providerResolver - initialized lazily
50
- undefined // providerRegistry - initialized lazily
51
- );
51
+ undefined, // providerRegistry - initialized lazily
52
+ { delegationMandate: this.config.delegationMandate });
52
53
  // Initialize provider services asynchronously (if needed)
53
54
  // Store the promise so consent routes can wait for initialization
54
- if (this.env.AGENTSHIELD_API_KEY && this.runtime) {
55
+ if (this.env.CHECKPOINT_API_KEY && this.runtime) {
55
56
  this.providerServicesInitPromise = this.initializeProviderServices();
56
57
  }
57
58
  // Admin service is optional based on config
58
- // Auto-enable if AGENTSHIELD_API_KEY is present and admin config is not explicitly disabled
59
+ // Auto-enable if CHECKPOINT_API_KEY is present and admin config is not explicitly disabled
59
60
  const shouldEnableAdmin = this.config.admin?.enabled !== false && // Not explicitly disabled
60
61
  (this.config.admin?.enabled === true || // Explicitly enabled OR
61
- !!this.env.AGENTSHIELD_API_KEY); // Auto-enable when API key present
62
+ !!this.env.CHECKPOINT_API_KEY); // Auto-enable when API key present
62
63
  if (shouldEnableAdmin) {
63
64
  console.error("[MCPICloudflareServer] Initializing admin service", {
64
65
  adminEnabled: this.config.admin?.enabled,
65
- hasApiKey: !!this.env.AGENTSHIELD_API_KEY,
66
- autoEnabled: !this.config.admin && !!this.env.AGENTSHIELD_API_KEY,
66
+ hasApiKey: !!this.env.CHECKPOINT_API_KEY,
67
+ autoEnabled: !this.config.admin && !!this.env.CHECKPOINT_API_KEY,
67
68
  });
68
69
  this.adminService = new AdminService(this.env);
69
70
  }
70
71
  else {
71
72
  console.error("[MCPICloudflareServer] Admin service disabled", {
72
73
  adminEnabled: this.config.admin?.enabled,
73
- hasApiKey: !!this.env.AGENTSHIELD_API_KEY,
74
+ hasApiKey: !!this.env.CHECKPOINT_API_KEY,
74
75
  });
75
76
  }
76
77
  // Initialize ProofVerifier with dependency injection
@@ -92,7 +93,7 @@ export class MCPICloudflareServer {
92
93
  * This is called lazily to avoid await in constructor
93
94
  */
94
95
  async initializeProviderServices() {
95
- if (!this.env.AGENTSHIELD_API_KEY || !this.runtime) {
96
+ if (!this.env.CHECKPOINT_API_KEY || !this.runtime) {
96
97
  return;
97
98
  }
98
99
  try {
@@ -109,8 +110,8 @@ export class MCPICloudflareServer {
109
110
  ? new KVOAuthConfigCache({ kv: this.env.TOOL_PROTECTION_KV })
110
111
  : undefined;
111
112
  const oauthConfigService = new ConfigService({
112
- baseUrl: this.env.AGENTSHIELD_API_URL || "https://kya.vouched.id",
113
- apiKey: this.env.AGENTSHIELD_API_KEY,
113
+ baseUrl: this.env.CHECKPOINT_API_URL || "https://kya.vouched.id",
114
+ apiKey: this.env.CHECKPOINT_API_KEY,
114
115
  fetchProvider,
115
116
  cache: oauthConfigCache,
116
117
  });
@@ -179,12 +180,12 @@ export class MCPICloudflareServer {
179
180
  method: request.method,
180
181
  hasAdminService: !!this.adminService,
181
182
  adminEnabled: this.config.admin?.enabled,
182
- hasApiKey: !!this.env.AGENTSHIELD_API_KEY,
183
+ hasApiKey: !!this.env.CHECKPOINT_API_KEY,
183
184
  });
184
185
  if (!this.adminService) {
185
186
  console.warn("[MCPICloudflareServer] Admin service not initialized", {
186
187
  adminEnabled: this.config.admin?.enabled,
187
- hasApiKey: !!this.env.AGENTSHIELD_API_KEY,
188
+ hasApiKey: !!this.env.CHECKPOINT_API_KEY,
188
189
  configAdmin: this.config.admin,
189
190
  });
190
191
  return new Response(JSON.stringify({
@@ -241,7 +242,7 @@ export class MCPICloudflareServer {
241
242
  // FIX: Pass consentService so OAuth callback can call getUserDidForSession()
242
243
  // Without this, effectiveUserDid is undefined and IDP tokens are not stored
243
244
  const handler = createOAuthCallbackHandler({
244
- agentShieldApiUrl: this.env.AGENTSHIELD_API_URL,
245
+ checkpointApiUrl: this.env.CHECKPOINT_API_URL,
245
246
  delegationStorage: this.env.DELEGATION_STORAGE,
246
247
  oauthSecurityService,
247
248
  consentService: this.consentService, // FIX: Enable session userDid lookup
@@ -252,6 +253,7 @@ export class MCPICloudflareServer {
252
253
  const mockContext = {
253
254
  env: this.env,
254
255
  req: {
256
+ url: request.url,
255
257
  query: (key) => url.searchParams.get(key) || undefined,
256
258
  header: (name) => request.headers.get(name) || undefined,
257
259
  },