Help us shape the future of Go! Take the 2026 Go Developer Survey

toolcoordinator

package
v0.233.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinator

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

Coordinator handles the tool round-trip UI flow.

func NewCoordinator

func NewCoordinator(opts Options) *Coordinator

NewCoordinator creates a new tool execution coordinator.

func (*Coordinator) GetActiveToolCallID

func (c *Coordinator) GetActiveToolCallID() string

GetActiveToolCallID returns the currently active tool call id (thread-safe).

func (*Coordinator) HandleToolApprovalRequested

func (c *Coordinator) HandleToolApprovalRequested(msg agentdomain.ToolApprovalRequestedEvent) tea.Cmd

HandleToolApprovalRequested records the pending tool call in the repo, sets up the approval UI state, broadcasts a notification, and keeps the chat listener pumping while the user decides.

func (*Coordinator) HandleToolApprovalResponse

func (c *Coordinator) HandleToolApprovalResponse(msg agentdomain.ToolApprovalResponseEvent) tea.Cmd

HandleToolApprovalResponse processes the user's accept/reject decision and forwards it to the waiting agent through the response channel.

func (*Coordinator) HandleToolCancelled

func (c *Coordinator) HandleToolCancelled(_ agentdomain.ToolCancelledEvent) tea.Cmd

HandleToolCancelled refreshes the conversation view so the synthetic [cancelled] tool entry that the integrity validator persisted becomes visible. No status-bar message - the cancel that triggered this already drove its own status ("User interrupted").

func (*Coordinator) HandleToolExecutionCompleted

func (c *Coordinator) HandleToolExecutionCompleted(msg agentdomain.ToolExecutionCompletedEvent) tea.Cmd

HandleToolExecutionCompleted finalizes the tool round-trip: clears the active-tool indicator, refreshes history, optionally fires a todo-update command, and emits a "Tools completed" status. The "preparing response" spinner only makes sense when an agent turn will follow; without an active chat session (extension-initiated tool calls) the status resets to idle, since no response will ever arrive to clear it.

func (*Coordinator) HandleToolExecutionProgress

func (c *Coordinator) HandleToolExecutionProgress(msg agentdomain.ToolExecutionProgressEvent) tea.Cmd

HandleToolExecutionProgress translates a tool-execution progress event into the appropriate UI status updates and keeps the right event channel pumping (bash, tool, or chat).

func (*Coordinator) HandleToolExecutionStarted

func (c *Coordinator) HandleToolExecutionStarted(msg tui.ToolExecutionStartedEvent) tea.Cmd

HandleToolExecutionStarted emits the initial "Starting tool execution" status.

func (*Coordinator) SetActiveToolCallID

func (c *Coordinator) SetActiveToolCallID(id string)

SetActiveToolCallID sets the currently active tool call id (thread-safe).

type Options

type Options struct {
	ConversationRepo convdomain.ConversationRepository
	StateStore       stateStore
	DirectExec       tui.DirectExecutionService
}

Options bundles the dependencies needed to construct a Coordinator.

Jump to

Keyboard shortcuts

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