Documentation
¶
Overview ¶
Package config manages application configuration from various sources.
Index ¶
- Constants
- func AgencyEnabled(cfg *Config) bool
- func LoadGitHubToken() (string, error)
- func MarkProjectInitialized() error
- func ShouldShowInitDialog() (bool, error)
- func TeamHUDEnabled(cfg *Config) bool
- func UpdateAgencyConstitution(name string) error
- func UpdateAgentModel(agentName AgentName, modelID models.ModelID) error
- func UpdateTheme(themeName string) error
- func Validate() error
- func ValidateAgencyConfig(cfg AgencyConfig) error
- func WorkingDirectory() string
- type AgencyConfig
- type AgencyConstitution
- type AgencyConstitutionPolicies
- type Agent
- type AgentName
- type Config
- type Data
- type DockerRuntimeConfig
- type GenesisRuntimeConfig
- type LSPConfig
- type LedgerRuntimeConfig
- type MCPServer
- type MCPType
- type OfficeRuntimeConfig
- type ProjectInitFlag
- type Provider
- type RedisRuntimeConfig
- type ScheduleDefaultsConfig
- type ScheduleWindow
- type ShellConfig
- type TUIConfig
- type TeamConfig
- type TeamPolicies
- type TeamRoleTemplate
- type TeamTemplate
- type VoiceEngineConfig
- type VoiceProjectionConfig
- type VoiceRuntimeConfig
Constants ¶
const (
// InitFlagFilename is the name of the file that indicates whether the project has been initialized
InitFlagFilename = "init"
)
const (
MaxTokensFallbackDefault = 4096
)
Application constants
Variables ¶
This section is empty.
Functions ¶
func AgencyEnabled ¶
func LoadGitHubToken ¶
Tries to load Github token from all possible locations
func MarkProjectInitialized ¶
func MarkProjectInitialized() error
MarkProjectInitialized marks the current project as initialized
func ShouldShowInitDialog ¶
ShouldShowInitDialog checks if the initialization dialog should be shown for the current directory
func TeamHUDEnabled ¶
func UpdateTheme ¶
UpdateTheme updates the theme in the configuration and writes it to the config file.
func Validate ¶
func Validate() error
Validate checks if the configuration is valid and applies defaults where needed.
func ValidateAgencyConfig ¶
func ValidateAgencyConfig(cfg AgencyConfig) error
func WorkingDirectory ¶
func WorkingDirectory() string
WorkingDirectory returns the current working directory from the configuration.
Types ¶
type AgencyConfig ¶
type AgencyConfig struct {
Enabled *bool `json:"enabled,omitempty"`
ProductName string `json:"productName,omitempty"`
CurrentConstitution string `json:"currentConstitution,omitempty"`
SoloConstitution string `json:"soloConstitution,omitempty"`
Office OfficeRuntimeConfig `json:"office,omitempty"`
Docker DockerRuntimeConfig `json:"docker,omitempty"`
Redis RedisRuntimeConfig `json:"redis,omitempty"`
Ledger LedgerRuntimeConfig `json:"ledger,omitempty"`
Voice VoiceRuntimeConfig `json:"voice,omitempty"`
Schedules ScheduleDefaultsConfig `json:"schedules,omitempty"`
Genesis GenesisRuntimeConfig `json:"genesis,omitempty"`
Constitutions map[string]AgencyConstitution `json:"constitutions,omitempty"`
}
func DefaultAgencyConfig ¶
func DefaultAgencyConfig(teamCfg TeamConfig, dataDir string) AgencyConfig
type AgencyConstitution ¶
type AgencyConstitution struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Blueprint string `json:"blueprint,omitempty"`
TeamTemplate string `json:"teamTemplate,omitempty"`
Governance string `json:"governance,omitempty"`
RuntimeMode string `json:"runtimeMode,omitempty"`
EntryMode string `json:"entryMode,omitempty"`
DefaultSchedule string `json:"defaultSchedule,omitempty"`
Policies AgencyConstitutionPolicies `json:"policies,omitempty"`
}
func ActiveConstitution ¶
func ActiveConstitution(cfg *Config) AgencyConstitution
type Agent ¶
type Agent struct {
Model models.ModelID `json:"model"`
MaxTokens int64 `json:"maxTokens"`
ReasoningEffort string `json:"reasoningEffort"` // For openai models low,medium,heigh
}
Agent defines configuration for different LLM models and their token limits.
type Config ¶
type Config struct {
Data Data `json:"data"`
WorkingDir string `json:"wd,omitempty"`
MCPServers map[string]MCPServer `json:"mcpServers,omitempty"`
Providers map[models.ModelProvider]Provider `json:"providers,omitempty"`
LSP map[string]LSPConfig `json:"lsp,omitempty"`
Agents map[AgentName]Agent `json:"agents,omitempty"`
Team TeamConfig `json:"team,omitempty"`
Agency AgencyConfig `json:"agency,omitempty"`
Debug bool `json:"debug,omitempty"`
DebugLSP bool `json:"debugLSP,omitempty"`
ContextPaths []string `json:"contextPaths,omitempty"`
TUI TUIConfig `json:"tui"`
Shell ShellConfig `json:"shell,omitempty"`
AutoCompact bool `json:"autoCompact,omitempty"`
}
Config is the main configuration structure for the application.
type Data ¶
type Data struct {
Directory string `json:"directory,omitempty"`
}
Data defines storage configuration.
type DockerRuntimeConfig ¶
type GenesisRuntimeConfig ¶
type GenesisRuntimeConfig struct {
ConversationDriven *bool `json:"conversationDriven,omitempty"`
AutoResearch *bool `json:"autoResearch,omitempty"`
AutoSkills *bool `json:"autoSkills,omitempty"`
AutoToolBinding *bool `json:"autoToolBinding,omitempty"`
SequentialSpawn *bool `json:"sequentialSpawn,omitempty"`
DefaultTopology string `json:"defaultTopology,omitempty"`
}
type LSPConfig ¶
type LSPConfig struct {
Disabled bool `json:"enabled"`
Command string `json:"command"`
Args []string `json:"args"`
Options any `json:"options"`
}
LSPConfig defines configuration for Language Server Protocol integration.
type LedgerRuntimeConfig ¶
type LedgerRuntimeConfig struct {
Backend string `json:"backend,omitempty"`
Path string `json:"path,omitempty"`
SnapshotPath string `json:"snapshotPath,omitempty"`
ConsensusMode string `json:"consensusMode,omitempty"`
DefaultQuorum int `json:"defaultQuorum,omitempty"`
ProjectionFile string `json:"projectionFile,omitempty"`
}
type MCPServer ¶
type MCPServer struct {
Command string `json:"command"`
Env []string `json:"env"`
Args []string `json:"args"`
Type MCPType `json:"type"`
URL string `json:"url"`
Headers map[string]string `json:"headers"`
}
MCPServer defines the configuration for a Model Control Protocol server.
type OfficeRuntimeConfig ¶
type OfficeRuntimeConfig struct {
Enabled *bool `json:"enabled,omitempty"`
Mode string `json:"mode,omitempty"`
AutoBoot *bool `json:"autoBoot,omitempty"`
StateFile string `json:"stateFile,omitempty"`
DefaultWorkspaceMode string `json:"defaultWorkspaceMode,omitempty"`
AllowSoloFallback *bool `json:"allowSoloFallback,omitempty"`
}
type ProjectInitFlag ¶
type ProjectInitFlag struct {
Initialized bool `json:"initialized"`
}
ProjectInitFlag represents the initialization status for a project directory
type RedisRuntimeConfig ¶
type ScheduleDefaultsConfig ¶
type ScheduleDefaultsConfig struct {
Timezone string `json:"timezone,omitempty"`
DefaultCadence string `json:"defaultCadence,omitempty"`
WakeOnOfficeOpen *bool `json:"wakeOnOfficeOpen,omitempty"`
RequireShiftHandoff *bool `json:"requireShiftHandoff,omitempty"`
Windows []ScheduleWindow `json:"windows,omitempty"`
}
type ScheduleWindow ¶
type ShellConfig ¶
type ShellConfig struct {
Path string `json:"path,omitempty"`
Args []string `json:"args,omitempty"`
}
ShellConfig defines the configuration for the shell used by the bash tool.
type TUIConfig ¶
type TUIConfig struct {
Theme string `json:"theme,omitempty"`
}
TUIConfig defines the configuration for the Terminal User Interface.
type TeamConfig ¶
type TeamConfig struct {
ActiveTeam string `json:"activeTeam,omitempty"`
DefaultTemplate string `json:"defaultTemplate,omitempty"`
DefaultBlueprint string `json:"defaultBlueprint,omitempty"`
CollaborationHUD *bool `json:"collaborationHud,omitempty"`
Templates map[string]TeamTemplate `json:"templates,omitempty"`
Blueprints map[string]TeamTemplate `json:"blueprints,omitempty"`
}
func DefaultTeamConfig ¶
func DefaultTeamConfig() TeamConfig
type TeamPolicies ¶
type TeamPolicies struct {
CommitMessageFormat string `json:"commitMessageFormat,omitempty"`
MaxWIP *int `json:"maxWip,omitempty"`
HandoffRequires []string `json:"handoffRequires,omitempty"`
ReviewRequired *bool `json:"reviewRequired,omitempty"`
AllowsSubagents *bool `json:"allowsSubagents,omitempty"`
DelegationMode string `json:"delegationMode,omitempty"`
LocalChatDefault string `json:"localChatDefault,omitempty"`
ReviewRouting string `json:"reviewRouting,omitempty"`
SynthesisRouting string `json:"synthesisRouting,omitempty"`
AllowsPeerMessaging *bool `json:"allowsPeerMessaging,omitempty"`
AllowsBroadcasts *bool `json:"allowsBroadcasts,omitempty"`
WorkspaceModeDefault string `json:"workspaceModeDefault,omitempty"`
LoopStrategy string `json:"loopStrategy,omitempty"`
ConcurrencyBudget *int `json:"concurrencyBudget,omitempty"`
RequiredGates []string `json:"requiredGates,omitempty"`
}
type TeamRoleTemplate ¶
type TeamRoleTemplate struct {
Name string `json:"name"`
Responsible string `json:"responsible,omitempty"`
CurrentFocus string `json:"currentFocus,omitempty"`
Profile string `json:"profile,omitempty"`
Prompt string `json:"prompt,omitempty"`
ReportsTo string `json:"reportsTo,omitempty"`
CanSpawnSubagents *bool `json:"canSpawnSubagents,omitempty"`
}
type TeamTemplate ¶
type TeamTemplate struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Category string `json:"category,omitempty"`
Orientation string `json:"orientation,omitempty"`
LeadershipMode string `json:"leadershipMode,omitempty"`
SpawnTeammates *bool `json:"spawnTeammates,omitempty"`
Roles []TeamRoleTemplate `json:"roles,omitempty"`
Policies TeamPolicies `json:"policies,omitempty"`
}
type VoiceEngineConfig ¶
type VoiceEngineConfig struct {
Enabled *bool `json:"enabled,omitempty"`
Command string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
InputMode string `json:"inputMode,omitempty"`
OutputMode string `json:"outputMode,omitempty"`
Language string `json:"language,omitempty"`
Voice string `json:"voice,omitempty"`
AudioFormat string `json:"audioFormat,omitempty"`
Timeout string `json:"timeout,omitempty"`
}
type VoiceProjectionConfig ¶
type VoiceProjectionConfig struct {
DefaultRoom string `json:"defaultRoom,omitempty"`
TranscriptProjection *bool `json:"transcriptProjection,omitempty"`
AudioProjection *bool `json:"audioProjection,omitempty"`
AutoProjectTranscript *bool `json:"autoProjectTranscript,omitempty"`
AutoProjectSynthesis *bool `json:"autoProjectSynthesis,omitempty"`
}
type VoiceRuntimeConfig ¶
type VoiceRuntimeConfig struct {
Enabled *bool `json:"enabled,omitempty"`
Provider string `json:"provider,omitempty"`
GatewayState string `json:"gatewayState,omitempty"`
AssetDir string `json:"assetDir,omitempty"`
ControlChannel string `json:"controlChannel,omitempty"`
SynthesisChannel string `json:"synthesisChannel,omitempty"`
MeetingTranscriptDir string `json:"meetingTranscriptDir,omitempty"`
Projection VoiceProjectionConfig `json:"projection,omitempty"`
STT VoiceEngineConfig `json:"stt,omitempty"`
TTS VoiceEngineConfig `json:"tts,omitempty"`
}