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

main.ts2 KB
// Register file views before starting app and agent subscriptions.
// Background reads start from app changes, never from rendering.
import * as Effect from "effect/Effect";
import * as Stream from "effect/Stream";
import { App, Commands, Events, Views, runPlugin } from "divergence/effect";
import { Files } from "./controller.ts";
import { runFinished } from "./panel.ts";
import { renderRail, renderPanel } from "./views.tsx";

const program = Effect.gen(function* () {
  const files = yield* Files;
  const app = yield* App;
  const commands = yield* Commands;
  const views = yield* Views;
  // Opened by its key, the panel's tree takes the keyboard (the rail's
  // button only shows it).
  yield* commands.register(
    "files.toggle",
    Effect.gen(function* () {
      const state = yield* app.state;
      yield* files.toggle(state);
      if (state.shared?.rightPanel !== "files" && state.workspaceId) yield* views.focus(`files-${state.workspaceId}`);
    }),
  );
  yield* commands.register("files.collapseAll", files.collapseAll());
  files.views.push(yield* views.add("rail", { slot: "rail", render: (ctx) => renderRail(ctx, files), on: ["app_state"], order: 10 }));
  files.views.push(
    yield* views.add("right", { slot: "right", render: (ctx) => renderPanel(ctx, files), on: ["app_state"], order: 10, title: "Files" }),
  );
  const events = yield* Events;
  yield* app.changes.pipe(
    Stream.runForEach((next) => Effect.forkScoped(files.followApp(next), { startImmediately: true })),
    Effect.forkScoped({ startImmediately: true }),
  );
  // Only finished runs are asked for; an older runtime sends every agent event.
  yield* events.stream("agent", { kinds: ["run_finished"] }).pipe(
    Stream.runForEach((event) =>
      Effect.forkScoped(
        runFinished(event.kind) && files.state.workspaceId ? files.refresh(files.state.workspaceId) : Effect.void,
        { startImmediately: true },
      ),
    ),
    Effect.forkScoped({ startImmediately: true }),
  );
  yield* files.followApp(yield* app.state);
});

export default runPlugin(Files.layer, program);

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.