@tracecode/harness 0.6.6 → 0.7.0-beta8

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 (494) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +134 -15
  3. package/THIRD_PARTY_NOTICES.md +170 -0
  4. package/dist/browser.cjs +2361 -1033
  5. package/dist/browser.cjs.map +1 -1
  6. package/dist/browser.d.cts +33 -3
  7. package/dist/browser.d.ts +33 -3
  8. package/dist/browser.js +2357 -1033
  9. package/dist/browser.js.map +1 -1
  10. package/dist/cli.cjs +160 -23
  11. package/dist/cli.cjs.map +1 -1
  12. package/dist/cli.js +161 -24
  13. package/dist/cli.js.map +1 -1
  14. package/dist/core.cjs +748 -867
  15. package/dist/core.cjs.map +1 -1
  16. package/dist/core.d.cts +21 -85
  17. package/dist/core.d.ts +21 -85
  18. package/dist/core.js +734 -855
  19. package/dist/core.js.map +1 -1
  20. package/dist/cpp-worker-client-Bn7kC0_L.d.ts +84 -0
  21. package/dist/cpp-worker-client-BzdJLuZa.d.cts +84 -0
  22. package/dist/cpp.cjs +1063 -0
  23. package/dist/cpp.cjs.map +1 -0
  24. package/dist/cpp.d.cts +7 -0
  25. package/dist/cpp.d.ts +7 -0
  26. package/dist/cpp.js +1035 -0
  27. package/dist/cpp.js.map +1 -0
  28. package/dist/csharp-worker-client-DMHIa2YG.d.cts +69 -0
  29. package/dist/csharp-worker-client-JwqS6LiX.d.ts +69 -0
  30. package/dist/csharp.cjs +1012 -0
  31. package/dist/csharp.cjs.map +1 -0
  32. package/dist/csharp.d.cts +7 -0
  33. package/dist/csharp.d.ts +7 -0
  34. package/dist/csharp.js +984 -0
  35. package/dist/csharp.js.map +1 -0
  36. package/dist/index.cjs +3142 -1160
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +13 -5
  39. package/dist/index.d.ts +13 -5
  40. package/dist/index.js +3117 -1148
  41. package/dist/index.js.map +1 -1
  42. package/dist/internal/browser.cjs +1639 -30
  43. package/dist/internal/browser.cjs.map +1 -1
  44. package/dist/internal/browser.d.cts +6 -199
  45. package/dist/internal/browser.d.ts +6 -199
  46. package/dist/internal/browser.js +1636 -30
  47. package/dist/internal/browser.js.map +1 -1
  48. package/dist/java-worker-client-BOwKW-11.d.cts +72 -0
  49. package/dist/java-worker-client-C97DDnCp.d.ts +72 -0
  50. package/dist/java.cjs +1225 -0
  51. package/dist/java.cjs.map +1 -0
  52. package/dist/java.d.cts +7 -0
  53. package/dist/java.d.ts +7 -0
  54. package/dist/java.js +1197 -0
  55. package/dist/java.js.map +1 -0
  56. package/dist/javascript-worker-client-CYBGEEvc.d.cts +51 -0
  57. package/dist/javascript-worker-client-DIX1Mp21.d.ts +51 -0
  58. package/dist/javascript.cjs +1063 -19
  59. package/dist/javascript.cjs.map +1 -1
  60. package/dist/javascript.d.cts +7 -4
  61. package/dist/javascript.d.ts +7 -4
  62. package/dist/javascript.js +1061 -19
  63. package/dist/javascript.js.map +1 -1
  64. package/dist/pyodide-worker-client-C-2rfHj9.d.ts +111 -0
  65. package/dist/pyodide-worker-client-Cn0a8Uv3.d.cts +111 -0
  66. package/dist/python.cjs +1282 -74
  67. package/dist/python.cjs.map +1 -1
  68. package/dist/python.d.cts +20 -14
  69. package/dist/python.d.ts +20 -14
  70. package/dist/python.js +1279 -74
  71. package/dist/python.js.map +1 -1
  72. package/dist/runtime-language-info-BFUSti3-.d.ts +43 -0
  73. package/dist/runtime-language-info-Bxza1cI2.d.cts +43 -0
  74. package/dist/runtime-types-2qM0MukN.d.cts +244 -0
  75. package/dist/runtime-types-2qM0MukN.d.ts +244 -0
  76. package/package.json +73 -8
  77. package/workers/cpp/cpp-compiler-frame.html +82 -0
  78. package/workers/cpp/cpp-compiler-worker.js +131 -0
  79. package/workers/cpp/cpp-worker.js +5790 -0
  80. package/workers/cpp/tracecode_runtime.hpp +6169 -0
  81. package/workers/csharp/csharp-worker.js +301 -0
  82. package/workers/java/.build/classes/harness/browser/JavaRewriteLibrary.class +0 -0
  83. package/workers/java/java-source-augmentations.js +907 -0
  84. package/workers/java/java-worker.js +2161 -177
  85. package/workers/java/src/harness/browser/JavaRewriteLibrary.java +1659 -32
  86. package/workers/java/src/javafx/util/Pair.java +42 -0
  87. package/workers/java/src/tracecode/browser/BrowserCompileAndTraceLibrary.java +714 -0
  88. package/workers/java/src/tracecode/browser/BrowserCompileAndTraceMain.java +76 -0
  89. package/workers/java/src/tracecode/browser/RuntimeProbeMain.java +14 -0
  90. package/workers/java/src/tracecode/user/TraceHooks.java +1414 -0
  91. package/workers/javascript/javascript-libraries-entry.js +71 -0
  92. package/workers/javascript/javascript-worker.js +2055 -424
  93. package/workers/python/generated-python-harness-snippets.js +4 -4
  94. package/workers/python/pyodide-worker.js +222 -61
  95. package/workers/python/runtime-core.js +1387 -301
  96. package/workers/vendor/csharp/.stamp +0 -0
  97. package/workers/vendor/csharp/TraceCode.CSharpHost.runtimeconfig.json +32 -0
  98. package/workers/vendor/csharp/_framework/Microsoft.CSharp.wasm +0 -0
  99. package/workers/vendor/csharp/_framework/Microsoft.CodeAnalysis.CSharp.wasm +0 -0
  100. package/workers/vendor/csharp/_framework/Microsoft.CodeAnalysis.wasm +0 -0
  101. package/workers/vendor/csharp/_framework/Microsoft.VisualBasic.Core.wasm +0 -0
  102. package/workers/vendor/csharp/_framework/Microsoft.VisualBasic.wasm +0 -0
  103. package/workers/vendor/csharp/_framework/Microsoft.Win32.Primitives.wasm +0 -0
  104. package/workers/vendor/csharp/_framework/Microsoft.Win32.Registry.wasm +0 -0
  105. package/workers/vendor/csharp/_framework/System.AppContext.wasm +0 -0
  106. package/workers/vendor/csharp/_framework/System.Buffers.wasm +0 -0
  107. package/workers/vendor/csharp/_framework/System.Collections.Concurrent.wasm +0 -0
  108. package/workers/vendor/csharp/_framework/System.Collections.Immutable.wasm +0 -0
  109. package/workers/vendor/csharp/_framework/System.Collections.NonGeneric.wasm +0 -0
  110. package/workers/vendor/csharp/_framework/System.Collections.Specialized.wasm +0 -0
  111. package/workers/vendor/csharp/_framework/System.Collections.wasm +0 -0
  112. package/workers/vendor/csharp/_framework/System.ComponentModel.Annotations.wasm +0 -0
  113. package/workers/vendor/csharp/_framework/System.ComponentModel.DataAnnotations.wasm +0 -0
  114. package/workers/vendor/csharp/_framework/System.ComponentModel.EventBasedAsync.wasm +0 -0
  115. package/workers/vendor/csharp/_framework/System.ComponentModel.Primitives.wasm +0 -0
  116. package/workers/vendor/csharp/_framework/System.ComponentModel.TypeConverter.wasm +0 -0
  117. package/workers/vendor/csharp/_framework/System.ComponentModel.wasm +0 -0
  118. package/workers/vendor/csharp/_framework/System.Configuration.wasm +0 -0
  119. package/workers/vendor/csharp/_framework/System.Console.wasm +0 -0
  120. package/workers/vendor/csharp/_framework/System.Core.wasm +0 -0
  121. package/workers/vendor/csharp/_framework/System.Data.Common.wasm +0 -0
  122. package/workers/vendor/csharp/_framework/System.Data.DataSetExtensions.wasm +0 -0
  123. package/workers/vendor/csharp/_framework/System.Data.wasm +0 -0
  124. package/workers/vendor/csharp/_framework/System.Diagnostics.Contracts.wasm +0 -0
  125. package/workers/vendor/csharp/_framework/System.Diagnostics.Debug.wasm +0 -0
  126. package/workers/vendor/csharp/_framework/System.Diagnostics.DiagnosticSource.wasm +0 -0
  127. package/workers/vendor/csharp/_framework/System.Diagnostics.FileVersionInfo.wasm +0 -0
  128. package/workers/vendor/csharp/_framework/System.Diagnostics.Process.wasm +0 -0
  129. package/workers/vendor/csharp/_framework/System.Diagnostics.StackTrace.wasm +0 -0
  130. package/workers/vendor/csharp/_framework/System.Diagnostics.TextWriterTraceListener.wasm +0 -0
  131. package/workers/vendor/csharp/_framework/System.Diagnostics.Tools.wasm +0 -0
  132. package/workers/vendor/csharp/_framework/System.Diagnostics.TraceSource.wasm +0 -0
  133. package/workers/vendor/csharp/_framework/System.Diagnostics.Tracing.wasm +0 -0
  134. package/workers/vendor/csharp/_framework/System.Drawing.Primitives.wasm +0 -0
  135. package/workers/vendor/csharp/_framework/System.Drawing.wasm +0 -0
  136. package/workers/vendor/csharp/_framework/System.Dynamic.Runtime.wasm +0 -0
  137. package/workers/vendor/csharp/_framework/System.Formats.Asn1.wasm +0 -0
  138. package/workers/vendor/csharp/_framework/System.Formats.Tar.wasm +0 -0
  139. package/workers/vendor/csharp/_framework/System.Globalization.Calendars.wasm +0 -0
  140. package/workers/vendor/csharp/_framework/System.Globalization.Extensions.wasm +0 -0
  141. package/workers/vendor/csharp/_framework/System.Globalization.wasm +0 -0
  142. package/workers/vendor/csharp/_framework/System.IO.Compression.Brotli.wasm +0 -0
  143. package/workers/vendor/csharp/_framework/System.IO.Compression.FileSystem.wasm +0 -0
  144. package/workers/vendor/csharp/_framework/System.IO.Compression.ZipFile.wasm +0 -0
  145. package/workers/vendor/csharp/_framework/System.IO.Compression.wasm +0 -0
  146. package/workers/vendor/csharp/_framework/System.IO.FileSystem.AccessControl.wasm +0 -0
  147. package/workers/vendor/csharp/_framework/System.IO.FileSystem.DriveInfo.wasm +0 -0
  148. package/workers/vendor/csharp/_framework/System.IO.FileSystem.Primitives.wasm +0 -0
  149. package/workers/vendor/csharp/_framework/System.IO.FileSystem.Watcher.wasm +0 -0
  150. package/workers/vendor/csharp/_framework/System.IO.FileSystem.wasm +0 -0
  151. package/workers/vendor/csharp/_framework/System.IO.IsolatedStorage.wasm +0 -0
  152. package/workers/vendor/csharp/_framework/System.IO.MemoryMappedFiles.wasm +0 -0
  153. package/workers/vendor/csharp/_framework/System.IO.Pipelines.wasm +0 -0
  154. package/workers/vendor/csharp/_framework/System.IO.Pipes.AccessControl.wasm +0 -0
  155. package/workers/vendor/csharp/_framework/System.IO.Pipes.wasm +0 -0
  156. package/workers/vendor/csharp/_framework/System.IO.UnmanagedMemoryStream.wasm +0 -0
  157. package/workers/vendor/csharp/_framework/System.IO.wasm +0 -0
  158. package/workers/vendor/csharp/_framework/System.Linq.AsyncEnumerable.wasm +0 -0
  159. package/workers/vendor/csharp/_framework/System.Linq.Expressions.wasm +0 -0
  160. package/workers/vendor/csharp/_framework/System.Linq.Parallel.wasm +0 -0
  161. package/workers/vendor/csharp/_framework/System.Linq.Queryable.wasm +0 -0
  162. package/workers/vendor/csharp/_framework/System.Linq.wasm +0 -0
  163. package/workers/vendor/csharp/_framework/System.Memory.wasm +0 -0
  164. package/workers/vendor/csharp/_framework/System.Net.Http.Json.wasm +0 -0
  165. package/workers/vendor/csharp/_framework/System.Net.Http.wasm +0 -0
  166. package/workers/vendor/csharp/_framework/System.Net.HttpListener.wasm +0 -0
  167. package/workers/vendor/csharp/_framework/System.Net.Mail.wasm +0 -0
  168. package/workers/vendor/csharp/_framework/System.Net.NameResolution.wasm +0 -0
  169. package/workers/vendor/csharp/_framework/System.Net.NetworkInformation.wasm +0 -0
  170. package/workers/vendor/csharp/_framework/System.Net.Ping.wasm +0 -0
  171. package/workers/vendor/csharp/_framework/System.Net.Primitives.wasm +0 -0
  172. package/workers/vendor/csharp/_framework/System.Net.Quic.wasm +0 -0
  173. package/workers/vendor/csharp/_framework/System.Net.Requests.wasm +0 -0
  174. package/workers/vendor/csharp/_framework/System.Net.Security.wasm +0 -0
  175. package/workers/vendor/csharp/_framework/System.Net.ServerSentEvents.wasm +0 -0
  176. package/workers/vendor/csharp/_framework/System.Net.ServicePoint.wasm +0 -0
  177. package/workers/vendor/csharp/_framework/System.Net.Sockets.wasm +0 -0
  178. package/workers/vendor/csharp/_framework/System.Net.WebClient.wasm +0 -0
  179. package/workers/vendor/csharp/_framework/System.Net.WebHeaderCollection.wasm +0 -0
  180. package/workers/vendor/csharp/_framework/System.Net.WebProxy.wasm +0 -0
  181. package/workers/vendor/csharp/_framework/System.Net.WebSockets.Client.wasm +0 -0
  182. package/workers/vendor/csharp/_framework/System.Net.WebSockets.wasm +0 -0
  183. package/workers/vendor/csharp/_framework/System.Net.wasm +0 -0
  184. package/workers/vendor/csharp/_framework/System.Numerics.Vectors.wasm +0 -0
  185. package/workers/vendor/csharp/_framework/System.Numerics.wasm +0 -0
  186. package/workers/vendor/csharp/_framework/System.ObjectModel.wasm +0 -0
  187. package/workers/vendor/csharp/_framework/System.Private.CoreLib.wasm +0 -0
  188. package/workers/vendor/csharp/_framework/System.Private.DataContractSerialization.wasm +0 -0
  189. package/workers/vendor/csharp/_framework/System.Private.Uri.wasm +0 -0
  190. package/workers/vendor/csharp/_framework/System.Private.Xml.Linq.wasm +0 -0
  191. package/workers/vendor/csharp/_framework/System.Private.Xml.wasm +0 -0
  192. package/workers/vendor/csharp/_framework/System.Reflection.DispatchProxy.wasm +0 -0
  193. package/workers/vendor/csharp/_framework/System.Reflection.Emit.ILGeneration.wasm +0 -0
  194. package/workers/vendor/csharp/_framework/System.Reflection.Emit.Lightweight.wasm +0 -0
  195. package/workers/vendor/csharp/_framework/System.Reflection.Emit.wasm +0 -0
  196. package/workers/vendor/csharp/_framework/System.Reflection.Extensions.wasm +0 -0
  197. package/workers/vendor/csharp/_framework/System.Reflection.Metadata.wasm +0 -0
  198. package/workers/vendor/csharp/_framework/System.Reflection.Primitives.wasm +0 -0
  199. package/workers/vendor/csharp/_framework/System.Reflection.TypeExtensions.wasm +0 -0
  200. package/workers/vendor/csharp/_framework/System.Reflection.wasm +0 -0
  201. package/workers/vendor/csharp/_framework/System.Resources.Reader.wasm +0 -0
  202. package/workers/vendor/csharp/_framework/System.Resources.ResourceManager.wasm +0 -0
  203. package/workers/vendor/csharp/_framework/System.Resources.Writer.wasm +0 -0
  204. package/workers/vendor/csharp/_framework/System.Runtime.CompilerServices.Unsafe.wasm +0 -0
  205. package/workers/vendor/csharp/_framework/System.Runtime.CompilerServices.VisualC.wasm +0 -0
  206. package/workers/vendor/csharp/_framework/System.Runtime.Extensions.wasm +0 -0
  207. package/workers/vendor/csharp/_framework/System.Runtime.Handles.wasm +0 -0
  208. package/workers/vendor/csharp/_framework/System.Runtime.InteropServices.JavaScript.wasm +0 -0
  209. package/workers/vendor/csharp/_framework/System.Runtime.InteropServices.RuntimeInformation.wasm +0 -0
  210. package/workers/vendor/csharp/_framework/System.Runtime.InteropServices.wasm +0 -0
  211. package/workers/vendor/csharp/_framework/System.Runtime.Intrinsics.wasm +0 -0
  212. package/workers/vendor/csharp/_framework/System.Runtime.Loader.wasm +0 -0
  213. package/workers/vendor/csharp/_framework/System.Runtime.Numerics.wasm +0 -0
  214. package/workers/vendor/csharp/_framework/System.Runtime.Serialization.Formatters.wasm +0 -0
  215. package/workers/vendor/csharp/_framework/System.Runtime.Serialization.Json.wasm +0 -0
  216. package/workers/vendor/csharp/_framework/System.Runtime.Serialization.Primitives.wasm +0 -0
  217. package/workers/vendor/csharp/_framework/System.Runtime.Serialization.Xml.wasm +0 -0
  218. package/workers/vendor/csharp/_framework/System.Runtime.Serialization.wasm +0 -0
  219. package/workers/vendor/csharp/_framework/System.Runtime.wasm +0 -0
  220. package/workers/vendor/csharp/_framework/System.Security.AccessControl.wasm +0 -0
  221. package/workers/vendor/csharp/_framework/System.Security.Claims.wasm +0 -0
  222. package/workers/vendor/csharp/_framework/System.Security.Cryptography.Algorithms.wasm +0 -0
  223. package/workers/vendor/csharp/_framework/System.Security.Cryptography.Cng.wasm +0 -0
  224. package/workers/vendor/csharp/_framework/System.Security.Cryptography.Csp.wasm +0 -0
  225. package/workers/vendor/csharp/_framework/System.Security.Cryptography.Encoding.wasm +0 -0
  226. package/workers/vendor/csharp/_framework/System.Security.Cryptography.OpenSsl.wasm +0 -0
  227. package/workers/vendor/csharp/_framework/System.Security.Cryptography.Primitives.wasm +0 -0
  228. package/workers/vendor/csharp/_framework/System.Security.Cryptography.X509Certificates.wasm +0 -0
  229. package/workers/vendor/csharp/_framework/System.Security.Cryptography.wasm +0 -0
  230. package/workers/vendor/csharp/_framework/System.Security.Principal.Windows.wasm +0 -0
  231. package/workers/vendor/csharp/_framework/System.Security.Principal.wasm +0 -0
  232. package/workers/vendor/csharp/_framework/System.Security.SecureString.wasm +0 -0
  233. package/workers/vendor/csharp/_framework/System.Security.wasm +0 -0
  234. package/workers/vendor/csharp/_framework/System.ServiceModel.Web.wasm +0 -0
  235. package/workers/vendor/csharp/_framework/System.ServiceProcess.wasm +0 -0
  236. package/workers/vendor/csharp/_framework/System.Text.Encoding.CodePages.wasm +0 -0
  237. package/workers/vendor/csharp/_framework/System.Text.Encoding.Extensions.wasm +0 -0
  238. package/workers/vendor/csharp/_framework/System.Text.Encoding.wasm +0 -0
  239. package/workers/vendor/csharp/_framework/System.Text.Encodings.Web.wasm +0 -0
  240. package/workers/vendor/csharp/_framework/System.Text.Json.wasm +0 -0
  241. package/workers/vendor/csharp/_framework/System.Text.RegularExpressions.wasm +0 -0
  242. package/workers/vendor/csharp/_framework/System.Threading.AccessControl.wasm +0 -0
  243. package/workers/vendor/csharp/_framework/System.Threading.Channels.wasm +0 -0
  244. package/workers/vendor/csharp/_framework/System.Threading.Overlapped.wasm +0 -0
  245. package/workers/vendor/csharp/_framework/System.Threading.Tasks.Dataflow.wasm +0 -0
  246. package/workers/vendor/csharp/_framework/System.Threading.Tasks.Extensions.wasm +0 -0
  247. package/workers/vendor/csharp/_framework/System.Threading.Tasks.Parallel.wasm +0 -0
  248. package/workers/vendor/csharp/_framework/System.Threading.Tasks.wasm +0 -0
  249. package/workers/vendor/csharp/_framework/System.Threading.Thread.wasm +0 -0
  250. package/workers/vendor/csharp/_framework/System.Threading.ThreadPool.wasm +0 -0
  251. package/workers/vendor/csharp/_framework/System.Threading.Timer.wasm +0 -0
  252. package/workers/vendor/csharp/_framework/System.Threading.wasm +0 -0
  253. package/workers/vendor/csharp/_framework/System.Transactions.Local.wasm +0 -0
  254. package/workers/vendor/csharp/_framework/System.Transactions.wasm +0 -0
  255. package/workers/vendor/csharp/_framework/System.ValueTuple.wasm +0 -0
  256. package/workers/vendor/csharp/_framework/System.Web.HttpUtility.wasm +0 -0
  257. package/workers/vendor/csharp/_framework/System.Web.wasm +0 -0
  258. package/workers/vendor/csharp/_framework/System.Windows.wasm +0 -0
  259. package/workers/vendor/csharp/_framework/System.Xml.Linq.wasm +0 -0
  260. package/workers/vendor/csharp/_framework/System.Xml.ReaderWriter.wasm +0 -0
  261. package/workers/vendor/csharp/_framework/System.Xml.Serialization.wasm +0 -0
  262. package/workers/vendor/csharp/_framework/System.Xml.XDocument.wasm +0 -0
  263. package/workers/vendor/csharp/_framework/System.Xml.XPath.XDocument.wasm +0 -0
  264. package/workers/vendor/csharp/_framework/System.Xml.XPath.wasm +0 -0
  265. package/workers/vendor/csharp/_framework/System.Xml.XmlDocument.wasm +0 -0
  266. package/workers/vendor/csharp/_framework/System.Xml.XmlSerializer.wasm +0 -0
  267. package/workers/vendor/csharp/_framework/System.Xml.wasm +0 -0
  268. package/workers/vendor/csharp/_framework/System.wasm +0 -0
  269. package/workers/vendor/csharp/_framework/TraceCode.CSharpHost.wasm +0 -0
  270. package/workers/vendor/csharp/_framework/WindowsBase.wasm +0 -0
  271. package/workers/vendor/csharp/_framework/cs/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
  272. package/workers/vendor/csharp/_framework/cs/Microsoft.CodeAnalysis.resources.wasm +0 -0
  273. package/workers/vendor/csharp/_framework/de/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
  274. package/workers/vendor/csharp/_framework/de/Microsoft.CodeAnalysis.resources.wasm +0 -0
  275. package/workers/vendor/csharp/_framework/dotnet.boot.js +1958 -0
  276. package/workers/vendor/csharp/_framework/dotnet.js +4 -0
  277. package/workers/vendor/csharp/_framework/dotnet.js.map +1 -0
  278. package/workers/vendor/csharp/_framework/dotnet.native.js +6687 -0
  279. package/workers/vendor/csharp/_framework/dotnet.native.wasm +0 -0
  280. package/workers/vendor/csharp/_framework/dotnet.runtime.js +4 -0
  281. package/workers/vendor/csharp/_framework/dotnet.runtime.js.map +1 -0
  282. package/workers/vendor/csharp/_framework/es/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
  283. package/workers/vendor/csharp/_framework/es/Microsoft.CodeAnalysis.resources.wasm +0 -0
  284. package/workers/vendor/csharp/_framework/fr/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
  285. package/workers/vendor/csharp/_framework/fr/Microsoft.CodeAnalysis.resources.wasm +0 -0
  286. package/workers/vendor/csharp/_framework/it/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
  287. package/workers/vendor/csharp/_framework/it/Microsoft.CodeAnalysis.resources.wasm +0 -0
  288. package/workers/vendor/csharp/_framework/ja/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
  289. package/workers/vendor/csharp/_framework/ja/Microsoft.CodeAnalysis.resources.wasm +0 -0
  290. package/workers/vendor/csharp/_framework/ko/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
  291. package/workers/vendor/csharp/_framework/ko/Microsoft.CodeAnalysis.resources.wasm +0 -0
  292. package/workers/vendor/csharp/_framework/mscorlib.wasm +0 -0
  293. package/workers/vendor/csharp/_framework/netstandard.wasm +0 -0
  294. package/workers/vendor/csharp/_framework/pl/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
  295. package/workers/vendor/csharp/_framework/pl/Microsoft.CodeAnalysis.resources.wasm +0 -0
  296. package/workers/vendor/csharp/_framework/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
  297. package/workers/vendor/csharp/_framework/pt-BR/Microsoft.CodeAnalysis.resources.wasm +0 -0
  298. package/workers/vendor/csharp/_framework/ru/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
  299. package/workers/vendor/csharp/_framework/ru/Microsoft.CodeAnalysis.resources.wasm +0 -0
  300. package/workers/vendor/csharp/_framework/supportFiles/0_Microsoft.CodeAnalysis.CSharp.dll +0 -0
  301. package/workers/vendor/csharp/_framework/supportFiles/100_System.Reflection.Emit.ILGeneration.dll +0 -0
  302. package/workers/vendor/csharp/_framework/supportFiles/101_System.Reflection.Emit.Lightweight.dll +0 -0
  303. package/workers/vendor/csharp/_framework/supportFiles/102_System.Reflection.Extensions.dll +0 -0
  304. package/workers/vendor/csharp/_framework/supportFiles/103_System.Reflection.Metadata.dll +0 -0
  305. package/workers/vendor/csharp/_framework/supportFiles/104_System.Reflection.Primitives.dll +0 -0
  306. package/workers/vendor/csharp/_framework/supportFiles/105_System.Reflection.TypeExtensions.dll +0 -0
  307. package/workers/vendor/csharp/_framework/supportFiles/106_System.Resources.Reader.dll +0 -0
  308. package/workers/vendor/csharp/_framework/supportFiles/107_System.Resources.ResourceManager.dll +0 -0
  309. package/workers/vendor/csharp/_framework/supportFiles/108_System.Resources.Writer.dll +0 -0
  310. package/workers/vendor/csharp/_framework/supportFiles/109_System.Runtime.CompilerServices.Unsafe.dll +0 -0
  311. package/workers/vendor/csharp/_framework/supportFiles/10_System.Buffers.dll +0 -0
  312. package/workers/vendor/csharp/_framework/supportFiles/110_System.Runtime.CompilerServices.VisualC.dll +0 -0
  313. package/workers/vendor/csharp/_framework/supportFiles/111_System.Runtime.dll +0 -0
  314. package/workers/vendor/csharp/_framework/supportFiles/112_System.Runtime.Extensions.dll +0 -0
  315. package/workers/vendor/csharp/_framework/supportFiles/113_System.Runtime.Handles.dll +0 -0
  316. package/workers/vendor/csharp/_framework/supportFiles/114_System.Runtime.InteropServices.dll +0 -0
  317. package/workers/vendor/csharp/_framework/supportFiles/115_System.Runtime.InteropServices.JavaScript.dll +0 -0
  318. package/workers/vendor/csharp/_framework/supportFiles/116_System.Runtime.InteropServices.RuntimeInformation.dll +0 -0
  319. package/workers/vendor/csharp/_framework/supportFiles/117_System.Runtime.Intrinsics.dll +0 -0
  320. package/workers/vendor/csharp/_framework/supportFiles/118_System.Runtime.Loader.dll +0 -0
  321. package/workers/vendor/csharp/_framework/supportFiles/119_System.Runtime.Numerics.dll +0 -0
  322. package/workers/vendor/csharp/_framework/supportFiles/11_System.Collections.Concurrent.dll +0 -0
  323. package/workers/vendor/csharp/_framework/supportFiles/120_System.Runtime.Serialization.dll +0 -0
  324. package/workers/vendor/csharp/_framework/supportFiles/121_System.Runtime.Serialization.Formatters.dll +0 -0
  325. package/workers/vendor/csharp/_framework/supportFiles/122_System.Runtime.Serialization.Json.dll +0 -0
  326. package/workers/vendor/csharp/_framework/supportFiles/123_System.Runtime.Serialization.Primitives.dll +0 -0
  327. package/workers/vendor/csharp/_framework/supportFiles/124_System.Runtime.Serialization.Xml.dll +0 -0
  328. package/workers/vendor/csharp/_framework/supportFiles/125_System.Security.AccessControl.dll +0 -0
  329. package/workers/vendor/csharp/_framework/supportFiles/126_System.Security.Claims.dll +0 -0
  330. package/workers/vendor/csharp/_framework/supportFiles/127_System.Security.Cryptography.Algorithms.dll +0 -0
  331. package/workers/vendor/csharp/_framework/supportFiles/128_System.Security.Cryptography.Cng.dll +0 -0
  332. package/workers/vendor/csharp/_framework/supportFiles/129_System.Security.Cryptography.Csp.dll +0 -0
  333. package/workers/vendor/csharp/_framework/supportFiles/12_System.Collections.dll +0 -0
  334. package/workers/vendor/csharp/_framework/supportFiles/130_System.Security.Cryptography.dll +0 -0
  335. package/workers/vendor/csharp/_framework/supportFiles/131_System.Security.Cryptography.Encoding.dll +0 -0
  336. package/workers/vendor/csharp/_framework/supportFiles/132_System.Security.Cryptography.OpenSsl.dll +0 -0
  337. package/workers/vendor/csharp/_framework/supportFiles/133_System.Security.Cryptography.Primitives.dll +0 -0
  338. package/workers/vendor/csharp/_framework/supportFiles/134_System.Security.Cryptography.X509Certificates.dll +0 -0
  339. package/workers/vendor/csharp/_framework/supportFiles/135_System.Security.dll +0 -0
  340. package/workers/vendor/csharp/_framework/supportFiles/136_System.Security.Principal.dll +0 -0
  341. package/workers/vendor/csharp/_framework/supportFiles/137_System.Security.Principal.Windows.dll +0 -0
  342. package/workers/vendor/csharp/_framework/supportFiles/138_System.Security.SecureString.dll +0 -0
  343. package/workers/vendor/csharp/_framework/supportFiles/139_System.ServiceModel.Web.dll +0 -0
  344. package/workers/vendor/csharp/_framework/supportFiles/13_System.Collections.Immutable.dll +0 -0
  345. package/workers/vendor/csharp/_framework/supportFiles/140_System.ServiceProcess.dll +0 -0
  346. package/workers/vendor/csharp/_framework/supportFiles/141_System.Text.Encoding.CodePages.dll +0 -0
  347. package/workers/vendor/csharp/_framework/supportFiles/142_System.Text.Encoding.dll +0 -0
  348. package/workers/vendor/csharp/_framework/supportFiles/143_System.Text.Encoding.Extensions.dll +0 -0
  349. package/workers/vendor/csharp/_framework/supportFiles/144_System.Text.Encodings.Web.dll +0 -0
  350. package/workers/vendor/csharp/_framework/supportFiles/145_System.Text.Json.dll +0 -0
  351. package/workers/vendor/csharp/_framework/supportFiles/146_System.Text.RegularExpressions.dll +0 -0
  352. package/workers/vendor/csharp/_framework/supportFiles/147_System.Threading.AccessControl.dll +0 -0
  353. package/workers/vendor/csharp/_framework/supportFiles/148_System.Threading.Channels.dll +0 -0
  354. package/workers/vendor/csharp/_framework/supportFiles/149_System.Threading.dll +0 -0
  355. package/workers/vendor/csharp/_framework/supportFiles/14_System.Collections.NonGeneric.dll +0 -0
  356. package/workers/vendor/csharp/_framework/supportFiles/150_System.Threading.Overlapped.dll +0 -0
  357. package/workers/vendor/csharp/_framework/supportFiles/151_System.Threading.Tasks.Dataflow.dll +0 -0
  358. package/workers/vendor/csharp/_framework/supportFiles/152_System.Threading.Tasks.dll +0 -0
  359. package/workers/vendor/csharp/_framework/supportFiles/153_System.Threading.Tasks.Extensions.dll +0 -0
  360. package/workers/vendor/csharp/_framework/supportFiles/154_System.Threading.Tasks.Parallel.dll +0 -0
  361. package/workers/vendor/csharp/_framework/supportFiles/155_System.Threading.Thread.dll +0 -0
  362. package/workers/vendor/csharp/_framework/supportFiles/156_System.Threading.ThreadPool.dll +0 -0
  363. package/workers/vendor/csharp/_framework/supportFiles/157_System.Threading.Timer.dll +0 -0
  364. package/workers/vendor/csharp/_framework/supportFiles/158_System.Transactions.dll +0 -0
  365. package/workers/vendor/csharp/_framework/supportFiles/159_System.Transactions.Local.dll +0 -0
  366. package/workers/vendor/csharp/_framework/supportFiles/15_System.Collections.Specialized.dll +0 -0
  367. package/workers/vendor/csharp/_framework/supportFiles/160_System.ValueTuple.dll +0 -0
  368. package/workers/vendor/csharp/_framework/supportFiles/161_System.Web.dll +0 -0
  369. package/workers/vendor/csharp/_framework/supportFiles/162_System.Web.HttpUtility.dll +0 -0
  370. package/workers/vendor/csharp/_framework/supportFiles/163_System.Windows.dll +0 -0
  371. package/workers/vendor/csharp/_framework/supportFiles/164_System.Xml.dll +0 -0
  372. package/workers/vendor/csharp/_framework/supportFiles/165_System.Xml.Linq.dll +0 -0
  373. package/workers/vendor/csharp/_framework/supportFiles/166_System.Xml.ReaderWriter.dll +0 -0
  374. package/workers/vendor/csharp/_framework/supportFiles/167_System.Xml.Serialization.dll +0 -0
  375. package/workers/vendor/csharp/_framework/supportFiles/168_System.Xml.XDocument.dll +0 -0
  376. package/workers/vendor/csharp/_framework/supportFiles/169_System.Xml.XmlDocument.dll +0 -0
  377. package/workers/vendor/csharp/_framework/supportFiles/16_System.ComponentModel.Annotations.dll +0 -0
  378. package/workers/vendor/csharp/_framework/supportFiles/170_System.Xml.XmlSerializer.dll +0 -0
  379. package/workers/vendor/csharp/_framework/supportFiles/171_System.Xml.XPath.dll +0 -0
  380. package/workers/vendor/csharp/_framework/supportFiles/172_System.Xml.XPath.XDocument.dll +0 -0
  381. package/workers/vendor/csharp/_framework/supportFiles/173_TraceCode.CSharpHost.dll +0 -0
  382. package/workers/vendor/csharp/_framework/supportFiles/174_WindowsBase.dll +0 -0
  383. package/workers/vendor/csharp/_framework/supportFiles/17_System.ComponentModel.DataAnnotations.dll +0 -0
  384. package/workers/vendor/csharp/_framework/supportFiles/18_System.ComponentModel.dll +0 -0
  385. package/workers/vendor/csharp/_framework/supportFiles/19_System.ComponentModel.EventBasedAsync.dll +0 -0
  386. package/workers/vendor/csharp/_framework/supportFiles/1_Microsoft.CodeAnalysis.dll +0 -0
  387. package/workers/vendor/csharp/_framework/supportFiles/20_System.ComponentModel.Primitives.dll +0 -0
  388. package/workers/vendor/csharp/_framework/supportFiles/21_System.ComponentModel.TypeConverter.dll +0 -0
  389. package/workers/vendor/csharp/_framework/supportFiles/22_System.Configuration.dll +0 -0
  390. package/workers/vendor/csharp/_framework/supportFiles/23_System.Console.dll +0 -0
  391. package/workers/vendor/csharp/_framework/supportFiles/24_System.Core.dll +0 -0
  392. package/workers/vendor/csharp/_framework/supportFiles/25_System.Data.Common.dll +0 -0
  393. package/workers/vendor/csharp/_framework/supportFiles/26_System.Data.DataSetExtensions.dll +0 -0
  394. package/workers/vendor/csharp/_framework/supportFiles/27_System.Data.dll +0 -0
  395. package/workers/vendor/csharp/_framework/supportFiles/28_System.Diagnostics.Contracts.dll +0 -0
  396. package/workers/vendor/csharp/_framework/supportFiles/29_System.Diagnostics.Debug.dll +0 -0
  397. package/workers/vendor/csharp/_framework/supportFiles/2_Microsoft.CSharp.dll +0 -0
  398. package/workers/vendor/csharp/_framework/supportFiles/30_System.Diagnostics.DiagnosticSource.dll +0 -0
  399. package/workers/vendor/csharp/_framework/supportFiles/31_System.Diagnostics.FileVersionInfo.dll +0 -0
  400. package/workers/vendor/csharp/_framework/supportFiles/32_System.Diagnostics.Process.dll +0 -0
  401. package/workers/vendor/csharp/_framework/supportFiles/33_System.Diagnostics.StackTrace.dll +0 -0
  402. package/workers/vendor/csharp/_framework/supportFiles/34_System.Diagnostics.TextWriterTraceListener.dll +0 -0
  403. package/workers/vendor/csharp/_framework/supportFiles/35_System.Diagnostics.Tools.dll +0 -0
  404. package/workers/vendor/csharp/_framework/supportFiles/36_System.Diagnostics.TraceSource.dll +0 -0
  405. package/workers/vendor/csharp/_framework/supportFiles/37_System.Diagnostics.Tracing.dll +0 -0
  406. package/workers/vendor/csharp/_framework/supportFiles/38_System.dll +0 -0
  407. package/workers/vendor/csharp/_framework/supportFiles/39_System.Drawing.dll +0 -0
  408. package/workers/vendor/csharp/_framework/supportFiles/3_Microsoft.VisualBasic.Core.dll +0 -0
  409. package/workers/vendor/csharp/_framework/supportFiles/40_System.Drawing.Primitives.dll +0 -0
  410. package/workers/vendor/csharp/_framework/supportFiles/41_System.Dynamic.Runtime.dll +0 -0
  411. package/workers/vendor/csharp/_framework/supportFiles/42_System.Formats.Asn1.dll +0 -0
  412. package/workers/vendor/csharp/_framework/supportFiles/43_System.Formats.Tar.dll +0 -0
  413. package/workers/vendor/csharp/_framework/supportFiles/44_System.Globalization.Calendars.dll +0 -0
  414. package/workers/vendor/csharp/_framework/supportFiles/45_System.Globalization.dll +0 -0
  415. package/workers/vendor/csharp/_framework/supportFiles/46_System.Globalization.Extensions.dll +0 -0
  416. package/workers/vendor/csharp/_framework/supportFiles/47_System.IO.Compression.Brotli.dll +0 -0
  417. package/workers/vendor/csharp/_framework/supportFiles/48_System.IO.Compression.dll +0 -0
  418. package/workers/vendor/csharp/_framework/supportFiles/49_System.IO.Compression.FileSystem.dll +0 -0
  419. package/workers/vendor/csharp/_framework/supportFiles/4_Microsoft.VisualBasic.dll +0 -0
  420. package/workers/vendor/csharp/_framework/supportFiles/50_System.IO.Compression.ZipFile.dll +0 -0
  421. package/workers/vendor/csharp/_framework/supportFiles/51_System.IO.dll +0 -0
  422. package/workers/vendor/csharp/_framework/supportFiles/52_System.IO.FileSystem.AccessControl.dll +0 -0
  423. package/workers/vendor/csharp/_framework/supportFiles/53_System.IO.FileSystem.dll +0 -0
  424. package/workers/vendor/csharp/_framework/supportFiles/54_System.IO.FileSystem.DriveInfo.dll +0 -0
  425. package/workers/vendor/csharp/_framework/supportFiles/55_System.IO.FileSystem.Primitives.dll +0 -0
  426. package/workers/vendor/csharp/_framework/supportFiles/56_System.IO.FileSystem.Watcher.dll +0 -0
  427. package/workers/vendor/csharp/_framework/supportFiles/57_System.IO.IsolatedStorage.dll +0 -0
  428. package/workers/vendor/csharp/_framework/supportFiles/58_System.IO.MemoryMappedFiles.dll +0 -0
  429. package/workers/vendor/csharp/_framework/supportFiles/59_System.IO.Pipelines.dll +0 -0
  430. package/workers/vendor/csharp/_framework/supportFiles/5_Microsoft.Win32.Primitives.dll +0 -0
  431. package/workers/vendor/csharp/_framework/supportFiles/60_System.IO.Pipes.AccessControl.dll +0 -0
  432. package/workers/vendor/csharp/_framework/supportFiles/61_System.IO.Pipes.dll +0 -0
  433. package/workers/vendor/csharp/_framework/supportFiles/62_System.IO.UnmanagedMemoryStream.dll +0 -0
  434. package/workers/vendor/csharp/_framework/supportFiles/63_System.Linq.AsyncEnumerable.dll +0 -0
  435. package/workers/vendor/csharp/_framework/supportFiles/64_System.Linq.dll +0 -0
  436. package/workers/vendor/csharp/_framework/supportFiles/65_System.Linq.Expressions.dll +0 -0
  437. package/workers/vendor/csharp/_framework/supportFiles/66_System.Linq.Parallel.dll +0 -0
  438. package/workers/vendor/csharp/_framework/supportFiles/67_System.Linq.Queryable.dll +0 -0
  439. package/workers/vendor/csharp/_framework/supportFiles/68_System.Memory.dll +0 -0
  440. package/workers/vendor/csharp/_framework/supportFiles/69_System.Net.dll +0 -0
  441. package/workers/vendor/csharp/_framework/supportFiles/6_Microsoft.Win32.Registry.dll +0 -0
  442. package/workers/vendor/csharp/_framework/supportFiles/70_System.Net.Http.dll +0 -0
  443. package/workers/vendor/csharp/_framework/supportFiles/71_System.Net.Http.Json.dll +0 -0
  444. package/workers/vendor/csharp/_framework/supportFiles/72_System.Net.HttpListener.dll +0 -0
  445. package/workers/vendor/csharp/_framework/supportFiles/73_System.Net.Mail.dll +0 -0
  446. package/workers/vendor/csharp/_framework/supportFiles/74_System.Net.NameResolution.dll +0 -0
  447. package/workers/vendor/csharp/_framework/supportFiles/75_System.Net.NetworkInformation.dll +0 -0
  448. package/workers/vendor/csharp/_framework/supportFiles/76_System.Net.Ping.dll +0 -0
  449. package/workers/vendor/csharp/_framework/supportFiles/77_System.Net.Primitives.dll +0 -0
  450. package/workers/vendor/csharp/_framework/supportFiles/78_System.Net.Quic.dll +0 -0
  451. package/workers/vendor/csharp/_framework/supportFiles/79_System.Net.Requests.dll +0 -0
  452. package/workers/vendor/csharp/_framework/supportFiles/7_mscorlib.dll +0 -0
  453. package/workers/vendor/csharp/_framework/supportFiles/80_System.Net.Security.dll +0 -0
  454. package/workers/vendor/csharp/_framework/supportFiles/81_System.Net.ServerSentEvents.dll +0 -0
  455. package/workers/vendor/csharp/_framework/supportFiles/82_System.Net.ServicePoint.dll +0 -0
  456. package/workers/vendor/csharp/_framework/supportFiles/83_System.Net.Sockets.dll +0 -0
  457. package/workers/vendor/csharp/_framework/supportFiles/84_System.Net.WebClient.dll +0 -0
  458. package/workers/vendor/csharp/_framework/supportFiles/85_System.Net.WebHeaderCollection.dll +0 -0
  459. package/workers/vendor/csharp/_framework/supportFiles/86_System.Net.WebProxy.dll +0 -0
  460. package/workers/vendor/csharp/_framework/supportFiles/87_System.Net.WebSockets.Client.dll +0 -0
  461. package/workers/vendor/csharp/_framework/supportFiles/88_System.Net.WebSockets.dll +0 -0
  462. package/workers/vendor/csharp/_framework/supportFiles/89_System.Numerics.dll +0 -0
  463. package/workers/vendor/csharp/_framework/supportFiles/8_netstandard.dll +0 -0
  464. package/workers/vendor/csharp/_framework/supportFiles/90_System.Numerics.Vectors.dll +0 -0
  465. package/workers/vendor/csharp/_framework/supportFiles/91_System.ObjectModel.dll +0 -0
  466. package/workers/vendor/csharp/_framework/supportFiles/92_System.Private.CoreLib.dll +0 -0
  467. package/workers/vendor/csharp/_framework/supportFiles/93_System.Private.DataContractSerialization.dll +0 -0
  468. package/workers/vendor/csharp/_framework/supportFiles/94_System.Private.Uri.dll +0 -0
  469. package/workers/vendor/csharp/_framework/supportFiles/95_System.Private.Xml.dll +0 -0
  470. package/workers/vendor/csharp/_framework/supportFiles/96_System.Private.Xml.Linq.dll +0 -0
  471. package/workers/vendor/csharp/_framework/supportFiles/97_System.Reflection.DispatchProxy.dll +0 -0
  472. package/workers/vendor/csharp/_framework/supportFiles/98_System.Reflection.dll +0 -0
  473. package/workers/vendor/csharp/_framework/supportFiles/99_System.Reflection.Emit.dll +0 -0
  474. package/workers/vendor/csharp/_framework/supportFiles/9_System.AppContext.dll +0 -0
  475. package/workers/vendor/csharp/_framework/tr/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
  476. package/workers/vendor/csharp/_framework/tr/Microsoft.CodeAnalysis.resources.wasm +0 -0
  477. package/workers/vendor/csharp/_framework/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
  478. package/workers/vendor/csharp/_framework/zh-Hans/Microsoft.CodeAnalysis.resources.wasm +0 -0
  479. package/workers/vendor/csharp/_framework/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
  480. package/workers/vendor/csharp/_framework/zh-Hant/Microsoft.CodeAnalysis.resources.wasm +0 -0
  481. package/workers/vendor/csharp/main.mjs +5 -0
  482. package/workers/vendor/csharp/package.json +1 -0
  483. package/workers/vendor/java-browser-helper.jar +0 -0
  484. package/workers/vendor/java-rewriter.jar +0 -0
  485. package/workers/vendor/javascript-libraries.js +10106 -0
  486. package/dist/runtime-types-89nchXlY.d.cts +0 -89
  487. package/dist/runtime-types-CCQ-ZLc9.d.ts +0 -89
  488. package/dist/types-zyvpJKCi.d.cts +0 -100
  489. package/dist/types-zyvpJKCi.d.ts +0 -100
  490. package/workers/java/java-source-augmentations.cjs +0 -242
  491. package/workers/java/src/spike/user/TraceHooks.java +0 -619
  492. package/workers/vendor/java-browser-spike-helper.jar +0 -0
  493. package/workers/vendor/java-practice-rewriter.jar +0 -0
  494. package/workers/vendor/java-rewrite-bridge.jar +0 -0
