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

Function checkTomlFile

apps/kimi-code/src/cli/sub/doctor.ts:193–217  ·  view source on GitHub ↗
(deps: ResolvedDoctorDeps, spec: CheckSpec)

Source from the content-addressed store, hash-verified

191}
192
193async function checkTomlFile(deps: ResolvedDoctorDeps, spec: CheckSpec): Promise<CheckResult> {
194 if (!deps.fileExists(spec.path)) {
195 return {
196 label: spec.label,
197 path: spec.path,
198 status: spec.explicit ? 'ERROR' : 'SKIP',
199 message: spec.explicit
200 ? 'File does not exist.'
201 : 'File does not exist; built-in defaults will apply.',
202 };
203 }
204
205 try {
206 const text = await deps.readTextFile(spec.path);
207 await spec.parse(text, spec.path);
208 return { label: spec.label, path: spec.path, status: 'OK' };
209 } catch (error) {
210 return {
211 label: spec.label,
212 path: spec.path,
213 status: 'ERROR',
214 message: formatErrorMessage(error, spec.path),
215 };
216 }
217}
218
219async function resolveConfigTargetPath(
220 deps: ResolvedDoctorDeps,

Callers 1

handleDoctorFunction · 0.85

Calls 2

formatErrorMessageFunction · 0.70
readTextFileMethod · 0.45

Tested by

no test coverage detected