perm

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package perm is the permission dialog (doc 02 section 9). It renders the core's PermissionRequested event: the consequence preview is shown exactly as the core rendered it, by kind, and never re-derived from tool input (D2, D15). Deny has the default focus, so the lowest energy answer is the safe one.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Choice

type Choice int

Choice is one of the three answers.

const (
	Deny Choice = iota
	AllowOnce
	AllowSession
)

type Decision

type Decision struct {
	ID     string // the request ID from the event
	Choice Choice
}

Decision is the action this dialog returns through the overlay. The root maps it onto the core's permission reply; the dialog itself never touches the bus.

type Dialog

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

Dialog renders one permission request. It implements ui/dialog.Dialog.

func New

New builds the dialog for a request. Focus starts on deny.

func (*Dialog) Draw

func (d *Dialog) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

Draw centers the dialog box in area and paints it.

func (*Dialog) HandleMsg

func (d *Dialog) HandleMsg(msg btea.Msg) any

HandleMsg moves focus with arrows or tab and answers on enter, with d, a, and s as direct answers.

func (*Dialog) ID

func (d *Dialog) ID() string

ID keys grace arming to this exact request, so only a literal reopen of the same question skips the arming delay.

Jump to

Keyboard shortcuts

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