@tracecode/harness 0.6.6 → 0.7.0-beta7

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 +6147 -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 +880 -0
  84. package/workers/java/java-worker.js +2149 -178
  85. package/workers/java/src/harness/browser/JavaRewriteLibrary.java +1645 -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 +1406 -0
  91. package/workers/javascript/javascript-libraries-entry.js +71 -0
  92. package/workers/javascript/javascript-worker.js +2054 -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
package/dist/csharp.js ADDED
@@ -0,0 +1,984 @@
1
+ // packages/harness-browser/src/runtime-capability-guards.ts
2
+ function isScriptRequest(functionName) {
3
+ if (functionName == null) return true;
4
+ return functionName.trim().length === 0;
5
+ }
6
+ function executionStyleLabel(executionStyle) {
7
+ if (executionStyle === "solution-method") return "solution-method";
8
+ if (executionStyle === "ops-class") return "ops-class";
9
+ return "function";
10
+ }
11
+ function isExecutionStyleSupported(profile, executionStyle) {
12
+ const styles = profile.capabilities.execution.styles;
13
+ if (executionStyle === "solution-method") return styles.solutionMethod;
14
+ if (executionStyle === "ops-class") return styles.opsClass;
15
+ return styles.function;
16
+ }
17
+ function describeRequest(request) {
18
+ if (request === "trace") return "tracing";
19
+ if (request === "interview") return "interview execution";
20
+ return "execution";
21
+ }
22
+ function assertRuntimeRequestSupported(profile, options) {
23
+ if (options.request === "trace" && !profile.capabilities.tracing.supported) {
24
+ throw new Error(`Runtime "${profile.language}" does not support tracing.`);
25
+ }
26
+ if (options.request === "interview" && !profile.capabilities.execution.styles.interviewMode) {
27
+ throw new Error(`Runtime "${profile.language}" does not support interview execution.`);
28
+ }
29
+ if (!isExecutionStyleSupported(profile, options.executionStyle)) {
30
+ throw new Error(
31
+ `Runtime "${profile.language}" does not support execution style "${executionStyleLabel(options.executionStyle)}".`
32
+ );
33
+ }
34
+ if (isScriptRequest(options.functionName) && !profile.capabilities.execution.styles.script) {
35
+ throw new Error(`Runtime "${profile.language}" does not support script mode ${describeRequest(options.request)}.`);
36
+ }
37
+ }
38
+
39
+ // packages/harness-browser/src/runtime-profiles.ts
40
+ var PYTHON_RUNTIME_PROFILE = {
41
+ language: "python",
42
+ maturity: "stable",
43
+ capabilities: {
44
+ execution: {
45
+ styles: {
46
+ function: true,
47
+ solutionMethod: true,
48
+ opsClass: true,
49
+ script: true,
50
+ interviewMode: true
51
+ },
52
+ timeouts: {
53
+ clientTimeouts: true,
54
+ runtimeTimeouts: true
55
+ }
56
+ },
57
+ tracing: {
58
+ supported: true,
59
+ events: {
60
+ line: true,
61
+ call: true,
62
+ return: true,
63
+ exception: true,
64
+ stdout: true,
65
+ timeout: true
66
+ },
67
+ controls: {
68
+ maxTraceSteps: true,
69
+ maxLineEvents: true,
70
+ maxSingleLineHits: true,
71
+ maxStoredEvents: true,
72
+ minimalTrace: true
73
+ },
74
+ fidelity: {
75
+ preciseLineMapping: true,
76
+ stableFunctionNames: true,
77
+ callStack: true
78
+ }
79
+ },
80
+ diagnostics: {
81
+ compileErrors: false,
82
+ runtimeErrors: true,
83
+ mappedErrorLines: true,
84
+ stackTraces: false
85
+ },
86
+ structures: {
87
+ treeNodeRefs: true,
88
+ listNodeRefs: true,
89
+ mapSerialization: true,
90
+ setSerialization: true,
91
+ graphSerialization: true,
92
+ cycleReferences: true
93
+ }
94
+ }
95
+ };
96
+ var JAVASCRIPT_RUNTIME_PROFILE = {
97
+ language: "javascript",
98
+ maturity: "stable",
99
+ capabilities: {
100
+ execution: {
101
+ styles: {
102
+ function: true,
103
+ solutionMethod: true,
104
+ opsClass: true,
105
+ script: true,
106
+ interviewMode: true
107
+ },
108
+ timeouts: {
109
+ clientTimeouts: true,
110
+ runtimeTimeouts: false
111
+ }
112
+ },
113
+ tracing: {
114
+ supported: true,
115
+ events: {
116
+ line: true,
117
+ call: true,
118
+ return: true,
119
+ exception: true,
120
+ stdout: false,
121
+ timeout: true
122
+ },
123
+ controls: {
124
+ maxTraceSteps: true,
125
+ maxLineEvents: true,
126
+ maxSingleLineHits: true,
127
+ maxStoredEvents: true,
128
+ minimalTrace: true
129
+ },
130
+ fidelity: {
131
+ preciseLineMapping: true,
132
+ stableFunctionNames: true,
133
+ callStack: true
134
+ }
135
+ },
136
+ diagnostics: {
137
+ compileErrors: false,
138
+ runtimeErrors: true,
139
+ mappedErrorLines: false,
140
+ stackTraces: false
141
+ },
142
+ structures: {
143
+ treeNodeRefs: true,
144
+ listNodeRefs: true,
145
+ mapSerialization: true,
146
+ setSerialization: true,
147
+ graphSerialization: true,
148
+ cycleReferences: true
149
+ }
150
+ }
151
+ };
152
+ var TYPESCRIPT_RUNTIME_PROFILE = {
153
+ language: "typescript",
154
+ maturity: "stable",
155
+ capabilities: {
156
+ execution: {
157
+ styles: {
158
+ function: true,
159
+ solutionMethod: true,
160
+ opsClass: true,
161
+ script: true,
162
+ interviewMode: true
163
+ },
164
+ timeouts: {
165
+ clientTimeouts: true,
166
+ runtimeTimeouts: false
167
+ }
168
+ },
169
+ tracing: {
170
+ supported: true,
171
+ events: {
172
+ line: true,
173
+ call: true,
174
+ return: true,
175
+ exception: true,
176
+ stdout: false,
177
+ timeout: true
178
+ },
179
+ controls: {
180
+ maxTraceSteps: true,
181
+ maxLineEvents: true,
182
+ maxSingleLineHits: true,
183
+ maxStoredEvents: true,
184
+ minimalTrace: true
185
+ },
186
+ fidelity: {
187
+ preciseLineMapping: true,
188
+ stableFunctionNames: true,
189
+ callStack: true
190
+ }
191
+ },
192
+ diagnostics: {
193
+ compileErrors: true,
194
+ runtimeErrors: true,
195
+ mappedErrorLines: true,
196
+ stackTraces: false
197
+ },
198
+ structures: {
199
+ treeNodeRefs: true,
200
+ listNodeRefs: true,
201
+ mapSerialization: true,
202
+ setSerialization: true,
203
+ graphSerialization: true,
204
+ cycleReferences: true
205
+ }
206
+ }
207
+ };
208
+ var JAVA_RUNTIME_PROFILE = {
209
+ language: "java",
210
+ maturity: "experimental",
211
+ capabilities: {
212
+ execution: {
213
+ styles: {
214
+ function: true,
215
+ solutionMethod: true,
216
+ opsClass: true,
217
+ script: true,
218
+ interviewMode: true
219
+ },
220
+ timeouts: {
221
+ clientTimeouts: true,
222
+ runtimeTimeouts: true
223
+ }
224
+ },
225
+ tracing: {
226
+ supported: true,
227
+ events: {
228
+ line: true,
229
+ call: true,
230
+ return: true,
231
+ exception: true,
232
+ stdout: false,
233
+ timeout: true
234
+ },
235
+ controls: {
236
+ maxTraceSteps: true,
237
+ maxLineEvents: false,
238
+ maxSingleLineHits: false,
239
+ maxStoredEvents: true,
240
+ minimalTrace: false
241
+ },
242
+ fidelity: {
243
+ preciseLineMapping: true,
244
+ stableFunctionNames: true,
245
+ callStack: true
246
+ }
247
+ },
248
+ diagnostics: {
249
+ compileErrors: true,
250
+ runtimeErrors: true,
251
+ mappedErrorLines: false,
252
+ stackTraces: true
253
+ },
254
+ structures: {
255
+ treeNodeRefs: true,
256
+ listNodeRefs: true,
257
+ mapSerialization: true,
258
+ setSerialization: true,
259
+ graphSerialization: false,
260
+ cycleReferences: true
261
+ }
262
+ },
263
+ notes: [
264
+ "Java currently supports the browser-local Java 17 lane for function, solution-method, ops-class, and script-style execution.",
265
+ "Interview-mode Java reuses the same browser-local execution path and remains experimental.",
266
+ 'Script-style Java uses an empty function name with executionStyle="function" and reads the top-level result variable.'
267
+ ]
268
+ };
269
+ var CSHARP_RUNTIME_PROFILE = {
270
+ language: "csharp",
271
+ maturity: "experimental",
272
+ capabilities: {
273
+ execution: {
274
+ styles: {
275
+ function: true,
276
+ solutionMethod: true,
277
+ opsClass: true,
278
+ script: true,
279
+ interviewMode: true
280
+ },
281
+ timeouts: {
282
+ clientTimeouts: true,
283
+ runtimeTimeouts: true
284
+ }
285
+ },
286
+ tracing: {
287
+ supported: true,
288
+ events: {
289
+ line: true,
290
+ call: true,
291
+ return: true,
292
+ exception: true,
293
+ stdout: true,
294
+ timeout: true
295
+ },
296
+ controls: {
297
+ maxTraceSteps: true,
298
+ maxLineEvents: true,
299
+ maxSingleLineHits: true,
300
+ maxStoredEvents: true,
301
+ minimalTrace: true
302
+ },
303
+ fidelity: {
304
+ preciseLineMapping: true,
305
+ stableFunctionNames: true,
306
+ callStack: true
307
+ }
308
+ },
309
+ diagnostics: {
310
+ compileErrors: true,
311
+ runtimeErrors: true,
312
+ mappedErrorLines: true,
313
+ stackTraces: false
314
+ },
315
+ structures: {
316
+ treeNodeRefs: true,
317
+ listNodeRefs: true,
318
+ mapSerialization: true,
319
+ setSerialization: true,
320
+ graphSerialization: true,
321
+ cycleReferences: true
322
+ }
323
+ },
324
+ notes: [
325
+ "C# support is browser-local and experimental.",
326
+ "C# supports named function-style requests where the browser-local host can bind the named method.",
327
+ 'Script-style C# uses an empty function name with executionStyle="function" and reads the top-level result variable.',
328
+ "Interview-mode C# uses the same browser-local worker execution path with interview timeout normalization.",
329
+ "The first C# slice supports public class Solution methods.",
330
+ "ListNode and TreeNode inputs are hydrated from level-order arrays or object-shaped JSON.",
331
+ "Dictionary, HashSet, List, and array return values serialize through the browser-local worker.",
332
+ "Tracing currently supports line, call, return, stdout, and simple local variable write events.",
333
+ "Structural visualization is added after execution and diagnostics are proven."
334
+ ]
335
+ };
336
+ var CPP_RUNTIME_PROFILE = {
337
+ language: "cpp",
338
+ maturity: "experimental",
339
+ capabilities: {
340
+ execution: {
341
+ styles: {
342
+ function: true,
343
+ solutionMethod: true,
344
+ opsClass: true,
345
+ script: true,
346
+ interviewMode: true
347
+ },
348
+ timeouts: {
349
+ clientTimeouts: true,
350
+ runtimeTimeouts: true
351
+ }
352
+ },
353
+ tracing: {
354
+ supported: true,
355
+ events: {
356
+ line: true,
357
+ call: true,
358
+ return: true,
359
+ exception: true,
360
+ stdout: true,
361
+ timeout: true
362
+ },
363
+ controls: {
364
+ maxTraceSteps: true,
365
+ maxLineEvents: true,
366
+ maxSingleLineHits: true,
367
+ maxStoredEvents: true,
368
+ minimalTrace: true
369
+ },
370
+ fidelity: {
371
+ preciseLineMapping: true,
372
+ stableFunctionNames: true,
373
+ callStack: true
374
+ }
375
+ },
376
+ diagnostics: {
377
+ compileErrors: true,
378
+ runtimeErrors: true,
379
+ mappedErrorLines: true,
380
+ stackTraces: false
381
+ },
382
+ structures: {
383
+ treeNodeRefs: true,
384
+ listNodeRefs: true,
385
+ mapSerialization: true,
386
+ setSerialization: true,
387
+ graphSerialization: true,
388
+ cycleReferences: true
389
+ }
390
+ },
391
+ notes: [
392
+ "C++ uses a focused browser-local Clang/LLD/WASI compiler lane with TraceCode-owned execution glue.",
393
+ "The runtime intentionally does not depend on a generic multi-language container/runtime SDK.",
394
+ 'Script-style C++ uses an empty function name with executionStyle="function"; the snippet must assign a serializable result variable.',
395
+ "Interview-mode C++ reuses the tracing compiler path with a trace budget and returns a non-trace execution result."
396
+ ]
397
+ };
398
+ var LANGUAGE_RUNTIME_PROFILES = {
399
+ python: PYTHON_RUNTIME_PROFILE,
400
+ javascript: JAVASCRIPT_RUNTIME_PROFILE,
401
+ typescript: TYPESCRIPT_RUNTIME_PROFILE,
402
+ java: JAVA_RUNTIME_PROFILE,
403
+ csharp: CSHARP_RUNTIME_PROFILE,
404
+ cpp: CPP_RUNTIME_PROFILE
405
+ };
406
+ var SUPPORTED_LANGUAGES = Object.freeze(
407
+ Object.keys(LANGUAGE_RUNTIME_PROFILES)
408
+ );
409
+ function getLanguageRuntimeProfile(language) {
410
+ const profile = LANGUAGE_RUNTIME_PROFILES[language];
411
+ if (!profile) {
412
+ throw new Error(`Runtime profile for language "${language}" is not implemented yet.`);
413
+ }
414
+ return profile;
415
+ }
416
+
417
+ // packages/harness-browser/src/csharp-runtime-client.ts
418
+ var CSharpRuntimeClient = class {
419
+ constructor(workerClient) {
420
+ this.workerClient = workerClient;
421
+ }
422
+ async init() {
423
+ return this.workerClient.init();
424
+ }
425
+ async executeWithTracing(code, functionName, inputs, options, executionStyle = "solution-method") {
426
+ assertRuntimeRequestSupported(getLanguageRuntimeProfile("csharp"), {
427
+ request: "trace",
428
+ executionStyle,
429
+ functionName
430
+ });
431
+ return this.workerClient.executeWithTracing(
432
+ code,
433
+ functionName ?? "",
434
+ inputs,
435
+ options,
436
+ executionStyle
437
+ );
438
+ }
439
+ async executeCode(code, functionName, inputs, executionStyle = "solution-method") {
440
+ assertRuntimeRequestSupported(getLanguageRuntimeProfile("csharp"), {
441
+ request: "execute",
442
+ executionStyle,
443
+ functionName
444
+ });
445
+ return this.workerClient.executeCode(
446
+ code,
447
+ functionName,
448
+ inputs,
449
+ executionStyle
450
+ );
451
+ }
452
+ async executeCodeInterviewMode(code, functionName, inputs, executionStyle = "solution-method") {
453
+ assertRuntimeRequestSupported(getLanguageRuntimeProfile("csharp"), {
454
+ request: "interview",
455
+ executionStyle,
456
+ functionName
457
+ });
458
+ return this.workerClient.executeCodeInterviewMode(
459
+ code,
460
+ functionName,
461
+ inputs,
462
+ executionStyle
463
+ );
464
+ }
465
+ };
466
+ function createCSharpRuntimeClient(workerClient) {
467
+ return new CSharpRuntimeClient(workerClient);
468
+ }
469
+
470
+ // packages/harness-core/src/runtime-trace.ts
471
+ var RUNTIME_TRACE_SCHEMA_VERSION = "runtime-trace-2026-04-28";
472
+
473
+ // packages/harness-browser/src/runtime-diagnostics.ts
474
+ var CONSOLE_METHOD_BY_LEVEL = {
475
+ debug: "debug",
476
+ info: "info",
477
+ warn: "warn",
478
+ error: "error"
479
+ };
480
+ function runtimeDiagnosticEvent(params) {
481
+ return {
482
+ schema: "tracecode.runtime-diagnostic.v1",
483
+ source: "harness",
484
+ ...params
485
+ };
486
+ }
487
+ function logRuntimeDiagnostic(level, params, options = {}) {
488
+ if (options.enabled === false && level !== "error") {
489
+ return;
490
+ }
491
+ const method = CONSOLE_METHOD_BY_LEVEL[level] ?? "info";
492
+ console[method]("[TraceRuntime]", runtimeDiagnosticEvent(params));
493
+ }
494
+
495
+ // packages/harness-browser/src/csharp-worker-client.ts
496
+ var EXECUTION_TIMEOUT_MS = 2e4;
497
+ var TRACING_TIMEOUT_MS = 2e4;
498
+ var INTERVIEW_MODE_TIMEOUT_MS = 5e3;
499
+ var INIT_TIMEOUT_MS = 45e3;
500
+ var MESSAGE_TIMEOUT_MS = 3e4;
501
+ var WORKER_READY_TIMEOUT_MS = 1e4;
502
+ var CSHARP_DEFAULT_FILE = "solution.cs";
503
+ var CSHARP_LEGACY_USER_FILE = "UserCode.cs";
504
+ function isCSharpUserFile(file) {
505
+ return Boolean(file?.endsWith(CSHARP_DEFAULT_FILE) || file?.endsWith(CSHARP_LEGACY_USER_FILE));
506
+ }
507
+ function isCSharpUserDiagnostic(diagnostic) {
508
+ return isCSharpUserFile(diagnostic.file);
509
+ }
510
+ function normalizeCSharpTraceEventFile(event) {
511
+ return isCSharpUserFile(event.file) ? { ...event, file: CSHARP_DEFAULT_FILE } : event;
512
+ }
513
+ var CSharpWorkerClient = class {
514
+ constructor(options) {
515
+ this.options = options;
516
+ this.debug = options.debug ?? process.env.NODE_ENV === "development";
517
+ this.initTimeoutMs = options.initTimeoutMs ?? INIT_TIMEOUT_MS;
518
+ this.executionTimeoutMs = options.executionTimeoutMs ?? EXECUTION_TIMEOUT_MS;
519
+ this.tracingTimeoutMs = options.tracingTimeoutMs ?? TRACING_TIMEOUT_MS;
520
+ this.interviewTimeoutMs = options.interviewTimeoutMs ?? INTERVIEW_MODE_TIMEOUT_MS;
521
+ }
522
+ worker = null;
523
+ pendingMessages = /* @__PURE__ */ new Map();
524
+ messageId = 0;
525
+ isInitializing = false;
526
+ initPromise = null;
527
+ warmupPromise = null;
528
+ workerReadyPromise = null;
529
+ workerReadyResolve = null;
530
+ workerReadyReject = null;
531
+ debug;
532
+ initTimeoutMs;
533
+ executionTimeoutMs;
534
+ tracingTimeoutMs;
535
+ interviewTimeoutMs;
536
+ isSupported() {
537
+ return typeof Worker !== "undefined";
538
+ }
539
+ getWorker() {
540
+ if (this.worker) return this.worker;
541
+ if (!this.isSupported()) {
542
+ throw new Error("Web Workers are not supported in this environment");
543
+ }
544
+ this.workerReadyPromise = new Promise((resolve, reject) => {
545
+ this.workerReadyResolve = resolve;
546
+ this.workerReadyReject = (error) => reject(error);
547
+ });
548
+ const workerUrl = this.debug && !this.options.workerUrl.includes("?") ? `${this.options.workerUrl}?dev=${Date.now()}` : this.options.workerUrl;
549
+ this.worker = new Worker(workerUrl, { type: "module" });
550
+ this.worker.onmessage = (event) => {
551
+ const { id, type, payload } = event.data;
552
+ if (type === "worker-ready") {
553
+ this.workerReadyResolve?.();
554
+ this.workerReadyResolve = null;
555
+ this.workerReadyReject = null;
556
+ logRuntimeDiagnostic("info", {
557
+ component: "CSharpWorkerClient",
558
+ runtime: "csharp",
559
+ phase: "worker-ready",
560
+ message: "C# worker is ready."
561
+ }, { enabled: this.debug });
562
+ return;
563
+ }
564
+ if (type === "idle-timeout") {
565
+ logRuntimeDiagnostic("info", {
566
+ component: "CSharpWorkerClient",
567
+ runtime: "csharp",
568
+ phase: "idle-timeout",
569
+ message: "C# worker closed after idle timeout."
570
+ }, { enabled: this.debug });
571
+ this.terminateAndReset(new Error("C# worker closed after idle timeout"));
572
+ return;
573
+ }
574
+ if (!id) return;
575
+ const pending = this.pendingMessages.get(id);
576
+ if (!pending) return;
577
+ this.pendingMessages.delete(id);
578
+ if (pending.timeoutId) globalThis.clearTimeout(pending.timeoutId);
579
+ if (type === "error") {
580
+ pending.reject(new Error(payload.error));
581
+ return;
582
+ }
583
+ pending.resolve(payload);
584
+ };
585
+ this.worker.onerror = (error) => {
586
+ logRuntimeDiagnostic("error", {
587
+ component: "CSharpWorkerClient",
588
+ runtime: "csharp",
589
+ phase: "worker-error",
590
+ message: "C# worker emitted an error event.",
591
+ detail: {
592
+ message: error.message,
593
+ filename: error.filename,
594
+ lineno: error.lineno,
595
+ colno: error.colno
596
+ }
597
+ });
598
+ const workerError = new Error(error.message || "C# worker error");
599
+ this.workerReadyReject?.(workerError);
600
+ this.workerReadyResolve = null;
601
+ this.workerReadyReject = null;
602
+ for (const [, pending] of this.pendingMessages) {
603
+ if (pending.timeoutId) globalThis.clearTimeout(pending.timeoutId);
604
+ pending.reject(workerError);
605
+ }
606
+ this.pendingMessages.clear();
607
+ this.terminateAndReset(workerError);
608
+ };
609
+ return this.worker;
610
+ }
611
+ async waitForWorkerReady() {
612
+ const readyPromise = this.workerReadyPromise;
613
+ if (!readyPromise) return;
614
+ await new Promise((resolve, reject) => {
615
+ let settled = false;
616
+ const timeoutId = globalThis.setTimeout(() => {
617
+ if (settled) return;
618
+ settled = true;
619
+ const timeoutError = new Error(
620
+ `C# worker failed to initialize in time (${Math.round(WORKER_READY_TIMEOUT_MS / 1e3)}s)`
621
+ );
622
+ logRuntimeDiagnostic("warn", {
623
+ component: "CSharpWorkerClient",
624
+ runtime: "csharp",
625
+ phase: "worker-ready-timeout",
626
+ message: "C# worker did not send worker-ready before the timeout.",
627
+ detail: { timeoutMs: WORKER_READY_TIMEOUT_MS }
628
+ }, { enabled: this.debug });
629
+ this.terminateAndReset(timeoutError);
630
+ reject(timeoutError);
631
+ }, WORKER_READY_TIMEOUT_MS);
632
+ readyPromise.then(() => {
633
+ if (settled) return;
634
+ settled = true;
635
+ globalThis.clearTimeout(timeoutId);
636
+ resolve();
637
+ }).catch((error) => {
638
+ if (settled) return;
639
+ settled = true;
640
+ globalThis.clearTimeout(timeoutId);
641
+ reject(error instanceof Error ? error : new Error(String(error)));
642
+ });
643
+ });
644
+ }
645
+ async sendMessage(type, payload, timeoutMs = MESSAGE_TIMEOUT_MS) {
646
+ const worker = this.getWorker();
647
+ await this.waitForWorkerReady();
648
+ const id = String(++this.messageId);
649
+ return new Promise((resolve, reject) => {
650
+ this.pendingMessages.set(id, {
651
+ resolve,
652
+ reject
653
+ });
654
+ const timeoutId = globalThis.setTimeout(() => {
655
+ const pending2 = this.pendingMessages.get(id);
656
+ if (!pending2) return;
657
+ this.pendingMessages.delete(id);
658
+ logRuntimeDiagnostic("warn", {
659
+ component: "CSharpWorkerClient",
660
+ runtime: "csharp",
661
+ phase: "worker-request-timeout",
662
+ message: "C# worker request timed out.",
663
+ detail: { id, type, timeoutMs }
664
+ }, { enabled: this.debug });
665
+ pending2.reject(new Error(`Worker request timed out: ${type}`));
666
+ }, timeoutMs);
667
+ const pending = this.pendingMessages.get(id);
668
+ if (pending) pending.timeoutId = timeoutId;
669
+ worker.postMessage({ id, type, payload });
670
+ });
671
+ }
672
+ async executeWithTimeout(executor, timeoutMs) {
673
+ return new Promise((resolve, reject) => {
674
+ let settled = false;
675
+ const timeoutId = globalThis.setTimeout(() => {
676
+ if (settled) return;
677
+ settled = true;
678
+ logRuntimeDiagnostic("warn", {
679
+ component: "CSharpWorkerClient",
680
+ runtime: "csharp",
681
+ phase: "execution-timeout",
682
+ message: "C# execution timed out; terminating worker.",
683
+ detail: { timeoutMs }
684
+ }, { enabled: this.debug });
685
+ this.terminateAndReset();
686
+ reject(new Error(`C# execution timed out after ${Math.round(timeoutMs / 1e3)} seconds.`));
687
+ }, timeoutMs);
688
+ executor().then((result) => {
689
+ if (settled) return;
690
+ settled = true;
691
+ globalThis.clearTimeout(timeoutId);
692
+ resolve(result);
693
+ }).catch((error) => {
694
+ if (settled) return;
695
+ settled = true;
696
+ globalThis.clearTimeout(timeoutId);
697
+ reject(error);
698
+ });
699
+ });
700
+ }
701
+ terminateAndReset(reason = new Error("Worker was terminated")) {
702
+ this.workerReadyReject?.(reason);
703
+ if (this.worker) {
704
+ this.worker.terminate();
705
+ this.worker = null;
706
+ }
707
+ this.initPromise = null;
708
+ this.warmupPromise = null;
709
+ this.isInitializing = false;
710
+ this.workerReadyPromise = null;
711
+ this.workerReadyResolve = null;
712
+ this.workerReadyReject = null;
713
+ for (const [, pending] of this.pendingMessages) {
714
+ if (pending.timeoutId) globalThis.clearTimeout(pending.timeoutId);
715
+ pending.reject(reason);
716
+ }
717
+ this.pendingMessages.clear();
718
+ }
719
+ shouldRetryInit(error) {
720
+ const message = error instanceof Error ? error.message : String(error);
721
+ return message.includes("timed out") || message.includes("Worker request timed out") || message.includes("worker error") || message.includes("Failed to fetch") || message.includes("was terminated") || message.includes("closed after idle timeout");
722
+ }
723
+ sendInitMessage() {
724
+ return this.sendMessage(
725
+ "init",
726
+ { assetBaseUrl: this.options.assetBaseUrl, ...this.workerOptionsPayload() },
727
+ this.initTimeoutMs
728
+ );
729
+ }
730
+ workerOptionsPayload() {
731
+ return this.options.workerIdleTimeoutMs === void 0 ? {} : { idleTimeoutMs: this.options.workerIdleTimeoutMs };
732
+ }
733
+ async init() {
734
+ if (this.initPromise) return this.initPromise;
735
+ if (this.isInitializing) {
736
+ await new Promise((resolve) => globalThis.setTimeout(resolve, 100));
737
+ return this.init();
738
+ }
739
+ this.isInitializing = true;
740
+ this.initPromise = (async () => {
741
+ try {
742
+ return await this.sendInitMessage();
743
+ } catch (error) {
744
+ if (!this.shouldRetryInit(error)) throw error;
745
+ this.terminateAndReset(error instanceof Error ? error : new Error(String(error)));
746
+ return this.sendInitMessage();
747
+ }
748
+ })();
749
+ try {
750
+ return await this.initPromise;
751
+ } catch (error) {
752
+ this.initPromise = null;
753
+ throw error;
754
+ } finally {
755
+ this.isInitializing = false;
756
+ }
757
+ }
758
+ async warmup() {
759
+ if (this.warmupPromise) return this.warmupPromise;
760
+ this.warmupPromise = (async () => {
761
+ try {
762
+ await this.init();
763
+ return await this.sendMessage(
764
+ "warmup",
765
+ { assetBaseUrl: this.options.assetBaseUrl, ...this.workerOptionsPayload() },
766
+ this.initTimeoutMs
767
+ );
768
+ } catch (error) {
769
+ this.warmupPromise = null;
770
+ throw error;
771
+ }
772
+ })();
773
+ return this.warmupPromise;
774
+ }
775
+ async executeCode(code, functionName, inputs, executionStyle) {
776
+ await this.init();
777
+ const result = await this.executeWithTimeout(
778
+ () => this.sendMessage(
779
+ "execute-code",
780
+ {
781
+ code,
782
+ functionName,
783
+ inputs,
784
+ executionStyle,
785
+ assetBaseUrl: this.options.assetBaseUrl,
786
+ timeoutMs: Math.max(100, this.executionTimeoutMs - 1e3),
787
+ ...this.workerOptionsPayload()
788
+ },
789
+ this.executionTimeoutMs + 5e3
790
+ ),
791
+ this.executionTimeoutMs
792
+ );
793
+ if (!result.success) {
794
+ const firstUserDiagnostic = result.diagnostics?.find(isCSharpUserDiagnostic);
795
+ return {
796
+ success: false,
797
+ output: null,
798
+ error: result.error ?? "C# execution failed",
799
+ ...firstUserDiagnostic ? { errorLine: firstUserDiagnostic.line } : {},
800
+ consoleOutput: result.consoleOutput ?? [],
801
+ timings: result.timings
802
+ };
803
+ }
804
+ return {
805
+ success: true,
806
+ output: result.output,
807
+ consoleOutput: result.consoleOutput ?? [],
808
+ timings: result.timings
809
+ };
810
+ }
811
+ async executeCodeInterviewMode(code, functionName, inputs, executionStyle) {
812
+ await this.init();
813
+ let result;
814
+ try {
815
+ result = await this.executeWithTimeout(
816
+ () => this.sendMessage(
817
+ "execute-code-interview",
818
+ {
819
+ code,
820
+ functionName,
821
+ inputs,
822
+ executionStyle,
823
+ assetBaseUrl: this.options.assetBaseUrl,
824
+ timeoutMs: Math.max(100, this.interviewTimeoutMs - 1e3),
825
+ ...this.workerOptionsPayload()
826
+ },
827
+ this.interviewTimeoutMs + 5e3
828
+ ),
829
+ this.interviewTimeoutMs
830
+ );
831
+ } catch {
832
+ return {
833
+ success: false,
834
+ output: null,
835
+ error: "Time Limit Exceeded",
836
+ timeoutReason: "client-timeout",
837
+ diagnosticStage: "interview",
838
+ consoleOutput: [],
839
+ timings: { totalMs: this.interviewTimeoutMs }
840
+ };
841
+ }
842
+ if (!result.success) {
843
+ const firstUserDiagnostic = result.diagnostics?.find(isCSharpUserDiagnostic);
844
+ if (this.isInterviewTimeoutLike(result)) {
845
+ return {
846
+ success: false,
847
+ output: null,
848
+ error: "Time Limit Exceeded",
849
+ timeoutReason: result.timeoutReason ?? "client-timeout",
850
+ diagnosticStage: "interview",
851
+ consoleOutput: result.consoleOutput ?? [],
852
+ timings: result.timings
853
+ };
854
+ }
855
+ return {
856
+ success: false,
857
+ output: null,
858
+ error: result.error ?? "C# execution failed",
859
+ ...firstUserDiagnostic ? { errorLine: firstUserDiagnostic.line } : {},
860
+ consoleOutput: result.consoleOutput ?? [],
861
+ timings: result.timings
862
+ };
863
+ }
864
+ return {
865
+ success: true,
866
+ output: result.output,
867
+ consoleOutput: result.consoleOutput ?? [],
868
+ timings: result.timings
869
+ };
870
+ }
871
+ async executeWithTracing(code, functionName, inputs, options, executionStyle) {
872
+ await this.init();
873
+ let result;
874
+ try {
875
+ result = await this.executeWithTimeout(
876
+ () => this.sendMessage(
877
+ "execute-with-tracing",
878
+ {
879
+ code,
880
+ functionName,
881
+ inputs,
882
+ executionStyle,
883
+ assetBaseUrl: this.options.assetBaseUrl,
884
+ timeoutMs: Math.max(100, this.tracingTimeoutMs - 1e3),
885
+ maxTraceSteps: options?.maxTraceSteps,
886
+ maxLineEvents: options?.maxLineEvents,
887
+ maxSingleLineHits: options?.maxSingleLineHits,
888
+ maxStoredEvents: options?.maxStoredEvents,
889
+ minimalTrace: options?.minimalTrace,
890
+ ...this.workerOptionsPayload()
891
+ },
892
+ this.tracingTimeoutMs + 5e3
893
+ ),
894
+ this.tracingTimeoutMs
895
+ );
896
+ } catch (error) {
897
+ const message = error instanceof Error ? error.message : String(error);
898
+ const trace2 = this.createTrace([
899
+ {
900
+ kind: "timeout",
901
+ runId: "csharp:run",
902
+ file: CSHARP_DEFAULT_FILE,
903
+ message
904
+ }
905
+ ]);
906
+ return {
907
+ success: false,
908
+ output: null,
909
+ error: message,
910
+ trace: trace2,
911
+ executionTimeMs: this.tracingTimeoutMs,
912
+ consoleOutput: [],
913
+ traceLimitExceeded: true,
914
+ timeoutReason: "client-timeout",
915
+ lineEventCount: trace2.lineEventCount,
916
+ traceStepCount: trace2.traceStepCount,
917
+ timings: { totalMs: this.tracingTimeoutMs }
918
+ };
919
+ }
920
+ const consoleOutput = result.consoleOutput ?? [];
921
+ const events = [
922
+ ...result.events ?? [],
923
+ ...consoleOutput.map((text) => ({
924
+ kind: "stdout",
925
+ runId: "csharp:run",
926
+ file: CSHARP_DEFAULT_FILE,
927
+ text
928
+ }))
929
+ ];
930
+ const trace = this.createTrace(events);
931
+ if (!result.success) {
932
+ const firstUserDiagnostic = result.diagnostics?.find(isCSharpUserDiagnostic);
933
+ return {
934
+ success: false,
935
+ output: null,
936
+ error: result.error ?? "C# execution failed",
937
+ ...firstUserDiagnostic ? { errorLine: firstUserDiagnostic.line } : {},
938
+ trace,
939
+ executionTimeMs: result.executionTimeMs ?? 0,
940
+ consoleOutput,
941
+ ...result.traceLimitExceeded !== void 0 ? { traceLimitExceeded: result.traceLimitExceeded } : {},
942
+ ...result.timeoutReason ? { timeoutReason: result.timeoutReason } : {},
943
+ lineEventCount: trace.lineEventCount,
944
+ traceStepCount: trace.traceStepCount,
945
+ timings: result.timings
946
+ };
947
+ }
948
+ return {
949
+ success: true,
950
+ output: result.output,
951
+ trace,
952
+ executionTimeMs: result.executionTimeMs ?? 0,
953
+ consoleOutput,
954
+ ...result.traceLimitExceeded !== void 0 ? { traceLimitExceeded: result.traceLimitExceeded } : {},
955
+ ...result.timeoutReason ? { timeoutReason: result.timeoutReason } : {},
956
+ lineEventCount: trace.lineEventCount,
957
+ traceStepCount: trace.traceStepCount,
958
+ timings: result.timings
959
+ };
960
+ }
961
+ createTrace(events) {
962
+ return {
963
+ schemaVersion: RUNTIME_TRACE_SCHEMA_VERSION,
964
+ language: "csharp",
965
+ runId: "csharp:run",
966
+ events: events.map(normalizeCSharpTraceEventFile),
967
+ lineEventCount: events.filter((event) => event.kind === "line").length,
968
+ traceStepCount: events.length
969
+ };
970
+ }
971
+ isInterviewTimeoutLike(result) {
972
+ if (result.timeoutReason) return true;
973
+ const normalized = String(result.error ?? "").toLowerCase();
974
+ return normalized.includes("timed out") || normalized.includes("trace-limit") || normalized.includes("line-limit") || normalized.includes("single-line-limit") || normalized.includes("recursion-limit") || normalized.includes("memory-limit");
975
+ }
976
+ terminate() {
977
+ this.terminateAndReset();
978
+ }
979
+ };
980
+ export {
981
+ CSharpWorkerClient,
982
+ createCSharpRuntimeClient
983
+ };
984
+ //# sourceMappingURL=csharp.js.map