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

Permissions in 0.2.6

  • Control chats chats.controlHighCreates chats, sends prompts and cancels runs.Send prompts, answer agent questions, and create, change, fork, revert, stop and group chats
  • Run other plugins' commands commands.runHighRuns commands of other plugins.Run the sidebar's New chat command from the title bar
  • Read chats chats.readMediumReads your transcripts and chat lists.Show workspaces, tasks, chats and transcripts, and follow them as agents work
  • Read files fs.readMediumReads files in the listed places.Suggest workspace files for @ mentionsPlaces: the open workspace
  • Show panels ui.slotsAlways grantedShows views in the listed parts of the window.Draw the chat grid, the title bar, and the Session panel with its rail buttonSlots: centertitlerailright

Files

open-in.ts2.3 KB
// "Open in": the chat's workspace folder in an editor, a terminal or the
// file manager on this machine, through the kernel's `open_in` methods. The
// app picked last is kept in the plugin's storage, so one click on the title
// strip's button opens it again.
import * as Effect from "effect/Effect";
import type { OpenInApp } from "divergence";
import type { Controller } from "./controller.ts";

const CHOSEN = "openIn";
const FINDER = "file-manager";

/** The apps on this machine and the one picked last. An older kernel has no `open_in.apps`: the list stays empty and
 * the title strip shows no control. */
export const loadOpenIn = Effect.fn("Chat.loadOpenIn")(function* (c: Controller) {
  const chosen = (yield* c.host.call("host/storage.get", { key: CHOSEN })).value;
  if (typeof chosen === "string") c.state.openIn.chosen = chosen;
  yield* listApps(c);
});

const listApps = (c: Controller) =>
  c.kernel.call("open_in.apps", {}).pipe(
    Effect.flatMap(({ apps }) =>
      Effect.sync(() => {
        c.state.openIn.apps = apps;
        c.presentations?.updateAllTitles();
      }),
    ),
    Effect.catchTag("KernelCallFailed", (error) =>
      error.message.startsWith("method not found")
        ? Effect.void
        : c.notify.error(`The apps to open the workspace in could not be found: ${error.message}`),
    ),
  );

/** The app the button opens: the one picked last while it is installed, else Finder, else the first one found. */
export function shownApp(c: Controller): OpenInApp | undefined {
  const { apps, chosen } = c.state.openIn;
  return apps.find((app) => app.id === chosen) ?? apps.find((app) => app.id === FINDER) ?? apps[0];
}

/** Opens the workspace's folder in `app` and remembers it, then lists the apps again, so one installed or removed since
 * shows at the next look. */
export const openIn = Effect.fn("Chat.openIn")(function* (c: Controller, workspaceId: string, app: OpenInApp) {
  yield* c.kernel
    .call("open_in", { app: app.id, workspaceId })
    .pipe(
      Effect.catchTag("KernelCallFailed", (error) => c.notify.error(`Could not open in ${app.name}: ${error.message}`)),
    );
  if (c.state.openIn.chosen !== app.id) {
    c.state.openIn.chosen = app.id;
    c.presentations?.updateAllTitles();
    yield* c.host.call("host/storage.set", { key: CHOSEN, value: app.id });
  }
  yield* listApps(c);
});

Versions

VersionPublishedPlugin APISizePermissionsStatus
0.2.9latestNov 21, 2026>=5 <6349 KB5 permissionsListed
0.2.8Nov 16, 2026>=5 <6348.6 KB5 permissionsListed
0.2.7Nov 11, 2026>=5 <6314.3 KB5 permissionsListed
0.2.6Nov 9, 2026>=5 <6306.2 KB5 permissionsListed
0.2.5Oct 27, 2026>=2 <4178.6 KB5 permissionsListed

Reviews and comments

0 threads · 0 reviews

No comments yet.