Skip to content

API Reference parrot.squawk.contract.cache

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

parrot.squawk.contract.cache

View source

Client-side contract cache: answers catalog_* without a round trip; applies handshake deltas.

Alias CapabilityCategory

Re-exported from parrot.interagent.CapabilityCategory.

Class ContractCache

In-memory client-side contract cache.

Attributes:

Attribute Type Description
known_hashes dict[str, str] Return {category: hash} to send as known_hashes in the handshake.

Method ContractCache.apply

Apply a handshake delta: upsert changed categories, drop removed ones.

apply(delta: ContractDelta) -> None

Parameter Type Default Description
delta ContractDelta Delta returned in WelcomeMessage.

Method ContractCache.replace_category

STALE_CONTRACT recovery: the server sent the current definition.

replace_category(category: CapabilityCategory) -> None

Parameter Type Default Description
category CapabilityCategory

Method ContractCache.category

Return a cached category by name, or None.

category(name: str) -> CapabilityCategory | None

Parameter Type Default Description
name str

Returns: CapabilityCategory | None

Method ContractCache.categories

Return every cached category sorted by name.

categories() -> list[CapabilityCategory]

Returns: list[CapabilityCategory]

Method ContractCache.find

Return a cached capability by id, or None.

find(cap_id: str) -> SquawkCapability | None

Parameter Type Default Description
cap_id str

Returns: SquawkCapability | None

Method ContractCache.search

Case-insensitive substring over cap_id + description, difflib fill-up to limit.

search(keywords: str, *, limit: int = 15) -> list[SquawkCapability]

Parameter Type Default Description
keywords str
limit int 15

Returns: list[SquawkCapability]

Alias ContractDelta

Re-exported from parrot.interagent.ContractDelta.

Alias SquawkCapability

Re-exported from parrot.interagent.SquawkCapability.

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