Versions in this module Expand all Collapse all v0 v0.6.0 Nov 10, 2026 Changes in this version + const IdleTimeout + const MaxFrame + const ProtocolVersion + var ErrDenied = errors.New("agent approval denied or canceled") + var ErrProtocol = errors.New("incompatible agent protocol; stop the old agent and retry") + func Connect(ctx context.Context, endpoint string, start bool) (net.Conn, error) + func CurrentTerminal() string + func Detach(cmd *exec.Cmd) + func Dial(ctx context.Context, endpoint string) (net.Conn, error) + func Endpoint() (string, error) + func Listen(endpoint string) (net.Listener, error) + func ReadFrame(r io.Reader, value any) error + func Requester(pid int) string + func ResourceApproval(account, command, requester, id, name string) (string, string) + func Serve(ctx context.Context, listener net.Listener, handler Handler) error + func Text(s string) string + func WriteFrame(w io.Writer, value any) error + type Dialog struct + Backend string + Environment []string + PID int + Pinentry string + Terminal string + func (d Dialog) Ask(ctx context.Context, title, prompt string, secret bool) (string, error) + func (d Dialog) Confirm(ctx context.Context, title, prompt string) error + func (d Dialog) Select(ctx context.Context, title, prompt string, choices []string) (int, error) + type Handler interface + Close func(context.Context) + Control func(context.Context, Request) (Message, error) + Expire func(context.Context) + Run func(context.Context, Request, io.Reader, io.Writer, io.Writer) (Message, error) + type Message struct + Args []string + Data []byte + Environment []string + Error string + Kind string + Status []Status + func Exchange(ctx context.Context, conn net.Conn, req Request, in io.Reader, ...) (Message, error) + type Request struct + Action string + Args []string + Dialog string + Directory string + Environment []string + PID int + Pinentry string + Settings map[string]any + Terminal string + Version int + func (r Request) Validate() error + type Sessions struct + func NewSessions(now func() time.Time) *Sessions + func (s *Sessions) Close(ctx context.Context) + func (s *Sessions) Expire(ctx context.Context) + func (s *Sessions) Lock(ctx context.Context, key string) + func (s *Sessions) Put(key string, close func(context.Context)) + func (s *Sessions) Status() []Status + func (s *Sessions) Touch(key string) bool + type Status struct + Account string + Expires time.Time