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:
@@ -8,6 +8,10 @@ import type { HarnessTool } from "../../types";
|
||||
|
||||
type Params = {
|
||||
user_id: number | string;
|
||||
/**
|
||||
* The coordinator: the worker's result comes back to its conversation.
|
||||
*/
|
||||
coordinator_id: number | string;
|
||||
/**
|
||||
* The coordinator's name, shown in the worker's conversation.
|
||||
*/
|
||||
@@ -26,11 +30,13 @@ type Args = {
|
||||
|
||||
/**
|
||||
* Lets the coordinator hand a task to a worker bot. The worker runs it on
|
||||
* its own main computer (if it has one) and posts the result in its own
|
||||
* conversation, where a note says who asked.
|
||||
* the computer it's on (if it has one) and posts the result in its own
|
||||
* conversation, where a note says who asked; the result (or failure) is
|
||||
* also reported back in the coordinator's conversation.
|
||||
*/
|
||||
export default function delegateTaskTool({
|
||||
user_id,
|
||||
coordinator_id,
|
||||
coordinator_name,
|
||||
workers,
|
||||
}: Params): HarnessTool<Args> {
|
||||
@@ -40,7 +46,7 @@ export default function delegateTaskTool({
|
||||
|
||||
return {
|
||||
name: "delegate_task",
|
||||
description: `Hand a task to a crew member. They run it in the background and post the result in their own conversation. Write the instructions as a full brief: what to do, where, and how they'll know it's done. Crew: ${crew}.`,
|
||||
description: `Hand a task to a crew member. They run it in the background and post the result in their own conversation; it's also reported back here when they finish or fail. Write the instructions as a full brief: what to do, where, and how they'll know it's done. Crew: ${crew}.`,
|
||||
schema: z.object({
|
||||
bot_id: z.number().int(),
|
||||
title: z.string().min(1).max(80),
|
||||
@@ -61,6 +67,7 @@ export default function delegateTaskTool({
|
||||
title: args.title,
|
||||
instructions: args.instructions,
|
||||
computer_id: computers[0]?.id || undefined,
|
||||
requested_by_bot_id: coordinator_id,
|
||||
});
|
||||
|
||||
await pushBotNotice({
|
||||
@@ -71,7 +78,7 @@ export default function delegateTaskTool({
|
||||
}),
|
||||
});
|
||||
|
||||
return `Task #${job_id} is with ${worker.name}. Their result will be in their conversation.`;
|
||||
return `Task #${job_id} is with ${worker.name}. Their result will be in their conversation and reported back here.`;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user