feat(coding-agent): add provider payload hook

This commit is contained in:
Mario Zechner
2026-03-07 14:23:25 +01:00
parent e3adaf1bd9
commit a3f05423d9
20 changed files with 157 additions and 32 deletions

View File

@@ -0,0 +1,14 @@
import { appendFileSync } from "node:fs";
import { join } from "node:path";
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
export default function (pi: ExtensionAPI) {
const logFile = join(process.cwd(), ".pi", "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 };
});
}