Official
opencode-v2
OpenCode 2 agent provider: runs opencode serve (2.x) and talks to its /api over HTTP and server-sent events.
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/opencode-v2@0.1.4
Permissions in 0.1.4
Files
types.ts1.3 KB
// The agent's state that is not the wire: where the server comes from, the
// chats and subagents it knows, and the event stream it reads.
import type * as Deferred from "effect/Deferred";
import type * as Fiber from "effect/Fiber";
import type { TaskInfo, ToolSpec } from "divergence/protocol";
/// Where the server comes from: the binary to start, or the address of one
/// the user runs (which wins).
export interface Config {
binaryPath: string | null;
serverUrl: string | null;
}
/// A chat the host knows. `applied` is what the server's session was last
/// told, so a prompt only switches what changed.
export interface SessionState {
workspace: string;
options: Record<string, unknown>;
tools: readonly ToolSpec[];
instructions: string | null;
applied: { model: string | null; agent: string | null; mode: string | null; instructions: string | null };
}
/// A subagent: a session of its own whose events show in the chat that
/// started it.
export interface Child {
root: string;
parent: string;
task: TaskInfo;
}
/// A tool call seen on the stream, by its host item id.
export interface CallState {
session: string;
name: string;
input: Record<string, unknown>;
}
export interface EventStream {
ready: Deferred.Deferred<void, unknown>;
fiber: Fiber.Fiber<void, unknown> | null;
}
No comments yet.