app

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func New

func New(ctx context.Context, rt runtime.Runtime, sess *session.Session, opts ...Opt) *App

func (*App) CompactSession added in v1.6.0

func (a *App) CompactSession()

func (*App) CurrentAgentCommands added in v1.9.1

func (a *App) CurrentAgentCommands(ctx context.Context) map[string]string

CurrentAgentCommands returns the commands for the active agent

func (*App) CurrentMCPPrompts added in v1.9.25

func (a *App) CurrentMCPPrompts(ctx context.Context) map[string]mcptools.PromptInfo

CurrentMCPPrompts returns the available MCP prompts for the active agent

func (*App) EmitStartupInfo added in v1.9.14

func (a *App) EmitStartupInfo(ctx context.Context, events chan runtime.Event)

EmitStartupInfo emits initial agent, team, and toolset information to the provided channel

func (*App) ExecuteMCPPrompt added in v1.9.25

func (a *App) ExecuteMCPPrompt(ctx context.Context, promptName string, arguments map[string]string) (string, error)

ExecuteMCPPrompt executes an MCP prompt with provided arguments and returns the content

func (*App) FirstMessage

func (a *App) FirstMessage() *string

func (*App) FirstMessageAttachment added in v1.17.0

func (a *App) FirstMessageAttachment() string

FirstMessageAttachment returns the attachment path for the first message.

func (*App) NewSession added in v1.6.0

func (a *App) NewSession()

func (*App) PlainTextTranscript added in v1.9.8

func (a *App) PlainTextTranscript() string

func (*App) ResolveCommand added in v1.9.1

func (a *App) ResolveCommand(ctx context.Context, userInput string) string

ResolveCommand converts /command to its prompt text

func (*App) Resume

func (a *App) Resume(resumeType runtime.ResumeType)

Resume resumes the runtime with the given confirmation type

func (*App) ResumeElicitation added in v1.9.14

func (a *App) ResumeElicitation(ctx context.Context, action tools.ElicitationAction, content map[string]any) error

ResumeElicitation resumes an elicitation request with the given action and content

func (*App) Run

func (a *App) Run(ctx context.Context, cancel context.CancelFunc, message string, attachments map[string]string)

Run one agent loop

func (*App) RunBangCommand added in v1.8.0

func (a *App) RunBangCommand(ctx context.Context, command string)

func (*App) RunWithMessage added in v1.17.0

func (a *App) RunWithMessage(ctx context.Context, cancel context.CancelFunc, msg *session.Message)

RunWithMessage runs the agent loop with a pre-constructed message. This is used for special cases like image attachments.

func (*App) Runtime added in v1.17.0

func (a *App) Runtime() runtime.Runtime

Runtime returns the runtime for this app.

func (*App) Session added in v1.9.1

func (a *App) Session() *session.Session

func (*App) Subscribe

func (a *App) Subscribe(ctx context.Context, program *tea.Program)

func (*App) SwitchAgent added in v1.16.0

func (a *App) SwitchAgent(agentName string) error

SwitchAgent switches the currently active agent for subsequent user messages

type Opt added in v1.17.0

type Opt func(*App)

Opt is an option for creating a new App.

func WithFirstMessage added in v1.17.0

func WithFirstMessage(msg string) Opt

WithFirstMessage sets the first message to send.

func WithFirstMessageAttachment added in v1.17.0

func WithFirstMessageAttachment(path string) Opt

WithFirstMessageAttachment sets the attachment path for the first message.

Jump to

Keyboard shortcuts

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