chat 4.13.3 → 4.14.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
@@ -62,7 +62,7 @@ interface ChatConfig<TAdapters extends Record<string, Adapter> = Record<string,
62
62
  * Logger instance or log level.
63
63
  * Pass "silent" to disable all logging.
64
64
  */
65
- logger: Logger | LogLevel;
65
+ logger?: Logger | LogLevel;
66
66
  /** State adapter for subscriptions and locking */
67
67
  state: StateAdapter;
68
68
  /**
@@ -242,7 +242,7 @@ interface Adapter<TThreadId = unknown, TRawMessage = unknown> {
242
242
  /** Render formatted content to platform-specific string */
243
243
  renderFormatted(content: FormattedContent): string;
244
244
  /** Show typing indicator */
245
- startTyping(threadId: string): Promise<void>;
245
+ startTyping(threadId: string, status?: string): Promise<void>;
246
246
  /**
247
247
  * Stream a message using platform-native streaming APIs.
248
248
  *
@@ -410,7 +410,7 @@ interface Postable<TState = Record<string, unknown>, TRawMessage = unknown> {
410
410
  replace?: boolean;
411
411
  }): Promise<void>;
412
412
  /** Show typing indicator */
413
- startTyping(): Promise<void>;
413
+ startTyping(status?: string): Promise<void>;
414
414
  /**
415
415
  * Get the current state.
416
416
  * Returns null if no state has been set.
@@ -589,8 +589,9 @@ interface Thread<TState = Record<string, unknown>, TRawMessage = unknown> extend
589
589
  * Show typing indicator in the thread.
590
590
  *
591
591
  * Some platforms support persistent typing indicators, others just send once.
592
+ * Optional status (e.g. "Typing...", "Searching documents...") is shown where supported.
592
593
  */
593
- startTyping(): Promise<void>;
594
+ startTyping(status?: string): Promise<void>;
594
595
  /**
595
596
  * Subscribe to future messages in this thread.
596
597
  *
@@ -1499,7 +1500,7 @@ declare class ChannelImpl<TState = Record<string, unknown>> implements Channel<T
1499
1500
  post(message: string | PostableMessage | CardJSXElement): Promise<SentMessage>;
1500
1501
  private postSingleMessage;
1501
1502
  postEphemeral(user: string | Author, message: AdapterPostableMessage | CardJSXElement, options: PostEphemeralOptions): Promise<EphemeralMessage | null>;
1502
- startTyping(): Promise<void>;
1503
+ startTyping(status?: string): Promise<void>;
1503
1504
  mentionUser(userId: string): string;
1504
1505
  toJSON(): SerializedChannel;
1505
1506
  static fromJSON<TState = Record<string, unknown>>(json: SerializedChannel, adapter?: Adapter): ChannelImpl<TState>;
@@ -2055,7 +2056,7 @@ declare class ThreadImpl<TState = Record<string, unknown>> implements Thread<TSt
2055
2056
  * Uses adapter's native streaming if available, otherwise falls back to post+edit.
2056
2057
  */
2057
2058
  private handleStream;
2058
- startTyping(): Promise<void>;
2059
+ startTyping(status?: string): Promise<void>;
2059
2060
  /**
2060
2061
  * Fallback streaming implementation using post + edit.
2061
2062
  * Used when adapter doesn't support native streaming.
package/dist/index.js CHANGED
@@ -646,8 +646,8 @@ var ChannelImpl = class _ChannelImpl {
646
646
  }
647
647
  return null;
648
648
  }
649
- async startTyping() {
650
- await this.adapter.startTyping(this.id);
649
+ async startTyping(status) {
650
+ await this.adapter.startTyping(this.id, status);
651
651
  }
652
652
  mentionUser(userId) {
653
653
  return `<@${userId}>`;
@@ -1054,8 +1054,8 @@ var ThreadImpl = class _ThreadImpl {
1054
1054
  }
1055
1055
  return this.fallbackStream(textStream, options);
1056
1056
  }
1057
- async startTyping() {
1058
- await this.adapter.startTyping(this.id);
1057
+ async startTyping(status) {
1058
+ await this.adapter.startTyping(this.id, status);
1059
1059
  }
1060
1060
  /**
1061
1061
  * Fallback streaming implementation using post + edit.
@@ -1396,7 +1396,7 @@ var Chat = class {
1396
1396
  if (typeof config.logger === "string") {
1397
1397
  this.logger = new ConsoleLogger(config.logger);
1398
1398
  } else {
1399
- this.logger = config.logger;
1399
+ this.logger = config.logger || new ConsoleLogger("info");
1400
1400
  }
1401
1401
  const webhooks = {};
1402
1402
  for (const [name, adapter] of Object.entries(config.adapters)) {