@kya-os/consent 0.3.0 → 0.4.1

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 (226) hide show
  1. package/README.md +185 -20
  2. package/dist/bundle/index.d.ts +4 -0
  3. package/dist/bundle/index.d.ts.map +1 -1
  4. package/dist/bundle/index.js +6 -0
  5. package/dist/bundle/index.js.map +1 -1
  6. package/dist/bundle/inline.d.ts.map +1 -1
  7. package/dist/bundle/inline.js +4 -4
  8. package/dist/bundle/inline.js.map +1 -1
  9. package/dist/cjs/bundle/index.js +15 -1
  10. package/dist/cjs/bundle/index.js.map +1 -1
  11. package/dist/cjs/bundle/inline.js +4 -4
  12. package/dist/cjs/bundle/inline.js.map +1 -1
  13. package/dist/cjs/components/consent-action-bar.js +97 -25
  14. package/dist/cjs/components/consent-action-bar.js.map +1 -1
  15. package/dist/cjs/components/consent-agent-header.js +7 -105
  16. package/dist/cjs/components/consent-agent-header.js.map +1 -1
  17. package/dist/cjs/components/consent-button.js +6 -1
  18. package/dist/cjs/components/consent-button.js.map +1 -1
  19. package/dist/cjs/components/consent-capabilities-screen.js +488 -66
  20. package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
  21. package/dist/cjs/components/consent-capability-card.js +197 -42
  22. package/dist/cjs/components/consent-capability-card.js.map +1 -1
  23. package/dist/cjs/components/consent-checkbox.js +7 -0
  24. package/dist/cjs/components/consent-checkbox.js.map +1 -1
  25. package/dist/cjs/components/consent-connector-header.js +206 -43
  26. package/dist/cjs/components/consent-connector-header.js.map +1 -1
  27. package/dist/cjs/components/consent-duration.js +1 -1
  28. package/dist/cjs/components/consent-footer.js +13 -12
  29. package/dist/cjs/components/consent-footer.js.map +1 -1
  30. package/dist/cjs/components/consent-headline.js +445 -30
  31. package/dist/cjs/components/consent-headline.js.map +1 -1
  32. package/dist/cjs/components/consent-oauth-button.js +71 -62
  33. package/dist/cjs/components/consent-oauth-button.js.map +1 -1
  34. package/dist/cjs/components/consent-otp-input.js +5 -0
  35. package/dist/cjs/components/consent-otp-input.js.map +1 -1
  36. package/dist/cjs/components/consent-phone-handoff.js +3 -3
  37. package/dist/cjs/components/consent-request-expiry.js +1 -1
  38. package/dist/cjs/components/consent-revocation-notice.js +4 -2
  39. package/dist/cjs/components/consent-revocation-notice.js.map +1 -1
  40. package/dist/cjs/components/consent-revoke.js +9 -4
  41. package/dist/cjs/components/consent-revoke.js.map +1 -1
  42. package/dist/cjs/components/consent-secured-by.js +106 -0
  43. package/dist/cjs/components/consent-secured-by.js.map +1 -0
  44. package/dist/cjs/components/consent-shell.js +1 -1
  45. package/dist/cjs/components/consent-terms.js +7 -0
  46. package/dist/cjs/components/consent-terms.js.map +1 -1
  47. package/dist/cjs/components/consent-wallet-check.js +1 -1
  48. package/dist/cjs/components/consent-wallet-notice.js +1 -1
  49. package/dist/cjs/components/consent-wallet-orb.js +1 -1
  50. package/dist/cjs/components/consent-wallet-signature.js +1 -1
  51. package/dist/cjs/components/decision-icons.js +33 -0
  52. package/dist/cjs/components/decision-icons.js.map +1 -0
  53. package/dist/cjs/components/edit-region.js +309 -0
  54. package/dist/cjs/components/edit-region.js.map +1 -0
  55. package/dist/cjs/components/grant-field-styles.js +2 -2
  56. package/dist/cjs/components/index.js +5 -1
  57. package/dist/cjs/components/index.js.map +1 -1
  58. package/dist/cjs/components/mcp-consent.js +81 -36
  59. package/dist/cjs/components/mcp-consent.js.map +1 -1
  60. package/dist/cjs/components/preview.js +67 -0
  61. package/dist/cjs/components/preview.js.map +1 -0
  62. package/dist/cjs/constants/capabilities.js +21 -2
  63. package/dist/cjs/constants/capabilities.js.map +1 -1
  64. package/dist/cjs/copy/tokens.js +60 -21
  65. package/dist/cjs/copy/tokens.js.map +1 -1
  66. package/dist/cjs/identity/agent-identity.js +3 -2
  67. package/dist/cjs/identity/agent-identity.js.map +1 -1
  68. package/dist/cjs/mcp-app/inline.js +2 -2
  69. package/dist/cjs/mcp-app/inline.js.map +1 -1
  70. package/dist/cjs/react/index.js +11 -2
  71. package/dist/cjs/react/index.js.map +1 -1
  72. package/dist/cjs/styles/brand.js +385 -0
  73. package/dist/cjs/styles/brand.js.map +1 -0
  74. package/dist/cjs/styles/index.js +1 -0
  75. package/dist/cjs/styles/index.js.map +1 -1
  76. package/dist/cjs/styles/theme.js +100 -30
  77. package/dist/cjs/styles/theme.js.map +1 -1
  78. package/dist/cjs/types/capabilities.types.js +1 -2
  79. package/dist/cjs/types/capabilities.types.js.map +1 -1
  80. package/dist/cjs/types/decision.types.js +13 -0
  81. package/dist/cjs/types/decision.types.js.map +1 -0
  82. package/dist/cjs/types/edit.types.js +80 -0
  83. package/dist/cjs/types/edit.types.js.map +1 -0
  84. package/dist/cjs/types/index.js +2 -0
  85. package/dist/cjs/types/index.js.map +1 -1
  86. package/dist/components/consent-action-bar.d.ts +20 -1
  87. package/dist/components/consent-action-bar.d.ts.map +1 -1
  88. package/dist/components/consent-action-bar.js +97 -25
  89. package/dist/components/consent-action-bar.js.map +1 -1
  90. package/dist/components/consent-agent-header.d.ts +4 -17
  91. package/dist/components/consent-agent-header.d.ts.map +1 -1
  92. package/dist/components/consent-agent-header.js +7 -105
  93. package/dist/components/consent-agent-header.js.map +1 -1
  94. package/dist/components/consent-button.d.ts +2 -0
  95. package/dist/components/consent-button.d.ts.map +1 -1
  96. package/dist/components/consent-button.js +6 -1
  97. package/dist/components/consent-button.js.map +1 -1
  98. package/dist/components/consent-capabilities-screen.d.ts +93 -14
  99. package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
  100. package/dist/components/consent-capabilities-screen.js +488 -67
  101. package/dist/components/consent-capabilities-screen.js.map +1 -1
  102. package/dist/components/consent-capability-card.d.ts +42 -5
  103. package/dist/components/consent-capability-card.d.ts.map +1 -1
  104. package/dist/components/consent-capability-card.js +196 -41
  105. package/dist/components/consent-capability-card.js.map +1 -1
  106. package/dist/components/consent-checkbox.d.ts +2 -0
  107. package/dist/components/consent-checkbox.d.ts.map +1 -1
  108. package/dist/components/consent-checkbox.js +7 -0
  109. package/dist/components/consent-checkbox.js.map +1 -1
  110. package/dist/components/consent-connector-header.d.ts +39 -7
  111. package/dist/components/consent-connector-header.d.ts.map +1 -1
  112. package/dist/components/consent-connector-header.js +206 -43
  113. package/dist/components/consent-connector-header.js.map +1 -1
  114. package/dist/components/consent-duration.js +1 -1
  115. package/dist/components/consent-footer.d.ts +6 -4
  116. package/dist/components/consent-footer.d.ts.map +1 -1
  117. package/dist/components/consent-footer.js +13 -12
  118. package/dist/components/consent-footer.js.map +1 -1
  119. package/dist/components/consent-headline.d.ts +76 -12
  120. package/dist/components/consent-headline.d.ts.map +1 -1
  121. package/dist/components/consent-headline.js +445 -32
  122. package/dist/components/consent-headline.js.map +1 -1
  123. package/dist/components/consent-oauth-button.d.ts +7 -3
  124. package/dist/components/consent-oauth-button.d.ts.map +1 -1
  125. package/dist/components/consent-oauth-button.js +74 -65
  126. package/dist/components/consent-oauth-button.js.map +1 -1
  127. package/dist/components/consent-otp-input.d.ts.map +1 -1
  128. package/dist/components/consent-otp-input.js +5 -0
  129. package/dist/components/consent-otp-input.js.map +1 -1
  130. package/dist/components/consent-passkey.d.ts +6 -0
  131. package/dist/components/consent-passkey.d.ts.map +1 -1
  132. package/dist/components/consent-passkey.js +67 -9
  133. package/dist/components/consent-passkey.js.map +1 -1
  134. package/dist/components/consent-phone-handoff.js +3 -3
  135. package/dist/components/consent-request-expiry.js +1 -1
  136. package/dist/components/consent-revocation-notice.d.ts.map +1 -1
  137. package/dist/components/consent-revocation-notice.js +4 -2
  138. package/dist/components/consent-revocation-notice.js.map +1 -1
  139. package/dist/components/consent-revoke.d.ts +2 -0
  140. package/dist/components/consent-revoke.d.ts.map +1 -1
  141. package/dist/components/consent-revoke.js +9 -4
  142. package/dist/components/consent-revoke.js.map +1 -1
  143. package/dist/components/consent-secured-by.d.ts +25 -0
  144. package/dist/components/consent-secured-by.d.ts.map +1 -0
  145. package/dist/components/consent-secured-by.js +103 -0
  146. package/dist/components/consent-secured-by.js.map +1 -0
  147. package/dist/components/consent-shell.js +1 -1
  148. package/dist/components/consent-terms.d.ts +2 -0
  149. package/dist/components/consent-terms.d.ts.map +1 -1
  150. package/dist/components/consent-terms.js +7 -0
  151. package/dist/components/consent-terms.js.map +1 -1
  152. package/dist/components/consent-wallet-check.js +1 -1
  153. package/dist/components/consent-wallet-notice.js +1 -1
  154. package/dist/components/consent-wallet-orb.js +1 -1
  155. package/dist/components/consent-wallet-signature.js +1 -1
  156. package/dist/components/decision-icons.d.ts +22 -0
  157. package/dist/components/decision-icons.d.ts.map +1 -0
  158. package/dist/components/decision-icons.js +30 -0
  159. package/dist/components/decision-icons.js.map +1 -0
  160. package/dist/components/edit-region.d.ts +50 -0
  161. package/dist/components/edit-region.d.ts.map +1 -0
  162. package/dist/components/edit-region.js +305 -0
  163. package/dist/components/edit-region.js.map +1 -0
  164. package/dist/components/grant-field-styles.js +2 -2
  165. package/dist/components/index.d.ts +3 -2
  166. package/dist/components/index.d.ts.map +1 -1
  167. package/dist/components/index.js +3 -2
  168. package/dist/components/index.js.map +1 -1
  169. package/dist/components/mcp-consent.d.ts +15 -0
  170. package/dist/components/mcp-consent.d.ts.map +1 -1
  171. package/dist/components/mcp-consent.js +81 -36
  172. package/dist/components/mcp-consent.js.map +1 -1
  173. package/dist/components/preview.d.ts +38 -0
  174. package/dist/components/preview.d.ts.map +1 -0
  175. package/dist/components/preview.js +61 -0
  176. package/dist/components/preview.js.map +1 -0
  177. package/dist/consent.js +2200 -389
  178. package/dist/consent.min.js +1308 -496
  179. package/dist/constants/capabilities.d.ts +14 -2
  180. package/dist/constants/capabilities.d.ts.map +1 -1
  181. package/dist/constants/capabilities.js +21 -2
  182. package/dist/constants/capabilities.js.map +1 -1
  183. package/dist/copy/tokens.d.ts +60 -21
  184. package/dist/copy/tokens.d.ts.map +1 -1
  185. package/dist/copy/tokens.js +60 -21
  186. package/dist/copy/tokens.js.map +1 -1
  187. package/dist/identity/agent-identity.d.ts +3 -2
  188. package/dist/identity/agent-identity.d.ts.map +1 -1
  189. package/dist/identity/agent-identity.js +3 -2
  190. package/dist/identity/agent-identity.js.map +1 -1
  191. package/dist/mcp-app/inline.d.ts.map +1 -1
  192. package/dist/mcp-app/inline.js +2 -2
  193. package/dist/mcp-app/inline.js.map +1 -1
  194. package/dist/react/index.d.ts +6 -1
  195. package/dist/react/index.d.ts.map +1 -1
  196. package/dist/react/index.js +10 -1
  197. package/dist/react/index.js.map +1 -1
  198. package/dist/styles/brand.d.ts +184 -0
  199. package/dist/styles/brand.d.ts.map +1 -0
  200. package/dist/styles/brand.js +372 -0
  201. package/dist/styles/brand.js.map +1 -0
  202. package/dist/styles/index.d.ts +1 -0
  203. package/dist/styles/index.d.ts.map +1 -1
  204. package/dist/styles/index.js +1 -0
  205. package/dist/styles/index.js.map +1 -1
  206. package/dist/styles/theme.d.ts +73 -13
  207. package/dist/styles/theme.d.ts.map +1 -1
  208. package/dist/styles/theme.js +96 -29
  209. package/dist/styles/theme.js.map +1 -1
  210. package/dist/types/capabilities.types.d.ts +12 -14
  211. package/dist/types/capabilities.types.d.ts.map +1 -1
  212. package/dist/types/capabilities.types.js +1 -2
  213. package/dist/types/capabilities.types.js.map +1 -1
  214. package/dist/types/decision.types.d.ts +57 -0
  215. package/dist/types/decision.types.d.ts.map +1 -0
  216. package/dist/types/decision.types.js +12 -0
  217. package/dist/types/decision.types.js.map +1 -0
  218. package/dist/types/edit.types.d.ts +73 -0
  219. package/dist/types/edit.types.d.ts.map +1 -0
  220. package/dist/types/edit.types.js +76 -0
  221. package/dist/types/edit.types.js.map +1 -0
  222. package/dist/types/index.d.ts +2 -0
  223. package/dist/types/index.d.ts.map +1 -1
  224. package/dist/types/index.js +2 -0
  225. package/dist/types/index.js.map +1 -1
  226. package/package.json +2 -2
