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.
Files
subagents.ts4 KB
// Native ACP child associations are reusable, restricted sessions rather than turns.
import type { TaskInfo, Usage } from "divergence/protocol";
import { patch, record } from "./entities.ts";
import type { RecordValue } from "./entities.ts";
import type { Message } from "./wire.ts";
export interface Child {
parent: string;
data: RecordValue;
toolCallId?: string;
model?: string;
effort?: string;
usage?: Usage;
}
export class Subagents {
readonly version: 1 | 2;
constructor(version: 1 | 2 = 1) {
this.version = version;
}
readonly children = new Map<string, Child>();
announce(parent: string, update: Message): string | null {
if (typeof update.sessionId !== "string") return null;
const id = update.sessionId;
const existing = this.children.get(id);
if (id === parent || (existing && existing.parent !== parent))
throw new Error("An ACP child cannot change parents.");
for (
let ancestor: string | undefined = parent;
ancestor !== undefined;
ancestor = this.children.get(ancestor)?.parent
)
if (ancestor === id) throw new Error("An ACP child association cannot form a cycle.");
const child = existing ?? { parent, data: {} };
patch(child.data, update, this.version === 2);
this.children.set(id, child);
return id;
}
root(id: string): string {
let parent = this.children.get(id)?.parent;
while (parent !== undefined) {
id = parent;
parent = this.children.get(id)?.parent;
}
return id;
}
state(id: string, update: Message): void {
const child = this.children.get(id);
if (child) child.data.state = update;
}
task(id: string): TaskInfo {
const child = this.children.get(id)!;
const state = record(child.data.state);
const status =
state.state === "running"
? "running"
: state.state === "requires_action"
? "waiting"
: state.state === "idle"
? "idle"
: undefined;
return {
id,
title: typeof child.data.title === "string" ? child.data.title : id,
...(status ? { status } : {}),
...(child.model ? { model: child.model } : {}),
...(child.effort ? { effort: child.effort } : {}),
...(child.usage ? { usage: child.usage } : {}),
...(child.toolCallId ? { toolCallId: child.toolCallId } : {}),
...(this.children.has(child.parent) ? { parentTaskId: child.parent } : {}),
...(typeof child.data.description === "string" ? { activity: child.data.description } : {}),
};
}
configuration(id: string, options: RecordValue[]): void {
const child = this.children.get(id);
if (!child) return;
const model = options.find((option) => option.category === "model")?.currentValue;
const effort = options.find((option) => option.category === "thought_level")?.currentValue;
child.model = typeof model === "string" ? model : undefined;
child.effort = typeof effort === "string" ? effort : undefined;
}
references(parent: string, toolCallId: unknown, content: unknown): string[] {
if (typeof toolCallId !== "string" || !Array.isArray(content)) return [];
const changed: string[] = [];
for (const item of content) {
const reference = record(item);
if (reference.type !== "session" || typeof reference.sessionId !== "string") continue;
const child = this.children.get(reference.sessionId);
if (child?.parent !== parent) continue;
child.toolCallId = toolCallId;
changed.push(reference.sessionId);
}
return changed;
}
cancellable(id: string): boolean {
return record(this.children.get(id)?.data.capabilities).cancel != null;
}
directory(id: string, fallback: (id: string) => string): string {
const child = this.children.get(id);
if (!child) return fallback(id);
return typeof child.data.cwd === "string" ? child.data.cwd : this.directory(child.parent, fallback);
}
forget(root: string): void {
for (const id of [...this.children.keys()]) if (this.root(id) === root) this.children.delete(id);
}
}Versions
| Version | Published | Plugin API | Size | Permissions | Status |
|---|---|---|---|---|---|
| 0.2.5latest | Nov 21, 2026 | >=5 <6 | 134 KB | 6 permissions | Listed |
| 0.2.4 | Nov 16, 2026 | >=5 <6 | 132.8 KB | 6 permissions | Listed |
| 0.2.3 | Nov 11, 2026 | >=5 <6 | 108.9 KB | 6 permissions | Listed |
| 0.2.2 | Nov 9, 2026 | >=5 <6 | 105.6 KB | 6 permissions | Listed |
| 0.2.1 | Oct 27, 2026 | >=2 <4 | 105.3 KB | 6 permissions | Listed |
No comments yet.