/** * techstack-mailbox-consumer — Auto-spawns the tech-stack agent when * dep-watcher messages land in the mailbox. * * This module runs a lightweight polling loop that checks the mailbox * for unread `assign` messages directed at the `tech-stack` agent. * When found, it invokes the provided `onSpawn` callback to spawn a * tech-stack subagent, passing the manifest path as the task. * * The consumer also records file-author entries when it detects that * a manifest was edited, so the tech-stack agent knows who to warn. * * @module techstack-mailbox-consumer */ import type { Mailbox } from './mailbox-types.js'; import { type FileAuthorTrackerOptions } from './file-author-tracker.js'; export interface TechStackConsumerOptions { /** The mailbox to poll. */ mailbox: Mailbox; /** Called when a tech-stack agent should be spawned. Receives the task description. */ onSpawn: (task: string, name: string) => Promise<{ subagentId: string; taskId: string; }>; /** Agent id that the consumer watches for. Default: 'tech-stack'. */ targetAgent?: string | undefined; /** Agent id that sends the completion ack. Default: 'tech-stack-consumer'. */ consumerAgentId?: string | undefined; /** Polling interval in ms. Default: 5000. */ pollIntervalMs?: number | undefined; /** File-author tracker config (for recording manifest edits). */ fileAuthorOpts?: FileAuthorTrackerOptions | undefined; /** Current session id (for file-author entries). */ sessionId?: string | undefined; /** Current agent id (for file-author entries). */ currentAgentId?: string | undefined; /** Current agent name (for file-author entries). */ currentAgentName?: string | undefined; /** Called on each poll cycle for logging. */ onLog?: ((msg: string) => void) | undefined; /** Called when an error occurs. */ onError?: ((err: unknown) => void) | undefined; } /** * Start the mailbox consumer loop. * * Returns a dispose function that stops polling and cleans up. */ export declare function startTechStackConsumer(opts: TechStackConsumerOptions): () => void; //# sourceMappingURL=techstack-mailbox-consumer.d.ts.map