fix(contracts)!: require absolute local paths for session filesystem inputs (#948)
fix(contracts): require absolute local paths for session filesystem inputs Snapshot, evidence-bundle export, and managed-target inputs accepted any non-empty string, so relative paths were resolved against the MCP server working directory instead of the caller's intent. Refine these contract fields to absolute host paths (Windows drive and forward-slash forms included), advertise the constraint on the property descriptions, and regenerate the derived catalog, product catalog, and skill catalog digest. Relative CLI options are unaffected because CLI flows do not parse these MCP contracts. Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import { isAbsoluteLocalPath } from "../domain/localPath.js";
|
||||
import {
|
||||
sessionOutputSchemas,
|
||||
requireOutputSchema,
|
||||
@@ -47,7 +48,16 @@ const session = <Name extends string, Schema extends z.ZodObject>(
|
||||
|
||||
/** Session-owned Evidence bundle export options. */
|
||||
export const exportEvidenceBundleInputSchema = z.strictObject({
|
||||
path: z.string().min(1),
|
||||
path: z
|
||||
.string()
|
||||
.min(1)
|
||||
.refine(isAbsoluteLocalPath, {
|
||||
message:
|
||||
"path must be an absolute local filesystem path (for example /tmp/rea/evidence.json or C:\\rea\\evidence.json)",
|
||||
})
|
||||
.describe(
|
||||
"Absolute local filesystem path for the exported evidence bundle; relative paths are rejected.",
|
||||
),
|
||||
overwrite: z.boolean().default(false),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user