@waniwani/sdk 0.22.0-beta.0 → 0.22.0-beta.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.
@@ -885,9 +885,14 @@ interface ChatTransportContext {
885
885
  needsFallback: () => boolean;
886
886
  onSession: (sessionId: string) => void;
887
887
  }
888
- /** Optional hooks the chat calls on a transport: ahead of the first message, and on unmount. */
888
+ /** Optional hooks the chat calls on a transport. */
889
889
  interface ChatTransportLifecycle {
890
+ /** The visitor started typing their first message. */
890
891
  prepare?(): void;
892
+ /** On mount: the conversation this browser already holds, as messages to show. */
893
+ restore?(): Promise<ai.UIMessage[]>;
894
+ /** The visitor started a new conversation. */
895
+ reset?(): void;
891
896
  dispose?(): void;
892
897
  }
893
898
  type ChatTransportFactory = (context: ChatTransportContext) => ai.ChatTransport<ai.UIMessage> & ChatTransportLifecycle;