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

runner

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(
	ctx context.Context,
	ag *adk.ChatModelAgent,
	messages []adk.Message,
	h handler.AgentEventHandler,
	rec *session.Recorder,
	todoStore *tools.TodoStore,
	goalStore *tools.GoalStore,
	tracer *telemetry.LangfuseTracer,
	tokenUsage *internalmodel.TokenUsage,
) string

Run executes the agent for a single turn, wrapping the response with a Langfuse trace when a tracer is present, enforcing todo-completion guards, and sending token-usage updates to the handler when done.

Types

type ApprovalState

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

ApprovalState manages whether tool calls require interactive user approval.

func NewApprovalState

func NewApprovalState(workpath string, autoApprove bool) *ApprovalState

NewApprovalState creates a new ApprovalState with the given workpath.

func NewApprovalStateWithMode added in v0.5.0

func NewApprovalStateWithMode(workpath string, m mode.SessionMode) *ApprovalState

NewApprovalStateWithMode creates a new ApprovalState seeded with a unified session mode (the preferred constructor; NewApprovalState wraps it for the legacy autoApprove-bool callers).

func (*ApprovalState) GetMode

func (s *ApprovalState) GetMode() handler.ApprovalMode

GetMode returns the current approval mode.

func (*ApprovalState) GetSessionMode added in v0.5.0

func (s *ApprovalState) GetSessionMode() mode.SessionMode

GetSessionMode returns the current unified session mode.

func (*ApprovalState) NewTeammateApprovalFunc

func (s *ApprovalState) NewTeammateApprovalFunc(workerName, workerColor string) func(ctx context.Context, toolName, toolArgs string) (bool, error)

NewTeammateApprovalFunc creates an approval function for a teammate that includes the worker identity in the TUI approval prompt. It shares the same decision logic as RequestApproval (via decide) so the two paths cannot drift apart.

func (*ApprovalState) RequestApproval

func (s *ApprovalState) RequestApproval(ctx context.Context, toolName, toolArgs string) (bool, error)

RequestApproval is the agent.ApprovalFunc implementation. It returns true immediately for read-only or obviously safe commands. For everything else it sends a TUI prompt and waits for the user's answer.

func (*ApprovalState) SetBrowserOriginFunc added in v0.8.1

func (s *ApprovalState) SetBrowserOriginFunc(fn func() string)

SetBrowserOriginFunc installs the active-tab origin provider used to scope per-site permissions for browser_act (whose args carry no URL).

func (*ApprovalState) SetBrowserPermFunc added in v0.8.1

func (s *ApprovalState) SetBrowserPermFunc(fn func(origin, class string) bool)

SetBrowserPermFunc installs the site-permission lookup for browser tools.

func (*ApprovalState) SetHandler

func (s *ApprovalState) SetHandler(h handler.AgentEventHandler)

SetHandler stores the handler used to send approval-request messages.

func (*ApprovalState) SetMode

func (s *ApprovalState) SetMode(m handler.ApprovalMode)

SetMode sets the approval mode (used for external mode changes).

func (*ApprovalState) SetSessionApproval

func (s *ApprovalState) SetSessionApproval(enabled bool)

SetSessionApproval sets the approval mode based on the boolean value. This is kept for backward compatibility with the channel-based mode sync.

func (*ApprovalState) SetSessionMode added in v0.5.0

func (s *ApprovalState) SetSessionMode(m mode.SessionMode)

SetSessionMode sets the unified session mode and derives the approval axis from it under the same lock. This is the single entry point a frontend uses to change the approval behavior; the tool/prompt axis is applied separately by each frontend's agent-rebuild path.

func (*ApprovalState) SetWorkpath

func (s *ApprovalState) SetWorkpath(path string)

SetWorkpath sets the current working directory (called on environment switch).

Jump to

Keyboard shortcuts

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