Documentation
¶
Overview ¶
Package approval implements app-control approval tracking for computer-use sessions, including session and persistent approvals plus explicit deny, cancel, and persistence-failed outcomes.
Index ¶
- Variables
- type Store
- func (s *Store) Approve(bundleID string, persistent bool) (computeruse.ApprovalState, error)
- func (s *Store) Path() string
- func (s *Store) Resolve(bundleID string, decision computeruse.ApprovalDecision) (computeruse.ApprovalState, error)
- func (s *Store) Status(bundleID string) computeruse.ApprovalState
Constants ¶
This section is empty.
Variables ¶
var ( // ErrBundleIDRequired reports a missing bundle ID. ErrBundleIDRequired = errors.New("bundle id required") // ErrApprovalDenied reports an explicit denial. ErrApprovalDenied = errors.New("approval denied") // ErrApprovalCanceled reports a canceled approval request. ErrApprovalCanceled = errors.New("approval canceled") // ErrApprovalPersistenceFailed reports that approval succeeded for the // current session but could not be persisted. ErrApprovalPersistenceFailed = errors.New("approval persistence failed") )
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store keeps approval state in memory and can persist it to disk.
func NewMemory ¶
func NewMemory() *Store
NewMemory returns a store that keeps all approvals in memory.
func NewStore ¶
NewStore returns a store backed by the default application-support path. If path is provided, it overrides the default location. An empty path disables persistence.
func (*Store) Approve ¶
func (s *Store) Approve(bundleID string, persistent bool) (computeruse.ApprovalState, error)
Approve records approval for bundleID. Persistent approval is saved when the store has a configured backing file.
func (*Store) Path ¶
Path reports the configured persistence path. It is empty for memory-only stores.
func (*Store) Resolve ¶
func (s *Store) Resolve(bundleID string, decision computeruse.ApprovalDecision) (computeruse.ApprovalState, error)
Resolve reports or records approval for bundleID according to decision.
func (*Store) Status ¶
func (s *Store) Status(bundleID string) computeruse.ApprovalState
Status reports the current approval state for bundleID.