@@ -2,37 +2,101 @@
2
2
  * Consent Headline
3
3
  *
4
4
  * The top of a consent screen: an eyebrow, the headline that says who is
5
- * asking and where, and a subhead. consent-capabilities-screen renders one,
6
- * and a screen composed from parts places its own.
5
+ * asking, and a subhead. consent-capabilities-screen renders one, and a screen
6
+ * composed from parts places its own.
7
7
  *
8
- * The agent's and the organization's names come from outside, and an agent
9
- * chooses its own name. Both are rendered as text, never as markup, so a name
10
- * like `Atlas <span class="pill">Verified</span>` reads exactly that way.
8
+ * The headline reads "{Agent} is requesting permission on your behalf", or
9
+ * "{Agent} would like to {Verb} on your behalf" when the host gives a verb.
10
+ * Given the agent (`agent`), its name is a button that opens what is known
11
+ * about it, and a domain-bound agent's name is followed by a chip naming the
12
+ * host that vouches for it. The subhead shows only when the host gives one.
11
13
  *
12
- * Parts: `eyebrow`, `headline` (the h1; each name is an `em` inside it) and
13
- * `subhead`.
14
+ * The agent's name comes from outside, and an agent chooses its own name. It
15
+ * is rendered as text, never as markup, so a name like
16
+ * `Atlas <span class="pill">Verified</span>` reads exactly that way.
17
+ *
18
+ * Parts: `eyebrow`, `headline` (the h1), `agent-name` (the name, an `em`, or a
19
+ * button when the agent is given), `host` (the domain chip), `subhead` and
20
+ * `agent-details` (the popover).
21
+ *
22
+ * Slot: `headline`, the h1's words in place of the standard line, for a host
23
+ * that words it its own way. The host's content is its own markup, so the host
24
+ * keeps an agent-chosen name as text. consent-capabilities-screen forwards its
25
+ * own `headline` slot here.
26
+ *
27
+ * In edit mode (`preview` and `editable`) the subhead is a region a person
28
+ * types into, keyed `description`; with no subhead of its own it starts from
29
+ * the standard line, and only typing writes it.
14
30
  *
