wasm-idle 1.2.0 → 1.4.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 (105) hide show
  1. package/README.md +250 -146
  2. package/dist/container/clang-runtime.js +32 -8
  3. package/dist/container/runtime-adapter.d.ts +2 -0
  4. package/dist/container/runtime-adapter.js +37 -8
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.js +1 -0
  7. package/dist/playground/assetBridge.js +10 -8
  8. package/dist/playground/assets.d.ts +4 -0
  9. package/dist/playground/assets.js +9 -4
  10. package/dist/playground/c3.js +1 -1
  11. package/dist/playground/compiledLldb.d.ts +2 -0
  12. package/dist/playground/compiledLldb.js +37 -2
  13. package/dist/playground/d.d.ts +1 -0
  14. package/dist/playground/d.js +18 -8
  15. package/dist/playground/index.d.ts +1 -1
  16. package/dist/playground/index.js +7 -0
  17. package/dist/playground/{java-debug-FMHDKUN6.js → java-debug-64JGCLTC.js} +1 -1
  18. package/dist/playground/java-debug-notices.txt +26 -1
  19. package/dist/playground/java.js +3 -2
  20. package/dist/playground/javaDebugBridge.js +42 -7
  21. package/dist/playground/javaDebugSource.js +4 -4
  22. package/dist/playground/javaMain.d.ts +3 -0
  23. package/dist/playground/javaMain.js +2 -0
  24. package/dist/playground/javaRuntimeErrors.d.ts +2 -1
  25. package/dist/playground/javaRuntimeErrors.js +9 -2
  26. package/dist/playground/javaSource.d.ts +1 -1
  27. package/dist/playground/javaSource.js +7 -2
  28. package/dist/playground/lldbSession.d.ts +2 -0
  29. package/dist/playground/lldbSession.js +60 -4
  30. package/dist/playground/objectivec.d.ts +1 -1
  31. package/dist/playground/objectivec.js +2 -1
  32. package/dist/playground/options.d.ts +1 -1
  33. package/dist/playground/python.d.ts +3 -0
  34. package/dist/playground/python.js +122 -2
  35. package/dist/playground/pythonCompileOptions.d.ts +52 -0
  36. package/dist/playground/pythonCompileOptions.js +40 -0
  37. package/dist/playground/scala.d.ts +34 -0
  38. package/dist/playground/scala.js +397 -0
  39. package/dist/playground/scalaAssets.d.ts +16 -0
  40. package/dist/playground/scalaAssets.js +51 -0
  41. package/dist/playground/scalaDiagnostics.d.ts +3 -0
  42. package/dist/playground/scalaDiagnostics.js +29 -0
  43. package/dist/playground/staticRuntimeModuleVersion.d.ts +1 -1
  44. package/dist/playground/staticRuntimeModuleVersion.js +1 -1
  45. package/dist/playground/staticWorkerRuntime.d.ts +2 -0
  46. package/dist/playground/staticWorkerRuntime.js +85 -11
  47. package/dist/playground/tinygo.js +21 -8
  48. package/dist/playground/tinygoExecutableGraph.js +1 -1
  49. package/dist/playground/v.d.ts +1 -0
  50. package/dist/playground/v.js +17 -7
  51. package/dist/playground/wasmC3Version.d.ts +8 -8
  52. package/dist/playground/wasmC3Version.js +8 -8
  53. package/dist/playground/wasmDebugVersion.d.ts +1 -1
  54. package/dist/playground/wasmDebugVersion.js +1 -1
  55. package/dist/playground/wasmDotnetVersion.d.ts +1 -1
  56. package/dist/playground/wasmDotnetVersion.js +1 -1
  57. package/dist/playground/wasmGoVersion.d.ts +1 -1
  58. package/dist/playground/wasmGoVersion.js +1 -1
  59. package/dist/playground/wasmLispVersion.d.ts +5 -0
  60. package/dist/playground/wasmLispVersion.js +5 -0
  61. package/dist/playground/wasmOcamlVersion.d.ts +4 -4
  62. package/dist/playground/wasmOcamlVersion.js +3 -3
  63. package/dist/playground/wasmPrologVersion.d.ts +17 -17
  64. package/dist/playground/wasmPrologVersion.js +16 -16
  65. package/dist/playground/wasmTinyGoVersion.d.ts +57 -57
  66. package/dist/playground/wasmTinyGoVersion.js +57 -57
  67. package/dist/playground/wasmTypeScriptVersion.d.ts +3 -3
  68. package/dist/playground/wasmTypeScriptVersion.js +3 -3
  69. package/dist/playground/wasmZigVersion.d.ts +7 -7
  70. package/dist/playground/wasmZigVersion.js +7 -7
  71. package/dist/playground/worker/java.js +18 -4
  72. package/dist/playground/worker/javaDebugEvaluator.js +2 -2
  73. package/dist/playground/worker/javaDebugRuntime.js +8 -1
  74. package/dist/playground/worker/javaStreaming.js +4 -2
  75. package/dist/playground/worker/ocaml.js +11 -10
  76. package/dist/playground/worker/python.js +45 -165
  77. package/dist/playground/worker/pythonCompile.d.ts +4 -0
  78. package/dist/playground/worker/pythonCompile.js +127 -0
  79. package/dist/playground/worker/pythonDebug.d.ts +20 -0
  80. package/dist/playground/worker/pythonDebug.js +205 -0
  81. package/dist/playground/worker/scala/UPSTREAM-LICENSE.txt +201 -0
  82. package/dist/playground/worker/scala/UPSTREAM-NOTICE.txt +108 -0
  83. package/dist/playground/worker/scala/asset-bootstrap.d.ts +6 -0
  84. package/dist/playground/worker/scala/asset-bootstrap.js +58 -0
  85. package/dist/playground/worker/scala/asset-receipts.d.ts +7 -0
  86. package/dist/playground/worker/scala/asset-receipts.js +58 -0
  87. package/dist/playground/worker/scala/compiler.worker.d.ts +1 -0
  88. package/dist/playground/worker/scala/compiler.worker.js +204 -0
  89. package/dist/playground/worker/scala/execution.worker.d.ts +1 -0
  90. package/dist/playground/worker/scala/execution.worker.js +89 -0
  91. package/dist/playground/worker/scala/memory-fs.d.ts +29 -0
  92. package/dist/playground/worker/scala/memory-fs.js +333 -0
  93. package/dist/playground/worker/scala/runner.d.ts +1 -0
  94. package/dist/playground/worker/scala/runner.js +36 -0
  95. package/dist/playground/worker/zig.d.ts +2 -1
  96. package/dist/playground/worker/zig.js +212 -86
  97. package/dist/playground/worker/zigDebug.d.ts +39 -0
  98. package/dist/playground/worker/zigDebug.js +156 -0
  99. package/dist/playground/zig.d.ts +27 -4
  100. package/dist/playground/zig.js +266 -23
  101. package/dist/playground/zigDebugValues.d.ts +20 -0
  102. package/dist/playground/zigDebugValues.js +248 -0
  103. package/dist/pythonCompiler.d.ts +8 -0
  104. package/dist/pythonCompiler.js +52 -0
  105. package/package.json +37 -26
