Official
opencode
OpenCode agent provider: runs opencode serve and talks to it 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: cvg install convergence/opencode@0.2.0
Permissions in 0.2.0
Files
types.ts3.7 KB
// Provider state and boundary schemas. Output types come directly from
// the Convergence agent protocol; OpenCode's own shapes stay `unknown`
// until the mapper reads them.
import * as z from "zod";
import type { AgentEvent, PromptDelivery, RunOutcome } from "convergence/protocol";
import type * as Deferred from "effect/Deferred";
import type * as Fiber from "effect/Fiber";
export type {
ConfigChoice as Choice,
ConfigOption,
ToolContent,
ToolCall,
QuestionOption,
QuestionField,
TaskInfo as Task,
Usage,
TranscriptItem,
AgentInfo,
} from "convergence/protocol";
export type { AgentEvent as Event } from "convergence/protocol";
export type { Instance } from "./instances.ts";
/// A chat the host knows: its folder, the options it chose, the model its
/// last turn ran on, and the plugin tools and instructions it was created
/// with.
export interface SessionState {
workspace: string;
options: Record<string, unknown>;
ranOn: [string, string] | null;
tools: { name: string; description?: string; inputSchema?: unknown }[];
instructions: string | null;
}
/// An active run: its id, the error it reported (if any), and when the
/// prompt was sent (so a reconnect can tell a lost idle from a new turn).
export interface RunState {
id: string;
error: string | null;
startedAt?: number;
delivery?: PromptDelivery & { nativeInputId: string; consumed: boolean };
stopping?: boolean;
outcome?: RunOutcome;
}
/// One workspace folder's event-stream subscription.
export interface StreamEntry {
stopped: boolean;
body: { cancel?: () => unknown; end?: () => unknown } | null;
fiber: Fiber.Fiber<void> | null;
ready: Deferred.Deferred<void>;
droppedAt?: number | null;
}
const sessionSchema = z.looseObject({
sessionId: z.string().optional(),
workspace: z.string().optional(),
options: z.record(z.string(), z.unknown()).optional(),
tools: z
.array(z.object({ name: z.string(), description: z.string().optional(), inputSchema: z.unknown().optional() }))
.optional(),
instructions: z.string().nullish(),
});
const promptBlock = z.looseObject({
type: z.string().optional(),
text: z.string().optional(),
path: z.string().optional(),
mimeType: z.string().optional(),
data: z.string().optional(),
name: z.string().optional(),
input: z.string().optional(),
});
export const promptSchema = z.object({
itemId: z.string().optional(),
blocks: z.array(promptBlock).optional(),
delivery: z
.object({ inputId: z.string(), attemptId: z.string(), intent: z.enum(["send", "steer", "queue"]) })
.optional(),
});
export type PromptInput = z.infer<typeof promptSchema>;
const answerSchema = z.object({
cancelled: z.boolean().optional(),
values: z.record(z.string(), z.unknown()).optional(),
});
export type QuestionInput = z.infer<typeof answerSchema>;
export const schemas = {
session: z.object({ sessionId: z.string() }),
workspace: z.object({ workspace: z.string().optional() }),
skills: z.object({ workspace: z.string() }),
create: sessionSchema,
resume: sessionSchema.extend({ sessionId: z.string() }),
prompt: z.object({ sessionId: z.string(), input: promptSchema.optional() }),
cancelTask: z.object({ sessionId: z.string(), taskId: z.string() }),
setOption: z.object({ sessionId: z.string(), optionId: z.string(), value: z.unknown() }),
approval: z.object({ approvalId: z.string(), optionId: z.string() }),
question: z.object({ questionId: z.string(), answer: answerSchema.optional() }),
rollback: z.object({ sessionId: z.string(), itemId: z.string() }),
fork: sessionSchema.extend({ sessionId: z.string() }),
authenticate: z.object({ method: z.unknown().optional() }),
empty: z.unknown(),
};
export type SessionParams = z.infer<typeof sessionSchema>;Versions
| Version | Published | Plugin API | Size | Permissions | Status |
|---|---|---|---|---|---|
| 0.2.0latest | Oct 5, 2026 | >=2 <3 | 94.8 KB | 5 permissions | Listed |
No comments yet.