15
31
  * @module components/consent-headline
16
32
  */
17
33
  import { LitElement } from "lit";
34
+ import { type AgentMetadata } from "../types/capabilities.types.js";
35
+ import { type ConsentEditSource } from "../types/edit.types.js";
36
+ /** The first letter or digit of a name, for a tile with no logo. */
37
+ export declare function initialOf(name: string): string;
38
+ /** The host that vouches for a domain-bound agent; none for any other. */
39
+ export declare function vouchingHost(agent: Pick<AgentMetadata, "verification" | "verified" | "domain">): string | undefined;
18
40
  export declare class ConsentHeadline extends LitElement {
19
41
  /** The agent asking. "An assistant" in the headline when it is empty. */
20
42
  agentName: string;
21
- /** The organization the agent wants to act at. "this site" when empty. */
22
- orgName: string;
43
+ /**
44
+ * The agent, for its name, the host chip and what its name opens. Its name
45
+ * wins over `agent-name`. Without it the name is plain text.
46
+ */
47
+ agent: AgentMetadata | undefined;
23
48
  /**
24
49
  * What the agent wants to do, as a phrase that follows "would like to",
25
- * such as "read your orders". Empty or "use" gives the generic headline.
50
+ * such as "read your orders". Empty or "use" gives the standard headline.
26
51
  */
27
52
  verb: string;
28
- /** The subhead. Empty gives the standard line for the agent. */
53
+ /** The subhead. Empty draws none. */
29
54
  description: string;
30
55
  /** The line above the headline. Empty gives "PERMISSION REQUEST". */
31
56
  eyebrow: string;
57
+ /** Draws as it would live; nothing here acts, so it only enables `editable`. */
58
+ preview: boolean;
59
+ /** With `preview`: the subhead can be edited in place. */
60
+ editable: boolean;
61
+ /** The raw text each region edits, by key. See `ConsentEditSource`. */
62
+ editSource: ConsentEditSource | undefined;
63
+ /** Whether the host filled the `headline` slot, so the standard line steps aside. */
64
+ private hostHeadline;
32
65
  static styles: import("lit").CSSResult;
33
66
  render(): import("lit").TemplateResult<1>;
34
- /** The headline, with each name as text in its own `em`. */
67
+ /** The name the headline gives the agent. */
68
+ private get displayName();
69
+ /**
70
+ * The subhead: the host's, as a region in edit mode. With none, nothing,
71
+ * except in edit mode, where the region starts from the standard line.
72
+ */
73
+ private subheadText;
74
+ /**
75
+ * Before the first render, reads what the slot will hold from the light DOM,
76
+ * so the first render is already the right one. A change made here does not
77
+ * schedule another update, where one made after the first update would.
78
+ */
79
+ willUpdate(): void;
80
+ /**
81
+ * The children the `headline` slot will be given, flattened: a screen's
82
+ * forwarded slot counts only when something is assigned to it.
83
+ */
84
+ private lightHeadlineFilled;
85
+ /**
86
+ * Reads the slot itself, not the event's target: when a screen forwards its
87
+ * own slot here, the event comes from that slot, and a host that fills the
88
+ * screen's slot later is seen only through the flattened list.
89
+ */
90
+ private readHeadlineSlot;
91
+ /** The headline, with the agent's name as a button when the agent is given. */
35
92
  private headlinePieces;
93
+ private renderName;
94
+ /** What the agent's name opens: who it is and how its name was checked. */
95
+ private renderDetails;
96
+ /** Places the popover under the name, inside the window, while it is open. */
97
+ private onDetailsToggle;
98
+ private placeDetails;
99
+ disconnectedCallback(): void;
36
100
  }
