Files
rea/src/contracts/sessionStatusContract.ts
T
morluto 765e809e36 refactor: use canonical implementations and types directly
Remove forwarding wrappers and shadow aliases, migrate callers and verification scripts to their owners, and share one exhaustive semantic resource-bound projection.
2026-10-09 23:35:19 +08:00

23 lines
763 B
TypeScript

import { z } from "zod";
import { isAbsolute } from "node:path";
import { localPathStringSchema } from "../domain/localPath.js";
/** Optional expectations used to compare the live session with its caller. */
export const binarySessionInputSchema = z.strictObject({
expected_package_version: z.string().min(1).optional(),
expected_catalog_digest: z
.string()
.regex(/^[a-f0-9]{64}$/u)
.optional(),
expected_server_path: localPathStringSchema
.refine(isAbsolute, {
message:
"expected_server_path must be an absolute local filesystem path (for example /opt/rea/dist/main.js)",
})
.describe(
"Absolute local filesystem path expected for the running server; relative paths are rejected.",
)
.optional(),
});