55ac653eaa
Override TodoWrite description via tool.definition hook to require WHERE/WHY/HOW/RESULT in each todo title and enforce 1-3 tool call granularity.
15 lines
369 B
TypeScript
15 lines
369 B
TypeScript
import { TODOWRITE_DESCRIPTION } from "./description"
|
|
|
|
export function createTodoDescriptionOverrideHook() {
|
|
return {
|
|
"tool.definition": async (
|
|
input: { toolID: string },
|
|
output: { description: string; parameters: unknown },
|
|
) => {
|
|
if (input.toolID === "todowrite") {
|
|
output.description = TODOWRITE_DESCRIPTION
|
|
}
|
|
},
|
|
}
|
|
}
|