Add computer switching, crew reporting, job steps and markdown chat

- Bots have a current computer (bots.computer_id), switched from the chat
  header beside the model button or by clicking a computer the bot names
  ([computer:ID]); tasks run on it by default
- search_computers runs one read-only command on all of a bot's computers;
  chat replies know their computers (compose-computers-note)
- The coordinator can use every computer and grants or revokes crew access
  with assign_computer
- Delegated jobs record requested_by_bot_id; the worker's result or failure
  is reported back in the coordinator's conversation
- bots_queue_updates records each model turn of a job, pushed live and shown
  in the working-on panel
- Live relay: every process pushes new messages, job steps and bot changes
  from the database to its own sockets, so work done elsewhere shows live
- Bot messages render as markdown (react-markdown + remark-gfm, no raw HTML)
  with twui components; rail previews are plain text
- Fix header button overflow in the model and computer selects
- Bump @moduletrace/twui to 0.1.2

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-19 04:44:35 +01:00
co-authored by Claude Opus 5.5
parent 6a2665dae9
commit 7b580d782e
64 changed files with 1792 additions and 86 deletions
+63 -1
View File
@@ -15,7 +15,7 @@ import {
} from "@/src/dict/computer-dict";
import { Harnesses } from "@/src/dict/harness-dict";
import { HarnessProviderKinds } from "@/src/dict/harness-provider-dict";
import { BotJobKinds } from "@/src/dict/bot-queue-dict";
import { BotJobKinds, BotJobUpdateKinds } from "@/src/dict/bot-queue-dict";
import { AppData } from "@/src/data/app-data";
import type { BUN_SQLITE_DatabaseSchemaType } from "@moduletrace/bun-sqlite/types";
import { EnvParadigms } from "@/src/dict/env-dict";
@@ -272,6 +272,11 @@ const schema: BUN_SQLITE_DatabaseSchemaType = {
fieldDescription: `Unix timestamp of the latest message, for rail ordering`,
dataType: "INTEGER",
},
{
fieldName: "computer_id",
fieldDescription: `The computer the bot works on now. Not a foreign key: null, or a computer it lost access to, means its main one`,
dataType: "INTEGER",
},
],
indexes: [
{
@@ -448,6 +453,11 @@ const schema: BUN_SQLITE_DatabaseSchemaType = {
fieldDescription: `The computer to run on, if any. Checked against the bot's access when queued`,
dataType: "INTEGER",
},
{
fieldName: "requested_by_bot_id",
fieldDescription: `The bot that handed this job over (the coordinator, through delegate_task). It gets the result or failure in its own conversation. Not a foreign key, so the job outlives it`,
dataType: "INTEGER",
},
{
fieldName: "title",
fieldDescription: `Short label for the job`,
@@ -498,6 +508,58 @@ const schema: BUN_SQLITE_DatabaseSchemaType = {
},
],
},
{
tableName: "bots_queue_updates",
tableDescription: `What a bot did while working through a queued job, one row per step, oldest first. Live in the working-on panel while the job runs; deleted with the job when it's pruned`,
fields: [
{
fieldName: "bots_queue_id",
fieldDescription: `The job`,
dataType: "INTEGER",
foreignKey: {
cascadeDelete: true,
destinationTableName: "bots_queue",
destinationTableColumnName: "id",
destinationTableColumnType: "INTEGER",
foreignKeyName: "bots_queue_update_job_fk",
},
},
{
fieldName: "bot_id",
fieldDescription: `The bot doing the work (the job's), to read a bot's updates without a join`,
dataType: "INTEGER",
foreignKey: {
cascadeDelete: true,
destinationTableName: "bots",
destinationTableColumnName: "id",
destinationTableColumnType: "INTEGER",
foreignKeyName: "bots_queue_update_bot_fk",
},
},
{
fieldName: "kind",
fieldDescription: `tool (the bot called tools) or note (it wrote something without calling one)`,
dataType: "TEXT",
options: BotJobUpdateKinds.map((k) => k.value),
},
{
fieldName: "text",
fieldDescription: `The update in one line, e.g. "Using sandbox_execute_bash"`,
dataType: "TEXT",
},
{
fieldName: "metadata",
fieldDescription: `JSON details: the step index, tool names, the model`,
dataType: "TEXT",
},
],
indexes: [
{
indexName: "idx_bots_queue_updates_job_created_at",
indexTableFields: ["bots_queue_id", "created_at"],
},
],
},
{
tableName: "workspaces",
fields: [