@kya-os/contracts 1.5.1 → 1.5.2-canary.1

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.
@@ -162,4 +162,3 @@ exports.revokeDelegationResponseSchema = zod_1.z.object({
162
162
  * Wrapped revocation response schema
163
163
  */
164
164
  exports.revokeDelegationAPIResponseSchema = (0, exports.agentShieldAPIResponseSchema)(exports.revokeDelegationResponseSchema);
165
- //# sourceMappingURL=schemas.js.map
@@ -109,7 +109,7 @@ export interface AgentShieldToolProtection {
109
109
  }
110
110
  /**
111
111
  * Response from tool protection config endpoint
112
- * GET /api/v1/bouncer/config/{projectId}
112
+ * GET /api/v1/bouncer/projects/{projectId}/config
113
113
  */
114
114
  export interface ToolProtectionConfigResponse {
115
115
  agent_did: string;
@@ -166,3 +166,4 @@ export declare class AgentShieldAPIError extends Error {
166
166
  readonly details?: Record<string, unknown> | undefined;
167
167
  constructor(code: string, message: string, details?: Record<string, unknown> | undefined);
168
168
  }
169
+ //# sourceMappingURL=types.d.ts.map
@@ -24,4 +24,3 @@ class AgentShieldAPIError extends Error {
24
24
  }
25
25
  }
26
26
  exports.AgentShieldAPIError = AgentShieldAPIError;
27
- //# sourceMappingURL=types.js.map
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Configuration Builder Utilities
3
+ *
4
+ * Shared utilities for building MCP-I configuration objects with sensible defaults.
5
+ * These functions are platform-agnostic and can be used by any adapter/platform.
6
+ *
7
+ * @module @kya-os/contracts/config
8
+ */
9
+ import type { MCPIBaseConfig } from './base.js';
10
+ import type { RuntimeIdentityConfig } from './identity.js';
11
+ import type { ProofingConfig } from './proofing.js';
12
+ import type { DelegationConfig } from './delegation.js';
13
+ import type { ToolProtectionSourceConfig } from './tool-protection.js';
14
+ /**
15
+ * Complete runtime configuration type
16
+ * This can be extended by platform-specific configs
17
+ */
18
+ export interface MCPIConfig extends MCPIBaseConfig {
19
+ identity?: RuntimeIdentityConfig;
20
+ proofing?: ProofingConfig;
21
+ delegation?: DelegationConfig;
22
+ toolProtection?: ToolProtectionSourceConfig;
23
+ }
24
+ /**
25
+ * Build base MCPIConfig that works across all platforms
26
+ *
27
+ * Creates a platform-agnostic configuration object with sensible defaults
28
+ * for identity, proofing, delegation, audit, and session management.
29
+ *
30
+ * @param env - Environment variables object (works with process.env or Cloudflare env)
31
+ * @returns Complete MCPIConfig object
32
+ */
33
+ export declare function buildBaseConfig(env: Record<string, any>): MCPIConfig;
34
+ //# sourceMappingURL=builder.d.ts.map
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ /**
3
+ * Configuration Builder Utilities
4
+ *
5
+ * Shared utilities for building MCP-I configuration objects with sensible defaults.
6
+ * These functions are platform-agnostic and can be used by any adapter/platform.
7
+ *
8
+ * @module @kya-os/contracts/config
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.buildBaseConfig = buildBaseConfig;
12
+ /**
13
+ * Build base MCPIConfig that works across all platforms
14
+ *
15
+ * Creates a platform-agnostic configuration object with sensible defaults
16
+ * for identity, proofing, delegation, audit, and session management.
17
+ *
18
+ * @param env - Environment variables object (works with process.env or Cloudflare env)
19
+ * @returns Complete MCPIConfig object
20
+ */
21
+ function buildBaseConfig(env) {
22
+ const environment = (env.MCPI_ENV || env.ENVIRONMENT || 'development');
23
+ const isDevelopment = environment === 'development';
24
+ const baseConfig = {
25
+ environment,
26
+ identity: {
27
+ enabled: true,
28
+ environment,
29
+ devIdentityPath: '.mcpi/identity.json'
30
+ },
31
+ proofing: {
32
+ enabled: true,
33
+ batchQueue: {
34
+ destinations: [
35
+ {
36
+ type: 'agentshield',
37
+ apiUrl: env.AGENTSHIELD_API_URL || 'https://kya.vouched.id',
38
+ apiKey: env.AGENTSHIELD_API_KEY || ''
39
+ }
40
+ ],
41
+ maxBatchSize: 10,
42
+ flushIntervalMs: 5000,
43
+ maxRetries: 3,
44
+ debug: isDevelopment
45
+ }
46
+ },
47
+ delegation: {
48
+ enabled: true,
49
+ enforceDelegations: true,
50
+ verifier: {
51
+ type: 'agentshield',
52
+ apiUrl: env.AGENTSHIELD_API_URL || 'https://kya.vouched.id',
53
+ apiKey: env.AGENTSHIELD_API_KEY || '',
54
+ cacheTtl: 60000, // 1 minute cache
55
+ debug: isDevelopment
56
+ },
57
+ authorization: {
58
+ authorizationUrl: env.AUTHORIZATION_URL || `${env.AGENTSHIELD_API_URL || 'https://kya.vouched.id'}/authorize`,
59
+ resumeTokenTtl: 600000, // 10 minutes
60
+ minReputationScore: 76
61
+ }
62
+ },
63
+ audit: {
64
+ enabled: true,
65
+ includeProofHashes: false,
66
+ includePayloads: false
67
+ },
68
+ session: {
69
+ timestampSkewSeconds: 120,
70
+ ttlMinutes: 30
71
+ }
72
+ };
73
+ return baseConfig;
74
+ }
75
+ //# sourceMappingURL=builder.js.map
@@ -6,21 +6,22 @@
6
6
  *
7
7
  * @module @kya-os/contracts/config
8
8
  */
9
- import type { MCPIBaseConfig } from './base.js';
10
- import type { RuntimeIdentityConfig } from './identity.js';
11
- import type { ProofingConfig } from './proofing.js';
12
- import type { DelegationConfig } from './delegation.js';
13
- import type { ToolProtectionSourceConfig } from './tool-protection.js';
14
- export { MCPIBaseConfig } from './base.js';
15
- export { RuntimeIdentityConfig, AgentIdentity } from './identity.js';
9
+ import type { MCPIBaseConfig } from "./base.js";
10
+ import type { RuntimeIdentityConfig } from "./identity.js";
11
+ import type { ProofingConfig } from "./proofing.js";
12
+ import type { DelegationConfig } from "./delegation.js";
13
+ import type { ToolProtectionSourceConfig } from "./tool-protection.js";
14
+ export { MCPIBaseConfig } from "./base.js";
15
+ export { RuntimeIdentityConfig, AgentIdentity } from "./identity.js";
16
16
  /**
17
17
  * @deprecated Use RuntimeIdentityConfig instead
18
18
  * This export is maintained for backward compatibility
19
19
  */
20
20
  export type IdentityConfig = RuntimeIdentityConfig;
21
- export { ProofingConfig, ProofBatchQueueConfig, ProofDestination, ProofDestinationType } from './proofing.js';
22
- export { DelegationConfig, DelegationVerifierConfig, DelegationVerifierType, AuthorizationConfig, DelegationRecord } from './delegation.js';
23
- export { ToolProtection, ToolProtectionMap, ToolProtectionSourceConfig, ToolProtectionSourceType, ToolProtectionServiceConfig, DelegationRequiredErrorData, ToolProtectionResponse } from './tool-protection.js';
21
+ export { ProofingConfig, ProofBatchQueueConfig, ProofDestination, ProofDestinationType, } from "./proofing.js";
22
+ export { DelegationConfig, DelegationVerifierConfig, DelegationVerifierType, AuthorizationConfig, DelegationRecord, } from "./delegation.js";
23
+ export { ToolProtection, ToolProtectionMap, ToolProtectionSourceConfig, ToolProtectionSourceType, ToolProtectionServiceConfig, DelegationRequiredErrorData, ToolProtectionResponse, } from "./tool-protection.js";
24
+ export { buildBaseConfig } from "./builder.js";
24
25
  /**
25
26
  * Complete runtime configuration type
26
27
  * This can be extended by platform-specific configs
@@ -31,3 +32,4 @@ export interface MCPIConfig extends MCPIBaseConfig {
31
32
  delegation?: DelegationConfig;
32
33
  toolProtection?: ToolProtectionSourceConfig;
33
34
  }
35
+ //# sourceMappingURL=index.d.ts.map
@@ -8,4 +8,8 @@
8
8
  * @module @kya-os/contracts/config
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.buildBaseConfig = void 0;
12
+ // Configuration builder utilities
13
+ var builder_js_1 = require("./builder.js");
14
+ Object.defineProperty(exports, "buildBaseConfig", { enumerable: true, get: function () { return builder_js_1.buildBaseConfig; } });
11
15
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Consent Module Exports
3
+ *
4
+ * Types and schemas for consent page configuration and approval handling
5
+ */
6
+ export { consentBrandingSchema, consentTermsSchema, consentCustomFieldSchema, consentCustomFieldOptionSchema, consentPageConfigSchema, consentApprovalRequestSchema, consentApprovalResponseSchema, consentConfigSchema, validateConsentPageConfig, validateConsentApprovalRequest, validateConsentApprovalResponse, validateConsentConfig, type ConsentBranding, type ConsentTerms, type ConsentCustomField, type ConsentPageConfig, type ConsentApprovalRequest, type ConsentApprovalResponse, type ConsentConfig, } from './schemas.js';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * Consent Module Exports
4
+ *
5
+ * Types and schemas for consent page configuration and approval handling
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.validateConsentConfig = exports.validateConsentApprovalResponse = exports.validateConsentApprovalRequest = exports.validateConsentPageConfig = exports.consentConfigSchema = exports.consentApprovalResponseSchema = exports.consentApprovalRequestSchema = exports.consentPageConfigSchema = exports.consentCustomFieldOptionSchema = exports.consentCustomFieldSchema = exports.consentTermsSchema = exports.consentBrandingSchema = void 0;
9
+ // Export schemas and inferred types (types are derived from schemas)
10
+ var schemas_js_1 = require("./schemas.js");
11
+ Object.defineProperty(exports, "consentBrandingSchema", { enumerable: true, get: function () { return schemas_js_1.consentBrandingSchema; } });
12
+ Object.defineProperty(exports, "consentTermsSchema", { enumerable: true, get: function () { return schemas_js_1.consentTermsSchema; } });
13
+ Object.defineProperty(exports, "consentCustomFieldSchema", { enumerable: true, get: function () { return schemas_js_1.consentCustomFieldSchema; } });
14
+ Object.defineProperty(exports, "consentCustomFieldOptionSchema", { enumerable: true, get: function () { return schemas_js_1.consentCustomFieldOptionSchema; } });
15
+ Object.defineProperty(exports, "consentPageConfigSchema", { enumerable: true, get: function () { return schemas_js_1.consentPageConfigSchema; } });
16
+ Object.defineProperty(exports, "consentApprovalRequestSchema", { enumerable: true, get: function () { return schemas_js_1.consentApprovalRequestSchema; } });
17
+ Object.defineProperty(exports, "consentApprovalResponseSchema", { enumerable: true, get: function () { return schemas_js_1.consentApprovalResponseSchema; } });
18
+ Object.defineProperty(exports, "consentConfigSchema", { enumerable: true, get: function () { return schemas_js_1.consentConfigSchema; } });
19
+ Object.defineProperty(exports, "validateConsentPageConfig", { enumerable: true, get: function () { return schemas_js_1.validateConsentPageConfig; } });
20
+ Object.defineProperty(exports, "validateConsentApprovalRequest", { enumerable: true, get: function () { return schemas_js_1.validateConsentApprovalRequest; } });
21
+ Object.defineProperty(exports, "validateConsentApprovalResponse", { enumerable: true, get: function () { return schemas_js_1.validateConsentApprovalResponse; } });
22
+ Object.defineProperty(exports, "validateConsentConfig", { enumerable: true, get: function () { return schemas_js_1.validateConsentConfig; } });