multicorn-shield 0.11.0 → 0.13.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/CHANGELOG.md +39 -0
- package/dist/badge.js +4 -4
- package/dist/index.cjs +38 -19
- package/dist/index.d.cts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js +37 -20
- package/dist/multicorn-proxy.js +578 -15
- package/dist/openclaw-hook/handler.js +0 -1
- package/dist/openclaw-plugin/multicorn-shield.js +11 -17
- package/dist/openclaw-plugin/openclaw.plugin.json +3 -1
- package/dist/proxy.cjs +174 -0
- package/dist/proxy.d.cts +228 -1
- package/dist/proxy.d.ts +228 -1
- package/dist/proxy.js +174 -1
- package/dist/shield-extension.js +1 -4
- package/package.json +4 -2
- package/plugins/cline/README.md +61 -0
- package/plugins/cline/hooks/scripts/post-tool-use.cjs +116 -0
- package/plugins/cline/hooks/scripts/pre-tool-use.cjs +271 -0
- package/plugins/cline/hooks/scripts/shared.cjs +303 -0
- package/plugins/gemini-cli/hooks/scripts/after-tool.cjs +110 -0
- package/plugins/gemini-cli/hooks/scripts/before-tool.cjs +197 -0
- package/plugins/gemini-cli/hooks/scripts/shared.cjs +319 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,45 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Gemini CLI native plugin: BeforeTool/AfterTool hook scripts for full governance
|
|
13
|
+
- Gemini CLI hosted proxy support with httpUrl config field
|
|
14
|
+
- CLI wizard: Gemini CLI platform with native plugin and hosted proxy integration modes
|
|
15
|
+
- CLI wizard: platform prerequisite detection (warns if target platform is not installed)
|
|
16
|
+
|
|
17
|
+
## [X.Y.Z] - YYYY-MM-DD
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- Cline native plugin support via PreToolUse/PostToolUse hooks
|
|
22
|
+
- Hook scripts for Cline: pre-tool-use.cjs, post-tool-use.cjs, shared.cjs
|
|
23
|
+
- Cline plugin README with setup instructions and troubleshooting
|
|
24
|
+
- Browser auto-open for consent screen when Shield blocks an action
|
|
25
|
+
- Licence headers on all plugin scripts
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- CLI wizard installs Cline hooks to ~/Documents/Cline/Hooks/ (previously ~/Documents/Cline/Rules/Hooks/)
|
|
30
|
+
- Cline hook reads toolName field from hook input (Cline v3.81+ sends toolName, not tool)
|
|
31
|
+
- Consent flow no longer polls for approval (blocks immediately with consent URL to avoid Cline's 30-second hook timeout)
|
|
32
|
+
- Extracted shared utilities (config loading, HTTP, tool mapping) into shared.cjs to eliminate duplication between hooks
|
|
33
|
+
- Parameter metadata scrubbed before sending to Shield API (file contents redacted, commands truncated)
|
|
34
|
+
- HTTPS enforced for non-local Shield API connections
|
|
35
|
+
|
|
36
|
+
### Removed
|
|
37
|
+
|
|
38
|
+
- Polling-based consent approval flow (replaced with immediate block + consent URL)
|
|
39
|
+
- Consent marker filesystem state (no longer needed without polling)
|
|
40
|
+
|
|
41
|
+
### Security
|
|
42
|
+
|
|
43
|
+
- Fixed Windows shell injection in openBrowser (replaced execSync with execFileSync)
|
|
44
|
+
- Added HTTPS enforcement for non-localhost baseUrl in hook config
|
|
45
|
+
- Added parameter and result scrubbing to prevent sensitive data leakage in audit metadata
|
|
46
|
+
|
|
8
47
|
## [0.11.0] - 2026-04-25
|
|
9
48
|
|
|
10
49
|
### Added
|
package/dist/badge.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var n={surface:"#14141f",surfaceHover:"#1a1a2e",border:"#2a2a3d",text:"#e8e8f0",accent:"#8b5cf6",accentDim:"rgba(139, 92, 246, 0.12)"};var E="#0f172a",y="#f8fafc",
|
|
1
|
+
var n={surface:"#14141f",surfaceHover:"#1a1a2e",border:"#2a2a3d",text:"#e8e8f0",accent:"#8b5cf6",accentDim:"rgba(139, 92, 246, 0.12)"};var E="#0f172a",y="#f8fafc",L="#f1f5f9",A="#e2e8f0";function h(){return `
|
|
2
2
|
:host { display: inline-block; line-height: 0; }
|
|
3
3
|
.badge {
|
|
4
4
|
display: inline-flex;
|
|
@@ -19,7 +19,7 @@ var n={surface:"#14141f",surfaceHover:"#1a1a2e",border:"#2a2a3d",text:"#e8e8f0",
|
|
|
19
19
|
transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
|
|
20
20
|
}
|
|
21
21
|
:host([theme="light"]) .badge {
|
|
22
|
-
border-color: ${
|
|
22
|
+
border-color: ${A};
|
|
23
23
|
background: ${y};
|
|
24
24
|
color: ${E};
|
|
25
25
|
}
|
|
@@ -29,7 +29,7 @@ var n={surface:"#14141f",surfaceHover:"#1a1a2e",border:"#2a2a3d",text:"#e8e8f0",
|
|
|
29
29
|
box-shadow: 0 0 0 1px ${n.accentDim};
|
|
30
30
|
}
|
|
31
31
|
:host([theme="light"]) .badge:hover {
|
|
32
|
-
background: ${
|
|
32
|
+
background: ${L};
|
|
33
33
|
border-color: ${n.accent};
|
|
34
34
|
}
|
|
35
35
|
.badge:focus-visible {
|
|
@@ -41,4 +41,4 @@ var n={surface:"#14141f",surfaceHover:"#1a1a2e",border:"#2a2a3d",text:"#e8e8f0",
|
|
|
41
41
|
:host([size="compact"]) .text { display: none; }
|
|
42
42
|
:host([size="compact"]) .badge { padding: 4px 6px; }
|
|
43
43
|
@media (prefers-reduced-motion: reduce) { .badge { transition: none; } }
|
|
44
|
-
`.trim()}var
|
|
44
|
+
`.trim()}var T="https://multicorn.ai/verify/",x="multicorn-badge",v="M12 1L3 5v6c0 5.55 3.84 9.95 9 12 5.16-2.05 9-6.45 9-12V5l-9-4z",w=typeof HTMLElement<"u"?HTMLElement:class{connectedCallback(){}};function C(e){if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t}var m=class extends w{#e=false;ensureShadow(){return this.shadowRoot!=null?this.shadowRoot:this.attachShadow({mode:"open"})}static get observedAttributes(){return ["agent-id","size","theme","action-count"]}connectedCallback(){this.render();}attributeChangedCallback(){this.render();}render(){let t=this.ensureShadow();if(!this.#e){let g=document.createElement("style");g.textContent=h(),t.appendChild(g),this.#e=true;}let s=(this.getAttribute("agent-id")??"").trim(),c=C(this.getAttribute("action-count")),a=t.querySelector("a.badge");if(a&&a.remove(),s==="")return;let d,l;if(c==null)d="Secured by Multicorn",l="Secured by Multicorn, verify this agent";else {let f=String(c);d="Secured by Multicorn \xB7 "+f+" actions secured",l="Secured by Multicorn \xB7 "+f+" actions secured, verify this agent";}let S=`${T}${encodeURIComponent(s)}`,o=document.createElement("a");o.className="badge",o.href=S,o.target="_blank",o.rel="noopener noreferrer",o.setAttribute("aria-label",l);let p="http://www.w3.org/2000/svg",r=document.createElementNS(p,"svg");r.setAttribute("class","icon"),r.setAttribute("width","16"),r.setAttribute("height","16"),r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("aria-hidden","true");let u=document.createElementNS(p,"path");u.setAttribute("d",v),u.setAttribute("fill",n.accent),r.appendChild(u),o.appendChild(r);let b=document.createElement("span");b.className="text",b.textContent=d,o.appendChild(b),t.appendChild(o);}};typeof customElements<"u"&&customElements.get(x)===void 0&&customElements.define(x,m);function H(e){return e==="compact"||e==="standard"}function M(e){return e==="dark"||e==="light"}var i=(typeof document<"u"&&document.currentScript!==null?document.currentScript:null)??null;if(i==null)console.warn("[Multicorn] badge.js must be loaded as a classic script (document.currentScript was null).");else {let e=i.dataset.agentId?.trim();if(e==null||e==="")console.warn("[Multicorn] Skipping trust badge: missing data-agent-id on the badge script tag.");else {let t=document.createElement("multicorn-badge");t.setAttribute("agent-id",e);let s=i.dataset.size;H(s)&&t.setAttribute("size",s);let c=i.dataset.theme;M(c)&&t.setAttribute("theme",c);let a=i.dataset.actionCount;a!=null&&a!==""&&t.setAttribute("action-count",a),i.parentNode?.insertBefore(t,i.nextSibling);}}
|
package/dist/index.cjs
CHANGED
|
@@ -4,17 +4,28 @@ var lit = require('lit');
|
|
|
4
4
|
var decorators_js = require('lit/decorators.js');
|
|
5
5
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
7
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
7
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
9
|
-
var result =
|
|
8
|
+
var result = void 0 ;
|
|
10
9
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
11
10
|
if (decorator = decorators[i])
|
|
12
|
-
result = (
|
|
13
|
-
if (
|
|
11
|
+
result = (decorator(target, key, result) ) || result;
|
|
12
|
+
if (result) __defProp(target, key, result);
|
|
14
13
|
return result;
|
|
15
14
|
};
|
|
16
15
|
|
|
17
16
|
// src/types/index.ts
|
|
17
|
+
var AGENT_PLATFORM_SLUGS = [
|
|
18
|
+
"openclaw",
|
|
19
|
+
"claude-code",
|
|
20
|
+
"claude-desktop",
|
|
21
|
+
"cursor",
|
|
22
|
+
"windsurf",
|
|
23
|
+
"cline",
|
|
24
|
+
"gemini-cli",
|
|
25
|
+
"other-mcp",
|
|
26
|
+
"github-actions",
|
|
27
|
+
"unknown"
|
|
28
|
+
];
|
|
18
29
|
var AGENT_STATUSES = {
|
|
19
30
|
Active: "active",
|
|
20
31
|
Paused: "paused",
|
|
@@ -1128,7 +1139,7 @@ function groupScopesByService(scopes) {
|
|
|
1128
1139
|
function scopeKey(scope) {
|
|
1129
1140
|
return `${scope.service}:${scope.permissionLevel}`;
|
|
1130
1141
|
}
|
|
1131
|
-
|
|
1142
|
+
var MulticornConsent = class extends lit.LitElement {
|
|
1132
1143
|
constructor() {
|
|
1133
1144
|
super(...arguments);
|
|
1134
1145
|
this.agentName = "";
|
|
@@ -1201,6 +1212,9 @@ exports.MulticornConsent = class MulticornConsent extends lit.LitElement {
|
|
|
1201
1212
|
}
|
|
1202
1213
|
};
|
|
1203
1214
|
}
|
|
1215
|
+
static {
|
|
1216
|
+
this.styles = [consentStyles];
|
|
1217
|
+
}
|
|
1204
1218
|
connectedCallback() {
|
|
1205
1219
|
super.connectedCallback();
|
|
1206
1220
|
if (Array.isArray(this.scopes) && this.scopes.length > 0) {
|
|
@@ -1574,34 +1588,33 @@ exports.MulticornConsent = class MulticornConsent extends lit.LitElement {
|
|
|
1574
1588
|
this.requestUpdate();
|
|
1575
1589
|
}
|
|
1576
1590
|
};
|
|
1577
|
-
exports.MulticornConsent.styles = [consentStyles];
|
|
1578
1591
|
__decorateClass([
|
|
1579
1592
|
decorators_js.property({ type: String, attribute: "agent-name" })
|
|
1580
|
-
],
|
|
1593
|
+
], MulticornConsent.prototype, "agentName");
|
|
1581
1594
|
__decorateClass([
|
|
1582
1595
|
decorators_js.property({ type: String, attribute: "agent-color" })
|
|
1583
|
-
],
|
|
1596
|
+
], MulticornConsent.prototype, "agentColor");
|
|
1584
1597
|
__decorateClass([
|
|
1585
1598
|
decorators_js.property({ type: Array, attribute: "scopes" })
|
|
1586
|
-
],
|
|
1599
|
+
], MulticornConsent.prototype, "scopes");
|
|
1587
1600
|
__decorateClass([
|
|
1588
1601
|
decorators_js.property({ type: Number, attribute: "spend-limit" })
|
|
1589
|
-
],
|
|
1602
|
+
], MulticornConsent.prototype, "spendLimit");
|
|
1590
1603
|
__decorateClass([
|
|
1591
1604
|
decorators_js.property({ type: String })
|
|
1592
|
-
],
|
|
1605
|
+
], MulticornConsent.prototype, "mode");
|
|
1593
1606
|
__decorateClass([
|
|
1594
1607
|
decorators_js.state()
|
|
1595
|
-
],
|
|
1608
|
+
], MulticornConsent.prototype, "_grantedScopes");
|
|
1596
1609
|
__decorateClass([
|
|
1597
1610
|
decorators_js.state()
|
|
1598
|
-
],
|
|
1611
|
+
], MulticornConsent.prototype, "_adjustedSpendLimit");
|
|
1599
1612
|
__decorateClass([
|
|
1600
1613
|
decorators_js.state()
|
|
1601
|
-
],
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1614
|
+
], MulticornConsent.prototype, "_isOpen");
|
|
1615
|
+
if (typeof customElements !== "undefined" && customElements.get(CONSENT_ELEMENT_TAG) === void 0) {
|
|
1616
|
+
customElements.define(CONSENT_ELEMENT_TAG, MulticornConsent);
|
|
1617
|
+
}
|
|
1605
1618
|
|
|
1606
1619
|
// src/badge/badge-styles.ts
|
|
1607
1620
|
var LIGHT_TEXT = "#0f172a";
|
|
@@ -1659,6 +1672,10 @@ function getBadgeStyleText() {
|
|
|
1659
1672
|
var VERIFY_BASE = "https://multicorn.ai/verify/";
|
|
1660
1673
|
var BADGE_ELEMENT_TAG = "multicorn-badge";
|
|
1661
1674
|
var SHIELD_PATH = "M12 1L3 5v6c0 5.55 3.84 9.95 9 12 5.16-2.05 9-6.45 9-12V5l-9-4z";
|
|
1675
|
+
var SafeHTMLElement = typeof HTMLElement !== "undefined" ? HTMLElement : class {
|
|
1676
|
+
connectedCallback() {
|
|
1677
|
+
}
|
|
1678
|
+
};
|
|
1662
1679
|
function parseOptionalCount(raw) {
|
|
1663
1680
|
if (raw == null || raw === "") {
|
|
1664
1681
|
return void 0;
|
|
@@ -1666,7 +1683,7 @@ function parseOptionalCount(raw) {
|
|
|
1666
1683
|
const n = Number(raw);
|
|
1667
1684
|
return Number.isNaN(n) ? void 0 : n;
|
|
1668
1685
|
}
|
|
1669
|
-
var MulticornBadge = class extends
|
|
1686
|
+
var MulticornBadge = class extends SafeHTMLElement {
|
|
1670
1687
|
#didInjectStyle = false;
|
|
1671
1688
|
ensureShadow() {
|
|
1672
1689
|
if (this.shadowRoot != null) {
|
|
@@ -1737,7 +1754,7 @@ var MulticornBadge = class extends HTMLElement {
|
|
|
1737
1754
|
root.appendChild(a);
|
|
1738
1755
|
}
|
|
1739
1756
|
};
|
|
1740
|
-
if (customElements.get(BADGE_ELEMENT_TAG) === void 0) {
|
|
1757
|
+
if (typeof customElements !== "undefined" && customElements.get(BADGE_ELEMENT_TAG) === void 0) {
|
|
1741
1758
|
customElements.define(BADGE_ELEMENT_TAG, MulticornBadge);
|
|
1742
1759
|
}
|
|
1743
1760
|
|
|
@@ -2888,10 +2905,12 @@ function validateApiKey(apiKey) {
|
|
|
2888
2905
|
}
|
|
2889
2906
|
|
|
2890
2907
|
exports.ACTION_STATUSES = ACTION_STATUSES;
|
|
2908
|
+
exports.AGENT_PLATFORM_SLUGS = AGENT_PLATFORM_SLUGS;
|
|
2891
2909
|
exports.AGENT_STATUSES = AGENT_STATUSES;
|
|
2892
2910
|
exports.BUILT_IN_SERVICES = BUILT_IN_SERVICES;
|
|
2893
2911
|
exports.CONSENT_ELEMENT_TAG = CONSENT_ELEMENT_TAG;
|
|
2894
2912
|
exports.MulticornBadge = MulticornBadge;
|
|
2913
|
+
exports.MulticornConsent = MulticornConsent;
|
|
2895
2914
|
exports.MulticornShield = MulticornShield;
|
|
2896
2915
|
exports.PERMISSION_LEVELS = PERMISSION_LEVELS;
|
|
2897
2916
|
exports.SERVICE_NAME_PATTERN = SERVICE_NAME_PATTERN;
|
package/dist/index.d.cts
CHANGED
|
@@ -9,6 +9,11 @@ import { LitElement, PropertyValues, HTMLTemplateResult } from 'lit';
|
|
|
9
9
|
*
|
|
10
10
|
* @module types
|
|
11
11
|
*/
|
|
12
|
+
/**
|
|
13
|
+
* Agent client platforms supported by hosted proxy and native hooks (aligned with API validation).
|
|
14
|
+
*/
|
|
15
|
+
declare const AGENT_PLATFORM_SLUGS: readonly ["openclaw", "claude-code", "claude-desktop", "cursor", "windsurf", "cline", "gemini-cli", "other-mcp", "github-actions", "unknown"];
|
|
16
|
+
type AgentPlatformSlug = (typeof AGENT_PLATFORM_SLUGS)[number];
|
|
12
17
|
/**
|
|
13
18
|
* Possible operational states for an agent.
|
|
14
19
|
*
|
|
@@ -1078,7 +1083,11 @@ declare function createFocusTrap(container: HTMLElement, initialFocus?: HTMLElem
|
|
|
1078
1083
|
*/
|
|
1079
1084
|
/** Custom element tag for the trust badge. */
|
|
1080
1085
|
declare const BADGE_ELEMENT_TAG: "multicorn-badge";
|
|
1081
|
-
declare
|
|
1086
|
+
declare const SafeHTMLElement: {
|
|
1087
|
+
new (): HTMLElement;
|
|
1088
|
+
prototype: HTMLElement;
|
|
1089
|
+
};
|
|
1090
|
+
declare class MulticornBadge extends SafeHTMLElement {
|
|
1082
1091
|
#private;
|
|
1083
1092
|
private ensureShadow;
|
|
1084
1093
|
static get observedAttributes(): string[];
|
|
@@ -2306,4 +2315,4 @@ interface ContentReviewRequestPayload {
|
|
|
2306
2315
|
*/
|
|
2307
2316
|
declare function requestContentReview(payload: ContentReviewRequestPayload, apiKey: string, baseUrl: string, logger?: PluginLogger): Promise<ContentReviewResult>;
|
|
2308
2317
|
|
|
2309
|
-
export { ACTION_STATUSES, AGENT_STATUSES, type Action, type ActionInput, type ActionLogger, type ActionLoggerConfig, type ActionPayload, type ActionStatus, type Agent, type AgentStatus, type ApiError, BUILT_IN_SERVICES, type BatchModeConfig, type BuiltInServiceName, CONSENT_ELEMENT_TAG, type ConsentDecision, type ConsentDeniedEventDetail, type ConsentEventDetail, type ConsentEventMap, type ConsentEventName, type ConsentGrantedEventDetail, type ConsentOptions, type ConsentPartialEventDetail, type ContentReviewRequestPayload, type ContentReviewResult, type ContentReviewStatusResponse, type FocusTrap, type McpAdapter, type McpAdapterConfig, type McpAdapterResult, type McpBlockedResult, type McpToolCall, type McpToolHandler, type McpToolResult, MulticornBadge, MulticornConsent, MulticornShield, type MulticornShieldConfig, PERMISSION_LEVELS, type Permission, type PermissionLevel, type RemainingBudget, SERVICE_NAME_PATTERN, type Scope, ScopeParseError, type ScopeParseResult, type ScopeRegistry, type ScopeRequest, type ServiceDefinition, type SpendCheckResult, type SpendingCheckResult, type SpendingChecker, type SpendingLimit, type SpendingLimits, type SpendingTrackerConfig, type ValidationResult, centsToDollars, createActionLogger, createFocusTrap, createMcpAdapter, createScopeRegistry, createSpendingChecker, dollarsToCents, formatScope, getPermissionLabel, getScopeLabel, getScopeShortLabel, getServiceDisplayName, getServiceIcon, hasScope, isBlockedResult, isPublicContentAction, isValidScopeString, parseScope, parseScopes, requestContentReview, requiresContentReview, tryParseScope, validateAllScopesAccess, validateScopeAccess };
|
|
2318
|
+
export { ACTION_STATUSES, AGENT_PLATFORM_SLUGS, AGENT_STATUSES, type Action, type ActionInput, type ActionLogger, type ActionLoggerConfig, type ActionPayload, type ActionStatus, type Agent, type AgentPlatformSlug, type AgentStatus, type ApiError, BUILT_IN_SERVICES, type BatchModeConfig, type BuiltInServiceName, CONSENT_ELEMENT_TAG, type ConsentDecision, type ConsentDeniedEventDetail, type ConsentEventDetail, type ConsentEventMap, type ConsentEventName, type ConsentGrantedEventDetail, type ConsentOptions, type ConsentPartialEventDetail, type ContentReviewRequestPayload, type ContentReviewResult, type ContentReviewStatusResponse, type FocusTrap, type McpAdapter, type McpAdapterConfig, type McpAdapterResult, type McpBlockedResult, type McpToolCall, type McpToolHandler, type McpToolResult, MulticornBadge, MulticornConsent, MulticornShield, type MulticornShieldConfig, PERMISSION_LEVELS, type Permission, type PermissionLevel, type RemainingBudget, SERVICE_NAME_PATTERN, type Scope, ScopeParseError, type ScopeParseResult, type ScopeRegistry, type ScopeRequest, type ServiceDefinition, type SpendCheckResult, type SpendingCheckResult, type SpendingChecker, type SpendingLimit, type SpendingLimits, type SpendingTrackerConfig, type ValidationResult, centsToDollars, createActionLogger, createFocusTrap, createMcpAdapter, createScopeRegistry, createSpendingChecker, dollarsToCents, formatScope, getPermissionLabel, getScopeLabel, getScopeShortLabel, getServiceDisplayName, getServiceIcon, hasScope, isBlockedResult, isPublicContentAction, isValidScopeString, parseScope, parseScopes, requestContentReview, requiresContentReview, tryParseScope, validateAllScopesAccess, validateScopeAccess };
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,11 @@ import { LitElement, PropertyValues, HTMLTemplateResult } from 'lit';
|
|
|
9
9
|
*
|
|
10
10
|
* @module types
|
|
11
11
|
*/
|
|
12
|
+
/**
|
|
13
|
+
* Agent client platforms supported by hosted proxy and native hooks (aligned with API validation).
|
|
14
|
+
*/
|
|
15
|
+
declare const AGENT_PLATFORM_SLUGS: readonly ["openclaw", "claude-code", "claude-desktop", "cursor", "windsurf", "cline", "gemini-cli", "other-mcp", "github-actions", "unknown"];
|
|
16
|
+
type AgentPlatformSlug = (typeof AGENT_PLATFORM_SLUGS)[number];
|
|
12
17
|
/**
|
|
13
18
|
* Possible operational states for an agent.
|
|
14
19
|
*
|
|
@@ -1078,7 +1083,11 @@ declare function createFocusTrap(container: HTMLElement, initialFocus?: HTMLElem
|
|
|
1078
1083
|
*/
|
|
1079
1084
|
/** Custom element tag for the trust badge. */
|
|
1080
1085
|
declare const BADGE_ELEMENT_TAG: "multicorn-badge";
|
|
1081
|
-
declare
|
|
1086
|
+
declare const SafeHTMLElement: {
|
|
1087
|
+
new (): HTMLElement;
|
|
1088
|
+
prototype: HTMLElement;
|
|
1089
|
+
};
|
|
1090
|
+
declare class MulticornBadge extends SafeHTMLElement {
|
|
1082
1091
|
#private;
|
|
1083
1092
|
private ensureShadow;
|
|
1084
1093
|
static get observedAttributes(): string[];
|
|
@@ -2306,4 +2315,4 @@ interface ContentReviewRequestPayload {
|
|
|
2306
2315
|
*/
|
|
2307
2316
|
declare function requestContentReview(payload: ContentReviewRequestPayload, apiKey: string, baseUrl: string, logger?: PluginLogger): Promise<ContentReviewResult>;
|
|
2308
2317
|
|
|
2309
|
-
export { ACTION_STATUSES, AGENT_STATUSES, type Action, type ActionInput, type ActionLogger, type ActionLoggerConfig, type ActionPayload, type ActionStatus, type Agent, type AgentStatus, type ApiError, BUILT_IN_SERVICES, type BatchModeConfig, type BuiltInServiceName, CONSENT_ELEMENT_TAG, type ConsentDecision, type ConsentDeniedEventDetail, type ConsentEventDetail, type ConsentEventMap, type ConsentEventName, type ConsentGrantedEventDetail, type ConsentOptions, type ConsentPartialEventDetail, type ContentReviewRequestPayload, type ContentReviewResult, type ContentReviewStatusResponse, type FocusTrap, type McpAdapter, type McpAdapterConfig, type McpAdapterResult, type McpBlockedResult, type McpToolCall, type McpToolHandler, type McpToolResult, MulticornBadge, MulticornConsent, MulticornShield, type MulticornShieldConfig, PERMISSION_LEVELS, type Permission, type PermissionLevel, type RemainingBudget, SERVICE_NAME_PATTERN, type Scope, ScopeParseError, type ScopeParseResult, type ScopeRegistry, type ScopeRequest, type ServiceDefinition, type SpendCheckResult, type SpendingCheckResult, type SpendingChecker, type SpendingLimit, type SpendingLimits, type SpendingTrackerConfig, type ValidationResult, centsToDollars, createActionLogger, createFocusTrap, createMcpAdapter, createScopeRegistry, createSpendingChecker, dollarsToCents, formatScope, getPermissionLabel, getScopeLabel, getScopeShortLabel, getServiceDisplayName, getServiceIcon, hasScope, isBlockedResult, isPublicContentAction, isValidScopeString, parseScope, parseScopes, requestContentReview, requiresContentReview, tryParseScope, validateAllScopesAccess, validateScopeAccess };
|
|
2318
|
+
export { ACTION_STATUSES, AGENT_PLATFORM_SLUGS, AGENT_STATUSES, type Action, type ActionInput, type ActionLogger, type ActionLoggerConfig, type ActionPayload, type ActionStatus, type Agent, type AgentPlatformSlug, type AgentStatus, type ApiError, BUILT_IN_SERVICES, type BatchModeConfig, type BuiltInServiceName, CONSENT_ELEMENT_TAG, type ConsentDecision, type ConsentDeniedEventDetail, type ConsentEventDetail, type ConsentEventMap, type ConsentEventName, type ConsentGrantedEventDetail, type ConsentOptions, type ConsentPartialEventDetail, type ContentReviewRequestPayload, type ContentReviewResult, type ContentReviewStatusResponse, type FocusTrap, type McpAdapter, type McpAdapterConfig, type McpAdapterResult, type McpBlockedResult, type McpToolCall, type McpToolHandler, type McpToolResult, MulticornBadge, MulticornConsent, MulticornShield, type MulticornShieldConfig, PERMISSION_LEVELS, type Permission, type PermissionLevel, type RemainingBudget, SERVICE_NAME_PATTERN, type Scope, ScopeParseError, type ScopeParseResult, type ScopeRegistry, type ScopeRequest, type ServiceDefinition, type SpendCheckResult, type SpendingCheckResult, type SpendingChecker, type SpendingLimit, type SpendingLimits, type SpendingTrackerConfig, type ValidationResult, centsToDollars, createActionLogger, createFocusTrap, createMcpAdapter, createScopeRegistry, createSpendingChecker, dollarsToCents, formatScope, getPermissionLabel, getScopeLabel, getScopeShortLabel, getServiceDisplayName, getServiceIcon, hasScope, isBlockedResult, isPublicContentAction, isValidScopeString, parseScope, parseScopes, requestContentReview, requiresContentReview, tryParseScope, validateAllScopesAccess, validateScopeAccess };
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
import { unsafeCSS, css, LitElement, html } from 'lit';
|
|
2
|
-
import { property, state
|
|
2
|
+
import { property, state } from 'lit/decorators.js';
|
|
3
3
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
5
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
7
|
-
var result =
|
|
6
|
+
var result = void 0 ;
|
|
8
7
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9
8
|
if (decorator = decorators[i])
|
|
10
|
-
result = (
|
|
11
|
-
if (
|
|
9
|
+
result = (decorator(target, key, result) ) || result;
|
|
10
|
+
if (result) __defProp(target, key, result);
|
|
12
11
|
return result;
|
|
13
12
|
};
|
|
14
13
|
|
|
15
14
|
// src/types/index.ts
|
|
15
|
+
var AGENT_PLATFORM_SLUGS = [
|
|
16
|
+
"openclaw",
|
|
17
|
+
"claude-code",
|
|
18
|
+
"claude-desktop",
|
|
19
|
+
"cursor",
|
|
20
|
+
"windsurf",
|
|
21
|
+
"cline",
|
|
22
|
+
"gemini-cli",
|
|
23
|
+
"other-mcp",
|
|
24
|
+
"github-actions",
|
|
25
|
+
"unknown"
|
|
26
|
+
];
|
|
16
27
|
var AGENT_STATUSES = {
|
|
17
28
|
Active: "active",
|
|
18
29
|
Paused: "paused",
|
|
@@ -1199,6 +1210,9 @@ var MulticornConsent = class extends LitElement {
|
|
|
1199
1210
|
}
|
|
1200
1211
|
};
|
|
1201
1212
|
}
|
|
1213
|
+
static {
|
|
1214
|
+
this.styles = [consentStyles];
|
|
1215
|
+
}
|
|
1202
1216
|
connectedCallback() {
|
|
1203
1217
|
super.connectedCallback();
|
|
1204
1218
|
if (Array.isArray(this.scopes) && this.scopes.length > 0) {
|
|
@@ -1572,34 +1586,33 @@ var MulticornConsent = class extends LitElement {
|
|
|
1572
1586
|
this.requestUpdate();
|
|
1573
1587
|
}
|
|
1574
1588
|
};
|
|
1575
|
-
MulticornConsent.styles = [consentStyles];
|
|
1576
1589
|
__decorateClass([
|
|
1577
1590
|
property({ type: String, attribute: "agent-name" })
|
|
1578
|
-
], MulticornConsent.prototype, "agentName"
|
|
1591
|
+
], MulticornConsent.prototype, "agentName");
|
|
1579
1592
|
__decorateClass([
|
|
1580
1593
|
property({ type: String, attribute: "agent-color" })
|
|
1581
|
-
], MulticornConsent.prototype, "agentColor"
|
|
1594
|
+
], MulticornConsent.prototype, "agentColor");
|
|
1582
1595
|
__decorateClass([
|
|
1583
1596
|
property({ type: Array, attribute: "scopes" })
|
|
1584
|
-
], MulticornConsent.prototype, "scopes"
|
|
1597
|
+
], MulticornConsent.prototype, "scopes");
|
|
1585
1598
|
__decorateClass([
|
|
1586
1599
|
property({ type: Number, attribute: "spend-limit" })
|
|
1587
|
-
], MulticornConsent.prototype, "spendLimit"
|
|
1600
|
+
], MulticornConsent.prototype, "spendLimit");
|
|
1588
1601
|
__decorateClass([
|
|
1589
1602
|
property({ type: String })
|
|
1590
|
-
], MulticornConsent.prototype, "mode"
|
|
1603
|
+
], MulticornConsent.prototype, "mode");
|
|
1591
1604
|
__decorateClass([
|
|
1592
1605
|
state()
|
|
1593
|
-
], MulticornConsent.prototype, "_grantedScopes"
|
|
1606
|
+
], MulticornConsent.prototype, "_grantedScopes");
|
|
1594
1607
|
__decorateClass([
|
|
1595
1608
|
state()
|
|
1596
|
-
], MulticornConsent.prototype, "_adjustedSpendLimit"
|
|
1609
|
+
], MulticornConsent.prototype, "_adjustedSpendLimit");
|
|
1597
1610
|
__decorateClass([
|
|
1598
1611
|
state()
|
|
1599
|
-
], MulticornConsent.prototype, "_isOpen"
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1612
|
+
], MulticornConsent.prototype, "_isOpen");
|
|
1613
|
+
if (typeof customElements !== "undefined" && customElements.get(CONSENT_ELEMENT_TAG) === void 0) {
|
|
1614
|
+
customElements.define(CONSENT_ELEMENT_TAG, MulticornConsent);
|
|
1615
|
+
}
|
|
1603
1616
|
|
|
1604
1617
|
// src/badge/badge-styles.ts
|
|
1605
1618
|
var LIGHT_TEXT = "#0f172a";
|
|
@@ -1657,6 +1670,10 @@ function getBadgeStyleText() {
|
|
|
1657
1670
|
var VERIFY_BASE = "https://multicorn.ai/verify/";
|
|
1658
1671
|
var BADGE_ELEMENT_TAG = "multicorn-badge";
|
|
1659
1672
|
var SHIELD_PATH = "M12 1L3 5v6c0 5.55 3.84 9.95 9 12 5.16-2.05 9-6.45 9-12V5l-9-4z";
|
|
1673
|
+
var SafeHTMLElement = typeof HTMLElement !== "undefined" ? HTMLElement : class {
|
|
1674
|
+
connectedCallback() {
|
|
1675
|
+
}
|
|
1676
|
+
};
|
|
1660
1677
|
function parseOptionalCount(raw) {
|
|
1661
1678
|
if (raw == null || raw === "") {
|
|
1662
1679
|
return void 0;
|
|
@@ -1664,7 +1681,7 @@ function parseOptionalCount(raw) {
|
|
|
1664
1681
|
const n = Number(raw);
|
|
1665
1682
|
return Number.isNaN(n) ? void 0 : n;
|
|
1666
1683
|
}
|
|
1667
|
-
var MulticornBadge = class extends
|
|
1684
|
+
var MulticornBadge = class extends SafeHTMLElement {
|
|
1668
1685
|
#didInjectStyle = false;
|
|
1669
1686
|
ensureShadow() {
|
|
1670
1687
|
if (this.shadowRoot != null) {
|
|
@@ -1735,7 +1752,7 @@ var MulticornBadge = class extends HTMLElement {
|
|
|
1735
1752
|
root.appendChild(a);
|
|
1736
1753
|
}
|
|
1737
1754
|
};
|
|
1738
|
-
if (customElements.get(BADGE_ELEMENT_TAG) === void 0) {
|
|
1755
|
+
if (typeof customElements !== "undefined" && customElements.get(BADGE_ELEMENT_TAG) === void 0) {
|
|
1739
1756
|
customElements.define(BADGE_ELEMENT_TAG, MulticornBadge);
|
|
1740
1757
|
}
|
|
1741
1758
|
|
|
@@ -2885,4 +2902,4 @@ function validateApiKey(apiKey) {
|
|
|
2885
2902
|
}
|
|
2886
2903
|
}
|
|
2887
2904
|
|
|
2888
|
-
export { ACTION_STATUSES, AGENT_STATUSES, BUILT_IN_SERVICES, CONSENT_ELEMENT_TAG, MulticornBadge, MulticornConsent, MulticornShield, PERMISSION_LEVELS, SERVICE_NAME_PATTERN, ScopeParseError, centsToDollars, createActionLogger, createFocusTrap, createMcpAdapter, createScopeRegistry, createSpendingChecker, dollarsToCents, formatScope, getPermissionLabel, getScopeLabel, getScopeShortLabel, getServiceDisplayName, getServiceIcon, hasScope, isBlockedResult, isPublicContentAction, isValidScopeString, parseScope, parseScopes, requestContentReview, requiresContentReview, tryParseScope, validateAllScopesAccess, validateScopeAccess };
|
|
2905
|
+
export { ACTION_STATUSES, AGENT_PLATFORM_SLUGS, AGENT_STATUSES, BUILT_IN_SERVICES, CONSENT_ELEMENT_TAG, MulticornBadge, MulticornConsent, MulticornShield, PERMISSION_LEVELS, SERVICE_NAME_PATTERN, ScopeParseError, centsToDollars, createActionLogger, createFocusTrap, createMcpAdapter, createScopeRegistry, createSpendingChecker, dollarsToCents, formatScope, getPermissionLabel, getScopeLabel, getScopeShortLabel, getServiceDisplayName, getServiceIcon, hasScope, isBlockedResult, isPublicContentAction, isValidScopeString, parseScope, parseScopes, requestContentReview, requiresContentReview, tryParseScope, validateAllScopesAccess, validateScopeAccess };
|