/** * CleoOS chat room — inter-agent messaging TUI. * * Installed to: $CLEO_HOME/pi-extensions/cleo-chatroom.ts * Loaded by: Pi via `-e ` or settings.json extensions array * * Wave 7 — surfaces inter-agent traffic as a TUI panel per ULTRAPLAN * section 13. Agents communicate through four tools: * * - `send_to_lead` — worker sends a message to their lead. * - `broadcast_to_team` — lead broadcasts to all group workers. * - `report_to_orchestrator` — lead reports status to the orchestrator. * - `query_peer` — worker queries another worker in the same group. * * Each tool appends a structured JSONL entry to the Pi session's message * log. A TUI widget (registered on `session_start`) renders the last N * messages in a scrollable panel below the editor. * * This is a TEMPLATE extension — it uses `import type` for Pi types and * mirrors the patterns established by the existing extensions in * `packages/cleo/templates/cleoos-hub/pi-extensions/`. * * @packageDocumentation */ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent"; /** * Tier role of an agent in the 3-tier hierarchy (ULTRAPLAN §10). * Used to apply distinct TUI styling per tier. */ export type AgentTierRole = "orchestrator" | "lead" | "worker"; /** A single inter-agent chat message. */ export interface ChatMessage { /** ISO-8601 timestamp of when the message was created. */ timestamp: string; /** Name of the sending agent. */ from: string; /** Name of the receiving agent or group (e.g. "team:backend"). */ to: string; /** Message channel identifying the tool that produced this message. */ channel: "send_to_lead" | "broadcast_to_team" | "report_to_orchestrator" | "query_peer"; /** The message text. */ text: string; /** * Optional tier role of the sending agent. * * When present, the TUI row is prefixed and (if ANSI is available) * coloured by tier: orchestrator = green ([O]), lead = yellow ([L]), * worker = blue ([W]). Defaults to "worker" when absent. */ role?: AgentTierRole; } /** * Return the single-character tier prefix for a chat message row. * * - `[O]` orchestrator (green in ANSI-capable terminals) * - `[L]` lead (yellow) * - `[W]` worker (blue, default) * * @param role - The sending agent's tier role, or `undefined` to default to worker. * @returns The three-character prefix string. */ export declare function tierPrefix(role: AgentTierRole | undefined): string; /** * Format a chat message for TUI display. * * Each row is prefixed with a tier indicator ([O]/[L]/[W]) so orchestrator, * lead, and worker traffic is visually distinct in the chat panel (ULTRAPLAN §13). * * @param msg - The message to format. * @returns A single-line string representation. */ export declare function formatMessage(msg: ChatMessage): string; /** * Pi extension factory for the CleoOS chat room. * * Registers four inter-agent communication tools and a TUI widget that * displays the message stream. Also registers `/cleo:chat-info` for * introspection and clears state on session shutdown. * * @param pi - The Pi extension API instance. */ export default function (pi: ExtensionAPI): void; //# sourceMappingURL=cleo-chatroom.d.ts.map