Rename task widget to todos
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user