}
+ back={
}
refreshing={files.isFetching}
onRefresh={() => void files.refetch()}
>
diff --git a/apps/web/features/memory/memory.tsx b/apps/web/features/memory/memory.tsx
index 7e1357be..c9b5544a 100644
--- a/apps/web/features/memory/memory.tsx
+++ b/apps/web/features/memory/memory.tsx
@@ -67,7 +67,6 @@ const SOURCE_LABELS: Record<
owner: () => "Added by you",
task: (name) => `From the automation ${name ?? ""}`.trim(),
bot: (name) => `From a request by ${name ?? "a bot"}`,
- group: (name) => `From the group chat ${name ?? ""}`.trim(),
};
export function sourceLabel(memory: Memory) {
@@ -81,7 +80,6 @@ const SOURCE_ICONS = {
owner: IconUser,
task: IconCalendarRepeat,
bot: IconRobot,
- group: IconUsersGroup,
} satisfies Record
["kind"], TablerIcon>;
function Highlighted({ text, needle }: { text: string; needle: string }) {
diff --git a/apps/web/features/providers/vision-model-settings.tsx b/apps/web/features/providers/vision-model-settings.tsx
index fa4ebb50..1cd17698 100644
--- a/apps/web/features/providers/vision-model-settings.tsx
+++ b/apps/web/features/providers/vision-model-settings.tsx
@@ -7,7 +7,7 @@ import { ModelChoiceRow, modelKey } from "./model-choice";
function statusText({ visionModel, choices }: VisionModel) {
if (!visionModel)
- return "Off. A bot whose model can't read images refuses them in its chat and gets only their names in group chats.";
+ return "Off. A bot whose model can't read images refuses them in its bot chat.";
const chosen = choices.find(
(item) => modelKey(item) === modelKey(visionModel),
diff --git a/apps/web/lib/chat-attention.dom.test.tsx b/apps/web/lib/chat-attention.dom.test.tsx
index 76d6c6ac..dee0d423 100644
--- a/apps/web/lib/chat-attention.dom.test.tsx
+++ b/apps/web/lib/chat-attention.dom.test.tsx
@@ -305,7 +305,7 @@ test("reports only active views and ready visible reply surfaces", async () => {
document.body.append(text);
const controller = getChatAttention();
const bot = { kind: "bot", id: "bot" } as const;
- const group = { kind: "group", id: "group" } as const;
+ const otherBot = { kind: "bot", id: "other-bot" } as const;
const reference: ReplyReference = {
eventId: "card-event",
@@ -438,11 +438,11 @@ test("reports only active views and ready visible reply surfaces", async () => {
await waitFor(() => views().length === 6);
expect(views()[5]!.body).toEqual({ chat: bot });
controller.displayed({ eventId: "old", surface: { kind: "text" } });
- controller.setChat(group);
+ controller.setChat(otherBot);
await waitFor(() => views().length === 7);
await settle();
expect(seen()).toHaveLength(1);
- expect(views()[6]!.body).toEqual({ chat: group });
+ expect(views()[6]!.body).toEqual({ chat: otherBot });
controller.displayed({ eventId: "other", surface: { kind: "text" } });
controller.setChat(null);
await waitFor(() => views().length === 8);
@@ -474,7 +474,7 @@ test("reports only active views and ready visible reply surfaces", async () => {
state.failSeen = true;
retrying.displayed({ eventId: "retry", surface: { kind: "text" } });
await waitFor(() => seen().length === 2 && retryCallbacks.length === 1);
- retrying.setChat(group);
+ retrying.setChat(otherBot);
retryCallbacks.at(-1)!();
await waitFor(() => seen().length === 3);
expect(seen()[1]?.body).toEqual({ chat: bot, eventIds: ["retry"] });
diff --git a/apps/web/lib/notifications.ts b/apps/web/lib/notifications.ts
index 6847a826..b912e0b7 100644
--- a/apps/web/lib/notifications.ts
+++ b/apps/web/lib/notifications.ts
@@ -37,13 +37,14 @@ function firstNotice(key: string) {
return true;
}
-export type ReplyChat = { kind: "bot" | "group"; id: string };
+export type ReplyChat = { kind: "bot"; id: string };
-const chatOf = ({ groupId, agentId }: ReplyEvent): ReplyChat =>
- groupId ? { kind: "group", id: groupId } : { kind: "bot", id: agentId };
+const chatOf = ({ agentId }: ReplyEvent): ReplyChat => ({
+ kind: "bot",
+ id: agentId,
+});
-const chatTag = ({ kind, id }: ReplyChat) =>
- kind === "group" ? `reply-group-${id}` : `reply-${id}`;
+const chatTag = ({ id }: ReplyChat) => `reply-${id}`;
function canNotify() {
return (
@@ -91,9 +92,6 @@ export function markSeen() {
document.addEventListener("visibilitychange", markSeen);
function noticeTitle(event: ReplyEvent) {
- if (event.groupId)
- return `${event.agentName} in ${event.groupName ?? "a group"}`;
-
const job = isJobKind(event.origin)
? ` · ${event.origin} job ${event.jobName ?? ""}`.trimEnd()
: "";
diff --git a/apps/web/lib/pins.dom.test.tsx b/apps/web/lib/pins.dom.test.tsx
index 74583d98..1e90431c 100644
--- a/apps/web/lib/pins.dom.test.tsx
+++ b/apps/web/lib/pins.dom.test.tsx
@@ -38,10 +38,7 @@ let pins: Pins | undefined;
let root: Root;
let notifySession: () => void;
-let renderPins: (
- bots?: Conversation[],
- groups?: Conversation[],
-) => Promise;
+let renderPins: (bots?: Conversation[]) => Promise;
let fetch: ReturnType;
@@ -87,8 +84,7 @@ const stubServer = () =>
),
);
-const bots = [{ id: "a" }, { id: "b" }];
-const groups = [{ id: "g" }];
+const bots = [{ id: "a" }, { id: "b" }, { id: "c" }];
const current = () => {
if (!pins) throw new Error("usePins has not rendered");
@@ -121,26 +117,21 @@ beforeAll(async () => {
root = createRoot(container);
notifySession = () => authClient.$store.notify("$sessionSignal");
- function Harness(props: {
- bots: Conversation[] | undefined;
- groups: Conversation[] | undefined;
- }) {
- pins = usePins(props.bots, props.groups);
+ function Harness(props: { bots: Conversation[] | undefined }) {
+ pins = usePins(props.bots);
return null;
}
- renderPins = async (nextBots, nextGroups) => {
- await act(async () =>
- root.render(),
- );
+ renderPins = async (nextBots) => {
+ await act(async () => root.render());
};
});
beforeEach(async () => {
failWrites = false;
omitPins = false;
- await renderPins(bots, groups);
+ await renderPins(bots);
});
afterAll(async () => {
@@ -161,44 +152,44 @@ afterAll(async () => {
});
test("pin adds the conversation at the end", async () => {
- await load(["group:g"]);
+ await load(["agent:c"]);
await act(async () => current().pin("agent:a"));
- expect(current().pinned).toEqual(["group:g", "agent:a"]);
+ expect(current().pinned).toEqual(["agent:c", "agent:a"]);
await waitFor(() => stored.length === 2, "the write");
- expect(written).toEqual([["group:g", "agent:a"]]);
+ expect(written).toEqual([["agent:c", "agent:a"]]);
await settle();
- expect(current().pinned).toEqual(["group:g", "agent:a"]);
+ expect(current().pinned).toEqual(["agent:c", "agent:a"]);
});
test("unpin removes the conversation", async () => {
- await load(["agent:a", "group:g"]);
+ await load(["agent:a", "agent:c"]);
await act(async () => current().unpin("agent:a"));
- expect(current().pinned).toEqual(["group:g"]);
+ expect(current().pinned).toEqual(["agent:c"]);
await waitFor(() => written.length === 1, "the write");
- expect(written).toEqual([["group:g"]]);
+ expect(written).toEqual([["agent:c"]]);
});
test("move puts the conversation at the target's place", async () => {
- await load(["agent:a", "agent:b", "group:g"]);
- await act(async () => current().move("agent:a", "group:g"));
- expect(current().pinned).toEqual(["agent:b", "group:g", "agent:a"]);
+ await load(["agent:a", "agent:b", "agent:c"]);
+ await act(async () => current().move("agent:a", "agent:c"));
+ expect(current().pinned).toEqual(["agent:b", "agent:c", "agent:a"]);
await act(async () => current().move("agent:a", "agent:b"));
- expect(current().pinned).toEqual(["agent:a", "agent:b", "group:g"]);
- await waitFor(shows(["agent:a", "agent:b", "group:g"]), "the saved order");
+ expect(current().pinned).toEqual(["agent:a", "agent:b", "agent:c"]);
+ await waitFor(shows(["agent:a", "agent:b", "agent:c"]), "the saved order");
await waitFor(() => stored[0] === "agent:a", "the last write");
- expect(written.at(-1)).toEqual(["agent:a", "agent:b", "group:g"]);
+ expect(written.at(-1)).toEqual(["agent:a", "agent:b", "agent:c"]);
});
test("a write drops pins for conversations that are gone", async () => {
await load(["agent:gone", "agent:a"], ["agent:a"]);
- await act(async () => current().pin("group:g"));
+ await act(async () => current().pin("agent:c"));
await waitFor(() => written.length === 1, "the write");
- expect(written).toEqual([["agent:a", "group:g"]]);
+ expect(written).toEqual([["agent:a", "agent:c"]]);
});
test("a tenth pin is refused", async () => {
const many = Array.from({ length: 10 }, (_, index) => ({ id: `${index}` }));
- await renderPins(many, groups);
+ await renderPins(many);
const nine = many.slice(0, 9).map(({ id }) => `agent:${id}`);
await load(nine);
@@ -209,9 +200,9 @@ test("a tenth pin is refused", async () => {
expect(current().pinned).toEqual(nine);
});
-test("changes wait until bots and groups have loaded", async () => {
+test("changes wait until bots have loaded", async () => {
await load(["agent:a"]);
- await renderPins(bots, undefined);
+ await renderPins(undefined);
expect(current().ready).toBe(false);
expect(current().canPin("agent:b")).toBe(false);
await act(async () => {
diff --git a/apps/web/lib/pins.ts b/apps/web/lib/pins.ts
index 6dd4abd8..5daabc16 100644
--- a/apps/web/lib/pins.ts
+++ b/apps/web/lib/pins.ts
@@ -9,14 +9,12 @@ type Conversation = { id: string };
export const botPin = (id: string) => `agent:${id}`;
-export const groupPin = (id: string) => `group:${id}`;
-
const savedPins = pinnedConversations.catch([]);
export type Pins = {
/** The pinned conversations that exist, first pin first. */
pinned: string[];
- /** False until the bots and groups load; until then every change is refused. */
+ /** False until the bots load; until then every change is refused. */
ready: boolean;
isPinned: (key: string) => boolean;
canPin: (key: string) => boolean;
@@ -30,10 +28,7 @@ export type Pins = {
* list, one write at a time; afterwards the session's list takes over again,
* which also rolls back a failed write.
*/
-export function usePins(
- bots: Conversation[] | undefined,
- groups: Conversation[] | undefined,
-): Pins {
+export function usePins(bots: Conversation[] | undefined): Pins {
const session = authClient.useSession();
const [wanted, setWanted] = useState(null);
@@ -48,14 +43,10 @@ export function usePins(
// written before the session's list arrives. A server too old to keep pins never sends one.
const ready =
bots !== undefined &&
- groups !== undefined &&
pinnedConversations.safeParse(session.data?.user.pinnedConversations)
.success;
- const existing = new Set([
- ...(bots ?? []).map(({ id }) => botPin(id)),
- ...(groups ?? []).map(({ id }) => groupPin(id)),
- ]);
+ const existing = new Set((bots ?? []).map(({ id }) => botPin(id)));
const pinned = (
wanted ?? savedPins.parse(session.data?.user.pinnedConversations)
diff --git a/docs/adr/0002-group-chats.md b/docs/adr/0002-group-chats.md
index cfc82b2e..b1ac6ccb 100644
--- a/docs/adr/0002-group-chats.md
+++ b/docs/adr/0002-group-chats.md
@@ -1,5 +1,7 @@
# Group chats
+> Superseded by [Remove group chats](../designs/remove-group-chats.md). This document records the original design.
+
Implements [feature 0001](https://github.com/crumble-project/spec/blob/main/features/0001-group-chats.md).
A group chat's shared transcript lives in its own Pi Durable store, `groups/.sqlite`, which holds only data entries and never calls a model. That reuses transcript paging, entry references, and request-ID deduplication, so every message is written once even when a post is retried or the server restarts. Group metadata and membership live in the product database next to bots.
diff --git a/docs/api-contract.md b/docs/api-contract.md
index 5b954493..145e6935 100644
--- a/docs/api-contract.md
+++ b/docs/api-contract.md
@@ -13,7 +13,6 @@ bun run openapi:check
| --- | --- |
| `openapi/openapi.json` | Shared route registry (OpenAPI 3.1) |
| `openapi/chat-snapshot.schema.json` | `chatSnapshotResponse` |
-| `openapi/group-chat-snapshot.schema.json` | `groupChatSnapshotResponse` |
| `openapi/activity-event.schema.json` | `activityEvent` (`reply` and `chat_preview` union) |
| `openapi/learned-event.schema.json` | `learnedEvent` |
| `openapi/desktop-control.schema.json` | `desktopControlResponse` |
@@ -83,8 +82,6 @@ All `/v1` streams require a Better Auth account session (a session bearer token
| --- | --- | --- |
| `/v1/agents/{id}/events` | `snapshot` | `chat-snapshot.schema.json` |
| `/v1/agents/{id}/events` | `heartbeat` | `heartbeat.schema.json` |
-| `/v1/group-chats/{id}/events` | `snapshot` | `group-chat-snapshot.schema.json` |
-| `/v1/group-chats/{id}/events` | `heartbeat` | `heartbeat.schema.json` |
| `/v1/agents/{id}/desktop/events` | `control` | `desktop-control.schema.json` |
| `/v1/agents/{id}/desktop/events` | `heartbeat` | `heartbeat.schema.json` |
| `/v1/events` | `activity` | `activity-event.schema.json` |
diff --git a/docs/architecture.md b/docs/architecture.md
index 647a1391..daebd69e 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -8,8 +8,8 @@ flowchart TD
Auth --> Tenant["Private user runtime (tenant.ts)"]
Tenant --> API["Hono HTTP & SSE API (/v1)"]
API --> Service["Bots & BotRuntime"]
- Service --> Store["Product SQLite (feature repositories)\nAgents, groups, skills, memories,\nschedules, credentials, changes"]
- Service --> Pi["Pi Durable SQLite Stores\nPer-bot & per-group transcripts,\ncoding/desktop jobs, reviews"]
+ Service --> Store["Product SQLite (feature repositories)\nAgents, skills, memories,\nschedules, credentials, changes"]
+ Service --> Pi["Pi Durable SQLite Stores\nPer-bot transcripts,\ncoding/desktop jobs, reviews"]
Pi --> Workspaces["MachineWorkspaces\nMicrosandbox microVM + proxy & Xvnc,\nor Railway sandbox + checkpoint"]
```
@@ -20,9 +20,9 @@ Source files named below live in feature folders under `apps/server/src/`, such
- **Accounts (`auth.ts`, `server.ts`, `tenant.ts`):** Better Auth stores accounts and sessions in `auth.sqlite`. The host authenticates every API and viewer request before routing to a private user runtime under `users/USER_ID`. Each runtime owns its databases, files, encryption key, services, event listeners, provider logins, and workspace namespace. Requests under `/v1/voice/` are the exception: the host reads no session there and routes a voice gateway token by its account prefix, as it routes viewer links, and the account checks the token's hash. Startup recovers every existing account runtime so background schedules continue without an active browser. Shared memories and skills remain inside the account. Host provider environment credentials are ignored.
- **Admins and server settings (`admin-api.ts`, `invites.ts`, `server-settings.ts`):** Better Auth's `admin` plugin adds user roles; its own `/api/auth/admin/*` routes are closed, and the host answers `/v1/admin/*` itself before any account runtime. The first user becomes admin in a `user.create.before` database hook, which is also the one gate for closed sign-up: an email sign-up needs an open invite in `x-crumble-invite`, and a passkey-only sign-up (passkey plugin with `requireSession: false`) checks and spends its invite in `afterVerification`. Server settings and invites are tables of `auth.sqlite`, added through a schema-only Better Auth plugin; queries inside a sign-up go through `getCurrentAdapter`, since SQLite would wait forever on the sign-up's own transaction. Each account runtime reads workspace size, coding image, and question grace period through a function the host passes in.
-- **Product store (repositories) vs. Pi Durable (`runtime.ts`):** Product SQLite (`store.sqlite`), read and written through each feature's Drizzle repository, stores agent profiles, canonical chat references, group chats, memories, skill packages, learned-change logs, schedules, MCP servers, and encrypted credentials. Each bot owns a separate Pi Durable SQLite store that manages conversation entries, model calls, tool execution, compaction, and retries.
+- **Product store (repositories) vs. Pi Durable (`runtime.ts`):** Product SQLite (`store.sqlite`), read and written through each feature's Drizzle repository, stores agent profiles, canonical chat references, memories, skill packages, learned-change logs, schedules, MCP servers, and encrypted credentials. Each bot owns a separate Pi Durable SQLite store that manages conversation entries, model calls, tool execution, compaction, and retries.
- **Layers below features (`bot-store/`, `bot-ports/`, `learned-changes/`):** `bot-store/` holds the rows of bots, conversations, executions, and automations; `bot-ports/` holds what features use to reach the bot runtime without importing it, such as `BotExtensions` and `BotNotices`; `learned-changes/` records changes, so `memory/` and `skills/` never depend on `learning/`, the reviews above them. All three sit below `bots/` and the other feature modules. The skill library sits above the store, so `AgentRepository` reads a bot's skills through the `AgentSkills` port.
-- **Effect services (`app/tenant.ts`):** Each account is one Effect `Layer` graph: repositories over `ProductDatabase`, then feature services such as `Bots`, `BotRuntime`, `GroupChats`, `BotSkills`, `Scheduler`, and `Push`, each with its own scope. Features offer their bot tools by registering them in `BotExtensions` from a layer of their own. Closing the account releases the graph in reverse. Domain failures are tagged errors (`shared/errors.ts`) that the API maps to HTTP statuses in one place; HTTP handlers reach services through access adapters (`botsAccess`, `groupChatsAccess`, and similar), which keep a Promise API at the Hono boundary. `createAPI` reads the services its routes need from the account's Context and registers every feature's routes from one list (`featureRoutes`); the store's Drizzle config collects each folder's `schema.ts` and `schema..ts` ([ADR 0008](adr/0008-feature-wiring.md)).
+- **Effect services (`app/tenant.ts`):** Each account is one Effect `Layer` graph: repositories over `ProductDatabase`, then feature services such as `Bots`, `BotRuntime`, `BotSkills`, `Scheduler`, and `Push`, each with its own scope. Features offer their bot tools by registering them in `BotExtensions` from a layer of their own. Closing the account releases the graph in reverse. Domain failures are tagged errors (`shared/errors.ts`) that the API maps to HTTP statuses in one place; HTTP handlers reach services through access adapters (`botsAccess` and similar), which keep a Promise API at the Hono boundary. `createAPI` reads the services its routes need from the account's Context and registers every feature's routes from one list (`featureRoutes`); the store's Drizzle config collects each folder's `schema.ts` and `schema..ts` ([ADR 0008](adr/0008-feature-wiring.md)).
- **Provider credentials (`provider-auth.ts`):** Encrypted at rest using the account's key: `.secret.key`, or `.secret.key.wrapped` sealed with `CRUMBLE_MASTER_KEY` when set. Pi AI owns interactive sign-in, token refresh, and request authentication; `ProviderCredentials` serializes logins, refreshes, key updates, and sign-outs per provider within the account.
- **MCP integrations:** Bots load tools only from enabled, permitted MCP servers. Unreachable or unauthenticated MCP servers are skipped for the turn with their error surfaced in status. OAuth supports dynamic client registration, Client ID Metadata Documents (`CRUMBLE_PUBLIC_URL`), and owner-registered OAuth client credentials.
- **Bundled web UI (`apps/web/`):** React, TanStack Router, TanStack Query, Tailwind CSS, and shadcn/ui served at `/ui` and bundled on demand by Bun.
@@ -40,15 +40,15 @@ Source files named below live in feature folders under `apps/server/src/`, such
## Inline visuals and reactions
- **`show` (`display.ts`, `charts.ts`):** Model-only tool that validates `stats`, `table`, or `chart` payloads, attaches them as `toolDetails`, and terminates the turn. Charts use TanStack Charts code compiled inside a zero-I/O QuickJS sandbox into themed drawing primitives (`chartLayout`).
-- **`desktop_screenshot` (`desktop-screenshot.ts`):** Offered in the bot chat to bots with the `desktop` tool (not in group turns). Holds the machine awake, refuses unless the bot desktop already runs (it never boots one), refuses while `passwordMayShow` holds for the running Chromium, then captures the whole X display with ImageMagick `import` through the bot's workspace. The JPEG goes in the tool result, which terminates the turn; clients read it from `GET /v1/agents/{id}/attachments/{entryId}/0`, which also serves successful screenshot results. It neither waits for nor pauses a running desktop job or the owner's control.
+- **`desktop_screenshot` (`desktop-screenshot.ts`):** Offered in the bot chat to bots with the `desktop` tool. Holds the machine awake, refuses unless the bot desktop already runs (it never boots one), refuses while `passwordMayShow` holds for the running Chromium, then captures the whole X display with ImageMagick `import` through the bot's workspace. The JPEG goes in the tool result, which terminates the turn; clients read it from `GET /v1/agents/{id}/attachments/{entryId}/0`, which also serves successful screenshot results. It neither waits for nor pauses a running desktop job or the owner's control.
- **`react` (`reaction.ts`):** Attaches a single emoji to the latest input message and terminates the turn without emitting a reply notification.
## Workspaces, coding jobs, and desktop jobs
`jobs.ts` (`defineJobKind`) powers both **coding jobs** (`jobs/coding.ts`) and **desktop jobs** (`bot-desktop/desktop-jobs.ts`) as child conversations in the bot's Pi store owned by background anchor and reporter tasks. `shared/job-kinds.ts` is the dependency-free table of what the rest of the server knows of each kind: its tool, label, and extension. Documents and tasks are named by those facts, so the runtime reads and answers any kind's jobs without the feature, and each plugin's definition hears only its own jobs:
-- **Conversation kinds (`bot-ports/conversation-kind.ts`):** The runtime knows the bot chat and nothing else. Group conversations (`group-chats/group-turns.ts`) and reviews (`learning/review-kind.ts`) are each a `ConversationKind`: it recognizes its conversations and picks their tools, extensions, instructions, model, and environment. An extension stays out of group turns through `chatOnly`.
-- **The bot's own workspace tools (`coding.ts`, `workspace` extension):** A bot with `coding` has `read`, `write`, `edit`, and `bash` itself, in its chat and group conversations, so it works in its workspace directly and starts a coding job only for parallel or long-running work. `conversationEnv` (`plugins.ts`) gives a job its kind's environment and every other conversation of the bot the coding plugin's `botEnv`: the bot's workspace with its credentials, like a job's; the runtime never asks for a review's. The environment is lazy, so a chat turn that runs no workspace tool boots nothing: the chat's `workspace` prompt section shows the workspace notes only while `Workspaces.running` says the machine is up, and otherwise only their path. A file-changing tool call syncs the workspace, as in a job.
+- **Conversation kinds (`bot-ports/conversation-kind.ts`):** The runtime knows the bot chat and nothing else. Reviews (`learning/review-kind.ts`) and outside calls (`voice-gateway/call-conversation.ts`) each provide a `ConversationKind` that recognizes their conversations and selects tools, extensions, instructions, models, and environments.
+- **The bot's own workspace tools (`coding.ts`, `workspace` extension):** A bot with `coding` has `read`, `write`, `edit`, and `bash` itself, in its bot chat, so it works in its workspace directly and starts a coding job only for parallel or long-running work. `conversationEnv` (`plugins.ts`) gives a job its kind's environment and every other conversation of the bot the coding plugin's `botEnv`: the bot's workspace with its credentials, like a job's; the runtime never asks for a review's. The environment is lazy, so a chat turn that runs no workspace tool boots nothing: the chat's `workspace` prompt section shows the workspace notes only while `Workspaces.running` says the machine is up, and otherwise only their path. A file-changing tool call syncs the workspace, as in a job.
- **What a job knows (`jobs.ts`, `chat-excerpt.ts`, `prompts.ts`):** A job is a fresh conversation, not a fork of the chat: a fork would carry the whole chat into the job's transcript, its learning review, and every request, uncached since the job's prompt and tools differ. Each job selects the runtime's `job-knowledge` extension beside its own: the `skill` tool and a `bot_knowledge` section with the owner's standing instructions, the skill index and the bot's memory, rendered at each request. The chat removes that extension, having the same in its instructions. Memory is read-only in jobs, since memory writes record chat turns as their source. A start also appends the chat's latest messages (owner and bot text, no tool calls; at most 12 messages and 8,000 characters) to the job's instructions as ``, so the bot's `start` message is just the task.
- **Coding jobs (`coding` tool):** Run `read`, `write`, `edit`, and `bash` via `pi-env` inside the bot's Microsandbox microVM (`MicrosandboxWorkspaces`), backed by a persistent ext4 volume (`crumble--`) mounted at `/workspace` and filtered by a per-workspace HTTP CONNECT proxy (`workspace-proxy.ts`). The proxy carries only TCP, so the machine's network policy denies outbound UDP except DNS to the sandbox's resolver; the machine record's `network` version recreates machines made before that rule, keeping `/workspace`.
- **Workspace backends (`machine-workspaces.ts`, [ADR 0005](adr/0005-railway-workspaces.md)):** `MachineWorkspaces` owns the lifecycle both backends share (lazy boot, idle stop, holds, the pi-env relay). It is the `BotWorkspaces` service: its methods return Effects whose failures are tagged errors (`workspace-errors.ts`), and the account's scope stops it after the bot runtime. Pi's `ExecutionEnv` stays Promise-based; the pi-env connection runs the boot at that boundary. With `CRUMBLE_WORKSPACE_BACKEND=railway`, `RailwayWorkspaces` runs each bot in a Railway sandbox instead: files survive as the checkpoint `crumble--`, taken after 30 seconds without a sync and before every stop; a restarted server reconnects to the running sandbox; there is no network policy. Bot desktops boot a second template with a pinned Chromium snapshot build.
@@ -59,20 +59,11 @@ Source files named below live in feature folders under `apps/server/src/`, such
- **Logins (`logins/`, #63):** Owner-given usernames, passwords, and one-time codes per bot, bound to hosts, one row per field in `login_fields`, each stored encrypted or read through `SecretValues` from a password manager. Managed over `/v1/agents/{id}/logins` (`logins-api.ts`). `computer_use`'s `fill_login` (`computer-use-login.ts`) types a field into a ref of the job's latest page read, only on an https page whose host the login covers; each password typed is recorded in `desktop_fills` and replaced in every later job's text for the desktop's life. Fills (`login_uses`) are kept for 90 days. The bot asks for a missing login with `request_login` (`login_requests`, #64); saving or declining posts a notice that starts a bot turn.
- **Watching and taking control (`desktop-control.ts`, `desktop-viewer.ts`, `rfb-filter.ts`):** `POST /v1/agents/{id}/desktop/viewer` issues a single-use ticket for a server-hosted noVNC viewer bridged to the guest's Xvnc over an exec stream. The RFB filter drops pointer, keyboard, and clipboard events unless the owner holds the persistent control lease (`PUT /v1/agents/{id}/desktop/control`). While the owner holds control, `computer_use` pauses; when control returns, stale snapshots are discarded and the job must capture the screen first. A passive viewer (`?passive=true`, the web chat's sidebar preview) neither boots nor holds the machine and ends when it stops; `GET /v1/agents/{id}/desktop/status` says whether the bot desktop runs. A viewer whose bot desktop does not open gets close code 1011 with a reason per tagged error (`desktop-api.ts`), and the server logs the cause.
-## Group chats
-
-`GroupChats` (`group-chats.ts`, [ADR 0002](adr/0002-group-chats.md)) manages conversations between the owner and 2–6 bots:
-
-- Each group's shared transcript lives in `groups/.sqlite` as `crumble.group-message` data entries.
-- Each member bot has a task-owned group conversation in its own Pi store (isolated from its private bot chat) with the `pass` tool and without delegation, coding jobs, or desktop jobs. A bot with coding keeps its own workspace tools there.
-- Owner messages wake mentioned bots (or all enabled members); bot messages wake only mentioned bots. After 8 bot-started turns since the owner's last message, the group pauses until the owner writes again.
-- Members joining after the first message receive a one-time model summary of earlier messages. Group turns can write only to the bot's own memory (recording the group in `Memory.source`). Bot chats can inspect their groups with the `group_chats` tool.
-
## Chat history search
`HistorySearch` (`history-search.ts`, `history-tools.ts`) provides `history_search` and `history_read` model tools over retained transcripts (including compacted messages):
-- Bot chats can search their own chat and current groups; group turns can search only that group's shared transcript.
+- Bots can search only their own bot chat.
- Uses case-insensitive literal substring matching over authored message bodies, newest-first, with an encrypted continuation token that fixes the search cutoff while rechecking current access on every page and surrounding read.
## Learned skills
@@ -80,5 +71,5 @@ Source files named below live in feature folders under `apps/server/src/`, such
Implemented in `skills.ts` and `review.ts` ([ADR 0003](adr/0003-learned-skills.md)):
- **Skill packages:** Stored in `skills` and `skill_documents` (plus read-only bundled defaults in `apps/server/skills/`). Working context lists skills by name and description; bots load instructions and `references/*.md` on demand via `skill` and edit their own skills in atomic batches via `skill_manage`. `Agent.skills` remains a compatible `{ name, instructions }` view over the bot's skill rows.
-- **Post-turn review:** Tracks tool-activity rounds per bot in `review_counters`, from every settled turn: bot chat, scheduled and event runs, group turns, and coding job turns. When the skill or memory counter reaches its threshold (default 10), a background review conversation runs on `reviewModel` (or the bot's model) within a strict character/token budget and updates skills or memory; its prompt treats outside data in the digest, such as event payloads, as untrusted.
+- **Post-turn review:** Tracks tool-activity rounds per bot in `review_counters`, from every settled turn: bot chat, scheduled and event runs, and coding job turns. When the skill or memory counter reaches its threshold (default 10), a background review conversation runs on `reviewModel` (or the bot's model) within a strict character/token budget and updates skills or memory; its prompt treats outside data in the digest, such as event payloads, as untrusted.
- **Change ledger and curator:** Every skill or memory mutation is logged in `learned_changes` with full before/after state for `GET /v1/changes` and `POST /v1/changes/{id}/revert`, and review changes emit a `learned` SSE event. A periodic curator marks bot-created skills `stale` after 14 unused days and `archived` after 30 days unless pinned or used by a scheduled task.
diff --git a/docs/designs/remove-group-chats.md b/docs/designs/remove-group-chats.md
new file mode 100644
index 00000000..089fe027
--- /dev/null
+++ b/docs/designs/remove-group-chats.md
@@ -0,0 +1,58 @@
+# Remove group chats
+
+**Status:** draft for approval.
+
+## Goal
+
+Crumble supports only the continuous direct chat between each bot and its owner. Remove group chats completely from this repository.
+
+The owner confirmed that existing group chats, their history, and their uploaded files can be permanently deleted.
+
+## Behavior
+
+1. The web client has no group-chat navigation, creation, membership management, transcript, composer, or library.
+2. Owners and bots cannot create, read, update, or send messages to group chats through the server.
+3. Group chats do not start or resume work after an upgrade. Remove group-only orchestration, prompts, tools, and event handling.
+4. Direct bot chats retain their existing behavior, history, files, replies, notifications, and background work.
+5. Bots that belonged to groups remain intact. Removing a group does not delete a member bot or its own data.
+6. Old group-chat links cannot reopen a group or expose its data. The web client recovers to the normal bot interface.
+
+## Data removal
+
+The upgrade permanently removes group records, memberships, transcripts, group-only runtime state, and group library entries.
+
+Remove files stored only for groups. Preserve any file bytes still referenced by a bot's library, including identical uploads shared by content hash.
+
+Cleanup must finish before normal server work starts. Interrupted cleanup must be safe to retry without deleting direct-chat data.
+
+Preserve the existing migration history. Add forward migration and upgrade cleanup as needed; do not reset the database or run cleanup against production during implementation.
+
+This change does not erase backups, bot memory, or copies already present in a bot's own chat or workspace. It provides no export or conversion into direct chats. Self-hosters must back up before upgrading; restoring a backup is the recovery path.
+
+## Interfaces and implementation scope
+
+- Remove group endpoints, event variants, types, and generated OpenAPI definitions. No deprecated group API or compatibility shim remains.
+- Remove group-only services, storage, UI components, and tests. Simplify shared code only where its group branch becomes unnecessary.
+- Preserve direct-chat API behavior. Older native clients lose group functionality; changes to the Apple and Android repositories are outside this change.
+- Update current user and contributor documentation, the canonical glossary, and the changelog. Historical plans, decisions, release notes, and migrations remain historical records.
+- Add no dependencies and make no unrelated refactors.
+
+## Alternatives
+
+Hiding the UI leaves the group API, runtime, and maintenance cost in place. Preserving inaccessible data avoids irreversible deletion but leaves obsolete storage behind. Full removal with data deletion matches the owner's requested scope.
+
+The main cost is a breaking API change and irreversible deletion on upgrade. Neither is hidden behind a feature flag.
+
+## Acceptance criteria
+
+- No active server, web, or contract code supports group chats; remaining references are migration cleanup or historical records.
+- An upgrade with existing groups removes their records, history, runtime state, and exclusively owned files.
+- A fresh database initializes without group support.
+- Repeating cleanup after interruption completes safely.
+- Member bots, direct-chat history, bot libraries, and content-hash files still referenced by bots survive unchanged.
+- Existing direct-chat checks pass. Generated OpenAPI files match the reduced contract.
+- Run `bun run check` at the repository root and `bun run check` in `apps/docs`. Report failures and skipped verification.
+
+## Review
+
+Approve this scope before implementation planning. The implementation plan will identify the exact migration and disk-cleanup sequence.
diff --git a/docs/native-push.md b/docs/native-push.md
index 5b82743d..078324fe 100644
--- a/docs/native-push.md
+++ b/docs/native-push.md
@@ -13,7 +13,7 @@ Authenticated push notification registration and delivery for iOS and Android (a
## Outbox and payload
-Completed owner, task, job-report, and group replies, and desktop job actions held for approval, create a durable outbox event in `push.sqlite`. Replies are suppressed for devices holding an active presence lease on the same bot chat. Retries use exponential backoff (1s to 64s, up to 8 attempts, 24h expiry); permanently rejected tokens disable only the matching registration.
+Completed owner, task, and job-report replies, and desktop job actions held for approval, create a durable outbox event in `push.sqlite`. Replies are suppressed for devices holding an active presence lease on the same bot chat. Retries use exponential backoff (1s to 64s, up to 8 attempts, 24h expiry); permanently rejected tokens disable only the matching registration.
```json
{
@@ -25,14 +25,12 @@ Completed owner, task, job-report, and group replies, and desktop job actions he
"entryId": "entry UUID or null",
"origin": "owner|task|coding|desktop",
"jobName": "optional job name",
- "groupId": "optional group UUID",
- "groupName": "optional group name",
"waitingFor": "optional: approval|credential|login",
"preview": "…",
"createdAt": "ISO-8601"
}
```
-- **APNs:** Sends an alert with the bot/group title, preview, default sound, and full root payload fields. Requires `CRUMBLE_APNS_TEAM_ID`, `CRUMBLE_APNS_KEY_ID`, `CRUMBLE_APNS_PRIVATE_KEY_PATH`, and `CRUMBLE_APNS_ALLOWED_TOPICS`.
+- **APNs:** Sends an alert with the bot title, preview, default sound, and full root payload fields. Requires `CRUMBLE_APNS_TEAM_ID`, `CRUMBLE_APNS_KEY_ID`, `CRUMBLE_APNS_PRIVATE_KEY_PATH`, and `CRUMBLE_APNS_ALLOWED_TOPICS`.
- **FCM:** Sends high-priority data-only HTTP v1 messages (string values, `""` for null `entryId`). Requires `CRUMBLE_FCM_SERVICE_ACCOUNT_PATH`.
- **Fallback:** When neither provider is configured, `remoteDelivery` is `false` and clients post local notifications from `/v1/events`.
diff --git a/docs/plans/2026-10-20-group-chats-m1.md b/docs/plans/2026-10-20-group-chats-m1.md
index 2e61770f..27a7c434 100644
--- a/docs/plans/2026-10-20-group-chats-m1.md
+++ b/docs/plans/2026-10-20-group-chats-m1.md
@@ -1,5 +1,7 @@
# Group chats, milestone 1: group store and owner API — Implementation Plan
+> Superseded by [Remove group chats](../designs/remove-group-chats.md). This document records the original design.
+
> Implement one task at a time. Review each deliverable before starting the next. Steps use `- [ ]`.
**Goal:** The owner can create, rename, change, and delete group chats and post messages into a shared group transcript over the HTTP API, with live updates. Bots do not answer yet.
diff --git a/docs/plans/2026-10-21-group-chats-m2.md b/docs/plans/2026-10-21-group-chats-m2.md
index d03c8f0f..dcafb66d 100644
--- a/docs/plans/2026-10-21-group-chats-m2.md
+++ b/docs/plans/2026-10-21-group-chats-m2.md
@@ -1,5 +1,7 @@
# Group chats milestone 2: turns
+> Superseded by [Remove group chats](../designs/remove-group-chats.md). This document records the original design.
+
> Implement one task at a time. Review each deliverable before starting the next. Steps use `- [ ]`.
**Goal:** Members answer in group chats: owner and bot messages start turns by the routing rules, bounded by the turn budget and a stop control.
diff --git a/docs/plans/2026-10-21-group-chats-m3.md b/docs/plans/2026-10-21-group-chats-m3.md
index 8501d3e3..99ef0cfb 100644
--- a/docs/plans/2026-10-21-group-chats-m3.md
+++ b/docs/plans/2026-10-21-group-chats-m3.md
@@ -1,5 +1,7 @@
# Group chats milestone 3: joining, notifications, and attachments
+> Superseded by [Remove group chats](../designs/remove-group-chats.md). This document records the original design.
+
> Implement one task at a time. Review each deliverable before starting the next. Steps use `- [ ]`.
**Goal:** A bot that joins a group gets a summary of the earlier conversation, the owner is notified for exactly the group events the specification names, and group messages carry attachments as bot chat messages do.
diff --git a/docs/plans/2026-10-21-group-chats-m4.md b/docs/plans/2026-10-21-group-chats-m4.md
index fd75b62f..445f5a44 100644
--- a/docs/plans/2026-10-21-group-chats-m4.md
+++ b/docs/plans/2026-10-21-group-chats-m4.md
@@ -1,5 +1,7 @@
# Group chats milestone 4: memory sources and group lookup
+> Superseded by [Remove group chats](../designs/remove-group-chats.md). This document records the original design.
+
> Implement one task at a time. Review each deliverable before starting the next. Steps use `- [ ]`.
**Goal:** Every memory records where it came from, group turns write only to the bot's own memory, and a bot can look up its group chats from its bot chat.
diff --git a/docs/plans/2026-10-21-group-chats-m5.md b/docs/plans/2026-10-21-group-chats-m5.md
index d1aff46c..c756de37 100644
--- a/docs/plans/2026-10-21-group-chats-m5.md
+++ b/docs/plans/2026-10-21-group-chats-m5.md
@@ -1,5 +1,7 @@
# Group chats milestone 5: group snapshot event schema
+> Superseded by [Remove group chats](../designs/remove-group-chats.md). This document records the original design.
+
> Implement one task at a time. Review each deliverable before starting the next. Steps use `- [ ]`.
**Goal:** Clients can generate and validate group chat stream events from an exported schema, as they do for bot chats.
diff --git a/docs/plans/2026-11-22-remove-group-chats.md b/docs/plans/2026-11-22-remove-group-chats.md
new file mode 100644
index 00000000..c788d1f1
--- /dev/null
+++ b/docs/plans/2026-11-22-remove-group-chats.md
@@ -0,0 +1,341 @@
+# Remove group chats implementation plan
+
+> Implement one task at a time. Review each deliverable before starting the next. Steps use `- [ ]`.
+
+**Status:** implemented and verified within the limits recorded below; approved for commit and push by the owner.
+
+**Goal:** remove group chats and permanently delete their data without changing direct bot chats.
+
+**Architecture:** keep only the direct-chat runtime and library ownership model. Run a restart-safe upgrade before starting normal server work, then remove group APIs and UI. Retain historical migrations and isolate any unavoidable legacy-data handling in upgrade cleanup.
+
+**Source:** [approved removal spec](../designs/remove-group-chats.md).
+
+## Decisions
+
+- Remove the feature completely, not behind a flag or hidden navigation.
+- Permanently delete group history and files. The owner selected deletion instead of inaccessible retention.
+- Preserve member bots, their direct chats, their libraries, and file bytes still referenced by a bot.
+- Remove group APIs without compatibility shims. Do not change native-client repositories.
+- Preserve bot-owned memory and learned changes; normalize group provenance rather than keeping active group domain types.
+- Do not apply cleanup to real account data during implementation. Use temporary fixtures only.
+
+## Constraints
+
+- No new dependencies or unrelated refactors.
+- Follow `GLOSSARY.md` and the root `AGENTS.md` instructions.
+- Read `apps/server/node_modules/effect/AGENTS.md` completely before writing Effect code.
+- Generate store migrations with `bun run --cwd apps/server db:generate --name remove_group_chats`.
+- Regenerate contracts with `bun run openapi:generate`.
+- Run `bun run check` at the root and `bun run check` from `apps/docs`.
+- Never commit, push, stage, or open a pull request without permission.
+
+## Out of scope
+
+Exports, conversion into direct chats, backup deletion, secure erasure, native-client updates, and changes to unrelated jobs or gateways.
+
+## Review focus
+
+1. A file uploaded both to a group and a bot remains downloadable from the bot library, including its extracted text.
+2. Archived private group histories, including former members and deleted groups, disappear without deleting the direct conversation.
+3. Cleanup removes group pins and queued notifications without affecting bot pins and notifications.
+4. Interrupted cleanup retries before normal work starts; a failed cleanup blocks startup instead of resuming group work.
+5. Retained memory and learned-change records remain readable after group provenance is normalized.
+
+## Files
+
+Paths use the existing feature layout. All paths in each task's inventory are in scope; record additional callers in Deviations.
+
+- Create `apps/server/src/app/group-chat-upgrade.ts` and `group-chat-upgrade.test.ts` for isolated upgrade cleanup and destructive-data coverage.
+- Modify startup, persisted schemas, and shared consumers listed in Tasks 1–2. Keep all existing migration SQL and snapshots unchanged.
+- Remove `apps/server/src/group-chats/`, `apps/server/src/contract/group-chats.ts`, and `apps/web/features/group-chats/` after their callers are removed.
+- Update the web consumers in Task 3 and current documentation in Task 4.
+- Regenerate `openapi/` and explicitly remove `openapi/group-chat-snapshot.schema.json`; the generator does not prune obsolete artifacts (`apps/server/src/contract/openapi.ts`).
+
+### Task 1: add the destructive upgrade safely
+
+**Files:** create the upgrade module and test listed in Files; modify `apps/server/src/app/{server,tenant,auth}.ts`. Extend `apps/server/src/app/{auth,server}.test.ts` for pins and startup ordering. Leave active schema/type removal and generated migrations to Task 2.
+
+**Interfaces:**
+
+- Consumes: account paths from `apps/server/src/app/data-dir.ts`; `createTenant(options: TenantOptions)` and its `ManagedRuntime.make` boundary (`app/tenant.ts`); store migration on layer acquisition (`shared/product-database.ts`); auth migrations before `betterAuth(options)` (`app/auth.ts:293–294`).
+- Consumes: legacy `group_chats`, `group_members`, `group_turns`, library owners, push state, and private conversation marker `crumble.group-conversation` (`group-chats/group-conversation.ts`).
+- Produces: new `removeLegacyGroupChats(accountDirectory: string): Promise` in `app/group-chat-upgrade.ts`. `restoreTenants` must complete a cleanup pass over every existing valid account before its tenant-start pass (`app/server.ts:200`). Also guard `createTenant` before `ManagedRuntime.make` for direct and lazy initialization. Repeated cleanup is harmless. Propagate errors so no bot or push layer starts after failed cleanup.
+- Produces: an idempotent auth pin cleanup after auth schema migration and before Better Auth starts; remove only `group:` entries, preserving `agent:` pins and their ordering.
+
+- [x] Record a clean verification baseline with `bun run check`; report unrelated failures before changing code.
+- [x] Inventory group state before dropping any table needed to identify private conversations or file references. Inspect existing databases only; do not create absent legacy databases. Skip tables absent on older or fresh installations.
+- [x] Keep cleanup offline, before product migrations and runtime acquisition. Atomically persist an account-local `group-chat-removal.json` inventory before destructive work. Include private conversation/task identifiers, store conversation/execution IDs, and group file hashes; never store transcript content. Reuse it after interruption and remove it only when every cleanup phase succeeds. Validate paths and do not follow symlinks out of the account directory. Never swallow errors or mark an interrupted upgrade complete.
+- [x] Remove `groups/` SQLite files and their `-wal`/`-shm` companions, including orphans. These files contain shared transcripts; private histories require the separate purge described next.
+- [x] Implement the selective Pi purge using the verified ownership rules in the Private history purge section.
+- [x] For group library rows, delete a hash's bytes and `.txt`/`.pdf.txt` derivatives only when no bot library references the hash. Leave the group rows available for retry until file removal succeeds, then delete group entries and tombstones.
+- [x] Purge group `chat_views` and `reply_associations` from `push.sqlite`; remove matching `push_outbox` rows, including events with `groupId` or origin `group`, and their delivery rows. Preserve devices, credentials, settings, and bot notifications.
+- [x] Normalize `memories.source` with kind `group` to null. Apply the same normalization to memory snapshots in learned changes. Remove group IDs and purged conversation/execution references from learned-change provenance, retaining record IDs, actors, target content, and revert chains. Clear skill provenance pointing to purged executions.
+- [x] Delete group records, memberships, and turns, then the matching store conversations, executions, pending reviews, and review results. Use the restart inventory to respect foreign-key ordering. Preserve learned-change records, bot-owned memories, skills, and unrelated conversations, including reviews and outside calls.
+- [x] Add focused upgrade coverage after implementing cleanup: use isolated fixtures containing former members, deleted groups, direct-chat sentinels, shared blobs, retained provenance, and interruption/retry. Assert no workers start on cleanup failure and all accounts finish cleanup before any worker starts. Verify a fresh directory too.
+- [x] Run `bun test apps/server/src/app/group-chat-upgrade.test.ts apps/server/src/app/auth.test.ts apps/server/src/app/server.test.ts`. Expected: cleanup assertions pass and unrelated data remains unchanged.
+
+#### Private history purge
+
+Pi Durable 1.4.0 has no selective conversation-deletion API. Keep physical-schema handling inside the offline upgrade module, not the normal runtime. `shared/harness-files.ts` opens storage without prefix options, so the application uses default table names.
+
+- Identify all tasks with JSON-encoded kind `crumble.group-anchor`, including terminal tasks. Compare using `json_quote('crumble.group-anchor')`, not an unquoted SQL string. See `group-chats/group-turns.ts` and `shared/anchor-task.ts`.
+- Select conversations whose `owner_task_id` identifies an anchor. `AgentRuntime.openAnchored` creates the anchor inside the direct conversation and a child conversation owned by the anchor (`bots/runtime.ts`). **Never include the anchor's containing conversation.**
+- Expand downward to tasks in selected conversations, their owned tasks, conversations owned by selected tasks, and conversations owned by selected conversations. Do not follow inherited-history parents upward.
+- Capture selected task, conversation, entry, submission, and document IDs in the restart inventory. Map Pi conversation IDs to store IDs with `formatEntryId(agentId, localId)` (`shared/entry-ids.ts`). This covers former members and deleted groups without relying on membership rows.
+- In one transaction per bot database, delete selected `document_revisions`, `documents`, `entries`, `submissions`, `tasks`, `conversations`, and their `record_ids` registrations. Include retired documents and task-scoped documents. There are no automatic cascades for this cleanup.
+- Preserve the direct/root conversation, unrelated reviews and outside calls, session-scoped documents, `durable_schema`, and `durable_metadata`, including ID and sequence counters.
+- Check the installed 1.4.0 schema and exported `CURRENT_SQLITE_SCHEMA_VERSION` before destructive SQL. Physical schema sources are the installed `@earendil-works/pi-durable/dist/storage/sqlite/{schema.js,migrations.js}`. Reject an unsupported shape rather than guessing.
+- Before deletion, reject any retained conversation inheriting from a selected conversation. Abort with an actionable error instead of destroying retained history. Verify this guard with a fixture.
+
+### Task 2: remove the server runtime and contract
+
+**Files:** remove `apps/server/src/group-chats/` and its feature-only tests. Modify these existing consumers under `apps/server/src/`:
+
+- Wiring: `app/{tenant,product-layer,api,api-requests}.ts`.
+- Runtime: `bots/{runtime,bots-admission,bots-submissions,bots-context}.ts`, `shared/{request-ids,chat-only,entry-ids}.ts`, `bot-ports/bot-extensions.ts`.
+- Transcript and search: `transcript/{entries,transcript,origins}.ts`, `history/{history-search,history-tools}.ts`.
+- Knowledge: `memory/{bot-memory,memory-tool,memory-sources,memory-repository}.ts`, `learned-changes/{change-source,learned-change-repository,review-conversation}.ts`, `learning/review-kind.ts`, `skills/skill-library.ts`, `shared/domain.ts`.
+- Schemas: `files/schema.ts`, `push/schema.ts`, `shared/domain.ts`, and the removed `group-chats/schema.ts`; new generated store migration and snapshot under `apps/server/drizzle/store/`.
+- Libraries: `files/{library-repository,library,library-tool,files-api}.ts`.
+- Notifications: `push/{push,chat-attention,push-repository,push-model,push-transports}.ts`; `app/auth.ts` and its pin parser from Task 1.
+- Remaining consumers: `bot-messaging/bot-messaging.ts`, `bot-desktop/desktop-screenshot.ts`, `jobs/workspace-notes.ts`.
+- Contract: remove `contract/group-chats.ts`; modify `contract/{api-contract,api-responses,reply-event,push,user-preferences,limits}.ts` and generated `openapi/` artifacts.
+- Existing mixed-feature tests and support in these directories, plus `apps/server/test/support/{store,store-bots,api,runtime-callbacks}.ts`; adjust group cases without deleting direct-chat assertions.
+
+**Interfaces:**
+
+- Consumes: Task 1's completed upgrade and bot-only persisted state.
+- Produces: a direct-chat-only server with no group routes, tools, services, or events.
+
+- [x] Remove group services, orchestration, prompts, tools, routes, and event variants, including startup resumption.
+- [x] Simplify shared transcript, execution, library, job, notification, and ownership branches only where group behavior is removed. Keep conversation-kind infrastructure used by learning reviews and outside calls.
+- [x] Move the mention-name `normalize` helper out of the deleted group feature into `bot-messaging/bot-messaging.ts`, its surviving consumer; preserve direct bot messaging behavior.
+- [x] Make library entries bot-owned only; remove group owner columns, foreign keys, checks, and indexes. Drop the group tables after Task 1 has removed their dependent data. Generate the forward store migration with `bun run --cwd apps/server db:generate --name remove_group_chats`; inspect its SQL for direct-data preservation. Leave historical SQL and snapshots unchanged. Narrow push chat kinds and generate a push migration with `bun run --cwd apps/server db:generate:push --name remove_group_chats` only if SQL constraints change.
+- [x] Preserve all direct-chat semantics and remove group-only tests and fixtures alongside their implementation. Keep legacy input fixtures that Task 1's upgrade coverage needs.
+- [x] Regenerate `openapi/` with `bun run openapi:generate` and explicitly remove `openapi/group-chat-snapshot.schema.json`. Keep all non-group endpoints and event fields unchanged.
+- [x] Run `bun run typecheck`, `bun run openapi:check`, and relevant existing server tests; repair only removal-related failures.
+
+### Task 3: remove the web interface
+
+**Files:** remove `apps/web/features/group-chats/{api.ts,groups.tsx}`. Modify existing files under `apps/web/`: `app/{router.tsx,shell.tsx,command-palette.tsx,activity-stream.ts}`, `features/chat/{conversation-target.ts,conversation.tsx,delivery.ts,transcript.tsx,drafts.ts}`, `features/library/{api.ts,library.tsx,files-view.tsx}`, `features/memory/memory.tsx`, `lib/{pins.ts,notifications.ts}`, and their affected DOM tests.
+
+**Interfaces:**
+
+- Consumes: Task 2's direct-chat-only routes and events.
+- Produces: a web client with bot navigation only; stale group links recover to normal bot navigation.
+
+- [x] Remove group navigation, creation, settings, members, transcripts, composers, libraries, and event subscriptions.
+- [x] Simplify shared components and stores to bot-only behavior without unrelated visual changes.
+- [x] Remove obsolete `crumble.draft:group:` local-storage entries without touching bot drafts. Remove group pin and notification navigation branches.
+- [x] Configure a router not-found view using the existing empty-state layout and a **Go home** action. Old `/groups/` links must use it without retaining group routes or requesting a group API. Verify the bot interface still loads.
+- [x] Run `bun run typecheck` and existing relevant web tests. Check the bot interface manually using disposable data if a server is started.
+
+### Task 4: update documentation and verify the complete removal
+
+**Files:** remove `apps/docs/content/concepts/group-chats.md` and its navigation links. Update these existing pages under `apps/docs/content/`: `concepts/{chats.mdx,memory-and-skills.md,workspaces.mdx,web-search.md}`, `clients/web.md`, `getting-started/{first-bot.md,providers.md}`, `reference/{api.md,glossary.md}`, `contributing/{index.md,architecture.mdx}`, and `self-hosting/configuration.md`. Update root `GLOSSARY.md`, `CHANGELOG.md`, and `docs/{architecture.md,api-contract.md,native-push.md}`. Mark historical group specs or ADRs as superseded with a link to the removal spec; do not rewrite their original decisions.
+
+**Interfaces:**
+
+- Consumes: Tasks 1–3's bot-only behavior and contract.
+- Produces: current documentation matching the removed feature, plus recorded verification.
+
+- [x] Update current user and contributor documentation, `GLOSSARY.md`, and `CHANGELOG.md`; preserve historical plans, decisions, migrations, and release notes.
+- [x] Document the breaking removal, permanent deletion, and the need to back up before upgrading.
+- [x] Audit remaining group references. Permit only historical records, upgrade cleanup, and its verification; keep unrelated uses of “group.” The initial scan found no feature references in `apps/site`; change the landing page only if the final audit finds one.
+- [x] Run `bun run check` at the root and `bun run check` in `apps/docs`.
+- [x] Record all failed or skipped verification and run a fresh-context `vet` review against the spec and this plan's deviations.
+
+## Execution and handoff
+
+Use one implementer for the sequence: upgrade ordering, runtime deletion, and shared types are tightly coupled. Do not parallelize edits across these tasks.
+
+## Deviations
+
+- Task 1, baseline · planned: a clean root check · did: accepted the supplied pre-edit baseline and reran the root check after implementation · why: existing failures are outside this task. The pre-edit baseline had 43 lint errors in Emulate tools and avatar code; server typecheck passed; web typecheck had six avatar errors. The supplied full-test baseline was 1329 passing, 118 skipped, three failing, and one error.
+- Task 1, inventory · planned: inspect existing databases offline · did: open with `create: false` and enforce `PRAGMA query_only = ON` during inventory · why: read-only connections failed with `SQLITE_CANTOPEN` on cold Pi WAL databases in the real server restart test. SQLite can maintain sidecars; no absent database is created and no product or Pi migration runs during cleanup.
+- Task 1, purge ordering · planned: list shared-file removal before selective Pi cleanup · did: purge inventoried private histories before removing shared SQLite files · why: replay validates Pi safety before removing shared history. Both phases remain restart-safe.
+- Task 1, review coverage · included job-turn review IDs without store executions, using the existing `jobTurnId` encoding in `shared/request-ids.ts`. Pending and completed group-job review results are covered by fixtures. No additional source modules were needed.
+- Task 1, server regression · converted the existing group-persistence restart test into deletion coverage, preserving member-bot assertions. Group routes and persisted schemas remain until Task 2.
+
+### Task 1 verification
+
+- Focused command from Task 1: **41 passed, zero failed**, 272 assertions, approximately 2.72 seconds. Fixtures cover archived former/deleted-group histories, retained root/review/call records, counters, documents, shared blobs and derivatives, provenance and actual memory reversion, interruption/retry, unsafe schema/inheritance/path guards, replay protection for root/direct conversations, auth pins, and startup barriers.
+- `bunx tsc -p apps/server --noEmit`: passed.
+- `bun fmt --check` on all seven changed TypeScript files: passed. Scoped `oxlint --deny-warnings` on the four production modules: zero warnings and zero errors. Tests are excluded by the repository lint configuration. `git diff --check`: passed.
+- Final `bun run check`: failed at lint with the same **43 pre-existing errors** in avatar code and `tools/emulate*` / `tools/check-emulate.ts`; no Task 1 errors remain. Later root-check stages did not run. The full suite and docs checks were not rerun for this task.
+- No staging, commits, pushes, real account data, external APIs, or secrets were used. The approved spec was not edited.
+
+### Required Task 2 follow-up
+
+Completed in Task 2: cleanup skips Pi validation when `__drizzle_migrations` records `20261122205418_remove_group_chats`, unless an unfinished manifest exists. Legacy accounts without that migration still purge. Fixtures prove future Pi schema versions do not block completed upgrades, while unfinished manifests still trigger the schema guard.
+
+### Task 2 deviations and implementation notes
+
+- Removed the active group runtime, routes, contracts, persistence wiring, and feature-only tests. Mixed tests retain direct-chat, two-bot isolation, review, call, workspace, and notification assertions. The anchored-conversation concurrency test uses a local test anchor rather than the removed feature.
+- Expanded transcript cleanup to `transcript/citations.ts` and its mixed test: removed group-only attached sources while retaining direct tool-derived citations and turn resets. Removed the obsolete optional cross-library resolver argument from runtime callbacks.
+- Removed obsolete `chatOnly` wrappers from `jobs/jobs.ts`, bot coordination, and voice gateway extensions. Kept the outside-call marker and conversation-kind infrastructure. Removed group limits from `shared/limits.ts`. These extra callers were necessary to finish the removal.
+- Generated the forward store migration with `db:generate`. Inspected SQL rebuilds both library tables while preserving bot columns, IDs, tombstones, hashes, and the bot-hash unique index. Library references are removed before group children and then their parent. Group drops use `IF EXISTS` for partial older installations. Historical migrations and snapshots were not edited.
+- No push migration was needed: the narrowed Drizzle text enum has no physical SQLite constraint change.
+- Legacy fixtures reconstruct group tables and library ownership from historical SQL, without deleted imports. Added an actual Pi-backed runtime fixture with a local legacy anchor. It closes the runtime before purging and verifies direct history and counters remain unchanged.
+- Older migration tests now roll back named migration ranges, not a fragile count of latest migrations. Direct behavior assertions remain.
+- Web and combined root typechecking are deferred to Task 3 at the user's direction. No web or user-facing docs code was edited. The approved spec was not edited.
+
+### Task 2 verification
+
+- `bunx tsc -p apps/server --noEmit`: passed.
+- Focused upgrade/auth/server tests: **44 passed, zero failed**, 293 assertions, 2.93 seconds. Upgrade coverage includes fresh install, old-to-new migration, preserved shared bytes/derivatives, completion gate, unfinished-manifest precedence, real legacy harness, and Task 1 safety/retry fixtures.
+- Full command `bun test --parallel apps/server/src apps/server/test`: **1156 passed, 118 skipped, zero failed**, 5212 assertions across 128 files, 12.87 seconds. Skips are opt-in integration tests. No real APIs or account data were used.
+- `bun run openapi:check`: passed after regeneration and explicit deletion of the obsolete group snapshot artifact.
+- Formatting applied to all changed server TypeScript files. Scoped `oxlint --deny-warnings`: **zero warnings and errors** across 58 production/support files; tests follow repository lint exclusions. `git diff --check`: passed.
+- No server/test-support imports of deleted group modules remain. No commits, staging, pushes, secrets, or real-data migrations. Tasks 3 and 4 are not started.
+
+### Task 2 exact file inventory
+
+Modified or added (relative to the repository root):
+
+- `apps/server/drizzle/store/20261122205418_remove_group_chats/migration.sql`
+- `apps/server/drizzle/store/20261122205418_remove_group_chats/snapshot.json`
+- `apps/server/src/app/api-requests.ts`
+- `apps/server/src/app/api.test.ts`
+- `apps/server/src/app/api.ts`
+- `apps/server/src/app/auth.test.ts`
+- `apps/server/src/app/group-chat-upgrade.test.ts`
+- `apps/server/src/app/group-chat-upgrade.ts`
+- `apps/server/src/app/product-layer.ts`
+- `apps/server/src/app/server.test.ts`
+- `apps/server/src/app/tenant.ts`
+- `apps/server/src/bot-desktop/desktop-screenshot.ts`
+- `apps/server/src/bot-messaging/bot-messaging.test.ts`
+- `apps/server/src/bot-messaging/bot-messaging.ts`
+- `apps/server/src/bot-messaging/coordination.ts`
+- `apps/server/src/bot-ports/bot-extensions.ts`
+- `apps/server/src/bots/bots-admission.ts`
+- `apps/server/src/bots/bots-context.ts`
+- `apps/server/src/bots/bots-submissions.ts`
+- `apps/server/src/bots/chat.test.ts`
+- `apps/server/src/bots/runtime-behavior.test.ts`
+- `apps/server/src/bots/runtime.ts`
+- `apps/server/src/contract/api-contract.ts`
+- `apps/server/src/contract/api-responses.ts`
+- `apps/server/src/contract/limits.ts`
+- `apps/server/src/contract/message-files.test.ts`
+- `apps/server/src/contract/push.ts`
+- `apps/server/src/contract/reply-event.ts`
+- `apps/server/src/contract/user-preferences.ts`
+- `apps/server/src/files/files-api.test.ts`
+- `apps/server/src/files/files-api.ts`
+- `apps/server/src/files/library-cleanup.test.ts`
+- `apps/server/src/files/library-repository.test.ts`
+- `apps/server/src/files/library-repository.ts`
+- `apps/server/src/files/library-tool.test.ts`
+- `apps/server/src/files/library-tool.ts`
+- `apps/server/src/files/library.test.ts`
+- `apps/server/src/files/library.ts`
+- `apps/server/src/files/schema.ts`
+- `apps/server/src/history/history-search.test.ts`
+- `apps/server/src/history/history-search.ts`
+- `apps/server/src/history/history-tools.test.ts`
+- `apps/server/src/history/history-tools.ts`
+- `apps/server/src/jobs/coding.test.ts`
+- `apps/server/src/jobs/jobs.ts`
+- `apps/server/src/jobs/workspace-notes.ts`
+- `apps/server/src/learned-changes/change-source.ts`
+- `apps/server/src/learned-changes/learned-change-repository.ts`
+- `apps/server/src/learned-changes/review-conversation.ts`
+- `apps/server/src/learning/learning-review.test.ts`
+- `apps/server/src/learning/review-kind.ts`
+- `apps/server/src/memory/bot-memory.test.ts`
+- `apps/server/src/memory/bot-memory.ts`
+- `apps/server/src/memory/memory-sources.test.ts`
+- `apps/server/src/memory/memory-sources.ts`
+- `apps/server/src/memory/memory-tool.ts`
+- `apps/server/src/push/chat-attention.ts`
+- `apps/server/src/push/push-model.ts`
+- `apps/server/src/push/push-transports.test.ts`
+- `apps/server/src/push/push-transports.ts`
+- `apps/server/src/push/push.test.ts`
+- `apps/server/src/push/push.ts`
+- `apps/server/src/push/schema.ts`
+- `apps/server/src/shared/chat-only.ts`
+- `apps/server/src/shared/domain.ts`
+- `apps/server/src/shared/entry-ids.ts`
+- `apps/server/src/shared/limits.ts`
+- `apps/server/src/shared/request-ids.test.ts`
+- `apps/server/src/shared/request-ids.ts`
+- `apps/server/src/shared/store.test.ts`
+- `apps/server/src/skills/skill-installer.test.ts`
+- `apps/server/src/skills/skill-library.ts`
+- `apps/server/src/transcript/citations.test.ts`
+- `apps/server/src/transcript/citations.ts`
+- `apps/server/src/transcript/entries.ts`
+- `apps/server/src/transcript/origins.ts`
+- `apps/server/src/transcript/transcript.ts`
+- `apps/server/src/voice-gateway/call-owner.ts`
+- `apps/server/src/voice-gateway/request-call.ts`
+- `apps/server/test/support/api.ts`
+- `apps/server/test/support/runtime-callbacks.ts`
+- `apps/server/test/support/store-bots.ts`
+- `apps/server/test/support/store.ts`
+- `docs/plans/2026-11-22-remove-group-chats.md`
+- `openapi/activity-event.schema.json`
+- `openapi/chat-snapshot.schema.json`
+- `openapi/openapi.json`
+- `openapi/pins-event.schema.json`
+
+Deleted:
+
+- `apps/server/src/contract/group-chats.ts`
+- `apps/server/src/group-chats/group-chat-context.ts`
+- `apps/server/src/group-chats/group-chat-members.ts`
+- `apps/server/src/group-chats/group-chat-post.ts`
+- `apps/server/src/group-chats/group-chat-repository.ts`
+- `apps/server/src/group-chats/group-chat-service.ts`
+- `apps/server/src/group-chats/group-chat-types.ts`
+- `apps/server/src/group-chats/group-chats-api.test.ts`
+- `apps/server/src/group-chats/group-chats-api.ts`
+- `apps/server/src/group-chats/group-chats-test-support.ts`
+- `apps/server/src/group-chats/group-chats.test.ts`
+- `apps/server/src/group-chats/group-chats.ts`
+- `apps/server/src/group-chats/group-conversation.ts`
+- `apps/server/src/group-chats/group-lookup.test.ts`
+- `apps/server/src/group-chats/group-lookup.ts`
+- `apps/server/src/group-chats/group-mentions.test.ts`
+- `apps/server/src/group-chats/group-mentions.ts`
+- `apps/server/src/group-chats/group-transcripts.test.ts`
+- `apps/server/src/group-chats/group-transcripts.ts`
+- `apps/server/src/group-chats/group-turn-engine.ts`
+- `apps/server/src/group-chats/group-turn-input.ts`
+- `apps/server/src/group-chats/group-turn-outcome.ts`
+- `apps/server/src/group-chats/group-turns.test.ts`
+- `apps/server/src/group-chats/group-turns.ts`
+- `apps/server/src/group-chats/schema.ts`
+- `openapi/group-chat-snapshot.schema.json`
+
+### Task 3 deviations and verification
+
+- Removed group navigation, routes, commands, events, notification targets, library ownership, and memory-source UI. Old links use the shared not-found view with **Go home**. Removed saved group drafts without touching bot drafts.
+- Converted shared delivery tests to bot chats and mixed pin/attention tests to multiple bots instead of deleting their surviving behavioral coverage. Updated `features/library/library.dom.test.tsx`, an additional caller of the simplified library component. No changes were needed in `features/library/files-view.tsx`.
+- Focused web command: 19 tests passed, zero failed across conversation, pins, attention, and library DOM suites.
+- Web typechecking reports only the same six pre-existing avatar errors found before implementation. No removal-related type errors remain.
+- Browser smoke testing was not run; existing avatar dependency errors still prevent a clean web build/typecheck. Old-link behavior is configured and typechecked, not manually verified.
+- The parent continued after the implementation agent completed server work; edits stayed sequential. The user authorized commit and push after completion; no pull request was requested.
+
+### Task 4 verification
+
+- Updated the canonical and public glossaries, current API/client/contributor guides, architecture notes, and changelog. Removed the group docs page; marked the original group ADR and plans superseded without rewriting their decisions.
+- Added backup, irreversible-deletion, compatibility, retained-data, failure, and retry guidance under self-hosting configuration.
+- The final audit found one extra live UI description in `apps/web/features/providers/vision-model-settings.tsx`; removed its group behavior claim. Remaining active-code references are the offline upgrade and its startup calls, with historical fixture/schema records preserved.
+- `bun run check`: failed at the same 43 pre-existing emulator/avatar lint errors, unchanged from baseline. Scoped lint across 76 changed production/support files: zero warnings or errors.
+- `bun run typecheck`: server passes; web has only the six pre-existing avatar errors. No removal-related type errors remain.
+- `bun run test`: 1,266 passed, 118 skipped, three failures and one error matching the pre-existing avatar and pending-save DOM failures. Full server verification separately passed: 1,156 passed, 118 skipped, zero failed.
+- Focused upgrade/auth/server tests: 44 passed. Focused conversation/pins/attention/library DOM tests: 19 passed.
+- Docs `bun run check` and `bun run build`: passed, 25 content pages, no broken links. Root formatting, OpenAPI drift, and `git diff --check`: passed. Formatted the new generated snapshot after the first formatting check identified it.
+- Fresh-context safety review found one high-severity gap: sibling learning reviews triggered by group executions could survive. Fixed as recorded next. Browser smoke testing, opted-in workspace integrations, and checks requiring real account data or external services were not run.
+
+### Review correction: sibling learning reviews
+
+- The review traced group-triggered learning reviews to separate `crumble.review-anchor` conversations under the direct/root conversation. The original descendant-only purge missed them.
+- Expanded offline inventory to pending-review links and materialized `crumble.review-conversation` documents. Match removed execution IDs or a legacy non-null `groupId`, including orphan reviews without execution or pending rows. Include selected review anchors and descendants in the existing manifest; preserve unrelated reviews and direct history.
+- Used the public SQLite storage document reader to reconstruct base/delta state without opening or resuming a harness. No dependency change or ad-hoc delta parser.
+- Regression before fix: `bun test apps/server/src/app/group-chat-upgrade.test.ts --test-name-pattern 'sibling group reviews'` failed because the manifest omitted `reviews:15` (zero passed, one failed). After the fix, focused upgrade/auth/server coverage passes: 45 passed, zero failed, 310 assertions. The fixture covers sibling/orphan reviews, interrupted cleanup, replay/reopen, retained direct reviews, and counters.
+- Parent independently reran the 45 tests, server typecheck, scoped lint, and formatting successfully. Final full server run after the correction: 1,157 passed, 118 skipped, zero failed (13.62 seconds). Docs, formatting, OpenAPI, and diff checks passed again. Commit and push hooks are bypassed because the independently established baseline lint/type/test failures remain. No unresolved review findings or `needs decision` entries remain. Review coverage was partial: cleanup/tests/migration, startup ordering, API-removal hunks, and changed web paths, not every unchanged caller or browser smoke test.
diff --git a/openapi/activity-event.schema.json b/openapi/activity-event.schema.json
index 5539c0ff..5b65d3fa 100644
--- a/openapi/activity-event.schema.json
+++ b/openapi/activity-event.schema.json
@@ -41,12 +41,6 @@
"jobName": {
"type": "string"
},
- "groupId": {
- "type": "string"
- },
- "groupName": {
- "type": "string"
- },
"waitingFor": {
"type": "string",
"enum": [
diff --git a/openapi/chat-snapshot.schema.json b/openapi/chat-snapshot.schema.json
index abf4021e..72ed492d 100644
--- a/openapi/chat-snapshot.schema.json
+++ b/openapi/chat-snapshot.schema.json
@@ -303,25 +303,6 @@
"toolDetails": {},
"presentation": {
"$ref": "#/$defs/MessagePresentation"
- },
- "sources": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "url": {
- "type": "string"
- },
- "title": {
- "type": "string"
- }
- },
- "required": [
- "url",
- "title"
- ],
- "additionalProperties": true
- }
}
},
"required": [
diff --git a/openapi/group-chat-snapshot.schema.json b/openapi/group-chat-snapshot.schema.json
deleted file mode 100644
index d099d682..00000000
--- a/openapi/group-chat-snapshot.schema.json
+++ /dev/null
@@ -1,576 +0,0 @@
-{
- "$schema": "https://json-schema.org/draft/2020-12/schema",
- "type": "object",
- "properties": {
- "messages": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "entryId": {
- "type": "string"
- },
- "requestId": {
- "type": "string"
- },
- "role": {
- "type": "string"
- },
- "content": {
- "type": "string"
- },
- "blocks": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/TranscriptBlock"
- }
- },
- "stopReason": {
- "type": "string"
- },
- "timestamp": {
- "type": "number"
- },
- "kind": {
- "type": "string"
- },
- "replyTo": {
- "type": "string"
- },
- "replyPreview": {
- "type": "string"
- },
- "replyReferences": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "eventId": {
- "type": "string",
- "minLength": 1
- },
- "surface": {
- "oneOf": [
- {
- "type": "object",
- "properties": {
- "kind": {
- "type": "string",
- "const": "text"
- }
- },
- "required": [
- "kind"
- ],
- "additionalProperties": true
- },
- {
- "type": "object",
- "properties": {
- "kind": {
- "type": "string",
- "const": "tool-card"
- },
- "toolCallId": {
- "type": "string",
- "minLength": 1
- }
- },
- "required": [
- "kind",
- "toolCallId"
- ],
- "additionalProperties": true
- },
- {
- "type": "object",
- "properties": {
- "kind": {
- "type": "string",
- "const": "held-action"
- },
- "actionId": {
- "type": "string",
- "minLength": 1
- }
- },
- "required": [
- "kind",
- "actionId"
- ],
- "additionalProperties": true
- }
- ]
- }
- },
- "required": [
- "eventId",
- "surface"
- ],
- "additionalProperties": true
- }
- },
- "origin": {
- "type": "object",
- "properties": {
- "kind": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "agentId": {
- "type": "string"
- },
- "via": {
- "type": "string"
- },
- "source": {
- "type": "string"
- }
- },
- "required": [
- "kind"
- ],
- "additionalProperties": true
- },
- "communication": {
- "type": "object",
- "properties": {
- "executionId": {
- "type": "string"
- },
- "fromAgentId": {
- "type": "string"
- },
- "fromName": {
- "type": "string"
- },
- "toAgentId": {
- "type": "string"
- },
- "toName": {
- "type": "string"
- },
- "status": {
- "type": "string",
- "enum": [
- "sent",
- "done",
- "failed",
- "cancelled"
- ]
- }
- },
- "required": [
- "executionId",
- "fromAgentId",
- "fromName",
- "toAgentId",
- "toName",
- "status"
- ],
- "additionalProperties": true
- },
- "jobQuestion": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "kind": {
- "type": "string"
- },
- "job": {
- "type": "string"
- },
- "options": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "multiple": {
- "type": "boolean"
- }
- },
- "required": [
- "id",
- "kind",
- "job"
- ],
- "additionalProperties": true
- },
- "heldAction": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "job": {
- "type": "string"
- }
- },
- "required": [
- "id",
- "job"
- ],
- "additionalProperties": true
- },
- "call": {
- "type": "object",
- "properties": {
- "callId": {
- "type": "string"
- },
- "direction": {
- "type": "string",
- "enum": [
- "inbound",
- "outbound"
- ]
- },
- "callee": {
- "type": "string"
- }
- },
- "required": [
- "callId",
- "direction"
- ],
- "additionalProperties": true
- },
- "files": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "mimeType": {
- "type": "string"
- },
- "size": {
- "type": "number"
- }
- },
- "required": [
- "id",
- "name",
- "mimeType",
- "size"
- ],
- "additionalProperties": true
- },
- {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "deleted": {
- "type": "boolean",
- "const": true
- }
- },
- "required": [
- "id",
- "deleted"
- ],
- "additionalProperties": true
- }
- ]
- }
- },
- "toolCallId": {
- "type": "string"
- },
- "toolName": {
- "type": "string"
- },
- "isError": {
- "type": "boolean"
- },
- "toolDetails": {},
- "presentation": {
- "$ref": "#/$defs/MessagePresentation"
- },
- "sources": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "url": {
- "type": "string"
- },
- "title": {
- "type": "string"
- }
- },
- "required": [
- "url",
- "title"
- ],
- "additionalProperties": true
- }
- }
- },
- "required": [
- "id",
- "entryId",
- "role",
- "content",
- "replyReferences"
- ],
- "additionalProperties": true
- }
- },
- "hasMore": {
- "type": "boolean"
- },
- "oldestEntryId": {
- "type": [
- "string",
- "null"
- ]
- },
- "groupChat": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "memberIds": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "createdAt": {
- "type": "string"
- },
- "updatedAt": {
- "type": "string"
- }
- },
- "required": [
- "id",
- "name",
- "memberIds",
- "createdAt",
- "updatedAt"
- ],
- "additionalProperties": true
- },
- "activity": {
- "type": "object",
- "properties": {
- "paused": {
- "type": "boolean"
- },
- "botTurns": {
- "type": "number"
- },
- "members": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "agentId": {
- "type": "string"
- },
- "status": {
- "type": "string",
- "enum": [
- "idle",
- "queued",
- "running",
- "disabled"
- ]
- },
- "error": {
- "type": [
- "string",
- "null"
- ]
- }
- },
- "required": [
- "agentId",
- "status",
- "error"
- ],
- "additionalProperties": true
- }
- }
- },
- "required": [
- "paused",
- "botTurns",
- "members"
- ],
- "additionalProperties": true
- },
- "updatedAt": {
- "type": "number"
- }
- },
- "required": [
- "messages",
- "hasMore",
- "oldestEntryId",
- "groupChat",
- "activity",
- "updatedAt"
- ],
- "additionalProperties": true,
- "$defs": {
- "TranscriptBlock": {
- "oneOf": [
- {
- "$ref": "#/$defs/TranscriptTextBlock"
- },
- {
- "$ref": "#/$defs/TranscriptThinkingBlock"
- },
- {
- "$ref": "#/$defs/TranscriptImageBlock"
- },
- {
- "$ref": "#/$defs/TranscriptToolCallBlock"
- }
- ]
- },
- "TranscriptTextBlock": {
- "type": "object",
- "properties": {
- "type": {
- "type": "string",
- "const": "text"
- },
- "text": {
- "type": "string"
- }
- },
- "required": [
- "type",
- "text"
- ],
- "additionalProperties": true
- },
- "TranscriptThinkingBlock": {
- "type": "object",
- "properties": {
- "type": {
- "type": "string",
- "const": "thinking"
- },
- "thinking": {
- "type": "string"
- },
- "redacted": {
- "type": "boolean"
- }
- },
- "required": [
- "type",
- "thinking"
- ],
- "additionalProperties": true
- },
- "TranscriptImageBlock": {
- "type": "object",
- "properties": {
- "type": {
- "type": "string",
- "const": "image"
- },
- "mimeType": {
- "type": "string"
- }
- },
- "required": [
- "type",
- "mimeType"
- ],
- "additionalProperties": true
- },
- "TranscriptToolCallBlock": {
- "type": "object",
- "properties": {
- "type": {
- "type": "string",
- "const": "toolCall"
- },
- "id": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "arguments": {
- "type": "object",
- "additionalProperties": {}
- }
- },
- "required": [
- "type",
- "id",
- "name",
- "arguments"
- ],
- "additionalProperties": true
- },
- "MessagePresentation": {
- "type": "object",
- "properties": {
- "text": {
- "type": "string"
- },
- "citations": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/Citation"
- }
- }
- },
- "required": [
- "text",
- "citations"
- ],
- "additionalProperties": true
- },
- "Citation": {
- "type": "object",
- "properties": {
- "href": {
- "type": "string"
- },
- "title": {
- "type": "string"
- },
- "site": {
- "type": "string"
- }
- },
- "required": [
- "href",
- "title",
- "site"
- ],
- "additionalProperties": true
- }
- }
-}
diff --git a/openapi/openapi.json b/openapi/openapi.json
index 84c363b1..a7d8b848 100644
--- a/openapi/openapi.json
+++ b/openapi/openapi.json
@@ -54,7 +54,7 @@
},
"origin": {
"type": "string",
- "description": "What the bot answered: owner (a message from the owner), task (a scheduled task), script (a script task's result), bot (another bot's request), group (a group chat turn), or coding or desktop (a job's report; jobName names the job). Clients may receive other values later."
+ "description": "What the bot answered: owner (a message from the owner), task (a scheduled task), script (a script task's result), bot (another bot's request), or coding or desktop (a job's report; jobName names the job). Clients may receive other values later."
},
"preview": {
"type": "string"
@@ -69,13 +69,6 @@
"type": "string",
"description": "The job whose report the bot answered, for origin coding or desktop. A desktop job's report often asks for the owner; clients may open the bot desktop."
},
- "groupId": {
- "type": "string",
- "description": "Set when a bot answered in a group chat; open the group rather than the bot chat."
- },
- "groupName": {
- "type": "string"
- },
"waitingFor": {
"type": "string",
"enum": [
@@ -220,7 +213,7 @@
"type": "array",
"items": {
"type": "string",
- "pattern": "^(agent|group):\\S+$"
+ "pattern": "^agent:\\S+$"
},
"maxItems": 9
}
@@ -967,7 +960,7 @@
"provider",
"model"
],
- "description": "The model that describes images for bots whose model can't read them. Null when off: such bots refuse images in their chat and get only an image's name in group chats."
+ "description": "The model that describes images for bots whose model can't read them. Null when off: such bots refuse images in their chat."
},
"choices": {
"type": "array",
@@ -1611,25 +1604,6 @@
},
"presentation": {
"$ref": "#/components/schemas/MessagePresentation"
- },
- "sources": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "url": {
- "type": "string"
- },
- "title": {
- "type": "string"
- }
- },
- "required": [
- "url",
- "title"
- ]
- },
- "description": "In a group chat, the pages the sending bot searched or read in the turn that wrote the message."
}
},
"required": [
@@ -1754,7 +1728,7 @@
"properties": {
"kind": {
"type": "string",
- "description": "Where the message came from: owner, task, event (an event automation's prompt), script (a script task's result), credential, bot, group, call (a voice gateway call ended, which starts a bot turn), call_request (the owner declined a call request), or callee (what the callee of an outside call said, in that call's conversation only). Clients may receive other values later."
+ "description": "Where the message came from: owner, task, event (an event automation's prompt), script (a script task's result), credential, bot, call (a voice gateway call ended, which starts a bot turn), call_request (the owner declined a call request), or callee (what the callee of an outside call said, in that call's conversation only). Clients may receive other values later."
},
"name": {
"type": "string"
@@ -2316,131 +2290,6 @@
"taskId"
]
},
- "GroupChat": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "memberIds": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "Member bots in the order they joined."
- },
- "createdAt": {
- "type": "string"
- },
- "updatedAt": {
- "type": "string"
- }
- },
- "required": [
- "id",
- "name",
- "memberIds",
- "createdAt",
- "updatedAt"
- ]
- },
- "GroupChatSnapshot": {
- "allOf": [
- {
- "$ref": "#/components/schemas/TranscriptPage"
- },
- {
- "type": "object",
- "properties": {
- "groupChat": {
- "$ref": "#/components/schemas/GroupChat"
- },
- "activity": {
- "$ref": "#/components/schemas/GroupActivity"
- },
- "updatedAt": {
- "type": "number"
- }
- },
- "required": [
- "groupChat",
- "activity",
- "updatedAt"
- ]
- }
- ]
- },
- "GroupActivity": {
- "type": "object",
- "properties": {
- "paused": {
- "type": "boolean",
- "description": "Bot-started turns used up the turn budget; the owner's next message resumes the group."
- },
- "botTurns": {
- "type": "number",
- "description": "Bot-started turns since the owner's last message."
- },
- "members": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/GroupMemberActivity"
- }
- }
- },
- "required": [
- "paused",
- "botTurns",
- "members"
- ]
- },
- "GroupMemberActivity": {
- "type": "object",
- "properties": {
- "agentId": {
- "type": "string"
- },
- "status": {
- "type": "string",
- "enum": [
- "idle",
- "queued",
- "running",
- "disabled"
- ]
- },
- "error": {
- "type": [
- "string",
- "null"
- ],
- "description": "Why the member's latest turn failed."
- }
- },
- "required": [
- "agentId",
- "status",
- "error"
- ]
- },
- "GroupMessageReceipt": {
- "type": "object",
- "properties": {
- "requestId": {
- "type": "string"
- },
- "entryId": {
- "type": "string"
- }
- },
- "required": [
- "requestId",
- "entryId"
- ]
- },
"Credentials": {
"type": "object",
"properties": {
@@ -3323,13 +3172,12 @@
"chat",
"owner",
"task",
- "bot",
- "group"
+ "bot"
]
},
"name": {
"type": "string",
- "description": "The task, bot, or group chat, as named when the memory was saved."
+ "description": "The task or bot, as named when the memory was saved."
},
"scheduleId": {
"type": "string",
@@ -3338,16 +3186,12 @@
"agentId": {
"type": "string",
"description": "For `bot`."
- },
- "groupId": {
- "type": "string",
- "description": "For `group`."
}
},
"required": [
"kind"
],
- "description": "Where the memory was saved: the owner's bot chat, the owner directly, a scheduled task, another bot's request, or a group chat."
+ "description": "Where the memory was saved: the owner's bot chat, the owner directly, a scheduled task, or another bot's request."
},
"SkillPackage": {
"type": "object",
@@ -3632,12 +3476,6 @@
"string",
"null"
]
- },
- "groupId": {
- "type": [
- "string",
- "null"
- ]
}
}
},
@@ -5643,8 +5481,7 @@
"kind": {
"type": "string",
"enum": [
- "bot",
- "group"
+ "bot"
]
},
"id": {
@@ -5776,8 +5613,7 @@
"kind": {
"type": "string",
"enum": [
- "bot",
- "group"
+ "bot"
]
},
"id": {
@@ -16170,9 +16006,9 @@
}
}
},
- "/v1/group-chats/{id}/files": {
- "post": {
- "operationId": "uploadGroupFile",
+ "/v1/agents/{id}/attachments/{entryId}/{index}": {
+ "get": {
+ "operationId": "getAttachment",
"security": [
{
"BearerAuth": []
@@ -16193,40 +16029,45 @@
{
"schema": {
"type": "string",
- "minLength": 1
+ "description": "An owner message's entry, or a successful `desktop_screenshot` tool result's entry."
},
"required": true,
- "name": "x-file-name",
- "in": "header"
+ "description": "An owner message's entry, or a successful `desktop_screenshot` tool result's entry.",
+ "name": "entryId",
+ "in": "path"
},
{
"schema": {
- "type": "string",
- "minLength": 1
+ "type": [
+ "integer",
+ "null"
+ ],
+ "minimum": 0,
+ "maximum": 7,
+ "description": "The attachment's index in the message's `attachments`, or the image's index in the tool result (0 for a desktop screenshot)."
},
"required": true,
- "name": "content-type",
- "in": "header"
+ "description": "The attachment's index in the message's `attachments`, or the image's index in the tool result (0 for a desktop screenshot).",
+ "name": "index",
+ "in": "path"
}
],
- "requestBody": {
- "required": true,
- "content": {
- "*/*": {
- "schema": {
- "type": "string",
- "format": "binary"
- }
- }
- }
- },
"responses": {
- "201": {
- "description": "Success",
+ "200": {
+ "description": "Attachment or screenshot bytes; Content-Type identifies the image format",
+ "headers": {
+ "Cache-Control": {
+ "schema": {
+ "type": "string"
+ },
+ "description": "private, max-age=31536000, immutable"
+ }
+ },
"content": {
- "application/json": {
+ "image/*": {
"schema": {
- "$ref": "#/components/schemas/UploadFile"
+ "type": "string",
+ "format": "binary"
}
}
}
@@ -16312,9 +16153,11 @@
}
}
}
- },
- "get": {
- "operationId": "listGroupFiles",
+ }
+ },
+ "/v1/agents/{id}/abort": {
+ "post": {
+ "operationId": "abortChat",
"security": [
{
"BearerAuth": []
@@ -16331,41 +16174,11 @@
"required": true,
"name": "id",
"in": "path"
- },
- {
- "schema": {
- "type": "string",
- "format": "uuid"
- },
- "required": false,
- "name": "before",
- "in": "query"
- },
- {
- "schema": {
- "type": "integer",
- "minimum": 1,
- "maximum": 200,
- "default": 50
- },
- "required": false,
- "name": "limit",
- "in": "query"
}
],
"responses": {
- "200": {
- "description": "Success",
- "content": {
- "application/json": {
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/LibraryFile"
- }
- }
- }
- }
+ "204": {
+ "description": "Success, no response body"
},
"400": {
"description": "Invalid request or operation",
@@ -16450,9 +16263,9 @@
}
}
},
- "/v1/group-chats/{id}/files/{fileId}": {
- "get": {
- "operationId": "getGroupFile",
+ "/v1/agents/{id}/compact": {
+ "post": {
+ "operationId": "compactChat",
"security": [
{
"BearerAuth": []
@@ -16469,25 +16282,15 @@
"required": true,
"name": "id",
"in": "path"
- },
- {
- "schema": {
- "type": "string",
- "format": "uuid"
- },
- "required": true,
- "name": "fileId",
- "in": "path"
}
],
"responses": {
- "200": {
- "description": "File bytes with safe download headers",
+ "202": {
+ "description": "Success",
"content": {
- "application/octet-stream": {
+ "application/json": {
"schema": {
- "type": "string",
- "format": "binary"
+ "$ref": "#/components/schemas/Compaction"
}
}
}
@@ -16573,9 +16376,20 @@
}
}
}
- },
- "delete": {
- "operationId": "deleteGroupFile",
+ }
+ },
+ "/v1/agents/{id}/events": {
+ "get": {
+ "operationId": "streamChatEvents",
+ "x-sse-events": {
+ "snapshot": {
+ "$ref": "#/components/schemas/ChatSnapshot"
+ },
+ "heartbeat": {
+ "$ref": "#/components/schemas/HeartbeatEvent"
+ }
+ },
+ "description": "Server-sent events. Each snapshot event carries a ChatSnapshot JSON object in data. Heartbeat events carry {} every 15 seconds. Authenticate with the Authorization header. Reconnect by fetching the current snapshot; there is no Last-Event-ID replay.",
"security": [
{
"BearerAuth": []
@@ -16595,1778 +16409,36 @@
},
{
"schema": {
- "type": "string",
- "format": "uuid"
- },
- "required": true,
- "name": "fileId",
- "in": "path"
- }
- ],
- "responses": {
- "204": {
- "description": "Success, no response body"
- },
- "400": {
- "description": "Invalid request or operation",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "401": {
- "description": "Missing, expired, or invalid account session",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Resource not found",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "405": {
- "description": "Resource is read-only",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "409": {
- "description": "Conflicting request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "413": {
- "description": "Request body exceeds the size limit",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "500": {
- "description": "Internal server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "503": {
- "description": "Service unavailable",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- }
- }
- }
- },
- "/v1/agents/{id}/attachments/{entryId}/{index}": {
- "get": {
- "operationId": "getAttachment",
- "security": [
- {
- "BearerAuth": []
- },
- {
- "SessionCookie": []
- }
- ],
- "parameters": [
- {
- "schema": {
- "type": "string"
- },
- "required": true,
- "name": "id",
- "in": "path"
- },
- {
- "schema": {
- "type": "string",
- "description": "An owner message's entry, or a successful `desktop_screenshot` tool result's entry."
- },
- "required": true,
- "description": "An owner message's entry, or a successful `desktop_screenshot` tool result's entry.",
- "name": "entryId",
- "in": "path"
- },
- {
- "schema": {
- "type": [
- "integer",
- "null"
- ],
- "minimum": 0,
- "maximum": 7,
- "description": "The attachment's index in the message's `attachments`, or the image's index in the tool result (0 for a desktop screenshot)."
- },
- "required": true,
- "description": "The attachment's index in the message's `attachments`, or the image's index in the tool result (0 for a desktop screenshot).",
- "name": "index",
- "in": "path"
- }
- ],
- "responses": {
- "200": {
- "description": "Attachment or screenshot bytes; Content-Type identifies the image format",
- "headers": {
- "Cache-Control": {
- "schema": {
- "type": "string"
- },
- "description": "private, max-age=31536000, immutable"
- }
- },
- "content": {
- "image/*": {
- "schema": {
- "type": "string",
- "format": "binary"
- }
- }
- }
- },
- "400": {
- "description": "Invalid request or operation",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "401": {
- "description": "Missing, expired, or invalid account session",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Resource not found",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "405": {
- "description": "Resource is read-only",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "409": {
- "description": "Conflicting request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "413": {
- "description": "Request body exceeds the size limit",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "500": {
- "description": "Internal server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "503": {
- "description": "Service unavailable",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- }
- }
- }
- },
- "/v1/agents/{id}/abort": {
- "post": {
- "operationId": "abortChat",
- "security": [
- {
- "BearerAuth": []
- },
- {
- "SessionCookie": []
- }
- ],
- "parameters": [
- {
- "schema": {
- "type": "string"
- },
- "required": true,
- "name": "id",
- "in": "path"
- }
- ],
- "responses": {
- "204": {
- "description": "Success, no response body"
- },
- "400": {
- "description": "Invalid request or operation",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "401": {
- "description": "Missing, expired, or invalid account session",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Resource not found",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "405": {
- "description": "Resource is read-only",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "409": {
- "description": "Conflicting request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "413": {
- "description": "Request body exceeds the size limit",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "500": {
- "description": "Internal server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "503": {
- "description": "Service unavailable",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- }
- }
- }
- },
- "/v1/agents/{id}/compact": {
- "post": {
- "operationId": "compactChat",
- "security": [
- {
- "BearerAuth": []
- },
- {
- "SessionCookie": []
- }
- ],
- "parameters": [
- {
- "schema": {
- "type": "string"
- },
- "required": true,
- "name": "id",
- "in": "path"
- }
- ],
- "responses": {
- "202": {
- "description": "Success",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Compaction"
- }
- }
- }
- },
- "400": {
- "description": "Invalid request or operation",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "401": {
- "description": "Missing, expired, or invalid account session",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Resource not found",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "405": {
- "description": "Resource is read-only",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "409": {
- "description": "Conflicting request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "413": {
- "description": "Request body exceeds the size limit",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "500": {
- "description": "Internal server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "503": {
- "description": "Service unavailable",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- }
- }
- }
- },
- "/v1/agents/{id}/events": {
- "get": {
- "operationId": "streamChatEvents",
- "x-sse-events": {
- "snapshot": {
- "$ref": "#/components/schemas/ChatSnapshot"
- },
- "heartbeat": {
- "$ref": "#/components/schemas/HeartbeatEvent"
- }
- },
- "description": "Server-sent events. Each snapshot event carries a ChatSnapshot JSON object in data. Heartbeat events carry {} every 15 seconds. Authenticate with the Authorization header. Reconnect by fetching the current snapshot; there is no Last-Event-ID replay.",
- "security": [
- {
- "BearerAuth": []
- },
- {
- "SessionCookie": []
- }
- ],
- "parameters": [
- {
- "schema": {
- "type": "string"
- },
- "required": true,
- "name": "id",
- "in": "path"
- },
- {
- "schema": {
- "type": "integer",
- "minimum": 1,
- "maximum": 200
- },
- "required": false,
- "name": "limit",
- "in": "query"
- },
- {
- "schema": {
- "type": "string",
- "description": "With partial=true, each snapshot's partial carries the reply text the bot is writing, updated about every 100 ms. Without it, partial stays empty and replies appear only when the turn ends."
- },
- "required": false,
- "description": "With partial=true, each snapshot's partial carries the reply text the bot is writing, updated about every 100 ms. Without it, partial stays empty and replies appear only when the turn ends.",
- "name": "partial",
- "in": "query"
- }
- ],
- "responses": {
- "200": {
- "description": "SSE stream, not a JSON array",
- "content": {
- "text/event-stream": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "400": {
- "description": "Invalid request or operation",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "401": {
- "description": "Missing, expired, or invalid account session",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Resource not found",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "405": {
- "description": "Resource is read-only",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "409": {
- "description": "Conflicting request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "413": {
- "description": "Request body exceeds the size limit",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "500": {
- "description": "Internal server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "503": {
- "description": "Service unavailable",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- }
- }
- }
- },
- "/v1/events": {
- "get": {
- "operationId": "streamActivityEvents",
- "x-sse-events": {
- "activity": {
- "$ref": "#/components/schemas/ActivityEvent"
- },
- "learned": {
- "$ref": "#/components/schemas/LearnedEvent"
- },
- "pins": {
- "$ref": "#/components/schemas/PinsEvent"
- },
- "heartbeat": {
- "$ref": "#/components/schemas/HeartbeatEvent"
- }
- },
- "description": "Server-sent events. Each activity event carries a ReplyEvent or ChatPreviewEvent JSON object in data. Each learned event carries a LearnedEvent: what a bot's review of one turn changed; GET /v1/agents/{id}/reviews lists them durably. Each pins event carries a PinsEvent: the account's pinned conversations after a change, which the session also returns. Current chat previews replay on connection; finished replies, learned events, and pins events are not replayed. Heartbeat events carry {} every 15 seconds. Authenticate with the Authorization header. No Last-Event-ID replay.",
- "security": [
- {
- "BearerAuth": []
- },
- {
- "SessionCookie": []
- }
- ],
- "responses": {
- "200": {
- "description": "SSE stream, not a JSON array",
- "content": {
- "text/event-stream": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "400": {
- "description": "Invalid request or operation",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "401": {
- "description": "Missing, expired, or invalid account session",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Resource not found",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "405": {
- "description": "Resource is read-only",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "409": {
- "description": "Conflicting request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "413": {
- "description": "Request body exceeds the size limit",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "500": {
- "description": "Internal server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "503": {
- "description": "Service unavailable",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- }
- }
- }
- },
- "/v1/group-chats": {
- "get": {
- "operationId": "listGroupChats",
- "security": [
- {
- "BearerAuth": []
- },
- {
- "SessionCookie": []
- }
- ],
- "responses": {
- "200": {
- "description": "Success",
- "content": {
- "application/json": {
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/GroupChat"
- }
- }
- }
- }
- },
- "400": {
- "description": "Invalid request or operation",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "401": {
- "description": "Missing, expired, or invalid account session",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Resource not found",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "405": {
- "description": "Resource is read-only",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "409": {
- "description": "Conflicting request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "413": {
- "description": "Request body exceeds the size limit",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "500": {
- "description": "Internal server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "503": {
- "description": "Service unavailable",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- }
- }
- },
- "post": {
- "operationId": "createGroupChat",
- "security": [
- {
- "BearerAuth": []
- },
- {
- "SessionCookie": []
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "minLength": 1,
- "maxLength": 80
- },
- "memberIds": {
- "type": "array",
- "items": {
- "type": "string",
- "format": "uuid"
- },
- "minItems": 2,
- "maxItems": 6
- }
- },
- "required": [
- "name",
- "memberIds"
- ]
- }
- }
- }
- },
- "responses": {
- "201": {
- "description": "Success",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GroupChat"
- }
- }
- }
- },
- "400": {
- "description": "Invalid request or operation",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "401": {
- "description": "Missing, expired, or invalid account session",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Resource not found",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "405": {
- "description": "Resource is read-only",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "409": {
- "description": "Conflicting request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "413": {
- "description": "Request body exceeds the size limit",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "500": {
- "description": "Internal server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "503": {
- "description": "Service unavailable",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- }
- }
- }
- },
- "/v1/group-chats/{id}": {
- "get": {
- "operationId": "getGroupChat",
- "security": [
- {
- "BearerAuth": []
- },
- {
- "SessionCookie": []
- }
- ],
- "parameters": [
- {
- "schema": {
- "type": "string"
- },
- "required": true,
- "name": "id",
- "in": "path"
- }
- ],
- "responses": {
- "200": {
- "description": "Success",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GroupChat"
- }
- }
- }
- },
- "400": {
- "description": "Invalid request or operation",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "401": {
- "description": "Missing, expired, or invalid account session",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Resource not found",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "405": {
- "description": "Resource is read-only",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "409": {
- "description": "Conflicting request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "413": {
- "description": "Request body exceeds the size limit",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "500": {
- "description": "Internal server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "503": {
- "description": "Service unavailable",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- }
- }
- },
- "patch": {
- "operationId": "updateGroupChat",
- "security": [
- {
- "BearerAuth": []
- },
- {
- "SessionCookie": []
- }
- ],
- "parameters": [
- {
- "schema": {
- "type": "string"
- },
- "required": true,
- "name": "id",
- "in": "path"
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "minLength": 1,
- "maxLength": 80
- },
- "memberIds": {
- "type": "array",
- "items": {
- "type": "string",
- "format": "uuid"
- },
- "minItems": 2,
- "maxItems": 6
- }
- }
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GroupChat"
- }
- }
- }
- },
- "400": {
- "description": "Invalid request or operation",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "401": {
- "description": "Missing, expired, or invalid account session",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Resource not found",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "405": {
- "description": "Resource is read-only",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "409": {
- "description": "Conflicting request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "413": {
- "description": "Request body exceeds the size limit",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "500": {
- "description": "Internal server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "503": {
- "description": "Service unavailable",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- }
- }
- },
- "delete": {
- "operationId": "deleteGroupChat",
- "security": [
- {
- "BearerAuth": []
- },
- {
- "SessionCookie": []
- }
- ],
- "parameters": [
- {
- "schema": {
- "type": "string"
- },
- "required": true,
- "name": "id",
- "in": "path"
- }
- ],
- "responses": {
- "204": {
- "description": "Success, no response body"
- },
- "400": {
- "description": "Invalid request or operation",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "401": {
- "description": "Missing, expired, or invalid account session",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Resource not found",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "405": {
- "description": "Resource is read-only",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "409": {
- "description": "Conflicting request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "413": {
- "description": "Request body exceeds the size limit",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "500": {
- "description": "Internal server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "503": {
- "description": "Service unavailable",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- }
- }
- }
- },
- "/v1/group-chats/{id}/chat": {
- "get": {
- "operationId": "getGroupChatSnapshot",
- "security": [
- {
- "BearerAuth": []
- },
- {
- "SessionCookie": []
- }
- ],
- "parameters": [
- {
- "schema": {
- "type": "string"
- },
- "required": true,
- "name": "id",
- "in": "path"
- },
- {
- "schema": {
- "type": "integer",
- "minimum": 1,
- "maximum": 200
- },
- "required": false,
- "name": "limit",
- "in": "query"
- }
- ],
- "responses": {
- "200": {
- "description": "Success",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GroupChatSnapshot"
- }
- }
- }
- },
- "400": {
- "description": "Invalid request or operation",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "401": {
- "description": "Missing, expired, or invalid account session",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Resource not found",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "405": {
- "description": "Resource is read-only",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "409": {
- "description": "Conflicting request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "413": {
- "description": "Request body exceeds the size limit",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "500": {
- "description": "Internal server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "503": {
- "description": "Service unavailable",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- }
- }
- }
- },
- "/v1/group-chats/{id}/history": {
- "get": {
- "operationId": "getGroupChatHistory",
- "security": [
- {
- "BearerAuth": []
- },
- {
- "SessionCookie": []
- }
- ],
- "parameters": [
- {
- "schema": {
- "type": "string"
- },
- "required": true,
- "name": "id",
- "in": "path"
- },
- {
- "schema": {
- "type": "integer",
- "minimum": 1,
- "maximum": 200
- },
- "required": false,
- "name": "limit",
- "in": "query"
- },
- {
- "schema": {
- "type": "string",
- "minLength": 1,
- "maxLength": 200
- },
- "required": false,
- "name": "before",
- "in": "query"
- }
- ],
- "responses": {
- "200": {
- "description": "Success",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/TranscriptPage"
- }
- }
- }
- },
- "400": {
- "description": "Invalid request or operation",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "401": {
- "description": "Missing, expired, or invalid account session",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Resource not found",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "405": {
- "description": "Resource is read-only",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "409": {
- "description": "Conflicting request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "413": {
- "description": "Request body exceeds the size limit",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "500": {
- "description": "Internal server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "503": {
- "description": "Service unavailable",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- }
- }
- }
- },
- "/v1/group-chats/{id}/messages": {
- "post": {
- "operationId": "sendGroupMessage",
- "security": [
- {
- "BearerAuth": []
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 200
+ },
+ "required": false,
+ "name": "limit",
+ "in": "query"
},
- {
- "SessionCookie": []
- }
- ],
- "parameters": [
{
"schema": {
- "type": "string"
+ "type": "string",
+ "description": "With partial=true, each snapshot's partial carries the reply text the bot is writing, updated about every 100 ms. Without it, partial stays empty and replies appear only when the turn ends."
},
- "required": true,
- "name": "id",
- "in": "path"
+ "required": false,
+ "description": "With partial=true, each snapshot's partial carries the reply text the bot is writing, updated about every 100 ms. Without it, partial stays empty and replies appear only when the turn ends.",
+ "name": "partial",
+ "in": "query"
}
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "content": {
- "type": "string",
- "maxLength": 32000
- },
- "requestId": {
- "type": "string",
- "format": "uuid"
- },
- "replyTo": {
- "type": "string",
- "minLength": 1,
- "maxLength": 200
- },
- "files": {
- "type": "array",
- "items": {
- "type": "string",
- "format": "uuid"
- },
- "maxItems": 8,
- "default": []
- }
- },
- "required": [
- "content",
- "requestId"
- ],
- "additionalProperties": false
- }
- }
- }
- },
"responses": {
- "201": {
- "description": "Success",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/GroupMessageReceipt"
- }
- }
- }
- },
- "400": {
- "description": "Invalid request or operation",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "401": {
- "description": "Missing, expired, or invalid account session",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Resource not found",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "405": {
- "description": "Resource is read-only",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "409": {
- "description": "Conflicting request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "413": {
- "description": "Request body exceeds the size limit",
+ "200": {
+ "description": "SSE stream, not a JSON array",
"content": {
- "text/plain": {
+ "text/event-stream": {
"schema": {
"type": "string"
}
}
}
},
- "500": {
- "description": "Internal server error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- },
- "503": {
- "description": "Service unavailable",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Error"
- }
- }
- }
- }
- }
- }
- },
- "/v1/group-chats/{id}/stop": {
- "post": {
- "operationId": "stopGroupChat",
- "description": "Ends every running bot turn in the group and drops the queued ones. The group is not paused; the next message starts turns again.",
- "security": [
- {
- "BearerAuth": []
- },
- {
- "SessionCookie": []
- }
- ],
- "parameters": [
- {
- "schema": {
- "type": "string"
- },
- "required": true,
- "name": "id",
- "in": "path"
- }
- ],
- "responses": {
- "204": {
- "description": "Success, no response body"
- },
"400": {
"description": "Invalid request or operation",
"content": {
@@ -18450,18 +16522,24 @@
}
}
},
- "/v1/group-chats/{id}/events": {
+ "/v1/events": {
"get": {
- "operationId": "streamGroupChatEvents",
+ "operationId": "streamActivityEvents",
"x-sse-events": {
- "snapshot": {
- "$ref": "#/components/schemas/GroupChatSnapshot"
+ "activity": {
+ "$ref": "#/components/schemas/ActivityEvent"
+ },
+ "learned": {
+ "$ref": "#/components/schemas/LearnedEvent"
+ },
+ "pins": {
+ "$ref": "#/components/schemas/PinsEvent"
},
"heartbeat": {
"$ref": "#/components/schemas/HeartbeatEvent"
}
},
- "description": "Server-sent events. Each snapshot event carries a GroupChatSnapshot JSON object in data, sent on connection and after every change. Heartbeat events carry {} every 15 seconds. Authenticate with the Authorization header. Reconnect by fetching the current snapshot; there is no Last-Event-ID replay.",
+ "description": "Server-sent events. Each activity event carries a ReplyEvent or ChatPreviewEvent JSON object in data. Each learned event carries a LearnedEvent: what a bot's review of one turn changed; GET /v1/agents/{id}/reviews lists them durably. Each pins event carries a PinsEvent: the account's pinned conversations after a change, which the session also returns. Current chat previews replay on connection; finished replies, learned events, and pins events are not replayed. Heartbeat events carry {} every 15 seconds. Authenticate with the Authorization header. No Last-Event-ID replay.",
"security": [
{
"BearerAuth": []
@@ -18470,26 +16548,6 @@
"SessionCookie": []
}
],
- "parameters": [
- {
- "schema": {
- "type": "string"
- },
- "required": true,
- "name": "id",
- "in": "path"
- },
- {
- "schema": {
- "type": "integer",
- "minimum": 1,
- "maximum": 200
- },
- "required": false,
- "name": "limit",
- "in": "query"
- }
- ],
"responses": {
"200": {
"description": "SSE stream, not a JSON array",
diff --git a/openapi/pins-event.schema.json b/openapi/pins-event.schema.json
index 0b582652..14264b29 100644
--- a/openapi/pins-event.schema.json
+++ b/openapi/pins-event.schema.json
@@ -7,7 +7,7 @@
"type": "array",
"items": {
"type": "string",
- "pattern": "^(agent|group):\\S+$"
+ "pattern": "^agent:\\S+$"
}
}
},