Todo list plugin for GUIChat
npm install @gui-chat-plugin/todo
Todo list plugin for GUI Chat applications. Manage tasks with a persistent todo list that syncs via localStorage.
- Add, update, and delete todo items
- Mark tasks as completed/uncompleted
- Clear all completed items at once
- Persistent storage via localStorage
- Inline text editing capability
``bash`
yarn add @gui-chat-plugin/todo
`typescript
// In src/tools/index.ts
import TodoPlugin from "@gui-chat-plugin/todo/vue";
const pluginList = [
// ... other plugins
TodoPlugin,
];
// In src/main.ts
import "@gui-chat-plugin/todo/style.css";
`
`typescript
import { executeTodo, TOOL_DEFINITION } from "@gui-chat-plugin/todo";
// Show the todo list
const result = await executeTodo(context, {
action: "show",
});
// Add a new item
const result = await executeTodo(context, {
action: "add",
text: "Buy groceries",
});
`
`typescript`
interface TodoArgs {
action: "show" | "add" | "toggle" | "delete" | "clear_completed" | "update";
text?: string; // For add/update actions
itemId?: string; // For toggle/delete/update actions
}
`typescript`
interface TodoItem {
id: string;
text: string;
completed: boolean;
createdAt: number;
}
`bashInstall dependencies
yarn install
Try these prompts to test the plugin:
1. "Show me my todo list"
2. "Add 'Buy groceries' to my todo list"
3. "I finished shopping, mark the groceries task as done"
MIT