@kya-os/consent 0.2.3 → 0.4.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 +223 -4
- package/dist/bundle/index.d.ts +10 -0
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +10 -0
- 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/cjs/bundle/index.js +10 -0
- 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/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 +5 -1
- package/dist/cjs/components/consent-agent-header.js.map +1 -1
- package/dist/cjs/components/consent-capabilities-screen.js +56 -4
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
- package/dist/cjs/components/consent-capability-card.js +75 -24
- package/dist/cjs/components/consent-capability-card.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 +50 -1
- package/dist/cjs/components/consent-headline.js.map +1 -1
- 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 +49 -42
- 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 +33 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/mcp-consent.js +18 -1
- 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/constants/capabilities.js +11 -2
- package/dist/cjs/constants/capabilities.js.map +1 -1
- package/dist/cjs/copy/tokens.js +91 -0
- 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/index.js +2 -0
- 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/react/index.js +120 -1
- package/dist/cjs/react/index.js.map +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.map +1 -1
- package/dist/components/consent-agent-header.js +5 -1
- package/dist/components/consent-agent-header.js.map +1 -1
- package/dist/components/consent-capabilities-screen.d.ts +24 -3
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
- package/dist/components/consent-capabilities-screen.js +54 -3
- package/dist/components/consent-capabilities-screen.js.map +1 -1
- package/dist/components/consent-capability-card.d.ts +19 -2
- package/dist/components/consent-capability-card.d.ts.map +1 -1
- package/dist/components/consent-capability-card.js +74 -23
- package/dist/components/consent-capability-card.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 +25 -0
- package/dist/components/consent-headline.d.ts.map +1 -1
- package/dist/components/consent-headline.js +52 -3
- package/dist/components/consent-headline.js.map +1 -1
- 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 +4 -4
- package/dist/components/consent-otp-input.d.ts.map +1 -1
- package/dist/components/consent-otp-input.js +51 -44
- 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 +11 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +14 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +18 -1
- 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 +3246 -807
- package/dist/consent.min.js +1360 -281
- package/dist/constants/capabilities.d.ts +5 -2
- package/dist/constants/capabilities.d.ts.map +1 -1
- package/dist/constants/capabilities.js +11 -2
- package/dist/constants/capabilities.js.map +1 -1
- package/dist/copy/tokens.d.ts +91 -0
- package/dist/copy/tokens.d.ts.map +1 -1
- package/dist/copy/tokens.js +91 -0
- 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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- 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 +74 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +119 -0
- package/dist/react/index.js.map +1 -1
- package/package.json +10 -4
package/dist/cjs/copy/tokens.js
CHANGED
|
@@ -108,6 +108,97 @@ exports.CONSENT_COPY_TOKENS = {
|
|
|
108
108
|
/** Dark theme secondary. */
|
|
109
109
|
deny: "Deny",
|
|
110
110
|
},
|
|
111
|
+
/**
|
|
112
|
+
* `consent-grant-terms`, `consent-duration` and `consent-folder-scope`
|
|
113
|
+
* defaults. Each element takes its own label, hint and placeholder too.
|
|
114
|
+
*/
|
|
115
|
+
grant: {
|
|
116
|
+
/** The button that opens the terms. */
|
|
117
|
+
customize: "Customize",
|
|
118
|
+
/** Between the parts of the closed summary: "8 hours · Every folder". */
|
|
119
|
+
summarySeparator: " · ",
|
|
120
|
+
durationLabel: "Valid for",
|
|
121
|
+
durationHint: "The grant ends on its own after this. The agent has to ask again.",
|
|
122
|
+
folderLabel: "Limit to a folder (optional)",
|
|
123
|
+
folderPlaceholder: "e.g. notes/",
|
|
124
|
+
folderHint: "Only files under this folder. Leave it blank to allow every folder.",
|
|
125
|
+
/** The summary when no folder is set. */
|
|
126
|
+
everyFolder: "Every folder",
|
|
127
|
+
/** `{Folder}` → the folder, e.g. "notes/". */
|
|
128
|
+
onlyFolderTemplate: "Only {Folder}",
|
|
129
|
+
/** A folder with a `.` or `..` segment, which no request can match. */
|
|
130
|
+
folderDotSegment: "Use a folder path without . or .. in it.",
|
|
131
|
+
/** The summary while the folder can't be used. */
|
|
132
|
+
folderNeedsFixing: "Folder needs fixing",
|
|
133
|
+
/** `chained`: what a delegation chain lets the agent do with the grant. */
|
|
134
|
+
passOn: "The agent can pass on only a narrower grant, never a wider one.",
|
|
135
|
+
},
|
|
136
|
+
/** `consent-revoke` defaults. `{Agent}` → agent display name. */
|
|
137
|
+
revoke: {
|
|
138
|
+
titleTemplate: "Take back {Agent}'s access?",
|
|
139
|
+
bodyTemplate: "It ends right away, and {Agent} has to ask again to get it back.",
|
|
140
|
+
/** Heading over what ends. */
|
|
141
|
+
endsTitle: "This ends",
|
|
142
|
+
/** `chained`: the grants the agent made under this one end too. */
|
|
143
|
+
chainedItemTemplate: "Every narrower grant {Agent} passed on",
|
|
144
|
+
confirm: "Take back access",
|
|
145
|
+
keep: "Keep access",
|
|
146
|
+
working: "Taking back…",
|
|
147
|
+
doneTitle: "Access taken back",
|
|
148
|
+
/** `{Agent}` never starts a sentence: it falls back to "this agent". */
|
|
149
|
+
doneBodyTemplate: "It has ended, and {Agent} can no longer use it.",
|
|
150
|
+
},
|
|
151
|
+
/**
|
|
152
|
+
* The wallet elements: `consent-wallet-check`, `consent-wallet-notice`,
|
|
153
|
+
* `consent-wallet-signature` and `consent-phone-handoff`. `{App}` → the
|
|
154
|
+
* app's name. `{CredentialsLink}` and `{RevokeLink}` → a link to the page
|
|
155
|
+
* where the person manages their wallet and their grants.
|
|
156
|
+
*/
|
|
157
|
+
wallet: {
|
|
158
|
+
/** The caption under the wallet check, one per status. */
|
|
159
|
+
check: {
|
|
160
|
+
checking: "Checking wallet identity…",
|
|
161
|
+
syncing: "Syncing this device's wallet to your account…",
|
|
162
|
+
ready: "Wallet verified",
|
|
163
|
+
conflict: "This browser can't sign for your wallet",
|
|
164
|
+
error: "Couldn't verify your wallet",
|
|
165
|
+
},
|
|
166
|
+
notice: {
|
|
167
|
+
/** `{App}` when the host doesn't name its app. */
|
|
168
|
+
appFallback: "this app",
|
|
169
|
+
credentialsLink: "your credentials page",
|
|
170
|
+
/** `updates-on-its-own`: the page reflects an approval made elsewhere. */
|
|
171
|
+
updatesOnItsOwn: "This page updates on its own once you do.",
|
|
172
|
+
errorTitle: "Couldn't check your wallet",
|
|
173
|
+
errorBody: "Refresh the page to try again. If it keeps happening, open {CredentialsLink} to check the wallet there.",
|
|
174
|
+
passkeyUnreachableTitle: "Approve from the browser that holds your passkey",
|
|
175
|
+
passkeyUnreachableBody: "Your wallet is derived from a passkey this browser can't reach, so nothing can be signed here. Open this same link in the browser where {App} is already set up and approve it there.",
|
|
176
|
+
passkeyUnreachableMore: "To approve from this browser in future, sync that passkey to it (iCloud Keychain, Google Password Manager, or 1Password).",
|
|
177
|
+
keyDriftTitle: "This browser's wallet key doesn't match your account",
|
|
178
|
+
keyDriftBody: "It holds your account identity but signs with a different key than the one your account publishes, so anything it signs would be rejected. Approve from the browser where {App} was first set up, or re-link this browser from {CredentialsLink}.",
|
|
179
|
+
supersededTitle: "Your identity was re-registered",
|
|
180
|
+
supersededBody: "The registry's current record for your account doesn't include this device's signing key. Re-link your account with the registry from {CredentialsLink}, then reopen this request.",
|
|
181
|
+
/** A conflict with a reason the element doesn't know: `message` follows. */
|
|
182
|
+
otherTitle: "This browser can't sign this request",
|
|
183
|
+
},
|
|
184
|
+
signature: {
|
|
185
|
+
signedBy: "Signed by your KYA-OS wallet.",
|
|
186
|
+
revokeTemplate: "Revoke any time from {RevokeLink}.",
|
|
187
|
+
revokeLink: "your credentials list",
|
|
188
|
+
},
|
|
189
|
+
handoff: {
|
|
190
|
+
title: "Approve on your phone instead",
|
|
191
|
+
body: "If your wallet's passkey is on your phone, approving there with Face ID or Touch ID is faster and more reliable than signing from this computer.",
|
|
192
|
+
scan: "Scan this with your phone's camera and approve there.",
|
|
193
|
+
updatesOnItsOwn: "This page updates on its own once you do.",
|
|
194
|
+
qrLabel: "QR code that opens this request on your phone",
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
/** `consent-request-expiry`. `{Time}` → the time left, e.g. "4:59". */
|
|
198
|
+
request: {
|
|
199
|
+
expiresTemplate: "This request expires in {Time}. Approve before then, or the agent will need to ask again.",
|
|
200
|
+
expired: "This request expired. Ask the agent to try again.",
|
|
201
|
+
},
|
|
111
202
|
attribution: {
|
|
112
203
|
/** Light theme. */
|
|
113
204
|
protectedBy: "Protected by Checkpoint",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/copy/tokens.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/copy/tokens.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAgQH,kCAQC;AAtQY,QAAA,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,gDAAgD;QAC1D,gBAAgB,EAAE,4CAA4C;KAC/D;IACD,OAAO,EAAE;QACP,sCAAsC;QACtC,QAAQ,EACN,kGAAkG;KACrG;IACD,SAAS,EAAE;QACT,YAAY,EAAE,UAAU;QACxB,cAAc,EAAE,YAAY;QAC5B;;;;WAIG;QACH,gBAAgB,EAAE,eAAe;QACjC;;;;;;WAMG;QACH,MAAM,EAAE,kBAAkB;QAC1B,+CAA+C;QAC/C,UAAU,EAAE,4BAA4B;QACxC,aAAa,EAAE,KAAK;QACpB;;;;WAIG;QACH,YAAY,EAAE,6DAA6D;QAC3E,gBAAgB,EAAE,oBAAoB;QACtC,8CAA8C;QAC9C,mBAAmB,EAAE,6BAA6B;KACnD;IACD,OAAO,EAAE;QACP,kEAAkE;QAClE,kBAAkB,EAAE,6BAA6B;QACjD,WAAW,EAAE,eAA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AAS,EAAE,uBAAuB;QAClC,YAAY,EAAE,qBAAqB;KACpC;IACD;;;OAGG;IACH,OAAO,EAAE;QACP,QAAQ,EAAE;YACR,KAAK,EAAE,kBAAkB;YACzB,YAAY,EACV,+FAA+F;YACjG,MAAM,EAAE,kBAAkB;YAC1B,IAAI,EAAE,iBAAiB;SACxB;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,kBAAkB;YACzB,YAAY,EACV,6EAA6E;YAC/E,MAAM,EAAE,kBAAkB;YAC1B,IAAI,EAAE,mBAAmB;SAC1B;QACD,QAAQ,EAAE,0CAA0C;QACpD,OAAO,EAAE,yBAAyB;QAClC,gBAAgB,EAAE,iCAAiC;QACnD,eAAe,EACb,6IAA6I;QAC/I,iBAAiB,EACf,uGAAuG;QACzG,6EAA6E;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,SAAgB,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,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Grant terms: a grant's duration and folder, in the field names of
|
|
4
|
+
* `@kya-os/id`'s `DelegationRequest`.
|
|
5
|
+
*
|
|
6
|
+
* @module @kya-os/consent/grant
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
__exportStar(require("./terms.js"), exports);
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grant/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,6CAA2B"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Grant terms: how long a grant lasts and which folder it covers.
|
|
4
|
+
*
|
|
5
|
+
* The person chooses them on the consent screen (`consent-duration`,
|
|
6
|
+
* `consent-folder-scope`, grouped by `consent-grant-terms`), and the host
|
|
7
|
+
* mints a credential with them. `GrantTerms` has the field names of
|
|
8
|
+
* `@kya-os/id`'s `DelegationRequest`, so the terms spread straight into
|
|
9
|
+
* `wallet.issueDelegation({ ...terms, capability, subjectDid })`. The types
|
|
10
|
+
* are declared here, not imported, so this module never needs `@kya-os/id`.
|
|
11
|
+
*
|
|
12
|
+
* Pure functions, no DOM.
|
|
13
|
+
*
|
|
14
|
+
* @module @kya-os/consent/grant
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.DEFAULT_DURATION_SECONDS = exports.DURATION_OPTIONS = void 0;
|
|
18
|
+
exports.durationOptionsWithin = durationOptionsWithin;
|
|
19
|
+
exports.pickDuration = pickDuration;
|
|
20
|
+
exports.formatDuration = formatDuration;
|
|
21
|
+
exports.readFolder = readFolder;
|
|
22
|
+
exports.folderTerms = folderTerms;
|
|
23
|
+
exports.mergeGrantTerms = mergeGrantTerms;
|
|
24
|
+
const MINUTE = 60;
|
|
25
|
+
const HOUR = 60 * MINUTE;
|
|
26
|
+
const DAY = 24 * HOUR;
|
|
27
|
+
/** The durations a picker offers when its host sets none. */
|
|
28
|
+
exports.DURATION_OPTIONS = Object.freeze([
|
|
29
|
+
{ label: "15 minutes", seconds: 15 * MINUTE },
|
|
30
|
+
{ label: "30 minutes", seconds: 30 * MINUTE },
|
|
31
|
+
{ label: "1 hour", seconds: HOUR },
|
|
32
|
+
{ label: "8 hours", seconds: 8 * HOUR },
|
|
33
|
+
{ label: "24 hours", seconds: DAY },
|
|
34
|
+
{ label: "7 days", seconds: 7 * DAY },
|
|
35
|
+
{ label: "30 days", seconds: 30 * DAY },
|
|
36
|
+
]);
|
|
37
|
+
/**
|
|
38
|
+
* The duration a picker starts on: a working session, so the agent doesn't
|
|
39
|
+
* have to ask again within the hour.
|
|
40
|
+
*/
|
|
41
|
+
exports.DEFAULT_DURATION_SECONDS = 8 * HOUR;
|
|
42
|
+
/**
|
|
43
|
+
* The options no longer than `maxSeconds`, in their own order. Never empty:
|
|
44
|
+
* a cap shorter than every option still offers the shortest one.
|
|
45
|
+
*/
|
|
46
|
+
function durationOptionsWithin(options, maxSeconds) {
|
|
47
|
+
const valid = options.filter((o) => Number.isFinite(o.seconds) && o.seconds > 0);
|
|
48
|
+
if (valid.length === 0)
|
|
49
|
+
return [...exports.DURATION_OPTIONS.slice(0, 1)];
|
|
50
|
+
if (maxSeconds === undefined || !Number.isFinite(maxSeconds)) {
|
|
51
|
+
return valid;
|
|
52
|
+
}
|
|
53
|
+
const within = valid.filter((o) => o.seconds <= maxSeconds);
|
|
54
|
+
if (within.length > 0)
|
|
55
|
+
return within;
|
|
56
|
+
const shortest = valid.reduce((a, b) => (b.seconds < a.seconds ? b : a));
|
|
57
|
+
return [shortest];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The option a picker shows for `seconds`: that option when it is offered,
|
|
61
|
+
* otherwise the longest offered option shorter than it, otherwise the
|
|
62
|
+
* shortest. A grant never gets longer than the host asked for.
|
|
63
|
+
*/
|
|
64
|
+
function pickDuration(seconds, options, maxSeconds) {
|
|
65
|
+
const offered = durationOptionsWithin(options, maxSeconds);
|
|
66
|
+
const exact = offered.find((o) => o.seconds === seconds);
|
|
67
|
+
if (exact)
|
|
68
|
+
return exact;
|
|
69
|
+
const shorter = offered.filter((o) => o.seconds < seconds);
|
|
70
|
+
if (shorter.length > 0) {
|
|
71
|
+
return shorter.reduce((a, b) => (b.seconds > a.seconds ? b : a));
|
|
72
|
+
}
|
|
73
|
+
return offered.reduce((a, b) => (b.seconds < a.seconds ? b : a));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A duration in words: "1 hour", "8 hours", "7 days", "90 seconds".
|
|
77
|
+
* Uses the largest unit that divides it evenly.
|
|
78
|
+
*/
|
|
79
|
+
function formatDuration(seconds) {
|
|
80
|
+
const units = [
|
|
81
|
+
[DAY, "day"],
|
|
82
|
+
[HOUR, "hour"],
|
|
83
|
+
[MINUTE, "minute"],
|
|
84
|
+
[1, "second"],
|
|
85
|
+
];
|
|
86
|
+
const whole = Math.max(0, Math.round(seconds));
|
|
87
|
+
for (const [size, name] of units) {
|
|
88
|
+
if (whole >= size && whole % size === 0) {
|
|
89
|
+
const n = whole / size;
|
|
90
|
+
return `${n} ${name}${n === 1 ? "" : "s"}`;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return `${whole} seconds`;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Read what a person typed into a folder field.
|
|
97
|
+
*
|
|
98
|
+
* - Blank, `/` or `*` means every folder.
|
|
99
|
+
* - Leading slashes and a trailing `*` are dropped: `/notes/*` is `notes/`.
|
|
100
|
+
* - `\` reads as `/`, and repeated slashes as one: `notes\\a//b` is
|
|
101
|
+
* `notes/a/b`. The matcher compares the raw string, so either would
|
|
102
|
+
* otherwise cover nothing a vault path can be.
|
|
103
|
+
* - A `.` or `..` segment is refused. The matcher refuses those too, so the
|
|
104
|
+
* grant would cover nothing at all.
|
|
105
|
+
*/
|
|
106
|
+
function readFolder(input) {
|
|
107
|
+
let folder = input
|
|
108
|
+
.trim()
|
|
109
|
+
.replace(/\\/g, "/")
|
|
110
|
+
.replace(/\/{2,}/g, "/")
|
|
111
|
+
.replace(/^\//, "");
|
|
112
|
+
if (folder.endsWith("*"))
|
|
113
|
+
folder = folder.slice(0, -1);
|
|
114
|
+
if (folder.replace(/\/+$/, "") === "")
|
|
115
|
+
return { ok: true, folder: "" };
|
|
116
|
+
const segments = folder.split("/");
|
|
117
|
+
if (segments.some((s) => s === "." || s === "..")) {
|
|
118
|
+
return { ok: false, problem: "dot-segment" };
|
|
119
|
+
}
|
|
120
|
+
return { ok: true, folder };
|
|
121
|
+
}
|
|
122
|
+
/** The grant terms for a folder: none for every folder. */
|
|
123
|
+
function folderTerms(folder) {
|
|
124
|
+
return folder
|
|
125
|
+
? { crispScopes: [{ resource: folder, matcher: "path-prefix" }] }
|
|
126
|
+
: {};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Combine the terms several fields chose. Folder scopes add up (a grant
|
|
130
|
+
* covers each of them); when more than one field sets a duration, the
|
|
131
|
+
* shortest wins, so combining terms never lengthens a grant.
|
|
132
|
+
*/
|
|
133
|
+
function mergeGrantTerms(...parts) {
|
|
134
|
+
const merged = {};
|
|
135
|
+
for (const part of parts) {
|
|
136
|
+
if (part.notAfter !== undefined) {
|
|
137
|
+
merged.notAfter =
|
|
138
|
+
merged.notAfter === undefined
|
|
139
|
+
? part.notAfter
|
|
140
|
+
: Math.min(merged.notAfter, part.notAfter);
|
|
141
|
+
}
|
|
142
|
+
if (part.crispScopes?.length) {
|
|
143
|
+
merged.crispScopes = [...(merged.crispScopes ?? []), ...part.crispScopes];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return merged;
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=terms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terms.js","sourceRoot":"","sources":["../../../src/grant/terms.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAmCH,sDAeC;AAOD,oCAaC;AAMD,wCAeC;AAgDD,gCAaC;AAGD,kCAIC;AAOD,0CAcC;AA1KD,MAAM,MAAM,GAAG,EAAE,CAAC;AAClB,MAAM,IAAI,GAAG,EAAE,GAAG,MAAM,CAAC;AACzB,MAAM,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC;AAEtB,6DAA6D;AAChD,QAAA,gBAAgB,GAA8B,MAAM,CAAC,MAAM,CAAC;IACvE,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,GAAG,MAAM,EAAE;IAC7C,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,GAAG,MAAM,EAAE;IAC7C,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE;IAClC,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE;IACvC,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE;IACnC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,GAAG,GAAG,EAAE;IACrC,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,GAAG,GAAG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C;AACT,CAAC;AAED;;;;GAIG;AACH,SAAgB,eAAe,CAAC,GAAG,KAAmB;IACpD,MAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAChC,MAAM,CAAC,QAAQ;gBACb,MAAM,CAAC,QAAQ,KAAK,SAAS;oBAC3B,CAAC,CAAC,IAAI,CAAC,QAAQ;oBACf,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjD,CAAC;QACD,IAAI,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;YAC7B,MAAM,CAAC,WAAW,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -58,4 +58,6 @@ __exportStar(require("./copy/index.js"), exports);
|
|
|
58
58
|
__exportStar(require("./popup/index.js"), exports);
|
|
59
59
|
// Re-export agent identity in the KYA-OS Entity Card shape
|
|
60
60
|
__exportStar(require("./identity/index.js"), exports);
|
|
61
|
+
// Re-export grant terms: a grant's duration and folder
|
|
62
|
+
__exportStar(require("./grant/index.js"), exports);
|
|
61
63
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;AAEH,sBAAsB;AACtB,2EAA2E;AAC3E,mDAAiC;AAEjC,wBAAwB;AACxB,qDAAmC;AAEnC,0BAA0B;AAC1B,uDAAqC;AAErC,uBAAuB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