diff options
Diffstat (limited to 'packages/plugin/src/index.ts')
| -rw-r--r-- | packages/plugin/src/index.ts | 67 |
1 files changed, 24 insertions, 43 deletions
diff --git a/packages/plugin/src/index.ts b/packages/plugin/src/index.ts index 9040fb517..be9822ee2 100644 --- a/packages/plugin/src/index.ts +++ b/packages/plugin/src/index.ts @@ -10,47 +10,28 @@ export type Plugin = (input: PluginInput) => Promise<Hooks> export interface Hooks { event?: (input: { event: Event }) => Promise<void> - chat?: { - /** - * Called when a new message is received - */ - message?: (input: {}, output: { message: UserMessage; parts: Part[] }) => Promise<void> - /** - * Modify parameters sent to LLM - */ - params?: ( - input: { model: Model; provider: Provider; message: UserMessage }, - output: { temperature: number; topP: number }, - ) => Promise<void> - } - permission?: { - /** - * Called when a permission is asked - */ - ask?: (input: Permission, output: { status: "ask" | "deny" | "allow" }) => Promise<void> - } - tool?: { - execute?: { - /** - * Called before a tool is executed - */ - before?: ( - input: { tool: string; sessionID: string; callID: string }, - output: { - args: any - }, - ) => Promise<void> - /** - * Called after a tool is executed - */ - after?: ( - input: { tool: string; sessionID: string; callID: string }, - output: { - title: string - output: string - metadata: any - }, - ) => Promise<void> - } - } + /** + * Called when a new message is received + */ + "chat.message"?: (input: {}, output: { message: UserMessage; parts: Part[] }) => Promise<void> + /** + * Modify parameters sent to LLM + */ + "chat.params"?: ( + input: { model: Model; provider: Provider; message: UserMessage }, + output: { temperature: number; topP: number }, + ) => Promise<void> + "permission.ask"?: (input: Permission, output: { status: "ask" | "deny" | "allow" }) => Promise<void> + "tool.execute.before"?: ( + input: { tool: string; sessionID: string; callID: string }, + output: { args: any }, + ) => Promise<void> + "tool.execute.after"?: ( + input: { tool: string; sessionID: string; callID: string }, + output: { + title: string + output: string + metadata: any + }, + ) => Promise<void> } |
