Skip to content

Repository files navigation

@gui-chat-plugin/todo

npm version

Todo list plugin for GUI Chat applications. Manage tasks with a persistent todo list that syncs via localStorage.

Features

  • 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

Installation

yarn add @gui-chat-plugin/todo gui-chat-protocol

gui-chat-protocol is a peer dependency — install it alongside the plugin; the host application provides the runtime and this plugin only declares the compatible range.

Usage

Vue Integration

// 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";

Core-only Usage

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",
});

API

TodoArgs

interface TodoArgs {
  action: "show" | "add" | "toggle" | "delete" | "clear_completed" | "update";
  text?: string;     // For add/update actions
  itemId?: string;   // For toggle/delete/update actions
}

TodoItem

interface TodoItem {
  id: string;
  text: string;
  completed: boolean;
  createdAt: number;
}

Development

# Install dependencies
yarn install

# Run demo
yarn dev

# Build
yarn build

# Lint
yarn lint

Test Prompts

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"

License

MIT

Related

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages