ExAgent.MCP.Snapshot (ExAgent v3.0.0)

View Source

Verified declarations for a pinned MCP client.

Stability — Candidate.

Capture a lock with ExAgent.MCP.Client.snapshot/1. Its SHA-256 covers canonical JSON for schema_version, revision, tasks and tools. Object keys are sorted and the order of declarations and schema arrays is preserved. The file adds the lowercase digest as sha256. It contains only the named declaration fields and the negotiated revision and Tasks mode.

Summary

Functions

Decode canonical lock bytes of at most 8 MiB and verify their SHA-256. Duplicate keys, unsupported revisions and inconsistent declarations fail with {:error, :invalid_mcp_snapshot}.

Types

t()

@type t() :: %{required(String.t()) => 1 | String.t() | boolean() | [map()]}

Functions

decode(bytes)

@spec decode(binary()) :: {:ok, t()} | {:error, :invalid_mcp_snapshot}

Decode canonical lock bytes of at most 8 MiB and verify their SHA-256. Duplicate keys, unsupported revisions and inconsistent declarations fail with {:error, :invalid_mcp_snapshot}.