@@ -0,0 +1,16 @@
1
+ import { type RuntimeAssetCacheOptions } from '@wasm-idle/core';
2
+ import { SCALA_ASSET_BASE_URL, SCALA_ASSET_RECEIPTS, SCALA_ASSET_REVISION } from './worker/scala/asset-receipts.js';
3
+ export { SCALA_ASSET_BASE_URL, SCALA_ASSET_RECEIPTS, SCALA_ASSET_REVISION };
4
+ export type ScalaCompilerPayload = Record<string, Uint8Array>;
5
+ export interface ScalaCompilerAssetOptions {
6
+ baseUrl?: string;
7
+ persistentCache?: RuntimeAssetCacheOptions;
8
+ signal?: AbortSignal;
9
+ maxAssetBytes?: number;
10
+ fetch?: typeof globalThis.fetch;
11
+ onProgress?: (loaded: number, total: number) => void;
12
+ }
13
+ /** Capability preflight precedes every cache/network load of the large compiler. */
14
+ export declare function assertScalaBrowserSupport(wasm?: typeof WebAssembly | undefined): void;
15
+ /** Fetches exactly the pinned graph; verified bytes, never remote URLs, cross into the Worker. */
16
+ export declare function createScalaCompilerPayload(options?: ScalaCompilerAssetOptions): Promise<ScalaCompilerPayload>;
@@ -0,0 +1,51 @@
1
+ import { fetchPinnedRuntimeAsset, RuntimeConfigurationError } from '@wasm-idle/core';
2
+ import { SCALA_ASSET_BASE_URL, SCALA_ASSET_RECEIPTS, SCALA_ASSET_REVISION } from './worker/scala/asset-receipts.js';
3
+ export { SCALA_ASSET_BASE_URL, SCALA_ASSET_RECEIPTS, SCALA_ASSET_REVISION };
4
+ /** Capability preflight precedes every cache/network load of the large compiler. */
5
+ export function assertScalaBrowserSupport(wasm = globalThis.WebAssembly) {
6
+ const features = wasm;
7
+ const missing = ['JSTag', 'Suspending', 'promising'].filter((name) => name === 'JSTag' ? features?.[name] === undefined : typeof features?.[name] !== 'function');
8
+ if (missing.length)
9
+ throw new RuntimeConfigurationError(`Scala 3 requires WebAssembly ${missing.join(', ')}. This browser cannot run the Scala.js compiler.`, { runtimeId: 'SCALA' });
10
+ }
11
+ /** Fetches exactly the pinned graph; verified bytes, never remote URLs, cross into the Worker. */
12
+ export async function createScalaCompilerPayload(options = {}) {
13
+ assertScalaBrowserSupport();
14
+ options.signal?.throwIfAborted();
15
+ let base;
16
+ try {
17
+ base = new URL(options.baseUrl ?? SCALA_ASSET_BASE_URL, globalThis.location?.href);
18
+ }
19
+ catch {
20
+ throw new RuntimeConfigurationError('Scala asset base URL is invalid.', {
21
+ runtimeId: 'SCALA'
22
+ });
23
+ }
24
+ if (!['http:', 'https:'].includes(base.protocol) ||
25
+ base.username ||
26
+ base.password ||
27
+ base.search ||
28
+ base.hash)
29
+ throw new RuntimeConfigurationError('Scala assets require an uncredentialed HTTP(S) base URL without query or fragment.', { runtimeId: 'SCALA' });
30
+ if (!base.pathname.endsWith('/'))
31
+ base.pathname += '/';
32
+ const total = SCALA_ASSET_RECEIPTS.reduce((sum, receipt) => sum + receipt.bytes, 0);
33
+ let loaded = 0;
34
+ const payload = {};
35
+ // Sequential loading bounds transient buffers and makes cancellation deterministic.
36
+ for (const receipt of SCALA_ASSET_RECEIPTS) {
37
+ const bytes = await fetchPinnedRuntimeAsset({
38
+ url: new URL(receipt.path, base).href,
39
+ receipt: { bytes: receipt.bytes, sha256: receipt.sha256 },
40
+ persistentCache: options.persistentCache,
41
+ signal: options.signal,
42
+ maxAssetBytes: options.maxAssetBytes,
43
+ fetch: options.fetch,
44
+ onProgress: (size) => options.onProgress?.(loaded + size, total)
45
+ });
46
+ options.signal?.throwIfAborted();
47
+ payload[receipt.path] = bytes;
48
+ loaded += receipt.bytes;
49
+ }
50
+ return payload;
51
+ }
@@ -0,0 +1,3 @@
1
+ import type { CompilerDiagnostic } from './options';
2
+ /** Convert the real Scala reporter's terminal headings into editor locations. */
3
+ export declare function parseScalaDiagnostics(lines: readonly string[], maxDiagnostics?: number): CompilerDiagnostic[];
@@ -0,0 +1,29 @@
1
+ import { DiagnosticLimitError } from '@wasm-idle/core';
2
+ /** Convert the real Scala reporter's terminal headings into editor locations. */
3
+ export function parseScalaDiagnostics(lines, maxDiagnostics = 1000) {
4
+ const diagnostics = [];
5
+ const text = lines.join('\n').replace(/\x1b\[[0-9;]*m/g, '');
6
+ const headings = [
7
+ ...text.matchAll(/^-- (?:\[\w+\] )?(.+?): \/workspace\/(.+\.scala):(\d+):(\d+)\s*-*\s*$/gm)
8
+ ];
9
+ for (let index = 0; index < headings.length; index++) {
10
+ const heading = headings[index];
11
+ if (diagnostics.length >= maxDiagnostics)
12
+ throw new DiagnosticLimitError('Scala diagnostic limit exceeded', {
13
+ runtimeId: 'SCALA',
14
+ limit: maxDiagnostics,
15
+ actual: diagnostics.length + 1
16
+ });
17
+ const body = text
18
+ .slice(heading.index + heading[0].length, headings[index + 1]?.index ?? text.length)
19
+ .trim();
20
+ diagnostics.push({
21
+ fileName: heading[2],
22
+ lineNumber: Number(heading[3]),
23
+ columnNumber: Number(heading[4]),
24
+ severity: /warning/i.test(heading[1]) ? 'warning' : 'error',
25
+ message: `${heading[1]}${body ? `\n${body}` : ''}`
26
+ });
27
+ }
28
+ return diagnostics;
29
+ }
@@ -1 +1 @@
1
- export declare const STATIC_RUNTIME_MODULE_VERSION = "b29a54a528d2f8aa";
1
+ export declare const STATIC_RUNTIME_MODULE_VERSION = "6b508364c7ec4127";
@@ -1,2 +1,2 @@
1
1
  // Generated by scripts/build-static-runtime-modules.mjs.
2
- export const STATIC_RUNTIME_MODULE_VERSION = 'b29a54a528d2f8aa';
2
+ export const STATIC_RUNTIME_MODULE_VERSION = '6b508364c7ec4127';
@@ -144,6 +144,8 @@ export declare class StaticWorkerRuntimeSandbox implements Sandbox {
144
144
  private createBootstrapUrl;
145
145
  private revokeBootstrapUrl;
146
146
  private ensureWorkerStarted;
147
+ private preflightWorkerAssets;
148
+ private prepareWorkerAssets;
147
149
  private startWorker;
148
150
  private handleWorkerMessage;
149
151
  private formatWorkerError;
@@ -1016,7 +1016,7 @@ self.postMessage = (message, transferOrOptions) => {
1016
1016
  });
1017
1017
  return startPromise;
1018
1018
  }