37
101
  declare global {
38
102
  interface HTMLElementTagNameMap {
@@ -1 +1 @@
1
- {"version":3,"file":"consent-headline.d.ts","sourceRoot":"","sources":["../../src/components/consent-headline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAQ5C,qBACa,eAAgB,SAAQ,UAAU;IAC7C,yEAAyE;IACpB,SAAS,SAAM;IAEpE,0EAA0E;IACvB,OAAO,SAAM;IAEhE;;;OAGG;IACyB,IAAI,SAAM;IAEtC,gEAAgE;IACpC,WAAW,SAAM;IAE7C,qEAAqE;IACzC,OAAO,SAAM;IAEzC,OAAgB,MAAM,0BAoCpB;IAEO,MAAM;IAiBf,4DAA4D;IAC5D,OAAO,CAAC,cAAc;CAiBvB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,eAAe,CAAC;KACrC;CACF"}
1
+ {"version":3,"file":"consent-headline.d.ts","sourceRoot":"","sources":["../../src/components/consent-headline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,UAAU,EAA2B,MAAM,KAAK,CAAC;AAI1D,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAYhC,oEAAoE;AACpE,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,0EAA0E;AAC1E,wBAAgB,YAAY,CAC1B,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,cAAc,GAAG,UAAU,GAAG,QAAQ,CAAC,GACjE,MAAM,GAAG,SAAS,CAIpB;AAKD,qBACa,eAAgB,SAAQ,UAAU;IAC7C,yEAAyE;IACpB,SAAS,SAAM;IAEpE;;;OAGG;IAC6B,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;IAEjE;;;OAGG;IACyB,IAAI,SAAM;IAEtC,qCAAqC;IACT,WAAW,SAAM;IAE7C,qEAAqE;IACzC,OAAO,SAAM;IAEzC,gFAAgF;IACpC,OAAO,UAAS;IAE5D,0DAA0D;IACd,QAAQ,UAAS;IAE7D,uEAAuE;IACvC,UAAU,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAE1E,qFAAqF;IAC5E,OAAO,CAAC,YAAY,CAAS;IAEtC,OAAgB,MAAM,0BA6NpB;IAEO,MAAM;IAsBf,6CAA6C;IAC7C,OAAO,KAAK,WAAW,GAEtB;IAED;;;OAGG;IACH,OAAO,CAAC,WAAW;IAcnB;;;;OAIG;IACM,UAAU,IAAI,IAAI;IAK3B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAU3B;;;;OAIG;IACH,OAAO,CAAC,gBAAgB,CAMtB;IAEF,+EAA+E;IAC/E,OAAO,CAAC,cAAc;IActB,OAAO,CAAC,UAAU;IA+BlB,2EAA2E;IAC3E,OAAO,CAAC,aAAa;IA+DrB,8EAA8E;IAC9E,OAAO,CAAC,eAAe,CAWrB;IAEF,OAAO,CAAC,YAAY,CAclB;IAEO,oBAAoB,IAAI,IAAI;CAKtC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,eAAe,CAAC;KACrC;CACF"}