@kya-os/consent 0.1.37 → 0.1.38

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline.js","sourceRoot":"","sources":["../../src/mcp-app/inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,sEAAsE;AACtE,MAAM,CAAC,MAAM,oBAAoB,GAAW,i8ysBAAi8ysB,CAAC;AAE9+ysB,4CAA4C;AAC5C,MAAM,CAAC,MAAM,yBAAyB,GAAW,MAAM,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * MCP Apps Consent Types
3
+ *
4
+ * Type definitions for the inline consent UI rendered via MCP Apps.
5
+ * These match the structuredContent shape produced by
6
+ * MCPIRuntimeBase.buildConsentUIResult().
7
+ */
8
+ /** Parameters passed via structuredContent from the runtime */
9
+ export interface ConsentParams {
10
+ type: "consent_required";
11
+ /** Auth mode: "consent-only" (default) or "credentials" (username/password form) */
12
+ authMode?: "consent-only" | "credentials";
13
+ tool: string;
14
+ scopes: string[];
15
+ agentDid: string;
16
+ agentName: string;
17
+ sessionId: string;
18
+ projectId: string;
19
+ resumeToken: string;
20
+ serverUrl: string;
21
+ /** Fallback URL if the iframe can't reach the server */
22
+ consentUrl: string;
23
+ /** Credential provider name (only present when authMode is "credentials") */
24
+ provider?: string;
25
+ }
26
+ /** Response from POST /consent/approve */
27
+ export interface ConsentApprovalResponse {
28
+ success: boolean;
29
+ delegation_id?: string;
30
+ delegation_token?: string;
31
+ error?: string;
32
+ error_code?: string;
33
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/mcp-app/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,+DAA+D;AAC/D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,kBAAkB,CAAC;IACzB,oFAAoF;IACpF,QAAQ,CAAC,EAAE,cAAc,GAAG,aAAa,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,0CAA0C;AAC1C,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * MCP Apps Consent Types
3
+ *
4
+ * Type definitions for the inline consent UI rendered via MCP Apps.
5
+ * These match the structuredContent shape produced by
6
+ * MCPIRuntimeBase.buildConsentUIResult().
7
+ */
8
+ export {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/mcp-app/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -82,8 +82,8 @@ export declare const ConsentApprovalRequestSchema: z.ZodObject<{
82
82
  auth_mode: "consent-only" | "credentials" | "oauth" | "magic-link" | "otp" | "qr-code" | "passkey" | "idv";
83
83
  provider_type: string;
84
84
  termsAccepted: boolean;
85
- customFields?: Record<string, string | boolean> | undefined;
86
85
  termsVersion?: string | undefined;
86
+ customFields?: Record<string, string | boolean> | undefined;
87
87
  oauth_identity?: {
88
88
  provider: string;
89
89
  subject: string;
@@ -100,10 +100,10 @@ export declare const ConsentApprovalRequestSchema: z.ZodObject<{
100
100
  session_id: string;
101
101
  project_id: string;
102
102
  termsAccepted: boolean;
103
- customFields?: Record<string, string | boolean> | undefined;
104
103
  auth_mode?: "consent-only" | "credentials" | "oauth" | "magic-link" | "otp" | "qr-code" | "passkey" | "idv" | undefined;
105
104
  provider_type?: string | undefined;
106
105
  termsVersion?: string | undefined;
106
+ customFields?: Record<string, string | boolean> | undefined;
107
107
  oauth_identity?: {
108
108
  provider: string;
109
109
  subject: string;
@@ -259,10 +259,10 @@ export declare const ConsentConfigAPIResponseSchema: z.ZodObject<{
259
259
  }>, "many">>;
260
260
  pattern: z.ZodOptional<z.ZodString>;
261
261
  }, "strip", z.ZodTypeAny, {
262
- type: "text" | "textarea" | "checkbox" | "select" | "email";
262
+ name: string;
263
+ type: "email" | "text" | "textarea" | "checkbox" | "select";
263
264
  required: boolean;
264
265
  label: string;
265
- name: string;
266
266
  options?: {
267
267
  value: string;
268
268
  label: string;
@@ -270,10 +270,10 @@ export declare const ConsentConfigAPIResponseSchema: z.ZodObject<{
270
270
  placeholder?: string | undefined;
271
271
  pattern?: string | undefined;
272
272
  }, {
273
- type: "text" | "textarea" | "checkbox" | "select" | "email";
273
+ name: string;
274
+ type: "email" | "text" | "textarea" | "checkbox" | "select";
274
275
  required: boolean;
275
276
  label: string;
276
- name: string;
277
277
  options?: {
278
278
  value: string;
279
279
  label: string;
@@ -281,10 +281,10 @@ export declare const ConsentConfigAPIResponseSchema: z.ZodObject<{
281
281
  placeholder?: string | undefined;
282
282
  pattern?: string | undefined;
283
283
  }>, {
284
- type: "text" | "textarea" | "checkbox" | "select" | "email";
284
+ name: string;
285
+ type: "email" | "text" | "textarea" | "checkbox" | "select";
285
286
  required: boolean;
286
287
  label: string;
287
- name: string;
288
288
  options?: {
289
289
  value: string;
290
290
  label: string;
@@ -292,10 +292,10 @@ export declare const ConsentConfigAPIResponseSchema: z.ZodObject<{
292
292
  placeholder?: string | undefined;
293
293
  pattern?: string | undefined;
294
294
  }, {
295
- type: "text" | "textarea" | "checkbox" | "select" | "email";
295
+ name: string;
296
+ type: "email" | "text" | "textarea" | "checkbox" | "select";
296
297
  required: boolean;
297
298
  label: string;
298
- name: string;
299
299
  options?: {
300
300
  value: string;
301
301
  label: string;
@@ -484,18 +484,25 @@ export declare const ConsentConfigAPIResponseSchema: z.ZodObject<{
484
484
  verificationType?: "document" | "selfie" | "both" | undefined;
485
485
  estimatedTime?: string | undefined;
486
486
  } | undefined;
487
- magicLink?: {
488
- buttonText?: string | undefined;
489
- enabled?: boolean | undefined;
490
- emailLabel?: string | undefined;
491
- emailPlaceholder?: string | undefined;
492
- resendCooldown?: number | undefined;
493
- } | undefined;
494
- qrCode?: {
495
- enabled?: boolean | undefined;
496
- instructions?: string | undefined;
497
- size?: number | undefined;
498
- showManualEntry?: boolean | undefined;
487
+ customFields?: {
488
+ name: string;
489
+ type: "email" | "text" | "textarea" | "checkbox" | "select";
490
+ required: boolean;
491
+ label: string;
492
+ options?: {
493
+ value: string;
494
+ label: string;
495
+ }[] | undefined;
496
+ placeholder?: string | undefined;
497
+ pattern?: string | undefined;
498
+ }[] | undefined;
499
+ success?: {
500
+ title?: string | undefined;
501
+ description?: string | undefined;
502
+ showCredential?: boolean | undefined;
503
+ redirectUrl?: string | undefined;
504
+ redirectDelay?: number | undefined;
505
+ continueButtonText?: string | undefined;
499
506
  } | undefined;
500
507
  branding?: {
501
508
  primaryColor?: string | undefined;
@@ -520,26 +527,19 @@ export declare const ConsentConfigAPIResponseSchema: z.ZodObject<{
520
527
  version?: string | undefined;
521
528
  required?: boolean | undefined;
522
529
  } | undefined;
523
- success?: {
524
- title?: string | undefined;
525
- description?: string | undefined;
526
- showCredential?: boolean | undefined;
527
- redirectUrl?: string | undefined;
528
- redirectDelay?: number | undefined;
529
- continueButtonText?: string | undefined;
530
+ magicLink?: {
531
+ buttonText?: string | undefined;
532
+ enabled?: boolean | undefined;
533
+ emailLabel?: string | undefined;
534
+ emailPlaceholder?: string | undefined;
535
+ resendCooldown?: number | undefined;
536
+ } | undefined;
537
+ qrCode?: {
538
+ enabled?: boolean | undefined;
539
+ instructions?: string | undefined;
540
+ size?: number | undefined;
541
+ showManualEntry?: boolean | undefined;
530
542
  } | undefined;
531
- customFields?: {
532
- type: "text" | "textarea" | "checkbox" | "select" | "email";
533
- required: boolean;
534
- label: string;
535
- name: string;
536
- options?: {
537
- value: string;
538
- label: string;
539
- }[] | undefined;
540
- placeholder?: string | undefined;
541
- pattern?: string | undefined;
542
- }[] | undefined;
543
543
  expirationDays?: number | undefined;
544
544
  metadata?: {
545
545
  version?: number | undefined;
@@ -582,18 +582,25 @@ export declare const ConsentConfigAPIResponseSchema: z.ZodObject<{
582
582
  verificationType?: "document" | "selfie" | "both" | undefined;
583
583
  estimatedTime?: string | undefined;
584
584
  } | undefined;
585
- magicLink?: {
586
- buttonText?: string | undefined;
587
- enabled?: boolean | undefined;
588
- emailLabel?: string | undefined;
589
- emailPlaceholder?: string | undefined;
590
- resendCooldown?: number | undefined;
591
- } | undefined;
592
- qrCode?: {
593
- enabled?: boolean | undefined;
594
- instructions?: string | undefined;
595
- size?: number | undefined;
596
- showManualEntry?: boolean | undefined;
585
+ customFields?: {
586
+ name: string;
587
+ type: "email" | "text" | "textarea" | "checkbox" | "select";
588
+ required: boolean;
589
+ label: string;
590
+ options?: {
591
+ value: string;
592
+ label: string;
593
+ }[] | undefined;
594
+ placeholder?: string | undefined;
595
+ pattern?: string | undefined;
596
+ }[] | undefined;
597
+ success?: {
598
+ title?: string | undefined;
599
+ description?: string | undefined;
600
+ showCredential?: boolean | undefined;
601
+ redirectUrl?: string | undefined;
602
+ redirectDelay?: number | undefined;
603
+ continueButtonText?: string | undefined;
597
604
  } | undefined;
598
605
  branding?: {
599
606
  primaryColor?: string | undefined;
@@ -618,26 +625,19 @@ export declare const ConsentConfigAPIResponseSchema: z.ZodObject<{
618
625
  version?: string | undefined;
619
626
  required?: boolean | undefined;
620
627
  } | undefined;
621
- success?: {
622
- title?: string | undefined;
623
- description?: string | undefined;
624
- showCredential?: boolean | undefined;
625
- redirectUrl?: string | undefined;
626
- redirectDelay?: number | undefined;
627
- continueButtonText?: string | undefined;
628
+ magicLink?: {
629
+ buttonText?: string | undefined;
630
+ enabled?: boolean | undefined;
631
+ emailLabel?: string | undefined;
632
+ emailPlaceholder?: string | undefined;
633
+ resendCooldown?: number | undefined;
634
+ } | undefined;
635
+ qrCode?: {
636
+ enabled?: boolean | undefined;
637
+ instructions?: string | undefined;
638
+ size?: number | undefined;
639
+ showManualEntry?: boolean | undefined;
628
640
  } | undefined;
629
- customFields?: {
630
- type: "text" | "textarea" | "checkbox" | "select" | "email";
631
- required: boolean;
632
- label: string;
633
- name: string;
634
- options?: {
635
- value: string;
636
- label: string;
637
- }[] | undefined;
638
- placeholder?: string | undefined;
639
- pattern?: string | undefined;
640
- }[] | undefined;
641
641
  expirationDays?: number | undefined;
642
642
  metadata?: {
643
643
  version?: number | undefined;
@@ -685,18 +685,25 @@ export declare const ConsentConfigAPIResponseSchema: z.ZodObject<{
685
685
  verificationType?: "document" | "selfie" | "both" | undefined;
686
686
  estimatedTime?: string | undefined;
687
687
  } | undefined;
688
- magicLink?: {
689
- buttonText?: string | undefined;
690
- enabled?: boolean | undefined;
691
- emailLabel?: string | undefined;
692
- emailPlaceholder?: string | undefined;
693
- resendCooldown?: number | undefined;
694
- } | undefined;
695
- qrCode?: {
696
- enabled?: boolean | undefined;
697
- instructions?: string | undefined;
698
- size?: number | undefined;
699
- showManualEntry?: boolean | undefined;
688
+ customFields?: {
689
+ name: string;
690
+ type: "email" | "text" | "textarea" | "checkbox" | "select";
691
+ required: boolean;
692
+ label: string;
693
+ options?: {
694
+ value: string;
695
+ label: string;
696
+ }[] | undefined;
697
+ placeholder?: string | undefined;
698
+ pattern?: string | undefined;
699
+ }[] | undefined;
700
+ success?: {
701
+ title?: string | undefined;
702
+ description?: string | undefined;
703
+ showCredential?: boolean | undefined;
704
+ redirectUrl?: string | undefined;
705
+ redirectDelay?: number | undefined;
706
+ continueButtonText?: string | undefined;
700
707
  } | undefined;
701
708
  branding?: {
702
709
  primaryColor?: string | undefined;
@@ -721,26 +728,19 @@ export declare const ConsentConfigAPIResponseSchema: z.ZodObject<{
721
728
  version?: string | undefined;
722
729
  required?: boolean | undefined;
723
730
  } | undefined;
724
- success?: {
725
- title?: string | undefined;
726
- description?: string | undefined;
727
- showCredential?: boolean | undefined;
728
- redirectUrl?: string | undefined;
729
- redirectDelay?: number | undefined;
730
- continueButtonText?: string | undefined;
731
+ magicLink?: {
732
+ buttonText?: string | undefined;
733
+ enabled?: boolean | undefined;
734
+ emailLabel?: string | undefined;
735
+ emailPlaceholder?: string | undefined;
736
+ resendCooldown?: number | undefined;
737
+ } | undefined;
738
+ qrCode?: {
739
+ enabled?: boolean | undefined;
740
+ instructions?: string | undefined;
741
+ size?: number | undefined;
742
+ showManualEntry?: boolean | undefined;
731
743
  } | undefined;
732
- customFields?: {
733
- type: "text" | "textarea" | "checkbox" | "select" | "email";
734
- required: boolean;
735
- label: string;
736
- name: string;
737
- options?: {
738
- value: string;
739
- label: string;
740
- }[] | undefined;
741
- placeholder?: string | undefined;
742
- pattern?: string | undefined;
743
- }[] | undefined;
744
744
  expirationDays?: number | undefined;
745
745
  metadata?: {
746
746
  version?: number | undefined;
@@ -787,18 +787,25 @@ export declare const ConsentConfigAPIResponseSchema: z.ZodObject<{
787
787
  verificationType?: "document" | "selfie" | "both" | undefined;
788
788
  estimatedTime?: string | undefined;
789
789
  } | undefined;
790
- magicLink?: {
791
- buttonText?: string | undefined;
792
- enabled?: boolean | undefined;
793
- emailLabel?: string | undefined;
794
- emailPlaceholder?: string | undefined;
795
- resendCooldown?: number | undefined;
796
- } | undefined;
797
- qrCode?: {
798
- enabled?: boolean | undefined;
799
- instructions?: string | undefined;
800
- size?: number | undefined;
801
- showManualEntry?: boolean | undefined;
790
+ customFields?: {
791
+ name: string;
792
+ type: "email" | "text" | "textarea" | "checkbox" | "select";
793
+ required: boolean;
794
+ label: string;
795
+ options?: {
796
+ value: string;
797
+ label: string;
798
+ }[] | undefined;
799
+ placeholder?: string | undefined;
800
+ pattern?: string | undefined;
801
+ }[] | undefined;
802
+ success?: {
803
+ title?: string | undefined;
804
+ description?: string | undefined;
805
+ showCredential?: boolean | undefined;
806
+ redirectUrl?: string | undefined;
807
+ redirectDelay?: number | undefined;
808
+ continueButtonText?: string | undefined;
802
809
  } | undefined;
803
810
  branding?: {
804
811
  primaryColor?: string | undefined;
@@ -823,26 +830,19 @@ export declare const ConsentConfigAPIResponseSchema: z.ZodObject<{
823
830
  version?: string | undefined;
824
831
  required?: boolean | undefined;
825
832
  } | undefined;
826
- success?: {
827
- title?: string | undefined;
828
- description?: string | undefined;
829
- showCredential?: boolean | undefined;
830
- redirectUrl?: string | undefined;
831
- redirectDelay?: number | undefined;
832
- continueButtonText?: string | undefined;
833
+ magicLink?: {
834
+ buttonText?: string | undefined;
835
+ enabled?: boolean | undefined;
836
+ emailLabel?: string | undefined;
837
+ emailPlaceholder?: string | undefined;
838
+ resendCooldown?: number | undefined;
839
+ } | undefined;
840
+ qrCode?: {
841
+ enabled?: boolean | undefined;
842
+ instructions?: string | undefined;
843
+ size?: number | undefined;
844
+ showManualEntry?: boolean | undefined;
833
845
  } | undefined;
834
- customFields?: {
835
- type: "text" | "textarea" | "checkbox" | "select" | "email";
836
- required: boolean;
837
- label: string;
838
- name: string;
839
- options?: {
840
- value: string;
841
- label: string;
842
- }[] | undefined;
843
- placeholder?: string | undefined;
844
- pattern?: string | undefined;
845
- }[] | undefined;
846
846
  expirationDays?: number | undefined;
847
847
  metadata?: {
848
848
  version?: number | undefined;
@@ -865,21 +865,21 @@ export declare const CredentialAuthRequestSchema: z.ZodObject<{
865
865
  provider: z.ZodString;
866
866
  remember_me: z.ZodOptional<z.ZodBoolean>;
867
867
  }, "strip", z.ZodTypeAny, {
868
- password: string;
869
868
  provider: string;
870
869
  agent_did: string;
871
870
  session_id: string;
872
871
  project_id: string;
873
872
  username: string;
873
+ password: string;
874
874
  csrf_token: string;
875
875
  remember_me?: boolean | undefined;
876
876
  }, {
877
- password: string;
878
877
  provider: string;
879
878
  agent_did: string;
880
879
  session_id: string;
881
880
  project_id: string;
882
881
  username: string;
882
+ password: string;
883
883
  csrf_token: string;
884
884
  remember_me?: boolean | undefined;
885
885
  }>;
@@ -952,8 +952,8 @@ export declare const ConsentPageConfigSchema: z.ZodEffects<z.ZodObject<{
952
952
  sessionId: string;
953
953
  projectId: string;
954
954
  serverUrl: string;
955
- autoClose?: boolean | undefined;
956
955
  provider?: string | undefined;
956
+ autoClose?: boolean | undefined;
957
957
  oauthRequired?: boolean | undefined;
958
958
  oauthUrl?: string | undefined;
959
959
  }, {
@@ -964,8 +964,8 @@ export declare const ConsentPageConfigSchema: z.ZodEffects<z.ZodObject<{
964
964
  sessionId: string;
965
965
  projectId: string;
966
966
  serverUrl: string;
967
- autoClose?: boolean | undefined;
968
967
  provider?: string | undefined;
968
+ autoClose?: boolean | undefined;
969
969
  oauthRequired?: boolean | undefined;
970
970
  oauthUrl?: string | undefined;
971
971
  }>, {
@@ -976,8 +976,8 @@ export declare const ConsentPageConfigSchema: z.ZodEffects<z.ZodObject<{
976
976
  sessionId: string;
977
977
  projectId: string;
978
978
  serverUrl: string;
979
- autoClose?: boolean | undefined;
980
979
  provider?: string | undefined;
980
+ autoClose?: boolean | undefined;
981
981
  oauthRequired?: boolean | undefined;
982
982
  oauthUrl?: string | undefined;
983
983
  }, {
@@ -988,8 +988,8 @@ export declare const ConsentPageConfigSchema: z.ZodEffects<z.ZodObject<{
988
988
  sessionId: string;
989
989
  projectId: string;
990
990
  serverUrl: string;
991
- autoClose?: boolean | undefined;
992
991
  provider?: string | undefined;
992
+ autoClose?: boolean | undefined;
993
993
  oauthRequired?: boolean | undefined;
994
994
  oauthUrl?: string | undefined;
995
995
  }>;