Add workspaces, conversation sessions, app-managed computers and pictures

- Rail: Add icon with stacked form modals (bot, workspace, computer),
  coordinator, recent bots with "See all bots", Workspaces section, and
  a workspace mode listing only its crew
- Workspaces: page for context, bots (per-workspace instructions and
  memory), computers (default, link, unlink), models and delete;
  conversations scoped per bot per workspace
- Sessions: conversations split into searchable, reopenable sessions
  with carry-over summaries; sessions and new-session header icons
- Computers: created and provisioned over the docker socket, home dir
  kept at DATA_DIR/computers/<id> after delete; super admins only
- Models: workspace settings win over a bot's own, then the defaults
- Pictures for bots and workspaces; bots editable from the header
- Coordinator tools: update_workspace, set_bot_workspace_instructions

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-19 08:39:33 +01:00
co-authored by Claude Opus 5.5
parent 56daf0c462
commit 0ce61cdb49
223 changed files with 8166 additions and 585 deletions
+22 -13
View File
@@ -2,37 +2,46 @@ import { describe, expect, test } from "bun:test";
import composeBotPrompt from "./compose-bot-prompt";
describe("composeBotPrompt", () => {
test("orders core instructions, workspaces, then memory", () => {
test("orders core instructions, the workspace, then memory", () => {
expect(
composeBotPrompt({
system_prompt: "# You are Scout\n\nFind things.",
memory: "- The user prefers short replies.",
workspaces: [
{ name: "Launch", system_prompt: "Ship by Friday." },
{ name: "Ops", system_prompt: "Servers are on Debian." },
],
workspace: {
name: "Launch",
description: "The spring launch.",
system_prompt: "Ship by Friday.",
},
workspace_bot: {
system_prompt: "Own the changelog.",
memory: "- Marketing signs off on copy.",
},
}),
).toBe(
[
"# You are Scout\n\nFind things.",
"# Workspace: Launch\n\nShip by Friday.",
"# Workspace: Ops\n\nServers are on Debian.",
`# Workspace: Launch\n\nYou're working in the workspace "Launch". Follow its context and your instructions for it below, over your general habits where they differ.\n\nThe spring launch.\n\nShip by Friday.`,
"# Your instructions in Launch\n\nOwn the changelog.",
"# Memory\n\n- The user prefers short replies.",
"# Memory in Launch\n\n- Marketing signs off on copy.",
].join("\n\n"),
);
});
test("leaves out empty parts", () => {
test("leaves out empty parts and has no workspace outside one", () => {
expect(
composeBotPrompt({
system_prompt: "Core.",
memory: " ",
workspaces: [
{ name: "Empty", system_prompt: "" },
{ name: null, system_prompt: "Shared." },
],
workspace_bot: { system_prompt: "Ignored." },
}),
).toBe("Core.\n\n# Workspace: Untitled\n\nShared.");
).toBe("Core.");
expect(composeBotPrompt({})).toBe("");
});
test("names an untitled workspace even when it has no context", () => {
expect(composeBotPrompt({ workspace: { name: null } })).toBe(
`# Workspace: Untitled\n\nYou're working in the workspace "Untitled". Follow its context and your instructions for it below, over your general habits where they differ.`,
);
});
});