@flamingo-stack/openframe-frontend-core 0.0.206 → 0.0.207
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/{chunk-YGOJIDL5.cjs → chunk-APM6KBPU.cjs} +114 -97
- package/dist/chunk-APM6KBPU.cjs.map +1 -0
- package/dist/{chunk-OLTGB32E.js → chunk-Z3GQGR5E.js} +23 -6
- package/dist/{chunk-OLTGB32E.js.map → chunk-Z3GQGR5E.js.map} +1 -1
- package/dist/components/chat/hooks/use-realtime-chunk-processor.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/chat/types/api.types.d.ts +17 -1
- package/dist/components/chat/types/api.types.d.ts.map +1 -1
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/index.cjs +2 -2
- package/dist/components/index.js +1 -1
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/chat/hooks/use-realtime-chunk-processor.ts +53 -6
- package/src/components/chat/types/api.types.ts +23 -1
- package/dist/chunk-YGOJIDL5.cjs.map +0 -1
|
@@ -39815,10 +39815,12 @@ function useRealtimeChunkProcessor(options) {
|
|
|
39815
39815
|
callbacks.onEscalatedApproval?.(requestId, data);
|
|
39816
39816
|
});
|
|
39817
39817
|
}
|
|
39818
|
+
hasEverStreamedRef.current = true;
|
|
39818
39819
|
hasInitializedWithData.current = true;
|
|
39819
39820
|
}
|
|
39820
39821
|
}, [initialState, callbacks]);
|
|
39821
39822
|
const isInStreamRef = useRef48(false);
|
|
39823
|
+
const hasEverStreamedRef = useRef48(false);
|
|
39822
39824
|
const pendingEscalatedRef = useRef48(/* @__PURE__ */ new Map());
|
|
39823
39825
|
const processChunk = useCallback36(
|
|
39824
39826
|
(chunk) => {
|
|
@@ -39831,6 +39833,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
39831
39833
|
switch (action.action) {
|
|
39832
39834
|
case "message_start":
|
|
39833
39835
|
isInStreamRef.current = true;
|
|
39836
|
+
hasEverStreamedRef.current = true;
|
|
39834
39837
|
callbacks.onStreamStart?.();
|
|
39835
39838
|
accumulator.resetSegments();
|
|
39836
39839
|
break;
|
|
@@ -39844,15 +39847,27 @@ function useRealtimeChunkProcessor(options) {
|
|
|
39844
39847
|
break;
|
|
39845
39848
|
case "text": {
|
|
39846
39849
|
const segments = accumulator.appendText(action.text);
|
|
39847
|
-
|
|
39850
|
+
if (isInStreamRef.current || !hasEverStreamedRef.current) {
|
|
39851
|
+
callbacks.onSegmentsUpdate?.(segments);
|
|
39852
|
+
} else {
|
|
39853
|
+
callbacks.onSegmentsUpdate?.([{ type: "text", text: action.text }], { append: true });
|
|
39854
|
+
}
|
|
39848
39855
|
break;
|
|
39849
39856
|
}
|
|
39850
39857
|
case "thinking": {
|
|
39851
39858
|
const segments = accumulator.appendThinking(action.text);
|
|
39852
|
-
|
|
39859
|
+
if (isInStreamRef.current || !hasEverStreamedRef.current) {
|
|
39860
|
+
callbacks.onSegmentsUpdate?.(segments);
|
|
39861
|
+
} else {
|
|
39862
|
+
callbacks.onSegmentsUpdate?.([{ type: "thinking", text: action.text }], { append: true });
|
|
39863
|
+
}
|
|
39853
39864
|
break;
|
|
39854
39865
|
}
|
|
39855
39866
|
case "tool_execution": {
|
|
39867
|
+
if (!isInStreamRef.current && callbacks.onToolExecuted) {
|
|
39868
|
+
callbacks.onToolExecuted(action.segment);
|
|
39869
|
+
break;
|
|
39870
|
+
}
|
|
39856
39871
|
const segments = accumulator.addToolExecution(action.segment);
|
|
39857
39872
|
callbacks.onSegmentsUpdate?.(segments);
|
|
39858
39873
|
break;
|
|
@@ -39958,10 +39973,12 @@ function useRealtimeChunkProcessor(options) {
|
|
|
39958
39973
|
callbacks.onSegmentsUpdate?.(segments);
|
|
39959
39974
|
}
|
|
39960
39975
|
} else {
|
|
39961
|
-
|
|
39962
|
-
callbacks.
|
|
39976
|
+
accumulator.updateApprovalStatus(requestId, status);
|
|
39977
|
+
if (!callbacks.onApprovalResolved) {
|
|
39978
|
+
callbacks.onSegmentsUpdate?.(accumulator.getSegments());
|
|
39979
|
+
}
|
|
39963
39980
|
}
|
|
39964
|
-
|
|
39981
|
+
callbacks.onApprovalResolved?.(requestId, status, approvalType);
|
|
39965
39982
|
break;
|
|
39966
39983
|
}
|
|
39967
39984
|
case "error": {
|
|
@@ -43690,4 +43707,4 @@ export {
|
|
|
43690
43707
|
TMCG_SOCIAL_PLATFORMS,
|
|
43691
43708
|
assets
|
|
43692
43709
|
};
|
|
43693
|
-
//# sourceMappingURL=chunk-
|
|
43710
|
+
//# sourceMappingURL=chunk-Z3GQGR5E.js.map
|