summaryrefslogtreecommitdiff
path: root/internal/hexaimcp
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-11 20:48:01 +0200
committerPaul Buetow <paul@buetow.org>2026-02-11 20:48:01 +0200
commit8312a19b4e1f9849aae9912433824b19e03a8daf (patch)
tree8ca381d8a6549e94b15a5c65f688a353f0da98ca /internal/hexaimcp
parent97b8887fb3448fd08524111d98425859bec8789f (diff)
refactor: consolidate cache and state into .local/hexai directory
Move all cache and state files under ~/.local/hexai/ with subdirectories: - ~/.local/hexai/cache/ (was ~/.cache/hexai/) - ~/.local/hexai/state/ (was ~/.local/state/hexai/) - ~/.local/hexai/data/ (was ~/.local/share/hexai/) This centralizes all non-config hexai files under a single .local/hexai directory, making it easier to manage and back up user data. Amp-Thread-ID: https://ampcode.com/threads/T-019c4e03-73db-70a2-ae27-3e1cc31d59c3 Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'internal/hexaimcp')
-rw-r--r--internal/hexaimcp/run.go6
-rw-r--r--internal/hexaimcp/run_test.go2
2 files changed, 4 insertions, 4 deletions
diff --git a/internal/hexaimcp/run.go b/internal/hexaimcp/run.go
index 448d826..6b28a2a 100644
--- a/internal/hexaimcp/run.go
+++ b/internal/hexaimcp/run.go
@@ -131,17 +131,17 @@ func getPromptsDir(cfg appconfig.App) (string, error) {
return expandPath(cfgDir)
}
- // Default: $XDG_DATA_HOME/hexai/prompts/ or ~/.local/share/hexai/prompts/
+ // Default: $XDG_DATA_HOME/prompts/ or ~/.local/hexai/data/prompts/
dataDir := os.Getenv("XDG_DATA_HOME")
if dataDir == "" {
home, err := os.UserHomeDir()
if err != nil {
return "", fmt.Errorf("cannot find user home directory: %w", err)
}
- dataDir = filepath.Join(home, ".local", "share")
+ dataDir = filepath.Join(home, ".local", "hexai", "data")
}
- return filepath.Join(dataDir, "hexai", "prompts"), nil
+ return filepath.Join(dataDir, "prompts"), nil
}
// expandPath expands ~ to home directory and returns absolute path.
diff --git a/internal/hexaimcp/run_test.go b/internal/hexaimcp/run_test.go
index 981a05f..2adf678 100644
--- a/internal/hexaimcp/run_test.go
+++ b/internal/hexaimcp/run_test.go
@@ -114,7 +114,7 @@ func TestGetPromptsDir(t *testing.T) {
name: "uses default XDG location",
envVar: "",
cfgValue: "",
- wantMatch: "hexai/prompts",
+ wantMatch: ".local/hexai/data/prompts",
},
}