Official

files

Built-in files 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/files@0.2.4

Permissions in 0.2.4

  • Read files fs.readMediumReads files in the listed places.List the files of the workspacePlaces: the open workspace
  • Read chats chats.readMediumReads your transcripts and chat lists.Refresh the file list when an agent finishes a turn
  • Show panels ui.slotsAlways grantedShows views in the listed parts of the window.Show the files button and panelSlots: railright

Files

folders.ts2.1 KB
// The folders open in each workspace's tree. The panel keeps them rather
// than the kernel's tree, so they outlast the tree: a hidden panel or
// another workspace gives them back as they were. The folders of the
// visible file open too, as in Zed.
import * as Effect from "effect/Effect";
import { folderIds } from "./panel.ts";
import type { FilesState } from "./panel.ts";

// `list` lists one folder of a workspace, warning when it cannot; `redraw`
// draws the panel again.
export function makeFolders(
  state: FilesState,
  list: (workspaceId: string, folder: string) => Effect.Effect<void>,
  redraw: () => void,
) {
  const openIn = (workspaceId: string) => (state.open[workspaceId] ??= new Set());
  const expand = Effect.fn("Files.expand")(function* (workspaceId: string, folder: string) {
    if (state.all || state.listing[folder]) return;
    yield* list(workspaceId, folder);
  });
  // A folder opened or closed in the tree, by pointer or keyboard. The tree
  // shows it already; the panel keeps it for when the tree is drawn anew.
  const setOpen = Effect.fn("Files.setOpen")(function* (workspaceId: string, folder: string, open: boolean) {
    if (!open) return void openIn(workspaceId).delete(folder);
    openIn(workspaceId).add(folder);
    yield* expand(workspaceId, folder);
  });
  const collapseAll = Effect.fn("Files.collapseAll")(function* () {
    if (!state.workspaceId) return;
    openIn(state.workspaceId).clear();
    redraw();
  });
  // Opens each folder on the file's path that its parent lists, listing the
  // parents on the way, so a file of another workspace opens nothing.
  const reveal = Effect.fn("Files.reveal")(function* (path: string) {
    const workspaceId = state.workspaceId;
    if (!workspaceId || state.all) return;
    let parent = "";
    for (const folder of folderIds(path)) {
      if (!state.listing[parent]) yield* list(workspaceId, parent);
      if (!state.listing[parent]?.folders.includes(folder.slice(parent.length, -1))) break;
      openIn(workspaceId).add(folder);
      parent = folder;
    }
    if (parent) yield* expand(workspaceId, parent);
    redraw();
  });
  return { openIn, setOpen, collapseAll, reveal };
}

Versions

VersionPublishedPlugin APISizePermissionsStatus
0.2.6latestNov 21, 2026>=5 <613.7 KB3 permissionsListed
0.2.5Nov 11, 2026>=5 <613.3 KB3 permissionsListed
0.2.4Nov 9, 2026>=5 <612.3 KB3 permissionsListed
0.2.3Oct 27, 2026>=2 <48 KB3 permissionsListed

Reviews and comments

0 threads · 0 reviews

No comments yet.