@opengeni/react 0.34.3 → 0.35.2
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-QRYJCWGD.js → chunk-AXQQ2V2I.js} +116 -32
- package/dist/{chunk-QRYJCWGD.js.map → chunk-AXQQ2V2I.js.map} +1 -1
- package/dist/{chunk-MEGI4FS6.js → chunk-J2RVJ6JX.js} +2 -1
- package/dist/{chunk-MEGI4FS6.js.map → chunk-J2RVJ6JX.js.map} +1 -1
- package/dist/{chunk-4NMH6UJ3.js → chunk-OKKMZDQF.js} +3 -2
- package/dist/chunk-OKKMZDQF.js.map +1 -0
- package/dist/hooks/use-turn-queue.d.ts +3 -1
- package/dist/index.js +3 -3
- package/dist/session-ui.js +2 -2
- package/dist/session.js +2 -2
- package/package.json +2 -2
- package/src/components/message-timeline.tsx +149 -32
- package/src/hooks/use-turn-queue.ts +4 -0
- package/src/timeline/projection.ts +1 -0
- package/dist/chunk-4NMH6UJ3.js.map +0 -1
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
groupTimeline,
|
|
4
4
|
mcpToolLeaf,
|
|
5
5
|
toolDisplayName
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-J2RVJ6JX.js";
|
|
7
7
|
import {
|
|
8
8
|
Tooltip,
|
|
9
9
|
TooltipContent,
|
|
@@ -4701,6 +4701,7 @@ import {
|
|
|
4701
4701
|
import { AnimatePresence as AnimatePresence3, motion as motion3 } from "motion/react";
|
|
4702
4702
|
import { Collapsible as Collapsible2 } from "radix-ui";
|
|
4703
4703
|
import {
|
|
4704
|
+
Component as Component2,
|
|
4704
4705
|
memo as memo2,
|
|
4705
4706
|
useCallback as useCallback2,
|
|
4706
4707
|
useEffect as useEffect8,
|
|
@@ -5613,19 +5614,34 @@ function MessageTimeline({
|
|
|
5613
5614
|
const next = groups[index + 1]?.group;
|
|
5614
5615
|
const contextCompactionCount = group.kind === "turn" ? group.contextCompactionCount ?? 0 : group.kind === "activity" && next?.kind === "item" && next.item.kind === "context-compaction" && next.item.phase === "compacted" ? 1 : 0;
|
|
5615
5616
|
return /* @__PURE__ */ jsx15("div", { "data-og-timeline-group-anchor": "", "data-og-group-key": key, children: /* @__PURE__ */ jsx15(
|
|
5616
|
-
|
|
5617
|
+
TimelineGroupRenderBoundary,
|
|
5617
5618
|
{
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5619
|
+
resetKeys: [
|
|
5620
|
+
group,
|
|
5621
|
+
renderMessageText,
|
|
5622
|
+
onOpenSession,
|
|
5623
|
+
onMemoryClick,
|
|
5624
|
+
onReconnect,
|
|
5625
|
+
resolveProviderLogo,
|
|
5626
|
+
toolRegistry,
|
|
5627
|
+
turnSummary
|
|
5628
|
+
],
|
|
5629
|
+
children: /* @__PURE__ */ jsx15(
|
|
5630
|
+
TimelineGroupView,
|
|
5631
|
+
{
|
|
5632
|
+
group,
|
|
5633
|
+
renderMessageText,
|
|
5634
|
+
onOpenSession,
|
|
5635
|
+
onMemoryClick,
|
|
5636
|
+
onReconnect,
|
|
5637
|
+
resolveProviderLogo,
|
|
5638
|
+
toolRegistry,
|
|
5639
|
+
turnSummary,
|
|
5640
|
+
foldLiveCluster: isAgentProgress(next),
|
|
5641
|
+
trailingAgentText: trailingAgentTextAfterTurn(group, next),
|
|
5642
|
+
contextCompactionCount: contextCompactionCount > 0 ? contextCompactionCount : void 0
|
|
5643
|
+
}
|
|
5644
|
+
)
|
|
5629
5645
|
}
|
|
5630
5646
|
) }, key);
|
|
5631
5647
|
}),
|
|
@@ -5815,6 +5831,44 @@ function cancelFrame(id) {
|
|
|
5815
5831
|
}
|
|
5816
5832
|
window.clearTimeout(id);
|
|
5817
5833
|
}
|
|
5834
|
+
function timelineRenderResetKeysChanged(previous, next) {
|
|
5835
|
+
return previous.length !== next.length || previous.some((key, index) => !Object.is(key, next[index]));
|
|
5836
|
+
}
|
|
5837
|
+
var TimelineGroupRenderBoundary = class extends Component2 {
|
|
5838
|
+
state = {
|
|
5839
|
+
failed: false,
|
|
5840
|
+
resetKeys: this.props.resetKeys
|
|
5841
|
+
};
|
|
5842
|
+
static getDerivedStateFromError() {
|
|
5843
|
+
return { failed: true };
|
|
5844
|
+
}
|
|
5845
|
+
static getDerivedStateFromProps(props, state) {
|
|
5846
|
+
if (timelineRenderResetKeysChanged(state.resetKeys, props.resetKeys)) {
|
|
5847
|
+
return { failed: false, resetKeys: props.resetKeys };
|
|
5848
|
+
}
|
|
5849
|
+
return null;
|
|
5850
|
+
}
|
|
5851
|
+
render() {
|
|
5852
|
+
if (this.state.failed) {
|
|
5853
|
+
return /* @__PURE__ */ jsxs13(
|
|
5854
|
+
"div",
|
|
5855
|
+
{
|
|
5856
|
+
"data-testid": "timeline-group-render-error",
|
|
5857
|
+
role: "status",
|
|
5858
|
+
className: "flex items-start gap-2 rounded-lg border border-og-border bg-og-surface-muted px-3 py-2 text-sm text-og-fg-muted",
|
|
5859
|
+
children: [
|
|
5860
|
+
/* @__PURE__ */ jsx15(TriangleAlertIcon3, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }),
|
|
5861
|
+
/* @__PURE__ */ jsxs13("div", { children: [
|
|
5862
|
+
/* @__PURE__ */ jsx15("p", { className: "font-medium text-og-fg", children: "Timeline item unavailable" }),
|
|
5863
|
+
/* @__PURE__ */ jsx15("p", { children: "This item could not be displayed. The rest of the conversation is still available." })
|
|
5864
|
+
] })
|
|
5865
|
+
]
|
|
5866
|
+
}
|
|
5867
|
+
);
|
|
5868
|
+
}
|
|
5869
|
+
return this.props.children;
|
|
5870
|
+
}
|
|
5871
|
+
};
|
|
5818
5872
|
var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
5819
5873
|
group,
|
|
5820
5874
|
renderMessageText,
|
|
@@ -5835,7 +5889,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
5835
5889
|
const foldMemory = useFoldMemory();
|
|
5836
5890
|
const activityShouldFold = group.kind === "activity" && Boolean(group.outcome || foldLiveCluster && clusterIsSettled(group));
|
|
5837
5891
|
const liveActivitySettle = useLiveSettleFold(activityShouldFold && !insideTurn);
|
|
5838
|
-
const turnDefaultOpen = !insideTurn && group.kind === "turn" && group.outcome === "failed";
|
|
5892
|
+
const turnDefaultOpen = !insideTurn && group.kind === "turn" && (group.outcome === "failed" || timelineGroupContainsAuthNeeded(group));
|
|
5839
5893
|
if (group.kind === "turn" && foldMemory && !insideTurn) {
|
|
5840
5894
|
inheritFoldRestingState(
|
|
5841
5895
|
foldMemory,
|
|
@@ -5912,22 +5966,40 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
5912
5966
|
const activityItems = flattenActivityItems(group.groups);
|
|
5913
5967
|
const nestClusters = foldableActivityClusterCount(group.groups) >= 2;
|
|
5914
5968
|
const turnCopyText = collectTurnCopyText(group.groups, trailingAgentText);
|
|
5915
|
-
const body = group.groups.map((child) =>
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5969
|
+
const body = group.groups.map((child) => {
|
|
5970
|
+
const key = timelineGroupKey(child);
|
|
5971
|
+
return /* @__PURE__ */ jsx15(
|
|
5972
|
+
TimelineGroupRenderBoundary,
|
|
5973
|
+
{
|
|
5974
|
+
resetKeys: [
|
|
5975
|
+
child,
|
|
5976
|
+
renderMessageText,
|
|
5977
|
+
onOpenSession,
|
|
5978
|
+
onMemoryClick,
|
|
5979
|
+
onReconnect,
|
|
5980
|
+
resolveProviderLogo,
|
|
5981
|
+
toolRegistry,
|
|
5982
|
+
turnSummary
|
|
5983
|
+
],
|
|
5984
|
+
children: /* @__PURE__ */ jsx15(
|
|
5985
|
+
TimelineGroupView2,
|
|
5986
|
+
{
|
|
5987
|
+
group: child,
|
|
5988
|
+
renderMessageText,
|
|
5989
|
+
onOpenSession,
|
|
5990
|
+
onMemoryClick,
|
|
5991
|
+
onReconnect,
|
|
5992
|
+
resolveProviderLogo,
|
|
5993
|
+
toolRegistry,
|
|
5994
|
+
turnSummary,
|
|
5995
|
+
insideTurn: true,
|
|
5996
|
+
nestClusterChips: nestClusters
|
|
5997
|
+
}
|
|
5998
|
+
)
|
|
5999
|
+
},
|
|
6000
|
+
key
|
|
6001
|
+
);
|
|
6002
|
+
});
|
|
5931
6003
|
return /* @__PURE__ */ jsx15(
|
|
5932
6004
|
TurnSummary,
|
|
5933
6005
|
{
|
|
@@ -5990,6 +6062,16 @@ function timelineGroupKey(group) {
|
|
|
5990
6062
|
return group.id;
|
|
5991
6063
|
}
|
|
5992
6064
|
}
|
|
6065
|
+
function timelineGroupContainsAuthNeeded(group) {
|
|
6066
|
+
switch (group.kind) {
|
|
6067
|
+
case "item":
|
|
6068
|
+
return group.item.kind === "auth-needed";
|
|
6069
|
+
case "activity":
|
|
6070
|
+
return false;
|
|
6071
|
+
case "turn":
|
|
6072
|
+
return group.groups.some(timelineGroupContainsAuthNeeded);
|
|
6073
|
+
}
|
|
6074
|
+
}
|
|
5993
6075
|
function timelineGroupItemIds(group) {
|
|
5994
6076
|
switch (group.kind) {
|
|
5995
6077
|
case "item":
|
|
@@ -6522,7 +6604,7 @@ function AuthNeededRow({
|
|
|
6522
6604
|
const [busy, setBusy] = useState11(false);
|
|
6523
6605
|
const [failed, setFailed] = useState11(false);
|
|
6524
6606
|
const provider = providerLabel(item.providerDomain);
|
|
6525
|
-
const unavailable = item.reason === "unsupported_auth" || item.reason === "resource_scope_unavailable";
|
|
6607
|
+
const unavailable = item.reason === "personal_authority_unavailable" || item.reason === "unsupported_auth" || item.reason === "resource_scope_unavailable";
|
|
6526
6608
|
const missing = item.reason === "missing_connection";
|
|
6527
6609
|
const actionLabel = missing ? "Connect" : "Reconnect";
|
|
6528
6610
|
const start = async () => {
|
|
@@ -6650,6 +6732,8 @@ function authReasonLine(reason) {
|
|
|
6650
6732
|
case "expired":
|
|
6651
6733
|
case "refresh_failed":
|
|
6652
6734
|
return "Its access expired.";
|
|
6735
|
+
case "personal_authority_unavailable":
|
|
6736
|
+
return "This automation was not granted access to your personal connection.";
|
|
6653
6737
|
case "unsupported_auth":
|
|
6654
6738
|
return "This connection cannot authenticate the configured tool endpoint.";
|
|
6655
6739
|
case "resource_scope_unavailable":
|
|
@@ -6713,4 +6797,4 @@ export {
|
|
|
6713
6797
|
MessageTimeline,
|
|
6714
6798
|
TimelineRow
|
|
6715
6799
|
};
|
|
6716
|
-
//# sourceMappingURL=chunk-
|
|
6800
|
+
//# sourceMappingURL=chunk-AXQQ2V2I.js.map
|