mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 04:01:56 +00:00
Add session export to HTML, improve tool error handling, and enhance RPC mode documentation
This commit is contained in:
parent
68092ccf01
commit
9e3e319f1a
9 changed files with 638 additions and 63 deletions
|
|
@ -163,10 +163,7 @@ export const editTool: AgentTool<typeof editSchema> = {
|
|||
if (signal) {
|
||||
signal.removeEventListener("abort", onAbort);
|
||||
}
|
||||
resolve({
|
||||
content: [{ type: "text", text: `Error: File not found: ${path}` }],
|
||||
details: undefined,
|
||||
});
|
||||
reject(new Error(`File not found: ${path}`));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -188,15 +185,11 @@ export const editTool: AgentTool<typeof editSchema> = {
|
|||
if (signal) {
|
||||
signal.removeEventListener("abort", onAbort);
|
||||
}
|
||||
resolve({
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: `Error: Could not find the exact text in ${path}. The old text must match exactly including all whitespace and newlines.`,
|
||||
},
|
||||
],
|
||||
details: undefined,
|
||||
});
|
||||
reject(
|
||||
new Error(
|
||||
`Could not find the exact text in ${path}. The old text must match exactly including all whitespace and newlines.`,
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -207,15 +200,11 @@ export const editTool: AgentTool<typeof editSchema> = {
|
|||
if (signal) {
|
||||
signal.removeEventListener("abort", onAbort);
|
||||
}
|
||||
resolve({
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: `Error: Found ${occurrences} occurrences of the text in ${path}. The text must be unique. Please provide more context to make it unique.`,
|
||||
},
|
||||
],
|
||||
details: undefined,
|
||||
});
|
||||
reject(
|
||||
new Error(
|
||||
`Found ${occurrences} occurrences of the text in ${path}. The text must be unique. Please provide more context to make it unique.`,
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue