Official
chat
Built-in chat UI (JavaScript UI plugin).
The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install divergence/chat@0.2.8
Permissions in 0.2.8
Files
input-schema.ts2.1 KB
// Legacy plugin storage needs boundary validation too. These structured blocks
// retain bytes on Alpha until a newer host can migrate them idempotently.
import * as z from "zod";
import type { AppState, Chat } from "divergence";
// The sidebar selects with metadata from its create/list result, so opening
// a chat need not wait for another list request in this plugin.
export const selectedChat = z.object({
id: z.string(), workspaceId: z.string(), agentId: z.string(), title: z.string(),
createdAt: z.string(), updatedAt: z.string(), archived: z.boolean(),
options: z.record(z.string(), z.unknown()),
status: z.enum(["idle", "running", "waiting_approval", "waiting_question", "failed"]),
sessionId: z.string().optional(), completedAt: z.string().optional(),
});
// The chat the app selected, as this plugin knows it, or as the plugin that
// selected it passed it along (kept in `chats` from then on).
export function adoptSelected(chats: Record<string, Chat>, app: AppState): Chat | undefined {
if (!app.chatId) return undefined;
const known = chats[app.chatId];
if (known) return known;
const selected = selectedChat.safeParse(app.shared?.selectedChat);
if (!selected.success || selected.data.id !== app.chatId) return undefined;
return (chats[app.chatId] = selected.data);
}
export const contentBlocks = z.array(z.discriminatedUnion("type", [
z.object({ type: z.literal("text"), text: z.string() }),
z.object({ type: z.literal("image"), mimeType: z.string(), data: z.string() }),
z.object({ type: z.literal("audio"), mimeType: z.string(), data: z.string() }),
z.object({ type: z.literal("file_ref"), path: z.string() }),
z.object({ type: z.literal("resource"), path: z.string(), text: z.string(), mimeType: z.string().optional() }),
z.object({ type: z.literal("skill"), name: z.string(), input: z.string().optional() }),
]));
export function legacyId(chatId: string, index: number, value: unknown): string {
let hash = 2166136261;
for (const character of JSON.stringify(value)) hash = Math.imul(hash ^ character.charCodeAt(0), 16777619);
return `legacy:${chatId}:${index}:${hash >>> 0}`;
}Versions
| Version | Published | Plugin API | Size | Permissions | Status |
|---|---|---|---|---|---|
| 0.2.9latest | Nov 21, 2026 | >=5 <6 | 349 KB | 5 permissions | Listed |
| 0.2.8 | Nov 16, 2026 | >=5 <6 | 348.6 KB | 5 permissions | Listed |
| 0.2.7 | Nov 11, 2026 | >=5 <6 | 314.3 KB | 5 permissions | Listed |
| 0.2.6 | Nov 9, 2026 | >=5 <6 | 306.2 KB | 5 permissions | Listed |
| 0.2.5 | Oct 27, 2026 | >=2 <4 | 178.6 KB | 5 permissions | Listed |
No comments yet.