# plugin-tasks

`@fayz-ai/plugin-tasks` · beta · Partial capability

Work happens between the records. A salon owner needs to "call the supplier," a clinic admin needs to "follow up on lab results" — small things that never fit neatly into a booking or an invoice. plugin-tasks gives every Fayz app a lightweight, always-available task list: a topbar button that opens a drawer for quick-add, statuses, priorities, due dates, labels, and assignees.

## Overview

Task management that cuts across any app. Unlike most plugins, `plugin-tasks` doesn't add a menu item: it mounts a button in the shell's top bar (the `shell.topbar.end` zone) that opens a task drawer from anywhere in the app, plus a tab in Settings.

It's the **full capability** of this group — data, UI and AI tool ship ready to use. It packages two migrations (`000_plg_rename` + `001_tasks_base`) with two tables of its own, `tsk_tasks` (subtasks via `parent_id`, status `todo`/`in_progress`/`done`/`cancelled`, priority `low`/`medium`/`high`/`urgent`, due date and labels) and `tsk_labels`. The Supabase provider falls back automatically to an in-memory mock provider when Supabase isn't configured.

For AI, it exposes the `getTasksSummary` tool (total, overdue, due today, by status and priority).

## When to use it

- You need a lightweight to-do available across the whole app, without spending a menu item on it.
- You want subtasks, priorities and color-coded labels without building them from scratch.
- You want the AI assistant to answer "what's overdue?" from real data.

## Specs

- **Package:** `@fayz-ai/plugin-tasks`
- **Version:** 0.1.7
- **Status:** beta
- **Capability:** Partial capability
- **Product type:** Management (Admin/SaaS)
- **Stable channel:** `^0.1.7`
- **Migrations:** 2 migration(s)
- **Factory:** `createTasksPlugin()`

## Data model

Convention: plg_ + tenant_id + RLS.

- `plg_tasks_labels` — name, color, is_active
- `plg_tasks_tasks` — title, description, status, priority, due_date, assigned_to_id

## AI tools

| id | mode | description |
| --- | --- | --- |
| `tasks.summary` | read | Returns a summary of pending tasks: total, overdue, due today, by status and priority. |

## Integrations

No hosted connector — external providers come in via the connector spine (`@fayz-ai/core`).

## Integrate

Add the plugin to surfaces.admin.plugins in your app's app.manifest.json and run the doctor to validate:

```json
{ "surfaces": { "admin": { "plugins": [ { "id": "tasks", "enabled": true } ] } } }
```

```bash
npx fayz doctor
```
