@kya-os/consent 0.5.2 → 0.5.4
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.
- package/README.md +25 -8
- package/dist/bundle/inline.d.ts.map +1 -1
- package/dist/bundle/inline.js +4 -4
- package/dist/bundle/inline.js.map +1 -1
- package/dist/cjs/bundle/inline.js +4 -4
- package/dist/cjs/bundle/inline.js.map +1 -1
- package/dist/cjs/components/approver-lockup.js +372 -0
- package/dist/cjs/components/approver-lockup.js.map +1 -0
- package/dist/cjs/components/consent-capabilities-screen.js +357 -97
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
- package/dist/cjs/components/consent-headline.js +35 -7
- package/dist/cjs/components/consent-headline.js.map +1 -1
- package/dist/cjs/components/decision-icons.js +2 -0
- package/dist/cjs/components/decision-icons.js.map +1 -1
- package/dist/cjs/components/flow-blocks.js +26 -312
- package/dist/cjs/components/flow-blocks.js.map +1 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/copy/tokens.js +14 -1
- package/dist/cjs/copy/tokens.js.map +1 -1
- package/dist/cjs/mcp-app/inline.js +2 -2
- package/dist/cjs/mcp-app/inline.js.map +1 -1
- package/dist/cjs/react/index.js +1 -0
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/cjs/schemas/capabilities.schemas.js +1 -0
- package/dist/cjs/schemas/capabilities.schemas.js.map +1 -1
- package/dist/cjs/styles/theme.js +3 -0
- package/dist/cjs/styles/theme.js.map +1 -1
- package/dist/components/approver-lockup.d.ts +73 -0
- package/dist/components/approver-lockup.d.ts.map +1 -0
- package/dist/components/approver-lockup.js +365 -0
- package/dist/components/approver-lockup.js.map +1 -0
- package/dist/components/consent-capabilities-screen.d.ts +88 -8
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
- package/dist/components/consent-capabilities-screen.js +357 -97
- package/dist/components/consent-capabilities-screen.js.map +1 -1
- package/dist/components/consent-headline.d.ts +15 -3
- package/dist/components/consent-headline.d.ts.map +1 -1
- package/dist/components/consent-headline.js +35 -7
- package/dist/components/consent-headline.js.map +1 -1
- package/dist/components/decision-icons.d.ts +2 -0
- package/dist/components/decision-icons.d.ts.map +1 -1
- package/dist/components/decision-icons.js +2 -0
- package/dist/components/decision-icons.js.map +1 -1
- package/dist/components/flow-blocks.d.ts +0 -9
- package/dist/components/flow-blocks.d.ts.map +1 -1
- package/dist/components/flow-blocks.js +26 -309
- package/dist/components/flow-blocks.js.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/consent.js +907 -606
- package/dist/consent.min.js +629 -509
- package/dist/copy/tokens.d.ts +14 -1
- package/dist/copy/tokens.d.ts.map +1 -1
- package/dist/copy/tokens.js +14 -1
- package/dist/copy/tokens.js.map +1 -1
- package/dist/flow/model.d.ts +1 -1
- package/dist/flow/schema.d.ts +12 -12
- package/dist/mcp-app/inline.d.ts.map +1 -1
- package/dist/mcp-app/inline.js +2 -2
- package/dist/mcp-app/inline.js.map +1 -1
- package/dist/react/index.d.ts +3 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -0
- package/dist/react/index.js.map +1 -1
- package/dist/schemas/api.schemas.d.ts +9 -0
- package/dist/schemas/api.schemas.d.ts.map +1 -1
- package/dist/schemas/capabilities.schemas.d.ts +5 -0
- package/dist/schemas/capabilities.schemas.d.ts.map +1 -1
- package/dist/schemas/capabilities.schemas.js +1 -0
- package/dist/schemas/capabilities.schemas.js.map +1 -1
- package/dist/schemas/config.schemas.d.ts +14 -0
- package/dist/schemas/config.schemas.d.ts.map +1 -1
- package/dist/styles/theme.d.ts +5 -0
- package/dist/styles/theme.d.ts.map +1 -1
- package/dist/styles/theme.js +3 -0
- package/dist/styles/theme.js.map +1 -1
- package/dist/types/capabilities.types.d.ts +20 -0
- package/dist/types/capabilities.types.d.ts.map +1 -1
- package/dist/types/decision.types.d.ts +10 -2
- package/dist/types/decision.types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The consent decision page, as Checkpoint draws it: the connector above a
|
|
5
5
|
* card holding the eyebrow, the serif headline that names the agent (its name
|
|
6
|
-
* opens what is known about it),
|
|
7
|
-
*
|
|
6
|
+
* opens what is known about it), who is authorizing which agent
|
|
7
|
+
* (`approver`, else a warning when the agent registered itself), the
|
|
8
|
+
* permission rows, the "Permission
|
|
8
9
|
* details" box (`grantDetails`, else the revocation notice) and Allow and
|
|
9
10
|
* Deny; under the card, "Secured by" and the Vouched lockup, and the host's
|
|
10
11
|
* legal links. Used when the resolved consent config includes `capabilities`.
|
|
@@ -18,11 +19,16 @@
|
|
|
18
19
|
* Each row's parts are forwarded with a `capability-` prefix
|
|
19
20
|
* (`capability-row`, `capability-label` and so on, see
|
|
20
21
|
* CAPABILITY_ROW_EXPORT_PARTS). The other parts are `connector`, `card`,
|
|
21
|
-
* `eyebrow`, `headline`, `agent-name`, `
|
|
22
|
-
* `
|
|
22
|
+
* `eyebrow`, `headline`, `agent-name`, `merchant-name` (with `headline`),
|
|
23
|
+
* `subhead`, `agent-details`, `info-note`,
|
|
24
|
+
* `unverified`, `approver` (with `approver-check`, `approver-agent` and
|
|
25
|
+
* `agent-status` inside), `permissions`, `section-header` (the eyebrow over
|
|
23
26
|
* the rows, "What {Agent} can do for you"), `section-hint` ("Tap to toggle"),
|
|
24
27
|
* `grant-details`, `actions`,
|
|
25
|
-
* `submit`, `cancel` and `below
|
|
28
|
+
* `submit`, `cancel` and `below`, and, when drawn, `error`, a row's
|
|
29
|
+
* verification (`capability-verify`, `capability-verify-label` and
|
|
30
|
+
* `capability-verify-action`) and its held-scope notice (`capability-held`).
|
|
31
|
+
* A host puts content in a row by giving it
|
|
26
32
|
* `slot="capability-<capability id>"`, words the headline itself through the
|
|
27
33
|
* `headline` slot, replaces the lockup through `footer`, adds its legal
|
|
28
34
|
* links through `legal`, and puts a `consent-wallet-check`
|
|
@@ -31,6 +37,14 @@
|
|
|
31
37
|
* Text wraps with `text-wrap: pretty`, inherited by every part, so no line
|
|
32
38
|
* ends on one word where the browser supports it.
|
|
33
39
|
*
|
|
40
|
+
* A row whose capability has a `check` (an identity check it needs first)
|
|
41
|
+
* shows "Requires verification" and a button with the check's words. The
|
|
42
|
+
* button never ticks the row: it sends `capability-check`, with the rows
|
|
43
|
+
* ticked now plus that one and any grant terms, for the host to run the
|
|
44
|
+
* check. `error` draws a notice at the top of the card that an action
|
|
45
|
+
* failed, and scrolls it into view each time it is set; clear it when the
|
|
46
|
+
* next action starts.
|
|
47
|
+
*
|
|
34
48
|
* With `preview` the screen draws as it would live and acts on nothing: it
|
|
35
49
|
* sends no `capabilities-allow` or `capabilities-deny`, and no link inside it
|
|
36
50
|
* goes anywhere; rows still tick. With `editable` as well, the subhead, the
|
|
@@ -46,6 +60,7 @@ import type { ConsentApprover, ConsentGrantDetails } from "../types/decision.typ
|
|
|
46
60
|
import { type AgentIdentity } from "../identity/agent-identity.js";
|
|
47
61
|
import { type ConsentEditSource } from "../types/edit.types.js";
|
|
48
62
|
import "./consent-action-bar.js";
|
|
63
|
+
import "./consent-headline.js";
|
|
49
64
|
import "./consent-secured-by.js";
|
|
50
65
|
import "./consent-revocation-notice.js";
|
|
51
66
|
import "./consent-connector-header.js";
|
|
@@ -69,6 +84,13 @@ export interface CapabilitiesApproveDetail {
|
|
|
69
84
|
*/
|
|
70
85
|
grantTerms?: GrantTerms;
|
|
71
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Detail emitted on `capability-check`: the row whose check was started, and
|
|
89
|
+
* what Allow would send had the person ticked that row too.
|
|
90
|
+
*/
|
|
91
|
+
export interface CapabilityCheckDetail extends CapabilitiesApproveDetail {
|
|
92
|
+
capabilityId: string;
|
|
93
|
+
}
|
|
72
94
|
export declare class ConsentCapabilitiesScreen extends LitElement {
|
|
73
95
|
static readonly features: Readonly<{
|
|
74
96
|
version: 5;
|
|
@@ -94,17 +116,45 @@ export declare class ConsentCapabilitiesScreen extends LitElement {
|
|
|
94
116
|
fixedExpiryDays: number | undefined;
|
|
95
117
|
theme: ConsentTheme;
|
|
96
118
|
howItWorksUrl: string;
|
|
119
|
+
/**
|
|
120
|
+
* That the last action failed, in words for the person, such as the
|
|
121
|
+
* server's refusal. Drawn at the top of the card as an alert. Empty: none.
|
|
122
|
+
*/
|
|
123
|
+
error: string;
|
|
97
124
|
loading: boolean;
|
|
98
125
|
/** Blocks approval while allowing the human to decline. */
|
|
99
126
|
disabled: boolean;
|
|
127
|
+
/** The line over the headline. Empty gives "PERMISSION REQUEST". */
|
|
128
|
+
eyebrow: string;
|
|
129
|
+
/**
|
|
130
|
+
* The headline, with `{Agent}`, `{Verb}` (`headlineVerb`) and `{Merchant}`
|
|
131
|
+
* (`orgName`) in it. The agent's name stays the button that opens its
|
|
132
|
+
* details, and the merchant's is in italics. Empty, or naming a verb or
|
|
133
|
+
* merchant that isn't given, gives the standard line. The `headline` slot
|
|
134
|
+
* wins over it.
|
|
135
|
+
*/
|
|
136
|
+
headline: string;
|
|
137
|
+
/**
|
|
138
|
+
* A note under "Permission details", such as how long access lasts, with
|
|
139
|
+
* `{Agent}`, `{Verb}` and `{Merchant}` filled in as plain text. Empty draws
|
|
140
|
+
* none.
|
|
141
|
+
*/
|
|
142
|
+
infoNote: string;
|
|
100
143
|
/** The subhead. Empty draws none. */
|
|
101
144
|
description: string;
|
|
102
145
|
submitLabel: string;
|
|
103
146
|
/**
|
|
104
|
-
* Who is signing in, and the checks they passed.
|
|
105
|
-
*
|
|
147
|
+
* Who is signing in, and the checks they passed. The box shows them over the
|
|
148
|
+
* agent they authorize. With no identifier, name or check, as for a
|
|
149
|
+
* confirmation without sign-in, no box is drawn.
|
|
106
150
|
*/
|
|
107
151
|
approver: ConsentApprover | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* Scopes an earlier approval already holds. A row that grants one says, once
|
|
154
|
+
* unticked, that the scope stays granted, since unticking it here doesn't
|
|
155
|
+
* withdraw the earlier grant.
|
|
156
|
+
*/
|
|
157
|
+
heldScopes: string[];
|
|
108
158
|
/**
|
|
109
159
|
* The "Permission details" box: what the grant connects to, how long it
|
|
110
160
|
* lasts and its limits, each worded by the host. Without it the screen
|
|
@@ -185,6 +235,7 @@ export declare class ConsentCapabilitiesScreen extends LitElement {
|
|
|
185
235
|
private seedKey;
|
|
186
236
|
constructor();
|
|
187
237
|
connectedCallback(): void;
|
|
238
|
+
updated(changed: Map<string, unknown>): void;
|
|
188
239
|
willUpdate(changed: Map<string, unknown>): void;
|
|
189
240
|
/**
|
|
190
241
|
* Seed `selected` from the capability defaults, but only when the
|
|
@@ -205,6 +256,11 @@ export declare class ConsentCapabilitiesScreen extends LitElement {
|
|
|
205
256
|
/** Grant terms in the `details` slot. None when rendered without a DOM. */
|
|
206
257
|
private get slottedTerms();
|
|
207
258
|
private get approvalDisabled();
|
|
259
|
+
/** What approving `selected` sends: its rows, their scopes and any grant terms. */
|
|
260
|
+
private approvalDetail;
|
|
261
|
+
/** A row's check can't start while the screen is busy or its terms can't be used. */
|
|
262
|
+
private get checkDisabled();
|
|
263
|
+
private onCheck;
|
|
208
264
|
private onAllow;
|
|
209
265
|
private onDeny;
|
|
210
266
|
private compileCapabilityCedar;
|
|
@@ -217,12 +273,36 @@ export declare class ConsentCapabilitiesScreen extends LitElement {
|
|
|
217
273
|
* rows, nothing.
|
|
218
274
|
*/
|
|
219
275
|
private renderSectionHeader;
|
|
276
|
+
/**
|
|
277
|
+
* "Requires verification" and the button that starts a row's check. It is
|
|
278
|
+
* in the row's `extra` slot, whose clicks the row leaves alone.
|
|
279
|
+
*/
|
|
280
|
+
private renderCheck;
|
|
281
|
+
/**
|
|
282
|
+
* "<scope> stays granted because of your earlier approval." under an
|
|
283
|
+
* unticked row, for each scope of it that an earlier approval holds. The
|
|
284
|
+
* live region stays while the row is ticked, so the words are announced as
|
|
285
|
+
* they appear.
|
|
286
|
+
*/
|
|
287
|
+
private renderHeld;
|
|
220
288
|
/** The warning for an agent that registered itself: its name is not checked. */
|
|
221
289
|
private renderUnverified;
|
|
222
|
-
/**
|
|
290
|
+
/**
|
|
291
|
+
* Who is signing in and the checks they passed, over the agent they
|
|
292
|
+
* authorize; nothing when there is no identifier, name or check.
|
|
293
|
+
*/
|
|
223
294
|
private renderApprover;
|
|
295
|
+
/**
|
|
296
|
+
* The agent's row: its name and tile, with "Unverified" or the domain it is
|
|
297
|
+
* identified by. Each status has an info button: the unverified one says
|
|
298
|
+
* what that means, and the domain one carries the host's `identityNote`
|
|
299
|
+
* when it gives one.
|
|
300
|
+
*/
|
|
301
|
+
private lockupAgent;
|
|
224
302
|
/** The "Permission details" box, when the host gives `grantDetails`. */
|
|
225
303
|
private renderGrantDetails;
|
|
304
|
+
/** The host's note under "Permission details"; nothing without one. */
|
|
305
|
+
private renderInfoNote;
|
|
226
306
|
/**
|
|
227
307
|
* The host's legal links, or a "How does this work?" link when the host
|
|
228
308
|
* gives its address; nothing when there is neither.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-capabilities-screen.d.ts","sourceRoot":"","sources":["../../src/components/consent-capabilities-screen.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"consent-capabilities-screen.d.ts","sourceRoot":"","sources":["../../src/components/consent-capabilities-screen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAEH,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAKrD,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EAC1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,+BAA+B,CAAC;AAOvC,OAAO,EA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