Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClassifyOperation ¶
ClassifyOperation determines the operation type from a tool name.
Types ¶
type ApprovalManager ¶
type ApprovalManager struct {
// contains filtered or unexported fields
}
ApprovalManager handles pause/approve/deny flows for tool calls that require human approval before proceeding.
func NewApprovalManager ¶
func NewApprovalManager() *ApprovalManager
NewApprovalManager creates a new ApprovalManager.
func (*ApprovalManager) Approve ¶
func (a *ApprovalManager) Approve(id string) bool
Approve approves the pending request with the given ID. Returns false if the ID is not found or was already consumed.
func (*ApprovalManager) Deny ¶
func (a *ApprovalManager) Deny(id string) bool
Deny denies the pending request with the given ID. Returns false if the ID is not found or was already consumed.
func (*ApprovalManager) WaitForApproval ¶
func (a *ApprovalManager) WaitForApproval(ctx context.Context, id string, timeout time.Duration) ApprovalStatus
WaitForApproval blocks until the given approval ID is approved, denied, the timeout elapses, or ctx is cancelled. A cancelled context (e.g. shutdown) returns ApprovalTimedOut so the caller fails the paused call safely rather than letting it proceed unapproved.
type ApprovalStatus ¶ added in v0.3.9
type ApprovalStatus string
ApprovalStatus describes the outcome of a pause/approval flow.
const ( ApprovalApproved ApprovalStatus = "approved" ApprovalDenied ApprovalStatus = "denied" ApprovalTimedOut ApprovalStatus = "timed_out" ApprovalNoApprover ApprovalStatus = "no_approver" )