Add tasks: the crew's shared to-do list

Bots and workspaces each keep a list of work tracked until it's done, and
the bots move it along themselves as they work.

- tasks (one collection per bot or per workspace), task_notes (the
  progress log) and task_media (a deliverable or a reference file, its
  bytes a private media row served at /media/private/<id>)
- statuses todo/doing/blocked/done/cancelled, with blocked_reason while
  only the user can unblock it
- visibility as SQL in src/utils/task-access: a user's own bots and
  workspaces, a run's own list plus its workspaces, everything for the
  coordinator; every tool and endpoint resolves through it
- list_tasks, create_task and update_task on every run, so a chat reply,
  a task and a routine all read the list, log progress and file what they
  produced
- TasksNote on every run and TaskReminderNote in chat, so a greeting or a
  proposed next step brings pending work up in one measured line
- tasks group on the workspace dashboard and a tasks modal in the
  conversation header, sharing one form, row and detail panel
- a bot's or workspace's own chat uploads are read before the delete so
  none are stranded; bot files keep their folder

Also corrects the README's RAM guidance and table alignment.
This commit is contained in:
2026-10-22 05:57:50 +01:00
parent 2d108b05bf
commit 7cb26c4e36
60 changed files with 3793 additions and 52 deletions
+4
View File
@@ -46,4 +46,8 @@ export const MediaParadigms = [
title: "Bot File",
value: "bot-file",
},
{
title: "Task Media",
value: "task-media",
},
] as const;
+95
View File
@@ -0,0 +1,95 @@
/**
* A task's status. Tasks are the crew's shared to-do list, one per bot and
* one per workspace, and every move through this list is a step in the
* work: `blocked` is what a bot (or the user) sets when only the user can
* unblock it, and `done` is only ever set once the work was verified.
*/
export const TaskStatuses = [
{
title: "To do",
value: "todo",
},
{
title: "Doing",
value: "doing",
},
{
title: "Blocked",
value: "blocked",
},
{
title: "Done",
value: "done",
},
{
title: "Cancelled",
value: "cancelled",
},
] as const;
export type TaskStatus = (typeof TaskStatuses)[number]["value"];
/**
* The statuses a task still needs work in: what a reminder may name and
* what a digest shows.
*/
export const OpenTaskStatuses = ["todo", "doing", "blocked"] as const;
/**
* Every status as a zod-friendly tuple of its values.
*/
export const TaskStatusValues = TaskStatuses.map((status) => status.value) as unknown as [
TaskStatus,
...TaskStatus[],
];
export type OpenTaskStatus = (typeof OpenTaskStatuses)[number];
/**
* Who created a task: the user by hand, or a bot with its tool.
*/
export const TaskOrigins = [
{
title: "User",
value: "user",
},
{
title: "Bot",
value: "bot",
},
] as const;
export type TaskOrigin = (typeof TaskOrigins)[number]["value"];
/**
* Who wrote a note on a task. The same values as a message's authors.
*/
export const TaskAuthors = [
{
title: "User",
value: "user",
},
{
title: "Bot",
value: "bot",
},
] as const;
export type TaskAuthor = (typeof TaskAuthors)[number]["value"];
/**
* What a file linked to a task is for: the thing the task produced
* (`deliverable`), or something it needs to do the work (`reference`).
*/
export const TaskMediaKinds = [
{
title: "Deliverable",
value: "deliverable",
},
{
title: "Reference",
value: "reference",
},
] as const;
export type TaskMediaKind = (typeof TaskMediaKinds)[number]["value"];