@kya-os/consent 0.4.1 → 0.5.0

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 (174) hide show
  1. package/README.md +8 -4
  2. package/dist/bundle/index.d.ts +5 -0
  3. package/dist/bundle/index.d.ts.map +1 -1
  4. package/dist/bundle/index.js +7 -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 +21 -0
  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-capabilities-screen.js +168 -215
  14. package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
  15. package/dist/cjs/components/consent-capability-card.js +30 -7
  16. package/dist/cjs/components/consent-capability-card.js.map +1 -1
  17. package/dist/cjs/components/consent-connector-header.js +69 -15
  18. package/dist/cjs/components/consent-connector-header.js.map +1 -1
  19. package/dist/cjs/components/consent-flow-timeline.js +177 -0
  20. package/dist/cjs/components/consent-flow-timeline.js.map +1 -0
  21. package/dist/cjs/components/consent-flow.js +540 -0
  22. package/dist/cjs/components/consent-flow.js.map +1 -0
  23. package/dist/cjs/components/consent-footer.js +9 -2
  24. package/dist/cjs/components/consent-footer.js.map +1 -1
  25. package/dist/cjs/components/consent-headline.js +30 -76
  26. package/dist/cjs/components/consent-headline.js.map +1 -1
  27. package/dist/cjs/components/consent-oauth-button.js +10 -89
  28. package/dist/cjs/components/consent-oauth-button.js.map +1 -1
  29. package/dist/cjs/components/consent-revocation-notice.js +25 -16
  30. package/dist/cjs/components/consent-revocation-notice.js.map +1 -1
  31. package/dist/cjs/components/consent-wallet-check.js +25 -1
  32. package/dist/cjs/components/consent-wallet-check.js.map +1 -1
  33. package/dist/cjs/components/decision-icons.js +6 -2
  34. package/dist/cjs/components/decision-icons.js.map +1 -1
  35. package/dist/cjs/components/flow-blocks.js +762 -0
  36. package/dist/cjs/components/flow-blocks.js.map +1 -0
  37. package/dist/cjs/components/flow-motion.js +177 -0
  38. package/dist/cjs/components/flow-motion.js.map +1 -0
  39. package/dist/cjs/components/grant-details.js +143 -0
  40. package/dist/cjs/components/grant-details.js.map +1 -0
  41. package/dist/cjs/components/index.js +10 -1
  42. package/dist/cjs/components/index.js.map +1 -1
  43. package/dist/cjs/components/mcp-consent.js +12 -0
  44. package/dist/cjs/components/mcp-consent.js.map +1 -1
  45. package/dist/cjs/components/provider-icons.js +92 -0
  46. package/dist/cjs/components/provider-icons.js.map +1 -0
  47. package/dist/cjs/constants/capabilities.js +6 -1
  48. package/dist/cjs/constants/capabilities.js.map +1 -1
  49. package/dist/cjs/copy/tokens.js +9 -5
  50. package/dist/cjs/copy/tokens.js.map +1 -1
  51. package/dist/cjs/flow/copy.js +146 -0
  52. package/dist/cjs/flow/copy.js.map +1 -0
  53. package/dist/cjs/flow/index.js +31 -0
  54. package/dist/cjs/flow/index.js.map +1 -0
  55. package/dist/cjs/flow/model.js +107 -0
  56. package/dist/cjs/flow/model.js.map +1 -0
  57. package/dist/cjs/flow/presets.js +157 -0
  58. package/dist/cjs/flow/presets.js.map +1 -0
  59. package/dist/cjs/flow/schema.js +76 -0
  60. package/dist/cjs/flow/schema.js.map +1 -0
  61. package/dist/cjs/mcp-app/inline.js +2 -2
  62. package/dist/cjs/mcp-app/inline.js.map +1 -1
  63. package/dist/cjs/react/index.js +30 -1
  64. package/dist/cjs/react/index.js.map +1 -1
  65. package/dist/cjs/styles/theme.js +8 -6
  66. package/dist/cjs/styles/theme.js.map +1 -1
  67. package/dist/components/consent-capabilities-screen.d.ts +22 -6
  68. package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
  69. package/dist/components/consent-capabilities-screen.js +169 -216
  70. package/dist/components/consent-capabilities-screen.js.map +1 -1
  71. package/dist/components/consent-capability-card.d.ts +10 -1
  72. package/dist/components/consent-capability-card.d.ts.map +1 -1
  73. package/dist/components/consent-capability-card.js +30 -7
  74. package/dist/components/consent-capability-card.js.map +1 -1
  75. package/dist/components/consent-connector-header.d.ts +14 -1
  76. package/dist/components/consent-connector-header.d.ts.map +1 -1
  77. package/dist/components/consent-connector-header.js +69 -15
  78. package/dist/components/consent-connector-header.js.map +1 -1
  79. package/dist/components/consent-flow-timeline.d.ts +49 -0
  80. package/dist/components/consent-flow-timeline.d.ts.map +1 -0
  81. package/dist/components/consent-flow-timeline.js +174 -0
  82. package/dist/components/consent-flow-timeline.js.map +1 -0
  83. package/dist/components/consent-flow.d.ts +101 -0
  84. package/dist/components/consent-flow.d.ts.map +1 -0
  85. package/dist/components/consent-flow.js +504 -0
  86. package/dist/components/consent-flow.js.map +1 -0
  87. package/dist/components/consent-footer.d.ts.map +1 -1
  88. package/dist/components/consent-footer.js +9 -2
  89. package/dist/components/consent-footer.js.map +1 -1
  90. package/dist/components/consent-headline.d.ts +12 -5
  91. package/dist/components/consent-headline.d.ts.map +1 -1
  92. package/dist/components/consent-headline.js +30 -76
  93. package/dist/components/consent-headline.js.map +1 -1
  94. package/dist/components/consent-oauth-button.d.ts +3 -4
  95. package/dist/components/consent-oauth-button.d.ts.map +1 -1
  96. package/dist/components/consent-oauth-button.js +10 -89
  97. package/dist/components/consent-oauth-button.js.map +1 -1
  98. package/dist/components/consent-revocation-notice.d.ts.map +1 -1
  99. package/dist/components/consent-revocation-notice.js +25 -16
  100. package/dist/components/consent-revocation-notice.js.map +1 -1
  101. package/dist/components/consent-wallet-check.d.ts +8 -0
  102. package/dist/components/consent-wallet-check.d.ts.map +1 -1
  103. package/dist/components/consent-wallet-check.js +26 -2
  104. package/dist/components/consent-wallet-check.js.map +1 -1
  105. package/dist/components/decision-icons.d.ts +6 -2
  106. package/dist/components/decision-icons.d.ts.map +1 -1
  107. package/dist/components/decision-icons.js +6 -2
  108. package/dist/components/decision-icons.js.map +1 -1
  109. package/dist/components/flow-blocks.d.ts +45 -0
  110. package/dist/components/flow-blocks.d.ts.map +1 -0
  111. package/dist/components/flow-blocks.js +755 -0
  112. package/dist/components/flow-blocks.js.map +1 -0
  113. package/dist/components/flow-motion.d.ts +41 -0
  114. package/dist/components/flow-motion.d.ts.map +1 -0
  115. package/dist/components/flow-motion.js +164 -0
  116. package/dist/components/flow-motion.js.map +1 -0
  117. package/dist/components/grant-details.d.ts +28 -0
  118. package/dist/components/grant-details.d.ts.map +1 -0
  119. package/dist/components/grant-details.js +138 -0
  120. package/dist/components/grant-details.js.map +1 -0
  121. package/dist/components/index.d.ts +3 -0
  122. package/dist/components/index.d.ts.map +1 -1
  123. package/dist/components/index.js +3 -0
  124. package/dist/components/index.js.map +1 -1
  125. package/dist/components/mcp-consent.d.ts +4 -0
  126. package/dist/components/mcp-consent.d.ts.map +1 -1
  127. package/dist/components/mcp-consent.js +12 -0
  128. package/dist/components/mcp-consent.js.map +1 -1
  129. package/dist/components/provider-icons.d.ts +16 -0
  130. package/dist/components/provider-icons.d.ts.map +1 -0
  131. package/dist/components/provider-icons.js +88 -0
  132. package/dist/components/provider-icons.js.map +1 -0
  133. package/dist/consent.js +3066 -1084
  134. package/dist/consent.min.js +1419 -658
  135. package/dist/constants/capabilities.d.ts +6 -2
  136. package/dist/constants/capabilities.d.ts.map +1 -1
  137. package/dist/constants/capabilities.js +6 -1
  138. package/dist/constants/capabilities.js.map +1 -1
  139. package/dist/copy/tokens.d.ts +9 -5
  140. package/dist/copy/tokens.d.ts.map +1 -1
  141. package/dist/copy/tokens.js +9 -5
  142. package/dist/copy/tokens.js.map +1 -1
  143. package/dist/flow/copy.d.ts +31 -0
  144. package/dist/flow/copy.d.ts.map +1 -0
  145. package/dist/flow/copy.js +137 -0
  146. package/dist/flow/copy.js.map +1 -0
  147. package/dist/flow/index.d.ts +15 -0
  148. package/dist/flow/index.d.ts.map +1 -0
  149. package/dist/flow/index.js +15 -0
  150. package/dist/flow/index.js.map +1 -0
  151. package/dist/flow/model.d.ts +209 -0
  152. package/dist/flow/model.d.ts.map +1 -0
  153. package/dist/flow/model.js +103 -0
  154. package/dist/flow/model.js.map +1 -0
  155. package/dist/flow/presets.d.ts +29 -0
  156. package/dist/flow/presets.d.ts.map +1 -0
  157. package/dist/flow/presets.js +153 -0
  158. package/dist/flow/presets.js.map +1 -0
  159. package/dist/flow/schema.d.ts +127 -0
  160. package/dist/flow/schema.d.ts.map +1 -0
  161. package/dist/flow/schema.js +72 -0
  162. package/dist/flow/schema.js.map +1 -0
  163. package/dist/mcp-app/inline.d.ts.map +1 -1
  164. package/dist/mcp-app/inline.js +2 -2
  165. package/dist/mcp-app/inline.js.map +1 -1
  166. package/dist/react/index.d.ts +21 -0
  167. package/dist/react/index.d.ts.map +1 -1
  168. package/dist/react/index.js +29 -0
  169. package/dist/react/index.js.map +1 -1
  170. package/dist/styles/theme.d.ts +11 -8
  171. package/dist/styles/theme.d.ts.map +1 -1
  172. package/dist/styles/theme.js +8 -6
  173. package/dist/styles/theme.js.map +1 -1
  174. package/package.json +9 -4
