Files
IdeaSDK/examples/cline-ai-plugin/tests/helpers/adapter-child.mjs
2026-11-19 16:30:49 +01:00

15 lines
565 B
JavaScript

import { fakeProvider } from "./fake-provider.mjs";
import { runAdapter } from "../../src/adapter.mjs";
globalThis.fetch = async () => { throw new Error("live network is forbidden in child QA"); };
const provider = fakeProvider({ text: process.argv[3] });
await runAdapter({
input: process.stdin, output: process.stdout, storageRoot: process.argv[2],
fetch: async (...args) => {
const response = await provider.fetch(...args);
process.send?.({ kind: "providerCall", call: provider.calls.at(-1) });
return response;
},
});
process.disconnect?.();