mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-06 08:24:46 +00:00
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
26 lines
645 B
TypeScript
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,
|
|
},
|
|
};
|
|
},
|
|
};
|