@kya-os/consent 0.1.48 → 0.1.50

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.
Files changed (135) hide show
  1. package/README.md +3 -0
  2. package/dist/bundle/inline.d.ts +1 -0
  3. package/dist/bundle/inline.d.ts.map +1 -1
  4. package/dist/bundle/inline.js +5 -4
  5. package/dist/bundle/inline.js.map +1 -1
  6. package/dist/bundle/shell.d.ts +6 -2
  7. package/dist/bundle/shell.d.ts.map +1 -1
  8. package/dist/bundle/shell.js +7 -3
  9. package/dist/bundle/shell.js.map +1 -1
  10. package/dist/cjs/bundle/inline.js +4 -4
  11. package/dist/cjs/bundle/inline.js.map +1 -1
  12. package/dist/cjs/bundle/shell.js +7 -3
  13. package/dist/cjs/bundle/shell.js.map +1 -1
  14. package/dist/cjs/components/consent-agent-header.js +10 -7
  15. package/dist/cjs/components/consent-agent-header.js.map +1 -1
  16. package/dist/cjs/components/consent-button.js +1 -1
  17. package/dist/cjs/components/consent-capabilities-screen.js +39 -16
  18. package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
  19. package/dist/cjs/components/consent-checkbox.js +2 -2
  20. package/dist/cjs/components/consent-connector-header.js +14 -3
  21. package/dist/cjs/components/consent-connector-header.js.map +1 -1
  22. package/dist/cjs/components/consent-revocation-notice.js +32 -6
  23. package/dist/cjs/components/consent-revocation-notice.js.map +1 -1
  24. package/dist/cjs/components/consent-shell.js +1 -1
  25. package/dist/cjs/components/consent-terms.js +2 -2
  26. package/dist/cjs/components/mcp-consent.js +126 -19
  27. package/dist/cjs/components/mcp-consent.js.map +1 -1
  28. package/dist/cjs/constants/colors.js +2 -2
  29. package/dist/cjs/constants/defaults.js +1 -1
  30. package/dist/cjs/copy/tokens.js +8 -1
  31. package/dist/cjs/copy/tokens.js.map +1 -1
  32. package/dist/cjs/index.js +1 -1
  33. package/dist/cjs/mcp-app/inline.js +2 -2
  34. package/dist/cjs/mcp-app/inline.js.map +1 -1
  35. package/dist/cjs/react/index.js +1 -1
  36. package/dist/cjs/resolution/resolve-config.js +3 -0
  37. package/dist/cjs/resolution/resolve-config.js.map +1 -1
  38. package/dist/cjs/schemas/api.schemas.js +2 -1
  39. package/dist/cjs/schemas/api.schemas.js.map +1 -1
  40. package/dist/cjs/schemas/config.schemas.js +1 -0
  41. package/dist/cjs/schemas/config.schemas.js.map +1 -1
  42. package/dist/cjs/styles/index.js +1 -1
  43. package/dist/cjs/styles/theme.js +29 -1
  44. package/dist/cjs/styles/theme.js.map +1 -1
  45. package/dist/cjs/styles/tokens.js +8 -8
  46. package/dist/cjs/styles/tokens.js.map +1 -1
  47. package/dist/cjs/templates/base/components.js +1 -1
  48. package/dist/cjs/templates/modes/credentials.template.js +6 -6
  49. package/dist/cjs/templates/modes/credentials.template.js.map +1 -1
  50. package/dist/cjs/templates/registry.js +3 -3
  51. package/dist/cjs/types/index.js +1 -1
  52. package/dist/cjs/types/modes.types.js +3 -3
  53. package/dist/components/consent-agent-header.d.ts.map +1 -1
  54. package/dist/components/consent-agent-header.js +10 -7
  55. package/dist/components/consent-agent-header.js.map +1 -1
  56. package/dist/components/consent-button.d.ts +1 -1
  57. package/dist/components/consent-button.js +1 -1
  58. package/dist/components/consent-capabilities-screen.d.ts +3 -0
  59. package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
  60. package/dist/components/consent-capabilities-screen.js +39 -16
  61. package/dist/components/consent-capabilities-screen.js.map +1 -1
  62. package/dist/components/consent-checkbox.js +2 -2
  63. package/dist/components/consent-connector-header.d.ts.map +1 -1
  64. package/dist/components/consent-connector-header.js +14 -3
  65. package/dist/components/consent-connector-header.js.map +1 -1
  66. package/dist/components/consent-revocation-notice.d.ts +10 -1
  67. package/dist/components/consent-revocation-notice.d.ts.map +1 -1
  68. package/dist/components/consent-revocation-notice.js +32 -6
  69. package/dist/components/consent-revocation-notice.js.map +1 -1
  70. package/dist/components/consent-shell.js +1 -1
  71. package/dist/components/consent-terms.js +2 -2
  72. package/dist/components/mcp-consent.d.ts +10 -2
  73. package/dist/components/mcp-consent.d.ts.map +1 -1
  74. package/dist/components/mcp-consent.js +126 -19
  75. package/dist/components/mcp-consent.js.map +1 -1
  76. package/dist/consent.js +227 -53
  77. package/dist/consent.min.js +154 -77
  78. package/dist/constants/colors.d.ts +2 -2
  79. package/dist/constants/colors.js +2 -2
  80. package/dist/constants/defaults.d.ts +1 -1
  81. package/dist/constants/defaults.js +1 -1
  82. package/dist/copy/tokens.d.ts +8 -1
  83. package/dist/copy/tokens.d.ts.map +1 -1
  84. package/dist/copy/tokens.js +8 -1
  85. package/dist/copy/tokens.js.map +1 -1
  86. package/dist/index.d.ts +1 -1
  87. package/dist/index.js +1 -1
  88. package/dist/mcp-app/index.d.ts +1 -0
  89. package/dist/mcp-app/index.js +1 -0
  90. package/dist/mcp-app/inline.d.ts +1 -0
  91. package/dist/mcp-app/inline.d.ts.map +1 -1
  92. package/dist/mcp-app/inline.js +3 -2
  93. package/dist/mcp-app/inline.js.map +1 -1
  94. package/dist/mcp-app/types.d.ts +1 -0
  95. package/dist/mcp-app/types.js +1 -0
  96. package/dist/react/index.d.ts +1 -1
  97. package/dist/react/index.js +1 -1
  98. package/dist/resolution/resolve-config.d.ts.map +1 -1
  99. package/dist/resolution/resolve-config.js +3 -0
  100. package/dist/resolution/resolve-config.js.map +1 -1
  101. package/dist/schemas/api.schemas.d.ts +11 -1
  102. package/dist/schemas/api.schemas.d.ts.map +1 -1
  103. package/dist/schemas/api.schemas.js +2 -1
  104. package/dist/schemas/api.schemas.js.map +1 -1
  105. package/dist/schemas/config.schemas.d.ts +6 -0
  106. package/dist/schemas/config.schemas.d.ts.map +1 -1
  107. package/dist/schemas/config.schemas.js +1 -0
  108. package/dist/schemas/config.schemas.js.map +1 -1
  109. package/dist/styles/index.d.ts +1 -1
  110. package/dist/styles/index.js +1 -1
  111. package/dist/styles/theme.d.ts +32 -1
  112. package/dist/styles/theme.d.ts.map +1 -1
  113. package/dist/styles/theme.js +29 -1
  114. package/dist/styles/theme.js.map +1 -1
  115. package/dist/styles/tokens.d.ts +5 -5
  116. package/dist/styles/tokens.js +8 -8
  117. package/dist/styles/tokens.js.map +1 -1
  118. package/dist/templates/base/components.d.ts +1 -1
  119. package/dist/templates/base/components.js +1 -1
  120. package/dist/templates/modes/credentials.template.d.ts +5 -5
  121. package/dist/templates/modes/credentials.template.js +6 -6
  122. package/dist/templates/modes/credentials.template.js.map +1 -1
  123. package/dist/templates/registry.d.ts +3 -3
  124. package/dist/templates/registry.js +3 -3
  125. package/dist/types/api.types.d.ts +3 -1
  126. package/dist/types/api.types.d.ts.map +1 -1
  127. package/dist/types/config.types.d.ts +11 -2
  128. package/dist/types/config.types.d.ts.map +1 -1
  129. package/dist/types/index.d.ts +1 -1
  130. package/dist/types/index.js +1 -1
  131. package/dist/types/modes.types.d.ts +3 -3
  132. package/dist/types/modes.types.js +3 -3
  133. package/dist/types/page.types.d.ts +1 -1
  134. package/dist/types/page.types.d.ts.map +1 -1
  135. package/package.json +6 -5
