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 convergence/chat@0.2.2
Permissions in 0.2.2
Files
session.ts2.8 KB
// The Session panel's data: when it shows, and how the chat open in the
// center reads (its options, status and times, its subagents). Pure: the
// views in views/session.ts draw what this returns.
import type { AppState, Chat, ConfigOption, TranscriptItem } from "convergence";
import { allTasks, counts } from "./subagents.ts";
/// The plugin the shell names in `rightPanel` and `rightPanelPreview`.
export const PANEL = "chat";
export const pinned = (app: AppState): boolean => app.shared?.rightPanel === PANEL;
/// Pinned as the docked column, or shown as the rail icon's fly-out.
export const sessionOpen = (app: AppState): boolean => pinned(app) || app.shared?.rightPanelPreview === PANEL;
/// The name of an option's chosen value ("Opus 4.1", "High"), else the
/// value itself; null without a value.
export function optionLabel(option: Pick<ConfigOption, "value" | "choices"> | undefined): string | null {
if (option?.value === undefined || option.value === null || option.value === "") return null;
return option.choices?.find((choice) => choice.value === option.value)?.name ?? String(option.value);
}
/// The chat's state as the sidebar names it, with the tone of its mark.
export function statusOf(chat: Pick<Chat, "status" | "sessionId">): {
label: string;
tone: "warning" | "info" | "danger" | "faint";
running: boolean;
} {
switch (chat.status) {
case "running":
return { label: "Running", tone: "info", running: true };
case "waiting_approval":
case "waiting_question":
return { label: "Needs you", tone: "warning", running: false };
case "failed":
return { label: "Failed", tone: "danger", running: false };
default:
return { label: chat.sessionId ? "Idle" : "Not started", tone: "faint", running: false };
}
}
/// "Oct 11, 14:05"; null for a time that does not parse.
export function when(iso: string | undefined): string | null {
const at = iso ? Date.parse(iso) : Number.NaN;
if (Number.isNaN(at)) return null;
return new Date(at).toLocaleString("en", { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit", hour12: false });
}
/// "just now", "5m ago", "3h ago", "2d ago"; null for a time that does not parse.
export function ago(iso: string | undefined, now = Date.now()): string | null {
const at = iso ? Date.parse(iso) : Number.NaN;
if (Number.isNaN(at)) return null;
const minutes = Math.floor(Math.max(0, now - at) / 60_000);
if (minutes < 1) return "just now";
if (minutes < 60) return `${minutes}m ago`;
const hours = Math.floor(minutes / 60);
return hours < 24 ? `${hours}h ago` : `${Math.floor(hours / 24)}d ago`;
}
/// Subagents at work in a transcript (running or waiting on the user):
/// the rail icon's badge and the title strip's "N working".
export const working = (items: readonly TranscriptItem[]): number => counts(allTasks(items).map((row) => row.task)).working;Versions
| Version | Published | Plugin API | Size | Permissions | Status |
|---|---|---|---|---|---|
| 0.2.5latest | Nov 21, 2026 | >=2 <4 | 174.6 KB | 5 permissions | Listed |
| 0.2.4 | Oct 25, 2026 | >=2 <4 | 174.2 KB | 5 permissions | Listed |
| 0.2.3 | Oct 24, 2026 | >=2 <4 | 165.4 KB | 5 permissions | Listed |
| 0.2.2 | Oct 23, 2026 | >=2 <4 | 165 KB | 5 permissions | Listed |
| 0.2.1 | Oct 6, 2026 | >=2 <3 | 111.8 KB | 5 permissions | Listed |
| 0.2.0 | Oct 5, 2026 | >=2 <3 | 105.1 KB | 5 permissions | Listed |
No comments yet.