Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitBackend ¶
type GitBackend struct {
// contains filtered or unexported fields
}
GitBackend syncs the memory directory with a git remote through the git CLI, so auth uses the user's own git and ssh config. Git never prompts and every command has a timeout, so a bad remote fails instead of hanging. Operations are best-effort: callers log the error and never abort the agent run.
func NewGitBackend ¶
func NewGitBackend(cfg *config.Config) *GitBackend
NewGitBackend constructs a git-backed memory sync. It warns once if the repo URL embeds credentials (they persist in .git/config) - ssh or a credential helper is preferred.
type LocalBackend ¶
type LocalBackend struct{}
LocalBackend is the default no-op memory backend. Memory lives only on the local disk, so there is nothing to sync in or out.
func NewLocalBackend ¶
func NewLocalBackend() *LocalBackend
NewLocalBackend returns the no-op backend.
type MemoryBackend ¶
type MemoryBackend interface {
SyncIn(ctx context.Context) error
SyncOut(ctx context.Context) error
}
MemoryBackend syncs the persistent memory directory with a remote. The local backend is a no-op. The git backend pulls on run start and commits + pushes when a fact changes. Both directions are best-effort: an error is returned for tests/telemetry but callers log and continue - a sync failure never aborts the agent run. SyncIn is idempotent and runs at most once per process.
func NewMemoryBackend ¶
func NewMemoryBackend(cfg *config.Config) MemoryBackend
NewMemoryBackend selects a memory backend from config, like storage.NewStorage. It returns the git backend only when memory is enabled with a git backend and a repo, and the local no-op backend otherwise. config.Validate already rejects a git backend without a repo, so this guard only keeps legacy configs safe.