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§
- Embedded
Resource Error - Error while decoding or persisting an embedded blob.
- Materialized
Resource - 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 overmaterialize_bytes.