approval

package
v0.3.20 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package approval manages persistent approval rules for tool execution. ABOUTME: Persistent approval rules for tool execution decisions ABOUTME: Stores user's "Always Allow" and "Never Allow" preferences per tool

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RuleDecision

type RuleDecision string

RuleDecision represents whether a tool is always allowed or never allowed

const (
	// RuleAlwaysAllow means the tool can execute without prompting
	RuleAlwaysAllow RuleDecision = "always_allow"
	// RuleNeverAllow means the tool is permanently blocked
	RuleNeverAllow RuleDecision = "never_allow"
)

type Rules

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

Rules manages persistent approval decisions for tools

func NewRules

func NewRules() (*Rules, error)

NewRules creates a new approval rules manager

func (*Rules) Check

func (r *Rules) Check(toolName string) RuleDecision

Check returns the rule for a tool, or empty string if no rule exists

func (*Rules) List

func (r *Rules) List() map[string]RuleDecision

List returns all current rules (for debugging/settings UI)

func (*Rules) Remove

func (r *Rules) Remove(toolName string) error

Remove removes any rule for a tool (resets to prompt)

func (*Rules) SetAlwaysAllow

func (r *Rules) SetAlwaysAllow(toolName string) error

SetAlwaysAllow marks a tool as always allowed

func (*Rules) SetNeverAllow

func (r *Rules) SetNeverAllow(toolName string) error

SetNeverAllow marks a tool as never allowed

Jump to

Keyboard shortcuts

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