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.9
Permissions in 0.2.9
Files
read-icons.test.ts2.7 KB
import assert from "node:assert/strict";
import test from "node:test";
import type { ToolCall } from "divergence";
import { harness, tree, nodes, chat, transcript, item } from "./ui-for-tests.test.ts";
import { renderTool, groupIcon } from "./views/rows.tsx";
import { toolIcon } from "./views/styles.tsx";
import { applyEvent } from "./transcript.ts";
const read = (fields: Partial<ToolCall> = {}) => item({
id: "read", role: "tool", call: { id: "read", name: "Read", kind: "read", title: "/work/file", status: "completed", content: [], locations: [], ...fields },
});
const icons = (call: ReturnType<typeof read>, folded: boolean) => {
const { v } = harness();
const row = tree(renderTool(v, transcript([call]), call, chat(), folded));
return nodes(row.children[0]).filter((node) => node.type === "icon" && !node.name.startsWith("chevron")).map((node) => node.name);
};
test("Read rows show file icons inside and outside groups", () => {
for (const folded of [true, false]) {
for (const status of ["pending", "running", "completed"] as const) {
assert.deepEqual(icons(read({ status, locations: [{ path: "/work/file.rs" }] }), folded), ["file-text"]);
}
}
});
test("image reads show image icons from locations before their result arrives", () => {
for (const extension of ["png", "jpg", "jpeg", "gif", "webp", "bmp", "tiff", "ico", "svg", "avif", "heic", "PNG"]) {
const call = read({ status: "running", locations: [{ path: `/work/shot.${extension}` }] });
for (const folded of [true, false]) assert.deepEqual(icons(call, folded), ["image"]);
assert.equal(groupIcon([call]), "image");
}
assert.deepEqual(icons(read({ locations: [{ path: "/work/shot.png/readme.txt" }] }), false), ["file-text"]);
});
test("image results update extensionless Read rows without changing their expansion", () => {
const call = read({ input: { path: "/work/picture" } });
const t = transcript([call]);
t.expanded.add(call.id);
applyEvent(t, { event: "tool_call_updated", id: call.id, content: [{ type: "image", mimeType: "image/png", path: "/data/images/stored" }] });
const updated = t.items[0] as typeof call;
for (const folded of [true, false]) assert.deepEqual(icons(updated, folded), ["image"]);
assert.equal(t.expanded.has(call.id), true);
assert.equal(groupIcon([updated, read()]), "image", "ties retain the first resolved icon");
});
test("image output does not turn non-read tools into image reads", () => {
const call = read({ kind: "other", content: [{ type: "image", mimeType: "image/png", path: "/work/shot.png" }] });
assert.equal(toolIcon(call.call), "cpu");
assert.deepEqual(icons(call, false), []);
assert.equal(toolIcon(read({ message: { to: "other", text: "Hello" } }).call), "send");
});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.