feat(ghidra): implement read-only inventory operations

This commit is contained in:
N0zoM1z0
2026-07-16 02:59:37 +09:00
committed by N0zoM1z0
parent f0e625d7ee
commit b1c07dd9c6
101 changed files with 3825 additions and 377 deletions
+3 -4
View File
@@ -3,6 +3,7 @@ import { err, type Result } from "../domain/result.js";
import type { PendingOperations } from "../process/PendingOperations.js";
import type { GhidraSessionError } from "./GhidraSessionError.js";
import { ghidraResponseResult, parseGhidraResponseLine } from "./protocol.js";
import type { GhidraRemoteError } from "./protocol.js";
/** Dependencies for correlating validated bridge responses. */
export interface GhidraResponseRouterOptions {
@@ -11,7 +12,7 @@ export interface GhidraResponseRouterOptions {
Result<JsonValue, GhidraSessionError>
>;
readonly nextId: () => number;
readonly remoteFailure: (message: string, cause: Error) => GhidraSessionError;
readonly remoteFailure: (failure: GhidraRemoteError) => GhidraSessionError;
readonly protocolFailure: (message: string, cause?: Error) => void;
}
@@ -38,9 +39,7 @@ export class GhidraResponseRouter {
const result = ghidraResponseResult(parsed.value);
this.#options.pending.settle(
parsed.value.id,
result.ok
? result
: err(this.#options.remoteFailure(result.error.message, result.error)),
result.ok ? result : err(this.#options.remoteFailure(result.error)),
);
}
}