Rename task widget to todos

This commit is contained in:
jb
2026-08-26 16:40:05 -04:00
parent b654c3c81b
commit 1a437f50b4
6 changed files with 48 additions and 12 deletions
+32
View File
@@ -10,6 +10,38 @@ import {
} from "../src/prompt.ts";
import { TaskState } from "../src/state.ts";
test("registers the conflict-free /todo command", async () => {
type RegisteredCommand = {
description: string;
handler(args: string, ctx: unknown): Promise<void>;
};
const commands = new Map<string, RegisteredCommand>();
const pi = {
on() {},
registerTool() {},
registerCommand(name: string, command: RegisteredCommand) {
commands.set(name, command);
},
};
piTodoHerdr(pi as never);
assert.deepEqual([...commands.keys()], ["todo"]);
const todo = commands.get("todo");
assert.equal(todo?.description, "Show or hide the todo tree widget");
const notifications: string[] = [];
await todo?.handler("", {
ui: {
setWidget() {},
notify(message: string) {
notifications.push(message);
},
},
});
assert.deepEqual(notifications, ["No todos yet."]);
});
test("keeps task guidance short with planning after exploration", () => {
assert.equal(TASK_PROMPT_GUIDELINES.length, 2);
const prompt = TASK_PROMPT_GUIDELINES.join("\n");