summaryrefslogtreecommitdiffhomepage
path: root/packages/plugin
diff options
context:
space:
mode:
authorMathias Beugnon <[email protected]>2025-11-09 06:29:27 +0100
committerGitHub <[email protected]>2025-11-08 23:29:27 -0600
commitd85eb1b880f288cd89d6ade9ccc30640df6c352e (patch)
tree72d1e33a3d7787733984d0cc045ed754fd00adb4 /packages/plugin
parent9637d704070782166a00262aa04b10353d2ebc03 (diff)
downloadopencode-d85eb1b880f288cd89d6ade9ccc30640df6c352e.tar.gz
opencode-d85eb1b880f288cd89d6ade9ccc30640df6c352e.zip
feat: add input context to chat.params and chat.message (#4085)
Diffstat (limited to 'packages/plugin')
-rw-r--r--packages/plugin/src/index.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/plugin/src/index.ts b/packages/plugin/src/index.ts
index f103749bd..4b187efe7 100644
--- a/packages/plugin/src/index.ts
+++ b/packages/plugin/src/index.ts
@@ -143,12 +143,15 @@ export interface Hooks {
/**
* Called when a new message is received
*/
- "chat.message"?: (input: {}, output: { message: UserMessage; parts: Part[] }) => Promise<void>
+ "chat.message"?: (
+ input: { sessionID: string; agent?: string; model?: { providerID: string; modelID: string; messageID?: string } },
+ output: { message: UserMessage; parts: Part[] },
+ ) => Promise<void>
/**
* Modify parameters sent to LLM
*/
"chat.params"?: (
- input: { model: Model; provider: Provider; message: UserMessage },
+ input: { sessionID: string; agent: string; model: Model; provider: Provider; message: UserMessage },
output: { temperature: number; topP: number; options: Record<string, any> },
) => Promise<void>
"permission.ask"?: (input: Permission, output: { status: "ask" | "deny" | "allow" }) => Promise<void>