@kya-os/consent 0.1.48 → 0.1.49
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/dist/bundle/inline.d.ts +1 -0
- package/dist/bundle/inline.d.ts.map +1 -1
- package/dist/bundle/inline.js +5 -4
- package/dist/bundle/inline.js.map +1 -1
- package/dist/bundle/shell.d.ts +4 -0
- package/dist/bundle/shell.d.ts.map +1 -1
- package/dist/bundle/shell.js +7 -3
- package/dist/bundle/shell.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 +7 -3
- package/dist/cjs/bundle/shell.js.map +1 -1
- package/dist/cjs/components/consent-capabilities-screen.js +35 -16
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
- package/dist/cjs/components/consent-revocation-notice.js +14 -6
- package/dist/cjs/components/consent-revocation-notice.js.map +1 -1
- package/dist/cjs/components/mcp-consent.js +122 -16
- package/dist/cjs/components/mcp-consent.js.map +1 -1
- package/dist/cjs/copy/tokens.js +2 -0
- 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/schemas/api.schemas.js +1 -0
- package/dist/cjs/schemas/api.schemas.js.map +1 -1
- package/dist/components/consent-capabilities-screen.d.ts +1 -0
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
- package/dist/components/consent-capabilities-screen.js +35 -16
- package/dist/components/consent-capabilities-screen.js.map +1 -1
- package/dist/components/consent-revocation-notice.d.ts +2 -1
- package/dist/components/consent-revocation-notice.d.ts.map +1 -1
- package/dist/components/consent-revocation-notice.js +14 -6
- package/dist/components/consent-revocation-notice.js.map +1 -1
- package/dist/components/mcp-consent.d.ts +8 -0
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +122 -16
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/consent.js +153 -33
- package/dist/consent.min.js +114 -53
- package/dist/copy/tokens.d.ts +2 -0
- package/dist/copy/tokens.d.ts.map +1 -1
- package/dist/copy/tokens.js +2 -0
- package/dist/copy/tokens.js.map +1 -1
- package/dist/mcp-app/index.d.ts +1 -0
- package/dist/mcp-app/index.js +1 -0
- package/dist/mcp-app/inline.d.ts +1 -0
- package/dist/mcp-app/inline.d.ts.map +1 -1
- package/dist/mcp-app/inline.js +3 -2
- package/dist/mcp-app/inline.js.map +1 -1
- package/dist/mcp-app/types.d.ts +1 -0
- package/dist/mcp-app/types.js +1 -0
- package/dist/schemas/api.schemas.d.ts +5 -0
- package/dist/schemas/api.schemas.d.ts.map +1 -1
- package/dist/schemas/api.schemas.js +1 -0
- package/dist/schemas/api.schemas.js.map +1 -1
- package/dist/types/api.types.d.ts +2 -0
- package/dist/types/api.types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/consent.js
CHANGED
|
@@ -2669,7 +2669,9 @@ var CONSENT_COPY_TOKENS = {
|
|
|
2669
2669
|
*/
|
|
2670
2670
|
revocationTemplate: "You can change or revoke any of these permissions anytime under {RevocationPath} at {Org}.",
|
|
2671
2671
|
/** `{Days}` → inactivity days, default 90. */
|
|
2672
|
-
inactivityTemplate: "Permissions automatically expire after {Days} days of inactivity."
|
|
2672
|
+
inactivityTemplate: "Permissions automatically expire after {Days} days of inactivity.",
|
|
2673
|
+
/** Native authorization follows the issued grant's fixed deadline. */
|
|
2674
|
+
fixedExpiryNotice: "Permissions expire at the time shown after approval. Continued use does not extend them."
|
|
2673
2675
|
},
|
|
2674
2676
|
actions: {
|
|
2675
2677
|
/** Light theme primary. `{Agent}` → agent display name. */
|
|
@@ -3671,16 +3673,16 @@ var ConsentRevocationNotice = class extends i4 {
|
|
|
3671
3673
|
this.revocationPath = "Account \u2192 Connected Agents";
|
|
3672
3674
|
this.orgName = "this site";
|
|
3673
3675
|
this.inactivityDays = 90;
|
|
3676
|
+
this.fixedExpiry = false;
|
|
3674
3677
|
}
|
|
3675
3678
|
render() {
|
|
3676
3679
|
const revoke = formatToken(CONSENT_COPY_TOKENS.footer.revocationTemplate, {
|
|
3677
3680
|
RevocationPath: this.revocationPath,
|
|
3678
3681
|
Org: this.orgName
|
|
3679
3682
|
});
|
|
3680
|
-
const
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
);
|
|
3683
|
+
const expiry = this.fixedExpiry ? CONSENT_COPY_TOKENS.footer.fixedExpiryNotice : formatToken(CONSENT_COPY_TOKENS.footer.inactivityTemplate, {
|
|
3684
|
+
Days: this.inactivityDays
|
|
3685
|
+
});
|
|
3684
3686
|
return b2`
|
|
3685
3687
|
<svg
|
|
3686
3688
|
class="icon"
|
|
@@ -3697,7 +3699,7 @@ var ConsentRevocationNotice = class extends i4 {
|
|
|
3697
3699
|
</svg>
|
|
3698
3700
|
<div class="content">
|
|
3699
3701
|
<span>${revoke}</span>
|
|
3700
|
-
<span>${
|
|
3702
|
+
<span>${expiry}</span>
|
|
3701
3703
|
</div>
|
|
3702
3704
|
`;
|
|
3703
3705
|
}
|
|
@@ -3709,7 +3711,7 @@ ConsentRevocationNotice.styles = i`
|
|
|
3709
3711
|
gap: 10px;
|
|
3710
3712
|
padding: 12px 14px;
|
|
3711
3713
|
border-radius: 12px;
|
|
3712
|
-
background: var(--cs-surface-inset, #
|
|
3714
|
+
background: var(--cs-surface-inset, #f1ece2);
|
|
3713
3715
|
color: var(--cs-text-secondary, #334155);
|
|
3714
3716
|
font-size: 12.5px;
|
|
3715
3717
|
line-height: 1.5;
|
|
@@ -3720,7 +3722,7 @@ ConsentRevocationNotice.styles = i`
|
|
|
3720
3722
|
height: 16px;
|
|
3721
3723
|
flex-shrink: 0;
|
|
3722
3724
|
margin-top: 2px;
|
|
3723
|
-
color: var(--cs-text-tertiary, #
|
|
3725
|
+
color: var(--cs-text-tertiary, #64748b);
|
|
3724
3726
|
}
|
|
3725
3727
|
|
|
3726
3728
|
.content {
|
|
@@ -3731,7 +3733,7 @@ ConsentRevocationNotice.styles = i`
|
|
|
3731
3733
|
|
|
3732
3734
|
em {
|
|
3733
3735
|
font-style: normal;
|
|
3734
|
-
color: var(--cs-text-primary, #
|
|
3736
|
+
color: var(--cs-text-primary, #0f172a);
|
|
3735
3737
|
font-weight: 500;
|
|
3736
3738
|
}
|
|
3737
3739
|
`;
|
|
@@ -3744,6 +3746,9 @@ __decorateClass([
|
|
|
3744
3746
|
__decorateClass([
|
|
3745
3747
|
n4({ type: Number })
|
|
3746
3748
|
], ConsentRevocationNotice.prototype, "inactivityDays", 2);
|
|
3749
|
+
__decorateClass([
|
|
3750
|
+
n4({ type: Boolean, attribute: "fixed-expiry" })
|
|
3751
|
+
], ConsentRevocationNotice.prototype, "fixedExpiry", 2);
|
|
3747
3752
|
ConsentRevocationNotice = __decorateClass([
|
|
3748
3753
|
t3("consent-revocation-notice")
|
|
3749
3754
|
], ConsentRevocationNotice);
|
|
@@ -4107,6 +4112,7 @@ var ConsentCapabilitiesScreen = class extends i4 {
|
|
|
4107
4112
|
this.headlineVerb = "use";
|
|
4108
4113
|
this.revocationPath = "Account \u2192 Connected Agents";
|
|
4109
4114
|
this.inactivityDays = 90;
|
|
4115
|
+
this.fixedExpiry = false;
|
|
4110
4116
|
this.theme = "light";
|
|
4111
4117
|
this.howItWorksUrl = "";
|
|
4112
4118
|
this.loading = false;
|
|
@@ -4128,9 +4134,11 @@ var ConsentCapabilitiesScreen = class extends i4 {
|
|
|
4128
4134
|
*/
|
|
4129
4135
|
this.seedKey = "";
|
|
4130
4136
|
this.onCapabilityToggle = (event) => {
|
|
4131
|
-
if (this.loading || this.disabled || !(event instanceof CustomEvent))
|
|
4137
|
+
if (this.loading || this.disabled || !(event instanceof CustomEvent))
|
|
4138
|
+
return;
|
|
4132
4139
|
const detail = event.detail;
|
|
4133
|
-
if (!detail || typeof detail !== "object" || !("id" in detail) || typeof detail.id !== "string" || !("checked" in detail) || typeof detail.checked !== "boolean" || !this.capabilities.some((capability) => capability.id === detail.id))
|
|
4140
|
+
if (!detail || typeof detail !== "object" || !("id" in detail) || typeof detail.id !== "string" || !("checked" in detail) || typeof detail.checked !== "boolean" || !this.capabilities.some((capability) => capability.id === detail.id))
|
|
4141
|
+
return;
|
|
4134
4142
|
const next = new Set(this.selected);
|
|
4135
4143
|
if (detail.checked) next.add(detail.id);
|
|
4136
4144
|
else next.delete(detail.id);
|
|
@@ -4138,10 +4146,14 @@ var ConsentCapabilitiesScreen = class extends i4 {
|
|
|
4138
4146
|
};
|
|
4139
4147
|
this.onAllow = () => {
|
|
4140
4148
|
if (this.loading || this.approvalDisabled) return;
|
|
4141
|
-
const selectedCapabilities = this.capabilities.filter(
|
|
4149
|
+
const selectedCapabilities = this.capabilities.filter(
|
|
4150
|
+
(c4) => this.selected.has(c4.id)
|
|
4151
|
+
);
|
|
4142
4152
|
if (selectedCapabilities.length === 0) return;
|
|
4143
4153
|
const selectedIds = selectedCapabilities.map((c4) => c4.id);
|
|
4144
|
-
const selectedScopes = Array.from(
|
|
4154
|
+
const selectedScopes = Array.from(
|
|
4155
|
+
new Set(selectedCapabilities.flatMap((c4) => c4.scopes))
|
|
4156
|
+
);
|
|
4145
4157
|
const detail = {
|
|
4146
4158
|
selectedCapabilityIds: selectedIds,
|
|
4147
4159
|
selectedScopes
|
|
@@ -4190,7 +4202,9 @@ var ConsentCapabilitiesScreen = class extends i4 {
|
|
|
4190
4202
|
return `:host { ${themeToCssVariables(getConsentTheme(this.theme))} }`;
|
|
4191
4203
|
}
|
|
4192
4204
|
get approvalDisabled() {
|
|
4193
|
-
return this.disabled || this.allowDisabled || this.selected.size === 0 || this.requireAll && this.capabilities.some(
|
|
4205
|
+
return this.disabled || this.allowDisabled || this.selected.size === 0 || this.requireAll && this.capabilities.some(
|
|
4206
|
+
(capability) => !this.selected.has(capability.id)
|
|
4207
|
+
);
|
|
4194
4208
|
}
|
|
4195
4209
|
compileCapabilityCedar(capability) {
|
|
4196
4210
|
const cedar = capability.cedar?.trim() || "";
|
|
@@ -4199,7 +4213,10 @@ var ConsentCapabilitiesScreen = class extends i4 {
|
|
|
4199
4213
|
return cedar;
|
|
4200
4214
|
}
|
|
4201
4215
|
try {
|
|
4202
|
-
return compileSingleCapability(
|
|
4216
|
+
return compileSingleCapability(
|
|
4217
|
+
{ ...capability, cedar },
|
|
4218
|
+
this.cedarContext
|
|
4219
|
+
);
|
|
4203
4220
|
} catch {
|
|
4204
4221
|
return cedar;
|
|
4205
4222
|
}
|
|
@@ -4213,7 +4230,10 @@ var ConsentCapabilitiesScreen = class extends i4 {
|
|
|
4213
4230
|
Org: "@@ORG@@"
|
|
4214
4231
|
});
|
|
4215
4232
|
const escaped = escapeHtml(raw);
|
|
4216
|
-
const withSerifEntities = escaped.replace("@@AGENT@@", `<em>${escapeHtml(agentName)}</em>`).replace(
|
|
4233
|
+
const withSerifEntities = escaped.replace("@@AGENT@@", `<em>${escapeHtml(agentName)}</em>`).replace(
|
|
4234
|
+
"@@ORG@@",
|
|
4235
|
+
`<em>${escapeHtml(this.orgName || "this site")}</em>`
|
|
4236
|
+
);
|
|
4217
4237
|
return b2`<h1
|
|
4218
4238
|
class="headline"
|
|
4219
4239
|
part="headline"
|
|
@@ -4242,7 +4262,9 @@ var ConsentCapabilitiesScreen = class extends i4 {
|
|
|
4242
4262
|
logo-dev-token="${this.logoDevToken}"
|
|
4243
4263
|
></consent-connector-header>
|
|
4244
4264
|
<div class="card" part="card">
|
|
4245
|
-
<span class="eyebrow" part="eyebrow"
|
|
4265
|
+
<span class="eyebrow" part="eyebrow"
|
|
4266
|
+
>${tokens.eyebrow.permissionRequest}</span
|
|
4267
|
+
>
|
|
4246
4268
|
${this.renderHeadline()}
|
|
4247
4269
|
<p class="subhead" part="subhead">${subhead}</p>
|
|
4248
4270
|
<slot name="identity"></slot>
|
|
@@ -4255,6 +4277,7 @@ var ConsentCapabilitiesScreen = class extends i4 {
|
|
|
4255
4277
|
logoUrl="${this.agentMetadata.logoUrl || ""}"
|
|
4256
4278
|
connectedAt="${this.agentMetadata.connectedAt || ""}"
|
|
4257
4279
|
></consent-agent-header>` : A}
|
|
4280
|
+
<slot name="agent-key"></slot>
|
|
4258
4281
|
<div part="permissions">
|
|
4259
4282
|
<div class="section-header">
|
|
4260
4283
|
<span>${sectionHeader}</span>
|
|
@@ -4280,11 +4303,14 @@ var ConsentCapabilitiesScreen = class extends i4 {
|
|
|
4280
4303
|
</div>
|
|
4281
4304
|
<slot name="auth"></slot>
|
|
4282
4305
|
<slot name="details"></slot>
|
|
4283
|
-
<slot name="notice"
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4306
|
+
<slot name="notice"
|
|
4307
|
+
><consent-revocation-notice
|
|
4308
|
+
revocationPath="${this.revocationPath}"
|
|
4309
|
+
orgName="${this.orgName || "this site"}"
|
|
4310
|
+
inactivityDays=${this.inactivityDays}
|
|
4311
|
+
?fixed-expiry=${this.fixedExpiry}
|
|
4312
|
+
></consent-revocation-notice
|
|
4313
|
+
></slot>
|
|
4288
4314
|
<consent-action-bar
|
|
4289
4315
|
part="actions"
|
|
4290
4316
|
agentName="${agentName}"
|
|
@@ -4297,10 +4323,12 @@ var ConsentCapabilitiesScreen = class extends i4 {
|
|
|
4297
4323
|
@consent-allow=${this.onAllow}
|
|
4298
4324
|
@consent-deny=${this.onDeny}
|
|
4299
4325
|
></consent-action-bar>
|
|
4300
|
-
<slot name="footer"
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4326
|
+
<slot name="footer"
|
|
4327
|
+
><consent-footer
|
|
4328
|
+
theme="${this.theme}"
|
|
4329
|
+
howItWorksUrl="${this.howItWorksUrl}"
|
|
4330
|
+
></consent-footer
|
|
4331
|
+
></slot>
|
|
4304
4332
|
</div>
|
|
4305
4333
|
`;
|
|
4306
4334
|
}
|
|
@@ -4409,6 +4437,9 @@ __decorateClass([
|
|
|
4409
4437
|
__decorateClass([
|
|
4410
4438
|
n4({ type: Number })
|
|
4411
4439
|
], ConsentCapabilitiesScreen.prototype, "inactivityDays", 2);
|
|
4440
|
+
__decorateClass([
|
|
4441
|
+
n4({ type: Boolean, attribute: "fixed-expiry" })
|
|
4442
|
+
], ConsentCapabilitiesScreen.prototype, "fixedExpiry", 2);
|
|
4412
4443
|
__decorateClass([
|
|
4413
4444
|
n4({ type: String })
|
|
4414
4445
|
], ConsentCapabilitiesScreen.prototype, "theme", 2);
|
|
@@ -4805,6 +4836,7 @@ var McpConsent = class extends i4 {
|
|
|
4805
4836
|
this.scopes = [];
|
|
4806
4837
|
this.agentDid = "";
|
|
4807
4838
|
this.sessionId = "";
|
|
4839
|
+
this.anchorSid = "";
|
|
4808
4840
|
this.projectId = "";
|
|
4809
4841
|
this.serverUrl = "";
|
|
4810
4842
|
this.agentName = "";
|
|
@@ -4816,6 +4848,7 @@ var McpConsent = class extends i4 {
|
|
|
4816
4848
|
this.credentialUserEmail = "";
|
|
4817
4849
|
this.credentialProviderUserId = "";
|
|
4818
4850
|
this.oauthUrl = "";
|
|
4851
|
+
this.nativeScopeSelection = false;
|
|
4819
4852
|
this.capabilities = [];
|
|
4820
4853
|
this.orgName = "";
|
|
4821
4854
|
this.headlineVerb = "use";
|
|
@@ -5016,7 +5049,7 @@ var McpConsent = class extends i4 {
|
|
|
5016
5049
|
formData.append(
|
|
5017
5050
|
"scopes",
|
|
5018
5051
|
JSON.stringify(
|
|
5019
|
-
this.identityAssertion ? this.scopes : this.selectedScopes
|
|
5052
|
+
this.identityAssertion && !this.nativeScopeSelection ? this.scopes : this.selectedScopes
|
|
5020
5053
|
)
|
|
5021
5054
|
);
|
|
5022
5055
|
formData.append("agent_did", this.agentDid);
|
|
@@ -5024,6 +5057,7 @@ var McpConsent = class extends i4 {
|
|
|
5024
5057
|
formData.append("agent_name", this.agentName);
|
|
5025
5058
|
}
|
|
5026
5059
|
formData.append("session_id", this.sessionId);
|
|
5060
|
+
if (this.anchorSid) formData.append("sid", this.anchorSid);
|
|
5027
5061
|
formData.append("project_id", this.projectId);
|
|
5028
5062
|
formData.append("auth_mode", this.currentMode);
|
|
5029
5063
|
formData.append("provider_type", this.getProviderType());
|
|
@@ -5087,6 +5121,10 @@ var McpConsent = class extends i4 {
|
|
|
5087
5121
|
window.location.href = result.redirectUrl;
|
|
5088
5122
|
return;
|
|
5089
5123
|
}
|
|
5124
|
+
if (this.nativeScopeSelection) {
|
|
5125
|
+
const expiresAt = result.expires_at;
|
|
5126
|
+
this.issuedExpiresAt = Number.isSafeInteger(expiresAt) && expiresAt > 0 && Number.isFinite(new Date(expiresAt * 1e3).getTime()) ? expiresAt : void 0;
|
|
5127
|
+
}
|
|
5090
5128
|
this.step = "success";
|
|
5091
5129
|
this.dispatchEvent(
|
|
5092
5130
|
new CustomEvent("mcp-consent:approve", {
|
|
@@ -5153,6 +5191,16 @@ var McpConsent = class extends i4 {
|
|
|
5153
5191
|
);
|
|
5154
5192
|
}
|
|
5155
5193
|
// === RENDER METHODS ===
|
|
5194
|
+
renderNativeAgentKey() {
|
|
5195
|
+
if (!this.nativeScopeSelection || !this.agentDid) return A;
|
|
5196
|
+
return b2`
|
|
5197
|
+
<section class="agent-key" aria-label="Agent key">
|
|
5198
|
+
<p><strong>Agent key</strong></p>
|
|
5199
|
+
<p>This permission is bound to this key.</p>
|
|
5200
|
+
<code>${this.agentDid}</code>
|
|
5201
|
+
</section>
|
|
5202
|
+
`;
|
|
5203
|
+
}
|
|
5156
5204
|
renderAgentInfo() {
|
|
5157
5205
|
const agentDisplay = this.agentName || "this agent";
|
|
5158
5206
|
return b2`
|
|
@@ -5177,6 +5225,7 @@ var McpConsent = class extends i4 {
|
|
|
5177
5225
|
</p>
|
|
5178
5226
|
</div>
|
|
5179
5227
|
</div>
|
|
5228
|
+
${this.renderNativeAgentKey()}
|
|
5180
5229
|
`;
|
|
5181
5230
|
}
|
|
5182
5231
|
handlePermissionsChange(e8) {
|
|
@@ -5184,7 +5233,7 @@ var McpConsent = class extends i4 {
|
|
|
5184
5233
|
}
|
|
5185
5234
|
renderPermissions() {
|
|
5186
5235
|
if (this.scopes.length === 0) return A;
|
|
5187
|
-
const interactive = shouldRenderScopesInteractive(this.identityAssertion);
|
|
5236
|
+
const interactive = this.nativeScopeSelection || shouldRenderScopesInteractive(this.identityAssertion);
|
|
5188
5237
|
return b2`
|
|
5189
5238
|
<p class="permissions-header">
|
|
5190
5239
|
${this.resolved?.ui.permissionsHeader ?? "The agent is requesting the following permissions:"}
|
|
@@ -5200,6 +5249,7 @@ var McpConsent = class extends i4 {
|
|
|
5200
5249
|
`;
|
|
5201
5250
|
}
|
|
5202
5251
|
renderExpiration() {
|
|
5252
|
+
if (this.nativeScopeSelection) return A;
|
|
5203
5253
|
const days = this.resolved?.expirationDays ?? 7;
|
|
5204
5254
|
return b2`
|
|
5205
5255
|
<p class="expiration">
|
|
@@ -5474,6 +5524,31 @@ var McpConsent = class extends i4 {
|
|
|
5474
5524
|
year: "numeric"
|
|
5475
5525
|
});
|
|
5476
5526
|
}
|
|
5527
|
+
renderSuccessExpiry() {
|
|
5528
|
+
if (!this.nativeScopeSelection)
|
|
5529
|
+
return b2`<div class="credential-expiry">
|
|
5530
|
+
Expires ${this.formatExpiryDate()}
|
|
5531
|
+
</div>`;
|
|
5532
|
+
if (this.issuedExpiresAt === void 0)
|
|
5533
|
+
return b2`<div class="credential-expiry">
|
|
5534
|
+
Expiration time unavailable.
|
|
5535
|
+
</div>`;
|
|
5536
|
+
const expiry = new Date(this.issuedExpiresAt * 1e3);
|
|
5537
|
+
return b2`<div class="credential-expiry">
|
|
5538
|
+
Expires
|
|
5539
|
+
<time datetime=${expiry.toISOString()}
|
|
5540
|
+
>${expiry.toLocaleString("en-US", {
|
|
5541
|
+
month: "short",
|
|
5542
|
+
day: "numeric",
|
|
5543
|
+
year: "numeric",
|
|
5544
|
+
hour: "numeric",
|
|
5545
|
+
minute: "2-digit",
|
|
5546
|
+
second: "2-digit",
|
|
5547
|
+
timeZoneName: "short"
|
|
5548
|
+
})}</time
|
|
5549
|
+
>
|
|
5550
|
+
</div>`;
|
|
5551
|
+
}
|
|
5477
5552
|
/**
|
|
5478
5553
|
* Get the display name for the agent.
|
|
5479
5554
|
* Returns agent name if available, otherwise falls back to agent DID.
|
|
@@ -5484,7 +5559,6 @@ var McpConsent = class extends i4 {
|
|
|
5484
5559
|
renderSuccess() {
|
|
5485
5560
|
const success = this.resolved?.success;
|
|
5486
5561
|
const agentDisplay = this.getAgentDisplayName();
|
|
5487
|
-
const expiryDate = this.formatExpiryDate();
|
|
5488
5562
|
const displayScopes = this.selectedScopes.length > 0 ? this.selectedScopes : this.scopes;
|
|
5489
5563
|
return b2`
|
|
5490
5564
|
<div class="success-container">
|
|
@@ -5531,8 +5605,7 @@ var McpConsent = class extends i4 {
|
|
|
5531
5605
|
)}
|
|
5532
5606
|
</div>
|
|
5533
5607
|
` : A}
|
|
5534
|
-
|
|
5535
|
-
<div class="credential-expiry">Expires ${expiryDate}</div>
|
|
5608
|
+
${this.renderSuccessExpiry()}
|
|
5536
5609
|
|
|
5537
5610
|
<!-- Verified Badge -->
|
|
5538
5611
|
<div class="verified-badge">
|
|
@@ -5627,6 +5700,7 @@ var McpConsent = class extends i4 {
|
|
|
5627
5700
|
headlineVerb="${this.headlineVerb}"
|
|
5628
5701
|
revocationPath="${this.revocationPath}"
|
|
5629
5702
|
inactivityDays=${this.inactivityDays}
|
|
5703
|
+
?fixed-expiry=${this.nativeScopeSelection}
|
|
5630
5704
|
theme="${this.consentTheme}"
|
|
5631
5705
|
how-it-works-url="${this.howItWorksUrl}"
|
|
5632
5706
|
?loading=${this.loading}
|
|
@@ -5636,12 +5710,19 @@ var McpConsent = class extends i4 {
|
|
|
5636
5710
|
@capabilities-allow=${this.onCapabilitiesAllow}
|
|
5637
5711
|
@capabilities-deny=${this.handleDeny}
|
|
5638
5712
|
>
|
|
5639
|
-
${
|
|
5713
|
+
${this.nativeScopeSelection && this.agentDid ? b2`<div slot="agent-key">${this.renderNativeAgentKey()}</div>` : A}
|
|
5714
|
+
${allSelected ? b2`<div slot="auth">
|
|
5715
|
+
<p>
|
|
5716
|
+
This request grants every listed permission. Select all
|
|
5717
|
+
permissions or deny the request.
|
|
5718
|
+
</p>
|
|
5719
|
+
${credentials ? this.renderCredentialFields() : A}
|
|
5720
|
+
</div>` : A}
|
|
5640
5721
|
</consent-capabilities-screen>
|
|
5641
5722
|
`;
|
|
5642
5723
|
}
|
|
5643
5724
|
get requiresAllCapabilities() {
|
|
5644
|
-
return shouldSelectAllCapabilities(this.currentMode) || Boolean(this.identityAssertion);
|
|
5725
|
+
return shouldSelectAllCapabilities(this.currentMode) || !this.nativeScopeSelection && Boolean(this.identityAssertion);
|
|
5645
5726
|
}
|
|
5646
5727
|
};
|
|
5647
5728
|
McpConsent.styles = i`
|
|
@@ -5699,6 +5780,36 @@ McpConsent.styles = i`
|
|
|
5699
5780
|
color: #111827;
|
|
5700
5781
|
}
|
|
5701
5782
|
|
|
5783
|
+
.agent-key {
|
|
5784
|
+
min-width: 0;
|
|
5785
|
+
padding: 1rem;
|
|
5786
|
+
margin-bottom: 1rem;
|
|
5787
|
+
border: 1px solid var(--cs-surface-border, #e5e7eb);
|
|
5788
|
+
border-radius: 0.5rem;
|
|
5789
|
+
color: var(--cs-text-primary, #111827);
|
|
5790
|
+
font-size: 0.875rem;
|
|
5791
|
+
line-height: 1.5;
|
|
5792
|
+
}
|
|
5793
|
+
|
|
5794
|
+
.agent-key p {
|
|
5795
|
+
margin: 0 0 0.5rem;
|
|
5796
|
+
}
|
|
5797
|
+
|
|
5798
|
+
.agent-key code {
|
|
5799
|
+
display: block;
|
|
5800
|
+
white-space: normal;
|
|
5801
|
+
overflow-wrap: anywhere;
|
|
5802
|
+
font-size: 0.75rem;
|
|
5803
|
+
}
|
|
5804
|
+
|
|
5805
|
+
[slot="agent-key"] {
|
|
5806
|
+
min-width: 0;
|
|
5807
|
+
}
|
|
5808
|
+
|
|
5809
|
+
[slot="agent-key"] .agent-key {
|
|
5810
|
+
margin-bottom: 0;
|
|
5811
|
+
}
|
|
5812
|
+
|
|
5702
5813
|
/* Permissions section */
|
|
5703
5814
|
.permissions-header {
|
|
5704
5815
|
font-size: 0.875rem;
|
|
@@ -6050,6 +6161,9 @@ __decorateClass([
|
|
|
6050
6161
|
__decorateClass([
|
|
6051
6162
|
n4({ type: String, attribute: "session-id" })
|
|
6052
6163
|
], McpConsent.prototype, "sessionId", 2);
|
|
6164
|
+
__decorateClass([
|
|
6165
|
+
n4({ type: String, attribute: "anchor-sid" })
|
|
6166
|
+
], McpConsent.prototype, "anchorSid", 2);
|
|
6053
6167
|
__decorateClass([
|
|
6054
6168
|
n4({ type: String, attribute: "project-id" })
|
|
6055
6169
|
], McpConsent.prototype, "projectId", 2);
|
|
@@ -6086,6 +6200,9 @@ __decorateClass([
|
|
|
6086
6200
|
__decorateClass([
|
|
6087
6201
|
n4({ type: String, attribute: "oauth-url" })
|
|
6088
6202
|
], McpConsent.prototype, "oauthUrl", 2);
|
|
6203
|
+
__decorateClass([
|
|
6204
|
+
n4({ type: Boolean, attribute: "native-scope-selection" })
|
|
6205
|
+
], McpConsent.prototype, "nativeScopeSelection", 2);
|
|
6089
6206
|
__decorateClass([
|
|
6090
6207
|
n4({
|
|
6091
6208
|
type: Array,
|
|
@@ -6195,6 +6312,9 @@ __decorateClass([
|
|
|
6195
6312
|
__decorateClass([
|
|
6196
6313
|
r5()
|
|
6197
6314
|
], McpConsent.prototype, "step", 2);
|
|
6315
|
+
__decorateClass([
|
|
6316
|
+
r5()
|
|
6317
|
+
], McpConsent.prototype, "issuedExpiresAt", 2);
|
|
6198
6318
|
__decorateClass([
|
|
6199
6319
|
r5()
|
|
6200
6320
|
], McpConsent.prototype, "termsAccepted", 2);
|