package/dist/consent.js CHANGED
@@ -662,7 +662,7 @@ ConsentButton.styles = i`
662
662
  }
663
663
 
664
664
  button {
665
- /* Base styles - matches AgentShield PreviewButton exactly */
665
+ /* Base styles - matches Checkpoint PreviewButton exactly */
666
666
  padding: 0.75rem 1rem;
667
667
  height: 2.75rem;
668
668
  border-radius: 0.5rem;
@@ -819,14 +819,14 @@ ConsentCheckbox.styles = i`
819
819
  opacity: 0.6;
820
820
  }
821
821
 
822
- /* Custom checkbox styling - matches AgentShield exactly */
822
+ /* Custom checkbox styling - matches Checkpoint exactly */
823
823
  input[type='checkbox'] {
824
824
  /* Reset */
825
825
  appearance: none;
826
826
  -webkit-appearance: none;
827
827
  margin: 0;
828
828
 
829
- /* Size - matches AgentShield w-4 h-4 */
829
+ /* Size - matches Checkpoint w-4 h-4 */
830
830
  width: 1rem;
831
831
  height: 1rem;
832
832
  min-width: 1rem;
@@ -1259,7 +1259,7 @@ ConsentShell.styles = i`
1259
1259
  --_secondary: var(--consent-secondary, #dbeafe);
1260
1260
  }
1261
1261
 
1262
- /* Container - matches AgentShield PreviewShell exactly */
1262
+ /* Container - matches Checkpoint PreviewShell exactly */
1263
1263
  .container {
1264
1264
  background: white;
1265
1265
  border-radius: 20px;
@@ -1813,13 +1813,13 @@ ConsentTerms.styles = i`
1813
1813
  opacity: 0.6;
1814
1814
  }
1815
1815
 
