Documentation
¶
Index ¶
- Constants
- Variables
- func ClearLine()
- func DisplayQR(qrURL string) error
- func DisplaySpinnerASCII(step int) string
- func DisplayStatus(message string, showSpinner bool, step int)
- func PrintError(message string)
- func PrintInfo(message string)
- func PrintSuccess(message string)
- func PrintWarning(message string)
- func RemotePairEnable(appManager *AppManager, botUUID string, enable bool) error
- func RemotePairRevoke(appManager *AppManager, botUUID, chatID string) error
- func RemotePairStatus(appManager *AppManager, botUUID string) error
- func TruncateString(s string, maxWidth int) string
- type APIStyle
- type AgentApplyFlagCmdKong
- type AgentCmdKong
- type AgentListFlagCmdKong
- type AgentRestoreFlagCmdKong
- type AgentShowFlagCmdKong
- type AppManager
- func (am *AppManager) AddProvider(name, apiBase, token string, apiStyle protocol.APIStyle) error
- func (am *AppManager) AddRule(rule typ.Rule) error
- func (am *AppManager) AppConfig() *config.AppConfig
- func (am *AppManager) CollectProvidersFromRule(rule *typ.Rule) ([]*typ.Provider, error)
- func (am *AppManager) DeleteProvider(name string) error
- func (am *AppManager) DeleteProviderByUUID(uuid string) error
- func (am *AppManager) ExportRule(rule *typ.Rule, providers []*typ.Provider, format exportpkg.Format) (string, error)
- func (am *AppManager) FetchAndSaveProviderModels(providerUUID string) error
- func (am *AppManager) GetGlobalConfig() *serverconfig.Config
- func (am *AppManager) GetModelToken() string
- func (am *AppManager) GetProvider(uuid string) (*typ.Provider, error)
- func (am *AppManager) GetProviderByUUID(uuid string) (*typ.Provider, error)
- func (am *AppManager) GetRuleByRequestModelAndScenario(requestModel string, scenario typ.RuleScenario) *typ.Rule
- func (am *AppManager) GetServerManager() *ServerManager
- func (am *AppManager) GetServerPort() int
- func (am *AppManager) GetUserToken() string
- func (am *AppManager) HasModelToken() bool
- func (am *AppManager) ImportRule(data string, format exportpkg.Format, opts ImportOptions) (*ImportResult, error)
- func (am *AppManager) ImportRuleFromJSONL(data string, opts ImportOptions) (*ImportResult, error)deprecated
- func (am *AppManager) ListProviders() []*typ.Provider
- func (am *AppManager) ListRules() []typ.Rule
- func (am *AppManager) SaveConfig() error
- func (am *AppManager) SetServerPort(port int) error
- func (am *AppManager) SetupServer(port int, opts ...server.ServerOption) error
- func (am *AppManager) SetupServerWithPort(port int) error
- func (am *AppManager) StartServer() error
- func (am *AppManager) UpdateProviderByUUID(uuid string, provider *typ.Provider) error
- func (am *AppManager) UpdateRule(uuid string, rule typ.Rule) error
- type BannerConfig
- type CCmdKong
- type ConfigAddCmdKong
- type ConfigCmdKong
- type ConfigDeleteCmdKong
- type ConfigExportCmdKong
- type ConfigGetCmdKong
- type ConfigImportCmdKong
- type ConfigInteractiveCmdKong
- type ConfigListCmdKong
- type ConfigUpdateCmdKong
- type ImportOptions
- type ImportResult
- type MCPBuiltinCmdKong
- type OAuthCmdKong
- type OpenCmdKong
- type ProviderAddCmdKong
- type ProviderCmdKong
- type ProviderDeleteCmdKong
- type ProviderDetailsCmdKong
- type ProviderImportInfo
- type ProviderInfo
- type ProviderListCmdKong
- type ProviderOAuthConfig
- type ProviderUpdateCmdKong
- type QRDisplay
- type QuickstartCmdKong
- type QuotaCmdKong
- type QuotaGetCmdKong
- type QuotaListCmdKong
- type QuotaRefreshCmdKong
- type QuotaSummaryCmdKong
- type RemoteAddCmdKong
- type RemoteCmdKong
- type RemoteConfigCmdKong
- type RemoteListCmdKong
- type RemotePairCmdKong
- type RemotePairDisableCmdKong
- type RemotePairEnableCmdKong
- type RemotePairRevokeCmdKong
- type RemotePairStatusCmdKong
- type RemoteStartCmdKong
- type RestartCmdKong
- type ServerManager
- func (sm *ServerManager) Cleanup()
- func (sm *ServerManager) GetGinEngine() *gin.Engine
- func (sm *ServerManager) GetTBServer() *server.Server
- func (sm *ServerManager) IsRunning() bool
- func (sm *ServerManager) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (sm *ServerManager) Setup(port int) error
- func (sm *ServerManager) Start() error
- func (sm *ServerManager) Stop() error
- type StartCmdKong
- type StatusCmdKong
- type StopCmdKong
- type SwaggerCmdKong
- type VersionCmdKong
Constants ¶
const StopTimeout = time.Second
Variables ¶
var ( BuildVersion = "dev" BuildGitCommit = "unknown" BuildBuildTime = "unknown" BuildGoVersion = "unknown" BuildPlatform = "unknown" )
Build information set by cli/tingly-box/main_kong.go at startup.
Functions ¶
func DisplayQR ¶
DisplayQR displays a QR code in the terminal It tries multiple methods and falls back to showing the URL
func DisplaySpinnerASCII ¶
DisplaySpinnerASCII returns a simple ASCII spinner
func DisplayStatus ¶
DisplayStatus displays a status message with optional spinner
func RemotePairEnable ¶ added in v0.260507.1
func RemotePairEnable(appManager *AppManager, botUUID string, enable bool) error
RemotePairEnable enables or disables RequirePairing for a bot. Takes effect at next bot start.
func RemotePairRevoke ¶ added in v0.260507.1
func RemotePairRevoke(appManager *AppManager, botUUID, chatID string) error
RemotePairRevoke forgets the pairing for a specific chat. The chat will need to re-bind to issue commands.
func RemotePairStatus ¶ added in v0.260507.1
func RemotePairStatus(appManager *AppManager, botUUID string) error
RemotePairStatus shows whether RequirePairing is on and where to find the code.
func TruncateString ¶
TruncateString truncates a string to fit within max width
Types ¶
type AgentApplyFlagCmdKong ¶ added in v0.260507.1
type AgentApplyFlagCmdKong struct {
AgentType string `kong:"arg,optional,help='Agent type (claude-code, opencode, codex)'"`
Provider string `kong:"flag,name='provider',help='Provider UUID'"`
Model string `kong:"flag,name='model',help='Model name'"`
Unified bool `kong:"flag,name='unified',default='true',help='Unified mode (claude-code only)'"`
StatusLine bool `kong:"flag,name='status-line',help='Install status line integration (claude-code only)'"`
Force bool `kong:"flag,name='force',help='Skip confirmation'"`
Preview bool `kong:"flag,name='preview',help='Preview without applying'"`
}
AgentApplyFlagCmdKong applies agent configuration via flags
func (*AgentApplyFlagCmdKong) Run ¶ added in v0.260507.1
func (a *AgentApplyFlagCmdKong) Run(appManager *AppManager) error
type AgentCmdKong ¶ added in v0.260507.1
type AgentCmdKong struct {
// Flag-based operations (primary interface)
List AgentListFlagCmdKong `kong:"cmd,name='list',default='1',hidden,help='List configured agents (default)'"`
Apply AgentApplyFlagCmdKong `kong:"cmd,help='Apply agent configuration'"`
Show AgentShowFlagCmdKong `kong:"cmd,help='Show agent configuration details'"`
Restore AgentRestoreFlagCmdKong `kong:"cmd,help='Restore agent configuration from backup'"`
}
AgentCmdKong is the Kong version of agent command with flag-based operations. The default behavior (no subcommand) is to list agents.
type AgentListFlagCmdKong ¶ added in v0.260507.1
type AgentListFlagCmdKong struct{}
AgentListFlagCmdKong lists configured agents (default behavior)
func (*AgentListFlagCmdKong) Run ¶ added in v0.260507.1
func (a *AgentListFlagCmdKong) Run(appManager *AppManager) error
type AgentRestoreFlagCmdKong ¶ added in v0.260507.1
type AgentRestoreFlagCmdKong struct {
AgentType string `kong:"arg,optional,help='Agent type to restore'"`
Force bool `kong:"flag,name='force',help='Skip confirmation prompt'"`
}
AgentRestoreFlagCmdKong restores agent configuration from backup
func (*AgentRestoreFlagCmdKong) Run ¶ added in v0.260507.1
func (a *AgentRestoreFlagCmdKong) Run(appManager *AppManager) error
type AgentShowFlagCmdKong ¶ added in v0.260507.1
type AgentShowFlagCmdKong struct {
AgentType string `kong:"arg,optional,help='Agent type to show'"`
}
AgentShowFlagCmdKong shows agent configuration details via flags
func (*AgentShowFlagCmdKong) Run ¶ added in v0.260507.1
func (a *AgentShowFlagCmdKong) Run(appManager *AppManager) error
type AppManager ¶
type AppManager struct {
// contains filtered or unexported fields
}
AppManager manages all application state and operations. It serves as the single source of truth for business logic that can be used by both CLI (cobra commands) and GUI (Wails services).
func CreateAppManagerForDir ¶
func CreateAppManagerForDir(configDir string) (*AppManager, error)
CreateAppManagerForDir creates a new AppManager for the specified config directory. This is used when a command specifies a different config directory than the global one.
func NewAppManager ¶
func NewAppManager(configDir string) (*AppManager, error)
NewAppManager creates a new AppManager with the given config directory.
func NewAppManagerWithConfig ¶
func NewAppManagerWithConfig(appConfig *config.AppConfig) *AppManager
NewAppManagerWithConfig creates a new AppManager with an existing AppConfig.
func (*AppManager) AddProvider ¶
func (am *AppManager) AddProvider(name, apiBase, token string, apiStyle protocol.APIStyle) error
AddProvider adds a new AI provider with the given configuration.
func (*AppManager) AddRule ¶
func (am *AppManager) AddRule(rule typ.Rule) error
AddRule adds a new routing rule.
func (*AppManager) AppConfig ¶
func (am *AppManager) AppConfig() *config.AppConfig
AppConfig returns the underlying AppConfig.
func (*AppManager) CollectProvidersFromRule ¶
CollectProvidersFromRule collects all providers referenced by the rule's services. This is a helper function for gathering providers to export with a rule.
func (*AppManager) DeleteProvider ¶
func (am *AppManager) DeleteProvider(name string) error
DeleteProvider removes an AI provider by name.
func (*AppManager) DeleteProviderByUUID ¶
func (am *AppManager) DeleteProviderByUUID(uuid string) error
DeleteProviderByUUID removes an AI provider by UUID.
func (*AppManager) ExportRule ¶
func (am *AppManager) ExportRule(rule *typ.Rule, providers []*typ.Provider, format exportpkg.Format) (string, error)
ExportRule exports a rule with its providers, or providers only, in the specified format. At least one of rule or providers must be specified.
func (*AppManager) FetchAndSaveProviderModels ¶
func (am *AppManager) FetchAndSaveProviderModels(providerUUID string) error
FetchAndSaveProviderModels fetches models from a provider and saves them.
func (*AppManager) GetGlobalConfig ¶
func (am *AppManager) GetGlobalConfig() *serverconfig.Config
GetGlobalConfig returns the global configuration manager.
func (*AppManager) GetModelToken ¶
func (am *AppManager) GetModelToken() string
GetModelToken returns the model API token.
func (*AppManager) GetProvider ¶
func (am *AppManager) GetProvider(uuid string) (*typ.Provider, error)
GetProvider returns a provider by UUID, or nil if not found.
func (*AppManager) GetProviderByUUID ¶ added in v0.260402.2330
func (am *AppManager) GetProviderByUUID(uuid string) (*typ.Provider, error)
GetProviderByUUID returns a provider by UUID (implements quota.ProviderManager interface)
func (*AppManager) GetRuleByRequestModelAndScenario ¶
func (am *AppManager) GetRuleByRequestModelAndScenario(requestModel string, scenario typ.RuleScenario) *typ.Rule
GetRuleByRequestModelAndScenario returns a rule by request model and scenario.
func (*AppManager) GetServerManager ¶
func (am *AppManager) GetServerManager() *ServerManager
GetServerManager returns the server manager instance.
func (*AppManager) GetServerPort ¶
func (am *AppManager) GetServerPort() int
GetServerPort returns the configured server port.
func (*AppManager) GetUserToken ¶
func (am *AppManager) GetUserToken() string
GetUserToken returns the user authentication token.
func (*AppManager) HasModelToken ¶
func (am *AppManager) HasModelToken() bool
HasModelToken returns true if a model token is configured.
func (*AppManager) ImportRule ¶
func (am *AppManager) ImportRule(data string, format exportpkg.Format, opts ImportOptions) (*ImportResult, error)
ImportRule imports a rule from data in the specified format
func (*AppManager) ImportRuleFromJSONL
deprecated
func (am *AppManager) ImportRuleFromJSONL(data string, opts ImportOptions) (*ImportResult, error)
ImportRuleFromJSONL imports a rule from JSONL format (either file content or stdin format). The data should be line-delimited JSON with: - Line 1: metadata (type="metadata") - Line 2: rule data (type="rule") - Subsequent lines: provider data (type="provider")
Deprecated: Use ImportRule with FormatAuto instead. This method is kept for backward compatibility.
func (*AppManager) ListProviders ¶
func (am *AppManager) ListProviders() []*typ.Provider
ListProviders returns all configured providers.
func (*AppManager) ListRules ¶
func (am *AppManager) ListRules() []typ.Rule
ListRules returns all configured rules.
func (*AppManager) SaveConfig ¶
func (am *AppManager) SaveConfig() error
SaveConfig saves the current configuration to disk.
func (*AppManager) SetServerPort ¶
func (am *AppManager) SetServerPort(port int) error
SetServerPort sets the server port.
func (*AppManager) SetupServer ¶
func (am *AppManager) SetupServer(port int, opts ...server.ServerOption) error
SetupServer initializes the server manager with the given port and options.
func (*AppManager) SetupServerWithPort ¶
func (am *AppManager) SetupServerWithPort(port int) error
SetupServerWithPort initializes the server manager with just a port (no options). This is a convenience method for the TUI wizard.
func (*AppManager) StartServer ¶
func (am *AppManager) StartServer() error
StartServer starts the server if it has been set up.
func (*AppManager) UpdateProviderByUUID ¶
func (am *AppManager) UpdateProviderByUUID(uuid string, provider *typ.Provider) error
UpdateProviderByUUID updates an existing provider by UUID.
func (*AppManager) UpdateRule ¶
func (am *AppManager) UpdateRule(uuid string, rule typ.Rule) error
UpdateRule updates an existing rule by UUID.
type BannerConfig ¶
type BannerConfig struct {
Port int
Host string
EnableUI bool
GlobalConfig *serverconfig.Config
IsDaemon bool
}
BannerConfig holds configuration for banner display
type CCmdKong ¶ added in v0.260507.1
type CCmdKong struct {
Args []string `kong:"arg,optional,passthrough"`
}
CCmdKong launches Claude Code with passthrough mode Kong's passthrough mode requires at least one positional arg
func (*CCmdKong) Run ¶ added in v0.260507.1
func (c *CCmdKong) Run(appManager *AppManager) error
type ConfigAddCmdKong ¶ added in v0.260507.1
type ConfigAddCmdKong struct {
Name string `kong:"arg,optional,help='Provider name'"`
BaseURL string `kong:"arg,optional,help='API base URL'"`
Token string `kong:"arg,optional,help='API token'"`
APIStyle string `kong:"arg,optional,help='API style (openai, anthropic)'"`
}
ConfigAddCmdKong adds a new provider
func (*ConfigAddCmdKong) Run ¶ added in v0.260507.1
func (c *ConfigAddCmdKong) Run(appManager *AppManager) error
type ConfigCmdKong ¶ added in v0.260507.1
type ConfigCmdKong struct {
// Interactive mode (default when no flags)
Interactive ConfigInteractiveCmdKong `kong:"cmd,name='interactive',default='1',hidden,help='Interactive configuration management'"`
// Provider management (via positional args for add, flags for other operations)
Add ConfigAddCmdKong `kong:"cmd,help='Add a new provider'"`
List ConfigListCmdKong `kong:"cmd,help='List all providers'"`
Delete ConfigDeleteCmdKong `kong:"cmd,help='Delete a provider (interactive)'"`
Update ConfigUpdateCmdKong `kong:"cmd,help='Update a provider (interactive)'"`
Get ConfigGetCmdKong `kong:"cmd,help='Get provider details by name'"`
// Import/Export
Export ConfigExportCmdKong `kong:"cmd,help='Export configuration'"`
Import ConfigImportCmdKong `kong:"cmd,help='Import configuration'"`
}
ConfigCmdKong is the unified configuration management command. It replaces provider/export/import commands with a single cohesive interface.
type ConfigDeleteCmdKong ¶ added in v0.260507.1
type ConfigDeleteCmdKong struct{}
ConfigDeleteCmdKong deletes a provider in interactive mode.
func (*ConfigDeleteCmdKong) Run ¶ added in v0.260507.1
func (c *ConfigDeleteCmdKong) Run(appManager *AppManager) error
type ConfigExportCmdKong ¶ added in v0.260507.1
type ConfigExportCmdKong struct {
RequestModel string `kong:"flag,name='request-model',required,help='Request model name'"`
Scenario string `kong:"flag,name='scenario',required,help='Rule scenario'"`
Format string `kong:"flag,name='format',default='jsonl',help='Export format: jsonl or base64'"`
Output string `kong:"flag,name='output',help='Output file path (default: stdout)'"`
}
ConfigExportCmdKong exports configuration to file or stdout
func (*ConfigExportCmdKong) Run ¶ added in v0.260507.1
func (c *ConfigExportCmdKong) Run(appManager *AppManager) error
type ConfigGetCmdKong ¶ added in v0.260507.1
type ConfigGetCmdKong struct {
Name string `kong:"arg,optional,help='Provider name'"`
}
ConfigGetCmdKong displays a provider's details. Without a name it drops into interactive selection.
func (*ConfigGetCmdKong) Run ¶ added in v0.260507.1
func (c *ConfigGetCmdKong) Run(appManager *AppManager) error
type ConfigImportCmdKong ¶ added in v0.260507.1
type ConfigImportCmdKong struct {
File string `kong:"arg,optional,help='Import file path (reads from stdin if omitted)'"`
Format string `kong:"flag,name='format',default='auto',help='Import format: auto, jsonl, or base64'"`
}
ConfigImportCmdKong imports configuration from file or stdin
func (*ConfigImportCmdKong) Run ¶ added in v0.260507.1
func (c *ConfigImportCmdKong) Run(appManager *AppManager) error
type ConfigInteractiveCmdKong ¶ added in v0.260507.1
type ConfigInteractiveCmdKong struct{}
ConfigInteractiveCmdKong runs the interactive config menu.
func (*ConfigInteractiveCmdKong) Run ¶ added in v0.260507.1
func (c *ConfigInteractiveCmdKong) Run(appManager *AppManager) error
type ConfigListCmdKong ¶ added in v0.260507.1
type ConfigListCmdKong struct{}
ConfigListCmdKong lists all providers
func (*ConfigListCmdKong) Run ¶ added in v0.260507.1
func (c *ConfigListCmdKong) Run(appManager *AppManager) error
type ConfigUpdateCmdKong ¶ added in v0.260507.1
type ConfigUpdateCmdKong struct{}
ConfigUpdateCmdKong updates a provider in interactive mode.
func (*ConfigUpdateCmdKong) Run ¶ added in v0.260507.1
func (c *ConfigUpdateCmdKong) Run(appManager *AppManager) error
type ImportOptions ¶
type ImportOptions struct {
// OnProviderConflict specifies what to do when a provider already exists.
// "use" - use existing provider, "skip" - skip this provider, "suffix" - create with suffixed name
OnProviderConflict string
// OnRuleConflict specifies what to do when a rule already exists.
// "skip" - skip import, "update" - update existing rule, "new" - create with new name
OnRuleConflict string
// Quiet suppresses progress output
Quiet bool
}
ImportOptions controls how imports are handled when conflicts occur.
type ImportResult ¶
type ImportResult struct {
RuleCreated bool
RuleUpdated bool
ProvidersCreated int
ProvidersUsed int
Providers []ProviderImportInfo
ProviderMap map[string]string // old UUID -> new UUID
}
ImportResult contains the results of an import operation.
type MCPBuiltinCmdKong ¶ added in v0.260507.1
type MCPBuiltinCmdKong struct{}
MCPBuiltinCmdKong starts the builtin MCP server. Registered at the top level as "mcp-builtin" to match the legacy command path, which is consumed by internal/mcp/runtime/builtin_registry.go.
func (*MCPBuiltinCmdKong) Run ¶ added in v0.260507.1
func (m *MCPBuiltinCmdKong) Run(appManager *AppManager) error
type OAuthCmdKong ¶ added in v0.260507.1
type OAuthCmdKong struct {
// Positional argument (optional)
Provider string `kong:"arg,optional,help='Provider type (e.g., claude_code, qwen_code, codex)'"`
// Flags
Name string `kong:"flag,name='name',short='n',help='Custom name for the provider'"`
Port int `kong:"flag,name='port',short='p',help='Callback server port'"`
ProxyURL string `kong:"flag,name='proxy',short='x',help='Proxy URL for OAuth requests'"`
}
OAuthCmdKong handles OAuth authentication
func (*OAuthCmdKong) Run ¶ added in v0.260507.1
func (o *OAuthCmdKong) Run(appManager *AppManager) error
type OpenCmdKong ¶ added in v0.260507.1
type OpenCmdKong struct {
// Embed StartCmdKong to share server flags
StartCmdKong
}
OpenCmdKong opens the web UI
func (*OpenCmdKong) Run ¶ added in v0.260507.1
func (o *OpenCmdKong) Run(appManager *AppManager) error
type ProviderAddCmdKong ¶ added in v0.260507.1
type ProviderAddCmdKong struct {
Name string `kong:"arg,optional,help='Provider name'"`
BaseURL string `kong:"arg,optional,help='API base URL'"`
Token string `kong:"arg,optional,help='API token'"`
APIStyle string `kong:"arg,optional,help='API style (openai, anthropic)'"`
}
ProviderAddCmdKong adds a new provider with optional positional args
func (*ProviderAddCmdKong) Run ¶ added in v0.260507.1
func (p *ProviderAddCmdKong) Run(appManager *AppManager) error
type ProviderCmdKong ¶ added in v0.260507.1
type ProviderCmdKong struct {
List ProviderListCmdKong `kong:"cmd,name='list',default='1',hidden,help='List all providers (default)'"`
Add ProviderAddCmdKong `kong:"cmd,help='Add a new provider'"`
Delete ProviderDeleteCmdKong `kong:"cmd,help='Delete a provider (interactive)'"`
Update ProviderUpdateCmdKong `kong:"cmd,help='Update a provider (interactive)'"`
Details ProviderDetailsCmdKong `kong:"cmd,help='View provider details'"`
}
ProviderCmdKong is the Kong version of provider command with subcommands. The default behavior (no subcommand) is to list providers.
type ProviderDeleteCmdKong ¶ added in v0.260507.1
type ProviderDeleteCmdKong struct{}
ProviderDeleteCmdKong deletes a provider in interactive mode
func (*ProviderDeleteCmdKong) Run ¶ added in v0.260507.1
func (p *ProviderDeleteCmdKong) Run(appManager *AppManager) error
type ProviderDetailsCmdKong ¶ added in v0.260507.1
type ProviderDetailsCmdKong struct {
Name string `kong:"arg,optional,help='Provider name'"`
}
ProviderDetailsCmdKong displays provider details (without name drops to interactive)
func (*ProviderDetailsCmdKong) Run ¶ added in v0.260507.1
func (p *ProviderDetailsCmdKong) Run(appManager *AppManager) error
type ProviderImportInfo ¶ added in v0.260414.2000
type ProviderImportInfo struct {
UUID string
Name string
Action string // "created", "used", "skipped"
}
ProviderImportInfo contains information about an imported or used provider
type ProviderInfo ¶
ProviderInfo holds information about an OAuth provider
type ProviderListCmdKong ¶ added in v0.260507.1
type ProviderListCmdKong struct{}
ProviderListCmdKong lists all providers
func (*ProviderListCmdKong) Run ¶ added in v0.260507.1
func (p *ProviderListCmdKong) Run(appManager *AppManager) error
type ProviderOAuthConfig ¶
type ProviderOAuthConfig struct {
Type string
DisplayName string
APIBase string
APIStyle string
OAuthMethod string // "pkce" or "device_code"
NeedsPort1455 bool
}
ProviderOAuthConfig holds OAuth configuration for a provider
type ProviderUpdateCmdKong ¶ added in v0.260507.1
type ProviderUpdateCmdKong struct{}
ProviderUpdateCmdKong updates a provider in interactive mode
func (*ProviderUpdateCmdKong) Run ¶ added in v0.260507.1
func (p *ProviderUpdateCmdKong) Run(appManager *AppManager) error
type QuickstartCmdKong ¶ added in v0.260507.1
type QuickstartCmdKong struct {
UseTUI bool `kong:"flag,name='tui',short='t',default='true',help='Use interactive TUI mode'"`
}
QuickstartCmdKong runs the guided setup wizard
func (*QuickstartCmdKong) Run ¶
func (q *QuickstartCmdKong) Run(appManager *AppManager) error
type QuotaCmdKong ¶ added in v0.260507.1
type QuotaCmdKong struct {
// List quotas (default behavior) - this is the default command
List QuotaListCmdKong `kong:"cmd,name='list',default='1',hidden,help='List all provider quotas (default)'"`
Get QuotaGetCmdKong `kong:"cmd,help='Get provider quota details'"`
Refresh QuotaRefreshCmdKong `kong:"cmd,help='Refresh quota data'"`
Summary QuotaSummaryCmdKong `kong:"cmd,help='Show quota summary'"`
}
QuotaCmdKong is the Kong version of quota command with streamlined behavior. The default behavior (no subcommand) is to list all quotas.
type QuotaGetCmdKong ¶ added in v0.260507.1
type QuotaGetCmdKong struct {
Provider string `kong:"arg,optional,help='Provider name or UUID'"`
Refresh bool `kong:"flag,name='refresh',short='r',help='Refresh before displaying'"`
}
QuotaGetCmdKong shows details for a specific provider This was merged into the list command, but we keep a separate command for explicit "get" usage
func (*QuotaGetCmdKong) Run ¶ added in v0.260507.1
func (q *QuotaGetCmdKong) Run(appManager *AppManager) error
type QuotaListCmdKong ¶ added in v0.260507.1
type QuotaListCmdKong struct {
Refresh bool `kong:"flag,name='refresh',short='r',help='Refresh before listing'"`
}
QuotaListCmdKong lists all provider quotas with optional refresh
func (*QuotaListCmdKong) Run ¶ added in v0.260507.1
func (q *QuotaListCmdKong) Run(appManager *AppManager) error
type QuotaRefreshCmdKong ¶ added in v0.260507.1
type QuotaRefreshCmdKong struct {
Provider string `kong:"arg,optional,help='Provider name or UUID to refresh (refreshes all if omitted)'"`
}
QuotaRefreshCmdKong refreshes quota data Supports optional provider argument to refresh specific provider
func (*QuotaRefreshCmdKong) Run ¶ added in v0.260507.1
func (q *QuotaRefreshCmdKong) Run(appManager *AppManager) error
type QuotaSummaryCmdKong ¶ added in v0.260507.1
type QuotaSummaryCmdKong struct{}
QuotaSummaryCmdKong shows quota summary
func (*QuotaSummaryCmdKong) Run ¶ added in v0.260507.1
func (q *QuotaSummaryCmdKong) Run(appManager *AppManager) error
type RemoteAddCmdKong ¶ added in v0.260507.1
type RemoteAddCmdKong struct{}
RemoteAddCmdKong adds a new bot configuration (interactive).
func (*RemoteAddCmdKong) Run ¶ added in v0.260507.1
func (r *RemoteAddCmdKong) Run(appManager *AppManager) error
type RemoteCmdKong ¶ added in v0.260507.1
type RemoteCmdKong struct {
Default RemoteListCmdKong `kong:"cmd,name='default',default='1',hidden,help='List remote sessions (default)'"`
List RemoteListCmdKong `kong:"cmd,help='List remote sessions'"`
Start RemoteStartCmdKong `kong:"cmd,help='Start a remote session'"`
Config RemoteConfigCmdKong `kong:"cmd,help='Configure remote settings'"`
Add RemoteAddCmdKong `kong:"cmd,help='Add a new bot configuration'"`
Pair RemotePairCmdKong `kong:"cmd,help='Manage TOFU pairing for an imbot'"`
}
RemoteCmdKong manages remote control. The hidden Default subcommand is marked default so `tingly-box remote` (no further args) lists sessions.
type RemoteConfigCmdKong ¶ added in v0.260507.1
type RemoteConfigCmdKong struct {
UUID string `kong:"arg,optional,help='Bot UUID (interactive selection if omitted)'"`
Show bool `kong:"flag,name='show',help='Show current configuration'"`
Provider string `kong:"flag,name='provider',help='Provider UUID for smartguide'"`
Model string `kong:"flag,name='model',help='Model name for smartguide'"`
}
RemoteConfigCmdKong configures remote settings
func (*RemoteConfigCmdKong) Run ¶ added in v0.260507.1
func (r *RemoteConfigCmdKong) Run(appManager *AppManager) error
type RemoteListCmdKong ¶ added in v0.260507.1
type RemoteListCmdKong struct{}
RemoteListCmdKong lists remote sessions
func (*RemoteListCmdKong) Run ¶ added in v0.260507.1
func (r *RemoteListCmdKong) Run(appManager *AppManager) error
type RemotePairCmdKong ¶ added in v0.260507.1
type RemotePairCmdKong struct {
Enable RemotePairEnableCmdKong `kong:"cmd,help='Turn on RequirePairing for a bot'"`
Disable RemotePairDisableCmdKong `kong:"cmd,help='Turn off RequirePairing for a bot'"`
Revoke RemotePairRevokeCmdKong `kong:"cmd,help='Forget the pairing for a specific chat'"`
Status RemotePairStatusCmdKong `kong:"cmd,help='Show pairing status for a bot'"`
}
RemotePairCmdKong manages TOFU pairing for imbots
func (*RemotePairCmdKong) Run ¶ added in v0.260507.1
func (r *RemotePairCmdKong) Run(appManager *AppManager) error
type RemotePairDisableCmdKong ¶ added in v0.260507.1
type RemotePairDisableCmdKong struct {
BotUUID string `kong:"arg,help='Bot UUID'"`
}
RemotePairDisableCmdKong turns off RequirePairing for a bot
func (*RemotePairDisableCmdKong) Run ¶ added in v0.260507.1
func (r *RemotePairDisableCmdKong) Run(appManager *AppManager) error
type RemotePairEnableCmdKong ¶ added in v0.260507.1
type RemotePairEnableCmdKong struct {
BotUUID string `kong:"arg,help='Bot UUID'"`
}
RemotePairEnableCmdKong turns on RequirePairing for a bot
func (*RemotePairEnableCmdKong) Run ¶ added in v0.260507.1
func (r *RemotePairEnableCmdKong) Run(appManager *AppManager) error
type RemotePairRevokeCmdKong ¶ added in v0.260507.1
type RemotePairRevokeCmdKong struct {
BotUUID string `kong:"arg,help='Bot UUID'"`
ChatID string `kong:"arg,help='Chat ID to unpair'"`
}
RemotePairRevokeCmdKong forgets the pairing for a specific chat
func (*RemotePairRevokeCmdKong) Run ¶ added in v0.260507.1
func (r *RemotePairRevokeCmdKong) Run(appManager *AppManager) error
type RemotePairStatusCmdKong ¶ added in v0.260507.1
type RemotePairStatusCmdKong struct {
BotUUID string `kong:"arg,help='Bot UUID'"`
}
RemotePairStatusCmdKong shows pairing status for a bot
func (*RemotePairStatusCmdKong) Run ¶ added in v0.260507.1
func (r *RemotePairStatusCmdKong) Run(appManager *AppManager) error
type RemoteStartCmdKong ¶ added in v0.260507.1
type RemoteStartCmdKong struct {
UUID string `kong:"arg,optional,help='Bot UUID (interactive selection if omitted)'"`
DataPath string `kong:"flag,name='data-path',help='Data directory for bot state'"`
Provider string `kong:"flag,name='provider',help='Provider UUID for smartguide'"`
Model string `kong:"flag,name='model',help='Model name for smartguide'"`
Force bool `kong:"flag,name='force',help='Skip provider validation and force start'"`
}
RemoteStartCmdKong starts a remote session
func (*RemoteStartCmdKong) Run ¶ added in v0.260507.1
func (r *RemoteStartCmdKong) Run(appManager *AppManager) error
type RestartCmdKong ¶ added in v0.260507.1
type RestartCmdKong struct {
StartCmdKong
}
RestartCmdKong is the Kong version of restart command
func (*RestartCmdKong) Run ¶ added in v0.260507.1
func (r *RestartCmdKong) Run(appManager *AppManager) error
type ServerManager ¶
ServerManager manages the HTTP server lifecycle
func NewServerManager ¶
func NewServerManager(appConfig *config.AppConfig, opts ...server.ServerOption) *ServerManager
NewServerManager creates a new server manager. opts are server options passed directly to the underlying server.
func (*ServerManager) Cleanup ¶
func (sm *ServerManager) Cleanup()
func (*ServerManager) GetGinEngine ¶
func (sm *ServerManager) GetGinEngine() *gin.Engine
func (*ServerManager) GetTBServer ¶
func (sm *ServerManager) GetTBServer() *server.Server
GetTBServer returns the underlying TinglyBox server instance
func (*ServerManager) IsRunning ¶
func (sm *ServerManager) IsRunning() bool
IsRunning checks if the server is currently running
func (*ServerManager) ServeHTTP ¶
func (sm *ServerManager) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*ServerManager) Setup ¶
func (sm *ServerManager) Setup(port int) error
Setup creates and configures the server without starting it
func (*ServerManager) Start ¶
func (sm *ServerManager) Start() error
Start starts the server (requires Setup to be called first)
type StartCmdKong ¶ added in v0.260507.1
type StartCmdKong struct {
Port int `kong:"flag,name='port',short='p',help='Server port'"`
Host string `kong:"flag,name='host',help='Server host'"`
EnableUI bool `kong:"flag,name='ui',short='u',default='true',help='Enable web UI'"`
EnableDebug bool `kong:"flag,name='debug',help='Enable debug mode'"`
EnableOpenBrowser bool `kong:"flag,name='browser',default='true',help='Auto-open browser'"`
EnableStyleTransform bool `kong:"flag,name='adapter',default='true',help='Enable API style transform'"`
Daemon bool `kong:"flag,name='daemon',help='Run as daemon'"`
LogFile string `kong:"flag,name='log-file',help='Log file path'"`
PromptRestart bool `kong:"flag,name='prompt-restart',help='Prompt to restart if running'"`
RecordMode string `kong:"flag,name='record-mode',help='Record mode'"`
RecordDir string `kong:"flag,name='record-dir',help='Record directory'"`
Expr string `kong:"flag,name='expr',help='Experimental features'"`
}
StartCmdKong is the Kong version of start command
func (*StartCmdKong) Run ¶ added in v0.260507.1
func (s *StartCmdKong) Run(appManager *AppManager) error
type StatusCmdKong ¶ added in v0.260507.1
type StatusCmdKong struct{}
StatusCmdKong is the Kong version of status command
func (*StatusCmdKong) Run ¶ added in v0.260507.1
func (s *StatusCmdKong) Run(appManager *AppManager) error
type StopCmdKong ¶ added in v0.260507.1
type StopCmdKong struct{}
StopCmdKong is the Kong version of stop command
func (*StopCmdKong) Run ¶ added in v0.260507.1
func (s *StopCmdKong) Run(appManager *AppManager) error
type SwaggerCmdKong ¶ added in v0.260507.1
type SwaggerCmdKong struct {
Output string `kong:"flag,name='output',short='o',help='Output file path'"`
Stdout bool `kong:"flag,name='stdout',help='Write to stdout'"`
}
SwaggerCmdKong generates OpenAPI schema
func (*SwaggerCmdKong) Run ¶ added in v0.260507.1
func (s *SwaggerCmdKong) Run(appManager *AppManager) error
type VersionCmdKong ¶ added in v0.260507.1
type VersionCmdKong struct{}
VersionCmdKong is the Kong version of version command
func (*VersionCmdKong) Run ¶ added in v0.260507.1
func (v *VersionCmdKong) Run(appManager *AppManager) error