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
+15 -2
View File
@@ -1,5 +1,6 @@
import type { BUN_SQLITE_COBBLE_COMPUTERS } from "@/db/types/db";
import type { HarnessTool } from "../../types";
import grabBotTaskTools from "./tasks/grab-bot-task-tools";
import createScheduleTool from "./create-schedule-tool";
import deleteScheduleTool from "./delete-schedule-tool";
import listSchedulesTool from "./list-schedules-tool";
@@ -25,6 +26,11 @@ type Params = {
* The session being answered, so the bot can react to its messages.
*/
session_id?: number | string;
/**
* Whether the run is the coordinator, which reaches every task and can
* add to any bot's or workspace's list.
*/
is_coordinator?: boolean;
};
/**
@@ -32,13 +38,14 @@ type Params = {
* works: its memory and instructions, its schedules, and in a workspace
* with several computers switching the default one.
*/
export default function grabBotTools({
export default async function grabBotTools({
user_id,
bot_id,
workspace_id,
computers = [],
session_id,
}: Params): HarnessTool[] {
is_coordinator,
}: Params): Promise<HarnessTool[]> {
return [
updateMemoryTool({ user_id, bot_id, workspace_id }),
updateInstructionsTool({ user_id, bot_id, workspace_id }),
@@ -50,5 +57,11 @@ export default function grabBotTools({
...(workspace_id && computers.length > 1
? [setWorkspaceComputerTool({ user_id, workspace_id, computers })]
: []),
...(await grabBotTaskTools({
user_id,
bot_id,
is_coordinator: Boolean(is_coordinator),
workspace_id,
})),
];
}