/** * Trello live query tools — the READ answer path for current-state questions. * * Ported from Kagemusha's mechanism (trello_search / trello_card_detail): * state questions are answered by reading the LIVE board at question time, * never by projecting the connector change log. The 2026-07-24 incident chain * (missing labels/assignees, first-sight timestamps burying enriched items, * per-character card collapse) was one architecture mistake surfacing three * ways: a log projection serving state queries. The connector log remains the * delta/trigger source; these tools are the truth reads, the same pattern as * kagemusha_* for the kagemusha DB. * * Read-only: no mutation endpoint is ever called. Card text is untrusted * external data — tool descriptions instruct the model to treat it as data. */ export interface TrelloQueryDeps { /** Injected for tests; defaults to global fetch. */ fetchFn?: typeof fetch; env?: NodeJS.ProcessEnv; /** Injected for tests; defaults to ~/.mama/connectors.json. */ configPath?: string; } interface TrelloAuth { apiKey: string; token: string; /** boardId → display name for enabled trello channels ('' = unscoped). */ boardNames: Map; } /** Loud, no-fallback auth resolution via the connector contract: * config.auth.token ?? env[tokenName ?? 'TRELLO_TOKEN'], "apiKey:token". */ export declare function resolveTrelloQueryAuth(deps?: TrelloQueryDeps): TrelloAuth; export interface TrelloCardSummary { cardId: string; name: string; board: string; list: string; labels: string[]; assignees: string[]; due: string | null; lastActivity: string; } /** Test seam: drop the snapshot cache. */ export declare function clearTrelloSnapshotCache(): void; export interface TrelloKanbanColumn { board: string; list: string; /** Open cards in the list. */ count: number; /** Cards actually returned; `returned < count` means this column is truncated. */ returned: number; cards: TrelloCardSummary[]; } export interface TrelloBoardCoverage { boardId: string; board: string; /** 'failed' contributed NO cards - absence of cards is not evidence of an empty board. */ status: 'ok' | 'failed'; /** Card data intact, member names unresolved. */ rosterDegraded: boolean; } export interface TrelloKanbanSnapshot { /** When the underlying read happened - NOT when this call was made. */ observedAt: string; /** 0 for a fresh read; >0 means this is a reused snapshot of that age. */ cacheAgeMs: number; /** Every configured board read successfully AND no column truncated. */ complete: boolean; truncated: boolean; boards: TrelloBoardCoverage[]; columns: TrelloKanbanColumn[]; } /** * Full LIVE kanban snapshot across the configured boards - the primary answer tool * for whole-project status. ONE call replaces a search per card: every open card * with its list, labels (revision round / artist), and assignee names, grouped by * board+list. * * The result carries its own coverage because both ways this read can be partial are * invisible in the data itself: a board whose fetch failed yields no cards, and a * column longer than maxCardsPerList is silently sliced. A caller that asserts a * whole-situation claim must check `complete` first. */ export declare function getTrelloKanban(input?: { maxCardsPerList?: number; }, deps?: TrelloQueryDeps): Promise; /** * Search cards across the configured boards, LIVE. Returns current list, * labels (revision round / artist), and assignee names per card. Tries * Trello's /search first (fast for ASCII terms), then fills up from a * board scan with local substring matching (reliable for CJK names). */ export declare function searchTrelloCards(input: { query: string; limit?: number; }, deps?: TrelloQueryDeps): Promise; export interface TrelloCardDetail extends TrelloCardSummary { description: string; checklists: Array<{ name: string; items: Array<{ name: string; complete: boolean; }>; }>; } /** Full card detail, LIVE: description head, members, labels, checklists. */ export declare function getTrelloCard(input: { cardId: string; }, deps?: TrelloQueryDeps): Promise; export {}; //# sourceMappingURL=query-tools.d.ts.map