@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.
- package/dist/chat/embed.js +51 -51
- package/dist/chat/embed.js.map +1 -1
- package/dist/chat/index.d.ts +6 -1
- package/dist/chat/index.js +14 -10
- package/dist/chat/index.js.map +1 -1
- package/package.json +4 -3
package/dist/chat/index.d.ts
CHANGED
|
@@ -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
|
|
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;
|