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]>
251 lines
5.3 KiB
TypeScript
251 lines
5.3 KiB
TypeScript
/**
|
|
* The palette a bot starts from: a suggested colour and the stone shape that
|
|
* goes with it. A bot's colour is free (any `#rrggbb`), so these are only
|
|
* the tiles the picker offers and the colours a new bot is given. Shape is
|
|
* stored separately (`bots.stone`), so a custom colour keeps its stone.
|
|
*/
|
|
export const BotHues = [
|
|
{
|
|
title: "Ember",
|
|
value: "ember",
|
|
color: "#e4572e",
|
|
},
|
|
{
|
|
title: "Amber",
|
|
value: "amber",
|
|
color: "#e9a23b",
|
|
},
|
|
{
|
|
title: "Moss",
|
|
value: "moss",
|
|
color: "#7fae3c",
|
|
},
|
|
{
|
|
title: "Teal",
|
|
value: "teal",
|
|
color: "#16a394",
|
|
},
|
|
{
|
|
title: "Cobalt",
|
|
value: "cobalt",
|
|
color: "#3b7dd8",
|
|
},
|
|
{
|
|
title: "Violet",
|
|
value: "violet",
|
|
color: "#7c5cd6",
|
|
},
|
|
{
|
|
title: "Rose",
|
|
value: "rose",
|
|
color: "#d6538c",
|
|
},
|
|
] as const;
|
|
|
|
/**
|
|
* Historical palette name. Kept for `bots.hue`, which is only read as a
|
|
* fallback for a bot saved before `color` and `stone` existed.
|
|
*/
|
|
export type BotHue = (typeof BotHues)[number]["value"];
|
|
|
|
/**
|
|
* The stone shapes. One flat cut each, from the handoff icon set. Shape is
|
|
* the bot's own, independent of its colour.
|
|
*/
|
|
export const BotStoneShapes = [
|
|
{
|
|
title: "Ember stone",
|
|
value: "ember",
|
|
},
|
|
{
|
|
title: "Amber stone",
|
|
value: "amber",
|
|
},
|
|
{
|
|
title: "Moss stone",
|
|
value: "moss",
|
|
},
|
|
{
|
|
title: "Teal stone",
|
|
value: "teal",
|
|
},
|
|
{
|
|
title: "Cobalt stone",
|
|
value: "cobalt",
|
|
},
|
|
{
|
|
title: "Violet stone",
|
|
value: "violet",
|
|
},
|
|
{
|
|
title: "Rose stone",
|
|
value: "rose",
|
|
},
|
|
] as const;
|
|
|
|
export type BotStoneShape = (typeof BotStoneShapes)[number]["value"];
|
|
|
|
export const BotKinds = [
|
|
{
|
|
title: "Worker",
|
|
value: "worker",
|
|
},
|
|
{
|
|
title: "Coordinator",
|
|
value: "coordinator",
|
|
},
|
|
] as const;
|
|
|
|
export type BotKind = (typeof BotKinds)[number]["value"];
|
|
|
|
/**
|
|
* Every user has exactly one coordinator, created with the account. It
|
|
* coordinates the crew and hands work to the other bots.
|
|
*/
|
|
export const CoordinatorBotName = "Coordinator";
|
|
|
|
/**
|
|
* The `app_settings` key holding the install-wide text appended to every
|
|
* bot's prompt, right after its own core instructions.
|
|
*/
|
|
export const BotSystemPromptAppendSettingKey = "bot_system_prompt_append";
|
|
|
|
/**
|
|
* The `app_settings` key holding the install's own limit on the tool turns
|
|
* one chat reply may take. Unset means `AppData.BotReplyMaxToolSteps`.
|
|
*/
|
|
export const BotReplyMaxToolStepsSettingKey = "bot_reply_max_tool_steps";
|
|
|
|
/**
|
|
* The `app_settings` key holding how many messages a session takes before
|
|
* the next user message starts a new one. Unset means
|
|
* `AppData.BotSessionMaxMessages`.
|
|
*/
|
|
export const BotSessionMaxMessagesSettingKey = "bot_session_max_messages";
|
|
|
|
/**
|
|
* A bot's face is its status. There are no badges or spinners.
|
|
*/
|
|
export const BotFaces = [
|
|
{
|
|
title: "Idle",
|
|
value: "idle",
|
|
},
|
|
{
|
|
title: "Working",
|
|
value: "working",
|
|
},
|
|
{
|
|
title: "Done",
|
|
value: "done",
|
|
},
|
|
{
|
|
title: "Asleep",
|
|
value: "asleep",
|
|
},
|
|
{
|
|
title: "Needs you",
|
|
value: "needs-you",
|
|
},
|
|
] as const;
|
|
|
|
export type BotFace = (typeof BotFaces)[number]["value"];
|
|
|
|
export const BotMessageAuthors = [
|
|
{
|
|
title: "Bot",
|
|
value: "bot",
|
|
},
|
|
{
|
|
title: "User",
|
|
value: "user",
|
|
},
|
|
] as const;
|
|
|
|
export type BotMessageAuthor = (typeof BotMessageAuthors)[number]["value"];
|
|
|
|
/**
|
|
* The emoji a message can be reacted with. Kept small and fixed, so the
|
|
* picker stays a row and every reaction reads the same everywhere.
|
|
*/
|
|
export const BotMessageReactions = [
|
|
{
|
|
title: "Like",
|
|
value: "👍",
|
|
},
|
|
{
|
|
title: "Love",
|
|
value: "❤️",
|
|
},
|
|
{
|
|
title: "Laugh",
|
|
value: "😂",
|
|
},
|
|
{
|
|
title: "Surprised",
|
|
value: "😮",
|
|
},
|
|
{
|
|
title: "Sad",
|
|
value: "😢",
|
|
},
|
|
{
|
|
title: "Celebrate",
|
|
value: "🎉",
|
|
},
|
|
] as const;
|
|
|
|
export type BotMessageReactionEmoji = (typeof BotMessageReactions)[number]["value"];
|
|
|
|
export const BotTaskStatuses = [
|
|
{
|
|
title: "Active",
|
|
value: "active",
|
|
},
|
|
{
|
|
title: "Done",
|
|
value: "done",
|
|
},
|
|
] as const;
|
|
|
|
export type BotTaskStatus = (typeof BotTaskStatuses)[number]["value"];
|
|
|
|
/**
|
|
* A conversation (one bot, in its own chat or one workspace) is split into
|
|
* sessions so no single history grows without bound. One is active per
|
|
* conversation; closed ones can be browsed and reopened.
|
|
*/
|
|
export const BotSessionStatuses = [
|
|
{
|
|
title: "Active",
|
|
value: "active",
|
|
},
|
|
{
|
|
title: "Closed",
|
|
value: "closed",
|
|
},
|
|
{
|
|
title: "Chatroom",
|
|
value: "chatroom",
|
|
},
|
|
] as const;
|
|
|
|
export type BotSessionStatus = (typeof BotSessionStatuses)[number]["value"];
|
|
|
|
export const BotTaskStepStates = [
|
|
{
|
|
title: "Done",
|
|
value: "done",
|
|
},
|
|
{
|
|
title: "Active",
|
|
value: "active",
|
|
},
|
|
{
|
|
title: "Pending",
|
|
value: "pending",
|
|
},
|
|
] as const;
|
|
|
|
export type BotTaskStepState = (typeof BotTaskStepStates)[number]["value"];
|