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

Permissions in 0.2.6

  • 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

watch.ts2 KB
// The workspace on screen is watched: a change in it names the shown
// folders it touched, so a file made or removed by anything (an agent, a
// terminal, another app) shows at once.
import * as Effect from "effect/Effect";
import * as Exit from "effect/Exit";
import * as Scope from "effect/Scope";
import { Fs, Host } from "divergence/effect";
import { touchedFolders, type FilesState } from "./panel.ts";

/// `changed` gets the listed folders a change touched, or null when it
/// touched something the tree cannot place and everything lists again.
export const makeWatch = Effect.fn("Files.makeWatch")(function* (
  state: FilesState,
  changed: (workspaceId: string, touched: readonly string[] | null) => Effect.Effect<void>,
) {
  const host = yield* Host;
  const fs = yield* Fs;
  const scope = yield* Effect.scope;
  let watching: Scope.Closeable | undefined;
  return Effect.fn("Files.watch")(function* (workspaceId: string) {
    if (watching) yield* Scope.close(watching, Exit.void);
    const own = yield* Scope.fork(scope);
    watching = own;
    const root = yield* host.call("host/workspaces.list", {}).pipe(
      Effect.map(({ workspaces }) => workspaces.find((workspace) => workspace.id === workspaceId)?.path ?? null),
      Effect.catchTag(["HostCallFailed", "NeedsReview", "PermissionNotGranted"], () => Effect.succeed(null)),
    );
    const onChange = (paths: readonly string[]) => {
      if (state.workspaceId !== workspaceId) return;
      const touched = state.all ? null : touchedFolders(root, paths, new Set(Object.keys(state.listing)));
      Effect.runFork(Effect.forkIn(changed(workspaceId, touched), own, { startImmediately: true }));
    };
    yield* fs.watch(".", onChange, { workspaceId }).pipe(
      Effect.provideService(Scope.Scope, own),
      Effect.catchTag(["HostCallFailed", "NeedsReview", "PermissionNotGranted"], (error) =>
        Effect.sync(() => console.warn(`files: the workspace is not watched: ${error.message}`)),
      ),
    );
  });
});

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.