Skip to content

API Reference parrot.roost.endpoint

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

parrot.roost.endpoint

View source

RoostEndpoint — one per agent instance (FEAT-747 M11).

Alias AgentAddress

Re-exported from parrot.roost.messages.AgentAddress.

Alias AgentRegistry

Re-exported from parrot.registry.AgentRegistry.

Alias Award

Re-exported from parrot.roost.scoring.Award.

Alias BidScorer

Re-exported from parrot.roost.scoring.BidScorer.

Alias Blackboard

Re-exported from parrot.roost.blackboard.Blackboard.

Alias Carrier

Re-exported from parrot.roost.carriers.base.Carrier.

Alias CarrierKind

Re-exported from parrot.roost.performatives.CarrierKind.

Alias ConversationBudget

Re-exported from parrot.roost.protocols.ConversationBudget.

Alias Dispatch

Re-exported from parrot.roost.gating.Dispatch.

Alias DispatchDecision

Re-exported from parrot.roost.gating.DispatchDecision.

Alias FailureCode

Re-exported from parrot.roost.performatives.FailureCode.

Alias FailureInfo

Re-exported from parrot.roost.messages.FailureInfo.

Alias GatingDispatcher

Re-exported from parrot.roost.gating.GatingDispatcher.

Alias GrantDenied

Re-exported from parrot.roost.grant.GrantDenied.

Alias GrantPolicy

Re-exported from parrot.roost.grant.GrantPolicy.

Alias Handler

Re-exported from parrot.roost.gating.Handler.

Alias InterAgentGrant

Re-exported from parrot.roost.directory.InterAgentGrant.

Alias InteractionProtocol

Re-exported from parrot.roost.performatives.InteractionProtocol.

Alias Performative

Re-exported from parrot.roost.performatives.Performative.

Alias ProtocolEngine

Re-exported from parrot.roost.protocols.ProtocolEngine.

Alias RoostAgentConfig

Re-exported from parrot.roost.directory.RoostAgentConfig.

Alias RoostAuditLedger

Re-exported from parrot.roost.audit.RoostAuditLedger.

Class RoostEndpoint

Compose Roost transport, deterministic dispatch, and local agent integrations.

Parameter Type Default Description
agent_name str
config Optional[RoostAgentConfig]
engine ProtocolEngine
dispatcher GatingDispatcher
carriers Mapping[CarrierKind, Carrier]
tool_manager 'ToolManager'
blackboard Optional[Blackboard] None
ledger Optional[RoostAuditLedger] None
working_memory Optional['WorkingMemoryToolkit'] None
wake Optional[WakeCallback] None
registry Optional['AgentRegistry'] None
grant Optional[GrantPolicy] None
permission_context Any None
auth_token Optional[str] None
sweep_interval float 0.25

Attributes:

Attribute Type Description
turns_in_flight int Number of agent turns currently running off the carrier consumer.
metrics dict[str, int] Return a snapshot of endpoint message and work counters.

Method RoostEndpoint.address

Return this endpoint's configured transport address.

address() -> AgentAddress

Returns: AgentAddress

Method RoostEndpoint.start

Subscribe this endpoint's address (and capabilities) on every carrier.

start() -> None

Method RoostEndpoint.stop

Cancel in-flight agent turns, unsubscribe, and fail outstanding request waiters as cancelled.

Turns are cancelled and awaited before the carriers are released: a turn that is inside query() closes its conversation as CANCELLED over a carrier that is still live.

stop() -> None

Method RoostEndpoint.sweep

Run ProtocolEngine.expire and deliver the typed failure(TIMEOUT) it emits.

Failures addressed to this agent resolve the local request waiter; the rest go out over the carriers.

sweep() -> int

Returns: int — Number of conversations closed by this sweep.

Method RoostEndpoint.effective_grant

Return the attenuated grant awarded on conversation_id, or None when none was awarded.

effective_grant(conversation_id: str) -> Optional[InterAgentGrant]

Parameter Type Default Description
conversation_id str

Returns: Optional[InterAgentGrant]

Method RoostEndpoint.send

Build, audit, route, and deliver one outbound Roost message.

send(performative: Performative, *, receivers: Sequence[AgentAddress] = (), capability_filter: Optional[str] = None, content: Any = None, protocol: Optional[InteractionProtocol] = None, conversation_id: Optional[str] = None, in_reply_to: Optional[str] = None, body: Optional[str] = None, envelope: Any = None, hops: int = 0) -> RoostMessage

Parameter Type Default Description
performative Performative
receivers Sequence[AgentAddress] ()
capability_filter Optional[str] None
content Any None
protocol Optional[InteractionProtocol] None
conversation_id Optional[str] None
in_reply_to Optional[str] None
body Optional[str] None
envelope Any None
hops int 0

Returns: RoostMessage

Method RoostEndpoint.inform

Send an Inform message.

inform(*, receivers: Sequence[AgentAddress] = (), capability_filter: Optional[str] = None, content: Any, body: Optional[str] = None) -> RoostMessage

Parameter Type Default Description
receivers Sequence[AgentAddress] ()
capability_filter Optional[str] None
content Any
body Optional[str] None

Returns: RoostMessage

Method RoostEndpoint.request

Execute a Request conversation and return its native result.

request(cap_id: str, args: Mapping[str, Any], *, timeout: Optional[float] = None, receiver: Optional[AgentAddress] = None, hops: int = 0) -> Any

Parameter Type Default Description
cap_id str Capability to request.
args Mapping[str, Any] Tool arguments.
timeout Optional[float] None Seconds to wait; also becomes the envelope budget.
receiver Optional[AgentAddress] None Explicit target agent; the caller's grant must cover cap_id (fail-closed).
hops int 0 Chain depth of the caller (e.g. ctx.current_hops) seeding the hop budget.

Returns: Any

Raises:

  • GrantDenied — cap_id is outside the caller's grant.

Method RoostEndpoint.query

Execute a Query conversation without an agreement phase.

query(question: Any, *, receiver: AgentAddress, timeout: Optional[float] = None, expected_schema: Optional[dict] = None, hops: int = 0, trace_id: str | None = None, conversation_id: Optional[str] = None) -> Any

Parameter Type Default Description
question Any Free-form query content.
receiver AgentAddress Target agent; its name is checked against the caller's grant (fail-closed).
timeout Optional[float] None Seconds to wait; also becomes the envelope budget.
expected_schema Optional[dict] None Optional JSON Schema the answer must satisfy (FailureCode.SCHEMA otherwise).
hops int 0 Chain depth of the caller seeding the hop budget.
trace_id str | None None Exact application trace identifier to retain in LocalEnvelope audit entries.
conversation_id Optional[str] None Identifier to open the conversation under, so the caller can correlate the outcome (success or failure) with audit entries. A fresh one is minted when omitted.

Returns: Any

Raises:

  • GrantDenied — receiver is outside the caller's grant.
  • ValueError — trace_id or conversation_id is empty, non-string, whitespace, or contains control/format characters.
  • ConversationExistsError — conversation_id already names a conversation on this endpoint's engine; nothing is sent and that conversation is left untouched.

Method RoostEndpoint.cfp

Broadcast a Contract Net call, score proposals, and notify bidders.

cfp(*, capability_filter: str, task: Any, bid_window_ms: int = 500, scorer: Optional[BidScorer] = None) -> Award

Parameter Type Default Description
capability_filter str
task Any
bid_window_ms int 500
scorer Optional[BidScorer] None

Returns: Award

Method RoostEndpoint.subscribe

Subscribe locally to a blackboard key or remotely through Roost.

subscribe(*, blackboard_key: Optional[str] = None, capability_filter: Optional[str] = None, handler: Optional[Handler] = None) -> str

Parameter Type Default Description
blackboard_key Optional[str] None
capability_filter Optional[str] None
handler Optional[Handler] None

Returns: str

Method RoostEndpoint.cancel

Close a local conversation and fail its pending waiter.

cancel(conversation_id: str, *, reason: str = '') -> None

Parameter Type Default Description
conversation_id str
reason str ''

Method RoostEndpoint.register_handler

Register an inbound content handler with the deterministic dispatcher.

register_handler(content_type: str, handler: Handler, *, needs_decision: bool = False) -> None

Parameter Type Default Description
content_type str
handler Handler
needs_decision bool False

Method RoostEndpoint.find_and_mount

Find granted capabilities and mount them when the optional satellite is available.

find_and_mount(query: str, *, limit: int = 5) -> list[str]

Parameter Type Default Description
query str
limit int 5

Returns: list[str]

Class RoostFailure

A request completed with a typed Roost failure.

Parameter Type Default Description
failure FailureInfo

Alias RoostMessage

Re-exported from parrot.roost.messages.RoostMessage.

Alias TerminalState

Re-exported from parrot.roost.protocols.TerminalState.

Alias ToolManager

Re-exported from parrot.tools.manager.ToolManager.

Alias TraceContext

Re-exported from parrot.core.events.lifecycle.TraceContext.

Alias Undeliverable

Re-exported from parrot.roost.carriers.base.Undeliverable.

Attribute WakeCallback

Alias WorkingMemoryToolkit

Re-exported from parrot.tools.working_memory.tool.WorkingMemoryToolkit.

Alias squawk_bridge

Re-exported from parrot.roost.squawk_bridge.

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