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]>
24 lines
715 B
TypeScript
24 lines
715 B
TypeScript
import deleteChatroomRows from "./delete-chatroom-rows";
|
|
|
|
type Params = {
|
|
/**
|
|
* Every room in this workspace, or every room of this user.
|
|
*/
|
|
workspace_id?: number | string;
|
|
user_id?: number | string;
|
|
};
|
|
|
|
/**
|
|
* Deletes every room of a workspace or a user, with everything in them
|
|
* (`deleteChatroomRows`).
|
|
*/
|
|
export default async function deleteChatrooms({ workspace_id, user_id }: Params) {
|
|
if (!workspace_id && !user_id) return;
|
|
|
|
await deleteChatroomRows({
|
|
rooms: workspace_id
|
|
? { sql: `SELECT id FROM chatrooms WHERE workspace_id = ?`, values: [workspace_id] }
|
|
: { sql: `SELECT id FROM chatrooms WHERE user_id = ?`, values: [user_id!] },
|
|
});
|
|
}
|