Merge pull request #1299 from morluto/fix/schema-patterns-without-lookaround
fix(mcp): advertise input patterns without look-around
This commit is contained in:
@@ -19,9 +19,13 @@ import {
|
||||
deriveFindings,
|
||||
} from "./dylibResolutionFindings.js";
|
||||
|
||||
/** Normalized path below the analyzed root: no `.`/`..` or empty segments. */
|
||||
/**
|
||||
* Normalized path below the analyzed root: nonempty segments joined by single
|
||||
* `/`, none of them `.` or `..`, without backslash or NUL. Advertised schema
|
||||
* patterns avoid look-around, which RE2 and Rust validators reject.
|
||||
*/
|
||||
const ROOT_RELATIVE_PATH =
|
||||
/^(?!\/)(?!(?:.*\/)?\.{1,2}(?:\/|$))(?!.*\/\/)(?!.*\/$)[^\\\u0000]+$/u;
|
||||
/^(?:[^\x2f\\\u0000.][^\x2f\\\u0000]*|\.[^\x2f\\\u0000.][^\x2f\\\u0000]*|\.\.[^\x2f\\\u0000]+)(?:\x2f(?:[^\x2f\\\u0000.][^\x2f\\\u0000]*|\.[^\x2f\\\u0000.][^\x2f\\\u0000]*|\.\.[^\x2f\\\u0000]+))*$/u;
|
||||
const rootRelativePathSchema = z
|
||||
.string()
|
||||
.min(1)
|
||||
|
||||
Reference in New Issue
Block a user