1816
- /* Custom checkbox styling - matches AgentShield exactly */
1816
+ /* Custom checkbox styling - matches Checkpoint exactly */
1817
1817
  input[type='checkbox'] {
1818
1818
  appearance: none;
1819
1819
  -webkit-appearance: none;
1820
1820
  margin: 0;
1821
1821
 
1822
- /* Size - matches AgentShield w-4 h-4 */
1822
+ /* Size - matches Checkpoint w-4 h-4 */
1823
1823
  width: 1rem;
1824
1824
  height: 1rem;
1825
1825
  min-width: 1rem;
@@ -2634,7 +2634,7 @@ var CONSENT_COPY_TOKENS = {
2634
2634
  },
2635
2635
  subhead: {
2636
2636
  /** `{Agent}` → agent display name. */
2637
- template: "Pick what {Agent} is allowed to do on your behalf. You stay in charge \u2014 change or cancel anytime."
2637
+ template: "Pick what {Agent} is allowed to do on your behalf. You stay in charge: change or cancel anytime."
2638
2638
  },
2639
2639
  agentTile: {
2640
2640
  verifiedPill: "Verified",
@@ -2669,7 +2669,14 @@ var CONSENT_COPY_TOKENS = {
2669
2669
  */
2670
2670
  revocationTemplate: "You can change or revoke any of these permissions anytime under {RevocationPath} at {Org}.",
2671
2671
  /** `{Days}` → inactivity days, default 90. */
2672
- inactivityTemplate: "Permissions automatically expire after {Days} days of inactivity."
2672
+ inactivityTemplate: "Permissions automatically expire after {Days} days of inactivity.",
2673
+ /** Native authorization follows the issued grant's fixed deadline. */
2674
+ fixedExpiryNotice: "Permissions expire at the time shown after approval. Continued use does not extend them.",
2675
+ /**
2676
+ * Grants with a fixed lifetime set by the server (a delegation mandate).
2677
+ * `{Duration}` → "1 day" or "N days".
2678
+ */
2679
+ fixedDurationTemplate: "Permissions expire {Duration} after approval. Continued use does not extend them."
2673
2680
  },
2674
2681
  actions: {
2675
2682
  /** Light theme primary. `{Agent}` → agent display name. */
@@ -2771,30 +2778,33 @@ ConsentAgentHeader.styles = i`
2771
2778
  border: 1px solid var(--cs-surface-border, transparent);
2772
2779
  }
2773
2780
 
2781
+ /* Agent tile: white with a light border in every theme, 44px outside. */
2774
2782
  .logo {
2783
+ box-sizing: border-box;
2775
2784
  width: 44px;
2776
2785
  height: 44px;
2777
2786
  border-radius: 12px;
2778
2787
  flex-shrink: 0;
2779
- background: var(--cs-surface-card, #fff);
2788
+ background: var(--cs-agent-tile-bg, #FFFFFF);
2780
2789
  display: flex;
2781
2790
  align-items: center;
2782
2791
  justify-content: center;
2783
2792
  overflow: hidden;
2784
- border: 1px solid var(--cs-surface-border, transparent);
2793
+ border: 1px solid var(--cs-agent-tile-border, rgba(15, 23, 42, 0.08));
2785
2794
  }
2786
2795
 
2796
+ /* Contained, not cropped: 28px leaves an 8px inset inside the 44px tile. */
2787
2797
  .logo img {
2788
- width: 100%;
2789
- height: 100%;
2790
- object-fit: cover;
2798
+ width: 28px;
2799
+ height: 28px;
2800
+ object-fit: contain;
2791
2801
  }
2792
2802
 
2793
2803
  .logo .placeholder {
2794
2804
  width: 100%;
2795
2805
  height: 100%;
2796
- background: var(--cs-surface-accent, #0F172A);
2797
- color: var(--cs-surface-accent-text, #fff);
2806
+ background: transparent;
2807
+ color: var(--cs-agent-tile-text, #0F172A);
2798
2808
  display: flex;
2799
2809
  align-items: center;
2800
2810
  justify-content: center;
@@ -3671,16 +3681,14 @@ var ConsentRevocationNotice = class extends i4 {
3671
3681
  this.revocationPath = "Account \u2192 Connected Agents";
3672
3682
  this.orgName = "this site";
3673
3683
  this.inactivityDays = 90;
3684
+ this.fixedExpiry = false;
3674
3685
  }
3675
3686
  render() {
3676
3687
  const revoke = formatToken(CONSENT_COPY_TOKENS.footer.revocationTemplate, {
3677
3688
  RevocationPath: this.revocationPath,
3678
3689
  Org: this.orgName
3679
3690
  });
3680
- const inactivity = formatToken(
3681
- CONSENT_COPY_TOKENS.footer.inactivityTemplate,
3682
- { Days: this.inactivityDays }
3683
- );
3691
+ const expiry = this.expiryCopy();
3684
3692
  return b2`
3685
3693
  <svg
3686
3694
  class="icon"
@@ -3697,10 +3705,22 @@ var ConsentRevocationNotice = class extends i4 {
3697
3705
  </svg>
3698
3706
  <div class="content">
3699
3707
  <span>${revoke}</span>
3700
- <span>${inactivity}</span>
3708
+ <span>${expiry}</span>
3701
3709
  </div>
3702
3710
  `;
3703
3711
  }
3712
+ expiryCopy() {
3713
+ if (this.fixedExpiry) return CONSENT_COPY_TOKENS.footer.fixedExpiryNotice;
3714
+ const fixedDays = this.fixedExpiryDays;
3715
+ if (fixedDays !== void 0 && Number.isInteger(fixedDays) && fixedDays > 0) {
3716
+ return formatToken(CONSENT_COPY_TOKENS.footer.fixedDurationTemplate, {
3717
+ Duration: fixedDays === 1 ? "1 day" : `${fixedDays} days`
3718
+ });
3719
+ }
3720
+ return formatToken(CONSENT_COPY_TOKENS.footer.inactivityTemplate, {
3721
+ Days: this.inactivityDays
3722
+ });
3723
+ }
3704
3724
  };
3705
3725
  ConsentRevocationNotice.styles = i`
3706
3726
  :host {
@@ -3709,7 +3729,7 @@ ConsentRevocationNotice.styles = i`
3709
3729
  gap: 10px;
3710
3730
  padding: 12px 14px;
3711
3731
  border-radius: 12px;
3712
- background: var(--cs-surface-inset, #F1ECE2);
3732
+ background: var(--cs-surface-inset, #f1ece2);
3713
3733
  color: var(--cs-text-secondary, #334155);
3714
3734
  font-size: 12.5px;
3715
3735
  line-height: 1.5;
@@ -3720,7 +3740,7 @@ ConsentRevocationNotice.styles = i`
3720
3740
  height: 16px;
3721
3741
  flex-shrink: 0;
3722
3742
  margin-top: 2px;
3723
- color: var(--cs-text-tertiary, #64748B);
3743
+ color: var(--cs-text-tertiary, #64748b);
3724
3744
  }
3725
3745
 
3726
3746
  .content {
@@ -3731,7 +3751,7 @@ ConsentRevocationNotice.styles = i`
3731
3751
 
3732
3752
  em {
3733
3753
  font-style: normal;
3734
- color: var(--cs-text-primary, #0F172A);
3754
+ color: var(--cs-text-primary, #0f172a);
3735
3755
  font-weight: 500;
3736
3756
  }
3737
3757
  `;
@@ -3744,6 +3764,12 @@ __decorateClass([
3744
3764
  __decorateClass([
3745
3765
  n4({ type: Number })
3746
3766
  ], ConsentRevocationNotice.prototype, "inactivityDays", 2);
3767
+ __decorateClass([
3768
+ n4({ type: Boolean, attribute: "fixed-expiry" })
3769
+ ], ConsentRevocationNotice.prototype, "fixedExpiry", 2);
3770
+ __decorateClass([
3771
+ n4({ type: Number, attribute: "fixed-expiry-days" })
3772
+ ], ConsentRevocationNotice.prototype, "fixedExpiryDays", 2);
3747
3773
  ConsentRevocationNotice = __decorateClass([
3748
3774
  t3("consent-revocation-notice")
3749
3775
  ], ConsentRevocationNotice);
@@ -3849,9 +3875,12 @@ ConsentConnectorHeader.styles = i`
3849
3875
  border: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.08));
3850
3876
  }
3851
3877
 
3878
+ /* Agent tile: white with a light border in every theme. border-box keeps
3879
+ it 56px outside; the shared .tile (server) box is left unchanged. */
3852
3880
  .tile.client {
3853
- background: var(--cs-surface-accent, #0F172A);
3854
- border-color: transparent;
3881
+ box-sizing: border-box;
3882
+ background: var(--cs-agent-tile-bg, #FFFFFF);
3883
+ border: 1px solid var(--cs-agent-tile-border, rgba(15, 23, 42, 0.08));
3855
3884
  }
3856
3885
 
3857
3886
  .tile img {
@@ -3860,6 +3889,14 @@ ConsentConnectorHeader.styles = i`
3860
3889
  object-fit: cover;
3861
3890
  }
3862
3891
 
3892
+ /* Agent marks are contained, not cropped: 36px leaves a 10px inset inside
3893
+ the centred 56px tile, so non-square logos keep their full shape. */
3894
+ .tile.client img {
3895
+ width: 36px;
3896
+ height: 36px;
3897
+ object-fit: contain;
3898
+ }
3899
+
3863
3900
  .tile .monogram {
3864
3901
  width: 100%;
3865
3902
  height: 100%;
@@ -3871,7 +3908,7 @@ ConsentConnectorHeader.styles = i`
3871
3908
  }
3872
3909
 
3873
3910
  .tile.client .monogram {
3874
- color: var(--cs-surface-accent-text, #fff);
3911
+ color: var(--cs-agent-tile-text, #0F172A);
3875
3912
  }
3876
3913
 
3877
3914
  .tile.server .monogram {
@@ -3948,6 +3985,9 @@ ConsentConnectorHeader = __decorateClass([
3948
3985
  // src/styles/theme.ts
3949
3986
  var FIXED_RISK_CHIP_BG = "#FCE7B6";
3950
3987
  var FIXED_RISK_CHIP_TEXT = "#7A4F00";
3988
+ var FIXED_AGENT_TILE_BG = "#FFFFFF";
3989
+ var FIXED_AGENT_TILE_BORDER = "rgba(15, 23, 42, 0.08)";
3990
+ var FIXED_AGENT_TILE_TEXT = "#0F172A";
3951
3991
  var lightTheme = {
3952
3992
  surfaceBg: "#F4F1EA",
3953
3993
  surfaceCard: "#FFFFFF",
@@ -3965,7 +4005,10 @@ var lightTheme = {
3965
4005
  chipRiskBg: FIXED_RISK_CHIP_BG,
3966
4006
  chipRiskText: FIXED_RISK_CHIP_TEXT,
3967
4007
  focusRing: "rgba(15, 23, 42, 0.35)",
3968
- cardShadow: "0 30px 80px -40px rgba(15, 23, 42, 0.40)"
4008
+ cardShadow: "0 30px 80px -40px rgba(15, 23, 42, 0.40)",
4009
+ agentTileBg: FIXED_AGENT_TILE_BG,
4010
+ agentTileBorder: FIXED_AGENT_TILE_BORDER,
4011
+ agentTileText: FIXED_AGENT_TILE_TEXT
3969
4012
  };
3970
4013
  var darkTheme = {
3971
4014
  surfaceBg: "#0B0808",
@@ -3984,14 +4027,23 @@ var darkTheme = {
3984
4027
  chipRiskBg: FIXED_RISK_CHIP_BG,
3985
4028
  chipRiskText: FIXED_RISK_CHIP_TEXT,
3986
4029
  focusRing: "rgba(248, 250, 252, 0.55)",
3987
- cardShadow: "0 40px 90px -40px rgba(0, 0, 0, 0.85)"
4030
+ cardShadow: "0 40px 90px -40px rgba(0, 0, 0, 0.85)",
4031
+ agentTileBg: FIXED_AGENT_TILE_BG,
4032
+ agentTileBorder: FIXED_AGENT_TILE_BORDER,
4033
+ agentTileText: FIXED_AGENT_TILE_TEXT
3988
4034
  };
3989
4035
  function getConsentTheme(theme) {
3990
4036
  return theme === "dark" ? darkTheme : lightTheme;
3991
4037
  }
3992
4038
  function themeToCssVariables(tokens) {
4039
+ const resolved = {
4040
+ ...tokens,
4041
+ agentTileBg: tokens.agentTileBg ?? FIXED_AGENT_TILE_BG,
4042
+ agentTileBorder: tokens.agentTileBorder ?? FIXED_AGENT_TILE_BORDER,
4043
+ agentTileText: tokens.agentTileText ?? FIXED_AGENT_TILE_TEXT
4044
+ };
3993
4045
  const declarations = [];
3994
- for (const [key, value] of Object.entries(tokens)) {
4046
+ for (const [key, value] of Object.entries(resolved)) {
3995
4047
  declarations.push(` --cs-${camelToKebab(key)}: ${value};`);
3996
4048
  }
3997
4049
  return declarations.join("\n");
@@ -4107,6 +4159,7 @@ var ConsentCapabilitiesScreen = class extends i4 {
4107
4159
  this.headlineVerb = "use";
4108
4160
  this.revocationPath = "Account \u2192 Connected Agents";
4109
4161
  this.inactivityDays = 90;
4162
+ this.fixedExpiry = false;
4110
4163
  this.theme = "light";
4111
4164
  this.howItWorksUrl = "";
4112
4165
  this.loading = false;
@@ -4128,9 +4181,11 @@ var ConsentCapabilitiesScreen = class extends i4 {
4128
4181
  */
4129
4182
  this.seedKey = "";
4130
4183
  this.onCapabilityToggle = (event) => {
4131
- if (this.loading || this.disabled || !(event instanceof CustomEvent)) return;
4184
+ if (this.loading || this.disabled || !(event instanceof CustomEvent))
4185
+ return;
4132
4186
  const detail = event.detail;
4133
- if (!detail || typeof detail !== "object" || !("id" in detail) || typeof detail.id !== "string" || !("checked" in detail) || typeof detail.checked !== "boolean" || !this.capabilities.some((capability) => capability.id === detail.id)) return;
4187
+ if (!detail || typeof detail !== "object" || !("id" in detail) || typeof detail.id !== "string" || !("checked" in detail) || typeof detail.checked !== "boolean" || !this.capabilities.some((capability) => capability.id === detail.id))
4188
+ return;
4134
4189
  const next = new Set(this.selected);
4135
4190
  if (detail.checked) next.add(detail.id);
4136
4191
  else next.delete(detail.id);
@@ -4138,10 +4193,14 @@ var ConsentCapabilitiesScreen = class extends i4 {
4138
4193
  };
4139
4194
  this.onAllow = () => {
4140
4195
  if (this.loading || this.approvalDisabled) return;
4141
- const selectedCapabilities = this.capabilities.filter((c4) => this.selected.has(c4.id));
4196
+ const selectedCapabilities = this.capabilities.filter(
4197
+ (c4) => this.selected.has(c4.id)
4198
+ );
4142
4199
  if (selectedCapabilities.length === 0) return;
4143
4200
  const selectedIds = selectedCapabilities.map((c4) => c4.id);
4144
- const selectedScopes = Array.from(new Set(selectedCapabilities.flatMap((c4) => c4.scopes)));
4201
+ const selectedScopes = Array.from(
4202
+ new Set(selectedCapabilities.flatMap((c4) => c4.scopes))
4203
+ );
4145
4204
  const detail = {
4146
4205
  selectedCapabilityIds: selectedIds,
4147
4206
  selectedScopes
@@ -4190,7 +4249,9 @@ var ConsentCapabilitiesScreen = class extends i4 {
4190
4249
  return `:host { ${themeToCssVariables(getConsentTheme(this.theme))} }`;
4191
4250
  }
4192
4251
  get approvalDisabled() {
4193
- return this.disabled || this.allowDisabled || this.selected.size === 0 || this.requireAll && this.capabilities.some((capability) => !this.selected.has(capability.id));
4252
+ return this.disabled || this.allowDisabled || this.selected.size === 0 || this.requireAll && this.capabilities.some(
4253
+ (capability) => !this.selected.has(capability.id)
4254
+ );
4194
4255
  }
4195
4256
  compileCapabilityCedar(capability) {
4196
4257
  const cedar = capability.cedar?.trim() || "";
@@ -4199,7 +4260,10 @@ var ConsentCapabilitiesScreen = class extends i4 {
4199
4260
  return cedar;
4200
4261
  }
4201
4262
  try {
4202
- return compileSingleCapability({ ...capability, cedar }, this.cedarContext);
4263
+ return compileSingleCapability(
4264
+ { ...capability, cedar },
4265
+ this.cedarContext
4266
+ );
4203
4267
  } catch {
4204
4268
  return cedar;
4205
4269
  }
@@ -4213,7 +4277,10 @@ var ConsentCapabilitiesScreen = class extends i4 {
4213
4277
  Org: "@@ORG@@"
4214
4278
  });
4215
4279
  const escaped = escapeHtml(raw);
4216
- const withSerifEntities = escaped.replace("@@AGENT@@", `<em>${escapeHtml(agentName)}</em>`).replace("@@ORG@@", `<em>${escapeHtml(this.orgName || "this site")}</em>`);
4280
+ const withSerifEntities = escaped.replace("@@AGENT@@", `<em>${escapeHtml(agentName)}</em>`).replace(
4281
+ "@@ORG@@",
4282
+ `<em>${escapeHtml(this.orgName || "this site")}</em>`
4283
+ );
4217
4284
  return b2`<h1
4218
4285
  class="headline"
4219
4286
  part="headline"
@@ -4242,7 +4309,9 @@ var ConsentCapabilitiesScreen = class extends i4 {
4242
4309
  logo-dev-token="${this.logoDevToken}"
4243
4310
  ></consent-connector-header>
4244
4311
  <div class="card" part="card">
4245
- <span class="eyebrow" part="eyebrow">${tokens.eyebrow.permissionRequest}</span>
4312
+ <span class="eyebrow" part="eyebrow"
4313
+ >${tokens.eyebrow.permissionRequest}</span
4314
+ >
4246
4315
  ${this.renderHeadline()}
4247
4316
  <p class="subhead" part="subhead">${subhead}</p>
4248
4317
  <slot name="identity"></slot>
@@ -4255,6 +4324,7 @@ var ConsentCapabilitiesScreen = class extends i4 {
4255
4324
  logoUrl="${this.agentMetadata.logoUrl || ""}"
4256
4325
  connectedAt="${this.agentMetadata.connectedAt || ""}"
4257
4326
  ></consent-agent-header>` : A}
4327
+ <slot name="agent-key"></slot>
4258
4328
  <div part="permissions">
4259
4329
  <div class="section-header">
4260
4330
  <span>${sectionHeader}</span>
@@ -4280,11 +4350,15 @@ var ConsentCapabilitiesScreen = class extends i4 {
4280
4350
  </div>
4281
4351
  <slot name="auth"></slot>
4282
4352
  <slot name="details"></slot>
4283
- <slot name="notice"><consent-revocation-notice
4284
- revocationPath="${this.revocationPath}"
4285
- orgName="${this.orgName || "this site"}"
4286
- inactivityDays=${this.inactivityDays}
4287
- ></consent-revocation-notice></slot>
4353
+ <slot name="notice"
4354
+ ><consent-revocation-notice
4355
+ revocationPath="${this.revocationPath}"
4356
+ orgName="${this.orgName || "this site"}"
4357
+ inactivityDays=${this.inactivityDays}
4358
+ ?fixed-expiry=${this.fixedExpiry}
4359
+ fixed-expiry-days=${this.fixedExpiryDays ?? A}
4360
+ ></consent-revocation-notice
4361
+ ></slot>
4288
4362
  <consent-action-bar
4289
4363
  part="actions"
4290
4364
  agentName="${agentName}"
@@ -4297,10 +4371,12 @@ var ConsentCapabilitiesScreen = class extends i4 {
4297
4371
  @consent-allow=${this.onAllow}
4298
4372
  @consent-deny=${this.onDeny}
4299
4373
  ></consent-action-bar>
4300
- <slot name="footer"><consent-footer
4301
- theme="${this.theme}"
4302
- howItWorksUrl="${this.howItWorksUrl}"
4303
- ></consent-footer></slot>
4374
+ <slot name="footer"
4375
+ ><consent-footer
4376
+ theme="${this.theme}"
4377
+ howItWorksUrl="${this.howItWorksUrl}"
4378
+ ></consent-footer
4379
+ ></slot>
4304
4380
  </div>
4305
4381
  `;
4306
4382
  }
@@ -4409,6 +4485,12 @@ __decorateClass([
4409
4485
  __decorateClass([
4410
4486
  n4({ type: Number })
4411
4487
  ], ConsentCapabilitiesScreen.prototype, "inactivityDays", 2);
4488
+ __decorateClass([
4489
+ n4({ type: Boolean, attribute: "fixed-expiry" })
4490
+ ], ConsentCapabilitiesScreen.prototype, "fixedExpiry", 2);
4491
+ __decorateClass([
4492
+ n4({ type: Number, attribute: "fixed-expiry-days" })
4493
+ ], ConsentCapabilitiesScreen.prototype, "fixedExpiryDays", 2);
4412
4494
  __decorateClass([
4413
4495
  n4({ type: String })
4414
4496
  ], ConsentCapabilitiesScreen.prototype, "theme", 2);
@@ -4711,6 +4793,8 @@ function resolveConsentConfig(config, agentName) {
4711
4793
  success,
4712
4794
  customFields,
4713
4795
  expirationDays,
4796
+ // Passthrough: set only when the server bound a delegation mandate.
4797
+ fixedExpiryDays: config?.fixedExpiryDays,
4714
4798
  authMode,
4715
4799
  // Passthrough mode configs
4716
4800
  credentials: config?.credentials,
@@ -4805,6 +4889,7 @@ var McpConsent = class extends i4 {
4805
4889
  this.scopes = [];
4806
4890
  this.agentDid = "";
4807
4891
  this.sessionId = "";
4892
+ this.anchorSid = "";
4808
4893
  this.projectId = "";
4809
4894
  this.serverUrl = "";
4810
4895
  this.agentName = "";
@@ -4816,6 +4901,7 @@ var McpConsent = class extends i4 {
4816
4901
  this.credentialUserEmail = "";
4817
4902
  this.credentialProviderUserId = "";
4818
4903
  this.oauthUrl = "";
4904
+ this.nativeScopeSelection = false;
4819
4905
  this.capabilities = [];
4820
4906
  this.orgName = "";
4821
4907
  this.headlineVerb = "use";
@@ -5016,7 +5102,7 @@ var McpConsent = class extends i4 {
5016
5102
  formData.append(
5017
5103
  "scopes",
5018
5104
  JSON.stringify(
5019
- this.identityAssertion ? this.scopes : this.selectedScopes
5105
+ this.identityAssertion && !this.nativeScopeSelection ? this.scopes : this.selectedScopes
5020
5106
  )
5021
5107
  );
5022
5108
  formData.append("agent_did", this.agentDid);
@@ -5024,6 +5110,7 @@ var McpConsent = class extends i4 {
5024
5110
  formData.append("agent_name", this.agentName);
5025
5111
  }
5026
5112
  formData.append("session_id", this.sessionId);
5113
+ if (this.anchorSid) formData.append("sid", this.anchorSid);
5027
5114
  formData.append("project_id", this.projectId);
5028
5115
  formData.append("auth_mode", this.currentMode);
5029
5116
  formData.append("provider_type", this.getProviderType());
@@ -5087,6 +5174,10 @@ var McpConsent = class extends i4 {
5087
5174
  window.location.href = result.redirectUrl;
5088
5175
  return;
5089
5176
  }
5177
+ if (this.nativeScopeSelection) {
5178
+ const expiresAt = result.expires_at;
5179
+ this.issuedExpiresAt = Number.isSafeInteger(expiresAt) && expiresAt > 0 && Number.isFinite(new Date(expiresAt * 1e3).getTime()) ? expiresAt : void 0;
5180
+ }
5090
5181
  this.step = "success";
5091
5182
  this.dispatchEvent(
5092
5183
  new CustomEvent("mcp-consent:approve", {
@@ -5153,6 +5244,16 @@ var McpConsent = class extends i4 {
5153
5244
  );
5154
5245
  }
5155
5246
  // === RENDER METHODS ===
5247
+ renderNativeAgentKey() {
5248
+ if (!this.nativeScopeSelection || !this.agentDid) return A;
5249
+ return b2`
5250
+ <section class="agent-key" aria-label="Agent key">
5251
+ <p><strong>Agent key</strong></p>
5252
+ <p>This permission is bound to this key.</p>
5253
+ <code>${this.agentDid}</code>
5254
+ </section>
5255
+ `;
5256
+ }
5156
5257
  renderAgentInfo() {
5157
5258
  const agentDisplay = this.agentName || "this agent";
5158
5259
  return b2`
@@ -5177,6 +5278,7 @@ var McpConsent = class extends i4 {
5177
5278
  </p>
5178
5279
  </div>
5179
5280
  </div>
5281
+ ${this.renderNativeAgentKey()}
5180
5282
  `;
5181
5283
  }
5182
5284
  handlePermissionsChange(e8) {
@@ -5184,7 +5286,7 @@ var McpConsent = class extends i4 {
5184
5286
  }
5185
5287
  renderPermissions() {
5186
5288
  if (this.scopes.length === 0) return A;
5187
- const interactive = shouldRenderScopesInteractive(this.identityAssertion);
5289
+ const interactive = this.nativeScopeSelection || shouldRenderScopesInteractive(this.identityAssertion);
5188
5290
  return b2`
5189
5291
  <p class="permissions-header">
5190
5292
  ${this.resolved?.ui.permissionsHeader ?? "The agent is requesting the following permissions:"}
@@ -5200,6 +5302,7 @@ var McpConsent = class extends i4 {
5200
5302
  `;
5201
5303
  }
5202
5304
  renderExpiration() {
5305
+ if (this.nativeScopeSelection) return A;
5203
5306
  const days = this.resolved?.expirationDays ?? 7;
5204
5307
  return b2`
5205
5308
  <p class="expiration">
@@ -5474,6 +5577,31 @@ var McpConsent = class extends i4 {
5474
5577
  year: "numeric"
5475
5578
  });
5476
5579
  }
5580
+ renderSuccessExpiry() {
5581
+ if (!this.nativeScopeSelection)
5582
+ return b2`<div class="credential-expiry">
5583
+ Expires ${this.formatExpiryDate()}
5584
+ </div>`;
5585
+ if (this.issuedExpiresAt === void 0)
5586
+ return b2`<div class="credential-expiry">
5587
+ Expiration time unavailable.
5588
+ </div>`;
5589
+ const expiry = new Date(this.issuedExpiresAt * 1e3);
5590
+ return b2`<div class="credential-expiry">
5591
+ Expires
5592
+ <time datetime=${expiry.toISOString()}
5593
+ >${expiry.toLocaleString("en-US", {
5594
+ month: "short",
5595
+ day: "numeric",
5596
+ year: "numeric",
5597
+ hour: "numeric",
5598
+ minute: "2-digit",
5599
+ second: "2-digit",
5600
+ timeZoneName: "short"
5601
+ })}</time
5602
+ >
5603
+ </div>`;
5604
+ }
5477
5605
  /**
5478
5606
  * Get the display name for the agent.
5479
5607
  * Returns agent name if available, otherwise falls back to agent DID.
@@ -5484,7 +5612,6 @@ var McpConsent = class extends i4 {
5484
5612
  renderSuccess() {
5485
5613
  const success = this.resolved?.success;
5486
5614
  const agentDisplay = this.getAgentDisplayName();
5487
- const expiryDate = this.formatExpiryDate();
5488
5615
  const displayScopes = this.selectedScopes.length > 0 ? this.selectedScopes : this.scopes;
5489
5616
  return b2`
5490
5617
  <div class="success-container">
@@ -5531,8 +5658,7 @@ var McpConsent = class extends i4 {
5531
5658
  )}
5532
5659
  </div>
5533
5660
  ` : A}
5534
-
5535
- <div class="credential-expiry">Expires ${expiryDate}</div>
5661
+ ${this.renderSuccessExpiry()}
5536
5662
 
5537
5663
  <!-- Verified Badge -->
5538
5664
  <div class="verified-badge">
@@ -5627,6 +5753,8 @@ var McpConsent = class extends i4 {
5627
5753
  headlineVerb="${this.headlineVerb}"
5628
5754
  revocationPath="${this.revocationPath}"
5629
5755
  inactivityDays=${this.inactivityDays}
5756
+ ?fixed-expiry=${this.nativeScopeSelection}
5757
+ fixed-expiry-days=${this.resolved?.fixedExpiryDays ?? A}
5630
5758
  theme="${this.consentTheme}"
5631
5759
  how-it-works-url="${this.howItWorksUrl}"
5632
5760
  ?loading=${this.loading}
@@ -5636,12 +5764,19 @@ var McpConsent = class extends i4 {
5636
5764
  @capabilities-allow=${this.onCapabilitiesAllow}
5637
5765
  @capabilities-deny=${this.handleDeny}
5638
5766
  >
5639
- ${allSelected ? b2`<div slot="auth"><p>This request grants every listed permission. Select all permissions or deny the request.</p>${credentials ? this.renderCredentialFields() : A}</div>` : A}
5767
+ ${this.nativeScopeSelection && this.agentDid ? b2`<div slot="agent-key">${this.renderNativeAgentKey()}</div>` : A}
5768
+ ${allSelected ? b2`<div slot="auth">
5769
+ <p>
5770
+ This request grants every listed permission. Select all
5771
+ permissions or deny the request.
5772
+ </p>
5773
+ ${credentials ? this.renderCredentialFields() : A}
5774
+ </div>` : A}
5640
5775
  </consent-capabilities-screen>
5641
5776
  `;
5642
5777
  }
5643
5778
  get requiresAllCapabilities() {
5644
- return shouldSelectAllCapabilities(this.currentMode) || Boolean(this.identityAssertion);
5779
+ return shouldSelectAllCapabilities(this.currentMode) || !this.nativeScopeSelection && Boolean(this.identityAssertion);
5645
5780
  }
5646
5781
  };
5647
5782
  McpConsent.styles = i`
@@ -5699,6 +5834,36 @@ McpConsent.styles = i`
5699
5834
  color: #111827;
5700
5835
  }
5701
5836
 
5837
+ .agent-key {
5838
+ min-width: 0;
5839
+ padding: 1rem;
5840
+ margin-bottom: 1rem;
5841
+ border: 1px solid var(--cs-surface-border, #e5e7eb);
5842
+ border-radius: 0.5rem;
5843
+ color: var(--cs-text-primary, #111827);
5844
+ font-size: 0.875rem;
5845
+ line-height: 1.5;
5846
+ }
5847
+
5848
+ .agent-key p {
5849
+ margin: 0 0 0.5rem;
5850
+ }
5851
+
5852
+ .agent-key code {
5853
+ display: block;
5854
+ white-space: normal;
5855
+ overflow-wrap: anywhere;
5856
+ font-size: 0.75rem;
5857
+ }
5858
+
5859
+ [slot="agent-key"] {
5860
+ min-width: 0;
5861
+ }
5862
+
5863
+ [slot="agent-key"] .agent-key {
5864
+ margin-bottom: 0;
5865
+ }
5866
+
5702
5867
  /* Permissions section */
5703
5868
  .permissions-header {
5704
5869
  font-size: 0.875rem;
@@ -6050,6 +6215,9 @@ __decorateClass([
6050
6215
  __decorateClass([
6051
6216
  n4({ type: String, attribute: "session-id" })
6052
6217
  ], McpConsent.prototype, "sessionId", 2);
6218
+ __decorateClass([
6219
+ n4({ type: String, attribute: "anchor-sid" })
6220
+ ], McpConsent.prototype, "anchorSid", 2);
6053
6221
  __decorateClass([
6054
6222
  n4({ type: String, attribute: "project-id" })
6055
6223
  ], McpConsent.prototype, "projectId", 2);
@@ -6086,6 +6254,9 @@ __decorateClass([
6086
6254
  __decorateClass([
6087
6255
  n4({ type: String, attribute: "oauth-url" })
6088
6256
  ], McpConsent.prototype, "oauthUrl", 2);
6257
+ __decorateClass([
6258
+ n4({ type: Boolean, attribute: "native-scope-selection" })
6259
+ ], McpConsent.prototype, "nativeScopeSelection", 2);
6089
6260
  __decorateClass([
6090
6261
  n4({
6091
6262
  type: Array,
@@ -6195,6 +6366,9 @@ __decorateClass([
6195
6366
  __decorateClass([
6196
6367
  r5()
6197
6368
  ], McpConsent.prototype, "step", 2);
6369
+ __decorateClass([
6370
+ r5()
6371
+ ], McpConsent.prototype, "issuedExpiresAt", 2);
6198
6372
  __decorateClass([
6199
6373
  r5()
6200
6374
  ], McpConsent.prototype, "termsAccepted", 2);