chat 4.0.2 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -46,6 +46,11 @@ interface ChatConfig<TAdapters extends Record<string, Adapter> = Record<string,
46
46
  * Pass "silent" to disable all logging.
47
47
  */
48
48
  logger?: Logger | LogLevel;
49
+ /**
50
+ * Update interval for fallback streaming (post + edit) in milliseconds.
51
+ * Defaults to 500ms. Lower values provide smoother updates but may hit rate limits.
52
+ */
53
+ streamingUpdateIntervalMs?: number;
49
54
  }
50
55
  /**
51
56
  * Options for webhook handling.
@@ -84,9 +89,9 @@ interface Adapter<TThreadId = unknown, TRawMessage = unknown> {
84
89
  /** Handle incoming webhook request */
85
90
  handleWebhook(request: Request, options?: WebhookOptions): Promise<Response>;
86
91
  /** Post a message to a thread */
87
- postMessage(threadId: string, message: PostableMessage): Promise<RawMessage<TRawMessage>>;
92
+ postMessage(threadId: string, message: AdapterPostableMessage): Promise<RawMessage<TRawMessage>>;
88
93
  /** Edit an existing message */
89
- editMessage(threadId: string, messageId: string, message: PostableMessage): Promise<RawMessage<TRawMessage>>;
94
+ editMessage(threadId: string, messageId: string, message: AdapterPostableMessage): Promise<RawMessage<TRawMessage>>;
90
95
  /** Delete a message */
91
96
  deleteMessage(threadId: string, messageId: string): Promise<void>;
92
97
  /** Add a reaction to a message */
