feat(hook): command execute before hook (#9267)
This commit is contained in:
@@ -1702,6 +1702,16 @@ NOTE: At any point in time through this workflow you should feel free to ask the
|
|||||||
: await lastModel(input.sessionID)
|
: await lastModel(input.sessionID)
|
||||||
: taskModel
|
: taskModel
|
||||||
|
|
||||||
|
await Plugin.trigger(
|
||||||
|
"command.execute.before",
|
||||||
|
{
|
||||||
|
command: input.command,
|
||||||
|
sessionID: input.sessionID,
|
||||||
|
arguments: input.arguments,
|
||||||
|
},
|
||||||
|
{ parts },
|
||||||
|
)
|
||||||
|
|
||||||
const result = (await prompt({
|
const result = (await prompt({
|
||||||
sessionID: input.sessionID,
|
sessionID: input.sessionID,
|
||||||
messageID: input.messageID,
|
messageID: input.messageID,
|
||||||
|
|||||||
@@ -173,6 +173,10 @@ export interface Hooks {
|
|||||||
output: { temperature: number; topP: number; topK: number; options: Record<string, any> },
|
output: { temperature: number; topP: number; topK: number; options: Record<string, any> },
|
||||||
) => Promise<void>
|
) => Promise<void>
|
||||||
"permission.ask"?: (input: Permission, output: { status: "ask" | "deny" | "allow" }) => Promise<void>
|
"permission.ask"?: (input: Permission, output: { status: "ask" | "deny" | "allow" }) => Promise<void>
|
||||||
|
"command.execute.before"?: (
|
||||||
|
input: { command: string; sessionID: string; arguments: string },
|
||||||
|
output: { parts: Part[] },
|
||||||
|
) => Promise<void>
|
||||||
"tool.execute.before"?: (
|
"tool.execute.before"?: (
|
||||||
input: { tool: string; sessionID: string; callID: string },
|
input: { tool: string; sessionID: string; callID: string },
|
||||||
output: { args: any },
|
output: { args: any },
|
||||||
|
|||||||
Reference in New Issue
Block a user