@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,41 +0,0 @@
|
|
|
1
|
-
import { type Batch, type Binding, type FindingRecord, type Snapshot, type Target } from './model.js';
|
|
2
|
-
import { Store } from './store.js';
|
|
3
|
-
/** Ghidra operations are separately acknowledged calls. The journal, not a batch endpoint,
|
|
4
|
-
* is the recovery boundary. Implementations must preserve staged project directories. */
|
|
5
|
-
export interface Publisher {
|
|
6
|
-
open(target: Target, batchId: string): Promise<Binding>;
|
|
7
|
-
checkout(target: Target, binding: Binding): Promise<Snapshot>;
|
|
8
|
-
read(target: Target, binding: Binding, findings: FindingRecord[]): Promise<Snapshot>;
|
|
9
|
-
apply(target: Target, binding: Binding, finding: FindingRecord): Promise<void>;
|
|
10
|
-
save(target: Target, binding: Binding): Promise<void>;
|
|
11
|
-
checkIn(target: Target, binding: Binding, batchId: string): Promise<number>;
|
|
12
|
-
published(target: Target, findings: FindingRecord[]): Promise<Snapshot>;
|
|
13
|
-
history(target: Target, batchId: string): Promise<number[]>;
|
|
14
|
-
released(target: Target): Promise<boolean>;
|
|
15
|
-
release(target: Target, binding: Binding): Promise<void>;
|
|
16
|
-
complete(target: Target, binding: Binding): Promise<void>;
|
|
17
|
-
/** Return only after every owned publisher process is stopped, staged copy backed up,
|
|
18
|
-
* and any owned checkout safely released. This must refuse a live/unidentified writer. */
|
|
19
|
-
abandon(target: Target, batch: Batch): Promise<void>;
|
|
20
|
-
}
|
|
21
|
-
export type Checkpoint = (phase: string, batch: Batch) => Promise<void>;
|
|
22
|
-
export declare class Coordinator {
|
|
23
|
-
readonly store: Store;
|
|
24
|
-
readonly publisher: Publisher;
|
|
25
|
-
private checkpoint;
|
|
26
|
-
private running;
|
|
27
|
-
constructor(store: Store, publisher: Publisher, checkpoint?: Checkpoint, running?: Map<string, Promise<Batch | {
|
|
28
|
-
state: "empty";
|
|
29
|
-
targetId: string;
|
|
30
|
-
}>>);
|
|
31
|
-
settled(): Promise<void>;
|
|
32
|
-
integrate(targetId: string): Promise<Batch | {
|
|
33
|
-
state: "empty";
|
|
34
|
-
targetId: string;
|
|
35
|
-
}>;
|
|
36
|
-
private mark;
|
|
37
|
-
private validate;
|
|
38
|
-
private integrateOnce;
|
|
39
|
-
private verify;
|
|
40
|
-
recover(batchId: string, abandon?: boolean): Promise<Batch>;
|
|
41
|
-
}
|
package/dist/src/coordinator.js
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { assertIdentity, fail, key } from './model.js';
|
|
2
|
-
export class Coordinator {
|
|
3
|
-
store;
|
|
4
|
-
publisher;
|
|
5
|
-
checkpoint;
|
|
6
|
-
running;
|
|
7
|
-
constructor(store, publisher, checkpoint = async () => { }, running = new Map()) {
|
|
8
|
-
this.store = store;
|
|
9
|
-
this.publisher = publisher;
|
|
10
|
-
this.checkpoint = checkpoint;
|
|
11
|
-
this.running = running;
|
|
12
|
-
}
|
|
13
|
-
async settled() { await Promise.allSettled([...this.running.values()]); }
|
|
14
|
-
integrate(targetId) {
|
|
15
|
-
const active = this.running.get(targetId);
|
|
16
|
-
if (active)
|
|
17
|
-
return active;
|
|
18
|
-
const work = this.integrateOnce(targetId).finally(() => this.running.delete(targetId));
|
|
19
|
-
this.running.set(targetId, work);
|
|
20
|
-
return work;
|
|
21
|
-
}
|
|
22
|
-
async mark(id, phase, patch = {}) {
|
|
23
|
-
const batch = this.store.update(id, phase, patch);
|
|
24
|
-
await this.checkpoint(phase, batch);
|
|
25
|
-
return batch;
|
|
26
|
-
}
|
|
27
|
-
validate(snapshot, target, findings, proposed) {
|
|
28
|
-
assertIdentity(snapshot.identity, target);
|
|
29
|
-
if (!Number.isSafeInteger(snapshot.version) || snapshot.version < 1)
|
|
30
|
-
fail('malformed', 'Readback did not contain a valid version.');
|
|
31
|
-
for (const finding of findings) {
|
|
32
|
-
if (!Object.hasOwn(snapshot.values, key(finding)))
|
|
33
|
-
fail('partial', 'Readback omitted a requested comment.');
|
|
34
|
-
const actual = snapshot.values[key(finding)];
|
|
35
|
-
if (actual !== null && typeof actual !== 'string')
|
|
36
|
-
fail('malformed', 'Readback contained a malformed comment.');
|
|
37
|
-
if (proposed && actual !== finding.after)
|
|
38
|
-
fail('verification', 'Published readback differs from the proposal.');
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
async integrateOnce(targetId) {
|
|
42
|
-
const target = this.store.target(targetId);
|
|
43
|
-
let batch = this.store.begin(targetId);
|
|
44
|
-
if (!batch)
|
|
45
|
-
return { state: 'empty', targetId };
|
|
46
|
-
try {
|
|
47
|
-
await this.checkpoint('accepted', batch);
|
|
48
|
-
const binding = await this.publisher.open(target, batch.id);
|
|
49
|
-
assertIdentity(binding.identity, target);
|
|
50
|
-
if (binding.role !== 'publisher' || !Number.isSafeInteger(binding.pid) || binding.pid <= 0)
|
|
51
|
-
fail('binding', 'Publisher binding is invalid.');
|
|
52
|
-
batch = await this.mark(batch.id, 'applying', { binding });
|
|
53
|
-
const baseline = await this.publisher.checkout(target, binding);
|
|
54
|
-
assertIdentity(baseline.identity, target);
|
|
55
|
-
if (!Number.isSafeInteger(baseline.version) || baseline.version < 1)
|
|
56
|
-
fail('malformed', 'Checkout did not report its baseline version.');
|
|
57
|
-
batch = await this.mark(batch.id, 'applying', { baselineVersion: baseline.version, binding });
|
|
58
|
-
const current = await this.publisher.read(target, binding, batch.findings);
|
|
59
|
-
this.validate(current, target, batch.findings, false);
|
|
60
|
-
if (current.version !== baseline.version)
|
|
61
|
-
fail('binding', 'Local copy is not bound to the fresh checkout baseline.');
|
|
62
|
-
const scopes = new Map();
|
|
63
|
-
const conflicts = [];
|
|
64
|
-
for (const f of batch.findings) {
|
|
65
|
-
const peer = scopes.get(key(f));
|
|
66
|
-
if (f.baselineVersion > baseline.version || current.values[key(f)] !== f.before ||
|
|
67
|
-
peer && (peer.before !== f.before || peer.after !== f.after)) {
|
|
68
|
-
conflicts.push({ findingId: f.findingId, peerFindingId: peer?.findingId, observed: current.values[key(f)], expected: f.before, proposed: f.after });
|
|
69
|
-
}
|
|
70
|
-
scopes.set(key(f), f);
|
|
71
|
-
}
|
|
72
|
-
if (conflicts.length) {
|
|
73
|
-
this.store.conflicts(batch.id, conflicts);
|
|
74
|
-
// No proposal has been applied; release must finish before unblocking the lane.
|
|
75
|
-
await this.publisher.release(target, binding);
|
|
76
|
-
batch = await this.mark(batch.id, 'conflict_pending', { detail: { conflicts } });
|
|
77
|
-
fail('conflict', 'Comment proposals conflict with the current baseline or each other.', batch);
|
|
78
|
-
}
|
|
79
|
-
for (const f of scopes.values()) {
|
|
80
|
-
await this.publisher.apply(target, binding, f);
|
|
81
|
-
const observed = await this.publisher.read(target, binding, [f]);
|
|
82
|
-
this.validate(observed, target, [f], true);
|
|
83
|
-
await this.checkpoint('local_application', this.store.batch(batch.id));
|
|
84
|
-
}
|
|
85
|
-
const all = await this.publisher.read(target, binding, batch.findings);
|
|
86
|
-
this.validate(all, target, batch.findings, true);
|
|
87
|
-
await this.publisher.save(target, binding);
|
|
88
|
-
batch = await this.mark(batch.id, 'staged');
|
|
89
|
-
// Durable check-in intent precedes the remote request. A kill at this boundary is
|
|
90
|
-
// deliberately uncertain even if the remote call had not started yet.
|
|
91
|
-
batch = await this.mark(batch.id, 'checking_in');
|
|
92
|
-
const version = await this.publisher.checkIn(target, binding, batch.id);
|
|
93
|
-
if (!Number.isSafeInteger(version) || version <= baseline.version)
|
|
94
|
-
fail('malformed', 'Check-in did not establish a newer server version.');
|
|
95
|
-
batch = await this.mark(batch.id, 'publication_unknown', { publishedVersion: version });
|
|
96
|
-
return await this.verify(target, batch);
|
|
97
|
-
}
|
|
98
|
-
catch (error) {
|
|
99
|
-
const latest = this.store.batch(batch.id);
|
|
100
|
-
if (!['conflict_pending', 'published_verified'].includes(latest.state)) {
|
|
101
|
-
const uncertain = ['checking_in', 'publication_unknown'].includes(latest.state);
|
|
102
|
-
const result = this.store.update(batch.id, uncertain ? 'publication_unknown' : 'failed', { detail: { phase: latest.state } });
|
|
103
|
-
fail(uncertain ? 'unknown' : 'staged', uncertain ? 'Publication outcome is unresolved; reconcile this batch before any retry.' : 'Integration stopped; the journal and staged copy are retained.', result);
|
|
104
|
-
}
|
|
105
|
-
throw error;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
async verify(target, batch) {
|
|
109
|
-
const versions = await this.publisher.history(target, batch.id);
|
|
110
|
-
if (versions.length !== 1 || versions[0] !== batch.publishedVersion)
|
|
111
|
-
fail('unknown', 'Server history does not uniquely establish this publication.');
|
|
112
|
-
const actual = await this.publisher.published(target, batch.findings);
|
|
113
|
-
this.validate(actual, target, batch.findings, true);
|
|
114
|
-
if (actual.version !== batch.publishedVersion || !await this.publisher.released(target))
|
|
115
|
-
fail('unknown', 'Independent readback or checkout release is unresolved.');
|
|
116
|
-
await this.checkpoint('verification', batch);
|
|
117
|
-
if (batch.binding)
|
|
118
|
-
await this.publisher.complete(target, batch.binding);
|
|
119
|
-
return this.mark(batch.id, 'published_verified');
|
|
120
|
-
}
|
|
121
|
-
async recover(batchId, abandon = false) {
|
|
122
|
-
let batch = this.store.batch(batchId);
|
|
123
|
-
const target = this.store.target(batch.targetId);
|
|
124
|
-
if (this.running.has(batch.targetId))
|
|
125
|
-
fail('busy', 'The publication owner is still executing this lane.');
|
|
126
|
-
if (['published_verified', 'conflict_pending'].includes(batch.state))
|
|
127
|
-
return batch;
|
|
128
|
-
if (batch.ownerPid !== process.pid) {
|
|
129
|
-
try {
|
|
130
|
-
process.kill(batch.ownerPid, 0);
|
|
131
|
-
fail('busy', 'The prior owner is still alive; recovery cannot take over.');
|
|
132
|
-
}
|
|
133
|
-
catch (error) {
|
|
134
|
-
if (error.code !== 'ESRCH')
|
|
135
|
-
throw error;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
const intent = this.store.events(batchId).some(e => e.state === 'checking_in');
|
|
139
|
-
if (intent) {
|
|
140
|
-
if (abandon)
|
|
141
|
-
fail('unknown', 'An uncertain check-in cannot be abandoned or retried.');
|
|
142
|
-
const versions = await this.publisher.history(target, batch.id);
|
|
143
|
-
if (versions.length !== 1)
|
|
144
|
-
fail('unknown', 'Server history is insufficient; this lane remains blocked.', batch);
|
|
145
|
-
batch = this.store.update(batchId, 'publication_unknown', { publishedVersion: versions[0] });
|
|
146
|
-
try {
|
|
147
|
-
return await this.verify(target, batch);
|
|
148
|
-
}
|
|
149
|
-
catch {
|
|
150
|
-
fail('unknown', 'Reconciliation could not verify every publication result; this lane remains blocked.', batch);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
if (!abandon)
|
|
154
|
-
fail('staged', 'A pre-publication stage is retained; use explicit abandon after stopping its publisher.', batch);
|
|
155
|
-
await this.publisher.abandon(target, batch);
|
|
156
|
-
// Findings remain observable. A fresh request can explicitly resubmit from a verified
|
|
157
|
-
// baseline; the original failed batch and stage are never overwritten or replayed.
|
|
158
|
-
return this.store.update(batchId, 'conflict_pending', { detail: { abandoned: true, requiresNewProposals: true } });
|
|
159
|
-
}
|
|
160
|
-
}
|
package/dist/src/cross-peer.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
interface PeerOwner {
|
|
2
|
-
target: string;
|
|
3
|
-
context?: string;
|
|
4
|
-
}
|
|
5
|
-
interface PeerReceipt extends PeerOwner {
|
|
6
|
-
path: string;
|
|
7
|
-
state: 'preparing' | 'closed';
|
|
8
|
-
}
|
|
9
|
-
type PeerStage = {
|
|
10
|
-
folder: string;
|
|
11
|
-
reason: string;
|
|
12
|
-
} | {
|
|
13
|
-
folder: string;
|
|
14
|
-
receipt: PeerReceipt;
|
|
15
|
-
input?: string;
|
|
16
|
-
};
|
|
17
|
-
/** Only the generated input of an exactly owned stage is disposable; its receipt stays. */
|
|
18
|
-
export declare function peerStage(root: string, name: string, owner: PeerOwner): Promise<PeerStage>;
|
|
19
|
-
export declare function peerStages(root: string, owner: PeerOwner): Promise<PeerStage[]>;
|
|
20
|
-
export {};
|
package/dist/src/cross-peer.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { lstat, readFile, readdir, realpath } from 'node:fs/promises';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
const peerName = /^__insight_peer_[a-f0-9]{32}$/;
|
|
4
|
-
const missing = (error) => error.code === 'ENOENT';
|
|
5
|
-
/** Only the generated input of an exactly owned stage is disposable; its receipt stays. */
|
|
6
|
-
export async function peerStage(root, name, owner) {
|
|
7
|
-
const parent = join(root, 'cross-peer'), folder = join(parent, name), keep = (reason) => ({ folder, reason });
|
|
8
|
-
if (!peerName.test(name))
|
|
9
|
-
return keep('Unrecognized cross-target stage.');
|
|
10
|
-
try {
|
|
11
|
-
const parentStat = await lstat(parent), stageStat = await lstat(folder);
|
|
12
|
-
if (parentStat.isSymbolicLink() || !parentStat.isDirectory() || stageStat.isSymbolicLink() || !stageStat.isDirectory() ||
|
|
13
|
-
await realpath(folder) !== join(await realpath(root), 'cross-peer', name))
|
|
14
|
-
return keep('Cross-target stage left its owned directory or is a link.');
|
|
15
|
-
let input;
|
|
16
|
-
for (const entry of await readdir(folder, { withFileTypes: true })) {
|
|
17
|
-
if (!['receipt.json', 'input.gzf'].includes(entry.name))
|
|
18
|
-
return keep('Cross-target stage holds unrecognized files.');
|
|
19
|
-
if (!entry.isFile())
|
|
20
|
-
return keep('Cross-target stage holds links or special entries.');
|
|
21
|
-
if (entry.name === 'input.gzf')
|
|
22
|
-
input = join(folder, entry.name);
|
|
23
|
-
}
|
|
24
|
-
const receipt = JSON.parse(await readFile(join(folder, 'receipt.json'), 'utf8'));
|
|
25
|
-
if (!receipt || typeof receipt !== 'object' || !owner.context || receipt.path !== '/' + name || receipt.target !== owner.target || receipt.context !== owner.context)
|
|
26
|
-
return keep('Cross-target cleanup receipt belongs to another context or is malformed.');
|
|
27
|
-
if (receipt.state !== 'closed' && receipt.state !== 'preparing')
|
|
28
|
-
return keep('Unknown cross-target cleanup stage.');
|
|
29
|
-
return { folder, receipt, ...(input ? { input } : {}) };
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
if (missing(error) || error instanceof SyntaxError)
|
|
33
|
-
return keep('Cross-target cleanup receipt or stage is missing or malformed.');
|
|
34
|
-
return keep('Cross-target stage could not be verified: ' + String(error.code ?? 'unavailable'));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
export async function peerStages(root, owner) {
|
|
38
|
-
const parent = join(root, 'cross-peer');
|
|
39
|
-
try {
|
|
40
|
-
const st = await lstat(parent);
|
|
41
|
-
if (st.isSymbolicLink() || !st.isDirectory())
|
|
42
|
-
return [{ folder: parent, reason: 'Cross-target stage inventory is a link or special entry.' }];
|
|
43
|
-
const stages = [];
|
|
44
|
-
for (const name of await readdir(parent))
|
|
45
|
-
stages.push(await peerStage(root, name, owner));
|
|
46
|
-
return stages;
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
if (missing(error))
|
|
50
|
-
return [];
|
|
51
|
-
return [{ folder: parent, reason: 'Cross-target stage inventory could not be verified: ' + String(error.code ?? 'unavailable') }];
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { ResearchBackend } from './research.js';
|
|
2
|
-
import type { Artifact } from './artifacts.js';
|
|
3
|
-
export declare function verifyDataMutation(backend: ResearchBackend, snapshot: Artifact, path: string, p: Record<string, unknown>, response: Record<string, unknown>): Promise<Record<string, unknown>>;
|
package/dist/src/data-effects.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { address } from './research.js';
|
|
2
|
-
import { object, fail } from './model.js';
|
|
3
|
-
const equal = (actual, expected, label) => { if (actual !== expected)
|
|
4
|
-
fail('partial', `Saved ${label} differs from the requested effect.`); };
|
|
5
|
-
export async function verifyDataMutation(backend, snapshot, path, p, response) {
|
|
6
|
-
if (!backend.inspect)
|
|
7
|
-
fail('configuration', 'Data edits require saved-state inspection.');
|
|
8
|
-
const inspect = (kind, parameters = {}) => backend.inspect(snapshot, { kind, ...parameters });
|
|
9
|
-
const resolve = async (name) => { const value = await inspect('resolve_type', { name }); equal(value.exists, true, 'type presence'); return object(value.type); };
|
|
10
|
-
if (path === '/import_data_types') {
|
|
11
|
-
if (response.parse_succeeded !== true)
|
|
12
|
-
fail('partial', 'Type import did not complete parsing.');
|
|
13
|
-
const value = await inspect('import_check', { source: p.source });
|
|
14
|
-
if (!Array.isArray(value.types) || !value.types.length)
|
|
15
|
-
fail('partial', 'Imported type inventory is absent.');
|
|
16
|
-
for (const type of value.types)
|
|
17
|
-
equal(object(type).matches, true, 'imported type ' + object(type).name);
|
|
18
|
-
return value;
|
|
19
|
-
}
|
|
20
|
-
if (path === '/set_function_this_type') {
|
|
21
|
-
const value = await inspect('function', { address: p.function_address });
|
|
22
|
-
equal(value.exists, true, 'member function presence');
|
|
23
|
-
let name = String(p.this_type).trim();
|
|
24
|
-
if (!name.endsWith('*'))
|
|
25
|
-
name += ' *';
|
|
26
|
-
const pointer = await resolve(name);
|
|
27
|
-
const parameters = value.parameters;
|
|
28
|
-
if (!Array.isArray(parameters))
|
|
29
|
-
fail('partial', 'Saved member parameters are absent.');
|
|
30
|
-
const self = parameters.find(param => object(param).auto === true && object(param).name === 'this');
|
|
31
|
-
if (!self)
|
|
32
|
-
fail('partial', 'Saved implicit this parameter is absent.');
|
|
33
|
-
equal(object(self).type, pointer.name, 'implicit this type');
|
|
34
|
-
equal(String(value.namespace).split('::').at(-1), pointer.pointerBase, 'owning class');
|
|
35
|
-
return value;
|
|
36
|
-
}
|
|
37
|
-
if (path === '/clear_flow_and_repair') {
|
|
38
|
-
if (response.success !== true || response.repair !== true)
|
|
39
|
-
fail('partial', 'Flow repair lacks a completed outcome.');
|
|
40
|
-
const range = object(response.seed_range);
|
|
41
|
-
equal(address(String(range.start_address)), address(p.start_address), 'repair seed start');
|
|
42
|
-
if (p.end_address)
|
|
43
|
-
equal(address(String(range.end_address_exclusive)), address(p.end_address), 'repair seed end');
|
|
44
|
-
const value = await inspect('instruction_range', { address: p.start_address, end_address: range.end_address_exclusive });
|
|
45
|
-
equal(value.count, object(response.observations).instructions_in_seed_after, 'repaired instruction count');
|
|
46
|
-
return value;
|
|
47
|
-
}
|
|
48
|
-
const data = await inspect('data', { address: p.address });
|
|
49
|
-
if (path === '/set_global' && p.type_name) {
|
|
50
|
-
equal(data.exists, true, 'defined global presence');
|
|
51
|
-
const type = await resolve(p.type_name);
|
|
52
|
-
if (Number(p.array_length ?? 0) > 0) {
|
|
53
|
-
const details = object(data.details);
|
|
54
|
-
equal(details.elementType, type.name, 'global array element');
|
|
55
|
-
equal(details.elementCount, p.array_length, 'global array length');
|
|
56
|
-
}
|
|
57
|
-
else
|
|
58
|
-
equal(data.type, type.name, 'global type');
|
|
59
|
-
}
|
|
60
|
-
if (path === '/apply_data_classification') {
|
|
61
|
-
equal(data.exists, true, 'classified data presence');
|
|
62
|
-
const definition = object(p.type_definition);
|
|
63
|
-
if (p.classification === 'PRIMITIVE') {
|
|
64
|
-
const type = await resolve(definition.type);
|
|
65
|
-
equal(data.type, type.name, 'classified primitive type');
|
|
66
|
-
}
|
|
67
|
-
if (p.classification === 'STRUCTURE') {
|
|
68
|
-
equal(data.type, definition.name, 'classified structure type');
|
|
69
|
-
const type = await resolve(definition.name);
|
|
70
|
-
const fields = type.fields;
|
|
71
|
-
if (!Array.isArray(fields) || !Array.isArray(definition.fields))
|
|
72
|
-
fail('partial', 'Classified structure layout is absent.');
|
|
73
|
-
equal(fields.length, definition.fields.length, 'classified field count');
|
|
74
|
-
for (let i = 0; i < fields.length; i++) {
|
|
75
|
-
const requested = object(definition.fields[i]), expected = await resolve(requested.type);
|
|
76
|
-
equal(object(fields[i]).name, requested.name, 'classified field name');
|
|
77
|
-
equal(object(fields[i]).type, expected.name, 'classified field type');
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
if (p.classification === 'ARRAY') {
|
|
81
|
-
const type = await resolve(definition.element_type ?? definition.element_struct), details = object(data.details);
|
|
82
|
-
equal(details.elementType, type.name, 'classified array element');
|
|
83
|
-
equal(details.elementCount, Number(definition.count), 'classified array length');
|
|
84
|
-
}
|
|
85
|
-
if (p.classification === 'STRING')
|
|
86
|
-
equal(data.isString, true, 'classified string value');
|
|
87
|
-
if (p.comment) {
|
|
88
|
-
const comment = await inspect('comments', { address: p.address });
|
|
89
|
-
equal(comment.pre, String(p.comment).replaceAll('\\n', '\n').replaceAll('\\t', '\t').replaceAll('\\r', '\r'), 'classified comment');
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
let symbols, comments;
|
|
93
|
-
if (p.name) {
|
|
94
|
-
symbols = await inspect('symbols', { address: p.address });
|
|
95
|
-
if (!Array.isArray(symbols.symbols) || !symbols.symbols.some(symbol => object(symbol).name === p.name))
|
|
96
|
-
fail('partial', 'Saved global label is absent.');
|
|
97
|
-
}
|
|
98
|
-
if (path === '/set_global' && p.plate_comment) {
|
|
99
|
-
comments = await inspect('comments', { address: p.address });
|
|
100
|
-
equal(comments.plate, p.plate_comment, 'global plate comment');
|
|
101
|
-
}
|
|
102
|
-
return { data, ...(symbols ? { symbols } : {}), ...(comments ? { comments } : {}) };
|
|
103
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface CallerGoal {
|
|
2
|
-
schema: 1;
|
|
3
|
-
id: string;
|
|
4
|
-
pid: number;
|
|
5
|
-
thread: string;
|
|
6
|
-
pc: string;
|
|
7
|
-
sp: string;
|
|
8
|
-
stop: number;
|
|
9
|
-
executable: string;
|
|
10
|
-
breakpoint: number;
|
|
11
|
-
}
|
|
12
|
-
export declare function readCallerGoal(python: string): Promise<CallerGoal | undefined>;
|
|
13
|
-
export declare function callerVerified(goal: CallerGoal, value: Record<string, unknown>): boolean;
|
|
14
|
-
export declare function awaitCaller(python: string, goal: CallerGoal, signal?: AbortSignal, budgetMs?: number): Promise<void>;
|
|
15
|
-
/** Runs from the owned LLDB CLI after the MCP action has returned and released its locks. */
|
|
16
|
-
export declare function callerObservationCommand(python: string, goal: CallerGoal, sample: string): string;
|
|
17
|
-
export declare function callerMonitor(python: string, send: (command: string) => void): () => Promise<void>;
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
/** Private, profile-owned LLDB completion receipts. No CPU operation is retried. */
|
|
2
|
-
import { lstat, open, readFile, realpath, rename } from 'node:fs/promises';
|
|
3
|
-
import { join, resolve } from 'node:path';
|
|
4
|
-
import { randomUUID } from 'node:crypto';
|
|
5
|
-
import { setTimeout as delay } from 'node:timers/promises';
|
|
6
|
-
import { fail, object } from './model.js';
|
|
7
|
-
const uuid = /^[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$/;
|
|
8
|
-
const hex = /^0x[a-fA-F0-9]{1,16}$/;
|
|
9
|
-
async function json(path) {
|
|
10
|
-
try {
|
|
11
|
-
const stat = await lstat(path);
|
|
12
|
-
if (!stat.isFile() || stat.size > 16384 || await realpath(path) !== resolve(path))
|
|
13
|
-
fail('binding', 'Native caller receipt is not an owned regular file.');
|
|
14
|
-
return object(JSON.parse(await readFile(path, 'utf8')));
|
|
15
|
-
}
|
|
16
|
-
catch (error) {
|
|
17
|
-
if (error.code === 'ENOENT')
|
|
18
|
-
return;
|
|
19
|
-
throw error;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
async function atomic(path, value) { const temporary = path + '.new-' + randomUUID(), file = await open(temporary, 'wx', 0o600); try {
|
|
23
|
-
await file.writeFile(JSON.stringify(value));
|
|
24
|
-
await file.sync();
|
|
25
|
-
}
|
|
26
|
-
finally {
|
|
27
|
-
await file.close();
|
|
28
|
-
} await rename(temporary, path); }
|
|
29
|
-
export async function readCallerGoal(python) {
|
|
30
|
-
const value = await json(join(python, 'caller-goal.json'));
|
|
31
|
-
if (!value)
|
|
32
|
-
return;
|
|
33
|
-
if (value.schema !== 1 || typeof value.id !== 'string' || !uuid.test(value.id) || !Number.isSafeInteger(value.pid) || Number(value.pid) <= 0 || typeof value.thread !== 'string' || !/^\d{1,20}$/.test(value.thread) || BigInt(value.thread) <= 0n || typeof value.pc !== 'string' || !hex.test(value.pc) || typeof value.sp !== 'string' || !hex.test(value.sp) || !Number.isSafeInteger(value.stop) || Number(value.stop) < 0 || typeof value.executable !== 'string' || !Number.isSafeInteger(value.breakpoint) || Number(value.breakpoint) <= 0)
|
|
34
|
-
fail('binding', 'Native caller goal is malformed.');
|
|
35
|
-
return value;
|
|
36
|
-
}
|
|
37
|
-
export function callerVerified(goal, value) {
|
|
38
|
-
return value.schema === 1 && value.goal === goal.id && value.state === 'verified' && value.pid === goal.pid && value.thread === goal.thread && typeof value.pc === 'string' && hex.test(value.pc) && BigInt(value.pc) === BigInt(goal.pc) && typeof value.sp === 'string' && hex.test(value.sp) && BigInt(value.sp) === BigInt(goal.sp) && Number.isSafeInteger(value.stop) && Number(value.stop) > goal.stop;
|
|
39
|
-
}
|
|
40
|
-
export async function awaitCaller(python, goal, signal, budgetMs = 12000) {
|
|
41
|
-
await atomic(join(python, 'caller-armed.json'), { schema: 1, id: goal.id });
|
|
42
|
-
const deadline = Date.now() + budgetMs;
|
|
43
|
-
while (Date.now() < deadline) {
|
|
44
|
-
signal?.throwIfAborted();
|
|
45
|
-
const value = await json(join(python, 'caller-observation.json'));
|
|
46
|
-
if (value?.goal === goal.id) {
|
|
47
|
-
if (callerVerified(goal, value))
|
|
48
|
-
return;
|
|
49
|
-
if (value.state === 'verified' || value.state === 'failed')
|
|
50
|
-
fail('partial', 'Native caller observation did not verify the requested return.', { goal: goal.id, observation: value });
|
|
51
|
-
}
|
|
52
|
-
await delay(Math.min(50, Math.max(1, deadline - Date.now())), undefined, { signal });
|
|
53
|
-
}
|
|
54
|
-
fail('partial', 'Native caller was not verified within the action budget; execution was not repeated.', { goal: goal.id });
|
|
55
|
-
}
|
|
56
|
-
/** Runs from the owned LLDB CLI after the MCP action has returned and released its locks. */
|
|
57
|
-
export function callerObservationCommand(python, goal, sample) {
|
|
58
|
-
const code = [
|
|
59
|
-
'import lldb,json,os,pathlib',
|
|
60
|
-
'goal=json.loads(' + JSON.stringify(JSON.stringify(goal)) + ')',
|
|
61
|
-
'output=pathlib.Path(' + JSON.stringify(join(python, 'caller-observation.json')) + ')',
|
|
62
|
-
'value={"schema":1,"goal":goal["id"],"sample":' + JSON.stringify(sample) + ',"state":"pending"}',
|
|
63
|
-
'def inspect_caller():',
|
|
64
|
-
' p=lldb.debugger.GetSelectedTarget().GetProcess()',
|
|
65
|
-
' if p.GetProcessID()!=goal["pid"]: raise RuntimeError("Native process identity changed")',
|
|
66
|
-
' state=p.GetState()',
|
|
67
|
-
' if state in (lldb.eStateExited,lldb.eStateDetached,lldb.eStateInvalid): raise RuntimeError("Native target ended before caller verification")',
|
|
68
|
-
' if state!=lldb.eStateStopped: return',
|
|
69
|
-
' stop=p.GetStopID(); t=p.GetThreadByID(int(goal["thread"])); f=t.GetFrameAtIndex(0)',
|
|
70
|
-
' if not f.IsValid(): return',
|
|
71
|
-
' pc=f.FindRegister("pc"); sp=f.FindRegister("sp")',
|
|
72
|
-
' if not pc.IsValid() or not sp.IsValid() or pc.GetError().Fail() or sp.GetError().Fail(): return',
|
|
73
|
-
' value.update(pid=p.GetProcessID(),thread=str(t.GetThreadID()),pc=hex(pc.GetValueAsUnsigned()),sp=hex(sp.GetValueAsUnsigned()),frame_pc=hex(f.GetPC()),stop=stop)',
|
|
74
|
-
' if stop<=goal["stop"] or pc.GetValueAsUnsigned()!=int(goal["pc"],16) or sp.GetValueAsUnsigned()!=int(goal["sp"],16) or p.GetState()!=lldb.eStateStopped or p.GetStopID()!=stop: return',
|
|
75
|
-
' from ghidralldb import commands',
|
|
76
|
-
' client=commands.STATE.require_client(); batch=client.cur_batch',
|
|
77
|
-
' value.update(trace_batch_count=batch.count if batch is not None else 0,trace_batch_mutex=client._block.locked())',
|
|
78
|
-
' if batch is not None or client._block.locked(): return',
|
|
79
|
-
' result=lldb.SBCommandReturnObject()',
|
|
80
|
-
' lldb.debugger.GetCommandInterpreter().HandleCommand("ghidra trace sync-synth-stopped",result)',
|
|
81
|
-
' if not result.Succeeded(): raise RuntimeError("Native stopped trace could not be synchronized")',
|
|
82
|
-
' batch=client.cur_batch',
|
|
83
|
-
' value.update(trace_batch_count=batch.count if batch is not None else 0,trace_batch_mutex=client._block.locked())',
|
|
84
|
-
' if batch is not None or client._block.locked(): return',
|
|
85
|
-
' f=p.GetThreadByID(int(goal["thread"])).GetFrameAtIndex(0)',
|
|
86
|
-
' pc=f.FindRegister("pc"); sp=f.FindRegister("sp")',
|
|
87
|
-
' if p.GetState()==lldb.eStateStopped and p.GetStopID()==stop and f.IsValid() and pc.IsValid() and sp.IsValid() and pc.GetError().Success() and sp.GetError().Success() and pc.GetValueAsUnsigned()==int(goal["pc"],16) and sp.GetValueAsUnsigned()==int(goal["sp"],16): value["state"]="verified"',
|
|
88
|
-
'try: inspect_caller()',
|
|
89
|
-
'except Exception as error: value.update(state="failed",error=str(error)[:1024])',
|
|
90
|
-
'temporary=str(output)+".new-"+value["sample"]',
|
|
91
|
-
'fd=os.open(temporary,os.O_CREAT|os.O_EXCL|os.O_WRONLY,0o600)',
|
|
92
|
-
'try: os.write(fd,json.dumps(value).encode("utf-8")); os.fsync(fd)',
|
|
93
|
-
'finally: os.close(fd)',
|
|
94
|
-
'os.replace(temporary,output)',
|
|
95
|
-
].join('\n');
|
|
96
|
-
return 'script exec(' + JSON.stringify(code) + ')\n';
|
|
97
|
-
}
|
|
98
|
-
export function callerMonitor(python, send) {
|
|
99
|
-
let goalId = '', sample = '', inflight = false, terminal = false, deadline = 0;
|
|
100
|
-
return async () => {
|
|
101
|
-
const armed = await json(join(python, 'caller-armed.json'));
|
|
102
|
-
if (!armed || typeof armed.id !== 'string' || !uuid.test(armed.id))
|
|
103
|
-
return;
|
|
104
|
-
const goal = await readCallerGoal(python);
|
|
105
|
-
if (!goal || goal.id !== armed.id)
|
|
106
|
-
return;
|
|
107
|
-
if (goalId !== goal.id) {
|
|
108
|
-
goalId = goal.id;
|
|
109
|
-
inflight = false;
|
|
110
|
-
terminal = false;
|
|
111
|
-
deadline = Date.now() + 15000;
|
|
112
|
-
}
|
|
113
|
-
if (terminal || Date.now() >= deadline)
|
|
114
|
-
return;
|
|
115
|
-
if (inflight) {
|
|
116
|
-
const value = await json(join(python, 'caller-observation.json'));
|
|
117
|
-
if (value?.goal !== goal.id || value.sample !== sample)
|
|
118
|
-
return;
|
|
119
|
-
inflight = false;
|
|
120
|
-
if (value.state === 'verified' || value.state === 'failed') {
|
|
121
|
-
terminal = true;
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
sample = randomUUID();
|
|
126
|
-
inflight = true;
|
|
127
|
-
send(callerObservationCommand(python, goal, sample));
|
|
128
|
-
};
|
|
129
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** Preserve the pinned Ghidra launcher except its one explicit local LLDB run command. */
|
|
2
|
-
export function debuggerLaunchArguments(arguments_, stopAtEntry, ownedPython) {
|
|
3
|
-
const result = [...arguments_];
|
|
4
|
-
if (ownedPython) {
|
|
5
|
-
const imports = result.flatMap((value, index) => index > 0 && ['-o', '--one-line'].includes(result[index - 1]) && value === 'script import os, ghidralldb' ? [index] : []);
|
|
6
|
-
if (imports.length !== 1)
|
|
7
|
-
throw Error('Pinned LLDB launcher must supply exactly one adapter import');
|
|
8
|
-
result[imports[0]] = "script import sys,os; sys.path.insert(0," + JSON.stringify(ownedPython) + "); import ghidralldb,ghidralldb.methods; os._exit(253) if os.path.realpath(ghidralldb.methods.__file__) != " + JSON.stringify(ownedPython + '/ghidralldb/methods.py') + " else None; print('Insight owned LLDB adapter verified')";
|
|
9
|
-
}
|
|
10
|
-
if (!stopAtEntry)
|
|
11
|
-
return result;
|
|
12
|
-
const launches = result.flatMap((value, index) => index > 0 && ['-o', '--one-line'].includes(result[index - 1]) && value.startsWith('process launch') ? [index] : []);
|
|
13
|
-
if (launches.length !== 1 || !['process launch', 'process launch --stop-at-entry'].includes(result[launches[0]]))
|
|
14
|
-
throw Error('Pinned LLDB launcher must supply exactly one supported launch command');
|
|
15
|
-
result[launches[0]] = 'process launch --stop-at-entry';
|
|
16
|
-
return result;
|
|
17
|
-
}
|