summaryrefslogtreecommitdiff
path: root/internal/hexaimcp
diff options
context:
space:
mode:
Diffstat (limited to 'internal/hexaimcp')
-rw-r--r--internal/hexaimcp/run.go2
-rw-r--r--internal/hexaimcp/run_test.go18
2 files changed, 10 insertions, 10 deletions
diff --git a/internal/hexaimcp/run.go b/internal/hexaimcp/run.go
index 7c487c3..7043ed2 100644
--- a/internal/hexaimcp/run.go
+++ b/internal/hexaimcp/run.go
@@ -205,7 +205,7 @@ func expandPath(path string) (string, error) {
// createSyncer creates a slash command syncer from config.
// Returns nil syncer if sync is disabled.
func createSyncer(cfg appconfig.App, logger *log.Logger) (*slashcommands.Syncer, error) {
- syncer, err := slashcommands.NewSyncer(cfg)
+ syncer, err := slashcommands.NewSyncer(cfg.MCPSection())
if err != nil {
return nil, err
}
diff --git a/internal/hexaimcp/run_test.go b/internal/hexaimcp/run_test.go
index 09f4f87..d567f2e 100644
--- a/internal/hexaimcp/run_test.go
+++ b/internal/hexaimcp/run_test.go
@@ -113,7 +113,7 @@ func TestGetPromptsDir(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
cfg := appconfig.App{
- FeatureConfig: appconfig.FeatureConfig{MCPPromptsDir: tt.cfgValue},
+ FeatureConfig: appconfig.FeatureConfig{MCPConfig: appconfig.MCPConfig{MCPPromptsDir: tt.cfgValue}},
}
result, err := getPromptsDir(cfg)
@@ -425,7 +425,7 @@ func TestGetPromptsDir_XDGDataHome(t *testing.T) {
// TestGetPromptsDir_TildeInConfig verifies tilde expansion for config path.
func TestGetPromptsDir_TildeInConfig(t *testing.T) {
cfg := appconfig.App{
- FeatureConfig: appconfig.FeatureConfig{MCPPromptsDir: "~/my-prompts"},
+ FeatureConfig: appconfig.FeatureConfig{MCPConfig: appconfig.MCPConfig{MCPPromptsDir: "~/my-prompts"}},
}
result, err := getPromptsDir(cfg)
@@ -450,7 +450,7 @@ func TestGetPromptsDir_TildeInConfig(t *testing.T) {
func TestCreateSyncer_Disabled(t *testing.T) {
logger := log.New(io.Discard, "", 0)
cfg := appconfig.App{
- FeatureConfig: appconfig.FeatureConfig{MCPSlashCommandSync: false},
+ FeatureConfig: appconfig.FeatureConfig{MCPConfig: appconfig.MCPConfig{MCPSlashCommandSync: false}},
}
syncer, err := createSyncer(cfg, logger)
@@ -468,10 +468,10 @@ func TestCreateSyncer_Enabled(t *testing.T) {
tmpDir := t.TempDir()
logger := log.New(io.Discard, "", 0)
cfg := appconfig.App{
- FeatureConfig: appconfig.FeatureConfig{
+ FeatureConfig: appconfig.FeatureConfig{MCPConfig: appconfig.MCPConfig{
MCPSlashCommandSync: true,
MCPSlashCommandDir: tmpDir,
- },
+ }},
}
syncer, err := createSyncer(cfg, logger)
@@ -488,10 +488,10 @@ func TestCreateSyncer_Enabled(t *testing.T) {
func TestCreateSyncer_Error(t *testing.T) {
logger := log.New(io.Discard, "", 0)
cfg := appconfig.App{
- FeatureConfig: appconfig.FeatureConfig{
+ FeatureConfig: appconfig.FeatureConfig{MCPConfig: appconfig.MCPConfig{
MCPSlashCommandSync: true,
MCPSlashCommandDir: "",
- },
+ }},
}
_, err := createSyncer(cfg, logger)
@@ -651,11 +651,11 @@ func TestApplyOverrides(t *testing.T) {
t.Run("does not overwrite with zero values", func(t *testing.T) {
cfg := appconfig.App{
- FeatureConfig: appconfig.FeatureConfig{
+ FeatureConfig: appconfig.FeatureConfig{MCPConfig: appconfig.MCPConfig{
MCPPromptsDir: "/existing/prompts",
MCPSlashCommandSync: true,
MCPSlashCommandDir: "/existing/cmds",
- },
+ }},
}
overrides := MCPOverrides{} // all zero values
applyOverrides(&cfg, overrides)