@@ -9,10 +9,14 @@ export declare const CONSENT_CAPABILITIES_FEATURES: Readonly<{
9
9
  * details, an unverified agent is flagged, `approver` and `grantDetails`
10
10
  * draw their boxes, rows have no icon unless `show-icons`, and the `footer`
11
11
  * slot sits under the card beside the new `legal` slot.
12
+ * 5 adds the `connector-mark` slot, which takes the shield's place, and
13
+ * `hide-risk` and `hide-scopes`, which leave out the HIGHER RISK chips and
14
+ * the scope badges, and drops the host
15
+ * chip after a domain-bound agent's name.
12
16
  */
13
- version: 4;
17
+ version: 5;
14
18
  scopesOnly: true;
15
- slots: readonly ["identity", "details", "notice", "footer", "legal", "headline"];
19
+ slots: readonly ["identity", "details", "notice", "footer", "legal", "headline", "connector-mark"];
16
20
  /** A row's slot is this prefix and the capability's id. */
17
21
  capabilitySlotPrefix: "capability-";
18
22
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/constants/capabilities.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,eAAO,MAAM,6BAA6B;IACxC;;;;;;;;;OASG;;;;IAWH,2DAA2D;;EAE3D,CAAC"}
1
+ {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/constants/capabilities.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,eAAO,MAAM,6BAA6B;IACxC;;;;;;;;;;;;;OAaG;;;;IAYH,2DAA2D;;EAE3D,CAAC"}
@@ -9,8 +9,12 @@ export const CONSENT_CAPABILITIES_FEATURES = Object.freeze({
9
9
  * details, an unverified agent is flagged, `approver` and `grantDetails`
10
10
  * draw their boxes, rows have no icon unless `show-icons`, and the `footer`
11
11
  * slot sits under the card beside the new `legal` slot.
12
+ * 5 adds the `connector-mark` slot, which takes the shield's place, and
13
+ * `hide-risk` and `hide-scopes`, which leave out the HIGHER RISK chips and
14
+ * the scope badges, and drops the host
15
+ * chip after a domain-bound agent's name.
12
16
  */
13
- version: 4,
17
+ version: 5,
14
18
  scopesOnly: true,
15
19
  slots: Object.freeze([
16
20
  "identity",
@@ -19,6 +23,7 @@ export const CONSENT_CAPABILITIES_FEATURES = Object.freeze({
19
23
  "footer",
20
24
  "legal",
21
25
  "headline",
26
+ "connector-mark",
22
27
  ]),
23
28
  /** A row's slot is this prefix and the capability's id. */
24
29
  capabilitySlotPrefix: "capability-",
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/constants/capabilities.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC;IACzD;;;;;;;;;OASG;IACH,OAAO,EAAE,CAAC;IACV,UAAU,EAAE,IAAI;IAChB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;QACnB,UAAU;QACV,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,OAAO;QACP,UAAU;KACF,CAAC;IACX,2DAA2D;IAC3D,oBAAoB,EAAE,aAAa;CACpC,CAAC,CAAC"}
1
+ {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/constants/capabilities.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC;IACzD;;;;;;;;;;;;;OAaG;IACH,OAAO,EAAE,CAAC;IACV,UAAU,EAAE,IAAI;IAChB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;QACnB,UAAU;QACV,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,OAAO;QACP,UAAU;QACV,gBAAgB;KACR,CAAC;IACX,2DAA2D;IAC3D,oBAAoB,EAAE,aAAa;CACpC,CAAC,CAAC"}
@@ -39,7 +39,6 @@ export declare const CONSENT_COPY_TOKENS: {
39
39
  readonly identity: "Identity";
40
40
  readonly identifiedBy: "Identified by {Host}";
41
41
  /** Read before the host in the headline's chip. */
42
- readonly identifiedByPrefix: "identified by ";
43
42
  readonly identifiedExplanation: "Its details are published at {Host}, and it can only send you back to an address listed there.";
44
43
  readonly verified: "Verified";
45
44
  readonly verifiedExplanation: "Its Entity Card was checked and verified.";
@@ -76,18 +75,22 @@ export declare const CONSENT_COPY_TOKENS: {
76
75
  readonly madeBy: "Made by {Vendor}";
77
76
  /** `{Surface}` → surface label, e.g. "Mac". */
78
77
  readonly askingFrom: "Asking from your {Surface}";
79
- readonly metaSeparator: " · ";
78
+ readonly metaSeparator: ". ";
80
79
  /**
81
80
  * @deprecated The header no longer uses this: it can't leave out an
82
81
  * unknown vendor or surface. Use `madeBy`, `askingFrom` and
83
82
  * `metaSeparator`.
84
83
  */
85
- readonly metaTemplate: "Made by {Vendor} · Asking from your {Surface} · {Connected}";
84
+ readonly metaTemplate: "Made by {Vendor}. Asking from your {Surface}. {Connected}";
86
85
  readonly connectedJustNow: "Connected just now";
87
86
  /** `{Minutes}` → minutes since connection. */
88
87
  readonly connectedMinutesAgo: "Connected {Minutes} min ago";
89
88
  };
90
89
  readonly section: {
90
+ /** Above the rows; `{Agent}` → the agent's name. Drawn uppercase by CSS. */
91
+ readonly capabilitiesHeader: "What {Agent} can do for you";
92
+ /** Beside it, while the rows can be ticked. */
93
+ readonly tapToToggle: "Tap to toggle";
91
94
  /** Used in the dark gateway theme. */
92
95
  readonly permissionsRequested: "PERMISSIONS REQUESTED";
93
96
  };
@@ -134,8 +137,8 @@ export declare const CONSENT_COPY_TOKENS: {
134
137
  readonly grant: {
135
138
  /** The button that opens the terms. */
136
139
  readonly customize: "Customize";
137
- /** Between the parts of the closed summary: "8 hours · Every folder". */
138
- readonly summarySeparator: " · ";
140
+ /** Between the parts of the closed summary: "8 hours, Every folder". */
141
+ readonly summarySeparator: ", ";
139
142
  readonly durationLabel: "Valid for";
140
143
  readonly durationHint: "The grant ends on its own after this. The agent has to ask again.";
141
144
  readonly folderLabel: "Limit to a folder (optional)";
@@ -176,6 +179,7 @@ export declare const CONSENT_COPY_TOKENS: {
176
179
  readonly wallet: {
177
180
  /** The caption under the wallet check, one per status. */
178
181
  readonly check: {
182
+ readonly idle: "Waiting for you";
179
183
  readonly checking: "Checking wallet identity…";
180
184
  readonly syncing: "Syncing this device's wallet to your account…";
181
185
  readonly ready: "Wallet verified";
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/copy/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,mBAAmB;;QAE5B,oCAAoC;;QAEpC,iEAAiE;;;;QAIjE;;;;WAIG;;;;;QAKH,sCAAsC;;;IAGxC,mDAAmD;;QAEjD,qCAAqC;;;;;QAKrC,mDAAmD;;;;;;;;;IAWrD,0EAA0E;;;;;IAK1E,wCAAwC;;;;IAIxC,0EAA0E;;;;;;;;;;QAUxE;;;;;;WAMG;;QAEH,+CAA+C;;;QAG/C;;;;WAIG;;;QAGH,8CAA8C;;;;QAI9C,sCAAsC;;;;;;QAMtC,4CAA4C;;QAE5C,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;;QAUxE;;;;;;WAMG;;QAEH,+CAA+C;;;QAG/C;;;;WAIG;;;QAGH,8CAA8C;;;;QAI9C,4EAA4E;;QAE5E,+CAA+C;;QAE/C,sCAAsC;;;;;;QAMtC,4CAA4C;;QAE5C,uDAAuD;;QAEvD,yDAAyD;;;;QAIzD;;;WAGG;;QAGH,8CAA8C;;QAG9C,sEAAsE;;QAGtE;;;WAGG;;;;QAKH,2DAA2D;;QAE3D,0BAA0B;;QAE1B,6BAA6B;;QAE7B,4BAA4B;;;IAG9B;;;OAGG;;QAED,uCAAuC;;QAEvC,wEAAwE;;;;;;;QASxE,yCAAyC;;QAEzC,8CAA8C;;QAE9C,uEAAuE;;QAEvE,kDAAkD;;QAElD,2EAA2E;;;IAG7E,iEAAiE;;;;QAK/D,8BAA8B;;QAE9B,mEAAmE;;;;;;QAMnE,wEAAwE;;;IAG1E;;;;;OAKG;;QAED,0DAA0D;;;;;;;;;;YAUxD,kDAAkD;;;YAGlD,0EAA0E;;;;;;;;;;;YAiB1E,4EAA4E;;;;;;;;;;;;;;;;IAgBhF,uEAAuE;;;;;IAMvE;;;OAGG;;;;;;;;;;QAUD,6CAA6C;;;QAG7C,sEAAsE;;QAEtE,oCAAoC;;QAEpC,kCAAkC;;;IAGpC;;;OAGG;;;;;;;;;;;;;;;;;;;QAuBD,6EAA6E;;;;;;;;;;CAavE,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,OAAO,mBAAmB,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,GAClD,MAAM,CAKR"}
@@ -39,7 +39,6 @@ export const CONSENT_COPY_TOKENS = {
39
39
  identity: "Identity",
40
40
  identifiedBy: "Identified by {Host}",
41
41
  /** Read before the host in the headline's chip. */
42
- identifiedByPrefix: "identified by ",
43
42
  identifiedExplanation: "Its details are published at {Host}, and it can only send you back to an address listed there.",
44
43
  verified: "Verified",
45
44
  verifiedExplanation: "Its Entity Card was checked and verified.",
@@ -76,18 +75,22 @@ export const CONSENT_COPY_TOKENS = {
76
75
  madeBy: "Made by {Vendor}",
77
76
  /** `{Surface}` → surface label, e.g. "Mac". */
78
77
  askingFrom: "Asking from your {Surface}",
79
- metaSeparator: " · ",
78
+ metaSeparator: ". ",
80
79
  /**
81
80
  * @deprecated The header no longer uses this: it can't leave out an
82
81
  * unknown vendor or surface. Use `madeBy`, `askingFrom` and
83
82
  * `metaSeparator`.
84
83
  */
85
- metaTemplate: "Made by {Vendor} · Asking from your {Surface} · {Connected}",
84
+ metaTemplate: "Made by {Vendor}. Asking from your {Surface}. {Connected}",
86
85
  connectedJustNow: "Connected just now",
87
86
  /** `{Minutes}` → minutes since connection. */
88
87
  connectedMinutesAgo: "Connected {Minutes} min ago",
89
88
  },
90
89
  section: {
90
+ /** Above the rows; `{Agent}` → the agent's name. Drawn uppercase by CSS. */
91
+ capabilitiesHeader: "What {Agent} can do for you",
92
+ /** Beside it, while the rows can be ticked. */
93
+ tapToToggle: "Tap to toggle",
91
94
  /** Used in the dark gateway theme. */
92
95
  permissionsRequested: "PERMISSIONS REQUESTED",
93
96
  },
@@ -134,8 +137,8 @@ export const CONSENT_COPY_TOKENS = {
134
137
  grant: {
135
138
  /** The button that opens the terms. */
136
139
  customize: "Customize",
137
- /** Between the parts of the closed summary: "8 hours · Every folder". */
138
- summarySeparator: " · ",
140
+ /** Between the parts of the closed summary: "8 hours, Every folder". */
141
+ summarySeparator: ", ",
139
142
  durationLabel: "Valid for",
140
143
  durationHint: "The grant ends on its own after this. The agent has to ask again.",
141
144
  folderLabel: "Limit to a folder (optional)",
@@ -176,6 +179,7 @@ export const CONSENT_COPY_TOKENS = {
176
179
  wallet: {
177
180
  /** The caption under the wallet check, one per status. */
178
181
  check: {
182
+ idle: "Waiting for you",
179
183
  checking: "Checking wallet identity…",
180
184
  syncing: "Syncing this device's wallet to your account…",
181
185
  ready: "Wallet verified",
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../src/copy/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,OAAO,EAAE;QACP,oCAAoC;QACpC,iBAAiB,EAAE,oBAAoB;QACvC,iEAAiE;QACjE,YAAY,EAAE,iBAAiB;KAChC;IACD,QAAQ,EAAE;QACR;;;;WAIG;QACH,QAAQ,EAAE,6CAA6C;QACvD,gBAAgB,EAAE,iDAAiD;KACpE;IACD,OAAO,EAAE;QACP,sCAAsC;QACtC,QAAQ,EAAE,oDAAoD;KAC/D;IACD,mDAAmD;IACnD,YAAY,EAAE;QACZ,qCAAqC;QACrC,KAAK,EAAE,eAAe;QACtB,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE,UAAU;QACpB,YAAY,EAAE,sBAAsB;QACpC,mDAAmD;QACnD,kBAAkB,EAAE,gBAAgB;QACpC,qBAAqB,EACnB,gGAAgG;QAClG,QAAQ,EAAE,UAAU;QACpB,mBAAmB,EAAE,2CAA2C;QAChE,UAAU,EAAE,YAAY;QACxB,qBAAqB,EACnB,4DAA4D;QAC9D,OAAO,EAAE,UAAU;KACpB;IACD,0EAA0E;IAC1E,eAAe,EAAE;QACf,OAAO,EAAE,kBAAkB;QAC3B,MAAM,EAAE,gCAAgC;KACzC;IACD,wCAAwC;IACxC,QAAQ,EAAE;QACR,QAAQ,EAAE,cAAc;KACzB;IACD,0EAA0E;IAC1E,YAAY,EAAE;QACZ,OAAO,EAAE,oBAAoB;QAC7B,UAAU,EAAE,aAAa;QACzB,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,QAAQ;QAChB,YAAY,EAAE,eAAe;QAC7B,cAAc,EAAE,iBAAiB;KAClC;IACD,SAAS,EAAE;QACT;;;;;;WAMG;QACH,MAAM,EAAE,kBAAkB;QAC1B,+CAA+C;QAC/C,UAAU,EAA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QAC7E,MAAM,EAAE;YACN,WAAW,EACT,mFAAmF;YACrF,aAAa,EACX,iFAAiF;YACnF,aAAa,EACX,sEAAsE;YACxE,QAAQ,EAAE,sCAAsC;YAChD,OAAO,EAAE,iDAAiD;YAC1D,OAAO,EAAE,sCAAsC;SAChD;KACF;CACO,CAAC;AAIX;;;;GAIG;AACH,MAAM,UAAU,WAAW,CACzB,QAAgB,EAChB,MAAmD;IAEnD,OAAO,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,GAAW,EAAE,EAAE;QAC3D,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Consent flow copy
3
+ *
4
+ * Every word a consent flow says, as tokens. A token is a string, or one
5
+ * string per step (or variant) with a `default`. The flow's own copy, a
6
+ * first-time shopper's, and a project's overrides layer over these
7
+ * (`flowCopy`). Placeholders: {Agent}, {Merchant}, {Verb}, {Provider},
8
+ * {First}, {When}.
9
+ *
10
+ * Pure data and string helpers: no DOM, no validator.
11
+ *
12
+ * @module flow/copy
13
+ */
14
+ import type { FlowCopy } from "./model.js";
15
+ export declare const FLOW_COPY: FlowCopy;
16
+ /** The defaults with each layer of overrides over them, merged a level deep. */
17
+ export declare function flowCopy(...layers: (FlowCopy | undefined)[]): FlowCopy;
18
+ /** A token's words: the token itself, or its entry for `step`, or its `default`. */
19
+ export declare function token(copy: FlowCopy, key: string, step?: string): string;
20
+ /** A token in a group: `group(copy, "actions").approve`, as strings. */
21
+ export declare function group(copy: FlowCopy, key: string): Record<string, string>;
22
+ /** A template split into its words and its placeholders, for a renderer to fill. */
23
+ export declare function splitTemplate(template: string): {
24
+ text?: string;
25
+ name?: string;
26
+ }[];
27
+ /** A template with its placeholders filled, as plain text. */
28
+ export declare function fillTemplate(template: string, values: Record<string, string | undefined>): string;
29
+ /** "Dylan Hobbs" is DH, "Alice" is A; with no name, the identifier's first letter; else "?". */
30
+ export declare function initialsOf(name?: string, identifier?: string): string;
31
+ //# sourceMappingURL=copy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../src/flow/copy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,SAAS,EAAE,QAkFvB,CAAC;AAKF,gFAAgF;AAChF,wBAAgB,QAAQ,CAAC,GAAG,MAAM,EAAE,CAAC,QAAQ,GAAG,SAAS,CAAC,EAAE,GAAG,QAAQ,CAUtE;AAED,oFAAoF;AACpF,wBAAgB,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAMxE;AAED,wEAAwE;AACxE,wBAAgB,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQzE;AAED,oFAAoF;AACpF,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,GACf;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,CAKpC;AAED,8DAA8D;AAC9D,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACzC,MAAM,CAIR;AAED,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,IAAI,SAAK,EAAE,UAAU,SAAK,GAAG,MAAM,CAW7D"}
@@ -0,0 +1,137 @@
1
+ export const FLOW_COPY = {
2
+ eyebrow: {
3
+ default: "Permission request",
4
+ granted: "Permission granted",
5
+ denied: "Permission declined",
6
+ },
7
+ headline: {
8
+ "sign-in": "Sign in to let {Agent} {Verb} at {Merchant}.",
9
+ default: "{Agent} would like to {Verb} at {Merchant} on your behalf",
10
+ granted: "Access granted",
11
+ denied: "No access given",
12
+ error: "Something went wrong",
13
+ },
14
+ sub: {
15
+ granted: "{Agent} can now {Verb} at {Merchant} for you.",
16
+ denied: "{Agent} can't {Verb} for you. Nothing was approved.",
17
+ error: "Nothing was approved. Try again, or ask {Agent} to start over.",
18
+ },
19
+ signIn: {
20
+ continueAs: "Continue as {First}",
21
+ other: "Not you? Use another {Provider} account.",
22
+ finePrint: "{Provider} confirms you control this account. {Merchant} does not get your mail, contacts or files.",
23
+ },
24
+ approver: {
25
+ label: "You are authorizing",
26
+ labelGranted: "You authorized",
27
+ labelDenied: "You declined",
28
+ party: "To act for you",
29
+ partyGranted: "Can now act for you",
30
+ partyDenied: "Asked to act for you",
31
+ confirmed: "Confirmed with passkey",
32
+ signedInWith: "Signed in with {Provider}",
33
+ declined: "Declined",
34
+ unverified: "Unverified",
35
+ unverifiedInfo: "It registered itself, so the name it gives is not checked. Allow only if you asked it to.",
36
+ identifiedBy: "Identified by {Domain}",
37
+ },
38
+ capabilitiesHeader: "What {Agent} can do for you",
39
+ tapToToggle: "Tap to toggle",
40
+ seal: {
41
+ "sign-in": "Sign in to continue",
42
+ consent: "Waiting for your passkey",
43
+ passkey: "Confirming with your passkey",
44
+ cancelled: "Passkey not confirmed",
45
+ granted: "Signed with your passkey",
46
+ denied: "Nothing was signed",
47
+ expired: "Request expired",
48
+ error: "Something went wrong",
49
+ },
50
+ details: {
51
+ title: "Permission details",
52
+ connectsTo: "Connects to",
53
+ duration: "Duration",
54
+ budget: "Budget",
55
+ amountLimits: "Amount limits",
56
+ folders: "Folders",
57
+ alreadyGranted: "Already granted",
58
+ },
59
+ actions: {
60
+ approve: "Approve with passkey",
61
+ deny: "Deny",
62
+ confirming: "Confirming…",
63
+ },
64
+ status: "Waiting for your passkey…",
65
+ notice: "Passkey not confirmed. Nothing was approved.",
66
+ expired: "This request expired. Ask {Agent} to try again.",
67
+ receipt: { until: "Until {When}" },
68
+ goBack: "Go back to {Agent} and tell it to continue. Revoke anytime under Connected agents at {Merchant}.",
69
+ retry: "Try again",
70
+ announce: {
71
+ "sign-in": "Sign in to continue.",
72
+ consent: "Review what {Agent} is asking for.",
73
+ passkey: "Waiting for your passkey.",
74
+ granted: "Access granted.",
75
+ denied: "No access given.",
76
+ cancelled: "Passkey not confirmed. Nothing was approved.",
77
+ expired: "This request expired.",
78
+ error: "Something went wrong. Nothing was approved.",
79
+ },
80
+ };
81
+ const isGroup = (value) => !!value && typeof value === "object" && !Array.isArray(value);
82
+ /** The defaults with each layer of overrides over them, merged a level deep. */
83
+ export function flowCopy(...layers) {
84
+ const out = { ...FLOW_COPY };
85
+ for (const layer of layers) {
86
+ for (const [key, value] of Object.entries(layer ?? {})) {
87
+ const base = out[key];
88
+ out[key] =
89
+ isGroup(value) && isGroup(base) ? { ...base, ...value } : value;
90
+ }
91
+ }
92
+ return out;
93
+ }
94
+ /** A token's words: the token itself, or its entry for `step`, or its `default`. */
95
+ export function token(copy, key, step) {
96
+ const value = copy[key];
97
+ if (typeof value === "string")
98
+ return value;
99
+ if (!isGroup(value))
100
+ return "";
101
+ const entry = (step && value[step]) ?? value.default;
102
+ return typeof entry === "string" ? entry : "";
103
+ }
104
+ /** A token in a group: `group(copy, "actions").approve`, as strings. */
105
+ export function group(copy, key) {
106
+ const value = copy[key];
107
+ if (!isGroup(value))
108
+ return {};
109
+ return Object.fromEntries(Object.entries(value).filter((entry) => typeof entry[1] === "string"));
110
+ }
111
+ /** A template split into its words and its placeholders, for a renderer to fill. */
112
+ export function splitTemplate(template) {
113
+ return template
114
+ .split(/\{(\w+)\}/)
115
+ .map((part, i) => (i % 2 ? { name: part } : { text: part }))
116
+ .filter((part) => part.name || part.text);
117
+ }
118
+ /** A template with its placeholders filled, as plain text. */
119
+ export function fillTemplate(template, values) {
120
+ return splitTemplate(template)
121
+ .map((part) => (part.name ? (values[part.name] ?? "") : part.text))
122
+ .join("");
123
+ }
124
+ /** "Dylan Hobbs" is DH, "Alice" is A; with no name, the identifier's first letter; else "?". */
125
+ export function initialsOf(name = "", identifier = "") {
126
+ const first = (word) => Array.from(word.replace(/^[^\p{L}\p{N}]+/u, ""))[0] ?? "";
127
+ const words = name
128
+ .trim()
129
+ .split(/\s+/)
130
+ .filter((word) => /[\p{L}\p{N}]/u.test(word));
131
+ if (words.length >= 2)
132
+ return (first(words[0]) + first(words[words.length - 1])).toUpperCase();
133
+ if (words.length === 1)
134
+ return first(words[0]).toUpperCase();
135
+ return (first(identifier) || "?").toUpperCase();
136
+ }
137
+ //# sourceMappingURL=copy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy.js","sourceRoot":"","sources":["../../src/flow/copy.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,MAAM,SAAS,GAAa;IACjC,OAAO,EAAE;QACP,OAAO,EAAE,oBAAoB;QAC7B,OAAO,EAAE,oBAAoB;QAC7B,MAAM,EAAE,qBAAqB;KAC9B;IACD,QAAQ,EAAE;QACR,SAAS,EAAE,8CAA8C;QACzD,OAAO,EAAE,2DAA2D;QACpE,OAAO,EAAE,gBAAgB;QACzB,MAAM,EAAE,iBAAiB;QACzB,KAAK,EAAE,sBAAsB;KAC9B;IACD,GAAG,EAAE;QACH,OAAO,EAAE,+CAA+C;QACxD,MAAM,EAAE,qDAAqD;QAC7D,KAAK,EAAE,gEAAgE;KACxE;IACD,MAAM,EAAE;QACN,UAAU,EAAE,qBAAqB;QACjC,KAAK,EAAE,0CAA0C;QACjD,SAAS,EACP,qGAAqG;KACxG;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,qBAAqB;QAC5B,YAAY,EAAE,gBAAgB;QAC9B,WAAW,EAAE,cAAc;QAC3B,KAAK,EAAE,gBAAgB;QACvB,YAAY,EAAE,qBA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AAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC5D,MAAM,KAAK,GAAG,IAAI;SACf,IAAI,EAAE;SACN,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;QACnB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5E,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC9D,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;AAClD,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Consent flows
3
+ *
4
+ * A consent flow as data: the model (names, types, the schema version), the
5
+ * schema Checkpoint validates a saved flow with, the presets it offers as
6
+ * templates, and the default copy with its helpers. The browser bundle carries the model and the presets, not the
7
+ * schema.
8
+ *
9
+ * @module @kya-os/consent/flow
10
+ */
11
+ export * from "./model.js";
12
+ export * from "./presets.js";
13
+ export * from "./copy.js";
14
+ export * from "./schema.js";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/flow/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Consent flows
3
+ *
4
+ * A consent flow as data: the model (names, types, the schema version), the
5
+ * schema Checkpoint validates a saved flow with, the presets it offers as
6
+ * templates, and the default copy with its helpers. The browser bundle carries the model and the presets, not the
7
+ * schema.
8
+ *
9
+ * @module @kya-os/consent/flow
10
+ */
11
+ export * from "./model.js";
12
+ export * from "./presets.js";
13
+ export * from "./copy.js";
14
+ export * from "./schema.js";
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/flow/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,209 @@
1
+ /**
2
+ * Consent flow model
3
+ *
4
+ * A consent flow is data: which blocks each step draws, in order, the
5
+ * connector's state in that step, and where focus lands, plus copy overrides.
6
+ * It is plain JSON (no functions), so Checkpoint can store a project's flow in
7
+ * its consent config, validate it (`flowSchema`), diff it against a preset,
8
+ * and have every server render exactly what was saved.
9
+ *
10
+ * This file holds the names and types only. It imports nothing but the
11
+ * package's own types, so the presets and the browser bundle carry no
12
+ * validator.
13
+ *
14
+ * @module flow/model
15
+ */
16
+ /** The flow schema's version. A server declares which versions it renders. */
17
+ import type { AgentMetadata, ConsentScopeCapability } from "../types/capabilities.types.js";
18
+ import type { ConsentGrantDetails } from "../types/decision.types.js";
19
+ export declare const FLOW_SCHEMA_VERSION = 1;
20
+ /** The blocks a step can draw. A block name may carry a variant: "capability:locked". */
21
+ export declare const FLOW_BLOCKS: readonly ["eyebrow", "headline", "sub", "signIn", "finePrint", "approver", "capability", "details", "countdown", "actions", "status", "notice", "expiredNote", "receipt", "goBack", "retry"];
22
+ export type FlowBlock = (typeof FLOW_BLOCKS)[number];
23
+ /** The steps a flow can have. */
24
+ export declare const FLOW_STEPS: readonly ["sign-in", "consent", "passkey", "granted", "denied", "cancelled", "expired", "error"];
25
+ export type FlowStep = (typeof FLOW_STEPS)[number];
26
+ /**
27
+ * The connector's states; a step names the one it shows. With the wallet
28
+ * check in the connector: resting until the person acts (sign-in, consent),
29
+ * turning while the passkey is open, closed on its check once granted, open
30
+ * at the top when the passkey was dismissed (cancelled), and its error once
31
+ * nothing was granted (denied, expired, error).
32
+ */
33
+ export declare const FLOW_CONNECTOR_STATES: readonly ["sign-in", "consent", "passkey", "cancelled", "granted", "denied", "expired", "error"];
34
+ export type FlowConnectorState = (typeof FLOW_CONNECTOR_STATES)[number];
35
+ /**
36
+ * How the person approves: `consent` submits on Allow, with no passkey step;
37
+ * `passkey` confirms with a passkey (created first by a first-time shopper).
38
+ */
39
+ export declare const APPROVAL_METHODS: readonly ["consent", "passkey"];
40
+ export type ApprovalMethod = (typeof APPROVAL_METHODS)[number];
41
+ /**
42
+ * How much the flow moves between steps: `default`, `subtle` (shorter and
43
+ * smaller), or `none` (cross-fades only: the reduced-motion path).
44
+ */
45
+ export declare const MOTION_PRESETS: readonly ["default", "subtle", "none"];
46
+ export type MotionPreset = (typeof MOTION_PRESETS)[number];
47
+ /** What sits in the connector's middle: the wallet check, or nothing (its shield). */
48
+ export declare const CONNECTOR_MARKS: readonly ["wallet-check", "none"];
49
+ export type ConnectorMark = (typeof CONNECTOR_MARKS)[number];
50
+ /** The motion primitives a flow plays, as its `consent-flow-motion` events name them. */
51
+ export declare const MOTION_PRIMITIVES: readonly ["leave", "arrive", "move", "cross-fade", "resize"];
52
+ export type MotionPrimitive = (typeof MOTION_PRIMITIVES)[number];
53
+ /** A copy override: a token's words, or a group of them. */
54
+ export type FlowCopy = {
55
+ [token: string]: string | FlowCopy;
56
+ };
57
+ export interface FlowStepDefinition {
58
+ /** The connector's state in this step. */
59
+ connector: FlowConnectorState;
60
+ /** The blocks, in order: a block name, or "name:variant". */
61
+ blocks: string[];
62
+ /** The block that takes focus when the person's own action lands here. */
63
+ focus?: FlowBlock;
64
+ }
65
+ export interface ConsentFlowDefinition {
66
+ version: typeof FLOW_SCHEMA_VERSION;
67
+ name: string;
68
+ approvalMethod: ApprovalMethod;
69
+ initial: FlowStep;
70
+ motion: MotionPreset;
71
+ connectorMark: ConnectorMark;
72
+ steps: Partial<Record<FlowStep, FlowStepDefinition>>;
73
+ /** Copy overrides for every request. */
74
+ copy: FlowCopy;
75
+ /** Copy overrides for a first-time shopper, who creates a passkey first. */
76
+ copyWhenCreatingPasskey: FlowCopy;
77
+ }
78
+ /** The events a flow sends, each as `consent-flow-<name>`, bubbling and composed. */
79
+ export declare const FLOW_EVENTS: readonly ["sign-in", "approve", "deny", "retry", "expire", "motion", "step"];
80
+ export type FlowEvent = (typeof FLOW_EVENTS)[number];
81
+ /** The agent: the package's agent metadata, with the DID optional (a flow never shows it). */
82
+ export type FlowAgent = Omit<AgentMetadata, "did"> & {
83
+ did?: string;
84
+ };
85
+ /** The merchant (the org the agent acts at): its name and, for "Connects to" and its tile, domain and logo. */
86
+ export interface FlowMerchant {
87
+ name: string;
88
+ domain?: string;
89
+ logoUrl?: string;
90
+ }
91
+ /** The person who approves, as their sign-in provider knows them. */
92
+ export interface FlowApprover {
93
+ /** Their name; initials stand in for a picture. */
94
+ name: string;
95
+ /** Their account, as the provider names it: an email or a handle. */
96
+ identifier?: string;
97
+ /** The provider's picture. Initials when absent or when it fails to load. */
98
+ avatarUrl?: string;
99
+ /** The sign-in provider: a built-in one (google, microsoft, apple, github, twitter, facebook) or `custom`. */
100
+ provider?: string;
101
+ /** The provider's name in the copy; a built-in provider's own name when left out. */
102
+ providerName?: string;
103
+ }
104
+ /**
105
+ * One thing the agent asks to do: the screen's capability, so one list feeds
106
+ * both. `defaultOn` decides the starting ticks; `receipt` is its line once
107
+ * granted ("Margherita, 2 a week").
108
+ */
109
+ export type FlowCapability = ConsentScopeCapability & {
110
+ receipt?: string;
111
+ };
112
+ /**
113
+ * The request a flow draws: who asks, for whom, at which merchant, for what.
114
+ * Host data, per request. The flow itself (steps, copy, motion) is the
115
+ * project's, saved in Checkpoint.
116
+ *
117
+ * Required in every step: `agent.name`, `merchant.name`, `verb`,
118
+ * `approver.name`, `capabilities`. The rest fills what a step draws when
119
+ * given and is left out when not: `approver.provider` (sign-in), the grant
120
+ * details (consent, passkey, cancelled), `requestExpiresAt` (the countdown),
121
+ * `grant` (granted).
122
+ */
123
+ export interface ConsentFlowData {
124
+ agent: FlowAgent;
125
+ merchant: FlowMerchant;
126
+ /** What the agent wants to do there, as "{Agent} would like to {Verb} at {Merchant}": "order". */
127
+ verb: string;
128
+ approver: FlowApprover;
129
+ /** `create` for a first-time shopper, who makes a passkey (the flow's `copyWhenCreatingPasskey`). */
130
+ passkey?: "use" | "create";
131
+ capabilities: FlowCapability[];
132
+ /** The screen's "Permission details" rows. "Connects to" shows `merchant.name` over `resource`. */
133
+ grantDetails?: ConsentGrantDetails;
134
+ /** When the request lapses: epoch ms or ISO. Drives the countdown and the `expire` event. */
135
+ requestExpiresAt?: number | string;
136
+ /** What the server granted, for the granted step's receipt. */
137
+ grant?: {
138
+ /** The capability ids granted; the ones ticked at approve when left out. */
139
+ capabilities?: string[];
140
+ /** When it ends: epoch ms or ISO. Each receipt line reads "Until …" in the viewer's own time. */
141
+ endsAt?: number | string;
142
+ };
143
+ /** The editor's switches, as on the screen. */
144
+ hideRisk?: boolean;
145
+ hideScopes?: boolean;
146
+ }
147
+ /** What every flow event carries. */
148
+ export interface FlowEventDetail {
149
+ /** The step the flow was on. */
150
+ step: FlowStep;
151
+ /** True from a `preview` flow, which an editor draws: nothing real happens. */
152
+ preview: boolean;
153
+ }
154
+ export interface FlowSignInDetail extends FlowEventDetail {
155
+ provider: string;
156
+ /** `remembered`: "Continue as …"; `other`: "Use another account". */
157
+ account: "remembered" | "other";
158
+ }
159
+ export interface FlowApproveDetail extends FlowEventDetail {
160
+ /** The ids of the capabilities ticked. */
161
+ capabilities: string[];
162
+ /** Their scopes, flattened and deduplicated. */
163
+ scopes: string[];
164
+ approvalMethod: ApprovalMethod;
165
+ }
166
+ export interface FlowExpireDetail extends FlowEventDetail {
167
+ /** When the request lapsed, epoch ms. */
168
+ expiresAt: number;
169
+ }
170
+ export interface FlowMotionDetail extends FlowEventDetail {
171
+ primitive: MotionPrimitive;
172
+ /** The block that moved, or `card` for its resize. */
173
+ block: FlowBlock | "card";
174
+ }
175
+ export interface FlowStepDetail extends FlowEventDetail {
176
+ /** The step before; null on the first draw. */
177
+ from: FlowStep | null;
178
+ }
179
+ /** Each flow event's detail, by event name. */
180
+ export interface ConsentFlowEventMap {
181
+ "consent-flow-sign-in": CustomEvent<FlowSignInDetail>;
182
+ "consent-flow-approve": CustomEvent<FlowApproveDetail>;
183
+ "consent-flow-deny": CustomEvent<FlowEventDetail>;
184
+ "consent-flow-retry": CustomEvent<FlowEventDetail>;
185
+ "consent-flow-expire": CustomEvent<FlowExpireDetail>;
186
+ "consent-flow-motion": CustomEvent<FlowMotionDetail>;
187
+ "consent-flow-step": CustomEvent<FlowStepDetail>;
188
+ }
189
+ /** The attributes `<consent-flow>` stamps on itself, for a host or preview to read. */
190
+ export declare const FLOW_HOST_ATTRIBUTES: {
191
+ readonly version: "data-consent-version";
192
+ readonly approvalMethod: "data-approval-method";
193
+ };
194
+ /**
195
+ * The fields a page that renders these flows adds to the `renders` object of
196
+ * its /.well-known/kya-consent-page declaration. The declaration itself (its
197
+ * consentUrl, signIn, approve, element and the rest) is Checkpoint's schema;
198
+ * this package only says what it renders, so a server declares the version it
199
+ * actually ships rather than a hard-coded one.
200
+ */
201
+ export interface ConsentFlowRenders {
202
+ /** The flow schema version the page renders. */
203
+ flow: number;
204
+ /** Whether the page honors the saved flow's approval method. */
205
+ approvalMethod: boolean;
206
+ }
207
+ /** `{ flow, approvalMethod }`, to spread into a declaration's `renders`. */
208
+ export declare function consentFlowRenders(): ConsentFlowRenders;
209
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot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