Documentation
¶
Index ¶
- Variables
- func ConfirmPrompt(prompt string) (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 ResolveRunModel(ctx context.Context, req RunModelRequest) (string, error)
- type Claude
- type Cline
- type Codex
- type Droid
- type Editor
- type IntegrationInfo
- type IntegrationInstallSpec
- type IntegrationLaunchRequest
- type IntegrationSpec
- type LaunchConfirmMode
- type LaunchMissingModelMode
- type LaunchPolicy
- type LauncherIntegrationState
- type LauncherState
- type ModelInfo
- type ModelItem
- type MultiSelector
- type OpenCode
- type Openclaw
- type Pi
- type RunModelRequest
- type Runner
- type SingleSelector
- type VSCode
- func (v *VSCode) Edit(models []string) 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, args []string) error
- func (v *VSCode) ShowInModelPicker(models []string) error
- func (v *VSCode) String() string
Constants ¶
This section is empty.
Variables ¶
var DefaultConfirmPrompt func(prompt string) (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 ErrCancelled = errors.New("cancelled")
ErrCancelled is returned when the user cancels a selection.
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 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 ResolveRunModel ¶
func ResolveRunModel(ctx context.Context, req RunModelRequest) (string, error)
ResolveRunModel returns the model that should be used for interactive chat.
Types ¶
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
ExtraArgs []string
Policy *LaunchPolicy
}
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 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 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
}
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 ModelInfo ¶
type ModelInfo = modelInfo
ModelInfo re-exports launcher model inventory details for callers.
type ModelItem ¶
ModelItem represents a model for selection UIs.
func IntegrationSelectionItems ¶
IntegrationSelectionItems returns the sorted integration items shown by launcher selection UIs.
type MultiSelector ¶
MultiSelector is a function type for multi item selection.
var DefaultMultiSelector MultiSelector
DefaultMultiSelector is the default multi-select implementation.
type OpenCode ¶
type OpenCode struct{}
OpenCode implements Runner and Editor for OpenCode integration
type RunModelRequest ¶
type RunModelRequest struct {
ForcePicker bool
Policy *LaunchPolicy
}
RunModelRequest controls how the root launcher resolves the chat model.
type SingleSelector ¶
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 VSCode ¶ added in v0.18.3
type VSCode struct{}
VSCode implements Runner and Editor for Visual Studio Code integration.
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) 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>".