fix(contracts): align CLI/MCP boundary contracts (#946)
* fix(cli): validate native scenario and preserve JSON paths * fix(process): reject invalid UTF-8 JSON inputs * fix(cli): retain missing JSON path diagnostics * test(cli): cover relative brace and bracket JSON paths * test(cli): reject missing native scenario steps * fix(mcp): advertise reserved process environment key * fix(process): reject NUL in process scenario values * fix(process): advertise NUL input constraints to MCP * fix(cli): report scenario input schema issues * fix(contracts): align CLI and MCP input validation * fix(mcp): document semantic output constraints * fix(mcp): describe process journal compatibility * docs: regenerate catalog after schema grouping * docs: regenerate catalog after main merge * fix(cli): preserve JSON and native UI input diagnostics * test(mcp): reuse advertised tool schemas in managed flow
This commit is contained in:
@@ -27,6 +27,13 @@ const projectIssue = (
|
||||
),
|
||||
),
|
||||
);
|
||||
if (issue.code === "invalid_key")
|
||||
return issue.issues.flatMap((keyIssue) =>
|
||||
projectIssue(
|
||||
{ ...keyIssue, path: [...issue.path, ...keyIssue.path] },
|
||||
input,
|
||||
),
|
||||
);
|
||||
if (issue.code === "unrecognized_keys")
|
||||
return issue.keys.map((key) => ({
|
||||
path: [...path, key],
|
||||
@@ -48,7 +55,16 @@ const projectIssue = (
|
||||
if (issue.code === "too_big")
|
||||
return [boundedIssue(path, "maximum", numericBound(issue.maximum))];
|
||||
if (issue.code === "invalid_format")
|
||||
return [{ path, reason: "invalid_format", expected: issue.format }];
|
||||
return [
|
||||
{
|
||||
path,
|
||||
reason: "invalid_format",
|
||||
expected: issue.format,
|
||||
...(issue.format === "regex" && issue.message.length > 0
|
||||
? { message: issue.message }
|
||||
: {}),
|
||||
},
|
||||
];
|
||||
if (issue.code === "invalid_value")
|
||||
return [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user