approval

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeStrict      = permission.ModeStrict
	ModeBalanced    = permission.ModeBalanced
	ModeAcceptEdits = permission.ModeAcceptEdits
	ModeTrust       = permission.ModeTrust
)
View Source
const (
	ChoiceAllowOnce    = permission.ChoiceAllowOnce
	ChoiceAllowSession = permission.ChoiceAllowSession
	ChoiceAllowAlways  = permission.ChoiceAllowAlways
	ChoiceDeny         = permission.ChoiceDeny
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApproverFunc

type ApproverFunc = permission.Approver

type AuditEntry

type AuditEntry = permission.AuditEntry

type Capability

type Capability = permission.Capability

type Choice

type Choice = permission.Choice

type CommandCategory

type CommandCategory string
const (
	CommandCategoryInfo    CommandCategory = "info"
	CommandCategoryPrompt  CommandCategory = "prompt"
	CommandCategorySession CommandCategory = "session"
	CommandCategoryConfig  CommandCategory = "config"
	CommandCategoryPlan    CommandCategory = "plan"
	CommandCategoryExit    CommandCategory = "exit"
)

func NormalizeCommandCategory

func NormalizeCommandCategory(raw string) CommandCategory

type CommandRequest

type CommandRequest struct {
	Name      string
	Category  CommandCategory
	NeedsIdle bool
	IsRunning bool
	Summary   string
	Preview   string
}

type Engine

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

func NewEngine

func NewEngine(cwd string, mode Mode, rules *RuleSet, onAudit func(AuditEntry)) (*Engine, error)

func (*Engine) ApproveCommand

func (e *Engine) ApproveCommand(_ context.Context, req CommandRequest) error

func (*Engine) ApproveHook

func (e *Engine) ApproveHook(ctx context.Context, req HookRequest) error

func (*Engine) Decide added in v0.1.0

func (e *Engine) Decide(ctx context.Context, req permission.Request) (*permission.Decision, error)

func (*Engine) Mode

func (e *Engine) Mode() Mode

func (*Engine) PlanMode

func (e *Engine) PlanMode() bool

func (*Engine) SetApprover

func (e *Engine) SetApprover(fn ApproverFunc)

func (*Engine) SetFilesystemRoots

func (e *Engine) SetFilesystemRoots(roots FilesystemRoots)

func (*Engine) SetMode

func (e *Engine) SetMode(mode Mode)

func (*Engine) SetPlanAllowedCommands added in v0.1.0

func (e *Engine) SetPlanAllowedCommands(prefixes []string)

func (*Engine) SetPlanMode

func (e *Engine) SetPlanMode(active bool)

func (*Engine) SetSkillAllows

func (e *Engine) SetSkillAllows(rawTools []string)

type FilesystemRoots

type FilesystemRoots = permission.FilesystemRoots

type HookRequest

type HookRequest struct {
	Event    string
	Tool     string
	Command  string
	Blocking bool
}

type Mode

type Mode = permission.Mode

func ParseMode

func ParseMode(raw string) (Mode, error)

type Prompt

type Prompt = permission.Prompt

type Rule

type Rule = permission.Rule

func ParseRule

func ParseRule(raw string) (Rule, error)

type RuleSet

type RuleSet = permission.RuleSet

func ParseRuleSet

func ParseRuleSet(allow, deny []string) (*RuleSet, error)

Jump to

Keyboard shortcuts

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