@mcpview/compose 0.14.1 → 0.15.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +101 -1
  2. package/README.md +113 -22
  3. package/esm/src/code-mode/engine.d.ts +59 -0
  4. package/esm/src/code-mode/engine.d.ts.map +1 -0
  5. package/esm/src/code-mode/engine.js +189 -0
  6. package/esm/src/code-mode/guest-worker.d.ts +2 -5
  7. package/esm/src/code-mode/guest-worker.d.ts.map +1 -1
  8. package/esm/src/code-mode/guest-worker.js +4 -75
  9. package/esm/src/code-mode/sandbox-api.d.ts +37 -0
  10. package/esm/src/code-mode/sandbox-api.d.ts.map +1 -0
  11. package/esm/src/code-mode/sandbox-api.js +36 -0
  12. package/esm/src/code-mode/sandbox-core.d.ts +99 -21
  13. package/esm/src/code-mode/sandbox-core.d.ts.map +1 -1
  14. package/esm/src/code-mode/sandbox-core.js +926 -221
  15. package/esm/src/code-mode/sandbox-worker.d.ts +37 -0
  16. package/esm/src/code-mode/sandbox-worker.d.ts.map +1 -0
  17. package/esm/src/code-mode/sandbox-worker.js +140 -0
  18. package/esm/src/code-mode/sandbox.d.ts +142 -29
  19. package/esm/src/code-mode/sandbox.d.ts.map +1 -1
  20. package/esm/src/code-mode/sandbox.js +399 -67
  21. package/esm/src/code-mode/surface.d.ts +148 -0
  22. package/esm/src/code-mode/surface.d.ts.map +1 -0
  23. package/esm/src/code-mode/surface.js +204 -0
  24. package/esm/src/code-mode/tool.js +1 -1
  25. package/esm/src/code-mode/worker-host.d.ts +39 -11
  26. package/esm/src/code-mode/worker-host.d.ts.map +1 -1
  27. package/esm/src/code-mode/worker-host.js +100 -43
  28. package/esm/src/code-mode/worker-protocol.d.ts +45 -8
  29. package/esm/src/code-mode/worker-protocol.d.ts.map +1 -1
  30. package/esm/src/code-mode/worker-protocol.js +4 -2
  31. package/esm/src/version.d.ts +1 -1
  32. package/esm/src/version.js +1 -1
  33. package/package.json +9 -1
  34. package/script/src/code-mode/engine.d.ts +59 -0
  35. package/script/src/code-mode/engine.d.ts.map +1 -0
  36. package/script/src/code-mode/engine.js +198 -0
  37. package/script/src/code-mode/guest-worker.d.ts +2 -5
  38. package/script/src/code-mode/guest-worker.d.ts.map +1 -1
  39. package/script/src/code-mode/guest-worker.js +4 -98
  40. package/script/src/code-mode/sandbox-api.d.ts +37 -0
  41. package/script/src/code-mode/sandbox-api.d.ts.map +1 -0
  42. package/script/src/code-mode/sandbox-api.js +50 -0
  43. package/script/src/code-mode/sandbox-core.d.ts +99 -21
  44. package/script/src/code-mode/sandbox-core.d.ts.map +1 -1
  45. package/script/src/code-mode/sandbox-core.js +931 -221
  46. package/script/src/code-mode/sandbox-worker.d.ts +37 -0
  47. package/script/src/code-mode/sandbox-worker.d.ts.map +1 -0
  48. package/script/src/code-mode/sandbox-worker.js +166 -0
  49. package/script/src/code-mode/sandbox.d.ts +142 -29
  50. package/script/src/code-mode/sandbox.d.ts.map +1 -1
  51. package/script/src/code-mode/sandbox.js +429 -72
  52. package/script/src/code-mode/surface.d.ts +148 -0
  53. package/script/src/code-mode/surface.d.ts.map +1 -0
  54. package/script/src/code-mode/surface.js +211 -0
  55. package/script/src/code-mode/tool.js +1 -1
  56. package/script/src/code-mode/worker-host.d.ts +39 -11
  57. package/script/src/code-mode/worker-host.d.ts.map +1 -1
  58. package/script/src/code-mode/worker-host.js +100 -42
  59. package/script/src/code-mode/worker-protocol.d.ts +45 -8
  60. package/script/src/code-mode/worker-protocol.d.ts.map +1 -1
  61. package/script/src/code-mode/worker-protocol.js +4 -2
  62. package/script/src/version.d.ts +1 -1
  63. package/script/src/version.js +1 -1
