Files
paseo/plugin-examples/provider-acp-transformer/server/vendor-edit.ts
T
Mohamed Boudra 35d2457d83 Let plugins provide coding agents (#4314)
Allow trusted local plugins to register complete coding-agent providers through the existing agent lifecycle. Includes direct and ACP implementations, SVG provider icons, custom timeline items, runnable examples, and public authoring documentation.

Closes #3547
Closes #3556
2026-09-04 19:56:57 +02:00

26 lines
645 B
TypeScript

import type { AcpTransformer } from "@getpaseo/plugin/acp";
import { z } from "zod";
const vendorEditInputSchema = z.object({
path: z.string(),
before: z.string(),
after: z.string(),
});
export const vendorEditTransformer: AcpTransformer = {
toolCall(toolCall) {
if (toolCall.name !== "vendor_file_edit") return toolCall;
const input = vendorEditInputSchema.safeParse(toolCall.input);
if (!input.success) return toolCall;
return {
...toolCall,
kind: "edit",
input: {
filePath: input.data.path,
oldString: input.data.before,
newString: input.data.after,
},
};
},
};