@eyeauras/insight-cli 0.1.0 → 0.2.0
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 +8 -2
- package/SKILL.md +4 -1
- package/dist/src/administration-results.js +1 -1
- package/dist/src/administration.d.ts +1 -1
- package/dist/src/administration.js +16 -2
- package/dist/src/cli.js +37 -5
- package/dist/src/contexts.js +12 -2
- package/dist/src/lifecycle.d.ts +1 -1
- package/dist/src/lifecycle.js +8 -2
- package/dist/src/native-inputs.js +12 -1
- package/dist/src/runtime-archives.d.ts +5 -0
- package/dist/src/runtime-archives.js +127 -0
- package/dist/src/runtime-catalog.d.ts +18 -0
- package/dist/src/runtime-catalog.js +27 -0
- package/dist/src/runtime-manager.d.ts +101 -0
- package/dist/src/runtime-manager.js +444 -0
- package/dist/src/runtime-selection.d.ts +13 -0
- package/dist/src/runtime-selection.js +25 -0
- package/dist/src/server.d.ts +2 -0
- package/dist/src/server.js +59 -54
- package/package.json +4 -2
- package/references/administration.md +2 -1
- package/references/managed-runtime.md +116 -0
- package/references/native/InsightRuntimeDoctor.java +33 -0
- package/references/setup.md +4 -2
- package/skills/insight-re/SKILL.md +1 -1
|
@@ -22,7 +22,8 @@ changing that project stays blocked; read-only inspection remains available. Par
|
|
|
22
22
|
export output does not prove success and is preserved. Retain receipts for continuation.
|
|
23
23
|
|
|
24
24
|
`ghidra server` operates on the configured local or external server. `status` reports connection
|
|
25
|
-
state
|
|
25
|
+
state, including a missing runtime before installation; `start/stop` manage the owned local
|
|
26
|
+
server (stop requires closed contexts). `connect` enables shared operations; `disconnect` releases the owned local server or the
|
|
26
27
|
external connection. Reconnect preserves repositories. Repository/file/history/checkout commands
|
|
27
28
|
require the explicit repository and relevant path. Admin actions require actual server authority
|
|
28
29
|
alongside Factory permissions. Changing ACLs preserves other users and anonymous access.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Managed Ghidra runtime
|
|
2
|
+
|
|
3
|
+
Use `ghidra install` for a complete compatible installation. Node 24+ is the bootstrap dependency;
|
|
4
|
+
no existing Java, Ghidra, Homebrew, Gradle, compiler or Python MCP bridge is required. Factory
|
|
5
|
+
profiles, permissions and OS secret storage remain in use. Follow the project's tool rules when
|
|
6
|
+
it specifies an external installation or server.
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
insight-cli profile create local
|
|
10
|
+
insight-cli --profile local permissions grant Update
|
|
11
|
+
insight-cli --profile local ghidra install
|
|
12
|
+
insight-cli --profile local ghidra status
|
|
13
|
+
insight-cli --profile local ghidra open ./client.exe --session new --json
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`download` caches the complete pinned Ghidra/JDK archives, without selecting or starting a runtime.
|
|
17
|
+
`install` uses that cache or downloads missing archives, unpacks to a new stage, checks JDK 21 and
|
|
18
|
+
Ghidra 12.1.2, decompiles a known x86 function and starts a disposable local Ghidra Server. The
|
|
19
|
+
server probe authenticates its identity and reader/publisher permissions. Selection changes only
|
|
20
|
+
after all checks pass. The bridge and helper sources come from the version-matched npm package.
|
|
21
|
+
A failed install preserves its stage/diagnostics and the old selection. Retrying uses a fresh stage;
|
|
22
|
+
completed cached archives are reused. A later install/doctor/uninstall authenticates and stops
|
|
23
|
+
any leftover disposable probe server before proceeding; an unverified live identity blocks recovery. Interrupted partial downloads are never used as complete files.
|
|
24
|
+
|
|
25
|
+
`status` without scope is passive: selection, paths, missing components, installations, retained
|
|
26
|
+
stages, recorded checks and live process receipts. It works before installation. It does not start
|
|
27
|
+
Java or create a research workspace. `status --session S --target T` retains the scoped live health
|
|
28
|
+
check. `server status` also works without an installed runtime and explains missing prerequisites.
|
|
29
|
+
`doctor` explicitly runs disposable native decompiler/server probes and checks macOS LLDB Python.
|
|
30
|
+
It never imports a research target or publishes research changes. Readiness recorded by a doctor
|
|
31
|
+
run includes its runtime fingerprint; status identifies whether that record matches the selection.
|
|
32
|
+
|
|
33
|
+
## Local archives and external installations
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
insight-cli --profile local ghidra download
|
|
37
|
+
insight-cli --profile local ghidra install --offline
|
|
38
|
+
insight-cli --profile local ghidra install --archive ./ghidra.zip
|
|
39
|
+
insight-cli --profile local ghidra install --archive ./ghidra.zip \
|
|
40
|
+
--java-archive ./jdk.tar.gz --offline
|
|
41
|
+
insight-cli --profile local ghidra install --executable /tools/ghidra/ghidraRun
|
|
42
|
+
insight-cli --profile local ghidra install --executable /tools/ghidra \
|
|
43
|
+
--java /tools/jdk/bin/java --offline
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`--executable` accepts the actual Ghidra launcher (`ghidraRun[.bat]`, or
|
|
47
|
+
`support/analyzeHeadless[.bat]`) or installation directory. It needs the complete compatible
|
|
48
|
+
installation, including host native components. A target EXE is not a Ghidra launcher.
|
|
49
|
+
Common Homebrew launcher wrappers are resolved through the adjacent complete `libexec` tree.
|
|
50
|
+
The external Ghidra tree is never modified or deleted. Java is delivered automatically unless
|
|
51
|
+
`--java` or `--java-archive` is supplied. Legacy profile `java`/`ghidraHome` configuration still works
|
|
52
|
+
when no explicit selection exists; an explicit selection takes precedence and never silently
|
|
53
|
+
falls back to profile paths after failure or uninstall.
|
|
54
|
+
|
|
55
|
+
Local archives are caller-selected inputs, consumed into owned hash-addressed copies before
|
|
56
|
+
extraction so later source edits cannot change the installed bytes. Optional `--archive-sha256` and
|
|
57
|
+
`--java-archive-sha256` check the expected bytes; the actual digests are recorded in the installation
|
|
58
|
+
identity. `--offline` prohibits network acquisition: provide/cache every required archive. On macOS,
|
|
59
|
+
an official Ghidra zip also needs the pinned prebuilt native archive in cache. The managed macOS
|
|
60
|
+
distribution already includes these natives. Executable modes are preserved; paths, links and
|
|
61
|
+
expanded sizes are checked during portable Node extraction. Downloads use pinned SHA256 values.
|
|
62
|
+
No external unzip, tar or Python executable is needed for extraction.
|
|
63
|
+
|
|
64
|
+
## Server, process and data ownership
|
|
65
|
+
|
|
66
|
+
The Ghidra distribution includes Ghidra Server. It uses the selected JDK and immutable tool code;
|
|
67
|
+
its repository, certificates, credentials and process settings are separate profile data.
|
|
68
|
+
Ordinary `open` starts it automatically. `server start` explicitly starts/enables it, and
|
|
69
|
+
`server stop` stops the identified owned server after all contexts are closed. It refuses to stop
|
|
70
|
+
a server under live clients. A later open can start it again; explicit `disconnect` disables shared
|
|
71
|
+
operations until `connect`/`start`. `server connect/disconnect` retain their connection-management API.
|
|
72
|
+
An external server remains configured through profile server/repository/account fields and Factory
|
|
73
|
+
secrets; `server stop` cannot stop that external service.
|
|
74
|
+
|
|
75
|
+
Code/cache/installation receipts live under profile AppData `runtime/`; research remains under
|
|
76
|
+
`workspace/`, and saved files under `materials/`. One selected immutable installation serves many
|
|
77
|
+
isolated JVM contexts; each has its own projects, home, settings, cache/temp and authenticated
|
|
78
|
+
endpoint. No per-agent copy of the Ghidra code distribution is required. This is process and data
|
|
79
|
+
isolation; it does not restrict arbitrary user scripts to an OS security sandbox.
|
|
80
|
+
|
|
81
|
+
Close scoped contexts and stop the owned server before selecting/reinstalling/removing a runtime.
|
|
82
|
+
A live receipt conservatively blocks these operations; it never authorizes killing a PID.
|
|
83
|
+
Download and doctor can run without switching the current runtime. Runtime commands serialize
|
|
84
|
+
within the Factory owner. Changing a selected runtime invalidates cached backend handles, without
|
|
85
|
+
removing saved research. There is no automatic version migration or floating upstream upgrade.
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
insight-cli --profile local ghidra close --session S --target T
|
|
89
|
+
insight-cli --profile local ghidra server stop
|
|
90
|
+
insight-cli --profile local permissions grant Destructive
|
|
91
|
+
insight-cli --profile local ghidra uninstall
|
|
92
|
+
# Optional cache deletion; research and external installations remain preserved:
|
|
93
|
+
insight-cli --profile local ghidra uninstall --purge-cache
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Uninstall removes only selected owned installation files. It preserves the selection as an
|
|
97
|
+
uninstalled receipt, so later research reports a missing runtime instead of changing bindings.
|
|
98
|
+
Archives remain reusable unless `--purge-cache` is selected. Reinstalling the same archives restores
|
|
99
|
+
the same runtime identity. Sessions, private snapshots, unresolved publication journals, server
|
|
100
|
+
repositories and artifacts survive. Uninstall does not resolve an uncertain merge or replay it.
|
|
101
|
+
|
|
102
|
+
## Sources and host boundary
|
|
103
|
+
|
|
104
|
+
The catalog pins Ghidra 12.1.2 and Temurin JDK 21.0.11+10. macOS uses public Homebrew-built Ghidra
|
|
105
|
+
bottles with native components (macOS 14+, ARM64 or x64); no installed Homebrew is used. Linux x64
|
|
106
|
+
and Windows x64 use the official Ghidra zip and Temurin archive. All source URLs, hashes and license
|
|
107
|
+
identities are in `src/runtime-catalog.ts`; downloaded distributions retain their license files.
|
|
108
|
+
Unsupported platforms fail explicitly and may use compatible external profile paths. Native
|
|
109
|
+
acceptance for this delivery is macOS ARM64; catalog availability is not Windows/Linux native proof.
|
|
110
|
+
|
|
111
|
+
The host provides Node/npm, OS frameworks, display/keychain access and debugger authorization.
|
|
112
|
+
macOS LLDB and its embedded Python come from Apple's developer tools; they are OS prerequisites,
|
|
113
|
+
not downloaded third-party Python dependencies. `doctor` reports a missing host debugger as a partial
|
|
114
|
+
failure even when static analysis/server pass. No root installation, developer-tools installer,
|
|
115
|
+
Gatekeeper disabling, shell-profile edit or global Java/Python selection is performed. Ghidra GUI
|
|
116
|
+
agents receive private copies of the Ghidra SDK's pinned debugger Python wheels.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import ghidra.GhidraApplicationLayout;
|
|
2
|
+
import ghidra.framework.*;
|
|
3
|
+
import ghidra.program.database.ProgramDB;
|
|
4
|
+
import ghidra.program.model.lang.LanguageID;
|
|
5
|
+
import ghidra.program.util.DefaultLanguageService;
|
|
6
|
+
import ghidra.program.flatapi.FlatProgramAPI;
|
|
7
|
+
import ghidra.app.decompiler.DecompInterface;
|
|
8
|
+
import ghidra.util.task.TaskMonitor;
|
|
9
|
+
import java.io.ByteArrayInputStream;
|
|
10
|
+
|
|
11
|
+
/** Disposable native probe: decode and decompile a known function using the selected installation. */
|
|
12
|
+
class InsightRuntimeDoctor {
|
|
13
|
+
public static void main(String[] args) {
|
|
14
|
+
var out=System.out;System.setOut(System.err);
|
|
15
|
+
try {
|
|
16
|
+
Application.initializeApplication(new GhidraApplicationLayout(),new HeadlessGhidraApplicationConfiguration());
|
|
17
|
+
var language=DefaultLanguageService.getLanguageService().getLanguage(new LanguageID("x86:LE:32:default"));
|
|
18
|
+
var program=new ProgramDB("runtime-probe",language,language.getDefaultCompilerSpec(),new Object());
|
|
19
|
+
var consumer=new Object();program.addConsumer(consumer);
|
|
20
|
+
int tx=program.startTransaction("probe");
|
|
21
|
+
var start=program.getAddressFactory().getDefaultAddressSpace().getAddress(0x1000);
|
|
22
|
+
program.getMemory().createInitializedBlock(".text",start,new ByteArrayInputStream(new byte[]{(byte)0xb8,42,0,0,0,(byte)0xc3}),6,TaskMonitor.DUMMY,false);
|
|
23
|
+
var api=new FlatProgramAPI(program);api.disassemble(start);var function=api.createFunction(start,"runtime_probe");
|
|
24
|
+
program.endTransaction(tx,true);
|
|
25
|
+
var decompiler=new DecompInterface();
|
|
26
|
+
if(!decompiler.openProgram(program))throw new IllegalStateException("Decompiler did not open program");
|
|
27
|
+
var result=decompiler.decompileFunction(function,30,TaskMonitor.DUMMY);
|
|
28
|
+
if(!result.decompileCompleted()||result.getDecompiledFunction()==null||!result.getDecompiledFunction().getC().contains("0x2a"))throw new IllegalStateException("Native decompile did not produce the expected return value");
|
|
29
|
+
decompiler.dispose();program.release(consumer);
|
|
30
|
+
out.println("{\"state\":\"ready\",\"headless\":true,\"decompiler\":true,\"expectedReturn\":42}");System.exit(0);
|
|
31
|
+
} catch(Throwable failure){failure.printStackTrace(System.err);out.println("{\"state\":\"failed\"}");System.exit(1);}
|
|
32
|
+
}
|
|
33
|
+
}
|
package/references/setup.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
# Setup
|
|
2
2
|
|
|
3
|
-
Use Node 24
|
|
4
|
-
|
|
3
|
+
Use Node 24+ and `ghidra install` to deliver Ghidra 12.1.2, JDK 21, native components and
|
|
4
|
+
server support. See [managed runtime](managed-runtime.md) for download/install/offline archives,
|
|
5
|
+
external executable paths, status/doctor and safe removal. Existing Factory profile `java` and
|
|
6
|
+
`ghidraHome` paths remain supported when no managed/external selection exists.
|
|
5
7
|
The package contains the verified GhidraMCP 7.0.0 bridge, its Apache-2.0 license/notice and
|
|
6
8
|
artifact provenance. Its pinned functionality catalog is from source
|
|
7
9
|
`57e37a8bf388b1279cff46378f85be1554548f61`, with SHA256
|
|
@@ -3,7 +3,7 @@ name: insight-re
|
|
|
3
3
|
description: Investigate shipped programs and binary artifacts with insight-cli and other available tools; retain ordinary research files, coordinate independent agents and publish Ghidra annotations. Use for reverse engineering behavior, not ordinary source-repository browsing.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Insight RE 0.
|
|
6
|
+
# Insight RE 0.2.0
|
|
7
7
|
|
|
8
8
|
Answer the user's research question with inspectable materials. Agents choose the
|
|
9
9
|
investigation; insight-cli supplies applications such as `ghidra` and `artifacts`.
|