@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.
Files changed (384) hide show
  1. package/.cli-package-build.json +1 -1
  2. package/README.md +25 -0
  3. package/SKILL.md +38 -54
  4. package/dist/src/binary.d.ts +3 -0
  5. package/dist/src/binary.js +74 -0
  6. package/dist/src/capture.d.ts +3 -0
  7. package/dist/src/capture.js +220 -0
  8. package/dist/src/cli.js +57 -12
  9. package/dist/src/contexts.d.ts +5 -0
  10. package/dist/src/contexts.js +42 -16
  11. package/dist/src/debugger-caller.d.ts +17 -0
  12. package/dist/src/debugger-caller.js +129 -0
  13. package/dist/src/debugger-launch.d.ts +2 -0
  14. package/dist/src/debugger-launch.js +17 -0
  15. package/dist/src/debugger-results.d.ts +1 -0
  16. package/dist/src/debugger-results.js +8 -0
  17. package/dist/src/debugger-supervisor.js +56 -13
  18. package/dist/src/debugger.js +16 -7
  19. package/dist/src/die.d.ts +12 -0
  20. package/dist/src/die.js +127 -0
  21. package/dist/src/dnspy-runtime.d.ts +8 -0
  22. package/dist/src/dnspy-runtime.js +46 -0
  23. package/dist/src/dnspy.d.ts +22 -0
  24. package/dist/src/dnspy.js +160 -0
  25. package/dist/src/dotnet-diagnostics.d.ts +13 -0
  26. package/dist/src/dotnet-diagnostics.js +101 -0
  27. package/dist/src/frida-worker.d.ts +1 -0
  28. package/dist/src/frida-worker.js +125 -0
  29. package/dist/src/frida.d.ts +16 -0
  30. package/dist/src/frida.js +125 -0
  31. package/dist/src/ghidra-debugger-runtime.d.ts +7 -0
  32. package/dist/src/ghidra-debugger-runtime.js +31 -0
  33. package/dist/src/ghidra-processes.d.ts +6 -0
  34. package/dist/src/ghidra-processes.js +121 -0
  35. package/dist/src/ghidra.js +6 -6
  36. package/dist/src/ilspy.d.ts +7 -0
  37. package/dist/src/ilspy.js +122 -0
  38. package/dist/src/lldb.d.ts +10 -0
  39. package/dist/src/lldb.js +99 -0
  40. package/dist/src/llvm.d.ts +6 -0
  41. package/dist/src/llvm.js +133 -0
  42. package/dist/src/managed-heap.d.ts +4 -0
  43. package/dist/src/managed-heap.js +73 -0
  44. package/dist/src/managed-metadata.d.ts +11 -0
  45. package/dist/src/managed-metadata.js +66 -0
  46. package/dist/src/mitmproxy.d.ts +55 -0
  47. package/dist/src/mitmproxy.js +172 -0
  48. package/dist/src/native-inputs.d.ts +3 -2
  49. package/dist/src/native-inputs.js +9 -4
  50. package/dist/src/package-version.d.ts +1 -0
  51. package/dist/src/package-version.js +3 -0
  52. package/dist/src/procmon-config.d.ts +2 -0
  53. package/dist/src/procmon-config.js +15 -0
  54. package/dist/src/procmon-events.d.ts +13 -0
  55. package/dist/src/procmon-events.js +82 -0
  56. package/dist/src/procmon.d.ts +4 -0
  57. package/dist/src/procmon.js +107 -0
  58. package/dist/src/research.d.ts +11 -2
  59. package/dist/src/research.js +5 -3
  60. package/dist/src/runtime-catalog.d.ts +5 -10
  61. package/dist/src/runtime-catalog.js +4 -5
  62. package/dist/src/runtime-manager.d.ts +27 -3
  63. package/dist/src/runtime-manager.js +100 -159
  64. package/dist/src/runtime-selection.js +21 -4
  65. package/dist/src/server.d.ts +13 -0
  66. package/dist/src/server.js +21 -45
  67. package/dist/src/sevenzip.d.ts +15 -0
  68. package/dist/src/sevenzip.js +119 -0
  69. package/dist/src/strace.d.ts +10 -0
  70. package/dist/src/strace.js +71 -0
  71. package/dist/src/text-window.d.ts +11 -0
  72. package/dist/src/text-window.js +6 -0
  73. package/dist/src/tool-runtime/archives.d.ts +10 -0
  74. package/dist/src/{runtime-archives.js → tool-runtime/archives.js} +91 -24
  75. package/dist/src/tool-runtime/catalog.d.ts +3 -0
  76. package/dist/src/tool-runtime/catalog.js +13 -0
  77. package/dist/src/tool-runtime/commands.d.ts +9 -0
  78. package/dist/src/tool-runtime/commands.js +39 -0
  79. package/dist/src/tool-runtime/deadline.d.ts +11 -0
  80. package/dist/src/tool-runtime/deadline.js +32 -0
  81. package/dist/src/tool-runtime/definition.d.ts +73 -0
  82. package/dist/src/tool-runtime/definition.js +49 -0
  83. package/dist/src/tool-runtime/dotnet.d.ts +4 -0
  84. package/dist/src/tool-runtime/dotnet.js +22 -0
  85. package/dist/src/tool-runtime/identity.d.ts +6 -0
  86. package/dist/src/tool-runtime/identity.js +50 -0
  87. package/dist/src/tool-runtime/installer.d.ts +101 -0
  88. package/dist/src/tool-runtime/installer.js +180 -0
  89. package/dist/src/tool-runtime/launch-worker.d.ts +1 -0
  90. package/dist/src/tool-runtime/launch-worker.js +58 -0
  91. package/dist/src/tool-runtime/run.d.ts +51 -0
  92. package/dist/src/tool-runtime/run.js +159 -0
  93. package/dist/src/tool-runtime/store.d.ts +15 -0
  94. package/dist/src/tool-runtime/store.js +219 -0
  95. package/dist/src/tool-runtime/supervisor.d.ts +57 -0
  96. package/dist/src/tool-runtime/supervisor.js +266 -0
  97. package/dist/src/tool-runtime/windows-job.d.ts +22 -0
  98. package/dist/src/tool-runtime/windows-job.js +43 -0
  99. package/dist/src/toolbox.d.ts +84 -0
  100. package/dist/src/toolbox.js +35 -0
  101. package/dist/src/tshark.d.ts +23 -0
  102. package/dist/src/tshark.js +174 -0
  103. package/dist/src/windbg.d.ts +14 -0
  104. package/dist/src/windbg.js +119 -0
  105. package/dist/src/workspace.d.ts +1 -0
  106. package/dist/src/workspace.js +6 -0
  107. package/package.json +5 -4
  108. package/references/agent-execution.md +36 -0
  109. package/references/agent-setup.md +61 -0
  110. package/references/artifacts.md +5 -0
  111. package/references/debugger.md +22 -0
  112. package/references/ilspy.md +33 -0
  113. package/references/managed-runtime.md +48 -7
  114. package/references/native/InsightPythonWheels.java +283 -2
  115. package/references/native/InsightTraceState.java +28 -13
  116. package/references/setup.md +2 -1
  117. package/runtime/managed/insight-heap/Azure.Core.dll +0 -0
  118. package/runtime/managed/insight-heap/Azure.Identity.dll +0 -0
  119. package/runtime/managed/insight-heap/Insight.Heap.csproj +1 -0
  120. package/runtime/managed/insight-heap/Insight.Heap.deps.json +391 -0
  121. package/runtime/managed/insight-heap/Insight.Heap.dll +0 -0
  122. package/runtime/managed/insight-heap/Insight.Heap.runtimeconfig.json +13 -0
  123. package/runtime/managed/insight-heap/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
  124. package/runtime/managed/insight-heap/Microsoft.Diagnostics.NETCore.Client.dll +0 -0
  125. package/runtime/managed/insight-heap/Microsoft.Diagnostics.Runtime.dll +0 -0
  126. package/runtime/managed/insight-heap/Microsoft.Extensions.Configuration.Abstractions.dll +0 -0
  127. package/runtime/managed/insight-heap/Microsoft.Extensions.DependencyInjection.Abstractions.dll +0 -0
  128. package/runtime/managed/insight-heap/Microsoft.Extensions.Diagnostics.Abstractions.dll +0 -0
  129. package/runtime/managed/insight-heap/Microsoft.Extensions.FileProviders.Abstractions.dll +0 -0
  130. package/runtime/managed/insight-heap/Microsoft.Extensions.Hosting.Abstractions.dll +0 -0
  131. package/runtime/managed/insight-heap/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
  132. package/runtime/managed/insight-heap/Microsoft.Extensions.Options.dll +0 -0
  133. package/runtime/managed/insight-heap/Microsoft.Extensions.Primitives.dll +0 -0
  134. package/runtime/managed/insight-heap/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  135. package/runtime/managed/insight-heap/Microsoft.Identity.Client.dll +0 -0
  136. package/runtime/managed/insight-heap/Microsoft.IdentityModel.Abstractions.dll +0 -0
  137. package/runtime/managed/insight-heap/Microsoft.Security.AntiSSRF.dll +0 -0
  138. package/runtime/managed/insight-heap/NuGet.Config +1 -0
  139. package/runtime/managed/insight-heap/Program.cs +20 -0
  140. package/runtime/managed/insight-heap/README.md +16 -0
  141. package/runtime/managed/insight-heap/System.ClientModel.dll +0 -0
  142. package/runtime/managed/insight-heap/System.Memory.Data.dll +0 -0
  143. package/runtime/managed/insight-heap/System.Security.Cryptography.ProtectedData.dll +0 -0
  144. package/runtime/managed/insight-heap/dependencies.json +436 -0
  145. package/runtime/managed/insight-heap/notices/Azure.Core-LICENSE.txt +21 -0
  146. package/runtime/managed/insight-heap/notices/Azure.Identity-LICENSE.txt +21 -0
  147. package/runtime/managed/insight-heap/notices/Microsoft.Bcl.AsyncInterfaces-LICENSE.txt +23 -0
  148. package/runtime/managed/insight-heap/notices/Microsoft.Bcl.AsyncInterfaces-THIRD-PARTY-NOTICES.TXT +1418 -0
  149. package/runtime/managed/insight-heap/notices/Microsoft.Diagnostics.NETCore.Client-LICENSE.txt +23 -0
  150. package/runtime/managed/insight-heap/notices/Microsoft.Diagnostics.Runtime-LICENSE.txt +23 -0
  151. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Configuration.Abstractions-LICENSE.txt +23 -0
  152. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Configuration.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
  153. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.DependencyInjection.Abstractions-LICENSE.txt +23 -0
  154. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.DependencyInjection.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
  155. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Diagnostics.Abstractions-LICENSE.txt +23 -0
  156. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Diagnostics.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
  157. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.FileProviders.Abstractions-LICENSE.txt +23 -0
  158. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.FileProviders.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
  159. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Hosting.Abstractions-LICENSE.txt +23 -0
  160. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Hosting.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
  161. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Logging.Abstractions-LICENSE.txt +23 -0
  162. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Logging.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
  163. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Options-LICENSE.txt +23 -0
  164. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Options-THIRD-PARTY-NOTICES.TXT +1418 -0
  165. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Primitives-LICENSE.txt +23 -0
  166. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Primitives-THIRD-PARTY-NOTICES.TXT +1418 -0
  167. package/runtime/managed/insight-heap/notices/Microsoft.Identity.Client-LICENSE.txt +21 -0
  168. package/runtime/managed/insight-heap/notices/Microsoft.Identity.Client.Extensions.Msal-LICENSE.txt +21 -0
  169. package/runtime/managed/insight-heap/notices/Microsoft.IdentityModel.Abstractions-LICENSE.txt +21 -0
  170. package/runtime/managed/insight-heap/notices/Microsoft.Security.AntiSSRF-LICENSE.txt +21 -0
  171. package/runtime/managed/insight-heap/notices/System.ClientModel-LICENSE.txt +21 -0
  172. package/runtime/managed/insight-heap/notices/System.Memory.Data-LICENSE.txt +23 -0
  173. package/runtime/managed/insight-heap/notices/System.Memory.Data-THIRD-PARTY-NOTICES.TXT +1418 -0
  174. package/runtime/managed/insight-heap/notices/System.Security.Cryptography.ProtectedData-LICENSE.TXT +23 -0
  175. package/runtime/managed/insight-heap/notices/System.Security.Cryptography.ProtectedData-THIRD-PARTY-NOTICES.TXT +309 -0
  176. package/runtime/managed/insight-heap/packages.lock.json +165 -0
  177. package/runtime/managed/insight-heap/provenance.json +146 -0
  178. package/runtime/managed/insight-heap/runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll +0 -0
  179. package/runtime/managed/insight-managed/Insight.Managed.csproj +4 -0
  180. package/runtime/managed/insight-managed/Insight.Managed.deps.json +41 -0
  181. package/runtime/managed/insight-managed/Insight.Managed.dll +0 -0
  182. package/runtime/managed/insight-managed/Insight.Managed.runtimeconfig.json +13 -0
  183. package/runtime/managed/insight-managed/LICENSE.dnlib.txt +20 -0
  184. package/runtime/managed/insight-managed/NuGet.Config +1 -0
  185. package/runtime/managed/insight-managed/Program.cs +31 -0
  186. package/runtime/managed/insight-managed/README.md +16 -0
  187. package/runtime/managed/insight-managed/dnlib.dll +0 -0
  188. package/runtime/managed/insight-managed/packages.lock.json +13 -0
  189. package/runtime/managed/insight-managed/provenance.json +40 -0
  190. package/runtime/native/binary/README.md +22 -0
  191. package/runtime/native/binary/dependencies.json +166 -0
  192. package/runtime/native/binary/helper.cpp +44 -0
  193. package/runtime/native/binary/insight-binary-darwin-arm64 +0 -0
  194. package/runtime/native/binary/notices/Catch2-3.12.0--Catch2-3.12.0__LICENSE.txt +23 -0
  195. package/runtime/native/binary/notices/LIEF-LICENSE.txt +202 -0
  196. package/runtime/native/binary/notices/LIEF-attribution.txt +37 -0
  197. package/runtime/native/binary/notices/Melkor_ELF_Fuzzer-ac2495b--elf_fuzzer-master__LICENSE.txt +674 -0
  198. package/runtime/native/binary/notices/expected-1.3.1--expected-1.3.1__COPYING +121 -0
  199. package/runtime/native/binary/notices/frozen-61dce5a--frozen-61dce5ae18ca59931e27675c468e64118aba8744__AUTHORS +3 -0
  200. package/runtime/native/binary/notices/frozen-61dce5a--frozen-61dce5ae18ca59931e27675c468e64118aba8744__LICENSE +202 -0
  201. package/runtime/native/binary/notices/json-LICENSE.MIT +21 -0
  202. package/runtime/native/binary/notices/mbedtls-4.0.0.r0.gec4044008d--LICENSE +553 -0
  203. package/runtime/native/binary/notices/mbedtls-4.0.0.r0.gec4044008d--framework__LICENSE +553 -0
  204. package/runtime/native/binary/notices/mbedtls-4.0.0.r0.gec4044008d--tf-psa-crypto__LICENSE +552 -0
  205. package/runtime/native/binary/notices/mbedtls-4.0.0.r0.gec4044008d--tf-psa-crypto__framework__LICENSE +553 -0
  206. package/runtime/native/binary/notices/nanobind-2.13.0.r18.g4db9ed3f--LICENSE +26 -0
  207. package/runtime/native/binary/notices/nanobind-2.13.0.r18.g4db9ed3f--ext__robin_map__LICENSE +21 -0
  208. package/runtime/native/binary/notices/span-LICENSE_1_0.txt +23 -0
  209. package/runtime/native/binary/notices/span-attribution.txt +11 -0
  210. package/runtime/native/binary/notices/spdlog-1.17.0--spdlog-1.17.0__LICENSE +25 -0
  211. package/runtime/native/binary/notices/utfcpp-4.0.9--utfcpp-4.0.9__LICENSE +23 -0
  212. package/runtime/native/binary/provenance.json +48 -0
  213. package/runtime/native/child-deadline-linux-x64 +0 -0
  214. package/runtime/native/child-deadline-linux.c +24 -0
  215. package/runtime/native/child-deadline-linux.provenance.json +17 -0
  216. package/runtime/native/deadline-alarm-darwin-universal.dylib +0 -0
  217. package/runtime/native/deadline-alarm.c +33 -0
  218. package/runtime/native/deadline-alarm.provenance.json +22 -0
  219. package/runtime/native/deadline-exec-darwin-arm64 +0 -0
  220. package/runtime/native/deadline-exec.c +24 -0
  221. package/runtime/native/deadline-exec.provenance.json +17 -0
  222. package/runtime/native/dnspy-extension/Bridge.cs +58 -0
  223. package/runtime/native/dnspy-extension/Insight.DnSpy.csproj +13 -0
  224. package/runtime/native/dnspy-extension/Insight.DnSpy.x.dll +0 -0
  225. package/runtime/native/dnspy-extension/NuGet.Config +1 -0
  226. package/runtime/native/dnspy-extension/UNICODE-LOADER.md +26 -0
  227. package/runtime/native/dnspy-extension/packages.lock.json +6 -0
  228. package/runtime/native/dnspy-extension/provenance.json +27 -0
  229. package/runtime/native/dnspy-extension/upstream-public-build.snk +0 -0
  230. package/runtime/native/dnspy-extension/vendor-files.json +4341 -0
  231. package/runtime/native/file-version.ps1 +7 -0
  232. package/runtime/native/insight-registry-win-x64.dll +0 -0
  233. package/runtime/native/mitmproxy/bridge.py +180 -0
  234. package/runtime/native/mitmproxy/notices.json +476 -0
  235. package/runtime/native/sources/detours-LICENSE.md +23 -0
  236. package/runtime/native/sources/detours-e4bfd6b.tar.gz +0 -0
  237. package/runtime/native/sources/detours-provenance.json +10 -0
  238. package/runtime/native/tshark-layout.json +2247 -0
  239. package/runtime/native/windows-job/DirectoryAlias.cs +24 -0
  240. package/runtime/native/windows-job/Insight.WindowsJob.csproj +1 -0
  241. package/runtime/native/windows-job/Insight.WindowsJob.dll +0 -0
  242. package/runtime/native/windows-job/NuGet.Config +1 -0
  243. package/runtime/native/windows-job/OwnedJob.cs +79 -0
  244. package/runtime/native/windows-job/RegistryRedirect.cs +45 -0
  245. package/runtime/native/windows-job/packages.lock.json +21 -0
  246. package/runtime/native/windows-job/provenance.json +16 -0
  247. package/runtime/native/windows-job/windows-job.ps1 +8 -0
  248. package/runtime/native/windows-registry.c +21 -0
  249. package/runtime/native/windows-registry.def +3 -0
  250. package/runtime/native/windows-registry.provenance.json +14 -0
  251. package/runtime/notices/diagnostics-10.0.750501.txt +23 -0
  252. package/runtime/tool-catalog.json +290 -0
  253. package/runtime/toolbox.json +1401 -0
  254. package/skill-bundle/insight-artifacts/SKILL.md +30 -0
  255. package/skill-bundle/insight-artifacts/references/agent-execution.md +36 -0
  256. package/skill-bundle/insight-artifacts/references/artifacts.md +52 -0
  257. package/skill-bundle/insight-binary/SKILL.md +46 -0
  258. package/skill-bundle/insight-binary/references/agent-execution.md +36 -0
  259. package/skill-bundle/insight-capture/SKILL.md +56 -0
  260. package/skill-bundle/insight-capture/references/agent-execution.md +36 -0
  261. package/skill-bundle/insight-cli/SKILL.md +42 -0
  262. package/skill-bundle/insight-cli/references/agent-execution.md +36 -0
  263. package/skill-bundle/insight-cli/references/agent-setup.md +61 -0
  264. package/skill-bundle/insight-die/SKILL.md +49 -0
  265. package/skill-bundle/insight-die/references/agent-execution.md +36 -0
  266. package/skill-bundle/insight-dnspy/SKILL.md +65 -0
  267. package/skill-bundle/insight-dnspy/references/agent-execution.md +36 -0
  268. package/skill-bundle/insight-dotnet-dump/SKILL.md +46 -0
  269. package/skill-bundle/insight-dotnet-dump/references/agent-execution.md +36 -0
  270. package/skill-bundle/insight-dotnet-stack/SKILL.md +39 -0
  271. package/skill-bundle/insight-dotnet-stack/references/agent-execution.md +36 -0
  272. package/skill-bundle/insight-dotnet-trace/SKILL.md +45 -0
  273. package/skill-bundle/insight-dotnet-trace/references/agent-execution.md +36 -0
  274. package/skill-bundle/insight-frida/SKILL.md +67 -0
  275. package/skill-bundle/insight-frida/references/agent-execution.md +36 -0
  276. package/skill-bundle/insight-ghidra/SKILL.md +91 -0
  277. package/skill-bundle/insight-ghidra/references/administration.md +34 -0
  278. package/skill-bundle/insight-ghidra/references/agent-execution.md +36 -0
  279. package/skill-bundle/insight-ghidra/references/archive.md +32 -0
  280. package/skill-bundle/insight-ghidra/references/artifacts.md +52 -0
  281. package/skill-bundle/insight-ghidra/references/debugger.md +62 -0
  282. package/skill-bundle/insight-ghidra/references/extensions-and-sync.md +124 -0
  283. package/skill-bundle/insight-ghidra/references/managed-runtime.md +157 -0
  284. package/skill-bundle/insight-ghidra/references/native-workflows.md +112 -0
  285. package/skill-bundle/insight-ghidra/references/query-semantics.md +96 -0
  286. package/skill-bundle/insight-ghidra/references/recovery.md +53 -0
  287. package/skill-bundle/insight-ghidra/references/research.md +101 -0
  288. package/skill-bundle/insight-ghidra/references/setup.md +50 -0
  289. package/skill-bundle/insight-ilspy/SKILL.md +45 -0
  290. package/skill-bundle/insight-ilspy/references/agent-execution.md +36 -0
  291. package/skill-bundle/insight-ilspy/references/ilspy.md +33 -0
  292. package/skill-bundle/insight-interop/SKILL.md +54 -0
  293. package/skill-bundle/insight-interop/references/agent-execution.md +36 -0
  294. package/skill-bundle/insight-lldb/SKILL.md +54 -0
  295. package/skill-bundle/insight-lldb/references/agent-execution.md +36 -0
  296. package/skill-bundle/insight-llvm/SKILL.md +56 -0
  297. package/skill-bundle/insight-llvm/references/agent-execution.md +36 -0
  298. package/skill-bundle/insight-managed-heap/SKILL.md +43 -0
  299. package/skill-bundle/insight-managed-heap/references/agent-execution.md +36 -0
  300. package/skill-bundle/insight-managed-metadata/SKILL.md +52 -0
  301. package/skill-bundle/insight-managed-metadata/references/agent-execution.md +36 -0
  302. package/skill-bundle/insight-mitmproxy/SKILL.md +62 -0
  303. package/skill-bundle/insight-mitmproxy/references/agent-execution.md +36 -0
  304. package/skill-bundle/insight-overview/SKILL.md +79 -0
  305. package/skill-bundle/insight-overview/references/agent-execution.md +36 -0
  306. package/skill-bundle/insight-procmon/SKILL.md +49 -0
  307. package/skill-bundle/insight-procmon/references/agent-execution.md +36 -0
  308. package/skill-bundle/insight-re/SKILL.md +121 -0
  309. package/skill-bundle/insight-re/references/agent-execution.md +36 -0
  310. package/skill-bundle/insight-re/references/artifacts.md +52 -0
  311. package/skill-bundle/insight-re/references/recovery.md +53 -0
  312. package/skill-bundle/insight-sevenzip/SKILL.md +42 -0
  313. package/skill-bundle/insight-sevenzip/references/agent-execution.md +36 -0
  314. package/skill-bundle/insight-strace/SKILL.md +46 -0
  315. package/skill-bundle/insight-strace/references/agent-execution.md +36 -0
  316. package/skill-bundle/insight-tshark/SKILL.md +49 -0
  317. package/skill-bundle/insight-tshark/references/agent-execution.md +36 -0
  318. package/skill-bundle/insight-windbg/SKILL.md +46 -0
  319. package/skill-bundle/insight-windbg/references/agent-execution.md +36 -0
  320. package/skill-bundle/manifest.json +32 -0
  321. package/skills/insight-artifacts/SKILL.md +30 -0
  322. package/skills/insight-artifacts/references/agent-execution.md +36 -0
  323. package/skills/insight-artifacts/references/artifacts.md +52 -0
  324. package/skills/insight-binary/SKILL.md +46 -0
  325. package/skills/insight-binary/references/agent-execution.md +36 -0
  326. package/skills/insight-capture/SKILL.md +56 -0
  327. package/skills/insight-capture/references/agent-execution.md +36 -0
  328. package/skills/insight-die/SKILL.md +49 -0
  329. package/skills/insight-die/references/agent-execution.md +36 -0
  330. package/skills/insight-dnspy/SKILL.md +65 -0
  331. package/skills/insight-dnspy/references/agent-execution.md +36 -0
  332. package/skills/insight-dotnet-dump/SKILL.md +46 -0
  333. package/skills/insight-dotnet-dump/references/agent-execution.md +36 -0
  334. package/skills/insight-dotnet-stack/SKILL.md +39 -0
  335. package/skills/insight-dotnet-stack/references/agent-execution.md +36 -0
  336. package/skills/insight-dotnet-trace/SKILL.md +45 -0
  337. package/skills/insight-dotnet-trace/references/agent-execution.md +36 -0
  338. package/skills/insight-frida/SKILL.md +67 -0
  339. package/skills/insight-frida/references/agent-execution.md +36 -0
  340. package/skills/insight-ghidra/SKILL.md +91 -0
  341. package/skills/insight-ghidra/references/administration.md +34 -0
  342. package/skills/insight-ghidra/references/agent-execution.md +36 -0
  343. package/skills/insight-ghidra/references/archive.md +32 -0
  344. package/skills/insight-ghidra/references/artifacts.md +52 -0
  345. package/skills/insight-ghidra/references/debugger.md +62 -0
  346. package/skills/insight-ghidra/references/extensions-and-sync.md +124 -0
  347. package/skills/insight-ghidra/references/managed-runtime.md +157 -0
  348. package/skills/insight-ghidra/references/native-workflows.md +112 -0
  349. package/skills/insight-ghidra/references/query-semantics.md +96 -0
  350. package/skills/insight-ghidra/references/recovery.md +53 -0
  351. package/skills/insight-ghidra/references/research.md +101 -0
  352. package/skills/insight-ghidra/references/setup.md +50 -0
  353. package/skills/insight-ilspy/SKILL.md +45 -0
  354. package/skills/insight-ilspy/references/agent-execution.md +36 -0
  355. package/skills/insight-ilspy/references/ilspy.md +33 -0
  356. package/skills/insight-interop/SKILL.md +54 -0
  357. package/skills/insight-interop/references/agent-execution.md +36 -0
  358. package/skills/insight-lldb/SKILL.md +54 -0
  359. package/skills/insight-lldb/references/agent-execution.md +36 -0
  360. package/skills/insight-llvm/SKILL.md +56 -0
  361. package/skills/insight-llvm/references/agent-execution.md +36 -0
  362. package/skills/insight-managed-heap/SKILL.md +43 -0
  363. package/skills/insight-managed-heap/references/agent-execution.md +36 -0
  364. package/skills/insight-managed-metadata/SKILL.md +52 -0
  365. package/skills/insight-managed-metadata/references/agent-execution.md +36 -0
  366. package/skills/insight-mitmproxy/SKILL.md +62 -0
  367. package/skills/insight-mitmproxy/references/agent-execution.md +36 -0
  368. package/skills/insight-overview/SKILL.md +79 -0
  369. package/skills/insight-overview/references/agent-execution.md +36 -0
  370. package/skills/insight-procmon/SKILL.md +49 -0
  371. package/skills/insight-procmon/references/agent-execution.md +36 -0
  372. package/skills/insight-re/SKILL.md +22 -9
  373. package/skills/insight-re/references/agent-execution.md +36 -0
  374. package/skills/insight-re/references/artifacts.md +52 -0
  375. package/skills/insight-re/references/recovery.md +53 -0
  376. package/skills/insight-sevenzip/SKILL.md +42 -0
  377. package/skills/insight-sevenzip/references/agent-execution.md +36 -0
  378. package/skills/insight-strace/SKILL.md +46 -0
  379. package/skills/insight-strace/references/agent-execution.md +36 -0
  380. package/skills/insight-tshark/SKILL.md +49 -0
  381. package/skills/insight-tshark/references/agent-execution.md +36 -0
  382. package/skills/insight-windbg/SKILL.md +46 -0
  383. package/skills/insight-windbg/references/agent-execution.md +36 -0
  384. package/dist/src/runtime-archives.d.ts +0 -5
