@kya-os/consent 0.1.49 → 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 (122) hide show
  1. package/README.md +3 -0
  2. package/dist/bundle/inline.d.ts.map +1 -1
  3. package/dist/bundle/inline.js +4 -4
  4. package/dist/bundle/inline.js.map +1 -1
  5. package/dist/bundle/shell.d.ts +2 -2
  6. package/dist/bundle/shell.d.ts.map +1 -1
  7. package/dist/cjs/bundle/inline.js +4 -4
  8. package/dist/cjs/bundle/inline.js.map +1 -1
  9. package/dist/cjs/components/consent-agent-header.js +10 -7
  10. package/dist/cjs/components/consent-agent-header.js.map +1 -1
  11. package/dist/cjs/components/consent-button.js +1 -1
  12. package/dist/cjs/components/consent-capabilities-screen.js +4 -0
  13. package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
  14. package/dist/cjs/components/consent-checkbox.js +2 -2
  15. package/dist/cjs/components/consent-connector-header.js +14 -3
  16. package/dist/cjs/components/consent-connector-header.js.map +1 -1
  17. package/dist/cjs/components/consent-revocation-notice.js +23 -5
  18. package/dist/cjs/components/consent-revocation-notice.js.map +1 -1
  19. package/dist/cjs/components/consent-shell.js +1 -1
  20. package/dist/cjs/components/consent-terms.js +2 -2
  21. package/dist/cjs/components/mcp-consent.js +4 -3
  22. package/dist/cjs/components/mcp-consent.js.map +1 -1
  23. package/dist/cjs/constants/colors.js +2 -2
  24. package/dist/cjs/constants/defaults.js +1 -1
  25. package/dist/cjs/copy/tokens.js +6 -1
  26. package/dist/cjs/copy/tokens.js.map +1 -1
  27. package/dist/cjs/index.js +1 -1
  28. package/dist/cjs/mcp-app/inline.js +2 -2
  29. package/dist/cjs/mcp-app/inline.js.map +1 -1
  30. package/dist/cjs/react/index.js +1 -1
  31. package/dist/cjs/resolution/resolve-config.js +3 -0
  32. package/dist/cjs/resolution/resolve-config.js.map +1 -1
  33. package/dist/cjs/schemas/api.schemas.js +1 -1
  34. package/dist/cjs/schemas/config.schemas.js +1 -0
  35. package/dist/cjs/schemas/config.schemas.js.map +1 -1
  36. package/dist/cjs/styles/index.js +1 -1
  37. package/dist/cjs/styles/theme.js +29 -1
  38. package/dist/cjs/styles/theme.js.map +1 -1
  39. package/dist/cjs/styles/tokens.js +8 -8
  40. package/dist/cjs/styles/tokens.js.map +1 -1
  41. package/dist/cjs/templates/base/components.js +1 -1
  42. package/dist/cjs/templates/modes/credentials.template.js +6 -6
  43. package/dist/cjs/templates/modes/credentials.template.js.map +1 -1
  44. package/dist/cjs/templates/registry.js +3 -3
  45. package/dist/cjs/types/index.js +1 -1
  46. package/dist/cjs/types/modes.types.js +3 -3
  47. package/dist/components/consent-agent-header.d.ts.map +1 -1
  48. package/dist/components/consent-agent-header.js +10 -7
  49. package/dist/components/consent-agent-header.js.map +1 -1
  50. package/dist/components/consent-button.d.ts +1 -1
  51. package/dist/components/consent-button.js +1 -1
  52. package/dist/components/consent-capabilities-screen.d.ts +2 -0
  53. package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
  54. package/dist/components/consent-capabilities-screen.js +4 -0
  55. package/dist/components/consent-capabilities-screen.js.map +1 -1
  56. package/dist/components/consent-checkbox.js +2 -2
  57. package/dist/components/consent-connector-header.d.ts.map +1 -1
  58. package/dist/components/consent-connector-header.js +14 -3
  59. package/dist/components/consent-connector-header.js.map +1 -1
  60. package/dist/components/consent-revocation-notice.d.ts +8 -0
  61. package/dist/components/consent-revocation-notice.d.ts.map +1 -1
  62. package/dist/components/consent-revocation-notice.js +23 -5
  63. package/dist/components/consent-revocation-notice.js.map +1 -1
  64. package/dist/components/consent-shell.js +1 -1
  65. package/dist/components/consent-terms.js +2 -2
  66. package/dist/components/mcp-consent.d.ts +2 -2
  67. package/dist/components/mcp-consent.d.ts.map +1 -1
  68. package/dist/components/mcp-consent.js +4 -3
  69. package/dist/components/mcp-consent.js.map +1 -1
  70. package/dist/consent.js +78 -24
  71. package/dist/consent.min.js +61 -45
  72. package/dist/constants/colors.d.ts +2 -2
  73. package/dist/constants/colors.js +2 -2
  74. package/dist/constants/defaults.d.ts +1 -1
  75. package/dist/constants/defaults.js +1 -1
  76. package/dist/copy/tokens.d.ts +6 -1
  77. package/dist/copy/tokens.d.ts.map +1 -1
  78. package/dist/copy/tokens.js +6 -1
  79. package/dist/copy/tokens.js.map +1 -1
  80. package/dist/index.d.ts +1 -1
  81. package/dist/index.js +1 -1
  82. package/dist/mcp-app/inline.d.ts.map +1 -1
  83. package/dist/mcp-app/inline.js +2 -2
  84. package/dist/mcp-app/inline.js.map +1 -1
  85. package/dist/react/index.d.ts +1 -1
  86. package/dist/react/index.js +1 -1
  87. package/dist/resolution/resolve-config.d.ts.map +1 -1
  88. package/dist/resolution/resolve-config.js +3 -0
  89. package/dist/resolution/resolve-config.js.map +1 -1
  90. package/dist/schemas/api.schemas.d.ts +6 -1
  91. package/dist/schemas/api.schemas.d.ts.map +1 -1
  92. package/dist/schemas/api.schemas.js +1 -1
  93. package/dist/schemas/config.schemas.d.ts +6 -0
  94. package/dist/schemas/config.schemas.d.ts.map +1 -1
  95. package/dist/schemas/config.schemas.js +1 -0
  96. package/dist/schemas/config.schemas.js.map +1 -1
  97. package/dist/styles/index.d.ts +1 -1
  98. package/dist/styles/index.js +1 -1
  99. package/dist/styles/theme.d.ts +32 -1
  100. package/dist/styles/theme.d.ts.map +1 -1
  101. package/dist/styles/theme.js +29 -1
  102. package/dist/styles/theme.js.map +1 -1
  103. package/dist/styles/tokens.d.ts +5 -5
  104. package/dist/styles/tokens.js +8 -8
  105. package/dist/styles/tokens.js.map +1 -1
  106. package/dist/templates/base/components.d.ts +1 -1
  107. package/dist/templates/base/components.js +1 -1
  108. package/dist/templates/modes/credentials.template.d.ts +5 -5
  109. package/dist/templates/modes/credentials.template.js +6 -6
  110. package/dist/templates/modes/credentials.template.js.map +1 -1
  111. package/dist/templates/registry.d.ts +3 -3
  112. package/dist/templates/registry.js +3 -3
  113. package/dist/types/api.types.d.ts +1 -1
  114. package/dist/types/config.types.d.ts +11 -2
  115. package/dist/types/config.types.d.ts.map +1 -1
  116. package/dist/types/index.d.ts +1 -1
  117. package/dist/types/index.js +1 -1
  118. package/dist/types/modes.types.d.ts +3 -3
  119. package/dist/types/modes.types.js +3 -3
  120. package/dist/types/page.types.d.ts +1 -1
  121. package/dist/types/page.types.d.ts.map +1 -1
  122. package/package.json +4 -3
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",
@@ -2671,7 +2671,12 @@ var CONSENT_COPY_TOKENS = {
2671
2671
  /** `{Days}` → inactivity days, default 90. */
2672
2672
  inactivityTemplate: "Permissions automatically expire after {Days} days of inactivity.",
2673
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."
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."
2675
2680
  },
