@mcpview/compose 0.14.0 → 0.14.1

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 CHANGED
@@ -5,6 +5,15 @@ documented in this file.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.14.1] - 2026-11-29
9
+
10
+ ### Fixed
11
+
12
+ - Under Deno, the default `isolation: "worker"` no longer fails with `SANDBOX_UNAVAILABLE` when
13
+ Compose is loaded from JSR without an unrestricted import grant. The check now asks for
14
+ `jsr.io:443`, which Deno grants by default, instead of every port of `jsr.io`. The recovery text
15
+ for a missing Deno permission now proposes granting it.
16
+
8
17
  ## [0.14.0] - 2026-11-29
9
18
 
10
19
  **Breaking** (0.x minor): Code Mode now runs programs in a worker by default (runtimes without
package/README.md CHANGED
@@ -124,20 +124,21 @@ CPU-bound program cannot block the server: `createSnippetChain(providers, catalo
124
124
  accepts `"worker"` (default) or `"inline"`. Use `"inline"` explicitly in runtimes or bundles that
125
125
  cannot start the worker module. An unavailable isolation fails at configuration with
126
126
  `SANDBOX_UNAVAILABLE`, never by falling back silently. Under Deno the worker inherits the host's
127
- permissions: grant read access to the `code-mode` directory of the package (import access when
128
- loaded from JSR) and to the QuickJS WASM file shipped with `quickjs-emscripten`. Configuration only
129
- checks the worker module itself; a missing grant for the other files fails the first run with
130
- `SANDBOX_FAILED`, so run one program at startup to verify the setup. `CODE_MODE_LIMITS` gives the
131
- defaults: 2 s of guest CPU (host calls excluded), 30 s of wall time, 12 MiB of memory, 16 provider
132
- calls (`listSnippets`, `runSnippet`) and 48 board operations (`panel`, `sync`) per program. Pass
133
- `limits` to override some of them (`memoryBytes` must be at least 64 KiB and `stackBytes` at least
134
- 16 KiB, or configuration throws a `RangeError`). `valueLength` counts UTF-16 code units of the JSON
135
- text, not UTF-8 bytes. Under Node's permission model, workers need `--allow-worker`; without it
136
- configuration fails with `SANDBOX_UNAVAILABLE` (audit mode does not count). Browsers have no worker
137
- guest: a browser-targeted bundle must use `isolation: "inline"` (the default `"worker"` fails at
138
- configuration with `SANDBOX_UNAVAILABLE`); the Node worker adapter is loaded at run time, so
139
- bundlers do not resolve `node:worker_threads`. `NODE_OPTIONS` that a worker cannot start with (such
140
- as `--input-type`) are not passed to it either.
127
+ permissions: grant read access to the `code-mode` directory of the package and to the QuickJS WASM
128
+ file shipped with `quickjs-emscripten`. Loaded from JSR, the package directory needs import access
129
+ to `jsr.io:443` instead, which Deno grants by default. Configuration only checks the worker module
130
+ itself; a missing grant for the other files fails the first run with `SANDBOX_FAILED`, so run one
131
+ program at startup to verify the setup. `CODE_MODE_LIMITS` gives the defaults: 2 s of guest CPU
132
+ (host calls excluded), 30 s of wall time, 12 MiB of memory, 16 provider calls (`listSnippets`,
133
+ `runSnippet`) and 48 board operations (`panel`, `sync`) per program. Pass `limits` to override some
134
+ of them (`memoryBytes` must be at least 64 KiB and `stackBytes` at least 16 KiB, or configuration
135
+ throws a `RangeError`). `valueLength` counts UTF-16 code units of the JSON text, not UTF-8 bytes.
136
+ Under Node's permission model, workers need `--allow-worker`; without it configuration fails with
137
+ `SANDBOX_UNAVAILABLE` (audit mode does not count). Browsers have no worker guest: a browser-targeted
138
+ bundle must use `isolation: "inline"` (the default `"worker"` fails at configuration with
139
+ `SANDBOX_UNAVAILABLE`); the Node worker adapter is loaded at run time, so bundlers do not resolve
140
+ `node:worker_threads`. `NODE_OPTIONS` that a worker cannot start with (such as `--input-type`) are
141
+ not passed to it either.
141
142
 
142
143
  **Breaking change: calls dispatch in the order they are awaited.** A call reaches the provider when
143
144
  the program starts it, not where it is written. A program that stores
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../../src/src/code-mode/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb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AI,EAAE,OAAO,EAAE,EACf,MAAM,EAAE,WAAW;AACnB,kGAAkG;AAClG,OAAO,EAAE,MAAM,OAAO,KACnB,OAAO,CAAC,OAAO,CAAC,EACrB,YAAY,CAAC,EAAE,WAAW,EAC1B,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,OAAO,CAAC,CA2FlB"}
@@ -69,7 +69,9 @@ export function assertSandboxIsolation(isolation) {
69
69
  if (reason) {
70
70
  throw new CodeModeError("SANDBOX_UNAVAILABLE", `Worker isolation is unavailable: ${reason}`, reason.includes("--allow-worker")
71
71
  ? 'Start Node with --allow-worker, or configure isolation: "inline"'
72
- : 'Configure isolation: "inline" explicitly for this runtime', { context: { isolation } });
72
+ : reason.startsWith("Deno has no ")
73
+ ? 'Grant that Deno permission, or configure isolation: "inline"'
74
+ : 'Configure isolation: "inline" explicitly for this runtime', { context: { isolation } });
73
75
  }
74
76
  }
75
77
  /** A JSON copy of the params, identical in both isolations. */
@@ -20,6 +20,18 @@ export interface NodeProcessLike {
20
20
  * does not count.
21
21
  */
22
22
  export declare function nodeWorkerPermission(process: NodeProcessLike | undefined): string | undefined;
23
+ /**
24
+ * The permission Deno needs to load the guest module, or undefined for schemes it does
25
+ * not gate. An import query must name the port: a bare `jsr.io` asks about every port
26
+ * and reads "prompt", although Deno grants `jsr.io:443` by default.
27
+ */
28
+ export declare function guestModulePermission(url: URL): {
29
+ name: "read";
30
+ path: URL;
31
+ } | {
32
+ name: "import";
33
+ host: string;
34
+ } | undefined;
23
35
  /** The part of the host's Node options that a Code Mode worker can start with. */
24
36
  export declare function nodeWorkerExecArgv(execArgv: readonly string[]): string[];
25
37
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"worker-host.d.ts","sourceRoot":"","sources":["../../../src/src/code-mode/worker-host.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAA2B,MAAM,aAAa,CAAC;AACrE,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACx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D,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B;AAED,+DAA+D;AAC/D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAWhE;AAUD;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAmHnE"}
@@ -61,6 +61,19 @@ export function nodeWorkerPermission(process) {
61
61
  return undefined;
62
62
  }
63
63
  }
64
+ /**
65
+ * The permission Deno needs to load the guest module, or undefined for schemes it does
66
+ * not gate. An import query must name the port: a bare `jsr.io` asks about every port
67
+ * and reads "prompt", although Deno grants `jsr.io:443` by default.
68
+ */
69
+ export function guestModulePermission(url) {
70
+ if (url.protocol === "file:")
71
+ return { name: "read", path: url };
72
+ if (url.protocol !== "https:" && url.protocol !== "http:")
73
+ return undefined;
74
+ const port = url.port || (url.protocol === "https:" ? "443" : "80");
75
+ return { name: "import", host: `${url.hostname}:${port}` };
76
+ }
64
77
  /**
65
78
  * A Deno worker inherits the host's permissions and must be able to load its module.
66
79
  * Only the module itself is checked: its siblings and the QuickJS WASM file are not.
@@ -71,11 +84,7 @@ function denoWorkerPermission() {
71
84
  if (!query)
72
85
  return undefined;
73
86
  const url = guestUrl();
74
- const descriptor = url.protocol === "file:"
75
- ? { name: "read", path: url }
76
- : url.protocol === "https:" || url.protocol === "http:"
77
- ? { name: "import", host: url.host }
78
- : undefined;
87
+ const descriptor = guestModulePermission(url);
79
88
  if (!descriptor)
80
89
  return undefined;
81
90
  try {
@@ -17,7 +17,7 @@
17
17
  * @module lib/version
18
18
  */
19
19
  /** @mcpview/compose package version. */
20
- export declare const COMPOSE_VERSION: "0.14.0";
20
+ export declare const COMPOSE_VERSION: "0.14.1";
21
21
  /**
22
22
  * MCP Apps protocol version targeted by compose.
23
23
  *
@@ -17,7 +17,7 @@
17
17
  * @module lib/version
18
18
  */
19
19
  /** @mcpview/compose package version. */
20
- export const COMPOSE_VERSION = "0.14.0";
20
+ export const COMPOSE_VERSION = "0.14.1";
21
21
  /**
22
22
  * MCP Apps protocol version targeted by compose.
23
23
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpview/compose",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Compose and synchronize multiple MCP Apps UIs into composite dashboards",
5
5
  "keywords": [
6
6
  "mcp",
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../../src/src/code-mode/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnD,qCAAqC;AACrC,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAC;IACtC,gKAAgK;IAChK,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CAC1C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,GAAE,OAAO,CAAC,aAAa,CAAM,GAAG,aAAa,CA0B1F;AAOD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAgBxE;AAqBD,uGAAuG;AACvG,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAWjF;AAED,mGAAmG;AACnG,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,EAC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gB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAWjF;AAED,mGAAmG;AACnG,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,EAC9B,MAAM,EAAE,WAAW;AACnB,iGAAiG;AACjG,OAAO,GAAE,MAAM,OAA8B,GAC5C,OAAO,CAAC,OAAO,CAAC,CAYlB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,MAAM,EAAE,CACN,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,OAAO,EAAE,EACf,MAAM,EAAE,WAAW;AACnB,kGAAkG;AAClG,OAAO,EAAE,MAAM,OAAO,KACnB,OAAO,CAAC,OAAO,CAAC,EACrB,YAAY,CAAC,EAAE,WAAW,EAC1B,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,OAAO,CAAC,CA2FlB"}
@@ -80,7 +80,9 @@ function assertSandboxIsolation(isolation) {
80
80
  if (reason) {
81
81
  throw new errors_js_1.CodeModeError("SANDBOX_UNAVAILABLE", `Worker isolation is unavailable: ${reason}`, reason.includes("--allow-worker")
82
82
  ? 'Start Node with --allow-worker, or configure isolation: "inline"'
83
- : 'Configure isolation: "inline" explicitly for this runtime', { context: { isolation } });
83
+ : reason.startsWith("Deno has no ")
84
+ ? 'Grant that Deno permission, or configure isolation: "inline"'
85
+ : 'Configure isolation: "inline" explicitly for this runtime', { context: { isolation } });
84
86
  }
85
87
  }
86
88
  /** A JSON copy of the params, identical in both isolations. */
@@ -20,6 +20,18 @@ export interface NodeProcessLike {
20
20
  * does not count.
21
21
  */
22
22
  export declare function nodeWorkerPermission(process: NodeProcessLike | undefined): string | undefined;
23
+ /**
24
+ * The permission Deno needs to load the guest module, or undefined for schemes it does
25
+ * not gate. An import query must name the port: a bare `jsr.io` asks about every port
26
+ * and reads "prompt", although Deno grants `jsr.io:443` by default.
27
+ */
28
+ export declare function guestModulePermission(url: URL): {
29
+ name: "read";
30
+ path: URL;
31
+ } | {
32
+ name: "import";
33
+ host: string;
34
+ } | undefined;
23
35
  /** The part of the host's Node options that a Code Mode worker can start with. */
24
36
  export declare function nodeWorkerExecArgv(execArgv: readonly string[]): string[];
25
37
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"worker-host.d.ts","sourceRoot":"","sources":["../../../src/src/code-mode/worker-host.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAA2B,MAAM,aAAa,CAAC;AACrE,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAoBtE;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,GAAE,MAA8B,GAAG,MAAM,GAAG,SAAS,CAUpG;AAED,uFAAuF;AACvF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE;QAAE,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IACvD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CAC7D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAc7F;AA4CD,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAYxE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC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,EAAE,MAAM,GAAG,SAAS,CAAC,CAIpC;AAyDD;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,OAAO,EACd,WAAW,EAAE,MAAM,GAClB,WAAW,CAwBb;AAED,qCAAqC;AACrC,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,iFAAiF;IACjF,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3D,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B;AAED,+DAA+D;AAC/D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAWhE;AAUD;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAmHnE"}
@@ -25,6 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.workerIsolationUnavailable = workerIsolationUnavailable;
27
27
  exports.nodeWorkerPermission = nodeWorkerPermission;
28
+ exports.guestModulePermission = guestModulePermission;
28
29
  exports.nodeWorkerExecArgv = nodeWorkerExecArgv;
29
30
  exports.nodeWorkerNodeOptions = nodeWorkerNodeOptions;
30
31
  exports.parseNodeOptions = parseNodeOptions;
@@ -95,6 +96,19 @@ function nodeWorkerPermission(process) {
95
96
  return undefined;
96
97
  }
97
98
  }
99
+ /**
100
+ * The permission Deno needs to load the guest module, or undefined for schemes it does
101
+ * not gate. An import query must name the port: a bare `jsr.io` asks about every port
102
+ * and reads "prompt", although Deno grants `jsr.io:443` by default.
103
+ */
104
+ function guestModulePermission(url) {
105
+ if (url.protocol === "file:")
106
+ return { name: "read", path: url };
107
+ if (url.protocol !== "https:" && url.protocol !== "http:")
108
+ return undefined;
109
+ const port = url.port || (url.protocol === "https:" ? "443" : "80");
110
+ return { name: "import", host: `${url.hostname}:${port}` };
111
+ }
98
112
  /**
99
113
  * A Deno worker inherits the host's permissions and must be able to load its module.
100
114
  * Only the module itself is checked: its siblings and the QuickJS WASM file are not.
@@ -105,11 +119,7 @@ function denoWorkerPermission() {
105
119
  if (!query)
106
120
  return undefined;
107
121
  const url = guestUrl();
108
- const descriptor = url.protocol === "file:"
109
- ? { name: "read", path: url }
110
- : url.protocol === "https:" || url.protocol === "http:"
111
- ? { name: "import", host: url.host }
112
- : undefined;
122
+ const descriptor = guestModulePermission(url);
113
123
  if (!descriptor)
114
124
  return undefined;
115
125
  try {
@@ -17,7 +17,7 @@
17
17
  * @module lib/version
18
18
  */
19
19
  /** @mcpview/compose package version. */
20
- export declare const COMPOSE_VERSION: "0.14.0";
20
+ export declare const COMPOSE_VERSION: "0.14.1";
21
21
  /**
22
22
  * MCP Apps protocol version targeted by compose.
23
23
  *
@@ -20,7 +20,7 @@
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.MCP_APPS_PROTOCOL_VERSION = exports.COMPOSE_VERSION = void 0;
22
22
  /** @mcpview/compose package version. */
23
- exports.COMPOSE_VERSION = "0.14.0";
23
+ exports.COMPOSE_VERSION = "0.14.1";
24
24
  /**
25
25
  * MCP Apps protocol version targeted by compose.
26
26
  *