@kya-os/consent 0.1.37 → 0.1.39

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 (192) hide show
  1. package/dist/bundle/index.d.ts +12 -0
  2. package/dist/bundle/index.d.ts.map +1 -1
  3. package/dist/bundle/index.js +12 -0
  4. package/dist/bundle/index.js.map +1 -1
  5. package/dist/bundle/inline.d.ts.map +1 -1
  6. package/dist/bundle/inline.js +2 -2
  7. package/dist/bundle/inline.js.map +1 -1
  8. package/dist/bundle/shell.d.ts +23 -0
  9. package/dist/bundle/shell.d.ts.map +1 -1
  10. package/dist/bundle/shell.js +25 -1
  11. package/dist/bundle/shell.js.map +1 -1
  12. package/dist/capabilities/index.d.ts +7 -0
  13. package/dist/capabilities/index.d.ts.map +1 -0
  14. package/dist/capabilities/index.js +7 -0
  15. package/dist/capabilities/index.js.map +1 -0
  16. package/dist/capabilities/registry.d.ts +29 -0
  17. package/dist/capabilities/registry.d.ts.map +1 -0
  18. package/dist/capabilities/registry.js +178 -0
  19. package/dist/capabilities/registry.js.map +1 -0
  20. package/dist/cedar/compile.d.ts +30 -0
  21. package/dist/cedar/compile.d.ts.map +1 -0
  22. package/dist/cedar/compile.js +55 -0
  23. package/dist/cedar/compile.js.map +1 -0
  24. package/dist/cedar/explain.d.ts +22 -0
  25. package/dist/cedar/explain.d.ts.map +1 -0
  26. package/dist/cedar/explain.js +72 -0
  27. package/dist/cedar/explain.js.map +1 -0
  28. package/dist/cedar/index.d.ts +8 -0
  29. package/dist/cedar/index.d.ts.map +1 -0
  30. package/dist/cedar/index.js +8 -0
  31. package/dist/cedar/index.js.map +1 -0
  32. package/dist/cjs/bundle/index.js +19 -1
  33. package/dist/cjs/bundle/index.js.map +1 -1
  34. package/dist/cjs/bundle/inline.js +2 -2
  35. package/dist/cjs/bundle/inline.js.map +1 -1
  36. package/dist/cjs/bundle/shell.js +25 -1
  37. package/dist/cjs/bundle/shell.js.map +1 -1
  38. package/dist/cjs/capabilities/index.js +12 -0
  39. package/dist/cjs/capabilities/index.js.map +1 -0
  40. package/dist/cjs/capabilities/registry.js +182 -0
  41. package/dist/cjs/capabilities/registry.js.map +1 -0
  42. package/dist/cjs/cedar/compile.js +59 -0
  43. package/dist/cjs/cedar/compile.js.map +1 -0
  44. package/dist/cjs/cedar/explain.js +75 -0
  45. package/dist/cjs/cedar/explain.js.map +1 -0
  46. package/dist/cjs/cedar/index.js +14 -0
  47. package/dist/cjs/cedar/index.js.map +1 -0
  48. package/dist/cjs/components/consent-action-bar.js +138 -0
  49. package/dist/cjs/components/consent-action-bar.js.map +1 -0
  50. package/dist/cjs/components/consent-agent-header.js +205 -0
  51. package/dist/cjs/components/consent-agent-header.js.map +1 -0
  52. package/dist/cjs/components/consent-capabilities-screen.js +309 -0
  53. package/dist/cjs/components/consent-capabilities-screen.js.map +1 -0
  54. package/dist/cjs/components/consent-capability-card.js +340 -0
  55. package/dist/cjs/components/consent-capability-card.js.map +1 -0
  56. package/dist/cjs/components/consent-footer.js +99 -0
  57. package/dist/cjs/components/consent-footer.js.map +1 -0
  58. package/dist/cjs/components/consent-revocation-notice.js +101 -0
  59. package/dist/cjs/components/consent-revocation-notice.js.map +1 -0
  60. package/dist/cjs/components/index.js +14 -1
  61. package/dist/cjs/components/index.js.map +1 -1
  62. package/dist/cjs/components/mcp-consent.js +176 -7
  63. package/dist/cjs/components/mcp-consent.js.map +1 -1
  64. package/dist/cjs/copy/index.js +12 -0
  65. package/dist/cjs/copy/index.js.map +1 -0
  66. package/dist/cjs/copy/tokens.js +101 -0
  67. package/dist/cjs/copy/tokens.js.map +1 -0
  68. package/dist/cjs/index.js +8 -0
  69. package/dist/cjs/index.js.map +1 -1
  70. package/dist/cjs/mcp-app/index.js +15 -0
  71. package/dist/cjs/mcp-app/index.js.map +1 -0
  72. package/dist/cjs/mcp-app/inline.js +20 -0
  73. package/dist/cjs/mcp-app/inline.js.map +1 -0
  74. package/dist/cjs/mcp-app/types.js +10 -0
  75. package/dist/cjs/mcp-app/types.js.map +1 -0
  76. package/dist/cjs/popup/index.js +15 -0
  77. package/dist/cjs/popup/index.js.map +1 -0
  78. package/dist/cjs/popup/launcher.js +77 -0
  79. package/dist/cjs/popup/launcher.js.map +1 -0
  80. package/dist/cjs/schemas/capabilities.schemas.js +129 -0
  81. package/dist/cjs/schemas/capabilities.schemas.js.map +1 -0
  82. package/dist/cjs/schemas/config.schemas.js +18 -0
  83. package/dist/cjs/schemas/config.schemas.js.map +1 -1
  84. package/dist/cjs/schemas/index.js +1 -0
  85. package/dist/cjs/schemas/index.js.map +1 -1
  86. package/dist/cjs/styles/index.js +1 -0
  87. package/dist/cjs/styles/index.js.map +1 -1
  88. package/dist/cjs/styles/theme.js +86 -0
  89. package/dist/cjs/styles/theme.js.map +1 -0
  90. package/dist/cjs/types/capabilities.types.js +12 -0
  91. package/dist/cjs/types/capabilities.types.js.map +1 -0
  92. package/dist/cjs/types/index.js +1 -0
  93. package/dist/cjs/types/index.js.map +1 -1
  94. package/dist/components/consent-action-bar.d.ts +30 -0
  95. package/dist/components/consent-action-bar.d.ts.map +1 -0
  96. package/dist/components/consent-action-bar.js +135 -0
  97. package/dist/components/consent-action-bar.js.map +1 -0
  98. package/dist/components/consent-agent-header.d.ts +31 -0
  99. package/dist/components/consent-agent-header.d.ts.map +1 -0
  100. package/dist/components/consent-agent-header.js +202 -0
  101. package/dist/components/consent-agent-header.js.map +1 -0
  102. package/dist/components/consent-capabilities-screen.d.ts +62 -0
  103. package/dist/components/consent-capabilities-screen.d.ts.map +1 -0
  104. package/dist/components/consent-capabilities-screen.js +306 -0
  105. package/dist/components/consent-capabilities-screen.js.map +1 -0
  106. package/dist/components/consent-capability-card.d.ts +44 -0
  107. package/dist/components/consent-capability-card.d.ts.map +1 -0
  108. package/dist/components/consent-capability-card.js +337 -0
  109. package/dist/components/consent-capability-card.js.map +1 -0
  110. package/dist/components/consent-footer.d.ts +22 -0
  111. package/dist/components/consent-footer.d.ts.map +1 -0
  112. package/dist/components/consent-footer.js +96 -0
  113. package/dist/components/consent-footer.js.map +1 -0
  114. package/dist/components/consent-revocation-notice.d.ts +22 -0
  115. package/dist/components/consent-revocation-notice.d.ts.map +1 -0
  116. package/dist/components/consent-revocation-notice.js +98 -0
  117. package/dist/components/consent-revocation-notice.js.map +1 -0
  118. package/dist/components/index.d.ts +6 -0
  119. package/dist/components/index.d.ts.map +1 -1
  120. package/dist/components/index.js +7 -0
  121. package/dist/components/index.js.map +1 -1
  122. package/dist/components/mcp-consent.d.ts +41 -0
  123. package/dist/components/mcp-consent.d.ts.map +1 -1
  124. package/dist/components/mcp-consent.js +176 -7
  125. package/dist/components/mcp-consent.js.map +1 -1
  126. package/dist/consent.js +1578 -210
  127. package/dist/consent.min.js +727 -96
  128. package/dist/copy/index.d.ts +8 -0
  129. package/dist/copy/index.d.ts.map +1 -0
  130. package/dist/copy/index.js +7 -0
  131. package/dist/copy/index.js.map +1 -0
  132. package/dist/copy/tokens.d.ts +93 -0
  133. package/dist/copy/tokens.d.ts.map +1 -0
  134. package/dist/copy/tokens.js +97 -0
  135. package/dist/copy/tokens.js.map +1 -0
  136. package/dist/index.d.ts +4 -0
  137. package/dist/index.d.ts.map +1 -1
  138. package/dist/index.js +8 -0
  139. package/dist/index.js.map +1 -1
  140. package/dist/mcp-app/index.d.ts +10 -0
  141. package/dist/mcp-app/index.d.ts.map +1 -0
  142. package/dist/mcp-app/index.js +9 -0
  143. package/dist/mcp-app/index.js.map +1 -0
  144. package/dist/mcp-app/inline.d.ts +16 -0
  145. package/dist/mcp-app/inline.d.ts.map +1 -0
  146. package/dist/mcp-app/inline.js +16 -0
  147. package/dist/mcp-app/inline.js.map +1 -0
  148. package/dist/mcp-app/types.d.ts +33 -0
  149. package/dist/mcp-app/types.d.ts.map +1 -0
  150. package/dist/mcp-app/types.js +8 -0
  151. package/dist/mcp-app/types.js.map +1 -0
  152. package/dist/popup/index.d.ts +8 -0
  153. package/dist/popup/index.d.ts.map +1 -0
  154. package/dist/popup/index.js +7 -0
  155. package/dist/popup/index.js.map +1 -0
  156. package/dist/popup/launcher.d.ts +81 -0
  157. package/dist/popup/launcher.d.ts.map +1 -0
  158. package/dist/popup/launcher.js +71 -0
  159. package/dist/popup/launcher.js.map +1 -0
  160. package/dist/schemas/api.schemas.d.ts +234 -30
  161. package/dist/schemas/api.schemas.d.ts.map +1 -1
  162. package/dist/schemas/capabilities.schemas.d.ts +186 -0
  163. package/dist/schemas/capabilities.schemas.d.ts.map +1 -0
  164. package/dist/schemas/capabilities.schemas.js +123 -0
  165. package/dist/schemas/capabilities.schemas.js.map +1 -0
  166. package/dist/schemas/config.schemas.d.ts +332 -36
  167. package/dist/schemas/config.schemas.d.ts.map +1 -1
  168. package/dist/schemas/config.schemas.js +18 -0
  169. package/dist/schemas/config.schemas.js.map +1 -1
  170. package/dist/schemas/index.d.ts +1 -0
  171. package/dist/schemas/index.d.ts.map +1 -1
  172. package/dist/schemas/index.js +1 -0
  173. package/dist/schemas/index.js.map +1 -1
  174. package/dist/styles/index.d.ts +1 -0
  175. package/dist/styles/index.d.ts.map +1 -1
  176. package/dist/styles/index.js +1 -0
  177. package/dist/styles/index.js.map +1 -1
  178. package/dist/styles/theme.d.ts +72 -0
  179. package/dist/styles/theme.d.ts.map +1 -0
  180. package/dist/styles/theme.js +81 -0
  181. package/dist/styles/theme.js.map +1 -0
  182. package/dist/types/capabilities.types.d.ts +126 -0
  183. package/dist/types/capabilities.types.d.ts.map +1 -0
  184. package/dist/types/capabilities.types.js +11 -0
  185. package/dist/types/capabilities.types.js.map +1 -0
  186. package/dist/types/config.types.d.ts +33 -0
  187. package/dist/types/config.types.d.ts.map +1 -1
  188. package/dist/types/index.d.ts +1 -0
  189. package/dist/types/index.d.ts.map +1 -1
  190. package/dist/types/index.js +1 -0
  191. package/dist/types/index.js.map +1 -1
  192. package/package.json +15 -8
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Consent Agent Header
3
+ *
4
+ * Renders the agent identity tile shared between the new consent screen and
5
+ * the OAuth Gateway consent modal. Shows logo + name + Verified/UNVERIFIED
6
+ * pill + meta line (`Made by {Vendor} · Asking from your {Surface} · Connected
7
+ * just now`).
8
+ *
9
+ * Fed by `AgentMetadata` from `@kya-os/consent/types/capabilities`.
10
+ *
11
+ * @module components/consent-agent-header
12
+ */
13
+ import { LitElement } from "lit";
14
+ export declare class ConsentAgentHeader extends LitElement {
15
+ agentName: string;
16
+ vendor: string;
17
+ surfaceLabel: string;
18
+ verified: boolean;
19
+ logoUrl: string;
20
+ connectedAt: string;
21
+ static styles: import("lit").CSSResult;
22
+ private renderConnectedFragment;
23
+ private renderMeta;
24
+ render(): import("lit").TemplateResult<1>;
25
+ }
26
+ declare global {
27
+ interface HTMLElementTagNameMap {
28
+ "consent-agent-header": ConsentAgentHeader;
29
+ }
30
+ }
31
+ //# sourceMappingURL=consent-agent-header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consent-agent-header.d.ts","sourceRoot":"","sources":["../../src/components/consent-agent-header.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAKrD,qBACa,kBAAmB,SAAQ,UAAU;IACpB,SAAS,SAAM;IACf,MAAM,SAAM;IACZ,YAAY,SAAM;IACjB,QAAQ,UAAS;IAClB,OAAO,SAAM;IACb,WAAW,SAAM;IAE7C,OAAgB,MAAM,0BA+FpB;IAEF,OAAO,CAAC,uBAAuB;IAiB/B,OAAO,CAAC,UAAU;IAWT,MAAM;CA0BhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,kBAAkB,CAAC;KAC5C;CACF"}
@@ -0,0 +1,202 @@
1
+ /**
2
+ * Consent Agent Header
3
+ *
4
+ * Renders the agent identity tile shared between the new consent screen and
5
+ * the OAuth Gateway consent modal. Shows logo + name + Verified/UNVERIFIED
6
+ * pill + meta line (`Made by {Vendor} · Asking from your {Surface} · Connected
7
+ * just now`).
8
+ *
9
+ * Fed by `AgentMetadata` from `@kya-os/consent/types/capabilities`.
10
+ *
11
+ * @module components/consent-agent-header
12
+ */
13
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
14
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
16
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
17
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
18
+ };
19
+ import { LitElement, html, css, nothing } from "lit";
20
+ import { customElement, property } from "lit/decorators.js";
21
+ import { CONSENT_COPY_TOKENS, formatToken } from "../copy/tokens.js";
22
+ let ConsentAgentHeader = class ConsentAgentHeader extends LitElement {
23
+ constructor() {
24
+ super(...arguments);
25
+ this.agentName = "";
26
+ this.vendor = "";
27
+ this.surfaceLabel = "";
28
+ this.verified = false;
29
+ this.logoUrl = "";
30
+ this.connectedAt = "";
31
+ }
32
+ renderConnectedFragment() {
33
+ if (!this.connectedAt) {
34
+ return CONSENT_COPY_TOKENS.agentTile.connectedJustNow;
35
+ }
36
+ const ts = Date.parse(this.connectedAt);
37
+ if (Number.isNaN(ts)) {
38
+ return CONSENT_COPY_TOKENS.agentTile.connectedJustNow;
39
+ }
40
+ const minutes = Math.max(0, Math.floor((Date.now() - ts) / 60000));
41
+ if (minutes < 1) {
42
+ return CONSENT_COPY_TOKENS.agentTile.connectedJustNow;
43
+ }
44
+ return formatToken(CONSENT_COPY_TOKENS.agentTile.connectedMinutesAgo, {
45
+ Minutes: minutes,
46
+ });
47
+ }
48
+ renderMeta() {
49
+ if (!this.vendor && !this.surfaceLabel) {
50
+ return this.renderConnectedFragment();
51
+ }
52
+ return formatToken(CONSENT_COPY_TOKENS.agentTile.metaTemplate, {
53
+ Vendor: this.vendor || "—",
54
+ Surface: this.surfaceLabel || "this device",
55
+ Connected: this.renderConnectedFragment(),
56
+ });
57
+ }
58
+ render() {
59
+ const initial = (this.agentName || "?").trim().charAt(0).toUpperCase();
60
+ const verifiedLabel = this.verified
61
+ ? CONSENT_COPY_TOKENS.agentTile.verifiedPill
62
+ : CONSENT_COPY_TOKENS.agentTile.unverifiedPill;
63
+ const verifiedClass = this.verified ? "verified" : "unverified";
64
+ return html `
65
+ <div class="tile" part="tile">
66
+ <div class="logo" aria-hidden="true">
67
+ ${this.logoUrl
68
+ ? html `<img src="${this.logoUrl}" alt="" />`
69
+ : html `<div class="placeholder">${initial}</div>`}
70
+ </div>
71
+ <div class="body">
72
+ <div class="row-name">
73
+ <span class="name">${this.agentName || nothing}</span>
74
+ <span class="pill ${verifiedClass}" part="pill">
75
+ ${verifiedLabel}
76
+ </span>
77
+ </div>
78
+ <div class="meta">${this.renderMeta()}</div>
79
+ </div>
80
+ </div>
81
+ `;
82
+ }
83
+ };
84
+ ConsentAgentHeader.styles = css `
85
+ :host {
86
+ display: block;
87
+ width: 100%;
88
+ }
89
+
90
+ .tile {
91
+ display: flex;
92
+ align-items: center;
93
+ gap: 16px;
94
+ padding: 16px 18px;
95
+ border-radius: 14px;
96
+ background: var(--cs-surface-inset, transparent);
97
+ border: 1px solid var(--cs-surface-border, transparent);
98
+ }
99
+
100
+ .logo {
101
+ width: 44px;
102
+ height: 44px;
103
+ border-radius: 12px;
104
+ flex-shrink: 0;
105
+ background: var(--cs-surface-card, #fff);
106
+ display: flex;
107
+ align-items: center;
108
+ justify-content: center;
109
+ overflow: hidden;
110
+ border: 1px solid var(--cs-surface-border, transparent);
111
+ }
112
+
113
+ .logo img {
114
+ width: 100%;
115
+ height: 100%;
116
+ object-fit: cover;
117
+ }
118
+
119
+ .logo .placeholder {
120
+ width: 100%;
121
+ height: 100%;
122
+ background: var(--cs-surface-accent, #0F172A);
123
+ color: var(--cs-surface-accent-text, #fff);
124
+ display: flex;
125
+ align-items: center;
126
+ justify-content: center;
127
+ font-weight: 600;
128
+ font-size: 18px;
129
+ }
130
+
131
+ .body {
132
+ display: flex;
133
+ flex-direction: column;
134
+ gap: 4px;
135
+ min-width: 0;
136
+ }
137
+
138
+ .row-name {
139
+ display: flex;
140
+ align-items: center;
141
+ gap: 10px;
142
+ flex-wrap: wrap;
143
+ }
144
+
145
+ .name {
146
+ font-size: 16px;
147
+ font-weight: 600;
148
+ color: var(--cs-text-primary, #0F172A);
149
+ letter-spacing: -0.01em;
150
+ }
151
+
152
+ .pill {
153
+ display: inline-flex;
154
+ align-items: center;
155
+ gap: 4px;
156
+ padding: 2px 8px;
157
+ border-radius: 999px;
158
+ font-size: 11px;
159
+ font-weight: 600;
160
+ letter-spacing: 0.04em;
161
+ }
162
+
163
+ .pill.verified {
164
+ background: var(--cs-pill-verified-bg, #DCFCE7);
165
+ color: var(--cs-pill-verified-text, #166534);
166
+ }
167
+
168
+ .pill.unverified {
169
+ background: var(--cs-pill-unverified-bg, #F1F5F9);
170
+ color: var(--cs-pill-unverified-text, #475569);
171
+ letter-spacing: 0.08em;
172
+ }
173
+
174
+ .meta {
175
+ font-size: 12px;
176
+ color: var(--cs-text-tertiary, #64748B);
177
+ line-height: 1.5;
178
+ }
179
+ `;
180
+ __decorate([
181
+ property({ type: String })
182
+ ], ConsentAgentHeader.prototype, "agentName", void 0);
183
+ __decorate([
184
+ property({ type: String })
185
+ ], ConsentAgentHeader.prototype, "vendor", void 0);
186
+ __decorate([
187
+ property({ type: String })
188
+ ], ConsentAgentHeader.prototype, "surfaceLabel", void 0);
189
+ __decorate([
190
+ property({ type: Boolean })
191
+ ], ConsentAgentHeader.prototype, "verified", void 0);
192
+ __decorate([
193
+ property({ type: String })
194
+ ], ConsentAgentHeader.prototype, "logoUrl", void 0);
195
+ __decorate([
196
+ property({ type: String })
197
+ ], ConsentAgentHeader.prototype, "connectedAt", void 0);
198
+ ConsentAgentHeader = __decorate([
199
+ customElement("consent-agent-header")
200
+ ], ConsentAgentHeader);
201
+ export { ConsentAgentHeader };
202
+ //# sourceMappingURL=consent-agent-header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consent-agent-header.js","sourceRoot":"","sources":["../../src/components/consent-agent-header.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAG9D,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,UAAU;IAA3C;;QACuB,cAAS,GAAG,EAAE,CAAC;QACf,WAAM,GAAG,EAAE,CAAC;QACZ,iBAAY,GAAG,EAAE,CAAC;QACjB,aAAQ,GAAG,KAAK,CAAC;QAClB,YAAO,GAAG,EAAE,CAAC;QACb,gBAAW,GAAG,EAAE,CAAC;IAyJ/C,CAAC;IAtDS,uBAAuB;QAC7B,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,OAAO,mBAAmB,CAAC,SAAS,CAAC,gBAAgB,CAAC;QACxD,CAAC;QACD,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACxC,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;YACrB,OAAO,mBAAmB,CAAC,SAAS,CAAC,gBAAgB,CAAC;QACxD,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,KAAM,CAAC,CAAC,CAAC;QACpE,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;YAChB,OA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C,CAAC;IACJ,CAAC;;AAtJe,yBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+F3B,AA/FqB,CA+FpB;AAtG0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAgB;AACf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAa;AACZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAAmB;AACjB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDAAkB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAc;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAkB;AANlC,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA+J9B"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Consent Capabilities Screen
3
+ *
4
+ * The composite layout from Peter's mockup: eyebrow + serif headline +
5
+ * subhead + agent identity tile + capability rows + revocation notice +
6
+ * action bar + footer. Used when the resolved consent config includes
7
+ * `capabilities` (the new humanized layout). Falls back to the legacy
8
+ * permissions list otherwise.
9
+ *
10
+ * This component is purely presentational. It accepts the resolved data
11
+ * (capabilities, agent metadata, copy values) and emits `consent-allow` /
12
+ * `consent-deny` events so the parent can submit the form / close the
13
+ * window. Selection state for the checkboxes is owned here to keep the
14
+ * parent simple.
15
+ *
16
+ * @module components/consent-capabilities-screen
17
+ */
18
+ import { LitElement } from "lit";
19
+ import type { Capability, AgentMetadata, ConsentTheme, CedarTemplateContext } from "../types/capabilities.types.js";
20
+ import "./consent-agent-header.js";
21
+ import "./consent-capability-card.js";
22
+ import "./consent-action-bar.js";
23
+ import "./consent-footer.js";
24
+ import "./consent-revocation-notice.js";
25
+ /**
26
+ * Detail emitted on `consent-allow` — the set of capability ids the user
27
+ * approved. The parent uses this to compose the granted list.
28
+ */
29
+ export interface CapabilitiesApproveDetail {
30
+ selectedCapabilityIds: string[];
31
+ selectedScopes: string[];
32
+ }
33
+ export declare class ConsentCapabilitiesScreen extends LitElement {
34
+ capabilities: Capability[];
35
+ agentMetadata: AgentMetadata | undefined;
36
+ cedarContext: CedarTemplateContext | undefined;
37
+ orgName: string;
38
+ headlineVerb: string;
39
+ revocationPath: string;
40
+ inactivityDays: number;
41
+ theme: ConsentTheme;
42
+ howItWorksUrl: string;
43
+ loading: boolean;
44
+ private selected;
45
+ connectedCallback(): void;
46
+ willUpdate(changed: Map<string, unknown>): void;
47
+ private seedDefaults;
48
+ static styles: import("lit").CSSResult;
49
+ private hostStyle;
50
+ private onCapabilityToggle;
51
+ private onAllow;
52
+ private onDeny;
53
+ private compileCapabilityCedar;
54
+ private renderHeadline;
55
+ render(): import("lit").TemplateResult<1>;
56
+ }
57
+ declare global {
58
+ interface HTMLElementTagNameMap {
59
+ "consent-capabilities-screen": ConsentCapabilitiesScreen;
60
+ }
61
+ }
62
+ //# sourceMappingURL=consent-capabilities-screen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consent-capabilities-screen.d.ts","sourceRoot":"","sources":["../../src/components/consent-capabilities-screen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAQrD,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,YAAY,EACZ,oBAAoB,EACrB,MAAM,gCAAgC,CAAC;AAExC,OAAO,2BAA2B,CAAC;AACnC,OAAO,8BAA8B,CAAC;AACtC,OAAO,yBAAyB,CAAC;AACjC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,gCAAgC,CAAC;AAGxC;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,qBACa,yBAA0B,SAAQ,UAAU;IAC5B,YAAY,EAAE,UAAU,EAAE,CAAM;IAC/B,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IACzC,YAAY,EAAE,oBAAoB,GAAG,SAAS,CAAC;IAC/C,OAAO,SAAM;IACb,YAAY,SAAS;IACrB,cAAc,SAAgC;IAC9C,cAAc,SAAM;IACpB,KAAK,EAAE,YAAY,CAAW;IACC,aAAa,SAAM;IACjD,OAAO,UAAS;IAEpC,OAAO,CAAC,QAAQ,CAAqB;IAErC,iBAAiB,IAAI,IAAI;IAKzB,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAMxD,OAAO,CAAC,YAAY;IAQpB,OAAgB,MAAM,0BAuEpB;IAEF,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,kBAAkB,CAMxB;IAEF,OAAO,CAAC,OAAO,CAiBb;IAEF,OAAO,CAAC,MAAM,CAIZ;IAEF,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,cAAc;IAkBb,MAAM;CAmEhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,6BAA6B,EAAE,yBAAyB,CAAC;KAC1D;CACF"}
@@ -0,0 +1,306 @@
1
+ /**
2
+ * Consent Capabilities Screen
3
+ *
4
+ * The composite layout from Peter's mockup: eyebrow + serif headline +
5
+ * subhead + agent identity tile + capability rows + revocation notice +
6
+ * action bar + footer. Used when the resolved consent config includes
7
+ * `capabilities` (the new humanized layout). Falls back to the legacy
8
+ * permissions list otherwise.
9
+ *
10
+ * This component is purely presentational. It accepts the resolved data
11
+ * (capabilities, agent metadata, copy values) and emits `consent-allow` /
12
+ * `consent-deny` events so the parent can submit the form / close the
13
+ * window. Selection state for the checkboxes is owned here to keep the
14
+ * parent simple.
15
+ *
16
+ * @module components/consent-capabilities-screen
17
+ */
18
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ };
24
+ import { LitElement, html, css, nothing } from "lit";
25
+ import { customElement, property, state } from "lit/decorators.js";
26
+ import { CONSENT_COPY_TOKENS, formatToken } from "../copy/tokens.js";
27
+ import { getConsentTheme, themeToCssVariables, } from "../styles/theme.js";
28
+ import { compileSingleCapability } from "../cedar/compile.js";
29
+ import "./consent-agent-header.js";
30
+ import "./consent-capability-card.js";
31
+ import "./consent-action-bar.js";
32
+ import "./consent-footer.js";
33
+ import "./consent-revocation-notice.js";
34
+ let ConsentCapabilitiesScreen = class ConsentCapabilitiesScreen extends LitElement {
35
+ constructor() {
36
+ super(...arguments);
37
+ this.capabilities = [];
38
+ this.orgName = "";
39
+ this.headlineVerb = "use";
40
+ this.revocationPath = "Account → Connected Agents";
41
+ this.inactivityDays = 90;
42
+ this.theme = "light";
43
+ this.howItWorksUrl = "";
44
+ this.loading = false;
45
+ this.selected = new Set();
46
+ this.onCapabilityToggle = (event) => {
47
+ const detail = event.detail;
48
+ const next = new Set(this.selected);
49
+ if (detail.checked)
50
+ next.add(detail.id);
51
+ else
52
+ next.delete(detail.id);
53
+ this.selected = next;
54
+ };
55
+ this.onAllow = () => {
56
+ if (this.loading)
57
+ return;
58
+ const selectedIds = Array.from(this.selected);
59
+ const selectedScopes = this.capabilities
60
+ .filter((c) => this.selected.has(c.id))
61
+ .flatMap((c) => c.scopes);
62
+ const detail = {
63
+ selectedCapabilityIds: selectedIds,
64
+ selectedScopes,
65
+ };
66
+ this.dispatchEvent(new CustomEvent("capabilities-allow", {
67
+ detail,
68
+ bubbles: true,
69
+ composed: true,
70
+ }));
71
+ };
72
+ this.onDeny = () => {
73
+ this.dispatchEvent(new CustomEvent("capabilities-deny", { bubbles: true, composed: true }));
74
+ };
75
+ }
76
+ connectedCallback() {
77
+ super.connectedCallback();
78
+ this.seedDefaults();
79
+ }
80
+ willUpdate(changed) {
81
+ if (changed.has("capabilities")) {
82
+ this.seedDefaults();
83
+ }
84
+ }
85
+ seedDefaults() {
86
+ const next = new Set();
87
+ for (const capability of this.capabilities) {
88
+ if (capability.defaultOn)
89
+ next.add(capability.id);
90
+ }
91
+ this.selected = next;
92
+ }
93
+ hostStyle() {
94
+ return `:host { ${themeToCssVariables(getConsentTheme(this.theme))} }`;
95
+ }
96
+ compileCapabilityCedar(capability) {
97
+ if (!this.cedarContext) {
98
+ return capability.cedar;
99
+ }
100
+ try {
101
+ return compileSingleCapability(capability, this.cedarContext);
102
+ }
103
+ catch {
104
+ return capability.cedar;
105
+ }
106
+ }
107
+ renderHeadline() {
108
+ const agentName = this.agentMetadata?.name || "this agent";
109
+ const tokens = CONSENT_COPY_TOKENS;
110
+ const raw = formatToken(tokens.headline.template, {
111
+ Agent: "@@AGENT@@",
112
+ Verb: this.headlineVerb || "use",
113
+ Org: "@@ORG@@",
114
+ });
115
+ const escaped = escapeHtml(raw);
116
+ const withSerifEntities = escaped
117
+ .replace("@@AGENT@@", `<em>${escapeHtml(agentName)}</em>`)
118
+ .replace("@@ORG@@", `<em>${escapeHtml(this.orgName || "this site")}</em>`);
119
+ return html `<h1
120
+ class="headline"
121
+ .innerHTML=${withSerifEntities}
122
+ ></h1>`;
123
+ }
124
+ render() {
125
+ const tokens = CONSENT_COPY_TOKENS;
126
+ const agentName = this.agentMetadata?.name || "this agent";
127
+ const subhead = formatToken(tokens.subhead.template, { Agent: agentName });
128
+ const sectionHeader = formatToken(tokens.section.capabilitiesHeader, {
129
+ Agent: agentName.toUpperCase(),
130
+ });
131
+ return html `
132
+ <style>
133
+ ${this.hostStyle()}
134
+ </style>
135
+ <div class="card" part="card">
136
+ <span class="eyebrow">${tokens.eyebrow.permissionRequest}</span>
137
+ ${this.renderHeadline()}
138
+ <p class="subhead">${subhead}</p>
139
+ ${this.agentMetadata
140
+ ? html `<consent-agent-header
141
+ agentName="${this.agentMetadata.name}"
142
+ vendor="${this.agentMetadata.vendor || ""}"
143
+ surfaceLabel="${this.agentMetadata.surfaceLabel || ""}"
144
+ ?verified=${this.agentMetadata.verified}
145
+ logoUrl="${this.agentMetadata.logoUrl || ""}"
146
+ connectedAt="${this.agentMetadata.connectedAt || ""}"
147
+ ></consent-agent-header>`
148
+ : nothing}
149
+ <div>
150
+ <div class="section-header">
151
+ <span>${sectionHeader}</span>
152
+ <span class="hint">${tokens.section.tapToToggle}</span>
153
+ </div>
154
+ <div class="rows" @capability-toggle=${this.onCapabilityToggle}>
155
+ ${this.capabilities.map((capability) => html `
156
+ <consent-capability-card
157
+ capabilityId="${capability.id}"
158
+ label="${capability.label}"
159
+ description="${capability.description}"
160
+ icon="${capability.icon}"
161
+ riskLevel="${capability.riskLevel}"
162
+ ?checked=${this.selected.has(capability.id)}
163
+ compiled-cedar="${this.compileCapabilityCedar(capability)}"
164
+ ></consent-capability-card>
165
+ `)}
166
+ </div>
167
+ </div>
168
+ <consent-revocation-notice
169
+ revocationPath="${this.revocationPath}"
170
+ orgName="${this.orgName || "this site"}"
171
+ inactivityDays=${this.inactivityDays}
172
+ ></consent-revocation-notice>
173
+ <consent-action-bar
174
+ agentName="${agentName}"
175
+ theme="${this.theme}"
176
+ ?loading=${this.loading}
177
+ ?disabled=${this.selected.size === 0}
178
+ @consent-allow=${this.onAllow}
179
+ @consent-deny=${this.onDeny}
180
+ ></consent-action-bar>
181
+ <consent-footer
182
+ theme="${this.theme}"
183
+ howItWorksUrl="${this.howItWorksUrl}"
184
+ ></consent-footer>
185
+ </div>
186
+ `;
187
+ }
188
+ };
189
+ ConsentCapabilitiesScreen.styles = css `
190
+ :host {
191
+ display: block;
192
+ box-sizing: border-box;
193
+ width: 100%;
194
+ max-width: 560px;
195
+ margin: 0 auto;
196
+ }
197
+
198
+ .card {
199
+ background: var(--cs-surface-card);
200
+ border: 1px solid var(--cs-surface-border);
201
+ border-radius: 22px;
202
+ box-shadow: var(--cs-card-shadow);
203
+ padding: 28px 28px 22px;
204
+ display: flex;
205
+ flex-direction: column;
206
+ gap: 22px;
207
+ color: var(--cs-text-primary);
208
+ }
209
+
210
+ .eyebrow {
211
+ font-size: 11px;
212
+ letter-spacing: 0.16em;
213
+ font-weight: 600;
214
+ color: var(--cs-text-tertiary);
215
+ text-transform: uppercase;
216
+ }
217
+
218
+ .headline {
219
+ font-family: "Times New Roman", Georgia, serif;
220
+ font-size: 30px;
221
+ line-height: 1.18;
222
+ letter-spacing: -0.01em;
223
+ color: var(--cs-text-primary);
224
+ margin: 0;
225
+ }
226
+
227
+ .headline em {
228
+ font-style: italic;
229
+ }
230
+
231
+ .subhead {
232
+ font-size: 14.5px;
233
+ color: var(--cs-text-secondary);
234
+ line-height: 1.55;
235
+ margin: 0;
236
+ }
237
+
238
+ .section-header {
239
+ display: flex;
240
+ align-items: center;
241
+ justify-content: space-between;
242
+ font-size: 11px;
243
+ letter-spacing: 0.14em;
244
+ font-weight: 600;
245
+ color: var(--cs-text-tertiary);
246
+ text-transform: uppercase;
247
+ }
248
+
249
+ .section-header .hint {
250
+ letter-spacing: 0;
251
+ font-weight: 400;
252
+ text-transform: none;
253
+ font-size: 12px;
254
+ }
255
+
256
+ .rows {
257
+ display: flex;
258
+ flex-direction: column;
259
+ }
260
+ `;
261
+ __decorate([
262
+ property({ type: Array })
263
+ ], ConsentCapabilitiesScreen.prototype, "capabilities", void 0);
264
+ __decorate([
265
+ property({ type: Object })
266
+ ], ConsentCapabilitiesScreen.prototype, "agentMetadata", void 0);
267
+ __decorate([
268
+ property({ type: Object })
269
+ ], ConsentCapabilitiesScreen.prototype, "cedarContext", void 0);
270
+ __decorate([
271
+ property({ type: String })
272
+ ], ConsentCapabilitiesScreen.prototype, "orgName", void 0);
273
+ __decorate([
274
+ property({ type: String })
275
+ ], ConsentCapabilitiesScreen.prototype, "headlineVerb", void 0);
276
+ __decorate([
277
+ property({ type: String })
278
+ ], ConsentCapabilitiesScreen.prototype, "revocationPath", void 0);
279
+ __decorate([
280
+ property({ type: Number })
281
+ ], ConsentCapabilitiesScreen.prototype, "inactivityDays", void 0);
282
+ __decorate([
283
+ property({ type: String })
284
+ ], ConsentCapabilitiesScreen.prototype, "theme", void 0);
285
+ __decorate([
286
+ property({ type: String, attribute: "how-it-works-url" })
287
+ ], ConsentCapabilitiesScreen.prototype, "howItWorksUrl", void 0);
288
+ __decorate([
289
+ property({ type: Boolean })
290
+ ], ConsentCapabilitiesScreen.prototype, "loading", void 0);
291
+ __decorate([
292
+ state()
293
+ ], ConsentCapabilitiesScreen.prototype, "selected", void 0);
294
+ ConsentCapabilitiesScreen = __decorate([
295
+ customElement("consent-capabilities-screen")
296
+ ], ConsentCapabilitiesScreen);
297
+ export { ConsentCapabilitiesScreen };
298
+ function escapeHtml(value) {
299
+ return value
300
+ .replace(/&/g, "&amp;")
301
+ .replace(/</g, "&lt;")
302
+ .replace(/>/g, "&gt;")
303
+ .replace(/"/g, "&quot;")
304
+ .replace(/'/g, "&#39;");
305
+ }
306
+ //# sourceMappingURL=consent-capabilities-screen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consent-capabilities-screen.js","sourceRoot":"","sources":["../../src/components/consent-capabilities-screen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,mB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AE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Consent Capability Card
3
+ *
4
+ * Renders a single capability row in the new humanized consent layout.
5
+ * Shows: square checkbox + icon tile + bold label inline with description +
6
+ * optional amber HIGHER RISK chip + small "View policy" disclosure.
7
+ *
8
+ * Emits a `capability-toggle` CustomEvent with `{ id, checked }` whenever the
9
+ * checkbox state changes; the parent (`<mcp-consent>`) tracks selection.
10
+ *
11
+ * @module components/consent-capability-card
12
+ */
13
+ import { LitElement } from "lit";
14
+ import type { CapabilityIcon, RiskLevel } from "../types/capabilities.types.js";
15
+ /**
16
+ * Detail emitted on the `capability-toggle` event.
17
+ */
18
+ export interface CapabilityToggleDetail {
19
+ id: string;
20
+ checked: boolean;
21
+ }
22
+ export declare class ConsentCapabilityCard extends LitElement {
23
+ capabilityId: string;
24
+ label: string;
25
+ description: string;
26
+ icon: CapabilityIcon;
27
+ riskLevel: RiskLevel;
28
+ checked: boolean;
29
+ compiledCedar: string;
30
+ private policyOpen;
31
+ static styles: import("lit").CSSResult;
32
+ private toggleChecked;
33
+ private togglePolicy;
34
+ private isHigherRisk;
35
+ private renderIcon;
36
+ private renderPolicy;
37
+ render(): import("lit").TemplateResult<1>;
38
+ }
39
+ declare global {
40
+ interface HTMLElementTagNameMap {
41
+ "consent-capability-card": ConsentCapabilityCard;
42
+ }
43
+ }
44
+ //# sourceMappingURL=consent-capability-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consent-capability-card.d.ts","sourceRoot":"","sources":["../../src/components/consent-capability-card.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAKrD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qBACa,qBAAsB,SAAQ,UAAU;IACvB,YAAY,SAAM;IAClB,KAAK,SAAM;IACX,WAAW,SAAM;IACjB,IAAI,EAAE,cAAc,CAAa;IACjC,SAAS,EAAE,SAAS,CAAS;IACb,OAAO,UAAS;IACH,aAAa,SAAM;IAEnE,OAAO,CAAC,UAAU,CAAS;IAEpC,OAAgB,MAAM,0BAwJpB;IAEF,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,YAAY;IA4BX,MAAM;CAoChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,yBAAyB,EAAE,qBAAqB,CAAC;KAClD;CACF"}