From 329fdf6fe8f3a2bf9679b13a8ce5cb16cf946129 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Mon, 13 Jul 2026 03:26:32 +0000 Subject: [PATCH] refactor(cli): share direct analysis tool types --- src/application/DirectAnalysis.ts | 29 +++++++++++------------------ src/cliEvidenceCommands.ts | 2 +- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/application/DirectAnalysis.ts b/src/application/DirectAnalysis.ts index b7f605f83..ba0969c51 100644 --- a/src/application/DirectAnalysis.ts +++ b/src/application/DirectAnalysis.ts @@ -13,6 +13,15 @@ const WORKFLOW_PROVIDER = { version: "1", } as const; +type DirectAnalysisTool = + | "binary_overview" + | "procedure_pseudo_code" + | "analyze_function" + | "search_strings" + | "search_procedures" + | "xrefs" + | "trace_feature"; + /** * Open one binary, execute one tool, and always release the bridge session. * Unlike MCP mode, every CLI invocation is intentionally isolated and does not @@ -20,14 +29,7 @@ const WORKFLOW_PROVIDER = { */ export const runDirectAnalysis = async ( path: string, - tool: - | "binary_overview" - | "procedure_pseudo_code" - | "analyze_function" - | "search_strings" - | "search_procedures" - | "xrefs" - | "trace_feature", + tool: DirectAnalysisTool, arguments_: Readonly>, logger: Logger = silentLogger, ): Promise => runAnalysis(path, tool, arguments_, logger); @@ -57,16 +59,7 @@ export const runSessionStatus = async ( const runAnalysis = async ( path: string, - tool: - | NativeToolName - | ArtifactToolName - | "binary_overview" - | "procedure_pseudo_code" - | "analyze_function" - | "search_strings" - | "search_procedures" - | "xrefs" - | "trace_feature", + tool: NativeToolName | ArtifactToolName | DirectAnalysisTool, arguments_: Readonly>, logger: Logger, ): Promise => { diff --git a/src/cliEvidenceCommands.ts b/src/cliEvidenceCommands.ts index 82ddca626..c602d4309 100644 --- a/src/cliEvidenceCommands.ts +++ b/src/cliEvidenceCommands.ts @@ -9,7 +9,7 @@ import { parseConfig } from "./config.js"; import { logCliCommand } from "./cliLogging.js"; import type { Logger } from "./logger.js"; -/** Register filesystem-gated Evidence v2 commands shared by package smoke tests. */ +/** Register filesystem-gated Evidence v2 commands. */ export const registerEvidenceCommands = ( cli: ReturnType, logger: Logger,