multicorn-shield 1.9.5 → 1.10.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 +11 -0
- package/README.md +87 -523
- package/dist/index.cjs +21 -20
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -1
- package/dist/multicorn-proxy.js +17 -6
- package/dist/multicorn-shield.js +15 -5
- package/dist/shield-extension.js +1 -1
- package/package.json +37 -22
- package/plugins/cline/hooks/scripts/post-tool-use.cjs +0 -0
- package/plugins/cline/hooks/scripts/pre-tool-use.cjs +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
- Bump `version` in `package.json` before publishing to npm.
|
|
11
11
|
|
|
12
|
+
## [1.10.0] - 2026-06-09
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Cline hosted proxy auth now uses `?key=` URL query parameter instead of static `Authorization` header, matching the pattern used by Cursor and other platforms
|
|
17
|
+
- Claude Desktop added to URL-key hosted proxy platforms
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Consent screen CSS import changed from `lit` to `@lit/reactive-element/css-tag.js` for compatibility with downstream bundlers
|
|
22
|
+
|
|
12
23
|
## [1.9.5] - 2026-05-13
|
|
13
24
|
|
|
14
25
|
### Fixed
|
package/README.md
CHANGED
|
@@ -1,158 +1,84 @@
|
|
|
1
|
-

|
|
2
|
-
|
|
3
1
|
# Multicorn Shield
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
Most AI coding agents inherit direct access to MCP tools, terminals, mail, and spend with no enforced guardrails, and Shield inserts consent workflows, budgets, policy checks, and tamper-evident logging before governed calls execute.
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
- **Permission enforcement** - Policy checks on scoped access so agents can't wander past what you granted.
|
|
6
|
+
- **Consent flows** - Human-in-the-loop approval when the model asks for new or risky actions.
|
|
7
|
+
- **Audit trails** - Structured activity logs with append-only hashing so history is harder to forge.
|
|
8
|
+
- **Spending controls** - Per-session and rolling limits aligned with budgets you set on the dashboard.
|
|
9
|
+
- **Anomaly detection** - Surfaces spikes and outliers in agent behaviour before they become incidents.
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
[](https://www.npmjs.com/package/multicorn-shield)
|
|
12
|
+
[](LICENSE)
|
|
13
|
+
[](https://github.com/Multicorn-AI/multicorn-shield/actions/workflows/ci.yml)
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
16
16
|
<img src="https://multicorn.ai/images/demo.gif" alt="Multicorn Shield demo: agent blocked, user approves in dashboard, agent proceeds" width="800" />
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
## Quick Start
|
|
24
|
-
|
|
25
|
-
### Option 1: Wrap your existing agents (no code changes)
|
|
26
|
-
|
|
27
|
-
Already using an MCP server with Claude Code, OpenClaw, or another agent? Add Shield as a proxy in front of it. No code changes required: the proxy intercepts every tool call, enforces permissions, and logs activity to your dashboard.
|
|
28
|
-
|
|
29
|
-
**Step 1: Install**
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm install -g multicorn-shield
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
**Step 2: Set up your API key**
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npx multicorn-shield init
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
The init wizard supports multiple agents. Run it again to add agents on different platforms (OpenClaw, Claude Code, Cursor) without losing existing config. Use `npx multicorn-shield agents` to see configured agents.
|
|
42
|
-
|
|
43
|
-
**Step 3: Wrap your MCP server**
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npx multicorn-shield --wrap <your-mcp-server>
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
For example, to wrap the MCP filesystem server:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
npx multicorn-shield --wrap npx @modelcontextprotocol/server-filesystem /tmp
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
That's it. Every tool call now goes through Shield's permission layer, and activity appears in your [Multicorn dashboard](https://app.multicorn.ai) in real time.
|
|
56
|
-
|
|
57
|
-
See the [full MCP proxy guide](https://multicorn.ai/docs/mcp-proxy) for Claude Code, OpenClaw, and generic MCP client examples.
|
|
58
|
-
|
|
59
|
-
### Claude Desktop Extension (.mcpb)
|
|
60
|
-
|
|
61
|
-
Install Shield without the terminal: download the `.mcpb` bundle (or use **Install** from the Shield product page), open it in Claude Desktop, and enter your API key when prompted. The extension reads your existing MCP servers from `claude_desktop_config.json`, runs them as child processes, merges their tools, and checks every `tools/call` with the Shield API. Activity still shows up in your [Multicorn dashboard](https://app.multicorn.ai).
|
|
62
|
-
|
|
63
|
-
**Disable or uninstall recovery:** On each start the extension saves a copy of your `mcpServers` block to `~/.multicorn/extension-backup.json` with restricted file permissions (owner read/write only). If you turn the extension off and need your original Claude Desktop MCP entries back, run:
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
npx multicorn-shield restore
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Then restart Claude Desktop. That overwrites `mcpServers` in your config with the last backup.
|
|
70
|
-
|
|
71
|
-
**Duplicate tool names:** If two MCP servers expose the same tool name, the first server in your config file keeps the name. The duplicate is skipped and a warning is written to the extension logs (stderr). Rename tools on the server side if you need both.
|
|
19
|
+
<p align="center">
|
|
20
|
+
<img src="https://multicorn.ai/images/screenshots/consent-screen.png" alt="Consent screen where users grant agent permissions" width="800" />
|
|
21
|
+
</p>
|
|
72
22
|
|
|
73
|
-
|
|
23
|
+
## Supported agents
|
|
74
24
|
|
|
75
|
-
|
|
76
|
-
pnpm run pack:extension
|
|
77
|
-
```
|
|
25
|
+
`npx multicorn-shield init` recognises every platform listed here (same registry as [`INIT_WIZARD_PLATFORM_REGISTRY`](https://github.com/Multicorn-AI/multicorn-shield/blob/main/src/proxy/config.ts) in source). Integration mode follows the [**Shield threat model**](https://multicorn.ai/shield/threat-model): **native plugins** inspect the whole tool surface exposed by the host; **hosted MCP proxy** governs MCP-shaped traffic routed through Shield.
|
|
78
26
|
|
|
79
|
-
|
|
27
|
+
| Agent | Mode | Setup on multicorn.ai |
|
|
28
|
+
| ------------------------------- | ------------------------------------------------ | --------------------------------------------------------------------- |
|
|
29
|
+
| [OpenClaw](https://openclaw.ai) | Native plugin | [Setup guide](https://multicorn.ai/docs/mcp-proxy#openclaw) |
|
|
30
|
+
| Claude Code | Native plugin | [Setup guide](https://multicorn.ai/docs/mcp-proxy#claude-code) |
|
|
31
|
+
| Windsurf | Native Cascade hooks (hosted MCP proxy optional) | [Setup guide](https://multicorn.ai/docs/mcp-proxy#quick-start) |
|
|
32
|
+
| Cline | Native hooks | [Setup guide](https://multicorn.ai/docs/mcp-proxy#quick-start) |
|
|
33
|
+
| Gemini CLI | Native hooks | [Setup guide](https://multicorn.ai/docs/mcp-proxy#quick-start) |
|
|
34
|
+
| OpenCode | Native plugin | [Setup guide](https://multicorn.ai/docs/mcp-proxy#quick-start) |
|
|
35
|
+
| Codex CLI | Native hooks | [Setup guide](https://multicorn.ai/docs/mcp-proxy#quick-start) |
|
|
36
|
+
| Cursor | Hosted MCP proxy | [Setup guide](https://multicorn.ai/docs/mcp-proxy#generic-mcp-client) |
|
|
37
|
+
| Claude Desktop | Hosted MCP proxy or `.mcpb` extension | [Setup guide](https://multicorn.ai/shield) |
|
|
38
|
+
| GitHub Copilot | Hosted MCP proxy | [Setup guide](https://multicorn.ai/docs/mcp-proxy#generic-mcp-client) |
|
|
39
|
+
| Kilo Code | Hosted MCP proxy | [Setup guide](https://multicorn.ai/docs/mcp-proxy#generic-mcp-client) |
|
|
40
|
+
| Continue | Hosted MCP proxy | [Setup guide](https://multicorn.ai/docs/mcp-proxy#generic-mcp-client) |
|
|
41
|
+
| Goose | Hosted MCP proxy | [Setup guide](https://multicorn.ai/docs/mcp-proxy#generic-mcp-client) |
|
|
80
42
|
|
|
81
|
-
|
|
43
|
+
For any other MCP client on stdio, pick **Local MCP / Other** in the wizard or open the [Setup guide](https://multicorn.ai/docs/mcp-proxy#generic-mcp-client).
|
|
82
44
|
|
|
83
|
-
|
|
45
|
+
## Quick start
|
|
84
46
|
|
|
85
|
-
|
|
47
|
+
Fastest path to a governed proxy ([full walkthrough](https://multicorn.ai/docs/mcp-proxy)):
|
|
86
48
|
|
|
87
49
|
```bash
|
|
88
50
|
npm install -g multicorn-shield
|
|
89
51
|
npx multicorn-shield init
|
|
90
52
|
```
|
|
91
53
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
**Step 2: Build the plugin**
|
|
54
|
+
The wizard prompts for your API key (`mcs_…` from [app.multicorn.ai](https://app.multicorn.ai)) and merges platform-specific snippets into the right config paths. Run it again any time you add another host agent. Inspect saved agents with:
|
|
95
55
|
|
|
96
56
|
```bash
|
|
97
|
-
|
|
98
|
-
npm run build
|
|
57
|
+
npx multicorn-shield agents
|
|
99
58
|
```
|
|
100
59
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
Add the plugin path to your `~/.openclaw/openclaw.json`:
|
|
104
|
-
|
|
105
|
-
```json
|
|
106
|
-
{
|
|
107
|
-
"plugins": {
|
|
108
|
-
"load": {
|
|
109
|
-
"paths": ["<npm-root>/multicorn-shield/dist/openclaw-plugin/index.js"]
|
|
110
|
-
},
|
|
111
|
-
"entries": {
|
|
112
|
-
"multicorn-shield": {
|
|
113
|
-
"enabled": true
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
Replace `<npm-root>` with the output of `npm root -g`.
|
|
121
|
-
|
|
122
|
-
**Step 4: Restart and verify**
|
|
60
|
+
After init, wrap your MCP server when you launch it:
|
|
123
61
|
|
|
124
62
|
```bash
|
|
125
|
-
|
|
126
|
-
openclaw plugins list
|
|
63
|
+
npx multicorn-shield --wrap <your-existing-mcp-command>
|
|
127
64
|
```
|
|
128
65
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
**How it works**
|
|
66
|
+
Shield bundles an OpenClaw plugin under `dist/openclaw-plugin/` if you prefer native interception over wrapping the MCP process. Claude Desktop users can sidestep manual JSON editing with the downloadable `.mcpb` bundle from [multicorn.ai/shield](https://multicorn.ai/shield). Need the SDK directly? Jump to **[SDK snippet](#sdk-snippet)** and the [getting started tutorial](https://multicorn.ai/docs/getting-started).
|
|
132
67
|
|
|
133
|
-
|
|
134
|
-
2. Shield intercepts via `before_tool_call` and checks permissions
|
|
135
|
-
3. First time: A consent screen opens in your browser so you can authorize the agent
|
|
136
|
-
4. Authorized actions: Proceed immediately
|
|
137
|
-
5. New or elevated actions: Blocked with a link to the dashboard where you approve or reject
|
|
138
|
-
6. Everything is logged to your Multicorn dashboard
|
|
68
|
+
## Links
|
|
139
69
|
|
|
140
|
-
|
|
70
|
+
| Resource | URL |
|
|
71
|
+
| -------------- | ------------------------------------------------ |
|
|
72
|
+
| Docs hub | https://multicorn.ai/shield |
|
|
73
|
+
| Product docs | https://multicorn.ai/docs/getting-started |
|
|
74
|
+
| Live dashboard | https://app.multicorn.ai |
|
|
75
|
+
| Source | https://github.com/Multicorn-AI/multicorn-shield |
|
|
141
76
|
|
|
142
|
-
|
|
143
|
-
| ------------------- | ---------------- |
|
|
144
|
-
| read | filesystem:read |
|
|
145
|
-
| write, edit | filesystem:write |
|
|
146
|
-
| exec | terminal:execute |
|
|
147
|
-
| exec (rm, mv, sudo) | terminal:write |
|
|
148
|
-
| browser | browser:execute |
|
|
149
|
-
| message | messaging:write |
|
|
77
|
+
Changelog: [CHANGELOG.md](CHANGELOG.md) · Contributing: [CONTRIBUTING.md](CONTRIBUTING.md) · Security: [SECURITY.md](SECURITY.md)
|
|
150
78
|
|
|
151
|
-
|
|
79
|
+
## SDK snippet
|
|
152
80
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
For full control over consent screens, spending limits, and action logging, use the SDK directly in your application code.
|
|
81
|
+
Install as a dependency when you embed consent screens or bespoke logging paths:
|
|
156
82
|
|
|
157
83
|
```bash
|
|
158
84
|
npm install multicorn-shield
|
|
@@ -177,355 +103,44 @@ await shield.logAction({
|
|
|
177
103
|
});
|
|
178
104
|
```
|
|
179
105
|
|
|
180
|
-
That gives you a consent screen, scoped permissions, and an audit trail.
|
|
181
|
-
|
|
182
|
-
## Dashboard
|
|
183
|
-
|
|
184
|
-
Every action, approval, and permission is visible in real time at [app.multicorn.ai](https://app.multicorn.ai).
|
|
185
|
-
|
|
186
|
-
**Sign up:** [https://app.multicorn.ai](https://app.multicorn.ai)
|
|
187
|
-
|
|
188
|
-
With the dashboard you can:
|
|
189
|
-
|
|
190
|
-
- See all agents and their activity
|
|
191
|
-
- Approve or reject pending actions
|
|
192
|
-
- Configure per-agent permissions (read/write/execute per service)
|
|
193
|
-
- Set spending limits
|
|
194
|
-
- View the full audit trail with hash-chain integrity
|
|
195
|
-
|
|
196
|
-
The dashboard works with both the SDK integration and the MCP proxy. No extra setup needed.
|
|
197
|
-
|
|
198
|
-
<p align="center">
|
|
199
|
-
<img src="https://multicorn.ai/images/og-image-shield.png" alt="Dashboard overview showing total actions, blocked count, spend, and live activity feed" width="800" />
|
|
200
|
-
</p>
|
|
201
|
-
|
|
202
|
-
<p align="center">
|
|
203
|
-
<img src="https://multicorn.ai/images/screenshots/approvals-card.png" alt="Approval card with one-tap approve/reject and permission duration options" width="800" />
|
|
204
|
-
</p>
|
|
205
|
-
|
|
206
|
-
<p align="center">
|
|
207
|
-
<img src="https://multicorn.ai/images/screenshots/activity-log-list.png" alt="Filterable activity log showing every agent action with status" width="800" />
|
|
208
|
-
</p>
|
|
209
|
-
|
|
210
|
-
<p align="center">
|
|
211
|
-
<img src="https://multicorn.ai/images/screenshots/consent-screen.png" alt="Consent screen where users grant agent permissions" width="800" />
|
|
212
|
-
</p>
|
|
213
|
-
|
|
214
|
-
<p align="center">
|
|
215
|
-
<img src="https://multicorn.ai/images/screenshots/agent-page-with-stats.png" alt="Agent detail page with action stats and budget tracking" width="800" />
|
|
216
|
-
</p>
|
|
217
|
-
|
|
218
|
-
## Built with Shield
|
|
219
|
-
|
|
220
|
-
Multicorn is developed using AI coding agents. Primarily Cursor for code generation and GitHub Actions as the deployment agent. Every one of those agents runs under Shield.
|
|
221
|
-
|
|
222
|
-
We're not just building a trust layer for AI agents. We're depending on it ourselves. If Shield fails to catch something in our own workflow, we feel it directly.
|
|
223
|
-
|
|
224
|
-
[Read how we use agents to build Multicorn →](https://multicorn.ai/blog/agents)
|
|
225
|
-
|
|
226
|
-
## Features
|
|
227
|
-
|
|
228
|
-
### Consent Screens
|
|
229
|
-
|
|
230
|
-
A drop-in web component (Shadow DOM, framework-agnostic) that lets users review and approve agent permissions before granting access.
|
|
231
|
-
|
|
232
|
-
```typescript
|
|
233
|
-
const decision = await shield.requestConsent({
|
|
234
|
-
agent: "OpenClaw",
|
|
235
|
-
scopes: ["read:gmail", "write:calendar", "execute:payments"],
|
|
236
|
-
spendLimit: 500,
|
|
237
|
-
agentColor: "#8b5cf6",
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
// decision.grantedScopes - what the user actually approved
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
### Scopes
|
|
244
|
-
|
|
245
|
-
Type-safe permission scopes with built-in services (Gmail, Calendar, Slack, Drive, Payments, GitHub, Jira) and a registry for custom ones.
|
|
246
|
-
|
|
247
|
-
```typescript
|
|
248
|
-
import { createScopeRegistry, parseScope } from "multicorn-shield";
|
|
249
|
-
|
|
250
|
-
const registry = createScopeRegistry();
|
|
251
|
-
|
|
252
|
-
registry.register({
|
|
253
|
-
name: "analytics",
|
|
254
|
-
description: "Internal analytics platform",
|
|
255
|
-
capabilities: ["read", "write"],
|
|
256
|
-
});
|
|
257
|
-
|
|
258
|
-
const scope = parseScope("read:analytics");
|
|
259
|
-
// { service: "analytics", permissionLevel: "read" }
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
### Action Logging
|
|
263
|
-
|
|
264
|
-
Structured audit trail of every action an agent takes. Supports immediate and batched delivery.
|
|
265
|
-
|
|
266
|
-
```typescript
|
|
267
|
-
await shield.logAction({
|
|
268
|
-
agent: "OpenClaw",
|
|
269
|
-
service: "gmail",
|
|
270
|
-
action: "send_email",
|
|
271
|
-
status: "approved",
|
|
272
|
-
cost: 0.002,
|
|
273
|
-
metadata: { recipient: "user@example.com" },
|
|
274
|
-
});
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
### Spending Controls
|
|
278
|
-
|
|
279
|
-
Client-side enforcement of per-transaction, daily, and monthly spend limits. Currency-safe integer arithmetic (cents) prevents floating point issues.
|
|
280
|
-
|
|
281
|
-
```typescript
|
|
282
|
-
const result = shield.checkSpending("OpenClaw", 849);
|
|
283
|
-
|
|
284
|
-
if (!result.allowed) {
|
|
285
|
-
// "Action blocked: $849.00 exceeds per-transaction limit of $200.00"
|
|
286
|
-
console.error(result.reason);
|
|
287
|
-
}
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
### MCP Integration
|
|
291
|
-
|
|
292
|
-
Middleware adapter for Model Context Protocol servers. Sits between the agent and MCP tools, enforcing permissions on every tool call.
|
|
293
|
-
|
|
294
|
-
```typescript
|
|
295
|
-
import { createMcpAdapter, isBlockedResult } from "multicorn-shield";
|
|
296
|
-
|
|
297
|
-
const adapter = createMcpAdapter({
|
|
298
|
-
agentId: "inbox-assistant",
|
|
299
|
-
grantedScopes: [
|
|
300
|
-
{ service: "gmail", permissionLevel: "execute" },
|
|
301
|
-
{ service: "calendar", permissionLevel: "read" },
|
|
302
|
-
],
|
|
303
|
-
logger,
|
|
304
|
-
});
|
|
305
|
-
|
|
306
|
-
const result = await adapter.intercept(
|
|
307
|
-
{ toolName: "gmail_send_email", arguments: { to: "user@example.com" } },
|
|
308
|
-
(call) => mcpServer.callTool(call.toolName, call.arguments),
|
|
309
|
-
);
|
|
310
|
-
|
|
311
|
-
if (isBlockedResult(result)) {
|
|
312
|
-
console.error(result.reason);
|
|
313
|
-
}
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
## API Reference
|
|
317
|
-
|
|
318
|
-
Full API documentation is generated from source with TypeDoc:
|
|
319
|
-
|
|
320
|
-
```bash
|
|
321
|
-
pnpm run docs
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
This outputs to `docs/api/`. You can also browse the inline JSDoc on every public export. All interfaces, functions, and types are documented with examples.
|
|
325
|
-
|
|
326
|
-
## Architecture
|
|
327
|
-
|
|
328
|
-
Multicorn Shield is the client-side SDK in the Multicorn ecosystem. It runs in the browser or Node.js and communicates with the Multicorn hosted API for persistence and policy enforcement.
|
|
329
|
-
|
|
330
|
-
```
|
|
331
|
-
┌─────────────────────────────────────────────────────┐
|
|
332
|
-
│ Your Application │
|
|
333
|
-
│ │
|
|
334
|
-
│ ┌──────────────────────────────────────────────┐ │
|
|
335
|
-
│ │ multicorn-shield (this SDK) │ │
|
|
336
|
-
│ │ │ │
|
|
337
|
-
│ │ ┌────────────┐ ┌──────────┐ ┌──────────┐ │ │
|
|
338
|
-
│ │ │ Consent │ │ Action │ │ Spending │ │ │
|
|
339
|
-
│ │ │ Screen │ │ Logger │ │ Checker │ │ │
|
|
340
|
-
│ │ └────────────┘ └────┬─────┘ └──────────┘ │ │
|
|
341
|
-
│ │ ┌────────────┐ │ │ │
|
|
342
|
-
│ │ │ MCP │ │ │ │
|
|
343
|
-
│ │ │ Adapter │ │ │ │
|
|
344
|
-
│ │ └────────────┘ │ │ │
|
|
345
|
-
│ └───────────────────────┼──────────────────────┘ │
|
|
346
|
-
│ │ HTTPS │
|
|
347
|
-
└──────────────────────────┼──────────────────────────┘
|
|
348
|
-
│
|
|
349
|
-
▼
|
|
350
|
-
┌────────────────────────┐
|
|
351
|
-
│ Multicorn Service API │
|
|
352
|
-
│ (hosted backend) │
|
|
353
|
-
└────────────┬───────────┘
|
|
354
|
-
│
|
|
355
|
-
▼
|
|
356
|
-
┌────────────────────────┐
|
|
357
|
-
│ Multicorn Dashboard │
|
|
358
|
-
│ (admin UI) │
|
|
359
|
-
└────────────────────────┘
|
|
360
|
-
```
|
|
361
|
-
|
|
362
|
-
The SDK handles:
|
|
363
|
-
|
|
364
|
-
- **Consent**: renders a Shadow DOM web component for permission approval
|
|
365
|
-
- **Scope validation**: parses and validates `"permission:service"` scope strings locally
|
|
366
|
-
- **Action logging**: sends structured events to the hosted API over HTTPS
|
|
367
|
-
- **Spending checks**: client-side pre-validation (server is the source of truth)
|
|
368
|
-
- **MCP adapter**: middleware layer between AI agents and MCP tool servers
|
|
369
|
-
|
|
370
|
-
The hosted API handles persistence, policy enforcement, and the audit trail. The SDK never stores credentials locally. API keys are held in memory only.
|
|
371
|
-
|
|
372
106
|
## Configuration
|
|
373
107
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
| Option | Type | Default | Description |
|
|
377
|
-
| ----------- | ----------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
378
|
-
| `apiKey` | `string` | - | **Required.** Your Multicorn API key. Must start with `mcs_` and be at least 16 characters. Stored in memory only. |
|
|
379
|
-
| `baseUrl` | `string` | `"https://api.multicorn.ai"` | Base URL for the Multicorn API. |
|
|
380
|
-
| `timeout` | `number` | `5000` | Request timeout in milliseconds. |
|
|
381
|
-
| `batchMode` | `BatchModeConfig` | - | Optional batch mode for action logging. When enabled, actions are queued and flushed periodically. |
|
|
382
|
-
|
|
383
|
-
### `BatchModeConfig`
|
|
384
|
-
|
|
385
|
-
| Option | Type | Default | Description |
|
|
386
|
-
| ----------------- | --------- | ------- | ----------------------------------------- |
|
|
387
|
-
| `enabled` | `boolean` | - | Whether batch mode is active. |
|
|
388
|
-
| `maxSize` | `number` | `10` | Maximum actions to queue before flushing. |
|
|
389
|
-
| `flushIntervalMs` | `number` | `5000` | Maximum time (ms) between flushes. |
|
|
390
|
-
|
|
391
|
-
### `ConsentOptions`
|
|
392
|
-
|
|
393
|
-
| Option | Type | Default | Description |
|
|
394
|
-
| ------------ | ---------- | ----------- | ------------------------------------------------------------------------------- |
|
|
395
|
-
| `agent` | `string` | - | **Required.** Name of the agent requesting access. Shown on the consent screen. |
|
|
396
|
-
| `scopes` | `string[]` | - | **Required.** Permission scopes to request. Format: `"permission:service"`. |
|
|
397
|
-
| `spendLimit` | `number` | `0` | Maximum spend per transaction in dollars. `0` disables spending controls. |
|
|
398
|
-
| `agentColor` | `string` | `"#8b5cf6"` | Hex colour for the agent icon on the consent screen. |
|
|
399
|
-
|
|
400
|
-
### `McpAdapterConfig`
|
|
401
|
-
|
|
402
|
-
| Option | Type | Default | Description |
|
|
403
|
-
| ------------------------- | ------------------------------ | ------------------ | --------------------------------------------------------------------------- |
|
|
404
|
-
| `agentId` | `string` | - | **Required.** Agent identifier for audit logging. |
|
|
405
|
-
| `grantedScopes` | `Scope[]` | - | **Required.** Scopes granted via the consent screen. |
|
|
406
|
-
| `logger` | `ActionLogger` | - | Optional logger instance. When omitted, actions are checked but not logged. |
|
|
407
|
-
| `requiredPermissionLevel` | `PermissionLevel` | `"execute"` | Permission level required for MCP tool calls. |
|
|
408
|
-
| `extractService` | `(toolName: string) => string` | Split on first `_` | Custom function to derive the service name from a tool name. |
|
|
409
|
-
| `extractAction` | `(toolName: string) => string` | Split on first `_` | Custom function to derive the action type from a tool name. |
|
|
410
|
-
|
|
411
|
-
## Framework Examples
|
|
108
|
+
The hosted **[getting started guide](https://multicorn.ai/docs/getting-started)** spells out CLI quick starts and SDK bootstrap defaults. MCP adapter knobs, consent payloads, CLI flags for the proxy wrapper, spending helpers, and every public export are covered by TypeDoc emitted with `pnpm docs` into **`docs/api/`**.
|
|
412
109
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
### React
|
|
416
|
-
|
|
417
|
-
```tsx
|
|
418
|
-
import { useEffect, useRef } from "react";
|
|
419
|
-
import { MulticornShield } from "multicorn-shield";
|
|
110
|
+
## Architecture
|
|
420
111
|
|
|
421
|
-
function AgentSetup() {
|
|
422
|
-
const shieldRef = useRef<MulticornShield | null>(null);
|
|
423
|
-
|
|
424
|
-
useEffect(() => {
|
|
425
|
-
shieldRef.current = new MulticornShield({ apiKey: "mcs_your_key_here" });
|
|
426
|
-
return () => shieldRef.current?.destroy();
|
|
427
|
-
}, []);
|
|
428
|
-
|
|
429
|
-
async function handleConnect() {
|
|
430
|
-
const decision = await shieldRef.current?.requestConsent({
|
|
431
|
-
agent: "OpenClaw",
|
|
432
|
-
scopes: ["read:gmail", "write:calendar"],
|
|
433
|
-
spendLimit: 200,
|
|
434
|
-
});
|
|
435
|
-
console.log("Granted:", decision?.grantedScopes);
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
return <button onClick={handleConnect}>Connect Agent</button>;
|
|
439
|
-
}
|
|
440
112
|
```
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
const shield = ref<MulticornShield | null>(null);
|
|
450
|
-
|
|
451
|
-
onMounted(() => {
|
|
452
|
-
shield.value = new MulticornShield({ apiKey: "mcs_your_key_here" });
|
|
453
|
-
});
|
|
454
|
-
|
|
455
|
-
onUnmounted(() => shield.value?.destroy());
|
|
456
|
-
|
|
457
|
-
async function handleConnect() {
|
|
458
|
-
const decision = await shield.value?.requestConsent({
|
|
459
|
-
agent: "OpenClaw",
|
|
460
|
-
scopes: ["read:gmail", "write:calendar"],
|
|
461
|
-
spendLimit: 200,
|
|
462
|
-
});
|
|
463
|
-
console.log("Granted:", decision?.grantedScopes);
|
|
464
|
-
}
|
|
465
|
-
</script>
|
|
466
|
-
|
|
467
|
-
<template>
|
|
468
|
-
<button @click="handleConnect">Connect Agent</button>
|
|
469
|
-
</template>
|
|
113
|
+
Your agent / Browser
|
|
114
|
+
│
|
|
115
|
+
▼
|
|
116
|
+
multicorn-shield SDK · CLI · local proxy shim
|
|
117
|
+
│
|
|
118
|
+
HTTPS (see Network behaviour below)
|
|
119
|
+
▼
|
|
120
|
+
Multicorn hosted API -> Dashboard UI
|
|
470
121
|
```
|
|
471
122
|
|
|
472
|
-
|
|
123
|
+
For module-level internals (consent renderer, MCP adapter, spending checker, proxies), regenerate TypeDoc locally (`pnpm docs`) and skim `docs/adr/`.
|
|
473
124
|
|
|
474
|
-
|
|
475
|
-
<script lang="ts">
|
|
476
|
-
import { onMount, onDestroy } from "svelte";
|
|
477
|
-
import { MulticornShield } from "multicorn-shield";
|
|
125
|
+
The SDK validates scopes client-side before calling hosted persistence. MCP proxy setups add localhost-only IPC (`127.0.0.1`) between wrapper and MCP child.
|
|
478
126
|
|
|
479
|
-
|
|
127
|
+
See **[Network behaviour](#network-behaviour)** for reachable hosts.
|
|
480
128
|
|
|
481
|
-
|
|
482
|
-
shield = new MulticornShield({ apiKey: "mcs_your_key_here" });
|
|
483
|
-
});
|
|
484
|
-
|
|
485
|
-
onDestroy(() => shield?.destroy());
|
|
486
|
-
|
|
487
|
-
async function handleConnect() {
|
|
488
|
-
const decision = await shield.requestConsent({
|
|
489
|
-
agent: "OpenClaw",
|
|
490
|
-
scopes: ["read:gmail", "write:calendar"],
|
|
491
|
-
spendLimit: 200,
|
|
492
|
-
});
|
|
493
|
-
console.log("Granted:", decision.grantedScopes);
|
|
494
|
-
}
|
|
495
|
-
</script>
|
|
496
|
-
|
|
497
|
-
<button on:click={handleConnect}>Connect Agent</button>
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
### Vanilla HTML
|
|
129
|
+
## Network behaviour
|
|
501
130
|
|
|
502
|
-
|
|
503
|
-
|
|
131
|
+
- **`api.multicorn.ai`:** Consent workflows, approvals, auditing, spends. Calls happen only while your code or CLI path runs Shield. There is no import-time network activity.
|
|
132
|
+
- **`localhost`:** Proxy-local IPC during stdio MCP wrapping. Traffic never leaves the machine.
|
|
133
|
+
- **CLI config:** The wizard writes your API key into `~/.multicorn/config.json` on disk. The in-app SDK keeps keys in memory unless you persist them yourself.
|
|
504
134
|
|
|
505
|
-
|
|
506
|
-
import { MulticornShield } from "multicorn-shield";
|
|
135
|
+
No third-party telemetry.
|
|
507
136
|
|
|
508
|
-
|
|
137
|
+
## Dashboard
|
|
509
138
|
|
|
510
|
-
|
|
511
|
-
const decision = await shield.requestConsent({
|
|
512
|
-
agent: "OpenClaw",
|
|
513
|
-
scopes: ["read:gmail", "write:calendar"],
|
|
514
|
-
spendLimit: 200,
|
|
515
|
-
});
|
|
516
|
-
console.log("Granted:", decision.grantedScopes);
|
|
517
|
-
});
|
|
518
|
-
</script>
|
|
519
|
-
```
|
|
139
|
+
Approve, reject, revoke, tune budgets, and watch live traffic at [app.multicorn.ai](https://app.multicorn.ai). Works for both MCP proxy setups and bespoke SDK integrations.
|
|
520
140
|
|
|
521
141
|
## Development
|
|
522
142
|
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
- Node.js 20+
|
|
526
|
-
- pnpm 9+
|
|
527
|
-
|
|
528
|
-
### Setup
|
|
143
|
+
Requires Node.js 20+ and pnpm 9+.
|
|
529
144
|
|
|
530
145
|
```bash
|
|
531
146
|
git clone https://github.com/Multicorn-AI/multicorn-shield.git
|
|
@@ -535,87 +150,36 @@ pnpm test
|
|
|
535
150
|
pnpm build
|
|
536
151
|
```
|
|
537
152
|
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
|
541
|
-
|
|
|
542
|
-
| `pnpm
|
|
543
|
-
| `pnpm
|
|
544
|
-
| `pnpm
|
|
545
|
-
| `pnpm
|
|
546
|
-
| `pnpm
|
|
547
|
-
| `pnpm
|
|
548
|
-
| `pnpm test:coverage` | Run tests with Istanbul coverage reporting |
|
|
549
|
-
| `pnpm typecheck` | Type-check without emitting |
|
|
550
|
-
| `pnpm docs` | Generate API docs with TypeDoc |
|
|
153
|
+
| Script | Meaning |
|
|
154
|
+
| -------------------- | ------------------------------------ |
|
|
155
|
+
| `pnpm build` | Produce ESM+CJS bundles with tsup |
|
|
156
|
+
| `pnpm dev` | tsup watch mode |
|
|
157
|
+
| `pnpm lint` | ESLint + Prettier |
|
|
158
|
+
| `pnpm lint:fix` | ESLint autofix plus Prettier write |
|
|
159
|
+
| `pnpm test` | Vitest unit suite |
|
|
160
|
+
| `pnpm test:coverage` | Vitest plus Istanbul instrumentation |
|
|
161
|
+
| `pnpm typecheck` | `tsc --noEmit` |
|
|
162
|
+
| `pnpm docs` | Typedoc emission into `docs/api/` |
|
|
551
163
|
|
|
552
|
-
|
|
164
|
+
Detailed notes live in **`src/`** headers and **`docs/adr/`**.
|
|
553
165
|
|
|
554
166
|
```
|
|
555
167
|
multicorn-shield/
|
|
556
|
-
├── src/
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
│ │ ├── consent-events.ts # Custom event types and dispatchers
|
|
562
|
-
│ │ ├── consent-styles.ts # Scoped styles (no CSS leakage)
|
|
563
|
-
│ │ ├── focus-trap.ts # Keyboard focus management
|
|
564
|
-
│ │ └── scope-labels.ts # Human-readable scope display names
|
|
565
|
-
│ ├── scopes/ # Scope types, parsing, and validation
|
|
566
|
-
│ │ ├── scope-definitions.ts # Built-in service registry
|
|
567
|
-
│ │ ├── scope-parser.ts # "read:gmail" string parsing
|
|
568
|
-
│ │ └── scope-validator.ts # Permission access checks
|
|
569
|
-
│ ├── logger/ # Action logging client
|
|
570
|
-
│ │ └── action-logger.ts # HTTP client with batch mode and retry
|
|
571
|
-
│ ├── spending/ # Client-side spend enforcement
|
|
572
|
-
│ │ └── spending-checker.ts # Integer-cents arithmetic, limit checks
|
|
573
|
-
│ ├── mcp/ # MCP (Model Context Protocol) adapter
|
|
574
|
-
│ │ └── mcp-adapter.ts # Middleware for MCP tool call interception
|
|
575
|
-
│ └── types/ # Shared TypeScript types
|
|
576
|
-
│ └── index.ts # Interfaces, constants, type aliases
|
|
577
|
-
├── docs/
|
|
578
|
-
│ └── adr/ # Architecture Decision Records
|
|
579
|
-
├── examples/ # Runnable HTML examples
|
|
580
|
-
├── dist/ # Built output (ESM + CJS + types)
|
|
581
|
-
├── tsup.config.ts # Bundle configuration
|
|
582
|
-
├── tsconfig.json # TypeScript strict mode configuration
|
|
583
|
-
├── vitest.config.ts # Test runner configuration
|
|
584
|
-
└── eslint.config.ts # Linting rules
|
|
168
|
+
├── src/ # SDK, CLI, MCP adapter, consent web component
|
|
169
|
+
├── plugins/ # Host-specific hooks (Cline, Codex CLI, Windsurf, OpenCode…)
|
|
170
|
+
├── bin/ # Executable entry stubs
|
|
171
|
+
├── docs/adr/ # Architecture decision records
|
|
172
|
+
└── examples/ # Runnable HTML snippets
|
|
585
173
|
```
|
|
586
174
|
|
|
587
175
|
## Publishing & ownership
|
|
588
176
|
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
The npm publish step uses a scoped automation token stored as one repository secret (`NPM_TOKEN`), only for this workflow, with npm provenance enabled on the publish command.
|
|
592
|
-
|
|
593
|
-
The npm package has a single publisher account (`multicorn-ai`). If you see a Socket.dev "unstable ownership" warning after an earlier publish-identity change, it often clears as the registry history stabilizes across the next few releases.
|
|
594
|
-
|
|
595
|
-
For compromised-package or supply-chain concerns, see [SECURITY.md](SECURITY.md).
|
|
596
|
-
|
|
597
|
-
## Network behaviour
|
|
598
|
-
|
|
599
|
-
The SDK and CLI make outbound requests to the following hosts:
|
|
600
|
-
|
|
601
|
-
**api.multicorn.ai** (control plane; default)
|
|
602
|
-
|
|
603
|
-
- Consent creation and approval polling
|
|
604
|
-
- Action audit submission
|
|
605
|
-
- Spending checks
|
|
606
|
-
- Invoked only when the host application calls SDK or CLI methods, or when the proxy or extension runs its control-plane logic. There is no import-time network activity.
|
|
607
|
-
|
|
608
|
-
**127.0.0.1 / localhost** (local proxy, when running in proxy mode)
|
|
609
|
-
|
|
610
|
-
- IPC between the CLI wrapper and the local proxy process
|
|
611
|
-
- Never leaves the user's machine
|
|
612
|
-
|
|
613
|
-
No telemetry, analytics, or phone-home calls. Outbound API URLs use fixed paths under a single configurable base URL: the SDK `baseUrl` option (default `https://api.multicorn.ai`), the `MULTICORN_BASE_URL` environment variable, or `baseUrl` in `~/.multicorn/config.json` for the proxy and related tooling. Hosts and paths are not built from agent tool parameters or request bodies.
|
|
177
|
+
Published by `multicorn-ai` on npm. CI runs lint, types, tests, and build before every release. See [SECURITY.md](SECURITY.md) for supply-chain concerns. Operational detail lives in [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
614
178
|
|
|
615
179
|
## Contributing
|
|
616
180
|
|
|
617
|
-
|
|
181
|
+
Patches welcome: read [CONTRIBUTING.md](CONTRIBUTING.md), open issues for platform gaps, attach repro logs whenever hooks mis-fire.
|
|
618
182
|
|
|
619
|
-
##
|
|
183
|
+
## Licence
|
|
620
184
|
|
|
621
185
|
[MIT](LICENSE) © Multicorn AI Pty Ltd
|
package/dist/index.cjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var lit = require('lit');
|
|
4
4
|
var decorators_js = require('lit/decorators.js');
|
|
5
|
+
var cssTag_js = require('@lit/reactive-element/css-tag.js');
|
|
5
6
|
|
|
6
7
|
var __defProp = Object.defineProperty;
|
|
7
8
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -473,7 +474,7 @@ var SHIELD_COLORS = {
|
|
|
473
474
|
};
|
|
474
475
|
|
|
475
476
|
// src/consent/consent-styles.ts
|
|
476
|
-
var consentStyles =
|
|
477
|
+
var consentStyles = cssTag_js.css`
|
|
477
478
|
:host {
|
|
478
479
|
display: block;
|
|
479
480
|
font-family:
|
|
@@ -487,25 +488,25 @@ var consentStyles = lit.css`
|
|
|
487
488
|
/* SECURITY: Every unsafeCSS() call below uses compile-time constants from
|
|
488
489
|
SHIELD_COLORS. Never pass user input or dynamic values to unsafeCSS() as
|
|
489
490
|
it bypasses Lit's CSS sanitisation and would create a CSS injection vector. */
|
|
490
|
-
color: ${
|
|
491
|
-
--shield-bg: ${
|
|
492
|
-
--shield-surface: ${
|
|
493
|
-
--shield-surface-hover: ${
|
|
494
|
-
--shield-border: ${
|
|
495
|
-
--shield-border-light: ${
|
|
496
|
-
--shield-text: ${
|
|
497
|
-
--shield-text-muted: ${
|
|
498
|
-
--shield-text-dim: ${
|
|
499
|
-
--shield-accent: ${
|
|
500
|
-
--shield-accent-light: ${
|
|
501
|
-
--shield-accent-dim: ${
|
|
502
|
-
--shield-accent-glow: ${
|
|
503
|
-
--shield-green: ${
|
|
504
|
-
--shield-green-dim: ${
|
|
505
|
-
--shield-amber: ${
|
|
506
|
-
--shield-amber-dim: ${
|
|
507
|
-
--shield-red: ${
|
|
508
|
-
--shield-red-dim: ${
|
|
491
|
+
color: ${cssTag_js.unsafeCSS(SHIELD_COLORS.text)};
|
|
492
|
+
--shield-bg: ${cssTag_js.unsafeCSS(SHIELD_COLORS.bg)};
|
|
493
|
+
--shield-surface: ${cssTag_js.unsafeCSS(SHIELD_COLORS.surface)};
|
|
494
|
+
--shield-surface-hover: ${cssTag_js.unsafeCSS(SHIELD_COLORS.surfaceHover)};
|
|
495
|
+
--shield-border: ${cssTag_js.unsafeCSS(SHIELD_COLORS.border)};
|
|
496
|
+
--shield-border-light: ${cssTag_js.unsafeCSS(SHIELD_COLORS.borderLight)};
|
|
497
|
+
--shield-text: ${cssTag_js.unsafeCSS(SHIELD_COLORS.text)};
|
|
498
|
+
--shield-text-muted: ${cssTag_js.unsafeCSS(SHIELD_COLORS.textMuted)};
|
|
499
|
+
--shield-text-dim: ${cssTag_js.unsafeCSS(SHIELD_COLORS.textDim)};
|
|
500
|
+
--shield-accent: ${cssTag_js.unsafeCSS(SHIELD_COLORS.accent)};
|
|
501
|
+
--shield-accent-light: ${cssTag_js.unsafeCSS(SHIELD_COLORS.accentLight)};
|
|
502
|
+
--shield-accent-dim: ${cssTag_js.unsafeCSS(SHIELD_COLORS.accentDim)};
|
|
503
|
+
--shield-accent-glow: ${cssTag_js.unsafeCSS(SHIELD_COLORS.accentGlow)};
|
|
504
|
+
--shield-green: ${cssTag_js.unsafeCSS(SHIELD_COLORS.green)};
|
|
505
|
+
--shield-green-dim: ${cssTag_js.unsafeCSS(SHIELD_COLORS.greenDim)};
|
|
506
|
+
--shield-amber: ${cssTag_js.unsafeCSS(SHIELD_COLORS.amber)};
|
|
507
|
+
--shield-amber-dim: ${cssTag_js.unsafeCSS(SHIELD_COLORS.amberDim)};
|
|
508
|
+
--shield-red: ${cssTag_js.unsafeCSS(SHIELD_COLORS.red)};
|
|
509
|
+
--shield-red-dim: ${cssTag_js.unsafeCSS(SHIELD_COLORS.redDim)};
|
|
509
510
|
}
|
|
510
511
|
|
|
511
512
|
/* Modal backdrop */
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _lit_reactive_element_css_tag_js from '@lit/reactive-element/css-tag.js';
|
|
2
2
|
import { LitElement, PropertyValues, HTMLTemplateResult } from 'lit';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -721,7 +721,7 @@ declare const CONSENT_ELEMENT_TAG = "multicorn-consent";
|
|
|
721
721
|
* ```
|
|
722
722
|
*/
|
|
723
723
|
declare class MulticornConsent extends LitElement {
|
|
724
|
-
static styles:
|
|
724
|
+
static styles: _lit_reactive_element_css_tag_js.CSSResult[];
|
|
725
725
|
/**
|
|
726
726
|
* The name of the agent requesting access.
|
|
727
727
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _lit_reactive_element_css_tag_js from '@lit/reactive-element/css-tag.js';
|
|
2
2
|
import { LitElement, PropertyValues, HTMLTemplateResult } from 'lit';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -721,7 +721,7 @@ declare const CONSENT_ELEMENT_TAG = "multicorn-consent";
|
|
|
721
721
|
* ```
|
|
722
722
|
*/
|
|
723
723
|
declare class MulticornConsent extends LitElement {
|
|
724
|
-
static styles:
|
|
724
|
+
static styles: _lit_reactive_element_css_tag_js.CSSResult[];
|
|
725
725
|
/**
|
|
726
726
|
* The name of the agent requesting access.
|
|
727
727
|
*
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LitElement, html } from 'lit';
|
|
2
2
|
import { property, state } from 'lit/decorators.js';
|
|
3
|
+
import { unsafeCSS, css } from '@lit/reactive-element/css-tag.js';
|
|
3
4
|
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
5
6
|
var __decorateClass = (decorators, target, key, kind) => {
|
package/dist/multicorn-proxy.js
CHANGED
|
@@ -2188,8 +2188,7 @@ async function applyHostedProxyMcpConfig(platform, proxyUrl, shortName, apiKey,
|
|
|
2188
2188
|
}
|
|
2189
2189
|
} else if (platform === "cline") {
|
|
2190
2190
|
result = await mergeMcpServersObjectStyle(getClineMcpSettingsPath(), shortName, {
|
|
2191
|
-
url: proxyUrlWithKeyWhenNeeded
|
|
2192
|
-
headers: { Authorization: authHeader }
|
|
2191
|
+
url: proxyUrlWithKeyWhenNeeded
|
|
2193
2192
|
});
|
|
2194
2193
|
if (result === "parse-error") {
|
|
2195
2194
|
printHostedProxyJsonParseWarning(getClineMcpSettingsPath());
|
|
@@ -2477,7 +2476,17 @@ Authorization = "Bearer ${bearerToken}"
|
|
|
2477
2476
|
`;
|
|
2478
2477
|
} else {
|
|
2479
2478
|
const urlKey = platform === "windsurf" ? "serverUrl" : "url";
|
|
2480
|
-
snippetText = JSON.stringify(
|
|
2479
|
+
snippetText = platform === "cline" ? JSON.stringify(
|
|
2480
|
+
{
|
|
2481
|
+
mcpServers: {
|
|
2482
|
+
[shortName]: {
|
|
2483
|
+
[urlKey]: urlInSnippet
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
},
|
|
2487
|
+
null,
|
|
2488
|
+
2
|
|
2489
|
+
) : JSON.stringify(
|
|
2481
2490
|
{
|
|
2482
2491
|
mcpServers: {
|
|
2483
2492
|
[shortName]: {
|
|
@@ -3788,7 +3797,8 @@ var init_config = __esm({
|
|
|
3788
3797
|
"github-copilot",
|
|
3789
3798
|
"kilo-code",
|
|
3790
3799
|
"continue-dev",
|
|
3791
|
-
"goose"
|
|
3800
|
+
"goose",
|
|
3801
|
+
"cline"
|
|
3792
3802
|
]);
|
|
3793
3803
|
OPENCODE_CONFIG_SCHEMA_URL = "https://opencode.ai/config.json";
|
|
3794
3804
|
DEFAULT_SHIELD_API_BASE_URL = "https://api.multicorn.ai";
|
|
@@ -4735,7 +4745,7 @@ var init_package = __esm({
|
|
|
4735
4745
|
"package.json"() {
|
|
4736
4746
|
package_default = {
|
|
4737
4747
|
name: "multicorn-shield",
|
|
4738
|
-
version: "1.
|
|
4748
|
+
version: "1.10.0",
|
|
4739
4749
|
description: "The control layer for AI agents: permissions, consent, spending limits, and audit logging.",
|
|
4740
4750
|
license: "MIT",
|
|
4741
4751
|
author: "Multicorn AI Pty Ltd",
|
|
@@ -4827,6 +4837,7 @@ var init_package = __esm({
|
|
|
4827
4837
|
},
|
|
4828
4838
|
dependencies: {
|
|
4829
4839
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
4840
|
+
"@lit/reactive-element": "^2.0.0",
|
|
4830
4841
|
lit: "^3.2.0",
|
|
4831
4842
|
yaml: "^2.8.2",
|
|
4832
4843
|
zod: "^4.3.6"
|
|
@@ -4888,7 +4899,7 @@ var init_package = __esm({
|
|
|
4888
4899
|
],
|
|
4889
4900
|
repository: {
|
|
4890
4901
|
type: "git",
|
|
4891
|
-
url: "
|
|
4902
|
+
url: "https://github.com/Multicorn-AI/multicorn-shield"
|
|
4892
4903
|
},
|
|
4893
4904
|
bugs: {
|
|
4894
4905
|
url: "https://github.com/Multicorn-AI/multicorn-shield/issues"
|
package/dist/multicorn-shield.js
CHANGED
|
@@ -1891,7 +1891,8 @@ var HOSTED_PROXY_PLATFORMS_WITH_URL_KEY = /* @__PURE__ */ new Set([
|
|
|
1891
1891
|
"github-copilot",
|
|
1892
1892
|
"kilo-code",
|
|
1893
1893
|
"continue-dev",
|
|
1894
|
-
"goose"
|
|
1894
|
+
"goose",
|
|
1895
|
+
"cline"
|
|
1895
1896
|
]);
|
|
1896
1897
|
function shouldEmbedKeyInHostedProxyUrl(platform) {
|
|
1897
1898
|
return HOSTED_PROXY_PLATFORMS_WITH_URL_KEY.has(platform);
|
|
@@ -2286,8 +2287,7 @@ async function applyHostedProxyMcpConfig(platform, proxyUrl, shortName, apiKey,
|
|
|
2286
2287
|
}
|
|
2287
2288
|
} else if (platform === "cline") {
|
|
2288
2289
|
result = await mergeMcpServersObjectStyle(getClineMcpSettingsPath(), shortName, {
|
|
2289
|
-
url: proxyUrlWithKeyWhenNeeded
|
|
2290
|
-
headers: { Authorization: authHeader }
|
|
2290
|
+
url: proxyUrlWithKeyWhenNeeded
|
|
2291
2291
|
});
|
|
2292
2292
|
if (result === "parse-error") {
|
|
2293
2293
|
printHostedProxyJsonParseWarning(getClineMcpSettingsPath());
|
|
@@ -2575,7 +2575,17 @@ Authorization = "Bearer ${bearerToken}"
|
|
|
2575
2575
|
`;
|
|
2576
2576
|
} else {
|
|
2577
2577
|
const urlKey = platform === "windsurf" ? "serverUrl" : "url";
|
|
2578
|
-
snippetText = JSON.stringify(
|
|
2578
|
+
snippetText = platform === "cline" ? JSON.stringify(
|
|
2579
|
+
{
|
|
2580
|
+
mcpServers: {
|
|
2581
|
+
[shortName]: {
|
|
2582
|
+
[urlKey]: urlInSnippet
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
},
|
|
2586
|
+
null,
|
|
2587
|
+
2
|
|
2588
|
+
) : JSON.stringify(
|
|
2579
2589
|
{
|
|
2580
2590
|
mcpServers: {
|
|
2581
2591
|
[shortName]: {
|
|
@@ -4658,7 +4668,7 @@ async function restoreClaudeDesktopMcpFromBackup() {
|
|
|
4658
4668
|
|
|
4659
4669
|
// package.json
|
|
4660
4670
|
var package_default = {
|
|
4661
|
-
version: "1.
|
|
4671
|
+
version: "1.10.0"};
|
|
4662
4672
|
|
|
4663
4673
|
// src/package-meta.ts
|
|
4664
4674
|
var PACKAGE_VERSION = package_default.version;
|
package/dist/shield-extension.js
CHANGED
|
@@ -22517,7 +22517,7 @@ async function writeExtensionBackup(claudeDesktopConfigPath, mcpServers) {
|
|
|
22517
22517
|
|
|
22518
22518
|
// package.json
|
|
22519
22519
|
var package_default = {
|
|
22520
|
-
version: "1.
|
|
22520
|
+
version: "1.10.0"};
|
|
22521
22521
|
|
|
22522
22522
|
// src/package-meta.ts
|
|
22523
22523
|
var PACKAGE_VERSION = package_default.version;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "multicorn-shield",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "The control layer for AI agents: permissions, consent, spending limits, and audit logging.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Multicorn AI Pty Ltd",
|
|
@@ -59,6 +59,28 @@
|
|
|
59
59
|
"engines": {
|
|
60
60
|
"node": ">=20"
|
|
61
61
|
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"build": "tsup",
|
|
64
|
+
"dev": "tsup --watch",
|
|
65
|
+
"lint": "eslint . --no-warn-ignored && prettier --check .",
|
|
66
|
+
"lint:fix": "eslint --fix . --no-warn-ignored && prettier --write .",
|
|
67
|
+
"test": "vitest run",
|
|
68
|
+
"test:watch": "vitest",
|
|
69
|
+
"test:coverage": "vitest run --coverage",
|
|
70
|
+
"typecheck": "tsc --noEmit",
|
|
71
|
+
"docs": "typedoc",
|
|
72
|
+
"clean": "rm -rf dist coverage docs/api extension-pack",
|
|
73
|
+
"stage-extension-pack": "rm -rf extension-pack && mkdir -p extension-pack/server && cp manifest.json extension-pack/ && cp icon.png extension-pack/ && cp dist/shield-extension.js extension-pack/server/index.js",
|
|
74
|
+
"validate:extension": "pnpm run stage-extension-pack && mcpb validate extension-pack/manifest.json",
|
|
75
|
+
"build:extension": "tsup",
|
|
76
|
+
"pack:extension": "pnpm run build && pnpm run stage-extension-pack && mcpb validate extension-pack/manifest.json && mcpb pack extension-pack dist/multicorn-shield.mcpb",
|
|
77
|
+
"size": "size-limit",
|
|
78
|
+
"prepublishOnly": "pnpm run clean && pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run build",
|
|
79
|
+
"prepare": "husky || true",
|
|
80
|
+
"release:patch": "npm version patch && pnpm publish",
|
|
81
|
+
"release:minor": "npm version minor && pnpm publish",
|
|
82
|
+
"release:major": "npm version major && pnpm publish"
|
|
83
|
+
},
|
|
62
84
|
"lint-staged": {
|
|
63
85
|
"*.ts": [
|
|
64
86
|
"eslint --fix --no-warn-ignored",
|
|
@@ -70,6 +92,7 @@
|
|
|
70
92
|
},
|
|
71
93
|
"dependencies": {
|
|
72
94
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
95
|
+
"@lit/reactive-element": "^2.0.0",
|
|
73
96
|
"lit": "^3.2.0",
|
|
74
97
|
"yaml": "^2.8.2",
|
|
75
98
|
"zod": "^4.3.6"
|
|
@@ -131,30 +154,22 @@
|
|
|
131
154
|
],
|
|
132
155
|
"repository": {
|
|
133
156
|
"type": "git",
|
|
134
|
-
"url": "
|
|
157
|
+
"url": "https://github.com/Multicorn-AI/multicorn-shield"
|
|
135
158
|
},
|
|
136
159
|
"bugs": {
|
|
137
160
|
"url": "https://github.com/Multicorn-AI/multicorn-shield/issues"
|
|
138
161
|
},
|
|
139
162
|
"homepage": "https://multicorn.ai",
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
"stage-extension-pack": "rm -rf extension-pack && mkdir -p extension-pack/server && cp manifest.json extension-pack/ && cp icon.png extension-pack/ && cp dist/shield-extension.js extension-pack/server/index.js",
|
|
152
|
-
"validate:extension": "pnpm run stage-extension-pack && mcpb validate extension-pack/manifest.json",
|
|
153
|
-
"build:extension": "tsup",
|
|
154
|
-
"pack:extension": "pnpm run build && pnpm run stage-extension-pack && mcpb validate extension-pack/manifest.json && mcpb pack extension-pack dist/multicorn-shield.mcpb",
|
|
155
|
-
"size": "size-limit",
|
|
156
|
-
"release:patch": "npm version patch && pnpm publish",
|
|
157
|
-
"release:minor": "npm version minor && pnpm publish",
|
|
158
|
-
"release:major": "npm version major && pnpm publish"
|
|
163
|
+
"pnpm": {
|
|
164
|
+
"overrides": {
|
|
165
|
+
"vite": ">=7.3.2",
|
|
166
|
+
"flatted": ">=3.4.2",
|
|
167
|
+
"minimatch": ">=10.2.3",
|
|
168
|
+
"rollup": ">=4.59.0",
|
|
169
|
+
"picomatch": ">=4.0.4",
|
|
170
|
+
"path-to-regexp": ">=8.4.0",
|
|
171
|
+
"node-forge": ">=1.4.0",
|
|
172
|
+
"fast-uri": ">=3.1.2"
|
|
173
|
+
}
|
|
159
174
|
}
|
|
160
|
-
}
|
|
175
|
+
}
|
|
File without changes
|
|
File without changes
|