/** * mail-tools — thin, high-affordance wrappers over the project mailbox. * * These are the PREFERRED mailbox tools for agents. The multi-action `mailbox` * tool is the low-level power surface for advanced queries and agent status; * `mail_send` and `mail_inbox` exist because explicit verbs ("send a mail", * "read my inbox") are what makes agents USE the mailbox autonomously — a model * reaches for `mail_send` mid-task far more readily than for * `mailbox action=send ...`. * * mail_send — message one agent (`to: "leader@a1b2c3d4"`), every leader * (`to: "leader"`), this session (`to: "@session"`), or everyone (`to: "*"`) * mail_inbox — read unread mail (unique id + base alias + session/project broadcasts), * marking it read so it isn't re-injected next iteration * * Both share the identity convention with the agent-loop checker * (`@`, see mailbox-attach) via `resolveMailboxIdentity`. * * @module mail-tools */ import type { EventBus } from '../kernel/events.js'; import type { Context } from '../core/context.js'; import type { MailboxAudience, MailboxMessageType } from './mailbox-types.js'; import { type MailboxResolver } from './mailbox-tool.js'; export interface MailToolsOptions { /** How to obtain a Mailbox given the execution Context (tests). */ resolveMailbox?: MailboxResolver | undefined; /** Project dir for the shared mailbox. Prefer wpaths.projectDir. */ projectDir?: string | undefined; /** EventBus for mailbox.agent_registered / heartbeat surface events. */ events?: EventBus | undefined; } export declare function makeMailSendTool(opts?: MailToolsOptions): { name: string; description: string; usageHint: string; category: string; permission: "auto"; mutating: true; capabilities: "coordination.mail"[]; inputSchema: { type: string; properties: { to: { type: string; description: string; }; subject: { type: string; description: string; }; body: { type: string; description: string; }; type: { type: string; enum: string[]; description: string; }; priority: { type: string; enum: string[]; }; audience: { type: string; enum: string[]; description: string; }; replyTo: { type: string; description: string; }; }; required: string[]; }; execute(input: unknown, ctx: Context): Promise<{ messageId?: never; to?: never; summary?: never; ok: boolean; error: string; from?: never; } | { error?: never; ok: boolean; messageId: string; from: string; to: string; summary: string; }>; }; export declare function makeMailInboxTool(opts?: MailToolsOptions): { name: string; description: string; usageHint: string; category: string; permission: "auto"; mutating: true; capabilities: "coordination.mail"[]; inputSchema: { type: string; properties: { limit: { type: string; description: string; }; markRead: { type: string; description: string; }; completed: { type: string; description: string; }; outcome: { type: string; description: string; }; }; }; execute(input: unknown, ctx: Context): Promise<{ ok: boolean; you: string; count: number; messages: { id: string; from: string; to: string; type: MailboxMessageType; audience: MailboxAudience; subject: string; body: string; timestamp: string; replyTo: string | undefined; }[]; summary: string; }>; }; //# sourceMappingURL=mail-tools.d.ts.map