@eyeauras/insight-cli 0.1.0 → 0.2.1
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/.cli-package-build.json +1 -1
- package/README.md +33 -2
- package/SKILL.md +38 -51
- package/dist/src/administration-results.js +1 -1
- package/dist/src/administration.d.ts +1 -1
- package/dist/src/administration.js +16 -2
- package/dist/src/binary.d.ts +3 -0
- package/dist/src/binary.js +74 -0
- package/dist/src/capture.d.ts +3 -0
- package/dist/src/capture.js +220 -0
- package/dist/src/cli.js +91 -14
- package/dist/src/contexts.d.ts +5 -0
- package/dist/src/contexts.js +54 -18
- package/dist/src/debugger-caller.d.ts +17 -0
- package/dist/src/debugger-caller.js +129 -0
- package/dist/src/debugger-launch.d.ts +2 -0
- package/dist/src/debugger-launch.js +17 -0
- package/dist/src/debugger-results.d.ts +1 -0
- package/dist/src/debugger-results.js +8 -0
- package/dist/src/debugger-supervisor.js +56 -13
- package/dist/src/debugger.js +16 -7
- package/dist/src/die.d.ts +12 -0
- package/dist/src/die.js +127 -0
- package/dist/src/dnspy-runtime.d.ts +8 -0
- package/dist/src/dnspy-runtime.js +46 -0
- package/dist/src/dnspy.d.ts +22 -0
- package/dist/src/dnspy.js +160 -0
- package/dist/src/dotnet-diagnostics.d.ts +13 -0
- package/dist/src/dotnet-diagnostics.js +101 -0
- package/dist/src/frida-worker.d.ts +1 -0
- package/dist/src/frida-worker.js +125 -0
- package/dist/src/frida.d.ts +16 -0
- package/dist/src/frida.js +125 -0
- package/dist/src/ghidra-debugger-runtime.d.ts +7 -0
- package/dist/src/ghidra-debugger-runtime.js +31 -0
- package/dist/src/ghidra-processes.d.ts +6 -0
- package/dist/src/ghidra-processes.js +121 -0
- package/dist/src/ghidra.js +6 -6
- package/dist/src/ilspy.d.ts +7 -0
- package/dist/src/ilspy.js +122 -0
- package/dist/src/lifecycle.d.ts +1 -1
- package/dist/src/lifecycle.js +8 -2
- package/dist/src/lldb.d.ts +10 -0
- package/dist/src/lldb.js +99 -0
- package/dist/src/llvm.d.ts +6 -0
- package/dist/src/llvm.js +133 -0
- package/dist/src/managed-heap.d.ts +4 -0
- package/dist/src/managed-heap.js +73 -0
- package/dist/src/managed-metadata.d.ts +11 -0
- package/dist/src/managed-metadata.js +66 -0
- package/dist/src/mitmproxy.d.ts +55 -0
- package/dist/src/mitmproxy.js +172 -0
- package/dist/src/native-inputs.d.ts +3 -2
- package/dist/src/native-inputs.js +21 -5
- package/dist/src/package-version.d.ts +1 -0
- package/dist/src/package-version.js +3 -0
- package/dist/src/procmon-config.d.ts +2 -0
- package/dist/src/procmon-config.js +15 -0
- package/dist/src/procmon-events.d.ts +13 -0
- package/dist/src/procmon-events.js +82 -0
- package/dist/src/procmon.d.ts +4 -0
- package/dist/src/procmon.js +107 -0
- package/dist/src/research.d.ts +11 -2
- package/dist/src/research.js +5 -3
- package/dist/src/runtime-catalog.d.ts +13 -0
- package/dist/src/runtime-catalog.js +26 -0
- package/dist/src/runtime-manager.d.ts +125 -0
- package/dist/src/runtime-manager.js +385 -0
- package/dist/src/runtime-selection.d.ts +13 -0
- package/dist/src/runtime-selection.js +42 -0
- package/dist/src/server.d.ts +15 -0
- package/dist/src/server.js +77 -96
- package/dist/src/sevenzip.d.ts +15 -0
- package/dist/src/sevenzip.js +119 -0
- package/dist/src/strace.d.ts +10 -0
- package/dist/src/strace.js +71 -0
- package/dist/src/text-window.d.ts +11 -0
- package/dist/src/text-window.js +6 -0
- package/dist/src/tool-runtime/archives.d.ts +10 -0
- package/dist/src/tool-runtime/archives.js +194 -0
- package/dist/src/tool-runtime/catalog.d.ts +3 -0
- package/dist/src/tool-runtime/catalog.js +13 -0
- package/dist/src/tool-runtime/commands.d.ts +9 -0
- package/dist/src/tool-runtime/commands.js +39 -0
- package/dist/src/tool-runtime/deadline.d.ts +11 -0
- package/dist/src/tool-runtime/deadline.js +32 -0
- package/dist/src/tool-runtime/definition.d.ts +73 -0
- package/dist/src/tool-runtime/definition.js +49 -0
- package/dist/src/tool-runtime/dotnet.d.ts +4 -0
- package/dist/src/tool-runtime/dotnet.js +22 -0
- package/dist/src/tool-runtime/identity.d.ts +6 -0
- package/dist/src/tool-runtime/identity.js +50 -0
- package/dist/src/tool-runtime/installer.d.ts +101 -0
- package/dist/src/tool-runtime/installer.js +180 -0
- package/dist/src/tool-runtime/launch-worker.d.ts +1 -0
- package/dist/src/tool-runtime/launch-worker.js +58 -0
- package/dist/src/tool-runtime/run.d.ts +51 -0
- package/dist/src/tool-runtime/run.js +159 -0
- package/dist/src/tool-runtime/store.d.ts +15 -0
- package/dist/src/tool-runtime/store.js +219 -0
- package/dist/src/tool-runtime/supervisor.d.ts +57 -0
- package/dist/src/tool-runtime/supervisor.js +266 -0
- package/dist/src/tool-runtime/windows-job.d.ts +22 -0
- package/dist/src/tool-runtime/windows-job.js +43 -0
- package/dist/src/toolbox.d.ts +84 -0
- package/dist/src/toolbox.js +35 -0
- package/dist/src/tshark.d.ts +23 -0
- package/dist/src/tshark.js +174 -0
- package/dist/src/windbg.d.ts +14 -0
- package/dist/src/windbg.js +119 -0
- package/dist/src/workspace.d.ts +1 -0
- package/dist/src/workspace.js +6 -0
- package/package.json +7 -4
- package/references/administration.md +2 -1
- package/references/agent-execution.md +36 -0
- package/references/agent-setup.md +61 -0
- package/references/artifacts.md +5 -0
- package/references/debugger.md +22 -0
- package/references/ilspy.md +33 -0
- package/references/managed-runtime.md +157 -0
- package/references/native/InsightPythonWheels.java +283 -2
- package/references/native/InsightRuntimeDoctor.java +33 -0
- package/references/native/InsightTraceState.java +28 -13
- package/references/setup.md +6 -3
- package/runtime/managed/insight-heap/Azure.Core.dll +0 -0
- package/runtime/managed/insight-heap/Azure.Identity.dll +0 -0
- package/runtime/managed/insight-heap/Insight.Heap.csproj +1 -0
- package/runtime/managed/insight-heap/Insight.Heap.deps.json +391 -0
- package/runtime/managed/insight-heap/Insight.Heap.dll +0 -0
- package/runtime/managed/insight-heap/Insight.Heap.runtimeconfig.json +13 -0
- package/runtime/managed/insight-heap/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Diagnostics.NETCore.Client.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Diagnostics.Runtime.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Extensions.Configuration.Abstractions.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Extensions.DependencyInjection.Abstractions.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Extensions.Diagnostics.Abstractions.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Extensions.FileProviders.Abstractions.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Extensions.Hosting.Abstractions.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Extensions.Options.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Extensions.Primitives.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Identity.Client.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.IdentityModel.Abstractions.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Security.AntiSSRF.dll +0 -0
- package/runtime/managed/insight-heap/NuGet.Config +1 -0
- package/runtime/managed/insight-heap/Program.cs +20 -0
- package/runtime/managed/insight-heap/README.md +16 -0
- package/runtime/managed/insight-heap/System.ClientModel.dll +0 -0
- package/runtime/managed/insight-heap/System.Memory.Data.dll +0 -0
- package/runtime/managed/insight-heap/System.Security.Cryptography.ProtectedData.dll +0 -0
- package/runtime/managed/insight-heap/dependencies.json +436 -0
- package/runtime/managed/insight-heap/notices/Azure.Core-LICENSE.txt +21 -0
- package/runtime/managed/insight-heap/notices/Azure.Identity-LICENSE.txt +21 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Bcl.AsyncInterfaces-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Bcl.AsyncInterfaces-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Diagnostics.NETCore.Client-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Diagnostics.Runtime-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Configuration.Abstractions-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Configuration.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.DependencyInjection.Abstractions-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.DependencyInjection.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Diagnostics.Abstractions-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Diagnostics.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.FileProviders.Abstractions-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.FileProviders.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Hosting.Abstractions-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Hosting.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Logging.Abstractions-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Logging.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Options-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Options-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Primitives-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Primitives-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Identity.Client-LICENSE.txt +21 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Identity.Client.Extensions.Msal-LICENSE.txt +21 -0
- package/runtime/managed/insight-heap/notices/Microsoft.IdentityModel.Abstractions-LICENSE.txt +21 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Security.AntiSSRF-LICENSE.txt +21 -0
- package/runtime/managed/insight-heap/notices/System.ClientModel-LICENSE.txt +21 -0
- package/runtime/managed/insight-heap/notices/System.Memory.Data-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/System.Memory.Data-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/System.Security.Cryptography.ProtectedData-LICENSE.TXT +23 -0
- package/runtime/managed/insight-heap/notices/System.Security.Cryptography.ProtectedData-THIRD-PARTY-NOTICES.TXT +309 -0
- package/runtime/managed/insight-heap/packages.lock.json +165 -0
- package/runtime/managed/insight-heap/provenance.json +146 -0
- package/runtime/managed/insight-heap/runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll +0 -0
- package/runtime/managed/insight-managed/Insight.Managed.csproj +4 -0
- package/runtime/managed/insight-managed/Insight.Managed.deps.json +41 -0
- package/runtime/managed/insight-managed/Insight.Managed.dll +0 -0
- package/runtime/managed/insight-managed/Insight.Managed.runtimeconfig.json +13 -0
- package/runtime/managed/insight-managed/LICENSE.dnlib.txt +20 -0
- package/runtime/managed/insight-managed/NuGet.Config +1 -0
- package/runtime/managed/insight-managed/Program.cs +31 -0
- package/runtime/managed/insight-managed/README.md +16 -0
- package/runtime/managed/insight-managed/dnlib.dll +0 -0
- package/runtime/managed/insight-managed/packages.lock.json +13 -0
- package/runtime/managed/insight-managed/provenance.json +40 -0
- package/runtime/native/binary/README.md +22 -0
- package/runtime/native/binary/dependencies.json +166 -0
- package/runtime/native/binary/helper.cpp +44 -0
- package/runtime/native/binary/insight-binary-darwin-arm64 +0 -0
- package/runtime/native/binary/notices/Catch2-3.12.0--Catch2-3.12.0__LICENSE.txt +23 -0
- package/runtime/native/binary/notices/LIEF-LICENSE.txt +202 -0
- package/runtime/native/binary/notices/LIEF-attribution.txt +37 -0
- package/runtime/native/binary/notices/Melkor_ELF_Fuzzer-ac2495b--elf_fuzzer-master__LICENSE.txt +674 -0
- package/runtime/native/binary/notices/expected-1.3.1--expected-1.3.1__COPYING +121 -0
- package/runtime/native/binary/notices/frozen-61dce5a--frozen-61dce5ae18ca59931e27675c468e64118aba8744__AUTHORS +3 -0
- package/runtime/native/binary/notices/frozen-61dce5a--frozen-61dce5ae18ca59931e27675c468e64118aba8744__LICENSE +202 -0
- package/runtime/native/binary/notices/json-LICENSE.MIT +21 -0
- package/runtime/native/binary/notices/mbedtls-4.0.0.r0.gec4044008d--LICENSE +553 -0
- package/runtime/native/binary/notices/mbedtls-4.0.0.r0.gec4044008d--framework__LICENSE +553 -0
- package/runtime/native/binary/notices/mbedtls-4.0.0.r0.gec4044008d--tf-psa-crypto__LICENSE +552 -0
- package/runtime/native/binary/notices/mbedtls-4.0.0.r0.gec4044008d--tf-psa-crypto__framework__LICENSE +553 -0
- package/runtime/native/binary/notices/nanobind-2.13.0.r18.g4db9ed3f--LICENSE +26 -0
- package/runtime/native/binary/notices/nanobind-2.13.0.r18.g4db9ed3f--ext__robin_map__LICENSE +21 -0
- package/runtime/native/binary/notices/span-LICENSE_1_0.txt +23 -0
- package/runtime/native/binary/notices/span-attribution.txt +11 -0
- package/runtime/native/binary/notices/spdlog-1.17.0--spdlog-1.17.0__LICENSE +25 -0
- package/runtime/native/binary/notices/utfcpp-4.0.9--utfcpp-4.0.9__LICENSE +23 -0
- package/runtime/native/binary/provenance.json +48 -0
- package/runtime/native/child-deadline-linux-x64 +0 -0
- package/runtime/native/child-deadline-linux.c +24 -0
- package/runtime/native/child-deadline-linux.provenance.json +17 -0
- package/runtime/native/deadline-alarm-darwin-universal.dylib +0 -0
- package/runtime/native/deadline-alarm.c +33 -0
- package/runtime/native/deadline-alarm.provenance.json +22 -0
- package/runtime/native/deadline-exec-darwin-arm64 +0 -0
- package/runtime/native/deadline-exec.c +24 -0
- package/runtime/native/deadline-exec.provenance.json +17 -0
- package/runtime/native/dnspy-extension/Bridge.cs +58 -0
- package/runtime/native/dnspy-extension/Insight.DnSpy.csproj +13 -0
- package/runtime/native/dnspy-extension/Insight.DnSpy.x.dll +0 -0
- package/runtime/native/dnspy-extension/NuGet.Config +1 -0
- package/runtime/native/dnspy-extension/UNICODE-LOADER.md +26 -0
- package/runtime/native/dnspy-extension/packages.lock.json +6 -0
- package/runtime/native/dnspy-extension/provenance.json +27 -0
- package/runtime/native/dnspy-extension/upstream-public-build.snk +0 -0
- package/runtime/native/dnspy-extension/vendor-files.json +4341 -0
- package/runtime/native/file-version.ps1 +7 -0
- package/runtime/native/insight-registry-win-x64.dll +0 -0
- package/runtime/native/mitmproxy/bridge.py +180 -0
- package/runtime/native/mitmproxy/notices.json +476 -0
- package/runtime/native/sources/detours-LICENSE.md +23 -0
- package/runtime/native/sources/detours-e4bfd6b.tar.gz +0 -0
- package/runtime/native/sources/detours-provenance.json +10 -0
- package/runtime/native/tshark-layout.json +2247 -0
- package/runtime/native/windows-job/DirectoryAlias.cs +24 -0
- package/runtime/native/windows-job/Insight.WindowsJob.csproj +1 -0
- package/runtime/native/windows-job/Insight.WindowsJob.dll +0 -0
- package/runtime/native/windows-job/NuGet.Config +1 -0
- package/runtime/native/windows-job/OwnedJob.cs +79 -0
- package/runtime/native/windows-job/RegistryRedirect.cs +45 -0
- package/runtime/native/windows-job/packages.lock.json +21 -0
- package/runtime/native/windows-job/provenance.json +16 -0
- package/runtime/native/windows-job/windows-job.ps1 +8 -0
- package/runtime/native/windows-registry.c +21 -0
- package/runtime/native/windows-registry.def +3 -0
- package/runtime/native/windows-registry.provenance.json +14 -0
- package/runtime/notices/diagnostics-10.0.750501.txt +23 -0
- package/runtime/tool-catalog.json +290 -0
- package/runtime/toolbox.json +1401 -0
- package/skill-bundle/insight-artifacts/SKILL.md +30 -0
- package/skill-bundle/insight-artifacts/references/agent-execution.md +36 -0
- package/skill-bundle/insight-artifacts/references/artifacts.md +52 -0
- package/skill-bundle/insight-binary/SKILL.md +46 -0
- package/skill-bundle/insight-binary/references/agent-execution.md +36 -0
- package/skill-bundle/insight-capture/SKILL.md +56 -0
- package/skill-bundle/insight-capture/references/agent-execution.md +36 -0
- package/skill-bundle/insight-cli/SKILL.md +42 -0
- package/skill-bundle/insight-cli/references/agent-execution.md +36 -0
- package/skill-bundle/insight-cli/references/agent-setup.md +61 -0
- package/skill-bundle/insight-die/SKILL.md +49 -0
- package/skill-bundle/insight-die/references/agent-execution.md +36 -0
- package/skill-bundle/insight-dnspy/SKILL.md +65 -0
- package/skill-bundle/insight-dnspy/references/agent-execution.md +36 -0
- package/skill-bundle/insight-dotnet-dump/SKILL.md +46 -0
- package/skill-bundle/insight-dotnet-dump/references/agent-execution.md +36 -0
- package/skill-bundle/insight-dotnet-stack/SKILL.md +39 -0
- package/skill-bundle/insight-dotnet-stack/references/agent-execution.md +36 -0
- package/skill-bundle/insight-dotnet-trace/SKILL.md +45 -0
- package/skill-bundle/insight-dotnet-trace/references/agent-execution.md +36 -0
- package/skill-bundle/insight-frida/SKILL.md +67 -0
- package/skill-bundle/insight-frida/references/agent-execution.md +36 -0
- package/skill-bundle/insight-ghidra/SKILL.md +91 -0
- package/skill-bundle/insight-ghidra/references/administration.md +34 -0
- package/skill-bundle/insight-ghidra/references/agent-execution.md +36 -0
- package/skill-bundle/insight-ghidra/references/archive.md +32 -0
- package/skill-bundle/insight-ghidra/references/artifacts.md +52 -0
- package/skill-bundle/insight-ghidra/references/debugger.md +62 -0
- package/skill-bundle/insight-ghidra/references/extensions-and-sync.md +124 -0
- package/skill-bundle/insight-ghidra/references/managed-runtime.md +157 -0
- package/skill-bundle/insight-ghidra/references/native-workflows.md +112 -0
- package/skill-bundle/insight-ghidra/references/query-semantics.md +96 -0
- package/skill-bundle/insight-ghidra/references/recovery.md +53 -0
- package/skill-bundle/insight-ghidra/references/research.md +101 -0
- package/skill-bundle/insight-ghidra/references/setup.md +50 -0
- package/skill-bundle/insight-ilspy/SKILL.md +45 -0
- package/skill-bundle/insight-ilspy/references/agent-execution.md +36 -0
- package/skill-bundle/insight-ilspy/references/ilspy.md +33 -0
- package/skill-bundle/insight-interop/SKILL.md +54 -0
- package/skill-bundle/insight-interop/references/agent-execution.md +36 -0
- package/skill-bundle/insight-lldb/SKILL.md +54 -0
- package/skill-bundle/insight-lldb/references/agent-execution.md +36 -0
- package/skill-bundle/insight-llvm/SKILL.md +56 -0
- package/skill-bundle/insight-llvm/references/agent-execution.md +36 -0
- package/skill-bundle/insight-managed-heap/SKILL.md +43 -0
- package/skill-bundle/insight-managed-heap/references/agent-execution.md +36 -0
- package/skill-bundle/insight-managed-metadata/SKILL.md +52 -0
- package/skill-bundle/insight-managed-metadata/references/agent-execution.md +36 -0
- package/skill-bundle/insight-mitmproxy/SKILL.md +62 -0
- package/skill-bundle/insight-mitmproxy/references/agent-execution.md +36 -0
- package/skill-bundle/insight-overview/SKILL.md +79 -0
- package/skill-bundle/insight-overview/references/agent-execution.md +36 -0
- package/skill-bundle/insight-procmon/SKILL.md +49 -0
- package/skill-bundle/insight-procmon/references/agent-execution.md +36 -0
- package/skill-bundle/insight-re/SKILL.md +121 -0
- package/skill-bundle/insight-re/references/agent-execution.md +36 -0
- package/skill-bundle/insight-re/references/artifacts.md +52 -0
- package/skill-bundle/insight-re/references/recovery.md +53 -0
- package/skill-bundle/insight-sevenzip/SKILL.md +42 -0
- package/skill-bundle/insight-sevenzip/references/agent-execution.md +36 -0
- package/skill-bundle/insight-strace/SKILL.md +46 -0
- package/skill-bundle/insight-strace/references/agent-execution.md +36 -0
- package/skill-bundle/insight-tshark/SKILL.md +49 -0
- package/skill-bundle/insight-tshark/references/agent-execution.md +36 -0
- package/skill-bundle/insight-windbg/SKILL.md +46 -0
- package/skill-bundle/insight-windbg/references/agent-execution.md +36 -0
- package/skill-bundle/manifest.json +32 -0
- package/skills/insight-artifacts/SKILL.md +30 -0
- package/skills/insight-artifacts/references/agent-execution.md +36 -0
- package/skills/insight-artifacts/references/artifacts.md +52 -0
- package/skills/insight-binary/SKILL.md +46 -0
- package/skills/insight-binary/references/agent-execution.md +36 -0
- package/skills/insight-capture/SKILL.md +56 -0
- package/skills/insight-capture/references/agent-execution.md +36 -0
- package/skills/insight-die/SKILL.md +49 -0
- package/skills/insight-die/references/agent-execution.md +36 -0
- package/skills/insight-dnspy/SKILL.md +65 -0
- package/skills/insight-dnspy/references/agent-execution.md +36 -0
- package/skills/insight-dotnet-dump/SKILL.md +46 -0
- package/skills/insight-dotnet-dump/references/agent-execution.md +36 -0
- package/skills/insight-dotnet-stack/SKILL.md +39 -0
- package/skills/insight-dotnet-stack/references/agent-execution.md +36 -0
- package/skills/insight-dotnet-trace/SKILL.md +45 -0
- package/skills/insight-dotnet-trace/references/agent-execution.md +36 -0
- package/skills/insight-frida/SKILL.md +67 -0
- package/skills/insight-frida/references/agent-execution.md +36 -0
- package/skills/insight-ghidra/SKILL.md +91 -0
- package/skills/insight-ghidra/references/administration.md +34 -0
- package/skills/insight-ghidra/references/agent-execution.md +36 -0
- package/skills/insight-ghidra/references/archive.md +32 -0
- package/skills/insight-ghidra/references/artifacts.md +52 -0
- package/skills/insight-ghidra/references/debugger.md +62 -0
- package/skills/insight-ghidra/references/extensions-and-sync.md +124 -0
- package/skills/insight-ghidra/references/managed-runtime.md +157 -0
- package/skills/insight-ghidra/references/native-workflows.md +112 -0
- package/skills/insight-ghidra/references/query-semantics.md +96 -0
- package/skills/insight-ghidra/references/recovery.md +53 -0
- package/skills/insight-ghidra/references/research.md +101 -0
- package/skills/insight-ghidra/references/setup.md +50 -0
- package/skills/insight-ilspy/SKILL.md +45 -0
- package/skills/insight-ilspy/references/agent-execution.md +36 -0
- package/skills/insight-ilspy/references/ilspy.md +33 -0
- package/skills/insight-interop/SKILL.md +54 -0
- package/skills/insight-interop/references/agent-execution.md +36 -0
- package/skills/insight-lldb/SKILL.md +54 -0
- package/skills/insight-lldb/references/agent-execution.md +36 -0
- package/skills/insight-llvm/SKILL.md +56 -0
- package/skills/insight-llvm/references/agent-execution.md +36 -0
- package/skills/insight-managed-heap/SKILL.md +43 -0
- package/skills/insight-managed-heap/references/agent-execution.md +36 -0
- package/skills/insight-managed-metadata/SKILL.md +52 -0
- package/skills/insight-managed-metadata/references/agent-execution.md +36 -0
- package/skills/insight-mitmproxy/SKILL.md +62 -0
- package/skills/insight-mitmproxy/references/agent-execution.md +36 -0
- package/skills/insight-overview/SKILL.md +79 -0
- package/skills/insight-overview/references/agent-execution.md +36 -0
- package/skills/insight-procmon/SKILL.md +49 -0
- package/skills/insight-procmon/references/agent-execution.md +36 -0
- package/skills/insight-re/SKILL.md +22 -9
- package/skills/insight-re/references/agent-execution.md +36 -0
- package/skills/insight-re/references/artifacts.md +52 -0
- package/skills/insight-re/references/recovery.md +53 -0
- package/skills/insight-sevenzip/SKILL.md +42 -0
- package/skills/insight-sevenzip/references/agent-execution.md +36 -0
- package/skills/insight-strace/SKILL.md +46 -0
- package/skills/insight-strace/references/agent-execution.md +36 -0
- package/skills/insight-tshark/SKILL.md +49 -0
- package/skills/insight-tshark/references/agent-execution.md +36 -0
- package/skills/insight-windbg/SKILL.md +46 -0
- package/skills/insight-windbg/references/agent-execution.md +36 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
2
|
+
import { createReadStream, createWriteStream, constants } from 'node:fs';
|
|
3
|
+
import { mkdir, open, rename, rm, lstat } from 'node:fs/promises';
|
|
4
|
+
import { dirname, join, posix } from 'node:path';
|
|
5
|
+
import { pipeline } from 'node:stream/promises';
|
|
6
|
+
import * as tar from 'tar';
|
|
7
|
+
import * as zip from 'yauzl';
|
|
8
|
+
import { fail } from '../model.js';
|
|
9
|
+
export async function fileSha256(path, signal) { const hash = createHash('sha256'); for await (const chunk of createReadStream(path, { signal }))
|
|
10
|
+
hash.update(chunk); return hash.digest('hex'); }
|
|
11
|
+
export function archiveName(name) {
|
|
12
|
+
if (!name || name.includes('\\') || name.includes('\0') || name.startsWith('/') || /^[a-zA-Z]:/.test(name) || name.split('/').includes('..'))
|
|
13
|
+
fail('invalid', 'Runtime archive contains an unsafe path.');
|
|
14
|
+
return name.replace(/^(\.\/)+/, '');
|
|
15
|
+
}
|
|
16
|
+
export async function extractArchive(file, destination, format, signal) {
|
|
17
|
+
signal?.throwIfAborted();
|
|
18
|
+
await mkdir(destination, { recursive: true, mode: 0o700 });
|
|
19
|
+
let count = 0, bytes = 0;
|
|
20
|
+
const bound = (name, size) => { archiveName(name); if (++count > 100000 || !Number.isSafeInteger(size) || size < 0 || (bytes += size) > 8 * 1024 ** 3)
|
|
21
|
+
fail('limit', 'Runtime archive exceeds extraction bounds.'); };
|
|
22
|
+
if (format === 'tgz') {
|
|
23
|
+
let unsafe;
|
|
24
|
+
await readTar(file, tar.t({ strict: true, filter: (path, entry) => {
|
|
25
|
+
try {
|
|
26
|
+
if (!('type' in entry))
|
|
27
|
+
fail('invalid', 'Unsupported runtime archive metadata.');
|
|
28
|
+
bound(path, entry.size);
|
|
29
|
+
if (!['File', 'Directory', 'SymbolicLink', 'Link', 'OldFile', 'ContiguousFile'].includes(entry.type))
|
|
30
|
+
fail('invalid', 'Unsupported runtime archive entry.');
|
|
31
|
+
if (entry.type === 'SymbolicLink' || entry.type === 'Link') {
|
|
32
|
+
const target = entry.linkpath;
|
|
33
|
+
if (typeof target !== 'string')
|
|
34
|
+
fail('invalid', 'Runtime archive link omitted its target.');
|
|
35
|
+
if (target.startsWith('/') || target.includes('\\') || /^[a-zA-Z]:/.test(target))
|
|
36
|
+
fail('invalid', 'Runtime archive link escapes extraction storage.');
|
|
37
|
+
const joined = posix.normalize(entry.type === 'Link' ? target : posix.join(posix.dirname(path), target));
|
|
38
|
+
archiveName(joined);
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
unsafe ??= error;
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
} }), 'end', signal);
|
|
47
|
+
if (unsafe)
|
|
48
|
+
throw unsafe;
|
|
49
|
+
await readTar(file, tar.x({ cwd: destination, strict: true, preserveOwner: false, noChmod: false }), 'close', signal);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const archive = await new Promise((ok, bad) => zip.open(file, { lazyEntries: true, strictFileNames: true }, (e, z) => e ? bad(e) : ok(z)));
|
|
53
|
+
await new Promise((ok, bad) => {
|
|
54
|
+
const failed = (e) => { archive.close(); bad(e); };
|
|
55
|
+
archive.on('error', failed);
|
|
56
|
+
archive.on('end', ok);
|
|
57
|
+
archive.on('entry', (entry) => {
|
|
58
|
+
void (async () => {
|
|
59
|
+
signal?.throwIfAborted();
|
|
60
|
+
bound(entry.fileName, entry.uncompressedSize);
|
|
61
|
+
const mode = entry.externalFileAttributes >>> 16, type = mode & 0o170000;
|
|
62
|
+
if (type && type !== 0o100000 && type !== 0o040000)
|
|
63
|
+
fail('invalid', 'Runtime zip may contain only files and directories.');
|
|
64
|
+
const path = join(destination, entry.fileName);
|
|
65
|
+
if (entry.fileName.endsWith('/'))
|
|
66
|
+
await mkdir(path, { recursive: true, mode: 0o700 });
|
|
67
|
+
else {
|
|
68
|
+
await mkdir(dirname(path), { recursive: true, mode: 0o700 });
|
|
69
|
+
const stream = await new Promise((ok, bad) => archive.openReadStream(entry, (e, s) => e ? bad(e) : ok(s)));
|
|
70
|
+
await pipeline(stream, createWriteStream(path, { flags: 'wx', mode: mode & 0o111 ? 0o755 : 0o644 }), { signal });
|
|
71
|
+
}
|
|
72
|
+
archive.readEntry();
|
|
73
|
+
})().catch(failed);
|
|
74
|
+
});
|
|
75
|
+
archive.readEntry();
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
export async function cacheArtifact(artifact, cache, fetcher, signal, offline = false, vendorDirect = false) {
|
|
79
|
+
signal.throwIfAborted();
|
|
80
|
+
await mkdir(cache, { recursive: true, mode: 0o700 });
|
|
81
|
+
const path = join(cache, artifact.sha256 + '.' + artifact.format);
|
|
82
|
+
try {
|
|
83
|
+
const cached = await lstat(path);
|
|
84
|
+
if (cached.isFile() && (artifact.size === undefined || cached.size === artifact.size) && await fileSha256(path, signal) === artifact.sha256)
|
|
85
|
+
return path;
|
|
86
|
+
fail('binding', 'Cached runtime archive failed its SHA256 check; remove the corrupt cache entry before retrying.');
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
if (error.code !== 'ENOENT')
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
if (offline)
|
|
93
|
+
fail('configuration', 'Required runtime archive is not cached; run the tool download command before using --offline.', { artifact: artifact.name, sha256: artifact.sha256 });
|
|
94
|
+
if (artifact.delivery?.kind === 'vendor-direct' && !vendorDirect)
|
|
95
|
+
fail('configuration', 'This non-redistributable runtime requires explicit vendor download; use --vendor-direct or supply a local archive.', { artifact: artifact.name, publisher: artifact.delivery.publisher, termsUrl: artifact.delivery.termsUrl });
|
|
96
|
+
const temporary = path + '.partial-' + randomUUID();
|
|
97
|
+
try {
|
|
98
|
+
const response = await fetcher(artifact.url, { signal, cache: 'no-store' });
|
|
99
|
+
if (!response.ok || !response.body)
|
|
100
|
+
fail('download', 'Pinned runtime download failed.', { artifact: artifact.name, status: response.status });
|
|
101
|
+
let size = 0;
|
|
102
|
+
const hash = createHash('sha256'), handle = await open(temporary, 'wx', 0o600);
|
|
103
|
+
try {
|
|
104
|
+
for await (const chunk of response.body) {
|
|
105
|
+
signal.throwIfAborted();
|
|
106
|
+
if ((size += chunk.byteLength) > (artifact.size ?? 2 * 1024 ** 3))
|
|
107
|
+
fail('limit', 'Runtime download exceeds two GiB.');
|
|
108
|
+
hash.update(chunk);
|
|
109
|
+
await handle.writeFile(chunk);
|
|
110
|
+
}
|
|
111
|
+
await handle.sync();
|
|
112
|
+
}
|
|
113
|
+
finally {
|
|
114
|
+
await handle.close();
|
|
115
|
+
}
|
|
116
|
+
if (artifact.size !== undefined && size !== artifact.size)
|
|
117
|
+
fail('binding', 'Downloaded runtime archive has an unexpected size.');
|
|
118
|
+
if (hash.digest('hex') !== artifact.sha256)
|
|
119
|
+
fail('binding', 'Downloaded runtime archive failed its pinned SHA256 check.');
|
|
120
|
+
await rename(temporary, path);
|
|
121
|
+
return path;
|
|
122
|
+
}
|
|
123
|
+
finally {
|
|
124
|
+
await rm(temporary, { force: true });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/** tar streams expose their own abort instead of Node's AbortSignal option. */
|
|
128
|
+
async function readTar(file, parser, event, signal) {
|
|
129
|
+
signal?.throwIfAborted();
|
|
130
|
+
const input = createReadStream(file, { signal });
|
|
131
|
+
await new Promise((ok, bad) => {
|
|
132
|
+
let settled = false;
|
|
133
|
+
const failed = (error) => { if (settled)
|
|
134
|
+
return; settled = true; input.unpipe(); input.destroy(); parser.abort(error); bad(error); };
|
|
135
|
+
parser.on('error', failed);
|
|
136
|
+
input.on('error', failed);
|
|
137
|
+
parser.once(event, () => { if (!settled) {
|
|
138
|
+
settled = true;
|
|
139
|
+
ok();
|
|
140
|
+
} });
|
|
141
|
+
input.pipe(parser);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
/** Consume local input once; extraction never races later edits to the caller's archive. */
|
|
145
|
+
export async function consumeArchive(path, cache, artifact, checksum, signal) {
|
|
146
|
+
const { realpath, stat } = await import('node:fs/promises');
|
|
147
|
+
const source = await realpath(path), input = await open(source, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0)), temporary = join(cache, 'local.partial-' + randomUUID());
|
|
148
|
+
try {
|
|
149
|
+
const metadata = await input.stat();
|
|
150
|
+
if (!metadata.isFile() || metadata.size > 2 * 1024 ** 3)
|
|
151
|
+
fail('invalid', 'Local runtime archive must be a regular file below two GiB.');
|
|
152
|
+
await mkdir(cache, { recursive: true, mode: 0o700 });
|
|
153
|
+
let size = 0;
|
|
154
|
+
const file = await open(temporary, 'wx', 0o600), hash = createHash('sha256');
|
|
155
|
+
try {
|
|
156
|
+
for await (const b of input.createReadStream({ signal, autoClose: false })) {
|
|
157
|
+
size += b.length;
|
|
158
|
+
if (size > 2 * 1024 ** 3)
|
|
159
|
+
fail('limit', 'Local archive grew beyond two GiB.');
|
|
160
|
+
hash.update(b);
|
|
161
|
+
await file.writeFile(b);
|
|
162
|
+
}
|
|
163
|
+
await file.sync();
|
|
164
|
+
}
|
|
165
|
+
finally {
|
|
166
|
+
await file.close();
|
|
167
|
+
}
|
|
168
|
+
const sha256 = hash.digest('hex');
|
|
169
|
+
if (checksum !== undefined && checksum.toLowerCase() !== sha256)
|
|
170
|
+
fail('binding', 'Local runtime archive differs from its expected SHA256.');
|
|
171
|
+
const handle = await open(temporary, 'r'), magic = Buffer.alloc(2);
|
|
172
|
+
try {
|
|
173
|
+
await handle.read(magic, 0, 2, 0);
|
|
174
|
+
}
|
|
175
|
+
finally {
|
|
176
|
+
await handle.close();
|
|
177
|
+
}
|
|
178
|
+
const format = magic.toString('hex') === '504b' ? 'zip' : 'tgz', owned = join(cache, sha256 + '.' + format);
|
|
179
|
+
try {
|
|
180
|
+
if (await fileSha256(owned) !== sha256)
|
|
181
|
+
fail('binding', 'Existing local-archive cache is corrupt.');
|
|
182
|
+
}
|
|
183
|
+
catch (e) {
|
|
184
|
+
if (e.code !== 'ENOENT')
|
|
185
|
+
throw e;
|
|
186
|
+
await rename(temporary, owned);
|
|
187
|
+
}
|
|
188
|
+
return { path: owned, artifact: { ...artifact, sha256, size, format } };
|
|
189
|
+
}
|
|
190
|
+
finally {
|
|
191
|
+
await input.close();
|
|
192
|
+
await rm(temporary, { force: true });
|
|
193
|
+
}
|
|
194
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { fail } from '../model.js';
|
|
3
|
+
const catalog = JSON.parse(readFileSync(new URL('../../../runtime/tool-catalog.json', import.meta.url), 'utf8'));
|
|
4
|
+
/** Expected bytes come from the installed package, never a replaceable remote manifest. */
|
|
5
|
+
export function catalogArtifact(sha256) {
|
|
6
|
+
const a = catalog[sha256];
|
|
7
|
+
const dnspy = a?.url === 'https://github.com/dnSpyEx/dnSpy/releases/download/v6.6.0/dnSpy-net-win64.zip' && a.sha256 === '8ed48f165dc355e869f3a0037ad4f9216147f995a5ae0258b296eeef1f73aab0' && a.delivery?.publisher === 'dnSpyEx' && a.delivery.termsUrl === 'https://visualstudio.microsoft.com/license-terms/mlt552233/';
|
|
8
|
+
const microsoft = a?.delivery?.publisher === 'Microsoft' && new URL(a.delivery.termsUrl).hostname === 'learn.microsoft.com' && new URL(a.delivery.termsUrl).protocol === 'https:' && new URL(a.url).protocol === 'https:' && ['download.sysinternals.com', 'windbg.download.prss.microsoft.com'].includes(new URL(a.url).hostname);
|
|
9
|
+
const vendor = a?.delivery?.kind === 'vendor-direct' && Boolean(a.delivery.reason) && (dnspy || microsoft);
|
|
10
|
+
if (!a || a.sha256 !== sha256 || !(a.url.startsWith('https://github.com/iXab3r/insight-cli/releases/download/tool-') || vendor) || !Number.isSafeInteger(a.size) || a.size < 1)
|
|
11
|
+
fail('binding', 'Pinned tool distribution is absent or invalid in the retained catalog.');
|
|
12
|
+
return { ...a };
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CommandContext, type CommandDefinition } from '@eyeauras/cli-factory';
|
|
2
|
+
import { type ProcessRecord } from './supervisor.js';
|
|
3
|
+
export interface ToolProcessHooks {
|
|
4
|
+
discover?: (c: CommandContext) => Promise<void>;
|
|
5
|
+
verify?: (record: ProcessRecord, c: CommandContext) => Promise<boolean | undefined>;
|
|
6
|
+
stop?: (record: ProcessRecord, c: CommandContext) => Promise<void>;
|
|
7
|
+
beforeKill?: (record: ProcessRecord, c: CommandContext) => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare function toolProcessCommands(hooks?: Record<string, ToolProcessHooks>, metadata?: readonly CommandDefinition[]): CommandDefinition[];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { command, Permission, CliError } from '@eyeauras/cli-factory';
|
|
2
|
+
import { listProcesses, processStatus, terminateProcess } from './supervisor.js';
|
|
3
|
+
import { text } from '../model.js';
|
|
4
|
+
const number = (value, max, min = 0) => { const n = Number(value); if (!Number.isSafeInteger(n) || n < min || n > max)
|
|
5
|
+
throw new CliError('Invalid process page bound.', { code: 'tool.input' }); return n; };
|
|
6
|
+
export function toolProcessCommands(hooks = {}, metadata = []) {
|
|
7
|
+
const verifier = (c) => (record) => hooks[record.tool]?.verify?.(record, c) ?? Promise.resolve(undefined);
|
|
8
|
+
const discover = async (c) => { for (const h of Object.values(hooks))
|
|
9
|
+
await h.discover?.(c); };
|
|
10
|
+
const processes = {
|
|
11
|
+
name: 'processes', description: 'List owned tool processes; inspect or stop one recorded execution', permission: Permission.ReadOnly,
|
|
12
|
+
options: [{ flags: '--tool <name>', description: 'Filter by tool' }, { flags: '--session <id>', description: 'Filter by research session' }, { flags: '--target <id>', description: 'Filter by input target' },
|
|
13
|
+
{ flags: '--all', description: 'Include completed and failed executions' }, { flags: '--limit <count>', description: 'Maximum records in this page', defaultValue: 50, parse: v => number(v, 1000, 1) },
|
|
14
|
+
{ flags: '--offset <count>', description: 'Skip records before this page', defaultValue: 0, parse: v => number(v, 2147483647) }],
|
|
15
|
+
async run({ options: o }, c) {
|
|
16
|
+
await discover(c);
|
|
17
|
+
let items = await listProcesses(c.appArguments.AppDataDirectory, { tool: o.tool === undefined ? undefined : text(o.tool, 64), session: o.session === undefined ? undefined : text(o.session, 128), target: o.target === undefined ? undefined : text(o.target, 128) }, verifier(c));
|
|
18
|
+
if (!o.all)
|
|
19
|
+
items = items.filter(r => !['exited', 'failed'].includes(r.state));
|
|
20
|
+
const limit = number(o.limit, 1000, 1), offset = number(o.offset, 2147483647);
|
|
21
|
+
return { items: items.slice(offset, offset + limit), total: items.length, limit, offset, truncated: items.length > offset + limit };
|
|
22
|
+
},
|
|
23
|
+
children: [
|
|
24
|
+
command('show <process>', 'Inspect a recorded execution and its diagnostic paths', async ({ args }, c) => { await discover(c); return processStatus(c.appArguments.AppDataDirectory, text(args.process, 64), verifier(c)); }, { permission: Permission.ReadOnly }),
|
|
25
|
+
command('stop <process>', 'Request tool-aware graceful shutdown of an owned process', async ({ args }, c) => {
|
|
26
|
+
await discover(c);
|
|
27
|
+
return terminateProcess(c.appArguments.AppDataDirectory, text(args.process, 64), false, verifier(c), r => hooks[r.tool]?.stop?.(r, c) ?? Promise.resolve());
|
|
28
|
+
}, { permission: Permission.Update }),
|
|
29
|
+
command('kill <process>', 'Force termination of a verified owned process; preserve uncertain work', async ({ args }, c) => {
|
|
30
|
+
await discover(c);
|
|
31
|
+
const id = text(args.process, 64), r = await processStatus(c.appArguments.AppDataDirectory, id, verifier(c));
|
|
32
|
+
if (r.state === 'running')
|
|
33
|
+
await hooks[r.tool]?.beforeKill?.(r, c);
|
|
34
|
+
return terminateProcess(c.appArguments.AppDataDirectory, id, true, verifier(c));
|
|
35
|
+
}, { permission: 'Destructive' }),
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
return [command('tools', 'Inspect research tools and executions', [...metadata, processes])];
|
|
39
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** For reviewed native helper execs started inside an adapter worker, never an external target. */
|
|
2
|
+
export declare function inheritedDeadlineEnvironment(deadlineUnixSeconds: number, receipts: string): Promise<{
|
|
3
|
+
DYLD_INSERT_LIBRARIES: string;
|
|
4
|
+
INSIGHT_NATIVE_DEADLINE_UNIX_SECONDS: string;
|
|
5
|
+
INSIGHT_NATIVE_DEADLINE_RECEIPTS: string;
|
|
6
|
+
}>;
|
|
7
|
+
/** Internal, first-party exec helper. No service or timer in the owner is needed after exec. */
|
|
8
|
+
export declare function deadlineLaunch(executable: string, args: string[], timeoutMs: number): Promise<{
|
|
9
|
+
executable: string;
|
|
10
|
+
arguments: string[];
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import { CliError } from '@eyeauras/cli-factory';
|
|
3
|
+
import { fileSha256 } from './archives.js';
|
|
4
|
+
import { isAbsolute } from 'node:path';
|
|
5
|
+
/** For reviewed native helper execs started inside an adapter worker, never an external target. */
|
|
6
|
+
export async function inheritedDeadlineEnvironment(deadlineUnixSeconds, receipts) {
|
|
7
|
+
if (process.platform !== 'darwin' || process.arch !== 'arm64' || !Number.isInteger(deadlineUnixSeconds) || deadlineUnixSeconds <= Date.now() / 1000 || deadlineUnixSeconds > Date.now() / 1000 + 600 || !isAbsolute(receipts))
|
|
8
|
+
throw new CliError('Invalid inherited native deadline.', { code: 'tool.configuration' });
|
|
9
|
+
const library = fileURLToPath(new URL('../../../runtime/native/deadline-alarm-darwin-universal.dylib', import.meta.url));
|
|
10
|
+
if (library.includes(':') || await fileSha256(library) !== 'cd5ebd65aa419b79cb327f2ae872f98f3fd222b93049c909e409776eab65b8ef')
|
|
11
|
+
throw new CliError('Inherited deadline library differs from its reviewed build or has an unsupported loader path.', { code: 'tool.binding' });
|
|
12
|
+
return { DYLD_INSERT_LIBRARIES: library, INSIGHT_NATIVE_DEADLINE_UNIX_SECONDS: String(deadlineUnixSeconds), INSIGHT_NATIVE_DEADLINE_RECEIPTS: receipts };
|
|
13
|
+
}
|
|
14
|
+
/** Internal, first-party exec helper. No service or timer in the owner is needed after exec. */
|
|
15
|
+
export async function deadlineLaunch(executable, args, timeoutMs) {
|
|
16
|
+
if (process.platform === 'linux' && process.arch === 'x64') {
|
|
17
|
+
if (!Number.isInteger(timeoutMs) || timeoutMs < 1000 || timeoutMs > 600000)
|
|
18
|
+
throw new CliError('Native deadline must be 1–600 seconds.', { code: 'tool.configuration' });
|
|
19
|
+
const helper = fileURLToPath(new URL('../../../runtime/native/child-deadline-linux-x64', import.meta.url));
|
|
20
|
+
if (await fileSha256(helper) !== 'e070e2de9a21aea78f224062877cdc0264be11229af314d3b88ff3b6bd77e26f')
|
|
21
|
+
throw new CliError('Packaged Linux launcher differs from its reviewed build.', { code: 'tool.binding' });
|
|
22
|
+
return { executable: helper, arguments: [String(Math.ceil(timeoutMs / 1000)), String(process.pid), executable, ...args] };
|
|
23
|
+
}
|
|
24
|
+
if (process.platform !== 'darwin' || process.arch !== 'arm64')
|
|
25
|
+
throw new CliError('A packaged native deadline is unavailable on this host.', { code: 'tool.unsupported' });
|
|
26
|
+
if (!Number.isInteger(timeoutMs) || timeoutMs < 1000 || timeoutMs > 600000)
|
|
27
|
+
throw new CliError('Native deadline must be between one and 600 seconds.', { code: 'tool.configuration' });
|
|
28
|
+
const helper = fileURLToPath(new URL('../../../runtime/native/deadline-exec-darwin-arm64', import.meta.url));
|
|
29
|
+
if (await fileSha256(helper) !== '32c146075d1c83422b068eeedd4a244d5e30cb768b279b185756c5d3b8008d88')
|
|
30
|
+
throw new CliError('Packaged native deadline differs from its reviewed build.', { code: 'tool.binding' });
|
|
31
|
+
return { executable: helper, arguments: [String(Math.ceil(timeoutMs / 1000)), '--', executable, ...args] };
|
|
32
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type CommandContext, type CommandDefinition } from '@eyeauras/cli-factory';
|
|
2
|
+
import type { ToolProcessHooks } from './commands.js';
|
|
3
|
+
export interface ToolArtifact {
|
|
4
|
+
name: string;
|
|
5
|
+
url: string;
|
|
6
|
+
sha256: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
format: 'zip' | 'tgz';
|
|
9
|
+
root: string;
|
|
10
|
+
license: string;
|
|
11
|
+
delivery?: {
|
|
12
|
+
kind: 'vendor-direct';
|
|
13
|
+
publisher: string;
|
|
14
|
+
termsUrl: string;
|
|
15
|
+
reason: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface ToolComponent {
|
|
19
|
+
id: string;
|
|
20
|
+
version: string;
|
|
21
|
+
artifacts: ToolArtifact[];
|
|
22
|
+
dependencies?: string[];
|
|
23
|
+
}
|
|
24
|
+
export interface ToolInstallation {
|
|
25
|
+
schema: 1;
|
|
26
|
+
tool: string;
|
|
27
|
+
id: string;
|
|
28
|
+
mode: 'managed' | 'external';
|
|
29
|
+
root: string;
|
|
30
|
+
executable: string;
|
|
31
|
+
fingerprint: string;
|
|
32
|
+
selectedAt: string;
|
|
33
|
+
uninstalledAt?: string;
|
|
34
|
+
components: Record<string, string>;
|
|
35
|
+
}
|
|
36
|
+
export interface ToolProcess {
|
|
37
|
+
schema: 1;
|
|
38
|
+
id: string;
|
|
39
|
+
tool: string;
|
|
40
|
+
role: string;
|
|
41
|
+
installation: string;
|
|
42
|
+
state: 'starting' | 'running' | 'exited' | 'failed' | 'unverified';
|
|
43
|
+
executable: string;
|
|
44
|
+
pid?: number;
|
|
45
|
+
identity?: string;
|
|
46
|
+
session?: string;
|
|
47
|
+
target?: string;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
endedAt?: string;
|
|
50
|
+
exitCode?: number | null;
|
|
51
|
+
signal?: string | null;
|
|
52
|
+
elapsedMs?: number;
|
|
53
|
+
}
|
|
54
|
+
export interface ToolLifecycle {
|
|
55
|
+
download(options: Record<string, unknown>, context: CommandContext): Promise<unknown>;
|
|
56
|
+
install(options: Record<string, unknown>, context: CommandContext): Promise<unknown>;
|
|
57
|
+
uninstall(options: Record<string, unknown>, context: CommandContext): Promise<unknown>;
|
|
58
|
+
doctor(options: Record<string, unknown>, context: CommandContext): Promise<unknown>;
|
|
59
|
+
status?(options: Record<string, unknown>, context: CommandContext): Promise<unknown>;
|
|
60
|
+
}
|
|
61
|
+
export interface ToolDefinition {
|
|
62
|
+
id: string;
|
|
63
|
+
description: string;
|
|
64
|
+
components: ToolComponent[];
|
|
65
|
+
lifecycle: ToolLifecycle;
|
|
66
|
+
vendorDirect?: boolean;
|
|
67
|
+
installOptions?: NonNullable<CommandDefinition['options']>;
|
|
68
|
+
commands?: CommandDefinition[];
|
|
69
|
+
processes?: ToolProcessHooks;
|
|
70
|
+
}
|
|
71
|
+
/** Definitions are data/hooks. Factory remains the only parser, permission and output owner. */
|
|
72
|
+
export declare function defineTool(value: ToolDefinition): ToolDefinition;
|
|
73
|
+
export declare function lifecycleCommands(tool: ToolDefinition): CommandDefinition[];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { command, Permission } from '@eyeauras/cli-factory';
|
|
2
|
+
import { fail } from '../model.js';
|
|
3
|
+
/** Definitions are data/hooks. Factory remains the only parser, permission and output owner. */
|
|
4
|
+
export function defineTool(value) {
|
|
5
|
+
if (!/^[a-z][a-z0-9-]*$/.test(value.id))
|
|
6
|
+
fail('invalid', 'Invalid tool name.');
|
|
7
|
+
const components = new Map(value.components.map(item => [item.id, item]));
|
|
8
|
+
if (components.size !== value.components.length)
|
|
9
|
+
fail('invalid', 'Duplicate tool component.');
|
|
10
|
+
const done = new Set(), pending = new Set();
|
|
11
|
+
function visit(id) {
|
|
12
|
+
const component = components.get(id);
|
|
13
|
+
if (!component)
|
|
14
|
+
fail('invalid', 'Unknown tool dependency.');
|
|
15
|
+
if (pending.has(id))
|
|
16
|
+
fail('invalid', 'Cyclic tool dependency.');
|
|
17
|
+
if (done.has(id))
|
|
18
|
+
return;
|
|
19
|
+
pending.add(id);
|
|
20
|
+
for (const dependency of component.dependencies ?? [])
|
|
21
|
+
visit(dependency);
|
|
22
|
+
pending.delete(id);
|
|
23
|
+
done.add(id);
|
|
24
|
+
for (const artifact of component.artifacts) {
|
|
25
|
+
if (!/^[a-f0-9]{64}$/.test(artifact.sha256) || new URL(artifact.url).protocol !== 'https:')
|
|
26
|
+
fail('invalid', 'Tool artifact requires HTTPS and a pinned SHA256.');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
for (const id of components.keys())
|
|
30
|
+
visit(id);
|
|
31
|
+
return value;
|
|
32
|
+
}
|
|
33
|
+
export function lifecycleCommands(tool) {
|
|
34
|
+
const offline = { flags: '--offline', description: 'Use verified local archives and cache without network access' };
|
|
35
|
+
const vendor = tool.vendorDirect ? [{ flags: '--vendor-direct', description: 'Explicitly acquire pinned non-redistributable bytes from the named vendor' }] : [];
|
|
36
|
+
const source = [...vendor, { flags: '--archive <path>', description: 'Install from a local tool archive' },
|
|
37
|
+
{ flags: '--archive-sha256 <sha256>', description: 'Expected SHA256 of the local tool archive' },
|
|
38
|
+
{ flags: '--executable <path>', description: 'Use an external executable; its files are never deleted' }, offline];
|
|
39
|
+
const leaf = (name, description, permission, options) => command(name, description, ({ options: o }, c) => tool.lifecycle[name](o, c), { permission, options });
|
|
40
|
+
return [
|
|
41
|
+
leaf('download', 'Download the pinned tool and required runtime components', Permission.Update, [offline, ...vendor]),
|
|
42
|
+
leaf('install', 'Prepare, verify and select the tool installation', Permission.Update, tool.installOptions ?? source),
|
|
43
|
+
leaf('uninstall', 'Remove owned software while preserving research and external files', 'Destructive', [
|
|
44
|
+
{ flags: '--purge-cache', description: 'Also remove owned downloaded archives' }
|
|
45
|
+
]),
|
|
46
|
+
leaf('doctor', 'Run bounded probes of the selected tool', Permission.Update, []),
|
|
47
|
+
...(tool.lifecycle.status ? [leaf('status', 'Inspect installation and process state without launching the tool', Permission.ReadOnly, [])] : []),
|
|
48
|
+
];
|
|
49
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ToolLaunch } from './installer.js';
|
|
2
|
+
/** Shared private runtime dependency; it is not an independent analytical tool. */
|
|
3
|
+
export declare function dotnetArtifact(platform?: string, architecture?: NodeJS.Architecture): import("./definition.js").ToolArtifact;
|
|
4
|
+
export declare function dotnetLaunch(root: string, entryPoint: string): ToolLaunch;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { catalogArtifact } from './catalog.js';
|
|
3
|
+
import { fail } from '../model.js';
|
|
4
|
+
const runtimeHashes = {
|
|
5
|
+
'darwin-arm64': 'fdf7ef21688338ad5d1d99d7eca7f3cf2e159c86e552d3f5acd0553b11c80ca6',
|
|
6
|
+
'darwin-x64': '50fd6ea005731494a6144fd4617746f4155fdc0f3682d0ba7292eac9e9bf46e3',
|
|
7
|
+
'linux-x64': '958c952691d2c3f8ce21f717f4e911c02b5da0e21ead21bd576368c454b79c77',
|
|
8
|
+
'win32-x64': '8db74a746baa450925d01325a2108ccf6ac39af4018047475292ae155c013d89',
|
|
9
|
+
};
|
|
10
|
+
/** Shared private runtime dependency; it is not an independent analytical tool. */
|
|
11
|
+
export function dotnetArtifact(platform = process.platform, architecture = process.arch) {
|
|
12
|
+
const hash = runtimeHashes[platform + '-' + architecture];
|
|
13
|
+
if (!hash)
|
|
14
|
+
fail('configuration', 'No pinned private .NET runtime for this platform; select an external compatible tool executable.');
|
|
15
|
+
return catalogArtifact(hash);
|
|
16
|
+
}
|
|
17
|
+
export function dotnetLaunch(root, entryPoint) {
|
|
18
|
+
return {
|
|
19
|
+
executable: join(root, 'dotnet' + (process.platform === 'win32' ? '.exe' : '')), arguments: [entryPoint],
|
|
20
|
+
environment: { DOTNET_ROOT: root, DOTNET_MULTILEVEL_LOOKUP: '0', DOTNET_CLI_TELEMETRY_OPTOUT: '1', DOTNET_NOLOGO: '1' },
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { execFile } from 'node:child_process';
|
|
3
|
+
import { promisify } from 'node:util';
|
|
4
|
+
const exec = promisify(execFile);
|
|
5
|
+
function unavailable(pid) { try {
|
|
6
|
+
process.kill(pid, 0);
|
|
7
|
+
}
|
|
8
|
+
catch (e) {
|
|
9
|
+
if (e.code === 'ESRCH')
|
|
10
|
+
return;
|
|
11
|
+
} return { birth: 'unavailable', strong: false }; }
|
|
12
|
+
export async function processIdentity(pid) {
|
|
13
|
+
if (!Number.isSafeInteger(pid) || pid < 1)
|
|
14
|
+
return;
|
|
15
|
+
try {
|
|
16
|
+
if (process.platform === 'linux') {
|
|
17
|
+
const raw = await readFile('/proc/' + pid + '/stat', 'utf8'), parts = raw.slice(raw.lastIndexOf(')') + 2).split(' ');
|
|
18
|
+
if (parts[0] === 'Z')
|
|
19
|
+
return;
|
|
20
|
+
return { birth: (await readFile('/proc/sys/kernel/random/boot_id', 'utf8')).trim() + ':' + parts[19], strong: true, group: Number(parts[2]) };
|
|
21
|
+
}
|
|
22
|
+
if (process.platform === 'darwin') {
|
|
23
|
+
const r = await exec('/bin/ps', ['-p', String(pid), '-o', 'stat=', '-o', 'pgid=', '-o', 'lstart='], { env: { PATH: '/usr/bin:/bin', LC_ALL: 'C', TZ: 'UTC' }, timeout: 3000, maxBuffer: 4096 });
|
|
24
|
+
const match = r.stdout.trim().match(/^(\S+)\s+(\d+)\s+(.+)$/);
|
|
25
|
+
if (!match)
|
|
26
|
+
return unavailable(pid);
|
|
27
|
+
if (match[1].startsWith('Z'))
|
|
28
|
+
return;
|
|
29
|
+
// ps birth time is second-resolution; recovered macOS processes additionally need a tool identity hook.
|
|
30
|
+
return { birth: match[3], strong: false, group: Number(match[2]) };
|
|
31
|
+
}
|
|
32
|
+
if (process.platform === 'win32') {
|
|
33
|
+
const script = 'try{$p=[Diagnostics.Process]::GetProcessById(' + pid + ');try{$p.StartTime.ToUniversalTime().Ticks.ToString()}finally{$p.Dispose()}}catch [ArgumentException]{}';
|
|
34
|
+
const r = await exec('powershell.exe', ['-NoProfile', '-NonInteractive', '-Command', script], { windowsHide: true, timeout: 15000, maxBuffer: 4096 });
|
|
35
|
+
return r.stdout.trim() ? { birth: r.stdout.trim(), strong: true } : unavailable(pid);
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
process.kill(pid, 0);
|
|
39
|
+
return { birth: 'unverified', strong: false };
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
if (['ENOENT', 'ESRCH', 'EACCES', 'EPERM'].includes(error.code ?? '') || error.code === 1)
|
|
47
|
+
return unavailable(pid);
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { CommandContext } from '@eyeauras/cli-factory';
|
|
2
|
+
import type { ToolArtifact, ToolInstallation } from './definition.js';
|
|
3
|
+
export interface ToolLaunch {
|
|
4
|
+
executable: string;
|
|
5
|
+
arguments: string[];
|
|
6
|
+
environment: Record<string, string>;
|
|
7
|
+
}
|
|
8
|
+
export interface SelectedTool extends ToolInstallation, ToolLaunch {
|
|
9
|
+
roots: Record<string, string>;
|
|
10
|
+
lastProbe: Record<string, unknown>;
|
|
11
|
+
externalInputs?: Record<string, string>;
|
|
12
|
+
noticeDigest?: string;
|
|
13
|
+
execution?: ToolLaunch;
|
|
14
|
+
executionFingerprint?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Read-only verification used by an owned child after the command owner has staged a runtime. */
|
|
17
|
+
export declare function verifyManagedInstallation(directory: string, tool: string, selected: SelectedTool): Promise<void>;
|
|
18
|
+
export interface InstallDescriptor {
|
|
19
|
+
id: string;
|
|
20
|
+
primary: string;
|
|
21
|
+
components: () => Record<string, ToolArtifact>;
|
|
22
|
+
launch: (roots: Record<string, string>) => ToolLaunch;
|
|
23
|
+
probe: (launch: ToolLaunch, c: CommandContext) => Promise<Record<string, unknown>>;
|
|
24
|
+
/** Reviewed nested packaging preparation inside owned staging, before probe/fingerprint. */
|
|
25
|
+
prepare?: (roots: Record<string, string>, c: CommandContext) => Promise<void>;
|
|
26
|
+
/** Exceptional upstream adaptation: prepare an owned execution copy, never rewrite external software. */
|
|
27
|
+
prepareExternal?: (executable: string, stage: string, c: CommandContext) => Promise<ToolLaunch>;
|
|
28
|
+
preparationId?: string;
|
|
29
|
+
/** Known sibling executables/data files needed by an external tool family. */
|
|
30
|
+
externalInputs?: (executable: string, c: CommandContext) => Promise<Record<string, string>>;
|
|
31
|
+
/** Full retained notices copied into owned installation storage, including external selections. */
|
|
32
|
+
noticeFiles?: Record<string, string>;
|
|
33
|
+
}
|
|
34
|
+
/** Standard archive-based tools supply layout and a real probe; exceptional tools reuse the stage primitives. */
|
|
35
|
+
export declare class ToolInstaller {
|
|
36
|
+
readonly c: CommandContext;
|
|
37
|
+
readonly descriptor: InstallDescriptor;
|
|
38
|
+
readonly directory: string;
|
|
39
|
+
readonly root: string;
|
|
40
|
+
readonly cache: string;
|
|
41
|
+
constructor(c: CommandContext, descriptor: InstallDescriptor);
|
|
42
|
+
private receipt;
|
|
43
|
+
status(): Promise<{
|
|
44
|
+
retainedStages: string[];
|
|
45
|
+
processes: import("./supervisor.js").ProcessRecord[];
|
|
46
|
+
tool: string;
|
|
47
|
+
state: string;
|
|
48
|
+
mode: string;
|
|
49
|
+
installation: string | undefined;
|
|
50
|
+
executable: string | undefined;
|
|
51
|
+
components: Record<string, string>;
|
|
52
|
+
lastProbe: Record<string, unknown> | undefined;
|
|
53
|
+
recommended: string;
|
|
54
|
+
}>;
|
|
55
|
+
download(offline?: boolean, vendorDirect?: boolean): Promise<{
|
|
56
|
+
tool: string;
|
|
57
|
+
state: string;
|
|
58
|
+
items: {
|
|
59
|
+
component: string;
|
|
60
|
+
path: string;
|
|
61
|
+
sha256: string;
|
|
62
|
+
license: string;
|
|
63
|
+
url: string;
|
|
64
|
+
delivery: {
|
|
65
|
+
kind: "vendor-direct";
|
|
66
|
+
publisher: string;
|
|
67
|
+
termsUrl: string;
|
|
68
|
+
reason: string;
|
|
69
|
+
} | {
|
|
70
|
+
kind: "owned-release";
|
|
71
|
+
};
|
|
72
|
+
}[];
|
|
73
|
+
}>;
|
|
74
|
+
install(o: Record<string, unknown>): Promise<{
|
|
75
|
+
tool: string;
|
|
76
|
+
state: string;
|
|
77
|
+
mode: "external" | "managed";
|
|
78
|
+
installation: string;
|
|
79
|
+
executable: string;
|
|
80
|
+
components: {
|
|
81
|
+
[k: string]: string;
|
|
82
|
+
};
|
|
83
|
+
checks: Record<string, unknown>;
|
|
84
|
+
}>;
|
|
85
|
+
private verify;
|
|
86
|
+
use<T>(action: (selection: SelectedTool) => Promise<T>): Promise<T>;
|
|
87
|
+
selected(): Promise<SelectedTool>;
|
|
88
|
+
doctor(): Promise<{
|
|
89
|
+
tool: string;
|
|
90
|
+
state: string;
|
|
91
|
+
installation: string;
|
|
92
|
+
checks: Record<string, unknown>;
|
|
93
|
+
}>;
|
|
94
|
+
uninstall(purgeCache?: boolean): Promise<{
|
|
95
|
+
tool: string;
|
|
96
|
+
state: string;
|
|
97
|
+
externalInstallationPreserved: boolean;
|
|
98
|
+
researchPreserved: boolean;
|
|
99
|
+
materialsPreserved: boolean;
|
|
100
|
+
}>;
|
|
101
|
+
}
|