@flamingo-stack/openframe-frontend-core 0.0.278-snapshot.20260617162149 → 0.0.278
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-7ECI5ZVO.js → chunk-5NL62LIF.js} +2 -2
- package/dist/{chunk-YK6FFIVG.js → chunk-737ZLQ2T.js} +2 -2
- package/dist/{chunk-Z53YSXDD.cjs → chunk-7LTWNUHB.cjs} +133 -149
- package/dist/chunk-7LTWNUHB.cjs.map +1 -0
- package/dist/{chunk-7XVVRE53.cjs → chunk-BBDJCXHW.cjs} +6 -6
- package/dist/{chunk-7XVVRE53.cjs.map → chunk-BBDJCXHW.cjs.map} +1 -1
- package/dist/{chunk-776ZURDZ.cjs → chunk-DO55GWNT.cjs} +10 -10
- package/dist/{chunk-776ZURDZ.cjs.map → chunk-DO55GWNT.cjs.map} +1 -1
- package/dist/{chunk-AVLSICZO.js → chunk-GO45CXT5.js} +33 -49
- package/dist/chunk-GO45CXT5.js.map +1 -0
- package/dist/{chunk-QP4H2JJN.cjs → chunk-L4BJU5CE.cjs} +34 -34
- package/dist/{chunk-QP4H2JJN.cjs.map → chunk-L4BJU5CE.cjs.map} +1 -1
- package/dist/{chunk-SZG56DA3.js → chunk-MDHNLZME.js} +2 -2
- package/dist/{chunk-6ZMD3KBP.js → chunk-MVUN35FH.js} +2 -2
- package/dist/{chunk-XBTQK32O.cjs → chunk-WYQ5VFXA.cjs} +25 -25
- package/dist/{chunk-XBTQK32O.cjs.map → chunk-WYQ5VFXA.cjs.map} +1 -1
- package/dist/components/chat/chat-message-enhanced.d.ts.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 +2 -7
- package/dist/components/chat/types/api.types.d.ts.map +1 -1
- package/dist/components/chat/types/message.types.d.ts +0 -10
- package/dist/components/chat/types/message.types.d.ts.map +1 -1
- package/dist/components/chat/types/network.types.d.ts +0 -2
- package/dist/components/chat/types/network.types.d.ts.map +1 -1
- package/dist/components/chat/types/processing.types.d.ts +0 -1
- package/dist/components/chat/types/processing.types.d.ts.map +1 -1
- package/dist/components/chat/utils/chunk-parser.d.ts.map +1 -1
- package/dist/components/chat/utils/history-merge.d.ts +0 -8
- package/dist/components/chat/utils/history-merge.d.ts.map +1 -1
- package/dist/components/chat/utils/message-segment-accumulator.d.ts +3 -5
- package/dist/components/chat/utils/message-segment-accumulator.d.ts.map +1 -1
- package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/index.cjs +53 -53
- package/dist/components/index.js +4 -4
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/tickets/index.cjs +52 -52
- package/dist/components/tickets/index.js +3 -3
- 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/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/chat/chat-message-enhanced.tsx +0 -1
- package/src/components/chat/hooks/use-realtime-chunk-processor.ts +21 -34
- package/src/components/chat/types/api.types.ts +2 -7
- package/src/components/chat/types/message.types.ts +0 -10
- package/src/components/chat/types/network.types.ts +0 -2
- package/src/components/chat/types/processing.types.ts +1 -1
- package/src/components/chat/utils/__tests__/history-merge.test.ts +0 -70
- package/src/components/chat/utils/chunk-parser.ts +1 -12
- package/src/components/chat/utils/history-merge.ts +2 -22
- package/src/components/chat/utils/message-segment-accumulator.ts +4 -10
- package/src/components/chat/utils/process-historical-messages.ts +1 -4
- package/dist/chunk-AVLSICZO.js.map +0 -1
- package/dist/chunk-Z53YSXDD.cjs.map +0 -1
- /package/dist/{chunk-7ECI5ZVO.js.map → chunk-5NL62LIF.js.map} +0 -0
- /package/dist/{chunk-YK6FFIVG.js.map → chunk-737ZLQ2T.js.map} +0 -0
- /package/dist/{chunk-SZG56DA3.js.map → chunk-MDHNLZME.js.map} +0 -0
- /package/dist/{chunk-6ZMD3KBP.js.map → chunk-MVUN35FH.js.map} +0 -0
|
@@ -2669,7 +2669,6 @@ var ChatMessageEnhanced = forwardRef11(
|
|
|
2669
2669
|
{
|
|
2670
2670
|
data: segment.data,
|
|
2671
2671
|
status: segment.status,
|
|
2672
|
-
resolvedByName: segment.resolvedByName,
|
|
2673
2672
|
onApprove: segment.onApprove,
|
|
2674
2673
|
onReject: segment.onReject
|
|
2675
2674
|
},
|
|
@@ -34910,16 +34909,13 @@ function parseChunkToAction(chunk) {
|
|
|
34910
34909
|
approvalType
|
|
34911
34910
|
};
|
|
34912
34911
|
}
|
|
34913
|
-
case MESSAGE_TYPE.APPROVAL_RESULT:
|
|
34914
|
-
const resolvedByName = typeof data.resolvedByName === "string" ? data.resolvedByName : typeof data.displayName === "string" ? data.displayName : void 0;
|
|
34912
|
+
case MESSAGE_TYPE.APPROVAL_RESULT:
|
|
34915
34913
|
return {
|
|
34916
34914
|
action: "approval_result",
|
|
34917
34915
|
requestId: data.approvalRequestId || data.approval_request_id || "",
|
|
34918
34916
|
approved: data.approved === true,
|
|
34919
|
-
approvalType: data.approvalType || "CLIENT"
|
|
34920
|
-
resolvedByName
|
|
34917
|
+
approvalType: data.approvalType || "CLIENT"
|
|
34921
34918
|
};
|
|
34922
|
-
}
|
|
34923
34919
|
case MESSAGE_TYPE.ERROR:
|
|
34924
34920
|
return {
|
|
34925
34921
|
action: "error",
|
|
@@ -35224,7 +35220,7 @@ var MessageSegmentAccumulator = class {
|
|
|
35224
35220
|
* `executions` is forwarded as-is. On upsert, a new `executions` object
|
|
35225
35221
|
* overrides the existing one (so the latest replay wins).
|
|
35226
35222
|
*/
|
|
35227
|
-
addApprovalBatch(approvalRequestId, approvalType, toolCalls, status = "pending", executions
|
|
35223
|
+
addApprovalBatch(approvalRequestId, approvalType, toolCalls, status = "pending", executions) {
|
|
35228
35224
|
const existingIndex = this.segments.findIndex(
|
|
35229
35225
|
(s) => s.type === "approval_batch" && s.data.approvalRequestId === approvalRequestId
|
|
35230
35226
|
);
|
|
@@ -35240,7 +35236,6 @@ var MessageSegmentAccumulator = class {
|
|
|
35240
35236
|
...mergedExecutions ? { executions: mergedExecutions } : {}
|
|
35241
35237
|
},
|
|
35242
35238
|
status,
|
|
35243
|
-
resolvedByName: resolvedByName ?? existing.resolvedByName,
|
|
35244
35239
|
onApprove: this.callbacks.onApprove,
|
|
35245
35240
|
onReject: this.callbacks.onReject
|
|
35246
35241
|
};
|
|
@@ -35255,7 +35250,6 @@ var MessageSegmentAccumulator = class {
|
|
|
35255
35250
|
...executions ? { executions } : {}
|
|
35256
35251
|
},
|
|
35257
35252
|
status,
|
|
35258
|
-
resolvedByName,
|
|
35259
35253
|
onApprove: this.callbacks.onApprove,
|
|
35260
35254
|
onReject: this.callbacks.onReject
|
|
35261
35255
|
};
|
|
@@ -35288,17 +35282,15 @@ var MessageSegmentAccumulator = class {
|
|
|
35288
35282
|
return { segment, pendingData: pendingApproval || null };
|
|
35289
35283
|
}
|
|
35290
35284
|
/**
|
|
35291
|
-
* Update status of an existing approval segment (single or batch)
|
|
35292
|
-
* `resolvedByName` (when provided) is stamped onto the matching batch segment so the
|
|
35293
|
-
* resolved card shows "by {name}"; omit it to leave any existing value untouched.
|
|
35285
|
+
* Update status of an existing approval segment (single or batch)
|
|
35294
35286
|
*/
|
|
35295
|
-
updateApprovalStatus(requestId, status
|
|
35287
|
+
updateApprovalStatus(requestId, status) {
|
|
35296
35288
|
this.segments = this.segments.map((segment) => {
|
|
35297
35289
|
if (segment.type === "approval_request" && segment.data.requestId === requestId) {
|
|
35298
35290
|
return { ...segment, status };
|
|
35299
35291
|
}
|
|
35300
35292
|
if (segment.type === "approval_batch" && segment.data.approvalRequestId === requestId) {
|
|
35301
|
-
return { ...segment, status
|
|
35293
|
+
return { ...segment, status };
|
|
35302
35294
|
}
|
|
35303
35295
|
return segment;
|
|
35304
35296
|
});
|
|
@@ -35398,14 +35390,13 @@ var MessageSegmentAccumulator = class {
|
|
|
35398
35390
|
break;
|
|
35399
35391
|
}
|
|
35400
35392
|
case "approval_batch": {
|
|
35401
|
-
const { data, status
|
|
35393
|
+
const { data, status } = segment;
|
|
35402
35394
|
this.addApprovalBatch(
|
|
35403
35395
|
data.approvalRequestId,
|
|
35404
35396
|
data.approvalType,
|
|
35405
35397
|
data.toolCalls,
|
|
35406
35398
|
status,
|
|
35407
|
-
data.executions
|
|
35408
|
-
resolvedByName
|
|
35399
|
+
data.executions
|
|
35409
35400
|
);
|
|
35410
35401
|
break;
|
|
35411
35402
|
}
|
|
@@ -35491,8 +35482,6 @@ function useRealtimeChunkProcessor(options) {
|
|
|
35491
35482
|
const action = parseChunkToAction(chunk);
|
|
35492
35483
|
if (!action) return;
|
|
35493
35484
|
const accumulator = accumulatorRef.current;
|
|
35494
|
-
const streamSeq = chunk && typeof chunk === "object" && typeof chunk.streamSeq === "number" ? chunk.streamSeq : void 0;
|
|
35495
|
-
const emitSegments = (s, meta) => callbacks.onSegmentsUpdate?.(s, streamSeq != null ? { ...meta, streamSeq } : meta);
|
|
35496
35485
|
if (action.action === "direct_message") sawDirectMessageRef.current = true;
|
|
35497
35486
|
if ((directModeFlagRef.current || sawDirectMessageRef.current) && !DIRECT_MODE_ALLOWED.has(action.action)) {
|
|
35498
35487
|
if (isInStreamRef.current) {
|
|
@@ -35520,18 +35509,18 @@ function useRealtimeChunkProcessor(options) {
|
|
|
35520
35509
|
case "text": {
|
|
35521
35510
|
const segments = accumulator.appendText(action.text);
|
|
35522
35511
|
if (isInStreamRef.current || !hasEverStreamedRef.current) {
|
|
35523
|
-
|
|
35512
|
+
callbacks.onSegmentsUpdate?.(segments);
|
|
35524
35513
|
} else {
|
|
35525
|
-
|
|
35514
|
+
callbacks.onSegmentsUpdate?.([{ type: "text", text: action.text }], { append: true });
|
|
35526
35515
|
}
|
|
35527
35516
|
break;
|
|
35528
35517
|
}
|
|
35529
35518
|
case "thinking": {
|
|
35530
35519
|
const segments = accumulator.appendThinking(action.text);
|
|
35531
35520
|
if (isInStreamRef.current || !hasEverStreamedRef.current) {
|
|
35532
|
-
|
|
35521
|
+
callbacks.onSegmentsUpdate?.(segments);
|
|
35533
35522
|
} else {
|
|
35534
|
-
|
|
35523
|
+
callbacks.onSegmentsUpdate?.([{ type: "thinking", text: action.text }], { append: true });
|
|
35535
35524
|
}
|
|
35536
35525
|
break;
|
|
35537
35526
|
}
|
|
@@ -35541,7 +35530,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
35541
35530
|
break;
|
|
35542
35531
|
}
|
|
35543
35532
|
const segments = accumulator.addToolExecution(action.segment);
|
|
35544
|
-
|
|
35533
|
+
callbacks.onSegmentsUpdate?.(segments);
|
|
35545
35534
|
break;
|
|
35546
35535
|
}
|
|
35547
35536
|
case "approval_request": {
|
|
@@ -35555,7 +35544,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
35555
35544
|
approvalType,
|
|
35556
35545
|
status
|
|
35557
35546
|
);
|
|
35558
|
-
|
|
35547
|
+
callbacks.onSegmentsUpdate?.(segments);
|
|
35559
35548
|
} else {
|
|
35560
35549
|
pendingEscalatedRef.current.set(requestId, { command, explanation, approvalType });
|
|
35561
35550
|
callbacks.onEscalatedApproval?.(requestId, { command, explanation, approvalType });
|
|
@@ -35583,7 +35572,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
35583
35572
|
}
|
|
35584
35573
|
if (batchApprovalsEnabled) {
|
|
35585
35574
|
const segments2 = accumulator.addApprovalBatch(requestId, approvalType, toolCalls, status);
|
|
35586
|
-
|
|
35575
|
+
callbacks.onSegmentsUpdate?.(segments2);
|
|
35587
35576
|
break;
|
|
35588
35577
|
}
|
|
35589
35578
|
let segments = accumulator.getSegments();
|
|
@@ -35597,11 +35586,11 @@ function useRealtimeChunkProcessor(options) {
|
|
|
35597
35586
|
status
|
|
35598
35587
|
);
|
|
35599
35588
|
}
|
|
35600
|
-
|
|
35589
|
+
callbacks.onSegmentsUpdate?.(segments);
|
|
35601
35590
|
break;
|
|
35602
35591
|
}
|
|
35603
35592
|
case "approval_result": {
|
|
35604
|
-
const { requestId, approved, approvalType
|
|
35593
|
+
const { requestId, approved, approvalType } = action;
|
|
35605
35594
|
const escalatedData = pendingEscalatedRef.current.get(requestId);
|
|
35606
35595
|
const status = approved ? "approved" : "rejected";
|
|
35607
35596
|
if (escalatedData) {
|
|
@@ -35617,11 +35606,9 @@ function useRealtimeChunkProcessor(options) {
|
|
|
35617
35606
|
requestId,
|
|
35618
35607
|
escalatedData.approvalType,
|
|
35619
35608
|
escalatedData.toolCalls,
|
|
35620
|
-
status
|
|
35621
|
-
void 0,
|
|
35622
|
-
resolvedByName
|
|
35609
|
+
status
|
|
35623
35610
|
);
|
|
35624
|
-
|
|
35611
|
+
callbacks.onSegmentsUpdate?.(segments);
|
|
35625
35612
|
} else {
|
|
35626
35613
|
let segments = accumulator.getSegments();
|
|
35627
35614
|
for (const call of escalatedData.toolCalls) {
|
|
@@ -35634,7 +35621,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
35634
35621
|
status
|
|
35635
35622
|
);
|
|
35636
35623
|
}
|
|
35637
|
-
|
|
35624
|
+
callbacks.onSegmentsUpdate?.(segments);
|
|
35638
35625
|
}
|
|
35639
35626
|
} else {
|
|
35640
35627
|
const segments = accumulator.addApprovalRequest(
|
|
@@ -35644,15 +35631,15 @@ function useRealtimeChunkProcessor(options) {
|
|
|
35644
35631
|
escalatedData.approvalType,
|
|
35645
35632
|
status
|
|
35646
35633
|
);
|
|
35647
|
-
|
|
35634
|
+
callbacks.onSegmentsUpdate?.(segments);
|
|
35648
35635
|
}
|
|
35649
35636
|
} else {
|
|
35650
|
-
accumulator.updateApprovalStatus(requestId, status
|
|
35637
|
+
accumulator.updateApprovalStatus(requestId, status);
|
|
35651
35638
|
if (!callbacks.onApprovalResolved) {
|
|
35652
|
-
|
|
35639
|
+
callbacks.onSegmentsUpdate?.(accumulator.getSegments());
|
|
35653
35640
|
}
|
|
35654
35641
|
}
|
|
35655
|
-
callbacks.onApprovalResolved?.(requestId, status, approvalType
|
|
35642
|
+
callbacks.onApprovalResolved?.(requestId, status, approvalType);
|
|
35656
35643
|
break;
|
|
35657
35644
|
}
|
|
35658
35645
|
case "error": {
|
|
@@ -35665,7 +35652,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
35665
35652
|
}
|
|
35666
35653
|
}
|
|
35667
35654
|
const segments = accumulator.addError(action.error, message2);
|
|
35668
|
-
|
|
35655
|
+
callbacks.onSegmentsUpdate?.(segments);
|
|
35669
35656
|
callbacks.onError?.(action.error, message2);
|
|
35670
35657
|
break;
|
|
35671
35658
|
}
|
|
@@ -35694,13 +35681,13 @@ function useRealtimeChunkProcessor(options) {
|
|
|
35694
35681
|
case "context_compaction_start": {
|
|
35695
35682
|
const standalone = !isInStreamRef.current;
|
|
35696
35683
|
const segments = accumulator.addContextCompaction();
|
|
35697
|
-
|
|
35684
|
+
callbacks.onSegmentsUpdate?.(segments, standalone ? { append: true, isCompacting: true } : void 0);
|
|
35698
35685
|
break;
|
|
35699
35686
|
}
|
|
35700
35687
|
case "context_compaction_end": {
|
|
35701
35688
|
const standalone = !isInStreamRef.current;
|
|
35702
35689
|
const segments = accumulator.completeContextCompaction(action.summary);
|
|
35703
|
-
|
|
35690
|
+
callbacks.onSegmentsUpdate?.(segments, standalone ? { append: true, isCompacting: true } : void 0);
|
|
35704
35691
|
break;
|
|
35705
35692
|
}
|
|
35706
35693
|
case "dialog_closed":
|
|
@@ -35722,8 +35709,8 @@ function useRealtimeChunkProcessor(options) {
|
|
|
35722
35709
|
sawDirectMessageRef.current = false;
|
|
35723
35710
|
}, []);
|
|
35724
35711
|
const updateApprovalStatus = useCallback35(
|
|
35725
|
-
(requestId, status
|
|
35726
|
-
return accumulatorRef.current.updateApprovalStatus(requestId, status
|
|
35712
|
+
(requestId, status) => {
|
|
35713
|
+
return accumulatorRef.current.updateApprovalStatus(requestId, status);
|
|
35727
35714
|
},
|
|
35728
35715
|
[]
|
|
35729
35716
|
);
|
|
@@ -37369,7 +37356,6 @@ function processMessageData(data, accumulator, approvalStatuses, options = {}, e
|
|
|
37369
37356
|
if ("approvalRequestId" in data && data.approvalRequestId) {
|
|
37370
37357
|
const existingStatus = approvalStatuses[data.approvalRequestId];
|
|
37371
37358
|
const status = existingStatus || (data.approved ? "approved" : "rejected");
|
|
37372
|
-
const resolvedByName = "resolvedByName" in data ? data.resolvedByName : void 0;
|
|
37373
37359
|
const escalatedData = escalatedApprovals?.get(data.approvalRequestId);
|
|
37374
37360
|
if (escalatedData?.toolCalls && escalatedData.toolCalls.length > 0) {
|
|
37375
37361
|
if (batchApprovalsEnabled) {
|
|
@@ -37377,9 +37363,7 @@ function processMessageData(data, accumulator, approvalStatuses, options = {}, e
|
|
|
37377
37363
|
data.approvalRequestId,
|
|
37378
37364
|
escalatedData.approvalType,
|
|
37379
37365
|
escalatedData.toolCalls,
|
|
37380
|
-
status
|
|
37381
|
-
void 0,
|
|
37382
|
-
resolvedByName
|
|
37366
|
+
status
|
|
37383
37367
|
);
|
|
37384
37368
|
} else {
|
|
37385
37369
|
for (const call of escalatedData.toolCalls) {
|
|
@@ -37405,7 +37389,7 @@ function processMessageData(data, accumulator, approvalStatuses, options = {}, e
|
|
|
37405
37389
|
escalatedApprovals?.delete(data.approvalRequestId);
|
|
37406
37390
|
}
|
|
37407
37391
|
const before = accumulator.getSegments();
|
|
37408
|
-
const after = accumulator.updateApprovalStatus(data.approvalRequestId, status
|
|
37392
|
+
const after = accumulator.updateApprovalStatus(data.approvalRequestId, status);
|
|
37409
37393
|
const updatedExisting = before.some((s, i) => after[i] !== s);
|
|
37410
37394
|
if (updatedExisting) break;
|
|
37411
37395
|
accumulator.processApprovalResult(
|
|
@@ -38391,7 +38375,7 @@ function mergeHistoryWithRealtime(input) {
|
|
|
38391
38375
|
if (m.role === "assistant" && trailingAssistantText && assistantAnswerText(m.content) === trailingAssistantText) {
|
|
38392
38376
|
return false;
|
|
38393
38377
|
}
|
|
38394
|
-
const covered =
|
|
38378
|
+
const covered = historyCoversRealtime !== null ? historyCoversRealtime : (m.timestamp?.getTime() ?? 0) <= historyFetchedAt;
|
|
38395
38379
|
if (covered) return false;
|
|
38396
38380
|
}
|
|
38397
38381
|
return true;
|
|
@@ -40249,4 +40233,4 @@ export {
|
|
|
40249
40233
|
LogsList,
|
|
40250
40234
|
assets
|
|
40251
40235
|
};
|
|
40252
|
-
//# sourceMappingURL=chunk-
|
|
40236
|
+
//# sourceMappingURL=chunk-GO45CXT5.js.map
|