@tracecode/harness 0.6.5 → 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.
- package/CHANGELOG.md +55 -0
- package/README.md +134 -15
- package/THIRD_PARTY_NOTICES.md +170 -0
- package/dist/browser.cjs +2361 -1033
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +33 -3
- package/dist/browser.d.ts +33 -3
- package/dist/browser.js +2357 -1033
- package/dist/browser.js.map +1 -1
- package/dist/cli.cjs +160 -23
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +161 -24
- package/dist/cli.js.map +1 -1
- package/dist/core.cjs +748 -867
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +21 -85
- package/dist/core.d.ts +21 -85
- package/dist/core.js +734 -855
- package/dist/core.js.map +1 -1
- package/dist/cpp-worker-client-Bn7kC0_L.d.ts +84 -0
- package/dist/cpp-worker-client-BzdJLuZa.d.cts +84 -0
- package/dist/cpp.cjs +1063 -0
- package/dist/cpp.cjs.map +1 -0
- package/dist/cpp.d.cts +7 -0
- package/dist/cpp.d.ts +7 -0
- package/dist/cpp.js +1035 -0
- package/dist/cpp.js.map +1 -0
- package/dist/csharp-worker-client-DMHIa2YG.d.cts +69 -0
- package/dist/csharp-worker-client-JwqS6LiX.d.ts +69 -0
- package/dist/csharp.cjs +1012 -0
- package/dist/csharp.cjs.map +1 -0
- package/dist/csharp.d.cts +7 -0
- package/dist/csharp.d.ts +7 -0
- package/dist/csharp.js +984 -0
- package/dist/csharp.js.map +1 -0
- package/dist/index.cjs +3142 -1160
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.js +3117 -1148
- package/dist/index.js.map +1 -1
- package/dist/internal/browser.cjs +1639 -30
- package/dist/internal/browser.cjs.map +1 -1
- package/dist/internal/browser.d.cts +6 -199
- package/dist/internal/browser.d.ts +6 -199
- package/dist/internal/browser.js +1636 -30
- package/dist/internal/browser.js.map +1 -1
- package/dist/java-worker-client-BOwKW-11.d.cts +72 -0
- package/dist/java-worker-client-C97DDnCp.d.ts +72 -0
- package/dist/java.cjs +1225 -0
- package/dist/java.cjs.map +1 -0
- package/dist/java.d.cts +7 -0
- package/dist/java.d.ts +7 -0
- package/dist/java.js +1197 -0
- package/dist/java.js.map +1 -0
- package/dist/javascript-worker-client-CYBGEEvc.d.cts +51 -0
- package/dist/javascript-worker-client-DIX1Mp21.d.ts +51 -0
- package/dist/javascript.cjs +1063 -19
- package/dist/javascript.cjs.map +1 -1
- package/dist/javascript.d.cts +7 -4
- package/dist/javascript.d.ts +7 -4
- package/dist/javascript.js +1061 -19
- package/dist/javascript.js.map +1 -1
- package/dist/pyodide-worker-client-C-2rfHj9.d.ts +111 -0
- package/dist/pyodide-worker-client-Cn0a8Uv3.d.cts +111 -0
- package/dist/python.cjs +1282 -74
- package/dist/python.cjs.map +1 -1
- package/dist/python.d.cts +20 -14
- package/dist/python.d.ts +20 -14
- package/dist/python.js +1279 -74
- package/dist/python.js.map +1 -1
- package/dist/runtime-language-info-BFUSti3-.d.ts +43 -0
- package/dist/runtime-language-info-Bxza1cI2.d.cts +43 -0
- package/dist/runtime-types-2qM0MukN.d.cts +244 -0
- package/dist/runtime-types-2qM0MukN.d.ts +244 -0
- package/package.json +73 -8
- package/workers/cpp/cpp-compiler-frame.html +82 -0
- package/workers/cpp/cpp-compiler-worker.js +131 -0
- package/workers/cpp/cpp-worker.js +5790 -0
- package/workers/cpp/tracecode_runtime.hpp +6147 -0
- package/workers/csharp/csharp-worker.js +301 -0
- package/workers/java/.build/classes/harness/browser/JavaRewriteLibrary.class +0 -0
- package/workers/java/java-source-augmentations.js +880 -0
- package/workers/java/java-worker.js +2256 -170
- package/workers/java/src/harness/browser/JavaRewriteLibrary.java +1645 -32
- package/workers/java/src/javafx/util/Pair.java +42 -0
- package/workers/java/src/tracecode/browser/BrowserCompileAndTraceLibrary.java +714 -0
- package/workers/java/src/tracecode/browser/BrowserCompileAndTraceMain.java +76 -0
- package/workers/java/src/tracecode/browser/RuntimeProbeMain.java +14 -0
- package/workers/java/src/tracecode/user/TraceHooks.java +1406 -0
- package/workers/javascript/javascript-libraries-entry.js +71 -0
- package/workers/javascript/javascript-worker.js +2054 -424
- package/workers/python/generated-python-harness-snippets.js +4 -4
- package/workers/python/pyodide-worker.js +222 -61
- package/workers/python/runtime-core.js +1387 -301
- package/workers/vendor/csharp/.stamp +0 -0
- package/workers/vendor/csharp/TraceCode.CSharpHost.runtimeconfig.json +32 -0
- package/workers/vendor/csharp/_framework/Microsoft.CSharp.wasm +0 -0
- package/workers/vendor/csharp/_framework/Microsoft.CodeAnalysis.CSharp.wasm +0 -0
- package/workers/vendor/csharp/_framework/Microsoft.CodeAnalysis.wasm +0 -0
- package/workers/vendor/csharp/_framework/Microsoft.VisualBasic.Core.wasm +0 -0
- package/workers/vendor/csharp/_framework/Microsoft.VisualBasic.wasm +0 -0
- package/workers/vendor/csharp/_framework/Microsoft.Win32.Primitives.wasm +0 -0
- package/workers/vendor/csharp/_framework/Microsoft.Win32.Registry.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.AppContext.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Buffers.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Collections.Concurrent.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Collections.Immutable.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Collections.NonGeneric.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Collections.Specialized.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Collections.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.ComponentModel.Annotations.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.ComponentModel.DataAnnotations.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.ComponentModel.EventBasedAsync.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.ComponentModel.Primitives.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.ComponentModel.TypeConverter.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.ComponentModel.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Configuration.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Console.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Core.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Data.Common.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Data.DataSetExtensions.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Data.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Diagnostics.Contracts.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Diagnostics.Debug.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Diagnostics.DiagnosticSource.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Diagnostics.FileVersionInfo.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Diagnostics.Process.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Diagnostics.StackTrace.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Diagnostics.TextWriterTraceListener.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Diagnostics.Tools.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Diagnostics.TraceSource.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Diagnostics.Tracing.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Drawing.Primitives.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Drawing.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Dynamic.Runtime.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Formats.Asn1.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Formats.Tar.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Globalization.Calendars.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Globalization.Extensions.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Globalization.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.IO.Compression.Brotli.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.IO.Compression.FileSystem.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.IO.Compression.ZipFile.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.IO.Compression.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.IO.FileSystem.AccessControl.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.IO.FileSystem.DriveInfo.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.IO.FileSystem.Primitives.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.IO.FileSystem.Watcher.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.IO.FileSystem.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.IO.IsolatedStorage.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.IO.MemoryMappedFiles.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.IO.Pipelines.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.IO.Pipes.AccessControl.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.IO.Pipes.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.IO.UnmanagedMemoryStream.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.IO.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Linq.AsyncEnumerable.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Linq.Expressions.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Linq.Parallel.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Linq.Queryable.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Linq.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Memory.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.Http.Json.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.Http.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.HttpListener.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.Mail.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.NameResolution.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.NetworkInformation.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.Ping.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.Primitives.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.Quic.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.Requests.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.Security.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.ServerSentEvents.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.ServicePoint.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.Sockets.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.WebClient.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.WebHeaderCollection.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.WebProxy.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.WebSockets.Client.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.WebSockets.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Net.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Numerics.Vectors.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Numerics.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.ObjectModel.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Private.CoreLib.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Private.DataContractSerialization.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Private.Uri.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Private.Xml.Linq.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Private.Xml.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Reflection.DispatchProxy.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Reflection.Emit.ILGeneration.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Reflection.Emit.Lightweight.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Reflection.Emit.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Reflection.Extensions.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Reflection.Metadata.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Reflection.Primitives.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Reflection.TypeExtensions.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Reflection.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Resources.Reader.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Resources.ResourceManager.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Resources.Writer.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Runtime.CompilerServices.Unsafe.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Runtime.CompilerServices.VisualC.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Runtime.Extensions.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Runtime.Handles.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Runtime.InteropServices.JavaScript.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Runtime.InteropServices.RuntimeInformation.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Runtime.InteropServices.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Runtime.Intrinsics.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Runtime.Loader.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Runtime.Numerics.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Runtime.Serialization.Formatters.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Runtime.Serialization.Json.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Runtime.Serialization.Primitives.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Runtime.Serialization.Xml.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Runtime.Serialization.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Runtime.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Security.AccessControl.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Security.Claims.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Security.Cryptography.Algorithms.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Security.Cryptography.Cng.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Security.Cryptography.Csp.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Security.Cryptography.Encoding.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Security.Cryptography.OpenSsl.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Security.Cryptography.Primitives.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Security.Cryptography.X509Certificates.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Security.Cryptography.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Security.Principal.Windows.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Security.Principal.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Security.SecureString.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Security.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.ServiceModel.Web.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.ServiceProcess.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Text.Encoding.CodePages.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Text.Encoding.Extensions.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Text.Encoding.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Text.Encodings.Web.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Text.Json.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Text.RegularExpressions.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Threading.AccessControl.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Threading.Channels.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Threading.Overlapped.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Threading.Tasks.Dataflow.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Threading.Tasks.Extensions.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Threading.Tasks.Parallel.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Threading.Tasks.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Threading.Thread.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Threading.ThreadPool.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Threading.Timer.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Threading.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Transactions.Local.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Transactions.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.ValueTuple.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Web.HttpUtility.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Web.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Windows.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Xml.Linq.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Xml.ReaderWriter.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Xml.Serialization.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Xml.XDocument.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Xml.XPath.XDocument.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Xml.XPath.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Xml.XmlDocument.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Xml.XmlSerializer.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.Xml.wasm +0 -0
- package/workers/vendor/csharp/_framework/System.wasm +0 -0
- package/workers/vendor/csharp/_framework/TraceCode.CSharpHost.wasm +0 -0
- package/workers/vendor/csharp/_framework/WindowsBase.wasm +0 -0
- package/workers/vendor/csharp/_framework/cs/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/cs/Microsoft.CodeAnalysis.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/de/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/de/Microsoft.CodeAnalysis.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/dotnet.boot.js +1958 -0
- package/workers/vendor/csharp/_framework/dotnet.js +4 -0
- package/workers/vendor/csharp/_framework/dotnet.js.map +1 -0
- package/workers/vendor/csharp/_framework/dotnet.native.js +6687 -0
- package/workers/vendor/csharp/_framework/dotnet.native.wasm +0 -0
- package/workers/vendor/csharp/_framework/dotnet.runtime.js +4 -0
- package/workers/vendor/csharp/_framework/dotnet.runtime.js.map +1 -0
- package/workers/vendor/csharp/_framework/es/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/es/Microsoft.CodeAnalysis.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/fr/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/fr/Microsoft.CodeAnalysis.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/it/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/it/Microsoft.CodeAnalysis.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/ja/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/ja/Microsoft.CodeAnalysis.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/ko/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/ko/Microsoft.CodeAnalysis.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/mscorlib.wasm +0 -0
- package/workers/vendor/csharp/_framework/netstandard.wasm +0 -0
- package/workers/vendor/csharp/_framework/pl/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/pl/Microsoft.CodeAnalysis.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/pt-BR/Microsoft.CodeAnalysis.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/ru/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/ru/Microsoft.CodeAnalysis.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/0_Microsoft.CodeAnalysis.CSharp.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/100_System.Reflection.Emit.ILGeneration.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/101_System.Reflection.Emit.Lightweight.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/102_System.Reflection.Extensions.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/103_System.Reflection.Metadata.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/104_System.Reflection.Primitives.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/105_System.Reflection.TypeExtensions.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/106_System.Resources.Reader.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/107_System.Resources.ResourceManager.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/108_System.Resources.Writer.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/109_System.Runtime.CompilerServices.Unsafe.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/10_System.Buffers.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/110_System.Runtime.CompilerServices.VisualC.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/111_System.Runtime.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/112_System.Runtime.Extensions.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/113_System.Runtime.Handles.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/114_System.Runtime.InteropServices.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/115_System.Runtime.InteropServices.JavaScript.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/116_System.Runtime.InteropServices.RuntimeInformation.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/117_System.Runtime.Intrinsics.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/118_System.Runtime.Loader.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/119_System.Runtime.Numerics.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/11_System.Collections.Concurrent.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/120_System.Runtime.Serialization.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/121_System.Runtime.Serialization.Formatters.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/122_System.Runtime.Serialization.Json.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/123_System.Runtime.Serialization.Primitives.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/124_System.Runtime.Serialization.Xml.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/125_System.Security.AccessControl.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/126_System.Security.Claims.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/127_System.Security.Cryptography.Algorithms.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/128_System.Security.Cryptography.Cng.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/129_System.Security.Cryptography.Csp.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/12_System.Collections.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/130_System.Security.Cryptography.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/131_System.Security.Cryptography.Encoding.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/132_System.Security.Cryptography.OpenSsl.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/133_System.Security.Cryptography.Primitives.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/134_System.Security.Cryptography.X509Certificates.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/135_System.Security.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/136_System.Security.Principal.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/137_System.Security.Principal.Windows.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/138_System.Security.SecureString.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/139_System.ServiceModel.Web.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/13_System.Collections.Immutable.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/140_System.ServiceProcess.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/141_System.Text.Encoding.CodePages.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/142_System.Text.Encoding.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/143_System.Text.Encoding.Extensions.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/144_System.Text.Encodings.Web.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/145_System.Text.Json.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/146_System.Text.RegularExpressions.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/147_System.Threading.AccessControl.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/148_System.Threading.Channels.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/149_System.Threading.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/14_System.Collections.NonGeneric.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/150_System.Threading.Overlapped.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/151_System.Threading.Tasks.Dataflow.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/152_System.Threading.Tasks.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/153_System.Threading.Tasks.Extensions.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/154_System.Threading.Tasks.Parallel.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/155_System.Threading.Thread.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/156_System.Threading.ThreadPool.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/157_System.Threading.Timer.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/158_System.Transactions.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/159_System.Transactions.Local.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/15_System.Collections.Specialized.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/160_System.ValueTuple.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/161_System.Web.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/162_System.Web.HttpUtility.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/163_System.Windows.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/164_System.Xml.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/165_System.Xml.Linq.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/166_System.Xml.ReaderWriter.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/167_System.Xml.Serialization.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/168_System.Xml.XDocument.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/169_System.Xml.XmlDocument.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/16_System.ComponentModel.Annotations.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/170_System.Xml.XmlSerializer.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/171_System.Xml.XPath.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/172_System.Xml.XPath.XDocument.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/173_TraceCode.CSharpHost.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/174_WindowsBase.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/17_System.ComponentModel.DataAnnotations.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/18_System.ComponentModel.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/19_System.ComponentModel.EventBasedAsync.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/1_Microsoft.CodeAnalysis.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/20_System.ComponentModel.Primitives.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/21_System.ComponentModel.TypeConverter.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/22_System.Configuration.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/23_System.Console.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/24_System.Core.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/25_System.Data.Common.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/26_System.Data.DataSetExtensions.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/27_System.Data.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/28_System.Diagnostics.Contracts.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/29_System.Diagnostics.Debug.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/2_Microsoft.CSharp.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/30_System.Diagnostics.DiagnosticSource.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/31_System.Diagnostics.FileVersionInfo.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/32_System.Diagnostics.Process.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/33_System.Diagnostics.StackTrace.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/34_System.Diagnostics.TextWriterTraceListener.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/35_System.Diagnostics.Tools.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/36_System.Diagnostics.TraceSource.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/37_System.Diagnostics.Tracing.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/38_System.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/39_System.Drawing.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/3_Microsoft.VisualBasic.Core.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/40_System.Drawing.Primitives.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/41_System.Dynamic.Runtime.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/42_System.Formats.Asn1.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/43_System.Formats.Tar.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/44_System.Globalization.Calendars.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/45_System.Globalization.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/46_System.Globalization.Extensions.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/47_System.IO.Compression.Brotli.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/48_System.IO.Compression.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/49_System.IO.Compression.FileSystem.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/4_Microsoft.VisualBasic.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/50_System.IO.Compression.ZipFile.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/51_System.IO.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/52_System.IO.FileSystem.AccessControl.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/53_System.IO.FileSystem.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/54_System.IO.FileSystem.DriveInfo.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/55_System.IO.FileSystem.Primitives.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/56_System.IO.FileSystem.Watcher.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/57_System.IO.IsolatedStorage.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/58_System.IO.MemoryMappedFiles.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/59_System.IO.Pipelines.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/5_Microsoft.Win32.Primitives.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/60_System.IO.Pipes.AccessControl.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/61_System.IO.Pipes.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/62_System.IO.UnmanagedMemoryStream.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/63_System.Linq.AsyncEnumerable.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/64_System.Linq.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/65_System.Linq.Expressions.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/66_System.Linq.Parallel.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/67_System.Linq.Queryable.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/68_System.Memory.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/69_System.Net.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/6_Microsoft.Win32.Registry.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/70_System.Net.Http.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/71_System.Net.Http.Json.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/72_System.Net.HttpListener.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/73_System.Net.Mail.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/74_System.Net.NameResolution.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/75_System.Net.NetworkInformation.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/76_System.Net.Ping.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/77_System.Net.Primitives.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/78_System.Net.Quic.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/79_System.Net.Requests.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/7_mscorlib.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/80_System.Net.Security.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/81_System.Net.ServerSentEvents.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/82_System.Net.ServicePoint.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/83_System.Net.Sockets.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/84_System.Net.WebClient.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/85_System.Net.WebHeaderCollection.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/86_System.Net.WebProxy.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/87_System.Net.WebSockets.Client.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/88_System.Net.WebSockets.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/89_System.Numerics.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/8_netstandard.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/90_System.Numerics.Vectors.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/91_System.ObjectModel.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/92_System.Private.CoreLib.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/93_System.Private.DataContractSerialization.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/94_System.Private.Uri.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/95_System.Private.Xml.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/96_System.Private.Xml.Linq.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/97_System.Reflection.DispatchProxy.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/98_System.Reflection.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/99_System.Reflection.Emit.dll +0 -0
- package/workers/vendor/csharp/_framework/supportFiles/9_System.AppContext.dll +0 -0
- package/workers/vendor/csharp/_framework/tr/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/tr/Microsoft.CodeAnalysis.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/zh-Hans/Microsoft.CodeAnalysis.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.wasm +0 -0
- package/workers/vendor/csharp/_framework/zh-Hant/Microsoft.CodeAnalysis.resources.wasm +0 -0
- package/workers/vendor/csharp/main.mjs +5 -0
- package/workers/vendor/csharp/package.json +1 -0
- package/workers/vendor/java-browser-helper.jar +0 -0
- package/workers/vendor/java-rewriter.jar +0 -0
- package/workers/vendor/javascript-libraries.js +10106 -0
- package/dist/runtime-types-89nchXlY.d.cts +0 -89
- package/dist/runtime-types-CCQ-ZLc9.d.ts +0 -89
- package/dist/types-zyvpJKCi.d.cts +0 -100
- package/dist/types-zyvpJKCi.d.ts +0 -100
- package/workers/java/java-source-augmentations.cjs +0 -242
- package/workers/java/src/spike/user/TraceHooks.java +0 -619
- package/workers/vendor/java-browser-spike-helper.jar +0 -0
- package/workers/vendor/java-practice-rewriter.jar +0 -0
- package/workers/vendor/java-rewrite-bridge.jar +0 -0
package/dist/cpp.cjs
ADDED
|
@@ -0,0 +1,1063 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/harness-cpp/src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
CppWorkerClient: () => CppWorkerClient,
|
|
24
|
+
createCppRuntimeClient: () => createCppRuntimeClient
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(src_exports);
|
|
27
|
+
|
|
28
|
+
// packages/harness-browser/src/runtime-capability-guards.ts
|
|
29
|
+
function isScriptRequest(functionName) {
|
|
30
|
+
if (functionName == null) return true;
|
|
31
|
+
return functionName.trim().length === 0;
|
|
32
|
+
}
|
|
33
|
+
function executionStyleLabel(executionStyle) {
|
|
34
|
+
if (executionStyle === "solution-method") return "solution-method";
|
|
35
|
+
if (executionStyle === "ops-class") return "ops-class";
|
|
36
|
+
return "function";
|
|
37
|
+
}
|
|
38
|
+
function isExecutionStyleSupported(profile, executionStyle) {
|
|
39
|
+
const styles = profile.capabilities.execution.styles;
|
|
40
|
+
if (executionStyle === "solution-method") return styles.solutionMethod;
|
|
41
|
+
if (executionStyle === "ops-class") return styles.opsClass;
|
|
42
|
+
return styles.function;
|
|
43
|
+
}
|
|
44
|
+
function describeRequest(request) {
|
|
45
|
+
if (request === "trace") return "tracing";
|
|
46
|
+
if (request === "interview") return "interview execution";
|
|
47
|
+
return "execution";
|
|
48
|
+
}
|
|
49
|
+
function assertRuntimeRequestSupported(profile, options) {
|
|
50
|
+
if (options.request === "trace" && !profile.capabilities.tracing.supported) {
|
|
51
|
+
throw new Error(`Runtime "${profile.language}" does not support tracing.`);
|
|
52
|
+
}
|
|
53
|
+
if (options.request === "interview" && !profile.capabilities.execution.styles.interviewMode) {
|
|
54
|
+
throw new Error(`Runtime "${profile.language}" does not support interview execution.`);
|
|
55
|
+
}
|
|
56
|
+
if (!isExecutionStyleSupported(profile, options.executionStyle)) {
|
|
57
|
+
throw new Error(
|
|
58
|
+
`Runtime "${profile.language}" does not support execution style "${executionStyleLabel(options.executionStyle)}".`
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
if (isScriptRequest(options.functionName) && !profile.capabilities.execution.styles.script) {
|
|
62
|
+
throw new Error(`Runtime "${profile.language}" does not support script mode ${describeRequest(options.request)}.`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// packages/harness-browser/src/runtime-profiles.ts
|
|
67
|
+
var PYTHON_RUNTIME_PROFILE = {
|
|
68
|
+
language: "python",
|
|
69
|
+
maturity: "stable",
|
|
70
|
+
capabilities: {
|
|
71
|
+
execution: {
|
|
72
|
+
styles: {
|
|
73
|
+
function: true,
|
|
74
|
+
solutionMethod: true,
|
|
75
|
+
opsClass: true,
|
|
76
|
+
script: true,
|
|
77
|
+
interviewMode: true
|
|
78
|
+
},
|
|
79
|
+
timeouts: {
|
|
80
|
+
clientTimeouts: true,
|
|
81
|
+
runtimeTimeouts: true
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
tracing: {
|
|
85
|
+
supported: true,
|
|
86
|
+
events: {
|
|
87
|
+
line: true,
|
|
88
|
+
call: true,
|
|
89
|
+
return: true,
|
|
90
|
+
exception: true,
|
|
91
|
+
stdout: true,
|
|
92
|
+
timeout: true
|
|
93
|
+
},
|
|
94
|
+
controls: {
|
|
95
|
+
maxTraceSteps: true,
|
|
96
|
+
maxLineEvents: true,
|
|
97
|
+
maxSingleLineHits: true,
|
|
98
|
+
maxStoredEvents: true,
|
|
99
|
+
minimalTrace: true
|
|
100
|
+
},
|
|
101
|
+
fidelity: {
|
|
102
|
+
preciseLineMapping: true,
|
|
103
|
+
stableFunctionNames: true,
|
|
104
|
+
callStack: true
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
diagnostics: {
|
|
108
|
+
compileErrors: false,
|
|
109
|
+
runtimeErrors: true,
|
|
110
|
+
mappedErrorLines: true,
|
|
111
|
+
stackTraces: false
|
|
112
|
+
},
|
|
113
|
+
structures: {
|
|
114
|
+
treeNodeRefs: true,
|
|
115
|
+
listNodeRefs: true,
|
|
116
|
+
mapSerialization: true,
|
|
117
|
+
setSerialization: true,
|
|
118
|
+
graphSerialization: true,
|
|
119
|
+
cycleReferences: true
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
var JAVASCRIPT_RUNTIME_PROFILE = {
|
|
124
|
+
language: "javascript",
|
|
125
|
+
maturity: "stable",
|
|
126
|
+
capabilities: {
|
|
127
|
+
execution: {
|
|
128
|
+
styles: {
|
|
129
|
+
function: true,
|
|
130
|
+
solutionMethod: true,
|
|
131
|
+
opsClass: true,
|
|
132
|
+
script: true,
|
|
133
|
+
interviewMode: true
|
|
134
|
+
},
|
|
135
|
+
timeouts: {
|
|
136
|
+
clientTimeouts: true,
|
|
137
|
+
runtimeTimeouts: false
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
tracing: {
|
|
141
|
+
supported: true,
|
|
142
|
+
events: {
|
|
143
|
+
line: true,
|
|
144
|
+
call: true,
|
|
145
|
+
return: true,
|
|
146
|
+
exception: true,
|
|
147
|
+
stdout: false,
|
|
148
|
+
timeout: true
|
|
149
|
+
},
|
|
150
|
+
controls: {
|
|
151
|
+
maxTraceSteps: true,
|
|
152
|
+
maxLineEvents: true,
|
|
153
|
+
maxSingleLineHits: true,
|
|
154
|
+
maxStoredEvents: true,
|
|
155
|
+
minimalTrace: true
|
|
156
|
+
},
|
|
157
|
+
fidelity: {
|
|
158
|
+
preciseLineMapping: true,
|
|
159
|
+
stableFunctionNames: true,
|
|
160
|
+
callStack: true
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
diagnostics: {
|
|
164
|
+
compileErrors: false,
|
|
165
|
+
runtimeErrors: true,
|
|
166
|
+
mappedErrorLines: false,
|
|
167
|
+
stackTraces: false
|
|
168
|
+
},
|
|
169
|
+
structures: {
|
|
170
|
+
treeNodeRefs: true,
|
|
171
|
+
listNodeRefs: true,
|
|
172
|
+
mapSerialization: true,
|
|
173
|
+
setSerialization: true,
|
|
174
|
+
graphSerialization: true,
|
|
175
|
+
cycleReferences: true
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
var TYPESCRIPT_RUNTIME_PROFILE = {
|
|
180
|
+
language: "typescript",
|
|
181
|
+
maturity: "stable",
|
|
182
|
+
capabilities: {
|
|
183
|
+
execution: {
|
|
184
|
+
styles: {
|
|
185
|
+
function: true,
|
|
186
|
+
solutionMethod: true,
|
|
187
|
+
opsClass: true,
|
|
188
|
+
script: true,
|
|
189
|
+
interviewMode: true
|
|
190
|
+
},
|
|
191
|
+
timeouts: {
|
|
192
|
+
clientTimeouts: true,
|
|
193
|
+
runtimeTimeouts: false
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
tracing: {
|
|
197
|
+
supported: true,
|
|
198
|
+
events: {
|
|
199
|
+
line: true,
|
|
200
|
+
call: true,
|
|
201
|
+
return: true,
|
|
202
|
+
exception: true,
|
|
203
|
+
stdout: false,
|
|
204
|
+
timeout: true
|
|
205
|
+
},
|
|
206
|
+
controls: {
|
|
207
|
+
maxTraceSteps: true,
|
|
208
|
+
maxLineEvents: true,
|
|
209
|
+
maxSingleLineHits: true,
|
|
210
|
+
maxStoredEvents: true,
|
|
211
|
+
minimalTrace: true
|
|
212
|
+
},
|
|
213
|
+
fidelity: {
|
|
214
|
+
preciseLineMapping: true,
|
|
215
|
+
stableFunctionNames: true,
|
|
216
|
+
callStack: true
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
diagnostics: {
|
|
220
|
+
compileErrors: true,
|
|
221
|
+
runtimeErrors: true,
|
|
222
|
+
mappedErrorLines: true,
|
|
223
|
+
stackTraces: false
|
|
224
|
+
},
|
|
225
|
+
structures: {
|
|
226
|
+
treeNodeRefs: true,
|
|
227
|
+
listNodeRefs: true,
|
|
228
|
+
mapSerialization: true,
|
|
229
|
+
setSerialization: true,
|
|
230
|
+
graphSerialization: true,
|
|
231
|
+
cycleReferences: true
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
var JAVA_RUNTIME_PROFILE = {
|
|
236
|
+
language: "java",
|
|
237
|
+
maturity: "experimental",
|
|
238
|
+
capabilities: {
|
|
239
|
+
execution: {
|
|
240
|
+
styles: {
|
|
241
|
+
function: true,
|
|
242
|
+
solutionMethod: true,
|
|
243
|
+
opsClass: true,
|
|
244
|
+
script: true,
|
|
245
|
+
interviewMode: true
|
|
246
|
+
},
|
|
247
|
+
timeouts: {
|
|
248
|
+
clientTimeouts: true,
|
|
249
|
+
runtimeTimeouts: true
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
tracing: {
|
|
253
|
+
supported: true,
|
|
254
|
+
events: {
|
|
255
|
+
line: true,
|
|
256
|
+
call: true,
|
|
257
|
+
return: true,
|
|
258
|
+
exception: true,
|
|
259
|
+
stdout: false,
|
|
260
|
+
timeout: true
|
|
261
|
+
},
|
|
262
|
+
controls: {
|
|
263
|
+
maxTraceSteps: true,
|
|
264
|
+
maxLineEvents: false,
|
|
265
|
+
maxSingleLineHits: false,
|
|
266
|
+
maxStoredEvents: true,
|
|
267
|
+
minimalTrace: false
|
|
268
|
+
},
|
|
269
|
+
fidelity: {
|
|
270
|
+
preciseLineMapping: true,
|
|
271
|
+
stableFunctionNames: true,
|
|
272
|
+
callStack: true
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
diagnostics: {
|
|
276
|
+
compileErrors: true,
|
|
277
|
+
runtimeErrors: true,
|
|
278
|
+
mappedErrorLines: false,
|
|
279
|
+
stackTraces: true
|
|
280
|
+
},
|
|
281
|
+
structures: {
|
|
282
|
+
treeNodeRefs: true,
|
|
283
|
+
listNodeRefs: true,
|
|
284
|
+
mapSerialization: true,
|
|
285
|
+
setSerialization: true,
|
|
286
|
+
graphSerialization: false,
|
|
287
|
+
cycleReferences: true
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
notes: [
|
|
291
|
+
"Java currently supports the browser-local Java 17 lane for function, solution-method, ops-class, and script-style execution.",
|
|
292
|
+
"Interview-mode Java reuses the same browser-local execution path and remains experimental.",
|
|
293
|
+
'Script-style Java uses an empty function name with executionStyle="function" and reads the top-level result variable.'
|
|
294
|
+
]
|
|
295
|
+
};
|
|
296
|
+
var CSHARP_RUNTIME_PROFILE = {
|
|
297
|
+
language: "csharp",
|
|
298
|
+
maturity: "experimental",
|
|
299
|
+
capabilities: {
|
|
300
|
+
execution: {
|
|
301
|
+
styles: {
|
|
302
|
+
function: true,
|
|
303
|
+
solutionMethod: true,
|
|
304
|
+
opsClass: true,
|
|
305
|
+
script: true,
|
|
306
|
+
interviewMode: true
|
|
307
|
+
},
|
|
308
|
+
timeouts: {
|
|
309
|
+
clientTimeouts: true,
|
|
310
|
+
runtimeTimeouts: true
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
tracing: {
|
|
314
|
+
supported: true,
|
|
315
|
+
events: {
|
|
316
|
+
line: true,
|
|
317
|
+
call: true,
|
|
318
|
+
return: true,
|
|
319
|
+
exception: true,
|
|
320
|
+
stdout: true,
|
|
321
|
+
timeout: true
|
|
322
|
+
},
|
|
323
|
+
controls: {
|
|
324
|
+
maxTraceSteps: true,
|
|
325
|
+
maxLineEvents: true,
|
|
326
|
+
maxSingleLineHits: true,
|
|
327
|
+
maxStoredEvents: true,
|
|
328
|
+
minimalTrace: true
|
|
329
|
+
},
|
|
330
|
+
fidelity: {
|
|
331
|
+
preciseLineMapping: true,
|
|
332
|
+
stableFunctionNames: true,
|
|
333
|
+
callStack: true
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
diagnostics: {
|
|
337
|
+
compileErrors: true,
|
|
338
|
+
runtimeErrors: true,
|
|
339
|
+
mappedErrorLines: true,
|
|
340
|
+
stackTraces: false
|
|
341
|
+
},
|
|
342
|
+
structures: {
|
|
343
|
+
treeNodeRefs: true,
|
|
344
|
+
listNodeRefs: true,
|
|
345
|
+
mapSerialization: true,
|
|
346
|
+
setSerialization: true,
|
|
347
|
+
graphSerialization: true,
|
|
348
|
+
cycleReferences: true
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
notes: [
|
|
352
|
+
"C# support is browser-local and experimental.",
|
|
353
|
+
"C# supports named function-style requests where the browser-local host can bind the named method.",
|
|
354
|
+
'Script-style C# uses an empty function name with executionStyle="function" and reads the top-level result variable.',
|
|
355
|
+
"Interview-mode C# uses the same browser-local worker execution path with interview timeout normalization.",
|
|
356
|
+
"The first C# slice supports public class Solution methods.",
|
|
357
|
+
"ListNode and TreeNode inputs are hydrated from level-order arrays or object-shaped JSON.",
|
|
358
|
+
"Dictionary, HashSet, List, and array return values serialize through the browser-local worker.",
|
|
359
|
+
"Tracing currently supports line, call, return, stdout, and simple local variable write events.",
|
|
360
|
+
"Structural visualization is added after execution and diagnostics are proven."
|
|
361
|
+
]
|
|
362
|
+
};
|
|
363
|
+
var CPP_RUNTIME_PROFILE = {
|
|
364
|
+
language: "cpp",
|
|
365
|
+
maturity: "experimental",
|
|
366
|
+
capabilities: {
|
|
367
|
+
execution: {
|
|
368
|
+
styles: {
|
|
369
|
+
function: true,
|
|
370
|
+
solutionMethod: true,
|
|
371
|
+
opsClass: true,
|
|
372
|
+
script: true,
|
|
373
|
+
interviewMode: true
|
|
374
|
+
},
|
|
375
|
+
timeouts: {
|
|
376
|
+
clientTimeouts: true,
|
|
377
|
+
runtimeTimeouts: true
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
tracing: {
|
|
381
|
+
supported: true,
|
|
382
|
+
events: {
|
|
383
|
+
line: true,
|
|
384
|
+
call: true,
|
|
385
|
+
return: true,
|
|
386
|
+
exception: true,
|
|
387
|
+
stdout: true,
|
|
388
|
+
timeout: true
|
|
389
|
+
},
|
|
390
|
+
controls: {
|
|
391
|
+
maxTraceSteps: true,
|
|
392
|
+
maxLineEvents: true,
|
|
393
|
+
maxSingleLineHits: true,
|
|
394
|
+
maxStoredEvents: true,
|
|
395
|
+
minimalTrace: true
|
|
396
|
+
},
|
|
397
|
+
fidelity: {
|
|
398
|
+
preciseLineMapping: true,
|
|
399
|
+
stableFunctionNames: true,
|
|
400
|
+
callStack: true
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
diagnostics: {
|
|
404
|
+
compileErrors: true,
|
|
405
|
+
runtimeErrors: true,
|
|
406
|
+
mappedErrorLines: true,
|
|
407
|
+
stackTraces: false
|
|
408
|
+
},
|
|
409
|
+
structures: {
|
|
410
|
+
treeNodeRefs: true,
|
|
411
|
+
listNodeRefs: true,
|
|
412
|
+
mapSerialization: true,
|
|
413
|
+
setSerialization: true,
|
|
414
|
+
graphSerialization: true,
|
|
415
|
+
cycleReferences: true
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
notes: [
|
|
419
|
+
"C++ uses a focused browser-local Clang/LLD/WASI compiler lane with TraceCode-owned execution glue.",
|
|
420
|
+
"The runtime intentionally does not depend on a generic multi-language container/runtime SDK.",
|
|
421
|
+
'Script-style C++ uses an empty function name with executionStyle="function"; the snippet must assign a serializable result variable.',
|
|
422
|
+
"Interview-mode C++ reuses the tracing compiler path with a trace budget and returns a non-trace execution result."
|
|
423
|
+
]
|
|
424
|
+
};
|
|
425
|
+
var LANGUAGE_RUNTIME_PROFILES = {
|
|
426
|
+
python: PYTHON_RUNTIME_PROFILE,
|
|
427
|
+
javascript: JAVASCRIPT_RUNTIME_PROFILE,
|
|
428
|
+
typescript: TYPESCRIPT_RUNTIME_PROFILE,
|
|
429
|
+
java: JAVA_RUNTIME_PROFILE,
|
|
430
|
+
csharp: CSHARP_RUNTIME_PROFILE,
|
|
431
|
+
cpp: CPP_RUNTIME_PROFILE
|
|
432
|
+
};
|
|
433
|
+
var SUPPORTED_LANGUAGES = Object.freeze(
|
|
434
|
+
Object.keys(LANGUAGE_RUNTIME_PROFILES)
|
|
435
|
+
);
|
|
436
|
+
function getLanguageRuntimeProfile(language) {
|
|
437
|
+
const profile = LANGUAGE_RUNTIME_PROFILES[language];
|
|
438
|
+
if (!profile) {
|
|
439
|
+
throw new Error(`Runtime profile for language "${language}" is not implemented yet.`);
|
|
440
|
+
}
|
|
441
|
+
return profile;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// packages/harness-browser/src/cpp-runtime-client.ts
|
|
445
|
+
var CppRuntimeClient = class {
|
|
446
|
+
constructor(workerClient) {
|
|
447
|
+
this.workerClient = workerClient;
|
|
448
|
+
}
|
|
449
|
+
async init() {
|
|
450
|
+
return this.workerClient.init();
|
|
451
|
+
}
|
|
452
|
+
async executeWithTracing(code, functionName, inputs, options, executionStyle = "solution-method") {
|
|
453
|
+
assertRuntimeRequestSupported(getLanguageRuntimeProfile("cpp"), {
|
|
454
|
+
request: "trace",
|
|
455
|
+
executionStyle,
|
|
456
|
+
functionName
|
|
457
|
+
});
|
|
458
|
+
return this.workerClient.executeWithTracing(
|
|
459
|
+
code,
|
|
460
|
+
functionName ?? "",
|
|
461
|
+
inputs,
|
|
462
|
+
options,
|
|
463
|
+
executionStyle
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
async executeCode(code, functionName, inputs, executionStyle = "solution-method") {
|
|
467
|
+
assertRuntimeRequestSupported(getLanguageRuntimeProfile("cpp"), {
|
|
468
|
+
request: "execute",
|
|
469
|
+
executionStyle,
|
|
470
|
+
functionName
|
|
471
|
+
});
|
|
472
|
+
return this.workerClient.executeCode(
|
|
473
|
+
code,
|
|
474
|
+
functionName,
|
|
475
|
+
inputs,
|
|
476
|
+
executionStyle
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
async executeCodeInterviewMode(code, functionName, inputs, executionStyle = "solution-method") {
|
|
480
|
+
assertRuntimeRequestSupported(getLanguageRuntimeProfile("cpp"), {
|
|
481
|
+
request: "interview",
|
|
482
|
+
executionStyle,
|
|
483
|
+
functionName
|
|
484
|
+
});
|
|
485
|
+
return this.workerClient.executeCodeInterviewMode(
|
|
486
|
+
code,
|
|
487
|
+
functionName,
|
|
488
|
+
inputs,
|
|
489
|
+
executionStyle
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
function createCppRuntimeClient(workerClient) {
|
|
494
|
+
return new CppRuntimeClient(workerClient);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// packages/harness-core/src/runtime-trace.ts
|
|
498
|
+
var RUNTIME_TRACE_SCHEMA_VERSION = "runtime-trace-2026-04-28";
|
|
499
|
+
function createEmptyRuntimeTrace(language, options = {}) {
|
|
500
|
+
return {
|
|
501
|
+
schemaVersion: RUNTIME_TRACE_SCHEMA_VERSION,
|
|
502
|
+
language,
|
|
503
|
+
runId: options.runId ?? `${language}:run`,
|
|
504
|
+
events: [],
|
|
505
|
+
lineEventCount: 0,
|
|
506
|
+
traceStepCount: 0
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
// packages/harness-browser/src/runtime-diagnostics.ts
|
|
511
|
+
var CONSOLE_METHOD_BY_LEVEL = {
|
|
512
|
+
debug: "debug",
|
|
513
|
+
info: "info",
|
|
514
|
+
warn: "warn",
|
|
515
|
+
error: "error"
|
|
516
|
+
};
|
|
517
|
+
function runtimeDiagnosticEvent(params) {
|
|
518
|
+
return {
|
|
519
|
+
schema: "tracecode.runtime-diagnostic.v1",
|
|
520
|
+
source: "harness",
|
|
521
|
+
...params
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
function logRuntimeDiagnostic(level, params, options = {}) {
|
|
525
|
+
if (options.enabled === false && level !== "error") {
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
const method = CONSOLE_METHOD_BY_LEVEL[level] ?? "info";
|
|
529
|
+
console[method]("[TraceRuntime]", runtimeDiagnosticEvent(params));
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// packages/harness-browser/src/cpp-worker-client.ts
|
|
533
|
+
var CppClientTimeoutError = class extends Error {
|
|
534
|
+
constructor(message, stage, timeoutMs) {
|
|
535
|
+
super(message);
|
|
536
|
+
this.stage = stage;
|
|
537
|
+
this.timeoutMs = timeoutMs;
|
|
538
|
+
this.name = "CppClientTimeoutError";
|
|
539
|
+
}
|
|
540
|
+
};
|
|
541
|
+
var INIT_TIMEOUT_MS = 12e4;
|
|
542
|
+
var EXECUTION_TIMEOUT_MS = 6e4;
|
|
543
|
+
var TRACING_TIMEOUT_MS = 6e4;
|
|
544
|
+
var INTERVIEW_MODE_TIMEOUT_MS = 3e4;
|
|
545
|
+
var MESSAGE_TIMEOUT_MS = 3e4;
|
|
546
|
+
var WORKER_READY_TIMEOUT_MS = 1e4;
|
|
547
|
+
var CPP_DEFAULT_FILE = "solution.cpp";
|
|
548
|
+
var CppWorkerClient = class {
|
|
549
|
+
constructor(options) {
|
|
550
|
+
this.options = options;
|
|
551
|
+
this.debug = options.debug ?? process.env.NODE_ENV === "development";
|
|
552
|
+
this.initTimeoutMs = options.initTimeoutMs ?? INIT_TIMEOUT_MS;
|
|
553
|
+
this.executionTimeoutMs = options.executionTimeoutMs ?? EXECUTION_TIMEOUT_MS;
|
|
554
|
+
this.tracingTimeoutMs = options.tracingTimeoutMs ?? TRACING_TIMEOUT_MS;
|
|
555
|
+
this.interviewTimeoutMs = options.interviewTimeoutMs ?? INTERVIEW_MODE_TIMEOUT_MS;
|
|
556
|
+
this.compilerFrameUrl = options.compilerFrameUrl;
|
|
557
|
+
}
|
|
558
|
+
worker = null;
|
|
559
|
+
pendingMessages = /* @__PURE__ */ new Map();
|
|
560
|
+
messageId = 0;
|
|
561
|
+
initPromise = null;
|
|
562
|
+
warmupPromise = null;
|
|
563
|
+
workerReadyPromise = null;
|
|
564
|
+
workerReadyResolve = null;
|
|
565
|
+
workerReadyReject = null;
|
|
566
|
+
debug;
|
|
567
|
+
initTimeoutMs;
|
|
568
|
+
executionTimeoutMs;
|
|
569
|
+
tracingTimeoutMs;
|
|
570
|
+
interviewTimeoutMs;
|
|
571
|
+
compilerFrameUrl;
|
|
572
|
+
activeCompilerFrames = /* @__PURE__ */ new Set();
|
|
573
|
+
compilerFrame = null;
|
|
574
|
+
compilerFrameReadyPromise = null;
|
|
575
|
+
compilerFrameReadyResolve = null;
|
|
576
|
+
compilerFrameReadyReject = null;
|
|
577
|
+
compilerFrameTargetOrigin = "";
|
|
578
|
+
compilerFrameRequestId = 0;
|
|
579
|
+
compilerFrameMessageHandler = null;
|
|
580
|
+
pendingCompilerFrameRequests = /* @__PURE__ */ new Map();
|
|
581
|
+
isSupported() {
|
|
582
|
+
return typeof Worker !== "undefined";
|
|
583
|
+
}
|
|
584
|
+
getWorker() {
|
|
585
|
+
if (this.worker) return this.worker;
|
|
586
|
+
if (!this.isSupported()) {
|
|
587
|
+
throw new Error("Web Workers are not supported in this environment");
|
|
588
|
+
}
|
|
589
|
+
this.workerReadyPromise = new Promise((resolve, reject) => {
|
|
590
|
+
this.workerReadyResolve = resolve;
|
|
591
|
+
this.workerReadyReject = (error) => reject(error);
|
|
592
|
+
});
|
|
593
|
+
const workerUrl = this.debug && !this.options.workerUrl.includes("?") ? `${this.options.workerUrl}?dev=${Date.now()}` : this.options.workerUrl;
|
|
594
|
+
this.worker = new Worker(workerUrl, { type: "module" });
|
|
595
|
+
this.worker.onmessage = (event) => {
|
|
596
|
+
const { id, type, payload } = event.data;
|
|
597
|
+
if (type === "worker-ready") {
|
|
598
|
+
this.workerReadyResolve?.();
|
|
599
|
+
this.workerReadyResolve = null;
|
|
600
|
+
this.workerReadyReject = null;
|
|
601
|
+
logRuntimeDiagnostic("info", {
|
|
602
|
+
component: "CppWorkerClient",
|
|
603
|
+
runtime: "cpp",
|
|
604
|
+
phase: "worker-ready",
|
|
605
|
+
message: "C++ worker is ready."
|
|
606
|
+
}, { enabled: this.debug });
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
if (type === "idle-timeout") {
|
|
610
|
+
logRuntimeDiagnostic("info", {
|
|
611
|
+
component: "CppWorkerClient",
|
|
612
|
+
runtime: "cpp",
|
|
613
|
+
phase: "idle-timeout",
|
|
614
|
+
message: "C++ worker closed after idle timeout."
|
|
615
|
+
}, { enabled: this.debug });
|
|
616
|
+
this.terminateAndReset(new Error("C++ worker closed after idle timeout"));
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
if (type === "compile-request") {
|
|
620
|
+
this.handleCompileRequest(event.data).catch((error) => {
|
|
621
|
+
if (!event.data.requestId) return;
|
|
622
|
+
this.worker?.postMessage({
|
|
623
|
+
type: "compile-response",
|
|
624
|
+
requestId: event.data.requestId,
|
|
625
|
+
payload: { success: false, error: error instanceof Error ? error.message : String(error) }
|
|
626
|
+
});
|
|
627
|
+
});
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
if (!id) return;
|
|
631
|
+
const pending = this.pendingMessages.get(id);
|
|
632
|
+
if (!pending) return;
|
|
633
|
+
this.pendingMessages.delete(id);
|
|
634
|
+
if (pending.timeoutId) globalThis.clearTimeout(pending.timeoutId);
|
|
635
|
+
if (type === "error") {
|
|
636
|
+
pending.reject(new Error(payload.error));
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
pending.resolve(payload);
|
|
640
|
+
};
|
|
641
|
+
this.worker.onerror = (error) => {
|
|
642
|
+
logRuntimeDiagnostic("error", {
|
|
643
|
+
component: "CppWorkerClient",
|
|
644
|
+
runtime: "cpp",
|
|
645
|
+
phase: "worker-error",
|
|
646
|
+
message: "C++ worker emitted an error event.",
|
|
647
|
+
detail: {
|
|
648
|
+
message: error.message,
|
|
649
|
+
filename: error.filename,
|
|
650
|
+
lineno: error.lineno,
|
|
651
|
+
colno: error.colno
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
const workerError = new Error(error.message || "C++ worker error");
|
|
655
|
+
this.workerReadyReject?.(workerError);
|
|
656
|
+
this.workerReadyResolve = null;
|
|
657
|
+
this.workerReadyReject = null;
|
|
658
|
+
this.terminateAndReset(workerError);
|
|
659
|
+
};
|
|
660
|
+
return this.worker;
|
|
661
|
+
}
|
|
662
|
+
async waitForWorkerReady() {
|
|
663
|
+
const readyPromise = this.workerReadyPromise;
|
|
664
|
+
if (!readyPromise) return;
|
|
665
|
+
await new Promise((resolve, reject) => {
|
|
666
|
+
let settled = false;
|
|
667
|
+
const timeoutId = globalThis.setTimeout(() => {
|
|
668
|
+
if (settled) return;
|
|
669
|
+
settled = true;
|
|
670
|
+
const timeoutError = new Error(
|
|
671
|
+
`C++ worker failed to initialize in time (${Math.round(WORKER_READY_TIMEOUT_MS / 1e3)}s)`
|
|
672
|
+
);
|
|
673
|
+
logRuntimeDiagnostic("warn", {
|
|
674
|
+
component: "CppWorkerClient",
|
|
675
|
+
runtime: "cpp",
|
|
676
|
+
phase: "worker-ready-timeout",
|
|
677
|
+
message: "C++ worker did not send worker-ready before the timeout.",
|
|
678
|
+
detail: { timeoutMs: WORKER_READY_TIMEOUT_MS }
|
|
679
|
+
}, { enabled: this.debug });
|
|
680
|
+
this.terminateAndReset(timeoutError);
|
|
681
|
+
reject(timeoutError);
|
|
682
|
+
}, WORKER_READY_TIMEOUT_MS);
|
|
683
|
+
readyPromise.then(() => {
|
|
684
|
+
if (settled) return;
|
|
685
|
+
settled = true;
|
|
686
|
+
globalThis.clearTimeout(timeoutId);
|
|
687
|
+
resolve();
|
|
688
|
+
}).catch((error) => {
|
|
689
|
+
if (settled) return;
|
|
690
|
+
settled = true;
|
|
691
|
+
globalThis.clearTimeout(timeoutId);
|
|
692
|
+
reject(error instanceof Error ? error : new Error(String(error)));
|
|
693
|
+
});
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
async sendMessage(type, payload, timeoutMs = MESSAGE_TIMEOUT_MS) {
|
|
697
|
+
const worker = this.getWorker();
|
|
698
|
+
await this.waitForWorkerReady();
|
|
699
|
+
const id = String(++this.messageId);
|
|
700
|
+
return new Promise((resolve, reject) => {
|
|
701
|
+
this.pendingMessages.set(id, {
|
|
702
|
+
resolve,
|
|
703
|
+
reject
|
|
704
|
+
});
|
|
705
|
+
const timeoutId = globalThis.setTimeout(() => {
|
|
706
|
+
const pending2 = this.pendingMessages.get(id);
|
|
707
|
+
if (!pending2) return;
|
|
708
|
+
this.pendingMessages.delete(id);
|
|
709
|
+
logRuntimeDiagnostic("warn", {
|
|
710
|
+
component: "CppWorkerClient",
|
|
711
|
+
runtime: "cpp",
|
|
712
|
+
phase: "worker-request-timeout",
|
|
713
|
+
message: "C++ worker request timed out.",
|
|
714
|
+
detail: { id, type, timeoutMs }
|
|
715
|
+
}, { enabled: this.debug });
|
|
716
|
+
pending2.reject(new Error(`Worker request timed out: ${type}`));
|
|
717
|
+
}, timeoutMs);
|
|
718
|
+
const pending = this.pendingMessages.get(id);
|
|
719
|
+
if (pending) pending.timeoutId = timeoutId;
|
|
720
|
+
worker.postMessage({ id, type, payload });
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
async executeWithTimeout(executor, timeoutMs, stage) {
|
|
724
|
+
return new Promise((resolve, reject) => {
|
|
725
|
+
let settled = false;
|
|
726
|
+
const timeoutId = globalThis.setTimeout(() => {
|
|
727
|
+
if (settled) return;
|
|
728
|
+
settled = true;
|
|
729
|
+
const timeoutLabel = stage === "trace" ? "tracing" : stage === "interview" ? "interview execution" : "compile/run";
|
|
730
|
+
const timeoutError = new CppClientTimeoutError(
|
|
731
|
+
`C++ ${timeoutLabel} timed out after ${Math.round(timeoutMs / 1e3)} seconds.`,
|
|
732
|
+
stage,
|
|
733
|
+
timeoutMs
|
|
734
|
+
);
|
|
735
|
+
logRuntimeDiagnostic("warn", {
|
|
736
|
+
component: "CppWorkerClient",
|
|
737
|
+
runtime: "cpp",
|
|
738
|
+
phase: "execution-timeout",
|
|
739
|
+
message: "C++ execution timed out; terminating worker.",
|
|
740
|
+
detail: { timeoutMs, stage }
|
|
741
|
+
}, { enabled: this.debug });
|
|
742
|
+
this.terminateAndReset(timeoutError);
|
|
743
|
+
reject(timeoutError);
|
|
744
|
+
}, timeoutMs);
|
|
745
|
+
executor().then((result) => {
|
|
746
|
+
if (settled) return;
|
|
747
|
+
settled = true;
|
|
748
|
+
globalThis.clearTimeout(timeoutId);
|
|
749
|
+
resolve(result);
|
|
750
|
+
}).catch((error) => {
|
|
751
|
+
if (settled) return;
|
|
752
|
+
settled = true;
|
|
753
|
+
globalThis.clearTimeout(timeoutId);
|
|
754
|
+
reject(error);
|
|
755
|
+
});
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
isClientTimeout(error) {
|
|
759
|
+
return error instanceof CppClientTimeoutError || error instanceof Error && error.message.includes("C++") && error.message.includes("timed out");
|
|
760
|
+
}
|
|
761
|
+
timeoutCodeResult(error) {
|
|
762
|
+
const timeoutError = error instanceof CppClientTimeoutError ? error : null;
|
|
763
|
+
return {
|
|
764
|
+
success: false,
|
|
765
|
+
output: null,
|
|
766
|
+
error: error instanceof Error ? error.message : String(error),
|
|
767
|
+
consoleOutput: [],
|
|
768
|
+
timeoutReason: "client-timeout",
|
|
769
|
+
diagnosticStage: timeoutError?.stage === "interview" ? "interview" : "runtime",
|
|
770
|
+
timings: { totalMs: timeoutError?.timeoutMs ?? this.executionTimeoutMs }
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
timeoutTraceResult(error) {
|
|
774
|
+
const timeoutError = error instanceof CppClientTimeoutError ? error : null;
|
|
775
|
+
const trace = createEmptyRuntimeTrace("cpp", { runId: "cpp:run", file: CPP_DEFAULT_FILE });
|
|
776
|
+
trace.events = [
|
|
777
|
+
{
|
|
778
|
+
kind: "timeout",
|
|
779
|
+
runId: "cpp:run",
|
|
780
|
+
file: CPP_DEFAULT_FILE,
|
|
781
|
+
message: error instanceof Error ? error.message : String(error)
|
|
782
|
+
}
|
|
783
|
+
];
|
|
784
|
+
trace.traceStepCount = 1;
|
|
785
|
+
return {
|
|
786
|
+
success: false,
|
|
787
|
+
output: null,
|
|
788
|
+
error: error instanceof Error ? error.message : String(error),
|
|
789
|
+
trace,
|
|
790
|
+
executionTimeMs: timeoutError?.timeoutMs ?? this.tracingTimeoutMs,
|
|
791
|
+
consoleOutput: [],
|
|
792
|
+
traceLimitExceeded: true,
|
|
793
|
+
timeoutReason: "client-timeout",
|
|
794
|
+
lineEventCount: 0,
|
|
795
|
+
traceStepCount: 1,
|
|
796
|
+
timings: { totalMs: timeoutError?.timeoutMs ?? this.tracingTimeoutMs }
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
terminateAndReset(reason = new Error("Worker was terminated")) {
|
|
800
|
+
this.workerReadyReject?.(reason);
|
|
801
|
+
if (this.worker) {
|
|
802
|
+
this.worker.terminate();
|
|
803
|
+
this.worker = null;
|
|
804
|
+
}
|
|
805
|
+
this.initPromise = null;
|
|
806
|
+
this.warmupPromise = null;
|
|
807
|
+
this.workerReadyPromise = null;
|
|
808
|
+
this.workerReadyResolve = null;
|
|
809
|
+
this.workerReadyReject = null;
|
|
810
|
+
for (const [, pending] of this.pendingMessages) {
|
|
811
|
+
if (pending.timeoutId) globalThis.clearTimeout(pending.timeoutId);
|
|
812
|
+
pending.reject(reason);
|
|
813
|
+
}
|
|
814
|
+
this.pendingMessages.clear();
|
|
815
|
+
this.clearCompilerFrames();
|
|
816
|
+
}
|
|
817
|
+
shouldRetryInit(error) {
|
|
818
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
819
|
+
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");
|
|
820
|
+
}
|
|
821
|
+
sendInitMessage() {
|
|
822
|
+
return this.sendMessage(
|
|
823
|
+
"init",
|
|
824
|
+
{
|
|
825
|
+
assets: {
|
|
826
|
+
clangWasmUrl: this.options.clangWasmUrl,
|
|
827
|
+
lldWasmUrl: this.options.lldWasmUrl,
|
|
828
|
+
sysrootUrl: this.options.sysrootUrl,
|
|
829
|
+
runtimeHeaderUrl: this.options.runtimeHeaderUrl,
|
|
830
|
+
compilerBundleUrl: this.options.compilerBundleUrl,
|
|
831
|
+
compilerFrameEnabled: Boolean(this.compilerFrameUrl && typeof document !== "undefined"),
|
|
832
|
+
compilerFrameUrl: this.compilerFrameUrl,
|
|
833
|
+
compilerWorkerUrl: this.options.compilerWorkerUrl
|
|
834
|
+
},
|
|
835
|
+
...this.workerOptionsPayload()
|
|
836
|
+
},
|
|
837
|
+
this.initTimeoutMs
|
|
838
|
+
);
|
|
839
|
+
}
|
|
840
|
+
async init() {
|
|
841
|
+
if (this.initPromise) return this.initPromise;
|
|
842
|
+
this.initPromise = (async () => {
|
|
843
|
+
try {
|
|
844
|
+
return await this.sendInitMessage();
|
|
845
|
+
} catch (error) {
|
|
846
|
+
if (!this.shouldRetryInit(error)) throw error;
|
|
847
|
+
this.terminateAndReset(error instanceof Error ? error : new Error(String(error)));
|
|
848
|
+
return this.sendInitMessage();
|
|
849
|
+
}
|
|
850
|
+
})();
|
|
851
|
+
try {
|
|
852
|
+
return await this.initPromise;
|
|
853
|
+
} catch (error) {
|
|
854
|
+
this.initPromise = null;
|
|
855
|
+
throw error;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
workerOptionsPayload() {
|
|
859
|
+
return this.options.workerIdleTimeoutMs === void 0 ? {} : { idleTimeoutMs: this.options.workerIdleTimeoutMs };
|
|
860
|
+
}
|
|
861
|
+
async warmup() {
|
|
862
|
+
if (this.warmupPromise) return this.warmupPromise;
|
|
863
|
+
this.warmupPromise = (async () => {
|
|
864
|
+
try {
|
|
865
|
+
await this.init();
|
|
866
|
+
return await this.sendMessage("warmup", this.workerOptionsPayload(), this.initTimeoutMs);
|
|
867
|
+
} catch (error) {
|
|
868
|
+
this.warmupPromise = null;
|
|
869
|
+
throw error;
|
|
870
|
+
}
|
|
871
|
+
})();
|
|
872
|
+
return this.warmupPromise;
|
|
873
|
+
}
|
|
874
|
+
clearCompilerFrames(reason = new Error("C++ compiler frame was closed")) {
|
|
875
|
+
this.compilerFrameReadyReject?.(reason);
|
|
876
|
+
this.compilerFrameReadyPromise = null;
|
|
877
|
+
this.compilerFrameReadyResolve = null;
|
|
878
|
+
this.compilerFrameReadyReject = null;
|
|
879
|
+
if (this.compilerFrameMessageHandler) {
|
|
880
|
+
globalThis.removeEventListener("message", this.compilerFrameMessageHandler);
|
|
881
|
+
this.compilerFrameMessageHandler = null;
|
|
882
|
+
}
|
|
883
|
+
for (const [, pending] of this.pendingCompilerFrameRequests) {
|
|
884
|
+
globalThis.clearTimeout(pending.timeoutId);
|
|
885
|
+
pending.resolve({ success: false, error: reason.message });
|
|
886
|
+
}
|
|
887
|
+
this.pendingCompilerFrameRequests.clear();
|
|
888
|
+
this.compilerFrame = null;
|
|
889
|
+
this.compilerFrameTargetOrigin = "";
|
|
890
|
+
for (const frame of this.activeCompilerFrames) {
|
|
891
|
+
frame.remove();
|
|
892
|
+
}
|
|
893
|
+
this.activeCompilerFrames.clear();
|
|
894
|
+
}
|
|
895
|
+
async handleCompileRequest(message) {
|
|
896
|
+
if (!message.requestId) return;
|
|
897
|
+
const worker = this.worker;
|
|
898
|
+
if (!worker) return;
|
|
899
|
+
const result = await this.compileInFrame(message.payload);
|
|
900
|
+
const transfer = result?.programBuffer instanceof ArrayBuffer ? [result.programBuffer] : [];
|
|
901
|
+
worker.postMessage(
|
|
902
|
+
{
|
|
903
|
+
type: "compile-response",
|
|
904
|
+
requestId: message.requestId,
|
|
905
|
+
payload: result
|
|
906
|
+
},
|
|
907
|
+
transfer
|
|
908
|
+
);
|
|
909
|
+
}
|
|
910
|
+
ensureCompilerFrame() {
|
|
911
|
+
if (!this.compilerFrameUrl || typeof document === "undefined") {
|
|
912
|
+
return Promise.reject(new Error("C++ compiler frame is not available."));
|
|
913
|
+
}
|
|
914
|
+
if (this.compilerFrame && this.compilerFrameReadyPromise) return this.compilerFrameReadyPromise;
|
|
915
|
+
const frameUrl = new URL(this.compilerFrameUrl, globalThis.location?.href);
|
|
916
|
+
this.compilerFrameTargetOrigin = frameUrl.origin;
|
|
917
|
+
const iframe = document.createElement("iframe");
|
|
918
|
+
iframe.src = frameUrl.href;
|
|
919
|
+
iframe.style.display = "none";
|
|
920
|
+
iframe.setAttribute("aria-hidden", "true");
|
|
921
|
+
this.compilerFrame = iframe;
|
|
922
|
+
this.activeCompilerFrames.add(iframe);
|
|
923
|
+
this.compilerFrameReadyPromise = new Promise((resolve, reject) => {
|
|
924
|
+
let settled = false;
|
|
925
|
+
let timeoutId;
|
|
926
|
+
const finishReady = () => {
|
|
927
|
+
if (settled) return;
|
|
928
|
+
settled = true;
|
|
929
|
+
globalThis.clearTimeout(timeoutId);
|
|
930
|
+
this.compilerFrameReadyResolve = null;
|
|
931
|
+
this.compilerFrameReadyReject = null;
|
|
932
|
+
resolve();
|
|
933
|
+
};
|
|
934
|
+
const onMessage = (event) => {
|
|
935
|
+
if (event.source !== iframe.contentWindow) return;
|
|
936
|
+
if (event.origin !== this.compilerFrameTargetOrigin) return;
|
|
937
|
+
if (event.data?.type === "frame-ready") {
|
|
938
|
+
finishReady();
|
|
939
|
+
return;
|
|
940
|
+
}
|
|
941
|
+
const requestId = event.data?.id;
|
|
942
|
+
if (!requestId) return;
|
|
943
|
+
const pending = this.pendingCompilerFrameRequests.get(requestId);
|
|
944
|
+
if (!pending) return;
|
|
945
|
+
this.pendingCompilerFrameRequests.delete(requestId);
|
|
946
|
+
globalThis.clearTimeout(pending.timeoutId);
|
|
947
|
+
const response = event.data;
|
|
948
|
+
pending.resolve(response.payload ?? { success: false, error: "C++ compiler frame returned an empty response." });
|
|
949
|
+
};
|
|
950
|
+
this.compilerFrameMessageHandler = onMessage;
|
|
951
|
+
timeoutId = globalThis.setTimeout(() => {
|
|
952
|
+
const error = new Error("C++ compiler frame request timed out.");
|
|
953
|
+
this.clearCompilerFrames(error);
|
|
954
|
+
reject(error);
|
|
955
|
+
}, this.initTimeoutMs);
|
|
956
|
+
this.compilerFrameReadyResolve = finishReady;
|
|
957
|
+
this.compilerFrameReadyReject = (error) => {
|
|
958
|
+
if (settled) return;
|
|
959
|
+
settled = true;
|
|
960
|
+
globalThis.clearTimeout(timeoutId);
|
|
961
|
+
reject(error);
|
|
962
|
+
};
|
|
963
|
+
globalThis.addEventListener("message", onMessage);
|
|
964
|
+
document.body.appendChild(iframe);
|
|
965
|
+
});
|
|
966
|
+
return this.compilerFrameReadyPromise;
|
|
967
|
+
}
|
|
968
|
+
async compileInFrame(payload) {
|
|
969
|
+
try {
|
|
970
|
+
await this.ensureCompilerFrame();
|
|
971
|
+
} catch (error) {
|
|
972
|
+
return { success: false, error: error instanceof Error ? error.message : String(error) };
|
|
973
|
+
}
|
|
974
|
+
const iframe = this.compilerFrame;
|
|
975
|
+
const frameWindow = iframe?.contentWindow;
|
|
976
|
+
if (!frameWindow) {
|
|
977
|
+
return { success: false, error: "C++ compiler frame is not available." };
|
|
978
|
+
}
|
|
979
|
+
return new Promise((resolve) => {
|
|
980
|
+
const requestId = `compile-${++this.compilerFrameRequestId}`;
|
|
981
|
+
const timeoutId = globalThis.setTimeout(() => {
|
|
982
|
+
this.pendingCompilerFrameRequests.delete(requestId);
|
|
983
|
+
resolve({ success: false, error: "C++ compiler frame request timed out." });
|
|
984
|
+
}, this.initTimeoutMs);
|
|
985
|
+
this.pendingCompilerFrameRequests.set(requestId, { resolve, timeoutId });
|
|
986
|
+
frameWindow.postMessage(
|
|
987
|
+
{
|
|
988
|
+
id: requestId,
|
|
989
|
+
type: "compile",
|
|
990
|
+
payload
|
|
991
|
+
},
|
|
992
|
+
this.compilerFrameTargetOrigin
|
|
993
|
+
);
|
|
994
|
+
});
|
|
995
|
+
}
|
|
996
|
+
async executeCode(code, functionName, inputs, executionStyle) {
|
|
997
|
+
await this.init();
|
|
998
|
+
try {
|
|
999
|
+
return await this.executeWithTimeout(
|
|
1000
|
+
() => this.sendMessage(
|
|
1001
|
+
"compile-run",
|
|
1002
|
+
{ code, functionName, inputs, executionStyle },
|
|
1003
|
+
this.executionTimeoutMs + 5e3
|
|
1004
|
+
),
|
|
1005
|
+
this.executionTimeoutMs,
|
|
1006
|
+
"compile-run"
|
|
1007
|
+
);
|
|
1008
|
+
} catch (error) {
|
|
1009
|
+
if (this.isClientTimeout(error)) return this.timeoutCodeResult(error);
|
|
1010
|
+
throw error;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
async executeWithTracing(code, functionName, inputs, options, executionStyle) {
|
|
1014
|
+
await this.init();
|
|
1015
|
+
try {
|
|
1016
|
+
return await this.executeWithTimeout(
|
|
1017
|
+
() => this.sendMessage(
|
|
1018
|
+
"execute-with-tracing",
|
|
1019
|
+
{ code, functionName, inputs, options, executionStyle },
|
|
1020
|
+
this.tracingTimeoutMs + 5e3
|
|
1021
|
+
),
|
|
1022
|
+
this.tracingTimeoutMs,
|
|
1023
|
+
"trace"
|
|
1024
|
+
);
|
|
1025
|
+
} catch (error) {
|
|
1026
|
+
if (this.isClientTimeout(error)) return this.timeoutTraceResult(error);
|
|
1027
|
+
throw error;
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
async executeCodeInterviewMode(code, functionName, inputs, executionStyle) {
|
|
1031
|
+
await this.init();
|
|
1032
|
+
try {
|
|
1033
|
+
return await this.executeWithTimeout(
|
|
1034
|
+
() => this.sendMessage(
|
|
1035
|
+
"execute-code-interview",
|
|
1036
|
+
{ code, functionName, inputs, executionStyle },
|
|
1037
|
+
this.interviewTimeoutMs + 5e3
|
|
1038
|
+
),
|
|
1039
|
+
this.interviewTimeoutMs,
|
|
1040
|
+
"interview"
|
|
1041
|
+
);
|
|
1042
|
+
} catch {
|
|
1043
|
+
return {
|
|
1044
|
+
success: false,
|
|
1045
|
+
output: null,
|
|
1046
|
+
error: "Time Limit Exceeded",
|
|
1047
|
+
timeoutReason: "client-timeout",
|
|
1048
|
+
diagnosticStage: "interview",
|
|
1049
|
+
consoleOutput: [],
|
|
1050
|
+
timings: { totalMs: this.interviewTimeoutMs }
|
|
1051
|
+
};
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
terminate() {
|
|
1055
|
+
this.terminateAndReset();
|
|
1056
|
+
}
|
|
1057
|
+
};
|
|
1058
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1059
|
+
0 && (module.exports = {
|
|
1060
|
+
CppWorkerClient,
|
|
1061
|
+
createCppRuntimeClient
|
|
1062
|
+
});
|
|
1063
|
+
//# sourceMappingURL=cpp.cjs.map
|