@kya-os/consent 0.2.2 → 0.3.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.
- package/README.md +344 -2
- package/dist/bundle/index.d.ts +48 -36
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +45 -33
- package/dist/bundle/index.js.map +1 -1
- 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/bundle/shell.d.ts +7 -0
- package/dist/bundle/shell.d.ts.map +1 -1
- package/dist/bundle/shell.js +5 -0
- package/dist/bundle/shell.js.map +1 -1
- package/dist/cjs/bundle/index.js +14 -1
- package/dist/cjs/bundle/index.js.map +1 -1
- package/dist/cjs/bundle/inline.js +4 -4
- package/dist/cjs/bundle/inline.js.map +1 -1
- package/dist/cjs/bundle/shell.js +5 -0
- package/dist/cjs/bundle/shell.js.map +1 -1
- package/dist/cjs/components/consent-action-bar.js +66 -15
- package/dist/cjs/components/consent-action-bar.js.map +1 -1
- package/dist/cjs/components/consent-agent-header.js +20 -10
- package/dist/cjs/components/consent-agent-header.js.map +1 -1
- package/dist/cjs/components/consent-capabilities-screen.js +57 -79
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
- package/dist/cjs/components/consent-checkbox.js +2 -2
- package/dist/cjs/components/consent-checkbox.js.map +1 -1
- package/dist/cjs/components/consent-duration.js +187 -0
- package/dist/cjs/components/consent-duration.js.map +1 -0
- package/dist/cjs/components/consent-folder-scope.js +169 -0
- package/dist/cjs/components/consent-folder-scope.js.map +1 -0
- package/dist/cjs/components/consent-footer.js +13 -2
- package/dist/cjs/components/consent-footer.js.map +1 -1
- package/dist/cjs/components/consent-grant-terms.js +321 -0
- package/dist/cjs/components/consent-grant-terms.js.map +1 -0
- package/dist/cjs/components/consent-headline.js +138 -0
- package/dist/cjs/components/consent-headline.js.map +1 -0
- package/dist/cjs/components/consent-input.js +47 -27
- package/dist/cjs/components/consent-input.js.map +1 -1
- package/dist/cjs/components/consent-otp-input.js +79 -55
- package/dist/cjs/components/consent-otp-input.js.map +1 -1
- package/dist/cjs/components/consent-phone-handoff.js +219 -0
- package/dist/cjs/components/consent-phone-handoff.js.map +1 -0
- package/dist/cjs/components/consent-request-expiry.js +159 -0
- package/dist/cjs/components/consent-request-expiry.js.map +1 -0
- package/dist/cjs/components/consent-revoke.js +308 -0
- package/dist/cjs/components/consent-revoke.js.map +1 -0
- package/dist/cjs/components/consent-shell.js +3 -0
- package/dist/cjs/components/consent-shell.js.map +1 -1
- package/dist/cjs/components/consent-terms.js +2 -2
- package/dist/cjs/components/consent-terms.js.map +1 -1
- package/dist/cjs/components/consent-wallet-check.js +107 -0
- package/dist/cjs/components/consent-wallet-check.js.map +1 -0
- package/dist/cjs/components/consent-wallet-notice.js +189 -0
- package/dist/cjs/components/consent-wallet-notice.js.map +1 -0
- package/dist/cjs/components/consent-wallet-orb.js +273 -0
- package/dist/cjs/components/consent-wallet-orb.js.map +1 -0
- package/dist/cjs/components/consent-wallet-signature.js +104 -0
- package/dist/cjs/components/consent-wallet-signature.js.map +1 -0
- package/dist/cjs/components/grant-field-styles.js +85 -0
- package/dist/cjs/components/grant-field-styles.js.map +1 -0
- package/dist/cjs/components/index.js +34 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/mcp-consent.js +60 -2
- package/dist/cjs/components/mcp-consent.js.map +1 -1
- package/dist/cjs/components/template-link.js +32 -0
- package/dist/cjs/components/template-link.js.map +1 -0
- package/dist/cjs/components/wallet-globe.js +184 -0
- package/dist/cjs/components/wallet-globe.js.map +1 -0
- package/dist/cjs/components/wallet-icons.js +19 -0
- package/dist/cjs/components/wallet-icons.js.map +1 -0
- package/dist/cjs/components/wallet-status.js +34 -0
- package/dist/cjs/components/wallet-status.js.map +1 -0
- package/dist/cjs/copy/tokens.js +107 -1
- package/dist/cjs/copy/tokens.js.map +1 -1
- package/dist/cjs/grant/index.js +24 -0
- package/dist/cjs/grant/index.js.map +1 -0
- package/dist/cjs/grant/terms.js +148 -0
- package/dist/cjs/grant/terms.js.map +1 -0
- package/dist/cjs/identity/agent-identity.js +314 -0
- package/dist/cjs/identity/agent-identity.js.map +1 -0
- package/dist/cjs/identity/documents.js +212 -0
- package/dist/cjs/identity/documents.js.map +1 -0
- package/dist/cjs/identity/entity-card.js +128 -0
- package/dist/cjs/identity/entity-card.js.map +1 -0
- package/dist/cjs/identity/index.js +31 -0
- package/dist/cjs/identity/index.js.map +1 -0
- package/dist/cjs/identity/resolve.js +122 -0
- package/dist/cjs/identity/resolve.js.map +1 -0
- package/dist/cjs/identity/schemas.js +88 -0
- package/dist/cjs/identity/schemas.js.map +1 -0
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/index.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/mcp-app/types.js +1 -1
- package/dist/cjs/popup/launcher.js +3 -3
- package/dist/cjs/react/index.js +260 -25
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/cjs/templates/index.js +1 -1
- package/dist/cjs/types/index.js +1 -1
- package/dist/components/consent-action-bar.d.ts +17 -0
- package/dist/components/consent-action-bar.d.ts.map +1 -1
- package/dist/components/consent-action-bar.js +67 -16
- package/dist/components/consent-action-bar.js.map +1 -1
- package/dist/components/consent-agent-header.d.ts +3 -1
- package/dist/components/consent-agent-header.d.ts.map +1 -1
- package/dist/components/consent-agent-header.js +20 -10
- package/dist/components/consent-agent-header.js.map +1 -1
- package/dist/components/consent-capabilities-screen.d.ts +23 -3
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
- package/dist/components/consent-capabilities-screen.js +57 -79
- package/dist/components/consent-capabilities-screen.js.map +1 -1
- package/dist/components/consent-checkbox.d.ts +1 -1
- package/dist/components/consent-checkbox.js +2 -2
- package/dist/components/consent-checkbox.js.map +1 -1
- package/dist/components/consent-duration.d.ts +64 -0
- package/dist/components/consent-duration.d.ts.map +1 -0
- package/dist/components/consent-duration.js +184 -0
- package/dist/components/consent-duration.js.map +1 -0
- package/dist/components/consent-folder-scope.d.ts +70 -0
- package/dist/components/consent-folder-scope.d.ts.map +1 -0
- package/dist/components/consent-folder-scope.js +166 -0
- package/dist/components/consent-folder-scope.js.map +1 -0
- package/dist/components/consent-footer.d.ts.map +1 -1
- package/dist/components/consent-footer.js +13 -2
- package/dist/components/consent-footer.js.map +1 -1
- package/dist/components/consent-grant-terms.d.ts +88 -0
- package/dist/components/consent-grant-terms.d.ts.map +1 -0
- package/dist/components/consent-grant-terms.js +318 -0
- package/dist/components/consent-grant-terms.js.map +1 -0
- package/dist/components/consent-headline.d.ts +42 -0
- package/dist/components/consent-headline.d.ts.map +1 -0
- package/dist/components/consent-headline.js +135 -0
- package/dist/components/consent-headline.js.map +1 -0
- package/dist/components/consent-input.d.ts +4 -4
- package/dist/components/consent-input.d.ts.map +1 -1
- package/dist/components/consent-input.js +49 -29
- package/dist/components/consent-input.js.map +1 -1
- package/dist/components/consent-otp-input.d.ts +11 -6
- package/dist/components/consent-otp-input.d.ts.map +1 -1
- package/dist/components/consent-otp-input.js +81 -57
- package/dist/components/consent-otp-input.js.map +1 -1
- package/dist/components/consent-phone-handoff.d.ts +50 -0
- package/dist/components/consent-phone-handoff.d.ts.map +1 -0
- package/dist/components/consent-phone-handoff.js +215 -0
- package/dist/components/consent-phone-handoff.js.map +1 -0
- package/dist/components/consent-request-expiry.d.ts +52 -0
- package/dist/components/consent-request-expiry.d.ts.map +1 -0
- package/dist/components/consent-request-expiry.js +154 -0
- package/dist/components/consent-request-expiry.js.map +1 -0
- package/dist/components/consent-revoke.d.ts +53 -0
- package/dist/components/consent-revoke.d.ts.map +1 -0
- package/dist/components/consent-revoke.js +305 -0
- package/dist/components/consent-revoke.js.map +1 -0
- package/dist/components/consent-shell.d.ts.map +1 -1
- package/dist/components/consent-shell.js +3 -0
- package/dist/components/consent-shell.js.map +1 -1
- package/dist/components/consent-terms.d.ts +1 -1
- package/dist/components/consent-terms.js +2 -2
- package/dist/components/consent-terms.js.map +1 -1
- package/dist/components/consent-wallet-check.d.ts +45 -0
- package/dist/components/consent-wallet-check.d.ts.map +1 -0
- package/dist/components/consent-wallet-check.js +102 -0
- package/dist/components/consent-wallet-check.js.map +1 -0
- package/dist/components/consent-wallet-notice.d.ts +54 -0
- package/dist/components/consent-wallet-notice.d.ts.map +1 -0
- package/dist/components/consent-wallet-notice.js +186 -0
- package/dist/components/consent-wallet-notice.js.map +1 -0
- package/dist/components/consent-wallet-orb.d.ts +48 -0
- package/dist/components/consent-wallet-orb.d.ts.map +1 -0
- package/dist/components/consent-wallet-orb.js +269 -0
- package/dist/components/consent-wallet-orb.js.map +1 -0
- package/dist/components/consent-wallet-signature.d.ts +26 -0
- package/dist/components/consent-wallet-signature.d.ts.map +1 -0
- package/dist/components/consent-wallet-signature.js +101 -0
- package/dist/components/consent-wallet-signature.js.map +1 -0
- package/dist/components/grant-field-styles.d.ts +9 -0
- package/dist/components/grant-field-styles.d.ts.map +1 -0
- package/dist/components/grant-field-styles.js +82 -0
- package/dist/components/grant-field-styles.js.map +1 -0
- package/dist/components/index.d.ts +28 -17
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +31 -17
- package/dist/components/index.js.map +1 -1
- package/dist/components/mcp-consent.d.ts +16 -0
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +60 -2
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/components/template-link.d.ts +24 -0
- package/dist/components/template-link.d.ts.map +1 -0
- package/dist/components/template-link.js +29 -0
- package/dist/components/template-link.js.map +1 -0
- package/dist/components/wallet-globe.d.ts +29 -0
- package/dist/components/wallet-globe.d.ts.map +1 -0
- package/dist/components/wallet-globe.js +181 -0
- package/dist/components/wallet-globe.js.map +1 -0
- package/dist/components/wallet-icons.d.ts +16 -0
- package/dist/components/wallet-icons.d.ts.map +1 -0
- package/dist/components/wallet-icons.js +16 -0
- package/dist/components/wallet-icons.js.map +1 -0
- package/dist/components/wallet-status.d.ts +19 -0
- package/dist/components/wallet-status.d.ts.map +1 -0
- package/dist/components/wallet-status.js +29 -0
- package/dist/components/wallet-status.js.map +1 -0
- package/dist/consent.js +3547 -811
- package/dist/consent.min.js +1366 -295
- package/dist/copy/tokens.d.ts +107 -1
- package/dist/copy/tokens.d.ts.map +1 -1
- package/dist/copy/tokens.js +107 -1
- package/dist/copy/tokens.js.map +1 -1
- package/dist/grant/index.d.ts +8 -0
- package/dist/grant/index.d.ts.map +1 -0
- package/dist/grant/index.js +8 -0
- package/dist/grant/index.js.map +1 -0
- package/dist/grant/terms.d.ts +97 -0
- package/dist/grant/terms.d.ts.map +1 -0
- package/dist/grant/terms.js +139 -0
- package/dist/grant/terms.js.map +1 -0
- package/dist/identity/agent-identity.d.ts +199 -0
- package/dist/identity/agent-identity.d.ts.map +1 -0
- package/dist/identity/agent-identity.js +305 -0
- package/dist/identity/agent-identity.js.map +1 -0
- package/dist/identity/documents.d.ts +63 -0
- package/dist/identity/documents.d.ts.map +1 -0
- package/dist/identity/documents.js +206 -0
- package/dist/identity/documents.js.map +1 -0
- package/dist/identity/entity-card.d.ts +80 -0
- package/dist/identity/entity-card.d.ts.map +1 -0
- package/dist/identity/entity-card.js +119 -0
- package/dist/identity/entity-card.js.map +1 -0
- package/dist/identity/index.d.ts +15 -0
- package/dist/identity/index.d.ts.map +1 -0
- package/dist/identity/index.js +15 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/identity/resolve.d.ts +31 -0
- package/dist/identity/resolve.d.ts.map +1 -0
- package/dist/identity/resolve.js +119 -0
- package/dist/identity/resolve.js.map +1 -0
- package/dist/identity/schemas.d.ts +404 -0
- package/dist/identity/schemas.d.ts.map +1 -0
- package/dist/identity/schemas.js +84 -0
- package/dist/identity/schemas.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/kya-os/index.d.ts +55 -0
- package/dist/kya-os/index.d.ts.map +1 -0
- package/dist/kya-os/index.js +235 -0
- package/dist/kya-os/index.js.map +1 -0
- 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/mcp-app/types.d.ts +1 -1
- package/dist/mcp-app/types.js +1 -1
- package/dist/popup/launcher.d.ts +3 -3
- package/dist/popup/launcher.js +3 -3
- package/dist/react/index.d.ts +182 -22
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +270 -35
- package/dist/react/index.js.map +1 -1
- package/dist/templates/index.d.ts +1 -1
- package/dist/templates/index.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/package.json +49 -8
package/README.md
CHANGED
|
@@ -2,6 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
`@kya-os/consent` provides consent configuration, Cedar capability types, templates, and Lit web components.
|
|
4
4
|
Import `@kya-os/consent/bundle` to register the components, or serve `CONSENT_BUNDLE` as an ES module for a standalone page.
|
|
5
|
+
See every component live, and the attacks it holds up against, at [consent.kya-os.ai](https://consent.kya-os.ai).
|
|
6
|
+
|
|
7
|
+
## Where it fits
|
|
8
|
+
|
|
9
|
+
This package works on its own, with any agent framework that needs a person's approval.
|
|
10
|
+
It also works with KYA-OS, an open protocol, and Vouched KYA runs both for you as a hosted service.
|
|
11
|
+
|
|
12
|
+
- `@kya-os/consent` draws the consent screen and reports what the person chose.
|
|
13
|
+
It is open source under MIT.
|
|
14
|
+
- [KYA-OS](https://github.com/decentralized-identity/kya-os-mcp/blob/main/SPEC.md) is an open protocol the screen works with, and doesn't need.
|
|
15
|
+
It gives the agent a DID, records the approval as a delegation credential, and has the agent sign a proof on every call for your server to check.
|
|
16
|
+
Its [JSON Schemas](https://schema.kya-os.org/) and [reference implementation](https://github.com/decentralized-identity/kya-os-mcp) are public, and the work happens in the [DIF Trusted AI Agents Working Group](https://identity.foundation/working-groups/trusted-agents.html).
|
|
17
|
+
- [Vouched KYA](https://kya.vouched.id/docs/govern/consent) is the hosted, commercial service.
|
|
18
|
+
It serves a consent page built on this package, stores the delegations it creates, verifies agent requests against them, and keeps the audit trail.
|
|
19
|
+
|
|
20
|
+
The screen's default footer says "Protected by Checkpoint".
|
|
21
|
+
Checkpoint is Vouched KYA's former name, and its hosted page relies on that default.
|
|
22
|
+
When you host the screen yourself, put your own footer in the `footer` slot.
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install @kya-os/consent
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The passkey component is the one exception to a single install.
|
|
31
|
+
Its entry points, `@kya-os/consent/passkey` and `@kya-os/consent/passkey/react`, need the optional peer dependency `@kya-os/id`.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install @kya-os/id # only if you import @kya-os/consent/passkey
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Without `@kya-os/id`, importing a passkey entry point fails with a module-not-found error for `@kya-os/id/wallet/passkey`.
|
|
38
|
+
Install `@kya-os/id` 0.6, 0.7 or 0.8 to fix it.
|
|
39
|
+
Every other entry point works without it, and so does the self-contained `consent.js` bundle, which inlines the passkey code.
|
|
5
40
|
|
|
6
41
|
## A standalone scope grant
|
|
7
42
|
|
|
@@ -26,7 +61,7 @@ screen.description = "Review the grant before using your passkey.";
|
|
|
26
61
|
screen.submitLabel = "Approve grant";
|
|
27
62
|
screen.cancelLabel = "Deny";
|
|
28
63
|
screen.addEventListener("capabilities-allow", async (event) => {
|
|
29
|
-
// event.detail: { selectedCapabilityIds: string[], selectedScopes: string[] }
|
|
64
|
+
// event.detail: { selectedCapabilityIds: string[], selectedScopes: string[], grantTerms? }
|
|
30
65
|
screen.loading = true;
|
|
31
66
|
try {
|
|
32
67
|
await hostApprove(event.detail);
|
|
@@ -48,6 +83,173 @@ Empty selections cannot emit approval.
|
|
|
48
83
|
`allSelected` (`all-selected`) seeds every capability as checked; rerendering the same capability IDs preserves the human's subsequent selection.
|
|
49
84
|
HTML attributes for custom labels are `submit-label` and `cancel-label`; JavaScript properties are `submitLabel` and `cancelLabel`.
|
|
50
85
|
|
|
86
|
+
## Grant terms
|
|
87
|
+
|
|
88
|
+
`<consent-grant-terms>` lets the person choose how long a grant lasts and which folder it covers.
|
|
89
|
+
It stays closed under one line that says what is in effect, such as "8 hours · Every folder", next to a Customize button.
|
|
90
|
+
Put it in the screen's `details` slot, and `capabilities-allow` carries the person's choice as `event.detail.grantTerms`.
|
|
91
|
+
Allow stays off while the terms can't be used, such as a folder path with `..` in it.
|
|
92
|
+
|
|
93
|
+
```html
|
|
94
|
+
<consent-capabilities-screen>
|
|
95
|
+
<consent-grant-terms slot="details" chained></consent-grant-terms>
|
|
96
|
+
</consent-capabilities-screen>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`grantTerms` is `{ notAfter, crispScopes }`, with `notAfter` in seconds.
|
|
100
|
+
Those are the field names of `@kya-os/id`'s `DelegationRequest`, so the terms spread into `wallet.issueDelegation()` unchanged.
|
|
101
|
+
The package root declares the type itself and never imports `@kya-os/id`.
|
|
102
|
+
|
|
103
|
+
With no child elements, the group shows a `<consent-duration>` and a `<consent-folder-scope>` with their defaults.
|
|
104
|
+
Put your own in it to configure them:
|
|
105
|
+
|
|
106
|
+
```html
|
|
107
|
+
<consent-grant-terms slot="details">
|
|
108
|
+
<consent-duration max="86400" value="3600"></consent-duration>
|
|
109
|
+
<consent-folder-scope
|
|
110
|
+
everything-label="Entire vault"
|
|
111
|
+
only-template="Limited to {Folder}"
|
|
112
|
+
></consent-folder-scope>
|
|
113
|
+
</consent-grant-terms>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
- `<consent-duration>` offers `options` (15 minutes to 30 days by default) up to `max`.
|
|
117
|
+
A `value` it doesn't offer shows as the longest shorter choice, so a grant never lasts longer than you asked for.
|
|
118
|
+
- `<consent-folder-scope>` reads a path the way the verifier's `path-prefix` matcher does.
|
|
119
|
+
`/notes/*` is `notes/`, and `notes/` never covers `notesx/`.
|
|
120
|
+
A path with a `.` or `..` segment is refused with a message, instead of becoming a grant that covers nothing.
|
|
121
|
+
- Both are form-associated.
|
|
122
|
+
Inside a `<form>` they submit under their `name`, and the folder field blocks submission while it is invalid.
|
|
123
|
+
- Any child element with a `grantTerms` property is a field, so you can add your own.
|
|
124
|
+
It may also have `summary` (its part of the closed line) and `valid`, and it should dispatch `consent-grant-field-change` when they change.
|
|
125
|
+
When more than one field sets a duration, the shortest wins.
|
|
126
|
+
- `chained` adds a line saying the agent can pass on only a narrower grant, which is true of every `@kya-os/id` delegation chain.
|
|
127
|
+
|
|
128
|
+
`@kya-os/consent/grant` exports the pure helpers behind them: `readFolder`, `folderTerms`, `mergeGrantTerms`, `pickDuration`, `formatDuration` and `DURATION_OPTIONS`.
|
|
129
|
+
It imports no other package, so a host that draws its own fields, or checks terms on its server, can use it on its own.
|
|
130
|
+
|
|
131
|
+
## Taking a grant back
|
|
132
|
+
|
|
133
|
+
`<consent-revoke>` asks before a grant ends, lists what ends, and confirms once it has.
|
|
134
|
+
It revokes nothing itself.
|
|
135
|
+
It fires `consent-revoke`, then your code revokes the grant and sets `loading`, then `revoked` or `error`.
|
|
136
|
+
With `chained`, the list adds every narrower grant the agent passed on, because revoking a `@kya-os/id` credential revokes the ones minted under it.
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
const revoke = document.querySelector("consent-revoke");
|
|
140
|
+
revoke.agentName = grant.agentName;
|
|
141
|
+
revoke.items = ["Read your notes", "Write to journal/"];
|
|
142
|
+
revoke.chained = true;
|
|
143
|
+
revoke.addEventListener("consent-revoke", async () => {
|
|
144
|
+
revoke.loading = true;
|
|
145
|
+
revoke.error = "";
|
|
146
|
+
try {
|
|
147
|
+
await wallet.revoke(grant.id); // the hub flips the grant's status bit
|
|
148
|
+
revoke.revoked = true;
|
|
149
|
+
} catch {
|
|
150
|
+
revoke.error = "Your account couldn't be reached. Try again.";
|
|
151
|
+
} finally {
|
|
152
|
+
revoke.loading = false;
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
revoke.addEventListener("consent-keep", closeDialog);
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Signing with a wallet
|
|
159
|
+
|
|
160
|
+
When the person approves by signing with their own wallet, as they do with `@kya-os/id`, these elements cover the moments around the signature.
|
|
161
|
+
Each shows state your page already has, and none of them calls a server.
|
|
162
|
+
|
|
163
|
+
- `<consent-wallet-check>` shows whether this browser's wallet can sign, as an orb and one line.
|
|
164
|
+
Set `status` to `checking`, `syncing`, `ready`, `conflict` or `error`.
|
|
165
|
+
The orb is a globe inside a dial of 48 ticks.
|
|
166
|
+
While the check runs, the globe turns and a light runs round the dial.
|
|
167
|
+
Once the wallet is ready, the dial closes and a check is drawn; when this browser can't sign, the dial stays open at the top.
|
|
168
|
+
- `<consent-wallet-orb>` is that orb on its own, for a screen whose own words already say what is happening.
|
|
169
|
+
It takes the same `status`, and one more: `idle`, for before anything has started, when the globe turns and the dial rests.
|
|
170
|
+
`--cs-wallet-orb-size`, `--cs-wallet-accent`, `--cs-wallet-success` and `--cs-wallet-muted` theme it.
|
|
171
|
+
- `<consent-wallet-notice>` says what to do when this browser can't sign.
|
|
172
|
+
It shows only for a `conflict` or an `error`.
|
|
173
|
+
`reason` picks the advice: `passkey-unreachable`, `key-drift` or `superseded`.
|
|
174
|
+
`credentials-url` links the page where the person manages their wallet, and the `more` slot replaces the advice under an unreachable passkey.
|
|
175
|
+
- `<consent-request-expiry>` counts down the time left to approve, from `expires-at` in epoch milliseconds or an ISO date.
|
|
176
|
+
At zero it says the request expired and fires `consent-request-expired` once, with `{ expiresAt }`.
|
|
177
|
+
- `<consent-phone-handoff>` is a QR code of the request's link, for a person whose passkey is on their phone.
|
|
178
|
+
It draws the code itself, so the link never goes to an image service.
|
|
179
|
+
Hide it on phones yourself: the element can't tell which device it is on.
|
|
180
|
+
- `<consent-wallet-signature>` is the small print under the buttons: the wallet signs the grant, and `revoke-url` is where to take it back.
|
|
181
|
+
|
|
182
|
+
The action bar takes `submit-icon="passkey"` for a fingerprint on Approve, and `loading-label` for what it says while it signs.
|
|
183
|
+
|
|
184
|
+
```html
|
|
185
|
+
<consent-wallet-check status="checking"></consent-wallet-check>
|
|
186
|
+
<consent-wallet-notice
|
|
187
|
+
app-name="Northwind"
|
|
188
|
+
credentials-url="/settings/credentials"
|
|
189
|
+
></consent-wallet-notice>
|
|
190
|
+
<consent-request-expiry
|
|
191
|
+
expires-at="2026-11-12T09:05:00Z"
|
|
192
|
+
></consent-request-expiry>
|
|
193
|
+
<consent-action-bar
|
|
194
|
+
submit-label="Approve"
|
|
195
|
+
cancel-label="Deny"
|
|
196
|
+
submit-icon="passkey"
|
|
197
|
+
loading-label="Signing…"
|
|
198
|
+
disabled
|
|
199
|
+
></consent-action-bar>
|
|
200
|
+
<consent-wallet-signature
|
|
201
|
+
revoke-url="/settings/credentials"
|
|
202
|
+
></consent-wallet-signature>
|
|
203
|
+
<consent-phone-handoff
|
|
204
|
+
url="https://app.example/c/chal_123"
|
|
205
|
+
updates-on-its-own
|
|
206
|
+
></consent-phone-handoff>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
// Your wallet check's outcome drives the check, the notice and Approve.
|
|
211
|
+
check.status = notice.status = outcome.status; // "ready", "conflict", …
|
|
212
|
+
notice.reason = outcome.reason; // "passkey-unreachable", …
|
|
213
|
+
bar.disabled = outcome.status !== "ready";
|
|
214
|
+
expiry.addEventListener("consent-request-expired", () => {
|
|
215
|
+
bar.disabled = true;
|
|
216
|
+
});
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
The notice names the app from `app-name`, or says "this app" without one.
|
|
220
|
+
Where your own words fit better, the check takes a `caption`, the notice a `message` and its `more` slot, and the phone handoff a `heading` and a `description`.
|
|
221
|
+
|
|
222
|
+
## React
|
|
223
|
+
|
|
224
|
+
`@kya-os/consent/react` has a React component for every element, such as `ConsentCapabilitiesScreenReact` for the screen above.
|
|
225
|
+
It needs two optional peer dependencies, `react` (18 or 19) and `@lit/react`:
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
npm install @kya-os/consent @lit/react
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
```tsx
|
|
232
|
+
import { ConsentCapabilitiesScreenReact } from "@kya-os/consent/react";
|
|
233
|
+
|
|
234
|
+
<ConsentCapabilitiesScreenReact
|
|
235
|
+
agentMetadata={{ name: "Claude", did: agentDid, verification: "verified" }}
|
|
236
|
+
capabilities={capabilities}
|
|
237
|
+
submitLabel="Approve grant"
|
|
238
|
+
loading={approving}
|
|
239
|
+
onAllow={(event) => hostApprove(event.detail)}
|
|
240
|
+
onDeny={hostDeny}
|
|
241
|
+
/>;
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Each component sets its props as element properties, so arrays and objects such as `capabilities` arrive intact, and takes an `onX` handler for each event the element fires.
|
|
245
|
+
React 18 can't do either for a custom element.
|
|
246
|
+
React 19 sets properties itself, and a React 19 app can render the elements directly: import `@kya-os/consent/bundle` to register them and listen with the raw event name, as in `oncapabilities-allow`.
|
|
247
|
+
The components keep the handlers typed in both versions.
|
|
248
|
+
`react` and `@lit/react` are peers, so the components use your app's copy of React.
|
|
249
|
+
No other entry point imports either one.
|
|
250
|
+
`<consent-passkey>` has its own component, `ConsentPasskeyReact`, in `@kya-os/consent/passkey/react` (see [Passkey mode](#passkey-mode)).
|
|
251
|
+
Slotted parts are children, as in `<ConsentGrantTermsReact slot="details" chained />` inside the screen.
|
|
252
|
+
|
|
51
253
|
## Host content and styling
|
|
52
254
|
|
|
53
255
|
Named slots place host content in the existing screen layout:
|
|
@@ -79,6 +281,69 @@ These hooks style the actual components without reaching into their shadow roots
|
|
|
79
281
|
The deprecated `verified` boolean is read only when `verification` is absent.
|
|
80
282
|
The domain pill is tinted from `--consent-primary` and takes the theme's text color; `--cs-pill-domain-bg`, `--cs-pill-domain-border`, and `--cs-pill-domain-text` override it.
|
|
81
283
|
|
|
284
|
+
## Agent identity: Entity Cards
|
|
285
|
+
|
|
286
|
+
Instead of `agentMetadata`, a host can hand the screen the agent as a KYA-OS Entity Card plus what its verifier established: `agentIdentity` on `<consent-capabilities-screen>` and `<mcp-consent>`, the `agent-identity` attribute, or `agentIdentity` in `generateConsentShell`.
|
|
287
|
+
The screen picks the pill from the verification, bound to the card.
|
|
288
|
+
A `verified` result counts only when it names the card's own DID, and a `domain` result only when it names the card's own domain; anything else shows UNVERIFIED.
|
|
289
|
+
When `agentIdentity` is set it is the only source for the agent tile: one that doesn't validate shows no tile, and never falls back to `agentMetadata`.
|
|
290
|
+
On `<mcp-consent>`, the card must name the `agent-did` the grant is for, or no tile shows.
|
|
291
|
+
|
|
292
|
+
The screen never verifies anything; the host does, before it renders the page.
|
|
293
|
+
`@kya-os/consent/identity` reads what agents already publish into the card shape:
|
|
294
|
+
|
|
295
|
+
- a KYA-OS Entity Card, as is;
|
|
296
|
+
- CIMD client metadata, read the way `cardFromClientMetadata` in `@kya-os/mcp/card` reads it;
|
|
297
|
+
- an A2A AgentCard carrying the KYA-OS entity-card extension, or the extension on its own;
|
|
298
|
+
- a NANDA AgentFacts document whose `id` is a DID.
|
|
299
|
+
|
|
300
|
+
`resolveAgentIdentity(document, { verifier, context })` reads the document, runs the verifier, binds its result to the card, and returns the `AgentIdentity` to render.
|
|
301
|
+
A verifier that throws or returns something malformed leaves the identity unverified.
|
|
302
|
+
A `verified` result must come with the verifier's own card for the document's DID, and the identity shows that card, so the name next to Verified is one the verifier checked.
|
|
303
|
+
Without a valid one, the identity is unverified.
|
|
304
|
+
Three verifiers fit:
|
|
305
|
+
|
|
306
|
+
- `domainVerifier` binds the card to the domain the host fetched the document from (`context.fetchedFrom`), and never says verified.
|
|
307
|
+
- `createKyaOsAgentVerifier` from `@kya-os/consent/kya-os` is the KYA-OS reference verifier (server only, ESM only, needs the optional peer `@kya-os/mcp`).
|
|
308
|
+
- Any object with `verify(document, context)` is an `AgentIdentityVerifier`.
|
|
309
|
+
|
|
310
|
+
The KYA-OS verifier says `verified` only when all of these hold:
|
|
311
|
+
|
|
312
|
+
- the card is a `did:web` card, resolved from the DID's own DID document, never taken from the presented document;
|
|
313
|
+
- `verifyCard` passes: the card is not revoked, and every accountability or attestation claim it makes holds;
|
|
314
|
+
- the requester proved it holds the card's key for this request, with a holder-of-key proof signed by a key the DID document publishes, addressed to `audience` and never seen before, or as the card's own CIMD client.
|
|
315
|
+
For a CIMD client, `context.cimdClientAuth` names the `client_id` the authorization server authenticated with `private_key_jwt` and the `jwks_uri` it took the key from.
|
|
316
|
+
Both must equal the card's `cimd` coordinates, and the CIMD document must be bound to the DID both ways.
|
|
317
|
+
|
|
318
|
+
Without a key proof the result is `domain` at best.
|
|
319
|
+
A `did:key` card has no home to resolve, so its name is self-asserted and it is never verified.
|
|
320
|
+
A card that names a `responsibleParty` needs `checks.accountabilityVerifier` to verify.
|
|
321
|
+
|
|
322
|
+
```ts
|
|
323
|
+
import { createSafeFetch, InMemoryNonceCache } from "@kya-os/mcp/card";
|
|
324
|
+
import { generateConsentShell } from "@kya-os/consent";
|
|
325
|
+
import { resolveAgentIdentity } from "@kya-os/consent/identity";
|
|
326
|
+
import { createKyaOsAgentVerifier } from "@kya-os/consent/kya-os";
|
|
327
|
+
|
|
328
|
+
const verifier = createKyaOsAgentVerifier({
|
|
329
|
+
fetch: createSafeFetch(),
|
|
330
|
+
audience: "did:web:shop.example.com",
|
|
331
|
+
consumeNonceIfFresh: new InMemoryNonceCache().consume,
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
const agentIdentity = await resolveAgentIdentity(agentFacts, {
|
|
335
|
+
verifier,
|
|
336
|
+
context: { proof, request: { method: "tools/call", params } },
|
|
337
|
+
connectedAt,
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
const html = generateConsentShell({ ...options, agentDid, agentIdentity });
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
`agentMetadataFromIdentity(identity)` gives the same tile data as `AgentMetadata`, so `isCappedAtProbe` and `compileCapabilitiesToCedar` lift the probe cap only for an identity a verifier proved.
|
|
344
|
+
`parseAgentIdentity` and `AgentIdentitySchema` validate an identity on the host.
|
|
345
|
+
The screen reads it with `readAgentIdentity`, which needs no zod, so the browser bundle stays free of it.
|
|
346
|
+
|
|
82
347
|
## Brand colors
|
|
83
348
|
|
|
84
349
|
Text drawn on or in a brand color reads its own variable, so it reaches WCAG AA (4.5:1) on any brand:
|
|
@@ -143,13 +408,90 @@ It loads the element from `{serverUrl}/consent.js`, and like the element it make
|
|
|
143
408
|
It re-dispatches the element's three events to a same-origin opener or parent window as `postMessage({ source: "consent-passkey", type, detail }, "/")`.
|
|
144
409
|
Required terms keep the element disabled until accepted, and without a usable `passkeyStep` the page fails closed.
|
|
145
410
|
|
|
411
|
+
## A consent page for `@kya-os/id`
|
|
412
|
+
|
|
413
|
+
[`@kya-os/id`](https://www.npmjs.com/package/@kya-os/id) mints the grant, and these components ask the person for it.
|
|
414
|
+
Together they make the page an `@kya-os/id` MCP server sends people to when an agent needs access.
|
|
415
|
+
|
|
416
|
+
On the server, `createMcpRouter` calls your `createConsentChallenge` when a tool call has no grant that covers it.
|
|
417
|
+
Store the request and return the page's URL.
|
|
418
|
+
The agent relays the URL to the person, and its next call carries the challenge back as a resume token.
|
|
419
|
+
|
|
420
|
+
```ts
|
|
421
|
+
import { createMcpRouter } from "@kya-os/id/mcp";
|
|
422
|
+
|
|
423
|
+
const router = createMcpRouter({
|
|
424
|
+
...options, // serverInfo, didResolver, findUserByDid, tools
|
|
425
|
+
createConsentChallenge: async ({ capability, agentLabel }) => {
|
|
426
|
+
const challenge = await consentRequests.create({ capability, agentLabel });
|
|
427
|
+
return { challenge, consentUrl: `${BASE_URL}/c/${challenge}` };
|
|
428
|
+
},
|
|
429
|
+
resolveResumeDelegation: ({ resumeToken }) =>
|
|
430
|
+
consentRequests.jwtFor(resumeToken),
|
|
431
|
+
});
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
The page at `/c/:challenge` is the capabilities screen with the grant terms in its `details` slot.
|
|
435
|
+
On Allow, the person's passkey wallet signs one credential with the terms they chose, and the page hands its JWT to your server for `jwtFor` to return.
|
|
436
|
+
|
|
437
|
+
```html
|
|
438
|
+
<consent-capabilities-screen>
|
|
439
|
+
<consent-grant-terms slot="details" chained></consent-grant-terms>
|
|
440
|
+
</consent-capabilities-screen>
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
```ts
|
|
444
|
+
import "@kya-os/consent/bundle";
|
|
445
|
+
import { createWallet } from "@kya-os/id/wallet";
|
|
446
|
+
|
|
447
|
+
const wallet = createWallet();
|
|
448
|
+
const screen = document.querySelector("consent-capabilities-screen");
|
|
449
|
+
screen.capabilities = [
|
|
450
|
+
{
|
|
451
|
+
id: request.capability,
|
|
452
|
+
label: request.label, // e.g. "Read your notes"
|
|
453
|
+
description: request.description,
|
|
454
|
+
icon: "eye",
|
|
455
|
+
riskLevel: "low",
|
|
456
|
+
defaultOn: true,
|
|
457
|
+
scopes: [request.capability],
|
|
458
|
+
},
|
|
459
|
+
];
|
|
460
|
+
screen.addEventListener("capabilities-allow", async (event) => {
|
|
461
|
+
const { selectedScopes, grantTerms } = event.detail;
|
|
462
|
+
screen.loading = true;
|
|
463
|
+
try {
|
|
464
|
+
const stored = await wallet.issueDelegation({
|
|
465
|
+
...grantTerms, // { notAfter, crispScopes }
|
|
466
|
+
capabilities: selectedScopes,
|
|
467
|
+
subjectDid: request.subjectDid,
|
|
468
|
+
audience: request.audience,
|
|
469
|
+
});
|
|
470
|
+
await fetch(`/api/consent/${challenge}`, {
|
|
471
|
+
method: "POST",
|
|
472
|
+
headers: { "content-type": "application/json" },
|
|
473
|
+
body: JSON.stringify({ jwt: stored.jwt }),
|
|
474
|
+
});
|
|
475
|
+
} finally {
|
|
476
|
+
screen.loading = false;
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
A grant the person's wallet signs needs no passkey assertion on top: the signature is the approval.
|
|
482
|
+
When your server approves the request instead, use the assertion mode.
|
|
483
|
+
Open the ceremony with `createCommittedChallenge` from `@kya-os/id/server/passkey`, which commits the challenge to the request's id and scopes, put `<consent-passkey>` in the screen's `auth` slot, and keep Allow off with `allow-disabled` until the server has verified the assertion (see [Passkey mode](#passkey-mode)).
|
|
484
|
+
|
|
485
|
+
Where the person manages their grants, `<consent-revoke>` and `wallet.revoke(id)` take one back (see [Taking a grant back](#taking-a-grant-back)).
|
|
486
|
+
The code above type-checks against `@kya-os/id` 0.8.
|
|
487
|
+
|
|
146
488
|
## Validation and preview
|
|
147
489
|
|
|
148
490
|
Run `pnpm test` and `pnpm build` for the package suite and all bundle formats.
|
|
149
491
|
The build also verifies that the browser, ESM, CJS, and MCP App inline bundles contain the same UI.
|
|
150
492
|
Run `pnpm test:browser` in a Python environment with Playwright installed for real Chromium tests of the public component contract.
|
|
151
493
|
Set `CHROMIUM` to use an existing Chromium executable; otherwise Playwright's installed Chromium is used.
|
|
152
|
-
The browser suite covers scope-only and Cedar rendering, custom content, mobile layout, empty and disabled approval, frozen scope selection while loading, actual main-component form submission, scope mismatch refusal,
|
|
494
|
+
The browser suite covers scope-only and Cedar rendering, custom content, mobile layout, empty and disabled approval, frozen scope selection while loading, actual main-component form submission, scope mismatch refusal, fixed-grant authentication gates, and the grant terms and revoke panel: form association, keyboard order, Allow carrying the terms, and the fit at 320px.
|
|
153
495
|
It also runs `<consent-passkey>` against a CDP virtual authenticator: passkey registration and a user-verified assertion, a failed user verification, and a browser without WebAuthn.
|
|
154
496
|
|
|
155
497
|
After building, serve this directory and open `preview/all-templates.html#scope-passkey-preview` for the fictional Google account and passkey host example.
|
package/dist/bundle/index.d.ts
CHANGED
|
@@ -21,40 +21,52 @@
|
|
|
21
21
|
*
|
|
22
22
|
* @module @kya-os/consent/bundle
|
|
23
23
|
*/
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
export {
|
|
52
|
-
export {
|
|
53
|
-
export {
|
|
54
|
-
export {
|
|
55
|
-
export {
|
|
56
|
-
export {
|
|
57
|
-
export
|
|
58
|
-
export
|
|
59
|
-
export
|
|
24
|
+
import "../components/consent-button.js";
|
|
25
|
+
import "../components/consent-checkbox.js";
|
|
26
|
+
import "../components/consent-input.js";
|
|
27
|
+
import "../components/consent-shell.js";
|
|
28
|
+
import "../components/consent-permissions.js";
|
|
29
|
+
import "../components/consent-terms.js";
|
|
30
|
+
import "../components/consent-oauth-button.js";
|
|
31
|
+
import "../components/consent-otp-input.js";
|
|
32
|
+
import "../components/consent-agent-header.js";
|
|
33
|
+
import "../components/consent-headline.js";
|
|
34
|
+
import "../components/consent-capability-card.js";
|
|
35
|
+
import "../components/consent-action-bar.js";
|
|
36
|
+
import "../components/consent-footer.js";
|
|
37
|
+
import "../components/consent-revocation-notice.js";
|
|
38
|
+
import "../components/consent-connector-header.js";
|
|
39
|
+
import "../components/consent-capabilities-screen.js";
|
|
40
|
+
import "../components/consent-duration.js";
|
|
41
|
+
import "../components/consent-folder-scope.js";
|
|
42
|
+
import "../components/consent-grant-terms.js";
|
|
43
|
+
import "../components/consent-revoke.js";
|
|
44
|
+
import "../components/consent-wallet-orb.js";
|
|
45
|
+
import "../components/consent-wallet-check.js";
|
|
46
|
+
import "../components/consent-wallet-notice.js";
|
|
47
|
+
import "../components/consent-wallet-signature.js";
|
|
48
|
+
import "../components/consent-request-expiry.js";
|
|
49
|
+
import "../components/consent-phone-handoff.js";
|
|
50
|
+
import "../components/mcp-consent.js";
|
|
51
|
+
export { McpConsent } from "../components/mcp-consent.js";
|
|
52
|
+
export { ConsentButton } from "../components/consent-button.js";
|
|
53
|
+
export { ConsentCheckbox } from "../components/consent-checkbox.js";
|
|
54
|
+
export { ConsentInput } from "../components/consent-input.js";
|
|
55
|
+
export { ConsentShell } from "../components/consent-shell.js";
|
|
56
|
+
export { ConsentPermissions } from "../components/consent-permissions.js";
|
|
57
|
+
export { ConsentTerms } from "../components/consent-terms.js";
|
|
58
|
+
export { ConsentOAuthButton } from "../components/consent-oauth-button.js";
|
|
59
|
+
export { ConsentOTPInput } from "../components/consent-otp-input.js";
|
|
60
|
+
export { ConsentAgentHeader } from "../components/consent-agent-header.js";
|
|
61
|
+
export { ConsentHeadline } from "../components/consent-headline.js";
|
|
62
|
+
export { ConsentCapabilityCard } from "../components/consent-capability-card.js";
|
|
63
|
+
export { ConsentActionBar } from "../components/consent-action-bar.js";
|
|
64
|
+
export { ConsentFooter } from "../components/consent-footer.js";
|
|
65
|
+
export { ConsentRevocationNotice } from "../components/consent-revocation-notice.js";
|
|
66
|
+
export { ConsentConnectorHeader } from "../components/consent-connector-header.js";
|
|
67
|
+
export { ConsentCapabilitiesScreen } from "../components/consent-capabilities-screen.js";
|
|
68
|
+
export { CONSENT_CAPABILITIES_FEATURES } from "../constants/capabilities.js";
|
|
69
|
+
export type { ConsentConfig, ResolvedConsentConfig, } from "../types/config.types.js";
|
|
70
|
+
export type { OAuthIdentity } from "../types/api.types.js";
|
|
71
|
+
export type { ConsentScopeCapability } from "../types/capabilities.types.js";
|
|
60
72
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundle/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;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AAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAG7E,YAAY,EACV,aAAa,EACb,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,YAAY,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/dist/bundle/index.js
CHANGED
|
@@ -22,39 +22,51 @@
|
|
|
22
22
|
* @module @kya-os/consent/bundle
|
|
23
23
|
*/
|
|
24
24
|
// Import all components - this registers them as custom elements
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
25
|
+
import "../components/consent-button.js";
|
|
26
|
+
import "../components/consent-checkbox.js";
|
|
27
|
+
import "../components/consent-input.js";
|
|
28
|
+
import "../components/consent-shell.js";
|
|
29
|
+
import "../components/consent-permissions.js";
|
|
30
|
+
import "../components/consent-terms.js";
|
|
31
|
+
import "../components/consent-oauth-button.js";
|
|
32
|
+
import "../components/consent-otp-input.js";
|
|
33
|
+
import "../components/consent-agent-header.js";
|
|
34
|
+
import "../components/consent-headline.js";
|
|
35
|
+
import "../components/consent-capability-card.js";
|
|
36
|
+
import "../components/consent-action-bar.js";
|
|
37
|
+
import "../components/consent-footer.js";
|
|
38
|
+
import "../components/consent-revocation-notice.js";
|
|
39
|
+
import "../components/consent-connector-header.js";
|
|
40
|
+
import "../components/consent-capabilities-screen.js";
|
|
41
|
+
import "../components/consent-duration.js";
|
|
42
|
+
import "../components/consent-folder-scope.js";
|
|
43
|
+
import "../components/consent-grant-terms.js";
|
|
44
|
+
import "../components/consent-revoke.js";
|
|
45
|
+
import "../components/consent-wallet-orb.js";
|
|
46
|
+
import "../components/consent-wallet-check.js";
|
|
47
|
+
import "../components/consent-wallet-notice.js";
|
|
48
|
+
import "../components/consent-wallet-signature.js";
|
|
49
|
+
import "../components/consent-request-expiry.js";
|
|
50
|
+
import "../components/consent-phone-handoff.js";
|
|
51
|
+
import "../components/mcp-consent.js";
|
|
41
52
|
// Re-export the main composite component for programmatic use
|
|
42
|
-
export { McpConsent } from
|
|
53
|
+
export { McpConsent } from "../components/mcp-consent.js";
|
|
43
54
|
// Re-export individual components for advanced usage
|
|
44
|
-
export { ConsentButton } from
|
|
45
|
-
export { ConsentCheckbox } from
|
|
46
|
-
export { ConsentInput } from
|
|
47
|
-
export { ConsentShell } from
|
|
48
|
-
export { ConsentPermissions } from
|
|
49
|
-
export { ConsentTerms } from
|
|
50
|
-
export { ConsentOAuthButton } from
|
|
51
|
-
export { ConsentOTPInput } from
|
|
52
|
-
export { ConsentAgentHeader } from
|
|
53
|
-
export {
|
|
54
|
-
export {
|
|
55
|
-
export {
|
|
56
|
-
export {
|
|
57
|
-
export {
|
|
58
|
-
export {
|
|
59
|
-
export {
|
|
55
|
+
export { ConsentButton } from "../components/consent-button.js";
|
|
56
|
+
export { ConsentCheckbox } from "../components/consent-checkbox.js";
|
|
57
|
+
export { ConsentInput } from "../components/consent-input.js";
|
|
58
|
+
export { ConsentShell } from "../components/consent-shell.js";
|
|
59
|
+
export { ConsentPermissions } from "../components/consent-permissions.js";
|
|
60
|
+
export { ConsentTerms } from "../components/consent-terms.js";
|
|
61
|
+
export { ConsentOAuthButton } from "../components/consent-oauth-button.js";
|
|
62
|
+
export { ConsentOTPInput } from "../components/consent-otp-input.js";
|
|
63
|
+
export { ConsentAgentHeader } from "../components/consent-agent-header.js";
|
|
64
|
+
export { ConsentHeadline } from "../components/consent-headline.js";
|
|
65
|
+
export { ConsentCapabilityCard } from "../components/consent-capability-card.js";
|
|
66
|
+
export { ConsentActionBar } from "../components/consent-action-bar.js";
|
|
67
|
+
export { ConsentFooter } from "../components/consent-footer.js";
|
|
68
|
+
export { ConsentRevocationNotice } from "../components/consent-revocation-notice.js";
|
|
69
|
+
export { ConsentConnectorHeader } from "../components/consent-connector-header.js";
|
|
70
|
+
export { ConsentCapabilitiesScreen } from "../components/consent-capabilities-screen.js";
|
|
71
|
+
export { CONSENT_CAPABILITIES_FEATURES } from "../constants/capabilities.js";
|
|
60
72
|
//# sourceMappingURL=index.js.map
|
package/dist/bundle/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bundle/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,iEAAiE;AACjE,OAAO,iCAAiC,CAAC;AACzC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,gCAAgC,CAAC;AACxC,OAAO,gCAAgC,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,gCAAgC,CAAC;AACxC,OAAO,uCAAuC,CAAC;A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AC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../src/bundle/inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../src/bundle/inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAA4omW,CAAC;AAE1qmW;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAe,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAA2B,CAAC;AAE9D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAuC,CAAC"}
|