@eyeauras/insight-cli 0.8.4 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cli-package-build.json +1 -1
- package/README.md +16 -23
- package/SKILL.md +6 -44
- package/dist/src/activity-audit.d.ts +33 -46
- package/dist/src/activity-audit.js +120 -195
- package/dist/src/analysis-default.d.ts +10 -2
- package/dist/src/analysis-default.js +62 -47
- package/dist/src/analysis-storage.d.ts +13 -13
- package/dist/src/analysis-storage.js +127 -258
- package/dist/src/artifacts.d.ts +5 -1
- package/dist/src/artifacts.js +31 -46
- package/dist/src/audit-commands.d.ts +6 -1
- package/dist/src/audit-commands.js +9 -2
- package/dist/src/audit-retention.d.ts +5 -23
- package/dist/src/audit-retention.js +37 -150
- package/dist/src/binary.js +4 -13
- package/dist/src/budgets.d.ts +2 -2
- package/dist/src/budgets.js +7 -9
- package/dist/src/capture.js +17 -30
- package/dist/src/cli.d.ts +9 -4
- package/dist/src/cli.js +288 -473
- package/dist/src/code-references.d.ts +2 -13
- package/dist/src/code-references.js +7 -99
- package/dist/src/context-diagnostics.d.ts +1 -23
- package/dist/src/context-diagnostics.js +1 -83
- package/dist/src/core/coordinator.d.ts +298 -0
- package/dist/src/core/coordinator.js +591 -0
- package/dist/src/core/layout.d.ts +51 -0
- package/dist/src/core/layout.js +55 -0
- package/dist/src/core/legacy-import.d.ts +55 -0
- package/dist/src/core/legacy-import.js +193 -0
- package/dist/src/cross-results.d.ts +3 -3
- package/dist/src/cross-results.js +4 -42
- package/dist/src/cross.js +2 -3
- package/dist/src/debugger-results.d.ts +1 -6
- package/dist/src/debugger-results.js +21 -153
- package/dist/src/debugger.d.ts +21 -11
- package/dist/src/debugger.js +106 -168
- package/dist/src/decode-results.d.ts +2 -1
- package/dist/src/decode-results.js +4 -20
- package/dist/src/diagnostic-error.d.ts +1 -1
- package/dist/src/diagnostic-error.js +4 -23
- package/dist/src/die.js +1 -23
- package/dist/src/dnspy-runtime.js +5 -12
- package/dist/src/dnspy.js +13 -28
- package/dist/src/dotnet-diagnostics.js +1 -1
- package/dist/src/extensions.d.ts +2 -3
- package/dist/src/extensions.js +14 -91
- package/dist/src/frida-worker.js +0 -20
- package/dist/src/frida.js +3 -26
- package/dist/src/function-boundaries.d.ts +2 -2
- package/dist/src/function-boundaries.js +9 -61
- package/dist/src/function-entries.d.ts +2 -2
- package/dist/src/function-entries.js +6 -36
- package/dist/src/function-inspection.d.ts +2 -2
- package/dist/src/function-inspection.js +17 -33
- package/dist/src/function-results.d.ts +1 -3
- package/dist/src/function-results.js +2 -13
- package/dist/src/hub/admin.d.ts +101 -0
- package/dist/src/hub/admin.js +314 -0
- package/dist/src/hub/autostart.d.ts +111 -0
- package/dist/src/hub/autostart.js +207 -0
- package/dist/src/hub/bundle.d.ts +33 -0
- package/dist/src/hub/bundle.js +25 -0
- package/dist/src/hub/client.d.ts +90 -0
- package/dist/src/hub/client.js +256 -0
- package/dist/src/hub/commands.d.ts +13 -0
- package/dist/src/hub/commands.js +280 -0
- package/dist/src/hub/contract.d.ts +87 -0
- package/dist/src/hub/contract.js +3 -0
- package/dist/src/hub/extensions.d.ts +41 -0
- package/dist/src/hub/extensions.js +3 -0
- package/dist/src/hub/ghidra.d.ts +70 -0
- package/dist/src/hub/ghidra.js +197 -0
- package/dist/src/hub/index.d.ts +6 -0
- package/dist/src/hub/index.js +7 -0
- package/dist/src/{work/store.d.ts → hub/ledger-store.d.ts} +57 -94
- package/dist/src/hub/ledger-store.js +919 -0
- package/dist/src/hub/ledger.d.ts +4 -0
- package/dist/src/hub/ledger.js +173 -0
- package/dist/src/hub/lock.d.ts +7 -0
- package/dist/src/hub/lock.js +53 -0
- package/dist/src/hub/repository.d.ts +45 -0
- package/dist/src/hub/repository.js +130 -0
- package/dist/src/hub/server.d.ts +86 -0
- package/dist/src/hub/server.js +414 -0
- package/dist/src/hub/settings.d.ts +36 -0
- package/dist/src/hub/settings.js +112 -0
- package/dist/src/hub/storage.d.ts +13 -0
- package/dist/src/hub/storage.js +46 -0
- package/dist/src/hub/store.d.ts +75 -0
- package/dist/src/hub/store.js +188 -0
- package/dist/src/ilspy.js +1 -1
- package/dist/src/internal-timing.d.ts +2 -9
- package/dist/src/internal-timing.js +2 -95
- package/dist/src/lldb.js +3 -15
- package/dist/src/llvm.js +0 -9
- package/dist/src/managed-heap.js +3 -7
- package/dist/src/managed-metadata.js +2 -5
- package/dist/src/memory-inputs.d.ts +1 -4
- package/dist/src/memory-inputs.js +10 -40
- package/dist/src/mitmproxy.d.ts +35 -4
- package/dist/src/mitmproxy.js +59 -40
- package/dist/src/model.d.ts +0 -73
- package/dist/src/model.js +0 -45
- package/dist/src/mutations.d.ts +1 -1
- package/dist/src/mutations.js +5 -10
- package/dist/src/native/contract.d.ts +130 -0
- package/dist/src/native/ghidra.d.ts +58 -0
- package/dist/src/native/ghidra.js +77 -0
- package/dist/src/native/host.d.ts +71 -0
- package/dist/src/native/host.js +265 -0
- package/dist/src/native/index.d.ts +13 -0
- package/dist/src/native/index.js +19 -0
- package/dist/src/native/jvm.d.ts +54 -0
- package/dist/src/native/jvm.js +47 -0
- package/dist/src/native/worker.d.ts +70 -0
- package/dist/src/native/worker.js +240 -0
- package/dist/src/native-inputs.d.ts +9 -14
- package/dist/src/native-inputs.js +22 -110
- package/dist/src/native-merge-patches.d.ts +2 -2
- package/dist/src/native-merge-patches.js +14 -14
- package/dist/src/persistent-client.js +53 -25
- package/dist/src/procmon.js +17 -31
- package/dist/src/program-files.d.ts +42 -0
- package/dist/src/program-files.js +148 -0
- package/dist/src/queries.js +2 -15
- package/dist/src/query-policy.d.ts +0 -2
- package/dist/src/query-policy.js +1 -14
- package/dist/src/research.d.ts +59 -238
- package/dist/src/research.js +212 -906
- package/dist/src/runtime-identity.d.ts +8 -0
- package/dist/src/runtime-identity.js +26 -0
- package/dist/src/runtime-manager.d.ts +1 -11
- package/dist/src/runtime-manager.js +10 -145
- package/dist/src/runtime-selection.d.ts +1 -1
- package/dist/src/runtime-selection.js +5 -37
- package/dist/src/saved-materials.js +8 -51
- package/dist/src/scripts.d.ts +1 -1
- package/dist/src/scripts.js +15 -15
- package/dist/src/sdk-contracts.js +2 -2
- package/dist/src/sdk.js +8 -8
- package/dist/src/sevenzip.js +1 -3
- package/dist/src/strace.js +0 -3
- package/dist/src/string-anchors.d.ts +2 -3
- package/dist/src/string-anchors.js +8 -101
- package/dist/src/text-window.d.ts +5 -4
- package/dist/src/text-window.js +4 -4
- package/dist/src/tool-runtime/archives.d.ts +1 -1
- package/dist/src/tool-runtime/archives.js +11 -20
- package/dist/src/tool-runtime/catalog.js +2 -5
- package/dist/src/tool-runtime/commands.js +1 -3
- package/dist/src/tool-runtime/deadline.js +2 -7
- package/dist/src/tool-runtime/definition.js +1 -31
- package/dist/src/tool-runtime/identity.js +6 -87
- package/dist/src/tool-runtime/installer.d.ts +2 -6
- package/dist/src/tool-runtime/installer.js +14 -76
- package/dist/src/tool-runtime/java-arguments.js +4 -10
- package/dist/src/tool-runtime/launch-worker.js +2 -8
- package/dist/src/tool-runtime/run.d.ts +2 -0
- package/dist/src/tool-runtime/run.js +20 -8
- package/dist/src/tool-runtime/store.d.ts +3 -3
- package/dist/src/tool-runtime/store.js +21 -83
- package/dist/src/tool-runtime/supervisor.d.ts +6 -11
- package/dist/src/tool-runtime/supervisor.js +155 -214
- package/dist/src/tool-runtime/windows-helper.d.ts +5 -0
- package/dist/src/tool-runtime/windows-helper.js +13 -0
- package/dist/src/tool-runtime/windows-job.d.ts +5 -5
- package/dist/src/tool-runtime/windows-job.js +13 -31
- package/dist/src/tshark.js +14 -27
- package/dist/src/ui-results.d.ts +3 -2
- package/dist/src/ui-results.js +16 -53
- package/dist/src/ui.d.ts +12 -13
- package/dist/src/ui.js +32 -70
- package/dist/src/version-tracking.d.ts +25 -39
- package/dist/src/version-tracking.js +70 -174
- package/dist/src/windbg.d.ts +1 -1
- package/dist/src/windbg.js +2 -8
- package/dist/src/work/client.d.ts +63 -0
- package/dist/src/work/client.js +163 -0
- package/dist/src/work/commands.d.ts +3 -1
- package/dist/src/work/commands.js +158 -184
- package/dist/src/work/dashboard.d.ts +2 -2
- package/dist/src/work/dashboard.js +7 -8
- package/dist/src/work/legacy.d.ts +8 -0
- package/dist/src/work/legacy.js +70 -0
- package/dist/src/work/model.d.ts +0 -3
- package/dist/src/work/model.js +0 -10
- package/dist/src/work/timing.d.ts +3 -3
- package/dist/src/work/timing.js +21 -25
- package/dist/src/workspace.d.ts +4 -250
- package/dist/src/workspace.js +11 -699
- package/node_modules/@eyeauras/cli-factory/README.md +6 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/cli.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/cli.js +76 -28
- package/node_modules/@eyeauras/cli-factory/dist/src/cli.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/command.d.ts +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/command.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/command.js +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/command.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/errors.d.ts +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/errors.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/errors.js +18 -6
- package/node_modules/@eyeauras/cli-factory/dist/src/errors.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/file-publication.d.ts +44 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/file-publication.d.ts.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/{profile-file.js → file-publication.js} +41 -113
- package/node_modules/@eyeauras/cli-factory/dist/src/file-publication.js.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/help.d.ts +5 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/help.d.ts.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/help.js +17 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/help.js.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/index.d.ts +9 -4
- package/node_modules/@eyeauras/cli-factory/dist/src/index.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/index.js +5 -2
- package/node_modules/@eyeauras/cli-factory/dist/src/index.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/json-rpc.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/json-rpc.js +11 -18
- package/node_modules/@eyeauras/cli-factory/dist/src/json-rpc.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/output-write.d.ts +10 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/output-write.d.ts.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/output-write.js +69 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/output-write.js.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/output.d.ts +3 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/output.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/output.js +74 -14
- package/node_modules/@eyeauras/cli-factory/dist/src/output.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/pagination.d.ts +3 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/pagination.d.ts.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/pagination.js +9 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/pagination.js.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/permissions.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/permissions.js +3 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/permissions.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/stream-result.d.ts +16 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/stream-result.d.ts.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/stream-result.js +83 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/stream-result.js.map +1 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/types.d.ts +5 -0
- package/node_modules/@eyeauras/cli-factory/dist/src/types.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/view.d.ts +49 -7
- package/node_modules/@eyeauras/cli-factory/dist/src/view.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/view.js +83 -6
- package/node_modules/@eyeauras/cli-factory/dist/src/view.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory/package.json +1 -1
- package/node_modules/@eyeauras/cli-factory-ipc/dist/cli-host.proto +19 -19
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/build.d.ts +7 -1
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/build.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/build.js +9 -4
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/build.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/host.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/host.js +5 -4
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/host.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/package-build.d.ts +11 -1
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/package-build.d.ts.map +1 -1
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/package-build.js +85 -57
- package/node_modules/@eyeauras/cli-factory-ipc/dist/src/package-build.js.map +1 -1
- package/node_modules/@eyeauras/cli-factory-ipc/package.json +2 -2
- package/package.json +4 -5
- package/references/native/InsightAnalyzerOptions.java +10 -0
- package/references/native/InsightAnchorScan.java +1 -11
- package/references/native/InsightCodeReferences.java +2 -3
- package/references/native/InsightCopyType.java +24 -0
- package/references/native/InsightFunctionBoundaries.java +0 -1
- package/references/native/InsightFunctionDatabases.java +20 -16
- package/references/native/InsightHelperCall.java +17 -0
- package/references/native/InsightHubServer.java +214 -0
- package/references/native/InsightNativeHost.java +112 -0
- package/references/native/InsightPlugins.java +0 -1
- package/references/native/InsightPythonWheels.java +3 -2
- package/references/native/InsightResearchQueries.java +3 -4
- package/references/native/InsightResearchView.java +4 -10
- package/references/native/InsightSdkFiles.java +7 -15
- package/references/native/InsightSdkScript.java +1 -4
- package/references/native/InsightSdkTools.java +36 -97
- package/references/native/InsightSdkTypes.java +13 -43
- package/references/native/InsightStringAnchors.java +1 -3
- package/references/native/InsightTraceState.java +13 -96
- package/references/native/InsightTraceTools.java +3 -5
- package/references/native/InsightVersionTracking.java +0 -6
- package/references/native/{HeadlessProgramMergeManager.java → InsightWcMerge.java} +17 -24
- package/references/native/InsightWcOps.java +449 -0
- package/references/native/InsightWcWorker.java +142 -0
- package/references/native/NATIVE-MERGE-NOTICE.txt +4 -8
- package/runtime/GhidraMCP-7.0.0.jar +0 -0
- package/runtime/managed/insight-heap/README.md +3 -3
- package/runtime/managed/insight-managed/README.md +3 -3
- package/runtime/native/binary/README.md +5 -4
- package/runtime/native/windows/DirectoryAlias.cs +24 -0
- package/runtime/native/windows/Insight.Windows.csproj +27 -0
- package/runtime/native/windows/Native.cs +36 -0
- package/runtime/native/windows/OwnedJob.cs +86 -0
- package/runtime/native/windows/Program.cs +50 -0
- package/runtime/native/windows/RegistryRedirect.cs +42 -0
- package/runtime/native/windows/insight-windows-x64.exe +0 -0
- package/runtime/native/windows/packages.lock.json +35 -0
- package/runtime/native/windows/provenance.json +17 -0
- package/runtime/research-view.provenance.json +6 -7
- package/runtime/toolbox.json +33 -114
- package/skill-bundle/insight-artifacts/SKILL.md +5 -19
- package/skill-bundle/insight-binary/SKILL.md +5 -35
- package/skill-bundle/insight-capture/SKILL.md +5 -45
- package/skill-bundle/insight-cli/SKILL.md +6 -44
- package/skill-bundle/insight-die/SKILL.md +5 -38
- package/skill-bundle/insight-dnspy/SKILL.md +5 -54
- package/skill-bundle/insight-dotnet-dump/SKILL.md +5 -35
- package/skill-bundle/insight-dotnet-stack/SKILL.md +5 -28
- package/skill-bundle/insight-dotnet-trace/SKILL.md +5 -34
- package/skill-bundle/insight-frida/SKILL.md +5 -56
- package/skill-bundle/insight-ghidra/SKILL.md +14 -113
- package/skill-bundle/insight-ilspy/SKILL.md +5 -34
- package/skill-bundle/insight-interop/SKILL.md +5 -43
- package/skill-bundle/insight-lldb/SKILL.md +5 -43
- package/skill-bundle/insight-llvm/SKILL.md +5 -45
- package/skill-bundle/insight-managed-heap/SKILL.md +5 -32
- package/skill-bundle/insight-managed-metadata/SKILL.md +5 -41
- package/skill-bundle/insight-mitmproxy/SKILL.md +5 -51
- package/skill-bundle/insight-overview/SKILL.md +5 -68
- package/skill-bundle/insight-procmon/SKILL.md +5 -38
- package/skill-bundle/insight-re/SKILL.md +10 -127
- package/skill-bundle/insight-sevenzip/SKILL.md +5 -31
- package/skill-bundle/insight-strace/SKILL.md +5 -35
- package/skill-bundle/insight-tshark/SKILL.md +5 -38
- package/skill-bundle/insight-windbg/SKILL.md +5 -35
- package/skill-bundle/manifest.json +1 -1
- package/skills/insight-artifacts/SKILL.md +5 -19
- package/skills/insight-binary/SKILL.md +5 -35
- package/skills/insight-capture/SKILL.md +5 -45
- package/skills/insight-die/SKILL.md +5 -38
- package/skills/insight-dnspy/SKILL.md +5 -54
- package/skills/insight-dotnet-dump/SKILL.md +5 -35
- package/skills/insight-dotnet-stack/SKILL.md +5 -28
- package/skills/insight-dotnet-trace/SKILL.md +5 -34
- package/skills/insight-frida/SKILL.md +5 -56
- package/skills/insight-ghidra/SKILL.md +14 -113
- package/skills/insight-ilspy/SKILL.md +5 -34
- package/skills/insight-interop/SKILL.md +5 -43
- package/skills/insight-lldb/SKILL.md +5 -43
- package/skills/insight-llvm/SKILL.md +5 -45
- package/skills/insight-managed-heap/SKILL.md +5 -32
- package/skills/insight-managed-metadata/SKILL.md +5 -41
- package/skills/insight-mitmproxy/SKILL.md +5 -51
- package/skills/insight-overview/SKILL.md +5 -68
- package/skills/insight-procmon/SKILL.md +5 -38
- package/skills/insight-re/SKILL.md +10 -127
- package/skills/insight-sevenzip/SKILL.md +5 -31
- package/skills/insight-strace/SKILL.md +5 -35
- package/skills/insight-tshark/SKILL.md +5 -38
- package/skills/insight-windbg/SKILL.md +5 -35
- package/dist/src/administration-results.d.ts +0 -1
- package/dist/src/administration-results.js +0 -84
- package/dist/src/administration.d.ts +0 -14
- package/dist/src/administration.js +0 -134
- package/dist/src/archive-contract.d.ts +0 -6
- package/dist/src/archive-contract.js +0 -108
- package/dist/src/archive.d.ts +0 -12
- package/dist/src/archive.js +0 -116
- package/dist/src/comment-effects.d.ts +0 -3
- package/dist/src/comment-effects.js +0 -55
- package/dist/src/context-credential.d.ts +0 -18
- package/dist/src/context-credential.js +0 -44
- package/dist/src/contexts.d.ts +0 -387
- package/dist/src/contexts.js +0 -2805
- package/dist/src/coordinator.d.ts +0 -41
- package/dist/src/coordinator.js +0 -160
- package/dist/src/cross-peer.d.ts +0 -20
- package/dist/src/cross-peer.js +0 -53
- package/dist/src/data-effects.d.ts +0 -3
- package/dist/src/data-effects.js +0 -103
- package/dist/src/debugger-caller.d.ts +0 -17
- package/dist/src/debugger-caller.js +0 -129
- package/dist/src/debugger-launch.d.ts +0 -2
- package/dist/src/debugger-launch.js +0 -17
- package/dist/src/debugger-supervisor.js +0 -179
- package/dist/src/directory-identity.d.ts +0 -6
- package/dist/src/directory-identity.js +0 -45
- package/dist/src/documentation-effects.d.ts +0 -5
- package/dist/src/documentation-effects.js +0 -56
- package/dist/src/function-effects.d.ts +0 -4
- package/dist/src/function-effects.js +0 -112
- package/dist/src/ghidra-processes.d.ts +0 -6
- package/dist/src/ghidra-processes.js +0 -138
- package/dist/src/ghidra.d.ts +0 -50
- package/dist/src/ghidra.js +0 -468
- package/dist/src/initial-model.d.ts +0 -7
- package/dist/src/initial-model.js +0 -115
- package/dist/src/initial-progress.d.ts +0 -4
- package/dist/src/initial-progress.js +0 -74
- package/dist/src/inline-script.d.ts +0 -15
- package/dist/src/inline-script.js +0 -61
- package/dist/src/legacy-migration.d.ts +0 -37
- package/dist/src/legacy-migration.js +0 -238
- package/dist/src/lifecycle.d.ts +0 -77
- package/dist/src/lifecycle.js +0 -315
- package/dist/src/merge.d.ts +0 -29
- package/dist/src/merge.js +0 -66
- package/dist/src/mutation-effects.d.ts +0 -4
- package/dist/src/mutation-effects.js +0 -321
- package/dist/src/native-queries.d.ts +0 -2
- package/dist/src/native-queries.js +0 -24
- package/dist/src/native-service.d.ts +0 -40
- package/dist/src/native-service.js +0 -406
- package/dist/src/projects.d.ts +0 -31
- package/dist/src/projects.js +0 -302
- package/dist/src/prototype-cli.d.ts +0 -8
- package/dist/src/prototype-cli.js +0 -155
- package/dist/src/query-results.d.ts +0 -2
- package/dist/src/query-results.js +0 -224
- package/dist/src/research-view.d.ts +0 -6
- package/dist/src/research-view.js +0 -9
- package/dist/src/sdk-files.d.ts +0 -29
- package/dist/src/sdk-files.js +0 -249
- package/dist/src/server.d.ts +0 -102
- package/dist/src/server.js +0 -663
- package/dist/src/storage-gc.d.ts +0 -23
- package/dist/src/storage-gc.js +0 -600
- package/dist/src/store.d.ts +0 -33
- package/dist/src/store.js +0 -178
- package/dist/src/sync-policy.d.ts +0 -22
- package/dist/src/sync-policy.js +0 -129
- package/dist/src/timed-backend.d.ts +0 -3
- package/dist/src/timed-backend.js +0 -24
- package/dist/src/timing-report.d.ts +0 -32
- package/dist/src/timing-report.js +0 -74
- package/dist/src/tool-runtime/native-process-proof.d.ts +0 -2
- package/dist/src/tool-runtime/native-process-proof.js +0 -26
- package/dist/src/transport.d.ts +0 -60
- package/dist/src/transport.js +0 -223
- package/dist/src/unresolved-guidance.d.ts +0 -46
- package/dist/src/unresolved-guidance.js +0 -55
- package/dist/src/work/backup.d.ts +0 -66
- package/dist/src/work/backup.js +0 -446
- package/dist/src/work/store.js +0 -1107
- package/dist/src/worker-lease.d.ts +0 -17
- package/dist/src/worker-lease.js +0 -50
- package/node_modules/@eyeauras/cli-factory/dist/src/profile-file.d.ts +0 -37
- package/node_modules/@eyeauras/cli-factory/dist/src/profile-file.d.ts.map +0 -1
- package/node_modules/@eyeauras/cli-factory/dist/src/profile-file.js.map +0 -1
- package/references/InsightRepositoryProbe.java +0 -55
- package/references/administration.md +0 -34
- package/references/agent-execution.md +0 -36
- package/references/agent-setup.md +0 -60
- package/references/archive.md +0 -32
- package/references/artifacts.md +0 -52
- package/references/debugger.md +0 -64
- package/references/extensions-and-sync.md +0 -125
- package/references/ilspy.md +0 -33
- package/references/managed-runtime.md +0 -162
- package/references/native/InsightArchivePayloads.java +0 -36
- package/references/native/InsightBlockTransfer.java +0 -57
- package/references/native/InsightGuiMain.java +0 -33
- package/references/native/InsightHeadlessMain.java +0 -18
- package/references/native/InsightImportProgress.java +0 -60
- package/references/native/InsightInitialImport.java +0 -48
- package/references/native/InsightInitialJournal.java +0 -57
- package/references/native/InsightInitialPublication.java +0 -142
- package/references/native/InsightInitialRecovery.java +0 -131
- package/references/native/InsightInlineExecutor.java +0 -143
- package/references/native/InsightInlineScript.java +0 -14
- package/references/native/InsightNativeCheckout.java +0 -487
- package/references/native/InsightNativeFingerprint.java +0 -80
- package/references/native/InsightNativeMigration.java +0 -155
- package/references/native/InsightNativeRead.java +0 -80
- package/references/native/InsightNativeReceipt.java +0 -31
- package/references/native/InsightNativeService.java +0 -43
- package/references/native/InsightNativeView.java +0 -40
- package/references/native/InsightOfflineAuthenticator.java +0 -20
- package/references/native/InsightOwnedScripts.java +0 -170
- package/references/native/InsightProjectFiles.java +0 -92
- package/references/native/InsightPublicationRecovery.java +0 -63
- package/references/native/InsightServerAdministration.java +0 -82
- package/references/native/InsightServerInit.java +0 -62
- package/references/native/InsightServerMain.java +0 -43
- package/references/native/InsightServerProbe.java +0 -29
- package/references/native/InsightSnapshotFields.java +0 -74
- package/references/native/InsightSnapshotInspect.java +0 -191
- package/references/native/InsightSnapshotPublisher.java +0 -123
- package/references/native/InsightStopDebugger.java +0 -20
- package/references/native/InsightTraceInspect.java +0 -24
- package/references/native/InsightWorkerLease.java +0 -132
- package/references/native-workflows.md +0 -124
- package/references/persistent-client.mjs +0 -147
- package/references/persistent.md +0 -90
- package/references/query-semantics.md +0 -109
- package/references/recovery.md +0 -235
- package/references/research.md +0 -296
- package/references/setup.md +0 -135
- package/references/sparse-navigation.md +0 -173
- package/references/storage.md +0 -139
- package/references/work-tracking.md +0 -261
- package/runtime/native/file-version.ps1 +0 -7
- package/runtime/native/mitmproxy/bridge.py +0 -180
- package/runtime/native/windows-job/DirectoryAlias.cs +0 -24
- package/runtime/native/windows-job/Insight.WindowsJob.csproj +0 -1
- package/runtime/native/windows-job/Insight.WindowsJob.dll +0 -0
- package/runtime/native/windows-job/OwnedJob.cs +0 -79
- package/runtime/native/windows-job/RegistryRedirect.cs +0 -45
- package/runtime/native/windows-job/packages.lock.json +0 -21
- package/runtime/native/windows-job/provenance.json +0 -16
- package/runtime/native/windows-job/windows-job.ps1 +0 -8
- package/skill-bundle/insight-artifacts/references/agent-execution.md +0 -36
- package/skill-bundle/insight-artifacts/references/artifacts.md +0 -52
- package/skill-bundle/insight-artifacts/references/recovery.md +0 -235
- package/skill-bundle/insight-artifacts/references/storage.md +0 -139
- package/skill-bundle/insight-binary/references/agent-execution.md +0 -36
- package/skill-bundle/insight-capture/references/agent-execution.md +0 -36
- package/skill-bundle/insight-cli/references/agent-execution.md +0 -36
- package/skill-bundle/insight-cli/references/agent-setup.md +0 -60
- package/skill-bundle/insight-cli/references/archive.md +0 -32
- package/skill-bundle/insight-cli/references/managed-runtime.md +0 -162
- package/skill-bundle/insight-cli/references/persistent-client.mjs +0 -147
- package/skill-bundle/insight-cli/references/persistent.md +0 -90
- package/skill-bundle/insight-cli/references/recovery.md +0 -235
- package/skill-bundle/insight-cli/references/setup.md +0 -135
- package/skill-bundle/insight-cli/references/storage.md +0 -139
- package/skill-bundle/insight-die/references/agent-execution.md +0 -36
- package/skill-bundle/insight-dnspy/references/agent-execution.md +0 -36
- package/skill-bundle/insight-dotnet-dump/references/agent-execution.md +0 -36
- package/skill-bundle/insight-dotnet-stack/references/agent-execution.md +0 -36
- package/skill-bundle/insight-dotnet-trace/references/agent-execution.md +0 -36
- package/skill-bundle/insight-frida/references/agent-execution.md +0 -36
- package/skill-bundle/insight-ghidra/references/administration.md +0 -34
- package/skill-bundle/insight-ghidra/references/agent-execution.md +0 -36
- package/skill-bundle/insight-ghidra/references/archive.md +0 -32
- package/skill-bundle/insight-ghidra/references/artifacts.md +0 -52
- package/skill-bundle/insight-ghidra/references/debugger.md +0 -64
- package/skill-bundle/insight-ghidra/references/extensions-and-sync.md +0 -125
- package/skill-bundle/insight-ghidra/references/managed-runtime.md +0 -162
- package/skill-bundle/insight-ghidra/references/native-workflows.md +0 -124
- package/skill-bundle/insight-ghidra/references/persistent-client.mjs +0 -147
- package/skill-bundle/insight-ghidra/references/persistent.md +0 -90
- package/skill-bundle/insight-ghidra/references/query-semantics.md +0 -109
- package/skill-bundle/insight-ghidra/references/recovery.md +0 -235
- package/skill-bundle/insight-ghidra/references/research.md +0 -296
- package/skill-bundle/insight-ghidra/references/setup.md +0 -135
- package/skill-bundle/insight-ghidra/references/sparse-navigation.md +0 -173
- package/skill-bundle/insight-ghidra/references/storage.md +0 -139
- package/skill-bundle/insight-ilspy/references/agent-execution.md +0 -36
- package/skill-bundle/insight-ilspy/references/ilspy.md +0 -33
- package/skill-bundle/insight-interop/references/agent-execution.md +0 -36
- package/skill-bundle/insight-lldb/references/agent-execution.md +0 -36
- package/skill-bundle/insight-llvm/references/agent-execution.md +0 -36
- package/skill-bundle/insight-managed-heap/references/agent-execution.md +0 -36
- package/skill-bundle/insight-managed-metadata/references/agent-execution.md +0 -36
- package/skill-bundle/insight-mitmproxy/references/agent-execution.md +0 -36
- package/skill-bundle/insight-overview/references/agent-execution.md +0 -36
- package/skill-bundle/insight-procmon/references/agent-execution.md +0 -36
- package/skill-bundle/insight-re/references/agent-execution.md +0 -36
- package/skill-bundle/insight-re/references/artifacts.md +0 -52
- package/skill-bundle/insight-re/references/persistent-client.mjs +0 -147
- package/skill-bundle/insight-re/references/persistent.md +0 -90
- package/skill-bundle/insight-re/references/recovery.md +0 -235
- package/skill-bundle/insight-re/references/storage.md +0 -139
- package/skill-bundle/insight-re/references/work-tracking.md +0 -261
- package/skill-bundle/insight-sevenzip/references/agent-execution.md +0 -36
- package/skill-bundle/insight-strace/references/agent-execution.md +0 -36
- package/skill-bundle/insight-tshark/references/agent-execution.md +0 -36
- package/skill-bundle/insight-windbg/references/agent-execution.md +0 -36
- package/skills/insight-artifacts/references/agent-execution.md +0 -36
- package/skills/insight-artifacts/references/artifacts.md +0 -52
- package/skills/insight-artifacts/references/recovery.md +0 -235
- package/skills/insight-artifacts/references/storage.md +0 -139
- package/skills/insight-binary/references/agent-execution.md +0 -36
- package/skills/insight-capture/references/agent-execution.md +0 -36
- package/skills/insight-die/references/agent-execution.md +0 -36
- package/skills/insight-dnspy/references/agent-execution.md +0 -36
- package/skills/insight-dotnet-dump/references/agent-execution.md +0 -36
- package/skills/insight-dotnet-stack/references/agent-execution.md +0 -36
- package/skills/insight-dotnet-trace/references/agent-execution.md +0 -36
- package/skills/insight-frida/references/agent-execution.md +0 -36
- package/skills/insight-ghidra/references/administration.md +0 -34
- package/skills/insight-ghidra/references/agent-execution.md +0 -36
- package/skills/insight-ghidra/references/archive.md +0 -32
- package/skills/insight-ghidra/references/artifacts.md +0 -52
- package/skills/insight-ghidra/references/debugger.md +0 -64
- package/skills/insight-ghidra/references/extensions-and-sync.md +0 -125
- package/skills/insight-ghidra/references/managed-runtime.md +0 -162
- package/skills/insight-ghidra/references/native-workflows.md +0 -124
- package/skills/insight-ghidra/references/persistent-client.mjs +0 -147
- package/skills/insight-ghidra/references/persistent.md +0 -90
- package/skills/insight-ghidra/references/query-semantics.md +0 -109
- package/skills/insight-ghidra/references/recovery.md +0 -235
- package/skills/insight-ghidra/references/research.md +0 -296
- package/skills/insight-ghidra/references/setup.md +0 -135
- package/skills/insight-ghidra/references/sparse-navigation.md +0 -173
- package/skills/insight-ghidra/references/storage.md +0 -139
- package/skills/insight-ilspy/references/agent-execution.md +0 -36
- package/skills/insight-ilspy/references/ilspy.md +0 -33
- package/skills/insight-interop/references/agent-execution.md +0 -36
- package/skills/insight-lldb/references/agent-execution.md +0 -36
- package/skills/insight-llvm/references/agent-execution.md +0 -36
- package/skills/insight-managed-heap/references/agent-execution.md +0 -36
- package/skills/insight-managed-metadata/references/agent-execution.md +0 -36
- package/skills/insight-mitmproxy/references/agent-execution.md +0 -36
- package/skills/insight-overview/references/agent-execution.md +0 -36
- package/skills/insight-procmon/references/agent-execution.md +0 -36
- package/skills/insight-re/references/agent-execution.md +0 -36
- package/skills/insight-re/references/artifacts.md +0 -52
- package/skills/insight-re/references/persistent-client.mjs +0 -147
- package/skills/insight-re/references/persistent.md +0 -90
- package/skills/insight-re/references/recovery.md +0 -235
- package/skills/insight-re/references/storage.md +0 -139
- package/skills/insight-re/references/work-tracking.md +0 -261
- package/skills/insight-sevenzip/references/agent-execution.md +0 -36
- package/skills/insight-strace/references/agent-execution.md +0 -36
- package/skills/insight-tshark/references/agent-execution.md +0 -36
- package/skills/insight-windbg/references/agent-execution.md +0 -36
- /package/dist/src/{debugger-supervisor.d.ts → native/contract.js} +0 -0
- /package/runtime/native/{windows-job → windows}/NuGet.Config +0 -0
package/references/ilspy.md
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# Static .NET research
|
|
2
|
-
|
|
3
|
-
Use the project's preferred tools and evidence conventions. When ILSpy is appropriate,
|
|
4
|
-
`insight-cli ilspy install` prepares its pinned CLI and private .NET runtime; a global SDK
|
|
5
|
-
or dotnet installation is unnecessary. Lifecycle and archive options appear in `--help`.
|
|
6
|
-
The ILSpy and runtime distributions come from our pinned GitHub Releases. For offline
|
|
7
|
-
installation supply `--archive` and `--dotnet-archive`, or use an already verified cache.
|
|
8
|
-
`--executable` selects a compatible external ilspycmd; uninstall preserves its files.
|
|
9
|
-
|
|
10
|
-
```sh
|
|
11
|
-
insight-cli ilspy types ./client.dll --json
|
|
12
|
-
insight-cli ilspy decompile --target <returned-target> --type Example.Policy --output policy.cs --json
|
|
13
|
-
insight-cli ilspy il --target <target> --type Example.Policy --json
|
|
14
|
-
insight-cli ilspy resources --target <target> --json
|
|
15
|
-
insight-cli ilspy resource --target <target> --name Example.settings.json --output extracted --json
|
|
16
|
-
insight-cli ilspy project --target <target> --output recovered-project --json
|
|
17
|
-
insight-cli ilspy metadata --target <target> --table MethodDef --json
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Use either an input file or an existing target. Reusing the target associates Ghidra and
|
|
21
|
-
ILSpy results with the same immutable bytes. No Ghidra context or merge is needed for a
|
|
22
|
-
stateless ILSpy read. An optional `--session` associates an existing session; it does not
|
|
23
|
-
create one. These calls require Update to capture input and run a tool.
|
|
24
|
-
|
|
25
|
-
Text responses include `content`, input SHA, process ID, elapsed time and diagnostic paths.
|
|
26
|
-
`--member` selects a metadata token or XML member ID for decompilation. Output paths must
|
|
27
|
-
be new: text operations create one ordinary file, project/resource operations create a
|
|
28
|
-
folder. Keep useful output in the project's chosen evidence location; `artifacts save`
|
|
29
|
-
is an optional explicit checkpoint. Static decompilation does not execute an assembly.
|
|
30
|
-
|
|
31
|
-
Use `tools processes --tool ilspy --all` for execution history and `tools processes show
|
|
32
|
-
<process-id>` for retained diagnostics. A failed or interrupted export can leave partial
|
|
33
|
-
files/staging; inspect them and choose a new output path for another intentional run.
|
|
@@ -1,162 +0,0 @@
|
|
|
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
|
-
On Windows, long Ghidra Java classpaths use an owned per-execution argument file, retained with
|
|
26
|
-
the process diagnostics. `javac` files use UTF-8; `java` launcher files use the Windows system
|
|
27
|
-
code page. Java 21's launcher still requires paths representable in that code page. Unmappable
|
|
28
|
-
characters fail before launch rather than selecting different files through lossy conversion.
|
|
29
|
-
|
|
30
|
-
`status` without scope is passive: selection, paths, missing components, installations, retained
|
|
31
|
-
stages, recorded checks and live process receipts. It works before installation. It does not start
|
|
32
|
-
Java or create a research workspace. `status --session S --target T` retains the scoped live health
|
|
33
|
-
check. `server status` also works without an installed runtime and explains missing prerequisites.
|
|
34
|
-
`doctor` explicitly runs disposable native decompiler/server probes and checks macOS LLDB Python.
|
|
35
|
-
It never imports a research target or publishes research changes. Readiness recorded by a doctor
|
|
36
|
-
run includes its runtime fingerprint; status identifies whether that record matches the selection.
|
|
37
|
-
|
|
38
|
-
## Local archives and external installations
|
|
39
|
-
|
|
40
|
-
```sh
|
|
41
|
-
insight-cli --profile local ghidra download
|
|
42
|
-
insight-cli --profile local ghidra install --offline
|
|
43
|
-
insight-cli --profile local ghidra install --archive ./ghidra.zip
|
|
44
|
-
insight-cli --profile local ghidra install --archive ./ghidra.zip \
|
|
45
|
-
--java-archive ./jdk.tar.gz --debugger-archive ./lldb-python.tar.gz --offline
|
|
46
|
-
insight-cli --profile local ghidra install --executable /tools/ghidra/ghidraRun
|
|
47
|
-
insight-cli --profile local ghidra install --executable /tools/ghidra \
|
|
48
|
-
--java /tools/jdk/bin/java --debugger-archive ./lldb-python.tar.gz --offline
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
`--executable` accepts the actual Ghidra launcher (`ghidraRun[.bat]`, or
|
|
52
|
-
`support/analyzeHeadless[.bat]`) or installation directory. It needs the complete compatible
|
|
53
|
-
installation, including host native components. A target EXE is not a Ghidra launcher.
|
|
54
|
-
Common Homebrew launcher wrappers are resolved through the adjacent complete `libexec` tree.
|
|
55
|
-
The external Ghidra tree is never modified or deleted. Java is delivered automatically unless
|
|
56
|
-
`--java` or `--java-archive` is supplied. Legacy profile `java`/`ghidraHome` configuration still works
|
|
57
|
-
when no explicit selection exists; an explicit selection takes precedence and never silently
|
|
58
|
-
falls back to profile paths after failure or uninstall.
|
|
59
|
-
|
|
60
|
-
Local archives are caller-selected inputs, consumed into owned hash-addressed copies before
|
|
61
|
-
extraction so later source edits cannot change the installed bytes. Optional `--archive-sha256` and
|
|
62
|
-
`--java-archive-sha256` and `--debugger-archive-sha256` check the expected bytes; the actual digests are recorded in the installation
|
|
63
|
-
identity. `--offline` prohibits network acquisition: provide/cache every required archive. On macOS,
|
|
64
|
-
an official Ghidra zip also needs the pinned prebuilt native archive in cache. The managed macOS
|
|
65
|
-
distribution already includes these natives. Executable modes are preserved; paths, links and
|
|
66
|
-
expanded sizes are checked during portable Node extraction. Downloads use exact assets retained
|
|
67
|
-
in `iXab3r/insight-cli` GitHub Releases, with hashes and sizes pinned in the installed package.
|
|
68
|
-
There is no runtime upstream/latest fallback; supplied archives and verified cache support offline use.
|
|
69
|
-
No external unzip, tar or Python executable is needed for extraction.
|
|
70
|
-
|
|
71
|
-
## Server, process and data ownership
|
|
72
|
-
|
|
73
|
-
The Ghidra distribution includes Ghidra Server. It uses the selected JDK and immutable tool code;
|
|
74
|
-
its repository, certificates, credentials and process settings are separate profile data.
|
|
75
|
-
Ordinary `open` starts it automatically. `server start` explicitly starts/enables it, and
|
|
76
|
-
`server stop` stops the identified owned server after all contexts are closed. It refuses to stop
|
|
77
|
-
a server under live clients. A later open can start it again; explicit `disconnect` disables shared
|
|
78
|
-
operations until `connect`/`start`. `server connect/disconnect` retain their connection-management API.
|
|
79
|
-
An external server remains configured through profile server/repository/account fields and Factory
|
|
80
|
-
secrets; `server stop` cannot stop that external service.
|
|
81
|
-
|
|
82
|
-
Code/cache/installation receipts live under configured [analysis storage](storage.md) `runtime/`; research remains under
|
|
83
|
-
`workspace/`, and saved files under `materials/`. One selected immutable installation serves many
|
|
84
|
-
isolated JVM contexts; each has its own projects, home, settings, cache/temp and authenticated
|
|
85
|
-
endpoint. No per-agent copy of the Ghidra code distribution is required. This is process and data
|
|
86
|
-
isolation; it does not restrict arbitrary user scripts to an OS security sandbox.
|
|
87
|
-
|
|
88
|
-
Close scoped contexts and stop the owned server before selecting/reinstalling/removing a runtime.
|
|
89
|
-
A live receipt conservatively blocks these operations; it never authorizes killing a PID.
|
|
90
|
-
Download and doctor can run without switching the current runtime. Runtime commands serialize
|
|
91
|
-
within the Factory owner. Changing a selected runtime invalidates cached backend handles, without
|
|
92
|
-
removing saved research. There is no automatic version migration or floating upstream upgrade.
|
|
93
|
-
|
|
94
|
-
```sh
|
|
95
|
-
insight-cli --profile local ghidra close --session S --target T
|
|
96
|
-
insight-cli --profile local ghidra server stop
|
|
97
|
-
insight-cli --profile local permissions grant Destructive
|
|
98
|
-
insight-cli --profile local ghidra uninstall
|
|
99
|
-
# Optional cache deletion; research and external installations remain preserved:
|
|
100
|
-
insight-cli --profile local ghidra uninstall --purge-cache
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Uninstall removes only selected owned installation files. It preserves the selection as an
|
|
104
|
-
uninstalled receipt, so later research reports a missing runtime instead of changing bindings.
|
|
105
|
-
Archives remain reusable unless `--purge-cache` is selected. It removes recorded archives for
|
|
106
|
-
this installation, preserving other tools' cache and unrecorded legacy entries. Reinstalling the same archives restores
|
|
107
|
-
the same runtime identity. Sessions, private snapshots, unresolved publication journals, server
|
|
108
|
-
repositories and artifacts survive. Uninstall does not resolve an uncertain merge or replay it.
|
|
109
|
-
|
|
110
|
-
## Process inventory and recovery
|
|
111
|
-
|
|
112
|
-
```sh
|
|
113
|
-
insight-cli --profile local tools processes --tool ghidra
|
|
114
|
-
insight-cli --profile local tools processes show <process-id>
|
|
115
|
-
insight-cli --profile local tools processes stop <process-id>
|
|
116
|
-
insight-cli --profile local tools processes kill <process-id>
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
These IDs describe executions, not new research selectors. Context records include the existing
|
|
120
|
-
session/target; server, GUI, debugger and helper roles remain separate. `stop` saves a selected
|
|
121
|
-
Ghidra context through its ordinary close path. Stopping a server requires closed contexts.
|
|
122
|
-
`kill` requires Destructive and explicitly interrupts verified owned work; it does not prove a
|
|
123
|
-
merge/save completed. Live debugger cleanup goes through the owning GUI so inferior termination
|
|
124
|
-
can be verified. Research and unknown journals are retained.
|
|
125
|
-
|
|
126
|
-
After an owner crash, inventory reconnects to authenticated owned endpoints without re-executing
|
|
127
|
-
research. macOS process birth times alone cannot prove recovered ownership; an ambiguous process
|
|
128
|
-
stays `unverified` and is not signalled. Original child handles and authenticated tool identities
|
|
129
|
-
provide the supported stop/kill authority. This is lifecycle management, not an OS security sandbox.
|
|
130
|
-
|
|
131
|
-
## Sources and host boundary
|
|
132
|
-
|
|
133
|
-
The catalog pins Ghidra 12.1.2 and Temurin JDK 21.0.11+10. macOS uses public Homebrew-built Ghidra
|
|
134
|
-
bottles with native components (macOS 14+, ARM64 or x64); no installed Homebrew is used. Linux x64
|
|
135
|
-
and Windows x64 use the official Ghidra zip and Temurin archive. The installed `runtime/tool-catalog.json` pins mirror assets; repository
|
|
136
|
-
`scripts/tool-distributions/` recipes retain upstream provenance. Published tool releases include
|
|
137
|
-
original licenses/notices and required source/build companions, independent of CLI releases.
|
|
138
|
-
Unsupported platforms fail explicitly and may use compatible external profile paths.
|
|
139
|
-
|
|
140
|
-
The host provides Node/npm, OS frameworks, display/keychain access and debugger authorization.
|
|
141
|
-
On macOS 15+ ARM64 the managed debugger below supplies private LLDB/Python; Apple developer
|
|
142
|
-
tools are not prerequisites for that backend. Other macOS system-debugger routes use LLDB and
|
|
143
|
-
its Python from Apple's developer tools. `doctor` probes the selected backend and can report
|
|
144
|
-
partial debugger failure while static analysis/server pass. No root installation, developer-tools installer,
|
|
145
|
-
Gatekeeper disabling, shell-profile edit or global Java/Python selection is performed. Ghidra GUI
|
|
146
|
-
agents receive private copies of the Ghidra SDK's pinned debugger Python wheels.
|
|
147
|
-
|
|
148
|
-
## Managed debugger dependency
|
|
149
|
-
|
|
150
|
-
On macOS 15+ ARM64, download/install also prepares pinned LLDB 23.1.3 with its own
|
|
151
|
-
Python 3.15 and native library closure. It is a private Ghidra dependency; the separate
|
|
152
|
-
`insight-cli lldb` application retains its own installation. `--debugger-archive` supplies
|
|
153
|
-
the exact pinned debugger archive for offline installation, including an external Ghidra
|
|
154
|
-
selection. Status reports this dependency and doctor probes its actual Python interpreter.
|
|
155
|
-
GUI startup prepares it for legacy profiles as needed. The backend does not use Homebrew
|
|
156
|
-
or Python from Apple developer tools. OS debugger authorization is still a host prerequisite.
|
|
157
|
-
|
|
158
|
-
A GUI context pins the verified debugger receipt. Its supervisor verifies those code and
|
|
159
|
-
library bytes again before launching LLDB. Close contexts and stop the local server before
|
|
160
|
-
changing/removing the Ghidra runtime; uninstall removes this owned dependency while retaining
|
|
161
|
-
research and external installations. Existing running GUI contexts must be closed/reopened
|
|
162
|
-
to adopt a different backend. Other host debugger profiles retain their declared host requirements.
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import com.google.gson.*;
|
|
2
|
-
import ghidra.app.script.GhidraScript;
|
|
3
|
-
import ghidra.program.model.listing.*;
|
|
4
|
-
import java.nio.charset.StandardCharsets;
|
|
5
|
-
import java.util.*;
|
|
6
|
-
|
|
7
|
-
/** Build the pinned archive contract without networking or archive credentials in the JVM. */
|
|
8
|
-
public class InsightArchivePayloads extends GhidraScript {
|
|
9
|
-
@Override public void run() throws Exception {
|
|
10
|
-
JsonObject p=JsonParser.parseString(new String(Base64.getDecoder().decode(getScriptArgs()[0]),StandardCharsets.UTF_8)).getAsJsonObject();
|
|
11
|
-
Class<?> service=Class.forName("com.xebyte.core.DocumentationHashService");
|
|
12
|
-
Object instance=service.getConstructors()[0].newInstance(new Object[]{null,null,null});
|
|
13
|
-
var build=service.getDeclaredMethod("buildArchivePayload",Program.class,Function.class,String.class,String.class,String.class);build.setAccessible(true);
|
|
14
|
-
var defaults=service.getDeclaredMethod("isDefaultSymbolName",String.class);defaults.setAccessible(true);
|
|
15
|
-
int offset=p.get("offset").getAsInt(),limit=p.get("limit").getAsInt();
|
|
16
|
-
if(offset<0||limit<1||limit>100)throw new IllegalArgumentException();
|
|
17
|
-
List<Object> rows=new ArrayList<>();int visited=0,skipped=0;boolean more=false;
|
|
18
|
-
Iterable<Function> functions=currentProgram.getFunctionManager().getFunctions(true);
|
|
19
|
-
if(p.has("function")){
|
|
20
|
-
var address=currentProgram.getAddressFactory().getAddress(p.get("function").getAsString());
|
|
21
|
-
var function=address==null?null:currentProgram.getFunctionManager().getFunctionAt(address);
|
|
22
|
-
if(function==null)throw new IllegalArgumentException("No function at the selected address");functions=List.of(function);
|
|
23
|
-
}
|
|
24
|
-
for(var function:functions){
|
|
25
|
-
if(visited++<offset)continue;
|
|
26
|
-
if(rows.size()+skipped>=limit){more=true;visited--;break;}
|
|
27
|
-
if(p.get("skip_default_named").getAsBoolean()&&(Boolean)defaults.invoke(null,function.getName())){skipped++;continue;}
|
|
28
|
-
Object payload=build.invoke(instance,currentProgram,function,p.get("binary_name").getAsString(),p.get("version").getAsString(),p.get("run_id").getAsString());
|
|
29
|
-
if(new Gson().toJson(payload).getBytes(StandardCharsets.UTF_8).length>262144)throw new IllegalArgumentException("Function archive payload exceeds 256 KiB");
|
|
30
|
-
rows.add(payload);
|
|
31
|
-
}
|
|
32
|
-
var result=Map.of("payloads",rows,"visited",Math.min(limit,Math.max(0,visited-offset)),"skipped",skipped,"more",more);
|
|
33
|
-
String json=new Gson().toJson(result);if(json.getBytes(StandardCharsets.UTF_8).length>786432)throw new IllegalArgumentException("Archive page exceeds 768 KiB; reduce the page size");
|
|
34
|
-
println("INSIGHT_ARCHIVE_PAYLOADS "+json);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
package db.buffers;
|
|
2
|
-
|
|
3
|
-
import java.io.IOException;
|
|
4
|
-
import java.util.TreeSet;
|
|
5
|
-
import java.util.Arrays;
|
|
6
|
-
import java.nio.ByteBuffer;
|
|
7
|
-
import java.nio.charset.StandardCharsets;
|
|
8
|
-
import java.security.MessageDigest;
|
|
9
|
-
import java.util.HexFormat;
|
|
10
|
-
|
|
11
|
-
/** Pinned native block-stream protocol; avoids RMI serialization of DataBuffer objects. */
|
|
12
|
-
public class InsightBlockTransfer {
|
|
13
|
-
/** Exact live DB buffers/parameters; ignores physical headers and unused free allocation. */
|
|
14
|
-
public static String fingerprint(BufferFile file) throws Exception {
|
|
15
|
-
MessageDigest hash=MessageDigest.getInstance("SHA-256");
|
|
16
|
-
String[] parameters=file.getParameterNames();Arrays.sort(parameters);
|
|
17
|
-
for(String name:parameters) {
|
|
18
|
-
byte[] key=name.getBytes(StandardCharsets.UTF_8);
|
|
19
|
-
hash.update(ByteBuffer.allocate(4).putInt(key.length).array());hash.update(key);
|
|
20
|
-
hash.update(ByteBuffer.allocate(4).putInt(file.getParameter(name)).array());
|
|
21
|
-
}
|
|
22
|
-
TreeSet<Integer> free=new TreeSet<>();for(int index:file.getFreeIndexes())free.add(index);
|
|
23
|
-
InputBlockStream stream=file instanceof LocalBufferFile local?local.getInputBlockStream():
|
|
24
|
-
file instanceof BufferFileAdapter remote?remote.getInputBlockStream():null;
|
|
25
|
-
if(stream==null)throw new IOException("Unsupported saved buffer protocol");
|
|
26
|
-
try(InputBlockStream input=stream) {
|
|
27
|
-
BufferFileBlock block;int previous=-1;
|
|
28
|
-
while((block=input.readBlock())!=null) {
|
|
29
|
-
if(block.getIndex()<=previous)throw new IOException("Saved block stream order is inconsistent");previous=block.getIndex();
|
|
30
|
-
if(block.getIndex()==0||free.contains(block.getIndex()-1))continue;
|
|
31
|
-
hash.update(ByteBuffer.allocate(4).putInt(block.getIndex()).array());hash.update(block.getData());
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return HexFormat.of().formatHex(hash.digest());
|
|
35
|
-
}
|
|
36
|
-
public static void copy(LocalBufferFile source, ManagedBufferFile destination) throws Exception {
|
|
37
|
-
if (!(destination instanceof BufferFileAdapter remote)) throw new IOException("Expected remote save buffer");
|
|
38
|
-
try (InputBlockStream input=source.getInputBlockStream()) {
|
|
39
|
-
boolean header=input.includesHeaderBlock();
|
|
40
|
-
int expected=input.getBlockCount()-(header?1:0), written=0;
|
|
41
|
-
try (OutputBlockStream output=remote.getOutputBlockStream(expected)) {
|
|
42
|
-
BufferFileBlock block;
|
|
43
|
-
while((block=input.readBlock())!=null) {
|
|
44
|
-
if(header && block.getIndex()==0) continue;
|
|
45
|
-
output.writeBlock(block); written++;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
if(written!=expected) throw new IOException("Incomplete block transfer");
|
|
49
|
-
}
|
|
50
|
-
destination.clearParameters();
|
|
51
|
-
for(String name:source.getParameterNames()) destination.setParameter(name,source.getParameter(name));
|
|
52
|
-
TreeSet<Integer> free=new TreeSet<>();
|
|
53
|
-
for(int index:source.getFreeIndexes()) free.add(index);
|
|
54
|
-
for(int index=source.getIndexCount();index<destination.getIndexCount();index++) free.add(index);
|
|
55
|
-
destination.setFreeIndexes(free.stream().mapToInt(Integer::intValue).toArray());
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import ghidra.GhidraApplicationLayout;
|
|
2
|
-
import ghidra.framework.Application;
|
|
3
|
-
import ghidra.framework.GhidraApplicationConfiguration;
|
|
4
|
-
import ghidra.framework.main.FrontEndTool;
|
|
5
|
-
import ghidra.framework.model.ProjectLocator;
|
|
6
|
-
import ghidra.framework.project.DefaultProjectManager;
|
|
7
|
-
import javax.swing.SwingUtilities;
|
|
8
|
-
|
|
9
|
-
/** An isolated frontend for a saved facade context; never loads a user's default project. */
|
|
10
|
-
class InsightGuiMain {
|
|
11
|
-
static class OwnedProjectManager extends DefaultProjectManager { OwnedProjectManager(){super();} }
|
|
12
|
-
public static void main(String[] args) throws Exception {
|
|
13
|
-
if(args.length!=3 || System.getenv("GHIDRA_MCP_AUTH_TOKEN")==null) throw new IllegalArgumentException();
|
|
14
|
-
GhidraApplicationConfiguration configuration=new GhidraApplicationConfiguration();
|
|
15
|
-
configuration.setShowSplashScreen(false);
|
|
16
|
-
Application.initializeApplication(new GhidraApplicationLayout(),configuration);
|
|
17
|
-
insight.nativecheckout.InsightOfflineAuthenticator.install();
|
|
18
|
-
SwingUtilities.invokeAndWait(()->{
|
|
19
|
-
try {
|
|
20
|
-
var manager=new OwnedProjectManager();
|
|
21
|
-
var project=manager.openProject(new ProjectLocator(args[0],args[1]),false,false);
|
|
22
|
-
var frontend=new FrontEndTool(manager);
|
|
23
|
-
if(project.getToolManager().getActiveWorkspace()==null) project.getToolManager().createWorkspace("Research").setActive();
|
|
24
|
-
frontend.setActiveProject(project);
|
|
25
|
-
var options=frontend.getOptions("GhidraMCP HTTP Server");
|
|
26
|
-
options.setInt("Server Port",Integer.parseInt(args[2]));
|
|
27
|
-
options.setBoolean("Enable UDS Transport",false); options.setBoolean("Enable TCP Transport",true);
|
|
28
|
-
options.setBoolean("Strict Naming Enforcement",false);
|
|
29
|
-
frontend.addPlugin("com.xebyte.GhidraMCPPlugin"); frontend.setVisible(true);
|
|
30
|
-
} catch(Exception failure) { throw new RuntimeException(failure); }
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import com.xebyte.core.NamingPolicy;
|
|
2
|
-
import com.xebyte.headless.GhidraMCPHeadlessServer;
|
|
3
|
-
|
|
4
|
-
/** Preserve caller-selected names in the owned facade, including structure fields. */
|
|
5
|
-
class InsightHeadlessMain {
|
|
6
|
-
public static void main(String[] args) throws Exception {
|
|
7
|
-
insight.nativecheckout.InsightOfflineAuthenticator.install();
|
|
8
|
-
InsightWorkerLease.start();
|
|
9
|
-
NamingPolicy.getInstance().setStrictNamingEnforcement(false, "insight facade");
|
|
10
|
-
// The steps of GhidraMCPHeadlessServer.main, keeping the instance so that owned helper scripts can run in-process.
|
|
11
|
-
GhidraMCPHeadlessServer server=new GhidraMCPHeadlessServer();
|
|
12
|
-
InsightOwnedScripts.bind(server);
|
|
13
|
-
try{server.launch(new ghidra.GhidraApplicationLayout(),args);}
|
|
14
|
-
catch(Exception failure){
|
|
15
|
-
System.err.println("Failed to launch headless server: "+failure.getMessage());failure.printStackTrace();System.exit(1);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import com.google.gson.*;
|
|
2
|
-
import ghidra.util.task.TaskMonitorAdapter;
|
|
3
|
-
import insight.InsightInitialJournal;
|
|
4
|
-
import java.nio.file.*;
|
|
5
|
-
import java.time.Instant;
|
|
6
|
-
import java.util.*;
|
|
7
|
-
|
|
8
|
-
/** A bounded observation channel, never a completion receipt or an overall percentage. */
|
|
9
|
-
class InsightImportProgress extends TaskMonitorAdapter implements AutoCloseable {
|
|
10
|
-
private final Path root;
|
|
11
|
-
private final String target,attempt;
|
|
12
|
-
private final String started=Instant.now().toString();
|
|
13
|
-
private final Timer heartbeat=new Timer("insight-import-progress",true);
|
|
14
|
-
private String phase="starting",state="running";
|
|
15
|
-
private String message="";
|
|
16
|
-
private long completed,total;
|
|
17
|
-
private boolean indeterminate=true;
|
|
18
|
-
private volatile Throwable writeFailure;
|
|
19
|
-
InsightImportProgress(Path root,String target)throws Exception{
|
|
20
|
-
this(root,target,null);
|
|
21
|
-
}
|
|
22
|
-
InsightImportProgress(Path root,String target,String attempt)throws Exception{
|
|
23
|
-
super(true);this.root=root;this.target=target;this.attempt=attempt;
|
|
24
|
-
Path previous=root.resolve("progress.json");
|
|
25
|
-
if(Files.exists(previous)){
|
|
26
|
-
JsonObject saved=InsightInitialJournal.read(previous);
|
|
27
|
-
if(saved.get("schema").getAsInt()!=1||!target.equals(saved.get("target").getAsString()))throw new SecurityException("Initial progress binding changed");
|
|
28
|
-
// Preserve observations only; an analysis checkpoint requires its own prepared snapshot.
|
|
29
|
-
InsightInitialJournal.write(root.resolve("progress-history-"+UUID.randomUUID()+".json"),saved);
|
|
30
|
-
}
|
|
31
|
-
observe();
|
|
32
|
-
heartbeat.scheduleAtFixedRate(new TimerTask(){public void run(){try{observe();}catch(Throwable failure){writeFailure=failure;}}},2000,2000);
|
|
33
|
-
}
|
|
34
|
-
synchronized void phase(String value)throws Exception{phase=value;setMessage("");initialize(0);setIndeterminate(true);observe();}
|
|
35
|
-
public synchronized void setMessage(String value){message=Objects.toString(value,"");}
|
|
36
|
-
public synchronized String getMessage(){return message;}
|
|
37
|
-
public synchronized void initialize(long maximum){completed=0;total=maximum;indeterminate=maximum<=0;}
|
|
38
|
-
public synchronized void setProgress(long value){completed=value;}
|
|
39
|
-
public synchronized void incrementProgress(long value){completed+=value;}
|
|
40
|
-
public synchronized long getProgress(){return completed;}
|
|
41
|
-
public synchronized void setMaximum(long value){total=value;}
|
|
42
|
-
public synchronized long getMaximum(){return total;}
|
|
43
|
-
public synchronized void setIndeterminate(boolean value){indeterminate=value;}
|
|
44
|
-
public synchronized boolean isIndeterminate(){return indeterminate;}
|
|
45
|
-
synchronized void state(String value)throws Exception{state=value;observe();}
|
|
46
|
-
// Observation I/O must never invalidate a completed import or its prepared receipt.
|
|
47
|
-
private synchronized void observe()throws Exception{
|
|
48
|
-
try{emit();writeFailure=null;}
|
|
49
|
-
catch(java.io.IOException failure){writeFailure=failure;}
|
|
50
|
-
}
|
|
51
|
-
private synchronized void emit()throws Exception{
|
|
52
|
-
JsonObject p=new JsonObject();p.addProperty("schema",1);p.addProperty("target",target);p.addProperty("phase",phase);p.addProperty("state",state);
|
|
53
|
-
if(attempt!=null)p.addProperty("attempt",attempt);
|
|
54
|
-
p.addProperty("pid",ProcessHandle.current().pid());p.addProperty("startedAt",started);p.addProperty("updatedAt",Instant.now().toString());
|
|
55
|
-
p.addProperty("indeterminate",isIndeterminate());String message=Objects.toString(getMessage(),"");p.addProperty("message",message.substring(0,Math.min(message.length(),1024)));
|
|
56
|
-
if(!isIndeterminate()&&getMaximum()>0){p.addProperty("completed",getProgress());p.addProperty("total",getMaximum());}
|
|
57
|
-
InsightInitialJournal.write(root.resolve("progress.json"),p);
|
|
58
|
-
}
|
|
59
|
-
public synchronized void close()throws Exception{heartbeat.cancel();if(state.equals("running"))state=isCancelled()?"cancelled":"failed";observe();if(writeFailure!=null)System.err.println("Initial import progress is unavailable; native completion receipts remain authoritative.");}
|
|
60
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import com.google.gson.*;
|
|
2
|
-
import ghidra.GhidraApplicationLayout;
|
|
3
|
-
import ghidra.framework.*;
|
|
4
|
-
import insight.InsightInitialJournal;
|
|
5
|
-
import java.nio.file.*;
|
|
6
|
-
import java.nio.channels.*;
|
|
7
|
-
import java.util.*;
|
|
8
|
-
|
|
9
|
-
/** No repository connection: incomplete analysis can only leave a private attempt. */
|
|
10
|
-
class InsightInitialImport {
|
|
11
|
-
public static void main(String[] args){var out=System.out;System.setOut(System.err);
|
|
12
|
-
try{
|
|
13
|
-
Path root=Path.of(args[0]);JsonObject p=InsightInitialJournal.intent(root);
|
|
14
|
-
try(var channel=FileChannel.open(InsightInitialJournal.lockRoot(root).resolve("lock"),StandardOpenOption.CREATE,StandardOpenOption.WRITE);var lock=channel.tryLock()){
|
|
15
|
-
if(lock==null){out.println("{\"state\":\"busy\"}");System.exit(0);}
|
|
16
|
-
Path journal=root.resolve("import.json");
|
|
17
|
-
if(Files.exists(journal)&&InsightInitialJournal.text(InsightInitialJournal.read(journal),"phase").equals("prepared")){
|
|
18
|
-
InsightInitialJournal.prepared(root);out.println("{\"state\":\"prepared\"}");System.exit(0);
|
|
19
|
-
}
|
|
20
|
-
if(Files.exists(root.resolve("publication.json")))throw new SecurityException("Publication already started without a prepared snapshot");
|
|
21
|
-
Path input=Path.of(InsightInitialJournal.text(p,"input"));
|
|
22
|
-
if(!InsightInitialJournal.hash(input).equals(InsightInitialJournal.text(p,"sha256")))throw new SecurityException("Input bytes changed");
|
|
23
|
-
JsonObject s=new JsonObject();s.addProperty("intentHash",InsightInitialJournal.hash(root.resolve("intent.json")));
|
|
24
|
-
s.addProperty("phase","importing");s.addProperty("pid",ProcessHandle.current().pid());s.addProperty("snapshot","attempt-"+UUID.randomUUID()+".gzf");
|
|
25
|
-
Path attempt=root.resolve(InsightInitialJournal.text(s,"snapshot")+".json");InsightInitialJournal.write(attempt,s);InsightInitialJournal.write(journal,s);
|
|
26
|
-
try(var progress=new InsightImportProgress(InsightInitialJournal.lockRoot(root),InsightInitialJournal.text(p,"target"),InsightInitialJournal.text(s,"snapshot"))){
|
|
27
|
-
progress.phase("runtime-initialization");
|
|
28
|
-
Application.initializeApplication(new GhidraApplicationLayout(),new HeadlessGhidraApplicationConfiguration());
|
|
29
|
-
JsonObject settings=p.getAsJsonObject("settings"),request=new JsonObject();
|
|
30
|
-
request.addProperty("input",input.toString());request.addProperty("output",root.resolve(InsightInitialJournal.text(s,"snapshot")).toString());
|
|
31
|
-
request.add("auto_analyze",settings.get("autoAnalyze"));request.addProperty("native_model",true);
|
|
32
|
-
for(String key:List.of("language","loader"))if(settings.has(key))request.add(key,settings.get(key));
|
|
33
|
-
if(settings.has("compilerSpec"))request.add("compiler_spec",settings.get("compilerSpec"));
|
|
34
|
-
if(settings.has("imageBase"))request.add("image_base",settings.get("imageBase"));
|
|
35
|
-
if(settings.has("loaderOptions"))request.add("options",settings.get("loaderOptions"));
|
|
36
|
-
JsonObject metadata;
|
|
37
|
-
try{metadata=new Gson().toJsonTree(InsightSdkFiles.importProgram(request,progress)).getAsJsonObject();}
|
|
38
|
-
catch(Throwable failure){progress.state(progress.isCancelled()?"cancelled":"failed");throw failure;}
|
|
39
|
-
progress.phase("snapshot-verification");
|
|
40
|
-
Path file=root.resolve(InsightInitialJournal.text(s,"snapshot"));InsightInitialJournal.sync(file);
|
|
41
|
-
s.add("metadata",metadata);s.addProperty("snapshotSha256",InsightInitialJournal.hash(file));s.addProperty("phase","prepared");InsightInitialJournal.write(attempt,s);InsightInitialJournal.write(journal,s);
|
|
42
|
-
InsightInitialJournal.prepared(root);progress.state("prepared");out.println("{\"state\":\"prepared\"}");
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
System.exit(0);
|
|
46
|
-
}catch(Throwable failure){failure.printStackTrace(System.err);out.println("{\"state\":\"failed\"}");System.exit(1);}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
package insight;
|
|
2
|
-
|
|
3
|
-
import com.google.gson.*;
|
|
4
|
-
import java.nio.file.*;
|
|
5
|
-
import java.nio.channels.*;
|
|
6
|
-
import java.security.MessageDigest;
|
|
7
|
-
import java.util.*;
|
|
8
|
-
|
|
9
|
-
/** Initial-model receipts, shared by private import and conditional create/readback helpers. */
|
|
10
|
-
public class InsightInitialJournal {
|
|
11
|
-
public static String text(JsonObject p,String key){return p.get(key).getAsString();}
|
|
12
|
-
public static JsonObject read(Path p)throws Exception{
|
|
13
|
-
if(!Files.isRegularFile(p,LinkOption.NOFOLLOW_LINKS)||Files.size(p)>1048576)throw new SecurityException("Invalid initial-model receipt");
|
|
14
|
-
return JsonParser.parseString(Files.readString(p)).getAsJsonObject();
|
|
15
|
-
}
|
|
16
|
-
public static String hash(Path p)throws Exception{
|
|
17
|
-
if(!Files.isRegularFile(p,LinkOption.NOFOLLOW_LINKS))throw new SecurityException("Invalid initial-model file");
|
|
18
|
-
MessageDigest hash=MessageDigest.getInstance("SHA-256");try(var in=Files.newInputStream(p)){byte[] b=new byte[65536];for(int n;(n=in.read(b))>=0;)if(n>0)hash.update(b,0,n);}
|
|
19
|
-
return HexFormat.of().formatHex(hash.digest());
|
|
20
|
-
}
|
|
21
|
-
public static void sync(Path p)throws Exception{try(var f=FileChannel.open(p,StandardOpenOption.WRITE)){f.force(true);}}
|
|
22
|
-
public static void write(Path p,JsonObject value)throws Exception{
|
|
23
|
-
Path temp=p.resolveSibling(p.getFileName()+".new-"+UUID.randomUUID());
|
|
24
|
-
Files.writeString(temp,new Gson().toJson(value),StandardOpenOption.CREATE_NEW);sync(temp);
|
|
25
|
-
Files.move(temp,p,StandardCopyOption.ATOMIC_MOVE,StandardCopyOption.REPLACE_EXISTING);
|
|
26
|
-
if(!System.getProperty("os.name").toLowerCase().contains("win"))try(var d=FileChannel.open(p.getParent(),StandardOpenOption.READ)){d.force(true);}
|
|
27
|
-
}
|
|
28
|
-
public static JsonObject intent(Path root)throws Exception{
|
|
29
|
-
if(!root.toRealPath().equals(root.toAbsolutePath().normalize()))throw new SecurityException("Initial-model root moved");
|
|
30
|
-
JsonObject p=read(root.resolve("intent.json"));
|
|
31
|
-
if(p.get("schema").getAsInt()!=1||!text(p,"target").matches("t_[a-f0-9]{32}")||!text(p,"id").matches("[a-f0-9-]{36}")||!text(p,"sha256").matches("[a-f0-9]{64}"))throw new SecurityException("Invalid initial-model identity");
|
|
32
|
-
return p;
|
|
33
|
-
}
|
|
34
|
-
/** Upgraded preparations share the original attempt's native lock. */
|
|
35
|
-
public static Path lockRoot(Path root)throws Exception{
|
|
36
|
-
JsonObject p=intent(root);if(!p.has("recoveryOf"))return root;
|
|
37
|
-
Path parent=root.getParent();JsonObject original=intent(parent);
|
|
38
|
-
if(!root.getFileName().toString().equals("runtime-"+text(p,"runtimeFingerprint"))||!text(p,"recoveryOf").equals(hash(parent.resolve("intent.json"))))throw new SecurityException("Recovery ancestry changed");
|
|
39
|
-
JsonObject expected=original.deepCopy();expected.add("id",p.get("id"));expected.add("runtimeFingerprint",p.get("runtimeFingerprint"));expected.add("recoveryOf",p.get("recoveryOf"));
|
|
40
|
-
if(!expected.equals(p))throw new SecurityException("Recovery immutable identity changed");
|
|
41
|
-
return parent;
|
|
42
|
-
}
|
|
43
|
-
public static JsonObject prepared(Path root)throws Exception{
|
|
44
|
-
JsonObject p=intent(root),s=read(root.resolve("import.json"));
|
|
45
|
-
if(!text(s,"intentHash").equals(hash(root.resolve("intent.json")))||!text(s,"phase").equals("prepared"))throw new SecurityException("Import is not prepared");
|
|
46
|
-
String name=text(s,"snapshot");if(!name.matches("attempt-[a-f0-9-]{36}\\.gzf"))throw new SecurityException();
|
|
47
|
-
Path file=root.resolve(name);if(!text(s,"snapshotSha256").equals(hash(file)))throw new SecurityException("Initial snapshot changed");
|
|
48
|
-
JsonObject v=s.getAsJsonObject("metadata"),settings=p.getAsJsonObject("settings");
|
|
49
|
-
if(!text(v,"sha256").equals(text(p,"sha256"))||v.get("auto_analyzed").getAsBoolean()!=settings.get("autoAnalyze").getAsBoolean())throw new SecurityException();
|
|
50
|
-
for(String key:List.of("language","compilerSpec","imageBase"))if(settings.has(key)){
|
|
51
|
-
String field=key.equals("compilerSpec")?"compiler":key.equals("imageBase")?"base_address":key;
|
|
52
|
-
String got=text(v,field);if(key.equals("imageBase"))got=got.replaceFirst("^0+(?!$)","");
|
|
53
|
-
if(!got.equals(text(settings,key)))throw new SecurityException("Initial load settings changed");
|
|
54
|
-
}
|
|
55
|
-
return s;
|
|
56
|
-
}
|
|
57
|
-
}
|