Memory.Project (fnord v0.9.29)

View Source

Project-level memory storage implementation for the Memory behaviour.

Project memory uses the shared file-backed store in Memory.FileStore. This module primarily resolves the current project and derives the runtime storage paths for that shared store.

Summary

Functions

Returns decoded memories for the current project for integration points that need full Memory.t() structs.

Saves a memory into the given project without changing the currently selected project.

Returns the project-scoped memory storage directory, or {:error, ...} when no project is selected. Exposed so callers can build per-memory lock paths without importing the internal store/1 helper.

Functions

list_memories()

@spec list_memories() :: {:ok, [Memory.t()]} | {:error, term()}

Returns decoded memories for the current project for integration points that need full Memory.t() structs.

Use list_memories/0 when callers need decoded memory records. Use list/0 for the title-oriented listing required by the Memory behaviour.

save_into(project, memory)

@spec save_into(Store.Project.t() | binary(), Memory.t()) :: :ok | {:error, term()}

Saves a memory into the given project without changing the currently selected project.

Accepts either a %Store.Project{} struct or a project name binary.

storage_path()

@spec storage_path() :: {:ok, String.t()} | {:error, term()}

Returns the project-scoped memory storage directory, or {:error, ...} when no project is selected. Exposed so callers can build per-memory lock paths without importing the internal store/1 helper.