Documentation
¶
Index ¶
- type App
- func (a *App) AvailableModels(ctx context.Context) []runtime.ModelChoice
- func (a *App) CompactSession(additionalPrompt string)
- func (a *App) CurrentAgentCommands(ctx context.Context) types.Commands
- func (a *App) CurrentMCPPrompts(ctx context.Context) map[string]mcptools.PromptInfo
- func (a *App) EmitStartupInfo(ctx context.Context, events chan runtime.Event)
- func (a *App) ExecuteMCPPrompt(ctx context.Context, promptName string, arguments map[string]string) (string, error)
- func (a *App) ExportHTML(filename string) (string, error)
- func (a *App) FirstMessage() *string
- func (a *App) FirstMessageAttachment() string
- func (a *App) NewSession()
- func (a *App) PlainTextTranscript() string
- func (a *App) ReplaceSession(ctx context.Context, sess *session.Session)
- func (a *App) ResolveCommand(ctx context.Context, userInput string) string
- func (a *App) Resume(resumeType runtime.ResumeType)
- func (a *App) ResumeElicitation(ctx context.Context, action tools.ElicitationAction, content map[string]any) error
- func (a *App) Run(ctx context.Context, cancel context.CancelFunc, message string, ...)
- func (a *App) RunBangCommand(ctx context.Context, command string)
- func (a *App) RunWithMessage(ctx context.Context, cancel context.CancelFunc, msg *session.Message)
- func (a *App) Runtime() runtime.Runtime
- func (a *App) Session() *session.Session
- func (a *App) SessionStore() session.Store
- func (a *App) SetCurrentAgentModel(ctx context.Context, modelRef string) error
- func (a *App) Subscribe(ctx context.Context, program *tea.Program)
- func (a *App) SupportsModelSwitching() bool
- func (a *App) SwitchAgent(agentName string) error
- type Opt
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 (*App) AvailableModels ¶ added in v1.19.0
func (a *App) AvailableModels(ctx context.Context) []runtime.ModelChoice
AvailableModels returns the list of models available for selection. Returns nil if model switching is not supported.
func (*App) CompactSession ¶ added in v1.6.0
func (*App) CurrentAgentCommands ¶ added in v1.8.2
CurrentAgentCommands returns the commands for the active agent
func (*App) CurrentMCPPrompts ¶ added in v1.8.2
CurrentMCPPrompts returns the available MCP prompts for the active agent
func (*App) EmitStartupInfo ¶ added in v1.8.2
EmitStartupInfo emits initial agent, team, and toolset information to the provided channel
func (*App) ExecuteMCPPrompt ¶ added in v1.8.2
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) ExportHTML ¶ added in v1.18.6
ExportHTML exports the current session as a standalone HTML file. If filename is empty, a default name based on the session title and timestamp is used.
func (*App) FirstMessage ¶
func (*App) FirstMessageAttachment ¶ added in v1.8.2
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.8.2
func (*App) ReplaceSession ¶ added in v1.8.2
ReplaceSession replaces the current session with the given session. This is used when loading a past session. It also re-emits startup info so the sidebar displays the agent and tool information. If the session has stored model overrides, they are applied to the runtime.
func (*App) ResolveCommand ¶ added in v1.8.2
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.8.2
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 (*App) RunWithMessage ¶ added in v1.8.2
RunWithMessage runs the agent loop with a pre-constructed message. This is used for special cases like image attachments.
func (*App) SessionStore ¶ added in v1.8.2
SessionStore returns the session store for browsing/loading sessions. Returns nil if no session store is configured.
func (*App) SetCurrentAgentModel ¶ added in v1.19.0
SetCurrentAgentModel sets the model for the current agent and persists the override in the session. Returns an error if model switching is not supported by the runtime (e.g., remote runtimes). Pass an empty modelRef to clear the override and use the agent's default model.
func (*App) SupportsModelSwitching ¶ added in v1.19.0
SupportsModelSwitching returns true if the runtime supports model switching.
func (*App) SwitchAgent ¶ added in v1.8.2
SwitchAgent switches the currently active agent for subsequent user messages
type Opt ¶ added in v1.8.2
type Opt func(*App)
Opt is an option for creating a new App.
func WithFirstMessage ¶ added in v1.8.2
WithFirstMessage sets the first message to send.
func WithFirstMessageAttachment ¶ added in v1.8.2
WithFirstMessageAttachment sets the attachment path for the first message.