feat(setup): add native Pi client support (#1376)
* feat(setup): add native Pi client support * fix(setup): isolate invalid Pi agent directory overrides Keep malformed Pi path evidence on its client entry so unrelated selected clients can complete setup and doctor. Preserve explicit Pi rejection and block filesystem operations rather than falling back to another directory. * fix(setup): parse Pi configuration as strict JSON Pi's installed MCP loader reads mcp.json with a bare JSON.parse and no BOM tolerance, so comments, trailing commas, a BOM, or an empty existing file yield loader errors and no servers. Parsing the Pi dialect with objectSchema.parse(JSON.parse(text)) before the shared empty/JSONC shortcut rejects those files at every mutation boundary instead of reporting configured registrations Pi cannot load. A missing file still initializes a fresh strict-JSON document, other dialects keep their JSONC/BOM/empty tolerance, and malformed files are never rewritten. --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
co-authored by
morluto
parent
f970b886aa
commit
9e22da845b
@@ -80,6 +80,16 @@ export const readClientRegistrationStatuses = async (
|
||||
options.platform,
|
||||
options.environment,
|
||||
)) {
|
||||
if (client.configPathError !== undefined) {
|
||||
statuses.push({
|
||||
client: client.name,
|
||||
config_path: client.configPath,
|
||||
command: [],
|
||||
state: "invalid",
|
||||
remediation: client.configPathError,
|
||||
});
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
!(await exists(client.markerPath)) &&
|
||||
!(await exists(client.configPath))
|
||||
@@ -166,9 +176,9 @@ const registrationAligned = (
|
||||
)
|
||||
return false;
|
||||
if (client.format === "vscode" && registration.type !== "stdio") return false;
|
||||
// OMP infers stdio for a command entry without an explicit type.
|
||||
// OMP and Pi infer stdio for a command entry without an explicit type.
|
||||
if (
|
||||
client.format === "omp" &&
|
||||
(client.format === "omp" || client.format === "pi") &&
|
||||
registration.type !== undefined &&
|
||||
registration.type !== "stdio"
|
||||
)
|
||||
@@ -230,7 +240,7 @@ const parseRegistration = (
|
||||
if (client.format === "commandcode" && registration.transport !== "stdio")
|
||||
throw new TypeError("Expected an stdio registration");
|
||||
if (
|
||||
client.format === "omp" &&
|
||||
(client.format === "omp" || client.format === "pi") &&
|
||||
registration.type !== undefined &&
|
||||
registration.type !== "stdio"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user