@tutti-os/agent-gui 0.0.131 → 0.0.133
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/README.md +5 -2
- package/dist/agent-conversation/index.d.ts +4 -6
- package/dist/agent-conversation/index.js +3 -3
- package/dist/agent-env/index.d.ts +10 -27
- package/dist/agent-env/index.js +14 -290
- package/dist/agent-env/index.js.map +1 -1
- package/dist/agent-gui.d.ts +1090 -20
- package/dist/agent-gui.js +7 -7
- package/dist/agent-message-center/index.d.ts +42 -7
- package/dist/agent-message-center/index.js +2 -2
- package/dist/{agentConversationVM-BD0-gg6C.d.ts → agentConversationVM-DWEy7jzx.d.ts} +41 -2
- package/dist/{agentGuiNodeTypes-5TL1hyCN.d.ts → agentGuiNodeTypes-B57MfwVo.d.ts} +5 -22
- package/dist/agents.d.ts +1 -1
- package/dist/agents.js +1 -1
- package/dist/app/renderer/agentactivity.css +1 -0
- package/dist/app/renderer/assets/icons/@-lined.svg +1 -8
- package/dist/{chunk-2RSNLVOX.js → chunk-A6NSHCRP.js} +204 -47
- package/dist/chunk-A6NSHCRP.js.map +1 -0
- package/dist/chunk-FM42UN2J.js +462 -0
- package/dist/chunk-FM42UN2J.js.map +1 -0
- package/dist/{chunk-PQJXWXTS.js → chunk-GBBNYGL7.js} +2 -2
- package/dist/{chunk-GCQYN7BR.js → chunk-HCRROERX.js} +2 -2
- package/dist/{chunk-WVWSFGBU.js → chunk-IZ626FDO.js} +563 -444
- package/dist/chunk-IZ626FDO.js.map +1 -0
- package/dist/{chunk-YWHGCKMT.js → chunk-N62NVPHT.js} +7 -7
- package/dist/chunk-N62NVPHT.js.map +1 -0
- package/dist/{chunk-T2NICA5D.js → chunk-VS5BRBY6.js} +4 -1
- package/dist/chunk-VS5BRBY6.js.map +1 -0
- package/dist/{contribution-yc4CGJmy.d.ts → contribution-BbW-kkpi.d.ts} +52 -1
- package/dist/custom-mention.d.ts +4 -2
- package/dist/i18n/index.d.ts +11 -6
- package/dist/index.d.ts +7982 -33
- package/dist/index.js +7 -7
- package/dist/runtime-Dwf44VKc.d.ts +7 -0
- package/dist/{types-BicfRVrV.d.ts → types-BeAVr4of.d.ts} +3 -5
- package/dist/workbench/contribution.d.ts +1 -2
- package/dist/workbench/contribution.js +2 -2
- package/dist/workbench/index.d.ts +1 -2
- package/dist/workbench/index.js +2 -2
- package/dist/workspace-agent-generated-files.d.ts +12 -1
- package/package.json +15 -15
- package/dist/AgentGUI-DxypmD7b.d.ts +0 -1080
- package/dist/agentPlanPromptDispatch-C7cCMjve.d.ts +0 -37
- package/dist/chunk-2RSNLVOX.js.map +0 -1
- package/dist/chunk-T2NICA5D.js.map +0 -1
- package/dist/chunk-VMQNG2KI.js +0 -178
- package/dist/chunk-VMQNG2KI.js.map +0 -1
- package/dist/chunk-WVWSFGBU.js.map +0 -1
- package/dist/chunk-YWHGCKMT.js.map +0 -1
- package/dist/pastedTextKinds-D-XuInaS.d.ts +0 -4
- package/dist/runtime-BBNdWgDU.d.ts +0 -10
- package/dist/workspaceAgentActivityListTypes-DZfS_HgG.d.ts +0 -48
- /package/dist/{chunk-PQJXWXTS.js.map → chunk-GBBNYGL7.js.map} +0 -0
- /package/dist/{chunk-GCQYN7BR.js.map → chunk-HCRROERX.js.map} +0 -0
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
classifyRecoverableAgentMessage,
|
|
8
8
|
isProviderPlanLimitMessage,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} from "./chunk-
|
|
9
|
+
resolveAgentErrorPresentation,
|
|
10
|
+
useOpenAgentEnvPanel
|
|
11
|
+
} from "./chunk-FM42UN2J.js";
|
|
12
12
|
import {
|
|
13
13
|
AGENT_PASTED_TEXT_BLOCK_KIND,
|
|
14
14
|
AGENT_PASTED_TEXT_MENTION_KIND
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
resolveWorkspaceFileLinkAction,
|
|
39
39
|
resolveWorkspaceFilePathCandidate,
|
|
40
40
|
resolveWorkspaceLinkAction
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-N62NVPHT.js";
|
|
42
42
|
import {
|
|
43
43
|
cn
|
|
44
44
|
} from "./chunk-KPMQGPYU.js";
|
|
@@ -5012,11 +5012,11 @@ function AgentTranscriptSkeleton({
|
|
|
5012
5012
|
import {
|
|
5013
5013
|
Fragment as Fragment7,
|
|
5014
5014
|
memo as memo4,
|
|
5015
|
-
useCallback as
|
|
5015
|
+
useCallback as useCallback13,
|
|
5016
5016
|
useLayoutEffect as useLayoutEffect4,
|
|
5017
5017
|
useMemo as useMemo7,
|
|
5018
|
-
useRef as
|
|
5019
|
-
useState as
|
|
5018
|
+
useRef as useRef12,
|
|
5019
|
+
useState as useState24
|
|
5020
5020
|
} from "react";
|
|
5021
5021
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
5022
5022
|
|
|
@@ -5452,6 +5452,7 @@ function CollapsibleReveal({
|
|
|
5452
5452
|
children,
|
|
5453
5453
|
className,
|
|
5454
5454
|
innerClassName,
|
|
5455
|
+
onHeightTransitionEnd,
|
|
5455
5456
|
preMountOnIdle = false
|
|
5456
5457
|
}) {
|
|
5457
5458
|
"use memo";
|
|
@@ -5463,6 +5464,17 @@ function CollapsibleReveal({
|
|
|
5463
5464
|
const heightRef = useRef2(height);
|
|
5464
5465
|
const measuredHeightRef = useRef2(null);
|
|
5465
5466
|
const previousExpandedRef = useRef2(expanded);
|
|
5467
|
+
const heightTransitionPendingRef = useRef2(false);
|
|
5468
|
+
const setRootRef = useCallback2(
|
|
5469
|
+
(node) => {
|
|
5470
|
+
if (rootRef.current !== null && node === null && heightTransitionPendingRef.current) {
|
|
5471
|
+
heightTransitionPendingRef.current = false;
|
|
5472
|
+
onHeightTransitionEnd?.();
|
|
5473
|
+
}
|
|
5474
|
+
rootRef.current = node;
|
|
5475
|
+
},
|
|
5476
|
+
[onHeightTransitionEnd]
|
|
5477
|
+
);
|
|
5466
5478
|
const setRevealHeight = useCallback2((nextHeight) => {
|
|
5467
5479
|
heightRef.current = nextHeight;
|
|
5468
5480
|
setHeight(nextHeight);
|
|
@@ -5475,11 +5487,18 @@ function CollapsibleReveal({
|
|
|
5475
5487
|
setMounted(true);
|
|
5476
5488
|
return void 0;
|
|
5477
5489
|
}
|
|
5490
|
+
let mountFrameStarted = false;
|
|
5478
5491
|
const animationFrame = requestAnimationFrame(() => {
|
|
5492
|
+
mountFrameStarted = true;
|
|
5479
5493
|
setMounted(true);
|
|
5480
5494
|
});
|
|
5481
|
-
return () =>
|
|
5482
|
-
|
|
5495
|
+
return () => {
|
|
5496
|
+
cancelAnimationFrame(animationFrame);
|
|
5497
|
+
if (!mountFrameStarted) {
|
|
5498
|
+
onHeightTransitionEnd?.();
|
|
5499
|
+
}
|
|
5500
|
+
};
|
|
5501
|
+
}, [expanded, mounted, onHeightTransitionEnd, preMountOnIdle]);
|
|
5483
5502
|
useEffect2(() => {
|
|
5484
5503
|
if (!preMountOnIdle || mounted || expanded) {
|
|
5485
5504
|
return void 0;
|
|
@@ -5508,6 +5527,7 @@ function CollapsibleReveal({
|
|
|
5508
5527
|
if (wasExpanded && visible && height === "auto") {
|
|
5509
5528
|
return void 0;
|
|
5510
5529
|
}
|
|
5530
|
+
heightTransitionPendingRef.current = true;
|
|
5511
5531
|
setVisible(false);
|
|
5512
5532
|
setRevealHeight("0px");
|
|
5513
5533
|
const animationFrame2 = requestAnimationFrame(() => {
|
|
@@ -5518,6 +5538,7 @@ function CollapsibleReveal({
|
|
|
5518
5538
|
return () => cancelAnimationFrame(animationFrame2);
|
|
5519
5539
|
}
|
|
5520
5540
|
if (!wasExpanded) {
|
|
5541
|
+
heightTransitionPendingRef.current = false;
|
|
5521
5542
|
setVisible(false);
|
|
5522
5543
|
setRevealHeight("0px");
|
|
5523
5544
|
return void 0;
|
|
@@ -5526,6 +5547,7 @@ function CollapsibleReveal({
|
|
|
5526
5547
|
const cachedHeight = measuredHeightRef.current;
|
|
5527
5548
|
const measuredHeight = renderedHeight > 0 ? renderedHeight : cachedHeight ?? root.scrollHeight;
|
|
5528
5549
|
measuredHeightRef.current = measuredHeight;
|
|
5550
|
+
heightTransitionPendingRef.current = true;
|
|
5529
5551
|
setRevealHeight(`${measuredHeight}px`);
|
|
5530
5552
|
setVisible(false);
|
|
5531
5553
|
const animationFrame = requestAnimationFrame(() => {
|
|
@@ -5583,17 +5605,19 @@ function CollapsibleReveal({
|
|
|
5583
5605
|
}
|
|
5584
5606
|
if (visible) {
|
|
5585
5607
|
setRevealHeight("auto");
|
|
5586
|
-
|
|
5587
|
-
}
|
|
5588
|
-
if (!expanded && !preMountOnIdle) {
|
|
5608
|
+
} else if (!expanded && !preMountOnIdle) {
|
|
5589
5609
|
setMounted(false);
|
|
5590
5610
|
}
|
|
5611
|
+
if (heightTransitionPendingRef.current) {
|
|
5612
|
+
heightTransitionPendingRef.current = false;
|
|
5613
|
+
onHeightTransitionEnd?.();
|
|
5614
|
+
}
|
|
5591
5615
|
};
|
|
5592
5616
|
const rootStyle = { height };
|
|
5593
5617
|
return /* @__PURE__ */ jsx5(
|
|
5594
5618
|
"div",
|
|
5595
5619
|
{
|
|
5596
|
-
ref:
|
|
5620
|
+
ref: setRootRef,
|
|
5597
5621
|
className: ["agent-collapsible-reveal", className ?? ""].filter(Boolean).join(" "),
|
|
5598
5622
|
"data-expanded": preMountOnIdle && expanded ? "true" : visible ? "true" : "false",
|
|
5599
5623
|
"aria-hidden": visible ? void 0 : true,
|
|
@@ -5719,6 +5743,7 @@ function AgentVisibleErrorMessage({
|
|
|
5719
5743
|
onExternalLink
|
|
5720
5744
|
}) {
|
|
5721
5745
|
"use memo";
|
|
5746
|
+
const openAgentEnvPanel = useOpenAgentEnvPanel();
|
|
5722
5747
|
const error = message.visibleError;
|
|
5723
5748
|
const detail = error?.detail?.trim() ?? "";
|
|
5724
5749
|
const providerLabel = workspaceAgentProviderLabel(
|
|
@@ -5750,7 +5775,7 @@ function AgentVisibleErrorMessage({
|
|
|
5750
5775
|
}
|
|
5751
5776
|
) : null
|
|
5752
5777
|
] }),
|
|
5753
|
-
actionKey && (focus || externalUrl && onExternalLink) ? /* @__PURE__ */ jsx8(
|
|
5778
|
+
actionKey && (focus && openAgentEnvPanel || externalUrl && onExternalLink) ? /* @__PURE__ */ jsx8(
|
|
5754
5779
|
Button,
|
|
5755
5780
|
{
|
|
5756
5781
|
type: "button",
|
|
@@ -5762,7 +5787,7 @@ function AgentVisibleErrorMessage({
|
|
|
5762
5787
|
onExternalLink?.(externalUrl);
|
|
5763
5788
|
return;
|
|
5764
5789
|
}
|
|
5765
|
-
if (focus) {
|
|
5790
|
+
if (focus && openAgentEnvPanel) {
|
|
5766
5791
|
openAgentEnvPanel({
|
|
5767
5792
|
provider: error?.provider ?? null,
|
|
5768
5793
|
focus
|
|
@@ -12864,7 +12889,8 @@ function useAgentTurnDisclosureStoreState() {
|
|
|
12864
12889
|
}
|
|
12865
12890
|
|
|
12866
12891
|
// shared/agentConversation/components/AgentTurnWorkSection.tsx
|
|
12867
|
-
import {
|
|
12892
|
+
import { useCallback as useCallback11, useRef as useRef8 } from "react";
|
|
12893
|
+
import { Button as Button2 } from "@tutti-os/ui-system/components";
|
|
12868
12894
|
import { ChevronDownIcon } from "@tutti-os/ui-system/icons";
|
|
12869
12895
|
|
|
12870
12896
|
// shared/agentConversation/components/agentTurnWorkSectionModel.ts
|
|
@@ -13069,12 +13095,47 @@ function AgentTurnWorkSection({
|
|
|
13069
13095
|
turnKey,
|
|
13070
13096
|
showDivider = false,
|
|
13071
13097
|
disclosureStore,
|
|
13098
|
+
onDisclosureMotionChange,
|
|
13072
13099
|
renderRow
|
|
13073
13100
|
}) {
|
|
13074
13101
|
const { t } = useTranslation();
|
|
13075
13102
|
const disclosureKey = `${sessionId}:${turnKey}`;
|
|
13076
13103
|
const expanded = model.collapseEligible ? disclosureStore.expandedOverrides[disclosureKey] ?? false : true;
|
|
13077
13104
|
const toggleLabel = expanded ? t("agentHost.agentGui.collapseTurnWork") : t("agentHost.agentGui.expandTurnWork");
|
|
13105
|
+
const pendingRevealTransitionsRef = useRef8(0);
|
|
13106
|
+
const disclosureMotionActiveRef = useRef8(false);
|
|
13107
|
+
const collapsibleSectionCount = model.sections.reduce(
|
|
13108
|
+
(count, section) => count + (section.kind === "work" && model.collapseEligible ? 1 : 0),
|
|
13109
|
+
0
|
|
13110
|
+
);
|
|
13111
|
+
const finishDisclosureMotion = useCallback11(() => {
|
|
13112
|
+
if (!disclosureMotionActiveRef.current) {
|
|
13113
|
+
return;
|
|
13114
|
+
}
|
|
13115
|
+
disclosureMotionActiveRef.current = false;
|
|
13116
|
+
pendingRevealTransitionsRef.current = 0;
|
|
13117
|
+
onDisclosureMotionChange?.(turnKey, false);
|
|
13118
|
+
}, [onDisclosureMotionChange, turnKey]);
|
|
13119
|
+
const startDisclosureMotion = useCallback11(
|
|
13120
|
+
(anchorElement) => {
|
|
13121
|
+
pendingRevealTransitionsRef.current = collapsibleSectionCount;
|
|
13122
|
+
if (collapsibleSectionCount === 0) {
|
|
13123
|
+
return;
|
|
13124
|
+
}
|
|
13125
|
+
disclosureMotionActiveRef.current = true;
|
|
13126
|
+
onDisclosureMotionChange?.(turnKey, true, anchorElement);
|
|
13127
|
+
},
|
|
13128
|
+
[collapsibleSectionCount, onDisclosureMotionChange, turnKey]
|
|
13129
|
+
);
|
|
13130
|
+
const handleRevealTransitionEnd = useCallback11(() => {
|
|
13131
|
+
if (!disclosureMotionActiveRef.current) {
|
|
13132
|
+
return;
|
|
13133
|
+
}
|
|
13134
|
+
pendingRevealTransitionsRef.current -= 1;
|
|
13135
|
+
if (pendingRevealTransitionsRef.current <= 0) {
|
|
13136
|
+
finishDisclosureMotion();
|
|
13137
|
+
}
|
|
13138
|
+
}, [finishDisclosureMotion]);
|
|
13078
13139
|
return /* @__PURE__ */ jsxs45("div", { className: "grid min-w-0", "data-agent-turn-work-section": turnKey, children: [
|
|
13079
13140
|
showDivider ? /* @__PURE__ */ jsx64(
|
|
13080
13141
|
"div",
|
|
@@ -13085,31 +13146,42 @@ function AgentTurnWorkSection({
|
|
|
13085
13146
|
}
|
|
13086
13147
|
) : null,
|
|
13087
13148
|
model.leadingRows.length > 0 ? /* @__PURE__ */ jsx64("div", { className: "mb-4 grid gap-4", children: renderRows(model.leadingRows, renderRow) }) : null,
|
|
13088
|
-
/* @__PURE__ */
|
|
13149
|
+
/* @__PURE__ */ jsx64(
|
|
13089
13150
|
"div",
|
|
13090
13151
|
{
|
|
13091
13152
|
className: "flex min-h-6 items-center gap-0.5 text-[12px] text-[var(--text-tertiary)]",
|
|
13092
13153
|
"data-agent-turn-work-header": turnKey,
|
|
13093
|
-
children:
|
|
13094
|
-
|
|
13095
|
-
|
|
13096
|
-
|
|
13097
|
-
|
|
13098
|
-
|
|
13099
|
-
|
|
13100
|
-
|
|
13101
|
-
|
|
13102
|
-
|
|
13103
|
-
|
|
13154
|
+
children: model.collapseEligible ? /* @__PURE__ */ jsxs45(
|
|
13155
|
+
Button2,
|
|
13156
|
+
{
|
|
13157
|
+
type: "button",
|
|
13158
|
+
variant: "chrome",
|
|
13159
|
+
size: "xs",
|
|
13160
|
+
className: "-ml-2 gap-0.5 px-2 text-[12px] font-normal",
|
|
13161
|
+
"aria-label": toggleLabel,
|
|
13162
|
+
"aria-expanded": expanded,
|
|
13163
|
+
title: toggleLabel,
|
|
13164
|
+
onClick: (event) => {
|
|
13165
|
+
startDisclosureMotion(
|
|
13166
|
+
event.currentTarget.closest(
|
|
13167
|
+
"[data-agent-turn-work-header]"
|
|
13168
|
+
)
|
|
13169
|
+
);
|
|
13170
|
+
disclosureStore.setExpandedOverride(disclosureKey, !expanded);
|
|
13171
|
+
},
|
|
13172
|
+
children: [
|
|
13173
|
+
/* @__PURE__ */ jsx64(AgentTurnDurationLabel, { timing: model.timing }),
|
|
13174
|
+
/* @__PURE__ */ jsx64(
|
|
13104
13175
|
ChevronDownIcon,
|
|
13105
13176
|
{
|
|
13106
13177
|
"aria-hidden": "true",
|
|
13178
|
+
"data-icon": "inline-end",
|
|
13107
13179
|
className: `transition-transform duration-150 ${expanded ? "rotate-0" : "-rotate-90"}`
|
|
13108
13180
|
}
|
|
13109
13181
|
)
|
|
13110
|
-
|
|
13111
|
-
|
|
13112
|
-
|
|
13182
|
+
]
|
|
13183
|
+
}
|
|
13184
|
+
) : /* @__PURE__ */ jsx64(AgentTurnDurationLabel, { timing: model.timing })
|
|
13113
13185
|
}
|
|
13114
13186
|
),
|
|
13115
13187
|
model.sections.map((section, sectionIndex) => {
|
|
@@ -13131,6 +13203,7 @@ function AgentTurnWorkSection({
|
|
|
13131
13203
|
{
|
|
13132
13204
|
expanded,
|
|
13133
13205
|
innerClassName: "grid gap-4 pt-4",
|
|
13206
|
+
onHeightTransitionEnd: handleRevealTransitionEnd,
|
|
13134
13207
|
children: content
|
|
13135
13208
|
},
|
|
13136
13209
|
`work:${firstRow?.renderKey ?? firstRow?.row.id ?? sectionIndex}`
|
|
@@ -13314,18 +13387,21 @@ function looksLikeTableSeparator(line) {
|
|
|
13314
13387
|
});
|
|
13315
13388
|
}
|
|
13316
13389
|
|
|
13390
|
+
// shared/agentConversation/components/useTurnDisclosureMotion.ts
|
|
13391
|
+
import { useCallback as useCallback12, useRef as useRef11, useState as useState23 } from "react";
|
|
13392
|
+
|
|
13317
13393
|
// shared/agentConversation/components/AgentMessageLocatorRail.tsx
|
|
13318
13394
|
import {
|
|
13319
13395
|
useEffect as useEffect13,
|
|
13320
13396
|
useLayoutEffect as useLayoutEffect3,
|
|
13321
|
-
useRef as
|
|
13397
|
+
useRef as useRef10,
|
|
13322
13398
|
useState as useState22
|
|
13323
13399
|
} from "react";
|
|
13324
13400
|
|
|
13325
13401
|
// shared/agentConversation/components/agentTranscriptModel.ts
|
|
13326
|
-
import { useLayoutEffect as useLayoutEffect2, useRef as
|
|
13402
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef9 } from "react";
|
|
13327
13403
|
function useEnteringTranscriptRows(rowKeys) {
|
|
13328
|
-
const previousKeysRef =
|
|
13404
|
+
const previousKeysRef = useRef9(null);
|
|
13329
13405
|
const previousKeys = previousKeysRef.current;
|
|
13330
13406
|
const enteringRowKeys = /* @__PURE__ */ new Set();
|
|
13331
13407
|
if (previousKeys) {
|
|
@@ -13464,14 +13540,14 @@ function AgentMessageLocatorRail({
|
|
|
13464
13540
|
label,
|
|
13465
13541
|
onLocate
|
|
13466
13542
|
}) {
|
|
13467
|
-
const locatorRef =
|
|
13468
|
-
const locatorViewportRef =
|
|
13469
|
-
const closePanelTimeoutRef =
|
|
13543
|
+
const locatorRef = useRef10(null);
|
|
13544
|
+
const locatorViewportRef = useRef10(null);
|
|
13545
|
+
const closePanelTimeoutRef = useRef10(null);
|
|
13470
13546
|
const [isPanelOpen, setIsPanelOpen] = useState22(false);
|
|
13471
13547
|
const [shouldRenderPanel, setShouldRenderPanel] = useState22(false);
|
|
13472
13548
|
const [activeKey, setActiveKey] = useState22(null);
|
|
13473
13549
|
const [selectedKey, setSelectedKey] = useState22(null);
|
|
13474
|
-
const previousAgentResponseByKeyRef =
|
|
13550
|
+
const previousAgentResponseByKeyRef = useRef10(null);
|
|
13475
13551
|
const [unreadAgentResponseKeys, setUnreadAgentResponseKeys] = useState22(/* @__PURE__ */ new Set());
|
|
13476
13552
|
const [visibleFrame, setVisibleFrame] = useState22(null);
|
|
13477
13553
|
useEffect13(() => {
|
|
@@ -13938,6 +14014,83 @@ function selectMessageLocatorItemAtViewportCenter(scrollParent, items) {
|
|
|
13938
14014
|
return nearest?.key ?? null;
|
|
13939
14015
|
}
|
|
13940
14016
|
|
|
14017
|
+
// shared/agentConversation/components/useTurnDisclosureMotion.ts
|
|
14018
|
+
var TurnDisclosureMotionController = class {
|
|
14019
|
+
movingTurnKeys = /* @__PURE__ */ new Set();
|
|
14020
|
+
scrollAnchor = null;
|
|
14021
|
+
setTurnMotionActive(turnKey, active, anchorElement) {
|
|
14022
|
+
if (active) {
|
|
14023
|
+
this.movingTurnKeys.add(turnKey);
|
|
14024
|
+
if (anchorElement) {
|
|
14025
|
+
this.scrollAnchor?.release();
|
|
14026
|
+
this.scrollAnchor = lockDisclosureRowPosition(anchorElement);
|
|
14027
|
+
}
|
|
14028
|
+
} else {
|
|
14029
|
+
this.movingTurnKeys.delete(turnKey);
|
|
14030
|
+
if (this.movingTurnKeys.size === 0) {
|
|
14031
|
+
this.scrollAnchor?.release();
|
|
14032
|
+
this.scrollAnchor = null;
|
|
14033
|
+
}
|
|
14034
|
+
}
|
|
14035
|
+
return this.movingTurnKeys.size > 0;
|
|
14036
|
+
}
|
|
14037
|
+
};
|
|
14038
|
+
function lockDisclosureRowPosition(anchorElement) {
|
|
14039
|
+
const scrollParent = findMessageLocatorScrollParent(anchorElement);
|
|
14040
|
+
if (!scrollParent) {
|
|
14041
|
+
return null;
|
|
14042
|
+
}
|
|
14043
|
+
const anchorTop = anchorElement.getBoundingClientRect().top;
|
|
14044
|
+
const previousOverflowAnchor = scrollParent.style.getPropertyValue("overflow-anchor");
|
|
14045
|
+
const previousOverflowAnchorPriority = scrollParent.style.getPropertyPriority("overflow-anchor");
|
|
14046
|
+
scrollParent.style.setProperty("overflow-anchor", "none");
|
|
14047
|
+
const preserveAnchorTop = () => {
|
|
14048
|
+
if (!anchorElement.isConnected) {
|
|
14049
|
+
return;
|
|
14050
|
+
}
|
|
14051
|
+
const topDelta = anchorElement.getBoundingClientRect().top - anchorTop;
|
|
14052
|
+
if (Math.abs(topDelta) < 0.5) {
|
|
14053
|
+
return;
|
|
14054
|
+
}
|
|
14055
|
+
scrollParent.scrollTop += topDelta;
|
|
14056
|
+
};
|
|
14057
|
+
scrollParent.addEventListener("scroll", preserveAnchorTop);
|
|
14058
|
+
return {
|
|
14059
|
+
release: () => {
|
|
14060
|
+
preserveAnchorTop();
|
|
14061
|
+
scrollParent.removeEventListener("scroll", preserveAnchorTop);
|
|
14062
|
+
if (previousOverflowAnchor) {
|
|
14063
|
+
scrollParent.style.setProperty(
|
|
14064
|
+
"overflow-anchor",
|
|
14065
|
+
previousOverflowAnchor,
|
|
14066
|
+
previousOverflowAnchorPriority
|
|
14067
|
+
);
|
|
14068
|
+
} else {
|
|
14069
|
+
scrollParent.style.removeProperty("overflow-anchor");
|
|
14070
|
+
}
|
|
14071
|
+
}
|
|
14072
|
+
};
|
|
14073
|
+
}
|
|
14074
|
+
function useTurnDisclosureMotion() {
|
|
14075
|
+
const motionControllerRef = useRef11(
|
|
14076
|
+
null
|
|
14077
|
+
);
|
|
14078
|
+
if (!motionControllerRef.current) {
|
|
14079
|
+
motionControllerRef.current = new TurnDisclosureMotionController();
|
|
14080
|
+
}
|
|
14081
|
+
const motionController = motionControllerRef.current;
|
|
14082
|
+
const [active, setActive] = useState23(false);
|
|
14083
|
+
const setTurnMotionActive = useCallback12(
|
|
14084
|
+
(turnKey, moving, anchorElement) => {
|
|
14085
|
+
setActive(
|
|
14086
|
+
motionController.setTurnMotionActive(turnKey, moving, anchorElement)
|
|
14087
|
+
);
|
|
14088
|
+
},
|
|
14089
|
+
[motionController]
|
|
14090
|
+
);
|
|
14091
|
+
return [active, setTurnMotionActive];
|
|
14092
|
+
}
|
|
14093
|
+
|
|
13941
14094
|
// shared/agentConversation/components/AgentTranscriptView.tsx
|
|
13942
14095
|
import { Fragment as Fragment8, jsx as jsx66, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
13943
14096
|
var AGENT_TRANSCRIPT_VIRTUALIZATION_OVERSCAN = 6;
|
|
@@ -13945,6 +14098,7 @@ var AGENT_TRANSCRIPT_ESTIMATED_TURN_HEIGHT_PX = 280;
|
|
|
13945
14098
|
var AGENT_TRANSCRIPT_DISCLOSURE_TURN_GAP_PX = 24;
|
|
13946
14099
|
var AGENT_TRANSCRIPT_LEGACY_TURN_GAP_PX = 12;
|
|
13947
14100
|
var AGENT_TRANSCRIPT_FALLBACK_TURN_COUNT = 3;
|
|
14101
|
+
var preventVirtualScrollAdjustment = () => false;
|
|
13948
14102
|
function transcriptLabelsEqual(previous, next) {
|
|
13949
14103
|
return previous === next || previous.thinkingLabel === next.thinkingLabel && previous.processing === next.processing && previous.turnSummary === next.turnSummary && previous.rawTimelineJson === next.rawTimelineJson && previous.userMessageLocator === next.userMessageLocator && previous.toolCallsLabel === next.toolCallsLabel;
|
|
13950
14104
|
}
|
|
@@ -13983,10 +14137,11 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
|
|
|
13983
14137
|
labels
|
|
13984
14138
|
}) {
|
|
13985
14139
|
"use memo";
|
|
13986
|
-
const [expandedToolRows, setExpandedToolRows] =
|
|
14140
|
+
const [expandedToolRows, setExpandedToolRows] = useState24({});
|
|
14141
|
+
const [hasMovingTurnDisclosure, handleDisclosureMotionChange] = useTurnDisclosureMotion();
|
|
13987
14142
|
const turnDisclosureStore = useAgentTurnDisclosureStore();
|
|
13988
|
-
const virtualizerHostRef =
|
|
13989
|
-
const [virtualScrollElement, setVirtualScrollElement] =
|
|
14143
|
+
const virtualizerHostRef = useRef12(null);
|
|
14144
|
+
const [virtualScrollElement, setVirtualScrollElement] = useState24(null);
|
|
13990
14145
|
const rowKeys = useMemo7(
|
|
13991
14146
|
() => conversation.rows.map(transcriptRowKey),
|
|
13992
14147
|
[conversation.rows]
|
|
@@ -14008,7 +14163,7 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
|
|
|
14008
14163
|
[conversation.rows, rowKeys, turnGroupIndexByRowIndex]
|
|
14009
14164
|
);
|
|
14010
14165
|
const enteringRowKeys = useEnteringTranscriptRows(rowKeys);
|
|
14011
|
-
const handleToolGroupExpandedChange =
|
|
14166
|
+
const handleToolGroupExpandedChange = useCallback13(
|
|
14012
14167
|
(key, expanded) => {
|
|
14013
14168
|
setExpandedToolRows((previous) => {
|
|
14014
14169
|
if (previous[key] === expanded) {
|
|
@@ -14062,7 +14217,7 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
|
|
|
14062
14217
|
[turnGroups]
|
|
14063
14218
|
);
|
|
14064
14219
|
const rowVirtualizer = useVirtualizer({
|
|
14065
|
-
anchorTo: "end",
|
|
14220
|
+
anchorTo: shouldVirtualize && hasMovingTurnDisclosure ? "start" : "end",
|
|
14066
14221
|
count: turnGroups.length,
|
|
14067
14222
|
estimateSize: () => AGENT_TRANSCRIPT_ESTIMATED_TURN_HEIGHT_PX,
|
|
14068
14223
|
getItemKey: (index) => turnGroups[index]?.key ?? index,
|
|
@@ -14070,7 +14225,8 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
|
|
|
14070
14225
|
overscan: AGENT_TRANSCRIPT_VIRTUALIZATION_OVERSCAN,
|
|
14071
14226
|
scrollEndThreshold: 24
|
|
14072
14227
|
});
|
|
14073
|
-
|
|
14228
|
+
rowVirtualizer.shouldAdjustScrollPositionOnItemSizeChange = shouldVirtualize && hasMovingTurnDisclosure ? preventVirtualScrollAdjustment : void 0;
|
|
14229
|
+
const handleLocateUserMessage = useCallback13(
|
|
14074
14230
|
(item) => {
|
|
14075
14231
|
const scrollParent = virtualizerHostRef.current ? findMessageLocatorScrollParent(virtualizerHostRef.current) : null;
|
|
14076
14232
|
const scrollToRenderedRow = () => {
|
|
@@ -14169,6 +14325,7 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
|
|
|
14169
14325
|
({ rowIndex }) => dividerRowIndexes.has(rowIndex)
|
|
14170
14326
|
),
|
|
14171
14327
|
disclosureStore: turnDisclosureStore,
|
|
14328
|
+
onDisclosureMotionChange: handleDisclosureMotionChange,
|
|
14172
14329
|
renderRow
|
|
14173
14330
|
},
|
|
14174
14331
|
group.key
|
|
@@ -14282,13 +14439,13 @@ var AgentConversationFlow = memo5(function AgentConversationFlow2({
|
|
|
14282
14439
|
});
|
|
14283
14440
|
|
|
14284
14441
|
// shared/agentConversation/projection/useProjectedAgentConversation.ts
|
|
14285
|
-
import { useMemo as useMemo8, useRef as
|
|
14442
|
+
import { useMemo as useMemo8, useRef as useRef13 } from "react";
|
|
14286
14443
|
function useProjectedAgentConversation({
|
|
14287
14444
|
conversation,
|
|
14288
14445
|
detail,
|
|
14289
14446
|
avoidGroupingEdits = false
|
|
14290
14447
|
}) {
|
|
14291
|
-
const previousConversationRef =
|
|
14448
|
+
const previousConversationRef = useRef13(null);
|
|
14292
14449
|
return useMemo8(() => {
|
|
14293
14450
|
if (!conversation && !detail) {
|
|
14294
14451
|
previousConversationRef.current = null;
|
|
@@ -14344,4 +14501,4 @@ export {
|
|
|
14344
14501
|
AgentConversationFlow,
|
|
14345
14502
|
useProjectedAgentConversation
|
|
14346
14503
|
};
|
|
14347
|
-
//# sourceMappingURL=chunk-
|
|
14504
|
+
//# sourceMappingURL=chunk-A6NSHCRP.js.map
|