Official

git

Built-in git 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/git@0.3.1

Permissions in 0.3.1

  • Run git commands git.writeHighRuns any git command.Stage, commit, switch branches and sync with the remote
  • Use your agents' models models.useHighRuns prompts through the agents you enabled.Write commit messages and pull requests with the cheapest model of your agents, on your own account
  • Read chats chats.readMediumReads your transcripts and chat lists.Refresh when an agent finishes a turn
  • Run named programs processMediumStarts the listed programs.Find and open the branch's pull request with the GitHub CLIPrograms: gh
  • Read git status and diffs git.readLowReads git status and diffs.Show the repository's status and diffs, and follow its changes
  • Show panels ui.slotsAlways grantedShows views in the listed parts of the window.Show the source control button and panelSlots: railright

Files

prompts.test.ts3.5 KB
// The model that writes for the panel, the prompts it gets and how its answers are read.
import assert from "node:assert/strict";
import { test } from "node:test";
import type { ModelAgent } from "divergence";
import { cleanMessage, commitPrompt, pullPrompt, splitPull, writerModel } from "./prompts.ts";
import type { Entry } from "./status.ts";

const efforts = (...values: string[]) => values.map((value) => ({ value, name: value }));
const model = (value: string, name = value, levels = efforts("low", "high")) => ({
  value,
  name,
  group: null,
  efforts: levels,
});
const agent = (id: string, models: ReturnType<typeof model>[], current: string | null = null): ModelAgent => ({
  id,
  name: id,
  icon: null,
  model: current,
  effort: null,
  models,
});

test("the writer is the first small model in the host's order, at low effort", () => {
  const agents = [
    { id: "broken", name: "Broken", icon: null, models: [], error: "not signed in" } as const,
    agent("first", [model("big-5"), model("gemini-2.5-pro")]),
    agent("second", [model("big-5"), model("big-5-mini", "Big 5 Mini", efforts("minimal", "low", "high"))]),
    agent("third", [model("haiku", "Haiku")]),
  ];
  assert.deepEqual(writerModel(agents), { agentId: "second", model: "big-5-mini", effort: "low" });
  assert.deepEqual(writerModel([agent("one", [model("fast-flash", "Flash", efforts("high"))])]), {
    agentId: "one",
    model: "fast-flash",
  });
});

test("without a small model the first agent writes with its own model, and with no agent nobody does", () => {
  assert.deepEqual(writerModel([agent("one", [model("big"), model("bigger")], "bigger")]), {
    agentId: "one",
    effort: "low",
  });
  assert.deepEqual(writerModel([agent("one", [])]), { agentId: "one" });
  assert.equal(writerModel([{ id: "x", name: "X", icon: null, models: [], error: "down" }]), null);
  assert.equal(writerModel([]), null);
});

test("answers lose a code fence and trailing spaces; a pull request answer splits into title and body", () => {
  assert.equal(
    cleanMessage("```text\nfix(git): keep the message  \n\nBody line \n```\n"),
    "fix(git): keep the message\n\nBody line",
  );
  assert.equal(cleanMessage("  feat: add a thing  "), "feat: add a thing");
  assert.deepEqual(splitPull("Title: Add pull requests\n\n- Writes the title\n- Opens it"), {
    title: "Add pull requests",
    body: "- Writes the title\n- Opens it",
  });
  assert.deepEqual(splitPull("# Add pull requests"), { title: "Add pull requests", body: "" });
});

test("the prompts carry the files, the branch, the commits, and at most 40,000 characters of a diff", () => {
  const files: Entry[] = [
    { path: "src/new.ts", origPath: "src/old.ts", staged: "R", unstaged: " ", letter: "R", side: "staged" },
    { path: "README.md", staged: "M", unstaged: " ", letter: "M", side: "staged" },
  ];
  const prompt = commitPrompt({ branch: "feature", files, diff: "x".repeat(50_000) });
  assert.match(prompt, /Conventional Commits/);
  assert.match(prompt, /Branch: feature/);
  assert.match(prompt, /R src\/old\.ts -> src\/new\.ts\nM README\.md/);
  assert.ok(!prompt.includes("x".repeat(40_001)));
  assert.match(prompt, /The rest is left out/);
  assert.match(commitPrompt({ branch: null, files, diff: "" }), /Branch: \(detached\)[\s\S]*only new files/);
  const pull = pullPrompt({ head: "feature", base: "main", commits: "* fix: one", stat: " a.ts | 2 +-" });
  assert.match(pull, /Branch feature into main\./);
  assert.match(pull, /\* fix: one[\s\S]*a\.ts \| 2 \+-/);
});

Versions

VersionPublishedPlugin APISizePermissionsStatus
0.3.3latestNov 21, 2026>=5 <630.8 KB6 permissionsListed
0.3.2Nov 16, 2026>=5 <630.4 KB6 permissionsListed
0.3.1Nov 11, 2026>=5 <630.2 KB6 permissionsListed
0.3.0Nov 9, 2026>=5 <629.2 KB6 permissionsListed
0.2.1Oct 27, 2026>=2 <413.6 KB4 permissionsListed

Reviews and comments

0 threads · 0 reviews

No comments yet.