settings

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package settings implements the lango settings command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchEmbeddingModelOptions

func FetchEmbeddingModelOptions(providerID string, cfg *config.Config, currentModel string) []string

FetchEmbeddingModelOptions fetches models and filters for embedding-capable ones. Falls back to the full model list if no embedding models are found.

func FetchModelOptions

func FetchModelOptions(providerID string, cfg *config.Config, currentModel string) []string

FetchModelOptions fetches available models from a provider. Returns a sorted list of model IDs, or nil if fetching fails. The currentModel (if non-empty) is always included in the result.

func FetchModelOptionsWithError

func FetchModelOptionsWithError(providerID string, cfg *config.Config, currentModel string) ([]string, error)

FetchModelOptionsWithError is like FetchModelOptions but also returns the error when model fetching fails, for diagnostic feedback.

func NewA2AForm

func NewA2AForm(cfg *config.Config) *tuicore.FormModel

NewA2AForm creates the A2A Protocol configuration form.

func NewAgentForm

func NewAgentForm(cfg *config.Config) *tuicore.FormModel

NewAgentForm creates the Agent configuration form.

func NewBackgroundForm

func NewBackgroundForm(cfg *config.Config) *tuicore.FormModel

NewBackgroundForm creates the Background Tasks configuration form.

func NewChannelsForm

func NewChannelsForm(cfg *config.Config) *tuicore.FormModel

NewChannelsForm creates the Channels configuration form.

func NewCommand

func NewCommand() *cobra.Command

NewCommand creates the settings command.

func NewCronForm

func NewCronForm(cfg *config.Config) *tuicore.FormModel

NewCronForm creates the Cron Scheduler configuration form.

func NewDBEncryptionForm

func NewDBEncryptionForm(cfg *config.Config) *tuicore.FormModel

NewDBEncryptionForm creates the Security DB Encryption configuration form.

func NewEmbeddingForm

func NewEmbeddingForm(cfg *config.Config) *tuicore.FormModel

NewEmbeddingForm creates the Embedding & RAG configuration form.

func NewGraphForm

func NewGraphForm(cfg *config.Config) *tuicore.FormModel

NewGraphForm creates the Graph Store configuration form.

func NewKMSForm

func NewKMSForm(cfg *config.Config) *tuicore.FormModel

NewKMSForm creates the Security KMS configuration form.

func NewKnowledgeForm

func NewKnowledgeForm(cfg *config.Config) *tuicore.FormModel

NewKnowledgeForm creates the Knowledge configuration form.

func NewLibrarianForm

func NewLibrarianForm(cfg *config.Config) *tuicore.FormModel

NewLibrarianForm creates the Librarian configuration form.

func NewMultiAgentForm

func NewMultiAgentForm(cfg *config.Config) *tuicore.FormModel

NewMultiAgentForm creates the Multi-Agent configuration form.

func NewOIDCProviderForm

func NewOIDCProviderForm(id string, cfg config.OIDCProviderConfig) *tuicore.FormModel

NewOIDCProviderForm creates the OIDC Provider configuration form.

func NewObservationalMemoryForm

func NewObservationalMemoryForm(cfg *config.Config) *tuicore.FormModel

NewObservationalMemoryForm creates the Observational Memory configuration form.

func NewP2PForm

func NewP2PForm(cfg *config.Config) *tuicore.FormModel

NewP2PForm creates the P2P Network configuration form.

func NewP2POwnerProtectionForm

func NewP2POwnerProtectionForm(cfg *config.Config) *tuicore.FormModel

NewP2POwnerProtectionForm creates the P2P Owner Protection configuration form.

func NewP2PPricingForm

func NewP2PPricingForm(cfg *config.Config) *tuicore.FormModel

NewP2PPricingForm creates the P2P Pricing configuration form.

func NewP2PSandboxForm

func NewP2PSandboxForm(cfg *config.Config) *tuicore.FormModel

NewP2PSandboxForm creates the P2P Sandbox configuration form.

func NewP2PZKPForm

func NewP2PZKPForm(cfg *config.Config) *tuicore.FormModel

NewP2PZKPForm creates the P2P ZKP configuration form.

func NewPaymentForm

func NewPaymentForm(cfg *config.Config) *tuicore.FormModel

NewPaymentForm creates the Payment configuration form.

func NewProviderForm

func NewProviderForm(id string, cfg config.ProviderConfig) *tuicore.FormModel

NewProviderForm creates a Provider configuration form.

func NewProviderFromConfig

func NewProviderFromConfig(id string, pCfg config.ProviderConfig) provider.Provider

NewProviderFromConfig creates a lightweight provider instance from config. Returns nil if the provider cannot be created (missing API key, unknown type, etc.).

func NewSecurityForm

func NewSecurityForm(cfg *config.Config) *tuicore.FormModel

