Official

acp

ACP agents from the ACP registry (Gemini, Cursor, Droid, Kilo, pi, ...), Oh My Pi, and your own entries (custom.json in the plugin's data folder). Agents are discovered at runtime.

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/acp@0.2.4

Permissions in 0.2.4

Take care. This plugin asks for permissions that can do anything your account can. The app asks you to hold Enable for two seconds or to type the plugin's name before it turns on.
  • Run any command process.anyDangerousStarts any program or shell command. This is as strong as your own account.Start the ACP agents, which the registry launches by path or through package runners such as npx and uvx, and run the terminal commands an agent asks for
  • Provide agents agents.provideMediumAdds agents to the app.Provide the agents of the ACP registry, and serve plugin tools to them through the host's loopback MCP server
  • Network access netMediumConnects to the listed hosts.Download the ACP registry and the agents' marks once a dayHosts: cdn.agentclientprotocol.com
  • Read files fs.readMediumReads files in the listed places.Read the files an agent asks for (ACP fs/read_text_file), only inside the chat's workspace, and your own agents from custom.json in this plugin's data folderPlaces: the open workspaceits own data folder
  • Write files fs.writeMediumCreates, changes and deletes files in the listed places.Write the files an agent asks to write (ACP fs/write_text_file), only inside the chat's workspace, and move the custom agents of the old ACP plugin into custom.json oncePlaces: the open workspaceits own data folder
  • Environment variables envMediumReads the listed environment variables.Sign Grok in with your xAI API key when you set one, and tell which Windows build of an agent to runVariables: XAI_API_KEYPROCESSOR_ARCHITECTURE

Files

v1.ts5.9 KB
// ACP v1 keeps chunk streaming and prompt-response completion semantics.
import type { AcpAgent } from "./agent.ts";
import * as map from "./map.ts";
import * as wire from "./wire.ts";
import { ToolStream, bound } from "./throttle.ts";
import { Entities, notice } from "./entities.ts";
import { EmbeddedTools } from "./apps.ts";

export function applyUpdate(this: AcpAgent, session: string, live: string, update: wire.Message) {
  let entities = this.entities.get(live);
  if (!entities) this.entities.set(live, (entities = new Entities()));
  const events = entities.push(update);
  if (events !== null) {
    for (const event of events) this.emitFor(session, event);
    return;
  }
  if (update.sessionUpdate === "notice") return this.emitFor(session, notice(update));
  // One prompt per session makes live model output unambiguous. Metadata,
  // replay and user echoes do not establish pickup of the current input.
  if (["agent_message_chunk", "agent_thought_chunk", "tool_call"].includes(update.sessionUpdate ?? ""))
    this.consumeInput(session);
  switch (update.sessionUpdate) {
    // The user message is already in the host's transcript.
    case "user_message_chunk":
      return;
    case "agent_message_chunk": {
      const itemId = this.chunkItem(session, false, update.messageId);
      return this.emitFor(session, {
        event: "text_delta",
        itemId,
        text: map.contentText(update.content),
        mode: "append",
      });
    }
    case "agent_thought_chunk": {
      const itemId = this.chunkItem(session, true, update.messageId);
      return this.emitFor(session, {
        event: "reasoning_delta",
        itemId,
        text: map.contentText(update.content),
        mode: "append",
      });
    }
    case "tool_call":
      return startTool.call(this, session, live, update);
    case "tool_call_update":
      return updateTool.call(this, session, live, update);
    case "plan":
      this.breakChunks(session);
      return this.emitFor(session, { event: "plan", ...map.plan(update) });
    case "available_commands_update": {
      const commands = map.commands(update);
      const state = this.sessions.get(session);
      if (state) state.commands = commands;
      return this.emitFor(session, { event: "commands", commands });
    }
    case "current_mode_update": {
      const state = this.stateOf(session);
      if (state.modes && typeof update.currentModeId === "string")
        state.modes = { ...state.modes, currentModeId: update.currentModeId };
      return this.publishOptions(session);
    }
    case "config_option_update": {
      this.stateOf(session).config = Array.isArray(update.configOptions) ? update.configOptions : [];
      return this.publishOptions(session);
    }
    case "session_info_update":
      if (typeof update.title === "string") this.emitFor(session, { event: "session_info", title: update.title });
      return;
    case "usage_update": {
      const usage = map.contextUsage(update);
      this.stateOf(session).context = usage;
      return this.emitFor(session, { event: "usage", ...usage });
    }
    // Compaction, `plan_update` and `plan_removed` have no place yet.
    default:
      return;
  }
}

export function permission(request: wire.Message) {
  return { request, subject: {}, title: null as string | null, warning: null as string | null };
}

function startTool(this: AcpAgent, session: string, live: string, update: wire.Message) {
  if (update.toolCallId === undefined) return;
  this.breakChunks(session);
  map.applyTerminalMeta(update, this.reportedTerminals(live));
  const views = this.terminalViews(live);
  this.rememberTerminals(session, live, update.toolCallId, update.content);
  const started = map.toolCall(update, views);
  if (this.hostFeatures.includes("mcpApps")) {
    let tools = this.embeddedTools.get(live);
    if (!tools) this.embeddedTools.set(live, (tools = new EmbeddedTools()));
    started.content = tools.update(update, started.content);
  }
  bound(started.content);
  this.note(session, { kind: "tool", id: started.id });
  // A subagent is announced as a tool call and has nothing else to
  // declare it, so the task is derived from the call and the call
  // itself still renders as the row it nests under.
  const task = this.quirks.subagent(update);
  if (task) {
    started.kind = "task";
    this.tasks.set(task.id, task.title);
    this.emitFor(session, { event: "task", ...task });
  }
  return this.emitFor(session, { event: "tool_call_started", ...started });
}

function updateTool(this: AcpAgent, session: string, live: string, update: wire.Message) {
  if (update.toolCallId === undefined) return;
  this.breakChunks(session);
  const touched = map.applyTerminalMeta(update, this.reportedTerminals(live));
  const views = this.terminalViews(live);
  if (Array.isArray(update.content)) this.rememberTerminals(session, live, update.toolCallId, update.content);
  const task = this.finishedTask(update);
  if (task) this.emitFor(session, { event: "task", ...task });
  const patch = map.toolCallUpdate(update, views);
  // Output reported in `_meta` changes the row's terminal.
  if (touched !== null && patch.content === undefined)
    patch.content = map.toolContent([{ type: "terminal", terminalId: touched }], views);
  if (this.hostFeatures.includes("mcpApps")) {
    let tools = this.embeddedTools.get(live);
    if (!tools) this.embeddedTools.set(live, (tools = new EmbeddedTools()));
    patch.content = tools.update(update, patch.content);
  }
  bound(patch.content);
  // Agents that resend the whole output on every tick would otherwise
  // send one event per tick.
  let streams = this.toolStreams.get(session);
  if (!streams) {
    streams = new Map();
    this.toolStreams.set(session, streams);
  }
  let stream = streams.get(patch.id);
  if (!stream) {
    stream = new ToolStream();
    streams.set(patch.id, stream);
  }
  const send = stream.push(patch);
  if (send) this.emitFor(session, { event: "tool_call_updated", ...send });
  return;
}

Versions

VersionPublishedPlugin APISizePermissionsStatus
0.2.5latestNov 21, 2026>=5 <6134 KB6 permissionsListed
0.2.4Nov 16, 2026>=5 <6132.8 KB6 permissionsListed
0.2.3Nov 11, 2026>=5 <6108.9 KB6 permissionsListed
0.2.2Nov 9, 2026>=5 <6105.6 KB6 permissionsListed
0.2.1Oct 27, 2026>=2 <4105.3 KB6 permissionsListed

Reviews and comments

0 threads · 0 reviews

No comments yet.