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

Function readAgentFile

packages/agent-core/src/profile/context.ts:163–168  ·  view source on GitHub ↗
(kaos: Kaos, path: string)

Source from the content-addressed store, hash-verified

161}
162
163async function readAgentFile(kaos: Kaos, path: string): Promise<AgentFile | undefined> {
164 if (!(await isFile(kaos, path))) return undefined;
165 const content = (await kaos.readText(path, { errors: 'ignore' })).trim();
166 if (content.length === 0) return undefined;
167 return { path, content };
168}
169
170async function pathExists(kaos: Kaos, path: string): Promise<boolean> {
171 try {

Callers 1

collectFunction · 0.85

Calls 2

isFileFunction · 0.70
readTextMethod · 0.65

Tested by

no test coverage detected