@@ -32,6 +32,7 @@ exports.parseNodeOptions = parseNodeOptions;
32
32
  exports.nodeWorkerEnv = nodeWorkerEnv;
33
33
  exports.encodeReply = encodeReply;
34
34
  exports.workerSpawnFailure = workerSpawnFailure;
35
+ exports.workerNotStarted = workerNotStarted;
35
36
  exports.runInWorker = runInWorker;
36
37
  /**
37
38
  * Host side of worker isolation: one short-lived worker per program, so a
@@ -61,7 +62,7 @@ function workerRuntime(scope = dntShim.dntGlobalThis) {
61
62
  * Why worker isolation cannot run here, or undefined when it can. `scope` is the
62
63
  * global object to inspect.
63
64
  */
64
- function workerIsolationUnavailable(scope = dntShim.dntGlobalThis) {
65
+ function workerIsolationUnavailable(scope = dntShim.dntGlobalThis, worker = guestUrl()) {
65
66
  if (typeof SharedArrayBuffer !== "function")
66
67
  return "SharedArrayBuffer is not available";
67
68
  const runtime = workerRuntime(scope);
@@ -73,7 +74,7 @@ function workerIsolationUnavailable(scope = dntShim.dntGlobalThis) {
73
74
  if (runtime === "node") {
74
75
  return nodeWorkerPermission(scope.process);
75
76
  }
76
- return denoWorkerPermission();
77
+ return denoWorkerPermission(worker);
77
78
  }
78
79
  /**
79
80
  * Why Node's enforced permission model forbids workers, or undefined. Audit mode
@@ -111,14 +112,13 @@ function guestModulePermission(url) {
111
112
  }
112
113
  /**
113
114
  * A Deno worker inherits the host's permissions and must be able to load its module.
114
- * Only the module itself is checked: its siblings and the QuickJS WASM file are not.
115
+ * Only the module itself is checked: the modules it imports are not.
115
116
  */
116
- function denoWorkerPermission() {
117
+ function denoWorkerPermission(url) {
117
118
  const deno = dntShim.dntGlobalThis.Deno;
118
119
  const query = deno?.permissions?.querySync;
119
120
  if (!query)
120
121
  return undefined;
121
- const url = guestUrl();
122
122
  const descriptor = guestModulePermission(url);
123
123
  if (!descriptor)
124
124
  return undefined;
@@ -224,26 +224,31 @@ function guestUrl() {
224
224
  function importNodeBuiltin(name) {
225
225
  return Promise.resolve(`${`node:${name}`}`).then(s => __importStar(require(s)));
226
226
  }
227
- async function spawn(onMessage, onFailure) {
227
+ async function spawn(onMessage,
228
+ /** `ended` is true when the worker's module ran to its end and the thread exited by itself. */
229
+ onFailure, url) {
228
230
  if (workerRuntime() === "node") {
229
231
  const { Worker } = await importNodeBuiltin("worker_threads");
230
232
  const process = dntShim.dntGlobalThis.process;
231
- const worker = new Worker(guestUrl(), {
233
+ const worker = new Worker(url, {
232
234
  execArgv: nodeWorkerExecArgv(process?.execArgv ?? []),
233
235
  env: nodeWorkerEnv(process?.env ?? {}),
234
236
  });
237
+ // A thread with nothing left to do exits with code 0: under Node that is
238
+ // how a module that never served the sandbox ends. Deno keeps it alive.
239
+ const onExit = (code) => onFailure(code === 0);
235
240
  worker.on("message", onMessage);
236
- worker.on("error", onFailure);
237
- worker.on("exit", onFailure);
241
+ worker.on("error", () => onFailure());
242
+ worker.on("exit", onExit);
238
243
  return {
239
244
  post: (message) => worker.postMessage(message),
240
245
  terminate: () => {
241
- worker.off("exit", onFailure);
246
+ worker.off("exit", onExit);
242
247
  void worker.terminate();
243
248
  },
244
249
  };
245
250
  }
246
- const worker = new Worker(guestUrl(), { type: "module" });
251
+ const worker = new Worker(url, { type: "module" });
247
252
  worker.onmessage = (event) => onMessage(event.data);
248
253
  worker.onerror = (event) => {
249
254
  event.preventDefault();
@@ -257,27 +262,18 @@ async function spawn(onMessage, onFailure) {
257
262
  * posted, so an oversized result never crosses the worker boundary (no parse and
258
263
  * no structured clone). The guest decodes the text.
259
264
  */
260
- function encodeReply(id, operation, value, valueLength) {
261
- let json;
265
+ function encodeReply(id, operation, value, valueLength, namespace,
266
+ /** True when the host completed the call and its effect cannot be undone. */
267
+ irreversible = false) {
268
+ const done = irreversible ? { irreversible: true } : {};
262
269
  try {
263
- // Like the inline path, drop what JSON drops (functions, undefined).
264
- json = JSON.stringify(value ?? null);
270
+ // The same rule as the inline path: one function decides what crosses.
271
+ const json = (0, sandbox_core_js_1.encodeHostValue)(namespace, operation, value, valueLength);
272
+ return { type: "reply", id, ok: true, json, ...done };
265
273
  }
266
- catch {
267
- json = undefined;
268
- }
269
- if (json === undefined) {
270
- return {
271
- type: "reply",
272
- id,
273
- ok: false,
274
- error: new errors_js_1.CodeModeError("OPERATION_FAILED", `api.${operation} returned a value that is not JSON`, "Return plain JSON from the host operation").toJSON(),
275
- };
276
- }
277
- if (json.length > valueLength) {
278
- return { type: "reply", id, ok: false, error: (0, sandbox_core_js_1.receiptTooLarge)(valueLength).toJSON() };
274
+ catch (error) {
275
+ return { type: "reply", id, ok: false, error: error.toJSON(), ...done };
279
276
  }
280
- return { type: "reply", id, ok: true, json };
281
277
  }
282
278
  /** The error for a worker that could not be created at all. */
283
279
  function workerSpawnFailure(error) {
@@ -287,17 +283,30 @@ function workerSpawnFailure(error) {
287
283
  }
288
284
  return sandboxFailed();
289
285
  }
286
+ /**
287
+ * The error for a worker that loaded but never reported: it stayed silent for
288
+ * the wall time of the program (`wallMs`), or its module ran to its end and
289
+ * the thread exited. No program ran, so this is no time limit of the program.
290
+ */
291
+ function workerNotStarted(wallMs) {
292
+ return new errors_js_1.CodeModeError("SANDBOX_FAILED", wallMs === undefined
293
+ ? "The Code Mode worker ended without serving the sandbox"
294
+ : `The Code Mode worker did not start within ${wallMs} ms`, 'Check that the worker module loads and that its entry calls serveSandboxWorker, or configure isolation: "inline"', { context: { worker: "not-started", ...(wallMs !== undefined && { ms: wallMs }) } });
295
+ }
290
296
  function sandboxFailed() {
291
297
  return new errors_js_1.CodeModeError("SANDBOX_FAILED", "The Code Mode worker stopped unexpectedly", 'Run the program again. If the worker module cannot be loaded (a bundle without it, or a missing read or import permission), grant access to it or configure isolation: "inline"');
292
298
  }
293
299
  /**
294
- * Run one program in a fresh worker and settle once with its value or a
300
+ * Run one program in a fresh worker and settle once: with the JSON text of
301
+ * what the program returned (undefined when it returned nothing), or with a
295
302
  * {@link CodeModeError}. The worker is always terminated afterwards.
296
303
  *
297
304
  * @example
298
305
  * ```ts
299
- * const value = await runInWorker({
300
- * code: "return 1 + 1;", params: {}, limits: CODE_MODE_LIMITS,
306
+ * const json = await runInWorker({
307
+ * code: "return 1 + 1;",
308
+ * surface: { namespace: "api", operations: {}, budgets: {} },
309
+ * limits: SANDBOX_RESOURCE_LIMITS,
301
310
  * call: () => Promise.reject(new Error("unused")), signal: new AbortController().signal,
302
311
  * });
303
312
  * ```
@@ -307,6 +316,8 @@ function runInWorker(input) {
307
316
  return new Promise((resolve, reject) => {
308
317
  let port;
309
318
  let settled = false;
319
+ /** True once the worker reported: there is a guest that may need time to stop. */
320
+ let ready = false;
310
321
  let grace;
311
322
  const finish = (outcome) => {
312
323
  if (settled)
@@ -318,6 +329,11 @@ function runInWorker(input) {
318
329
  port?.terminate();
319
330
  };
320
331
  function stop() {
332
+ if (!ready) {
333
+ // No guest to wait for: the worker never reported.
334
+ finish(() => reject(input.signal.reason));
335
+ return;
336
+ }
321
337
  Atomics.store(cancel, 0, 1);
322
338
  // A guest blocked in a host call is released by that call's own abort;
323
339
  // one stuck in a native operation gets a grace period, then is dropped.
@@ -346,14 +362,46 @@ function runInWorker(input) {
346
362
  }
347
363
  switch (message.type) {
348
364
  case "ready":
365
+ // A worker reports once: a second report starts nothing.
366
+ if (ready)
367
+ return;
368
+ ready = true;
369
+ input.started?.();
349
370
  send({
350
371
  type: "run",
351
372
  code: input.code,
352
- params: input.params,
373
+ surface: input.surface,
353
374
  limits: input.limits,
375
+ referenceKey: input.referenceKey,
376
+ asksAboutUnsent: input.unsent !== undefined,
354
377
  cancel: cancel.buffer,
355
378
  });
356
379
  return;
380
+ case "unsent": {
381
+ // The guest asks only when the host said it decides.
382
+ const decide = input.unsent;
383
+ if (!decide) {
384
+ finish(() => reject(sandboxFailed()));
385
+ return;
386
+ }
387
+ decide(message.calls).then(() => {
388
+ if (!settled)
389
+ send({ type: "unsent-reply", ok: true });
390
+ }, (error) => {
391
+ if (settled)
392
+ return;
393
+ if (error instanceof errors_js_1.CodeModeError) {
394
+ send({
395
+ type: "unsent-reply",
396
+ ok: false,
397
+ error: errors_js_1.CodeModeError.prototype.toJSON.call(error),
398
+ });
399
+ }
400
+ else
401
+ finish(() => reject(sandboxFailed()));
402
+ });
403
+ return;
404
+ }
357
405
  case "call": {
358
406
  const { id } = message;
359
407
  // Building a reply runs host-controlled code (a provider error's own
@@ -368,25 +416,35 @@ function runInWorker(input) {
368
416
  finish(() => reject(sandboxFailed()));
369
417
  }
370
418
  };
371
- input.call(message.operation, message.args).then((value) => reply(() => encodeReply(id, message.operation, value, input.limits.valueLength)), (error) => reply(() => ({
372
- type: "reply",
373
- id,
374
- ok: false,
375
- // The base serializer reads plain fields: a subclass cannot override it.
376
- error: errors_js_1.CodeModeError.prototype.toJSON.call(error instanceof errors_js_1.CodeModeError ? error : new errors_js_1.CodeModeError("OPERATION_FAILED", `api.${message.operation} failed`, "Check the arguments, then retry once")),
377
- })));
419
+ input.call(message.operation, message.args, id).then((value) => reply(() => encodeReply(id, message.operation, value, input.limits.valueLength, input.surface.namespace, input.mustDeliver?.(id) === true)), (error) => reply(() => {
420
+ // The worker rebuilds the carrier from the call it is waiting on.
421
+ if (error instanceof sandbox_core_js_1.HostErrorCarrier) {
422
+ return { type: "reply", id, ok: false, host: error.shown };
423
+ }
424
+ const failure = error instanceof errors_js_1.CodeModeError
425
+ ? error
426
+ : (0, sandbox_core_js_1.operationFailed)(input.surface.namespace, message.operation);
427
+ return {
428
+ type: "reply",
429
+ id,
430
+ ok: false,
431
+ // The base serializer reads plain fields: a subclass cannot override it.
432
+ error: errors_js_1.CodeModeError.prototype.toJSON.call(failure),
433
+ };
434
+ }));
378
435
  return;
379
436
  }
380
437
  case "done":
381
438
  // A guest can finish during the stop grace period: an abort still wins.
382
- finish(() => input.signal.aborted ? reject(input.signal.reason) : resolve(message.value));
439
+ finish(() => input.signal.aborted ? reject(input.signal.reason) : resolve(message.json));
383
440
  return;
384
441
  case "fail":
385
442
  finish(() => reject((0, errors_js_1.codeModeErrorFromFields)(message.error) ?? sandboxFailed()));
386
443
  return;
387
444
  }
388
445
  };
389
- spawn(onMessage, () => finish(() => reject(sandboxFailed()))).then((spawned) => {
446
+ const onFailure = (ended = false) => finish(() => reject(ended && !ready ? workerNotStarted() : sandboxFailed()));
447
+ spawn(onMessage, onFailure, input.worker ?? guestUrl()).then((spawned) => {
390
448
  if (settled) {
391
449
  spawned.terminate();
392
450
  return;
@@ -1,30 +1,59 @@
1
1
  /**
2
- * Messages between the host and the Code Mode guest worker. Only JSON values
3
- * and one SharedArrayBuffer (the cancel flag) cross the boundary.
2
+ * Messages between the host and the Code Mode guest worker. Every value of a
3
+ * program crosses as JSON text, never as a tree of objects: copying a tree
4
+ * between threads has a nesting limit of its own, which the other isolation
5
+ * does not have. One SharedArrayBuffer crosses too: the cancel flag.
4
6
  *
5
7
  * @module code-mode/worker-protocol
6
8
  */
7
9
  import type { CodeModeErrorFields } from "./errors.js";
8
- import type { SandboxLimits } from "./sandbox-core.js";
10
+ import type { EncodedSurface, HostErrorShown, SandboxResourceLimits, UnsentCall } from "./sandbox-core.js";
9
11
  /** Host to worker. */
10
12
  export type HostMessage = {
11
13
  readonly type: "run";
12
14
  readonly code: string;
13
- readonly params: Record<string, unknown>;
14
- readonly limits: SandboxLimits;
15
+ /** Plain data: a name, the JSON text of each constant and the table of operations. */
16
+ readonly surface: EncodedSurface;
17
+ readonly limits: SandboxResourceLimits;
18
+ /** The key of the record that stands for an earlier result, when the surface uses references. */
19
+ readonly referenceKey?: string;
20
+ /** True when the host decides about unsent calls: the guest then asks before it completes. */
21
+ readonly asksAboutUnsent: boolean;
15
22
  /** Int32Array flag: 1 asks the guest to stop at its next interrupt check. */
16
23
  readonly cancel: SharedArrayBuffer;
24
+ } | {
25
+ /** The host lets the program's value stand although calls were not sent. */
26
+ readonly type: "unsent-reply";
27
+ readonly ok: true;
28
+ } | {
29
+ /** The host refuses: the run fails with this error. */
30
+ readonly type: "unsent-reply";
31
+ readonly ok: false;
32
+ readonly error: CodeModeErrorFields;
17
33
  } | {
18
34
  readonly type: "reply";
19
35
  readonly id: number;
20
36
  readonly ok: true;
21
37
  /** The JSON text of the result, already within `limits.valueLength`. */
22
38
  readonly json: string;
39
+ /** The host completed this call and its effect cannot be undone. */
40
+ readonly irreversible?: true;
23
41
  } | {
24
42
  readonly type: "reply";
25
43
  readonly id: number;
26
44
  readonly ok: false;
27
45
  readonly error: CodeModeErrorFields;
46
+ /**
47
+ * The host completed this call, its effect cannot be undone, and this error
48
+ * is about its result, which could not be sent.
49
+ */
50
+ readonly irreversible?: true;
51
+ } | {
52
+ readonly type: "reply";
53
+ readonly id: number;
54
+ readonly ok: false;
55
+ /** The host rejected with its own error: what the program is shown. */
56
+ readonly host: HostErrorShown;
28
57
  };
29
58
  /** Worker to host. */
30
59
  export type GuestMessage = {
@@ -33,10 +62,18 @@ export type GuestMessage = {
33
62
  readonly type: "call";
34
63
  readonly id: number;
35
64
  readonly operation: string;
36
- readonly args: unknown[];
37
- } | {
65
+ /** The JSON text of the list of arguments. */
66
+ readonly args: string;
67
+ }
68
+ /** The program finished normally with calls it did not wait for: the host decides. */
69
+ | {
70
+ readonly type: "unsent";
71
+ readonly calls: UnsentCall[];
72
+ }
73
+ /** `json` is the JSON text of what the program returned; absent when it returned nothing. */
74
+ | {
38
75
  readonly type: "done";
39
- readonly value: unknown;
76
+ readonly json?: string;
40
77
  } | {
41
78
  readonly type: "fail";
42
79
  readonly error: CodeModeErrorFields;
@@ -1 +1 @@
1
- {"version":3,"file":"worker-protocol.d.ts","sourceRoot":"","sources":["../../../src/src/code-mode/worker-protocol.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,sBAAsB;AACtB,MAAM,MAAM,WAAW,GACnB;IACA,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,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,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;CACpC,GACC;IACA,QAA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C;IACnB,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;CAC/B,CAAC;AAEJ,sBAAsB;AACtB,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAC1B;IACA,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AACD,sFAAsF;GACpF;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,CAAA;CAAE;AAC3D,6FAA6F;GAC3F;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAA;CAAE,CAAC"}
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  /**
3
- * Messages between the host and the Code Mode guest worker. Only JSON values
4
- * and one SharedArrayBuffer (the cancel flag) cross the boundary.
3
+ * Messages between the host and the Code Mode guest worker. Every value of a
4
+ * program crosses as JSON text, never as a tree of objects: copying a tree
5
+ * between threads has a nesting limit of its own, which the other isolation
6
+ * does not have. One SharedArrayBuffer crosses too: the cancel flag.
5
7
  *
6
8
  * @module code-mode/worker-protocol
7
9
  */
@@ -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.1";
20
+ export declare const COMPOSE_VERSION: "0.15.0";
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.1";
23
+ exports.COMPOSE_VERSION = "0.15.0";
24
24
  /**
25
25
  * MCP Apps protocol version targeted by compose.
26
26
  *