approvalcoord

package
v0.178.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	AgentService     agentdomain.AgentService
	ConversationRepo convdomain.ConversationRepository
	StateManager     stateManager
}

Options bundles the dependencies needed to construct a Service.

type Service

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

Service owns the UI side of "pause the assistant turn pending external decision" events.

func NewService

func NewService(opts Options) *Service

NewService creates a new approval coordinator.

func (*Service) HandleComputerUsePaused

func (s *Service) HandleComputerUsePaused(msg agentdomain.ComputerUsePausedEvent) tea.Cmd

HandleComputerUsePaused cancels the in-flight request and marks state as paused. No restart - the user will manually resume.

func (*Service) HandleComputerUseResumed

func (s *Service) HandleComputerUseResumed(_ agentdomain.ComputerUseResumedEvent) (tea.Cmd, bool)

HandleComputerUseResumed clears the pause state, injects a hidden "please continue" user message, and signals the orchestrator to restart streaming.

func (*Service) HandlePlanApprovalRequested

func (s *Service) HandlePlanApprovalRequested(msg agentdomain.PlanApprovalRequestedEvent) tea.Cmd

HandlePlanApprovalRequested sets up the plan-approval UI state and emits an info status. Always returns a cmd; no restart side-effect.

func (*Service) HandlePlanApprovalResponse

func (s *Service) HandlePlanApprovalResponse(msg tui.PlanApprovalResponseEvent) (tea.Cmd, bool)

HandlePlanApprovalResponse processes the user's accept/reject decision on a plan and returns whatever cmds the orchestrator should run plus a restart flag (true → orchestrator should kick a new ChatCompletionRunner.Start()).

func (*Service) HandleUserQuestionRequested

func (s *Service) HandleUserQuestionRequested(msg agentdomain.UserQuestionRequestedEvent) tea.Cmd

HandleUserQuestionRequested sets up the AskUserQuestion form state. The form renders as a floating box over the chat (like tool approval), so the view stays ViewStateChat and keys are intercepted while the form state is set. Unlike plan approval this does NOT stop the agent loop: the tool's Execute is blocked on the response channel and resumes when the user submits or cancels.

Jump to

Keyboard shortcuts

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