summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBen Vargas <[email protected]>2025-12-02 21:50:21 -0700
committerGitHub <[email protected]>2025-12-02 22:50:21 -0600
commit6c25e64658d2f3fbb047b4d19e8b959dae218551 (patch)
tree20ffaf9c11b8bc03c0b519166939f01f957d724e
parentf2fd0f8f009e9649e01b799c5c0758d5a3496536 (diff)
downloadopencode-6c25e64658d2f3fbb047b4d19e8b959dae218551.tar.gz
opencode-6c25e64658d2f3fbb047b4d19e8b959dae218551.zip
fix: correct Provider type in chat.params plugin hook (#5003)
-rw-r--r--packages/plugin/src/index.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/plugin/src/index.ts b/packages/plugin/src/index.ts
index ab7aac251..291d68b79 100644
--- a/packages/plugin/src/index.ts
+++ b/packages/plugin/src/index.ts
@@ -16,6 +16,12 @@ import { type ToolDefinition } from "./tool"
export * from "./tool"
+export type ProviderContext = {
+ source: "env" | "config" | "custom" | "api"
+ info: Provider
+ options: Record<string, any>
+}
+
export type PluginInput = {
client: ReturnType<typeof createOpencodeClient>
project: Project
@@ -153,7 +159,7 @@ export interface Hooks {
* Modify parameters sent to LLM
*/
"chat.params"?: (
- input: { sessionID: string; agent: string; model: Model; provider: Provider; message: UserMessage },
+ input: { sessionID: string; agent: string; model: Model; provider: ProviderContext; message: UserMessage },
output: { temperature: number; topP: number; options: Record<string, any> },
) => Promise<void>
"permission.ask"?: (input: Permission, output: { status: "ask" | "deny" | "allow" }) => Promise<void>