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.
Files changed (197) hide show
  1. package/README.md +267 -112
  2. package/dist/container/bash-profile.d.ts +80 -0
  3. package/dist/container/bash-profile.js +328 -0
  4. package/dist/container/binding.d.ts +39 -0
  5. package/dist/container/binding.js +331 -0
  6. package/dist/container/clang-runtime.d.ts +42 -0
  7. package/dist/container/clang-runtime.js +561 -0
  8. package/dist/container/client.d.ts +14 -0
  9. package/dist/container/client.js +185 -0
  10. package/dist/container/explorer.d.ts +31 -0
  11. package/dist/container/explorer.js +112 -0
  12. package/dist/container/index.d.ts +11 -0
  13. package/dist/container/index.js +11 -0
  14. package/dist/container/owner-worker.d.ts +19 -0
  15. package/dist/container/owner-worker.js +464 -0
  16. package/dist/container/protocol.d.ts +84 -0
  17. package/dist/container/protocol.js +28 -0
  18. package/dist/container/runtime-adapter.d.ts +75 -0
  19. package/dist/container/runtime-adapter.js +537 -0
  20. package/dist/container/shell-control.d.ts +49 -0
  21. package/dist/container/shell-control.js +360 -0
  22. package/dist/container/workspace.d.ts +12 -0
  23. package/dist/container/workspace.js +29 -0
  24. package/dist/index.d.ts +1 -1
  25. package/dist/playground/assetBridge.js +111 -33
  26. package/dist/playground/assets.d.ts +10 -2
  27. package/dist/playground/c3.js +22 -0
  28. package/dist/playground/c3Memory.d.ts +19 -0
  29. package/dist/playground/c3Memory.js +117 -0
  30. package/dist/playground/cachedClang.js +143 -34
  31. package/dist/playground/clang.d.ts +5 -1
  32. package/dist/playground/clang.js +61 -5
  33. package/dist/playground/clangAssetIntegrity.js +6 -6
  34. package/dist/playground/clangWorkerProtocol.d.ts +12 -1
  35. package/dist/playground/cobol.d.ts +3 -0
  36. package/dist/playground/cobol.js +10 -1
  37. package/dist/playground/commonlispAssets.d.ts +2 -2
  38. package/dist/playground/compiledArtifactCache.d.ts +3 -1
  39. package/dist/playground/compiledArtifactCache.js +31 -5
  40. package/dist/playground/compiledLldb.d.ts +41 -0
  41. package/dist/playground/compiledLldb.js +167 -0
  42. package/dist/playground/d.d.ts +10 -2
  43. package/dist/playground/d.js +161 -14
  44. package/dist/playground/debugDeadline.d.ts +12 -0
  45. package/dist/playground/debugDeadline.js +34 -0
  46. package/dist/playground/debugMailbox.d.ts +12 -0
  47. package/dist/playground/debugMailbox.js +77 -0
  48. package/dist/playground/dotnet.js +6 -8
  49. package/dist/playground/fortran.d.ts +3 -0
  50. package/dist/playground/fortran.js +10 -1
  51. package/dist/playground/go.js +23 -7
  52. package/dist/playground/goDebugInstrumentation.js +207 -97
  53. package/dist/playground/java-debug-FMHDKUN6.js +124 -0
  54. package/dist/playground/java-debug-notices.txt +492 -0
  55. package/dist/playground/java.d.ts +17 -1
  56. package/dist/playground/java.js +162 -5
  57. package/dist/playground/javaDebug.d.ts +62 -0
  58. package/dist/playground/javaDebug.js +305 -0
  59. package/dist/playground/javaDebugBridge.d.ts +6 -0
  60. package/dist/playground/javaDebugBridge.js +250 -0
  61. package/dist/playground/javaDebugSource.d.ts +9 -0
  62. package/dist/playground/javaDebugSource.js +4 -0
  63. package/dist/playground/javaRuntimeErrors.d.ts +9 -0
  64. package/dist/playground/javaRuntimeErrors.js +93 -0
  65. package/dist/playground/lean4Assets.d.ts +1 -25
  66. package/dist/playground/lean4Assets.js +2 -123
  67. package/dist/playground/lfortran.js +10 -0
  68. package/dist/playground/lfortranAssets.d.ts +2 -2
  69. package/dist/playground/lldbSession.d.ts +23 -2
  70. package/dist/playground/lldbSession.js +278 -58
  71. package/dist/playground/lldbSourcePath.d.ts +2 -0
  72. package/dist/playground/lldbSourcePath.js +9 -0
  73. package/dist/playground/lua.d.ts +20 -1
  74. package/dist/playground/lua.js +190 -8
  75. package/dist/playground/luaDebug.d.ts +1 -0
  76. package/dist/playground/luaDebug.js +1 -0
  77. package/dist/playground/nim.d.ts +1 -0
  78. package/dist/playground/nim.js +30 -0
  79. package/dist/playground/objectivec.d.ts +10 -6
  80. package/dist/playground/objectivec.js +85 -10
  81. package/dist/playground/options.d.ts +12 -4
  82. package/dist/playground/python.d.ts +8 -1
  83. package/dist/playground/python.js +89 -6
  84. package/dist/playground/ruby.d.ts +10 -1
  85. package/dist/playground/ruby.js +66 -1
  86. package/dist/playground/rubyDebug.d.ts +21 -0
  87. package/dist/playground/rubyDebug.js +128 -0
  88. package/dist/playground/runtimeAssetCache.d.ts +1 -32
  89. package/dist/playground/runtimeAssetCache.js +1 -193
  90. package/dist/playground/runtimeSession.d.ts +2 -2
  91. package/dist/playground/runtimeSession.js +11 -11
  92. package/dist/playground/rust.d.ts +10 -0
  93. package/dist/playground/rust.js +230 -51
  94. package/dist/playground/sandbox.d.ts +8 -1
  95. package/dist/playground/staticStdinRing.d.ts +2 -1
  96. package/dist/playground/staticStdinRing.js +21 -10
  97. package/dist/playground/staticWorkerRuntime.d.ts +15 -1
  98. package/dist/playground/staticWorkerRuntime.js +127 -19
  99. package/dist/playground/stdinBuffer.d.ts +1 -1
  100. package/dist/playground/stdinBuffer.js +19 -2
  101. package/dist/playground/tinygo.d.ts +3 -0
  102. package/dist/playground/tinygo.js +88 -6
  103. package/dist/playground/typescript.js +8 -0
  104. package/dist/playground/v.d.ts +6 -2
  105. package/dist/playground/v.js +76 -13
  106. package/dist/playground/wasmAwkVersion.d.ts +13 -13
  107. package/dist/playground/wasmAwkVersion.js +4 -4
  108. package/dist/playground/wasmBqnVersion.d.ts +2 -2
  109. package/dist/playground/wasmBqnVersion.js +2 -2
  110. package/dist/playground/wasmC3Version.d.ts +2 -2
  111. package/dist/playground/wasmC3Version.js +2 -2
  112. package/dist/playground/wasmClojureScriptVersion.d.ts +2 -2
  113. package/dist/playground/wasmClojureScriptVersion.js +2 -2
  114. package/dist/playground/wasmCommonLispVersion.d.ts +2 -2
  115. package/dist/playground/wasmCommonLispVersion.js +2 -2
  116. package/dist/playground/wasmDIntegrity.d.ts +5 -5
  117. package/dist/playground/wasmDIntegrity.js +5 -5
  118. package/dist/playground/wasmDVersion.d.ts +16 -1
  119. package/dist/playground/wasmDVersion.js +16 -1
  120. package/dist/playground/wasmDebugVersion.d.ts +1 -1
  121. package/dist/playground/wasmDebugVersion.js +1 -1
  122. package/dist/playground/wasmForthVersion.d.ts +2 -2
  123. package/dist/playground/wasmForthVersion.js +2 -2
  124. package/dist/playground/wasmGleamVersion.d.ts +2 -2
  125. package/dist/playground/wasmGleamVersion.js +2 -2
  126. package/dist/playground/wasmGrainVersion.d.ts +2 -2
  127. package/dist/playground/wasmGrainVersion.js +2 -2
  128. package/dist/playground/wasmJVersion.d.ts +2 -2
  129. package/dist/playground/wasmJVersion.js +2 -2
  130. package/dist/playground/wasmJanetVersion.js +2 -2
  131. package/dist/playground/wasmJuliaVersion.js +2 -2
  132. package/dist/playground/wasmLean4Version.d.ts +1 -110
  133. package/dist/playground/wasmLean4Version.js +2 -111
  134. package/dist/playground/wasmLfortranVersion.d.ts +2 -2
  135. package/dist/playground/wasmLfortranVersion.js +2 -2
  136. package/dist/playground/wasmLuaVersion.d.ts +1 -1
  137. package/dist/playground/wasmLuaVersion.js +1 -1
  138. package/dist/playground/wasmNimVersion.d.ts +9 -9
  139. package/dist/playground/wasmNimVersion.js +6 -6
  140. package/dist/playground/wasmOcamlVersion.d.ts +2 -2
  141. package/dist/playground/wasmOcamlVersion.js +1 -1
  142. package/dist/playground/wasmPascalVersion.js +2 -2
  143. package/dist/playground/wasmPerlVersion.js +2 -2
  144. package/dist/playground/wasmPrologVersion.d.ts +2 -2
  145. package/dist/playground/wasmPrologVersion.js +2 -2
  146. package/dist/playground/wasmReScriptVersion.d.ts +2 -2
  147. package/dist/playground/wasmReScriptVersion.js +2 -2
  148. package/dist/playground/wasmRustVersion.d.ts +26 -38
  149. package/dist/playground/wasmRustVersion.js +25 -40
  150. package/dist/playground/wasmTclVersion.d.ts +4 -4
  151. package/dist/playground/wasmTclVersion.js +2 -2
  152. package/dist/playground/wasmTinyGoVersion.d.ts +14 -14
  153. package/dist/playground/wasmTinyGoVersion.js +14 -14
  154. package/dist/playground/wasmTypeScriptVersion.d.ts +5 -5
  155. package/dist/playground/wasmTypeScriptVersion.js +5 -5
  156. package/dist/playground/worker/cachedClangCompile.js +52 -4
  157. package/dist/playground/worker/cachedClangExecute.js +6 -5
  158. package/dist/playground/worker/clang.js +33 -11
  159. package/dist/playground/worker/cobol.js +3 -3
  160. package/dist/playground/worker/d.js +63 -7
  161. package/dist/playground/worker/fortran.js +3 -3
  162. package/dist/playground/worker/go.js +16 -5
  163. package/dist/playground/worker/haskell.js +10 -7
  164. package/dist/playground/worker/java.js +263 -45
  165. package/dist/playground/worker/javaDebugEvaluator.d.ts +16 -0
  166. package/dist/playground/worker/javaDebugEvaluator.js +44 -0
  167. package/dist/playground/worker/javaDebugRuntime.d.ts +24 -0
  168. package/dist/playground/worker/javaDebugRuntime.js +315 -0
  169. package/dist/playground/worker/javaOutput.d.ts +11 -0
  170. package/dist/playground/worker/javaOutput.js +54 -0
  171. package/dist/playground/worker/lua.js +15 -3
  172. package/dist/playground/worker/php.js +15 -9
  173. package/dist/playground/worker/python.js +102 -30
  174. package/dist/playground/worker/pythonExecution.js +17 -1
  175. package/dist/playground/worker/pythonWorkspaceFiles.d.ts +6 -0
  176. package/dist/playground/worker/pythonWorkspaceFiles.js +26 -0
  177. package/dist/playground/worker/pythonWorkspaceImports.d.ts +4 -0
  178. package/dist/playground/worker/pythonWorkspaceImports.js +129 -0
  179. package/dist/playground/worker/r.js +13 -6
  180. package/dist/playground/worker/ruby.js +13 -0
  181. package/dist/playground/worker/rubyDebugPreview.d.ts +2 -0
  182. package/dist/playground/worker/rubyDebugPreview.js +80 -0
  183. package/dist/playground/worker/rubyTracepoint.d.ts +16 -0
  184. package/dist/playground/worker/rubyTracepoint.js +162 -0
  185. package/dist/playground/worker/rust.js +38 -3
  186. package/dist/playground/worker/sqlite.js +4 -3
  187. package/dist/playground/worker/tinygo.js +11 -3
  188. package/dist/playground/worker/typescript.js +2 -3
  189. package/dist/playground/worker/v.js +32 -7
  190. package/dist/playground/worker/wat.js +2 -3
  191. package/dist/playground/worker/zig.js +20 -6
  192. package/dist/playground/workerSession.d.ts +1 -28
  193. package/dist/playground/workerSession.js +1 -164
  194. package/dist/playground/zig.js +4 -0
  195. package/package.json +66 -15
  196. package/dist/playground/worker/python.runtime.cases.d.ts +0 -1
  197. package/dist/playground/worker/python.runtime.cases.js +0 -374
