@eyeauras/insight-cli 0.3.2 → 0.4.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 (141) hide show
  1. package/.cli-package-build.json +1 -1
  2. package/README.md +34 -62
  3. package/SKILL.md +4 -1
  4. package/dist/src/arguments.js +9 -4
  5. package/dist/src/cli.js +45 -37
  6. package/dist/src/code-references.d.ts +48 -0
  7. package/dist/src/code-references.js +154 -0
  8. package/dist/src/context-diagnostics.d.ts +25 -0
  9. package/dist/src/context-diagnostics.js +82 -0
  10. package/dist/src/contexts.d.ts +13 -1
  11. package/dist/src/contexts.js +38 -9
  12. package/dist/src/function-boundaries.d.ts +9 -0
  13. package/dist/src/function-boundaries.js +68 -0
  14. package/dist/src/function-entries.d.ts +33 -0
  15. package/dist/src/function-entries.js +84 -0
  16. package/dist/src/function-inspection.d.ts +4 -2
  17. package/dist/src/function-inspection.js +94 -59
  18. package/dist/src/function-results.d.ts +3 -1
  19. package/dist/src/function-results.js +9 -3
  20. package/dist/src/inline-script.d.ts +15 -0
  21. package/dist/src/inline-script.js +62 -0
  22. package/dist/src/internal-timing.d.ts +3 -0
  23. package/dist/src/internal-timing.js +52 -0
  24. package/dist/src/lifecycle.js +14 -4
  25. package/dist/src/native-inputs.d.ts +1 -1
  26. package/dist/src/native-inputs.js +1 -1
  27. package/dist/src/native-queries.js +1 -1
  28. package/dist/src/persistent-client.d.ts +30 -0
  29. package/dist/src/persistent-client.js +125 -0
  30. package/dist/src/queries.js +4 -1
  31. package/dist/src/query-policy.js +9 -1
  32. package/dist/src/research-view.d.ts +6 -0
  33. package/dist/src/research-view.js +9 -0
  34. package/dist/src/research.d.ts +38 -0
  35. package/dist/src/research.js +78 -8
  36. package/dist/src/string-anchors.d.ts +43 -0
  37. package/dist/src/string-anchors.js +176 -0
  38. package/dist/src/sync-policy.js +3 -0
  39. package/dist/src/timed-backend.d.ts +3 -0
  40. package/dist/src/timed-backend.js +16 -0
  41. package/dist/src/transport.d.ts +1 -0
  42. package/dist/src/transport.js +4 -0
  43. package/dist/src/workspace.js +5 -2
  44. package/package.json +12 -1
  45. package/references/native/InsightAnchorScan.java +135 -0
  46. package/references/native/InsightCodeReferences.java +129 -0
  47. package/references/native/InsightFunctionBoundaries.java +56 -0
  48. package/references/native/InsightInlineExecutor.java +143 -0
  49. package/references/native/InsightInlineScript.java +14 -0
  50. package/references/native/InsightPeRanges.java +92 -0
  51. package/references/native/InsightResearchQueries.java +22 -1
  52. package/references/native/InsightResearchView.java +69 -0
  53. package/references/native/InsightStringAnchors.java +49 -0
  54. package/references/persistent-client.mjs +125 -0
  55. package/references/persistent.md +50 -0
  56. package/references/query-semantics.md +12 -0
  57. package/references/recovery.md +36 -0
  58. package/references/research.md +87 -0
  59. package/references/setup.md +1 -1
  60. package/references/sparse-navigation.md +173 -0
  61. package/runtime/GhidraMCP-7.0.0.jar +0 -0
  62. package/runtime/GhidraMCP-NOTICE +5 -0
  63. package/runtime/provenance.json +17 -3
  64. package/runtime/research-view.provenance.json +28 -0
  65. package/runtime/toolbox.json +10 -3
  66. package/skill-bundle/insight-artifacts/SKILL.md +1 -1
  67. package/skill-bundle/insight-artifacts/references/recovery.md +36 -0
  68. package/skill-bundle/insight-binary/SKILL.md +1 -1
  69. package/skill-bundle/insight-capture/SKILL.md +1 -1
  70. package/skill-bundle/insight-cli/SKILL.md +4 -1
  71. package/skill-bundle/insight-cli/references/persistent-client.mjs +125 -0
  72. package/skill-bundle/insight-cli/references/persistent.md +50 -0
  73. package/skill-bundle/insight-cli/references/recovery.md +36 -0
  74. package/skill-bundle/insight-cli/references/setup.md +1 -1
  75. package/skill-bundle/insight-die/SKILL.md +1 -1
  76. package/skill-bundle/insight-dnspy/SKILL.md +1 -1
  77. package/skill-bundle/insight-dotnet-dump/SKILL.md +1 -1
  78. package/skill-bundle/insight-dotnet-stack/SKILL.md +1 -1
  79. package/skill-bundle/insight-dotnet-trace/SKILL.md +1 -1
  80. package/skill-bundle/insight-frida/SKILL.md +1 -1
  81. package/skill-bundle/insight-ghidra/SKILL.md +14 -1
  82. package/skill-bundle/insight-ghidra/references/persistent-client.mjs +125 -0
  83. package/skill-bundle/insight-ghidra/references/persistent.md +50 -0
  84. package/skill-bundle/insight-ghidra/references/query-semantics.md +12 -0
  85. package/skill-bundle/insight-ghidra/references/recovery.md +36 -0
  86. package/skill-bundle/insight-ghidra/references/research.md +87 -0
  87. package/skill-bundle/insight-ghidra/references/setup.md +1 -1
  88. package/skill-bundle/insight-ghidra/references/sparse-navigation.md +173 -0
  89. package/skill-bundle/insight-ilspy/SKILL.md +1 -1
  90. package/skill-bundle/insight-interop/SKILL.md +1 -1
  91. package/skill-bundle/insight-lldb/SKILL.md +1 -1
  92. package/skill-bundle/insight-llvm/SKILL.md +1 -1
  93. package/skill-bundle/insight-managed-heap/SKILL.md +1 -1
  94. package/skill-bundle/insight-managed-metadata/SKILL.md +1 -1
  95. package/skill-bundle/insight-mitmproxy/SKILL.md +1 -1
  96. package/skill-bundle/insight-overview/SKILL.md +1 -1
  97. package/skill-bundle/insight-procmon/SKILL.md +1 -1
  98. package/skill-bundle/insight-re/SKILL.md +4 -1
  99. package/skill-bundle/insight-re/references/persistent-client.mjs +125 -0
  100. package/skill-bundle/insight-re/references/persistent.md +50 -0
  101. package/skill-bundle/insight-re/references/recovery.md +36 -0
  102. package/skill-bundle/insight-sevenzip/SKILL.md +1 -1
  103. package/skill-bundle/insight-strace/SKILL.md +1 -1
  104. package/skill-bundle/insight-tshark/SKILL.md +1 -1
  105. package/skill-bundle/insight-windbg/SKILL.md +1 -1
  106. package/skill-bundle/manifest.json +1 -1
  107. package/skills/insight-artifacts/SKILL.md +1 -1
  108. package/skills/insight-artifacts/references/recovery.md +36 -0
  109. package/skills/insight-binary/SKILL.md +1 -1
  110. package/skills/insight-capture/SKILL.md +1 -1
  111. package/skills/insight-die/SKILL.md +1 -1
  112. package/skills/insight-dnspy/SKILL.md +1 -1
  113. package/skills/insight-dotnet-dump/SKILL.md +1 -1
  114. package/skills/insight-dotnet-stack/SKILL.md +1 -1
  115. package/skills/insight-dotnet-trace/SKILL.md +1 -1
  116. package/skills/insight-frida/SKILL.md +1 -1
  117. package/skills/insight-ghidra/SKILL.md +14 -1
  118. package/skills/insight-ghidra/references/persistent-client.mjs +125 -0
  119. package/skills/insight-ghidra/references/persistent.md +50 -0
  120. package/skills/insight-ghidra/references/query-semantics.md +12 -0
  121. package/skills/insight-ghidra/references/recovery.md +36 -0
  122. package/skills/insight-ghidra/references/research.md +87 -0
  123. package/skills/insight-ghidra/references/setup.md +1 -1
  124. package/skills/insight-ghidra/references/sparse-navigation.md +173 -0
  125. package/skills/insight-ilspy/SKILL.md +1 -1
  126. package/skills/insight-interop/SKILL.md +1 -1
  127. package/skills/insight-lldb/SKILL.md +1 -1
  128. package/skills/insight-llvm/SKILL.md +1 -1
  129. package/skills/insight-managed-heap/SKILL.md +1 -1
  130. package/skills/insight-managed-metadata/SKILL.md +1 -1
  131. package/skills/insight-mitmproxy/SKILL.md +1 -1
  132. package/skills/insight-overview/SKILL.md +1 -1
  133. package/skills/insight-procmon/SKILL.md +1 -1
  134. package/skills/insight-re/SKILL.md +4 -1
  135. package/skills/insight-re/references/persistent-client.mjs +125 -0
  136. package/skills/insight-re/references/persistent.md +50 -0
  137. package/skills/insight-re/references/recovery.md +36 -0
  138. package/skills/insight-sevenzip/SKILL.md +1 -1
  139. package/skills/insight-strace/SKILL.md +1 -1
  140. package/skills/insight-tshark/SKILL.md +1 -1
  141. package/skills/insight-windbg/SKILL.md +1 -1