@@ -1,7 +1,21 @@
1
+ // packages/harness-core/src/runtime-trace.ts
2
+ var RUNTIME_TRACE_SCHEMA_VERSION = "runtime-trace-2026-04-28";
3
+ function createEmptyRuntimeTrace(language, options = {}) {
4
+ return {
5
+ schemaVersion: RUNTIME_TRACE_SCHEMA_VERSION,
6
+ language,
7
+ runId: options.runId ?? `${language}:run`,
8
+ events: [],
9
+ lineEventCount: 0,
10
+ traceStepCount: 0
11
+ };
12
+ }
13
+
1
14
  // packages/harness-javascript/src/typescript-runtime-declarations.ts
2
15
  var TYPESCRIPT_RUNTIME_DECLARATIONS = `
3
16
  declare class ListNode {
4
17
  val: any;
18
+ value: any;
5
19
  next: ListNode | SerializedListNode | SerializedRef | null;
6
20
  prev?: ListNode | SerializedListNode | SerializedRef | null;
7
21
  constructor(val?: any, next?: ListNode | null);
@@ -9,6 +23,7 @@ declare class ListNode {
9
23
 
10
24
  declare class TreeNode {
11
25
  val: any;
26
+ value: any;
12
27
  left: TreeNode | SerializedTreeNode | SerializedRef | null;
13
28
  right: TreeNode | SerializedTreeNode | SerializedRef | null;
14
29
  constructor(val?: any, left?: TreeNode | null, right?: TreeNode | null);
@@ -20,6 +35,7 @@ type SerializedListNode = {
20
35
  __id__?: string;
21
36
  __type__?: 'ListNode';
22
37
  val?: any;
38
+ value?: any;
23
39
  next?: SerializedListNode | SerializedRef | ListNode | null;
24
40
  prev?: SerializedListNode | SerializedRef | ListNode | null;
25
41
  };
@@ -28,6 +44,7 @@ type SerializedTreeNode = {
28
44
  __id__?: string;
29
45
  __type__?: 'TreeNode';
30
46
  val?: any;
47
+ value?: any;
31
48
  left?: SerializedTreeNode | SerializedRef | TreeNode | null;
32
49
  right?: SerializedTreeNode | SerializedRef | TreeNode | null;
33
50
  };
@@ -41,6 +58,7 @@ ${TYPESCRIPT_RUNTIME_DECLARATIONS}
41
58
 
42
59
  // packages/harness-javascript/src/javascript-executor.ts
43
60
  var typeScriptModulePromise = null;
61
+ var javascriptLibraryPromise = null;
44
62
  async function getTypeScriptModule() {
45
63
  if (!typeScriptModulePromise) {
46
64
  const specifier = "typescript";
@@ -51,6 +69,154 @@ async function getTypeScriptModule() {
51
69
  }
52
70
  return typeScriptModulePromise;
53
71
  }
72
+ async function tryImportJavaScriptLibraryModule(specifier) {
73
+ try {
74
+ return await import(
75
+ /* webpackIgnore: true */
76
+ specifier
77
+ );
78
+ } catch {
79
+ return void 0;
80
+ }
81
+ }
82
+ function normalizeCommonJsLikeModule(moduleValue) {
83
+ if (!moduleValue || typeof moduleValue !== "object") return moduleValue;
84
+ const record = moduleValue;
85
+ const namedKeys = Object.keys(record).filter((key) => key !== "default");
86
+ if (namedKeys.length === 0 && "default" in record) {
87
+ return record.default;
88
+ }
89
+ if (record.default && typeof record.default === "object") {
90
+ return { ...record.default, ...record };
91
+ }
92
+ return record;
93
+ }
94
+ function moduleMember(moduleValue, name) {
95
+ if (!moduleValue || typeof moduleValue !== "object") return void 0;
96
+ const record = moduleValue;
97
+ return record[name];
98
+ }
99
+ async function getJavaScriptLibraryEnvironment() {
100
+ if (!javascriptLibraryPromise) {
101
+ javascriptLibraryPromise = (async () => {
102
+ const [
103
+ lodashModule,
104
+ binarySearchTreeModule,
105
+ dequeModule,
106
+ graphModule,
107
+ heapModule,
108
+ linkedListModule,
109
+ priorityQueueModule,
110
+ queueModule,
111
+ enhancedSetModule,
112
+ stackModule,
113
+ trieModule
114
+ ] = await Promise.all([
115
+ tryImportJavaScriptLibraryModule("lodash"),
116
+ tryImportJavaScriptLibraryModule("@datastructures-js/binary-search-tree"),
117
+ tryImportJavaScriptLibraryModule("@datastructures-js/deque"),
118
+ tryImportJavaScriptLibraryModule("@datastructures-js/graph"),
119
+ tryImportJavaScriptLibraryModule("@datastructures-js/heap"),
120
+ tryImportJavaScriptLibraryModule("@datastructures-js/linked-list"),
121
+ tryImportJavaScriptLibraryModule("@datastructures-js/priority-queue"),
122
+ tryImportJavaScriptLibraryModule("@datastructures-js/queue"),
123
+ tryImportJavaScriptLibraryModule("@datastructures-js/set"),
124
+ tryImportJavaScriptLibraryModule("@datastructures-js/stack"),
125
+ tryImportJavaScriptLibraryModule("@datastructures-js/trie")
126
+ ]);
127
+ const lodash = normalizeCommonJsLikeModule(lodashModule);
128
+ const binarySearchTree = normalizeCommonJsLikeModule(binarySearchTreeModule);
129
+ const deque = normalizeCommonJsLikeModule(dequeModule);
130
+ const graph = normalizeCommonJsLikeModule(graphModule);
131
+ const heap = normalizeCommonJsLikeModule(heapModule);
132
+ const linkedList = normalizeCommonJsLikeModule(linkedListModule);
133
+ const priorityQueue = normalizeCommonJsLikeModule(priorityQueueModule);
134
+ const queue = normalizeCommonJsLikeModule(queueModule);
135
+ const enhancedSet = normalizeCommonJsLikeModule(enhancedSetModule);
136
+ const stack = normalizeCommonJsLikeModule(stackModule);
137
+ const trie = normalizeCommonJsLikeModule(trieModule);
138
+ const moduleEntries = [
139
+ ["lodash", lodash],
140
+ ["lodash.js", lodash],
141
+ ["@datastructures-js/binary-search-tree", binarySearchTree],
142
+ ["@datastructures-js/deque", deque],
143
+ ["@datastructures-js/graph", graph],
144
+ ["@datastructures-js/heap", heap],
145
+ ["@datastructures-js/linked-list", linkedList],
146
+ ["@datastructures-js/priority-queue", priorityQueue],
147
+ ["@datastructures-js/queue", queue],
148
+ ["@datastructures-js/set", enhancedSet],
149
+ ["@datastructures-js/stack", stack],
150
+ ["@datastructures-js/trie", trie]
151
+ ].filter((entry) => entry[1] !== void 0);
152
+ const globals = {
153
+ _: lodash,
154
+ lodash,
155
+ Deque: moduleMember(deque, "Deque"),
156
+ DoublyLinkedList: moduleMember(linkedList, "DoublyLinkedList"),
157
+ DoublyLinkedListNode: moduleMember(linkedList, "DoublyLinkedListNode"),
158
+ EnhancedSet: moduleMember(enhancedSet, "EnhancedSet"),
159
+ Heap: moduleMember(heap, "Heap"),
160
+ LinkedList: moduleMember(linkedList, "LinkedList"),
161
+ LinkedListNode: moduleMember(linkedList, "LinkedListNode"),
162
+ MaxHeap: moduleMember(heap, "MaxHeap"),
163
+ MaxPriorityQueue: moduleMember(priorityQueue, "MaxPriorityQueue"),
164
+ MinHeap: moduleMember(heap, "MinHeap"),
165
+ MinPriorityQueue: moduleMember(priorityQueue, "MinPriorityQueue"),
166
+ PriorityQueue: moduleMember(priorityQueue, "PriorityQueue"),
167
+ Queue: moduleMember(queue, "Queue"),
168
+ Stack: moduleMember(stack, "Stack")
169
+ };
170
+ for (const [key, value] of Object.entries(globals)) {
171
+ if (value === void 0) delete globals[key];
172
+ }
173
+ return {
174
+ modules: Object.fromEntries(moduleEntries),
175
+ globals
176
+ };
177
+ })();
178
+ }
179
+ return javascriptLibraryPromise;
180
+ }
181
+ function installJavaScriptLibraryGlobals(environment) {
182
+ const scope = globalThis;
183
+ const descriptors = /* @__PURE__ */ new Map();
184
+ const previousRequire = typeof scope.require === "function" ? scope.require : null;
185
+ const moduleObject = { exports: {} };
186
+ const requireFunction = (specifier) => {
187
+ if (Object.prototype.hasOwnProperty.call(environment.modules, specifier)) {
188
+ return environment.modules[specifier];
189
+ }
190
+ if (previousRequire && previousRequire !== requireFunction) {
191
+ return previousRequire(specifier);
192
+ }
193
+ throw new Error(`Cannot find module '${specifier}'`);
194
+ };
195
+ const values = {
196
+ ...environment.globals,
197
+ __TRACECODE_JAVASCRIPT_LIBRARIES__: environment.modules,
198
+ require: requireFunction,
199
+ module: moduleObject,
200
+ exports: moduleObject.exports
201
+ };
202
+ for (const [key, value] of Object.entries(values)) {
203
+ descriptors.set(key, Object.getOwnPropertyDescriptor(globalThis, key));
204
+ Object.defineProperty(scope, key, {
205
+ value,
206
+ configurable: true,
207
+ writable: true
208
+ });
209
+ }
210
+ return () => {
211
+ for (const [key, descriptor] of descriptors) {
212
+ if (descriptor) {
213
+ Object.defineProperty(scope, key, descriptor);
214
+ } else {
215
+ delete scope[key];
216
+ }
217
+ }
218
+ };
219
+ }
54
220
  function performanceNow() {
55
221
  if (typeof performance !== "undefined" && typeof performance.now === "function") {
56
222
  return performance.now();
@@ -106,8 +272,23 @@ function getCustomClassName(value) {
106
272
  }
107
273
  return name;
108
274
  }
275
+ var RUNTIME_VALUE_MAX_DEPTH = 48;
276
+ var RUNTIME_VALUE_MAX_ITEMS = 64;
277
+ var RUNTIME_VALUE_MAX_OBJECT_FIELDS = 32;
278
+ var TRACE_SERIALIZATION_LIMITS = { maxItems: RUNTIME_VALUE_MAX_ITEMS, maxFields: RUNTIME_VALUE_MAX_OBJECT_FIELDS };
279
+ var OUTPUT_SERIALIZATION_LIMITS = { maxItems: Number.POSITIVE_INFINITY, maxFields: Number.POSITIVE_INFINITY };
280
+ var activeSerializationLimits = TRACE_SERIALIZATION_LIMITS;
281
+ function truncationMarker(total, emitted) {
282
+ return { __truncated__: true, remaining: Math.max(0, total - emitted) };
283
+ }
284
+ function limitedEntries(items, maxItems) {
285
+ return {
286
+ values: items.slice(0, maxItems),
287
+ remaining: Math.max(0, items.length - maxItems)
288
+ };
289
+ }
109
290
  function serializeValue(value, depth = 0, seen = /* @__PURE__ */ new WeakSet(), nodeRefState = { ids: /* @__PURE__ */ new Map(), nextId: 1 }) {
110
- if (depth > 48) return "<max depth>";
291
+ if (depth > RUNTIME_VALUE_MAX_DEPTH) return "<max depth>";
111
292
  if (value === null || value === void 0) return value;
112
293
  if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
113
294
  return value;
@@ -119,22 +300,39 @@ function serializeValue(value, depth = 0, seen = /* @__PURE__ */ new WeakSet(),
119
300
  return "<function>";
120
301
  }
121
302
  if (Array.isArray(value)) {
122
- return value.map((item) => serializeValue(item, depth + 1, seen));
303
+ const limited = limitedEntries(value, activeSerializationLimits.maxItems);
304
+ const result = limited.values.map((item) => serializeValue(item, depth + 1, seen, nodeRefState));
305
+ if (limited.remaining > 0) result.push(truncationMarker(value.length, limited.values.length));
306
+ return result;
123
307
  }
124
308
  if (value instanceof Set) {
125
- return {
309
+ const items = [...value];
310
+ const limited = limitedEntries(items, activeSerializationLimits.maxItems);
311
+ const result = {
126
312
  __type__: "set",
127
- values: [...value].map((item) => serializeValue(item, depth + 1, seen, nodeRefState))
313
+ values: limited.values.map((item) => serializeValue(item, depth + 1, seen, nodeRefState))
128
314
  };
315
+ if (limited.remaining > 0) {
316
+ result.__truncated__ = true;
317
+ result.remaining = limited.remaining;
318
+ }
319
+ return result;
129
320
  }
130
321
  if (value instanceof Map) {
131
- return {
322
+ const entries = [...value.entries()];
323
+ const limited = limitedEntries(entries, activeSerializationLimits.maxItems);
324
+ const result = {
132
325
  __type__: "map",
133
- entries: [...value.entries()].map(([k, v]) => [
326
+ entries: limited.values.map(([k, v]) => [
134
327
  serializeValue(k, depth + 1, seen, nodeRefState),
135
328
  serializeValue(v, depth + 1, seen, nodeRefState)
136
329
  ])
137
330
  };
331
+ if (limited.remaining > 0) {
332
+ result.__truncated__ = true;
333
+ result.remaining = limited.remaining;
334
+ }
335
+ return result;
138
336
  }
139
337
  if (typeof value === "object") {
140
338
  if (isLikelyTreeNodeValue(value) || isLikelyListNodeValue(value)) {
@@ -145,8 +343,7 @@ function serializeValue(value, depth = 0, seen = /* @__PURE__ */ new WeakSet(),
145
343
  return { __ref__: existingId };
146
344
  }
147
345
  const isTree = isLikelyTreeNodeValue(value);
148
- const nodePrefix = isTree ? "tree" : "list";
149
- const nodeId = `${nodePrefix}-${nodeRefState.nextId++}`;
346
+ const nodeId = `ref-${nodeRefState.nextId++}`;
150
347
  nodeRefState.ids.set(objectValue, nodeId);
151
348
  const out2 = isTree ? {
152
349
  __type__: "TreeNode",
@@ -162,10 +359,14 @@ function serializeValue(value, depth = 0, seen = /* @__PURE__ */ new WeakSet(),
162
359
  ..."prev" in nodeValue ? { prev: serializeValue(nodeValue.prev ?? null, depth + 1, seen, nodeRefState) } : {}
163
360
  };
164
361
  const skipped = isTree ? /* @__PURE__ */ new Set(["__id__", "__type__", "__class__", "val", "value", "left", "right"]) : /* @__PURE__ */ new Set(["__id__", "__type__", "__class__", "val", "value", "next", "prev"]);
165
- for (const [k, v] of Object.entries(nodeValue)) {
166
- if (skipped.has(k)) continue;
362
+ const fields2 = Object.entries(nodeValue).filter(([k]) => !skipped.has(k));
363
+ for (const [k, v] of fields2.slice(0, activeSerializationLimits.maxFields)) {
167
364
  out2[k] = serializeValue(v, depth + 1, seen, nodeRefState);
168
365
  }
366
+ if (fields2.length > activeSerializationLimits.maxFields) {
367
+ out2.__truncated__ = true;
368
+ out2.remaining = fields2.length - activeSerializationLimits.maxFields;
369
+ }
169
370
  return out2;
170
371
  }
171
372
  const customClassName = getCustomClassName(value);
@@ -175,32 +376,54 @@ function serializeValue(value, depth = 0, seen = /* @__PURE__ */ new WeakSet(),
175
376
  if (existingId) {
176
377
  return { __ref__: existingId };
177
378
  }
178
- const objectId = `object-${nodeRefState.nextId++}`;
379
+ const objectId = `ref-${nodeRefState.nextId++}`;
179
380
  nodeRefState.ids.set(objectValue, objectId);
180
381
  if (seen.has(objectValue)) return { __ref__: objectId };
181
382
  seen.add(objectValue);
182
383
  const out2 = {
183
- __type__: "object",
384
+ __type__: customClassName,
184
385
  __class__: customClassName,
185
386
  __id__: objectId
186
387
  };
187
- for (const [k, v] of Object.entries(value)) {
388
+ const fields2 = Object.entries(value);
389
+ for (const [k, v] of fields2.slice(0, activeSerializationLimits.maxFields)) {
188
390
  out2[k] = serializeValue(v, depth + 1, seen, nodeRefState);
189
391
  }
392
+ if (fields2.length > activeSerializationLimits.maxFields) {
393
+ out2.__truncated__ = true;
394
+ out2.remaining = fields2.length - activeSerializationLimits.maxFields;
395
+ }
190
396
  seen.delete(objectValue);
191
397
  return out2;
192
398
  }
193
399
  if (seen.has(value)) return "<cycle>";
194
400
  seen.add(value);
195
401
  const out = {};
196
- for (const [k, v] of Object.entries(value)) {
402
+ const fields = Object.entries(value);
403
+ for (const [k, v] of fields.slice(0, activeSerializationLimits.maxFields)) {
197
404
  out[k] = serializeValue(v, depth + 1, seen, nodeRefState);
198
405
  }
406
+ if (fields.length > activeSerializationLimits.maxFields) {
407
+ out.__truncated__ = true;
408
+ out.remaining = fields.length - activeSerializationLimits.maxFields;
409
+ }
199
410
  seen.delete(value);
200
411
  return out;
201
412
  }
202
413
  return String(value);
203
414
  }
415
+ function withSerializationLimits(limits, serialize) {
416
+ const previous = activeSerializationLimits;
417
+ activeSerializationLimits = limits;
418
+ try {
419
+ return serialize();
420
+ } finally {
421
+ activeSerializationLimits = previous;
422
+ }
423
+ }
424
+ function serializeOutputValue(value) {
425
+ return withSerializationLimits(OUTPUT_SERIALIZATION_LIMITS, () => serializeValue(value));
426
+ }
204
427
  function extractUserErrorLine(error) {
205
428
  if (typeof error === "object" && error && "__tracecodeLine" in error) {
206
429
  const line2 = Number(error.__tracecodeLine);
@@ -266,16 +489,40 @@ function resolveReferenceGraph(value, byId, resolved) {
266
489
  }
267
490
  return out;
268
491
  }
492
+ function cloneInputGraph(value, cloned = /* @__PURE__ */ new WeakMap()) {
493
+ if (value === null || value === void 0) return value;
494
+ if (typeof value !== "object") return value;
495
+ if (cloned.has(value)) {
496
+ return cloned.get(value);
497
+ }
498
+ if (Array.isArray(value)) {
499
+ const out2 = [];
500
+ cloned.set(value, out2);
501
+ for (const item of value) {
502
+ out2.push(cloneInputGraph(item, cloned));
503
+ }
504
+ return out2;
505
+ }
506
+ if (!isPlainObjectRecord(value)) {
507
+ return value;
508
+ }
509
+ const out = {};
510
+ cloned.set(value, out);
511
+ for (const [key, nested] of Object.entries(value)) {
512
+ out[key] = cloneInputGraph(nested, cloned);
513
+ }
514
+ return out;
515
+ }
269
516
  function normalizeInputs(inputs) {
270
517
  if (!inputs || typeof inputs !== "object" || Array.isArray(inputs)) return {};
271
518
  const byId = /* @__PURE__ */ new Map();
272
519
  collectReferenceTargets(inputs, byId, /* @__PURE__ */ new WeakSet());
273
520
  if (byId.size === 0) {
274
- return inputs;
521
+ return cloneInputGraph(inputs);
275
522
  }
276
523
  const hydrated = resolveReferenceGraph(inputs, byId, /* @__PURE__ */ new WeakMap());
277
524
  if (!hydrated || typeof hydrated !== "object" || Array.isArray(hydrated)) {
278
- return inputs;
525
+ return cloneInputGraph(inputs);
279
526
  }
280
527
  return hydrated;
281
528
  }
@@ -683,6 +930,8 @@ async function executeJavaScriptCode(code, functionName, inputs, executionStyle
683
930
  const normalizedInputs = normalizeInputs(inputs);
684
931
  const materializers = await resolveInputMaterializers(code, functionName, executionStyle, language);
685
932
  const materializedInputs = applyInputMaterializers(normalizedInputs, materializers);
933
+ const javascriptLibraryEnvironment = await getJavaScriptLibraryEnvironment();
934
+ const restoreJavaScriptLibraryGlobals = installJavaScriptLibraryGlobals(javascriptLibraryEnvironment);
686
935
  try {
687
936
  let output;
688
937
  if (executionStyle === "ops-class") {
@@ -698,7 +947,7 @@ async function executeJavaScriptCode(code, functionName, inputs, executionStyle
698
947
  }
699
948
  return {
700
949
  success: true,
701
- output: serializeValue(output),
950
+ output: serializeOutputValue(output),
702
951
  consoleOutput
703
952
  };
704
953
  } catch (error) {
@@ -709,6 +958,8 @@ async function executeJavaScriptCode(code, functionName, inputs, executionStyle
709
958
  errorLine: extractUserErrorLine(error),
710
959
  consoleOutput
711
960
  };
961
+ } finally {
962
+ restoreJavaScriptLibraryGlobals();
712
963
  }
713
964
  }
714
965
  async function executeJavaScriptWithTracing(code, functionName, inputs, executionStyle = "function", language = "javascript") {
@@ -720,7 +971,7 @@ async function executeJavaScriptWithTracing(code, functionName, inputs, executio
720
971
  success: false,
721
972
  error: codeResult.error,
722
973
  errorLine: codeResult.errorLine,
723
- trace: [],
974
+ trace: createEmptyRuntimeTrace(language),
724
975
  executionTimeMs,
725
976
  consoleOutput: codeResult.consoleOutput ?? [],
726
977
  lineEventCount: 0,
@@ -730,7 +981,7 @@ async function executeJavaScriptWithTracing(code, functionName, inputs, executio
730
981
  return {
731
982
  success: true,
732
983
  output: codeResult.output,
733
- trace: [],
984
+ trace: createEmptyRuntimeTrace(language),
734
985
  executionTimeMs,
735
986
  consoleOutput: codeResult.consoleOutput ?? [],
736
987
  lineEventCount: 0,
@@ -744,8 +995,799 @@ async function executeTypeScriptCode(code, functionName, inputs, executionStyle
744
995
  const transpiledCode = await transpileTypeScript(code);
745
996
  return executeJavaScriptCode(transpiledCode, functionName, materializedInputs, executionStyle, "typescript");
746
997
  }
998
+
999
+ // packages/harness-browser/src/runtime-capability-guards.ts
1000
+ function isScriptRequest(functionName) {
1001
+ if (functionName == null) return true;
1002
+ return functionName.trim().length === 0;
1003
+ }
1004
+ function executionStyleLabel(executionStyle) {
1005
+ if (executionStyle === "solution-method") return "solution-method";
1006
+ if (executionStyle === "ops-class") return "ops-class";
1007
+ return "function";
1008
+ }
1009
+ function isExecutionStyleSupported(profile, executionStyle) {
1010
+ const styles = profile.capabilities.execution.styles;
1011
+ if (executionStyle === "solution-method") return styles.solutionMethod;
1012
+ if (executionStyle === "ops-class") return styles.opsClass;
1013
+ return styles.function;
1014
+ }
1015
+ function describeRequest(request) {
1016
+ if (request === "trace") return "tracing";
1017
+ if (request === "interview") return "interview execution";
1018
+ return "execution";
1019
+ }
1020
+ function assertRuntimeRequestSupported(profile, options) {
1021
+ if (options.request === "trace" && !profile.capabilities.tracing.supported) {
1022
+ throw new Error(`Runtime "${profile.language}" does not support tracing.`);
1023
+ }
1024
+ if (options.request === "interview" && !profile.capabilities.execution.styles.interviewMode) {
1025
+ throw new Error(`Runtime "${profile.language}" does not support interview execution.`);
1026
+ }
1027
+ if (!isExecutionStyleSupported(profile, options.executionStyle)) {
1028
+ throw new Error(
1029
+ `Runtime "${profile.language}" does not support execution style "${executionStyleLabel(options.executionStyle)}".`
1030
+ );
1031
+ }
1032
+ if (isScriptRequest(options.functionName) && !profile.capabilities.execution.styles.script) {
1033
+ throw new Error(`Runtime "${profile.language}" does not support script mode ${describeRequest(options.request)}.`);
1034
+ }
1035
+ }
1036
+
1037
+ // packages/harness-browser/src/runtime-profiles.ts
1038
+ var PYTHON_RUNTIME_PROFILE = {
1039
+ language: "python",
1040
+ maturity: "stable",
1041
+ capabilities: {
1042
+ execution: {
1043
+ styles: {
1044
+ function: true,
1045
+ solutionMethod: true,
1046
+ opsClass: true,
1047
+ script: true,
1048
+ interviewMode: true
1049
+ },
1050
+ timeouts: {
1051
+ clientTimeouts: true,
1052
+ runtimeTimeouts: true
1053
+ }
1054
+ },
1055
+ tracing: {
1056
+ supported: true,
1057
+ events: {
1058
+ line: true,
1059
+ call: true,
1060
+ return: true,
1061
+ exception: true,
1062
+ stdout: true,
1063
+ timeout: true
1064
+ },
1065
+ controls: {
1066
+ maxTraceSteps: true,
1067
+ maxLineEvents: true,
1068
+ maxSingleLineHits: true,
1069
+ maxStoredEvents: true,
1070
+ minimalTrace: true
1071
+ },
1072
+ fidelity: {
1073
+ preciseLineMapping: true,
1074
+ stableFunctionNames: true,
1075
+ callStack: true
1076
+ }
1077
+ },
1078
+ diagnostics: {
1079
+ compileErrors: false,
1080
+ runtimeErrors: true,
1081
+ mappedErrorLines: true,
1082
+ stackTraces: false
1083
+ },
1084
+ structures: {
1085
+ treeNodeRefs: true,
1086
+ listNodeRefs: true,
1087
+ mapSerialization: true,
1088
+ setSerialization: true,
1089
+ graphSerialization: true,
1090
+ cycleReferences: true
1091
+ }
1092
+ }
1093
+ };
1094
+ var JAVASCRIPT_RUNTIME_PROFILE = {
1095
+ language: "javascript",
1096
+ maturity: "stable",
1097
+ capabilities: {
1098
+ execution: {
1099
+ styles: {
1100
+ function: true,
1101
+ solutionMethod: true,
1102
+ opsClass: true,
1103
+ script: true,
1104
+ interviewMode: true
1105
+ },
1106
+ timeouts: {
1107
+ clientTimeouts: true,
1108
+ runtimeTimeouts: false
1109
+ }
1110
+ },
1111
+ tracing: {
1112
+ supported: true,
1113
+ events: {
1114
+ line: true,
1115
+ call: true,
1116
+ return: true,
1117
+ exception: true,
1118
+ stdout: false,
1119
+ timeout: true
1120
+ },
1121
+ controls: {
1122
+ maxTraceSteps: true,
1123
+ maxLineEvents: true,
1124
+ maxSingleLineHits: true,
1125
+ maxStoredEvents: true,
1126
+ minimalTrace: true
1127
+ },
1128
+ fidelity: {
1129
+ preciseLineMapping: true,
1130
+ stableFunctionNames: true,
1131
+ callStack: true
1132
+ }
1133
+ },
1134
+ diagnostics: {
1135
+ compileErrors: false,
1136
+ runtimeErrors: true,
1137
+ mappedErrorLines: false,
1138
+ stackTraces: false
1139
+ },
1140
+ structures: {
1141
+ treeNodeRefs: true,
1142
+ listNodeRefs: true,
1143
+ mapSerialization: true,
1144
+ setSerialization: true,
1145
+ graphSerialization: true,
1146
+ cycleReferences: true
1147
+ }
1148
+ }
1149
+ };
1150
+ var TYPESCRIPT_RUNTIME_PROFILE = {
1151
+ language: "typescript",
1152
+ maturity: "stable",
1153
+ capabilities: {
1154
+ execution: {
1155
+ styles: {
1156
+ function: true,
1157
+ solutionMethod: true,
1158
+ opsClass: true,
1159
+ script: true,
1160
+ interviewMode: true
1161
+ },
1162
+ timeouts: {
1163
+ clientTimeouts: true,
1164
+ runtimeTimeouts: false
1165
+ }
1166
+ },
1167
+ tracing: {
1168
+ supported: true,
1169
+ events: {
1170
+ line: true,
1171
+ call: true,
1172
+ return: true,
1173
+ exception: true,
1174
+ stdout: false,
1175
+ timeout: true
1176
+ },
1177
+ controls: {
1178
+ maxTraceSteps: true,
1179
+ maxLineEvents: true,
1180
+ maxSingleLineHits: true,
1181
+ maxStoredEvents: true,
1182
+ minimalTrace: true
1183
+ },
1184
+ fidelity: {
1185
+ preciseLineMapping: true,
1186
+ stableFunctionNames: true,
1187
+ callStack: true
1188
+ }
1189
+ },
1190
+ diagnostics: {
1191
+ compileErrors: true,
1192
+ runtimeErrors: true,
1193
+ mappedErrorLines: true,
1194
+ stackTraces: false
1195
+ },
1196
+ structures: {
1197
+ treeNodeRefs: true,
1198
+ listNodeRefs: true,
1199
+ mapSerialization: true,
1200
+ setSerialization: true,
1201
+ graphSerialization: true,
1202
+ cycleReferences: true
1203
+ }
1204
+ }
1205
+ };
1206
+ var JAVA_RUNTIME_PROFILE = {
1207
+ language: "java",
1208
+ maturity: "experimental",
1209
+ capabilities: {
1210
+ execution: {
1211
+ styles: {
1212
+ function: true,
1213
+ solutionMethod: true,
1214
+ opsClass: true,
1215
+ script: true,
1216
+ interviewMode: true
1217
+ },
1218
+ timeouts: {
1219
+ clientTimeouts: true,
1220
+ runtimeTimeouts: true
1221
+ }
1222
+ },
1223
+ tracing: {
1224
+ supported: true,
1225
+ events: {
1226
+ line: true,
1227
+ call: true,
1228
+ return: true,
1229
+ exception: true,
1230
+ stdout: false,
1231
+ timeout: true
1232
+ },
1233
+ controls: {
1234
+ maxTraceSteps: true,
1235
+ maxLineEvents: false,
1236
+ maxSingleLineHits: false,
1237
+ maxStoredEvents: true,
1238
+ minimalTrace: false
1239
+ },
1240
+ fidelity: {
1241
+ preciseLineMapping: true,
1242
+ stableFunctionNames: true,
1243
+ callStack: true
1244
+ }
1245
+ },
1246
+ diagnostics: {
1247
+ compileErrors: true,
1248
+ runtimeErrors: true,
1249
+ mappedErrorLines: false,
1250
+ stackTraces: true
1251
+ },
1252
+ structures: {
1253
+ treeNodeRefs: true,
1254
+ listNodeRefs: true,
1255
+ mapSerialization: true,
1256
+ setSerialization: true,
1257
+ graphSerialization: false,
1258
+ cycleReferences: true
1259
+ }
1260
+ },
1261
+ notes: [
1262
+ "Java currently supports the browser-local Java 17 lane for function, solution-method, ops-class, and script-style execution.",
1263
+ "Interview-mode Java reuses the same browser-local execution path and remains experimental.",
1264
+ 'Script-style Java uses an empty function name with executionStyle="function" and reads the top-level result variable.'
1265
+ ]
1266
+ };
1267
+ var CSHARP_RUNTIME_PROFILE = {
1268
+ language: "csharp",
1269
+ maturity: "experimental",
1270
+ capabilities: {
1271
+ execution: {
1272
+ styles: {
1273
+ function: true,
1274
+ solutionMethod: true,
1275
+ opsClass: true,
1276
+ script: true,
1277
+ interviewMode: true
1278
+ },
1279
+ timeouts: {
1280
+ clientTimeouts: true,
1281
+ runtimeTimeouts: true
1282
+ }
1283
+ },
1284
+ tracing: {
1285
+ supported: true,
1286
+ events: {
1287
+ line: true,
1288
+ call: true,
1289
+ return: true,
1290
+ exception: true,
1291
+ stdout: true,
1292
+ timeout: true
1293
+ },
1294
+ controls: {
1295
+ maxTraceSteps: true,
1296
+ maxLineEvents: true,
1297
+ maxSingleLineHits: true,
1298
+ maxStoredEvents: true,
1299
+ minimalTrace: true
1300
+ },
1301
+ fidelity: {
1302
+ preciseLineMapping: true,
1303
+ stableFunctionNames: true,
1304
+ callStack: true
1305
+ }
1306
+ },
1307
+ diagnostics: {
1308
+ compileErrors: true,
1309
+ runtimeErrors: true,
1310
+ mappedErrorLines: true,
1311
+ stackTraces: false
1312
+ },
1313
+ structures: {
1314
+ treeNodeRefs: true,
1315
+ listNodeRefs: true,
1316
+ mapSerialization: true,
1317
+ setSerialization: true,
1318
+ graphSerialization: true,
1319
+ cycleReferences: true
1320
+ }
1321
+ },
1322
+ notes: [
1323
+ "C# support is browser-local and experimental.",
1324
+ "C# supports named function-style requests where the browser-local host can bind the named method.",
1325
+ 'Script-style C# uses an empty function name with executionStyle="function" and reads the top-level result variable.',
1326
+ "Interview-mode C# uses the same browser-local worker execution path with interview timeout normalization.",
1327
+ "The first C# slice supports public class Solution methods.",
1328
+ "ListNode and TreeNode inputs are hydrated from level-order arrays or object-shaped JSON.",
1329
+ "Dictionary, HashSet, List, and array return values serialize through the browser-local worker.",
1330
+ "Tracing currently supports line, call, return, stdout, and simple local variable write events.",
1331
+ "Structural visualization is added after execution and diagnostics are proven."
1332
+ ]
1333
+ };
1334
+ var CPP_RUNTIME_PROFILE = {
1335
+ language: "cpp",
1336
+ maturity: "experimental",
1337
+ capabilities: {
1338
+ execution: {
1339
+ styles: {
1340
+ function: true,
1341
+ solutionMethod: true,
1342
+ opsClass: true,
1343
+ script: true,
1344
+ interviewMode: true
1345
+ },
1346
+ timeouts: {
1347
+ clientTimeouts: true,
1348
+ runtimeTimeouts: true
1349
+ }
1350
+ },
1351
+ tracing: {
1352
+ supported: true,
1353
+ events: {
1354
+ line: true,
1355
+ call: true,
1356
+ return: true,
1357
+ exception: true,
1358
+ stdout: true,
1359
+ timeout: true
1360
+ },
1361
+ controls: {
1362
+ maxTraceSteps: true,
1363
+ maxLineEvents: true,
1364
+ maxSingleLineHits: true,
1365
+ maxStoredEvents: true,
1366
+ minimalTrace: true
1367
+ },
1368
+ fidelity: {
1369
+ preciseLineMapping: true,
1370
+ stableFunctionNames: true,
1371
+ callStack: true
1372
+ }
1373
+ },
1374
+ diagnostics: {
1375
+ compileErrors: true,
1376
+ runtimeErrors: true,
1377
+ mappedErrorLines: true,
1378
+ stackTraces: false
1379
+ },
1380
+ structures: {
1381
+ treeNodeRefs: true,
1382
+ listNodeRefs: true,
1383
+ mapSerialization: true,
1384
+ setSerialization: true,
1385
+ graphSerialization: true,
1386
+ cycleReferences: true
1387
+ }
1388
+ },
1389
+ notes: [
1390
+ "C++ uses a focused browser-local Clang/LLD/WASI compiler lane with TraceCode-owned execution glue.",
1391
+ "The runtime intentionally does not depend on a generic multi-language container/runtime SDK.",
1392
+ 'Script-style C++ uses an empty function name with executionStyle="function"; the snippet must assign a serializable result variable.',
1393
+ "Interview-mode C++ reuses the tracing compiler path with a trace budget and returns a non-trace execution result."
1394
+ ]
1395
+ };
1396
+ var LANGUAGE_RUNTIME_PROFILES = {
1397
+ python: PYTHON_RUNTIME_PROFILE,
1398
+ javascript: JAVASCRIPT_RUNTIME_PROFILE,
1399
+ typescript: TYPESCRIPT_RUNTIME_PROFILE,
1400
+ java: JAVA_RUNTIME_PROFILE,
1401
+ csharp: CSHARP_RUNTIME_PROFILE,
1402
+ cpp: CPP_RUNTIME_PROFILE
1403
+ };
1404
+ var SUPPORTED_LANGUAGES = Object.freeze(
1405
+ Object.keys(LANGUAGE_RUNTIME_PROFILES)
1406
+ );
1407
+ function getLanguageRuntimeProfile(language) {
1408
+ const profile = LANGUAGE_RUNTIME_PROFILES[language];
1409
+ if (!profile) {
1410
+ throw new Error(`Runtime profile for language "${language}" is not implemented yet.`);
1411
+ }
1412
+ return profile;
1413
+ }
1414
+
1415
+ // packages/harness-browser/src/javascript-runtime-client.ts
1416
+ var JavaScriptRuntimeClient = class {
1417
+ constructor(runtimeLanguage, workerClient) {
1418
+ this.runtimeLanguage = runtimeLanguage;
1419
+ this.workerClient = workerClient;
1420
+ }
1421
+ async init() {
1422
+ return this.workerClient.init();
1423
+ }
1424
+ async executeWithTracing(code, functionName, inputs, options, executionStyle = "function") {
1425
+ assertRuntimeRequestSupported(getLanguageRuntimeProfile(this.runtimeLanguage), {
1426
+ request: "trace",
1427
+ executionStyle,
1428
+ functionName
1429
+ });
1430
+ return this.workerClient.executeWithTracing(
1431
+ code,
1432
+ functionName,
1433
+ inputs,
1434
+ options,
1435
+ executionStyle,
1436
+ this.runtimeLanguage
1437
+ );
1438
+ }
1439
+ async executeCode(code, functionName, inputs, executionStyle = "function") {
1440
+ assertRuntimeRequestSupported(getLanguageRuntimeProfile(this.runtimeLanguage), {
1441
+ request: "execute",
1442
+ executionStyle,
1443
+ functionName
1444
+ });
1445
+ return this.workerClient.executeCode(
1446
+ code,
1447
+ functionName,
1448
+ inputs,
1449
+ executionStyle,
1450
+ this.runtimeLanguage
1451
+ );
1452
+ }
1453
+ async executeCodeInterviewMode(code, functionName, inputs, executionStyle = "function") {
1454
+ assertRuntimeRequestSupported(getLanguageRuntimeProfile(this.runtimeLanguage), {
1455
+ request: "interview",
1456
+ executionStyle,
1457
+ functionName
1458
+ });
1459
+ return this.workerClient.executeCodeInterviewMode(
1460
+ code,
1461
+ functionName,
1462
+ inputs,
1463
+ executionStyle,
1464
+ this.runtimeLanguage
1465
+ );
1466
+ }
1467
+ };
1468
+ function createJavaScriptRuntimeClient(runtimeLanguage, workerClient) {
1469
+ return new JavaScriptRuntimeClient(runtimeLanguage, workerClient);
1470
+ }
1471
+
1472
+ // packages/harness-browser/src/runtime-diagnostics.ts
1473
+ var CONSOLE_METHOD_BY_LEVEL = {
1474
+ debug: "debug",
1475
+ info: "info",
1476
+ warn: "warn",
1477
+ error: "error"
1478
+ };
1479
+ function runtimeDiagnosticEvent(params) {
1480
+ return {
1481
+ schema: "tracecode.runtime-diagnostic.v1",
1482
+ source: "harness",
1483
+ ...params
1484
+ };
1485
+ }
1486
+ function logRuntimeDiagnostic(level, params, options = {}) {
1487
+ if (options.enabled === false && level !== "error") {
1488
+ return;
1489
+ }
1490
+ const method = CONSOLE_METHOD_BY_LEVEL[level] ?? "info";
1491
+ console[method]("[TraceRuntime]", runtimeDiagnosticEvent(params));
1492
+ }
1493
+
1494
+ // packages/harness-browser/src/javascript-worker-client.ts
1495
+ var EXECUTION_TIMEOUT_MS = 2e4;
1496
+ var INTERVIEW_MODE_TIMEOUT_MS = 5e3;
1497
+ var TRACING_TIMEOUT_MS = 2e4;
1498
+ var INIT_TIMEOUT_MS = 1e4;
1499
+ var TYPESCRIPT_WARMUP_TIMEOUT_MS = 3e4;
1500
+ var MESSAGE_TIMEOUT_MS = 12e3;
1501
+ var WORKER_READY_TIMEOUT_MS = 1e4;
1502
+ var JavaScriptWorkerClient = class {
1503
+ constructor(options) {
1504
+ this.options = options;
1505
+ this.debug = options.debug ?? process.env.NODE_ENV === "development";
1506
+ }
1507
+ worker = null;
1508
+ pendingMessages = /* @__PURE__ */ new Map();
1509
+ messageId = 0;
1510
+ isInitializing = false;
1511
+ initPromise = null;
1512
+ warmupPromises = /* @__PURE__ */ new Map();
1513
+ workerReadyPromise = null;
1514
+ workerReadyResolve = null;
1515
+ workerReadyReject = null;
1516
+ debug;
1517
+ isSupported() {
1518
+ return typeof Worker !== "undefined";
1519
+ }
1520
+ getWorker() {
1521
+ if (this.worker) return this.worker;
1522
+ if (!this.isSupported()) {
1523
+ throw new Error("Web Workers are not supported in this environment");
1524
+ }
1525
+ this.workerReadyPromise = new Promise((resolve, reject) => {
1526
+ this.workerReadyResolve = resolve;
1527
+ this.workerReadyReject = (error) => reject(error);
1528
+ });
1529
+ const workerUrl = this.debug && !this.options.workerUrl.includes("?") ? `${this.options.workerUrl}?dev=${Date.now()}` : this.options.workerUrl;
1530
+ this.worker = new Worker(workerUrl);
1531
+ this.worker.onmessage = (event) => {
1532
+ const { id, type, payload } = event.data;
1533
+ if (type === "worker-ready") {
1534
+ this.workerReadyResolve?.();
1535
+ this.workerReadyResolve = null;
1536
+ this.workerReadyReject = null;
1537
+ logRuntimeDiagnostic("info", {
1538
+ component: "JavaScriptWorkerClient",
1539
+ runtime: "javascript",
1540
+ phase: "worker-ready",
1541
+ message: "JavaScript worker is ready."
1542
+ }, { enabled: this.debug });
1543
+ return;
1544
+ }
1545
+ if (id) {
1546
+ const pending = this.pendingMessages.get(id);
1547
+ if (!pending) return;
1548
+ this.pendingMessages.delete(id);
1549
+ if (pending.timeoutId) globalThis.clearTimeout(pending.timeoutId);
1550
+ if (type === "error") {
1551
+ pending.reject(new Error(payload.error));
1552
+ return;
1553
+ }
1554
+ pending.resolve(payload);
1555
+ }
1556
+ };
1557
+ this.worker.onerror = (error) => {
1558
+ logRuntimeDiagnostic("error", {
1559
+ component: "JavaScriptWorkerClient",
1560
+ runtime: "javascript",
1561
+ phase: "worker-error",
1562
+ message: "JavaScript worker emitted an error event.",
1563
+ detail: {
1564
+ message: error.message,
1565
+ filename: error.filename,
1566
+ lineno: error.lineno,
1567
+ colno: error.colno
1568
+ }
1569
+ });
1570
+ const workerError = new Error("Worker error");
1571
+ this.workerReadyReject?.(workerError);
1572
+ this.workerReadyResolve = null;
1573
+ this.workerReadyReject = null;
1574
+ for (const [id, pending] of this.pendingMessages) {
1575
+ if (pending.timeoutId) globalThis.clearTimeout(pending.timeoutId);
1576
+ pending.reject(workerError);
1577
+ this.pendingMessages.delete(id);
1578
+ }
1579
+ };
1580
+ return this.worker;
1581
+ }
1582
+ async waitForWorkerReady() {
1583
+ const readyPromise = this.workerReadyPromise;
1584
+ if (!readyPromise) return;
1585
+ await new Promise((resolve, reject) => {
1586
+ let settled = false;
1587
+ const timeoutId = globalThis.setTimeout(() => {
1588
+ if (settled) return;
1589
+ settled = true;
1590
+ const timeoutError = new Error(
1591
+ `JavaScript worker failed to initialize in time (${Math.round(WORKER_READY_TIMEOUT_MS / 1e3)}s)`
1592
+ );
1593
+ this.terminateAndReset(timeoutError);
1594
+ reject(timeoutError);
1595
+ }, WORKER_READY_TIMEOUT_MS);
1596
+ readyPromise.then(() => {
1597
+ if (settled) return;
1598
+ settled = true;
1599
+ globalThis.clearTimeout(timeoutId);
1600
+ resolve();
1601
+ }).catch((error) => {
1602
+ if (settled) return;
1603
+ settled = true;
1604
+ globalThis.clearTimeout(timeoutId);
1605
+ reject(error instanceof Error ? error : new Error(String(error)));
1606
+ });
1607
+ });
1608
+ }
1609
+ async sendMessage(type, payload, timeoutMs = MESSAGE_TIMEOUT_MS) {
1610
+ const worker = this.getWorker();
1611
+ await this.waitForWorkerReady();
1612
+ const id = String(++this.messageId);
1613
+ return new Promise((resolve, reject) => {
1614
+ this.pendingMessages.set(id, {
1615
+ resolve,
1616
+ reject
1617
+ });
1618
+ const timeoutId = globalThis.setTimeout(() => {
1619
+ const pending2 = this.pendingMessages.get(id);
1620
+ if (!pending2) return;
1621
+ this.pendingMessages.delete(id);
1622
+ pending2.reject(new Error(`Worker request timed out: ${type}`));
1623
+ }, timeoutMs);
1624
+ const pending = this.pendingMessages.get(id);
1625
+ if (pending) pending.timeoutId = timeoutId;
1626
+ worker.postMessage({ id, type, payload });
1627
+ });
1628
+ }
1629
+ async executeWithTimeout(executor, timeoutMs) {
1630
+ return new Promise((resolve, reject) => {
1631
+ let settled = false;
1632
+ const timeoutId = globalThis.setTimeout(() => {
1633
+ if (settled) return;
1634
+ settled = true;
1635
+ this.terminateAndReset();
1636
+ reject(
1637
+ new Error(
1638
+ `Execution timed out (possible infinite loop). Code execution was stopped after ${Math.round(timeoutMs / 1e3)} seconds.`
1639
+ )
1640
+ );
1641
+ }, timeoutMs);
1642
+ executor().then((result) => {
1643
+ if (settled) return;
1644
+ settled = true;
1645
+ globalThis.clearTimeout(timeoutId);
1646
+ resolve(result);
1647
+ }).catch((error) => {
1648
+ if (settled) return;
1649
+ settled = true;
1650
+ globalThis.clearTimeout(timeoutId);
1651
+ reject(error);
1652
+ });
1653
+ });
1654
+ }
1655
+ terminateAndReset(reason = new Error("Worker was terminated")) {
1656
+ this.workerReadyReject?.(reason);
1657
+ if (this.worker) {
1658
+ this.worker.terminate();
1659
+ this.worker = null;
1660
+ }
1661
+ this.initPromise = null;
1662
+ this.warmupPromises.clear();
1663
+ this.isInitializing = false;
1664
+ this.workerReadyPromise = null;
1665
+ this.workerReadyResolve = null;
1666
+ this.workerReadyReject = null;
1667
+ for (const [, pending] of this.pendingMessages) {
1668
+ if (pending.timeoutId) globalThis.clearTimeout(pending.timeoutId);
1669
+ pending.reject(reason);
1670
+ }
1671
+ this.pendingMessages.clear();
1672
+ }
1673
+ async init() {
1674
+ if (this.initPromise) return this.initPromise;
1675
+ if (this.isInitializing) {
1676
+ await new Promise((resolve) => globalThis.setTimeout(resolve, 100));
1677
+ return this.init();
1678
+ }
1679
+ this.isInitializing = true;
1680
+ this.initPromise = this.sendMessage("init", void 0, INIT_TIMEOUT_MS);
1681
+ try {
1682
+ return await this.initPromise;
1683
+ } catch (error) {
1684
+ this.initPromise = null;
1685
+ throw error;
1686
+ } finally {
1687
+ this.isInitializing = false;
1688
+ }
1689
+ }
1690
+ async warmup(language = "javascript") {
1691
+ const existing = this.warmupPromises.get(language);
1692
+ if (existing) return existing;
1693
+ const warmupPromise = (async () => {
1694
+ await this.init();
1695
+ return this.sendMessage(
1696
+ "warmup",
1697
+ { language },
1698
+ language === "typescript" ? TYPESCRIPT_WARMUP_TIMEOUT_MS : INIT_TIMEOUT_MS
1699
+ );
1700
+ })();
1701
+ this.warmupPromises.set(language, warmupPromise);
1702
+ try {
1703
+ return await warmupPromise;
1704
+ } catch (error) {
1705
+ this.warmupPromises.delete(language);
1706
+ throw error;
1707
+ }
1708
+ }
1709
+ async executeWithTracing(code, functionName, inputs, options, executionStyle = "function", language = "javascript") {
1710
+ await this.init();
1711
+ return this.executeWithTimeout(
1712
+ () => this.sendMessage(
1713
+ "execute-with-tracing",
1714
+ {
1715
+ code,
1716
+ functionName,
1717
+ inputs,
1718
+ options,
1719
+ executionStyle,
1720
+ language
1721
+ },
1722
+ TRACING_TIMEOUT_MS + 2e3
1723
+ ),
1724
+ TRACING_TIMEOUT_MS
1725
+ );
1726
+ }
1727
+ async executeCode(code, functionName, inputs, executionStyle = "function", language = "javascript") {
1728
+ await this.init();
1729
+ return this.executeWithTimeout(
1730
+ () => this.sendMessage(
1731
+ "execute-code",
1732
+ {
1733
+ code,
1734
+ functionName,
1735
+ inputs,
1736
+ executionStyle,
1737
+ language
1738
+ },
1739
+ EXECUTION_TIMEOUT_MS + 2e3
1740
+ ),
1741
+ EXECUTION_TIMEOUT_MS
1742
+ );
1743
+ }
1744
+ async executeCodeInterviewMode(code, functionName, inputs, executionStyle = "function", language = "javascript") {
1745
+ await this.init();
1746
+ try {
1747
+ const result = await this.executeWithTimeout(
1748
+ () => this.sendMessage(
1749
+ "execute-code-interview",
1750
+ {
1751
+ code,
1752
+ functionName,
1753
+ inputs,
1754
+ executionStyle,
1755
+ language
1756
+ },
1757
+ INTERVIEW_MODE_TIMEOUT_MS + 2e3
1758
+ ),
1759
+ INTERVIEW_MODE_TIMEOUT_MS
1760
+ );
1761
+ if (!result.success && result.error) {
1762
+ const normalized = result.error.toLowerCase();
1763
+ const isTimeoutOrResourceLimit = normalized.includes("timed out") || normalized.includes("infinite loop") || normalized.includes("line-limit") || normalized.includes("single-line-limit") || normalized.includes("recursion-limit") || normalized.includes("trace-limit") || normalized.includes("line events") || normalized.includes("trace steps") || normalized.includes("call depth");
1764
+ if (isTimeoutOrResourceLimit) {
1765
+ return {
1766
+ success: false,
1767
+ output: null,
1768
+ error: "Time Limit Exceeded",
1769
+ consoleOutput: result.consoleOutput ?? []
1770
+ };
1771
+ }
1772
+ }
1773
+ return result;
1774
+ } catch {
1775
+ return {
1776
+ success: false,
1777
+ output: null,
1778
+ error: "Time Limit Exceeded",
1779
+ consoleOutput: []
1780
+ };
1781
+ }
1782
+ }
1783
+ terminate() {
1784
+ this.terminateAndReset();
1785
+ }
1786
+ };
747
1787
  export {
1788
+ JavaScriptWorkerClient,
748
1789
  TYPESCRIPT_RUNTIME_DECLARATIONS,
1790
+ createJavaScriptRuntimeClient,
749
1791
  executeJavaScriptCode,
750
1792
  executeJavaScriptWithTracing,
751
1793
  executeTypeScriptCode,