Documentation
¶
Index ¶
- Variables
- type App
- func (a *App) AvailableModels(ctx context.Context) []runtime.ModelChoice
- func (a *App) CompactSession(ctx context.Context, additionalPrompt string)
- func (a *App) CurrentAgentCommands(ctx context.Context) types.Commands
- func (a *App) CurrentAgentModel() string
- func (a *App) CurrentAgentSkills() []skills.Skill
- 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(ctx context.Context, filename string) (string, error)
- func (a *App) HasPermissions() bool
- func (a *App) IsTitleGenerating() bool
- func (a *App) NewSession()
- func (a *App) PermissionsInfo() *runtime.PermissionsInfo
- func (a *App) PlainTextTranscript() string
- func (a *App) RegenerateSessionTitle(ctx context.Context) error
- func (a *App) ReplaceSession(ctx context.Context, sess *session.Session)
- func (a *App) ResolveCommand(ctx context.Context, userInput string) string
- func (a *App) ResolveInput(ctx context.Context, input string) string
- func (a *App) ResolveSkillCommand(input string) (string, error)
- func (a *App) Resume(req runtime.ResumeRequest)
- 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) SendFirstMessage() tea.Cmd
- 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) ShouldExitAfterFirstResponse() bool
- func (a *App) SubscribeWith(ctx context.Context, send func(tea.Msg))
- func (a *App) SupportsModelSwitching() bool
- func (a *App) SwitchAgent(agentName string) error
- func (a *App) TrackCurrentAgentModel(model string)
- func (a *App) UpdateSessionTitle(ctx context.Context, title string) error
- type Opt
Constants ¶
This section is empty.
Variables ¶
var ErrTitleGenerating = fmt.Errorf("title generation in progress, please wait")
UpdateSessionTitle updates the current session's title and persists it. It works with both local and remote runtimes. ErrTitleGenerating is returned when attempting to set a title while generation is in progress.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) AvailableModels ¶
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 ¶
func (*App) CurrentAgentCommands ¶
CurrentAgentCommands returns the commands for the active agent
func (*App) CurrentAgentModel ¶
CurrentAgentModel returns the model ID for the current agent. Returns the tracked model from AgentInfoEvent, or falls back to session overrides. Returns empty string if no model information is available (fail-open scenario).
func (*App) CurrentAgentSkills ¶
CurrentAgentSkills returns the available skills if skills are enabled for the current agent.
func (*App) CurrentMCPPrompts ¶
CurrentMCPPrompts returns the available MCP prompts for the active agent
func (*App) EmitStartupInfo ¶
EmitStartupInfo emits initial agent, team, and toolset information to the provided channel
func (*App) ExecuteMCPPrompt ¶
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 ¶
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) HasPermissions ¶
HasPermissions returns true if any permissions are configured (team or session level).
func (*App) IsTitleGenerating ¶
IsTitleGenerating returns true if title generation is currently in progress.
func (*App) NewSession ¶
func (a *App) NewSession()
func (*App) PermissionsInfo ¶
func (a *App) PermissionsInfo() *runtime.PermissionsInfo
PermissionsInfo returns combined permissions info from team and session. Returns nil if no permissions are configured at either level.
func (*App) PlainTextTranscript ¶
func (*App) RegenerateSessionTitle ¶
RegenerateSessionTitle triggers AI-based title regeneration for the current session. Returns ErrTitleGenerating if a title generation is already in progress.
func (*App) ReplaceSession ¶
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 ¶
ResolveCommand converts /command to its prompt text
func (*App) ResolveInput ¶
ResolveInput resolves the user input by trying skill commands first, then agent commands. Returns the resolved content ready to send to the agent.
func (*App) ResolveSkillCommand ¶
ResolveSkillCommand checks if the input matches a skill slash command (e.g. /skill-name args). If matched, it reads the skill content and returns the resolved prompt. Otherwise returns "".
func (*App) Resume ¶
func (a *App) Resume(req runtime.ResumeRequest)
Resume resumes the runtime with the given confirmation request
func (*App) ResumeElicitation ¶
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 []messages.Attachment)
Run one agent loop
func (*App) RunWithMessage ¶
RunWithMessage runs the agent loop with a pre-constructed message. This is used for special cases like image attachments.
func (*App) SendFirstMessage ¶
func (*App) SessionStore ¶
SessionStore returns the session store for browsing/loading sessions. Returns nil if no session store is configured.
func (*App) SetCurrentAgentModel ¶
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) ShouldExitAfterFirstResponse ¶
ShouldExitAfterFirstResponse returns true if the app is configured to exit after the first assistant response completes.
func (*App) SubscribeWith ¶
SubscribeWith subscribes to app events using a custom send function. This allows callers to wrap or transform messages before sending them to the Bubble Tea program (e.g. to tag events with a session ID for routing).
func (*App) SupportsModelSwitching ¶
SupportsModelSwitching returns true if the runtime supports model switching.
func (*App) SwitchAgent ¶
SwitchAgent switches the currently active agent for subsequent user messages
func (*App) TrackCurrentAgentModel ¶
TrackCurrentAgentModel updates the tracked model ID for the current agent. This is called when AgentInfoEvent is received from the runtime.
type Opt ¶
type Opt func(*App)
Opt is an option for creating a new App.
func WithExitAfterFirstResponse ¶
func WithExitAfterFirstResponse() Opt
WithExitAfterFirstResponse configures the app to exit after the first assistant response.
func WithFirstMessage ¶
WithFirstMessage sets the first message to send.
func WithFirstMessageAttachment ¶
WithFirstMessageAttachment sets the attachment path for the first message.
func WithQueuedMessages ¶
WithQueuedMessages sets messages to be queued after the first message is sent. These messages will be delivered to the TUI as SendMsg events, which the chat page will queue and process sequentially after each agent response.
func WithTitleGenerator ¶
func WithTitleGenerator(gen *sessiontitle.Generator) Opt
WithTitleGenerator sets the title generator for local title generation. If not set, title generation will be handled by the runtime (for remote) or skipped.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package export provides HTML export functionality for docker agent sessions.
|
Package export provides HTML export functionality for docker agent sessions. |