Frida session lookups, script lookups, unreadable script files and the instrument-with-frida PID and script checks returned invalid_request with no issues, while the remediation told callers to correct the listed arguments. Attach the session_id, script_id, path, target or script issue with the reason so CLI and MCP callers can see what to fix. Fixes #2213 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
841 B
TypeScript
28 lines
841 B
TypeScript
import { AnalysisInputError } from "../../domain/analysisErrorCore.js";
|
|
|
|
/** A session ID that names no open Frida session owned by this process. */
|
|
export const unknownFridaSession = (
|
|
operation: string,
|
|
sessionId: string,
|
|
): AnalysisInputError =>
|
|
new AnalysisInputError(operation, undefined, [
|
|
{
|
|
path: ["session_id"],
|
|
reason: "invalid_value",
|
|
message: `No open Frida session ${sessionId}; start one with start_frida_session.`,
|
|
},
|
|
]);
|
|
|
|
/** A script ID that names no loaded script in the selected session. */
|
|
export const unknownFridaScript = (
|
|
operation: string,
|
|
scriptId: string,
|
|
): AnalysisInputError =>
|
|
new AnalysisInputError(operation, undefined, [
|
|
{
|
|
path: ["script_id"],
|
|
reason: "invalid_value",
|
|
message: `No loaded Frida script ${scriptId} in this session.`,
|
|
},
|
|
]);
|