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
+53
View File
@@ -9,6 +9,9 @@ import type {
BUN_SQLITE_COBBLE_COMPUTERS,
BUN_SQLITE_COBBLE_CRON_JOBS,
BUN_SQLITE_COBBLE_MEDIA,
BUN_SQLITE_COBBLE_TASK_MEDIA,
BUN_SQLITE_COBBLE_TASK_NOTES,
BUN_SQLITE_COBBLE_TASKS,
BUN_SQLITE_COBBLE_USER_TYPES,
BUN_SQLITE_COBBLE_USERS,
BUN_SQLITE_COBBLE_WORKSPACES,
@@ -84,6 +87,52 @@ export type CronJobWithNames = BUN_SQLITE_COBBLE_CRON_JOBS & {
workspace_name?: string | null;
};
/**
* A task with what a list shows beside it: the bot and workspace it belongs
* to, and its latest note.
*/
export type TaskWithNames = BUN_SQLITE_COBBLE_TASKS & {
bot_name?: string | null;
bot_kind?: string | null;
bot_hue?: string | null;
bot_face?: string | null;
bot_image_media_id?: number | null;
workspace_name?: string | null;
/**
* Its newest note's text, for the row's second line.
*/
latest_note?: string | null;
/**
* How many files it carries.
*/
media_count?: number | null;
};
/**
* A file linked to a task, joined with the `media` row it's served from.
*/
export type TaskFile = BUN_SQLITE_COBBLE_TASK_MEDIA & {
media_type?: string | null;
mime_type?: string | null;
/**
* The `media` row's title, when the link has no name of its own.
*/
media_title?: string | null;
/**
* Whether the `media` row is still there.
*/
missing?: boolean;
};
/**
* A task with its notes and files: what the task modal and the workspace's
* tasks group render.
*/
export type TaskDetail = TaskWithNames & {
notes: BUN_SQLITE_COBBLE_TASK_NOTES[];
files: TaskFile[];
};
/**
* A session in a conversation's sessions modal.
*/
@@ -810,6 +859,10 @@ export type PagePropsType = {
* A workspace's dashboard: the user's latest sessions there.
*/
workspace_activity?: WorkspaceActivityItem[] | null;
/**
* A workspace's dashboard: its shared to-do list.
*/
workspace_tasks?: TaskWithNames[] | null;
/**
* The computer a settings page manages, with its access.
*/