import { type ClaimResult, type TransitionResult } from "./task-store.js"; import { type TmuxApi } from "./tmux.js"; import type { MailboxMessageView, TaskStatus } from "./types.js"; export interface ClaimInput { team_name: string; task_id: string; worker: string; cwd?: string; } export declare function apiClaimTask(input: ClaimInput): ClaimResult; export interface TransitionInput { team_name: string; task_id: string; worker?: string; from: TaskStatus; to: TaskStatus; claim_token: string; result?: string; cwd?: string; } export declare function apiTransitionTaskStatus(input: TransitionInput): TransitionResult; export interface SendMessageInput { team_name: string; from: string; to: string; body: string; cwd?: string; } export interface SendMessageResult { ok: boolean; messageId?: string; nudged?: boolean; error?: string; } /** * Send a message to the leader or any registered worker. Rejects path-traversal * and unknown recipients before any file I/O. Best-effort nudges the recipient * worker's tmux pane (never the leader — it has no tracked pane). */ export declare function apiSendMessage(input: SendMessageInput, tmux?: TmuxApi): Promise; export interface BroadcastInput { team_name: string; from: string; body: string; cwd?: string; } export interface BroadcastResult { ok: boolean; recipients: string[]; messageIds: string[]; errors?: string[]; } /** Broadcast to every worker (except the sender) AND the leader. */ export declare function apiBroadcast(input: BroadcastInput, tmux?: TmuxApi): Promise; export interface MailboxListInput { team_name: string; worker: string; undelivered_only?: boolean; cwd?: string; } export interface MailboxListResult { ok: boolean; messages: MailboxMessageView[]; error?: string; } /** List a recipient's mailbox (merged with delivery receipts). */ export declare function apiMailboxList(input: MailboxListInput): MailboxListResult; export interface MailboxMarkDeliveredInput { team_name: string; worker: string; message_id: string; cwd?: string; } export interface MailboxMarkDeliveredResult { ok: boolean; error?: string; } /** Mark a mailbox message delivered (appends a delivery receipt). */ export declare function apiMailboxMarkDelivered(input: MailboxMarkDeliveredInput): MailboxMarkDeliveredResult;