Something went wrong. Try again.
fork of prime agent with changes i want but are not upstreamable probqbly (and some fixes)
Something went wrong. Try again.
671 B · 18 lines
TypeScript
at main
12345678910111213141516171819import { appendFileSync } from "node:fs";import { join } from "node:path";import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
export default function (pi: ExtensionAPI) { const logFile = join(process.cwd(), ".prime", "agent", "provider-payload.log");
pi.on("before_provider_request", (event) => { appendFileSync(logFile, `${JSON.stringify(event.payload, null, 2)}\n\n`, "utf8");
// Optional: replace the payload instead of only logging it. // return { ...event.payload, temperature: 0 }; });
pi.on("after_provider_response", (event) => { appendFileSync(logFile, `[${event.status}] ${JSON.stringify(event.headers)}\n\n`, "utf8"); });}