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

Function readRequiredSource

packages/agent-core/src/profile/load.ts:98–105  ·  view source on GitHub ↗
(sources: Readonly<Record<string, string>>, path: string)

Source from the content-addressed store, hash-verified

96}
97
98function readRequiredSource(sources: Readonly<Record<string, string>>, path: string): string {
99 const normalized = normalizeSourcePath(path);
100 const content = sources[normalized];
101 if (content === undefined) {
102 throw new Error(`Embedded agent profile source missing: ${normalized}`);
103 }
104 return content;
105}
106
107function normalizeSourcePath(path: string): string {
108 return normalize(path.replaceAll('\\', '/')).replace(/^\.\//, '');

Callers 2

Calls 1

normalizeSourcePathFunction · 0.85

Tested by

no test coverage detected