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

Function get

packages/agent-core/test/session/init.test.ts:759–775  ·  view source on GitHub ↗
(target, prop, receiver)

Source from the content-addressed store, hash-verified

757function wrapReadTextWithError(inner: Kaos, cause: Error): Kaos {
758 return new Proxy(inner, {
759 get(target, prop, receiver) {
760 if (prop === 'readText') {
761 return async () => {
762 throw cause;
763 };
764 }
765 if (prop === 'readLines') {
766 return async function* () {
767 yield* [];
768 throw cause;
769 };
770 }
771 if (prop === 'withCwd') {
772 return (cwd: string) => wrapReadTextWithError(target.withCwd(cwd), cause);
773 }
774 return Reflect.get(target, prop, receiver);
775 },
776 });
777}

Callers

nothing calls this directly

Calls 3

wrapReadTextWithErrorFunction · 0.85
withCwdMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected