@kya-os/contracts 1.7.17 → 1.7.19

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.
@@ -23,15 +23,15 @@ export declare const MCPClientInfoSchema: z.ZodObject<{
23
23
  persistentId: z.ZodOptional<z.ZodString>;
24
24
  }, "strip", z.ZodTypeAny, {
25
25
  name: string;
26
- title?: string | undefined;
27
26
  version?: string | undefined;
27
+ title?: string | undefined;
28
28
  platform?: string | undefined;
29
29
  vendor?: string | undefined;
30
30
  persistentId?: string | undefined;
31
31
  }, {
32
32
  name: string;
33
- title?: string | undefined;
34
33
  version?: string | undefined;
34
+ title?: string | undefined;
35
35
  platform?: string | undefined;
36
36
  vendor?: string | undefined;
37
37
  persistentId?: string | undefined;
@@ -48,20 +48,20 @@ export declare const MCPClientSessionInfoSchema: z.ZodObject<{
48
48
  protocolVersion: z.ZodOptional<z.ZodString>;
49
49
  capabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
50
50
  }, "strip", z.ZodTypeAny, {
51
- name: string;
52
51
  clientId: string;
53
- title?: string | undefined;
52
+ name: string;
54
53
  version?: string | undefined;
54
+ title?: string | undefined;
55
55
  platform?: string | undefined;
56
56
  vendor?: string | undefined;
57
57
  persistentId?: string | undefined;
58
58
  protocolVersion?: string | undefined;
59
59
  capabilities?: Record<string, unknown> | undefined;
60
60
  }, {
61
- name: string;
62
61
  clientId: string;
63
- title?: string | undefined;
62
+ name: string;
64
63
  version?: string | undefined;
64
+ title?: string | undefined;
65
65
  platform?: string | undefined;
66
66
  vendor?: string | undefined;
67
67
  persistentId?: string | undefined;
@@ -84,20 +84,20 @@ export declare const HandshakeRequestSchema: z.ZodObject<{
84
84
  clientId: z.ZodOptional<z.ZodString>;
85
85
  }, "strip", z.ZodTypeAny, {
86
86
  name: string;
87
- title?: string | undefined;
87
+ clientId?: string | undefined;
88
88
  version?: string | undefined;
89
+ title?: string | undefined;
89
90
  platform?: string | undefined;
90
91
  vendor?: string | undefined;
91
92
  persistentId?: string | undefined;
92
- clientId?: string | undefined;
93
93
  }, {
94
94
  name: string;
95
- title?: string | undefined;
95
+ clientId?: string | undefined;
96
96
  version?: string | undefined;
97
+ title?: string | undefined;
97
98
  platform?: string | undefined;
98
99
  vendor?: string | undefined;
99
100
  persistentId?: string | undefined;
100
- clientId?: string | undefined;
101
101
  }>>;
102
102
  clientProtocolVersion: z.ZodOptional<z.ZodString>;
103
103
  clientCapabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -108,12 +108,12 @@ export declare const HandshakeRequestSchema: z.ZodObject<{
108
108
  agentDid?: string | undefined;
109
109
  clientInfo?: {
110
110
  name: string;
111
- title?: string | undefined;
111
+ clientId?: string | undefined;
112
112
  version?: string | undefined;
113
+ title?: string | undefined;
113
114
  platform?: string | undefined;
114
115
  vendor?: string | undefined;
115
116
  persistentId?: string | undefined;
116
- clientId?: string | undefined;
117
117
  } | undefined;
118
118
  clientProtocolVersion?: string | undefined;
119
119
  clientCapabilities?: Record<string, unknown> | undefined;
@@ -124,12 +124,12 @@ export declare const HandshakeRequestSchema: z.ZodObject<{
124
124
  agentDid?: string | undefined;
125
125
  clientInfo?: {
126
126
  name: string;
127
- title?: string | undefined;
127
+ clientId?: string | undefined;
128
128
  version?: string | undefined;
129
+ title?: string | undefined;
129
130
  platform?: string | undefined;
130
131
  vendor?: string | undefined;
131
132
  persistentId?: string | undefined;
132
- clientId?: string | undefined;
133
133
  } | undefined;
134
134
  clientProtocolVersion?: string | undefined;
135
135
  clientCapabilities?: Record<string, unknown> | undefined;
@@ -158,20 +158,20 @@ export declare const SessionContextSchema: z.ZodObject<{
158
158
  protocolVersion: z.ZodOptional<z.ZodString>;
159
159
  capabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
160
160
  }, "strip", z.ZodTypeAny, {
161
- name: string;
162
161
  clientId: string;
163
- title?: string | undefined;
162
+ name: string;
164
163
  version?: string | undefined;
164
+ title?: string | undefined;
165
165
  platform?: string | undefined;
166
166
  vendor?: string | undefined;
167
167
  persistentId?: string | undefined;
168
168
  protocolVersion?: string | undefined;
169
169
  capabilities?: Record<string, unknown> | undefined;
170
170
  }, {
171
- name: string;
172
171
  clientId: string;
173
- title?: string | undefined;
172
+ name: string;
174
173
  version?: string | undefined;
174
+ title?: string | undefined;
175
175
  platform?: string | undefined;
176
176
  vendor?: string | undefined;
177
177
  persistentId?: string | undefined;
@@ -195,29 +195,29 @@ export declare const SessionContextSchema: z.ZodObject<{
195
195
  }, "strip", z.ZodTypeAny, {
196
196
  provider: string;
197
197
  subject: string;
198
- name?: string | undefined;
199
198
  email?: string | undefined;
199
+ name?: string | undefined;
200
200
  }, {
201
201
  provider: string;
202
202
  subject: string;
203
- name?: string | undefined;
204
203
  email?: string | undefined;
204
+ name?: string | undefined;
205
205
  }>>;
206
206
  }, "strip", z.ZodTypeAny, {
207
+ createdAt: number;
207
208
  nonce: string;
208
209
  audience: string;
209
210
  timestamp: number;
210
211
  sessionId: string;
211
- createdAt: number;
212
212
  lastActivity: number;
213
213
  ttlMinutes: number;
214
- identityState: "anonymous" | "authenticated";
214
+ identityState: "authenticated" | "anonymous";
215
215
  agentDid?: string | undefined;
216
216
  clientInfo?: {
217
- name: string;
218
217
  clientId: string;
219
- title?: string | undefined;
218
+ name: string;
220
219
  version?: string | undefined;
220
+ title?: string | undefined;
221
221
  platform?: string | undefined;
222
222
  vendor?: string | undefined;
223
223
  persistentId?: string | undefined;
@@ -230,22 +230,22 @@ export declare const SessionContextSchema: z.ZodObject<{
230
230
  oauthIdentity?: {
231
231
  provider: string;
232
232
  subject: string;
233
- name?: string | undefined;
234
233
  email?: string | undefined;
234
+ name?: string | undefined;
235
235
  } | undefined;
236
236
  }, {
237
+ createdAt: number;
237
238
  nonce: string;
238
239
  audience: string;
239
240
  timestamp: number;
240
241
  sessionId: string;
241
- createdAt: number;
242
242
  lastActivity: number;
243
243
  agentDid?: string | undefined;
244
244
  clientInfo?: {
245
- name: string;
246
245
  clientId: string;
247
- title?: string | undefined;
246
+ name: string;
248
247
  version?: string | undefined;
248
+ title?: string | undefined;
249
249
  platform?: string | undefined;
250
250
  vendor?: string | undefined;
251
251
  persistentId?: string | undefined;
@@ -256,12 +256,12 @@ export declare const SessionContextSchema: z.ZodObject<{
256
256
  serverDid?: string | undefined;
257
257
  clientDid?: string | undefined;
258
258
  userDid?: string | undefined;
259
- identityState?: "anonymous" | "authenticated" | undefined;
259
+ identityState?: "authenticated" | "anonymous" | undefined;
260
260
  oauthIdentity?: {
261
261
  provider: string;
262
262
  subject: string;
263
- name?: string | undefined;
264
263
  email?: string | undefined;
264
+ name?: string | undefined;
265
265
  } | undefined;
266
266
  }>;
267
267
  export declare const NonceCacheEntrySchema: z.ZodObject<{
@@ -352,20 +352,23 @@ function getAuthorizationTypeKey(auth) {
352
352
  switch (auth.type) {
353
353
  case 'oauth':
354
354
  // Keep original key format for backward compatibility with existing cache entries
355
- return `oauth:${auth.provider}`;
355
+ // Handle undefined provider gracefully (may come from loose API response types)
356
+ return auth.provider ? `oauth:${auth.provider}` : 'oauth';
356
357
  case 'oauth2':
357
- return `oauth2:${auth.provider}`;
358
+ return auth.provider ? `oauth2:${auth.provider}` : 'oauth2';
358
359
  case 'password':
359
- return `password:${auth.provider}`;
360
+ return auth.provider ? `password:${auth.provider}` : 'password';
360
361
  case 'mdl':
361
- return `mdl:${auth.issuer}:${auth.credentialType || ''}`;
362
+ // Keep trailing colon for backward compatibility with existing cache entries
363
+ return `mdl:${auth.issuer || 'unknown'}:${auth.credentialType || ''}`;
362
364
  case 'idv':
363
- return `idv:${auth.provider}:${auth.verificationLevel || ''}`;
365
+ // Keep trailing colon for backward compatibility with existing cache entries
366
+ return `idv:${auth.provider || 'unknown'}:${auth.verificationLevel || ''}`;
364
367
  case 'verifiable_credential':
365
- return `vc:${auth.issuer || 'any'}:${auth.credentialType}`;
368
+ return `vc:${auth.issuer || 'any'}:${auth.credentialType || 'unknown'}`;
366
369
  case 'credential':
367
370
  // Deprecated: treat as verifiable_credential
368
- return `vc:${auth.issuer || 'any'}:${auth.credentialType}`;
371
+ return `vc:${auth.issuer || 'any'}:${auth.credentialType || 'unknown'}`;
369
372
  case 'webauthn':
370
373
  return `webauthn:${auth.rpId || 'default'}`;
371
374
  case 'siwe':
@@ -20,8 +20,8 @@ export declare const AgentContextSchema: z.ZodObject<{
20
20
  confidence: "verified";
21
21
  registry: string;
22
22
  verifiedAt: number;
23
- delegationRef?: string | undefined;
24
23
  subject?: string | undefined;
24
+ delegationRef?: string | undefined;
25
25
  }, {
26
26
  did: string;
27
27
  kid: string;
@@ -30,8 +30,8 @@ export declare const AgentContextSchema: z.ZodObject<{
30
30
  registry: string;
31
31
  verifiedAt: number;
32
32
  scopes?: string[] | undefined;
33
- delegationRef?: string | undefined;
34
33
  subject?: string | undefined;
34
+ delegationRef?: string | undefined;
35
35
  }>;
36
36
  export declare const VerifierResultSchema: z.ZodObject<{
37
37
  success: z.ZodBoolean;
@@ -54,8 +54,8 @@ export declare const VerifierResultSchema: z.ZodObject<{
54
54
  confidence: "verified";
55
55
  registry: string;
56
56
  verifiedAt: number;
57
- delegationRef?: string | undefined;
58
57
  subject?: string | undefined;
58
+ delegationRef?: string | undefined;
59
59
  }, {
60
60
  did: string;
61
61
  kid: string;
@@ -64,8 +64,8 @@ export declare const VerifierResultSchema: z.ZodObject<{
64
64
  registry: string;
65
65
  verifiedAt: number;
66
66
  scopes?: string[] | undefined;
67
- delegationRef?: string | undefined;
68
67
  subject?: string | undefined;
68
+ delegationRef?: string | undefined;
69
69
  }>>;
70
70
  error: z.ZodOptional<z.ZodObject<{
71
71
  code: z.ZodString;
@@ -100,8 +100,8 @@ export declare const VerifierResultSchema: z.ZodObject<{
100
100
  confidence: "verified";
101
101
  registry: string;
102
102
  verifiedAt: number;
103
- delegationRef?: string | undefined;
104
103
  subject?: string | undefined;
104
+ delegationRef?: string | undefined;
105
105
  } | undefined;
106
106
  }, {
107
107
  success: boolean;
@@ -120,8 +120,8 @@ export declare const VerifierResultSchema: z.ZodObject<{
120
120
  registry: string;
121
121
  verifiedAt: number;
122
122
  scopes?: string[] | undefined;
123
- delegationRef?: string | undefined;
124
123
  subject?: string | undefined;
124
+ delegationRef?: string | undefined;
125
125
  } | undefined;
126
126
  }>;
127
127
  export declare const StructuredErrorSchema: z.ZodObject<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kya-os/contracts",
3
- "version": "1.7.17",
3
+ "version": "1.7.19",
4
4
  "description": "Shared contracts, types, and schemas for MCP-I framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -95,7 +95,7 @@
95
95
  },
96
96
  "sideEffects": false,
97
97
  "dependencies": {
98
- "@kya-os/consent": "^0.1.13",
98
+ "@kya-os/consent": "^0.1.20",
99
99
  "zod": "^3.25.76"
100
100
  },
101
101
  "devDependencies": {