@paymanai/payman-ask-sdk 4.0.16 → 4.0.18

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.mjs CHANGED
@@ -846,6 +846,17 @@ function useStreamManagerV2(config, callbacks, setMessages, setIsWaitingForRespo
846
846
  signal: abortController.signal,
847
847
  onEvent: (event) => {
848
848
  if (abortController.signal.aborted) return;
849
+ try {
850
+ const et = event?.eventType;
851
+ if (et === "RUN_IN_PROGRESS" || et === "INTENT_PROGRESS" || et === "THINKING_DELTA") {
852
+ const len = (event.partialText ?? event.text ?? "").length;
853
+ console.log(`[stream] ${et} (+${len} chars)`);
854
+ } else {
855
+ console.log(`[stream] ${et ?? "?"}:`, JSON.stringify(event));
856
+ }
857
+ } catch {
858
+ console.log("[stream] (unserializable event)", event?.eventType);
859
+ }
849
860
  processStreamEventV2(event, state);
850
861
  if (state.lastUserAction) {
851
862
  callbacksRef.current.onUserActionRequired?.(state.lastUserAction);