feat(session): add dynamic binary lifecycle

This commit is contained in:
morluto
2026-07-12 06:34:18 +08:00
parent c2c3d989eb
commit f32e718cc7
16 changed files with 942 additions and 28 deletions
+3 -3
View File
@@ -8,14 +8,14 @@ const DEFAULT_HOPPER_LAUNCHER_PATH =
export interface AppConfig {
readonly hopperLauncherPath: string;
readonly hopperTargetPath: string;
readonly hopperTargetPath: string | undefined;
readonly hopperTargetKind: "executable" | "database";
readonly hopperLoaderArgs: readonly string[];
}
const environmentSchema = z.object({
HOPPER_LAUNCHER_PATH: z.string().min(1).optional(),
HOPPER_TARGET_PATH: z.string().min(1),
HOPPER_TARGET_PATH: z.string().min(1).optional(),
HOPPER_TARGET_KIND: z.enum(["executable", "database"]).default("executable"),
HOPPER_LOADER_ARGS_JSON: z.string().optional(),
});
@@ -27,7 +27,7 @@ export const parseConfig = (
const parsedEnvironment = environmentSchema.safeParse(environment);
if (!parsedEnvironment.success) {
return err(
new ConfigurationError("HOPPER_TARGET_PATH is required", {
new ConfigurationError("Invalid Hopper environment configuration", {
cause: parsedEnvironment.error,
}),
);