/** * daemon/todoist-inbox.ts — what has been commented on since you last looked. * * A push per reply tells you something happened the moment it happens. That is * the wrong shape for the actual problem: a tree of hundreds of tasks, comments * arriving on any of them, and no way to see which ones are waiting for you. * Todoist itself will not help — it does not notify an account about its own * activity, and every comment the bridge writes is written as you, so the one * event you most want to know about is precisely the one Todoist stays quiet * about. * * So this reads the activity log — one request, not one per task — groups the * comments by the task they landed on, and hands back a list you can jump from. * The read marker is stored, so "what's new" means new since you last asked * rather than new since some arbitrary window. * * The marker is only advanced when the caller says so. A digest that marks * everything read as a side effect of being built would lose the whole backlog * the first time a scheduled job ran before you saw it. */ export interface InboxComment { at: string; content: string; /** The app that wrote it — "AIBroker Bridge" for a session's reply. */ client?: string; } export interface InboxEntry { taskId: string; projectId?: string; title?: string; url?: string; comments: InboxComment[]; /** Newest comment on this task, for ordering. */ latest: string; } export interface Inbox { entries: InboxEntry[]; /** Tasks that had new comments but whose titles were not resolved. */ truncated: number; /** The marker this digest was computed against. */ since?: string; /** The newest event seen, which becomes the marker if the caller commits. */ newest?: string; } /** When the inbox was last marked read. Undefined means never. */ export declare function lastSeen(): string | undefined; /** Record that everything up to `at` has been seen. */ export declare function markSeen(at: string): void; export interface ActivityRecord { /** The comment's own id — the only stable key for "already handled". */ object_id?: string; event_date?: string; parent_item_id?: string; parent_project_id?: string; extra_data?: { content?: string; client?: string; }; } /** * Comment events, newest first. * * Returns an empty list rather than throwing when Todoist cannot be reached — * the caller is building a digest, and a digest that fails loudly on a network * blip is a digest that gets turned off. */ export declare function fetchCommentActivity(fetchImpl?: typeof fetch): Promise; /** * Group new comments by the task they landed on. * * `since` defaults to the stored read marker. Pass it explicitly to look * further back without disturbing the marker. */ export declare function buildInbox(opts?: { since?: string; }): Promise; /** * The digest as text, ready for a phone. * * A deleted task resolves to no title; it is still listed, because "a comment * arrived on something that no longer exists" is information, not noise. */ export declare function formatInbox(inbox: Inbox): string; //# sourceMappingURL=todoist-inbox.d.ts.map