multicorn-shield 1.9.5 → 1.11.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 +29 -0
- package/README.md +87 -523
- package/dist/index.cjs +31 -20
- package/dist/index.d.cts +14 -6
- package/dist/index.d.ts +14 -6
- package/dist/index.js +12 -1
- package/dist/multicorn-proxy.js +1600 -160
- package/dist/multicorn-shield.js +1590 -163
- package/dist/proxy.cjs +2 -0
- package/dist/proxy.d.cts +3 -0
- package/dist/proxy.d.ts +3 -0
- package/dist/proxy.js +2 -0
- package/dist/shield-extension.js +3 -1
- package/package.json +42 -22
- package/plugins/cline/hooks/scripts/post-tool-use.cjs +0 -0
- package/plugins/cline/hooks/scripts/pre-tool-use.cjs +0 -0
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) => {
|
|
@@ -40,6 +41,7 @@ var AGENT_STATUSES = {
|
|
|
40
41
|
var PERMISSION_LEVELS = {
|
|
41
42
|
Read: "read",
|
|
42
43
|
Write: "write",
|
|
44
|
+
Delete: "delete",
|
|
43
45
|
Execute: "execute",
|
|
44
46
|
Publish: "publish",
|
|
45
47
|
Create: "create"
|
|
@@ -74,6 +76,11 @@ var BUILT_IN_SERVICES = {
|
|
|
74
76
|
description: "Google Drive: file browsing, uploading, and sharing",
|
|
75
77
|
capabilities: [PERMISSION_LEVELS.Read, PERMISSION_LEVELS.Write]
|
|
76
78
|
},
|
|
79
|
+
filesystem: {
|
|
80
|
+
name: "filesystem",
|
|
81
|
+
description: "Sandboxed Multicorn workspace: reading, writing, and deleting files",
|
|
82
|
+
capabilities: [PERMISSION_LEVELS.Read, PERMISSION_LEVELS.Write, PERMISSION_LEVELS.Delete]
|
|
83
|
+
},
|
|
77
84
|
payments: {
|
|
78
85
|
name: "payments",
|
|
79
86
|
description: "Payment processing: balance enquiries and transaction execution",
|
|
@@ -343,6 +350,7 @@ var SERVICE_DISPLAY_NAMES = {
|
|
|
343
350
|
calendar: "Google Calendar",
|
|
344
351
|
slack: "Slack",
|
|
345
352
|
drive: "Google Drive",
|
|
353
|
+
filesystem: "Workspace files",
|
|
346
354
|
payments: "Payments",
|
|
347
355
|
github: "GitHub",
|
|
348
356
|
jira: "Jira",
|
|
@@ -354,6 +362,7 @@ var SERVICE_ICONS = {
|
|
|
354
362
|
calendar: "\u{1F4C5}",
|
|
355
363
|
slack: "\u{1F4AC}",
|
|
356
364
|
drive: "\u{1F4C1}",
|
|
365
|
+
filesystem: "\u{1F4C2}",
|
|
357
366
|
payments: "\u{1F4B3}",
|
|
358
367
|
github: "\u{1F419}",
|
|
359
368
|
jira: "\u{1F3AF}",
|
|
@@ -363,6 +372,7 @@ var SERVICE_ICONS = {
|
|
|
363
372
|
var PERMISSION_DESCRIPTIONS = {
|
|
364
373
|
[PERMISSION_LEVELS.Read]: "Read",
|
|
365
374
|
[PERMISSION_LEVELS.Write]: "Create and modify",
|
|
375
|
+
[PERMISSION_LEVELS.Delete]: "Delete",
|
|
366
376
|
[PERMISSION_LEVELS.Execute]: "Execute actions",
|
|
367
377
|
[PERMISSION_LEVELS.Publish]: "Publish",
|
|
368
378
|
[PERMISSION_LEVELS.Create]: "Create"
|
|
@@ -370,6 +380,7 @@ var PERMISSION_DESCRIPTIONS = {
|
|
|
370
380
|
var PERMISSION_FULL_DESCRIPTIONS = {
|
|
371
381
|
[PERMISSION_LEVELS.Read]: (serviceName) => `Read your ${serviceName}`,
|
|
372
382
|
[PERMISSION_LEVELS.Write]: (serviceName) => `Create and modify ${serviceName} content`,
|
|
383
|
+
[PERMISSION_LEVELS.Delete]: (serviceName) => `Delete ${serviceName} content`,
|
|
373
384
|
[PERMISSION_LEVELS.Execute]: (serviceName) => {
|
|
374
385
|
if (serviceName.toLowerCase().includes("payment")) {
|
|
375
386
|
return "Make purchases on your behalf";
|
|
@@ -473,7 +484,7 @@ var SHIELD_COLORS = {
|
|
|
473
484
|
};
|
|
474
485
|
|
|
475
486
|
// src/consent/consent-styles.ts
|
|
476
|
-
var consentStyles =
|
|
487
|
+
var consentStyles = cssTag_js.css`
|
|
477
488
|
:host {
|
|
478
489
|
display: block;
|
|
479
490
|
font-family:
|
|
@@ -487,25 +498,25 @@ var consentStyles = lit.css`
|
|
|
487
498
|
/* SECURITY: Every unsafeCSS() call below uses compile-time constants from
|
|
488
499
|
SHIELD_COLORS. Never pass user input or dynamic values to unsafeCSS() as
|
|
489
500
|
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: ${
|
|
501
|
+
color: ${cssTag_js.unsafeCSS(SHIELD_COLORS.text)};
|
|
502
|
+
--shield-bg: ${cssTag_js.unsafeCSS(SHIELD_COLORS.bg)};
|
|
503
|
+
--shield-surface: ${cssTag_js.unsafeCSS(SHIELD_COLORS.surface)};
|
|
504
|
+
--shield-surface-hover: ${cssTag_js.unsafeCSS(SHIELD_COLORS.surfaceHover)};
|
|
505
|
+
--shield-border: ${cssTag_js.unsafeCSS(SHIELD_COLORS.border)};
|
|
506
|
+
--shield-border-light: ${cssTag_js.unsafeCSS(SHIELD_COLORS.borderLight)};
|
|
507
|
+
--shield-text: ${cssTag_js.unsafeCSS(SHIELD_COLORS.text)};
|
|
508
|
+
--shield-text-muted: ${cssTag_js.unsafeCSS(SHIELD_COLORS.textMuted)};
|
|
509
|
+
--shield-text-dim: ${cssTag_js.unsafeCSS(SHIELD_COLORS.textDim)};
|
|
510
|
+
--shield-accent: ${cssTag_js.unsafeCSS(SHIELD_COLORS.accent)};
|
|
511
|
+
--shield-accent-light: ${cssTag_js.unsafeCSS(SHIELD_COLORS.accentLight)};
|
|
512
|
+
--shield-accent-dim: ${cssTag_js.unsafeCSS(SHIELD_COLORS.accentDim)};
|
|
513
|
+
--shield-accent-glow: ${cssTag_js.unsafeCSS(SHIELD_COLORS.accentGlow)};
|
|
514
|
+
--shield-green: ${cssTag_js.unsafeCSS(SHIELD_COLORS.green)};
|
|
515
|
+
--shield-green-dim: ${cssTag_js.unsafeCSS(SHIELD_COLORS.greenDim)};
|
|
516
|
+
--shield-amber: ${cssTag_js.unsafeCSS(SHIELD_COLORS.amber)};
|
|
517
|
+
--shield-amber-dim: ${cssTag_js.unsafeCSS(SHIELD_COLORS.amberDim)};
|
|
518
|
+
--shield-red: ${cssTag_js.unsafeCSS(SHIELD_COLORS.red)};
|
|
519
|
+
--shield-red-dim: ${cssTag_js.unsafeCSS(SHIELD_COLORS.redDim)};
|
|
509
520
|
}
|
|
510
521
|
|
|
511
522
|
/* 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
|
/**
|
|
@@ -32,6 +32,8 @@ type AgentStatus = (typeof AGENT_STATUSES)[keyof typeof AGENT_STATUSES];
|
|
|
32
32
|
*
|
|
33
33
|
* - `read`: observe data without modification
|
|
34
34
|
* - `write`: create or modify data
|
|
35
|
+
* - `delete`: destroy data (kept distinct from `write` so saving a file never
|
|
36
|
+
* implies the right to delete one; used by the hosted workspace filesystem)
|
|
35
37
|
* - `execute`: trigger side-effects (e.g. send an email, make a payment)
|
|
36
38
|
* - `publish`: make existing content publicly accessible (e.g. deploy, publish, make live)
|
|
37
39
|
* - `create`: create new content that is immediately public (e.g. tweet, public commit, forum post)
|
|
@@ -39,6 +41,7 @@ type AgentStatus = (typeof AGENT_STATUSES)[keyof typeof AGENT_STATUSES];
|
|
|
39
41
|
declare const PERMISSION_LEVELS: {
|
|
40
42
|
readonly Read: "read";
|
|
41
43
|
readonly Write: "write";
|
|
44
|
+
readonly Delete: "delete";
|
|
42
45
|
readonly Execute: "execute";
|
|
43
46
|
readonly Publish: "publish";
|
|
44
47
|
readonly Create: "create";
|
|
@@ -233,6 +236,11 @@ declare const BUILT_IN_SERVICES: {
|
|
|
233
236
|
readonly description: "Google Drive: file browsing, uploading, and sharing";
|
|
234
237
|
readonly capabilities: readonly ["read", "write"];
|
|
235
238
|
};
|
|
239
|
+
readonly filesystem: {
|
|
240
|
+
readonly name: "filesystem";
|
|
241
|
+
readonly description: "Sandboxed Multicorn workspace: reading, writing, and deleting files";
|
|
242
|
+
readonly capabilities: readonly ["read", "write", "delete"];
|
|
243
|
+
};
|
|
236
244
|
readonly payments: {
|
|
237
245
|
readonly name: "payments";
|
|
238
246
|
readonly description: "Payment processing: balance enquiries and transaction execution";
|
|
@@ -448,7 +456,7 @@ type ScopeParseResult = {
|
|
|
448
456
|
* Parse a scope string into a structured {@link Scope} object.
|
|
449
457
|
*
|
|
450
458
|
* Scope strings use the format `"permission:service"` where:
|
|
451
|
-
* - **permission** is one of `read`, `write`, `execute`, `publish`, or `create`
|
|
459
|
+
* - **permission** is one of `read`, `write`, `delete`, `execute`, `publish`, or `create`
|
|
452
460
|
* - **service** is a lowercase identifier (letters, digits, hyphens, underscores)
|
|
453
461
|
*
|
|
454
462
|
* @param input - The scope string to parse (e.g. `"read:gmail"`).
|
|
@@ -463,8 +471,8 @@ type ScopeParseResult = {
|
|
|
463
471
|
*
|
|
464
472
|
* @example
|
|
465
473
|
* ```ts
|
|
466
|
-
* parseScope("
|
|
467
|
-
* // throws ScopeParseError: Unknown permission level "
|
|
474
|
+
* parseScope("destroy:gmail");
|
|
475
|
+
* // throws ScopeParseError: Unknown permission level "destroy" …
|
|
468
476
|
* ```
|
|
469
477
|
*/
|
|
470
478
|
declare function parseScope(input: string): Scope;
|
|
@@ -533,7 +541,7 @@ declare function formatScope(scope: Scope): string;
|
|
|
533
541
|
* @example
|
|
534
542
|
* ```ts
|
|
535
543
|
* isValidScopeString("read:gmail"); // true
|
|
536
|
-
* isValidScopeString("
|
|
544
|
+
* isValidScopeString("destroy:gmail"); // false
|
|
537
545
|
* isValidScopeString(""); // false
|
|
538
546
|
* ```
|
|
539
547
|
*/
|
|
@@ -721,7 +729,7 @@ declare const CONSENT_ELEMENT_TAG = "multicorn-consent";
|
|
|
721
729
|
* ```
|
|
722
730
|
*/
|
|
723
731
|
declare class MulticornConsent extends LitElement {
|
|
724
|
-
static styles:
|
|
732
|
+
static styles: _lit_reactive_element_css_tag_js.CSSResult[];
|
|
725
733
|
/**
|
|
726
734
|
* The name of the agent requesting access.
|
|
727
735
|
*
|
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
|
/**
|
|
@@ -32,6 +32,8 @@ type AgentStatus = (typeof AGENT_STATUSES)[keyof typeof AGENT_STATUSES];
|
|
|
32
32
|
*
|
|
33
33
|
* - `read`: observe data without modification
|
|
34
34
|
* - `write`: create or modify data
|
|
35
|
+
* - `delete`: destroy data (kept distinct from `write` so saving a file never
|
|
36
|
+
* implies the right to delete one; used by the hosted workspace filesystem)
|
|
35
37
|
* - `execute`: trigger side-effects (e.g. send an email, make a payment)
|
|
36
38
|
* - `publish`: make existing content publicly accessible (e.g. deploy, publish, make live)
|
|
37
39
|
* - `create`: create new content that is immediately public (e.g. tweet, public commit, forum post)
|
|
@@ -39,6 +41,7 @@ type AgentStatus = (typeof AGENT_STATUSES)[keyof typeof AGENT_STATUSES];
|
|
|
39
41
|
declare const PERMISSION_LEVELS: {
|
|
40
42
|
readonly Read: "read";
|
|
41
43
|
readonly Write: "write";
|
|
44
|
+
readonly Delete: "delete";
|
|
42
45
|
readonly Execute: "execute";
|
|
43
46
|
readonly Publish: "publish";
|
|
44
47
|
readonly Create: "create";
|
|
@@ -233,6 +236,11 @@ declare const BUILT_IN_SERVICES: {
|
|
|
233
236
|
readonly description: "Google Drive: file browsing, uploading, and sharing";
|
|
234
237
|
readonly capabilities: readonly ["read", "write"];
|
|
235
238
|
};
|
|
239
|
+
readonly filesystem: {
|
|
240
|
+
readonly name: "filesystem";
|
|
241
|
+
readonly description: "Sandboxed Multicorn workspace: reading, writing, and deleting files";
|
|
242
|
+
readonly capabilities: readonly ["read", "write", "delete"];
|
|
243
|
+
};
|
|
236
244
|
readonly payments: {
|
|
237
245
|
readonly name: "payments";
|
|
238
246
|
readonly description: "Payment processing: balance enquiries and transaction execution";
|
|
@@ -448,7 +456,7 @@ type ScopeParseResult = {
|
|
|
448
456
|
* Parse a scope string into a structured {@link Scope} object.
|
|
449
457
|
*
|
|
450
458
|
* Scope strings use the format `"permission:service"` where:
|
|
451
|
-
* - **permission** is one of `read`, `write`, `execute`, `publish`, or `create`
|
|
459
|
+
* - **permission** is one of `read`, `write`, `delete`, `execute`, `publish`, or `create`
|
|
452
460
|
* - **service** is a lowercase identifier (letters, digits, hyphens, underscores)
|
|
453
461
|
*
|
|
454
462
|
* @param input - The scope string to parse (e.g. `"read:gmail"`).
|
|
@@ -463,8 +471,8 @@ type ScopeParseResult = {
|
|
|
463
471
|
*
|
|
464
472
|
* @example
|
|
465
473
|
* ```ts
|
|
466
|
-
* parseScope("
|
|
467
|
-
* // throws ScopeParseError: Unknown permission level "
|
|
474
|
+
* parseScope("destroy:gmail");
|
|
475
|
+
* // throws ScopeParseError: Unknown permission level "destroy" …
|
|
468
476
|
* ```
|
|
469
477
|
*/
|
|
470
478
|
declare function parseScope(input: string): Scope;
|
|
@@ -533,7 +541,7 @@ declare function formatScope(scope: Scope): string;
|
|
|
533
541
|
* @example
|
|
534
542
|
* ```ts
|
|
535
543
|
* isValidScopeString("read:gmail"); // true
|
|
536
|
-
* isValidScopeString("
|
|
544
|
+
* isValidScopeString("destroy:gmail"); // false
|
|
537
545
|
* isValidScopeString(""); // false
|
|
538
546
|
* ```
|
|
539
547
|
*/
|
|
@@ -721,7 +729,7 @@ declare const CONSENT_ELEMENT_TAG = "multicorn-consent";
|
|
|
721
729
|
* ```
|
|
722
730
|
*/
|
|
723
731
|
declare class MulticornConsent extends LitElement {
|
|
724
|
-
static styles:
|
|
732
|
+
static styles: _lit_reactive_element_css_tag_js.CSSResult[];
|
|
725
733
|
/**
|
|
726
734
|
* The name of the agent requesting access.
|
|
727
735
|
*
|
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) => {
|
|
@@ -38,6 +39,7 @@ var AGENT_STATUSES = {
|
|
|
38
39
|
var PERMISSION_LEVELS = {
|
|
39
40
|
Read: "read",
|
|
40
41
|
Write: "write",
|
|
42
|
+
Delete: "delete",
|
|
41
43
|
Execute: "execute",
|
|
42
44
|
Publish: "publish",
|
|
43
45
|
Create: "create"
|
|
@@ -72,6 +74,11 @@ var BUILT_IN_SERVICES = {
|
|
|
72
74
|
description: "Google Drive: file browsing, uploading, and sharing",
|
|
73
75
|
capabilities: [PERMISSION_LEVELS.Read, PERMISSION_LEVELS.Write]
|
|
74
76
|
},
|
|
77
|
+
filesystem: {
|
|
78
|
+
name: "filesystem",
|
|
79
|
+
description: "Sandboxed Multicorn workspace: reading, writing, and deleting files",
|
|
80
|
+
capabilities: [PERMISSION_LEVELS.Read, PERMISSION_LEVELS.Write, PERMISSION_LEVELS.Delete]
|
|
81
|
+
},
|
|
75
82
|
payments: {
|
|
76
83
|
name: "payments",
|
|
77
84
|
description: "Payment processing: balance enquiries and transaction execution",
|
|
@@ -341,6 +348,7 @@ var SERVICE_DISPLAY_NAMES = {
|
|
|
341
348
|
calendar: "Google Calendar",
|
|
342
349
|
slack: "Slack",
|
|
343
350
|
drive: "Google Drive",
|
|
351
|
+
filesystem: "Workspace files",
|
|
344
352
|
payments: "Payments",
|
|
345
353
|
github: "GitHub",
|
|
346
354
|
jira: "Jira",
|
|
@@ -352,6 +360,7 @@ var SERVICE_ICONS = {
|
|
|
352
360
|
calendar: "\u{1F4C5}",
|
|
353
361
|
slack: "\u{1F4AC}",
|
|
354
362
|
drive: "\u{1F4C1}",
|
|
363
|
+
filesystem: "\u{1F4C2}",
|
|
355
364
|
payments: "\u{1F4B3}",
|
|
356
365
|
github: "\u{1F419}",
|
|
357
366
|
jira: "\u{1F3AF}",
|
|
@@ -361,6 +370,7 @@ var SERVICE_ICONS = {
|
|
|
361
370
|
var PERMISSION_DESCRIPTIONS = {
|
|
362
371
|
[PERMISSION_LEVELS.Read]: "Read",
|
|
363
372
|
[PERMISSION_LEVELS.Write]: "Create and modify",
|
|
373
|
+
[PERMISSION_LEVELS.Delete]: "Delete",
|
|
364
374
|
[PERMISSION_LEVELS.Execute]: "Execute actions",
|
|
365
375
|
[PERMISSION_LEVELS.Publish]: "Publish",
|
|
366
376
|
[PERMISSION_LEVELS.Create]: "Create"
|
|
@@ -368,6 +378,7 @@ var PERMISSION_DESCRIPTIONS = {
|
|
|
368
378
|
var PERMISSION_FULL_DESCRIPTIONS = {
|
|
369
379
|
[PERMISSION_LEVELS.Read]: (serviceName) => `Read your ${serviceName}`,
|
|
370
380
|
[PERMISSION_LEVELS.Write]: (serviceName) => `Create and modify ${serviceName} content`,
|
|
381
|
+
[PERMISSION_LEVELS.Delete]: (serviceName) => `Delete ${serviceName} content`,
|
|
371
382
|
[PERMISSION_LEVELS.Execute]: (serviceName) => {
|
|
372
383
|
if (serviceName.toLowerCase().includes("payment")) {
|
|
373
384
|
return "Make purchases on your behalf";
|