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

keyboard-commands.test.ts3.2 KB
// The commands that reach the composer's controls from the keyboard act on
// the chat on screen, bring the chat back from another page first, and say
// so when the agent has no such control.
import assert from "node:assert/strict";
import test from "node:test";
import * as Effect from "effect/Effect";
import type { ConfigOption } from "divergence";
import { Commands } from "divergence/effect";
import { InputLedger, withController } from "./testing.ts";
import { registerKeyboardCommands } from "./keyboard-commands.ts";
import type { Controller } from "./controller.ts";

const option = (id: string, category: string): ConfigOption => ({
  id,
  name: id,
  category,
  kind: "select",
  value: "a",
  choices: [{ value: "a", name: "A" }],
});

/// Registers the commands, and answers a runner for each by id with the
/// focus requests and routes they made.
function harness(c: Controller, route = "chat") {
  const registered = new Map<string, Effect.Effect<unknown, unknown>>();
  const seen: (string | [string, string | undefined])[] = [];
  c.views.focus = (id: string, focusOption?: string) => Effect.sync(() => void seen.push([id, focusOption]));
  c.app.route = (name: string) => Effect.sync(() => void seen.push(`route ${name}`));
  (c.api.app as { state: () => unknown }).state = () => ({ route, chatId: "c1" });
  const register = registerKeyboardCommands(c).pipe(
    Effect.provideService(Commands, {
      register: (id: string, effect: unknown) => Effect.sync(() => void registered.set(id, effect as Effect.Effect<unknown, unknown>)),
      setAction: () => Effect.void,
    } as never),
    Effect.scoped,
  );
  return {
    register,
    seen,
    run: (id: string) => {
      const command = registered.get(id);
      assert.ok(command, `${id} is registered`);
      return command;
    },
  };
}

test("the prompt box and the pickers of the chat on screen take the keyboard", async () => {
  await withController(new InputLedger(), (c) =>
    Effect.gen(function* () {
      const keys = harness(c);
      yield* keys.register;
      c.composer("c1").options = [option("model", "model"), option("effort", "reasoning"), option("auto", "approval")];
      yield* keys.run("chat.focusPrompt");
      yield* keys.run("chat.chooseAgent");
      yield* keys.run("chat.chooseModel");
      yield* keys.run("chat.chooseEffort");
      yield* keys.run("chat.chooseApproval");
      assert.deepEqual(keys.seen, [
        ["prompt-c1", undefined],
        ["agent-c1", undefined],
        ["models-c1-agent", "model"],
        ["models-c1-agent", "effort"],
        ["opt-c1-auto", undefined],
      ]);
    }),
  );
});

test("from another page the chat comes back first, and a missing setting says so", async () => {
  const ledger = new InputLedger();
  await withController(ledger, (c) =>
    Effect.gen(function* () {
      const keys = harness(c, "settings");
      yield* keys.register;
      c.composer("c1").options = [];
      yield* keys.run("chat.focusPrompt");
      yield* keys.run("chat.chooseMode");
      yield* keys.run("chat.chooseApproval");
      assert.deepEqual(keys.seen, ["route chat", ["prompt-c1", undefined], "route chat", "route chat"]);
      assert.deepEqual(ledger.notices, ["Agent has no mode setting", "Agent has no approval setting"]);
    }),
  );
});

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.