mirror of
https://github.com/morluto/rea
synced 2026-10-27 14:42:18 -04:00
765e809e36
Remove forwarding wrappers and shadow aliases, migrate callers and verification scripts to their owners, and share one exhaustive semantic resource-bound projection.
44 lines
1.7 KiB
TypeScript
44 lines
1.7 KiB
TypeScript
import { isAbsolute } from "node:path";
|
|
import { executableFormatHintSchema } from "../domain/dosCom.js";
|
|
import { localPathStringSchema } from "../domain/localPath.js";
|
|
import { z } from "zod";
|
|
import { analysisProviderSelectorSchema } from "./providerSelection.js";
|
|
|
|
/** Caller-supplied analysis snapshot path; must name its destination absolutely. */
|
|
const snapshotPathSchema = localPathStringSchema
|
|
.refine(isAbsolute, {
|
|
message:
|
|
"snapshot_path must be an absolute local filesystem path (for example /tmp/rea/analysis.json or C:\\rea\\analysis.json)",
|
|
})
|
|
.describe(
|
|
"Absolute local filesystem path for the analysis snapshot; relative paths are rejected.",
|
|
);
|
|
|
|
/** Caller-supplied analysis target path; must name the target absolutely. */
|
|
const binaryTargetPathSchema = localPathStringSchema
|
|
.refine(isAbsolute, {
|
|
message:
|
|
"path must be an absolute local filesystem path (for example /tmp/fixture.bin or C:\\analysis\\fixture.bin)",
|
|
})
|
|
.describe(
|
|
"Absolute local filesystem path for the analysis target; relative paths are rejected.",
|
|
);
|
|
|
|
/** Input contract for opening a target with an optional staged snapshot. */
|
|
export const openBinaryInputSchema = z.strictObject({
|
|
path: binaryTargetPathSchema,
|
|
format: executableFormatHintSchema
|
|
.optional()
|
|
.describe(
|
|
"Explicit headerless DOS COM interpretation; omission preserves header-based detection",
|
|
),
|
|
provider_id: analysisProviderSelectorSchema.optional(),
|
|
snapshot_path: snapshotPathSchema.optional(),
|
|
});
|
|
|
|
/** Input contract for closing a target after an optional atomic snapshot. */
|
|
export const closeBinaryInputSchema = z.strictObject({
|
|
snapshot_path: snapshotPathSchema.optional(),
|
|
overwrite: z.boolean().default(false),
|
|
});
|