Self-hosted workflows for coding-agent delivery. Orchestrate CodeBuddy, Codex and Claude Code with scripts and human approval gates. Includes Local workflows for coding assistants.
JavaScript agent-orchestrationagentic-workflowai-agentsai-codingclaude-codecode-reviewcodebuddycodexcoding-agentscursordeveloper-toolshuman-on-the-loopllmmcpmulti-agentsdlcself-hostedsopworkflow-automationworkflow-engine
package repo
import (
"errors"
"strings"
"time"
"agentflow/internal/domain"
)
// AssistantPreferences returns the user's Main Bot settings; the zero value
// when they never saved any.
func (r *AssistantRepo) AssistantPreferences(userID int64) domain.AssistantPreferences {
var out domain.AssistantPreferences
if userID <= 0 {
return out
}
var row assistantPreferenceRow
if err := r.DB.Where("user_id = ?", userID).Take(&row).Error; err != nil {
return out
}
out.ProactiveRoles, out.ProactiveSOPs, out.Instructions = row.ProactiveRoles, row.ProactiveSOPs, row.Instructions
out.SteerOnSend = row.SteerOnSend
if row.UpdatedAt != nil {
out.UpdatedAt = *row.UpdatedAt
}
return out
}
// PutAssistantPreferences replaces the user's Main Bot settings.
func (r *AssistantRepo) PutAssistantPreferences(userID int64, p domain.AssistantPreferences) (domain.AssistantPreferences, error) {
if userID <= 0 {
return p, errors.New("user id is required")
}
now := time.Now().UTC()
row := assistantPreferenceRow{UserID: userID, ProactiveRoles: p.ProactiveRoles, ProactiveSOPs: p.ProactiveSOPs, SteerOnSend: p.SteerOnSend, Instructions: strings.TrimSpace(p.Instructions), UpdatedAt: &now}
if err := r.DB.Save(&row).Error; err != nil {
return p, err
}
return r.AssistantPreferences(userID), nil
}