2676
2681
  actions: {
2677
2682
  /** Light theme primary. `{Agent}` → agent display name. */
@@ -2773,30 +2778,33 @@ ConsentAgentHeader.styles = i`
2773
2778
  border: 1px solid var(--cs-surface-border, transparent);
2774
2779
  }
2775
2780
 
2781
+ /* Agent tile: white with a light border in every theme, 44px outside. */
2776
2782
  .logo {
2783
+ box-sizing: border-box;
2777
2784
  width: 44px;
2778
2785
  height: 44px;
2779
2786
  border-radius: 12px;
2780
2787
  flex-shrink: 0;
2781
- background: var(--cs-surface-card, #fff);
2788
+ background: var(--cs-agent-tile-bg, #FFFFFF);
2782
2789
  display: flex;
2783
2790
  align-items: center;
2784
2791
  justify-content: center;
2785
2792
  overflow: hidden;
2786
- border: 1px solid var(--cs-surface-border, transparent);
2793
+ border: 1px solid var(--cs-agent-tile-border, rgba(15, 23, 42, 0.08));
2787
2794
  }
2788
2795
 
2796
+ /* Contained, not cropped: 28px leaves an 8px inset inside the 44px tile. */
2789
2797
  .logo img {
2790
- width: 100%;
2791
- height: 100%;
2792
- object-fit: cover;
2798
+ width: 28px;
2799
+ height: 28px;
2800
+ object-fit: contain;
2793
2801
  }
2794
2802
 
2795
2803
  .logo .placeholder {
2796
2804
  width: 100%;
2797
2805
  height: 100%;
2798
- background: var(--cs-surface-accent, #0F172A);
2799
- color: var(--cs-surface-accent-text, #fff);
2806
+ background: transparent;
2807
+ color: var(--cs-agent-tile-text, #0F172A);
2800
2808
  display: flex;
2801
2809
  align-items: center;
2802
2810
  justify-content: center;
@@ -3680,9 +3688,7 @@ var ConsentRevocationNotice = class extends i4 {
3680
3688
  RevocationPath: this.revocationPath,
3681
3689
  Org: this.orgName
3682
3690
  });
3683
- const expiry = this.fixedExpiry ? CONSENT_COPY_TOKENS.footer.fixedExpiryNotice : formatToken(CONSENT_COPY_TOKENS.footer.inactivityTemplate, {
3684
- Days: this.inactivityDays
3685
- });
3691
+ const expiry = this.expiryCopy();
3686
3692
  return b2`
3687
3693
  <svg
3688
3694
  class="icon"
@@ -3703,6 +3709,18 @@ var ConsentRevocationNotice = class extends i4 {
3703
3709
  </div>
3704
3710
  `;
3705
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
+ }
3706
3724
  };
3707
3725
  ConsentRevocationNotice.styles = i`
3708
3726
  :host {
@@ -3749,6 +3767,9 @@ __decorateClass([
3749
3767
  __decorateClass([
3750
3768
  n4({ type: Boolean, attribute: "fixed-expiry" })
3751
3769
  ], ConsentRevocationNotice.prototype, "fixedExpiry", 2);
3770
+ __decorateClass([
3771
+ n4({ type: Number, attribute: "fixed-expiry-days" })
3772
+ ], ConsentRevocationNotice.prototype, "fixedExpiryDays", 2);
3752
3773
  ConsentRevocationNotice = __decorateClass([
3753
3774
  t3("consent-revocation-notice")
3754
3775
  ], ConsentRevocationNotice);
@@ -3854,9 +3875,12 @@ ConsentConnectorHeader.styles = i`
3854
3875
  border: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.08));
3855
3876
  }
3856
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. */
3857
3880
  .tile.client {
3858
- background: var(--cs-surface-accent, #0F172A);
3859
- 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));
3860
3884
  }
3861
3885
 
3862
3886
  .tile img {
@@ -3865,6 +3889,14 @@ ConsentConnectorHeader.styles = i`
3865
3889
  object-fit: cover;
3866
3890
  }
3867
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
+
3868
3900
  .tile .monogram {
3869
3901
  width: 100%;
3870
3902
  height: 100%;
@@ -3876,7 +3908,7 @@ ConsentConnectorHeader.styles = i`
3876
3908
  }
3877
3909
 
3878
3910
  .tile.client .monogram {
3879
- color: var(--cs-surface-accent-text, #fff);
3911
+ color: var(--cs-agent-tile-text, #0F172A);
3880
3912
  }
3881
3913
 
3882
3914
  .tile.server .monogram {
@@ -3953,6 +3985,9 @@ ConsentConnectorHeader = __decorateClass([
3953
3985
  // src/styles/theme.ts
3954
3986
  var FIXED_RISK_CHIP_BG = "#FCE7B6";
3955
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";
3956
3991
  var lightTheme = {
3957
3992
  surfaceBg: "#F4F1EA",
3958
3993
  surfaceCard: "#FFFFFF",
@@ -3970,7 +4005,10 @@ var lightTheme = {
3970
4005
  chipRiskBg: FIXED_RISK_CHIP_BG,
3971
4006
  chipRiskText: FIXED_RISK_CHIP_TEXT,
3972
4007
  focusRing: "rgba(15, 23, 42, 0.35)",
3973
- 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
3974
4012
  };
3975
4013
  var darkTheme = {
3976
4014
  surfaceBg: "#0B0808",
@@ -3989,14 +4027,23 @@ var darkTheme = {
3989
4027
  chipRiskBg: FIXED_RISK_CHIP_BG,
3990
4028
  chipRiskText: FIXED_RISK_CHIP_TEXT,
3991
4029
  focusRing: "rgba(248, 250, 252, 0.55)",
3992
- 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
3993
4034
  };
3994
4035
  function getConsentTheme(theme) {
3995
4036
  return theme === "dark" ? darkTheme : lightTheme;
3996
4037
  }
3997
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
+ };
3998
4045
  const declarations = [];
3999
- for (const [key, value] of Object.entries(tokens)) {
4046
+ for (const [key, value] of Object.entries(resolved)) {
4000
4047
  declarations.push(` --cs-${camelToKebab(key)}: ${value};`);
4001
4048
  }
4002
4049
  return declarations.join("\n");
@@ -4309,6 +4356,7 @@ var ConsentCapabilitiesScreen = class extends i4 {
4309
4356
  orgName="${this.orgName || "this site"}"
4310
4357
  inactivityDays=${this.inactivityDays}
4311
4358
  ?fixed-expiry=${this.fixedExpiry}
4359
+ fixed-expiry-days=${this.fixedExpiryDays ?? A}
4312
4360
  ></consent-revocation-notice
4313
4361
  ></slot>
4314
4362
  <consent-action-bar
@@ -4440,6 +4488,9 @@ __decorateClass([
4440
4488
  __decorateClass([
4441
4489
  n4({ type: Boolean, attribute: "fixed-expiry" })
4442
4490
  ], ConsentCapabilitiesScreen.prototype, "fixedExpiry", 2);
4491
+ __decorateClass([
4492
+ n4({ type: Number, attribute: "fixed-expiry-days" })
4493
+ ], ConsentCapabilitiesScreen.prototype, "fixedExpiryDays", 2);
4443
4494
  __decorateClass([
4444
4495
  n4({ type: String })
4445
4496
  ], ConsentCapabilitiesScreen.prototype, "theme", 2);
@@ -4742,6 +4793,8 @@ function resolveConsentConfig(config, agentName) {
4742
4793
  success,
4743
4794
  customFields,
4744
4795
  expirationDays,
4796
+ // Passthrough: set only when the server bound a delegation mandate.
4797
+ fixedExpiryDays: config?.fixedExpiryDays,
4745
4798
  authMode,
4746
4799
  // Passthrough mode configs
4747
4800
  credentials: config?.credentials,
@@ -5701,6 +5754,7 @@ var McpConsent = class extends i4 {
5701
5754
  revocationPath="${this.revocationPath}"
5702
5755
  inactivityDays=${this.inactivityDays}
5703
5756
  ?fixed-expiry=${this.nativeScopeSelection}
5757
+ fixed-expiry-days=${this.resolved?.fixedExpiryDays ?? A}
5704
5758
  theme="${this.consentTheme}"
5705
5759
  how-it-works-url="${this.howItWorksUrl}"
5706
5760
  ?loading=${this.loading}