feat: store PicoClaw memory in SQLite

Store session history, preferences, and dated records in one database per home.
Commit complete turns, checkpoint tool batches, and compact history by prefix.
Add memory search and writes, with previews for ambiguous corrections.
Review conversations in the background and support SQLite backup and restore.
This commit is contained in:
loveuer committed 2026-11-25 11:36:10 +08:00
1 parent cd4a95934a
commit b8b11d452f
112 files changed
+8117 -6310

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
package agent
import (
"crypto/sha256"
"fmt"
"os"
"path/filepath"
"testing"
)
func TestMain(m *testing.M) {
// Tests can construct independent agents in one process with reused keys.
dir, err := os.MkdirTemp("", "picoclaw-agent-db-tests-")
if err != nil {
panic(err)
}
memoryDatabasePath = func(workspace string) string {
return filepath.Join(dir, fmt.Sprintf("%x", sha256.Sum256([]byte(workspace))), "memory.sqlite3")
}
code := m.Run()
_ = os.RemoveAll(dir)
os.Exit(code)
}