Let crew managers edit a bot's workspace instructions where they work with it

A bot's instructions and memory for one workspace were only reachable
from the workspace's settings. The editor is now shared and also opens
from the conversation menu in that workspace ("Instructions here",
loaded on open through api/admin/workspaces/workspace-bot) and from the
workspace rows on the bot's settings page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-25 13:17:32 +01:00
co-authored by Claude Opus 5.5
parent 84f8c0cac8
commit 2d85177c59
14 changed files with 431 additions and 87 deletions
@@ -0,0 +1,14 @@
import fetchApi from "@moduletrace/twui/utils/fetch/fetchApi";
import type { APIResponseObject } from "@moduletrace/bunext/types";
import type { WorkspaceBotRequest } from "@/src/schemas/workspace-schema";
import type { WorkspaceBotInstructions } from "@/src/types";
/**
* A bot's instructions and memory for one workspace, for its editor.
*/
export default async function fetchWorkspaceBotInstructions({ workspace_id, bot_id }: WorkspaceBotRequest) {
return await fetchApi<WorkspaceBotRequest, APIResponseObject<WorkspaceBotInstructions>>(
`/api/admin/workspaces/workspace-bot`,
{ method: "POST", body: { workspace_id, bot_id } },
);
}