@noodleseed/assistant 1.16.0 → 1.16.1

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.
@@ -250,6 +250,7 @@ interface AssistantClient<TPageContext extends AssistantPageContext = AssistantC
250
250
  /** Read a detached snapshot suitable for a framework-owned renderer. */
251
251
  getChatState(): AssistantChatState;
252
252
  connect(): Promise<void>;
253
+ hasSession(): boolean;
253
254
  sendMessage(message: string): Promise<void>;
254
255
  respond(id: string, response: AssistantInteractionResponse): Promise<void>;
255
256
  updateContext(context: AssistantContext): void;
@@ -250,6 +250,7 @@ interface AssistantClient<TPageContext extends AssistantPageContext = AssistantC
250
250
  /** Read a detached snapshot suitable for a framework-owned renderer. */
251
251
  getChatState(): AssistantChatState;
252
252
  connect(): Promise<void>;
253
+ hasSession(): boolean;
253
254
  sendMessage(message: string): Promise<void>;
254
255
  respond(id: string, response: AssistantInteractionResponse): Promise<void>;
255
256
  updateContext(context: AssistantContext): void;
package/dist/client.cjs CHANGED
@@ -23300,6 +23300,10 @@ var DefaultAssistantClient = class {
23300
23300
  getChatState() {
23301
23301
  return this.#chat.getState();
23302
23302
  }
23303
+ /** Whether a session already exists, so a caller can avoid re-entering its loading state. */
23304
+ hasSession() {
23305
+ return this.#session !== void 0;
23306
+ }
23303
23307
  async connect() {
23304
23308
  if (this.#session) return;
23305
23309
  await this.#singleFlight(async (signal) => {