diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-02 14:17:57 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-02 14:17:57 +0200 |
| commit | 0928e675046fa5b4d4f2b030e7054cf91e864c41 (patch) | |
| tree | 9f207876442ef3c0c7cf9517aa6072532f645ff8 /internal/hexaimcp | |
| parent | e3ca5e372ce41c5c916c6d833813299cd8a48afa (diff) | |
mcp: depend on SlashCommandSyncer interface instead of concrete type (task 410)
Diffstat (limited to 'internal/hexaimcp')
| -rw-r--r-- | internal/hexaimcp/run.go | 4 | ||||
| -rw-r--r-- | internal/hexaimcp/run_test.go | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/internal/hexaimcp/run.go b/internal/hexaimcp/run.go index 23faa08..b6fed8c 100644 --- a/internal/hexaimcp/run.go +++ b/internal/hexaimcp/run.go @@ -26,11 +26,11 @@ type ServerFactory func( w io.Writer, logger *log.Logger, store promptstore.PromptStore, - syncer *slashcommands.Syncer, + syncer mcp.SlashCommandSyncer, ) ServerRunner // defaultServerFactory is the production server factory. -func defaultServerFactory(r io.Reader, w io.Writer, logger *log.Logger, store promptstore.PromptStore, syncer *slashcommands.Syncer) ServerRunner { +func defaultServerFactory(r io.Reader, w io.Writer, logger *log.Logger, store promptstore.PromptStore, syncer mcp.SlashCommandSyncer) ServerRunner { return mcp.NewServer(r, w, logger, store, syncer) } diff --git a/internal/hexaimcp/run_test.go b/internal/hexaimcp/run_test.go index 794fa1f..3c3f9d8 100644 --- a/internal/hexaimcp/run_test.go +++ b/internal/hexaimcp/run_test.go @@ -15,7 +15,6 @@ import ( "codeberg.org/snonux/hexai/internal/appconfig" "codeberg.org/snonux/hexai/internal/mcp" "codeberg.org/snonux/hexai/internal/promptstore" - "codeberg.org/snonux/hexai/internal/slashcommands" ) // mockServerRunner implements ServerRunner for testing @@ -35,7 +34,7 @@ func TestFullProtocolFlow(t *testing.T) { tmpDir := t.TempDir() // Create test server factory - serverFactory := func(r io.Reader, w io.Writer, logger *log.Logger, store promptstore.PromptStore, syncer *slashcommands.Syncer) ServerRunner { + serverFactory := func(r io.Reader, w io.Writer, logger *log.Logger, store promptstore.PromptStore, syncer mcp.SlashCommandSyncer) ServerRunner { return mcp.NewServer(r, w, logger, store, syncer) } @@ -283,7 +282,7 @@ func TestRun(t *testing.T) { logPath := filepath.Join(tmpDir, "test.log") // Create a mock server factory that returns immediately - mockFactory := func(r io.Reader, w io.Writer, logger *log.Logger, store promptstore.PromptStore, syncer *slashcommands.Syncer) ServerRunner { + mockFactory := func(r io.Reader, w io.Writer, logger *log.Logger, store promptstore.PromptStore, syncer mcp.SlashCommandSyncer) ServerRunner { return &mockServerRunner{ runFunc: func() error { return nil // Exit immediately @@ -316,7 +315,7 @@ func TestRunWithFactory_ServerError(t *testing.T) { logPath := filepath.Join(tmpDir, "test.log") // Create a mock server factory that returns an error - mockFactory := func(r io.Reader, w io.Writer, logger *log.Logger, store promptstore.PromptStore, syncer *slashcommands.Syncer) ServerRunner { + mockFactory := func(r io.Reader, w io.Writer, logger *log.Logger, store promptstore.PromptStore, syncer mcp.SlashCommandSyncer) ServerRunner { return &mockServerRunner{ runFunc: func() error { return fmt.Errorf("mock server error") |
