@kya-os/contracts 1.5.3-canary.3 → 1.5.3-canary.4

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.
@@ -357,8 +357,11 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
357
357
  /**
358
358
  * OAuth provider identity information (optional)
359
359
  * Used to link OAuth accounts to persistent User DIDs
360
+ *
361
+ * CRITICAL: Uses .nullish() to accept null, undefined, or OAuthIdentity
362
+ * This matches JSON parsing behavior where missing fields become null
360
363
  */
361
- oauth_identity: z.ZodOptional<z.ZodObject<{
364
+ oauth_identity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
362
365
  /**
363
366
  * OAuth provider name (e.g., "google", "github", "microsoft")
364
367
  */
@@ -386,7 +389,7 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
386
389
  subject: string;
387
390
  name?: string | undefined;
388
391
  email?: string | undefined;
389
- }>>;
392
+ }>>>;
390
393
  /**
391
394
  * User DID (optional)
392
395
  * If provided, represents the persistent User DID for this user
@@ -394,11 +397,11 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
394
397
  */
395
398
  user_did: z.ZodOptional<z.ZodString>;
396
399
  }, "strip", z.ZodTypeAny, {
397
- agent_did: string;
398
- project_id: string;
399
400
  tool: string;
400
401
  scopes: string[];
402
+ agent_did: string;
401
403
  session_id: string;
404
+ project_id: string;
402
405
  termsAccepted: boolean;
403
406
  customFields?: Record<string, string | boolean> | undefined;
404
407
  termsVersion?: string | undefined;
@@ -407,14 +410,14 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
407
410
  subject: string;
408
411
  name?: string | undefined;
409
412
  email?: string | undefined;
410
- } | undefined;
413
+ } | null | undefined;
411
414
  user_did?: string | undefined;
412
415
  }, {
413
- agent_did: string;
414
- project_id: string;
415
416
  tool: string;
416
417
  scopes: string[];
418
+ agent_did: string;
417
419
  session_id: string;
420
+ project_id: string;
418
421
  termsAccepted: boolean;
419
422
  customFields?: Record<string, string | boolean> | undefined;
420
423
  termsVersion?: string | undefined;
@@ -423,7 +426,7 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
423
426
  subject: string;
424
427
  name?: string | undefined;
425
428
  email?: string | undefined;
426
- } | undefined;
429
+ } | null | undefined;
427
430
  user_did?: string | undefined;
428
431
  }>;
429
432
  export type ConsentApprovalRequest = z.infer<typeof consentApprovalRequestSchema>;
@@ -723,11 +726,11 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
723
726
  * @returns Validation result
724
727
  */
725
728
  export declare function validateConsentApprovalRequest(request: unknown): z.SafeParseReturnType<{
726
- agent_did: string;
727
- project_id: string;
728
729
  tool: string;
729
730
  scopes: string[];
731
+ agent_did: string;
730
732
  session_id: string;
733
+ project_id: string;
731
734
  termsAccepted: boolean;
732
735
  customFields?: Record<string, string | boolean> | undefined;
733
736
  termsVersion?: string | undefined;
@@ -736,14 +739,14 @@ export declare function validateConsentApprovalRequest(request: unknown): z.Safe
736
739
  subject: string;
737
740
  name?: string | undefined;
738
741
  email?: string | undefined;
739
- } | undefined;
742
+ } | null | undefined;
740
743
  user_did?: string | undefined;
741
744
  }, {
742
- agent_did: string;
743
- project_id: string;
744
745
  tool: string;
745
746
  scopes: string[];
747
+ agent_did: string;
746
748
  session_id: string;
749
+ project_id: string;
747
750
  termsAccepted: boolean;
748
751
  customFields?: Record<string, string | boolean> | undefined;
749
752
  termsVersion?: string | undefined;
@@ -752,7 +755,7 @@ export declare function validateConsentApprovalRequest(request: unknown): z.Safe
752
755
  subject: string;
753
756
  name?: string | undefined;
754
757
  email?: string | undefined;
755
- } | undefined;
758
+ } | null | undefined;
756
759
  user_did?: string | undefined;
757
760
  }>;
758
761
  /**
@@ -152,8 +152,11 @@ exports.consentApprovalRequestSchema = zod_1.z.object({
152
152
  /**
153
153
  * OAuth provider identity information (optional)
154
154
  * Used to link OAuth accounts to persistent User DIDs
155
+ *
156
+ * CRITICAL: Uses .nullish() to accept null, undefined, or OAuthIdentity
157
+ * This matches JSON parsing behavior where missing fields become null
155
158
  */
156
- oauth_identity: exports.oauthIdentitySchema.optional(),
159
+ oauth_identity: exports.oauthIdentitySchema.nullish(),
157
160
  /**
158
161
  * User DID (optional)
159
162
  * If provided, represents the persistent User DID for this user
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kya-os/contracts",
3
- "version": "1.5.3-canary.3",
3
+ "version": "1.5.3-canary.4",
4
4
  "description": "Shared types and schemas for XMCP-I ecosystem",
5
5
  "type": "commonjs",
6
6
  "sideEffects": false,