chat 4.21.0 → 4.23.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 +175 -6
- package/dist/index.js +383 -68
- package/dist/index.js.map +1 -1
- package/docs/concurrency.mdx +223 -0
- package/docs/meta.json +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ declare class MessageHistoryCache {
|
|
|
42
42
|
interface SerializedChannel {
|
|
43
43
|
_type: "chat:Channel";
|
|
44
44
|
adapterName: string;
|
|
45
|
+
channelVisibility?: ChannelVisibility;
|
|
45
46
|
id: string;
|
|
46
47
|
isDM: boolean;
|
|
47
48
|
}
|
|
@@ -50,6 +51,7 @@ interface SerializedChannel {
|
|
|
50
51
|
*/
|
|
51
52
|
interface ChannelImplConfigWithAdapter {
|
|
52
53
|
adapter: Adapter;
|
|
54
|
+
channelVisibility?: ChannelVisibility;
|
|
53
55
|
id: string;
|
|
54
56
|
isDM?: boolean;
|
|
55
57
|
messageHistory?: MessageHistoryCache;
|
|
@@ -60,6 +62,7 @@ interface ChannelImplConfigWithAdapter {
|
|
|
60
62
|
*/
|
|
61
63
|
interface ChannelImplConfigLazy {
|
|
62
64
|
adapterName: string;
|
|
65
|
+
channelVisibility?: ChannelVisibility;
|
|
63
66
|
id: string;
|
|
64
67
|
isDM?: boolean;
|
|
65
68
|
}
|
|
@@ -67,6 +70,7 @@ type ChannelImplConfig = ChannelImplConfigWithAdapter | ChannelImplConfigLazy;
|
|
|
67
70
|
declare class ChannelImpl<TState = Record<string, unknown>> implements Channel<TState> {
|
|
68
71
|
readonly id: string;
|
|
69
72
|
readonly isDM: boolean;
|
|
73
|
+
readonly channelVisibility: ChannelVisibility;
|
|
70
74
|
private _adapter?;
|
|
71
75
|
private readonly _adapterName?;
|
|
72
76
|
private _stateAdapterInstance?;
|
|
@@ -144,6 +148,7 @@ interface SerializedThread {
|
|
|
144
148
|
_type: "chat:Thread";
|
|
145
149
|
adapterName: string;
|
|
146
150
|
channelId: string;
|
|
151
|
+
channelVisibility?: ChannelVisibility;
|
|
147
152
|
currentMessage?: SerializedMessage;
|
|
148
153
|
id: string;
|
|
149
154
|
isDM: boolean;
|
|
@@ -154,6 +159,7 @@ interface SerializedThread {
|
|
|
154
159
|
interface ThreadImplConfigWithAdapter {
|
|
155
160
|
adapter: Adapter;
|
|
156
161
|
channelId: string;
|
|
162
|
+
channelVisibility?: ChannelVisibility;
|
|
157
163
|
currentMessage?: Message;
|
|
158
164
|
fallbackStreamingPlaceholderText?: string | null;
|
|
159
165
|
id: string;
|
|
@@ -172,6 +178,7 @@ interface ThreadImplConfigWithAdapter {
|
|
|
172
178
|
interface ThreadImplConfigLazy {
|
|
173
179
|
adapterName: string;
|
|
174
180
|
channelId: string;
|
|
181
|
+
channelVisibility?: ChannelVisibility;
|
|
175
182
|
currentMessage?: Message;
|
|
176
183
|
fallbackStreamingPlaceholderText?: string | null;
|
|
177
184
|
id: string;
|
|
@@ -186,6 +193,7 @@ declare class ThreadImpl<TState = Record<string, unknown>> implements Thread<TSt
|
|
|
186
193
|
readonly id: string;
|
|
187
194
|
readonly channelId: string;
|
|
188
195
|
readonly isDM: boolean;
|
|
196
|
+
readonly channelVisibility: ChannelVisibility;
|
|
189
197
|
/** Direct adapter instance (if provided) */
|
|
190
198
|
private _adapter?;
|
|
191
199
|
/** Adapter name for lazy resolution */
|
|
@@ -329,6 +337,16 @@ declare class NotImplementedError extends ChatError {
|
|
|
329
337
|
constructor(message: string, feature?: string, cause?: unknown);
|
|
330
338
|
}
|
|
331
339
|
|
|
340
|
+
/**
|
|
341
|
+
* Represents the visibility scope of a channel.
|
|
342
|
+
*
|
|
343
|
+
* - `private`: Channel is only visible to invited members (e.g., private Slack channels)
|
|
344
|
+
* - `workspace`: Channel is visible to all workspace members (e.g., public Slack channels)
|
|
345
|
+
* - `external`: Channel is shared with external organizations (e.g., Slack Connect)
|
|
346
|
+
* - `unknown`: Visibility cannot be determined
|
|
347
|
+
*/
|
|
348
|
+
type ChannelVisibility = "private" | "workspace" | "external" | "unknown";
|
|
349
|
+
|
|
332
350
|
/**
|
|
333
351
|
* Chat configuration with type-safe adapter inference.
|
|
334
352
|
* @template TAdapters - Record of adapter name to adapter instance
|
|
@@ -336,6 +354,20 @@ declare class NotImplementedError extends ChatError {
|
|
|
336
354
|
interface ChatConfig<TAdapters extends Record<string, Adapter> = Record<string, Adapter>> {
|
|
337
355
|
/** Map of adapter name to adapter instance */
|
|
338
356
|
adapters: TAdapters;
|
|
357
|
+
/**
|
|
358
|
+
* How to handle messages that arrive while a handler is already
|
|
359
|
+
* processing on the same thread.
|
|
360
|
+
*
|
|
361
|
+
* - `'drop'` (default) — discard the message (throw `LockError`)
|
|
362
|
+
* - `'queue'` — queue the message; when the current handler finishes,
|
|
363
|
+
* process only the latest queued message with `context.skipped` containing
|
|
364
|
+
* all intermediate messages
|
|
365
|
+
* - `'debounce'` — all messages start/reset a debounce timer; only the
|
|
366
|
+
* final message in a burst is processed
|
|
367
|
+
* - `'concurrent'` — no locking; all messages processed in parallel
|
|
368
|
+
* - `ConcurrencyConfig` — fine-grained control over strategy and parameters
|
|
369
|
+
*/
|
|
370
|
+
concurrency?: ConcurrencyStrategy | ConcurrencyConfig;
|
|
339
371
|
/**
|
|
340
372
|
* TTL for message deduplication entries in milliseconds.
|
|
341
373
|
* Defaults to 300000 (5 minutes). Increase if your webhook cold starts
|
|
@@ -350,6 +382,17 @@ interface ChatConfig<TAdapters extends Record<string, Adapter> = Record<string,
|
|
|
350
382
|
* wait until some real text has been streamed before creating the message.
|
|
351
383
|
*/
|
|
352
384
|
fallbackStreamingPlaceholderText?: string | null;
|
|
385
|
+
/**
|
|
386
|
+
* Lock scope determines which messages contend for the same lock.
|
|
387
|
+
*
|
|
388
|
+
* - `'thread'`: lock per threadId (default for most adapters)
|
|
389
|
+
* - `'channel'`: lock per channelId (default for WhatsApp, Telegram)
|
|
390
|
+
* - function: resolve scope dynamically per message (async supported)
|
|
391
|
+
*
|
|
392
|
+
* When not set, falls back to the adapter's `lockScope` property,
|
|
393
|
+
* then to `'thread'`.
|
|
394
|
+
*/
|
|
395
|
+
lockScope?: LockScope | ((context: LockScopeContext) => LockScope | Promise<LockScope>);
|
|
353
396
|
/**
|
|
354
397
|
* Logger instance or log level.
|
|
355
398
|
* Pass "silent" to disable all logging.
|
|
@@ -366,6 +409,8 @@ interface ChatConfig<TAdapters extends Record<string, Adapter> = Record<string,
|
|
|
366
409
|
ttlMs?: number;
|
|
367
410
|
};
|
|
368
411
|
/**
|
|
412
|
+
* @deprecated Use `concurrency` instead.
|
|
413
|
+
*
|
|
369
414
|
* Behavior when a thread lock cannot be acquired (another handler is processing).
|
|
370
415
|
* - `'drop'` (default) — throw `LockError`, preserving current behavior
|
|
371
416
|
* - `'force'` — force-release the existing lock and re-acquire
|
|
@@ -486,6 +531,16 @@ interface Adapter<TThreadId = unknown, TRawMessage = unknown> {
|
|
|
486
531
|
fetchMessages(threadId: string, options?: FetchOptions): Promise<FetchResult<TRawMessage>>;
|
|
487
532
|
/** Fetch thread metadata */
|
|
488
533
|
fetchThread(threadId: string): Promise<ThreadInfo>;
|
|
534
|
+
/**
|
|
535
|
+
* Get the visibility scope of a channel containing the thread.
|
|
536
|
+
*
|
|
537
|
+
* This distinguishes between private channels, workspace-visible channels,
|
|
538
|
+
* and externally shared channels (e.g., Slack Connect).
|
|
539
|
+
*
|
|
540
|
+
* @param threadId - The thread ID to check
|
|
541
|
+
* @returns The channel visibility scope
|
|
542
|
+
*/
|
|
543
|
+
getChannelVisibility?(threadId: string): ChannelVisibility;
|
|
489
544
|
/** Handle incoming webhook request */
|
|
490
545
|
handleWebhook(request: Request, options?: WebhookOptions): Promise<Response>;
|
|
491
546
|
/** Called when Chat instance is created (internal use) */
|
|
@@ -501,6 +556,14 @@ interface Adapter<TThreadId = unknown, TRawMessage = unknown> {
|
|
|
501
556
|
* List threads in a channel.
|
|
502
557
|
*/
|
|
503
558
|
listThreads?(channelId: string, options?: ListThreadsOptions): Promise<ListThreadsResult<TRawMessage>>;
|
|
559
|
+
/**
|
|
560
|
+
* Default lock scope for this adapter.
|
|
561
|
+
* - `'thread'` (default): lock per threadId
|
|
562
|
+
* - `'channel'`: lock per channelId (for channel-based platforms like WhatsApp, Telegram)
|
|
563
|
+
*
|
|
564
|
+
* Can be overridden by `ChatConfig.lockScope`.
|
|
565
|
+
*/
|
|
566
|
+
readonly lockScope?: LockScope;
|
|
504
567
|
/** Unique name for this adapter (e.g., "slack", "teams") */
|
|
505
568
|
readonly name: string;
|
|
506
569
|
/**
|
|
@@ -716,6 +779,57 @@ interface ChatInstance {
|
|
|
716
779
|
channelId: string;
|
|
717
780
|
}, options?: WebhookOptions): void;
|
|
718
781
|
}
|
|
782
|
+
/** Lock scope determines which messages contend for the same lock. */
|
|
783
|
+
type LockScope = "thread" | "channel";
|
|
784
|
+
/** Context provided to the lockScope resolver function. */
|
|
785
|
+
interface LockScopeContext {
|
|
786
|
+
adapter: Adapter;
|
|
787
|
+
channelId: string;
|
|
788
|
+
isDM: boolean;
|
|
789
|
+
threadId: string;
|
|
790
|
+
}
|
|
791
|
+
/** Concurrency strategy for overlapping messages on the same thread. */
|
|
792
|
+
type ConcurrencyStrategy = "drop" | "queue" | "debounce" | "concurrent";
|
|
793
|
+
/** Fine-grained concurrency configuration. */
|
|
794
|
+
interface ConcurrencyConfig {
|
|
795
|
+
/** Debounce window in milliseconds (debounce strategy). Default: 1500. */
|
|
796
|
+
debounceMs?: number;
|
|
797
|
+
/** Max concurrent handlers per thread (concurrent strategy). Default: Infinity. */
|
|
798
|
+
maxConcurrent?: number;
|
|
799
|
+
/** Max queued messages per thread (queue/debounce strategy). Default: 10. */
|
|
800
|
+
maxQueueSize?: number;
|
|
801
|
+
/** What to do when queue is full. Default: 'drop-oldest'. */
|
|
802
|
+
onQueueFull?: "drop-oldest" | "drop-newest";
|
|
803
|
+
/** TTL for queued entries in milliseconds. Default: 90000 (90s). */
|
|
804
|
+
queueEntryTtlMs?: number;
|
|
805
|
+
/** The concurrency strategy to use. */
|
|
806
|
+
strategy: ConcurrencyStrategy;
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* An entry in the per-thread message queue.
|
|
810
|
+
* Used by the `queue` and `debounce` concurrency strategies.
|
|
811
|
+
*/
|
|
812
|
+
interface QueueEntry {
|
|
813
|
+
/** When this entry was enqueued (Unix ms). */
|
|
814
|
+
enqueuedAt: number;
|
|
815
|
+
/** When this entry expires (Unix ms). Stale entries are discarded on dequeue. */
|
|
816
|
+
expiresAt: number;
|
|
817
|
+
/** The queued message. */
|
|
818
|
+
message: Message;
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* Context provided to message handlers when messages were queued
|
|
822
|
+
* while a previous handler was running.
|
|
823
|
+
*/
|
|
824
|
+
interface MessageContext {
|
|
825
|
+
/**
|
|
826
|
+
* Messages that arrived while the previous handler was running,
|
|
827
|
+
* in chronological order, excluding the current message (which is the latest).
|
|
828
|
+
*/
|
|
829
|
+
skipped: Message[];
|
|
830
|
+
/** Total messages received since last handler ran (skipped.length + 1). */
|
|
831
|
+
totalSinceLastHandler: number;
|
|
832
|
+
}
|
|
719
833
|
interface StateAdapter {
|
|
720
834
|
/** Acquire a lock on a thread (returns null if already locked) */
|
|
721
835
|
acquireLock(threadId: string, ttlMs: number): Promise<Lock | null>;
|
|
@@ -728,8 +842,12 @@ interface StateAdapter {
|
|
|
728
842
|
connect(): Promise<void>;
|
|
729
843
|
/** Delete a cached value */
|
|
730
844
|
delete(key: string): Promise<void>;
|
|
845
|
+
/** Pop the next message from the thread's queue. Returns null if empty. */
|
|
846
|
+
dequeue(threadId: string): Promise<QueueEntry | null>;
|
|
731
847
|
/** Disconnect from the state backend */
|
|
732
848
|
disconnect(): Promise<void>;
|
|
849
|
+
/** Atomically append a message to the thread's pending queue. Returns new queue depth. */
|
|
850
|
+
enqueue(threadId: string, entry: QueueEntry, maxSize: number): Promise<number>;
|
|
733
851
|
/** Extend a lock's TTL */
|
|
734
852
|
extendLock(lock: Lock, ttlMs: number): Promise<boolean>;
|
|
735
853
|
/**
|
|
@@ -744,6 +862,8 @@ interface StateAdapter {
|
|
|
744
862
|
getList<T = unknown>(key: string): Promise<T[]>;
|
|
745
863
|
/** Check if subscribed to a thread */
|
|
746
864
|
isSubscribed(threadId: string): Promise<boolean>;
|
|
865
|
+
/** Get the current queue depth for a thread. */
|
|
866
|
+
queueDepth(threadId: string): Promise<number>;
|
|
747
867
|
/** Release a lock */
|
|
748
868
|
releaseLock(lock: Lock): Promise<void>;
|
|
749
869
|
/** Set a cached value with optional TTL in milliseconds */
|
|
@@ -770,6 +890,8 @@ interface Lock {
|
|
|
770
890
|
interface Postable<TState = Record<string, unknown>, TRawMessage = unknown> {
|
|
771
891
|
/** The adapter this entity belongs to */
|
|
772
892
|
readonly adapter: Adapter;
|
|
893
|
+
/** The visibility scope of this channel */
|
|
894
|
+
readonly channelVisibility: ChannelVisibility;
|
|
773
895
|
/** Unique ID */
|
|
774
896
|
readonly id: string;
|
|
775
897
|
/** Whether this is a direct message conversation */
|
|
@@ -869,6 +991,8 @@ interface ThreadSummary<TRawMessage = unknown> {
|
|
|
869
991
|
* Channel metadata returned by fetchInfo().
|
|
870
992
|
*/
|
|
871
993
|
interface ChannelInfo {
|
|
994
|
+
/** The visibility scope of this channel */
|
|
995
|
+
channelVisibility?: ChannelVisibility;
|
|
872
996
|
id: string;
|
|
873
997
|
isDM?: boolean;
|
|
874
998
|
memberCount?: number;
|
|
@@ -1038,6 +1162,8 @@ interface Thread<TState = Record<string, unknown>, TRawMessage = unknown> extend
|
|
|
1038
1162
|
interface ThreadInfo {
|
|
1039
1163
|
channelId: string;
|
|
1040
1164
|
channelName?: string;
|
|
1165
|
+
/** The visibility scope of this channel */
|
|
1166
|
+
channelVisibility?: ChannelVisibility;
|
|
1041
1167
|
id: string;
|
|
1042
1168
|
/** Whether this is a direct message conversation */
|
|
1043
1169
|
isDM?: boolean;
|
|
@@ -1349,7 +1475,7 @@ interface FileUpload {
|
|
|
1349
1475
|
* });
|
|
1350
1476
|
* ```
|
|
1351
1477
|
*/
|
|
1352
|
-
type MentionHandler<TState = Record<string, unknown>> = (thread: Thread<TState>, message: Message) => void | Promise<void>;
|
|
1478
|
+
type MentionHandler<TState = Record<string, unknown>> = (thread: Thread<TState>, message: Message, context?: MessageContext) => void | Promise<void>;
|
|
1353
1479
|
/**
|
|
1354
1480
|
* Handler for direct messages (1:1 conversations with the bot).
|
|
1355
1481
|
*
|
|
@@ -1358,14 +1484,14 @@ type MentionHandler<TState = Record<string, unknown>> = (thread: Thread<TState>,
|
|
|
1358
1484
|
* handlers are registered, DMs fall through to `onNewMention` for backward
|
|
1359
1485
|
* compatibility.
|
|
1360
1486
|
*/
|
|
1361
|
-
type DirectMessageHandler<TState = Record<string, unknown>> = (thread: Thread<TState>, message: Message, channel: Channel<TState
|
|
1487
|
+
type DirectMessageHandler<TState = Record<string, unknown>> = (thread: Thread<TState>, message: Message, channel: Channel<TState>, context?: MessageContext) => void | Promise<void>;
|
|
1362
1488
|
/**
|
|
1363
1489
|
* Handler for messages matching a regex pattern.
|
|
1364
1490
|
*
|
|
1365
1491
|
* Registered via `chat.onNewMessage(pattern, handler)`. Called when a message
|
|
1366
1492
|
* matches the pattern in an unsubscribed thread.
|
|
1367
1493
|
*/
|
|
1368
|
-
type MessageHandler<TState = Record<string, unknown>> = (thread: Thread<TState>, message: Message) => void | Promise<void>;
|
|
1494
|
+
type MessageHandler<TState = Record<string, unknown>> = (thread: Thread<TState>, message: Message, context?: MessageContext) => void | Promise<void>;
|
|
1369
1495
|
/**
|
|
1370
1496
|
* Handler for messages in subscribed threads.
|
|
1371
1497
|
*
|
|
@@ -1389,7 +1515,7 @@ type MessageHandler<TState = Record<string, unknown>> = (thread: Thread<TState>,
|
|
|
1389
1515
|
* });
|
|
1390
1516
|
* ```
|
|
1391
1517
|
*/
|
|
1392
|
-
type SubscribedMessageHandler<TState = Record<string, unknown>> = (thread: Thread<TState>, message: Message) => void | Promise<void>;
|
|
1518
|
+
type SubscribedMessageHandler<TState = Record<string, unknown>> = (thread: Thread<TState>, message: Message, context?: MessageContext) => void | Promise<void>;
|
|
1393
1519
|
/**
|
|
1394
1520
|
* Well-known emoji that work across platforms (Slack and Google Chat).
|
|
1395
1521
|
* These are normalized to a common format regardless of platform.
|
|
@@ -2101,6 +2227,9 @@ declare class Chat<TAdapters extends Record<string, Adapter> = Record<string, Ad
|
|
|
2101
2227
|
private readonly _dedupeTtlMs;
|
|
2102
2228
|
private readonly _onLockConflict;
|
|
2103
2229
|
private readonly _messageHistory;
|
|
2230
|
+
private readonly _concurrencyStrategy;
|
|
2231
|
+
private readonly _concurrencyConfig;
|
|
2232
|
+
private readonly _lockScope;
|
|
2104
2233
|
private readonly mentionHandlers;
|
|
2105
2234
|
private readonly directMessageHandlers;
|
|
2106
2235
|
private readonly messagePatterns;
|
|
@@ -2470,6 +2599,12 @@ declare class Chat<TAdapters extends Record<string, Adapter> = Record<string, Ad
|
|
|
2470
2599
|
* Infer which adapter to use based on the userId format.
|
|
2471
2600
|
*/
|
|
2472
2601
|
private inferAdapterFromUserId;
|
|
2602
|
+
/**
|
|
2603
|
+
* Resolve the lock key for a message based on lock scope.
|
|
2604
|
+
* With 'thread' scope, returns threadId. With 'channel' scope,
|
|
2605
|
+
* returns channelId (derived via adapter.channelIdFromThreadId).
|
|
2606
|
+
*/
|
|
2607
|
+
private getLockKey;
|
|
2473
2608
|
/**
|
|
2474
2609
|
* Handle an incoming message from an adapter.
|
|
2475
2610
|
* This is called by adapters when they receive a webhook.
|
|
@@ -2478,9 +2613,36 @@ declare class Chat<TAdapters extends Record<string, Adapter> = Record<string, Ad
|
|
|
2478
2613
|
* - Deduplication: Same message may arrive multiple times (e.g., Slack sends
|
|
2479
2614
|
* both `message` and `app_mention` events, GChat sends direct webhook + Pub/Sub)
|
|
2480
2615
|
* - Bot filtering: Messages from the bot itself are skipped
|
|
2481
|
-
* -
|
|
2616
|
+
* - Concurrency: Controlled by `concurrency` config (drop, queue, debounce, concurrent)
|
|
2482
2617
|
*/
|
|
2483
2618
|
handleIncomingMessage(adapter: Adapter, threadId: string, message: Message): Promise<void>;
|
|
2619
|
+
/**
|
|
2620
|
+
* Drop strategy: acquire lock or fail. Original behavior.
|
|
2621
|
+
*/
|
|
2622
|
+
private handleDrop;
|
|
2623
|
+
/**
|
|
2624
|
+
* Queue/Debounce strategy: enqueue if lock is busy, drain after processing.
|
|
2625
|
+
*/
|
|
2626
|
+
private handleQueueOrDebounce;
|
|
2627
|
+
/**
|
|
2628
|
+
* Debounce loop: wait for debounceMs, check if newer message arrived,
|
|
2629
|
+
* repeat until no new messages, then process the final message.
|
|
2630
|
+
*/
|
|
2631
|
+
private debounceLoop;
|
|
2632
|
+
/**
|
|
2633
|
+
* Drain queue: collect all pending messages, dispatch the latest with
|
|
2634
|
+
* skipped context, then check for more.
|
|
2635
|
+
*/
|
|
2636
|
+
private drainQueue;
|
|
2637
|
+
/**
|
|
2638
|
+
* Concurrent strategy: no locking, process immediately.
|
|
2639
|
+
*/
|
|
2640
|
+
private handleConcurrent;
|
|
2641
|
+
/**
|
|
2642
|
+
* Dispatch a message to the appropriate handler chain based on
|
|
2643
|
+
* subscription status, mention detection, and pattern matching.
|
|
2644
|
+
*/
|
|
2645
|
+
private dispatchToHandlers;
|
|
2484
2646
|
private createThread;
|
|
2485
2647
|
/**
|
|
2486
2648
|
* Detect if the bot was mentioned in the message.
|
|
@@ -2488,6 +2650,13 @@ declare class Chat<TAdapters extends Record<string, Adapter> = Record<string, Ad
|
|
|
2488
2650
|
*/
|
|
2489
2651
|
private detectMention;
|
|
2490
2652
|
private escapeRegex;
|
|
2653
|
+
/**
|
|
2654
|
+
* Reconstruct a proper Message instance from a dequeued entry.
|
|
2655
|
+
* After JSON roundtrip through the state adapter, the message is a plain
|
|
2656
|
+
* object (not a Message instance). This restores class invariants like
|
|
2657
|
+
* `links` defaulting to `[]` and `metadata.dateSent` being a Date.
|
|
2658
|
+
*/
|
|
2659
|
+
private rehydrateMessage;
|
|
2491
2660
|
private runHandlers;
|
|
2492
2661
|
}
|
|
2493
2662
|
|
|
@@ -3001,4 +3170,4 @@ declare const Select: SelectComponent;
|
|
|
3001
3170
|
declare const SelectOption: SelectOptionComponent;
|
|
3002
3171
|
declare const TextInput: TextInputComponent;
|
|
3003
3172
|
|
|
3004
|
-
export { type ActionEvent, type ActionHandler, Actions, ActionsComponent, type Adapter, type AdapterPostableMessage, type AiAssistantMessage, type AiFilePart, type AiImagePart, type AiMessage, type AiMessagePart, type AiTextPart, type AiUserMessage, type AppHomeOpenedEvent, type AppHomeOpenedHandler, type AssistantContextChangedEvent, type AssistantContextChangedHandler, type AssistantThreadStartedEvent, type AssistantThreadStartedHandler, type Attachment, type Author, BaseFormatConverter, Button, ButtonComponent, Card, CardChild, CardComponent, CardElement, CardLink, CardLinkComponent, CardText, type Channel, ChannelImpl, type ChannelInfo, Chat, type ChatConfig, ChatElement, ChatError, type ChatInstance, ConsoleLogger, type CustomEmojiMap, DEFAULT_EMOJI_MAP, type DirectMessageHandler, Divider, DividerComponent, type Emoji, type EmojiFormats, type EmojiMapConfig, EmojiResolver, type EmojiValue, type EphemeralMessage, type FetchDirection, type FetchOptions, type FetchResult, Field, FieldComponent, Fields, FieldsComponent, type FileUpload, type FormatConverter, type FormattedContent, Image, ImageComponent, LinkButton, LinkButtonComponent, type LinkPreview, type ListThreadsOptions, type ListThreadsResult, type Lock, LockError, type LogLevel, type Logger, type MarkdownConverter, type MarkdownTextChunk, type MemberJoinedChannelEvent, type MemberJoinedChannelHandler, type MentionHandler, Message, type MessageData, type MessageHandler, MessageHistoryCache, type MessageHistoryConfig, type MessageMetadata, Modal, type ModalCloseEvent, type ModalCloseHandler, type ModalCloseResponse, ModalComponent, ModalElement, type ModalErrorsResponse, type ModalPushResponse, type ModalResponse, type ModalSubmitEvent, type ModalSubmitHandler, type ModalUpdateResponse, NotImplementedError, type PlanUpdateChunk, type PostEphemeralOptions, type Postable, type PostableAst, type PostableCard, type PostableMarkdown, type PostableMessage, type PostableRaw, RadioSelect, RadioSelectComponent, RateLimitError, type RawMessage, type ReactionEvent, type ReactionHandler, type ScheduledMessage, Section, SectionComponent, Select, SelectComponent, SelectOption, SelectOptionComponent, type SentMessage, type SerializedChannel, type SerializedMessage, type SerializedThread, type SlashCommandEvent, type SlashCommandHandler, type StateAdapter, type StreamChunk, type StreamEvent, type StreamOptions, StreamingMarkdownRenderer, type SubscribedMessageHandler, THREAD_STATE_TTL_MS, Table, type TaskUpdateChunk, TextComponent, TextInput, TextInputComponent, type Thread, ThreadImpl, type ThreadInfo, type ThreadSummary, type WebhookOptions, type WellKnownEmoji, blockquote, cardChildToFallbackText, codeBlock, convertEmojiPlaceholders, createEmoji, defaultEmojiResolver, deriveChannelId, emoji, emphasis, fromFullStream, fromReactElement, fromReactModalElement, getEmoji, getNodeChildren, getNodeValue, inlineCode, isBlockquoteNode, isCardElement, isCodeNode, isDeleteNode, isEmphasisNode, isInlineCodeNode, isJSX, isLinkNode, isListItemNode, isListNode, isModalElement, isParagraphNode, isStrongNode, isTableCellNode, isTableNode, isTableRowNode, isTextNode, link, markdownToPlainText, paragraph, parseMarkdown, root, strikethrough, stringifyMarkdown, strong, tableElementToAscii, tableToAscii, text, toAiMessages, toCardElement, toModalElement, toPlainText, walkAst };
|
|
3173
|
+
export { type ActionEvent, type ActionHandler, Actions, ActionsComponent, type Adapter, type AdapterPostableMessage, type AiAssistantMessage, type AiFilePart, type AiImagePart, type AiMessage, type AiMessagePart, type AiTextPart, type AiUserMessage, type AppHomeOpenedEvent, type AppHomeOpenedHandler, type AssistantContextChangedEvent, type AssistantContextChangedHandler, type AssistantThreadStartedEvent, type AssistantThreadStartedHandler, type Attachment, type Author, BaseFormatConverter, Button, ButtonComponent, Card, CardChild, CardComponent, CardElement, CardLink, CardLinkComponent, CardText, type Channel, ChannelImpl, type ChannelInfo, type ChannelVisibility, Chat, type ChatConfig, ChatElement, ChatError, type ChatInstance, type ConcurrencyConfig, type ConcurrencyStrategy, ConsoleLogger, type CustomEmojiMap, DEFAULT_EMOJI_MAP, type DirectMessageHandler, Divider, DividerComponent, type Emoji, type EmojiFormats, type EmojiMapConfig, EmojiResolver, type EmojiValue, type EphemeralMessage, type FetchDirection, type FetchOptions, type FetchResult, Field, FieldComponent, Fields, FieldsComponent, type FileUpload, type FormatConverter, type FormattedContent, Image, ImageComponent, LinkButton, LinkButtonComponent, type LinkPreview, type ListThreadsOptions, type ListThreadsResult, type Lock, LockError, type LockScope, type LockScopeContext, type LogLevel, type Logger, type MarkdownConverter, type MarkdownTextChunk, type MemberJoinedChannelEvent, type MemberJoinedChannelHandler, type MentionHandler, Message, type MessageContext, type MessageData, type MessageHandler, MessageHistoryCache, type MessageHistoryConfig, type MessageMetadata, Modal, type ModalCloseEvent, type ModalCloseHandler, type ModalCloseResponse, ModalComponent, ModalElement, type ModalErrorsResponse, type ModalPushResponse, type ModalResponse, type ModalSubmitEvent, type ModalSubmitHandler, type ModalUpdateResponse, NotImplementedError, type PlanUpdateChunk, type PostEphemeralOptions, type Postable, type PostableAst, type PostableCard, type PostableMarkdown, type PostableMessage, type PostableRaw, type QueueEntry, RadioSelect, RadioSelectComponent, RateLimitError, type RawMessage, type ReactionEvent, type ReactionHandler, type ScheduledMessage, Section, SectionComponent, Select, SelectComponent, SelectOption, SelectOptionComponent, type SentMessage, type SerializedChannel, type SerializedMessage, type SerializedThread, type SlashCommandEvent, type SlashCommandHandler, type StateAdapter, type StreamChunk, type StreamEvent, type StreamOptions, StreamingMarkdownRenderer, type SubscribedMessageHandler, THREAD_STATE_TTL_MS, Table, type TaskUpdateChunk, TextComponent, TextInput, TextInputComponent, type Thread, ThreadImpl, type ThreadInfo, type ThreadSummary, type WebhookOptions, type WellKnownEmoji, blockquote, cardChildToFallbackText, codeBlock, convertEmojiPlaceholders, createEmoji, defaultEmojiResolver, deriveChannelId, emoji, emphasis, fromFullStream, fromReactElement, fromReactModalElement, getEmoji, getNodeChildren, getNodeValue, inlineCode, isBlockquoteNode, isCardElement, isCodeNode, isDeleteNode, isEmphasisNode, isInlineCodeNode, isJSX, isLinkNode, isListItemNode, isListNode, isModalElement, isParagraphNode, isStrongNode, isTableCellNode, isTableNode, isTableRowNode, isTextNode, link, markdownToPlainText, paragraph, parseMarkdown, root, strikethrough, stringifyMarkdown, strong, tableElementToAscii, tableToAscii, text, toAiMessages, toCardElement, toModalElement, toPlainText, walkAst };
|