@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
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import { fail } from './model.js';
|
|
2
|
-
import { rejectPlaceholders } from './query-policy.js';
|
|
3
|
-
const shapes = {
|
|
4
|
-
'/analyze_data_region': { start_address: 'string', end_address: 'string', byte_span: 'number', xref_count: 'number', classification_hint: 'string' },
|
|
5
|
-
'/detect_array_bounds': { address: 'string', estimated_size: 'number', stride: 'number', element_count: 'number', confidence: 'string' },
|
|
6
|
-
'/analyze_control_flow': { function_name: 'string', entry_point: 'string', metrics: 'object', basic_block_details: 'array' },
|
|
7
|
-
'/analyze_dataflow': { function: 'object', anchor: 'object', direction: 'string', chain: 'array', truncated: 'boolean' },
|
|
8
|
-
'/analyze_for_documentation': { name: 'string', address: 'string', parameters: 'array', locals: 'array' },
|
|
9
|
-
'/analyze_function_complete': { name: 'string', address: 'string' },
|
|
10
|
-
'/analyze_function_completeness': { function_name: 'string', completeness_score: 'number' },
|
|
11
|
-
'/find_code_gaps': { gaps: 'array', total: 'number', offset: 'number', limit: 'number' },
|
|
12
|
-
'/find_next_undefined_function': { found: 'boolean' },
|
|
13
|
-
'/find_similar_functions': { target_function: 'string', similar_functions: 'array', matches_found: 'number' },
|
|
14
|
-
'/get_field_access_context': { struct_address: 'string', field_offset: 'number', examples: 'array' },
|
|
15
|
-
'/get_function_pcode': { name: 'string', address: 'string', basic_blocks: 'array' },
|
|
16
|
-
'/inspect_memory_content': { address: 'string', bytes_read: 'number', hex_dump: 'string' },
|
|
17
|
-
'/list_analyzers': { analyzers: 'array', count: 'number' },
|
|
18
|
-
'/search_instructions': { matches: 'array' },
|
|
19
|
-
'/analyze_global_completeness': { address: 'string', score: 'number', issues: 'array' },
|
|
20
|
-
'/analyze_struct_field_usage': { struct_name: 'string', struct_size: 'number', field_usage: 'object' },
|
|
21
|
-
'/audit_global': { address: 'string', issues: 'array', fully_documented: 'boolean' },
|
|
22
|
-
'/audit_globals_in_function': { function: 'object', globals: 'array', summary: 'object' },
|
|
23
|
-
'/get_enum_values': { name: 'string', size: 'number', values: 'array' },
|
|
24
|
-
'/get_struct_layout': { name: 'string', size: 'number', alignment: 'number', fields: 'array' },
|
|
25
|
-
'/get_type_size': { type_name: 'string', size: 'number', alignment: 'number' },
|
|
26
|
-
'/get_valid_data_types': { builtin_types: 'array', windows_types: 'array' },
|
|
27
|
-
'/suggest_field_names': { struct_address: 'string', suggestions: 'array' },
|
|
28
|
-
'/validate_data_type': { type_name: 'string', valid: 'boolean', warnings: 'array' },
|
|
29
|
-
'/validate_function_prototype': { valid: 'boolean' },
|
|
30
|
-
'/batch_string_anchor_report': { anchors: 'array', total_anchors: 'number' },
|
|
31
|
-
'/find_undocumented_by_string': { undocumented_functions: 'array', undocumented_count: 'number' },
|
|
32
|
-
'/get_function_documentation': { hash: 'string', function_name: 'string', parameters: 'array', comments: 'array', labels: 'array' },
|
|
33
|
-
'/emulate_function': { success: 'boolean', steps_executed: 'number', stop_reason: 'string', registers: 'object' },
|
|
34
|
-
'/emulate_hash_batch': { tested: 'number', matches: 'array', resolved: 'boolean' },
|
|
35
|
-
'/disassemble_function': { instructions: 'array', count: 'number' },
|
|
36
|
-
'/force_decompile': { address: 'string', name: 'string', decompiled: 'string' },
|
|
37
|
-
'/get_functions': { functions: 'object', count: 'number', requested: 'number' },
|
|
38
|
-
'/list_class_members': { class_name: 'string', members: 'array', total_members: 'number' },
|
|
39
|
-
'/list_function_tags': { tags: 'array', total: 'number' },
|
|
40
|
-
'/find_functions': { functions: 'array', total: 'number', count: 'number' },
|
|
41
|
-
'/get_entry_points': { entry_points: 'array', count: 'number' },
|
|
42
|
-
'/get_function_count': { function_count: 'number' },
|
|
43
|
-
'/list_calling_conventions': { calling_conventions: 'array', count: 'number' },
|
|
44
|
-
'/list_globals': { globals: 'array', count: 'number', total: 'number' },
|
|
45
|
-
'/list_program_items': { kind: 'string', items: 'array', count: 'number', total: 'number' },
|
|
46
|
-
'/list_shadowed_globals': { shadowed: 'array', count: 'number', total: 'number' },
|
|
47
|
-
'/list_strings': { strings: 'array', count: 'number', total: 'number' },
|
|
48
|
-
'/search_strings': { matches: 'array', total: 'number', offset: 'number', limit: 'number' },
|
|
49
|
-
'/analyze_api_call_chains': { detected_patterns: 'array', total_patterns_detected: 'number' },
|
|
50
|
-
'/detect_malware_behaviors': { behaviors: 'array', total_behaviors_detected: 'number' },
|
|
51
|
-
'/extract_iocs_with_context': { iocs: 'array', total_iocs: 'number' },
|
|
52
|
-
'/find_anti_analysis_techniques': { findings: 'array', total_findings: 'number' },
|
|
53
|
-
'/analysis_status': { analyzing: 'boolean', analyzed: 'boolean', function_count: 'number' },
|
|
54
|
-
'/get_address_spaces': { address_spaces: 'array', count: 'number' },
|
|
55
|
-
'/get_language_metadata': { language_id: 'string', processor: 'string', endian: 'string', address_spaces: 'array' },
|
|
56
|
-
'/get_metadata': { architecture: 'string', compiler: 'string', language: 'string', base_address: 'string', function_count: 'number' },
|
|
57
|
-
'/get_property': { address: 'string', has_value: 'boolean' },
|
|
58
|
-
'/list_bookmarks': { bookmarks: 'array', count: 'number' },
|
|
59
|
-
'/list_properties': { map: 'string', entries: 'array', count: 'number', total: 'number' },
|
|
60
|
-
'/read_memory': { address: 'string', length: 'number', data: 'array', hex: 'string' },
|
|
61
|
-
'/can_rename_at_address': { can_rename: 'boolean', type: 'string' },
|
|
62
|
-
'/get_function_call_graph': { edges: 'array', count: 'number' },
|
|
63
|
-
'/get_xrefs_from': { references: 'array', count: 'number', total: 'number' },
|
|
64
|
-
'/get_xrefs_to': { references: 'array', count: 'number', total: 'number' },
|
|
65
|
-
};
|
|
66
|
-
function checkShape(result, shape) {
|
|
67
|
-
if (!result || typeof result !== 'object' || Array.isArray(result))
|
|
68
|
-
fail('partial', 'Query expected a result object.');
|
|
69
|
-
const value = result;
|
|
70
|
-
for (const [key, type] of Object.entries(shape)) {
|
|
71
|
-
const item = value[key], valid = type === 'array' ? Array.isArray(item) : type === 'object' ? Boolean(item) && typeof item === 'object' && !Array.isArray(item) :
|
|
72
|
-
type === 'number' ? typeof item === 'number' && Number.isFinite(item) : typeof item === type;
|
|
73
|
-
if (!valid)
|
|
74
|
-
fail('partial', `Query omitted or malformed ${key}.`);
|
|
75
|
-
}
|
|
76
|
-
return value;
|
|
77
|
-
}
|
|
78
|
-
/** Validate the pinned operation's result variant, independently of its HTTP acknowledgment. */
|
|
79
|
-
export function queryResult(path, parameters, result) {
|
|
80
|
-
rejectPlaceholders(result);
|
|
81
|
-
let shape = shapes[path];
|
|
82
|
-
if (path === '/find_dead_code')
|
|
83
|
-
shape = { findings: 'array', complete: 'boolean', unresolved_flow: 'boolean', algorithm: 'string', scan: 'object', truncated: 'boolean' };
|
|
84
|
-
if (path === '/detect_crypto_constants' || path === '/search_byte_patterns')
|
|
85
|
-
shape = { matches: 'array', complete: 'boolean', scanned_bytes: 'number', maximum_bytes: 'number', algorithm: 'string', scan: 'object', truncated: 'boolean' };
|
|
86
|
-
if (path === '/get_valid_data_types')
|
|
87
|
-
shape = { types: 'array', scope: 'string', scan: 'object', truncated: 'boolean' };
|
|
88
|
-
if (path === '/validate_function_prototype')
|
|
89
|
-
shape = { valid: 'boolean', diagnostics: 'array', parser: 'string', persisted_changes: 'boolean' };
|
|
90
|
-
const bulkComments = path === '/get_comment' && Boolean(String(parameters.addresses ?? '').trim());
|
|
91
|
-
if (path === '/get_comment')
|
|
92
|
-
shape = bulkComments ? { results: 'array', requested: 'number', returned: 'number', with_comments: 'number' } : { address: 'string', has_comment: 'boolean' };
|
|
93
|
-
if (path === '/find_data_types')
|
|
94
|
-
shape = { ...(parameters.categories ? { categories: 'array' } : { data_types: 'array' }), count: 'number' };
|
|
95
|
-
if (path === '/get_function_hash')
|
|
96
|
-
shape = parameters.function ? { hash: 'string', function_name: 'string', instruction_count: 'number' } : { functions: 'array' };
|
|
97
|
-
// The pinned service returns a bare bundle for function=, a map/counts for functions=.
|
|
98
|
-
// Bulk selection takes precedence even when both selectors are supplied.
|
|
99
|
-
if (path === '/get_functions' && !String(parameters.functions ?? '').trim())
|
|
100
|
-
shape = { name: 'string', size: 'number' };
|
|
101
|
-
if (path === '/get_program_options')
|
|
102
|
-
shape = parameters.group ? { options: 'array' } : { groups: 'array' };
|
|
103
|
-
// The pinned implementation retains format as a deprecated no-op and always returns JSON.
|
|
104
|
-
if (path === '/list_data_items_by_xrefs')
|
|
105
|
-
shape = { data_items: 'array', count: 'number', total: 'number' };
|
|
106
|
-
if (path === '/get_external_location')
|
|
107
|
-
shape = { address: 'string' };
|
|
108
|
-
if (path === '/get_full_call_graph')
|
|
109
|
-
shape = parameters.format === 'json_edges' ? { edges: 'array', edge_count: 'number', caller_count: 'number' } :
|
|
110
|
-
parameters.format === 'dot' || parameters.format === 'mermaid' ? { format: 'string', diagram: 'string', count: 'number' } :
|
|
111
|
-
parameters.format === 'adjacency' ? { format: 'string', adjacency: 'object', count: 'number' } : { edges: 'array', count: 'number' };
|
|
112
|
-
if (path === '/analyze_call_graph')
|
|
113
|
-
shape = parameters.analysis_type === undefined || parameters.analysis_type === 'summary' ? { total_functions: 'number', total_call_edges: 'number' } : { analysis_type: 'string' };
|
|
114
|
-
if (path === '/get_assembly_context') {
|
|
115
|
-
const value = checkShape(result, {}), input = parameters.xref_sources;
|
|
116
|
-
const addresses = Array.isArray(input) ? input : typeof input === 'string' ? input.split(',').map(v => v.trim()).filter(Boolean) : [];
|
|
117
|
-
for (const at of addresses)
|
|
118
|
-
if (!Object.hasOwn(value, String(at)))
|
|
119
|
-
fail('partial', 'Assembly context omitted a requested address.');
|
|
120
|
-
return result;
|
|
121
|
-
}
|
|
122
|
-
if (path === '/list_scripts')
|
|
123
|
-
shape = { items: 'array', count: 'number', total: 'number', offset: 'number', limit: 'number', truncated: 'boolean' };
|
|
124
|
-
if (!shape)
|
|
125
|
-
fail('schema', 'Pinned query has no result contract.');
|
|
126
|
-
const value = checkShape(result, shape);
|
|
127
|
-
const rowShapes = {
|
|
128
|
-
'/list_globals': { key: 'globals', shape: { address: 'string', name: 'string', type: 'string', size: 'number', xrefs: 'number', named: 'boolean', typed: 'boolean' } },
|
|
129
|
-
'/list_strings': { key: 'strings', shape: { address: 'string', value: 'string', encoding: 'string' } },
|
|
130
|
-
'/search_strings': { key: 'matches', shape: { address: 'string', value: 'string', encoding: 'string' } },
|
|
131
|
-
'/search_instructions': { key: 'matches', shape: { address: 'string', mnemonic: 'string', instruction: 'string', length: 'number' } },
|
|
132
|
-
'/get_valid_data_types': { key: 'types', shape: { name: 'string', path: 'string', size: 'number', alignment: 'number', source: 'string' } },
|
|
133
|
-
'/find_dead_code': { key: 'findings', shape: { address: 'string', end: 'string', size: 'number', kind: 'string' } },
|
|
134
|
-
'/detect_crypto_constants': { key: 'matches', shape: { address: 'string', signature: 'string', length: 'number', kind: 'string' } },
|
|
135
|
-
'/search_byte_patterns': { key: 'matches', shape: { address: 'string', signature: 'string', length: 'number', kind: 'string' } },
|
|
136
|
-
'/get_function_call_graph': { key: 'edges', shape: { caller: 'string', callee: 'string' } },
|
|
137
|
-
};
|
|
138
|
-
const checkedRows = rowShapes[path];
|
|
139
|
-
if (checkedRows)
|
|
140
|
-
for (const row of value[checkedRows.key])
|
|
141
|
-
checkShape(row, checkedRows.shape);
|
|
142
|
-
if (value.scan !== undefined) {
|
|
143
|
-
const scan = checkShape(value.scan, { visited: 'number', maximum: 'number', complete: 'boolean', reason: 'string' });
|
|
144
|
-
if (!Number.isSafeInteger(scan.visited) || !Number.isSafeInteger(scan.maximum) || Number(scan.visited) < 0 || Number(scan.visited) > Number(scan.maximum))
|
|
145
|
-
fail('partial', 'Query scan counters are inconsistent.');
|
|
146
|
-
if (scan.complete === false && value.truncated !== true)
|
|
147
|
-
fail('partial', 'Incomplete query scan was reported as untruncated.');
|
|
148
|
-
}
|
|
149
|
-
for (const entry of [['globals', 'count'], ['strings', 'count'], ['matches', 'count'], ['types', 'count']])
|
|
150
|
-
if (Array.isArray(value[entry[0]]) && value[entry[1]] !== undefined && value[entry[1]] !== value[entry[0]].length)
|
|
151
|
-
fail('partial', 'Query row count is inconsistent.');
|
|
152
|
-
if (path === '/find_dead_code' && (value.complete === false || value.unresolved_flow === true) && value.findings.length)
|
|
153
|
-
fail('partial', 'Incomplete CFG analysis cannot classify unreachable blocks.');
|
|
154
|
-
if (path === '/detect_crypto_constants' || path === '/search_byte_patterns') {
|
|
155
|
-
if (Number(value.scanned_bytes) > Number(value.maximum_bytes) || Number(value.scanned_bytes) < 0)
|
|
156
|
-
fail('partial', 'Byte scan exceeded its declared budget.');
|
|
157
|
-
if (value.complete === false && typeof value.next_address !== 'string')
|
|
158
|
-
fail('partial', 'Partial byte scan omitted its continuation.');
|
|
159
|
-
if (path === '/detect_crypto_constants') {
|
|
160
|
-
const database = checkShape(value.database, { version: 'string', signatures: 'array' });
|
|
161
|
-
for (const row of database.signatures)
|
|
162
|
-
checkShape(row, { name: 'string', length: 'number' });
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
if (path === '/get_entry_points') {
|
|
166
|
-
for (const raw of value.entry_points) {
|
|
167
|
-
const row = checkShape(raw, { address: 'string', name: 'string', kind: 'string', confirmed: 'boolean', provenance: 'string' });
|
|
168
|
-
if (row.confirmed !== true || row.kind !== 'external_entry' || row.provenance !== 'ghidra.symbol.external-entry-point')
|
|
169
|
-
fail('partial', 'Entry-point metadata was replaced by an unconfirmed candidate.');
|
|
170
|
-
}
|
|
171
|
-
if (!Array.isArray(value.candidates))
|
|
172
|
-
fail('partial', 'Entry-point result omitted its candidates.');
|
|
173
|
-
for (const raw of value.candidates) {
|
|
174
|
-
const row = checkShape(raw, { address: 'string', name: 'string', kind: 'string', confirmed: 'boolean', provenance: 'string' });
|
|
175
|
-
if (row.confirmed !== false)
|
|
176
|
-
fail('partial', 'Entry candidate was labeled confirmed.');
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
if (path === '/validate_function_prototype' || path === '/validate_data_type') {
|
|
180
|
-
if (!Array.isArray(value.diagnostics))
|
|
181
|
-
fail('partial', 'Validation omitted parser/resolution diagnostics.');
|
|
182
|
-
for (const raw of value.diagnostics)
|
|
183
|
-
checkShape(raw, { severity: 'string', code: 'string', message: 'string' });
|
|
184
|
-
if (value.valid === true) {
|
|
185
|
-
if (path === '/validate_data_type')
|
|
186
|
-
checkShape(value.resolved, { name: 'string', path: 'string', size: 'number', alignment: 'number' });
|
|
187
|
-
else
|
|
188
|
-
checkShape(value.signature, { name: 'string', return_type: 'object', parameters: 'array', calling_convention: 'string' });
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
if (path === '/emulate_function' && value.completed !== undefined) {
|
|
192
|
-
checkShape(value, { completed: 'boolean', hit_return: 'boolean', abi: 'string', pointer_bytes: 'number' });
|
|
193
|
-
if (value.completed !== value.hit_return || value.completed === true && value.stop_reason !== 'return')
|
|
194
|
-
fail('partial', 'Emulation termination was reported inconsistently.');
|
|
195
|
-
}
|
|
196
|
-
if (path === '/get_comment') {
|
|
197
|
-
const rows = bulkComments ? value.results : [value];
|
|
198
|
-
if (bulkComments && (!['requested', 'returned', 'with_comments'].every(key => Number.isSafeInteger(value[key]) && Number(value[key]) >= 0) || value.returned !== rows.length || Number(value.returned) > Number(value.requested) || Number(value.with_comments) > Number(value.requested)))
|
|
199
|
-
fail('partial', 'Bulk comment counts are inconsistent.');
|
|
200
|
-
for (const row of rows) {
|
|
201
|
-
const comment = checkShape(row, { address: 'string', has_comment: 'boolean' });
|
|
202
|
-
for (const kind of ['plate', 'pre', 'eol', 'post', 'repeatable'])
|
|
203
|
-
if (comment[kind] !== null && typeof comment[kind] !== 'string')
|
|
204
|
-
fail('partial', 'Query omitted or malformed comment kind.');
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
if (path === '/get_full_call_graph' && parameters.format === 'json_edges') {
|
|
208
|
-
const rows = value.edges;
|
|
209
|
-
if (value.edge_count !== rows.length || !Number.isSafeInteger(value.caller_count) || Number(value.caller_count) < 0)
|
|
210
|
-
fail('partial', 'Call graph counts are inconsistent.');
|
|
211
|
-
for (const row of rows)
|
|
212
|
-
checkShape(row, { caller_addr: 'string', callee_addr: 'string', caller_name: 'string', callee_name: 'string' });
|
|
213
|
-
}
|
|
214
|
-
if (path === '/get_struct_layout')
|
|
215
|
-
for (const field of value.fields)
|
|
216
|
-
checkShape(field, { offset: 'number', size: 'number', type: 'string', name: 'string' });
|
|
217
|
-
if (path === '/get_enum_values')
|
|
218
|
-
for (const member of value.values) {
|
|
219
|
-
const observed = checkShape(member, { name: 'string' }), number = observed.value;
|
|
220
|
-
if (!(typeof number === 'number' && Number.isSafeInteger(number) || typeof number === 'string' && /^-?\d+$/.test(number)))
|
|
221
|
-
fail('partial', 'Enum result omitted its exact integer value.');
|
|
222
|
-
}
|
|
223
|
-
return result;
|
|
224
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { object, fail } from './model.js';
|
|
2
|
-
/** Strip transport versioning from the existing logical observation and its identity digest. */
|
|
3
|
-
export function researchView(raw) {
|
|
4
|
-
const r = object(raw);
|
|
5
|
-
if (r.protocol !== 'insight-research-view-v1' || typeof r.modification !== 'string' || !/^\d{1,20}$/.test(r.modification) ||
|
|
6
|
-
!['language', 'compiler'].every(k => typeof r[k] === 'string' && r[k].length > 0 && r[k].length <= 256 && !r[k].includes('\0')))
|
|
7
|
-
fail('partial', 'Native research-view observation is malformed or unsupported.');
|
|
8
|
-
return { modification: r.modification, language: r.language, compiler: r.compiler };
|
|
9
|
-
}
|
package/dist/src/sdk-files.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type CommandContext, type CommandDefinition } from '@eyeauras/cli-factory';
|
|
2
|
-
import { Workspace, type Scope } from './workspace.js';
|
|
3
|
-
import { Research, type ResearchBackend } from './research.js';
|
|
4
|
-
/** Native SDK file effects have retained input/output bytes and never repeat an uncertain call. */
|
|
5
|
-
export declare class SdkFiles {
|
|
6
|
-
private readonly workspace;
|
|
7
|
-
private readonly research;
|
|
8
|
-
private readonly backend;
|
|
9
|
-
constructor(workspace: Workspace, research: Research, backend: () => Promise<ResearchBackend>);
|
|
10
|
-
loaders(input: string): Promise<{
|
|
11
|
-
inputSha256: string;
|
|
12
|
-
}>;
|
|
13
|
-
exporters(selected: Scope): Promise<{
|
|
14
|
-
value: Record<string, unknown>;
|
|
15
|
-
session: string;
|
|
16
|
-
target: string;
|
|
17
|
-
}>;
|
|
18
|
-
private copy;
|
|
19
|
-
private completedOutput;
|
|
20
|
-
databaseQuery(selected: Scope, operation: 'fid-query' | 'bsim-query', database: string, p: Record<string, unknown>): Promise<{
|
|
21
|
-
databaseSha256: string;
|
|
22
|
-
sourceSnapshotSha256: string;
|
|
23
|
-
value: Record<string, unknown>;
|
|
24
|
-
session: string;
|
|
25
|
-
target: string;
|
|
26
|
-
}>;
|
|
27
|
-
export(selected: Scope, operation: 'export' | 'archive-export' | 'fid-build' | 'bsim-build', parameters: Record<string, unknown>, directory: string, callerId?: string): Promise<unknown>;
|
|
28
|
-
}
|
|
29
|
-
export declare function sdkFileCommands(service: (c: CommandContext) => SdkFiles): CommandDefinition[];
|
package/dist/src/sdk-files.js
DELETED
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import { command, Permission } from '@eyeauras/cli-factory';
|
|
2
|
-
import { mkdir, readdir, lstat, readFile, open, rename, copyFile, realpath, chmod } from 'node:fs/promises';
|
|
3
|
-
import { constants } from 'node:fs';
|
|
4
|
-
import { join, resolve, dirname } from 'node:path';
|
|
5
|
-
import { scope, address, number } from './research.js';
|
|
6
|
-
import { object, fail, text, id, stable } from './model.js';
|
|
7
|
-
import { parseDomainJson } from './json.js';
|
|
8
|
-
import { selectedOptions } from './arguments.js';
|
|
9
|
-
import { randomUUID } from 'node:crypto';
|
|
10
|
-
async function persist(path, value) { const temp = path + '.new-' + randomUUID(), file = await open(temp, 'wx', 0o600); try {
|
|
11
|
-
await file.writeFile(stable(value));
|
|
12
|
-
await file.sync();
|
|
13
|
-
}
|
|
14
|
-
finally {
|
|
15
|
-
await file.close();
|
|
16
|
-
} await rename(temp, path); if (process.platform !== 'win32') {
|
|
17
|
-
const directory = await open(dirname(path), 'r');
|
|
18
|
-
try {
|
|
19
|
-
await directory.sync();
|
|
20
|
-
}
|
|
21
|
-
finally {
|
|
22
|
-
await directory.close();
|
|
23
|
-
}
|
|
24
|
-
} }
|
|
25
|
-
/** Native SDK file effects have retained input/output bytes and never repeat an uncertain call. */
|
|
26
|
-
export class SdkFiles {
|
|
27
|
-
workspace;
|
|
28
|
-
research;
|
|
29
|
-
backend;
|
|
30
|
-
constructor(workspace, research, backend) {
|
|
31
|
-
this.workspace = workspace;
|
|
32
|
-
this.research = research;
|
|
33
|
-
this.backend = backend;
|
|
34
|
-
}
|
|
35
|
-
async loaders(input) {
|
|
36
|
-
const artifact = await this.workspace.artifacts.capture(input, 'input'), backend = await this.backend();
|
|
37
|
-
if (!backend.sdkFile)
|
|
38
|
-
fail('configuration', 'Native SDK file workflows are unavailable.');
|
|
39
|
-
return { inputSha256: artifact.sha256, ...await backend.sdkFile('loaders', { input: await this.workspace.artifacts.verify(artifact) }) };
|
|
40
|
-
}
|
|
41
|
-
async exporters(selected) {
|
|
42
|
-
return this.research.ordered(selected, async () => {
|
|
43
|
-
const backend = await this.backend();
|
|
44
|
-
if (!backend.sdkFile)
|
|
45
|
-
fail('configuration', 'Native SDK file workflows are unavailable.');
|
|
46
|
-
await backend.open(selected);
|
|
47
|
-
const snapshot = await backend.saved(selected);
|
|
48
|
-
return { ...selected, value: await backend.sdkFile('exporters', { snapshot: (backend.snapshotFile ? await backend.snapshotFile(snapshot) : await this.workspace.artifacts.verify(snapshot)) }) };
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
async copy(files, directory, recovery = false) {
|
|
52
|
-
try {
|
|
53
|
-
await mkdir(directory, { mode: 0o700 });
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
if (!recovery || error.code !== 'EEXIST')
|
|
57
|
-
throw error;
|
|
58
|
-
}
|
|
59
|
-
if (await realpath(directory) !== resolve(directory) || (await lstat(directory)).isSymbolicLink())
|
|
60
|
-
fail('binding', 'Export destination is not the requested ordinary directory.');
|
|
61
|
-
for (const file of files) {
|
|
62
|
-
if (!/^[a-zA-Z0-9_.-]{1,160}$/.test(file.name) || file.name === '.' || file.name === '..')
|
|
63
|
-
fail('binding', 'Exporter produced an unsupported output filename.');
|
|
64
|
-
const source = await this.workspace.artifacts.verify(file.artifact), output = join(directory, file.name);
|
|
65
|
-
try {
|
|
66
|
-
await copyFile(source, output, constants.COPYFILE_EXCL);
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
if (!recovery || error.code !== 'EEXIST')
|
|
70
|
-
throw error;
|
|
71
|
-
}
|
|
72
|
-
if ((await this.workspace.artifacts.capture(output, 'input')).id !== file.artifact.id)
|
|
73
|
-
fail('partial', 'Exported file bytes differ from retained native output.');
|
|
74
|
-
// Artifact copies retain their read-only mode. The owned user output needs a writable
|
|
75
|
-
// descriptor for FlushFileBuffers on Windows; verify existing recovery bytes first.
|
|
76
|
-
await chmod(output, 0o600);
|
|
77
|
-
const handle = await open(output, 'r+');
|
|
78
|
-
try {
|
|
79
|
-
await handle.sync();
|
|
80
|
-
}
|
|
81
|
-
finally {
|
|
82
|
-
await handle.close();
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (process.platform !== 'win32')
|
|
86
|
-
for (const path of [directory, dirname(directory)]) {
|
|
87
|
-
const handle = await open(path, 'r');
|
|
88
|
-
try {
|
|
89
|
-
await handle.sync();
|
|
90
|
-
}
|
|
91
|
-
finally {
|
|
92
|
-
await handle.close();
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
async completedOutput(stage, request, operation) {
|
|
97
|
-
const marker = object(JSON.parse(await readFile(join(stage, 'native-result.json'), 'utf8')));
|
|
98
|
-
if (marker.request !== request || marker.operation !== operation || object(marker.value).state !== 'exported' || !Array.isArray(marker.files) || !marker.files.length || marker.files.length > 64)
|
|
99
|
-
fail('binding', 'Native file completion receipt differs from the retained request.');
|
|
100
|
-
const files = [];
|
|
101
|
-
for (const item of marker.files) {
|
|
102
|
-
const row = object(item), name = text(row.name, 160);
|
|
103
|
-
if (!/^[a-zA-Z0-9_.-]+$/.test(name) || name === '.' || name === '..')
|
|
104
|
-
fail('binding', 'Native output name is not a simple owned file.');
|
|
105
|
-
const path = join(stage, 'outputs', name);
|
|
106
|
-
if (!(await lstat(path)).isFile() || (await lstat(path)).isSymbolicLink())
|
|
107
|
-
fail('binding', 'Native output is not a regular owned file.');
|
|
108
|
-
const artifact = await this.workspace.artifacts.capture(path, 'input');
|
|
109
|
-
if (artifact.sha256 !== row.sha256 || artifact.size !== row.size)
|
|
110
|
-
fail('partial', 'Native output changed after its completion receipt.');
|
|
111
|
-
files.push({ name, artifact });
|
|
112
|
-
}
|
|
113
|
-
return { files, value: marker.value };
|
|
114
|
-
}
|
|
115
|
-
async databaseQuery(selected, operation, database, p) {
|
|
116
|
-
const artifact = await this.workspace.artifacts.capture(database, 'input');
|
|
117
|
-
if (artifact.size > 268435456)
|
|
118
|
-
fail('limit', 'Function database exceeds 256 MiB.');
|
|
119
|
-
return this.research.ordered(selected, async () => {
|
|
120
|
-
const backend = await this.backend();
|
|
121
|
-
if (!backend.sdkFile)
|
|
122
|
-
fail('configuration', 'Native function databases are unavailable.');
|
|
123
|
-
await backend.open(selected);
|
|
124
|
-
const snapshot = await backend.saved(selected), value = await backend.sdkFile(operation, { ...p, database: await this.workspace.artifacts.verify(artifact), snapshot: (backend.snapshotFile ? await backend.snapshotFile(snapshot) : await this.workspace.artifacts.verify(snapshot)) });
|
|
125
|
-
return { ...selected, databaseSha256: artifact.sha256, sourceSnapshotSha256: snapshot.sha256, value };
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
async export(selected, operation, parameters, directory, callerId) {
|
|
129
|
-
const reserved = this.workspace.reserveRequest(selected, 'ghidra.sdk-file.' + operation, { ...parameters, outputDirectory: directory }, callerId);
|
|
130
|
-
return this.research.ordered(selected, async () => {
|
|
131
|
-
const request = this.workspace.request(reserved.request.id), stage = join(this.workspace.directory, 'sdk-exports', request.id), receiptPath = join(stage, 'receipt.json');
|
|
132
|
-
if (reserved.replay && request.state !== 'accepted') {
|
|
133
|
-
if (request.state === 'applied')
|
|
134
|
-
return request.result;
|
|
135
|
-
let saved;
|
|
136
|
-
try {
|
|
137
|
-
saved = object(JSON.parse(await readFile(receiptPath, 'utf8')));
|
|
138
|
-
}
|
|
139
|
-
catch {
|
|
140
|
-
let completed;
|
|
141
|
-
try {
|
|
142
|
-
completed = await this.completedOutput(stage, request.id, operation);
|
|
143
|
-
}
|
|
144
|
-
catch {
|
|
145
|
-
fail('unknown', 'Native export has no verified completed receipt; the original call is not repeated.');
|
|
146
|
-
}
|
|
147
|
-
saved = { request: request.id, operation, ...completed };
|
|
148
|
-
await persist(receiptPath, saved);
|
|
149
|
-
}
|
|
150
|
-
if (saved.request !== request.id || saved.operation !== operation || !Array.isArray(saved.files))
|
|
151
|
-
fail('binding', 'Native export receipt differs from the retained intent.');
|
|
152
|
-
const files = saved.files;
|
|
153
|
-
await this.copy(files, directory, true);
|
|
154
|
-
const current = this.workspace.context(selected);
|
|
155
|
-
const result = { ...selected, state: 'exported', outputDirectory: directory, files: files.map(file => ({ name: file.name, sha256: file.artifact.sha256, size: file.artifact.size })), value: saved.value };
|
|
156
|
-
this.workspace.completeSavedRequest(selected, request.id, current.generation, {}, result);
|
|
157
|
-
return result;
|
|
158
|
-
}
|
|
159
|
-
try {
|
|
160
|
-
await lstat(directory);
|
|
161
|
-
fail('exists', 'Export directory already exists; choose a new directory.');
|
|
162
|
-
}
|
|
163
|
-
catch (error) {
|
|
164
|
-
if (error.code !== 'ENOENT')
|
|
165
|
-
throw error;
|
|
166
|
-
}
|
|
167
|
-
const backend = await this.backend();
|
|
168
|
-
if (!backend.sdkFile)
|
|
169
|
-
fail('configuration', 'Native SDK file workflows are unavailable.');
|
|
170
|
-
await backend.open(selected);
|
|
171
|
-
const snapshot = await backend.saved(selected), current = this.workspace.context(selected);
|
|
172
|
-
await mkdir(stage, { recursive: true, mode: 0o700 });
|
|
173
|
-
const outputs = join(stage, 'outputs');
|
|
174
|
-
await mkdir(outputs, { recursive: true, mode: 0o700 });
|
|
175
|
-
if (await realpath(outputs) !== resolve(outputs) || (await lstat(outputs)).isSymbolicLink() || (await readdir(outputs)).length)
|
|
176
|
-
fail('binding', 'Accepted file preparation must retain an empty owned output directory.');
|
|
177
|
-
this.workspace.startRequest(request.id, { kind: 'sdk-file', operation, snapshot, generation: current.generation });
|
|
178
|
-
try {
|
|
179
|
-
const filename = operation === 'archive-export' ? 'types.gdt' : operation === 'fid-build' ? 'database.fidb' : operation === 'bsim-build' ? 'database.mv.db' : 'program.out';
|
|
180
|
-
const value = await backend.sdkFile(operation, { ...parameters, request_id: request.id, receipt: join(stage, 'native-result.json'), snapshot: (backend.snapshotFile ? await backend.snapshotFile(snapshot) : await this.workspace.artifacts.verify(snapshot)), output: join(outputs, filename) });
|
|
181
|
-
if (value.state !== 'exported')
|
|
182
|
-
fail('partial', 'Native exporter did not establish a completed output.');
|
|
183
|
-
const completed = await this.completedOutput(stage, request.id, operation), files = completed.files;
|
|
184
|
-
if (stable(completed.value) !== stable(value))
|
|
185
|
-
fail('partial', 'Native file reply differs from its durable receipt.');
|
|
186
|
-
await persist(receiptPath, { request: request.id, operation, files, value });
|
|
187
|
-
await this.copy(files, directory);
|
|
188
|
-
const result = { ...selected, state: 'exported', outputDirectory: directory, files: files.map(file => ({ name: file.name, sha256: file.artifact.sha256, size: file.artifact.size })), value };
|
|
189
|
-
this.workspace.completeSavedRequest(selected, request.id, current.generation, { workingSnapshot: snapshot }, result);
|
|
190
|
-
return result;
|
|
191
|
-
}
|
|
192
|
-
catch (error) {
|
|
193
|
-
this.workspace.recordRequest(request.id, 'unknown', { ...selected, state: 'unknown' });
|
|
194
|
-
throw error;
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
function json(value) { return parseDomainJson(text(value, 16000)); }
|
|
200
|
-
export function sdkFileCommands(service) {
|
|
201
|
-
const outputs = [...selectedOptions, { flags: '--output-directory <directory>', description: 'New output directory including all exporter companion files', required: true },
|
|
202
|
-
{ flags: '--request-id <id>', description: 'Retrieve retained export bytes without repeating native export' }];
|
|
203
|
-
const databases = [];
|
|
204
|
-
for (const kind of ['fid', 'bsim']) {
|
|
205
|
-
databases.push(command('build-' + kind, 'Build a genuine native ' + kind + ' database from the saved private snapshot', ({ options: o }, c) => service(c).export(scope(o), kind + '-build', { library: text(o.library, 512), ...(kind === 'fid' ? { version: text(o.libraryVersion, 128) } : {}) }, resolve(c.cwd, text(o.outputDirectory, 4096)), o.requestId === undefined ? undefined : id(o.requestId, '--request-id')), { permission: Permission.Update, options: [...outputs, { flags: '--library <name>', description: 'Native library/database name', required: true }, ...(kind === 'fid' ? [{ flags: '--library-version <version>', description: 'Native library version', required: true }] : [])] }));
|
|
206
|
-
databases.push(command(kind + '-query', 'Query one explicitly consumed native ' + kind + ' database with provenance and no-match semantics', ({ options: o }, c) => {
|
|
207
|
-
const p = { limit: number(o.limit, 1000, 1) };
|
|
208
|
-
if (o.function !== undefined)
|
|
209
|
-
p.function = address(o.function);
|
|
210
|
-
if (kind === 'fid') {
|
|
211
|
-
const threshold = Number(o.threshold);
|
|
212
|
-
if (!Number.isFinite(threshold) || threshold < 0 || threshold > 100000)
|
|
213
|
-
fail('invalid', 'FID threshold must be 0–100000 native code units.');
|
|
214
|
-
p.threshold = threshold;
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
const similarity = Number(o.similarity), significance = Number(o.significance);
|
|
218
|
-
if (!Number.isFinite(similarity) || similarity < 0 || similarity > 1 || !Number.isFinite(significance) || significance < 0 || significance > 1000000)
|
|
219
|
-
fail('invalid', 'Invalid native BSim similarity/significance threshold.');
|
|
220
|
-
p.similarity = similarity;
|
|
221
|
-
p.significance = significance;
|
|
222
|
-
}
|
|
223
|
-
return service(c).databaseQuery(scope(o), kind + '-query', resolve(c.cwd, text(o.database, 4096)), p);
|
|
224
|
-
}, { permission: Permission.ReadOnly, options: [...selectedOptions, { flags: '--database <file>', description: 'Native FID or BSim/H2 file; immutable bytes are consumed first', required: true },
|
|
225
|
-
{ flags: '--function <address>', description: 'Exact function entry', ...(kind === 'bsim' ? { required: true } : {}) }, { flags: '--limit <count>', description: 'Maximum returned matches', defaultValue: 20 },
|
|
226
|
-
...(kind === 'fid' ? [{ flags: '--threshold <score>', description: 'Native matching code-unit threshold', defaultValue: 14.6 }] : [{ flags: '--similarity <number>', description: 'Native feature similarity 0–1', defaultValue: 0.7 }, { flags: '--significance <number>', description: 'Native feature significance', defaultValue: 0 }])] }));
|
|
227
|
-
}
|
|
228
|
-
return [command('libraries', 'Native FID and BSim/H2 library identity/similarity databases', databases), command('formats', 'Native loaders and exporters', [
|
|
229
|
-
command('loaders', 'Read installed loader names and supported specs/options for consumed bytes', ({ options: o }, c) => service(c).loaders(resolve(c.cwd, text(o.input, 4096))), { permission: Permission.ReadOnly, options: [{ flags: '--input <file>', description: 'Input file to inspect', required: true }] }),
|
|
230
|
-
command('exporters', 'Read installed exporters and their actual options for this program', ({ options: o }, c) => service(c).exporters(scope(o)), { permission: Permission.ReadOnly, options: selectedOptions }),
|
|
231
|
-
command('export', 'Export through an explicitly selected native exporter with typed options/ranges', ({ options: o }, c) => {
|
|
232
|
-
const p = { exporter: text(o.exporter, 512), options: object(json(o.options)) };
|
|
233
|
-
if (o.ranges !== undefined) {
|
|
234
|
-
const ranges = json(o.ranges);
|
|
235
|
-
if (!Array.isArray(ranges) || !ranges.length || ranges.length > 64)
|
|
236
|
-
fail('invalid', 'Export ranges require 1–64 start/end objects.');
|
|
237
|
-
p.ranges = ranges;
|
|
238
|
-
}
|
|
239
|
-
return service(c).export(scope(o), 'export', p, resolve(c.cwd, text(o.outputDirectory, 4096)), o.requestId === undefined ? undefined : id(o.requestId, '--request-id'));
|
|
240
|
-
}, { permission: Permission.Update, options: [...outputs, { flags: '--exporter <id>', description: 'Explicit native exporter name/ID', required: true }, { flags: '--options <json>', description: 'Named primitive native options', defaultValue: '{}' }, { flags: '--ranges <json>', description: 'Address ranges with start/end; exporter must support restricted output' }] }),
|
|
241
|
-
]), command('types', 'Native type archives', [
|
|
242
|
-
command('archive-export', 'Export 1–256 explicit type paths to a native GDT with checked layout', ({ options: o }, c) => {
|
|
243
|
-
const types = json(o.types);
|
|
244
|
-
if (!Array.isArray(types) || !types.length || types.length > 256 || types.some(v => typeof v !== 'string' || !v.startsWith('/')))
|
|
245
|
-
fail('invalid', 'Types must be 1–256 absolute type paths.');
|
|
246
|
-
return service(c).export(scope(o), 'archive-export', { types }, resolve(c.cwd, text(o.outputDirectory, 4096)), o.requestId === undefined ? undefined : id(o.requestId, '--request-id'));
|
|
247
|
-
}, { permission: Permission.Update, options: [...outputs, { flags: '--types <json>', description: 'Selected native type paths', required: true }] }),
|
|
248
|
-
])];
|
|
249
|
-
}
|
package/dist/src/server.d.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import type { CommandContext } from '@eyeauras/cli-factory';
|
|
2
|
-
import { type ChildProcess } from 'node:child_process';
|
|
3
|
-
import { type NativeInputs } from './native-inputs.js';
|
|
4
|
-
import { NativeServices } from './native-service.js';
|
|
5
|
-
export interface ServerBinding {
|
|
6
|
-
mode: 'local' | 'external';
|
|
7
|
-
origin: string;
|
|
8
|
-
repository: string;
|
|
9
|
-
readerUser: string;
|
|
10
|
-
publisherUser: string;
|
|
11
|
-
readerSecret: string;
|
|
12
|
-
publisherSecret: string;
|
|
13
|
-
}
|
|
14
|
-
interface LocalServer extends ServerBinding {
|
|
15
|
-
toolProcessId?: string;
|
|
16
|
-
mode: 'local';
|
|
17
|
-
instance: string;
|
|
18
|
-
port: number;
|
|
19
|
-
identityPort: number;
|
|
20
|
-
keySecret: string;
|
|
21
|
-
tokenSecret: string;
|
|
22
|
-
phase: 'seeded' | 'initialized' | 'running' | 'stopped';
|
|
23
|
-
pid?: number;
|
|
24
|
-
}
|
|
25
|
-
export declare function retireReusedServer(directory: string, control: string, local: LocalServer): Promise<boolean>;
|
|
26
|
-
export declare function interpret(result: Record<string, unknown>): Record<string, unknown>;
|
|
27
|
-
/** Own local startup; external profiles connect without taking ownership of their server. */
|
|
28
|
-
export declare class GhidraServer {
|
|
29
|
-
readonly directory: string;
|
|
30
|
-
private readonly inputs;
|
|
31
|
-
private readonly c;
|
|
32
|
-
private readonly state;
|
|
33
|
-
constructor(directory: string, inputs: NativeInputs, c: CommandContext, state?: {
|
|
34
|
-
initializing?: Promise<ServerBinding>;
|
|
35
|
-
child?: ChildProcess;
|
|
36
|
-
services?: NativeServices;
|
|
37
|
-
servicesClosed?: boolean;
|
|
38
|
-
});
|
|
39
|
-
fork(c: CommandContext): GhidraServer;
|
|
40
|
-
private root;
|
|
41
|
-
private run;
|
|
42
|
-
/**
|
|
43
|
-
* A helper that failed for lack of memory keeps its failure code (and so its sent/unknown meaning), but is
|
|
44
|
-
* reported as such: on a loaded machine it is retried once memory is available, not treated as a defect.
|
|
45
|
-
*/
|
|
46
|
-
private memoryExhausted;
|
|
47
|
-
/**
|
|
48
|
-
* True when no process that could still write a native checkout journal exists: every one-shot helper and publisher
|
|
49
|
-
* service launched for this profile has proved its exit, except publisher services this owner still tracks as
|
|
50
|
-
* serving. Those receive requests only from callers holding their target's lane, so none of them can be working on
|
|
51
|
-
* a request whose lane the caller holds. Profiles have one owner process; records of any other owner must be ended.
|
|
52
|
-
*/
|
|
53
|
-
nativeWritersSettled(): Promise<boolean>;
|
|
54
|
-
private runHelper;
|
|
55
|
-
/**
|
|
56
|
-
* A cancelled one-shot helper whose process provably never started: no supervisor record at all, or a record
|
|
57
|
-
* without a PID that never left its pre-spawn phases. Anything else may have run and keeps its cancellation.
|
|
58
|
-
*/
|
|
59
|
-
private neverSpawned;
|
|
60
|
-
/**
|
|
61
|
-
* Hot native operations run in a long-lived service of the same trusted helper code with the role's own
|
|
62
|
-
* credentials; a service that cannot be used leaves the one-shot helper in charge (nothing was sent).
|
|
63
|
-
*/
|
|
64
|
-
private viaService;
|
|
65
|
-
/** Owner disposal: close the services for good (in-flight requests end with their termination outcome). */
|
|
66
|
-
stopServices(): Promise<void>;
|
|
67
|
-
/** Maintenance: stop idle services now; false while a service is still running a request. */
|
|
68
|
-
stopIdleServices(): Promise<boolean>;
|
|
69
|
-
credentials(binding: ServerBinding, role: 'reader' | 'publisher'): Promise<Record<string, string>>;
|
|
70
|
-
fields(snapshot: string, selectors: string): Promise<Record<string, unknown>>;
|
|
71
|
-
nativeCheckout(binding: ServerBinding, request: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
72
|
-
private nativeCheckoutCall;
|
|
73
|
-
nativeMigration(binding: ServerBinding, request: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
74
|
-
private nativeMigrationCall;
|
|
75
|
-
nativeRead(binding: ServerBinding, request: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
76
|
-
private nativeReadCall;
|
|
77
|
-
inspect(snapshot: string, request: string): Promise<Record<string, unknown>>;
|
|
78
|
-
sdkFile(operation: string, p: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
79
|
-
traceInspect(snapshot: string): Promise<Record<string, unknown>>;
|
|
80
|
-
project(operation: string, parameters: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
81
|
-
projectOutcome(requestId: string, expected: Record<string, unknown>): Promise<Record<string, unknown> | undefined>;
|
|
82
|
-
administration(operation: string, parameters: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
83
|
-
programStatus(binding: ServerBinding, path: string): Promise<Record<string, unknown>>;
|
|
84
|
-
initialRecovery(binding: ServerBinding, root: string, fingerprint: string, receipt?: string): Promise<Record<string, unknown>>;
|
|
85
|
-
initialImport(root: string): Promise<Record<string, unknown>>;
|
|
86
|
-
initialPublication(binding: ServerBinding, root: string, operation?: 'stage' | 'verify-stage' | 'promote' | 'verify'): Promise<Record<string, unknown>>;
|
|
87
|
-
recoverPublication(binding: ServerBinding, path: string, snapshot: string, expected: number, request: string, journal: string, sourceSha: string): Promise<Record<string, unknown>>;
|
|
88
|
-
/**
|
|
89
|
-
* Repository roles of an owned local server are fixed at initialization and canonical ACL changes are refused,
|
|
90
|
-
* so one verification per authenticated server process suffices. Every native operation re-checks its role.
|
|
91
|
-
*/
|
|
92
|
-
private authority;
|
|
93
|
-
private verifyAuthority;
|
|
94
|
-
ensure(): Promise<ServerBinding>;
|
|
95
|
-
private initialize;
|
|
96
|
-
private identity;
|
|
97
|
-
stop(): Promise<void>;
|
|
98
|
-
}
|
|
99
|
-
export declare function serverIdentity(local: LocalServer, c: CommandContext): Promise<Record<string, unknown>>;
|
|
100
|
-
/** Stop only the authenticated owned server recorded below this workspace/probe root. */
|
|
101
|
-
export declare function stopLocalServer(directory: string, c: CommandContext): Promise<void>;
|
|
102
|
-
export {};
|