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