refactor(cli): share direct analysis tool types

This commit is contained in:
morluto
2026-07-13 03:26:32 +00:00
parent d806480e41
commit 329fdf6fe8
2 changed files with 12 additions and 19 deletions
+11 -18
View File
@@ -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<Record<string, JsonValue>>,
logger: Logger = silentLogger,
): Promise<JsonValue> => 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<Record<string, JsonValue>>,
logger: Logger,
): Promise<JsonValue> => {
+1 -1
View File
@@ -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<typeof Cli.create>,
logger: Logger,