Skip to main content

Module acp_embedded

Module acp_embedded 

Expand description

ACP re-export of shared embedded-resource materialization. Implementation lives in zeroclaw_tools::embedded_resource so MCP and ACP share one helper without zeroclaw-tools depending on this crate.

Structs§

EmbeddedResourceError
Error while decoding or persisting an embedded blob.
MaterializedResource
Result of writing an embedded resource into the session workspace.

Constants§

MAX_EMBEDDED_FILE_BYTES
Per-file decoded size limit for embedded blobs (matches RPC attach / ACP).

Functions§

content_hash_name
Content-addressed identity <sha256> / <sha256>.<ext> derived from raw bytes (the full hex SHA-256 digest). Shared by blob materialization and outbound delivery URIs so both use the same opaque, URI-safe, collision-resistant name — the identity is the full 256-bit digest and depends on content, never on a caller-supplied filename, so distinct content never aliases one name and reserved characters can’t leak.
decode_embedded_blob
Decode a base64 embedded blob and enforce the size cap, WITHOUT writing anything. Lets a caller validate every prompt part up front so an invalid later part cannot leave earlier parts already materialized on disk.
materialize_resource_blob
Decode blob_b64, enforce size limits, write under {workspace}/uploads/, and return a prompt marker ([Document: …] or [IMAGE:…]). Thin base64 front door over materialize_bytes.