feat(memory): add git-backed version control for dream memory files

- Add GitStore class wrapping dulwich for memory file versioning
- Auto-commit memory changes during Dream consolidation
- Add /dream-log and /dream-restore commands for history browsing
- Pass tracked_files as constructor param, generate .gitignore dynamically
This commit is contained in:
chengyongru
2026-04-03 00:32:54 +08:00
committed by chengyongru
parent a9e01bf838
commit f824a629a8
9 changed files with 803 additions and 51 deletions
+11
View File
@@ -454,4 +454,15 @@ def sync_workspace_templates(workspace: Path, silent: bool = False) -> list[str]
from rich.console import Console
for name in added:
Console().print(f" [dim]Created {name}[/dim]")
# Initialize git for memory version control
try:
from nanobot.agent.git_store import GitStore
gs = GitStore(workspace, tracked_files=[
"SOUL.md", "USER.md", "memory/MEMORY.md",
])
gs.init()
except Exception:
logger.warning("Failed to initialize git store for {}", workspace)
return added