/** * Platform adapter port — the single seam between the platform-neutral core * (queue, agent, sessions, scheduler) and a chat platform implementation. * * pi-tag ships exactly one implementation (src/slack/client.ts). The interface * exists so the core never grows platform-specific imports beyond this shape, * and so a future shared gateway core can be extracted without refactoring. */ export interface PlatformAdapter { /** Connect to the platform and resolve once inbound events are flowing. */ start(): Promise; /** Disconnect and release the platform connection (fire-and-forget). */ stop(): void; /** Human-readable bot identity for startup logs (undefined before start). */ getBotTag(): string | undefined; /** * Deliver agent output to a channel. `ctx.threadTs` carries the parent * thread ts when the triggering message lived in a thread; implementations * decide whether to honor it (e.g. Slack honors it when REPLY_IN_THREAD is * enabled). Returns false when delivery failed. */ sendResponse(jid: string, text: string, ctx?: { threadTs?: string; }): Promise; /** * Toggle a "working on it" indicator. `ctx.ts` is the triggering message ts * so implementations without a typing indicator (Slack) can react to the * message instead. Best-effort: implementations must never reject. */ setBusy(jid: string, on: boolean, ctx?: { ts?: string; }): Promise; /** * Upload local files to a channel as native attachments (used when agent * output references files on the gateway host). Returns false on failure. */ sendFiles(jid: string, filePaths: string[], ctx?: { threadTs?: string; }): Promise; }