test(linux): verify setup through CLI and MCP

This commit is contained in:
morluto
2026-07-13 21:20:51 +00:00
parent 75818d119e
commit 67504d2d51
20 changed files with 632 additions and 123 deletions
+14 -4
View File
@@ -1,4 +1,10 @@
import type { JsonValue } from "./jsonValue.js";
import {
hopperStartupFailure,
type HopperStartupFailureCode,
} from "./hopperStartupFailure.js";
export { hopperStartupFailure } from "./hopperStartupFailure.js";
export type { HopperStartupFailureCode } from "./hopperStartupFailure.js";
/** Stable tags exposed by safe analysis-error projections. */
const ANALYSIS_ERROR_TAGS = [
@@ -282,14 +288,14 @@ export class HopperRemoteError extends HopperError {
/** The owned Hopper bridge stopped before its client was closed. */
export class HopperProcessError extends HopperError {
readonly _tag = "HopperProcessError";
readonly failureCode: HopperStartupFailureCode | undefined;
override readonly userMessage: string | undefined;
constructor(readonly exitCode: number | null) {
super(`Hopper bridge stopped unexpectedly with code ${String(exitCode)}`);
this.userMessage =
exitCode === 78
? "This Hopper demo build or dialog is not supported for unattended Linux analysis. Update REA or use a supported Hopper build."
: undefined;
const failure = hopperStartupFailure(exitCode);
this.failureCode = failure?.code;
this.userMessage = failure?.message;
}
}
@@ -342,6 +348,7 @@ export interface AnalysisErrorProjection
| "unavailable"
| "execution_failure";
readonly message: string;
readonly code?: HopperStartupFailureCode;
}
/** Project expected failures into exhaustive, secret-safe caller fields. */
@@ -349,9 +356,12 @@ export const projectAnalysisError = (
error: AnalysisError,
): AnalysisErrorProjection => {
assertKnownTag(error._tag);
const code =
error instanceof HopperProcessError ? error.failureCode : undefined;
return {
category: errorCategory(error),
message: userMessage(error),
...(code === undefined ? {} : { code }),
};
};