NewSecurityForm creates the Security configuration form.

func NewServerForm

func NewServerForm(cfg *config.Config) *tuicore.FormModel

NewServerForm creates the Server configuration form.

func NewSessionForm

func NewSessionForm(cfg *config.Config) *tuicore.FormModel

NewSessionForm creates the Session configuration form.

func NewSkillForm

func NewSkillForm(cfg *config.Config) *tuicore.FormModel

NewSkillForm creates the Skill configuration form.

func NewToolsForm

func NewToolsForm(cfg *config.Config) *tuicore.FormModel

NewToolsForm creates the Tools configuration form.

func NewWorkflowForm

func NewWorkflowForm(cfg *config.Config) *tuicore.FormModel

NewWorkflowForm creates the Workflow Engine configuration form.

func ParseCustomPatterns

func ParseCustomPatterns(val string) map[string]string

ParseCustomPatterns parses a comma-separated "name:regex" string into a map.

Types

type AuthProviderItem

type AuthProviderItem struct {
	ID        string
	IssuerURL string
}

AuthProviderItem represents an OIDC provider in the list.

type AuthProvidersListModel

type AuthProvidersListModel struct {
	Providers []AuthProviderItem
	Cursor    int
	Selected  string // ID of selected provider, or "NEW"
	Deleted   string // ID of provider to delete
	Exit      bool   // True if user wants to go back
}

AuthProvidersListModel manages the OIDC provider list UI.

func NewAuthProvidersListModel

func NewAuthProvidersListModel(cfg *config.Config) AuthProvidersListModel

NewAuthProvidersListModel creates a new model from config.

func (AuthProvidersListModel) Init

func (m AuthProvidersListModel) Init() tea.Cmd

Init implements tea.Model.

func (AuthProvidersListModel) Update

Update handles key events for the OIDC provider list.

func (AuthProvidersListModel) View

func (m AuthProvidersListModel) View() string

View renders the OIDC provider list.

type Category

type Category struct {
	ID    string
	Title string
	Desc  string
}

Category represents a configuration category in the menu.

type Editor

type Editor struct {

	// Public status
	Completed bool
	Cancelled bool
	// contains filtered or unexported fields
}

Editor is the main bubbletea model for the settings editor.

func NewEditor

func NewEditor() *Editor

NewEditor creates a new settings editor with default config.

func NewEditorWithConfig

func NewEditorWithConfig(cfg *config.Config) *Editor

NewEditorWithConfig creates a new settings editor pre-loaded with the given config.

func (*Editor) Config

func (e *Editor) Config() *config.Config

Config returns the current configuration from the editor state.

func (*Editor) Init

func (e *Editor) Init() tea.Cmd

Init implements tea.Model.

func (*Editor) Update

func (e *Editor) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (*Editor) View

func (e *Editor) View() string

View implements tea.Model.

type EditorStep

type EditorStep int

EditorStep represents the current step in the settings editor.

const (
	StepWelcome EditorStep = iota
	StepMenu
	StepForm
	StepProvidersList
	StepAuthProvidersList
	StepComplete
)
type MenuModel struct {
	Sections []Section
	Cursor   int
	Selected string
	Width    int
	Height   int
	// contains filtered or unexported fields
}

MenuModel manages the configuration menu.

func NewMenuModel

func NewMenuModel() MenuModel

NewMenuModel creates a new menu model with grouped configuration categories.

func (m MenuModel) AllCategories() []Category

AllCategories returns a flat list of all categories (public, for tests).

func (m MenuModel) Init() tea.Cmd

Init implements tea.Model.

func (m MenuModel) IsSearching() bool

IsSearching returns true when the menu is in search mode.

func (m MenuModel) Update(msg tea.Msg) (MenuModel, tea.Cmd)

Update handles key events for the menu.

func (m MenuModel) View() string

View renders the configuration menu.

type ProviderItem

type ProviderItem struct {
	ID   string
	Type string
}

ProviderItem represents a provider in the list.

type ProvidersListModel

type ProvidersListModel struct {
	Providers []ProviderItem
	Cursor    int
	Selected  string // ID of selected provider, or "NEW"
	Deleted   string // ID of provider to delete
	Exit      bool   // True if user wants to go back
}

ProvidersListModel manages the provider list UI.

func NewProvidersListModel

func NewProvidersListModel(cfg *config.Config) ProvidersListModel

NewProvidersListModel creates a new model from config.

func (ProvidersListModel) Init

func (m ProvidersListModel) Init() tea.Cmd

Init implements tea.Model.

func (ProvidersListModel) Update

Update handles key events for the provider list.

func (ProvidersListModel) View

func (m ProvidersListModel) View() string

View renders the provider list.

type Section

type Section struct {
	Title      string
	Categories []Category
}

Section groups related categories under a heading.

Jump to

Keyboard shortcuts

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