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/slashcommands | |
| parent | e3ca5e372ce41c5c916c6d833813299cd8a48afa (diff) | |
mcp: depend on SlashCommandSyncer interface instead of concrete type (task 410)
Diffstat (limited to 'internal/slashcommands')
| -rw-r--r-- | internal/slashcommands/syncer.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/slashcommands/syncer.go b/internal/slashcommands/syncer.go index 91dbf50..8ff9e58 100644 --- a/internal/slashcommands/syncer.go +++ b/internal/slashcommands/syncer.go @@ -79,6 +79,16 @@ func (s *Syncer) Sync(prompt *promptstore.Prompt, op Operation) error { return s.atomicWrite(path, []byte(markdown)) } +// SyncCreate syncs a newly created prompt. +func (s *Syncer) SyncCreate(prompt *promptstore.Prompt) error { + return s.Sync(prompt, OpCreate) +} + +// SyncUpdate syncs an updated prompt. +func (s *Syncer) SyncUpdate(prompt *promptstore.Prompt) error { + return s.Sync(prompt, OpUpdate) +} + // Delete removes hexai-{name}.md file. // Returns nil if file doesn't exist (idempotent). func (s *Syncer) Delete(promptName string) error { |
