@eyeauras/insight-cli 0.2.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 +25 -0
- package/SKILL.md +38 -54
- 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 +57 -12
- package/dist/src/contexts.d.ts +5 -0
- package/dist/src/contexts.js +42 -16
- 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/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 +9 -4
- 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 +5 -10
- package/dist/src/runtime-catalog.js +4 -5
- package/dist/src/runtime-manager.d.ts +27 -3
- package/dist/src/runtime-manager.js +100 -159
- package/dist/src/runtime-selection.js +21 -4
- package/dist/src/server.d.ts +13 -0
- package/dist/src/server.js +21 -45
- 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/{runtime-archives.js → tool-runtime/archives.js} +91 -24
- 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 +5 -4
- 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 +48 -7
- package/references/native/InsightPythonWheels.java +283 -2
- package/references/native/InsightTraceState.java +28 -13
- package/references/setup.md +2 -1
- 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
- package/dist/src/runtime-archives.d.ts +0 -5
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { access, mkdir, readdir } from 'node:fs/promises';
|
|
3
|
+
import { constants } from 'node:fs';
|
|
4
|
+
import { join, isAbsolute, resolve } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { randomUUID } from 'node:crypto';
|
|
7
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
8
|
+
import { CliError } from '@eyeauras/cli-factory';
|
|
9
|
+
import { atomicWrite, readJson, toolRoot, withToolLock } from './store.js';
|
|
10
|
+
import { processIdentity } from './identity.js';
|
|
11
|
+
import { digest } from '../model.js';
|
|
12
|
+
const owned = new Map();
|
|
13
|
+
const ownedKey = (directory, id) => resolve(directory) + '\0' + id;
|
|
14
|
+
/** Receipts report pending lifetime only; they never authorize a signal to another PID. */
|
|
15
|
+
async function nativeChildren(record) {
|
|
16
|
+
if (record.metadata?.nativeChildDeadlines !== true)
|
|
17
|
+
return [];
|
|
18
|
+
let names;
|
|
19
|
+
try {
|
|
20
|
+
names = await readdir(join(record.root, 'native-deadlines'));
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
if (e.code === 'ENOENT')
|
|
24
|
+
return [];
|
|
25
|
+
throw e;
|
|
26
|
+
}
|
|
27
|
+
if (names.length > 100)
|
|
28
|
+
throw new CliError('Native helper receipt count exceeds its bound.', { code: 'tool.process.unverified' });
|
|
29
|
+
return Promise.all(names.map(async (name) => {
|
|
30
|
+
const value = await readJson(join(record.root, 'native-deadlines', name));
|
|
31
|
+
if (!/^\d+\.json$/.test(name) || !value || value.protocol !== 1 || !Number.isSafeInteger(value.pid) || value.pid < 1 || value.pid > 2147483647 || name !== value.pid + '.json' || !Number.isSafeInteger(value.parentPid) || value.parentPid < 1 || !Number.isSafeInteger(value.birthSeconds) || value.birthSeconds < 1 || !Number.isSafeInteger(value.birthMicroseconds) || value.birthMicroseconds < 0 || value.birthMicroseconds >= 1000000 || !Number.isSafeInteger(value.deadlineUnixSeconds) || value.deadlineUnixSeconds <= 0)
|
|
32
|
+
throw new CliError('Native helper receipt is invalid; no cleanup was assumed.', { code: 'tool.process.unverified' });
|
|
33
|
+
const receiptDigest = digest(value), acknowledgment = join(record.root, 'native-deadline-exits', name), previous = await readJson(acknowledgment);
|
|
34
|
+
if (previous?.receiptDigest === receiptDigest)
|
|
35
|
+
return { ...value, state: 'exited' };
|
|
36
|
+
const identity = await processIdentity(value.pid), seconds = identity && process.platform === 'darwin' ? Date.parse(identity.birth + ' GMT') / 1000 : NaN;
|
|
37
|
+
// A different observable birth proves reuse, without granting permission to signal that PID.
|
|
38
|
+
const exited = !identity || Number.isFinite(seconds) && seconds !== value.birthSeconds;
|
|
39
|
+
if (exited)
|
|
40
|
+
await atomicWrite(acknowledgment, { receiptDigest, observedAt: new Date().toISOString() });
|
|
41
|
+
return { ...value, state: exited ? 'exited' : 'pending' };
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
export async function launchProcess(directory, spec, executable, args, options = {}, control = {}) {
|
|
45
|
+
return withToolLock(directory, spec.tool, async () => {
|
|
46
|
+
control.signal?.throwIfAborted();
|
|
47
|
+
toolRoot(directory, spec.tool);
|
|
48
|
+
if (!isAbsolute(executable))
|
|
49
|
+
throw new CliError('Tool executable must be absolute.', { code: 'tool.configuration' });
|
|
50
|
+
const id = control.id ?? randomUUID();
|
|
51
|
+
if (!/^[a-f0-9-]{36}$/.test(id))
|
|
52
|
+
throw Error('Invalid process identity');
|
|
53
|
+
const root = join(directory, 'runtime/runs', id), path = join(directory, 'runtime/processes', id + '.json');
|
|
54
|
+
await mkdir(root, { recursive: true, mode: 0o700 });
|
|
55
|
+
const gated = process.platform !== 'win32' && typeof process.execve === 'function';
|
|
56
|
+
const record = { schema: 1, id, ...spec, state: 'starting', executable, root, ownerPid: process.pid, profileBinding: digest(resolve(directory)), gated, phase: 'reserved', createdAt: new Date().toISOString() };
|
|
57
|
+
await atomicWrite(path, record);
|
|
58
|
+
try {
|
|
59
|
+
control.signal?.throwIfAborted();
|
|
60
|
+
await access(executable, process.platform === 'win32' ? constants.F_OK : constants.X_OK);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
Object.assign(record, { state: 'failed', phase: 'preflight_failed' });
|
|
64
|
+
await atomicWrite(path, record);
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
const environment = options.env ?? { PATH: process.env.PATH, HOME: root, TMPDIR: root };
|
|
68
|
+
const stdio = Array.isArray(options.stdio) ? [...options.stdio] : Array(3).fill(options.stdio ?? 'pipe'), fd = stdio.length, nonce = randomUUID();
|
|
69
|
+
if (gated)
|
|
70
|
+
stdio.push('pipe');
|
|
71
|
+
let child;
|
|
72
|
+
try {
|
|
73
|
+
child = spawn(gated ? process.execPath : executable, gated ? ['--no-warnings', fileURLToPath(new URL('./launch-worker.js', import.meta.url)), directory, id, String(fd)] : args, { cwd: root, ...options, stdio, windowsHide: true, env: gated ? { PATH: environment.PATH, HOME: root, TMPDIR: root } : environment });
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
Object.assign(record, { state: 'failed', phase: 'spawn_failed' });
|
|
77
|
+
await atomicWrite(path, record);
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
const closed = new Promise((ok, bad) => { child.on('error', error => { if (!child.pid)
|
|
81
|
+
bad(error); }); child.once('close', ok); });
|
|
82
|
+
void closed.catch(() => { });
|
|
83
|
+
const handle = { child, closed, record };
|
|
84
|
+
owned.set(ownedKey(directory, id), handle);
|
|
85
|
+
const finalized = control.finalize === false ? closed : closed.then(async () => {
|
|
86
|
+
const current = await readJson(path) ?? record;
|
|
87
|
+
if (current.state !== 'failed' && current.state !== 'unverified')
|
|
88
|
+
Object.assign(current, { state: 'exited', exitCode: child.exitCode, signal: child.signalCode, endedAt: new Date().toISOString(), outcome: current.requestedStop === 'kill' ? 'killed' : current.requestedStop === 'stop' ? 'stopped' : 'completed' });
|
|
89
|
+
await atomicWrite(path, current);
|
|
90
|
+
}, async () => { Object.assign(record, { state: 'failed', phase: 'spawn_failed' }); await atomicWrite(path, record); });
|
|
91
|
+
handle.closed = finalized.finally(() => { owned.delete(ownedKey(directory, id)); });
|
|
92
|
+
void handle.closed.catch(() => { });
|
|
93
|
+
Object.assign(child, { toolProcessId: id, toolClosed: handle.closed });
|
|
94
|
+
try {
|
|
95
|
+
await control.onSpawn?.(child);
|
|
96
|
+
if (!child.pid)
|
|
97
|
+
throw Error('Owned tool spawn did not obtain a PID');
|
|
98
|
+
if (gated) {
|
|
99
|
+
const channel = child.stdio[fd];
|
|
100
|
+
channel.on('error', () => { });
|
|
101
|
+
channel.end(JSON.stringify({ executable, arguments: args, environment: Object.fromEntries(Object.entries(environment).filter(([, v]) => v !== undefined)), nonce }));
|
|
102
|
+
let armed = false;
|
|
103
|
+
for (let i = 0; i < 400; i++) {
|
|
104
|
+
control.signal?.throwIfAborted();
|
|
105
|
+
const ready = await readJson(join(root, 'armed.json'));
|
|
106
|
+
if (ready && ready.pid === child.pid && ready.nonce === nonce) {
|
|
107
|
+
armed = true;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
if (child.exitCode !== null || child.signalCode !== null)
|
|
111
|
+
break;
|
|
112
|
+
await delay(25);
|
|
113
|
+
}
|
|
114
|
+
if (!armed)
|
|
115
|
+
throw Error('Owned launch did not become armed');
|
|
116
|
+
Object.assign(record, await readJson(path), { state: 'running', phase: 'exec_authorized' });
|
|
117
|
+
await atomicWrite(path, record);
|
|
118
|
+
await atomicWrite(join(root, 'go.json'), { nonce });
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
if (!child.pid)
|
|
122
|
+
throw Error('No child process');
|
|
123
|
+
const identity = await processIdentity(child.pid);
|
|
124
|
+
Object.assign(record, { pid: child.pid, identity: identity?.birth, strongIdentity: identity?.strong, processGroup: identity?.group, state: 'running', phase: 'direct_child_only' });
|
|
125
|
+
await atomicWrite(path, record);
|
|
126
|
+
}
|
|
127
|
+
return child;
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
if (child.exitCode === null && child.signalCode === null)
|
|
131
|
+
try {
|
|
132
|
+
child.kill('SIGKILL');
|
|
133
|
+
}
|
|
134
|
+
catch { }
|
|
135
|
+
await Promise.race([handle.closed.catch(() => { }), delay(2000)]);
|
|
136
|
+
Object.assign(record, { state: child.exitCode !== null || child.signalCode !== null ? 'failed' : 'unverified', phase: 'launch_failed' });
|
|
137
|
+
await atomicWrite(path, record);
|
|
138
|
+
throw error;
|
|
139
|
+
}
|
|
140
|
+
}, control.signal);
|
|
141
|
+
}
|
|
142
|
+
export async function processStatus(directory, id, verify) {
|
|
143
|
+
if (!/^[a-f0-9-]{36}$/.test(id))
|
|
144
|
+
throw new CliError('Invalid process identity.', { code: 'tool.process.invalid' });
|
|
145
|
+
const record = await readJson(join(directory, 'runtime/processes', id + '.json'));
|
|
146
|
+
if (!record || record.id !== id)
|
|
147
|
+
throw new CliError('Unknown tool process.', { code: 'tool.process.missing' });
|
|
148
|
+
if (record.root !== join(directory, 'runtime/runs', id) || record.profileBinding !== digest(resolve(directory)))
|
|
149
|
+
return { ...record, state: 'unverified', phase: 'profile_binding_changed' };
|
|
150
|
+
const finishing = owned.get(ownedKey(directory, id));
|
|
151
|
+
if (finishing && (finishing.child.exitCode !== null || finishing.child.signalCode !== null)) {
|
|
152
|
+
await finishing.closed;
|
|
153
|
+
return processStatus(directory, id, verify);
|
|
154
|
+
}
|
|
155
|
+
let children;
|
|
156
|
+
try {
|
|
157
|
+
children = await nativeChildren(record);
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
return { ...record, state: 'unverified', phase: 'native_children_unverified' };
|
|
161
|
+
}
|
|
162
|
+
const pending = children.some(c => c.state === 'pending');
|
|
163
|
+
const observed = { ...record, ...(children.length ? { nativeChildren: children } : {}) };
|
|
164
|
+
if (['exited', 'failed'].includes(record.state))
|
|
165
|
+
return pending ? { ...observed, state: 'unverified', phase: 'native_children_pending' } : observed;
|
|
166
|
+
if (!record.pid) {
|
|
167
|
+
try {
|
|
168
|
+
process.kill(record.ownerPid, 0);
|
|
169
|
+
return record;
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
return { ...record, state: record.gated ? 'failed' : 'unverified', phase: 'owner_lost_before_pid' };
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const identity = await processIdentity(record.pid);
|
|
176
|
+
if (!identity)
|
|
177
|
+
return { ...observed, state: pending ? 'unverified' : 'exited', phase: pending ? 'native_children_pending' : 'observed_exit', outcome: 'unknown' };
|
|
178
|
+
if (identity.birth !== record.identity)
|
|
179
|
+
return { ...record, state: 'unverified', phase: 'pid_identity_changed' };
|
|
180
|
+
const current = owned.get(ownedKey(directory, id)), local = current?.child.pid === record.pid && current.record.identity === record.identity && current.child.exitCode === null && current.child.signalCode === null;
|
|
181
|
+
const proof = verify ? await verify(record) : undefined;
|
|
182
|
+
if (local || proof === true || proof === undefined && record.strongIdentity && identity.strong)
|
|
183
|
+
return { ...observed, state: 'running' };
|
|
184
|
+
return { ...observed, state: 'unverified', phase: 'tool_identity_required' };
|
|
185
|
+
}
|
|
186
|
+
export async function listProcesses(directory, filter = {}, verify) {
|
|
187
|
+
let names;
|
|
188
|
+
try {
|
|
189
|
+
names = await readdir(join(directory, 'runtime/processes'));
|
|
190
|
+
}
|
|
191
|
+
catch (e) {
|
|
192
|
+
if (e.code === 'ENOENT')
|
|
193
|
+
return [];
|
|
194
|
+
throw e;
|
|
195
|
+
}
|
|
196
|
+
const items = [];
|
|
197
|
+
for (const name of names) {
|
|
198
|
+
if (!/^[a-f0-9-]{36}\.json$/.test(name))
|
|
199
|
+
continue;
|
|
200
|
+
const record = await processStatus(directory, name.slice(0, -5), verify);
|
|
201
|
+
if (filter.tool && record.tool !== filter.tool || filter.session && record.session !== filter.session || filter.target && record.target !== filter.target)
|
|
202
|
+
continue;
|
|
203
|
+
items.push(record);
|
|
204
|
+
}
|
|
205
|
+
return items.sort((a, b) => b.createdAt.localeCompare(a.createdAt));
|
|
206
|
+
}
|
|
207
|
+
export async function terminateProcess(directory, id, force, verify, graceful) {
|
|
208
|
+
const path = join(directory, 'runtime/processes', id + '.json'), record = await processStatus(directory, id, verify);
|
|
209
|
+
if (['exited', 'failed'].includes(record.state))
|
|
210
|
+
return { process: id, state: 'already_exited' };
|
|
211
|
+
if (record.state !== 'running' || !record.pid)
|
|
212
|
+
throw new CliError('Process ownership is unverified; no signal was sent.', { code: 'tool.process.unverified' });
|
|
213
|
+
if (!force && graceful)
|
|
214
|
+
await graceful(record);
|
|
215
|
+
let current = await processStatus(directory, id, verify);
|
|
216
|
+
if (!['exited', 'failed'].includes(current.state)) {
|
|
217
|
+
if (current.state !== 'running' || current.pid !== record.pid)
|
|
218
|
+
throw new CliError('Process identity changed during stop.', { code: 'tool.process.unverified' });
|
|
219
|
+
current.requestedStop = force ? 'kill' : 'stop';
|
|
220
|
+
await atomicWrite(path, current);
|
|
221
|
+
const identity = await processIdentity(record.pid);
|
|
222
|
+
if (!identity || identity.birth !== record.identity)
|
|
223
|
+
throw new CliError('Process identity changed before signalling.', { code: 'tool.process.unverified' });
|
|
224
|
+
try {
|
|
225
|
+
if (process.platform !== 'win32' && record.processGroup === record.pid && identity.group === record.pid)
|
|
226
|
+
process.kill(-record.pid, force ? 'SIGKILL' : 'SIGTERM');
|
|
227
|
+
else
|
|
228
|
+
process.kill(record.pid, force ? 'SIGKILL' : 'SIGTERM');
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
if (error.code !== 'ESRCH')
|
|
232
|
+
throw error;
|
|
233
|
+
}
|
|
234
|
+
for (let i = 0; i < 100; i++) {
|
|
235
|
+
if (!await processIdentity(record.pid))
|
|
236
|
+
break;
|
|
237
|
+
await delay(50);
|
|
238
|
+
}
|
|
239
|
+
if (await processIdentity(record.pid))
|
|
240
|
+
throw new CliError('Owned process did not stop; its record is retained.', { code: 'tool.process.busy' });
|
|
241
|
+
}
|
|
242
|
+
await owned.get(ownedKey(directory, id))?.closed;
|
|
243
|
+
current = { ...(await readJson(path) ?? record), state: 'exited', outcome: force ? 'killed' : 'stopped', endedAt: new Date().toISOString() };
|
|
244
|
+
await atomicWrite(path, current);
|
|
245
|
+
return { process: id, state: force ? 'killed' : 'stopped', interrupted: force, tool: record.tool, session: record.session, target: record.target };
|
|
246
|
+
}
|
|
247
|
+
/** Migration/reconnection only: an adapter must authenticate a known existing tool before registration. */
|
|
248
|
+
export async function registerExistingProcess(directory, spec, executable, pid, verify) {
|
|
249
|
+
toolRoot(directory, spec.tool);
|
|
250
|
+
const identity = await processIdentity(pid);
|
|
251
|
+
if (!identity)
|
|
252
|
+
throw new CliError('Existing tool process has exited.', { code: 'tool.process.missing' });
|
|
253
|
+
const hex = digest({ profile: resolve(directory), ...spec, pid, identity: identity.birth }).slice(0, 32), id = [hex.slice(0, 8), hex.slice(8, 12), hex.slice(12, 16), hex.slice(16, 20), hex.slice(20)].join('-');
|
|
254
|
+
const root = join(directory, 'runtime/runs', id), path = join(directory, 'runtime/processes', id + '.json');
|
|
255
|
+
const record = { schema: 1, id, ...spec, root, ownerPid: process.pid, profileBinding: digest(resolve(directory)), gated: false, state: 'running', phase: 'adopted_verified', createdAt: new Date().toISOString(), executable, pid, identity: identity.birth, strongIdentity: identity.strong, processGroup: identity.group };
|
|
256
|
+
if (!await verify(record))
|
|
257
|
+
throw new CliError('Existing process did not authenticate as the owned tool.', { code: 'tool.process.unverified' });
|
|
258
|
+
if ((await processIdentity(pid))?.birth !== identity.birth)
|
|
259
|
+
throw new CliError('Existing process identity changed during registration.', { code: 'tool.process.unverified' });
|
|
260
|
+
const previous = await readJson(path);
|
|
261
|
+
if (previous)
|
|
262
|
+
return id;
|
|
263
|
+
await mkdir(root, { recursive: true, mode: 0o700 });
|
|
264
|
+
await atomicWrite(path, record);
|
|
265
|
+
return id;
|
|
266
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Stock Windows PowerShell loads the packaged first-party Job Object executor; no runtime compiler. */
|
|
2
|
+
export declare function windowsJobLaunch(root: string, nonce: string, executable: string, args: string[], cwd: string, timeoutMs: number, options?: {
|
|
3
|
+
observedSubject?: {
|
|
4
|
+
pid: number;
|
|
5
|
+
birth: string;
|
|
6
|
+
};
|
|
7
|
+
nativeMutex?: 'procmon';
|
|
8
|
+
nativeRegistry?: 'procmon';
|
|
9
|
+
}): Promise<{
|
|
10
|
+
executable: string;
|
|
11
|
+
arguments: string[];
|
|
12
|
+
}>;
|
|
13
|
+
export declare function windowsJobResult(root: string, nonce: string, launcherPid: number, registryExpected?: boolean): Promise<{
|
|
14
|
+
registryIsolated?: boolean | undefined;
|
|
15
|
+
schema: number;
|
|
16
|
+
nonce: string;
|
|
17
|
+
launcherPid: number;
|
|
18
|
+
phase: string;
|
|
19
|
+
childExitCode: number;
|
|
20
|
+
childPid: number;
|
|
21
|
+
childBirthTicks: string;
|
|
22
|
+
}>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
3
|
+
import { join, isAbsolute } from 'node:path';
|
|
4
|
+
import { CliError } from '@eyeauras/cli-factory';
|
|
5
|
+
import { fileSha256 } from './archives.js';
|
|
6
|
+
import { atomicWrite, readJson } from './store.js';
|
|
7
|
+
import { processIdentity } from './identity.js';
|
|
8
|
+
/** Stock Windows PowerShell loads the packaged first-party Job Object executor; no runtime compiler. */
|
|
9
|
+
export async function windowsJobLaunch(root, nonce, executable, args, cwd, timeoutMs, options = {}) {
|
|
10
|
+
if (process.platform !== 'win32' || !Number.isInteger(timeoutMs) || timeoutMs < 1000 || timeoutMs > 600000)
|
|
11
|
+
throw new CliError('Owned Windows job deadline must be 1–600 seconds.', { code: 'tool.configuration' });
|
|
12
|
+
const native = fileURLToPath(new URL('../../../runtime/native/windows-job/', import.meta.url));
|
|
13
|
+
const proof = await readJson(join(native, 'provenance.json'));
|
|
14
|
+
if (!proof || await fileSha256(join(native, 'Insight.WindowsJob.dll')) !== proof.sha256 || await fileSha256(join(native, 'windows-job.ps1')) !== proof.launcherSha256)
|
|
15
|
+
throw new CliError('Packaged Windows job differs from its reviewed build.', { code: 'tool.binding' });
|
|
16
|
+
const identity = await processIdentity(process.pid), system = process.env.SystemRoot ?? process.env.WINDIR;
|
|
17
|
+
if (!identity?.strong || !/^\d+$/.test(identity.birth) || !system || !isAbsolute(system))
|
|
18
|
+
throw new CliError('Windows owner birth identity or system directory is unavailable.', { code: 'tool.process.unverified' });
|
|
19
|
+
if (options.observedSubject && (!Number.isSafeInteger(options.observedSubject.pid) || options.observedSubject.pid < 1 || !/^\d+$/.test(options.observedSubject.birth)))
|
|
20
|
+
throw new CliError('Borrowed Windows subject identity is invalid.', { code: 'tool.process.unverified' });
|
|
21
|
+
let registry = {};
|
|
22
|
+
if (options.nativeRegistry) {
|
|
23
|
+
const registryShim = join(native, '../insight-registry-win-x64.dll'), proof = await readJson(join(native, '../windows-registry.provenance.json'));
|
|
24
|
+
if (!proof || await fileSha256(registryShim) !== proof.sha256)
|
|
25
|
+
throw new CliError('Private Windows registry helper is missing or differs from its reviewed build.', { code: 'tool.binding' });
|
|
26
|
+
registry = { registryShim, registryShimSha256: proof.sha256 };
|
|
27
|
+
}
|
|
28
|
+
const specification = join(root, 'job-specification.json');
|
|
29
|
+
await atomicWrite(specification, { schema: 1, nonce, executable, arguments: args, cwd, timeoutMs, ownerPid: process.pid, ownerBirthTicks: identity.birth, ...registry, ...(options.observedSubject ? { observedPid: options.observedSubject.pid, observedBirthTicks: options.observedSubject.birth } : {}), ...(options.nativeMutex ? { nativeMutex: 'Local\\insight-cli-procmon-capture' } : {}) });
|
|
30
|
+
return { executable: join(system, 'System32/WindowsPowerShell/v1.0/powershell.exe'), arguments: ['-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-File', join(native, 'windows-job.ps1'), '-Specification', specification] };
|
|
31
|
+
}
|
|
32
|
+
export async function windowsJobResult(root, nonce, launcherPid, registryExpected = false) {
|
|
33
|
+
const result = await readJson(join(root, 'job-result.json'));
|
|
34
|
+
const started = await readJson(join(root, 'job-started.json'));
|
|
35
|
+
if (!result || !started || result.schema !== 1 || started.schema !== 1 || result.nonce !== nonce || started.nonce !== nonce || result.launcherPid !== launcherPid || started.launcherPid !== launcherPid || !['completed', 'timeout', 'owner_lost'].includes(result.phase) || !Number.isSafeInteger(result.childExitCode) || result.childExitCode < 0 || result.childExitCode > 0xffffffff || !Number.isSafeInteger(result.childPid) || result.childPid < 1 || result.childPid !== started.childPid || !/^\d+$/.test(result.childBirthTicks) || result.childBirthTicks !== started.childBirthTicks || started.phase !== 'assigned_suspended')
|
|
36
|
+
throw new CliError('Owned Windows job result is missing or unverified; no successful outcome was assumed.', { code: 'tool.process.unverified' });
|
|
37
|
+
if (registryExpected) {
|
|
38
|
+
const proof = await readFile(join(root, 'registry-isolated.bin'));
|
|
39
|
+
if (proof.length !== 48 || proof.readUInt32LE(0) !== 0x49484b31 || proof.readUInt32LE(4) !== result.childPid || proof.readUInt32LE(8) !== 0 || proof.subarray(12).toString('ascii') !== nonce)
|
|
40
|
+
throw new CliError('Private Windows registry initialization is unverified.', { code: 'tool.process.unverified' });
|
|
41
|
+
}
|
|
42
|
+
return { ...result, ...(registryExpected ? { registryIsolated: true } : {}) };
|
|
43
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type CommandDefinition } from '@eyeauras/cli-factory';
|
|
2
|
+
interface PackagedSkill {
|
|
3
|
+
name: string;
|
|
4
|
+
title: string;
|
|
5
|
+
path: string;
|
|
6
|
+
resources: Record<string, string>;
|
|
7
|
+
}
|
|
8
|
+
interface Capability {
|
|
9
|
+
id: string;
|
|
10
|
+
namespace: string;
|
|
11
|
+
kind: 'analytical' | 'supporting' | 'capability';
|
|
12
|
+
skill: string;
|
|
13
|
+
purpose: string;
|
|
14
|
+
evaluationCase: {
|
|
15
|
+
id: string;
|
|
16
|
+
inputFamily: string;
|
|
17
|
+
task: string;
|
|
18
|
+
modes: string[];
|
|
19
|
+
requiredObservations: string[];
|
|
20
|
+
};
|
|
21
|
+
inputs: string[];
|
|
22
|
+
tasks: string[];
|
|
23
|
+
platforms: string[];
|
|
24
|
+
dependencies: string[];
|
|
25
|
+
workflowCommands: string[];
|
|
26
|
+
limitations: string[];
|
|
27
|
+
}
|
|
28
|
+
export interface Toolbox {
|
|
29
|
+
schema: 1;
|
|
30
|
+
skills: PackagedSkill[];
|
|
31
|
+
tools: Capability[];
|
|
32
|
+
}
|
|
33
|
+
export declare const toolbox: Toolbox;
|
|
34
|
+
export declare function locateSkill(name?: string): {
|
|
35
|
+
version: string;
|
|
36
|
+
name: string;
|
|
37
|
+
bundlePath: string;
|
|
38
|
+
path: string;
|
|
39
|
+
skills: string[];
|
|
40
|
+
};
|
|
41
|
+
export declare function describeTool(id: string): {
|
|
42
|
+
status: string;
|
|
43
|
+
version: string;
|
|
44
|
+
skill: {
|
|
45
|
+
version: string;
|
|
46
|
+
name: string;
|
|
47
|
+
bundlePath: string;
|
|
48
|
+
path: string;
|
|
49
|
+
skills: string[];
|
|
50
|
+
};
|
|
51
|
+
runtime: {
|
|
52
|
+
required: boolean;
|
|
53
|
+
providedByNamespace: string;
|
|
54
|
+
dependencies: string[];
|
|
55
|
+
readiness?: undefined;
|
|
56
|
+
statusCommand?: undefined;
|
|
57
|
+
} | {
|
|
58
|
+
required: boolean;
|
|
59
|
+
readiness: string;
|
|
60
|
+
statusCommand: string[];
|
|
61
|
+
providedByNamespace?: undefined;
|
|
62
|
+
dependencies?: undefined;
|
|
63
|
+
};
|
|
64
|
+
id: string;
|
|
65
|
+
namespace: string;
|
|
66
|
+
kind: "analytical" | "supporting" | "capability";
|
|
67
|
+
purpose: string;
|
|
68
|
+
evaluationCase: {
|
|
69
|
+
id: string;
|
|
70
|
+
inputFamily: string;
|
|
71
|
+
task: string;
|
|
72
|
+
modes: string[];
|
|
73
|
+
requiredObservations: string[];
|
|
74
|
+
};
|
|
75
|
+
inputs: string[];
|
|
76
|
+
tasks: string[];
|
|
77
|
+
platforms: string[];
|
|
78
|
+
dependencies: string[];
|
|
79
|
+
workflowCommands: string[];
|
|
80
|
+
limitations: string[];
|
|
81
|
+
};
|
|
82
|
+
export declare function skillCommand(): CommandDefinition;
|
|
83
|
+
export declare function toolboxCommands(): CommandDefinition[];
|
|
84
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { localCommand, CliError, tableView, recordView } from '@eyeauras/cli-factory';
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { packageVersion } from './package-version.js';
|
|
5
|
+
const packageRoot = new URL('../../', import.meta.url);
|
|
6
|
+
export const toolbox = JSON.parse(readFileSync(new URL('runtime/toolbox.json', packageRoot), 'utf8'));
|
|
7
|
+
export function locateSkill(name = 'insight-cli') {
|
|
8
|
+
const skill = toolbox.skills.find(s => s.name === name);
|
|
9
|
+
if (!skill)
|
|
10
|
+
throw new CliError(`Unknown skill '${name}'.`, { code: 'toolbox.skillNotFound', next: [['tools', 'list']] });
|
|
11
|
+
return { version: packageVersion, name, bundlePath: fileURLToPath(new URL('skill-bundle', packageRoot)), path: fileURLToPath(new URL(skill.path, packageRoot)), skills: toolbox.skills.map(s => s.name) };
|
|
12
|
+
}
|
|
13
|
+
export function describeTool(id) {
|
|
14
|
+
const tool = toolbox.tools.find(t => t.id === id);
|
|
15
|
+
if (!tool)
|
|
16
|
+
throw new CliError(`Unknown tool '${id}'.`, { code: 'toolbox.notFound', next: [['tools', 'list']] });
|
|
17
|
+
return { ...tool, status: 'available', version: packageVersion, skill: locateSkill(tool.skill),
|
|
18
|
+
runtime: tool.kind !== 'analytical' ? { required: false, providedByNamespace: tool.namespace, dependencies: tool.dependencies } : { required: true, readiness: 'notChecked', statusCommand: ['insight-cli', tool.namespace, 'status', '--json'] } };
|
|
19
|
+
}
|
|
20
|
+
export function skillCommand() {
|
|
21
|
+
return localCommand('skill [name]', 'Locate packaged tool instructions', ({ args }) => locateSkill(args.name === undefined ? undefined : String(args.name)), {
|
|
22
|
+
view: recordView({ fields: [{ label: 'Skill', value: x => x.name }, { label: 'Version', value: x => x.version }, { label: 'Path', value: x => x.path }] })
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export function toolboxCommands() {
|
|
26
|
+
return [
|
|
27
|
+
localCommand('list', 'List shipped research capabilities', () => ({ version: packageVersion, items: toolbox.tools.map(t => ({ id: t.id, namespace: t.namespace, kind: t.kind, purpose: t.purpose, inputs: t.inputs, tasks: t.tasks, platforms: t.platforms, skill: t.skill, status: 'available' })) }), {
|
|
28
|
+
view: tableView({ rows: x => x.items, columns: [{ header: 'Tool', value: x => x.id }, { header: 'Purpose', value: x => x.purpose }, { header: 'Skill', value: x => x.skill }] })
|
|
29
|
+
}),
|
|
30
|
+
localCommand('show <tool>', 'Describe tasks and tool preparation', ({ args }) => describeTool(String(args.tool)), {
|
|
31
|
+
view: recordView({ fields: [{ label: 'Tool', value: x => x.id }, { label: 'Purpose', value: x => x.purpose }, { label: 'Kind', value: x => x.kind }, { label: 'Platforms', value: x => x.platforms.join(', ') }, { label: 'Dependencies', value: x => x.dependencies.join(', ') || 'none' }, { label: 'Skill', value: x => x.skill.path }],
|
|
32
|
+
sections: [{ title: () => 'Tasks', lines: x => x.tasks }, { title: () => 'Limitations', lines: x => x.limitations }], next: x => [['skill', x.skill.name]] })
|
|
33
|
+
}),
|
|
34
|
+
];
|
|
35
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type CommandContext, type CommandDefinition } from '@eyeauras/cli-factory';
|
|
2
|
+
import { ToolInstaller } from './tool-runtime/installer.js';
|
|
3
|
+
import type { Workspace } from './workspace.js';
|
|
4
|
+
export declare function tsharkInstaller(c: CommandContext): ToolInstaller;
|
|
5
|
+
export type PacketFields = Record<string, string[]>;
|
|
6
|
+
export declare function tsharkRows(value: string): PacketFields[];
|
|
7
|
+
export declare function tsharkStreams(rows: PacketFields[]): {
|
|
8
|
+
frames: number[];
|
|
9
|
+
sources: string[];
|
|
10
|
+
destinations: string[];
|
|
11
|
+
transport: string;
|
|
12
|
+
stream: number;
|
|
13
|
+
}[];
|
|
14
|
+
export declare function tsharkFollow(output: string, transport: string, stream: number): {
|
|
15
|
+
nodes: string[];
|
|
16
|
+
chunks: {
|
|
17
|
+
node: number;
|
|
18
|
+
hex: string;
|
|
19
|
+
bytes: number;
|
|
20
|
+
}[];
|
|
21
|
+
totalBytes: number;
|
|
22
|
+
};
|
|
23
|
+
export declare function tsharkCommands(workspace: (c: CommandContext) => Workspace): CommandDefinition[];
|