@elqnt/chat 1.0.11 → 1.0.12

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.
@@ -317,7 +317,7 @@ var useWebSocketChatBase = ({
317
317
  if (transportRef.current === "sse") {
318
318
  const sseUrl = getRestApiUrl(`stream?orgId=${orgId}&userId=${userId}&clientType=${clientType}&chatId=${currentChatKeyRef.current || ""}`);
319
319
  logger.debug("Connecting to SSE:", sseUrl);
320
- console.log(`\u23F3 Initiating SSE connection to ${serverBaseUrl}...`);
320
+ console.log(`\u23F3 Initiating SSE connection to ${sseUrl}...`);
321
321
  const eventSource = new EventSource(sseUrl);
322
322
  eventSource.onopen = () => {
323
323
  if (!mountedRef.current) {
@@ -867,8 +867,30 @@ var useWebSocketChatBase = ({
867
867
  user: fullEvent.data?.user
868
868
  });
869
869
  break;
870
+ // Event types that use the generic /event endpoint
871
+ case "load_agent_context":
872
+ case "skill_activate":
873
+ case "skill_deactivate":
874
+ case "sync_metadata":
875
+ case "plan_approved":
876
+ case "plan_rejected":
877
+ await sendRestMessage("event", {
878
+ type: fullEvent.type,
879
+ orgId: fullEvent.orgId,
880
+ chatKey: fullEvent.chatKey || currentChatKeyRef.current,
881
+ userId: fullEvent.userId,
882
+ data: fullEvent.data
883
+ });
884
+ break;
870
885
  default:
871
- logger.warn("Unrecognized event type for SSE REST:", fullEvent.type);
886
+ logger.warn("Sending unrecognized event type via generic endpoint:", fullEvent.type);
887
+ await sendRestMessage("event", {
888
+ type: fullEvent.type,
889
+ orgId: fullEvent.orgId,
890
+ chatKey: fullEvent.chatKey || currentChatKeyRef.current,
891
+ userId: fullEvent.userId,
892
+ data: fullEvent.data
893
+ });
872
894
  break;
873
895
  }
874
896
  updateMetrics({ messagesSent: metrics.messagesSent + 1 });