# `ReqManagedAgents.Artifacts`
[🔗](https://github.com/cash-mckeeman/req_managed_agents/blob/v0.12.0/req_managed_agents/lib/req_managed_agents/artifacts.ex#L1)

One artifacts vocabulary over provider-native session storage: `list/2`,
`fetch/3`, `put/4`, `delete/3` — name-keyed and session-scoped, because a
file's NAME is the only identity the model can ever reference.

A store is `{impl_module, store_term}`; build the store_term with the impl's
constructor:

  * `ReqManagedAgents.Artifacts.ClaudeFiles.store/2` — Anthropic Files API
  * `ReqManagedAgents.Artifacts.AgentCoreSessionStorage.store/4` — AgentCore
    `sessionStorage` mount, command-backed (report-scale artifacts)

Error normalization across impls: a missing name is `{:error, :not_found}`;
when duplicate names exist (re-runs accumulate on CMA), `list/2` returns all
and `fetch`/`delete` act on the newest.

# `store`

```elixir
@type store() :: {module(), term()}
```

# `delete`

```elixir
@callback delete(store_term :: term(), name :: String.t(), opts :: keyword()) ::
  :ok | {:error, term()}
```

# `fetch`

```elixir
@callback fetch(store_term :: term(), name :: String.t(), opts :: keyword()) ::
  {:ok, binary()} | {:error, term()}
```

# `list`

```elixir
@callback list(store_term :: term(), opts :: keyword()) ::
  {:ok, [ReqManagedAgents.Artifact.t()]} | {:error, term()}
```

# `put`

```elixir
@callback put(
  store_term :: term(),
  name :: String.t(),
  contents :: binary(),
  opts :: keyword()
) ::
  :ok | {:error, term()}
```

# `delete`

```elixir
@spec delete(store(), String.t(), keyword()) :: :ok | {:error, term()}
```

# `fetch`

```elixir
@spec fetch(store(), String.t(), keyword()) :: {:ok, binary()} | {:error, term()}
```

# `list`

```elixir
@spec list(
  store(),
  keyword()
) :: {:ok, [ReqManagedAgents.Artifact.t()]} | {:error, term()}
```

# `put`

```elixir
@spec put(store(), String.t(), binary(), keyword()) :: :ok | {:error, term()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
