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.6

Permissions in 0.2.6

  • Control chats chats.controlHighCreates chats, sends prompts and cancels runs.Send prompts, answer agent questions, and create, change, fork, revert, stop and group chats
  • Run other plugins' commands commands.runHighRuns commands of other plugins.Run the sidebar's New chat command from the title bar
  • Read chats chats.readMediumReads your transcripts and chat lists.Show workspaces, tasks, chats and transcripts, and follow them as agents work
  • Read files fs.readMediumReads files in the listed places.Suggest workspace files for @ mentionsPlaces: the open workspace
  • Show panels ui.slotsAlways grantedShows views in the listed parts of the window.Draw the chat grid, the title bar, and the Session panel with its rail buttonSlots: centertitlerailright

Files

rows.test.ts3.9 KB
// A transcript keeps the rows that did not change between renders, so the
// runtime skips them, and draws again every row whose inputs changed.
import assert from "node:assert/strict";
import test from "node:test";
import type { AgentEventKind } from "divergence";
import { applyEvent } from "./transcript.ts";
import { renderTool, renderTranscript } from "./views/rows.tsx";
import { chat, harness, item, nodes } from "./ui-for-tests.test.ts";

function setup() {
  const h = harness();
  h.controller.api.toolRenderers = () => [];
  h.controller.state.chats.a = chat({ id: "a", sessionId: "s" });
  const t = h.controller.transcript("a");
  t.items = [
    item({ id: "u1", role: "user", text: "first" }),
    item({ id: "a1", role: "assistant", text: "reply one" }),
    item({ id: "u2", role: "user", text: "second" }),
    item({ id: "t1", role: "tool", call: { kind: "read", title: "Read a.ts", content: [{ type: "text", text: "x" }] } }),
    item({ id: "a2", role: "assistant", text: "reply" }),
  ];
  t.snapshot = { kind: "ready" };
  // The rows of the scroller, by the id each row's column carries.
  const rows = () => {
    const scroller = nodes(renderTranscript(h.v, h.controller.state.chats.a!)).find((node) => node.type === "scroller");
    return new Map((scroller?.items ?? []).map((row) => [String(row.id), row]));
  };
  return { h, t, rows };
}

test("rows that did not change are the same elements as last render", () => {
  const { t, rows } = setup();
  const before = rows();
  const after = rows();
  for (const [id, row] of before) assert.equal(after.get(id), row, id);

  applyEvent(t, { event: "text_delta", itemId: "a2", text: " more" } as AgentEventKind);
  const streamed = rows();
  assert.notEqual(streamed.get("transcript-row-a2"), after.get("transcript-row-a2"), "the streamed reply draws again");
  assert.equal(streamed.get("transcript-row-a1"), after.get("transcript-row-a1"), "the replies before it are kept");
  assert.ok(nodes(streamed.get("transcript-row-a2")).some((node) => node.text === "reply more"));
});

test("a tool update, a toggle and the run starting draw the rows they change", () => {
  const { t, rows } = setup();
  const before = rows();
  const fold = [...before.keys()].find((id) => id.includes("tools-t1"))!;

  applyEvent(t, { event: "tool_call_updated", id: "t1", status: "failed" } as AgentEventKind);
  const updated = rows();
  assert.notEqual(updated.get(fold), before.get(fold), "the updated call's fold draws again");
  assert.equal(updated.get("transcript-row-u1"), before.get("transcript-row-u1"));

  t.folds.set("tools-t1", false);
  const folded = rows();
  assert.notEqual(folded.get(fold), updated.get(fold), "closing the fold draws it again");

  // A user row offers its edit only while nothing runs: every one draws again.
  t.running = true;
  const running = rows();
  assert.notEqual(running.get("transcript-row-u1"), folded.get("transcript-row-u1"));
  assert.notEqual(running.get("transcript-row-u2"), folded.get("transcript-row-u2"));
});

test("a running command spins where its terminal icon goes, and nowhere else", () => {
  const { h, t } = setup();
  const run = item({ id: "t2", role: "tool", call: { kind: "execute", title: "cargo build", status: "running" } });
  const draw = () => {
    const all = nodes(renderTool(h.v, t, run, h.controller.state.chats.a!));
    const slot = all.find((node) => node.width === 14)!;
    return { all, slot: nodes(slot) };
  };
  const running = draw();
  assert.equal(running.all.filter((node) => node.type === "spinner").length, 1);
  assert.ok(running.slot.some((node) => node.type === "spinner"), "the spinner is in the icon slot");
  assert.ok(!running.all.some((node) => node.type === "icon" && node.name === "square-terminal"));
  run.call.status = "completed";
  const done = draw();
  assert.ok(!done.all.some((node) => node.type === "spinner"));
  assert.ok(done.slot.some((node) => node.type === "icon" && node.name === "square-terminal"));
});

Versions

VersionPublishedPlugin APISizePermissionsStatus
0.2.9latestNov 21, 2026>=5 <6349 KB5 permissionsListed
0.2.8Nov 16, 2026>=5 <6348.6 KB5 permissionsListed
0.2.7Nov 11, 2026>=5 <6314.3 KB5 permissionsListed
0.2.6Nov 9, 2026>=5 <6306.2 KB5 permissionsListed
0.2.5Oct 27, 2026>=2 <4178.6 KB5 permissionsListed

Reviews and comments

0 threads · 0 reviews

No comments yet.