@kya-os/contracts 1.5.1 → 1.5.2-canary.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.
@@ -15,7 +15,11 @@ const index_js_1 = require("../tool-protection/index.js");
15
15
  * Identity configuration schema
16
16
  */
17
17
  exports.identityConfigSchema = zod_1.z.object({
18
- agentDid: zod_1.z.string().min(1),
18
+ /**
19
+ * @deprecated Use serverDid instead. Will be removed in v2.0
20
+ */
21
+ agentDid: zod_1.z.string().min(1).optional(),
22
+ serverDid: zod_1.z.string().min(1),
19
23
  environment: zod_1.z.enum(['development', 'production']),
20
24
  storageLocation: zod_1.z.enum(['cloudflare-kv', 'file-system', 'env-vars']),
21
25
  });
@@ -23,10 +23,17 @@ import type { DelegationVerifierType } from '../config/delegation.js';
23
23
  export interface MCPIServerConfig {
24
24
  identity: {
25
25
  /**
26
- * Agent DID (public identifier)
26
+ * MCP-I Server DID (public identifier)
27
+ * Identifies this server instance
28
+ * @deprecated Use serverDid instead. Will be removed in v2.0
29
+ */
30
+ agentDid?: string;
31
+ /**
32
+ * MCP-I Server DID (public identifier)
33
+ * Identifies this server instance
27
34
  * Read-only, displayed for reference
28
35
  */
29
- agentDid: string;
36
+ serverDid: string;
30
37
  /**
31
38
  * Environment mode
32
39
  * Controls identity source: 'development' | 'production'
@@ -254,7 +261,7 @@ export interface MCPIServerConfig {
254
261
  */
255
262
  /**
256
263
  * Request to get server configuration
257
- * GET /api/v1/projects/{projectId}/config
264
+ * GET /api/v1/bouncer/projects/{projectId}/config
258
265
  */
259
266
  export interface GetServerConfigRequest {
260
267
  projectId: string;
@@ -274,7 +281,7 @@ export interface GetServerConfigResponse {
274
281
  }
275
282
  /**
276
283
  * Request to update server configuration
277
- * PUT /api/v1/projects/{projectId}/config
284
+ * PUT /api/v1/bouncer/projects/{projectId}/config
278
285
  */
279
286
  export interface UpdateServerConfigRequest {
280
287
  projectId: string;
@@ -300,7 +307,7 @@ export interface UpdateServerConfigResponse {
300
307
  }
301
308
  /**
302
309
  * Request to validate server configuration without saving
303
- * POST /api/v1/projects/{projectId}/config/validate
310
+ * POST /api/v1/bouncer/projects/{projectId}/config/validate
304
311
  */
305
312
  export interface ValidateServerConfigRequest {
306
313
  projectId: string;
@@ -114,6 +114,12 @@ export declare const DelegationConstraintsSchema: z.ZodObject<{
114
114
  notAfter: z.ZodOptional<z.ZodNumber>;
115
115
  /** Simple scopes array (for Phase 1 bouncer - simplified model) */
116
116
  scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
117
+ /**
118
+ * Optional target server DID(s) for this delegation
119
+ * If omitted, delegation is valid on any server accepting the scopes
120
+ * If specified, delegation is only valid on the specified server(s)
121
+ */
122
+ audience: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
117
123
  /** CRISP-specific constraints (full model) */
118
124
  crisp: z.ZodOptional<z.ZodObject<{
119
125
  /** Optional budget constraint */
@@ -279,6 +285,12 @@ export declare const DelegationConstraintsSchema: z.ZodObject<{
279
285
  notAfter: z.ZodOptional<z.ZodNumber>;
280
286
  /** Simple scopes array (for Phase 1 bouncer - simplified model) */
281
287
  scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
288
+ /**
289
+ * Optional target server DID(s) for this delegation
290
+ * If omitted, delegation is valid on any server accepting the scopes
291
+ * If specified, delegation is only valid on the specified server(s)
292
+ */
293
+ audience: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
282
294
  /** CRISP-specific constraints (full model) */
283
295
  crisp: z.ZodOptional<z.ZodObject<{
284
296
  /** Optional budget constraint */
@@ -444,6 +456,12 @@ export declare const DelegationConstraintsSchema: z.ZodObject<{
444
456
  notAfter: z.ZodOptional<z.ZodNumber>;
445
457
  /** Simple scopes array (for Phase 1 bouncer - simplified model) */
446
458
  scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
459
+ /**
460
+ * Optional target server DID(s) for this delegation
461
+ * If omitted, delegation is valid on any server accepting the scopes
462
+ * If specified, delegation is only valid on the specified server(s)
463
+ */
464
+ audience: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
447
465
  /** CRISP-specific constraints (full model) */
448
466
  crisp: z.ZodOptional<z.ZodObject<{
449
467
  /** Optional budget constraint */
@@ -620,6 +638,12 @@ export declare function validateDelegationConstraints(constraints: unknown): z.S
620
638
  notAfter: z.ZodOptional<z.ZodNumber>;
621
639
  /** Simple scopes array (for Phase 1 bouncer - simplified model) */
622
640
  scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
641
+ /**
642
+ * Optional target server DID(s) for this delegation
643
+ * If omitted, delegation is valid on any server accepting the scopes
644
+ * If specified, delegation is only valid on the specified server(s)
645
+ */
646
+ audience: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
623
647
  /** CRISP-specific constraints (full model) */
624
648
  crisp: z.ZodOptional<z.ZodObject<{
625
649
  /** Optional budget constraint */
@@ -785,6 +809,12 @@ export declare function validateDelegationConstraints(constraints: unknown): z.S
785
809
  notAfter: z.ZodOptional<z.ZodNumber>;
786
810
  /** Simple scopes array (for Phase 1 bouncer - simplified model) */
787
811
  scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
812
+ /**
813
+ * Optional target server DID(s) for this delegation
814
+ * If omitted, delegation is valid on any server accepting the scopes
815
+ * If specified, delegation is only valid on the specified server(s)
816
+ */
817
+ audience: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
788
818
  /** CRISP-specific constraints (full model) */
789
819
  crisp: z.ZodOptional<z.ZodObject<{
790
820
  /** Optional budget constraint */
@@ -989,3 +1019,4 @@ export declare const MAX_BUDGET_CAP: number;
989
1019
  * Maximum reasonable window duration (10 years in seconds)
990
1020
  */
991
1021
  export declare const MAX_WINDOW_DURATION_SEC: number;
1022
+ //# sourceMappingURL=constraints.d.ts.map
@@ -76,6 +76,15 @@ exports.DelegationConstraintsSchema = zod_1.z.object({
76
76
  notAfter: zod_1.z.number().int().optional(),
77
77
  /** Simple scopes array (for Phase 1 bouncer - simplified model) */
78
78
  scopes: zod_1.z.array(zod_1.z.string()).optional(),
79
+ /**
80
+ * Optional target server DID(s) for this delegation
81
+ * If omitted, delegation is valid on any server accepting the scopes
82
+ * If specified, delegation is only valid on the specified server(s)
83
+ */
84
+ audience: zod_1.z.union([
85
+ zod_1.z.string().startsWith("did:"),
86
+ zod_1.z.array(zod_1.z.string().startsWith("did:"))
87
+ ]).optional(),
79
88
  /** CRISP-specific constraints (full model) */
80
89
  crisp: zod_1.z.object({
81
90
  /** Optional budget constraint */
@@ -207,3 +216,4 @@ exports.MAX_BUDGET_CAP = Number.MAX_SAFE_INTEGER;
207
216
  * Maximum reasonable window duration (10 years in seconds)
208
217
  */
209
218
  exports.MAX_WINDOW_DURATION_SEC = 10 * 365 * 24 * 60 * 60;
219
+ //# sourceMappingURL=constraints.js.map
@@ -21,3 +21,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  __exportStar(require("./schemas.js"), exports);
23
23
  __exportStar(require("./constraints.js"), exports);
24
+ //# sourceMappingURL=index.js.map