mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
chore: revert unrelated golines formatting
This commit is contained in:
@@ -98,11 +98,7 @@ type processHookAfterToolResponse struct {
|
||||
Result *ToolResultHookResponse `json:"result,omitempty"`
|
||||
}
|
||||
|
||||
func NewProcessHook(
|
||||
ctx context.Context,
|
||||
name string,
|
||||
opts ProcessHookOptions,
|
||||
) (*ProcessHook, error) {
|
||||
func NewProcessHook(ctx context.Context, name string, opts ProcessHookOptions) (*ProcessHook, error) {
|
||||
if len(opts.Command) == 0 {
|
||||
return nil, fmt.Errorf("process hook command is required")
|
||||
}
|
||||
@@ -266,10 +262,7 @@ func (ph *ProcessHook) AfterTool(
|
||||
return resp.Result, HookDecision{Action: resp.Action, Reason: resp.Reason}, nil
|
||||
}
|
||||
|
||||
func (ph *ProcessHook) ApproveTool(
|
||||
ctx context.Context,
|
||||
req *ToolApprovalRequest,
|
||||
) (ApprovalDecision, error) {
|
||||
func (ph *ProcessHook) ApproveTool(ctx context.Context, req *ToolApprovalRequest) (ApprovalDecision, error) {
|
||||
if ph == nil || !ph.opts.ApproveTool {
|
||||
return ApprovalDecision{Approved: true}, nil
|
||||
}
|
||||
@@ -480,11 +473,7 @@ func (ph *ProcessHook) removePending(id uint64) {
|
||||
}
|
||||
}
|
||||
|
||||
func (al *AgentLoop) MountProcessHook(
|
||||
ctx context.Context,
|
||||
name string,
|
||||
opts ProcessHookOptions,
|
||||
) error {
|
||||
func (al *AgentLoop) MountProcessHook(ctx context.Context, name string, opts ProcessHookOptions) error {
|
||||
if al == nil {
|
||||
return fmt.Errorf("agent loop is nil")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user