refactor(mcp): make analysis states unrepresentable (#468)
* refactor(config): parse capability settings into exact states * refactor(runtime): encode replay and process outcomes exactly * refactor: make analysis states unrepresentable * refactor(mcp): register canonical schemas with SDK * fix: preserve capability and catalog invariants * fix(build): remove stale compiled modules * fix(replay): update real verifier policy dependency * fix(package): verify the complete MCP catalog * fix(test): supply complete replay reload policy * refactor(contracts): centralize output schema lookup * refactor(mcp): delegate protocol boundaries to SDK * fix(browser): approve real source capture * fix(mcp): preserve catalog guidance
This commit is contained in:
+13
-1
@@ -1,8 +1,8 @@
|
||||
import { z } from "zod";
|
||||
import { isAbsolute } from "node:path";
|
||||
|
||||
import { ConfigurationError } from "../domain/errors.js";
|
||||
import { err, ok, type Result } from "../domain/result.js";
|
||||
import {} from "../domain/browserObservation.js";
|
||||
import { electronFileRootsSchema } from "../domain/electronObservation.js";
|
||||
|
||||
export const parseStringArray = (
|
||||
@@ -29,6 +29,18 @@ export const parseStringArray = (
|
||||
}
|
||||
};
|
||||
|
||||
/** Parse a JSON string array whose members must all be absolute paths. */
|
||||
export const parseAbsoluteRoots = (
|
||||
encoded: string,
|
||||
name: string,
|
||||
): Result<readonly string[], ConfigurationError> => {
|
||||
const parsed = parseStringArray(encoded, name);
|
||||
if (!parsed.ok) return parsed;
|
||||
return parsed.value.some((root) => !isAbsolute(root))
|
||||
? err(new ConfigurationError(`${name} must encode absolute roots`))
|
||||
: parsed;
|
||||
};
|
||||
|
||||
export const parseBrowserArray = (
|
||||
encoded: string,
|
||||
name: string,
|
||||
|
||||
Reference in New Issue
Block a user