Dashboard › opencode › Distillation
1c113e3b-7804-4faf-a50a-add8312e8fed["lore_tm_v1_dvDGQqQo5BC3JP4VLfKb37Yba_z6hii6YO_NQZUolUc"]
Date: Sep 8, 2026
/home/byk/.opencode/node_modules/@opencode-ai/plugin/dist/index.d.ts; imports include Event, createOpencodeClient, Project, Model, Provider, Permission, UserMessage, Message, Part, Auth, and Config from @opencode-ai/sdk, BunShell from ./shell, and ToolDefinition from ./tool; the file also re-exports everything from ./tool.ProviderContext has source: "env" | "config" | "custom" | "api", info: Provider, and options: Record<string, any>.PluginInput fields are client: ReturnType<typeof createOpencodeClient>, project: Project, directory: string, worktree: string, serverUrl: URL, and $: BunShell.AuthHook contains provider: string, optional loader?: (auth: () => Promise<Auth>, provider: Provider) => Promise<Record<string, any>>, and a methods array supporting "oauth" and "api" authentication methods.AuthHook method variants have label: string and optional prompts containing either text prompts (key, message, optional placeholder, validate, and condition) or select prompts (key, message, options, and optional condition); select options contain label, value, and optional hint."oauth" AuthHook method requires authorize(inputs?: Record<string, string>): Promise<AuthOuathResult>. The "api" method has optional authorize? returning either { type: "success"; key: string; provider?: string } or { type: "failed" }.AuthOuathResult—spelled exactly with Ouath—contains url: string, instructions: string, and either method: "auto" with callback() or method: "code" with callback(code: string). Each callback returns failure or success with optional provider plus either OAuth credentials (refresh, access, expires, optional accountId) or key.Hooks members include optional event, config, tool, auth, "chat.message", "chat.params", and "chat.headers". event receives { event: Event }; config receives Config; tool maps string keys to ToolDefinition; and auth is AuthHook."chat.message" is documented as “Called when a new message is received”; its input contains sessionID, optional agent, optional model with providerID and modelID, optional messageID, and optional variant; its mutable output contains message: UserMessage and parts: Part[]."chat.params" is documented as “Modify parameters sent to LLM”; its input contains sessionID, agent, model: Model, provider: ProviderContext, and message: UserMessage; its output contains temperature, topP, topK, and options: Record<string, any>."chat.headers" shows the same input fields as "chat.params"—sessionID, agent, model, provider, and message—and output headers: Record<string, string>; the tool indicated that offset 156 is needed to view the remainder.