mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-24 10:12:44 +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
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { vendorEditTransformer } from "./vendor-edit.js";
|
|
|
|
describe("vendorEditTransformer", () => {
|
|
it("normalizes only the vendor edit payload", () => {
|
|
const transformed = vendorEditTransformer.toolCall?.(
|
|
{
|
|
id: "edit-1",
|
|
name: "vendor_file_edit",
|
|
title: "Edit file",
|
|
status: "completed",
|
|
input: { path: "src/app.ts", before: "old", after: "new" },
|
|
output: null,
|
|
locations: [],
|
|
},
|
|
{ sessionId: "session-1" },
|
|
);
|
|
|
|
expect(transformed).toMatchObject({
|
|
kind: "edit",
|
|
input: { filePath: "src/app.ts", oldString: "old", newString: "new" },
|
|
});
|
|
});
|
|
|
|
it("preserves a vendor edit with a malformed payload", () => {
|
|
const toolCall = {
|
|
id: "edit-1",
|
|
name: "vendor_file_edit",
|
|
title: "Edit file",
|
|
status: "completed" as const,
|
|
input: { path: "src/app.ts", before: "old" },
|
|
output: null,
|
|
locations: [],
|
|
};
|
|
|
|
const transformed = vendorEditTransformer.toolCall?.(toolCall, {
|
|
sessionId: "session-1",
|
|
});
|
|
|
|
expect(transformed).toBe(toolCall);
|
|
});
|
|
});
|