wasm-idle 1.1.0 → 1.2.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/README.md +267 -112
- package/dist/container/bash-profile.d.ts +80 -0
- package/dist/container/bash-profile.js +328 -0
- package/dist/container/binding.d.ts +39 -0
- package/dist/container/binding.js +331 -0
- package/dist/container/clang-runtime.d.ts +42 -0
- package/dist/container/clang-runtime.js +561 -0
- package/dist/container/client.d.ts +14 -0
- package/dist/container/client.js +185 -0
- package/dist/container/explorer.d.ts +31 -0
- package/dist/container/explorer.js +112 -0
- package/dist/container/index.d.ts +11 -0
- package/dist/container/index.js +11 -0
- package/dist/container/owner-worker.d.ts +19 -0
- package/dist/container/owner-worker.js +464 -0
- package/dist/container/protocol.d.ts +84 -0
- package/dist/container/protocol.js +28 -0
- package/dist/container/runtime-adapter.d.ts +75 -0
- package/dist/container/runtime-adapter.js +537 -0
- package/dist/container/shell-control.d.ts +49 -0
- package/dist/container/shell-control.js +360 -0
- package/dist/container/workspace.d.ts +12 -0
- package/dist/container/workspace.js +29 -0
- package/dist/index.d.ts +1 -1
- package/dist/playground/assetBridge.js +111 -33
- package/dist/playground/assets.d.ts +10 -2
- package/dist/playground/c3.js +22 -0
- package/dist/playground/c3Memory.d.ts +19 -0
- package/dist/playground/c3Memory.js +117 -0
- package/dist/playground/cachedClang.js +143 -34
- package/dist/playground/clang.d.ts +5 -1
- package/dist/playground/clang.js +61 -5
- package/dist/playground/clangAssetIntegrity.js +6 -6
- package/dist/playground/clangWorkerProtocol.d.ts +12 -1
- package/dist/playground/cobol.d.ts +3 -0
- package/dist/playground/cobol.js +10 -1
- package/dist/playground/commonlispAssets.d.ts +2 -2
- package/dist/playground/compiledArtifactCache.d.ts +3 -1
- package/dist/playground/compiledArtifactCache.js +31 -5
- package/dist/playground/compiledLldb.d.ts +41 -0
- package/dist/playground/compiledLldb.js +167 -0
- package/dist/playground/d.d.ts +10 -2
- package/dist/playground/d.js +161 -14
- package/dist/playground/debugDeadline.d.ts +12 -0
- package/dist/playground/debugDeadline.js +34 -0
- package/dist/playground/debugMailbox.d.ts +12 -0
- package/dist/playground/debugMailbox.js +77 -0
- package/dist/playground/dotnet.js +6 -8
- package/dist/playground/fortran.d.ts +3 -0
- package/dist/playground/fortran.js +10 -1
- package/dist/playground/go.js +23 -7
- package/dist/playground/goDebugInstrumentation.js +207 -97
- package/dist/playground/java-debug-FMHDKUN6.js +124 -0
- package/dist/playground/java-debug-notices.txt +492 -0
- package/dist/playground/java.d.ts +17 -1
- package/dist/playground/java.js +162 -5
- package/dist/playground/javaDebug.d.ts +62 -0
- package/dist/playground/javaDebug.js +305 -0
- package/dist/playground/javaDebugBridge.d.ts +6 -0
- package/dist/playground/javaDebugBridge.js +250 -0
- package/dist/playground/javaDebugSource.d.ts +9 -0
- package/dist/playground/javaDebugSource.js +4 -0
- package/dist/playground/javaRuntimeErrors.d.ts +9 -0
- package/dist/playground/javaRuntimeErrors.js +93 -0
- package/dist/playground/lean4Assets.d.ts +1 -25
- package/dist/playground/lean4Assets.js +2 -123
- package/dist/playground/lfortran.js +10 -0
- package/dist/playground/lfortranAssets.d.ts +2 -2
- package/dist/playground/lldbSession.d.ts +23 -2
- package/dist/playground/lldbSession.js +278 -58
- package/dist/playground/lldbSourcePath.d.ts +2 -0
- package/dist/playground/lldbSourcePath.js +9 -0
- package/dist/playground/lua.d.ts +20 -1
- package/dist/playground/lua.js +190 -8
- package/dist/playground/luaDebug.d.ts +1 -0
- package/dist/playground/luaDebug.js +1 -0
- package/dist/playground/nim.d.ts +1 -0
- package/dist/playground/nim.js +30 -0
- package/dist/playground/objectivec.d.ts +10 -6
- package/dist/playground/objectivec.js +85 -10
- package/dist/playground/options.d.ts +12 -4
- package/dist/playground/python.d.ts +8 -1
- package/dist/playground/python.js +89 -6
- package/dist/playground/ruby.d.ts +10 -1
- package/dist/playground/ruby.js +66 -1
- package/dist/playground/rubyDebug.d.ts +21 -0
- package/dist/playground/rubyDebug.js +128 -0
- package/dist/playground/runtimeAssetCache.d.ts +1 -32
- package/dist/playground/runtimeAssetCache.js +1 -193
- package/dist/playground/runtimeSession.d.ts +2 -2
- package/dist/playground/runtimeSession.js +11 -11
- package/dist/playground/rust.d.ts +10 -0
- package/dist/playground/rust.js +230 -51
- package/dist/playground/sandbox.d.ts +8 -1
- package/dist/playground/staticStdinRing.d.ts +2 -1
- package/dist/playground/staticStdinRing.js +21 -10
- package/dist/playground/staticWorkerRuntime.d.ts +15 -1
- package/dist/playground/staticWorkerRuntime.js +127 -19
- package/dist/playground/stdinBuffer.d.ts +1 -1
- package/dist/playground/stdinBuffer.js +19 -2
- package/dist/playground/tinygo.d.ts +3 -0
- package/dist/playground/tinygo.js +88 -6
- package/dist/playground/typescript.js +8 -0
- package/dist/playground/v.d.ts +6 -2
- package/dist/playground/v.js +76 -13
- package/dist/playground/wasmAwkVersion.d.ts +13 -13
- package/dist/playground/wasmAwkVersion.js +4 -4
- package/dist/playground/wasmBqnVersion.d.ts +2 -2
- package/dist/playground/wasmBqnVersion.js +2 -2
- package/dist/playground/wasmC3Version.d.ts +2 -2
- package/dist/playground/wasmC3Version.js +2 -2
- package/dist/playground/wasmClojureScriptVersion.d.ts +2 -2
- package/dist/playground/wasmClojureScriptVersion.js +2 -2
- package/dist/playground/wasmCommonLispVersion.d.ts +2 -2
- package/dist/playground/wasmCommonLispVersion.js +2 -2
- package/dist/playground/wasmDIntegrity.d.ts +5 -5
- package/dist/playground/wasmDIntegrity.js +5 -5
- package/dist/playground/wasmDVersion.d.ts +16 -1
- package/dist/playground/wasmDVersion.js +16 -1
- package/dist/playground/wasmDebugVersion.d.ts +1 -1
- package/dist/playground/wasmDebugVersion.js +1 -1
- package/dist/playground/wasmForthVersion.d.ts +2 -2
- package/dist/playground/wasmForthVersion.js +2 -2
- package/dist/playground/wasmGleamVersion.d.ts +2 -2
- package/dist/playground/wasmGleamVersion.js +2 -2
- package/dist/playground/wasmGrainVersion.d.ts +2 -2
- package/dist/playground/wasmGrainVersion.js +2 -2
- package/dist/playground/wasmJVersion.d.ts +2 -2
- package/dist/playground/wasmJVersion.js +2 -2
- package/dist/playground/wasmJanetVersion.js +2 -2
- package/dist/playground/wasmJuliaVersion.js +2 -2
- package/dist/playground/wasmLean4Version.d.ts +1 -110
- package/dist/playground/wasmLean4Version.js +2 -111
- package/dist/playground/wasmLfortranVersion.d.ts +2 -2
- package/dist/playground/wasmLfortranVersion.js +2 -2
- package/dist/playground/wasmLuaVersion.d.ts +1 -1
- package/dist/playground/wasmLuaVersion.js +1 -1
- package/dist/playground/wasmNimVersion.d.ts +9 -9
- package/dist/playground/wasmNimVersion.js +6 -6
- package/dist/playground/wasmOcamlVersion.d.ts +2 -2
- package/dist/playground/wasmOcamlVersion.js +1 -1
- package/dist/playground/wasmPascalVersion.js +2 -2
- package/dist/playground/wasmPerlVersion.js +2 -2
- package/dist/playground/wasmPrologVersion.d.ts +2 -2
- package/dist/playground/wasmPrologVersion.js +2 -2
- package/dist/playground/wasmReScriptVersion.d.ts +2 -2
- package/dist/playground/wasmReScriptVersion.js +2 -2
- package/dist/playground/wasmRustVersion.d.ts +26 -38
- package/dist/playground/wasmRustVersion.js +25 -40
- package/dist/playground/wasmTclVersion.d.ts +4 -4
- package/dist/playground/wasmTclVersion.js +2 -2
- package/dist/playground/wasmTinyGoVersion.d.ts +14 -14
- package/dist/playground/wasmTinyGoVersion.js +14 -14
- package/dist/playground/wasmTypeScriptVersion.d.ts +5 -5
- package/dist/playground/wasmTypeScriptVersion.js +5 -5
- package/dist/playground/worker/cachedClangCompile.js +52 -4
- package/dist/playground/worker/cachedClangExecute.js +6 -5
- package/dist/playground/worker/clang.js +33 -11
- package/dist/playground/worker/cobol.js +3 -3
- package/dist/playground/worker/d.js +63 -7
- package/dist/playground/worker/fortran.js +3 -3
- package/dist/playground/worker/go.js +16 -5
- package/dist/playground/worker/haskell.js +10 -7
- package/dist/playground/worker/java.js +263 -45
- package/dist/playground/worker/javaDebugEvaluator.d.ts +16 -0
- package/dist/playground/worker/javaDebugEvaluator.js +44 -0
- package/dist/playground/worker/javaDebugRuntime.d.ts +24 -0
- package/dist/playground/worker/javaDebugRuntime.js +315 -0
- package/dist/playground/worker/javaOutput.d.ts +11 -0
- package/dist/playground/worker/javaOutput.js +54 -0
- package/dist/playground/worker/lua.js +15 -3
- package/dist/playground/worker/php.js +15 -9
- package/dist/playground/worker/python.js +102 -30
- package/dist/playground/worker/pythonExecution.js +17 -1
- package/dist/playground/worker/pythonWorkspaceFiles.d.ts +6 -0
- package/dist/playground/worker/pythonWorkspaceFiles.js +26 -0
- package/dist/playground/worker/pythonWorkspaceImports.d.ts +4 -0
- package/dist/playground/worker/pythonWorkspaceImports.js +129 -0
- package/dist/playground/worker/r.js +13 -6
- package/dist/playground/worker/ruby.js +13 -0
- package/dist/playground/worker/rubyDebugPreview.d.ts +2 -0
- package/dist/playground/worker/rubyDebugPreview.js +80 -0
- package/dist/playground/worker/rubyTracepoint.d.ts +16 -0
- package/dist/playground/worker/rubyTracepoint.js +162 -0
- package/dist/playground/worker/rust.js +38 -3
- package/dist/playground/worker/sqlite.js +4 -3
- package/dist/playground/worker/tinygo.js +11 -3
- package/dist/playground/worker/typescript.js +2 -3
- package/dist/playground/worker/v.js +32 -7
- package/dist/playground/worker/wat.js +2 -3
- package/dist/playground/worker/zig.js +20 -6
- package/dist/playground/workerSession.d.ts +1 -28
- package/dist/playground/workerSession.js +1 -164
- package/dist/playground/zig.js +4 -0
- package/package.json +66 -15
- package/dist/playground/worker/python.runtime.cases.d.ts +0 -1
- package/dist/playground/worker/python.runtime.cases.js +0 -374
|
@@ -1,193 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/** Immutable bootstrap assets only: never store a worker, Wasm instance, or user filesystem. */
|
|
3
|
-
export class RuntimeAssetCache {
|
|
4
|
-
maxBytes;
|
|
5
|
-
maxEntries;
|
|
6
|
-
entries = new Map();
|
|
7
|
-
inFlight = new Map();
|
|
8
|
-
inFlightKeyBytes = 0;
|
|
9
|
-
identities = new WeakMap();
|
|
10
|
-
nextIdentity = 0;
|
|
11
|
-
bytes = 0;
|
|
12
|
-
hits = 0;
|
|
13
|
-
misses = 0;
|
|
14
|
-
disposed = false;
|
|
15
|
-
constructor(maxBytes = 256 * 1024 * 1024, maxEntries = 64) {
|
|
16
|
-
this.maxBytes = maxBytes;
|
|
17
|
-
this.maxEntries = maxEntries;
|
|
18
|
-
if (!Number.isSafeInteger(maxBytes) ||
|
|
19
|
-
maxBytes < 0 ||
|
|
20
|
-
!Number.isSafeInteger(maxEntries) ||
|
|
21
|
-
maxEntries < 0) {
|
|
22
|
-
throw new TypeError('Runtime cache limits must be non-negative safe integers');
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
/** Identity is owner-local; a custom loader must never alias another loader. */
|
|
26
|
-
identity(value) {
|
|
27
|
-
if (!value)
|
|
28
|
-
return 0;
|
|
29
|
-
let identity = this.identities.get(value);
|
|
30
|
-
if (identity === undefined) {
|
|
31
|
-
identity = ++this.nextIdentity;
|
|
32
|
-
this.identities.set(value, identity);
|
|
33
|
-
}
|
|
34
|
-
return identity;
|
|
35
|
-
}
|
|
36
|
-
get(key) {
|
|
37
|
-
if (this.disposed)
|
|
38
|
-
return undefined;
|
|
39
|
-
const entry = this.entries.get(key);
|
|
40
|
-
if (!entry) {
|
|
41
|
-
this.misses++;
|
|
42
|
-
return undefined;
|
|
43
|
-
}
|
|
44
|
-
this.hits++;
|
|
45
|
-
this.entries.delete(key);
|
|
46
|
-
this.entries.set(key, entry);
|
|
47
|
-
return entry.value;
|
|
48
|
-
}
|
|
49
|
-
/** Only the trusted host publishes fully verified results; failures are never retained. */
|
|
50
|
-
set(key, value, bytes) {
|
|
51
|
-
if (this.disposed)
|
|
52
|
-
return;
|
|
53
|
-
if (!Number.isSafeInteger(bytes) || bytes < 0)
|
|
54
|
-
throw new TypeError('Invalid cache byte count');
|
|
55
|
-
const charge = bytes + key.length * 2;
|
|
56
|
-
if (this.maxEntries === 0 || charge > this.maxBytes)
|
|
57
|
-
return;
|
|
58
|
-
const previous = this.entries.get(key);
|
|
59
|
-
if (previous)
|
|
60
|
-
this.bytes -= previous.bytes;
|
|
61
|
-
this.entries.delete(key);
|
|
62
|
-
this.entries.set(key, { value, bytes: charge });
|
|
63
|
-
this.bytes += charge;
|
|
64
|
-
while (this.entries.size > this.maxEntries || this.bytes > this.maxBytes) {
|
|
65
|
-
const oldest = this.entries.keys().next().value;
|
|
66
|
-
this.bytes -= this.entries.get(oldest).bytes;
|
|
67
|
-
this.entries.delete(oldest);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/** Share work, but give every consumer its own cancellation and progress subscription. */
|
|
71
|
-
share(key, signal, start, onProgress) {
|
|
72
|
-
if (signal.aborted)
|
|
73
|
-
return Promise.reject(abortReason(signal));
|
|
74
|
-
let operation = this.inFlight.get(key);
|
|
75
|
-
if (!operation) {
|
|
76
|
-
// A disabled or saturated owner cache still loads assets without retaining operations.
|
|
77
|
-
if (this.disposed ||
|
|
78
|
-
this.inFlight.size >= this.maxEntries ||
|
|
79
|
-
this.inFlightKeyBytes + key.length * 2 > this.maxBytes) {
|
|
80
|
-
return Promise.resolve().then(() => {
|
|
81
|
-
if (signal.aborted)
|
|
82
|
-
throw abortReason(signal);
|
|
83
|
-
return start(signal, (progress) => onProgress?.(progress));
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
const pending = {
|
|
87
|
-
controller: new AbortController(),
|
|
88
|
-
promise: undefined,
|
|
89
|
-
consumers: new Set(),
|
|
90
|
-
progress: new Map(),
|
|
91
|
-
settled: false,
|
|
92
|
-
keyBytes: key.length * 2
|
|
93
|
-
};
|
|
94
|
-
this.inFlight.set(key, pending);
|
|
95
|
-
this.inFlightKeyBytes += pending.keyBytes;
|
|
96
|
-
pending.promise = Promise.resolve().then(() => {
|
|
97
|
-
if (pending.controller.signal.aborted)
|
|
98
|
-
throw abortReason(pending.controller.signal);
|
|
99
|
-
return start(pending.controller.signal, (progress, progressKey = '') => {
|
|
100
|
-
pending.progress.set(progressKey, progress);
|
|
101
|
-
for (const consumer of pending.consumers) {
|
|
102
|
-
try {
|
|
103
|
-
consumer(progress);
|
|
104
|
-
}
|
|
105
|
-
catch {
|
|
106
|
-
// One progress listener cannot interrupt another consumer's load.
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
const cleanup = () => {
|
|
112
|
-
pending.settled = true;
|
|
113
|
-
pending.progress.clear();
|
|
114
|
-
this.removeOperation(key, pending);
|
|
115
|
-
};
|
|
116
|
-
void pending.promise.then(cleanup, cleanup);
|
|
117
|
-
operation = pending;
|
|
118
|
-
}
|
|
119
|
-
const shared = operation;
|
|
120
|
-
return new Promise((resolve, reject) => {
|
|
121
|
-
let active = true;
|
|
122
|
-
const receiveProgress = (progress) => {
|
|
123
|
-
if (active)
|
|
124
|
-
onProgress?.(progress);
|
|
125
|
-
};
|
|
126
|
-
const release = () => {
|
|
127
|
-
active = false;
|
|
128
|
-
signal.removeEventListener('abort', onAbort);
|
|
129
|
-
shared.consumers.delete(receiveProgress);
|
|
130
|
-
if (!shared.settled && shared.consumers.size === 0) {
|
|
131
|
-
this.removeOperation(key, shared);
|
|
132
|
-
shared.controller.abort(abortReason(signal));
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
const onAbort = () => {
|
|
136
|
-
if (!active)
|
|
137
|
-
return;
|
|
138
|
-
release();
|
|
139
|
-
reject(abortReason(signal));
|
|
140
|
-
};
|
|
141
|
-
shared.consumers.add(receiveProgress);
|
|
142
|
-
signal.addEventListener('abort', onAbort, { once: true });
|
|
143
|
-
void shared.promise.then((value) => {
|
|
144
|
-
if (!active)
|
|
145
|
-
return;
|
|
146
|
-
release();
|
|
147
|
-
resolve(value);
|
|
148
|
-
}, (error) => {
|
|
149
|
-
if (!active)
|
|
150
|
-
return;
|
|
151
|
-
release();
|
|
152
|
-
reject(error);
|
|
153
|
-
});
|
|
154
|
-
for (const progress of shared.progress.values()) {
|
|
155
|
-
try {
|
|
156
|
-
receiveProgress(progress);
|
|
157
|
-
}
|
|
158
|
-
catch {
|
|
159
|
-
// Progress is advisory, including replay to a late subscriber.
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
if (signal.aborted)
|
|
163
|
-
onAbort();
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
removeOperation(key, operation) {
|
|
167
|
-
if (this.inFlight.get(key) !== operation)
|
|
168
|
-
return;
|
|
169
|
-
this.inFlight.delete(key);
|
|
170
|
-
this.inFlightKeyBytes -= operation.keyBytes;
|
|
171
|
-
}
|
|
172
|
-
stats() {
|
|
173
|
-
return {
|
|
174
|
-
hits: this.hits,
|
|
175
|
-
misses: this.misses,
|
|
176
|
-
entries: this.entries.size,
|
|
177
|
-
bytes: this.bytes,
|
|
178
|
-
inFlight: this.inFlight.size,
|
|
179
|
-
disposed: this.disposed
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
dispose() {
|
|
183
|
-
if (this.disposed)
|
|
184
|
-
return;
|
|
185
|
-
this.disposed = true;
|
|
186
|
-
this.entries.clear();
|
|
187
|
-
// Existing consumers may finish, but a disposed owner never retains their results.
|
|
188
|
-
this.inFlight.clear();
|
|
189
|
-
this.inFlightKeyBytes = 0;
|
|
190
|
-
this.identities = new WeakMap();
|
|
191
|
-
this.bytes = 0;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
1
|
+
export { RuntimeAssetCache } from '@wasm-idle/core';
|
|
@@ -15,7 +15,7 @@ export interface PlaygroundRuntimeSession {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* A browser-owned
|
|
19
|
-
* compiler
|
|
18
|
+
* A browser-owned runtime session. Panels own disposable execution leases, while
|
|
19
|
+
* verified compiler assets survive problem, editor and language changes.
|
|
20
20
|
*/
|
|
21
21
|
export declare function createRuntimeSession(runtimeAssets: SandboxRuntimeAssets, options?: PlaygroundBindingOptions): PlaygroundRuntimeSession;
|
|
@@ -4,16 +4,16 @@ import { RuntimeAssetCache } from './runtimeAssetCache';
|
|
|
4
4
|
import { CompiledArtifactCache } from './compiledArtifactCache';
|
|
5
5
|
import { createCachedClangSandbox } from './cachedClang';
|
|
6
6
|
/**
|
|
7
|
-
* A browser-owned
|
|
8
|
-
* compiler
|
|
7
|
+
* A browser-owned runtime session. Panels own disposable execution leases, while
|
|
8
|
+
* verified compiler assets survive problem, editor and language changes.
|
|
9
9
|
*/
|
|
10
10
|
export function createRuntimeSession(runtimeAssets, options = {}) {
|
|
11
11
|
let language;
|
|
12
12
|
let epoch = 0;
|
|
13
13
|
let disposed = false;
|
|
14
14
|
let disposal;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const assetCache = new RuntimeAssetCache();
|
|
16
|
+
const artifactCache = new CompiledArtifactCache();
|
|
17
17
|
const leases = new Set();
|
|
18
18
|
let retiring = Promise.resolve();
|
|
19
19
|
const stale = () => new RuntimeConfigurationError('Runtime session was disposed or its language changed', {
|
|
@@ -21,14 +21,17 @@ export function createRuntimeSession(runtimeAssets, options = {}) {
|
|
|
21
21
|
});
|
|
22
22
|
const release = (owned) => {
|
|
23
23
|
const previous = retiring;
|
|
24
|
-
|
|
24
|
+
const released = Promise.allSettled([
|
|
25
|
+
previous,
|
|
26
|
+
...owned.map((lease) => lease.dispose())
|
|
27
|
+
]).then((results) => {
|
|
25
28
|
const failure = results.find((result) => result.status === 'rejected');
|
|
26
29
|
if (failure?.status === 'rejected')
|
|
27
30
|
throw failure.reason;
|
|
28
31
|
});
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
return
|
|
32
|
+
// Keep ordering as a completion barrier; report this failure only to its owner.
|
|
33
|
+
retiring = released.catch(() => undefined);
|
|
34
|
+
return released;
|
|
32
35
|
};
|
|
33
36
|
const session = {
|
|
34
37
|
async selectLanguage(value) {
|
|
@@ -41,10 +44,7 @@ export function createRuntimeSession(runtimeAssets, options = {}) {
|
|
|
41
44
|
return await retiring;
|
|
42
45
|
language = next;
|
|
43
46
|
epoch++;
|
|
44
|
-
assetCache.dispose();
|
|
45
47
|
artifactCache.clear();
|
|
46
|
-
assetCache = new RuntimeAssetCache();
|
|
47
|
-
artifactCache = new CompiledArtifactCache();
|
|
48
48
|
await release([...leases].filter((lease) => lease.epoch !== undefined));
|
|
49
49
|
},
|
|
50
50
|
createBinding() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type PlaygroundRuntimeAssets, type RuntimeAssetIntegrityEntry } from './assets';
|
|
2
2
|
import { type DebugCommand, type DebugDataBreakpoint, type DebugDataBreakpointInfoArguments, type DebugSessionEvent, type CompilerDiagnostic, type SandboxExecutionOptions } from './options';
|
|
3
3
|
import type { Sandbox, SandboxProgress } from './sandbox';
|
|
4
|
+
import { RuntimeAssetCache, type DebugEvaluateOptions, type DebugSourceBreakpoint, type DebugSteppingOptions } from '@wasm-idle/core';
|
|
4
5
|
declare class Rust implements Sandbox {
|
|
5
6
|
output: any;
|
|
6
7
|
ondebug?: (event: DebugSessionEvent) => void;
|
|
@@ -19,6 +20,9 @@ declare class Rust implements Sandbox {
|
|
|
19
20
|
debugManifestUrl: string;
|
|
20
21
|
debugManifestReceipt?: Readonly<RuntimeAssetIntegrityEntry>;
|
|
21
22
|
executableGraphFingerprint: string;
|
|
23
|
+
private runtimeAssetsKey;
|
|
24
|
+
private runtimeAssetCache;
|
|
25
|
+
private ownsRuntimeAssetCache;
|
|
22
26
|
private persistentCacheBaseline?;
|
|
23
27
|
oncompilerdiagnostic?: (diagnostic: CompilerDiagnostic) => void;
|
|
24
28
|
waitingForInput: boolean;
|
|
@@ -35,6 +39,7 @@ declare class Rust implements Sandbox {
|
|
|
35
39
|
private debugMode;
|
|
36
40
|
private activeDebugPhaseTimeout?;
|
|
37
41
|
private readonly lldbBreakpoints;
|
|
42
|
+
private readonly lldbBreakpointSpecifications;
|
|
38
43
|
private lldbEditorSourcePath;
|
|
39
44
|
private disposeWorkerExecutableGraph;
|
|
40
45
|
load(runtimeAssets?: string | PlaygroundRuntimeAssets, _code?: string, _log?: boolean, _args?: string[], _options?: SandboxExecutionOptions, progress?: SandboxProgress): Promise<void>;
|
|
@@ -45,6 +50,9 @@ declare class Rust implements Sandbox {
|
|
|
45
50
|
debugCommand(command: DebugCommand): Promise<void> | undefined;
|
|
46
51
|
debugPause(): Promise<void> | undefined;
|
|
47
52
|
setBreakpoints(lines: number[], sourcePath?: string): Promise<void> | undefined;
|
|
53
|
+
setSourceBreakpoints(breakpoints: DebugSourceBreakpoint[], sourcePath?: string): Promise<void>;
|
|
54
|
+
debugSetSteppingOptions(options: DebugSteppingOptions): Promise<void>;
|
|
55
|
+
debugEvaluateValue(expression: string, options?: DebugEvaluateOptions): Promise<import("@wasm-idle/core").DebugEvaluateResult>;
|
|
48
56
|
debugEvaluate(expression: string): Promise<string>;
|
|
49
57
|
debugVariables(variablesReference: number, start?: number, count?: number): Promise<import("@wasm-idle/core").DebugVariable[]>;
|
|
50
58
|
debugScopes(frameId: number): Promise<import("@wasm-idle/core").DebugScope[]>;
|
|
@@ -58,6 +66,8 @@ declare class Rust implements Sandbox {
|
|
|
58
66
|
debugDataBreakpointInfo(arguments_: DebugDataBreakpointInfoArguments): Promise<import("@wasm-idle/core").DebugDataBreakpointInfo | null>;
|
|
59
67
|
debugSetDataBreakpoints(breakpoints: DebugDataBreakpoint[]): Promise<import("@wasm-idle/core").DebugResolvedDataBreakpoint[]>;
|
|
60
68
|
kill(): Promise<void>;
|
|
69
|
+
setRuntimeAssetCache(cache: RuntimeAssetCache): void;
|
|
70
|
+
dispose(): Promise<void>;
|
|
61
71
|
terminate(): Promise<void>;
|
|
62
72
|
clear(): Promise<void>;
|
|
63
73
|
}
|