Give every user their own bot face
A bot's face and status line live in bot_user_faces, one row per bot and user, set by jobs for the user whose conversation they're in. Needs-you and working only show to that user; every bot read overlays the viewer's face (botFaceSql) and pushes go to the user a face change is for. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import BotAvatar from "@/src/components/general/bot-avatar";
|
||||
import type { BUN_SQLITE_COBBLE_BOTS } from "@/db/types/db";
|
||||
import type { BotWithFace } from "@/src/types";
|
||||
import type { BotFace, BotHue } from "@/src/dict/bot-dict";
|
||||
import SettingsListRow from "../../../(partials)/settings-list-row";
|
||||
import SettingsRowAction from "../../../(partials)/settings-row-action";
|
||||
|
||||
type Props = {
|
||||
bot: BUN_SQLITE_COBBLE_BOTS;
|
||||
bot: BotWithFace;
|
||||
/**
|
||||
* The bot's settings page, when the actor may open it.
|
||||
*/
|
||||
|
||||
@@ -45,7 +45,7 @@ export const server: BunextPageServerFn<PagePropsType> = async (params) => {
|
||||
),
|
||||
grabBots({ user_id }),
|
||||
grabUserWorkspaces({ user_id }),
|
||||
grabComputerAccess({ computer_id: allowed.id }),
|
||||
grabComputerAccess({ computer_id: allowed.id, user_id }),
|
||||
]);
|
||||
|
||||
return {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { BUN_SQLITE_COBBLE_COMPUTERS } from "@/db/types/db";
|
||||
import userAuth from "@/src/functions/backend/auth/user-auth";
|
||||
import pushBotNotice from "@/src/bots-queue/push-bot-notice";
|
||||
import pushBotUpdated from "@/src/bots-queue/push-bot-updated";
|
||||
import setBotComputer from "@/src/functions/backend/db/computers/set-bot-computer";
|
||||
import grabUserConversation from "@/src/functions/backend/db/bot-sessions/grab-user-conversation";
|
||||
import setWorkspaceComputer from "@/src/functions/backend/db/workspaces/set-workspace-computer";
|
||||
@@ -54,15 +54,7 @@ export const handler: BunextAPIRouteHandler<
|
||||
user_id: user.id,
|
||||
});
|
||||
|
||||
await pushBotNotice({
|
||||
bot_id: bot.id || 0,
|
||||
bot: {
|
||||
id: bot.id,
|
||||
face: bot.face,
|
||||
status_line: bot.status_line,
|
||||
computer_id: computer.id,
|
||||
},
|
||||
});
|
||||
await pushBotUpdated({ bot_id: bot.id || 0, computer_id: computer.id || null });
|
||||
|
||||
await logEvent({
|
||||
title: "Bot computer switched",
|
||||
|
||||
Reference in New Issue
Block a user