/** * IRC tool — agent-to-agent messaging. * * Lets any live agent send a short prose message to any other live agent in * this process and (optionally) get a prose reply. * * Routing happens via the global AgentRegistry. Replies are produced by an * ephemeral side-channel call (`AgentSession.respondAsBackground`) that * mirrors `/btw`: the recipient's current model, system prompt, and message * history are used to compute a reply without persisting it through the * normal stream path. After the reply is generated, both the incoming * message and the auto-reply are queued for injection into the recipient's * persisted history (deferred until the recipient is idle), so the model * sees the exchange on its next turn. * * This avoids the deadlock that arises when the recipient is blocked on a * long-running tool call: the side-channel call does not depend on the * recipient's main agent loop being free. */ import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core"; import * as z from "zod/v4"; import type { ToolSession } from "."; declare const ircSchema: z.ZodObject<{ op: z.ZodEnum<{ list: "list"; send: "send"; }>; to: z.ZodOptional; message: z.ZodOptional; awaitReply: z.ZodOptional; }, z.core.$strip>; type IrcParams = z.infer; interface IrcReply { from: string; text: string; } export interface IrcDetails { op: "send" | "list"; from?: string; to?: string; delivered?: string[]; replies?: IrcReply[]; failed?: Array<{ id: string; error: string; }>; notFound?: string[]; peers?: Array<{ id: string; displayName: string; kind: string; status: string; parentId?: string; }>; channels?: string[]; } export declare class IrcTool implements AgentTool { #private; private readonly session; readonly name = "irc"; readonly label = "IRC"; readonly summary = "Send and receive messages between agents over IRC-like channels"; readonly description: string; readonly parameters: z.ZodObject<{ op: z.ZodEnum<{ list: "list"; send: "send"; }>; to: z.ZodOptional; message: z.ZodOptional; awaitReply: z.ZodOptional; }, z.core.$strip>; readonly strict = true; readonly loadMode = "discoverable"; constructor(session: ToolSession); static createIf(session: ToolSession): IrcTool | null; execute(_toolCallId: string, params: IrcParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback, _context?: AgentToolContext): Promise>; } export {};