@@ -0,0 +1,50 @@
1
+ # Persistent research calls
2
+
3
+ For a sequence of CLI research calls, keep one `insight-cli --json-rpc` frontend alive in the
4
+ agent's long-lived JavaScript runtime. The Factory owner and Ghidra processes have their own
5
+ lifetime; retaining only the owner still makes a new frontend validate its installed build.
6
+
7
+ The package exports a small stdio client, independent of the facade's eager imports:
8
+
9
+ ```js
10
+ import {connectInsight, InsightCommandError, InsightTransportError}
11
+ from '@eyeauras/insight-cli/persistent';
12
+
13
+ const cli = await connectInsight({executable: 'insight-cli', cwd: projectDirectory});
14
+ const result = await cli.execute([
15
+ 'ghidra', 'functions', 'inspect', '--session', session, '--target', target,
16
+ '--function', 'main', '--fields', 'entry_point', '--include-call-context', 'false'
17
+ ]);
18
+ // Keep cli for subsequent calls in this investigation.
19
+ ```
20
+
21
+ When package-name resolution is unavailable in the agent host, dynamically import the
22
+ [`persistent-client.mjs`](persistent-client.mjs) beside this reference by its absolute file URL.
23
+ It is generated from the same canonical package module. In a persistent REPL retain `cli` as a
24
+ binding across tool invocations. A new Node process per query does not retain this connection.
25
+ For an explicit installed bin, use `{executable: process.execPath, arguments: [installedBin], cwd}`.
26
+ `env` optionally supplies the child environment. There is no shell or separate profile/config.
27
+ Use existing `--profile` argv flags when selecting a profile explicitly.
28
+
29
+ `execute(argv)` returns the CLI result unchanged, without a JSON-RPC envelope. Calls are queued
30
+ in admission order. Native work can be long: await the original promise through the agent host's
31
+ existing wait facility. This V1 client deliberately has no per-request timeout or automatic
32
+ reconnect/retry. Factory permissions, command validation, IDs and native budgets remain authoritative.
33
+
34
+ * `InsightCommandError.rpc` preserves the JSON-RPC error code, message and data, including typed
35
+ CLI error results. A command failure leaves a healthy connection usable for the next command.
36
+ * `InsightTransportError.dispatched === true` means the request was handed to the stream and its
37
+ acknowledgment is unavailable; it does not prove execution. Changing commands require their
38
+ existing request-ID/status recovery. The client never resends them.
39
+ * `dispatched === false` means this client did not send that request, including queued requests
40
+ after a transport failure. Reconnection is an explicit new connection, not an implicit replay.
41
+
42
+ The client bounds each response line to four MiB, validates IDs and envelopes, and fails the
43
+ connection on malformed, uncorrelated or oversized replies. It drains stderr without retaining
44
+ arbitrary native diagnostics in memory. Read command-level diagnostics from their typed results
45
+ and the existing profile diagnostic locations.
46
+
47
+ Finish owned Ghidra contexts with the normal scoped commands, following the project's shared
48
+ server policy. Then `await cli.close()` drains already admitted requests and ends this stdio
49
+ connection. It does not issue `ipc-server stop`, close another agent's context or stop a server.
50
+ Do not call close while expecting to admit more requests.
@@ -24,11 +24,47 @@ establishes that the old owned bootstrap worker has ended, then uses an authorit
24
24
  probe. An absent canonical item permits private preparation; an existing first version requires
