/** * Thinking content type for Convos. * * Agent → conversation "I'm thinking about this message" status. Mirrors * the existing FocusModeControl / TypingIndicator pattern: silent, no * fallback, JSON payload, filtered from chat history. Receivers route it * into a side-channel UI affordance ("Agent is thinking…"). * * Wire shape: * { * "state": "start" | "stop", * "targetMessageId": "", * "content": "<3–5 word human-readable label>", * "resultMessageId": "" * } * * The `state` field follows the FocusModeControl pattern — `start` opens * a thinking session, `stop` closes it. Senders are expected to always * pair a `start` with a matching `stop` (same `targetMessageId`). * * `targetMessageId` and `content` are both required even on `stop`, so * receivers can disambiguate concurrent thinking sessions and render a * final label if they want. * * `resultMessageId` is optional and only meaningful on `stop` — when present, * it identifies the agent's own reply message that resolved the thinking. * Receivers can use it to link "thought about X" to "replied with Y" in the * UI. Omitted when the thinking ended without a reply (interrupt, error, * agent had nothing to say). */ import type { ContentTypeId, EncodedContent } from "@xmtp/node-bindings"; import type { ContentCodec } from "@xmtp/content-type-primitives"; import type { DecodedMessage } from "@xmtp/node-sdk"; export declare const ContentTypeThinking: ContentTypeId; export type ThinkingState = "start" | "stop"; export interface Thinking { state: ThinkingState; targetMessageId: string; content: string; /** Optional — only meaningful on `stop`. The agent's reply that closed the thinking. */ resultMessageId?: string; } export declare class ThinkingCodec implements ContentCodec { get contentType(): ContentTypeId; encode(content: Thinking): EncodedContent; decode(content: EncodedContent): Thinking; fallback(_content: Thinking): string | undefined; shouldPush(_content: Thinking): boolean; } export declare function isThinkingMessage(message: DecodedMessage): boolean; export declare function getThinkingContent(message: DecodedMessage): Thinking | undefined;