Skip to content

API Reference parrot.integrations.telegram.crew.registry

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

parrot.integrations.telegram.crew.registry

View source

Thread-safe in-memory registry of active agents in a crew.

Provides CRUD operations on AgentCard entries and resolution by Telegram username or agent name.

Alias AgentCard

Re-exported from parrot.integrations.telegram.crew.agent_card.AgentCard.

Class CrewRegistry

Thread-safe in-memory registry tracking active agents in the crew.

All mutating operations use an asyncio.Lock to ensure consistency when called from concurrent coroutines.

Method CrewRegistry.register

Register an agent in the crew.

register(card: AgentCard) -> None

Parameter Type Default Description
card AgentCard The AgentCard describing the agent to register.

Method CrewRegistry.unregister

Remove an agent from the registry.

unregister(username: str) -> Optional[AgentCard]

Parameter Type Default Description
username str Telegram username (with or without @).

Returns: Optional[AgentCard] — The removed AgentCard, or None if not found.

Method CrewRegistry.update_status

Update an agent's status and optionally its current task.

Also updates the last_seen timestamp.

update_status(username: str, status: str, current_task: Optional[str] = None) -> None

Parameter Type Default Description
username str Telegram username (with or without @).
status str New status (ready, busy, offline).
current_task Optional[str] None Description of current task (when busy).

Method CrewRegistry.get

Get an agent card by Telegram username.

get(username: str) -> Optional[AgentCard]

Parameter Type Default Description
username str Telegram username (with or without @).

Returns: Optional[AgentCard] — The AgentCard if found, None otherwise.

Method CrewRegistry.list_active

Return all agents that are not offline.

list_active() -> List[AgentCard]

Returns: List[AgentCard] — List of AgentCard instances with status != 'offline'.

Method CrewRegistry.resolve

Resolve an agent by username or agent name.

Supports both @username and agent_name (case-insensitive for names).

resolve(name_or_username: str) -> Optional[AgentCard]

Parameter Type Default Description
name_or_username str A Telegram @username or agent name.

Returns: Optional[AgentCard] — The matching AgentCard, or None if not found.

Attribute logger

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