@@ -1,8 +1,8 @@
1
1
  export const WASM_RUST_RUNTIME_PROFILE = Object.freeze({
2
- profileId: 'wasm-rust-292ad2fd5b130d101e8b8c853e702942649011d26ce42660babd35b2b61aff00',
2
+ profileId: 'wasm-rust-6990bddaebda5337b365913696303cc2c6c3251c6143721f4b0b58defd83411f',
3
3
  protocolVersion: 1,
4
4
  manifestPath: 'runtime/runtime-manifest.v3.json',
5
- manifestFingerprint: '292ad2fd5b130d101e8b8c853e702942649011d26ce42660babd35b2b61aff00',
5
+ manifestFingerprint: '6990bddaebda5337b365913696303cc2c6c3251c6143721f4b0b58defd83411f',
6
6
  manifestReceipt: {
7
7
  bytes: 6185,
8
8
  sha256: '30b210003632395a1effd19f7a46565d5f8c52a9d3a28a310fa24219f97a5a9a'
@@ -181,12 +181,12 @@ export const WASM_RUST_EXECUTABLE_GRAPH_PROFILE = Object.freeze({
181
181
  encoding: 'identity'
182
182
  },
183
183
  storage: {
184
- bytes: 6936,
185
- sha256: '3a7d5ad84676ceabef0758be7230abb97ef496375b2d4838cc25d02371465f7b'
184
+ bytes: 10748,
185
+ sha256: 'b18798a82090629e5f86524476d757932de74af580431874c2eeebf6b704cb0f'
186
186
  },
187
187
  logical: {
188
- bytes: 6936,
189
- sha256: '3a7d5ad84676ceabef0758be7230abb97ef496375b2d4838cc25d02371465f7b'
188
+ bytes: 10748,
189
+ sha256: 'b18798a82090629e5f86524476d757932de74af580431874c2eeebf6b704cb0f'
190
190
  },
191
191
  imports: [
192
192
  {
@@ -206,23 +206,8 @@ export const WASM_RUST_EXECUTABLE_GRAPH_PROFILE = Object.freeze({
206
206
  },
207
207
  {
208
208
  kind: 'static',
209
- specifier: './vendor/browser_wasi_shim/fd.js',
210
- target: 'vendor/browser_wasi_shim/fd.js'
211
- },
212
- {
213
- kind: 'static',
214
- specifier: './vendor/browser_wasi_shim/fs_mem.js',
215
- target: 'vendor/browser_wasi_shim/fs_mem.js'
216
- },
217
- {
218
- kind: 'static',
219
- specifier: './vendor/browser_wasi_shim/wasi.js',
220
- target: 'vendor/browser_wasi_shim/wasi.js'
221
- },
222
- {
223
- kind: 'static',
224
- specifier: './vendor/browser_wasi_shim/wasi_defs.js',
225
- target: 'vendor/browser_wasi_shim/wasi_defs.js'
209
+ specifier: './vendor/browser_wasi_shim/index.js',
210
+ target: 'vendor/browser_wasi_shim/index.js'
226
211
  }
227
212
  ],
228
213
  assets: [],
@@ -415,12 +400,12 @@ export const WASM_RUST_EXECUTABLE_GRAPH_PROFILE = Object.freeze({
415
400
  encoding: 'identity'
416
401
  },
417
402
  storage: {
418
- bytes: 5220,
419
- sha256: '52164fb602e546e61e6a5a2e09ae3c61aba9377c1b9918b0a788d92e4c497a5b'
403
+ bytes: 5819,
404
+ sha256: '8933c8f043fb3dbee28d4f61d8a3ea16a372b2c833b1071a6531071388fed730'
420
405
  },
421
406
  logical: {
422
- bytes: 5220,
423
- sha256: '52164fb602e546e61e6a5a2e09ae3c61aba9377c1b9918b0a788d92e4c497a5b'
407
+ bytes: 5819,
408
+ sha256: '8933c8f043fb3dbee28d4f61d8a3ea16a372b2c833b1071a6531071388fed730'
424
409
  },
425
410
  imports: [],
426
411
  assets: [],
@@ -432,12 +417,12 @@ export const WASM_RUST_EXECUTABLE_GRAPH_PROFILE = Object.freeze({
432
417
  encoding: 'identity'
433
418
  },
434
419
  storage: {
435
- bytes: 22093,
436
- sha256: '72cd8fe5c7999ffa6e144b3d6ea3691686843063dc8405274c2573f1ea8356a2'
420
+ bytes: 24122,
421
+ sha256: 'fc799b595d8d4022cbf02328673b5bb08ad0f86be0da9ac0b3ac12e9f5d343fa'
437
422
  },
438
423
  logical: {
439
- bytes: 22093,
440
- sha256: '72cd8fe5c7999ffa6e144b3d6ea3691686843063dc8405274c2573f1ea8356a2'
424
+ bytes: 24122,
425
+ sha256: 'fc799b595d8d4022cbf02328673b5bb08ad0f86be0da9ac0b3ac12e9f5d343fa'
441
426
  },
442
427
  imports: [
443
428
  {
@@ -530,12 +515,12 @@ export const WASM_RUST_EXECUTABLE_GRAPH_PROFILE = Object.freeze({
530
515
  encoding: 'identity'
531
516
  },
532
517
  storage: {
533
- bytes: 35115,
534
- sha256: '6fd676dfda595610d41e44e80f90f9330aee5326d5daf42cb935a28b48dffc2b'
518
+ bytes: 37956,
519
+ sha256: 'd948487286c5920a5bbdaab94188ebeeadd8e405be74f4839c1cf8ddaf083c52'
535
520
  },
536
521
  logical: {
537
- bytes: 35115,
538
- sha256: '6fd676dfda595610d41e44e80f90f9330aee5326d5daf42cb935a28b48dffc2b'
522
+ bytes: 37956,
523
+ sha256: 'd948487286c5920a5bbdaab94188ebeeadd8e405be74f4839c1cf8ddaf083c52'
539
524
  },
540
525
  imports: [
541
526
  {
@@ -628,12 +613,12 @@ export const WASM_RUST_EXECUTABLE_GRAPH_PROFILE = Object.freeze({
628
613
  encoding: 'identity'
629
614
  },
630
615
  storage: {
631
- bytes: 3686,
632
- sha256: 'cfbc70c3349b35c1f510ead79fdfb95bb29700f2566716b6b5fa0d1017cd00d7'
616
+ bytes: 3969,
617
+ sha256: 'c3ee4682af8d8b9f338f1258fdff5701754f72753aa1b5385b7848bff1ff3e8d'
633
618
  },
634
619
  logical: {
635
- bytes: 3686,
636
- sha256: 'cfbc70c3349b35c1f510ead79fdfb95bb29700f2566716b6b5fa0d1017cd00d7'
620
+ bytes: 3969,
621
+ sha256: 'c3ee4682af8d8b9f338f1258fdff5701754f72753aa1b5385b7848bff1ff3e8d'
637
622
  },
638
623
  imports: [
639
624
  {
@@ -1588,6 +1573,6 @@ export const WASM_RUST_EXECUTABLE_GRAPH_PROFILE = Object.freeze({
1588
1573
  externals: []
1589
1574
  }
1590
1575
  },
1591
- fingerprint: '7d1b409ad0953dfe170cb7d34aeaf790ae82599cdd1520c22d777a35cab368a0'
1576
+ fingerprint: '5e2563e8a985fe3a30a209aa7cb7d53cdfd2b0b8af1c1a96b7e8f2d08046bfee'
1592
1577
  });
1593
1578
  export const WASM_RUST_ASSET_VERSION = WASM_RUST_RUNTIME_PROFILE.manifestFingerprint;
@@ -37,8 +37,8 @@ export declare const WASM_TCL_RUNTIME_PROFILE: {
37
37
  };
38
38
  export declare const WASM_TCL_ASSET_VERSION: "4687ad97c5bb5e96d4354a24e9faffeb9dc9eb1ee7e8c9b0c0ea289c5d9a2baa";
39
39
  export declare const WASM_TCL_RUNNER_RECEIPT: {
40
- readonly bytes: 31654;
41
- readonly sha256: "f65d0ed41589fe280219948afe7b4bb5f07766faac66fd2b15b70c5c2c50c4f2";
40
+ readonly bytes: 31944;
41
+ readonly sha256: "1f0656df1a3be8d8ff1f3da40ec8eb82aa79d4253b095d613e02278fdd945fca";
42
42
  };
43
43
  export declare const WASM_TCL_RUNTIME_BUNDLE: Readonly<{
44
44
  profile: {
@@ -79,7 +79,7 @@ export declare const WASM_TCL_RUNTIME_BUNDLE: Readonly<{
79
79
  };
80
80
  };
81
81
  workerReceipt: {
82
- readonly bytes: 31654;
83
- readonly sha256: "f65d0ed41589fe280219948afe7b4bb5f07766faac66fd2b15b70c5c2c50c4f2";
82
+ readonly bytes: 31944;
83
+ readonly sha256: "1f0656df1a3be8d8ff1f3da40ec8eb82aa79d4253b095d613e02278fdd945fca";
84
84
  };
85
85
  }>;
@@ -37,8 +37,8 @@ export const WASM_TCL_RUNTIME_PROFILE = {
37
37
  };
38
38
  export const WASM_TCL_ASSET_VERSION = WASM_TCL_RUNTIME_PROFILE.manifestFingerprint;
39
39
  export const WASM_TCL_RUNNER_RECEIPT = {
40
- bytes: 31654,
41
- sha256: 'f65d0ed41589fe280219948afe7b4bb5f07766faac66fd2b15b70c5c2c50c4f2'
40
+ bytes: 31944,
41
+ sha256: '1f0656df1a3be8d8ff1f3da40ec8eb82aa79d4253b095d613e02278fdd945fca'
42
42
  };
43
43
  export const WASM_TCL_RUNTIME_BUNDLE = Object.freeze({
44
44
  profile: WASM_TCL_RUNTIME_PROFILE,
@@ -46,7 +46,7 @@ export declare const WASM_TINYGO_EXECUTABLE_GRAPH_PROFILE: Readonly<{
46
46
  schemaVersion: 1;
47
47
  format: "wasm-idle-tinygo-executable-graph-v1";
48
48
  entryPath: "upstream.js";
49
- fingerprint: "8ecbffd4b4e44ff67288d8c46328a1b06d0a0ac76d7a50a9e458603b68d0d795";
49
+ fingerprint: "8b2e87ec50b586591903adcff8c547b37c3b23d4e12f97d8266035cefdeebac4";
50
50
  modules: Readonly<{
51
51
  'assets/upstream-binaryen-59aad93503b5fd53.wasm.gz.bin': Readonly<{
52
52
  bytes: 2366782;
@@ -55,20 +55,20 @@ export declare const WASM_TINYGO_EXECUTABLE_GRAPH_PROFILE: Readonly<{
55
55
  uncompressedSha256: "59aad93503b5fd539993f2f5571c11dce9ddb4c5d10b681abc8e5dc124aed526";
56
56
  imports: readonly never[];
57
57
  }>;
58
- 'assets/upstream-compile-worker-CFw6Ych6.js': Readonly<{
59
- bytes: 558;
60
- sha256: "03a76345c69f8bd751dac18894f65c0918f1690fbbb661f38052819cd5ae8209";
61
- imports: readonly never[];
62
- }>;
63
- 'assets/upstream-compile-worker-CUrboB1_.js': Readonly<{
64
- bytes: 103559;
65
- sha256: "42337c2f06d04b51d79f0ec66ae685f0cfb2a78718b0636df980dc92dd1db9d5";
58
+ 'assets/upstream-compile-worker-6CYe8gHb.js': Readonly<{
59
+ bytes: 105574;
60
+ sha256: "30c6b0d3f0968222e0d78f7ec54300838eca0326558e448bc48ab213e35aae2f";
66
61
  imports: readonly Readonly<{
67
62
  specifier: "./upstream-compile-worker-CeYS3ydo.js";
68
63
  target: "assets/upstream-compile-worker-CeYS3ydo.js";
69
64
  kind: "dynamic";
70
65
  }>[];
71
66
  }>;
67
+ 'assets/upstream-compile-worker-CFw6Ych6.js': Readonly<{
68
+ bytes: 558;
69
+ sha256: "03a76345c69f8bd751dac18894f65c0918f1690fbbb661f38052819cd5ae8209";
70
+ imports: readonly never[];
71
+ }>;
72
72
  'assets/upstream-compile-worker-CeYS3ydo.js': Readonly<{
73
73
  bytes: 181175;
74
74
  sha256: "faa2bf6a310cd23991babde1fb62cd34253d692fee03029fe3508eae4c24b1c0";
@@ -96,14 +96,14 @@ export declare const WASM_TINYGO_EXECUTABLE_GRAPH_PROFILE: Readonly<{
96
96
  }>[];
97
97
  }>;
98
98
  'upstream.js': Readonly<{
99
- bytes: 126073;
100
- sha256: "136a957aa940c3e2b8c7a925eb538f3fce81f699aa9113e1fd93ce0b35c879aa";
99
+ bytes: 126235;
100
+ sha256: "b780e6d7492c60f9c7481eda0b3ef45be15887ee367b8728532e824a4592e3b1";
101
101
  imports: readonly Readonly<{
102
- specifier: "assets/upstream-compile-worker-CUrboB1_.js";
103
- target: "assets/upstream-compile-worker-CUrboB1_.js";
102
+ specifier: "assets/upstream-compile-worker-6CYe8gHb.js";
103
+ target: "assets/upstream-compile-worker-6CYe8gHb.js";
104
104
  kind: "worker";
105
105
  }>[];
106
106
  }>;
107
107
  }>;
108
108
  }>;
109
- export declare const WASM_TINYGO_ASSET_VERSION = "0b2e827ae219eecc806d4118ee4a2b6032adbe7a960e6c0e471c4491d9a1f2f3";
109
+ export declare const WASM_TINYGO_ASSET_VERSION = "43cb86856c8d017a66529bbed945b564b3c6a8d6a59bf3e98afb47d1ac25f8f2";
@@ -46,7 +46,7 @@ export const WASM_TINYGO_EXECUTABLE_GRAPH_PROFILE = Object.freeze({
46
46
  schemaVersion: 1,
47
47
  format: WASM_TINYGO_EXECUTABLE_GRAPH_FORMAT,
48
48
  entryPath: 'upstream.js',
49
- fingerprint: '8ecbffd4b4e44ff67288d8c46328a1b06d0a0ac76d7a50a9e458603b68d0d795',
49
+ fingerprint: '8b2e87ec50b586591903adcff8c547b37c3b23d4e12f97d8266035cefdeebac4',
50
50
  modules: Object.freeze({
51
51
  'assets/upstream-binaryen-59aad93503b5fd53.wasm.gz.bin': Object.freeze({
52
52
  bytes: 2366782,
@@ -55,14 +55,9 @@ export const WASM_TINYGO_EXECUTABLE_GRAPH_PROFILE = Object.freeze({
55
55
  uncompressedSha256: '59aad93503b5fd539993f2f5571c11dce9ddb4c5d10b681abc8e5dc124aed526',
56
56
  imports: Object.freeze([])
57
57
  }),
58
- 'assets/upstream-compile-worker-CFw6Ych6.js': Object.freeze({
59
- bytes: 558,
60
- sha256: '03a76345c69f8bd751dac18894f65c0918f1690fbbb661f38052819cd5ae8209',
61
- imports: Object.freeze([])
62
- }),
63
- 'assets/upstream-compile-worker-CUrboB1_.js': Object.freeze({
64
- bytes: 103559,
65
- sha256: '42337c2f06d04b51d79f0ec66ae685f0cfb2a78718b0636df980dc92dd1db9d5',
58
+ 'assets/upstream-compile-worker-6CYe8gHb.js': Object.freeze({
59
+ bytes: 105574,
60
+ sha256: '30c6b0d3f0968222e0d78f7ec54300838eca0326558e448bc48ab213e35aae2f',
66
61
  imports: Object.freeze([
67
62
  Object.freeze({
68
63
  specifier: './upstream-compile-worker-CeYS3ydo.js',
@@ -71,6 +66,11 @@ export const WASM_TINYGO_EXECUTABLE_GRAPH_PROFILE = Object.freeze({
71
66
  })
72
67
  ])
73
68
  }),
69
+ 'assets/upstream-compile-worker-CFw6Ych6.js': Object.freeze({
70
+ bytes: 558,
71
+ sha256: '03a76345c69f8bd751dac18894f65c0918f1690fbbb661f38052819cd5ae8209',
72
+ imports: Object.freeze([])
73
+ }),
74
74
  'assets/upstream-compile-worker-CeYS3ydo.js': Object.freeze({
75
75
  bytes: 181175,
76
76
  sha256: 'faa2bf6a310cd23991babde1fb62cd34253d692fee03029fe3508eae4c24b1c0',
@@ -104,16 +104,16 @@ export const WASM_TINYGO_EXECUTABLE_GRAPH_PROFILE = Object.freeze({
104
104
  ])
105
105
  }),
106
106
  'upstream.js': Object.freeze({
107
- bytes: 126073,
108
- sha256: '136a957aa940c3e2b8c7a925eb538f3fce81f699aa9113e1fd93ce0b35c879aa',
107
+ bytes: 126235,
108
+ sha256: 'b780e6d7492c60f9c7481eda0b3ef45be15887ee367b8728532e824a4592e3b1',
109
109
  imports: Object.freeze([
110
110
  Object.freeze({
111
- specifier: 'assets/upstream-compile-worker-CUrboB1_.js',
112
- target: 'assets/upstream-compile-worker-CUrboB1_.js',
111
+ specifier: 'assets/upstream-compile-worker-6CYe8gHb.js',
112
+ target: 'assets/upstream-compile-worker-6CYe8gHb.js',
113
113
  kind: 'worker'
114
114
  })
115
115
  ])
116
116
  })
117
117
  })
118
118
  });
119
- export const WASM_TINYGO_ASSET_VERSION = '0b2e827ae219eecc806d4118ee4a2b6032adbe7a960e6c0e471c4491d9a1f2f3';
119
+ export const WASM_TINYGO_ASSET_VERSION = '43cb86856c8d017a66529bbed945b564b3c6a8d6a59bf3e98afb47d1ac25f8f2';
@@ -1,9 +1,9 @@
1
- export declare const WASM_TYPESCRIPT_ASSET_VERSION = "2d968f66f878ce33";
1
+ export declare const WASM_TYPESCRIPT_ASSET_VERSION = "e48868a1d3851320";
2
2
  export declare const WASM_TYPESCRIPT_MODULE_RECEIPT: Readonly<{
3
- bytes: 3759064;
4
- sha256: "2c8942b6383d25d4582e9db0ee38d85b61eb8016f16e57c840f3c20af9ac848b";
3
+ bytes: 3882154;
4
+ sha256: "df071064e3d1e8ce1c5bae87853db00021681d069b3ef046a884b95fa58eadfe";
5
5
  }>;
6
6
  export declare const WASM_JAVASCRIPT_MODULE_RECEIPT: Readonly<{
7
- bytes: 35866;
8
- sha256: "21b176cfe1ce4d39519979422bd1b3b598f183e9b3fe042ecc8cc37a535c3608";
7
+ bytes: 158899;
8
+ sha256: "9e2df469ef3934424fba004bb66b5a3b042ecaf1ad3496789ac8fe8e67389d65";
9
9
  }>;
@@ -1,9 +1,9 @@
1
- export const WASM_TYPESCRIPT_ASSET_VERSION = '2d968f66f878ce33';
1
+ export const WASM_TYPESCRIPT_ASSET_VERSION = 'e48868a1d3851320';
2
2
  export const WASM_TYPESCRIPT_MODULE_RECEIPT = Object.freeze({
3
- bytes: 3759064,
4
- sha256: '2c8942b6383d25d4582e9db0ee38d85b61eb8016f16e57c840f3c20af9ac848b'
3
+ bytes: 3882154,
4
+ sha256: 'df071064e3d1e8ce1c5bae87853db00021681d069b3ef046a884b95fa58eadfe'
5
5
  });
6
6
  export const WASM_JAVASCRIPT_MODULE_RECEIPT = Object.freeze({
7
- bytes: 35866,
8
- sha256: '21b176cfe1ce4d39519979422bd1b3b598f183e9b3fe042ecc8cc37a535c3608'
7
+ bytes: 158899,
8
+ sha256: '9e2df469ef3934424fba004bb66b5a3b042ecaf1ad3496789ac8fe8e67389d65'
9
9
  });
@@ -1,7 +1,8 @@
1
- import { BrowserClangRuntime, loadRuntimeManifest, resolveRuntimeManifestUrl } from '@wasm-idle/llvm-core/clang';
1
+ import { BrowserClangRuntime, loadRuntimeManifest, extractCompilerDiagnostics, resolveRuntimeManifestUrl } from '@wasm-idle/llvm-core/clang';
2
2
  import { configureWorkerRuntimeAssets, handleWorkerAssetMessage } from './assets';
3
3
  import { compileWorkerRuntimeAsset } from './runtimeModule';
4
4
  import { BUNDLED_CLANG_ASSET_INTEGRITY, BUNDLED_CLANG_LANGUAGE_SYSROOT_PROFILES } from '../clangAssetIntegrity';
5
+ import { OutputLimitError, resolveExecutionLimits } from '@wasm-idle/core';
5
6
  const worker = globalThis;
6
7
  let started = false;
7
8
  worker.onmessage = async ({ data }) => {
@@ -11,8 +12,36 @@ worker.onmessage = async ({ data }) => {
11
12
  return;
12
13
  started = true;
13
14
  const output = [];
15
+ const encoder = new TextEncoder();
16
+ let outputBytes = 0;
17
+ let outputLimitError;
18
+ const controller = new AbortController();
14
19
  let runtime;
15
20
  try {
21
+ const maxOutputBytes = resolveExecutionLimits(data.maxOutputBytes === undefined ? {} : { maxOutputBytes: data.maxOutputBytes }).maxOutputBytes;
22
+ const checkOutputBytes = (additionalBytes) => {
23
+ if (outputLimitError)
24
+ throw outputLimitError;
25
+ const actual = outputBytes + additionalBytes;
26
+ if (actual <= maxOutputBytes)
27
+ return;
28
+ outputLimitError = new OutputLimitError(`Compiler output exceeded ${maxOutputBytes} bytes`, { limit: maxOutputBytes, actual, phase: 'compile' });
29
+ const stdout = output.join('');
30
+ // Report before retaining a chunk, including temporarily buffered PCH diagnostics.
31
+ worker.postMessage({
32
+ type: 'error',
33
+ error: outputLimitError.message,
34
+ code: 'output-limit',
35
+ limit: maxOutputBytes,
36
+ actual,
37
+ stdout,
38
+ diagnostics: extractCompilerDiagnostics(stdout),
39
+ stderr: ''
40
+ });
41
+ // A header builder can recover close-time stream errors; prevent its cache write too.
42
+ controller.abort(outputLimitError);
43
+ throw outputLimitError;
44
+ };
16
45
  if (data.request.debug || (data.request.debugMode && data.request.debugMode !== 'none')) {
17
46
  throw new Error('Cached C/C++ execution does not support debug artifacts.');
18
47
  }
@@ -53,8 +82,16 @@ worker.onmessage = async ({ data }) => {
53
82
  maxAssetBytes: data.maxAssetBytes,
54
83
  manifest,
55
84
  persistentCache: data.persistentCache,
85
+ signal: controller.signal,
56
86
  log: data.log ?? false,
57
- stdout: (chunk) => output.push(chunk),
87
+ stdout: (chunk) => {
88
+ if (!chunk)
89
+ return;
90
+ const bytes = encoder.encode(chunk).byteLength;
91
+ checkOutputBytes(bytes);
92
+ outputBytes += bytes;
93
+ output.push(chunk);
94
+ },
58
95
  progress: (value) => worker.postMessage({
59
96
  type: 'progress',
60
97
  progress: {
@@ -79,9 +116,12 @@ worker.onmessage = async ({ data }) => {
79
116
  });
80
117
  const artifact = await runtime.compileArtifact(data.request.code, {
81
118
  ...data.request,
119
+ onBufferedOutput: checkOutputBytes,
82
120
  persistentCache: data.persistentCache,
83
121
  precompiledHeader: data.precompiledHeader
84
122
  });
123
+ if (outputLimitError)
124
+ return;
85
125
  if (runtime.usedPrecompiledHeader)
86
126
  worker.postMessage({
87
127
  type: 'progress',
@@ -93,19 +133,25 @@ worker.onmessage = async ({ data }) => {
93
133
  message: 'Compiled with precompiled <bits/stdc++.h>'
94
134
  }
95
135
  });
136
+ const stdout = output.join('');
96
137
  worker.postMessage({
97
138
  type: 'compiled',
98
139
  artifact,
99
- stdout: output.join(''),
140
+ stdout,
141
+ diagnostics: extractCompilerDiagnostics(stdout),
100
142
  stderr: '',
101
143
  ...buildingPrecompiledHeader(runtime)
102
144
  });
103
145
  }
104
146
  catch (error) {
147
+ if (outputLimitError)
148
+ return;
149
+ const stdout = output.join('');
105
150
  worker.postMessage({
106
151
  type: 'error',
107
152
  error: error instanceof Error ? error.message : String(error),
108
- stdout: output.join(''),
153
+ stdout,
154
+ diagnostics: extractCompilerDiagnostics(stdout),
109
155
  stderr: '',
110
156
  ...buildingPrecompiledHeader(runtime)
111
157
  });
@@ -114,6 +160,8 @@ worker.onmessage = async ({ data }) => {
114
160
  // headers, prepares <bits/stdc++.h> for the next compile.
115
161
  if (runtime && buildingPrecompiledHeader(runtime).precompiledHeader) {
116
162
  const header = await runtime.buildPrecompiledHeader().catch(() => undefined);
163
+ if (outputLimitError)
164
+ return;
117
165
  worker.postMessage({ type: 'precompiled-header', header }, header ? [header.bytes.buffer] : []);
118
166
  }
119
167
  };
@@ -13,19 +13,20 @@ worker.onmessage = async ({ data }) => {
13
13
  : new Uint8Array(data.inputBuffer, CLANG_STDIN_HEADER_BYTES);
14
14
  if (payload && payload.byteLength === 0)
15
15
  throw new Error('C/C++ stdin buffer is empty.');
16
- const files = (data.workspaceFiles || []).map(({ path, content }) => ({
17
- path,
18
- contents: content
19
- }));
16
+ const activePath = data.activePath || (data.artifact.language === 'C' ? 'main.c' : 'main.cc');
17
+ const files = (data.workspaceFiles || [])
18
+ .filter(({ path }) => data.code === undefined || path !== activePath)
19
+ .map(({ path, content }) => ({ path, contents: content }));
20
20
  if (data.code !== undefined) {
21
21
  files.push({
22
- path: data.activePath || (data.artifact.language === 'C' ? 'main.c' : 'main.cc'),
22
+ path: activePath,
23
23
  contents: data.code
24
24
  });
25
25
  }
26
26
  // The public executor creates a fresh WASI host, files, descriptors and Wasm
27
27
  // instance. Only the immutable compiled Module is reused across executions.
28
28
  const result = await executeBrowserClangArtifact(data.artifact, {
29
+ maxWasmMemoryBytes: data.maxWasmMemoryBytes,
29
30
  args: data.programArgs,
30
31
  env: data.env,
31
32
  files,
@@ -19,6 +19,25 @@ function missingPrecompiledHeader() {
19
19
  function postProgress(percent, stage) {
20
20
  postMessage({ progress: { percent, stage } });
21
21
  }
22
+ function normalizeLldbWorkspaceFiles(files) {
23
+ // Both compiler phases and LLDB accept text; retain BOMs and original FS bytes.
24
+ const decoder = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true });
25
+ return files.map((file) => {
26
+ let content = file.content;
27
+ if (typeof content !== 'string') {
28
+ const path = `/workspace/${normalizeDwarfWorkspacePath(file.path)}`;
29
+ if (!(content instanceof Uint8Array))
30
+ throw new TypeError(`LLDB workspace file content must be a string or Uint8Array: ${path}`);
31
+ try {
32
+ content = decoder.decode(content);
33
+ }
34
+ catch (cause) {
35
+ throw new Error(`LLDB workspace file is not valid UTF-8: ${path}`, { cause });
36
+ }
37
+ }
38
+ return { ...file, content };
39
+ });
40
+ }
22
41
  async function loadClang(path, log, maxAssetBytes, verifiedStreaming = false, languageSysrootProfiles = false, persistentCache) {
23
42
  const { BrowserClangRuntime, loadRuntimeManifest, resolveRuntimeManifestUrl } = await import('@wasm-idle/llvm-core/clang');
24
43
  const manifest = await loadRuntimeManifest(resolveRuntimeManifestUrl(path), fetch, undefined, maxAssetBytes);
@@ -106,7 +125,9 @@ self.onmessage = async (event) => {
106
125
  compileArgs,
107
126
  programArgs,
108
127
  activePath,
109
- workspaceFiles,
128
+ workspaceFiles: resolvedDebugMode === 'lldb'
129
+ ? normalizeLldbWorkspaceFiles(workspaceFiles || [])
130
+ : workspaceFiles,
110
131
  cppVersion,
111
132
  cVersion,
112
133
  debugMode: resolvedDebugMode,
@@ -128,7 +149,7 @@ self.onmessage = async (event) => {
128
149
  self.postMessage({ error: error.message, ...missingPrecompiledHeader() });
129
150
  }
130
151
  }
131
- else if (code) {
152
+ else if (typeof code === 'string') {
132
153
  clang.log = log;
133
154
  stdinBufferClang = new Int32Array(buffer);
134
155
  debugBufferClang = new Int32Array(debugBuffer);
@@ -143,12 +164,21 @@ self.onmessage = async (event) => {
143
164
  }
144
165
  try {
145
166
  if (resolvedDebugMode === 'lldb') {
167
+ const inputPath = normalizeDwarfWorkspacePath(activePath || (language === 'C' ? 'main.c' : 'main.cc')) || (language === 'C' ? 'main.c' : 'main.cc');
168
+ const sources = new Map();
169
+ const compilerWorkspaceFiles = normalizeLldbWorkspaceFiles(workspaceFiles || []);
170
+ for (const file of compilerWorkspaceFiles) {
171
+ const sourcePath = normalizeDwarfWorkspacePath(file.path);
172
+ if (sourcePath)
173
+ sources.set(`/workspace/${sourcePath}`, file.content);
174
+ }
175
+ sources.set(`/workspace/${inputPath}`, code);
146
176
  const artifact = await clang.compileArtifact(code, {
147
177
  language,
148
178
  compileArgs,
149
179
  programArgs,
150
180
  activePath,
151
- workspaceFiles,
181
+ workspaceFiles: compilerWorkspaceFiles,
152
182
  cppVersion,
153
183
  cVersion,
154
184
  debugMode: 'lldb',
@@ -158,14 +188,6 @@ self.onmessage = async (event) => {
158
188
  if (!artifact.debug) {
159
189
  throw new Error('wasm-clang did not return an LLDB DWARF descriptor');
160
190
  }
161
- const inputPath = normalizeDwarfWorkspacePath(activePath || (language === 'C' ? 'main.c' : 'main.cc')) || (language === 'C' ? 'main.c' : 'main.cc');
162
- const sources = new Map();
163
- for (const file of workspaceFiles || []) {
164
- const sourcePath = normalizeDwarfWorkspacePath(file.path);
165
- if (sourcePath)
166
- sources.set(`/workspace/${sourcePath}`, file.content);
167
- }
168
- sources.set(`/workspace/${inputPath}`, code);
169
191
  self.postMessage({
170
192
  lldbArtifact: {
171
193
  bytes: new Uint8Array(artifact.bytes),
@@ -51,10 +51,10 @@ self.onmessage = async (event) => {
51
51
  postMessage({ load: true });
52
52
  }
53
53
  catch (error) {
54
- postMessage({ error: error.message });
54
+ postMessage({ error: error?.message || String(error) });
55
55
  }
56
56
  }
57
- else if (typeof log === 'boolean' && !code) {
57
+ else if (code === '' || (typeof log === 'boolean' && code === undefined)) {
58
58
  // The compiler receives the current logging preference for every compilation.
59
59
  if (typeof code === 'string')
60
60
  postMessage({ results: true });
@@ -101,7 +101,7 @@ self.onmessage = async (event) => {
101
101
  postMessage({ results: true });
102
102
  }
103
103
  catch (error) {
104
- postMessage({ error: error.message });
104
+ postMessage({ error: error?.message || String(error) });
105
105
  }
106
106
  }
107
107
  };