config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package config loads and validates rocketclaw configuration files.

Index

Constants

View Source
const DefaultGracefulShutdownTimeout = 5 * time.Minute

DefaultGracefulShutdownTimeout is the baseline restart and signal shutdown drain budget.

View Source
const DefaultWebUIListenAddr = "0.0.0.0:8766"

DefaultWebUIListenAddr is the baseline browser voice-mode listener.

View Source
const DefaultWorkDir = ".rocketclaw"

DefaultWorkDir is the generated runtime directory for rocketclaw configs.

Variables

This section is empty.

Functions

func LoadExternalMCPUsers

func LoadExternalMCPUsers(configPath string) (map[string]string, error)

LoadExternalMCPUsers reads the optional rocketclaw.users.json file next to configPath.

Types

type Config

type Config struct {
	Workspace                                string             `json:"workspace"`
	WorkDir                                  string             `json:"-"`
	Overlays                                 []string           `json:"overlays,omitempty"`
	Environment                              []string           `json:"environment,omitempty"`
	EmergencySafeWords                       []string           `json:"emergency_safe_words,omitempty"`
	ThreadAgents                             ThreadAgents       `json:"thread_agents,omitempty"`
	MinimumWaitAfterHumanInteraction         string             `json:"minimum_wait_after_human_interaction"`
	MinimumWaitAfterHumanInteractionDuration time.Duration      `json:"-"`
	GracefulShutdownTimeout                  string             `json:"graceful_shutdown_timeout,omitempty"`
	GracefulShutdownTimeoutDuration          time.Duration      `json:"-"`
	Logging                                  LoggingConfig      `json:"logging"`
	DiscordVoice                             DiscordVoiceConfig `json:"discord_voice"`
	DiscordText                              DiscordTextConfig  `json:"discord_text"`
	MCPExternal                              MCPExternalConfig  `json:"mcp_external"`
	WebUI                                    WebUIConfig        `json:"web_ui"`
	Slack                                    SlackConfig        `json:"slack"`
	OpenAI                                   OpenAIConfig       `json:"openai"`
}

Config is the top-level rocketclaw runtime configuration.

func Load

func Load(configPath string) (*Config, error)

Load reads, normalizes, and validates the rocketclaw configuration file.

func (*Config) Validate

func (c *Config) Validate() error

Validate verifies the configuration is usable for the enabled connectors.

func (*Config) WorkDirName

func (c *Config) WorkDirName() string

WorkDirName returns the selected generated runtime directory name.

type DiscordTextConfig

type DiscordTextConfig struct {
	Enabled     bool   `json:"enabled"`
	Token       string `json:"token"`
	ChannelID   string `json:"channel_id"`
	HumanUserID string `json:"human_user_id"`
}

DiscordTextConfig configures the Discord text connector.

type DiscordVoiceConfig

type DiscordVoiceConfig struct {
	Enabled        bool   `json:"enabled"`
	Token          string `json:"token"`
	VoiceChannelID string `json:"voice_channel_id"`
	HumanUserID    string `json:"human_user_id"`
}

DiscordVoiceConfig configures the Discord voice connector.

type LoggingConfig

type LoggingConfig struct {
	Level string `json:"level"`
}

LoggingConfig controls rocketclaw logging.

type MCPExternalConfig

type MCPExternalConfig struct {
	Enabled       bool     `json:"enabled"`
	ListenAddr    string   `json:"listen_addr"`
	AllowedAgents []string `json:"allowed_agents,omitempty"`
}

MCPExternalConfig configures the persistent external MCP HTTP server.

type OpenAIConfig

type OpenAIConfig struct {
	APIKey         string `json:"api_key"`
	APIBaseURL     string `json:"api_base_url"`
	RocketCodeAuth string `json:"rocketcode_auth"`

	STTModel      string `json:"stt_model"`
	STTPrompt     string `json:"stt_prompt"`
	STTAPIKey     string `json:"stt_key"`
	STTAPIBaseURL string `json:"stt_base_url"`

	TTSModel        string `json:"tts_model"`
	TTSVoice        string `json:"tts_voice"`
	TTSInstructions string `json:"tts_instructions"`
	TTSAPIKey       string `json:"tts_key"`
	TTSAPIBaseURL   string `json:"tts_base_url"`
}

OpenAIConfig configures the OpenAI audio clients.

type SlackConfig

type SlackConfig struct {
	Enabled     bool              `json:"enabled"`
	BotToken    string            `json:"bot_token"`
	AppToken    string            `json:"app_token"`
	Room        string            `json:"room"`
	HumanUserID string            `json:"human_user_id"`
	SocialMode  SlackSocialConfig `json:"social_mode"`
}

SlackConfig configures the Slack DM connector.

type SlackSocialConfig

type SlackSocialConfig struct {
	Enabled         bool              `json:"enabled"`
	ChannelAgents   map[string]string `json:"channel_agents,omitempty"`
	AllowedUserIDs  []string          `json:"allowed_user_ids,omitempty"`
	ContextMessages int               `json:"context_messages"`
}

SlackSocialConfig configures mention-triggered Slack channel threads.

type ThreadAgent

type ThreadAgent struct {
	Agent   string `json:"agent"`
	PreSeed bool   `json:"pre_seed"`
}

ThreadAgent configures one Slack emoji prefix thread target.

type ThreadAgents

type ThreadAgents map[string]ThreadAgent

ThreadAgents maps Slack emoji prefixes to thread routing config.

type WebUIConfig

type WebUIConfig struct {
	Enabled    bool   `json:"enabled"`
	ListenAddr string `json:"listen_addr"`
	CertFile   string `json:"cert_file"`
	KeyFile    string `json:"key_file"`
}

WebUIConfig configures the browser voice-mode listener.

Jump to

Keyboard shortcuts

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