Agentic.AgentFS.Overlay (agentic v0.3.0)

Copy Markdown

Manages temporary overlay directories for agent filesystem materialization.

Creates a temp directory, writes skills and memories into it, and provides paths for bind-mounting into the agent sandbox.

Summary

Functions

Create a new overlay directory for a session.

Read back memory content modified by the agent.

Read back skills that were created or modified by the agent.

Write memory content into the overlay directory.

Write skills into the overlay directory.

Functions

create()

@spec create() :: {String.t(), (-> :ok)}

Create a new overlay directory for a session.

Returns {overlay_path, cleanup_fn} where cleanup_fn is a 0-arity function that deletes the overlay directory.

read_memory(overlay_path)

@spec read_memory(String.t()) :: String.t()

Read back memory content modified by the agent.

read_skills(overlay_path, original_names)

@spec read_skills(String.t(), [String.t()]) :: [map()]

Read back skills that were created or modified by the agent.

Returns list of %{name: ..., content: ..., is_new: bool}.

write_memory(overlay_path, content)

@spec write_memory(String.t(), String.t()) :: :ok

Write memory content into the overlay directory.

Memory is written as memory/MEMORY.md.

write_skills(overlay_path, skills)

@spec write_skills(String.t(), [map()]) :: :ok

Write skills into the overlay directory.

Skills are written as skills/<name>/SKILL.md.