Skip to content

API Reference parrot.squawk.blobs.store

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.squawk.blobs.store

View source

Content-addressed byte-object store with owner/grant ACL, TTL and dedup (FEAT-746 M5).

Class BlobMeta

Describe an immutable content-addressed blob and its access policy.

Fields:

Field Type Default Description
key str
media_type MediaType
byte_size int
created_at datetime
expires_at datetime
owner HandleOwner
grants tuple[str, ...] ()
encrypted bool False
data_class str 'internal'

Alias HandleClaimError

Re-exported from parrot.interagent.HandleClaimError.

Alias HandleOwner

Re-exported from parrot.interagent.HandleOwner.

Alias MediaType

Re-exported from parrot.interagent.MediaType.

Class SquawkBlobStore

Define content-addressed blob storage with shared ACL and TTL semantics.

Method SquawkBlobStore.put_stream

Hash while writing and publish only after digest verification.

put_stream(frames: AsyncIterator[bytes], *, media_type: MediaType, owner: HandleOwner, ttl_s: int, expected_digest: str | None = None, data_class: str = 'internal') -> BlobMeta

Parameter Type Default Description
frames AsyncIterator[bytes]
media_type MediaType
owner HandleOwner
ttl_s int
expected_digest str | None None
data_class str 'internal'

Returns: BlobMeta

Method SquawkBlobStore.has

Return whether an unexpired record exists (for owner when given).

has(key: str, *, owner: HandleOwner | None = None) -> bool

Parameter Type Default Description
key str
owner HandleOwner | None None

Returns: bool

Method SquawkBlobStore.meta

Return owner's record for a key, or any unexpired record when owner is None.

meta(key: str, *, owner: HandleOwner | None = None) -> BlobMeta | None

Parameter Type Default Description
key str
owner HandleOwner | None None

Returns: BlobMeta | None

Method SquawkBlobStore.open_read

Authorize access and yield chunks of the requested plaintext range.

open_read(key: str, *, owner: HandleOwner, grantee: str | None = None, offset: int = 0, length: int | None = None) -> AsyncIterator[bytes]

Parameter Type Default Description
key str
owner HandleOwner
grantee str | None None
offset int 0
length int | None None

Returns: AsyncIterator[bytes]

Method SquawkBlobStore.grant

Grant an agent access when requested by the blob owner.

grant(key: str, *, owner: HandleOwner, grantee: str) -> BlobMeta

Parameter Type Default Description
key str
owner HandleOwner
grantee str

Returns: BlobMeta

Method SquawkBlobStore.delete

Delete the caller's own record for a blob.

delete(key: str, *, owner: HandleOwner) -> bool

Parameter Type Default Description
key str
owner HandleOwner

Returns: bool

Method SquawkBlobStore.sweep

Delete expired objects and return the count.

sweep(now: datetime | None = None) -> int

Parameter Type Default Description
now datetime | None None

Returns: int

Function owner_slug

Return the stable storage namespace for one owner tuple.

Blob keys are content addresses, so identical bytes from two owners share a key. Each owner keeps its own record (TTL, grants, data class, encryption) under <key>/<owner_slug> so no owner can read, extend or replace another's.

owner_slug(owner: HandleOwner) -> str

Parameter Type Default Description
owner HandleOwner Full owner tuple.

Returns: str — A 32-hex-character digest of the owner tuple.

Function select_record

Pick the record a caller may read: its own, else one that granted grantee.

select_record(records: Iterable[BlobMeta], owner: HandleOwner, grantee: str | None, *, now: datetime | None = None) -> BlobMeta

Parameter Type Default Description
records Iterable[BlobMeta] Every owner record stored for one key.
owner HandleOwner Full owner tuple asserted by the caller.
grantee str | None Agent identity used for explicit grant access.
now datetime | None None Optional current time for deterministic checks.

Returns: BlobMeta — The authorized, unexpired record.

Raises:

  • HandleClaimError — If no record authorizes the caller.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally