This commit is contained in:
Dax Raad
2025-06-11 18:19:15 -04:00
parent 3c82fb6818
commit 468cec545a
7 changed files with 84 additions and 52 deletions

View File

@@ -11,7 +11,6 @@ export const GrepTool = Tool.define({
parameters: z.object({
pattern: z
.string()
.nullable()
.describe("The regex pattern to search for in file contents"),
path: z
.string()
@@ -52,7 +51,7 @@ export const GrepTool = Tool.define({
if (exitCode === 1) {
return {
metadata: { matches: 0, truncated: false },
metadata: { matches: 0, truncated: false, title: params.pattern },
output: "No files found",
}
}
@@ -94,7 +93,7 @@ export const GrepTool = Tool.define({
if (finalMatches.length === 0) {
return {
metadata: { matches: 0, truncated: false },
metadata: { matches: 0, truncated: false, title: params.pattern },
output: "No files found",
}
}

View File

@@ -34,7 +34,7 @@ export const TodoWriteTool = Tool.define({
return {
output: JSON.stringify(params.todos, null, 2),
metadata: {
title: `${params.todos.length} todos`,
title: `${params.todos.filter((x) => x.status !== "completed").length} todos`,
todos: params.todos,
},
}
@@ -50,7 +50,7 @@ export const TodoReadTool = Tool.define({
return {
metadata: {
todos,
title: ``,
title: `${todos.filter((x) => x.status !== "completed").length} todos`,
},
output: JSON.stringify(todos, null, 2),
}