fix: name host and tool requirements in optional adapter refusals
Host and tool-configuration refusals from the pwntools, EVMole, firmware, mitmproxy, Wakaru, LLDB and xcrun adapters carried no userMessage, so CLI and MCP callers saw the generic "This analysis is unavailable for the current target. Choose another analysis or target." as both message and remediation. Choosing another target cannot satisfy a Linux-only profile or an unset REA_*_COMMAND. The actual requirement appeared only in details.reason. Pass each refusal's reason as its userMessage, as the adapters' other configuration refusals (EVMole limits, JADX, pwndbg) already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e6905c18e0
commit
170d0bf9e2
@@ -50,6 +50,8 @@ import {
|
||||
|
||||
const OPERATION = "observe_native_calls";
|
||||
const PROVIDER = "native-macos";
|
||||
const LLDB_REQUIREMENT =
|
||||
"LLDB from Xcode or the Command Line Tools is not available";
|
||||
/** Captured target output kept per stream; the rest is counted, not stored. */
|
||||
const MAX_OUTPUT_BYTES = 1024 * 1024;
|
||||
/** LLDB startup, symbol loading and teardown beyond the observation window. */
|
||||
@@ -180,7 +182,8 @@ export class LldbCallTracer implements NativeCallTracer {
|
||||
: new AnalysisCapabilityUnavailableError(
|
||||
PROVIDER,
|
||||
OPERATION,
|
||||
"LLDB from Xcode or the Command Line Tools is not available",
|
||||
LLDB_REQUIREMENT,
|
||||
{ userMessage: LLDB_REQUIREMENT },
|
||||
),
|
||||
);
|
||||
const root = await PrivateRuntimeRoot.create({ prefix: "rea-lldb-" });
|
||||
|
||||
@@ -668,13 +668,15 @@ const translateCommandFailure = (
|
||||
...(capturedOutput === undefined ? {} : { capturedOutput }),
|
||||
...(cleanup === undefined ? {} : { cleanup }),
|
||||
};
|
||||
if (failure.reason === "unavailable")
|
||||
if (failure.reason === "unavailable") {
|
||||
const reason = `${failure.tool} is unavailable through xcrun.`;
|
||||
return new AnalysisCapabilityUnavailableError(
|
||||
IDENTITY.id,
|
||||
operation,
|
||||
`${failure.tool} is unavailable through xcrun.`,
|
||||
errorOptions,
|
||||
reason,
|
||||
{ ...errorOptions, userMessage: reason },
|
||||
);
|
||||
}
|
||||
if (failure.reason === "cancelled")
|
||||
return new AnalysisCancelledError(operation, errorOptions);
|
||||
if (failure.reason === "timeout")
|
||||
|
||||
@@ -38,6 +38,9 @@ import {
|
||||
PWNTOOLS_LIMITS,
|
||||
} from "./PwntoolsRelease.js";
|
||||
|
||||
const HOST_REQUIREMENT =
|
||||
"The initial real-verified pwntools artifact profile supports Linux x64 only.";
|
||||
|
||||
/** Owned launcher seam shared by the offline pwntools artifact adapters. */
|
||||
export type PwntoolsLauncher = NonNullable<
|
||||
Parameters<typeof runOwnedCommand>[2]
|
||||
@@ -122,7 +125,8 @@ export class PwntoolsDecoder<
|
||||
throw new AnalysisCapabilityUnavailableError(
|
||||
this.identity.id,
|
||||
OPERATION,
|
||||
"The initial real-verified pwntools artifact profile supports Linux x64 only.",
|
||||
HOST_REQUIREMENT,
|
||||
{ userMessage: HOST_REQUIREMENT },
|
||||
);
|
||||
if (!isAbsolute(selectedPath))
|
||||
throw pwntoolsUnavailable(
|
||||
|
||||
Reference in New Issue
Block a user