@kya-os/contracts 1.5.3-canary.2 → 1.5.3-canary.21

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 (90) hide show
  1. package/.turbo/turbo-build.log +17 -0
  2. package/.turbo/turbo-test$colon$coverage.log +85 -0
  3. package/.turbo/turbo-test.log +32 -0
  4. package/coverage/coverage-final.json +38 -0
  5. package/dist/agentshield-api/admin-schemas.d.ts +2 -2
  6. package/dist/agentshield-api/index.d.ts +1 -1
  7. package/dist/agentshield-api/schemas.d.ts +150 -48
  8. package/dist/agentshield-api/schemas.js +32 -4
  9. package/dist/agentshield-api/types.d.ts +31 -4
  10. package/dist/audit/index.d.ts +193 -0
  11. package/dist/audit/index.js +100 -0
  12. package/dist/config/identity.d.ts +205 -2
  13. package/dist/config/identity.js +28 -0
  14. package/dist/config/index.d.ts +2 -1
  15. package/dist/config/tool-context.d.ts +34 -0
  16. package/dist/config/tool-context.js +13 -0
  17. package/dist/consent/schemas.d.ts +119 -93
  18. package/dist/consent/schemas.js +111 -64
  19. package/dist/dashboard-config/schemas.d.ts +2248 -992
  20. package/dist/handshake.d.ts +14 -14
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.js +2 -0
  23. package/dist/tool-protection/index.d.ts +490 -14
  24. package/dist/tool-protection/index.js +89 -2
  25. package/dist/verifier/index.d.ts +1 -0
  26. package/dist/verifier/index.js +18 -0
  27. package/dist/well-known/index.d.ts +2 -2
  28. package/package.json +43 -122
  29. package/schemas/cli/register-output/v1.0.0.json +69 -0
  30. package/schemas/identity/v1.0.0.json +46 -0
  31. package/schemas/proof/v1.0.0.json +80 -0
  32. package/schemas/registry/receipt-v1.0.0.json +60 -0
  33. package/schemas/verifier/verify-page/v1.0.0.json +94 -0
  34. package/schemas/well-known/agent/v1.0.0.json +67 -0
  35. package/schemas/well-known/did/v1.0.0.json +174 -0
  36. package/scripts/emit-schemas.js +11 -0
  37. package/src/agentshield-api/admin-schemas.ts +31 -0
  38. package/src/agentshield-api/admin-types.ts +47 -0
  39. package/src/agentshield-api/endpoints.ts +60 -0
  40. package/src/agentshield-api/index.ts +70 -0
  41. package/src/agentshield-api/schemas.ts +304 -0
  42. package/src/agentshield-api/types.ts +317 -0
  43. package/src/audit/index.ts +128 -0
  44. package/src/cli.ts +156 -0
  45. package/src/config/base.ts +107 -0
  46. package/src/config/builder.ts +97 -0
  47. package/src/config/delegation.ts +232 -0
  48. package/src/config/identity.ts +252 -0
  49. package/src/config/index.ts +78 -0
  50. package/src/config/proofing.ts +138 -0
  51. package/src/config/tool-context.ts +41 -0
  52. package/src/config/tool-protection.ts +174 -0
  53. package/src/consent/index.ts +32 -0
  54. package/src/consent/schemas.ts +334 -0
  55. package/src/consent/types.ts +199 -0
  56. package/src/dashboard-config/default-config.json +86 -0
  57. package/src/dashboard-config/default-config.ts +266 -0
  58. package/src/dashboard-config/index.ts +48 -0
  59. package/src/dashboard-config/schemas.ts +286 -0
  60. package/src/dashboard-config/types.ts +404 -0
  61. package/src/delegation/constraints.ts +267 -0
  62. package/src/delegation/index.ts +8 -0
  63. package/src/delegation/schemas.ts +595 -0
  64. package/src/did/index.ts +9 -0
  65. package/src/did/resolve-contract.ts +255 -0
  66. package/src/did/schemas.ts +190 -0
  67. package/src/did/types.ts +224 -0
  68. package/src/env/constants.ts +70 -0
  69. package/src/env/index.ts +5 -0
  70. package/src/handshake.ts +125 -0
  71. package/src/index.ts +45 -0
  72. package/src/proof/index.ts +31 -0
  73. package/src/proof/proof-record.ts +163 -0
  74. package/src/proof/signing-spec.ts +146 -0
  75. package/src/proof.ts +99 -0
  76. package/src/registry.ts +146 -0
  77. package/src/runtime/errors.ts +153 -0
  78. package/src/runtime/headers.ts +136 -0
  79. package/src/runtime/index.ts +6 -0
  80. package/src/test.ts +143 -0
  81. package/src/tlkrc/index.ts +5 -0
  82. package/src/tlkrc/rotation.ts +153 -0
  83. package/src/tool-protection/index.ts +406 -0
  84. package/src/utils/validation.ts +93 -0
  85. package/src/vc/index.ts +8 -0
  86. package/src/vc/schemas.ts +277 -0
  87. package/src/vc/statuslist.ts +279 -0
  88. package/src/verifier/index.ts +2 -0
  89. package/src/verifier.ts +92 -0
  90. package/src/well-known/index.ts +237 -0
