summaryrefslogtreecommitdiff
path: root/internal/appconfig/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/appconfig/config.go')
-rw-r--r--internal/appconfig/config.go33
1 files changed, 31 insertions, 2 deletions
diff --git a/internal/appconfig/config.go b/internal/appconfig/config.go
index 8ae9597..490ed4e 100644
--- a/internal/appconfig/config.go
+++ b/internal/appconfig/config.go
@@ -126,7 +126,9 @@ type App struct {
TmuxEditAgents []TmuxEditAgentCfg `json:"-" toml:"-"`
// MCP: Model Context Protocol server settings
- MCPPromptsDir string `json:"-" toml:"-"` // Directory for prompt storage
+ MCPPromptsDir string `json:"-" toml:"-"` // Directory for prompt storage
+ MCPSlashCommandSync bool `json:"-" toml:"-"` // Enable slash command sync
+ MCPSlashCommandDir string `json:"-" toml:"-"` // Directory for slash command files
}
// CustomAction describes a user-defined code action.
@@ -383,7 +385,9 @@ type sectionTmuxEditAgent struct {
// sectionMCP configures the MCP server settings.
type sectionMCP struct {
- PromptsDir string `toml:"prompts_dir"`
+ PromptsDir string `toml:"prompts_dir"`
+ SlashCommandSync bool `toml:"slashcommand_sync"`
+ SlashCommandDir string `toml:"slashcommand_dir"`
}
type sectionOpenAI struct {
@@ -719,6 +723,12 @@ func (fc *fileConfig) toApp() App {
if strings.TrimSpace(fc.MCP.PromptsDir) != "" {
out.MCPPromptsDir = strings.TrimSpace(fc.MCP.PromptsDir)
}
+ if fc.MCP.SlashCommandSync {
+ out.MCPSlashCommandSync = fc.MCP.SlashCommandSync
+ }
+ if strings.TrimSpace(fc.MCP.SlashCommandDir) != "" {
+ out.MCPSlashCommandDir = strings.TrimSpace(fc.MCP.SlashCommandDir)
+ }
return out
}
@@ -1058,6 +1068,16 @@ func (a *App) mergeBasics(other *App) {
if other.IgnoreLSPNotify != nil {
a.IgnoreLSPNotify = other.IgnoreLSPNotify
}
+ // MCP settings
+ if s := strings.TrimSpace(other.MCPPromptsDir); s != "" {
+ a.MCPPromptsDir = s
+ }
+ if other.MCPSlashCommandSync {
+ a.MCPSlashCommandSync = other.MCPSlashCommandSync
+ }
+ if s := strings.TrimSpace(other.MCPSlashCommandDir); s != "" {
+ a.MCPSlashCommandDir = s
+ }
}
// mergeSurfaceModels copies per-surface model and temperature overrides.
@@ -1599,6 +1619,15 @@ func loadFromEnv(logger *log.Logger) *App {
out.MCPPromptsDir = s
any = true
}
+ if s := getenv("HEXAI_MCP_SLASHCOMMAND_SYNC"); s != "" {
+ b := s == "true" || s == "1"
+ out.MCPSlashCommandSync = b
+ any = true
+ }
+ if s := getenv("HEXAI_MCP_SLASHCOMMAND_DIR"); s != "" {
+ out.MCPSlashCommandDir = s
+ any = true
+ }
if !any {
return nil