feat(history): add Atuin context scopes

This commit is contained in:
2026-08-14 13:30:10 +03:00
parent 2b82e016b9
commit e897b4a89a
13 changed files with 560 additions and 30 deletions
+18
View File
@@ -30,6 +30,9 @@ func TestDefaultConfigAndState(t *testing.T) {
if !cfg.Core.CobraProbeEnabled {
t.Errorf("expected cobra probing to be enabled by default")
}
if cfg.History.Scope != "global" {
t.Errorf("expected global history scope, got %q", cfg.History.Scope)
}
// test manual provider registration
cfg.AI.Provider = "custom"
@@ -207,6 +210,21 @@ func TestValidateAutoUpdateRange(t *testing.T) {
}
}
func TestValidateHistoryScope(t *testing.T) {
cfg := DefaultConfig()
for _, scope := range []string{"global", "directory", "workspace", "hybrid"} {
cfg.History.Scope = scope
if err := validate(cfg); err != nil {
t.Errorf("expected history scope %q to be valid: %v", scope, err)
}
}
cfg.History.Scope = "session"
if err := validate(cfg); err == nil {
t.Error("expected unsupported history scope to be rejected")
}
}
func TestLoadSave(t *testing.T) {
tmpDir, err := os.MkdirTemp("", "iris-config-test")
if err != nil {