1019
- async startWorker(generation, progress, controls) {
1019
+ async preflightWorkerAssets(generation, progress, controls) {
1020
1020
  let runtimePreflight;
1021
1021
  if (this.config.preflightRuntimeAssets) {
1022
1022
  const urls = this.resolvedRuntimeUrls;
@@ -1036,8 +1036,30 @@ self.postMessage = (message, transferOrOptions) => {
1036
1036
  runtimeId: this.config.languageId
1037
1037
  };
1038
1038
  this.reportProgress(progress, 0.03, `Preflighting ${this.config.displayName} runtime`);
1039
+ let rejectAborted;
1040
+ const aborted = new Promise((_resolve, reject) => {
1041
+ rejectAborted = reject;
1042
+ });
1043
+ const abortPreflight = () => {
1044
+ operation.active = false;
1045
+ if (operation.claimedTicket)
1046
+ this.retireRuntimePreflight(operation.claimedTicket);
1047
+ rejectAborted(new CancelledError(`${this.config.displayName} runtime preflight cancelled`, {
1048
+ phase: 'asset',
1049
+ runtimeId: this.config.languageId,
1050
+ cause: controls.signal?.reason
1051
+ }));
1052
+ };
1053
+ // A custom preflight may ignore cancellation. Retire its claimed buffers
1054
+ // immediately and settle without waiting for its late callback result.
1055
+ void aborted.catch(() => { });
1056
+ controls.signal?.addEventListener('abort', abortPreflight, { once: true });
1039
1057
  try {
1040
- runtimePreflight = await this.config.preflightRuntimeAssets(urls, {
1058
+ if (controls.signal?.aborted) {
1059
+ abortPreflight();
1060
+ return await aborted;
1061
+ }
1062
+ const pending = this.config.preflightRuntimeAssets(urls, {
1041
1063
  limits: controls.limits,
1042
1064
  persistentCache: controls.persistentCache,
1043
1065
  signal: controls.signal,
@@ -1112,6 +1134,7 @@ self.postMessage = (message, transferOrOptions) => {
1112
1134
  return ticket;
1113
1135
  }
1114
1136
  });
1137
+ runtimePreflight = await Promise.race([pending, aborted]);
1115
1138
  }
1116
1139
  catch (error) {
1117
1140
  operation.active = false;
@@ -1120,6 +1143,9 @@ self.postMessage = (message, transferOrOptions) => {
1120
1143
  }
1121
1144
  throw error;
1122
1145
  }
1146
+ finally {
1147
+ controls.signal?.removeEventListener('abort', abortPreflight);
1148
+ }
1123
1149
  operation.active = false;
1124
1150
  const returnedDelivery = runtimePreflight !== null && typeof runtimePreflight === 'object'
1125
1151
  ? ownedDeliveryStateByTicket.get(runtimePreflight)
@@ -1156,18 +1182,66 @@ self.postMessage = (message, transferOrOptions) => {
1156
1182
  throw error;
1157
1183
  }
1158
1184
  }
1185
+ return runtimePreflight;
1186
+ }
1187
+ async prepareWorkerAssets(generation, progress, controls) {
1188
+ const controller = new AbortController();
1189
+ const abort = () => controller.abort(controls.signal?.reason);
1190
+ const preparationControls = { ...controls, signal: controller.signal };
1191
+ let active = true;
1192
+ let lastProgress = 0;
1193
+ const preparationProgress = {
1194
+ set: (value, stage) => {
1195
+ if (!active ||
1196
+ controller.signal.aborted ||
1197
+ this.disposed ||
1198
+ generation !== this.workerGeneration)
1199
+ return;
1200
+ lastProgress = Math.max(lastProgress, Number.isFinite(value) ? value : 0);
1201
+ this.reportProgress(progress, lastProgress, stage);
1202
+ }
1203
+ };
1204
+ let runtimePreflight;
1205
+ controls.signal?.addEventListener('abort', abort, { once: true });
1206
+ try {
1207
+ if (controls.signal?.aborted)
1208
+ abort();
1209
+ // The runner script is independent of the verified runtime payload. Only
1210
+ // downloads and verification overlap; the runner is created after both finish.
1211
+ const [, verifiedWorkerBytes] = await Promise.all([
1212
+ this.preflightWorkerAssets(generation, preparationProgress, preparationControls).then((value) => {
1213
+ // The helper has already removed its abort listener. A sibling failure
1214
+ // can still invalidate this last handoff before we retain its ticket.
1215
+ if (!active || controller.signal.aborted) {
1216
+ this.retireRuntimePreflight(value);
1217
+ throw new CancelledError(`${this.config.displayName} runtime preparation cancelled`, {
1218
+ phase: 'startup',
1219
+ runtimeId: this.config.languageId,
1220
+ cause: controller.signal.reason
1221
+ });
1222
+ }
1223
+ runtimePreflight = value;
1224
+ }),
1225
+ this.preloadWorkerScript(preparationProgress, preparationControls)
1226
+ ]);
1227
+ return { runtimePreflight, verifiedWorkerBytes };
1228
+ }
1229
+ catch (error) {
1230
+ active = false;
1231
+ controller.abort(error);
1232
+ this.retireRuntimePreflight(runtimePreflight);
1233
+ throw error;
1234
+ }
1235
+ finally {
1236
+ active = false;
1237
+ controls.signal?.removeEventListener('abort', abort);
1238
+ }
1239
+ }
1240
+ async startWorker(generation, progress, controls) {
1241
+ const { runtimePreflight, verifiedWorkerBytes } = await this.prepareWorkerAssets(generation, progress, controls);
1159
1242
  let worker;
1160
1243
  let workerCreated = false;
1161
1244
  try {
1162
- if (this.disposed)
1163
- throw this.getDisposeReason();
1164
- if (generation !== this.workerGeneration) {
1165
- throw new CancelledError(`${this.config.displayName} worker startup terminated`, {
1166
- phase: 'startup',
1167
- runtimeId: this.config.languageId
1168
- });
1169
- }
1170
- const verifiedWorkerBytes = await this.preloadWorkerScript(progress, controls);
1171
1245
  if (this.disposed)
1172
1246
  throw this.getDisposeReason();
1173
1247
  if (generation !== this.workerGeneration) {
@@ -744,13 +744,26 @@ class TinyGo {
744
744
  if (!owner)
745
745
  throw new Error('TinyGo asset load has no active operation');
746
746
  this.assertOperation(owner);
747
- const bytes = await fetchPinnedRuntimeAsset({
748
- url,
749
- receipt,
750
- persistentCache: this.persistentCache,
751
- maxAssetBytes: owner.limits?.maxAssetBytes ?? maxAssetBytes,
752
- signal: init?.signal ?? owner.controller.signal
753
- });
747
+ const signal = init?.signal ?? owner.controller.signal;
748
+ let bytes;
749
+ try {
750
+ bytes = await fetchPinnedRuntimeAsset({
751
+ url,
752
+ receipt,
753
+ persistentCache: this.persistentCache,
754
+ maxAssetBytes: owner.limits?.maxAssetBytes ?? maxAssetBytes,
755
+ signal
756
+ });
757
+ }
758
+ catch (error) {
759
+ this.assertOperation(owner);
760
+ signal.throwIfAborted();
761
+ if (!receipt.uncompressedSha256)
762
+ throw error;
763
+ // HTTP may already decode gzip. Let the upstream loader verify its pinned
764
+ // logical bytes and limits when the encoded-byte cache cannot accept it.
765
+ return globalThis.fetch(input, { ...init, signal });
766
+ }
754
767
  this.assertOperation(owner);
755
768
  // This is a verified byte adapter, not a network response with a fabricated URL.
756
769
  return new Response(Uint8Array.from(bytes).buffer, {
@@ -852,7 +865,7 @@ class TinyGo {
852
865
  if (!assetsPromise)
853
866
  throw new Error('upstream TinyGo assets are not loaded');
854
867
  appendLog('upstream TinyGo receipt validation scheduled in compiler worker');
855
- return { target: 'wasip1', implementation: 'upstream-tinygo-0.40.1' };
868
+ return { target: 'wasip1', implementation: 'upstream-tinygo-0.43.0' };
856
869
  },
857
870
  async execute() {
858
871
  if (target !== 'wasip1') {
@@ -312,7 +312,7 @@ function createPreflightManifest(profile, keysByPath) {
312
312
  identity: {
313
313
  languageId: 'TINYGO',
314
314
  implementationId: 'tinygo-upstream-browser',
315
- implementationVersion: '0.40.1',
315
+ implementationVersion: '0.43.0',
316
316
  profile: {
317
317
  profileId: 'tinygo-executable-graph-v1',
318
318
  manifestSchemaVersion: 1,
@@ -42,6 +42,7 @@ declare class VLang extends CompiledLldbSandbox implements Sandbox {
42
42
  private flushPendingInput;
43
43
  run(code: string, prepare: boolean, log?: boolean, prog?: SandboxProgress, args?: string[], options?: SandboxExecutionOptions): Promise<boolean | string>;
44
44
  private cancelOperation;
45
+ private finishCancellation;
45
46
  kill(): void;
46
47
  terminate(reason?: unknown): void;
47
48
  clear(): Promise<void>;
@@ -693,15 +693,21 @@ class VLang extends CompiledLldbSandbox {
693
693
  cancelOperation(operation, reason) {
694
694
  if (!this.isOperationActive(operation))
695
695
  return;
696
- void this.stopLldb();
697
- this.finishExplicitStdin(operation);
698
696
  operation.cancelled = true;
699
697
  operation.cancellationReason = reason;
700
- this.activeOperation = null;
698
+ // Retain ownership while stop listeners run so reentrant cancellation cannot
699
+ // replace the original reason or start a replacement before teardown finishes.
700
+ void this.stopLldb();
701
+ this.finishCancellation(operation);
702
+ }
703
+ finishCancellation(operation) {
704
+ if (!this.releaseOperation(operation))
705
+ return;
706
+ this.finishExplicitStdin(operation);
701
707
  this.waitingForInput = false;
702
708
  this.pendingEof = false;
703
709
  this.uid += 1;
704
- this.workerSession.terminate(reason);
710
+ this.workerSession.terminate(operation.cancellationReason);
705
711
  this.exit = true;
706
712
  this.cleanupOperation(operation);
707
713
  }
@@ -711,12 +717,12 @@ class VLang extends CompiledLldbSandbox {
711
717
  terminate(reason = 'Process terminated') {
712
718
  if (this.disposed)
713
719
  return;
714
- void this.stopLldb();
715
720
  const operation = this.activeOperation;
716
721
  if (operation) {
717
722
  this.cancelOperation(operation, reason);
718
723
  return;
719
724
  }
725
+ void this.stopLldb();
720
726
  this.waitingForInput = false;
721
727
  this.pendingEof = false;
722
728
  this.uid += 1;
@@ -736,10 +742,14 @@ class VLang extends CompiledLldbSandbox {
736
742
  dispose() {
737
743
  if (this.disposePromise)
738
744
  return this.disposePromise;
739
- void this.stopLldb();
740
745
  this.disposed = true;
741
746
  this.disposePromise = Promise.resolve();
742
747
  const activeOperation = this.activeOperation;
748
+ if (activeOperation && !activeOperation.cancelled) {
749
+ activeOperation.cancelled = true;
750
+ activeOperation.cancellationReason = this.disposeCancellation;
751
+ }
752
+ void this.stopLldb();
743
753
  const assetBridge = this.assetBridge;
744
754
  delete this.worker;
745
755
  this.assetBridge = null;
@@ -753,7 +763,7 @@ class VLang extends CompiledLldbSandbox {
753
763
  // Asset cleanup is best effort after host state becomes unreachable.
754
764
  }
755
765
  if (activeOperation) {
756
- this.cancelOperation(activeOperation, this.disposeCancellation);
766
+ this.finishCancellation(activeOperation);
757
767
  }
758
768
  else {
759
769
  this.uid += 1;
@@ -1,20 +1,20 @@
1
1
  export declare const bundledC3Profile: {
2
- readonly profileId: "c3-0.8.3-wasm32-byte-v1";
3
- readonly producerManifestSha256: "6cd939ede70a166ae56c92c8978ee7d29a972eb3404262cb926bb370d567a8bb";
2
+ readonly profileId: "c3-0.8.5_1-wasm32-byte-v1";
3
+ readonly producerManifestSha256: "e138fc873d706e9d7042cc3419c32206bcb58c647e7e7b2c769ac369eb9fe2c1";
4
4
  readonly compilerJavaScriptReceipt: {
5
5
  readonly bytes: 101743;
6
6
  readonly sha256: "2174a9b00c8b412c1162683a232d20af3640336b9abfad5a61af872f7d792e45";
7
7
  };
8
8
  readonly compilerWasmReceipt: {
9
- readonly bytes: 39058650;
10
- readonly sha256: "f84c768a8dcd679bf092b7cd7bb9ec5786bc70bedc9d8929cfbb2d79291d8c0e";
9
+ readonly bytes: 39987618;
10
+ readonly sha256: "b3b874078d9f5f06c91aac7556052da74ed45efbe66f756509fd85e1bb7e415b";
11
11
  };
12
12
  readonly producerReceipt: {
13
- readonly bytes: 13996;
14
- readonly sha256: "3fec378b171e717bf08f5096291740fa313649e14280d156d0cf7cdcf50082f8";
13
+ readonly bytes: 14199;
14
+ readonly sha256: "df8c29d31d8522a1f5ce19e2a6b228d02a392181e4971cc04206be7f49cecc34";
15
15
  };
16
16
  };
17
17
  export declare const bundledC3WorkerReceipt: {
18
- readonly bytes: 17225;
19
- readonly sha256: "043817070c6f6c9f6ce3d570a5de79c7be1ca3dba3d40c482be9f962ad714c57";
18
+ readonly bytes: 17373;
19
+ readonly sha256: "5a2a5f65bf99e5aec89212a0609749a786b1375e97946bbc19da8387efae349d";
20
20
  };
@@ -1,21 +1,21 @@
1
1
  // Generated by scripts/sync-wasm-c3.mjs from verified local producer artifacts.
2
2
  export const bundledC3Profile = {
3
- profileId: 'c3-0.8.3-wasm32-byte-v1',
4
- producerManifestSha256: '6cd939ede70a166ae56c92c8978ee7d29a972eb3404262cb926bb370d567a8bb',
3
+ profileId: 'c3-0.8.5_1-wasm32-byte-v1',
4
+ producerManifestSha256: 'e138fc873d706e9d7042cc3419c32206bcb58c647e7e7b2c769ac369eb9fe2c1',
5
5
  compilerJavaScriptReceipt: {
6
6
  bytes: 101743,
7
7
  sha256: '2174a9b00c8b412c1162683a232d20af3640336b9abfad5a61af872f7d792e45'
8
8
  },
9
9
  compilerWasmReceipt: {
10
- bytes: 39058650,
11
- sha256: 'f84c768a8dcd679bf092b7cd7bb9ec5786bc70bedc9d8929cfbb2d79291d8c0e'
10
+ bytes: 39987618,
11
+ sha256: 'b3b874078d9f5f06c91aac7556052da74ed45efbe66f756509fd85e1bb7e415b'
12
12
  },
13
13
  producerReceipt: {
14
- bytes: 13996,
15
- sha256: '3fec378b171e717bf08f5096291740fa313649e14280d156d0cf7cdcf50082f8'
14
+ bytes: 14199,
15
+ sha256: 'df8c29d31d8522a1f5ce19e2a6b228d02a392181e4971cc04206be7f49cecc34'
16
16
  }
17
17
  };
18
18
  export const bundledC3WorkerReceipt = {
19
- bytes: 17225,
20
- sha256: '043817070c6f6c9f6ce3d570a5de79c7be1ca3dba3d40c482be9f962ad714c57'
19
+ bytes: 17373,
20
+ sha256: '5a2a5f65bf99e5aec89212a0609749a786b1375e97946bbc19da8387efae349d'
21
21
  };
@@ -1,6 +1,6 @@
1
1
  export declare const WASM_DEBUG_RUNTIME_PROFILE: Readonly<{
2
2
  manifestReceipt: Readonly<{
3
3
  bytes: 2853;
4
- sha256: "d4b08c91cd9bc810d0862ea2a5ef5a092e52f6b22a6f3121499ec5d3df2086b5";
4
+ sha256: "78e65afcf84ed709c6d166f4ef55bf34e5e3b10c61155a3484547cb8b27bd3a1";
5
5
  }>;
6
6
  }>;
@@ -1,6 +1,6 @@
1
1
  export const WASM_DEBUG_RUNTIME_PROFILE = Object.freeze({
2
2
  manifestReceipt: Object.freeze({
3
3
  bytes: 2853,
4
- sha256: 'd4b08c91cd9bc810d0862ea2a5ef5a092e52f6b22a6f3121499ec5d3df2086b5'
4
+ sha256: '78e65afcf84ed709c6d166f4ef55bf34e5e3b10c61155a3484547cb8b27bd3a1'
5
5
  })
6
6
  });
@@ -1 +1 @@
1
- export declare const WASM_DOTNET_ASSET_VERSION = "8f1f986689faf541";
1
+ export declare const WASM_DOTNET_ASSET_VERSION = "82669c38f4f5e55f";
@@ -1 +1 @@
1
- export const WASM_DOTNET_ASSET_VERSION = '8f1f986689faf541';
1
+ export const WASM_DOTNET_ASSET_VERSION = '82669c38f4f5e55f';
@@ -1 +1 @@
1
- export declare const WASM_GO_ASSET_VERSION = "c92a5b9dc0c99663";
1
+ export declare const WASM_GO_ASSET_VERSION = "74214135e06c0e21";
@@ -1 +1 @@
1
- export const WASM_GO_ASSET_VERSION = 'c92a5b9dc0c99663';
1
+ export const WASM_GO_ASSET_VERSION = '74214135e06c0e21';
@@ -1 +1,6 @@
1
1
  export declare const WASM_LISP_ASSET_VERSION = "588e867fce63b2d638f15ab09edef831fb701d26664a4644144d0e91c0ab7ef7";
2
+ export declare const WASM_LISP_MANIFEST_RECEIPT: Readonly<{
3
+ sha256: "f8d1197afabea4c50904a1865abd74757e5dd924034f37e36a132d3833c558c8";
4
+ bytes: 6157;
5
+ mediaType: "application/json";
6
+ }>;
@@ -1 +1,6 @@
1
1
  export const WASM_LISP_ASSET_VERSION = '588e867fce63b2d638f15ab09edef831fb701d26664a4644144d0e91c0ab7ef7';
2
+ export const WASM_LISP_MANIFEST_RECEIPT = Object.freeze({
3
+ sha256: 'f8d1197afabea4c50904a1865abd74757e5dd924034f37e36a132d3833c558c8',
4
+ bytes: 6157,
5
+ mediaType: 'application/json'
6
+ });
@@ -1,12 +1,12 @@
1
- export declare const WASM_OCAML_ASSET_VERSION = "8442b877cbc5a4b2c5ccb6fe2e55239eb059cda2c05ece5b713f50c5c8813dcb";
1
+ export declare const WASM_OCAML_ASSET_VERSION = "c8f8c435d39a1c0666be2e1fd99eab2780b3614fe3ebdaa5c7bcf48e13448bc0";
2
2
  export declare const WASM_OCAML_RUNTIME_PROFILE: Readonly<{
3
- fingerprint: "8442b877cbc5a4b2c5ccb6fe2e55239eb059cda2c05ece5b713f50c5c8813dcb";
3
+ fingerprint: "c8f8c435d39a1c0666be2e1fd99eab2780b3614fe3ebdaa5c7bcf48e13448bc0";
4
4
  moduleReceipt: Readonly<{
5
5
  bytes: 1892;
6
6
  sha256: "17d80beb633799e9021dc1b851bc76283494d981ec20fc315462d740284fa13a";
7
7
  }>;
8
8
  manifestReceipt: Readonly<{
9
- bytes: 60021;
10
- sha256: "968ae852c9a244a19f6bdef12e42e0495ad38b1e1f29bdeb5534bb178c85768e";
9
+ bytes: 62221;
10
+ sha256: "12059feaaa9fb6c89c429162aa40454f82ede1600ed053ac3a9539eff75f5992";
11
11
  }>;
12
12
  }>;
@@ -1,4 +1,4 @@
1
- export const WASM_OCAML_ASSET_VERSION = '8442b877cbc5a4b2c5ccb6fe2e55239eb059cda2c05ece5b713f50c5c8813dcb';
1
+ export const WASM_OCAML_ASSET_VERSION = 'c8f8c435d39a1c0666be2e1fd99eab2780b3614fe3ebdaa5c7bcf48e13448bc0';
2
2
  export const WASM_OCAML_RUNTIME_PROFILE = Object.freeze({
3
3
  fingerprint: WASM_OCAML_ASSET_VERSION,
4
4
  moduleReceipt: Object.freeze({
@@ -6,7 +6,7 @@ export const WASM_OCAML_RUNTIME_PROFILE = Object.freeze({
6
6
  sha256: '17d80beb633799e9021dc1b851bc76283494d981ec20fc315462d740284fa13a'
7
7
  }),
8
8
  manifestReceipt: Object.freeze({
9
- bytes: 60021,
10
- sha256: '968ae852c9a244a19f6bdef12e42e0495ad38b1e1f29bdeb5534bb178c85768e'
9
+ bytes: 62221,
10
+ sha256: '12059feaaa9fb6c89c429162aa40454f82ede1600ed053ac3a9539eff75f5992'
11
11
  })
12
12
  });
@@ -1,31 +1,31 @@
1
1
  export declare const WASM_PROLOG_RUNTIME_PROFILE: {
2
- readonly profileId: "swipl-wasm-8.2.1-swipl-10.1.15";
3
- readonly packageRevision: "85167290994ede92eab1aa5e399007c031e6cb82";
4
- readonly swiplRevision: "5db27168f89b15186745ea401fbb99a017413788";
5
- readonly manifestFingerprint: "c97f050d36f55558811d27021580338dd01e37016c70e1ef2daaaad0a29618b3";
2
+ readonly profileId: "swipl-wasm-8.2.5-swipl-10.1.19";
3
+ readonly packageRevision: "a633668fc459e0fd4ec5f993443d07b0c933aa2a";
4
+ readonly swiplRevision: "724df2b54cf1dda6fb3327d9167db2ae750c460e";
5
+ readonly manifestFingerprint: "f1cfa59be0be8ff815e056b53f6c59bd270dbdabc62f09bcd42e40122185d95a";
6
6
  readonly manifestReceipt: {
7
7
  readonly bytes: 2576;
8
- readonly sha256: "b67d6f6ff9115bd886d2992b0ad97e7d726aa66cc2a3e288ce7f99a3249d6d47";
8
+ readonly sha256: "aae0a74de3c773a5b7da1cbd14e1e55e95f3f8a52cb2435c9fcad4e6684279f7";
9
9
  };
10
10
  readonly javascriptReceipt: {
11
- readonly bytes: 193421;
12
- readonly sha256: "635da02ac0eb18e51303e4a0398b220d17cabfc0e4b7a2acbc7af9e949e4a9c7";
11
+ readonly bytes: 191369;
12
+ readonly sha256: "b71b671c5396c0d3ab4e04ee0376bfb47319cdfcf4b00b202ba3fdb671de6e7d";
13
13
  };
14
14
  readonly wasmReceipt: {
15
- readonly bytes: 820495;
16
- readonly sha256: "da8461e22b4513c5020d7eef7f8e62b2086003125381d18fed08f3656eecd793";
17
- readonly uncompressedBytes: 2275324;
18
- readonly uncompressedSha256: "c8831c0ac6a021b6bc67fa1b86e8826d1ea92a1a81b932cfb88fea235361c355";
15
+ readonly bytes: 835909;
16
+ readonly sha256: "fb3d7bb440083b48d383a178dcab0325f4a61c9e470d42bf12e0431f39f0f54e";
17
+ readonly uncompressedBytes: 2311472;
18
+ readonly uncompressedSha256: "80674a1223edc60629460fca12e322f9c27fdeb20ef72fc0f755edea1906a3b2";
19
19
  };
20
20
  readonly dataReceipt: {
21
- readonly bytes: 1192600;
22
- readonly sha256: "ea735ff89940eaed405a4a9b2be8606141d821016f3fc7671983b2203e88e86f";
23
- readonly uncompressedBytes: 1659074;
24
- readonly uncompressedSha256: "91e9d9c1d184f1a291c870e96bf6a1bc502ce8787946c966526a663a725ba932";
21
+ readonly bytes: 1195673;
22
+ readonly sha256: "432ea3836adabf3fd034494b74c8e5c7748108a9977cf3b5efa2310c4eea373d";
23
+ readonly uncompressedBytes: 1662393;
24
+ readonly uncompressedSha256: "a980ac3f2ecb5a5d670b8470ab77c780768c0c6421ed51ef063f606d736c55a4";
25
25
  };
26
26
  };
27
- export declare const WASM_PROLOG_ASSET_VERSION: "c97f050d36f55558811d27021580338dd01e37016c70e1ef2daaaad0a29618b3";
27
+ export declare const WASM_PROLOG_ASSET_VERSION: "f1cfa59be0be8ff815e056b53f6c59bd270dbdabc62f09bcd42e40122185d95a";
28
28
  export declare const WASM_PROLOG_RUNNER_RECEIPT: {
29
29
  readonly bytes: 25728;
30
- readonly sha256: "f7b90043b2fc7cbcac475264841705633f433604adb2e61ac4f6dbc505f5c2b4";
30
+ readonly sha256: "3f30582ec19cf430e6d2f7e9d544cc0f766accc7361f0a3fbb427bcdb7d0298b";
31
31
  };
@@ -1,31 +1,31 @@
1
1
  export const WASM_PROLOG_RUNTIME_PROFILE = {
2
- profileId: 'swipl-wasm-8.2.1-swipl-10.1.15',
3
- packageRevision: '85167290994ede92eab1aa5e399007c031e6cb82',
4
- swiplRevision: '5db27168f89b15186745ea401fbb99a017413788',
5
- manifestFingerprint: 'c97f050d36f55558811d27021580338dd01e37016c70e1ef2daaaad0a29618b3',
2
+ profileId: 'swipl-wasm-8.2.5-swipl-10.1.19',
3
+ packageRevision: 'a633668fc459e0fd4ec5f993443d07b0c933aa2a',
4
+ swiplRevision: '724df2b54cf1dda6fb3327d9167db2ae750c460e',
5
+ manifestFingerprint: 'f1cfa59be0be8ff815e056b53f6c59bd270dbdabc62f09bcd42e40122185d95a',
6
6
  manifestReceipt: {
7
7
  bytes: 2576,
8
- sha256: 'b67d6f6ff9115bd886d2992b0ad97e7d726aa66cc2a3e288ce7f99a3249d6d47'
8
+ sha256: 'aae0a74de3c773a5b7da1cbd14e1e55e95f3f8a52cb2435c9fcad4e6684279f7'
9
9
  },
10
10
  javascriptReceipt: {
11
- bytes: 193421,
12
- sha256: '635da02ac0eb18e51303e4a0398b220d17cabfc0e4b7a2acbc7af9e949e4a9c7'
11
+ bytes: 191369,
12
+ sha256: 'b71b671c5396c0d3ab4e04ee0376bfb47319cdfcf4b00b202ba3fdb671de6e7d'
13
13
  },
14
14
  wasmReceipt: {
15
- bytes: 820495,
16
- sha256: 'da8461e22b4513c5020d7eef7f8e62b2086003125381d18fed08f3656eecd793',
17
- uncompressedBytes: 2275324,
18
- uncompressedSha256: 'c8831c0ac6a021b6bc67fa1b86e8826d1ea92a1a81b932cfb88fea235361c355'
15
+ bytes: 835909,
16
+ sha256: 'fb3d7bb440083b48d383a178dcab0325f4a61c9e470d42bf12e0431f39f0f54e',
17
+ uncompressedBytes: 2311472,
18
+ uncompressedSha256: '80674a1223edc60629460fca12e322f9c27fdeb20ef72fc0f755edea1906a3b2'
19
19
  },
20
20
  dataReceipt: {
21
- bytes: 1192600,
22
- sha256: 'ea735ff89940eaed405a4a9b2be8606141d821016f3fc7671983b2203e88e86f',
23
- uncompressedBytes: 1659074,
24
- uncompressedSha256: '91e9d9c1d184f1a291c870e96bf6a1bc502ce8787946c966526a663a725ba932'
21
+ bytes: 1195673,
22
+ sha256: '432ea3836adabf3fd034494b74c8e5c7748108a9977cf3b5efa2310c4eea373d',
23
+ uncompressedBytes: 1662393,
24
+ uncompressedSha256: 'a980ac3f2ecb5a5d670b8470ab77c780768c0c6421ed51ef063f606d736c55a4'
25
25
  }
26
26
  };
27
27
  export const WASM_PROLOG_ASSET_VERSION = WASM_PROLOG_RUNTIME_PROFILE.manifestFingerprint;
28
28
  export const WASM_PROLOG_RUNNER_RECEIPT = {
29
29
  bytes: 25728,
30
- sha256: 'f7b90043b2fc7cbcac475264841705633f433604adb2e61ac4f6dbc505f5c2b4'
30
+ sha256: '3f30582ec19cf430e6d2f7e9d544cc0f766accc7361f0a3fbb427bcdb7d0298b'
31
31
  };