Documentation
¶
Index ¶
- Constants
- Variables
- func ConfirmPrompt(prompt string) (bool, error)
- func ConfirmPromptWithOptions(prompt string, options ConfirmOptions) (bool, error)
- func EnsureIntegrationInstalled(name string, runner Runner) error
- func IsIntegrationInstalled(name string) bool
- func LaunchCmd(checkServerHeartbeat func(cmd *cobra.Command, args []string) error, ...) *cobra.Command
- func LaunchIntegration(ctx context.Context, req IntegrationLaunchRequest) error
- func OpenBrowser(url string)
- func PlanSatisfies(currentPlan, requiredPlan string) bool
- func ResolveRunModel(ctx context.Context, req RunModelRequest) (string, error)
- type AccountState
- type AccountStatePrefetch
- type Claude
- type ClaudeDesktop
- func (c *ClaudeDesktop) AutodiscoveredModel() string
- func (c *ClaudeDesktop) AutodiscoveryConfigured() bool
- func (c *ClaudeDesktop) ConfigurationSuccessMessage() string
- func (c *ClaudeDesktop) ConfigureAutodiscovery() error
- func (c *ClaudeDesktop) Onboard() error
- func (c *ClaudeDesktop) Paths() []string
- func (c *ClaudeDesktop) RequiresInteractiveOnboarding() bool
- func (c *ClaudeDesktop) Restore() error
- func (c *ClaudeDesktop) RestoreHint() string
- func (c *ClaudeDesktop) RestoreSuccessMessage() string
- func (c *ClaudeDesktop) Run(_ string, _ []LaunchModel, _ []string) error
- func (c *ClaudeDesktop) SkipModelReadiness() bool
- func (c *ClaudeDesktop) String() string
- func (c *ClaudeDesktop) Supported() error
- type Cline
- type Codex
- type CodexApp
- func (c *CodexApp) ConfigurationSuccessMessage() string
- func (c *CodexApp) Configure(model string) error
- func (c *CodexApp) ConfigureWithModels(primary string, models []LaunchModel) error
- func (c *CodexApp) CurrentModel() string
- func (c *CodexApp) Onboard() error
- func (c *CodexApp) Paths() []string
- func (c *CodexApp) RequiresInteractiveOnboarding() bool
- func (c *CodexApp) Restore() error
- func (c *CodexApp) RestoreHint() string
- func (c *CodexApp) RestoreSuccessMessage() string
- func (c *CodexApp) Run(_ string, _ []LaunchModel, args []string) error
- func (c *CodexApp) String() string
- func (c *CodexApp) Supported() error
- type ConfigurationSuccessIntegration
- type ConfirmDefault
- type ConfirmOptions
- type Copilot
- type Droid
- type Editor
- type Hermes
- func (h *Hermes) Configure(model string) error
- func (h *Hermes) CurrentModel() string
- func (h *Hermes) Onboard() error
- func (h *Hermes) Paths() []string
- func (h *Hermes) RefreshRuntimeAfterConfigure() error
- func (h *Hermes) RequiresInteractiveOnboarding() bool
- func (h *Hermes) Run(_ string, _ []LaunchModel, args []string) error
- func (h *Hermes) String() string
- type HermesDesktop
- type IntegrationInfo
- type IntegrationInstallSpec
- type IntegrationLaunchRequest
- type IntegrationSpec
- type Kimi
- type LaunchConfirmMode
- type LaunchMissingModelMode
- type LaunchModel
- type LaunchPolicy
- type LauncherIntegrationState
- type LauncherState
- type ManagedAutodiscoveryCloudIntegration
- type ManagedAutodiscoveryIntegration
- type ManagedInteractiveOnboarding
- type ManagedModelListConfigurer
- type ManagedModelReadinessSkipper
- type ManagedOnboardingValidator
- type ManagedRuntimeRefresher
- type ManagedSingleModel
- type ModelInfo
- type ModelItem
- type MultiSelector
- type MultiSelectorWithUpdates
- type OMP
- func (o *OMP) Configure(model string) error
- func (o *OMP) ConfigureWithModels(primary string, models []LaunchModel) error
- func (o *OMP) CurrentModel() string
- func (o *OMP) Onboard() error
- func (o *OMP) Paths() []string
- func (o *OMP) RequiresInteractiveOnboarding() bool
- func (o *OMP) Run(model string, _ []LaunchModel, args []string) error
- func (o *OMP) String() string
- type OpenCode
- type Openclaw
- type Pi
- type Poolside
- type Qwen
- type RestorableIntegration
- type RestoreHintIntegration
- type RestoreInstallCheckSkipper
- type RestoreSuccessIntegration
- type RunModelRequest
- type Runner
- type SelectionItem
- type SingleSelector
- type SingleSelectorWithUpdates
- type Spinner
- type SupportedIntegration
- type VSCode
- func (v *VSCode) Edit(models []LaunchModel) error
- func (v *VSCode) FocusVSCode()
- func (v *VSCode) IsRunning() bool
- func (v *VSCode) Models() []string
- func (v *VSCode) Paths() []string
- func (v *VSCode) Quit()
- func (v *VSCode) Run(model string, _ []LaunchModel, args []string) error
- func (v *VSCode) ShowInModelPicker(models []string) error
- func (v *VSCode) String() string
Constants ¶
const (
// DefaultUpgradeURL is the fixed destination for subscription upgrades.
DefaultUpgradeURL = "https://ollama.com/upgrade"
)
Variables ¶
var DefaultConfirmPrompt func(prompt string, options ConfirmOptions) (bool, error)
DefaultConfirmPrompt provides a TUI-based confirmation prompt. When set, ConfirmPrompt delegates to it instead of using raw terminal I/O.
var DefaultSignIn func(modelName, signInURL string) (string, error)
DefaultSignIn provides a TUI-based sign-in flow. When set, ensureAuth uses it instead of plain text prompts. Returns the signed-in username or an error.
var DefaultSpinner func(message string) *Spinner
DefaultSpinner, when set, starts an animated spinner displaying message and returns a *Spinner. cmd/cmd.go registers a bubbletea implementation from cmd/tui; when unset (or when it returns nil, e.g. no TTY) StartSpinner falls back to a simple ANSI spinner using SpinnerFrames.
var DefaultUpgrade func(modelName, requiredPlan string) (string, error)
DefaultUpgrade provides a TUI-based upgrade flow. Returns the updated plan or an error.
var ErrCancelled = errors.New("cancelled")
ErrCancelled is returned when the user cancels a selection.
var (
)
var SpinnerFrames = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
SpinnerFrames are the braille spinner frames used by the bubbletea TUIs in this codebase (sign-in, upgrade). StartSpinner uses the same frames for its fallback so the restart spinner matches the look of those flows.
Functions ¶
func ConfirmPrompt ¶
ConfirmPrompt is the shared confirmation gate for launch flows (integration edits, missing-model pulls, sign-in prompts, OpenClaw install/security, etc). Behavior is controlled by currentLaunchConfirmPolicy, typically scoped by withLaunchConfirmPolicy in LaunchCmd (e.g. auto-approve with --yes).
func ConfirmPromptWithOptions ¶ added in v0.20.5
func ConfirmPromptWithOptions(prompt string, options ConfirmOptions) (bool, error)
ConfirmPromptWithOptions is the shared confirmation gate for launch flows that need custom yes/no labels in interactive UIs.
func EnsureIntegrationInstalled ¶
EnsureIntegrationInstalled installs auto-installable integrations when missing.
func IsIntegrationInstalled ¶
IsIntegrationInstalled checks if an integration binary is installed.
func LaunchCmd ¶
func LaunchCmd(checkServerHeartbeat func(cmd *cobra.Command, args []string) error, runTUI func(cmd *cobra.Command)) *cobra.Command
LaunchCmd returns the cobra command for launching integrations. The runTUI callback is called when the root launcher UI should be shown.
func LaunchIntegration ¶
func LaunchIntegration(ctx context.Context, req IntegrationLaunchRequest) error
LaunchIntegration runs the canonical launcher flow for one integration.
func PlanSatisfies ¶ added in v0.23.2
PlanSatisfies reports whether currentPlan can use a model that has a requiredPlan.
func ResolveRunModel ¶
func ResolveRunModel(ctx context.Context, req RunModelRequest) (string, error)
ResolveRunModel returns the model that should be used for interactive chat.
Types ¶
type AccountState ¶ added in v0.23.2
type AccountState struct {
Status accountStateStatus
Plan string
}
type AccountStatePrefetch ¶ added in v0.23.2
type AccountStatePrefetch struct {
// contains filtered or unexported fields
}
func StartAccountStatePrefetch ¶ added in v0.23.2
func StartAccountStatePrefetch(ctx context.Context) *AccountStatePrefetch
func (*AccountStatePrefetch) StateIfReady ¶ added in v0.23.2
func (p *AccountStatePrefetch) StateIfReady() *AccountState
func (*AccountStatePrefetch) StateUpdates ¶ added in v0.23.2
func (p *AccountStatePrefetch) StateUpdates(ctx context.Context) <-chan *AccountState
type ClaudeDesktop ¶ added in v0.23.0
type ClaudeDesktop struct{}
ClaudeDesktop configures and launches Claude Desktop in third-party inference mode using Ollama Cloud as the gateway.
func (*ClaudeDesktop) AutodiscoveredModel ¶ added in v0.23.0
func (c *ClaudeDesktop) AutodiscoveredModel() string
func (*ClaudeDesktop) AutodiscoveryConfigured ¶ added in v0.23.0
func (c *ClaudeDesktop) AutodiscoveryConfigured() bool
func (*ClaudeDesktop) ConfigurationSuccessMessage ¶ added in v0.23.0
func (c *ClaudeDesktop) ConfigurationSuccessMessage() string
func (*ClaudeDesktop) ConfigureAutodiscovery ¶ added in v0.23.0
func (c *ClaudeDesktop) ConfigureAutodiscovery() error
func (*ClaudeDesktop) Onboard ¶ added in v0.23.0
func (c *ClaudeDesktop) Onboard() error
func (*ClaudeDesktop) Paths ¶ added in v0.23.0
func (c *ClaudeDesktop) Paths() []string
func (*ClaudeDesktop) RequiresInteractiveOnboarding ¶ added in v0.23.0
func (c *ClaudeDesktop) RequiresInteractiveOnboarding() bool
func (*ClaudeDesktop) Restore ¶ added in v0.23.0
func (c *ClaudeDesktop) Restore() error
func (*ClaudeDesktop) RestoreHint ¶ added in v0.23.0
func (c *ClaudeDesktop) RestoreHint() string
func (*ClaudeDesktop) RestoreSuccessMessage ¶ added in v0.23.0
func (c *ClaudeDesktop) RestoreSuccessMessage() string
func (*ClaudeDesktop) Run ¶ added in v0.23.0
func (c *ClaudeDesktop) Run(_ string, _ []LaunchModel, _ []string) error
func (*ClaudeDesktop) SkipModelReadiness ¶ added in v0.23.0
func (c *ClaudeDesktop) SkipModelReadiness() bool
func (*ClaudeDesktop) String ¶ added in v0.23.0
func (c *ClaudeDesktop) String() string
func (*ClaudeDesktop) Supported ¶ added in v0.23.0
func (c *ClaudeDesktop) Supported() error
type Cline ¶
type Cline struct{}
Cline implements Runner and Editor for the Cline CLI integration
func (*Cline) Edit ¶
func (c *Cline) Edit(models []LaunchModel) error
type Codex ¶
type Codex struct{}
Codex implements Runner for Codex integration
func (*Codex) RestoreSuccessMessage ¶ added in v0.30.1
func (*Codex) SkipRestoreInstallCheck ¶ added in v0.30.1
type CodexApp ¶ added in v0.24.0
type CodexApp struct{}
CodexApp configures the desktop Codex app with one launch-selected default model while leaving model discovery and switching to Codex's Ollama provider.
func (*CodexApp) ConfigurationSuccessMessage ¶ added in v0.24.0
func (*CodexApp) ConfigureWithModels ¶ added in v0.24.0
func (c *CodexApp) ConfigureWithModels(primary string, models []LaunchModel) error
func (*CodexApp) CurrentModel ¶ added in v0.24.0
func (*CodexApp) RequiresInteractiveOnboarding ¶ added in v0.24.0
func (*CodexApp) RestoreHint ¶ added in v0.24.0
func (*CodexApp) RestoreSuccessMessage ¶ added in v0.24.0
type ConfigurationSuccessIntegration ¶ added in v0.23.0
type ConfigurationSuccessIntegration interface {
ConfigurationSuccessMessage() string
}
ConfigurationSuccessIntegration can print a short message after launcher successfully switches an app into a launch-managed mode.
type ConfirmDefault ¶ added in v0.32.0
type ConfirmDefault int
const ( ConfirmDefaultYes ConfirmDefault = iota ConfirmDefaultNo )
type ConfirmOptions ¶ added in v0.20.5
type ConfirmOptions struct {
YesLabel string
NoLabel string
Default ConfirmDefault
}
ConfirmOptions customizes labels for confirmation prompts.
type Copilot ¶ added in v0.21.0
type Copilot struct{}
Copilot implements Runner for GitHub Copilot CLI integration.
type Droid ¶
type Droid struct{}
Droid implements Runner and Editor for Droid integration
func (*Droid) Edit ¶
func (d *Droid) Edit(models []LaunchModel) error
type Editor ¶
type Editor interface {
Paths() []string
Edit(models []LaunchModel) error
Models() []string
}
Editor can edit config files for integrations that support model configuration.
type Hermes ¶ added in v0.21.0
type Hermes struct{}
Hermes is intentionally not an Editor integration: launch owns one primary model and the local Ollama endpoint, while Hermes keeps its own discovery and switching UX after startup.
func (*Hermes) CurrentModel ¶ added in v0.21.0
func (*Hermes) RefreshRuntimeAfterConfigure ¶ added in v0.21.0
func (*Hermes) RequiresInteractiveOnboarding ¶ added in v0.21.0
type HermesDesktop ¶ added in v0.30.5
type HermesDesktop struct {
Hermes
}
func (*HermesDesktop) Onboard ¶ added in v0.30.5
func (h *HermesDesktop) Onboard() error
func (*HermesDesktop) Run ¶ added in v0.30.5
func (h *HermesDesktop) Run(_ string, _ []LaunchModel, args []string) error
func (*HermesDesktop) String ¶ added in v0.30.5
func (h *HermesDesktop) String() string
type IntegrationInfo ¶
IntegrationInfo contains display information about a registered integration.
func ListIntegrationInfos ¶
func ListIntegrationInfos() []IntegrationInfo
ListIntegrationInfos returns the registered integrations in launcher display order.
type IntegrationInstallSpec ¶
type IntegrationInstallSpec struct {
CheckInstalled func() bool
EnsureInstalled func() error
URL string
Command []string
}
IntegrationInstallSpec describes how launcher should detect and guide installation.
type IntegrationLaunchRequest ¶
type IntegrationLaunchRequest struct {
Name string
ModelOverride string
ForceConfigure bool
ConfigureOnly bool
Restore bool
ExtraArgs []string
Policy *LaunchPolicy
AccountState *AccountState
AccountStateProvider func() *AccountState
AccountStateUpdates func(context.Context) <-chan *AccountState
}
IntegrationLaunchRequest controls the canonical integration launcher flow.
type IntegrationSpec ¶
type IntegrationSpec struct {
Name string
Runner Runner
Aliases []string
Hidden bool
Description string
Install IntegrationInstallSpec
}
IntegrationSpec is the canonical registry entry for one integration.
func ListVisibleIntegrationSpecs ¶
func ListVisibleIntegrationSpecs() []IntegrationSpec
ListVisibleIntegrationSpecs returns the canonical integrations that should appear in interactive UIs.
func LookupIntegrationSpec ¶
func LookupIntegrationSpec(name string) (*IntegrationSpec, error)
LookupIntegrationSpec resolves either a canonical integration name or alias to its spec.
type Kimi ¶ added in v0.21.1
type Kimi struct{}
Kimi implements Runner for Kimi Code CLI integration.
type LaunchConfirmMode ¶
type LaunchConfirmMode int
LaunchConfirmMode controls confirmation behavior across launch flows.
const ( // LaunchConfirmPrompt prompts the user for confirmation. LaunchConfirmPrompt LaunchConfirmMode = iota // LaunchConfirmAutoApprove skips prompts and treats confirmation as accepted. LaunchConfirmAutoApprove // LaunchConfirmRequireYes rejects confirmation requests with a --yes hint. LaunchConfirmRequireYes )
type LaunchMissingModelMode ¶
type LaunchMissingModelMode int
LaunchMissingModelMode controls local missing-model handling in launch flows.
const ( // LaunchMissingModelPromptToPull prompts to pull a missing local model. LaunchMissingModelPromptToPull LaunchMissingModelMode = iota // LaunchMissingModelAutoPull pulls a missing local model without prompting. LaunchMissingModelAutoPull // LaunchMissingModelFail fails immediately when a local model is missing. LaunchMissingModelFail )
type LaunchModel ¶ added in v0.30.0
type LaunchModel struct {
Name string
Remote bool
ToolCapable bool
Capabilities []modelpkg.Capability
ContextLength int
MaxOutputTokens int
EmbeddingLength int
Size int64
Details api.ModelDetails
}
LaunchModel is the model metadata Launch passes to integration config writers after resolving selected model names through the per-run inventory.
func (LaunchModel) HasCapability ¶ added in v0.30.0
func (m LaunchModel) HasCapability(capability modelpkg.Capability) bool
func (LaunchModel) WithCloudLimits ¶ added in v0.30.0
func (m LaunchModel) WithCloudLimits() LaunchModel
type LaunchPolicy ¶
type LaunchPolicy struct {
Confirm LaunchConfirmMode
MissingModel LaunchMissingModelMode
}
LaunchPolicy controls launch behavior that may vary by caller context.
type LauncherIntegrationState ¶
type LauncherIntegrationState struct {
Name string
DisplayName string
Description string
Installed bool
AutoInstallable bool
Selectable bool
Changeable bool
CurrentModel string
ModelUsable bool
InstallHint string
Editor bool
}
LauncherIntegrationState is the launch-owned status for one launcher integration.
type LauncherState ¶
type LauncherState struct {
LastSelection string
RunModel string
RunModelUsable bool
Integrations map[string]LauncherIntegrationState
AccountState *AccountState
}
LauncherState is the launch-owned snapshot used to render the root launcher menu.
func BuildLauncherState ¶
func BuildLauncherState(ctx context.Context) (*LauncherState, error)
BuildLauncherState returns the launch-owned root launcher menu snapshot.
type ManagedAutodiscoveryCloudIntegration ¶ added in v0.23.0
type ManagedAutodiscoveryCloudIntegration interface {
UsesOllamaCloud() bool
}
ManagedAutodiscoveryCloudIntegration marks an autodiscovery integration whose discovered model catalog depends on the user's local Ollama Cloud auth state.
type ManagedAutodiscoveryIntegration ¶ added in v0.23.0
type ManagedAutodiscoveryIntegration interface {
Paths() []string
AutodiscoveredModel() string
AutodiscoveryConfigured() bool
ConfigureAutodiscovery() error
Onboard() error
}
ManagedAutodiscoveryIntegration is for managed integrations that do not need a launcher-selected model because the app discovers available models itself.
type ManagedInteractiveOnboarding ¶ added in v0.21.0
type ManagedInteractiveOnboarding interface {
RequiresInteractiveOnboarding() bool
}
ManagedInteractiveOnboarding lets a managed integration declare whether its onboarding step really requires an interactive terminal. Hermes does not.
type ManagedModelListConfigurer ¶ added in v0.23.0
type ManagedModelListConfigurer interface {
ConfigureWithModels(primary string, models []LaunchModel) error
}
ManagedModelListConfigurer lets managed single-model integrations receive the launcher's model list while still preserving one primary selected model.
type ManagedModelReadinessSkipper ¶ added in v0.23.0
type ManagedModelReadinessSkipper interface {
SkipModelReadiness() bool
}
ManagedModelReadinessSkipper lets managed integrations opt out of local Ollama model readiness checks when the configured runtime is not the local daemon.
type ManagedOnboardingValidator ¶ added in v0.21.0
type ManagedOnboardingValidator interface {
OnboardingComplete() bool
}
ManagedOnboardingValidator lets managed integrations re-check saved onboarding state when launcher needs a stronger live readiness signal.
type ManagedRuntimeRefresher ¶ added in v0.21.0
type ManagedRuntimeRefresher interface {
RefreshRuntimeAfterConfigure() error
}
ManagedRuntimeRefresher lets managed integrations refresh any long-lived background runtime after launch rewrites their config.
type ManagedSingleModel ¶ added in v0.21.0
type ManagedSingleModel interface {
Paths() []string
Configure(model string) error
CurrentModel() string
Onboard() error
}
ManagedSingleModel is the narrow launch-owned config path for integrations like Hermes that have one primary model selected by launcher, need launcher to persist minimal config, and still keep their own model discovery and onboarding UX. This stays separate from Runner-only integrations and the multi-model Editor flow so Hermes-specific behavior stays scoped to one path.
type ModelInfo ¶
type ModelInfo = LaunchModel
ModelInfo re-exports launcher model inventory details for callers.
type ModelItem ¶
type ModelItem struct {
Name string
Description string
Recommended bool
VRAMBytes int64
MaxOutputTokens int
RequiredPlan string
ToolCapable bool
Capabilities []modelpkg.Capability
Size int64
Details api.ModelDetails
}
ModelItem represents model metadata before selector-only UI state is derived.
func IntegrationSelectionItems ¶
IntegrationSelectionItems returns the sorted integration items shown by launcher selection UIs.
type MultiSelector ¶
type MultiSelector func(title string, items []SelectionItem, preChecked []string) ([]string, error)
MultiSelector is a function type for multi item selection.
var DefaultMultiSelector MultiSelector
DefaultMultiSelector is the default multi-select implementation.
type MultiSelectorWithUpdates ¶ added in v0.23.2
type MultiSelectorWithUpdates func(title string, items []SelectionItem, preChecked []string, updates <-chan []SelectionItem) ([]string, error)
MultiSelectorWithUpdates is a multi item selector that can receive refreshed item state while open.
var DefaultMultiSelectorWithUpdates MultiSelectorWithUpdates
DefaultMultiSelectorWithUpdates is the default multi-select implementation with live updates.
type OMP ¶ added in v0.30.6
type OMP struct{}
OMP implements Runner for the OMP coding-agent integration.
func (*OMP) ConfigureWithModels ¶ added in v0.30.6
func (o *OMP) ConfigureWithModels(primary string, models []LaunchModel) error
func (*OMP) CurrentModel ¶ added in v0.30.6
func (*OMP) RequiresInteractiveOnboarding ¶ added in v0.30.6
type OpenCode ¶
type OpenCode struct {
// contains filtered or unexported fields
}
OpenCode implements Runner and Editor for OpenCode integration. Config is passed via OPENCODE_CONFIG_CONTENT env var at launch time instead of writing to opencode's config files.
func (*OpenCode) Edit ¶
func (o *OpenCode) Edit(models []LaunchModel) error
type Openclaw ¶
type Openclaw struct{}
func (*Openclaw) Edit ¶
func (c *Openclaw) Edit(models []LaunchModel) error
type Pi ¶
type Pi struct{}
Pi implements Runner and Editor for Pi (Pi Coding Agent) integration
func (*Pi) Edit ¶
func (p *Pi) Edit(models []LaunchModel) error
type Poolside ¶ added in v0.22.0
type Poolside struct{}
Poolside implements Runner for Poolside's CLI.
type Qwen ¶ added in v0.30.1
type Qwen struct{}
func (*Qwen) CurrentModel ¶ added in v0.30.1
func (*Qwen) RequiresInteractiveOnboarding ¶ added in v0.30.1
type RestorableIntegration ¶ added in v0.23.0
type RestorableIntegration interface {
Restore() error
}
RestorableIntegration lets integrations switch back from a launch-managed mode to the application's normal/default mode.
type RestoreHintIntegration ¶ added in v0.23.0
type RestoreHintIntegration interface {
RestoreHint() string
}
RestoreHintIntegration can provide a short restore command after launch switches an app into a launch-managed mode.
type RestoreInstallCheckSkipper ¶ added in v0.30.1
type RestoreInstallCheckSkipper interface {
SkipRestoreInstallCheck() bool
}
RestoreInstallCheckSkipper lets cleanup-only restore flows run even when the external integration binary has already been removed.
type RestoreSuccessIntegration ¶ added in v0.23.0
type RestoreSuccessIntegration interface {
RestoreSuccessMessage() string
}
RestoreSuccessIntegration can print a short message after launcher restores an app back to its default mode.
type RunModelRequest ¶
type RunModelRequest struct {
ForcePicker bool
Policy *LaunchPolicy
AccountState *AccountState
AccountStateProvider func() *AccountState
AccountStateUpdates func(context.Context) <-chan *AccountState
}
RunModelRequest controls how the root launcher resolves the chat model.
type Runner ¶
type Runner interface {
Run(model string, models []LaunchModel, args []string) error
String() string
}
Runner executes an integration with the selected model and its resolved launch metadata. models is ordered with the primary model first.
type SelectionItem ¶ added in v0.23.2
type SelectionItem struct {
Name string
Description string
Recommended bool
AvailabilityBadge string
}
SelectionItem represents a model row after launch has derived selector-only UI state.
func ApplyAccountStateToSelectionItems ¶ added in v0.23.2
func ApplyAccountStateToSelectionItems(items []ModelItem, state AccountState) []SelectionItem
func SelectionItemsWithAccountState ¶ added in v0.23.2
func SelectionItemsWithAccountState(items []ModelItem, state *AccountState) []SelectionItem
type SingleSelector ¶
type SingleSelector func(title string, items []SelectionItem, current string) (string, error)
SingleSelector is a function type for single item selection. current is the name of the previously selected item to highlight; empty means no pre-selection.
var DefaultSingleSelector SingleSelector
DefaultSingleSelector is the default single-select implementation.
type SingleSelectorWithUpdates ¶ added in v0.23.2
type SingleSelectorWithUpdates func(title string, items []SelectionItem, current string, updates <-chan []SelectionItem) (string, error)
SingleSelectorWithUpdates is a single item selector that can receive refreshed item state while open.
var DefaultSingleSelectorWithUpdates SingleSelectorWithUpdates
DefaultSingleSelectorWithUpdates is the default single-select implementation with live updates.
type Spinner ¶ added in v0.32.0
type Spinner struct {
// contains filtered or unexported fields
}
Spinner is a handle on a running animated spinner. Stop halts the spinner and clears its line (it blocks until the spinner has fully stopped and is safe to call multiple times). Cancelled returns a channel that is closed if the user interrupts the spinner (e.g. with Ctrl+C); wait loops can select on it to abort early. For the non-interactive ANSI fallback the channel is never closed because Ctrl+C raises SIGINT and terminates the process directly.
func NewSpinner ¶ added in v0.32.0
func NewSpinner(stop func(), cancelled chan struct{}) *Spinner
NewSpinner builds a Spinner from a stop function and a cancellation channel. It is intended for implementations of DefaultSpinner (e.g. the bubbletea spinner in cmd/tui). stop must be safe to call multiple times; cancelled is closed by the implementation when the user interrupts the spinner, or left open when interruption is handled another way (e.g. SIGINT).
func StartSpinner ¶ added in v0.32.0
StartSpinner begins an animated spinner displaying message and returns a *Spinner handle. It uses DefaultSpinner when available, otherwise a simple ANSI fallback that renders SpinnerFrames to stderr without requiring a TTY.
type SupportedIntegration ¶ added in v0.23.0
type SupportedIntegration interface {
Supported() error
}
SupportedIntegration lets an integration report platform support separately from whether the underlying app binary is installed.
type VSCode ¶ added in v0.18.3
type VSCode struct{}
VSCode implements Runner and Editor for Visual Studio Code integration.
func (*VSCode) Edit ¶ added in v0.18.3
func (v *VSCode) Edit(models []LaunchModel) error
func (*VSCode) FocusVSCode ¶ added in v0.18.3
func (v *VSCode) FocusVSCode()
FocusVSCode brings VS Code to the foreground.
func (*VSCode) IsRunning ¶ added in v0.18.3
IsRunning reports whether VS Code is currently running. Each platform uses a pattern specific enough to avoid matching Cursor or other VS Code forks.
func (*VSCode) Quit ¶ added in v0.18.3
func (v *VSCode) Quit()
Quit gracefully quits VS Code and waits for it to exit so that it flushes its in-memory state back to the database.
func (*VSCode) Run ¶ added in v0.18.3
func (v *VSCode) Run(model string, _ []LaunchModel, args []string) error
func (*VSCode) ShowInModelPicker ¶ added in v0.18.3
ShowInModelPicker ensures the given models are visible in VS Code's Copilot Chat model picker. It sets the configured models to true in the picker preferences so they appear in the dropdown. Models use the VS Code identifier format "ollama/Ollama/<name>".