25
25
  independent readback. The old project, intent and original session/target remain preserved.
26
26
 
27
+ ## Interrupted save or close
28
+
29
+ After restoring profile storage, inspect the selected session and target with
30
+ `sessions status <session> --target <target>`. Retry the original save/close with the
31
+ same `--request-id`. If the original command had no caller ID, use the generated
32
+ `unresolvedRequests[].id` from status. This retrieves the original intent instead of
33
+ creating another close. A verified stopped worker lets close report `state: closed`
34
+ and retain the acknowledged private snapshot and pending changes; it sends no new save,
35
+ open, close or publication. Reopen the same session/target afterward.
36
+
37
+ If release cannot be proved, the command still fails with `coordinator.unknown`
38
+ and gives scoped status/process inspection commands. An authenticated live worker is not
39
+ closed again automatically. Retain its project and journals. After inspecting its retained
40
+ work, an operator may terminate that exact owned headless worker through
41
+ `tools processes kill <process>` with Destructive permission, accepting loss of any
42
+ unacknowledged in-memory work. Do not kill by guessed PID/port or stop the shared server.
43
+ Retrieve the same close request after that worker has ended. An unavailable endpoint or
44
+ changed process receipt is not proof of release; preserve the binding for investigation.
45
+
27
46
  If a response was lost, inspect `sessions status <session> --target <target>`. Never infer
