refactor(cli): share direct analysis tool types
This commit is contained in:
@@ -13,6 +13,15 @@ const WORKFLOW_PROVIDER = {
|
|||||||
version: "1",
|
version: "1",
|
||||||
} as const;
|
} 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.
|
* Open one binary, execute one tool, and always release the bridge session.
|
||||||
* Unlike MCP mode, every CLI invocation is intentionally isolated and does not
|
* Unlike MCP mode, every CLI invocation is intentionally isolated and does not
|
||||||
@@ -20,14 +29,7 @@ const WORKFLOW_PROVIDER = {
|
|||||||
*/
|
*/
|
||||||
export const runDirectAnalysis = async (
|
export const runDirectAnalysis = async (
|
||||||
path: string,
|
path: string,
|
||||||
tool:
|
tool: DirectAnalysisTool,
|
||||||
| "binary_overview"
|
|
||||||
| "procedure_pseudo_code"
|
|
||||||
| "analyze_function"
|
|
||||||
| "search_strings"
|
|
||||||
| "search_procedures"
|
|
||||||
| "xrefs"
|
|
||||||
| "trace_feature",
|
|
||||||
arguments_: Readonly<Record<string, JsonValue>>,
|
arguments_: Readonly<Record<string, JsonValue>>,
|
||||||
logger: Logger = silentLogger,
|
logger: Logger = silentLogger,
|
||||||
): Promise<JsonValue> => runAnalysis(path, tool, arguments_, logger);
|
): Promise<JsonValue> => runAnalysis(path, tool, arguments_, logger);
|
||||||
@@ -57,16 +59,7 @@ export const runSessionStatus = async (
|
|||||||
|
|
||||||
const runAnalysis = async (
|
const runAnalysis = async (
|
||||||
path: string,
|
path: string,
|
||||||
tool:
|
tool: NativeToolName | ArtifactToolName | DirectAnalysisTool,
|
||||||
| NativeToolName
|
|
||||||
| ArtifactToolName
|
|
||||||
| "binary_overview"
|
|
||||||
| "procedure_pseudo_code"
|
|
||||||
| "analyze_function"
|
|
||||||
| "search_strings"
|
|
||||||
| "search_procedures"
|
|
||||||
| "xrefs"
|
|
||||||
| "trace_feature",
|
|
||||||
arguments_: Readonly<Record<string, JsonValue>>,
|
arguments_: Readonly<Record<string, JsonValue>>,
|
||||||
logger: Logger,
|
logger: Logger,
|
||||||
): Promise<JsonValue> => {
|
): Promise<JsonValue> => {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { parseConfig } from "./config.js";
|
|||||||
import { logCliCommand } from "./cliLogging.js";
|
import { logCliCommand } from "./cliLogging.js";
|
||||||
import type { Logger } from "./logger.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 = (
|
export const registerEvidenceCommands = (
|
||||||
cli: ReturnType<typeof Cli.create>,
|
cli: ReturnType<typeof Cli.create>,
|
||||||
logger: Logger,
|
logger: Logger,
|
||||||
|
|||||||
Reference in New Issue
Block a user