@@ -0,0 +1,252 @@
1
+ /**
2
+ * Identity Configuration Types
3
+ *
4
+ * Configuration for MCP-I identity management including DID generation,
5
+ * key management, and environment-specific settings.
6
+ *
7
+ * @module @kya-os/contracts/config
8
+ */
9
+
10
+ import { z } from "zod";
11
+
12
+ /**
13
+ * Runtime Identity Configuration
14
+ *
15
+ * Configuration for MCP-I identity management at runtime.
16
+ * Used in application configs (mcpi-runtime-config.ts)
17
+ *
18
+ * Controls how agent identity is managed, including key generation,
19
+ * storage, and DID creation.
20
+ */
21
+ export interface RuntimeIdentityConfig {
22
+ /**
23
+ * Enable identity features
24
+ * When false, the agent operates anonymously without DID/keys
25
+ */
26
+ enabled: boolean;
27
+
28
+ /**
29
+ * Runtime environment for identity
30
+ * Determines where keys come from and how they're managed
31
+ */
32
+ environment: "development" | "production";
33
+
34
+ /**
35
+ * Production identity configuration
36
+ * Used when environment is 'production'
37
+ */
38
+ production?: {
39
+ /**
40
+ * Environment variable name containing the private key
41
+ * @example 'MCPI_PRIVATE_KEY'
42
+ */
43
+ privateKeyEnv?: string;
44
+
45
+ /**
46
+ * Environment variable name containing the public key
47
+ * @example 'MCPI_PUBLIC_KEY'
48
+ */
49
+ publicKeyEnv?: string;
50
+
51
+ /**
52
+ * Environment variable name containing the DID
53
+ * @example 'MCPI_AGENT_DID'
54
+ */
55
+ didEnv?: string;
56
+ };
57
+
58
+ /**
59
+ * Privacy mode - minimizes identity disclosure
60
+ * When true, identity is only revealed when absolutely necessary
61
+ * @default false
62
+ */
63
+ privacyMode?: boolean;
64
+
65
+ /**
66
+ * Enable debug logging for identity operations
67
+ * WARNING: May log sensitive information
68
+ * @default false
69
+ */
70
+ debug?: boolean;
71
+
72
+ /**
73
+ * Enable automatic user DID generation on chat join
74
+ * When true, generates ephemeral did:key DIDs for users when they join a session
75
+ * @default false
76
+ */
77
+ generateUserDids?: boolean;
78
+
79
+ /**
80
+ * User DID storage strategy
81
+ * - 'ephemeral': User DIDs are not persisted (default, did:key)
82
+ * - 'persistent': User DIDs are persisted in storage (requires did:web setup)
83
+ * @default 'ephemeral'
84
+ */
85
+ userDidStorage?: "ephemeral" | "persistent";
86
+ }
87
+
88
+ /**
89
+ * OAuth Provider Configuration
90
+ *
91
+ * Configuration for a single OAuth provider (GitHub, Google, etc.)
92
+ */
93
+ export interface OAuthProvider {
94
+ /** OAuth client ID (public, safe to expose) */
95
+ clientId: string;
96
+
97
+ /** OAuth client secret (NOT returned in API response for security) */
98
+ clientSecret?: string | null;
99
+
100
+ /** OAuth authorization URL */
101
+ authorizationUrl: string;
102
+
103
+ /** OAuth token exchange URL */
104
+ tokenUrl: string;
105
+
106
+ /** OAuth user info endpoint URL */
107
+ userInfoUrl?: string;
108
+
109
+ /** Whether provider supports PKCE (Proof Key for Code Exchange) */
110
+ supportsPKCE: boolean;
111
+
112
+ /** Whether provider requires client secret (false for PKCE-only providers) */
113
+ requiresClientSecret: boolean;
114
+
115
+ /** Available scopes for this provider */
116
+ scopes?: string[];
117
+
118
+ /** Default scopes to request */
119
+ defaultScopes?: string[];
120
+
121
+ /** Whether provider uses proxy mode (via AgentShield) */
122
+ proxyMode?: boolean;
123
+
124
+ // Phase 3: Custom IDP Support
125
+ /** Custom OAuth parameters to include in authorization URL (e.g., audience, acr_values) */
126
+ customParams?: Record<string, string>;
127
+
128
+ /** Token endpoint authentication method */
129
+ tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic";
130
+
131
+ /** OAuth response type (default: "code") */
132
+ responseType?: string;
133
+
134
+ /** OAuth grant type (default: "authorization_code") */
135
+ grantType?: string;
136
+ }
137
+
138
+ /**
139
+ * OAuth Configuration
140
+ *
141
+ * Configuration for OAuth providers fetched from AgentShield API.
142
+ * Contains all available providers for a project.
143
+ *
144
+ * Note: API does NOT return a defaultProvider field (Phase 1 architecture).
145
+ * Phase 1 uses configured provider as temporary fallback.
146
+ * Phase 2+ requires tools to explicitly specify oauthProvider.
147
+ */
148
+ export interface OAuthConfig {
149
+ /** Map of provider names to provider configurations */
150
+ providers: Record<string, OAuthProvider>;
151
+ }
152
+
153
+ /**
154
+ * Zod schema for OAuthProvider validation
155
+ */
156
+ export const OAuthProviderSchema = z.object({
157
+ clientId: z.string().min(1),
158
+ clientSecret: z.string().nullable().optional(),
159
+ authorizationUrl: z.string().url(),
160
+ tokenUrl: z.string().url(),
161
+ userInfoUrl: z.string().url().optional(),
162
+ supportsPKCE: z.boolean(),
163
+ requiresClientSecret: z.boolean(),
164
+ scopes: z.array(z.string()).optional(),
165
+ defaultScopes: z.array(z.string()).optional(),
166
+ proxyMode: z.boolean().optional(),
167
+ // Phase 3: Custom IDP Support
168
+ customParams: z.record(z.string()).optional(),
169
+ tokenEndpointAuthMethod: z.enum(["client_secret_post", "client_secret_basic"]).optional(),
170
+ responseType: z.string().optional().default("code"),
171
+ grantType: z.string().optional().default("authorization_code"),
172
+ });
173
+
174
+ /**
175
+ * Zod schema for OAuthConfig validation
176
+ */
177
+ export const OAuthConfigSchema = z.object({
178
+ providers: z.record(z.string(), OAuthProviderSchema),
179
+ });
180
+
181
+ /**
182
+ * IDP Tokens
183
+ *
184
+ * Tokens received from OAuth provider (IDP = Identity Provider)
185
+ */
186
+ export interface IdpTokens {
187
+ /** OAuth access token for API calls */
188
+ access_token: string;
189
+
190
+ /** OAuth refresh token (optional) */
191
+ refresh_token?: string;
192
+
193
+ /** Token expiration time in seconds */
194
+ expires_in?: number;
195
+
196
+ /** Token expiration timestamp (milliseconds since epoch) */
197
+ expires_at: number;
198
+
199
+ /** Token type (usually "Bearer") */
200
+ token_type: string;
201
+
202
+ /** Granted scopes */
203
+ scope?: string;
204
+ }
205
+
206
+ /**
207
+ * Agent identity representation
208
+ * The actual identity data structure used at runtime
209
+ */
210
+ export interface AgentIdentity {
211
+ /**
212
+ * Decentralized Identifier
213
+ * @example 'did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
214
+ */
215
+ did: string;
216
+
217
+ /**
218
+ * Base64-encoded public key
219
+ */
220
+ publicKey: string;
221
+
222
+ /**
223
+ * Base64-encoded private key
224
+ * NOTE: Should be kept secure and never logged
225
+ */
226
+ privateKey: string;
227
+
228
+ /**
229
+ * ISO 8601 timestamp of when the identity was created
230
+ */
231
+ createdAt: string;
232
+
233
+ /**
234
+ * Optional metadata about the identity
235
+ */
236
+ metadata?: {
237
+ /**
238
+ * Human-readable name for this identity
239
+ */
240
+ name?: string;
241
+
242
+ /**
243
+ * Version of the identity format
244
+ */
245
+ version?: string;
246
+
247
+ /**
248
+ * Additional custom properties
249
+ */
250
+ [key: string]: unknown;
251
+ };
252
+ }
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Configuration Type Exports
3
+ *
4
+ * Central export point for all configuration types in the contracts package.
5
+ * These types form the foundation of XMCP-I's configuration architecture.
6
+ *
7
+ * @module @kya-os/contracts/config
8
+ */
9
+
10
+ // Import types for the interface
11
+ import type { MCPIBaseConfig } from "./base.js";
12
+ import type { RuntimeIdentityConfig } from "./identity.js";
13
+ import type { ProofingConfig } from "./proofing.js";
14
+ import type { DelegationConfig } from "./delegation.js";
15
+ import type { ToolProtectionSourceConfig } from "./tool-protection.js";
16
+
17
+ // Base configuration
18
+ export { MCPIBaseConfig } from "./base.js";
19
+
20
+ // Identity configuration
21
+ export {
22
+ RuntimeIdentityConfig,
23
+ AgentIdentity,
24
+ OAuthProvider,
25
+ OAuthConfig,
26
+ IdpTokens,
27
+ } from "./identity.js";
28
+
29
+ // Tool execution context
30
+ export type { ToolExecutionContext } from "./tool-context.js";
31
+
32
+ /**
33
+ * @deprecated Use RuntimeIdentityConfig instead
34
+ * This export is maintained for backward compatibility
35
+ */
36
+ export type IdentityConfig = RuntimeIdentityConfig;
37
+
38
+ // Proofing configuration
39
+ export {
40
+ ProofingConfig,
41
+ ProofBatchQueueConfig,
42
+ ProofDestination,
43
+ ProofDestinationType,
44
+ } from "./proofing.js";
45
+
46
+ // Delegation configuration
47
+ export {
48
+ DelegationConfig,
49
+ DelegationVerifierConfig,
50
+ DelegationVerifierType,
51
+ AuthorizationConfig,
52
+ DelegationRecord,
53
+ } from "./delegation.js";
54
+
55
+ // Tool protection configuration
56
+ export {
57
+ ToolProtection,
58
+ ToolProtectionMap,
59
+ ToolProtectionSourceConfig,
60
+ ToolProtectionSourceType,
61
+ ToolProtectionServiceConfig,
62
+ DelegationRequiredErrorData,
63
+ ToolProtectionResponse,
64
+ } from "./tool-protection.js";
65
+
66
+ // Configuration builder utilities
67
+ export { buildBaseConfig } from "./builder.js";
68
+
69
+ /**
70
+ * Complete runtime configuration type
71
+ * This can be extended by platform-specific configs
72
+ */
73
+ export interface MCPIConfig extends MCPIBaseConfig {
74
+ identity?: RuntimeIdentityConfig;
75
+ proofing?: ProofingConfig;
76
+ delegation?: DelegationConfig;
77
+ toolProtection?: ToolProtectionSourceConfig;
78
+ }
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Proofing Configuration Types
3
+ *
4
+ * Configuration for proof generation and submission including batch
5
+ * processing, destinations, and retry logic.
6
+ *
7
+ * @module @kya-os/contracts/config
8
+ */
9
+
10
+ /**
11
+ * Proof destination types
12
+ */
13
+ export type ProofDestinationType = 'agentshield' | 'kta' | 'custom';
14
+
15
+ /**
16
+ * Proof destination configuration
17
+ * Defines where proofs should be submitted
18
+ */
19
+ export interface ProofDestination {
20
+ /**
21
+ * Type of destination
22
+ */
23
+ type: ProofDestinationType;
24
+
25
+ /**
26
+ * API base URL for the destination
27
+ * Required for 'agentshield' and 'kta' types
28
+ * @example 'https://kya.vouched.id'
29
+ */
30
+ apiUrl?: string;
31
+
32
+ /**
33
+ * API key for authentication
34
+ * Required for most destinations
35
+ */
36
+ apiKey?: string;
37
+
38
+ /**
39
+ * Custom submission function
40
+ * Required for 'custom' type destinations
41
+ */
42
+ submit?: (proofs: any[]) => Promise<void>;
43
+
44
+ /**
45
+ * Additional destination-specific configuration
46
+ */
47
+ options?: Record<string, unknown>;
48
+ }
49
+
50
+ /**
51
+ * Proof batch queue configuration
52
+ * Controls how proofs are batched and submitted
53
+ */
54
+ export interface ProofBatchQueueConfig {
55
+ /**
56
+ * Destinations where proofs should be sent
57
+ * Multiple destinations are processed in parallel
58
+ */
59
+ destinations: ProofDestination[];
60
+
61
+ /**
62
+ * Maximum number of proofs to batch before auto-submission
63
+ * @default 10
64
+ */
65
+ maxBatchSize?: number;
66
+
67
+ /**
68
+ * Time interval (ms) between automatic flush attempts
69
+ * @default 5000
70
+ */
71
+ flushIntervalMs?: number;
72
+
73
+ /**
74
+ * Maximum number of retry attempts for failed submissions
75
+ * @default 3
76
+ */
77
+ maxRetries?: number;
78
+
79
+ /**
80
+ * Backoff multiplier for retry delays
81
+ * @default 2
82
+ */
83
+ retryBackoff?: number;
84
+
85
+ /**
86
+ * Enable debug logging for proof submission
87
+ * @default false
88
+ */
89
+ debug?: boolean;
90
+ }
91
+
92
+ /**
93
+ * Proofing configuration (platform-agnostic)
94
+ *
95
+ * Controls proof generation, batching, and submission to external services
96
+ * like AgentShield or Know That AI (KTA).
97
+ */
98
+ export interface ProofingConfig {
99
+ /**
100
+ * Enable proof generation and submission
101
+ * @default true
102
+ */
103
+ enabled: boolean;
104
+
105
+ /**
106
+ * Proof batch queue configuration
107
+ * Controls batching and submission behavior
108
+ */
109
+ batchQueue?: ProofBatchQueueConfig;
110
+
111
+ /**
112
+ * Include additional metadata in proofs
113
+ * @default true
114
+ */
115
+ includeMetadata?: boolean;
116
+
117
+ /**
118
+ * Custom proof generation options
119
+ */
120
+ options?: {
121
+ /**
122
+ * Include timestamp in all proofs
123
+ * @default true
124
+ */
125
+ includeTimestamp?: boolean;
126
+
127
+ /**
128
+ * Include session context in proofs
129
+ * @default true
130
+ */
131
+ includeSession?: boolean;
132
+
133
+ /**
134
+ * Custom fields to include in every proof
135
+ */
136
+ customFields?: Record<string, unknown>;
137
+ };
138
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Tool Execution Context
3
+ *
4
+ * Execution context passed to tool handlers, enabling tools to access
5
+ * IDP tokens for external API calls (GitHub, Google, etc.).
6
+ *
7
+ * All fields are optional for backward compatibility - tools that don't
8
+ * require OAuth will receive undefined context.
9
+ *
10
+ * @package @kya-os/contracts
11
+ */
12
+
13
+ /**
14
+ * Execution context passed to tool handlers
15
+ *
16
+ * Enables tools to access IDP tokens for external API calls.
17
+ * Context is only provided when:
18
+ * - Tool requires OAuth (has requiredScopes)
19
+ * - User DID is available
20
+ * - IDP token is successfully resolved
21
+ */
22
+ export interface ToolExecutionContext {
23
+ /** IDP access token for external API calls (e.g., GitHub, Google) */
24
+ idpToken?: string;
25
+
26
+ /** OAuth provider name (e.g., "github", "google") */
27
+ provider?: string;
28
+
29
+ /** Scopes granted for this token */
30
+ scopes?: string[];
31
+
32
+ /** User DID associated with this token */
33
+ userDid?: string;
34
+
35
+ /** Session ID */
36
+ sessionId?: string;
37
+
38
+ /** Delegation token (MCP-I internal authorization) */
39
+ delegationToken?: string;
40
+ }
41
+
@@ -0,0 +1,174 @@
1
+ /**
2
+ * Tool Protection Configuration Types
3
+ *
4
+ * Configuration for tool protection including delegation requirements,
5
+ * scopes, and multi-source resolution strategies.
6
+ *
7
+ * @module @kya-os/contracts/config
8
+ */
9
+
10
+ // Import core tool protection types from the spec
11
+ import type {
12
+ ToolProtection as BaseToolProtection,
13
+ ToolProtectionMap as BaseToolProtectionMap,
14
+ DelegationRequiredErrorData as BaseDelegationRequiredErrorData,
15
+ ToolProtectionResponse as BaseToolProtectionResponse
16
+ } from '../tool-protection/index.js';
17
+
18
+ // Re-export for convenience
19
+ export type ToolProtection = BaseToolProtection;
20
+ export type ToolProtectionMap = BaseToolProtectionMap;
21
+ export type DelegationRequiredErrorData = BaseDelegationRequiredErrorData;
22
+ export type ToolProtectionResponse = BaseToolProtectionResponse;
23
+
24
+ /**
25
+ * Tool protection source types
26
+ */
27
+ export type ToolProtectionSourceType =
28
+ | 'inline' // Inline configuration in code
29
+ | 'local' // Local file (tool-protections.json)
30
+ | 'agentshield' // AgentShield API
31
+ | 'kta' // Know That AI
32
+ | 'multi'; // Multiple sources with priority resolution
33
+
34
+ /**
35
+ * Tool protection source configuration
36
+ * Defines where tool protection settings come from
37
+ */
38
+ export interface ToolProtectionSourceConfig {
39
+ /**
40
+ * Type of source to use
41
+ */
42
+ source: ToolProtectionSourceType;
43
+
44
+ /**
45
+ * Inline tool protection map
46
+ * Used when source is 'inline'
47
+ */
48
+ inline?: BaseToolProtectionMap;
49
+
50
+ /**
51
+ * Path to local tool protections file
52
+ * Used when source is 'local'
53
+ * @example './tool-protections.json'
54
+ */
55
+ localFile?: string;
56
+
57
+ /**
58
+ * AgentShield configuration
59
+ * Used when source is 'agentshield'
60
+ */
61
+ agentShield?: {
62
+ /**
63
+ * AgentShield API base URL
64
+ * @example 'https://kya.vouched.id'
65
+ */
66
+ apiUrl: string;
67
+
68
+ /**
69
+ * API key for authentication
70
+ */
71
+ apiKey?: string;
72
+
73
+ /**
74
+ * Project ID (optional, for backward compatibility)
75
+ * Modern approach uses agent DID
76
+ */
77
+ projectId?: string;
78
+
79
+ /**
80
+ * Cache TTL in milliseconds
81
+ * @default 300000 (5 minutes)
82
+ */
83
+ cacheTtl?: number;
84
+ };
85
+
86
+ /**
87
+ * KTA configuration
88
+ * Used when source is 'kta'
89
+ */
90
+ kta?: {
91
+ /**
92
+ * KTA API base URL
93
+ */
94
+ apiUrl: string;
95
+
96
+ /**
97
+ * API key for authentication
98
+ */
99
+ apiKey?: string;
100
+ };
101
+
102
+ /**
103
+ * Multi-source configuration
104
+ * Used when source is 'multi'
105
+ * Sources are checked in priority order
106
+ */
107
+ sources?: Array<{
108
+ /**
109
+ * Source configuration
110
+ */
111
+ config: Omit<ToolProtectionSourceConfig, 'source' | 'sources'>;
112
+
113
+ /**
114
+ * Priority (higher number = higher priority)
115
+ * @default 0
116
+ */
117
+ priority?: number;
118
+
119
+ /**
120
+ * Whether to stop after this source if found
121
+ * @default false
122
+ */
123
+ exclusive?: boolean;
124
+ }>;
125
+
126
+ /**
127
+ * Fallback configuration if all sources fail
128
+ */
129
+ fallback?: BaseToolProtectionMap;
130
+
131
+ /**
132
+ * Enable debug logging
133
+ * @default false
134
+ */
135
+ debug?: boolean;
136
+ }
137
+
138
+ /**
139
+ * Tool protection service configuration
140
+ * Used by provider-based implementations
141
+ */
142
+ export interface ToolProtectionServiceConfig {
143
+ /**
144
+ * API base URL for fetching tool protections
145
+ */
146
+ apiUrl: string;
147
+
148
+ /**
149
+ * API key for authentication
150
+ */
151
+ apiKey: string;
152
+
153
+ /**
154
+ * Project ID (optional)
155
+ */
156
+ projectId?: string;
157
+
158
+ /**
159
+ * Cache TTL in milliseconds
160
+ * @default 300000 (5 minutes)
161
+ */
162
+ cacheTtl?: number;
163
+
164
+ /**
165
+ * Fallback configuration if API is unavailable
166
+ */
167
+ fallbackConfig?: BaseToolProtectionMap;
168
+
169
+ /**
170
+ * Enable debug logging
171
+ * @default false
172
+ */
173
+ debug?: boolean;
174
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Consent Module Exports
3
+ *
4
+ * Types and schemas for consent page configuration and approval handling
5
+ */
6
+
7
+ // Export schemas and inferred types (types are derived from schemas)
8
+ export {
9
+ consentBrandingSchema,
10
+ consentTermsSchema,
11
+ consentCustomFieldSchema,
12
+ consentCustomFieldOptionSchema,
13
+ consentPageConfigSchema,
14
+ consentApprovalRequestSchema,
15
+ consentApprovalResponseSchema,
16
+ consentConfigSchema,
17
+ oauthIdentitySchema,
18
+ validateConsentPageConfig,
19
+ validateConsentApprovalRequest,
20
+ validateConsentApprovalResponse,
21
+ validateConsentConfig,
22
+ type ConsentBranding,
23
+ type ConsentTerms,
24
+ type ConsentCustomField,
25
+ type ConsentPageConfig,
26
+ type ConsentApprovalRequest,
27
+ type ConsentApprovalResponse,
28
+ type ConsentConfig,
29
+ type OAuthIdentity,
30
+ } from './schemas.js';
31
+
32
+