mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-09 18:04:55 +00:00
* feat(providers): add fx as an opt-in bundled ACP provider fx ships a native ACP server, so it follows the catalog opt-in shape of the other bundled ACP provider and needs no vendor protocol code. fx files its provider selector first under ACP's "model" category, then the model, Fast, and Ultrafast. The ACP adapter took the first option in that category as the model, so the model picker listed fx's providers. It now prefers the option with id "model" and keeps the rest as settings. * fix(providers): keep the chosen model across ACP provider changes fx's provider option also selects that provider's saved model. Paseo applied the model before the option, so a new agent lost the requested model. It also kept the old model as the agent's preference after a switch, and reopening the agent sent that model to the new connection. Apply opening configuration in the order the agent lists its options, and store the model an option moved the session to.
27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
import type { AcpToolCallSnapshot, AcpTransformer } from "@getpaseo/plugin/server/acp";
|
|
|
|
type ToolInput = AcpToolCallSnapshot["input"];
|
|
|
|
// fx names its file arguments for the model (`path`, `old_string`), so its file tools need the
|
|
// argument names Paseo's edit rows read. The adapter reapplies this to each update of a call.
|
|
export const fileToolTransformer: AcpTransformer = {
|
|
toolCall(toolCall) {
|
|
const input = toEditRowInput(toolCall.name, toolCall.input);
|
|
return input ? { ...toolCall, input } : toolCall;
|
|
},
|
|
};
|
|
|
|
function toEditRowInput(tool: string | undefined, input: ToolInput): ToolInput | null {
|
|
if (typeof input !== "object" || input === null || Array.isArray(input)) return null;
|
|
if (typeof input.path !== "string") return null;
|
|
if (tool === "write_file") return { filePath: input.path, newString: input.content ?? null };
|
|
if (tool === "edit_file") {
|
|
return {
|
|
filePath: input.path,
|
|
oldString: input.old_string ?? null,
|
|
newString: input.new_string ?? null,
|
|
};
|
|
}
|
|
return null;
|
|
}
|