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

Permissions in 0.2.7

  • 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

quote.test.ts2.7 KB
// A reply to a selection in an agent's message: the selection goes into the
// prompt box as a quote, with separation from existing text and the caret below it.
import assert from "node:assert/strict";
import test from "node:test";
import * as Effect from "effect/Effect";
import { withQuote } from "./composer.ts";
import { renderAssistant } from "./views/rows.tsx";
import { chat, harness, item, nodes } from "./ui-for-tests.test.ts";

test("a quote starts immediately in an empty prompt and separates existing text", () => {
  const line = "We can also update the UI to match this change";
  assert.equal(withQuote("", line), `> ${line}\n`);
  assert.equal(withQuote(" \n ", line), `> ${line}\n`);
  assert.equal(withQuote("Thanks.", line), `Thanks.\n\n> ${line}\n`);
  // Trailing space and lines typed before it do not widen the gap.
  assert.equal(withQuote("Thanks.  \n\n\n", line), `Thanks.\n\n> ${line}\n`);
  // Every line is quoted, an empty one too, so paragraphs stay one quote.
  assert.equal(withQuote("", "First **bold**\n\nSecond"), "> First **bold**\n>\n> Second\n");
});

for (const typed of ["", "Looks good."]) test(`replying to a selection ${typed ? "after existing text" : "in an empty prompt"} fills the prompt box and gives it the keyboard`, async () => {
  const h = harness();
  const c = chat({ id: "c1" });
  h.controller.state.chats.c1 = c;
  h.controller.composer("c1").text = typed;
  const reply = item({ id: "a1", role: "assistant", text: "We can also update the UI to match this change" });
  const markdown = nodes(renderAssistant(h.v, c, reply as Parameters<typeof renderAssistant>[2])).find(
    (node) => node.type === "markdown",
  );
  assert.ok(markdown, "the reply is markdown");
  (markdown.onQuote as (event: { text: string }) => void)({ text: "update the UI" });
  await h.settle();
  assert.equal(h.controller.composer("c1").text, `${typed ? `${typed}\n\n` : ""}> update the UI\n`);
  assert.deepEqual(h.focused, ["prompt-c1"]);
  await h.close();
});

test("a reply to code in a tab goes to the open chat's prompt box, and needs a chat open", async () => {
  const h = harness();
  h.controller.state.chats.c1 = chat({ id: "c1" });
  h.controller.composer("c1").text = "Why?";
  const quote = "`src/a.rs` lines 2–3:\n```rust\nlet a = 1;\nlet b = 2;\n```";
  const none = await Effect.runPromise(Effect.flip(h.controller.quoteInOpenChat(quote)));
  assert.equal(none._tag, "NoOpenChat");
  await Effect.runPromise(h.controller.app.select("c1", "w1"));
  await Effect.runPromise(h.controller.quoteInOpenChat(quote));
  await h.settle();
  assert.equal(
    h.controller.composer("c1").text,
    "Why?\n\n> `src/a.rs` lines 2–3:\n> ```rust\n> let a = 1;\n> let b = 2;\n> ```\n",
  );
  assert.deepEqual(h.focused, ["prompt-c1"]);
  await h.close();
});

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.