Official

settings

Built-in settings 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/settings@0.2.6

Permissions in 0.2.6

  • Manage plugins plugins.manageOfficial onlyReloads and enables plugins. Only official plugins can have it.List, enable, disable and reload plugins, install updates, and quit to finish an update
  • Change app settings settings.writeHighChanges the app settings.Change the settings and the theme
  • Manage agents agents.manageHighEnables, disables and signs in agents, and changes their settings.Turn agents on and off, sign in to them and update them
  • Control chats chats.controlHighCreates chats, sends prompts and cancels runs.Add project folders, and open the first chat and the changes saved in the first-run guide
  • Read chats chats.readMediumReads your transcripts and chat lists.Hold an agent's update until its chats stop running
  • Read app settings settings.readLowReads the app settings.Show the settings, and the tools and rules of every plugin
  • Show panels ui.slotsAlways grantedShows views in the listed parts of the window.Draw settings, its list of sections in the sidebar's place, and the first-run guideSlots: centerleft

Files

views/tools.tsx4.9 KB
// The Tools section: the plugin tools every agent can be given, the mode
// they are shown in, and the rules plugins add to every session.
// HTM whitespace is significant; keep these templates out of Prettier's HTML formatter.
import type { EffectViewContext } from "divergence/effect";
import type { ToolsOverview } from "divergence";
import type { SettingsPage } from "../controller.ts";
import { card, listRow, pluginChip, section, segmented, setting, column, fill, row } from "./layout.tsx";

function toggled(list: readonly string[], key: string, on: boolean) {
  return on ? list.filter((k) => k !== key) : [...list, key];
}

// A rule file is off as `plugin/file`. A plain plugin name, from before rules
// were switched per file, turns all its files off, so it becomes one entry
// per file before one of them changes.
export function toggledRule(list: readonly string[], plugin: string, file: string, files: readonly string[], on: boolean) {
  const perFile = list.includes(plugin) ? [...list.filter((k) => k !== plugin), ...files.map((f) => `${plugin}/${f}`)] : list;
  return toggled(perFile.filter((k) => k !== `${plugin}/${file}`), `${plugin}/${file}`, on);
}

export function renderTools(ctx: EffectViewContext<object>, actions: SettingsPage["Service"]) {
  const state = actions.state;
  const t = state.tools;
  if (t === undefined) return <empty>Loading tools…</empty>;
  if (!t) return <empty>This build of Divergence has no plugin tools.</empty>;
  const settings = state.data.settings?.tools;
  const toolRow = (tool: ToolsOverview["tools"][number]) =>
    listRow(
      <switch id={`tool-${tool.plugin}-${tool.name}`} label="" checked={tool.enabled} onChange={(e: { value: boolean }) => ctx.run(actions.updateTools({ disabled: toggled(settings?.disabled ?? [], `${tool.plugin}/${tool.name}`, e.value) }))} />,
      (
        <div {...column} {...fill} gap="small" padding="small">
          <div {...row} gap="small" padding="small">
                  <text style="mono" size="sm">{tool.name}</text>
                  {tool.exposedAs !== tool.name ? <text style="body" size="xs" tone="faint">{`as ${tool.exposedAs}`}</text> : null}
                  <spacer />
                  {pluginChip(tool.plugin)}
                </div>
          {tool.description ? <text style="body" size="xs" tone="muted">{tool.description}</text> : null}
        </div>
      ),
    );
  const ruleRow = (rule: ToolsOverview["rules"][number]) => {
    const files = t.rules.filter((r) => r.plugin === rule.plugin).map((r) => r.file);
    return listRow(
      <switch id={`rules-${rule.plugin}-${rule.file}`} label="" checked={rule.enabled} onChange={(e: { value: boolean }) => ctx.run(actions.updateTools({ disabledRules: toggledRule(settings?.disabledRules ?? [], rule.plugin, rule.file, files, e.value) }))} />,
      (
        <div {...column} {...fill} gap="small" padding="small">
          <div {...row} gap="small" padding="small">
                  <text style="mono" size="sm">{rule.file}</text>
                  <spacer />
                  {pluginChip(rule.plugin)}
                </div>
          <text style="body" size="xs" tone="muted" truncate>{rule.text.trim().split("\n")[0] ?? ""}</text>
        </div>
      ),
    );
  };
  return (
    <div {...column} gap="large" padding="small">
      {section(
                "Plugin tools",
                "Tools that plugins give every agent. A chat gets the tools that are on when its session starts.",
                card([
                  setting({
                    title: "Show tools to agents as",
                    description:
                      t.mode === "code"
                        ? "One execute tool. The agent writes a short JavaScript program that calls the tools, so it can chain and filter their results."
                        : "Each plugin tool is a tool of its own.",
                    control: segmented(
                      "tool-mode",
                      t.mode,
                      [
                        { value: "code", label: "Code mode" },
                        { value: "direct", label: "Separate tools" },
                      ],
                      (value) => ctx.run(actions.updateTools({ mode: value })),
                    ),
                  }),
                ]),
              )}
      {t.tools.length
                  ? card(t.tools.map(toolRow))
                  : (
                    <text style="body" size="xs" tone="muted">
                      No plugin gives tools yet. A plugin registers them with api.tools.register; see plugins/docs/tools.md.
                    </text>
                  )}
      {section(
                "Rules",
                "Instructions plugins add to every agent session.",
                t.rules.length
                  ? card(t.rules.map(ruleRow))
                  : <text style="body" size="xs" tone="muted">No plugin has rules. A plugin lists Markdown files in contributes.rules.</text>,
              )}
    </div>
  );
}

Versions

VersionPublishedPlugin APISizePermissionsStatus
0.2.8latestNov 21, 2026>=5 <668.5 KB7 permissionsListed
0.2.7Nov 18, 2026>=5 <668 KB7 permissionsListed
0.2.6Nov 16, 2026>=5 <666.3 KB7 permissionsListed
0.2.5Nov 11, 2026>=5 <663.6 KB7 permissionsListed
0.2.4Nov 9, 2026>=5 <661.6 KB7 permissionsListed
0.2.3Oct 27, 2026>=2 <446.8 KB7 permissionsListed

Reviews and comments

0 threads · 0 reviews

No comments yet.