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

Permissions in 0.2.8

  • 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/page.tsx5.9 KB
// The settings page. Settings takes the window: its list of sections is
// drawn in the sidebar's place, the open section in the main pane.
// HTM whitespace is significant; keep these templates out of Prettier's HTML formatter.
import * as kit from "divergence";
import type { EffectViewContext } from "divergence/effect";
import type { SettingsPage } from "../controller.ts";
import { APP_SECTIONS, pluginSections } from "../model.ts";
import { renderGeneral } from "./general.tsx";
import { renderAgents } from "./agents.tsx";
import { renderWorkspaces } from "./workspaces.tsx";
import { renderArchived } from "./archived.tsx";
import { renderPlugins } from "./plugins.tsx";
import { renderTools } from "./tools.tsx";
import { renderKeys } from "./keys.tsx";
import { renderUpdates } from "./updates.tsx";
import { renderPluginSection } from "./pluginSection.tsx";
import { column, fill, full, reading } from "./layout.tsx";

const RAISED = kit.RAISED ?? { elevation: "raised" };
const FLAT = kit.FLAT ?? { elevation: "none" };

// Opening Settings fades the list in, and the open section fades in each
// time it changes; the kernel runs both at the window's present, without
// drawing the views again, and jumps under reduced motion.
const FADE_IN = { opacity: 0, motion: { to: { opacity: 1 }, duration: 180, easing: "easeOut" } };
const SECTION_IN = { opacity: 0, motion: { to: { opacity: 1 }, duration: 140, easing: "easeOut" } };

// Settings takes the window: this list of sections stands in the sidebar's
// place while the route is `settings`. Its rows sit on the sidebar's side
// inset, and Back to chat sits at its foot where the chat sidebar has its
// Settings row, so the two rows trade places.
export function renderSettingsSidebar(ctx: EffectViewContext<object>, actions: SettingsPage["Service"]) {
  if (ctx.app.route !== "settings") return null;
  const state = actions.state;
  const entry = (item: { id: string; label: string; icon?: string; plugin?: string; enabled?: boolean }) => {
    const chosen = state.section === item.id;
    const label =
      item.id === "updates" && (state.updates?.appUpdate || state.updates?.pluginUpdate)
        ? `${item.label} •`
        : item.label;
    // A turned-off plugin's mark is faint. The chosen row's fill is the
    // one box below that glides from row to row.
    return <item key={item.id} id={`nav-${item.id}`} icon={item.icon ?? "puzzle"} iconTone={item.enabled === false ? "faint" : undefined} label={label} selected={chosen} {...FLAT} background={chosen ? "transparent" : undefined} onClick={() => ctx.run(actions.openSection(item.id, item.plugin))} />;
  };
  const plugins = pluginSections(state.data.plugins);
  return (
    <div id="settings-sidebar" {...column} {...fill} {...full} padding="small" paddingTop={0} {...FADE_IN}>
      <div {...column} {...fill} gap={2} padding="small" paddingTop={2} overflowY="scroll">
          <div id="settings-selection" follows={`nav-${state.section}`} width="100%" height="100%" background="accent" borderRadius="sm" {...RAISED} layoutMotion />
          <item heading label="Settings" />
          {APP_SECTIONS.map(entry)}
          {/* The room above a heading that follows rows, as the chat
              sidebar leaves above each of its sections. */}
          {plugins.length
                        ? <item heading label="Plugins" marginTop="0.75rem" />
                        : null}
          {plugins.map(entry)}
        </div>
      <div {...column} padding="small" paddingY="small">
          <item id="settings-back" icon="arrow-left" label="Back to chat" onClick={() => ctx.run(actions.route("chat"))} />
        </div>
    </div>
  );
}

function body(ctx: EffectViewContext<object>, actions: SettingsPage["Service"]) {
  const plugin = actions.sectionPlugin();
  if (plugin) return renderPluginSection(ctx, actions, plugin);
  switch (actions.state.section) {
    case "agents":
      return renderAgents(ctx, actions);
    case "workspaces":
      return renderWorkspaces(ctx, actions);
    case "archived":
      return renderArchived(ctx, actions);
    case "plugins":
      return renderPlugins(ctx, actions);
    case "tools":
      return renderTools(ctx, actions);
    case "keys":
      return renderKeys(ctx, actions);
    case "updates":
      return renderUpdates(ctx, actions);
    default:
      return renderGeneral(ctx, actions);
  }
}

// The open section, at the reading width in the main pane. The page's data
// loads when the plugin starts, so Settings opens on its section at once.
export function renderSettings(ctx: EffectViewContext<object>, actions: SettingsPage["Service"]) {
  const state = actions.state;
  if (ctx.app.route !== "settings") return null;
  // A plugin's section that is gone (the plugin was removed) falls back.
  const open = actions.sectionPlugin();
  if (open && state.data.status === "ready" && !state.data.plugins.some((p) => p.name === open && p.settings))
    state.section = "general";
  // The chat plugin's film grain covers this page too.
  const grain = state.sections.chat?.properties.some((p) => p.key === "transcriptGrain" && p.value === true) ?? false;
  return (
    <div id="settings-page" {...column} {...fill} {...full} padding="small" grain={grain}>
      <div {...column} {...fill} height="100%" padding="small" overflowY="scroll">
          {state.data.status === "ready"
                        ? <div key={state.section} id={`settings-section-${state.section}`} {...column} {...reading} gap="large" padding="small" paddingX="large" paddingY="large" {...SECTION_IN}>{body(ctx, actions)}</div>
                        : state.data.status === "failed"
                          ? <div {...column} {...reading} padding="large"><callout title="Settings could not load" text={state.data.error}><button id="settings-retry" label="Try again" small variant="outline" onClick={() => ctx.run(actions.load())} /></callout></div>
                          : null}
        </div>
    </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.