feat(setup): register OMP during setup (#1301)
* feat(setup): register OMP during setup Add OMP (oh-my-pi) as a setup, doctor and uninstall client. Setup writes a type: stdio entry to the user-level agent mcp.json that OMP reads, following PI_CONFIG_DIR, an absolute PI_CODING_AGENT_DIR and the OMP_PROFILE/PI_PROFILE named profile. It removes rea from OMP's disabledServers denylist, which would otherwise hide the registration, and doctor reports a listed registration as stale. Closes #1257 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(setup): honor OMP's enabledServers allowlist in doctor OMP's user enabledServers allowlist forces an entry with enabled: false on, unless disabledServers also lists it. Doctor reported such a working registration as stale. Also format the FAQ client list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(setup): keep OMP's allowlisted entry in update maintenance rea update skipped an owned OMP entry with enabled: false even when OMP's enabledServers allowlist runs it. Apply the same forced-enable rule as doctor. Share the client-location environment reset across the client tests instead of repeating it in each file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
24673aaae4
commit
8b4c359135
@@ -1037,6 +1037,47 @@ export const grokServerListedDisabled = (
|
||||
Array.isArray(document.disabled_mcp_servers) &&
|
||||
document.disabled_mcp_servers.includes(serverKey);
|
||||
|
||||
/**
|
||||
* OMP's user `disabledServers` denylist hides a server by name regardless of
|
||||
* its entry, so a listed REA registration is not loaded.
|
||||
*/
|
||||
export const OMP_DISABLED_SERVERS_KEY = "disabledServers";
|
||||
|
||||
/** Whether OMP's root `disabledServers` denylist names `serverKey`. */
|
||||
export const ompServerListedDisabled = (
|
||||
document: Record<string, unknown>,
|
||||
serverKey: string,
|
||||
): boolean => {
|
||||
const listed = document[OMP_DISABLED_SERVERS_KEY];
|
||||
return Array.isArray(listed) && listed.includes(serverKey);
|
||||
};
|
||||
|
||||
/** OMP's user `enabledServers` allowlist overrides an entry's `enabled: false`. */
|
||||
const OMP_ENABLED_SERVERS_KEY = "enabledServers";
|
||||
|
||||
/**
|
||||
* Whether OMP's allowlist forces `serverKey` on despite its entry's
|
||||
* `enabled: false`. The `disabledServers` denylist still wins over it.
|
||||
*/
|
||||
export const clientServerForcedEnabled = (
|
||||
parsed: ClientConfigurationDocument,
|
||||
serverKey: string,
|
||||
): boolean => {
|
||||
if (parsed.dialect !== "omp") return false;
|
||||
const listed = parsed.document[OMP_ENABLED_SERVERS_KEY];
|
||||
return Array.isArray(listed) && listed.includes(serverKey);
|
||||
};
|
||||
|
||||
/** Whether a client's own disable list suppresses `serverKey`. */
|
||||
export const clientServerListedDisabled = (
|
||||
parsed: ClientConfigurationDocument,
|
||||
serverKey: string,
|
||||
): boolean =>
|
||||
(parsed.dialect === "grok" &&
|
||||
grokServerListedDisabled(parsed.document, serverKey)) ||
|
||||
(parsed.dialect === "omp" &&
|
||||
ompServerListedDisabled(parsed.document, serverKey));
|
||||
|
||||
/** Keep an existing Grok document intact aside from the REA server tables. */
|
||||
const serializeGrokConfiguration = (
|
||||
document: Record<string, unknown>,
|
||||
@@ -1289,6 +1330,7 @@ export const clientRegistrationEntry = (
|
||||
: { environment: { ...environment } }),
|
||||
};
|
||||
case "vscode":
|
||||
case "omp":
|
||||
return {
|
||||
type: "stdio",
|
||||
command: executable,
|
||||
|
||||
Reference in New Issue
Block a user