MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / resolveDeps

Function resolveDeps

apps/kimi-code/src/cli/sub/doctor.ts:115–135  ·  view source on GitHub ↗
(deps: Partial<DoctorDeps> | DoctorDeps | undefined)

Source from the content-addressed store, hash-verified

113}
114
115function resolveDeps(deps: Partial<DoctorDeps> | DoctorDeps | undefined): ResolvedDoctorDeps {
116 let configRpc = deps?.configRpc;
117 const getConfigRpc = (): KimiConfigRpc => {
118 configRpc ??= createKimiConfigRpc();
119 return configRpc;
120 };
121
122 return {
123 cwd: deps?.cwd ?? (() => process.cwd()),
124 defaultConfigPath: deps?.defaultConfigPath ?? (() => getConfigRpc().resolveConfigPath()),
125 defaultTuiConfigPath: deps?.defaultTuiConfigPath ?? getTuiConfigPath,
126 stdout: deps?.stdout ?? process.stdout,
127 stderr: deps?.stderr ?? process.stderr,
128 exit: deps?.exit ?? ((code) => process.exit(code)),
129 fileExists: deps?.fileExists ?? existsSync,
130 readTextFile: deps?.readTextFile ?? ((path) => readFile(path, 'utf-8')),
131 validateConfigToml:
132 deps?.validateConfigToml ??
133 ((text, filePath) => getConfigRpc().validateConfigToml({ text, filePath })),
134 };
135}
136
137async function buildCheckSpecs(
138 deps: ResolvedDoctorDeps,

Callers 2

handleDoctorFunction · 0.70
runDoctorCommandFunction · 0.70

Calls 6

getConfigRpcFunction · 0.85
cwdMethod · 0.80
resolveConfigPathMethod · 0.65
exitMethod · 0.65
validateConfigTomlMethod · 0.65
readFileFunction · 0.50

Tested by

no test coverage detected