28
47
  `applied` from a connection failure. A changing command's optional request ID binds one effective
29
48
  intent inside the profile. Repeating the same ID/input retrieves its recorded outcome or
30
49
  unresolved state; changing input under that ID fails. Without an ID, calls are new intentions.
31
50
 
51
+ For Java `scripts run-inline`, a versioned native executor records compilation, non-initializing
52
+ class resolution, initialization, construction and framework execution separately. A correlated
53
+ receipt proving `userCode: not_started` and `entrypointInvoked: false` before initialization
54
+ produces `state: rejected` with a terminal failed request. The context remains available and
55
+ its prior saved/pending work is unchanged. The CLI exits nonzero; the error result retains
56
+ bounded compiler/load diagnostics. Repeating that request ID retrieves the same rejection;
57
+ corrected source requires a new ID. Each attempt has isolated source/classes under profile
58
+ analysis storage, with annotation processing disabled and no reuse of older inline classes.
59
+
60
+ Initialization or constructor failure can have effects even when `run()` was never called.
61
+ These failures, framework/runtime failures and missing/malformed/lost acknowledgements remain
62
+ unknown. During framework execution `entrypointInvoked: null` means actual `run()` entry was
63
+ not independently observed. Console text cannot establish non-execution. This is not a sandbox
64
+ for adversarial same-JVM Java, and existing unknown script attempts are not reclassified from
65
+ their exception strings or an unchanged program snapshot. File/Python scripts retain their
66
+ existing conservative recovery semantics.
67
+
32
68
  An unknown or partial effect retains its request intent, snapshots and native stage. Open the
33
69
  same tuple to reconcile supported outcomes. A committed merge is verified against its recorded
34
70
  server version and complete saved buffers through independent read authority; it is never
@@ -3,7 +3,7 @@ name: insight-sevenzip
3
3
  description: Inventory, integrity-check and recover files from archives and supported containers with insight-cli 7-Zip, then hand recovered binaries or configuration to the appropriate research tool.
4
4
  ---
5
5
 
6
- # Insight 7-Zip 0.3.2
6
+ # Insight 7-Zip 0.4.1
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-strace
3
3
  description: Observe actual file reads, writes, process creation and network syscalls in an authorized owned native Linux launch using insight-cli strace. Use when static inference needs concrete operating-system interaction evidence.
4
4
  ---
5
5
 
6
- # Insight strace 0.3.2
6
+ # Insight strace 0.4.1
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-tshark
3
3
  description: Inspect an offline PCAP or PCAPNG with insight-cli tshark to identify protocols, HTTP/DNS/TLS fields, packet evidence and reconstructed TCP/UDP streams. Use for captured traffic questions; live acquisition and TLS decryption are separate tasks.
4
4
  ---
5
5
 
6
- # Insight TShark 0.3.2
6
+ # Insight TShark 0.4.1
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-windbg
3
3
  description: Investigate Windows native user-mode minidumps using bounded stacks, threads, registers, modules, memory and disassembly through insight-cli windbg. Use on Windows x64 when a captured runtime state needs native debugger evidence.
4
4
  ---
5
5
 
6
- # Insight WinDbg 0.3.2
6
+ # Insight WinDbg 0.4.1
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized