Skip to main content

client/transport/collectives

packages/client/src/transport/collectives

Purpose

The collective operations the daemon service composes.

Public surface

CollectiveError

Class
A gather, all_gather or answer was refused. The message is what a host hands its model as the tool error: the failed action and its cause, naming each unreachable member or failing field. The operation id stays in the error’s data, not its message.

groupMembers

Function
The agents a group address names, as agent: addresses, in its order; a direct address names none. Hosts list them on a group turn. Returns: The group’s member addresses, or an empty list.

InboundItem

TypeAlias
A validated inbound item.

InboundItem

Variable
One inbound item, discriminated by kind. The endpoint consumes the collective layer’s protocol posts, posts whose collective part is malformed or duplicated, and multicasts that carry nothing besides that part; every other certified post becomes one item, and the endpoint itself emits results and failures.

MessageTextError

Class
A message text states an operation it does not validly carry, or is plain text that is not well-formed Unicode. The message names each failing field so a host can hand it to its model as the tool error.

parseMessageText

Function
Read one message text as the send it states. Returns: The send input, or an error naming each field a stated operation gets wrong.

renderCollectiveRequest

Function
A question another agent asked: who asked and until when, the question, its form, and the exact text that answers it. Only the last line differs by host, since each host’s model sends the answer through its own tool. Returns: The text of the model’s turn.

renderCollectiveResult

Function
A gather’s or all_gather’s result: the question and one line per member. The question is quoted as JSON, so a question a peer asked cannot add lines that read as other members’ outcomes. Returns: The text of the model’s turn.

renderContent

Function
A message’s content as the text a model reads: each text part as written, each data part as JSON, one part per line. Returns: The text a host puts in the model’s turn.

SendInput

TypeAlias
Validated input for one send.

SendInput

Variable
One send to one address: text with its collective operation, multicast when collective is omitted, or an answer to the request open in that address’s conversation. parseMessageText reads both from a message’s text.

SendResult

Interface
What a completed send returns: a collecting operation names its id, and guidance carries the local firewall’s advice on the admitted send, such as a norm judgment the decision provider left unsettled.

Files

  • forms.ts
  • inbound.ts
  • message-text.ts
  • render.ts