approval

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package approval provides human-in-the-loop approval workflows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	ID       string         `json:"id"`
	ToolName string         `json:"tool_name"`
	Args     map[string]any `json:"args"`
	Response chan bool      `json:"-"`
}

Request represents a pending approval request.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service manages pending approval requests.

func NewService

func NewService() *Service

func (*Service) HandlePending

func (s *Service) HandlePending(w http.ResponseWriter, _ *http.Request)

HandlePending returns all pending approval requests.

func (*Service) HandleRespond

func (s *Service) HandleRespond(w http.ResponseWriter, r *http.Request)

HandleRespond processes an approval response.

func (*Service) RequestApproval

func (s *Service) RequestApproval(toolName string, args map[string]any) (bool, error)

RequestApproval submits a tool call for human approval and blocks until resolved.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL