style(agent): format whitespace in hook structs and constants
Remove trailing whitespace and standardize spacing in JSON struct tags, constants, and test data for improved code consistency.
This commit is contained in:
parent
a81dd22b2d
commit
4d0eced9f4
3 changed files with 7 additions and 7 deletions
|
|
@ -91,8 +91,8 @@ type processHookAfterLLMResponse struct {
|
||||||
|
|
||||||
type processHookBeforeToolResponse struct {
|
type processHookBeforeToolResponse struct {
|
||||||
processHookDecisionResponse
|
processHookDecisionResponse
|
||||||
Call *ToolCallHookRequest `json:"call,omitempty"`
|
Call *ToolCallHookRequest `json:"call,omitempty"`
|
||||||
Result *tools.ToolResult `json:"result,omitempty"` // Result returned directly by hook (for respond action)
|
Result *tools.ToolResult `json:"result,omitempty"` // Result returned directly by hook (for respond action)
|
||||||
}
|
}
|
||||||
|
|
||||||
type processHookAfterToolResponse struct {
|
type processHookAfterToolResponse struct {
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ type HookAction string
|
||||||
const (
|
const (
|
||||||
HookActionContinue HookAction = "continue"
|
HookActionContinue HookAction = "continue"
|
||||||
HookActionModify HookAction = "modify"
|
HookActionModify HookAction = "modify"
|
||||||
HookActionRespond HookAction = "respond" // Return result directly, skip tool execution
|
HookActionRespond HookAction = "respond" // Return result directly, skip tool execution
|
||||||
HookActionDenyTool HookAction = "deny_tool"
|
HookActionDenyTool HookAction = "deny_tool"
|
||||||
HookActionAbortTurn HookAction = "abort_turn"
|
HookActionAbortTurn HookAction = "abort_turn"
|
||||||
HookActionHardAbort HookAction = "hard_abort"
|
HookActionHardAbort HookAction = "hard_abort"
|
||||||
|
|
|
||||||
|
|
@ -356,10 +356,10 @@ func (h *respondHook) BeforeTool(
|
||||||
if h.respondTools[call.Tool] {
|
if h.respondTools[call.Tool] {
|
||||||
next := call.Clone()
|
next := call.Clone()
|
||||||
next.HookResult = &tools.ToolResult{
|
next.HookResult = &tools.ToolResult{
|
||||||
ForLLM: "hook-responded: " + call.Tool,
|
ForLLM: "hook-responded: " + call.Tool,
|
||||||
ForUser: "",
|
ForUser: "",
|
||||||
Silent: false,
|
Silent: false,
|
||||||
IsError: false,
|
IsError: false,
|
||||||
}
|
}
|
||||||
return next, HookDecision{Action: HookActionRespond}, nil
|
return next, HookDecision{Action: HookActionRespond}, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue