From d69cb36bf27de37c4977f3b25df5cba5ace7d77e Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sun, 8 Mar 2026 03:34:54 +0000 Subject: refactor(storage): update templates to use generic agent config --- internal/storage/templates.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/storage') diff --git a/internal/storage/templates.go b/internal/storage/templates.go index 350b4f8..57abaa4 100644 --- a/internal/storage/templates.go +++ b/internal/storage/templates.go @@ -18,7 +18,7 @@ type Template struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` - Claude task.ClaudeConfig `json:"claude"` + Agent task.AgentConfig `json:"agent"` Timeout string `json:"timeout"` Priority string `json:"priority"` Tags []string `json:"tags"` @@ -28,7 +28,7 @@ type Template struct { // CreateTemplate inserts a new template. func (s *DB) CreateTemplate(tmpl *Template) error { - configJSON, err := json.Marshal(tmpl.Claude) + configJSON, err := json.Marshal(tmpl.Agent) if err != nil { return fmt.Errorf("marshaling config: %w", err) } @@ -73,7 +73,7 @@ func (s *DB) ListTemplates() ([]*Template, error) { // UpdateTemplate fully replaces a template's fields. Returns ErrTemplateNotFound if the ID is missing. func (s *DB) UpdateTemplate(tmpl *Template) error { - configJSON, err := json.Marshal(tmpl.Claude) + configJSON, err := json.Marshal(tmpl.Agent) if err != nil { return fmt.Errorf("marshaling config: %w", err) } @@ -130,7 +130,7 @@ func scanTemplate(row scanner) (*Template, error) { } return nil, err } - if err := json.Unmarshal([]byte(configJSON), &tmpl.Claude); err != nil { + if err := json.Unmarshal([]byte(configJSON), &tmpl.Agent); err != nil { return nil, fmt.Errorf("unmarshaling config: %w", err) } if err := json.Unmarshal([]byte(tagsJSON), &tmpl.Tags); err != nil { -- cgit v1.2.3