@@ -0,0 +1,99 @@
1
+ import { command, Permission } from '@eyeauras/cli-factory';
2
+ import { dirname, join, resolve } from 'node:path';
3
+ import { release } from 'node:os';
4
+ import { mkdir, writeFile, open, copyFile, chmod } from 'node:fs/promises';
5
+ import { constants } from 'node:fs';
6
+ import { randomUUID } from 'node:crypto';
7
+ import { ToolInstaller } from './tool-runtime/installer.js';
8
+ import { defineTool, lifecycleCommands } from './tool-runtime/definition.js';
9
+ import { catalogArtifact } from './tool-runtime/catalog.js';
10
+ import { runTool } from './tool-runtime/run.js';
11
+ import { fileSha256 } from './tool-runtime/archives.js';
12
+ import { fail, text, id } from './model.js';
13
+ import { number } from './research.js';
14
+ const rootOf = (executable) => dirname(dirname(executable));
15
+ function supported() { if (process.platform !== 'darwin' || process.arch !== 'arm64' || Number(release().split('.')[0]) < 23)
16
+ fail('unsupported', 'This LLDB facade requires macOS 14+ ARM64. Imported PE/ELF files cannot be executed on this host.'); }
17
+ export function lldbInstaller(c) { return new ToolInstaller(c, { id: 'lldb', primary: 'lldb', components: () => { supported(); return { lldb: catalogArtifact('3df8fefb9f15fd80d250dc78517a659f4ec67159f73fdc5df71b7100709213d5') }; }, launch: roots => ({ executable: join(roots.lldb, 'bin/lldb'), arguments: [], environment: {} }), externalInputs: async (executable) => { supported(); const root = rootOf(executable); return { debugserver: await fileSha256(join(root, 'bin/debugserver')), liblldb: await fileSha256(join(root, 'lib/liblldb.23.1.dylib')) }; }, probe: async (launch, context) => { supported(); const r = await runTool(context, { tool: 'lldb', role: 'version', executable: launch.executable, arguments: ['--no-lldbinit', '--version'], maxOutputBytes: 65536, timeoutMs: 10000, nativeDeadline: true }); if (!/lldb version 23\.1\.3\b/.test(r.stdout))
18
+ fail('configuration', 'Select LLDB 23.1.3 with adjacent bin/debugserver and lib/liblldb.23.1.dylib.'); await fileSha256(join(rootOf(launch.executable), 'bin/debugserver')); await fileSha256(join(rootOf(launch.executable), 'lib/liblldb.23.1.dylib')); return { version: '23.1.3', ownedLaunchOnly: true, detachOnError: false, kernelDeadline: true }; } }); }
19
+ const quote = (value) => { if (/[\x00-\x1f\x7f`]/.test(value))
20
+ fail('invalid', 'Debugger arguments must not contain control characters or LLDB expression delimiters (backticks).'); return '"' + value.replaceAll('\\', '\\\\').replaceAll('"', '\\"') + '"'; };
21
+ export function lldbPlan(o) {
22
+ const breakpoint = text(o.breakpoint, 512), address = /^0x[0-9a-fA-F]{1,16}$/.test(breakpoint);
23
+ if (breakpoint.startsWith('0x') && !address)
24
+ fail('invalid', 'A breakpoint address must be a hexadecimal unsigned 64-bit file address.');
25
+ const hit = number(o.hit ?? 1, 10000, 1), registers = text(o.registers ?? 'pc,sp,x0', 512).split(',');
26
+ if (registers.length > 64 || registers.some(r => !(/^[a-zA-Z][a-zA-Z0-9_]{0,31}$/).test(r)))
27
+ fail('invalid', 'Registers must be comma-separated native register names.');
28
+ const args = o.arg === undefined ? [] : Array.isArray(o.arg) ? o.arg : [o.arg];
29
+ if (args.length > 64)
30
+ fail('limit', 'At most 64 literal program arguments are supported.');
31
+ const commands = ['settings set auto-confirm true', 'settings set target.detach-on-error false', 'settings set target.disable-stdio true', 'breakpoint set --one-shot true --ignore-count ' + (hit - 1) + ' ' + (address ? '--address ' : '--name ') + quote(breakpoint), 'process launch --shell-expand-args false -- ' + args.map(v => quote(text(v, 4096))).join(' '), ...(o.variables || o.symbols ? ['frame variable --depth 2'] : []), 'register read ' + registers.join(' '), 'thread backtrace --count 32'];
32
+ if (o.memoryAddress !== undefined) {
33
+ const at = text(o.memoryAddress, 64);
34
+ if (!/^0x[0-9a-fA-F]{1,16}$/.test(at) && !/^\$[a-zA-Z][a-zA-Z0-9_]{0,31}$/.test(at))
35
+ fail('invalid', 'Memory address must be a hexadecimal runtime address or $register.');
36
+ commands.push('memory read --format x --size 1 --count ' + number(o.memoryBytes ?? 64, 4096, 1) + ' ' + at);
37
+ }
38
+ else if (o.memoryBytes !== undefined)
39
+ fail('invalid', '--memory-bytes requires --memory-address.');
40
+ if (o.stepOut)
41
+ commands.push('thread step-out', 'register read ' + registers.join(' '));
42
+ commands.push('process kill', 'quit');
43
+ return commands;
44
+ }
45
+ export function lldbSnapshot(stdout) {
46
+ const inferior = Number(stdout.match(/Process (\d+) launched:/)?.[1]);
47
+ if (!inferior || !(/stop reason = (?:one-shot )?breakpoint/).test(stdout) || !new RegExp('Process ' + inferior + ' exited with status').test(stdout))
48
+ fail('partial', 'LLDB did not complete the requested breakpoint snapshot and inferior cleanup; inspect native diagnostics.');
49
+ return { inferiorPid: inferior, lines: stdout.trimEnd().split(/\r?\n/) };
50
+ }
51
+ export function lldbCommands(workspace) {
52
+ const definition = defineTool({ id: 'lldb', description: 'Observe an owned native launch at a breakpoint, inspect state and terminate it', components: [{ id: 'lldb', version: '23.1.3', artifacts: [] }], lifecycle: { download: (o, c) => lldbInstaller(c).download(Boolean(o.offline)), install: (o, c) => lldbInstaller(c).install(o), uninstall: (o, c) => lldbInstaller(c).uninstall(Boolean(o.purgeCache)), doctor: (_o, c) => lldbInstaller(c).doctor(), status: (_o, c) => lldbInstaller(c).status() } });
53
+ return [command('lldb', definition.description, [...lifecycleCommands(definition), command('inspect [input]', 'Launch an owned copy, capture a breakpoint snapshot, optionally step out, then kill the inferior', async ({ args, options: o }, c) => {
54
+ supported();
55
+ if (Boolean(args.input) === Boolean(o.target))
56
+ fail('invalid', 'Supply exactly one input path or --target.');
57
+ const commands = lldbPlan(o), limit = number(o.limit ?? 200, 1000, 1), offset = number(o.offset ?? 0, 1000000), timeoutMs = number(o.timeoutSeconds ?? 30, 600, 1) * 1000;
58
+ const w = workspace(c), target = args.input ? await w.importTarget(resolve(c.cwd, text(args.input, 4096))) : w.target(id(o.target)), input = await w.artifacts.verify(target.input), header = Buffer.alloc(32), handle = await open(input, 'r');
59
+ try {
60
+ await handle.read(header, 0, 32, 0);
61
+ }
62
+ finally {
63
+ await handle.close();
64
+ }
65
+ // A captured Mach-O is executable only in its own platform. Never execute an imported PE/ELF.
66
+ const magic = header.subarray(0, 4).toString('hex');
67
+ if (!['cffaedfe', 'feedfacf'].includes(magic) || (magic === 'cffaedfe' ? header.readUInt32LE(4) : header.readUInt32BE(4)) !== 0x0100000c)
68
+ fail('unsupported', 'LLDB owned launch requires a thin ARM64 Mach-O input on this host.');
69
+ const directory = join(c.appArguments.AppDataDirectory, 'runtime/lldb/subjects', randomUUID()), subject = join(directory, 'subject');
70
+ await mkdir(directory, { recursive: true, mode: 0o700 });
71
+ await copyFile(input, subject, constants.COPYFILE_EXCL);
72
+ await chmod(subject, 0o700);
73
+ if (await fileSha256(subject) !== target.binarySha256)
74
+ fail('binding', 'Owned launch bytes differ from the immutable target.');
75
+ const symbols = o.symbols ? await w.artifacts.capture(resolve(c.cwd, text(o.symbols, 4096)), 'input') : undefined;
76
+ if (symbols)
77
+ commands.unshift('target symbols add ' + quote(await w.artifacts.verify(symbols)));
78
+ return lldbInstaller(c).use(async (selected) => {
79
+ const result = await runTool(c, { tool: 'lldb', role: 'inspect', installation: selected.id, executable: selected.executable, arguments: ['--no-lldbinit', '--batch', ...commands.flatMap(command => ['-o', command]), '--', subject], environment: { ...selected.environment, LLDB_DEBUGSERVER_PATH: join(rootOf(selected.executable), 'bin/debugserver') }, cwd: directory, target: target.id, timeoutMs, nativeDeadline: true }), snapshot = lldbSnapshot(result.stdout);
80
+ // Observation only: never signal a PID parsed from native text. LLDB owns inferior termination.
81
+ try {
82
+ process.kill(snapshot.inferiorPid, 0);
83
+ fail('partial', 'LLDB reported cleanup but its inferior PID remains present; inspect diagnostics.');
84
+ }
85
+ catch (error) {
86
+ if (error.code !== 'ESRCH')
87
+ throw error;
88
+ }
89
+ const base = { state: 'completed', target: target.id, inputSha256: target.binarySha256, ...(symbols ? { symbolsSha256: symbols.sha256 } : {}), process: result.process, inferiorPid: snapshot.inferiorPid, inferiorTerminated: true, elapsedMs: result.elapsedMs, diagnostics: result.diagnostics, stderr: result.stderr, coverage: 'One owned launch and selected breakpoint observation; executing the input can have application side effects. Static addresses require image correspondence; runtime addresses vary with ASLR.' };
90
+ if (o.output) {
91
+ const output = resolve(c.cwd, text(o.output, 4096)), content = JSON.stringify({ ...base, lines: snapshot.lines }, null, 2) + '\n';
92
+ await mkdir(dirname(output), { recursive: true, mode: 0o700 });
93
+ await writeFile(output, content, { flag: 'wx', mode: 0o600 });
94
+ return { ...base, output, bytes: Buffer.byteLength(content), totalLines: snapshot.lines.length };
95
+ }
96
+ return { ...base, lines: snapshot.lines.slice(offset, offset + limit), offset, limit, totalLines: snapshot.lines.length, truncated: offset + limit < snapshot.lines.length };
97
+ });
98
+ }, { permission: Permission.Update, options: [{ flags: '--target <id>', description: 'Reuse an immutable captured Mach-O target' }, { flags: '--breakpoint <function-or-address>', description: 'Required function name or 0x file address' }, { flags: '--hit <number>', description: 'Observe the selected hit (1–10000)', defaultValue: 1 }, { flags: '--arg <literal...>', description: 'Literal program arguments; no shell expansion' }, { flags: '--symbols <file>', description: 'Capture and load a matching DWARF companion file (inside .dSYM/Contents/Resources/DWARF)' }, { flags: '--variables', description: 'Also request local variables; requires usable debug information' }, { flags: '--registers <names>', description: 'Comma-separated registers', defaultValue: 'pc,sp,x0' }, { flags: '--memory-address <address>', description: 'Optional runtime 0x address or $register' }, { flags: '--memory-bytes <bytes>', description: 'Bytes to read (1–4096)', defaultValue: undefined }, { flags: '--step-out', description: 'Return from the stopped function and capture registers again' }, { flags: '--output <file>', description: 'Save the full bounded snapshot to a new JSON file' }, { flags: '--limit <count>', description: 'Maximum native output lines (1–1000)', defaultValue: 200 }, { flags: '--offset <count>', description: 'Skip native output lines', defaultValue: 0 }, { flags: '--timeout-seconds <seconds>', description: 'Owned launch deadline (1–600), retained after owner loss', defaultValue: 30 }] })])];
99
+ }
@@ -0,0 +1,6 @@
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 llvmInstaller(c: CommandContext): ToolInstaller;
5
+ export declare function llvmAddress(value: unknown): bigint;
6
+ export declare function llvmCommands(workspace: (c: CommandContext) => Workspace): CommandDefinition[];
@@ -0,0 +1,133 @@
1
+ import { command, Permission } from '@eyeauras/cli-factory';
2
+ import { join, resolve, dirname } from 'node:path';
3
+ import { release } from 'node:os';
4
+ import { open, mkdir, writeFile } from 'node:fs/promises';
5
+ import { ToolInstaller } from './tool-runtime/installer.js';
6
+ import { defineTool, lifecycleCommands } from './tool-runtime/definition.js';
7
+ import { catalogArtifact } from './tool-runtime/catalog.js';
8
+ import { fileSha256 } from './tool-runtime/archives.js';
9
+ import { runTool } from './tool-runtime/run.js';
10
+ import { fail, text, id } from './model.js';
11
+ import { number } from './research.js';
12
+ const utilities = ['llvm-readobj', 'llvm-objdump', 'llvm-nm', 'llvm-pdbutil'];
13
+ const executable = (primary, name) => name === 'llvm-readobj' ? primary : join(dirname(primary), name + (process.platform === 'win32' ? '.exe' : ''));
14
+ export function llvmInstaller(c) {
15
+ return new ToolInstaller(c, { id: 'llvm', primary: 'llvm', components: () => {
16
+ if (process.platform !== 'darwin' || process.arch !== 'arm64' || Number(release().split('.')[0]) < 23)
17
+ fail('unsupported', 'Managed LLVM utilities require macOS 14+ ARM64; select an external compatible llvm-readobj with its three sibling utilities.');
18
+ return { llvm: catalogArtifact('2599cb40282085a61a3d8b50003d75d556010d764c05a9bf30e45a7c7b5b7861') };
19
+ }, launch: roots => ({ executable: join(roots.llvm, 'bin/llvm-readobj'), arguments: [], environment: {} }),
20
+ externalInputs: async (primary) => { const hashes = {}; for (const name of utilities)
21
+ try {
22
+ hashes[name] = await fileSha256(executable(primary, name), c.signal);
23
+ }
24
+ catch {
25
+ c.signal.throwIfAborted();
26
+ fail('configuration', 'External LLVM requires all four pinned sibling utilities in the executable directory.', { missing: name });
27
+ } return hashes; },
28
+ probe: async (launch, context) => {
29
+ const versions = {};
30
+ for (const name of utilities) {
31
+ const r = await runTool(context, { tool: 'llvm', role: 'version', executable: executable(launch.executable, name), arguments: ['--version'], maxOutputBytes: 65536, timeoutMs: 30000 });
32
+ if (!/\bLLVM version 23\.1\.3\b/.test(r.stdout))
33
+ fail('configuration', 'The selected LLVM family must provide version 23.1.3.', { utility: name });
34
+ versions[name] = '23.1.3';
35
+ }
36
+ return { versions, managedMinimumMacOS: '14.0' };
37
+ } });
38
+ }
39
+ export function llvmAddress(value) { const v = text(value, 18); if (!/^0x[0-9a-fA-F]{1,16}$/.test(v))
40
+ fail('invalid', 'Address must be an explicit 0x-prefixed unsigned virtual address.'); return BigInt(v); }
41
+ async function format(path) {
42
+ const file = await open(path, 'r'), magic = Buffer.alloc(4);
43
+ try {
44
+ await file.read(magic, 0, 4, 0);
45
+ }
46
+ finally {
47
+ await file.close();
48
+ }
49
+ if (magic.subarray(0, 2).toString() === 'MZ')
50
+ return 'pe';
51
+ if (magic.toString('hex') === '7f454c46')
52
+ return 'elf';
53
+ if (['feedface', 'cefaedfe', 'feedfacf', 'cffaedfe', 'cafebabe', 'bebafeca', 'cafebabf', 'bfbafeca'].includes(magic.toString('hex')))
54
+ return 'macho';
55
+ return 'other';
56
+ }
57
+ export function llvmCommands(workspace) {
58
+ const definition = defineTool({ id: 'llvm', description: 'Inspect native binary structure, symbols, instructions and PDBs', components: [{ id: 'llvm', version: '23.1.3', artifacts: [] }], lifecycle: { download: (o, c) => llvmInstaller(c).download(Boolean(o.offline)), install: (o, c) => llvmInstaller(c).install(o), uninstall: (o, c) => llvmInstaller(c).uninstall(Boolean(o.purgeCache)), doctor: (_o, c) => llvmInstaller(c).doctor(), status: (_o, c) => llvmInstaller(c).status() } });
59
+ const common = [{ flags: '--target <id>', description: 'Reuse an immutable research target' }, { flags: '--output <file>', description: 'Write full bounded native text to a new ordinary file' },
60
+ { flags: '--limit <count>', description: 'Maximum native text lines returned (1–400)', defaultValue: 100 }, { flags: '--offset <count>', description: 'Skip native text lines', defaultValue: 0 },
61
+ { flags: '--filter <text>', description: 'Select matching native lines; surrounding context may be outside the selection' }, { flags: '--timeout-seconds <seconds>', description: 'Deadline per native process (1–600)', defaultValue: 120 }];
62
+ const operation = (name, options = []) => command(name + ' [input]', 'Native ' + name + ' through pinned LLVM utilities', async ({ args, options: o }, c) => {
63
+ if (Boolean(args.input) === Boolean(o.target))
64
+ fail('invalid', 'Supply exactly one input path or --target.');
65
+ const w = workspace(c), target = args.input ? await w.importTarget(resolve(c.cwd, text(args.input, 4096))) : w.target(id(o.target)), input = await w.artifacts.verify(target.input);
66
+ const kind = await format(input), timeoutMs = number(o.timeoutSeconds, 600, 1) * 1000, limit = number(o.limit, 400, 1), offset = number(o.offset, 10000000, 0);
67
+ const calls = [];
68
+ if (name === 'headers' || name === 'sections')
69
+ calls.push({ utility: 'llvm-readobj', arguments: [name === 'headers' ? '--file-header' : '--sections', input] });
70
+ if (name === 'section-data') {
71
+ const section = text(o.section, 256);
72
+ if (!/^[a-zA-Z0-9_.+,$-]+$/.test(section))
73
+ fail('invalid', 'Section name must be an exact native section name.');
74
+ calls.push({ utility: 'llvm-readobj', arguments: ['--hex-dump=' + section, input] });
75
+ }
76
+ if (name === 'imports') {
77
+ if (kind === 'pe')
78
+ calls.push({ utility: 'llvm-readobj', arguments: ['--coff-imports', input] });
79
+ else if (kind === 'elf')
80
+ calls.push({ utility: 'llvm-readobj', arguments: ['--needed-libs', input] }, { utility: 'llvm-nm', arguments: ['--dynamic', '--undefined-only', '--format=posix', input] });
81
+ else if (kind === 'macho')
82
+ calls.push({ utility: 'llvm-objdump', arguments: ['--macho', '--dylibs-used', input] }, { utility: 'llvm-nm', arguments: ['--undefined-only', '--format=posix', input] });
83
+ else
84
+ fail('unsupported', 'Import linkage view requires a PE, ELF or Mach-O image.');
85
+ }
86
+ if (name === 'exports') {
87
+ if (kind === 'pe')
88
+ calls.push({ utility: 'llvm-readobj', arguments: ['--coff-exports', input] });
89
+ else if (kind === 'elf' || kind === 'macho')
90
+ calls.push({ utility: 'llvm-nm', arguments: [...(kind === 'elf' ? ['--dynamic'] : []), '--defined-only', '--extern-only', '--format=posix', input] });
91
+ else
92
+ fail('unsupported', 'Export linkage view requires a PE, ELF or Mach-O image.');
93
+ }
94
+ if (name === 'symbols')
95
+ calls.push({ utility: 'llvm-nm', arguments: ['--format=posix', ...(o.undefinedOnly ? ['--undefined-only'] : []), input] });
96
+ if (name === 'disassemble') {
97
+ const start = llvmAddress(o.address), length = number(o.bytes, 4096, 1), end = start + BigInt(length);
98
+ if (end > 0xffffffffffffffffn)
99
+ fail('invalid', 'Disassembly interval overflows a 64-bit address.');
100
+ calls.push({ utility: 'llvm-objdump', arguments: ['--disassemble', '--demangle', '--start-address=0x' + start.toString(16), '--stop-address=0x' + end.toString(16), input] });
101
+ }
102
+ if (name === 'pdb') {
103
+ const view = text(o.view, 16);
104
+ if (!['summary', 'modules', 'globals', 'publics', 'symbols', 'types'].includes(view))
105
+ fail('invalid', 'PDB view must be summary, modules, globals, publics, symbols or types.');
106
+ if (o.typeIndex && view !== 'types' || o.symbol && view !== 'globals')
107
+ fail('invalid', 'type-index is for types; symbol is for globals.');
108
+ if (o.typeIndex && llvmAddress(o.typeIndex) > 0xffffffffn)
109
+ fail('invalid', 'PDB type index exceeds 32 bits.');
110
+ const flags = view === 'types' ? (o.typeIndex ? ['--types', '--type-index=0x' + llvmAddress(o.typeIndex).toString(16)] : ['--type-stats']) : ['--' + view];
111
+ if (o.module !== undefined)
112
+ flags.push('--modi=' + number(o.module, 1000000, 0));
113
+ if (o.symbol)
114
+ flags.push('--global-name=' + text(o.symbol, 1024));
115
+ calls.push({ utility: 'llvm-pdbutil', arguments: ['dump', ...flags, input] });
116
+ }
117
+ return llvmInstaller(c).use(async (selected) => {
118
+ const results = [];
119
+ for (const call of calls)
120
+ results.push({ ...call, result: await runTool(c, { tool: 'llvm', role: name, installation: selected.id, executable: executable(selected.executable, call.utility), arguments: call.arguments, environment: selected.environment, target: target.id, timeoutMs }) });
121
+ const content = results.map(r => r.utility + '\n' + r.result.stdout).join('\n'), base = { state: 'completed', target: target.id, inputSha256: target.binarySha256, fileFormat: kind, format: 'native-text', processes: results.map(r => ({ utility: r.utility, process: r.result.process, diagnostics: r.result.diagnostics, elapsedMs: r.result.elapsedMs })) };
122
+ if (o.output) {
123
+ const output = resolve(c.cwd, text(o.output, 4096));
124
+ await mkdir(dirname(output), { recursive: true, mode: 0o700 });
125
+ await writeFile(output, content, { flag: 'wx', mode: 0o600 });
126
+ return { ...base, output, bytes: Buffer.byteLength(content) };
127
+ }
128
+ const all = content.trimEnd().split(/\r?\n/), lines = o.filter ? all.filter(l => l.includes(text(o.filter, 1024))) : all;
129
+ return { ...base, content: lines.slice(offset, offset + limit).join('\n'), totalLines: lines.length, offset, limit, truncated: offset + limit < lines.length };
130
+ });
131
+ }, { permission: Permission.Update, options: [...common, ...options] });
132
+ return [command('llvm', definition.description, [...lifecycleCommands(definition), ...['headers', 'sections', 'imports', 'exports'].map(n => operation(n)), operation('section-data', [{ flags: '--section <name>', description: 'Exact section name; bounded hexadecimal contents, not virtual memory', required: true }]), operation('symbols', [{ flags: '--undefined-only', description: 'Only undefined symbols' }]), operation('disassemble', [{ flags: '--address <virtual-address>', description: 'Start virtual address, not a file offset', required: true }, { flags: '--bytes <count>', description: 'Byte interval (1–4096)', defaultValue: 128 }]), operation('pdb', [{ flags: '--view <name>', description: 'summary, modules, globals, publics, symbols or types', defaultValue: 'summary' }, { flags: '--module <index>', description: 'Focus a compiland by its numeric module index' }, { flags: '--symbol <name>', description: 'Exact global symbol name' }, { flags: '--type-index <0x-index>', description: 'Inspect one hexadecimal type record instead of type statistics' }])])];
133
+ }
@@ -0,0 +1,4 @@
1
+ import { type CommandContext, type CommandDefinition } from '@eyeauras/cli-factory';
2
+ import type { ToolInstaller } from './tool-runtime/installer.js';
3
+ import type { Workspace } from './workspace.js';
4
+ export declare function managedHeapCommand(workspace: (c: CommandContext) => Workspace, installer: (c: CommandContext) => ToolInstaller): CommandDefinition;
@@ -0,0 +1,73 @@
1
+ import { command, Permission, CliError } from '@eyeauras/cli-factory';
2
+ import { join, resolve, dirname, basename } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { mkdir, writeFile } from 'node:fs/promises';
5
+ import { randomUUID } from 'node:crypto';
6
+ import { dotnetLaunch } from './tool-runtime/dotnet.js';
7
+ import { runTool } from './tool-runtime/run.js';
8
+ import { atomicWrite } from './tool-runtime/store.js';
9
+ import { fileSha256 } from './tool-runtime/archives.js';
10
+ import { fail, text, id } from './model.js';
11
+ import { number } from './research.js';
12
+ const helper = fileURLToPath(new URL('../../runtime/managed/insight-heap/Insight.Heap.dll', import.meta.url));
13
+ export function managedHeapCommand(workspace, installer) {
14
+ return command('query [input]', 'Read bounded managed heap objects, fields and stacks from one immutable dump', async ({ args, options: o }, c) => {
15
+ if (process.platform !== 'darwin' || process.arch !== 'arm64')
16
+ fail('unsupported', 'The structured ClrMD facade is verified for matching macOS ARM64 CoreCLR dumps. Other native DAC profiles remain unverified.');
17
+ if (Boolean(args.input) === Boolean(o.target))
18
+ fail('invalid', 'Supply one dump input or --target.');
19
+ const view = text(o.view ?? 'overview', 16);
20
+ if (!['overview', 'objects', 'object', 'stacks'].includes(view))
21
+ fail('invalid', 'Use overview, objects, object or stacks.');
22
+ const address = o.address === undefined ? undefined : text(o.address, 18);
23
+ if ((view === 'object') !== Boolean(address) || address && !/^0x[0-9a-fA-F]{1,16}$/.test(address))
24
+ fail('invalid', 'Only object view requires a dump-scoped hexadecimal --address.');
25
+ if (o.thread !== undefined && view !== 'stacks')
26
+ fail('invalid', '--thread selects an OS thread in stacks view.');
27
+ const limit = number(o.limit ?? 50, 500, 1), offset = number(o.offset ?? 0, 1000000), maxObjects = number(o.maxObjects ?? 1000000, 1000000, 1), runtime = number(o.runtimeIndex ?? 0, 15);
28
+ const w = workspace(c), target = args.input ? await w.importTarget(resolve(c.cwd, text(args.input, 4096))) : w.target(id(o.target)), input = await w.artifacts.verify(target.input);
29
+ if (target.input.size > 4 * 1024 ** 3)
30
+ fail('limit', 'Dump input exceeds four GiB.');
31
+ return installer(c).use(async (selected) => {
32
+ let launch;
33
+ if (selected.roots.dotnet)
34
+ launch = dotnetLaunch(selected.roots.dotnet, helper);
35
+ else {
36
+ if (!o.dotnetHost)
37
+ fail('configuration', 'An external diagnostics selection requires an explicit compatible --dotnet-host and --dac-file.');
38
+ const host = resolve(c.cwd, text(o.dotnetHost, 4096));
39
+ if (!['dotnet', 'dotnet.exe'].includes(basename(host).toLowerCase()))
40
+ fail('invalid', 'Select a compatible .NET 10 host.');
41
+ await fileSha256(host);
42
+ launch = { executable: host, arguments: [helper], environment: { DOTNET_ROOT: dirname(host), DOTNET_MULTILEVEL_LOOKUP: '0', DOTNET_CLI_TELEMETRY_OPTOUT: '1' } };
43
+ }
44
+ const dac = o.dacFile ? resolve(c.cwd, text(o.dacFile, 4096)) : selected.roots.dotnet ? join(selected.roots.dotnet, 'shared/Microsoft.NETCore.App/10.0.13/libmscordaccore.dylib') : undefined;
45
+ if (!dac)
46
+ fail('configuration', 'Select an explicit matching native --dac-file.');
47
+ if (basename(dac) !== 'libmscordaccore.dylib')
48
+ fail('invalid', 'Select the matching CoreCLR macOS DAC library, not a target assembly.');
49
+ const dacSha256 = await fileSha256(dac), directory = join(c.appArguments.AppDataDirectory, 'runtime/managed-heap/queries', randomUUID()), plan = join(directory, 'plan.json');
50
+ await atomicWrite(plan, { schema: 1, input, dac, view, address, type: o.type === undefined ? undefined : text(o.type, 4096), thread: o.thread === undefined ? undefined : number(o.thread, 4294967295, 1), runtime, limit, offset, maxObjects });
51
+ const result = await runTool(c, { tool: 'dotnet-dump', role: 'structured-query', installation: selected.id, executable: launch.executable, arguments: [...launch.arguments, plan], environment: { ...launch.environment, DOTNET_EnableDiagnostics: '0' }, nativeDeadline: true, timeoutMs: 60000, maxOutputBytes: 8 * 1024 ** 2, target: target.id, metadata: { view, helperSha256: await fileSha256(helper), dacSha256 } });
52
+ let observation;
53
+ try {
54
+ observation = JSON.parse(result.stdout);
55
+ }
56
+ catch {
57
+ throw new CliError('Dump query did not return complete bounded JSON.', { code: 'tool.partial', result: { process: result.process, diagnostics: result.diagnostics } });
58
+ }
59
+ if (!['completed', 'partial'].includes(observation?.state) || typeof observation.complete !== 'boolean')
60
+ fail('partial', 'Dump query receipt was not verified.', { process: result.process, diagnostics: result.diagnostics });
61
+ if (await fileSha256(input) !== target.binarySha256 || await fileSha256(dac) !== dacSha256)
62
+ fail('binding', 'Dump or explicit DAC changed during the query.');
63
+ const value = { ...observation, target: target.id, inputSha256: target.binarySha256, dacSha256, dacSelection: o.dacFile ? 'explicit-local' : 'managed-10.0.13', process: result.process, elapsedMs: result.elapsedMs, diagnostics: result.diagnostics };
64
+ if (o.output) {
65
+ const output = resolve(c.cwd, text(o.output, 4096)), content = JSON.stringify(value, null, 2) + '\n';
66
+ await mkdir(dirname(output), { recursive: true, mode: 0o700 });
67
+ await writeFile(output, content, { flag: 'wx', mode: 0o600 });
68
+ return { state: value.state, complete: value.complete, reason: value.reason, target: target.id, output, bytes: Buffer.byteLength(content), process: result.process, diagnostics: result.diagnostics };
69
+ }
70
+ return value;
71
+ });
72
+ }, { permission: Permission.Update, options: [{ flags: '--target <id>', description: 'Reuse captured immutable dump bytes' }, { flags: '--view <kind>', description: 'overview, objects, object or stacks', defaultValue: 'overview' }, { flags: '--type <name>', description: 'Exact heap type fullname; object view verifies the expected type' }, { flags: '--address <hex>', description: 'Object address from this exact dump' }, { flags: '--thread <id>', description: 'Dump-scoped OS thread ID for stacks' }, { flags: '--runtime-index <index>', description: 'CLR runtime index from overview', defaultValue: 0 }, { flags: '--dac-file <file>', description: 'Explicit matching trusted native CoreCLR DAC; managed default is 10.0.13' }, { flags: '--dotnet-host <file>', description: 'Compatible .NET 10 host for external diagnostics selection' }, { flags: '--max-objects <count>', description: 'Scan at most 1–1000000 objects; reaching this bound is partial', defaultValue: 1000000 }, { flags: '--limit <count>', description: 'Return 1–500 objects, fields or threads', defaultValue: 50 }, { flags: '--offset <count>', description: 'Skip matching rows', defaultValue: 0 }, { flags: '--output <file>', description: 'Save this bounded query to a new ordinary JSON file' }] });
73
+ }
@@ -0,0 +1,11 @@
1
+ import { type CommandContext, type CommandDefinition } from '@eyeauras/cli-factory';
2
+ import type { ToolInstaller, SelectedTool } from './tool-runtime/installer.js';
3
+ import type { Workspace } from './workspace.js';
4
+ export declare function metadataToken(value: unknown): number;
5
+ export declare function runManagedMetadata(c: CommandContext, selected: SelectedTool, plan: Record<string, unknown>, externalHost?: unknown): Promise<{
6
+ data: any;
7
+ process: string;
8
+ elapsedMs: number;
9
+ diagnostics: string;
10
+ }>;
11
+ export declare function managedMetadataCommands(workspace: (c: CommandContext) => Workspace, installer: (c: CommandContext) => ToolInstaller): CommandDefinition[];
@@ -0,0 +1,66 @@
1
+ import { command, Permission, CliError } from '@eyeauras/cli-factory';
2
+ import { join, resolve, dirname, basename } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { mkdir, writeFile } from 'node:fs/promises';
5
+ import { randomUUID } from 'node:crypto';
6
+ import { dotnetLaunch } from './tool-runtime/dotnet.js';
7
+ import { runTool } from './tool-runtime/run.js';
8
+ import { atomicWrite } from './tool-runtime/store.js';
9
+ import { fileSha256 } from './tool-runtime/archives.js';
10
+ import { fail, text, id } from './model.js';
11
+ import { number } from './research.js';
12
+ const helper = fileURLToPath(new URL('../../runtime/managed/insight-managed/Insight.Managed.dll', import.meta.url));
13
+ export function metadataToken(value) { const token = text(value, 16); if (!/^0x06[0-9a-fA-F]{6}$/.test(token) || Number(token) === 0x06000000)
14
+ fail('invalid', 'Select a nonzero MethodDef token (0x060000NN) from this exact managed target.'); return Number(token); }
15
+ async function input(c, w, path, target) { if (Boolean(path) === Boolean(target))
16
+ fail('invalid', 'Supply one managed input path or --target.'); const value = path ? await w.importTarget(resolve(c.cwd, text(path, 4096))) : w.target(id(target)); if (value.input.size > 64 * 1024 ** 2)
17
+ fail('limit', 'Static managed input exceeds 64 MiB.'); return { path: await w.artifacts.verify(value.input), target: value.id, sha256: value.binarySha256 }; }
18
+ export async function runManagedMetadata(c, selected, plan, externalHost) {
19
+ let launch;
20
+ if (selected.roots.dotnet)
21
+ launch = dotnetLaunch(selected.roots.dotnet, helper);
22
+ else {
23
+ if (!externalHost)
24
+ fail('configuration', 'Static metadata requires the managed ILSpy private runtime, or an explicit --dotnet-host for an external ILSpy selection.');
25
+ const host = resolve(c.cwd, text(externalHost, 4096));
26
+ if (!['dotnet', 'dotnet.exe'].includes(basename(host).toLowerCase()))
27
+ fail('invalid', 'Select a compatible dotnet host, not a shell or compiler.');
28
+ await fileSha256(host);
29
+ launch = { executable: host, arguments: [helper], environment: { DOTNET_ROOT: dirname(host), DOTNET_MULTILEVEL_LOOKUP: '0', DOTNET_CLI_TELEMETRY_OPTOUT: '1' } };
30
+ }
31
+ const directory = join(c.appArguments.AppDataDirectory, 'runtime/managed-metadata/queries', randomUUID()), file = join(directory, 'plan.json');
32
+ await atomicWrite(file, { schema: 1, ...plan });
33
+ const result = await runTool(c, { tool: 'ilspy', role: plan.mode === 'compare' ? 'assembly-comparison' : 'metadata-query', installation: selected.id, executable: launch.executable, arguments: [...launch.arguments, file], environment: { ...launch.environment, DOTNET_EnableDiagnostics: '0' }, nativeDeadline: true, timeoutMs: 60000, maxOutputBytes: 8 * 1024 ** 2, metadata: { helperSha256: await fileSha256(helper), operation: plan.mode, view: plan.view }, target: typeof plan.target === 'string' ? plan.target : undefined });
34
+ let data;
35
+ try {
36
+ data = JSON.parse(result.stdout);
37
+ }
38
+ catch {
39
+ throw new CliError('Managed helper did not return complete bounded JSON.', { code: 'tool.partial', result: { process: result.process, diagnostics: result.diagnostics } });
40
+ }
41
+ if (data?.state !== 'completed' || data.complete !== true)
42
+ fail('partial', 'Static managed metadata was not fully verified.', { process: result.process, diagnostics: result.diagnostics, observation: data });
43
+ return { data, process: result.process, elapsedMs: result.elapsedMs, diagnostics: result.diagnostics };
44
+ }
45
+ export function managedMetadataCommands(workspace, installer) {
46
+ const common = [{ flags: '--type <name>', description: 'Exact dnlib type fullname from a prior query' }, { flags: '--filter <text>', description: 'Literal case-sensitive full signature/name substring' }, { flags: '--name-filter <text>', description: 'Case-insensitive managed method name only; methods, imports, method or compare' }, { flags: '--limit <count>', description: 'Rows/instructions to return (1–1000)', defaultValue: 50 }, { flags: '--offset <count>', description: 'Skip matching rows/instructions', defaultValue: 0 }, { flags: '--dotnet-host <file>', description: 'Compatible .NET 10 host for an external ILSpy selection' }, { flags: '--output <file>', description: 'Save this bounded result/page to a new ordinary JSON file' }];
47
+ const run = (mode) => command(mode === 'query' ? 'query [input]' : 'compare <left> <right>', mode === 'query' ? 'Read structured managed metadata, P/Invoke and normalized IL without executing the target' : 'Compare managed signatures, normalized IL and P/Invoke across two immutable assemblies', async ({ args, options: o }, c) => {
48
+ const limit = number(o.limit ?? 50, 1000, 1), offset = number(o.offset ?? 0, 1000000), view = mode === 'query' ? text(o.view ?? 'overview', 16) : undefined;
49
+ if (view && !['overview', 'types', 'methods', 'method', 'imports'].includes(view))
50
+ fail('invalid', 'Use overview, types, methods, method or imports.');
51
+ if (o.nameFilter !== undefined && mode === 'query' && !['methods', 'imports', 'method'].includes(view))
52
+ fail('invalid', '--name-filter selects method names; use methods, imports or method view.');
53
+ const token = o.method === undefined ? undefined : metadataToken(o.method);
54
+ if (view === 'method' && token === undefined)
55
+ fail('invalid', 'Method view requires --method from this exact module.');
56
+ const w = workspace(c), a = await input(c, w, mode === 'query' ? args.input : args.left, mode === 'query' ? o.target : undefined), b = mode === 'compare' ? await input(c, w, args.right, undefined) : undefined;
57
+ return installer(c).use(async (selected) => { const result = await runManagedMetadata(c, selected, { mode, input: a.path, other: b?.path, view, type: o.type === undefined ? undefined : text(o.type, 4096), filter: o.filter === undefined ? undefined : text(o.filter, 4096), nameFilter: o.nameFilter === undefined ? undefined : text(o.nameFilter, 4096), token, limit, offset, target: a.target }, o.dotnetHost); if (await fileSha256(a.path) !== a.sha256 || b && await fileSha256(b.path) !== b.sha256)
58
+ fail('binding', 'Immutable metadata input changed during the query.'); const { data: observation, ...execution } = result; const output = { ...observation, state: 'completed', complete: true, ...(b ? { left: { target: a.target, inputSha256: a.sha256 }, right: { target: b.target, inputSha256: b.sha256 } } : { target: a.target, inputSha256: a.sha256 }), ...execution }; if (o.output) {
59
+ const file = resolve(c.cwd, text(o.output, 4096)), content = JSON.stringify(output, null, 2) + '\n';
60
+ await mkdir(dirname(file), { recursive: true, mode: 0o700 });
61
+ await writeFile(file, content, { flag: 'wx', mode: 0o600 });
62
+ return { state: 'completed', complete: true, target: a.target, output: file, bytes: Buffer.byteLength(content), process: result.process, diagnostics: result.diagnostics };
63
+ } return output; });
64
+ }, { permission: Permission.Update, options: [...common, ...(mode === 'query' ? [{ flags: '--target <id>', description: 'Reuse an immutable managed target' }, { flags: '--view <kind>', description: 'overview, types, methods, method or imports', defaultValue: 'overview' }, { flags: '--method <token>', description: 'MethodDef token (0x060000NN), required for method view' }] : [])] });
65
+ return [run('query'), run('compare')];
66
+ }
@@ -0,0 +1,55 @@
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 mitmproxyInstaller(c: CommandContext): ToolInstaller;
5
+ export declare function mitmproxyStatus(c: CommandContext): Promise<{
6
+ captures: {
7
+ endpoint?: string | undefined;
8
+ archive?: string | undefined;
9
+ caCertificate?: string | undefined;
10
+ process: string;
11
+ state: string;
12
+ ready: boolean;
13
+ }[];
14
+ retainedStages: string[];
15
+ processes: import("./tool-runtime/supervisor.js").ProcessRecord[];
16
+ tool: string;
17
+ state: string;
18
+ mode: string;
19
+ installation: string | undefined;
20
+ executable: string | undefined;
21
+ components: Record<string, string>;
22
+ lastProbe: Record<string, unknown> | undefined;
23
+ recommended: string;
24
+ }>;
25
+ interface Message {
26
+ bodyAvailable: boolean;
27
+ bodySha256: string | null;
28
+ bodyBase64: string | null;
29
+ bodyTruncated: boolean | null;
30
+ bodyBytes: number | null;
31
+ headers: [string, string][];
32
+ headersTruncated: boolean;
33
+ }
34
+ export interface HttpObservation {
35
+ kind: 'http';
36
+ id: string;
37
+ request: Message & {
38
+ method: string;
39
+ url: string;
40
+ host: string;
41
+ path: string;
42
+ };
43
+ response: (Message & {
44
+ statusCode: number;
45
+ }) | null;
46
+ error: string | null;
47
+ pending: boolean;
48
+ }
49
+ export declare function compareHttp(left: HttpObservation[], right: HttpObservation[]): {
50
+ items: Record<string, unknown>[];
51
+ unchanged: number;
52
+ scope: string;
53
+ };
54
+ export declare function mitmproxyCommands(workspace: (c: CommandContext) => Workspace): CommandDefinition[];
55
+ export {};