summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-08 03:34:54 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-08 06:33:02 +0000
commitd69cb36bf27de37c4977f3b25df5cba5ace7d77e (patch)
treee9a6ce7c88be4addf044d74b2f995456e5794819
parentf887a6387946c8fc54f83a1f11a86d6c9d68dc50 (diff)
refactor(storage): update templates to use generic agent config
-rw-r--r--internal/storage/templates.go8
1 files changed, 4 insertions, 4 deletions
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 {