@@ -95,8 +100,39 @@ interface Adapter<TThreadId = unknown, TRawMessage = unknown> {
95
100
  removeReaction(threadId: string, messageId: string, emoji: EmojiValue | string): Promise<void>;
96
101
  /** Show typing indicator */
97
102
  startTyping(threadId: string): Promise<void>;
98
- /** Fetch messages from a thread */
99
- fetchMessages(threadId: string, options?: FetchOptions): Promise<Message<TRawMessage>[]>;
103
+ /**
104
+ * Fetch messages from a thread.
105
+ *
106
+ * **Direction behavior:**
107
+ * - `backward` (default): Fetches the most recent messages. Use this for loading
108
+ * a chat view. The `nextCursor` points to older messages.
109
+ * - `forward`: Fetches the oldest messages first. Use this for iterating through
110
+ * message history. The `nextCursor` points to newer messages.
111
+ *
112
+ * **Message ordering:**
113
+ * Messages within each page are always returned in chronological order (oldest first),
114
+ * regardless of direction. This is the natural reading order for chat messages.
115
+ *
116
+ * @example
117
+ * ```typescript
118
+ * // Load most recent 50 messages for display
119
+ * const recent = await adapter.fetchMessages(threadId, { limit: 50 });
120
+ * // recent.messages: [older, ..., newest] in chronological order
121
+ *
122
+ * // Paginate backward to load older messages
123
+ * const older = await adapter.fetchMessages(threadId, {
124
+ * limit: 50,
125
+ * cursor: recent.nextCursor,
126
+ * });
127
+ *
128
+ * // Iterate through all history from the beginning
129
+ * const history = await adapter.fetchMessages(threadId, {
130
+ * limit: 100,
131
+ * direction: 'forward',
132
+ * });
133
+ * ```
134
+ */
135
+ fetchMessages(threadId: string, options?: FetchOptions): Promise<FetchResult<TRawMessage>>;
100
136
  /** Fetch thread metadata */
101
137
  fetchThread(threadId: string): Promise<ThreadInfo>;
102
138
  /** Encode platform-specific data into a thread ID string */
@@ -133,6 +169,30 @@ interface Adapter<TThreadId = unknown, TRawMessage = unknown> {
133
169
  * @returns True if the thread is a DM, false otherwise
134
170
  */
135
171
  isDM?(threadId: string): boolean;
172
+ /**
173
+ * Stream a message using platform-native streaming APIs.
174
+ *
175
+ * The adapter consumes the async iterable and handles the entire streaming lifecycle.
176
+ * Only available on platforms with native streaming support (e.g., Slack).
177
+ *
178
+ * @param threadId - The thread to stream to
179
+ * @param textStream - Async iterable of text chunks (e.g., from AI SDK)
180
+ * @param options - Platform-specific streaming options
181
+ * @returns The raw message after streaming completes
182
+ */
183
+ stream?(threadId: string, textStream: AsyncIterable<string>, options?: StreamOptions): Promise<RawMessage<TRawMessage>>;
184
+ }
185
+ /**
186
+ * Options for streaming messages.
187
+ * Platform-specific options are passed through to the adapter.
188
+ */
189
+ interface StreamOptions {
190
+ /** Slack: The user ID to stream to (for AI assistant context) */
191
+ recipientUserId?: string;
192
+ /** Slack: The team/workspace ID */
193
+ recipientTeamId?: string;
194
+ /** Minimum interval between updates in ms (default: 1000). Used for fallback mode (GChat/Teams). */
195
+ updateIntervalMs?: number;
136
196
  }
137
197
  /** Internal interface for Chat instance passed to adapters */
138
198
  interface ChatInstance {
@@ -206,7 +266,14 @@ interface Lock {
206
266
  token: string;
207
267
  expiresAt: number;
208
268
  }
209
- interface Thread<TRawMessage = unknown> {
269
+ /** Default TTL for thread state (30 days in milliseconds) */
270
+ declare const THREAD_STATE_TTL_MS: number;
271
+ /**
272
+ * Thread interface with support for custom state.
273
+ * @template TState - Custom state type stored per-thread (default: Record<string, unknown>)
274
+ * @template TRawMessage - Platform-specific raw message type
275
+ */
276
+ interface Thread<TState = Record<string, unknown>, TRawMessage = unknown> {
210
277
  /** Unique thread ID (format: "adapter:channel:thread") */
211
278
  readonly id: string;
212
279
  /** The adapter this thread belongs to */
@@ -215,9 +282,45 @@ interface Thread<TRawMessage = unknown> {
215
282
  readonly channelId: string;
216
283
  /** Whether this is a direct message conversation */
217
284
  readonly isDM: boolean;
285
+ /**
286
+ * Get the current thread state.
287
+ * Returns null if no state has been set.
288
+ *
289
+ * @example
290
+ * ```typescript
291
+ * const state = await thread.state;
292
+ * if (state?.aiMode) {
293
+ * // AI mode is enabled
294
+ * }
295
+ * ```
296
+ */
297
+ readonly state: Promise<TState | null>;
298
+ /**
299
+ * Set the thread state. Merges with existing state by default.
300
+ * State is persisted for 30 days.
301
+ *
302
+ * @param state - Partial state to merge, or full state if replace is true
303
+ * @param options - Options for setting state
304
+ *
305
+ * @example
306
+ * ```typescript
307
+ * // Merge with existing state
308
+ * await thread.setState({ aiMode: true });
309
+ *
310
+ * // Replace entire state
311
+ * await thread.setState({ aiMode: true }, { replace: true });
312
+ * ```
313
+ */
314
+ setState(state: Partial<TState>, options?: {
315
+ replace?: boolean;
316
+ }): Promise<void>;
218
317
  /** Recently fetched messages (cached) */
219
318
  recentMessages: Message<TRawMessage>[];
220
- /** Async iterator for all messages in the thread */
319
+ /**
320
+ * Async iterator for all messages in the thread.
321
+ * Messages are yielded in chronological order (oldest first).
322
+ * Automatically handles pagination.
323
+ */
221
324
  allMessages: AsyncIterable<Message<TRawMessage>>;
222
325
  /**
223
326
  * Check if this thread is currently subscribed.
@@ -252,7 +355,11 @@ interface Thread<TRawMessage = unknown> {
252
355
  /**
253
356
  * Post a message to this thread.
254
357
  *
255
- * @param message - String, PostableMessage, or JSX Card element to send
358
+ * Supports text, markdown, cards, and streaming from async iterables.
359
+ * When posting a stream (e.g., from AI SDK), uses platform-native streaming
360
+ * APIs when available (Slack), or falls back to post + edit with throttling.
361
+ *
362
+ * @param message - String, PostableMessage, JSX Card, or AsyncIterable<string>
256
363
  * @returns A SentMessage with methods to edit, delete, or add reactions
257
364
  *
258
365
  * @example
@@ -266,12 +373,16 @@ interface Thread<TRawMessage = unknown> {
266
373
  * // With emoji
267
374
  * await thread.post(`${emoji.thumbs_up} Great job!`);
268
375
  *
269
- * // JSX Card (with @jsxImportSource chat-sdk)
376
+ * // JSX Card (with @jsxImportSource chat)
270
377
  * await thread.post(
271
378
  * <Card title="Welcome!">
272
379
  * <Text>Hello world</Text>
273
380
  * </Card>
274
381
  * );
382
+ *
383
+ * // Stream from AI SDK
384
+ * const result = await agent.stream({ prompt: message.text });
385
+ * await thread.post(result.textStream);
275
386
  * ```
276
387
  */
277
388
  post(message: string | PostableMessage | CardJSXElement): Promise<SentMessage<TRawMessage>>;
@@ -304,13 +415,77 @@ interface ThreadInfo {
304
415
  /** Platform-specific metadata */
305
416
  metadata: Record<string, unknown>;
306
417
  }
418
+ /**
419
+ * Direction for fetching messages.
420
+ *
421
+ * - `backward`: Fetch most recent messages first. Pagination moves toward older messages.
422
+ * This is the default, suitable for loading a chat view (show latest messages first).
423
+ *
424
+ * - `forward`: Fetch oldest messages first. Pagination moves toward newer messages.
425
+ * Suitable for iterating through message history from the beginning.
426
+ *
427
+ * In both directions, messages within each page are returned in chronological order
428
+ * (oldest first), which is the natural reading order for chat messages.
429
+ *
430
+ * @example
431
+ * ```typescript
432
+ * // Load most recent 50 messages (default)
433
+ * const recent = await adapter.fetchMessages(threadId, { limit: 50 });
434
+ * // recent.messages: [older, ..., newest] (chronological within page)
435
+ * // recent.nextCursor: points to older messages
436
+ *
437
+ * // Iterate through all history from beginning
438
+ * const history = await adapter.fetchMessages(threadId, {
439
+ * limit: 50,
440
+ * direction: 'forward',
441
+ * });
442
+ * // history.messages: [oldest, ..., newer] (chronological within page)
443
+ * // history.nextCursor: points to even newer messages
444
+ * ```
445
+ */
446
+ type FetchDirection = "forward" | "backward";
447
+ /**
448
+ * Options for fetching messages from a thread.
449
+ */
307
450
  interface FetchOptions {
308
- /** Maximum number of messages to fetch */
451
+ /** Maximum number of messages to fetch. Default varies by adapter (50-100). */
309
452
  limit?: number;
310
- /** Fetch messages before this message ID */
311
- before?: string;
312
- /** Fetch messages after this message ID */
313
- after?: string;
453
+ /**
454
+ * Pagination cursor for fetching the next page of messages.
455
+ * Pass the `nextCursor` from a previous `FetchResult`.
456
+ */
457
+ cursor?: string;
458
+ /**
459
+ * Direction to fetch messages.
460
+ *
461
+ * - `backward` (default): Fetch most recent messages. Cursor moves to older messages.
462
+ * - `forward`: Fetch oldest messages. Cursor moves to newer messages.
463
+ *
464
+ * Messages within each page are always returned in chronological order (oldest first).
465
+ */
466
+ direction?: FetchDirection;
467
+ }
468
+ /**
469
+ * Result of fetching messages from a thread.
470
+ */
471
+ interface FetchResult<TRawMessage = unknown> {
472
+ /**
473
+ * Messages in chronological order (oldest first within this page).
474
+ *
475
+ * For `direction: 'backward'` (default): These are the N most recent messages.
476
+ * For `direction: 'forward'`: These are the N oldest messages (or next N after cursor).
477
+ */
478
+ messages: Message<TRawMessage>[];
479
+ /**
480
+ * Cursor for fetching the next page.
481
+ * Pass this as `cursor` in the next `fetchMessages` call.
482
+ *
483
+ * - For `direction: 'backward'`: Points to older messages.
484
+ * - For `direction: 'forward'`: Points to newer messages.
485
+ *
486
+ * Undefined if there are no more messages in that direction.
487
+ */
488
+ nextCursor?: string;
314
489
  }
315
490
  /**
316
491
  * Formatted content using mdast AST.
@@ -392,6 +567,11 @@ interface SentMessage<TRawMessage = unknown> extends Message<TRawMessage> {
392
567
  /** Remove a reaction from this message */
393
568
  removeReaction(emoji: EmojiValue | string): Promise<void>;
394
569
  }
570
+ /**
571
+ * Input type for adapter postMessage/editMessage methods.
572
+ * This excludes streams since adapters handle content synchronously.
573
+ */
574
+ type AdapterPostableMessage = string | PostableRaw | PostableMarkdown | PostableAst | PostableCard | CardElement;
395
575
  /**
396
576
  * A message that can be posted to a thread.
397
577
  *
@@ -401,8 +581,9 @@ interface SentMessage<TRawMessage = unknown> extends Message<TRawMessage> {
401
581
  * - `{ ast: Root }` - mdast AST, converted to platform format
402
582
  * - `{ card: CardElement }` - Rich card with buttons (Block Kit / Adaptive Cards / GChat Cards)
403
583
  * - `CardElement` - Direct card element
584
+ * - `AsyncIterable<string>` - Streaming text (e.g., from AI SDK's textStream)
404
585
  */
405
- type PostableMessage = string | PostableRaw | PostableMarkdown | PostableAst | PostableCard | CardElement;
586
+ type PostableMessage = AdapterPostableMessage | AsyncIterable<string>;
406
587
  interface PostableRaw {
407
588
  /** Raw text passed through as-is to the platform */
408
589
  raw: string;
@@ -496,14 +677,14 @@ interface FileUpload {
496
677
  * });
497
678
  * ```
498
679
  */
499
- type MentionHandler = (thread: Thread, message: Message) => Promise<void>;
680
+ type MentionHandler<TState = Record<string, unknown>> = (thread: Thread<TState>, message: Message) => Promise<void>;
500
681
  /**
501
682
  * Handler for messages matching a regex pattern.
502
683
  *
503
684
  * Registered via `chat.onNewMessage(pattern, handler)`. Called when a message
504
685
  * matches the pattern in an unsubscribed thread.
505
686
  */
506
- type MessageHandler = (thread: Thread, message: Message) => Promise<void>;
687
+ type MessageHandler<TState = Record<string, unknown>> = (thread: Thread<TState>, message: Message) => Promise<void>;
507
688
  /**
508
689
  * Handler for messages in subscribed threads.
509
690
  *
@@ -527,7 +708,7 @@ type MessageHandler = (thread: Thread, message: Message) => Promise<void>;
527
708
  * });
528
709
  * ```
529
710
  */
530
- type SubscribedMessageHandler = (thread: Thread, message: Message) => Promise<void>;
711
+ type SubscribedMessageHandler<TState = Record<string, unknown>> = (thread: Thread<TState>, message: Message) => Promise<void>;
531
712
  /**
532
713
  * Well-known emoji that work across platforms (Slack and Google Chat).
533
714
  * These are normalized to a common format regardless of platform.
@@ -728,10 +909,19 @@ type Webhooks<TAdapters extends Record<string, Adapter>> = {
728
909
  [K in keyof TAdapters]: WebhookHandler;
729
910
  };
730
911
  /**
731
- * Main Chat class with type-safe adapter inference.
912
+ * Main Chat class with type-safe adapter inference and custom thread state.
913
+ *
914
+ * @template TAdapters - Map of adapter names to Adapter instances
915
+ * @template TState - Custom state type stored per-thread (default: Record<string, unknown>)
732
916
  *
733
917
  * @example
734
- * const chat = new Chat({
918
+ * // Define custom thread state type
919
+ * interface MyThreadState {
920
+ * aiMode?: boolean;
921
+ * userName?: string;
922
+ * }
923
+ *
924
+ * const chat = new Chat<typeof adapters, MyThreadState>({
735
925
  * userName: "mybot",
736
926
  * adapters: {
737
927
  * slack: createSlackAdapter({ ... }),
@@ -740,14 +930,18 @@ type Webhooks<TAdapters extends Record<string, Adapter>> = {
740
930
  * state: createMemoryState(),
741
931
  * });
742
932
  *
743
- * // Type-safe: only 'slack' and 'teams' are valid
744
- * chat.webhooks.slack(request, { waitUntil });
933
+ * // Type-safe thread state
934
+ * chat.onNewMention(async (thread, message) => {
935
+ * await thread.setState({ aiMode: true });
936
+ * const state = await thread.state; // Type: MyThreadState | null
937
+ * });
745
938
  */
746
- declare class Chat<TAdapters extends Record<string, Adapter> = Record<string, Adapter>> implements ChatInstance {
939
+ declare class Chat<TAdapters extends Record<string, Adapter> = Record<string, Adapter>, TState = Record<string, unknown>> implements ChatInstance {
747
940
  private adapters;
748
- private state;
941
+ private _stateAdapter;
749
942
  private userName;
750
943
  private logger;
944
+ private _streamingUpdateIntervalMs;
751
945
  private mentionHandlers;
752
946
  private messagePatterns;
753
947
  private subscribedMessageHandlers;
@@ -804,7 +998,7 @@ declare class Chat<TAdapters extends Record<string, Adapter> = Record<string, Ad
804
998
  * });
805
999
  * ```
806
1000
  */
807
- onNewMention(handler: MentionHandler): void;
1001
+ onNewMention(handler: MentionHandler<TState>): void;
808
1002
  /**
809
1003
  * Register a handler for messages matching a regex pattern.
810
1004
  *
@@ -819,7 +1013,7 @@ declare class Chat<TAdapters extends Record<string, Adapter> = Record<string, Ad
819
1013
  * });
820
1014
  * ```
821
1015
  */
822
- onNewMessage(pattern: RegExp, handler: MessageHandler): void;
1016
+ onNewMessage(pattern: RegExp, handler: MessageHandler<TState>): void;
823
1017
  /**
824
1018
  * Register a handler for messages in subscribed threads.
825
1019
  *
@@ -843,7 +1037,7 @@ declare class Chat<TAdapters extends Record<string, Adapter> = Record<string, Ad
843
1037
  * });
844
1038
  * ```
845
1039
  */
846
- onSubscribedMessage(handler: SubscribedMessageHandler): void;
1040
+ onSubscribedMessage(handler: SubscribedMessageHandler<TState>): void;
847
1041
  /**
848
1042
  * Register a handler for reaction events.
849
1043
  *
@@ -959,7 +1153,7 @@ declare class Chat<TAdapters extends Record<string, Adapter> = Record<string, Ad
959
1153
  * });
960
1154
  * ```
961
1155
  */
962
- openDM(user: string | Author): Promise<Thread>;
1156
+ openDM(user: string | Author): Promise<Thread<TState>>;
963
1157
  /**
964
1158
  * Infer which adapter to use based on the userId format.
965
1159
  */
@@ -985,6 +1179,71 @@ declare class Chat<TAdapters extends Record<string, Adapter> = Record<string, Ad
985
1179
  private runHandlers;
986
1180
  }
987
1181
 
1182
+ interface ThreadImplConfig {
1183
+ id: string;
1184
+ adapter: Adapter;
1185
+ channelId: string;
1186
+ stateAdapter: StateAdapter;
1187
+ initialMessage?: Message;
1188
+ /** If true, thread is known to be subscribed (for short-circuit optimization) */
1189
+ isSubscribedContext?: boolean;
1190
+ /** Whether this is a direct message conversation */
1191
+ isDM?: boolean;
1192
+ /** Current message context for streaming (provides userId/teamId) */
1193
+ currentMessage?: Message;
1194
+ /** Update interval for fallback streaming in milliseconds. Defaults to 500ms. */
1195
+ streamingUpdateIntervalMs?: number;
1196
+ }
1197
+ declare class ThreadImpl<TState = Record<string, unknown>> implements Thread<TState> {
1198
+ readonly id: string;
1199
+ readonly adapter: Adapter;
1200
+ readonly channelId: string;
1201
+ readonly isDM: boolean;
1202
+ private _stateAdapter;
1203
+ private _recentMessages;
1204
+ private _isSubscribedContext;
1205
+ /** Current message context for streaming - provides userId/teamId */
1206
+ private _currentMessage?;
1207
+ /** Update interval for fallback streaming */
1208
+ private _streamingUpdateIntervalMs;
1209
+ constructor(config: ThreadImplConfig);
1210
+ get recentMessages(): Message[];
1211
+ set recentMessages(messages: Message[]);
1212
+ /**
1213
+ * Get the current thread state.
1214
+ * Returns null if no state has been set.
1215
+ */
1216
+ get state(): Promise<TState | null>;
1217
+ /**
1218
+ * Set the thread state. Merges with existing state by default.
1219
+ * State is persisted for 30 days.
1220
+ */
1221
+ setState(newState: Partial<TState>, options?: {
1222
+ replace?: boolean;
1223
+ }): Promise<void>;
1224
+ get allMessages(): AsyncIterable<Message>;
1225
+ isSubscribed(): Promise<boolean>;
1226
+ subscribe(): Promise<void>;
1227
+ unsubscribe(): Promise<void>;
1228
+ post(message: string | PostableMessage | CardJSXElement): Promise<SentMessage>;
1229
+ /**
1230
+ * Handle streaming from an AsyncIterable.
1231
+ * Uses adapter's native streaming if available, otherwise falls back to post+edit.
1232
+ */
1233
+ private handleStream;
1234
+ startTyping(): Promise<void>;
1235
+ /**
1236
+ * Fallback streaming implementation using post + edit.
1237
+ * Used when adapter doesn't support native streaming.
1238
+ * Uses recursive setTimeout to send updates every intervalMs (default 500ms).
1239
+ * Schedules next update only after current edit completes to avoid overwhelming slow services.
1240
+ */
1241
+ private fallbackStream;
1242
+ refresh(): Promise<void>;
1243
+ mentionUser(userId: string): string;
1244
+ private createSentMessage;
1245
+ }
1246
+
988
1247
  /**
989
1248
  * Get or create an immutable singleton EmojiValue.
990
1249
  *
@@ -1150,6 +1409,8 @@ declare const emoji: ExtendedEmojiHelper;
1150
1409
  * Markdown parsing and conversion utilities using unified/remark.
1151
1410
  */
1152
1411
 
1412
+ type PostableMessageInput = AdapterPostableMessage;
1413
+
1153
1414
  /**
1154
1415
  * Parse markdown string into an AST.
1155
1416
  * Supports GFM (GitHub Flavored Markdown) for strikethrough, tables, etc.
@@ -1281,19 +1542,6 @@ declare abstract class BaseFormatConverter implements FormatConverter {
1281
1542
  */
1282
1543
  protected cardChildToFallbackText(child: CardChild): string | null;
1283
1544
  }
1284
- /**
1285
- * Type for PostableMessage input (for rendering to text)
1286
- */
1287
- type PostableMessageInput = string | {
1288
- raw: string;
1289
- } | {
1290
- markdown: string;
1291
- } | {
1292
- ast: Root;
1293
- } | {
1294
- card: CardElement;
1295
- fallbackText?: string;
1296
- } | CardElement;
1297
1545
 
1298
1546
  declare const Actions: typeof Actions$1;
1299
1547
  declare const Button: typeof Button$1;
@@ -1309,4 +1557,4 @@ declare const isJSX: typeof isJSX$1;
1309
1557
  declare const Section: typeof Section$1;
1310
1558
  declare const toCardElement: typeof toCardElement$1;
1311
1559
 
1312
- export { type ActionEvent, type ActionHandler, Actions, type Adapter, type Attachment, type Author, BaseFormatConverter, Button, Card, CardChild, CardElement, CardJSXElement, CardText, Chat, type ChatConfig, ChatError, type ChatInstance, ConsoleLogger, type CustomEmojiMap, DEFAULT_EMOJI_MAP, Divider, type Emoji, type EmojiFormats, type EmojiMapConfig, EmojiResolver, type EmojiValue, type FetchOptions, Field, Fields, type FileUpload, type FormatConverter, type FormattedContent, Image, type Lock, LockError, type LogLevel, type Logger, type MarkdownConverter, type MentionHandler, type Message, type MessageHandler, type MessageMetadata, NotImplementedError, type PostableAst, type PostableCard, type PostableMarkdown, type PostableMessage, type PostableRaw, RateLimitError, type RawMessage, type ReactionEvent, type ReactionHandler, Section, type SentMessage, type StateAdapter, type SubscribedMessageHandler, type Thread, type ThreadInfo, type WebhookOptions, type WellKnownEmoji, blockquote, codeBlock, convertEmojiPlaceholders, createEmoji, defaultEmojiResolver, emoji, emphasis, fromReactElement, getEmoji, inlineCode, isCardElement, isJSX, link, markdownToPlainText, paragraph, parseMarkdown, root, strikethrough, stringifyMarkdown, strong, text, toCardElement, toPlainText, walkAst };
1560
+ export { type ActionEvent, type ActionHandler, Actions, type Adapter, type AdapterPostableMessage, type Attachment, type Author, BaseFormatConverter, Button, Card, CardChild, CardElement, CardJSXElement, CardText, Chat, type ChatConfig, ChatError, type ChatInstance, ConsoleLogger, type CustomEmojiMap, DEFAULT_EMOJI_MAP, Divider, type Emoji, type EmojiFormats, type EmojiMapConfig, EmojiResolver, type EmojiValue, type FetchDirection, type FetchOptions, type FetchResult, Field, Fields, type FileUpload, type FormatConverter, type FormattedContent, Image, type Lock, LockError, type LogLevel, type Logger, type MarkdownConverter, type MentionHandler, type Message, type MessageHandler, type MessageMetadata, NotImplementedError, type PostableAst, type PostableCard, type PostableMarkdown, type PostableMessage, type PostableRaw, RateLimitError, type RawMessage, type ReactionEvent, type ReactionHandler, Section, type SentMessage, type StateAdapter, type StreamOptions, type SubscribedMessageHandler, THREAD_STATE_TTL_MS, type Thread, ThreadImpl, type ThreadInfo, type WebhookOptions, type WellKnownEmoji, blockquote, codeBlock, convertEmojiPlaceholders, createEmoji, defaultEmojiResolver, emoji, emphasis, fromReactElement, getEmoji, inlineCode, isCardElement, isJSX, link, markdownToPlainText, paragraph, parseMarkdown, root, strikethrough, stringifyMarkdown, strong, text, toCardElement, toPlainText, walkAst };