* feat(setup): add Kimi Code client support Registers rea in ~/.kimi-code/mcp.json (or $KIMI_CODE_HOME/mcp.json), preserving unrelated settings with a .rea.backup; registration is command-based stdio with no type field, startupTimeoutMs 30000 and toolTimeoutMs 120000 from MCP_STARTUP_POLICY. Strict JSON parsing: empty or whitespace-only files initialize; malformed JSON is rejected untouched with no backup; explicit transport other than stdio reports invalid. Bundled skill uses the shared ~/.agents/skills destination that Kimi Code discovers, installed and verified through the shared-skill flow. Validated by 19 Kimi-specific tests, 260 adjacent-client regressions passing, check:fast and docs:check, and real-client verification on Kimi Code 0.40.1 (173 tools discovered, real mcp__rea__analyze_javascript_application call succeeded). * fix(setup): preserve Kimi tool filters and strict JSON coverage --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
import { vi } from "vitest";
|
|
|
|
import { PRODUCT_IDENTITY } from "../../src/identity.js";
|
|
|
|
/** The default npx registration command setup writes on POSIX hosts. */
|
|
export const NPX_REGISTRATION_COMMAND = [
|
|
"npx",
|
|
"-y",
|
|
PRODUCT_IDENTITY.registrationPackageSpecifier,
|
|
"mcp",
|
|
] as const;
|
|
|
|
/** Environment variables that redirect where supported clients keep config. */
|
|
export const CLIENT_LOCATION_ENVIRONMENT = [
|
|
"APPDATA",
|
|
"CLAUDE_CONFIG_DIR",
|
|
"CODEX_HOME",
|
|
"DSH_HOME",
|
|
"DSH_AGENTS_HOME",
|
|
"COPILOT_HOME",
|
|
"GROK_HOME",
|
|
"GEMINI_CLI_HOME",
|
|
"GEMINI_CLI_TRUST_WORKSPACE",
|
|
"GEMINI_RESTRICTED_MODE",
|
|
"GEMINI_CLI_TRUSTED_FOLDERS_PATH",
|
|
"GEMINI_CLI_SYSTEM_SETTINGS_PATH",
|
|
"GEMINI_CLI_SYSTEM_DEFAULTS_PATH",
|
|
"HERMES_DATA_DIR_SUFFIX",
|
|
"HERMES_HOME",
|
|
"KIMI_CODE_HOME",
|
|
"LOCALAPPDATA",
|
|
"OMP_PROFILE",
|
|
"OPENCODE_CONFIG",
|
|
"OPENCODE_CONFIG_DIR",
|
|
"PI_CODING_AGENT_DIR",
|
|
"PI_CONFIG_DIR",
|
|
"PI_PROFILE",
|
|
"QODER_CONFIG_DIR",
|
|
"QWEN_HOME",
|
|
"SAND_DATA_ROOT",
|
|
"XDG_CONFIG_HOME",
|
|
] as const;
|
|
|
|
/** Clear the developer's client locations so tests resolve only their temporary homes. */
|
|
export const clearClientLocationEnvironment = (): void => {
|
|
for (const name of CLIENT_LOCATION_ENVIRONMENT) vi.stubEnv(name, undefined);
|
|
};
|