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

Function get

packages/agent-core/test/harness/runtime.test.ts:61–80  ·  view source on GitHub ↗
(target, prop, receiver)

Source from the content-addressed store, hash-verified

59function createLocalTomlFailingKaos(base: Kaos): Kaos {
60 return new Proxy(base, {
61 get(target, prop, receiver) {
62 if (prop === 'readText') {
63 return (
64 path: string,
65 options?: { encoding?: BufferEncoding; errors?: 'strict' | 'replace' | 'ignore' },
66 ) => {
67 if (String(path).endsWith('local.toml')) {
68 return Promise.reject(
69 new Error(`acp: readTextFile failed for ${path}: unknown session (issue #988)`),
70 );
71 }
72 return target.readText(path, options);
73 };
74 }
75 if (prop === 'withCwd') {
76 return (cwd: string) => createLocalTomlFailingKaos(target.withCwd(cwd));
77 }
78 const value = Reflect.get(target, prop, receiver);
79 return typeof value === 'function' ? (value as (...args: unknown[]) => unknown).bind(target) : value;
80 },
81 });
82}
83

Callers

nothing calls this directly

Calls 5

rejectMethod · 0.65
readTextMethod · 0.65
withCwdMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected