fix(mcp): emit portable Unicode NUL patterns (#1230)
Preserve NUL rejection while avoiding the short escape rejected by strict schema consumers. Guard the entire advertised input/output catalog and all three JavaScript regexp modes. Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
This commit is contained in:
@@ -5,7 +5,7 @@ const hexSchema = z.string().regex(/^0x[0-9a-f]+$/u);
|
||||
const nativeString = z
|
||||
.string()
|
||||
.regex(
|
||||
/^[^\0]*$/u,
|
||||
/^[^\u0000]*$/u,
|
||||
"Native launch and breakpoint strings cannot contain NUL",
|
||||
);
|
||||
/** Objective-C class names and selectors never contain spaces or brackets. */
|
||||
@@ -61,8 +61,10 @@ export const nativeCallObservationInputSchema = z.strictObject({
|
||||
z
|
||||
.string()
|
||||
.min(1)
|
||||
.regex(/^[^=\0]+$/u, "Environment names cannot contain '=' or NUL"),
|
||||
z.string().regex(/^[^\0]*$/u, "Environment values cannot contain NUL"),
|
||||
.regex(/^[^=\u0000]+$/u, "Environment names cannot contain '=' or NUL"),
|
||||
z
|
||||
.string()
|
||||
.regex(/^[^\u0000]*$/u, "Environment values cannot contain NUL"),
|
||||
)
|
||||
.default({})
|
||||
.describe("Overrides on top of the environment REA runs with."),
|
||||
|
||||
Reference in New Issue
Block a user