/** * Phase F document assistant (`teamshare-agent doc`): reads a document's * extracted text (Word/PPT/Excel/PDF) plus its comment thread, and replies * to every comment that @mentions the agent. The reply quotes the relevant * context - the document text is included in the prompt so the model can * answer questions about the document content. */ import { TeamshareApi } from '../api'; import { type HarnessName } from '../harness/harness-adapter'; export interface DocReplyOptions { harness: HarnessName; selfMode: boolean; llm?: { baseUrl: string; apiKey: string; model: string; temperature?: number; maxTokens?: number; }; /** Reasoning effort for harnesses that expose it (codex: low|medium|high|xhigh, agy: low|medium|high). */ effort?: string; /** Debug/testing switch (TS_CHAT_ECHO=1): post canned acknowledgments. */ echo?: boolean; /** Document being assisted - recorded as the session title for spend attribution. */ documentId?: string; /** Owning project - pins create_task/create_document + self-mode tool loop. */ projectId?: string; /** Waking comment id (from document.mention) - scope the run to just that comment. */ commentId?: string; /** API client carrying the session agent's key (used to pin the harness MCP identity). */ api?: import('../api').TeamshareApi; /** Working directory - used by antigravity to find .agents/mcp_config.json. */ cwd?: string; /** Harness session id - stamped on MCP claims so they can be released at exit. */ sessionId?: string; /** Agent row id - scopes machine-local harness session continuation. */ agentId?: string; /** Optional logger for retry/give-up lines (wired to the CLI's log). */ onLog?: (text: string) => void; /** AI edit request context (from document.edit_request wake). */ editRequest?: { instruction: string; pageNumber?: number; quote: string; }; /** Idle timeout in minutes — killed after this long with no output. Default 20. */ timeoutMin?: number; } /** * Runs the document reply loop: fetch the document + extract, find comments * mentioning the agent, reply to each (one per comment, chronological). */ export declare function runDocReply(api: TeamshareApi, agentId: string, documentId: string, mentionToken: string, opts: DocReplyOptions): Promise<{ replied: number; skipped: number; }>;