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
question-fields.test.ts2.3 KB
import { test } from "node:test";
import assert from "node:assert/strict";
import type { QuestionField } from "divergence";
import { storableAnswers, submittedValues, visibleFields } from "./question-fields.ts";
const fields: QuestionField[] = [
{ id: "kind", label: "Kind", kind: "select", options: [{ value: "api", label: "API" }, { value: "cli", label: "CLI" }], default: "cli" },
{ id: "key", label: "Key", kind: "text", secret: true, when: [{ field: "kind", op: "eq", value: "api" }] },
{ id: "region", label: "Region", kind: "text", when: [{ field: "key", op: "ne", value: "" }] },
{ id: "verbose", label: "Verbose", kind: "boolean", default: false },
];
test("a field shows only while its conditions hold, and a hidden field hides what depends on it", () => {
assert.deepEqual(visibleFields(fields, {}).map((field) => field.id), ["kind", "verbose"], "the default answers kind");
assert.deepEqual(visibleFields(fields, { kind: "api" }).map((field) => field.id), ["kind", "key", "verbose"]);
assert.deepEqual(visibleFields(fields, { kind: "api", key: "sk" }).map((field) => field.id), ["kind", "key", "region", "verbose"]);
assert.deepEqual(
visibleFields(fields, { kind: "cli", key: "sk" }).map((field) => field.id),
["kind", "verbose"],
"region depends on a hidden field",
);
});
test("the answer sent takes defaults and leaves out hidden fields", () => {
assert.deepEqual(submittedValues(fields, { key: "sk", region: "eu" }), { kind: "cli", verbose: false });
assert.deepEqual(submittedValues(fields, { kind: "api", key: "sk", region: "eu", verbose: true }), {
kind: "api",
key: "sk",
region: "eu",
verbose: true,
});
});
test("a secret answer is never kept across a reload", () => {
assert.deepEqual(storableAnswers(fields, { kind: "api", key: "sk", region: "eu" }), { kind: "api", region: "eu" });
});
test("a list answer holds a condition when it contains the value", () => {
const list: QuestionField[] = [
{ id: "tags", label: "Tags", kind: "multi_select", options: [] },
{ id: "why", label: "Why", kind: "text", when: [{ field: "tags", op: "eq", value: "other" }] },
];
assert.deepEqual(visibleFields(list, { tags: ["a", "other"] }).map((field) => field.id), ["tags", "why"]);
assert.deepEqual(visibleFields(list, { tags: ["a"] }).map((field) => field.id), ["tags"]);
});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.