A worker asks for another bot's help with ask_crew. The coordinator reads the request, asks the right bot (in a workspace, only its members), and sends the answer back into the asking bot's conversation, waking it. Each exchange is kept as a read-only chatroom: listed in the main rail after the workspaces, or in the workspace's rail for requests made there, with live status rows for each bot while it's open and a Stop button. Room sessions are hidden from every conversation list, other bots' words reach the model fenced as data, and turns, nesting and open rooms are capped. Closed rooms are pruned after a retention period and past a cap per place (Settings > General). Co-Authored-By: Claude Opus 5.5 <[email protected]>
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { memo } from "react";
|
|
import Markdown from "react-markdown";
|
|
import remarkGfm from "remark-gfm";
|
|
import Stack from "@moduletrace/twui/layout/Stack";
|
|
import type { BotMessageWithAttachments } from "@/src/types";
|
|
import linkComputerRefs from "@/src/utils/link-computer-refs";
|
|
import { MessageMarkdownComponents } from "../(data)/message-markdown-components";
|
|
|
|
/**
|
|
* Kept module-level: a new array on every render makes `react-markdown`
|
|
* parse the message again.
|
|
*/
|
|
const RemarkPlugins = [remarkGfm];
|
|
|
|
type Props = {
|
|
message: BotMessageWithAttachments;
|
|
};
|
|
|
|
/**
|
|
* One chatroom outcome in the asking bot's conversation, rendered like a
|
|
* bot's message (its room ref a chip that opens the room).
|
|
*/
|
|
function CrewMessageLine({ message }: Props) {
|
|
return (
|
|
<Stack className="w-full gap-2.5! items-start break-words">
|
|
<Markdown remarkPlugins={RemarkPlugins} components={MessageMarkdownComponents}>
|
|
{linkComputerRefs({ text: message.text || "" })}
|
|
</Markdown>
|
|
</Stack>
|
|
);
|
|
}
|
|
|
|
export default memo(CrewMessageLine);
|