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:
@@ -0,0 +1,50 @@
|
||||
import Row from "@moduletrace/twui/layout/Row";
|
||||
import Span from "@moduletrace/twui/layout/Span";
|
||||
import Stack from "@moduletrace/twui/layout/Stack";
|
||||
import { Check } from "lucide-react";
|
||||
import type { BUN_SQLITE_COBBLE_COMPUTERS } from "@/db/types/db";
|
||||
|
||||
type Props = {
|
||||
computer: BUN_SQLITE_COBBLE_COMPUTERS;
|
||||
/**
|
||||
* The computer the bot is on.
|
||||
*/
|
||||
current: boolean;
|
||||
onPick: () => void;
|
||||
};
|
||||
|
||||
/**
|
||||
* One computer in the header's computer select, checked when it's the
|
||||
* one the bot is on.
|
||||
*/
|
||||
export default function BotComputerOption({ computer, current, onPick }: Props) {
|
||||
return (
|
||||
<Row
|
||||
role="menuitemradio"
|
||||
aria-checked={current}
|
||||
tabIndex={0}
|
||||
onClick={current ? undefined : onPick}
|
||||
onKeyDown={(e) => {
|
||||
if (!current && (e.key == "Enter" || e.key == " ")) {
|
||||
e.preventDefault();
|
||||
onPick();
|
||||
}
|
||||
}}
|
||||
className={`w-full min-h-9 gap-2.5! flex-nowrap items-center px-4 py-1.5 text-ink transition-colors duration-[var(--m-fast)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ink ${
|
||||
current ? "cursor-default" : "cursor-pointer hover:bg-sunken"
|
||||
}`}
|
||||
>
|
||||
<Check size={16} aria-hidden className={`shrink-0 ${current ? "" : "invisible"}`} />
|
||||
<Stack className="min-w-0 gap-0!">
|
||||
<Span className="text-sm leading-5 text-ink truncate w-full">
|
||||
{computer.name || `Computer ${computer.id}`}
|
||||
</Span>
|
||||
{computer.description ? (
|
||||
<Span className="text-[13px] leading-[18px] text-ink-secondary truncate w-full">
|
||||
{computer.description}
|
||||
</Span>
|
||||
) : null}
|
||||
</Stack>
|
||||
</Row>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user