@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.
- package/CHANGELOG.md +101 -1
- package/README.md +113 -22
- package/esm/src/code-mode/engine.d.ts +59 -0
- package/esm/src/code-mode/engine.d.ts.map +1 -0
- package/esm/src/code-mode/engine.js +189 -0
- package/esm/src/code-mode/guest-worker.d.ts +2 -5
- package/esm/src/code-mode/guest-worker.d.ts.map +1 -1
- package/esm/src/code-mode/guest-worker.js +4 -75
- package/esm/src/code-mode/sandbox-api.d.ts +37 -0
- package/esm/src/code-mode/sandbox-api.d.ts.map +1 -0
- package/esm/src/code-mode/sandbox-api.js +36 -0
- package/esm/src/code-mode/sandbox-core.d.ts +99 -21
- package/esm/src/code-mode/sandbox-core.d.ts.map +1 -1
- package/esm/src/code-mode/sandbox-core.js +926 -221
- package/esm/src/code-mode/sandbox-worker.d.ts +37 -0
- package/esm/src/code-mode/sandbox-worker.d.ts.map +1 -0
- package/esm/src/code-mode/sandbox-worker.js +140 -0
- package/esm/src/code-mode/sandbox.d.ts +142 -29
- package/esm/src/code-mode/sandbox.d.ts.map +1 -1
- package/esm/src/code-mode/sandbox.js +399 -67
- package/esm/src/code-mode/surface.d.ts +148 -0
- package/esm/src/code-mode/surface.d.ts.map +1 -0
- package/esm/src/code-mode/surface.js +204 -0
- package/esm/src/code-mode/tool.js +1 -1
- package/esm/src/code-mode/worker-host.d.ts +39 -11
- package/esm/src/code-mode/worker-host.d.ts.map +1 -1
- package/esm/src/code-mode/worker-host.js +100 -43
- package/esm/src/code-mode/worker-protocol.d.ts +45 -8
- package/esm/src/code-mode/worker-protocol.d.ts.map +1 -1
- package/esm/src/code-mode/worker-protocol.js +4 -2
- package/esm/src/version.d.ts +1 -1
- package/esm/src/version.js +1 -1
- package/package.json +9 -1
- package/script/src/code-mode/engine.d.ts +59 -0
- package/script/src/code-mode/engine.d.ts.map +1 -0
- package/script/src/code-mode/engine.js +198 -0
- package/script/src/code-mode/guest-worker.d.ts +2 -5
- package/script/src/code-mode/guest-worker.d.ts.map +1 -1
- package/script/src/code-mode/guest-worker.js +4 -98
- package/script/src/code-mode/sandbox-api.d.ts +37 -0
- package/script/src/code-mode/sandbox-api.d.ts.map +1 -0
- package/script/src/code-mode/sandbox-api.js +50 -0
- package/script/src/code-mode/sandbox-core.d.ts +99 -21
- package/script/src/code-mode/sandbox-core.d.ts.map +1 -1
- package/script/src/code-mode/sandbox-core.js +931 -221
- package/script/src/code-mode/sandbox-worker.d.ts +37 -0
- package/script/src/code-mode/sandbox-worker.d.ts.map +1 -0
- package/script/src/code-mode/sandbox-worker.js +166 -0
- package/script/src/code-mode/sandbox.d.ts +142 -29
- package/script/src/code-mode/sandbox.d.ts.map +1 -1
- package/script/src/code-mode/sandbox.js +429 -72
- package/script/src/code-mode/surface.d.ts +148 -0
- package/script/src/code-mode/surface.d.ts.map +1 -0
- package/script/src/code-mode/surface.js +211 -0
- package/script/src/code-mode/tool.js +1 -1
- package/script/src/code-mode/worker-host.d.ts +39 -11
- package/script/src/code-mode/worker-host.d.ts.map +1 -1
- package/script/src/code-mode/worker-host.js +100 -42
- package/script/src/code-mode/worker-protocol.d.ts +45 -8
- package/script/src/code-mode/worker-protocol.d.ts.map +1 -1
- package/script/src/code-mode/worker-protocol.js +4 -2
- package/script/src/version.d.ts +1 -1
- 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:
|
|
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,
|
|
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(
|
|
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",
|
|
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",
|
|
246
|
+
worker.off("exit", onExit);
|
|
242
247
|
void worker.terminate();
|
|
243
248
|
},
|
|
244
249
|
};
|
|
245
250
|
}
|
|
246
|
-
const worker = new Worker(
|
|
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
|
-
|
|
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
|
-
//
|
|
264
|
-
json =
|
|
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
|
-
|
|
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
|
|
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
|
|
300
|
-
* code: "return 1 + 1;",
|
|
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
|
-
|
|
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
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
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.
|
|
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
|
-
|
|
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.
|
|
3
|
-
*
|
|
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 {
|
|
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
|
-
|
|
14
|
-
readonly
|
|
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
|
-
|
|
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
|
|
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
|
|
1
|
+
{"version":3,"file":"worker-protocol.d.ts","sourceRoot":"","sources":["../../../src/src/code-mode/worker-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,UAAU,EACX,MAAM,mBAAmB,CAAC;AAE3B,sBAAsB;AACtB,MAAM,MAAM,WAAW,GACnB;IACA,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sFAAsF;IACtF,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACvC,iGAAiG;IACjG,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,8FAA8F;IAC9F,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;CACpC,GACC;IACA,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;CACnB,GACC;IACA,uDAAuD;IACvD,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC;CACrC,GACC;IACA,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;CAC9B,GACC;IACA,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;CAC9B,GACC;IACA,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;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.
|
|
4
|
-
*
|
|
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
|
*/
|
package/script/src/version.d.ts
CHANGED
package/script/src/version.js
CHANGED
|
@@ -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.
|
|
23
|
+
exports.COMPOSE_VERSION = "0.15.0";
|
|
24
24
|
/**
|
|
25
25
|
* MCP Apps protocol version targeted by compose.
|
|
26
26
|
*
|