refactor: remove single-use forwarding helpers
This commit is contained in:
@@ -208,11 +208,6 @@ export const analysisViewInputError = (
|
||||
): AnalysisInputError =>
|
||||
new AnalysisInputError(INSPECT_ANALYSIS_VIEW_OPERATION, undefined, issues);
|
||||
|
||||
/** SHA-256 of the canonical projected JSON, excluding this digest field. */
|
||||
export const analysisViewDigest = (
|
||||
projection: Omit<AnalysisViewResult, "view_digest">,
|
||||
): string => digestCanonicalValue(projection, "Analysis view");
|
||||
|
||||
/** View payload before the content digest is attached. */
|
||||
export type UnsignedAnalysisView =
|
||||
| Omit<
|
||||
@@ -229,7 +224,7 @@ export const sealAnalysisView = (
|
||||
): AnalysisViewResult =>
|
||||
analysisViewResultSchema.parse({
|
||||
...projection,
|
||||
view_digest: analysisViewDigest(projection),
|
||||
view_digest: digestCanonicalValue(projection, "Analysis view"),
|
||||
});
|
||||
|
||||
const parentDigest = (evidenceId: string): string => evidenceId.slice(3);
|
||||
|
||||
@@ -4,11 +4,6 @@ import type {
|
||||
ParsedInstruction,
|
||||
} from "./ManagedMemberInspectorCore.js";
|
||||
|
||||
const opcode = (
|
||||
code: number,
|
||||
): { readonly name: string; readonly operand: string } | undefined =>
|
||||
OPCODES.get(code);
|
||||
|
||||
const PREFIX_OPCODES = new Set([
|
||||
"unaligned.",
|
||||
"volatile.",
|
||||
@@ -403,7 +398,7 @@ export const decodeInstructions = (
|
||||
const first = il.readUInt8(offset);
|
||||
offset += 1;
|
||||
const code = first === 0xfe ? 0xfe00 + il.readUInt8(offset++) : first;
|
||||
const descriptor = opcode(code);
|
||||
const descriptor = OPCODES.get(code);
|
||||
if (descriptor === undefined) {
|
||||
issue = `Unsupported CIL opcode 0x${code.toString(16)} at IL offset ${String(start)}`;
|
||||
break;
|
||||
|
||||
@@ -61,7 +61,8 @@ import { AndroidAnalysisService } from "../application/android/AndroidAnalysisSe
|
||||
import type { AndroidAnalysisPort } from "../application/android/AndroidAnalysisPort.js";
|
||||
import { createAndroidAnalysisProvider } from "../composition/android.js";
|
||||
import { registerManagedWorkflowTools } from "./registerManagedWorkflowTools.js";
|
||||
import { registerNativeTools } from "./registerNativeTools.js";
|
||||
import { NATIVE_TOOL_CONTRACTS } from "../contracts/native/nativeToolContracts.js";
|
||||
import { registerEvidenceTools } from "./registerEvidenceTools.js";
|
||||
import { registerOfficialTools } from "./registerOfficialTools.js";
|
||||
import { registerGuidedPrompts } from "./registerPrompts.js";
|
||||
import { registerSessionTools } from "./registerSessionTools.js";
|
||||
@@ -410,7 +411,7 @@ const registerBinaryAnalysisTools = ({
|
||||
recordEvidence,
|
||||
withAdmittedAnalysis,
|
||||
};
|
||||
registerNativeTools(server, evidenceOptions);
|
||||
registerEvidenceTools(server, NATIVE_TOOL_CONTRACTS, evidenceOptions);
|
||||
registerArtifactTools(server, evidenceOptions);
|
||||
registerManagedTools(server, evidenceOptions);
|
||||
if (session !== undefined)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
import type { EvidenceMcpServer } from "./EvidenceMcpServer.js";
|
||||
import type { EvidenceWriter } from "../application/investigation/InvestigationRecordPort.js";
|
||||
|
||||
import { NATIVE_TOOL_CONTRACTS } from "../contracts/native/nativeToolContracts.js";
|
||||
import type { BinaryTarget } from "../domain/binaryTargetTypes.js";
|
||||
import type { Logger } from "pino";
|
||||
import { registerEvidenceTools } from "./registerEvidenceTools.js";
|
||||
|
||||
/** Register provider-neutral static inspection operations. */
|
||||
export const registerNativeTools = (
|
||||
server: EvidenceMcpServer,
|
||||
options: {
|
||||
readonly logger: Logger;
|
||||
readonly activeTarget: (() => BinaryTarget | undefined) | undefined;
|
||||
readonly recordEvidence: EvidenceWriter["recordEvidence"] | undefined;
|
||||
readonly withAdmittedAnalysis: import("./analysisAdmission.js").WithAdmittedAnalysis;
|
||||
},
|
||||
): void =>
|
||||
registerEvidenceTools(server, NATIVE_TOOL_CONTRACTS, {
|
||||
...options,
|
||||
});
|
||||
Reference in New Issue
Block a user