@tutti-os/agent-gui 0.0.57 → 0.0.58
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/agent-conversation/index.js +9 -8
- package/dist/agent-conversation/index.js.map +1 -1
- package/dist/agent-env/index.d.ts +285 -0
- package/dist/agent-env/index.js +360 -0
- package/dist/agent-env/index.js.map +1 -0
- package/dist/agent-message-center/index.js +11 -11
- package/dist/app/renderer/agentactivity.css +8 -33
- package/dist/{chunk-RGVVHF7Q.js → chunk-2WUDORCV.js} +2 -2
- package/dist/{chunk-Z3AAQQFD.js → chunk-5SRRKWE4.js} +2 -2
- package/dist/{chunk-DZ76JPCV.js → chunk-BEFNWUOZ.js} +95 -154
- package/dist/chunk-BEFNWUOZ.js.map +1 -0
- package/dist/{chunk-IMZBRUP3.js → chunk-BT5WEZO5.js} +7 -7
- package/dist/{chunk-HFZOXSSQ.js → chunk-CEMXB7LA.js} +5 -5
- package/dist/{chunk-S6PCOX3S.js → chunk-HVU46DDA.js} +1 -1
- package/dist/chunk-HVU46DDA.js.map +1 -0
- package/dist/{chunk-33LWYV6O.js → chunk-IS6JUDDY.js} +9 -1
- package/dist/chunk-IS6JUDDY.js.map +1 -0
- package/dist/{chunk-VOXUYDQF.js → chunk-N756UO52.js} +11 -7
- package/dist/chunk-N756UO52.js.map +1 -0
- package/dist/{chunk-N37A5CJH.js → chunk-NX6T3DDS.js} +3 -3
- package/dist/{chunk-KOR6UVUJ.js → chunk-OFMORNBO.js} +5 -5
- package/dist/{chunk-QFHR527D.js → chunk-OLI2A3EM.js} +2 -2
- package/dist/chunk-PSLAWU25.js +145 -0
- package/dist/chunk-PSLAWU25.js.map +1 -0
- package/dist/{chunk-2VHP7KQ5.js → chunk-SLT5Q37C.js} +6 -6
- package/dist/{chunk-SZ7JGCS3.js → chunk-UCCUIUGK.js} +4 -4
- package/dist/context-mention-palette/index.js +7 -7
- package/dist/i18n/index.d.ts +8 -0
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +52 -0
- package/dist/index.js +570 -108
- package/dist/index.js.map +1 -1
- package/dist/workbench/contribution.js +2 -2
- package/dist/workbench/index.js +14 -14
- package/dist/workbench/sessionTitle.js +3 -3
- package/dist/workspace-agent-generated-files.js +3 -3
- package/package.json +19 -12
- package/dist/chunk-33LWYV6O.js.map +0 -1
- package/dist/chunk-DZ76JPCV.js.map +0 -1
- package/dist/chunk-S6PCOX3S.js.map +0 -1
- package/dist/chunk-VOXUYDQF.js.map +0 -1
- /package/dist/{chunk-RGVVHF7Q.js.map → chunk-2WUDORCV.js.map} +0 -0
- /package/dist/{chunk-Z3AAQQFD.js.map → chunk-5SRRKWE4.js.map} +0 -0
- /package/dist/{chunk-IMZBRUP3.js.map → chunk-BT5WEZO5.js.map} +0 -0
- /package/dist/{chunk-HFZOXSSQ.js.map → chunk-CEMXB7LA.js.map} +0 -0
- /package/dist/{chunk-N37A5CJH.js.map → chunk-NX6T3DDS.js.map} +0 -0
- /package/dist/{chunk-KOR6UVUJ.js.map → chunk-OFMORNBO.js.map} +0 -0
- /package/dist/{chunk-QFHR527D.js.map → chunk-OLI2A3EM.js.map} +0 -0
- /package/dist/{chunk-2VHP7KQ5.js.map → chunk-SLT5Q37C.js.map} +0 -0
- /package/dist/{chunk-SZ7JGCS3.js.map → chunk-UCCUIUGK.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
AgentInteractivePromptSurface,
|
|
24
24
|
approvalOptionDisplayLabel
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-OFMORNBO.js";
|
|
26
26
|
import {
|
|
27
27
|
PLAN_IMPLEMENTATION_ACTION_FEEDBACK,
|
|
28
28
|
PLAN_IMPLEMENTATION_ACTION_IMPLEMENT,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
resolveAgentGUIExplicitConversationTitle,
|
|
42
42
|
resolveAgentGUIProviderDisplayLabel,
|
|
43
43
|
resolveAgentGUIProviderIdentity
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-UCCUIUGK.js";
|
|
45
45
|
import {
|
|
46
46
|
AgentConversationFlow,
|
|
47
47
|
Button,
|
|
@@ -53,7 +53,6 @@ import {
|
|
|
53
53
|
editorToPromptText,
|
|
54
54
|
getAppErrorCode,
|
|
55
55
|
labelForProviderSkill,
|
|
56
|
-
openAgentEnvPanel,
|
|
57
56
|
partitionSubAgentTimelineItems,
|
|
58
57
|
plainTextToAgentRichTextDoc,
|
|
59
58
|
plainTextToAgentRichTextInlineContent,
|
|
@@ -63,14 +62,17 @@ import {
|
|
|
63
62
|
skillTriggerForPrefix,
|
|
64
63
|
toLocalShortDateTime,
|
|
65
64
|
useProjectedAgentConversation
|
|
66
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-BEFNWUOZ.js";
|
|
67
66
|
import {
|
|
68
67
|
AgentMessageMarkdown,
|
|
69
68
|
AgentTargetPresentationProvider,
|
|
70
69
|
ZoomableImage,
|
|
71
70
|
cn,
|
|
72
71
|
resolveWorkspaceLinkAction
|
|
73
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-SLT5Q37C.js";
|
|
73
|
+
import {
|
|
74
|
+
openAgentEnvPanel
|
|
75
|
+
} from "./chunk-PSLAWU25.js";
|
|
74
76
|
import {
|
|
75
77
|
AGENT_MENTION_FILTER_TAB_ORDER,
|
|
76
78
|
AgentFileMentionPalette,
|
|
@@ -78,7 +80,7 @@ import {
|
|
|
78
80
|
DEFAULT_AGENT_MENTION_FILTER,
|
|
79
81
|
agentMentionItemKey,
|
|
80
82
|
preloadAgentMentionBrowse
|
|
81
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-BT5WEZO5.js";
|
|
82
84
|
import {
|
|
83
85
|
WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN,
|
|
84
86
|
buildWorkspaceAgentActivityListViewModel,
|
|
@@ -88,10 +90,10 @@ import {
|
|
|
88
90
|
isWorkspaceAgentUntitledTask,
|
|
89
91
|
mergeWorkspaceAgentActivityDurableAndOverlayMessages,
|
|
90
92
|
selectWorkspaceAgentActivityOverlayMessages
|
|
91
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-CEMXB7LA.js";
|
|
92
94
|
import {
|
|
93
95
|
Spinner
|
|
94
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-OLI2A3EM.js";
|
|
95
97
|
import {
|
|
96
98
|
resolveWorkspaceAgentSessionSortTimeUnixMs
|
|
97
99
|
} from "./chunk-IBIMGLCD.js";
|
|
@@ -102,7 +104,7 @@ import {
|
|
|
102
104
|
mentionItemToAttrs,
|
|
103
105
|
normalizeAgentSessionMentionTitle,
|
|
104
106
|
parseMentionItemFromHref
|
|
105
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-NX6T3DDS.js";
|
|
106
108
|
import "./chunk-Y35GDLP2.js";
|
|
107
109
|
import "./chunk-LUGELG5V.js";
|
|
108
110
|
import {
|
|
@@ -124,10 +126,18 @@ import {
|
|
|
124
126
|
useAgentHostApi,
|
|
125
127
|
useOptionalAgentActivityRuntime,
|
|
126
128
|
useOptionalAgentHostApi
|
|
127
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-HVU46DDA.js";
|
|
128
130
|
import "./chunk-TYGL25EL.js";
|
|
131
|
+
import {
|
|
132
|
+
AgentGuiI18nProvider,
|
|
133
|
+
agentGuiI18nModule,
|
|
134
|
+
agentGuiI18nResources,
|
|
135
|
+
translate,
|
|
136
|
+
useTranslation
|
|
137
|
+
} from "./chunk-5SRRKWE4.js";
|
|
129
138
|
import "./chunk-PJP5BUU6.js";
|
|
130
139
|
import "./chunk-MTFSQWZ6.js";
|
|
140
|
+
import "./chunk-IS6JUDDY.js";
|
|
131
141
|
import {
|
|
132
142
|
AGENT_CONTEXT_MENTION_PROVIDER_IDS
|
|
133
143
|
} from "./chunk-JM24HADP.js";
|
|
@@ -135,14 +145,6 @@ import "./chunk-GCBDIQDX.js";
|
|
|
135
145
|
import {
|
|
136
146
|
createAgentQueuedPromptRuntime
|
|
137
147
|
} from "./chunk-TG3ZXLPM.js";
|
|
138
|
-
import {
|
|
139
|
-
AgentGuiI18nProvider,
|
|
140
|
-
agentGuiI18nModule,
|
|
141
|
-
agentGuiI18nResources,
|
|
142
|
-
translate,
|
|
143
|
-
useTranslation
|
|
144
|
-
} from "./chunk-Z3AAQQFD.js";
|
|
145
|
-
import "./chunk-33LWYV6O.js";
|
|
146
148
|
|
|
147
149
|
// shared/agentActivitySnapshotProjection.ts
|
|
148
150
|
import {
|
|
@@ -15865,7 +15867,7 @@ import {
|
|
|
15865
15867
|
useRef as useRef11,
|
|
15866
15868
|
useState as useState10
|
|
15867
15869
|
} from "react";
|
|
15868
|
-
import { createPortal as createPortal3 } from "react-dom";
|
|
15870
|
+
import { createPortal as createPortal3, flushSync } from "react-dom";
|
|
15869
15871
|
import {
|
|
15870
15872
|
AddIcon,
|
|
15871
15873
|
Button as Button3,
|
|
@@ -20006,6 +20008,7 @@ function AgentUsageChip({
|
|
|
20006
20008
|
"use memo";
|
|
20007
20009
|
const [usagePopoverOpen, setUsagePopoverOpen] = useState10(false);
|
|
20008
20010
|
const usagePopoverHoverTimerRef = useRef11(null);
|
|
20011
|
+
const usagePopoverContentRef = useRef11(null);
|
|
20009
20012
|
const clampedPercent = Math.max(0, Math.min(100, percentUsed));
|
|
20010
20013
|
const chipLabel = labels.usageChipLabel({ percent: clampedPercent });
|
|
20011
20014
|
const showTokens = usedTokens !== null && totalTokens !== null;
|
|
@@ -20060,6 +20063,22 @@ function AgentUsageChip({
|
|
|
20060
20063
|
},
|
|
20061
20064
|
[closeUsagePopover, openUsagePopover]
|
|
20062
20065
|
);
|
|
20066
|
+
const handleUsageTriggerBlur = useCallback9(
|
|
20067
|
+
(event) => {
|
|
20068
|
+
const nextFocusTarget = event.relatedTarget;
|
|
20069
|
+
if (nextFocusTarget instanceof Node && usagePopoverContentRef.current?.contains(nextFocusTarget)) {
|
|
20070
|
+
clearUsagePopoverHoverTimer();
|
|
20071
|
+
clearUsagePopoverCloseTimer();
|
|
20072
|
+
return;
|
|
20073
|
+
}
|
|
20074
|
+
closeUsagePopover();
|
|
20075
|
+
},
|
|
20076
|
+
[
|
|
20077
|
+
clearUsagePopoverCloseTimer,
|
|
20078
|
+
clearUsagePopoverHoverTimer,
|
|
20079
|
+
closeUsagePopover
|
|
20080
|
+
]
|
|
20081
|
+
);
|
|
20063
20082
|
useEffect11(
|
|
20064
20083
|
() => () => {
|
|
20065
20084
|
clearUsagePopoverHoverTimer();
|
|
@@ -20078,8 +20097,7 @@ function AgentUsageChip({
|
|
|
20078
20097
|
),
|
|
20079
20098
|
"data-testid": "agent-gui-usage-chip",
|
|
20080
20099
|
"data-usage-level": usageLevel,
|
|
20081
|
-
onBlur: tooltipsEnabled ?
|
|
20082
|
-
onClick: tooltipsEnabled ? openUsagePopover : void 0,
|
|
20100
|
+
onBlur: tooltipsEnabled ? handleUsageTriggerBlur : void 0,
|
|
20083
20101
|
onFocus: tooltipsEnabled ? openUsagePopoverAfterHoverDelay : void 0,
|
|
20084
20102
|
onPointerEnter: (event) => {
|
|
20085
20103
|
if (tooltipsEnabled && event.pointerType !== "touch") {
|
|
@@ -20109,10 +20127,11 @@ function AgentUsageChip({
|
|
|
20109
20127
|
open: usagePopoverOpen,
|
|
20110
20128
|
onOpenChange: handleUsagePopoverOpenChange,
|
|
20111
20129
|
children: [
|
|
20112
|
-
/* @__PURE__ */ jsx28(
|
|
20130
|
+
/* @__PURE__ */ jsx28(PopoverAnchor, { asChild: true, children: trigger }),
|
|
20113
20131
|
usagePopoverOpen ? /* @__PURE__ */ jsx28(
|
|
20114
20132
|
PopoverContent,
|
|
20115
20133
|
{
|
|
20134
|
+
ref: usagePopoverContentRef,
|
|
20116
20135
|
side: "bottom",
|
|
20117
20136
|
align: "end",
|
|
20118
20137
|
className: "w-[320px] max-w-[calc(100vw-32px)] gap-3 text-xs",
|
|
@@ -20254,6 +20273,7 @@ function AgentComposer({
|
|
|
20254
20273
|
uiLanguage = "en",
|
|
20255
20274
|
isActive = true,
|
|
20256
20275
|
previewMode = false,
|
|
20276
|
+
workspaceReferencePickerOpen = false,
|
|
20257
20277
|
promptImagesSupported = true,
|
|
20258
20278
|
composerFocusRequestSequence = null,
|
|
20259
20279
|
layoutMode = "dock",
|
|
@@ -21061,7 +21081,7 @@ function AgentComposer({
|
|
|
21061
21081
|
(event) => handleFileMentionKeyDown(event) || handleSlashPaletteKeyDown(event) || handleSlashCommandMenuKeyDown(event) || handlePlanModeToggleKeyDown(event)
|
|
21062
21082
|
);
|
|
21063
21083
|
useEffect11(() => {
|
|
21064
|
-
if (!showPalette) {
|
|
21084
|
+
if (!showPalette || workspaceReferencePickerOpen) {
|
|
21065
21085
|
return;
|
|
21066
21086
|
}
|
|
21067
21087
|
const handleDocumentKeyDown = (event) => {
|
|
@@ -21089,7 +21109,7 @@ function AgentComposer({
|
|
|
21089
21109
|
capture: true
|
|
21090
21110
|
});
|
|
21091
21111
|
};
|
|
21092
|
-
}, [handlePaletteKeyDown, showPalette]);
|
|
21112
|
+
}, [handlePaletteKeyDown, showPalette, workspaceReferencePickerOpen]);
|
|
21093
21113
|
const handleFileMentionSuggestionChange = useCallback9(
|
|
21094
21114
|
(state) => {
|
|
21095
21115
|
setFileMentionSuggestion(state);
|
|
@@ -21407,18 +21427,18 @@ function AgentComposer({
|
|
|
21407
21427
|
);
|
|
21408
21428
|
const handleOpenReferencesForEntity = useCallback9(
|
|
21409
21429
|
(entity) => {
|
|
21410
|
-
clearActiveFileMentionTrigger();
|
|
21411
|
-
closeFileMentionPalette();
|
|
21412
21430
|
if (!onRequestWorkspaceReferences) {
|
|
21413
21431
|
return;
|
|
21414
21432
|
}
|
|
21415
|
-
void onRequestWorkspaceReferences(entity).then(
|
|
21416
|
-
(result
|
|
21417
|
-
|
|
21433
|
+
void onRequestWorkspaceReferences(entity).then((result) => {
|
|
21434
|
+
if (result.files.length > 0 || result.mentionItems.length > 0) {
|
|
21435
|
+
flushSync(clearActiveFileMentionTrigger);
|
|
21436
|
+
}
|
|
21437
|
+
return applyReferencePickResult(result);
|
|
21438
|
+
});
|
|
21418
21439
|
},
|
|
21419
21440
|
[
|
|
21420
21441
|
clearActiveFileMentionTrigger,
|
|
21421
|
-
closeFileMentionPalette,
|
|
21422
21442
|
applyReferencePickResult,
|
|
21423
21443
|
onRequestWorkspaceReferences
|
|
21424
21444
|
]
|
|
@@ -22332,65 +22352,69 @@ function AgentComposer({
|
|
|
22332
22352
|
/* @__PURE__ */ jsxs15("div", { className: AgentGUINode_styles_default.composerFooter, children: [
|
|
22333
22353
|
/* @__PURE__ */ jsxs15("div", { className: composerStyles.footerGroup, children: [
|
|
22334
22354
|
/* @__PURE__ */ jsxs15("div", { className: "inline-flex shrink-0 items-center gap-1", children: [
|
|
22335
|
-
previewMode ? /* @__PURE__ */ jsx28(
|
|
22336
|
-
|
|
22337
|
-
|
|
22338
|
-
|
|
22339
|
-
|
|
22340
|
-
|
|
22341
|
-
|
|
22342
|
-
|
|
22343
|
-
|
|
22344
|
-
|
|
22345
|
-
|
|
22346
|
-
|
|
22347
|
-
|
|
22348
|
-
|
|
22349
|
-
|
|
22350
|
-
|
|
22351
|
-
|
|
22352
|
-
|
|
22353
|
-
|
|
22354
|
-
|
|
22355
|
-
|
|
22356
|
-
|
|
22357
|
-
|
|
22358
|
-
|
|
22359
|
-
|
|
22360
|
-
|
|
22361
|
-
|
|
22362
|
-
|
|
22363
|
-
|
|
22364
|
-
|
|
22365
|
-
|
|
22366
|
-
|
|
22367
|
-
|
|
22368
|
-
|
|
22369
|
-
|
|
22370
|
-
|
|
22371
|
-
|
|
22372
|
-
|
|
22373
|
-
|
|
22374
|
-
|
|
22375
|
-
|
|
22376
|
-
|
|
22377
|
-
|
|
22378
|
-
|
|
22379
|
-
|
|
22380
|
-
|
|
22381
|
-
|
|
22382
|
-
|
|
22383
|
-
|
|
22384
|
-
|
|
22385
|
-
|
|
22386
|
-
|
|
22387
|
-
|
|
22388
|
-
|
|
22389
|
-
|
|
22390
|
-
|
|
22391
|
-
|
|
22392
|
-
|
|
22393
|
-
|
|
22355
|
+
previewMode ? /* @__PURE__ */ jsx28(TooltipProvider, { delayDuration: 120, children: /* @__PURE__ */ jsxs15(Tooltip, { children: [
|
|
22356
|
+
/* @__PURE__ */ jsx28(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx28(
|
|
22357
|
+
"button",
|
|
22358
|
+
{
|
|
22359
|
+
type: "button",
|
|
22360
|
+
"aria-label": labels.referenceWorkspaceFiles,
|
|
22361
|
+
className: cn(
|
|
22362
|
+
AgentGUINode_styles_default.composerMenuTrigger,
|
|
22363
|
+
AgentGUINode_styles_default.composerReferenceTrigger,
|
|
22364
|
+
"w-auto justify-center text-[var(--agent-gui-text-secondary)] [&_svg]:shrink-0"
|
|
22365
|
+
),
|
|
22366
|
+
children: /* @__PURE__ */ jsx28(
|
|
22367
|
+
AddIcon,
|
|
22368
|
+
{
|
|
22369
|
+
"aria-hidden": true,
|
|
22370
|
+
className: "size-3.5",
|
|
22371
|
+
"data-agent-reference-add-icon": "true"
|
|
22372
|
+
}
|
|
22373
|
+
)
|
|
22374
|
+
}
|
|
22375
|
+
) }),
|
|
22376
|
+
/* @__PURE__ */ jsx28(TooltipContent, { side: "top", children: labels.addContent })
|
|
22377
|
+
] }) }) : /* @__PURE__ */ jsx28(TooltipProvider, { delayDuration: 120, children: /* @__PURE__ */ jsxs15(Tooltip, { children: [
|
|
22378
|
+
/* @__PURE__ */ jsx28(
|
|
22379
|
+
Select2,
|
|
22380
|
+
{
|
|
22381
|
+
open: false,
|
|
22382
|
+
value: workspaceReferenceSelectValue,
|
|
22383
|
+
disabled: !onRequestWorkspaceReferences || composerControlsHardDisabled,
|
|
22384
|
+
onOpenChange: (isOpen) => {
|
|
22385
|
+
if (isOpen) {
|
|
22386
|
+
void handleWorkspaceReferencePicker();
|
|
22387
|
+
}
|
|
22388
|
+
},
|
|
22389
|
+
onValueChange: (nextValue) => {
|
|
22390
|
+
if (nextValue === workspaceReferenceOptionValue) {
|
|
22391
|
+
void handleWorkspaceReferencePicker();
|
|
22392
|
+
}
|
|
22393
|
+
},
|
|
22394
|
+
children: /* @__PURE__ */ jsx28(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx28(
|
|
22395
|
+
SelectTrigger2,
|
|
22396
|
+
{
|
|
22397
|
+
size: "sm",
|
|
22398
|
+
"aria-label": labels.referenceWorkspaceFiles,
|
|
22399
|
+
className: cn(
|
|
22400
|
+
AgentGUINode_styles_default.composerMenuTrigger,
|
|
22401
|
+
AgentGUINode_styles_default.composerReferenceTrigger,
|
|
22402
|
+
"w-auto justify-center text-[var(--agent-gui-text-secondary)] [&>svg:last-child]:hidden [&_svg]:shrink-0"
|
|
22403
|
+
),
|
|
22404
|
+
children: /* @__PURE__ */ jsx28(
|
|
22405
|
+
AddIcon,
|
|
22406
|
+
{
|
|
22407
|
+
"aria-hidden": true,
|
|
22408
|
+
className: "size-3.5",
|
|
22409
|
+
"data-agent-reference-add-icon": "true"
|
|
22410
|
+
}
|
|
22411
|
+
)
|
|
22412
|
+
}
|
|
22413
|
+
) })
|
|
22414
|
+
}
|
|
22415
|
+
),
|
|
22416
|
+
/* @__PURE__ */ jsx28(TooltipContent, { side: "top", children: labels.addContent })
|
|
22417
|
+
] }) }),
|
|
22394
22418
|
/* @__PURE__ */ jsx28(
|
|
22395
22419
|
"button",
|
|
22396
22420
|
{
|
|
@@ -23203,6 +23227,7 @@ var AGENT_GUI_STICK_TO_BOTTOM_THRESHOLD_PX = 24;
|
|
|
23203
23227
|
var AGENT_GUI_TOP_HISTORY_PREFETCH_THRESHOLD_PX = 240;
|
|
23204
23228
|
var AGENT_GUI_TOP_MASK_SCROLL_EPSILON_PX = 1;
|
|
23205
23229
|
var AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE = 5;
|
|
23230
|
+
var AGENT_GUI_CONVERSATION_RAIL_PROJECTION_PROVIDER = "codex";
|
|
23206
23231
|
var AGENT_GUI_TIMELINE_SCROLL_AREA_CONTENT_STYLE = {
|
|
23207
23232
|
width: "100%",
|
|
23208
23233
|
minWidth: "100%",
|
|
@@ -23888,7 +23913,8 @@ function AgentGUINodeView({
|
|
|
23888
23913
|
conversations: viewModel.conversations,
|
|
23889
23914
|
store: conversationRailStore,
|
|
23890
23915
|
storeState: conversationRailStoreState,
|
|
23891
|
-
userProjects: viewModel.userProjects
|
|
23916
|
+
userProjects: viewModel.userProjects,
|
|
23917
|
+
workspaceId: viewModel.workspaceId
|
|
23892
23918
|
}
|
|
23893
23919
|
)
|
|
23894
23920
|
}
|
|
@@ -23926,6 +23952,7 @@ function AgentGUINodeView({
|
|
|
23926
23952
|
uiLanguage,
|
|
23927
23953
|
hideDetailHeader: conversationRailCollapsed,
|
|
23928
23954
|
isActive,
|
|
23955
|
+
workspaceReferencePickerOpen,
|
|
23929
23956
|
composerFocusRequestSequence: detailComposerFocusRequestSequence,
|
|
23930
23957
|
isAgentProviderReady,
|
|
23931
23958
|
slashStatusLimits,
|
|
@@ -24045,6 +24072,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24045
24072
|
hideDetailHeader,
|
|
24046
24073
|
isActive,
|
|
24047
24074
|
previewMode,
|
|
24075
|
+
workspaceReferencePickerOpen,
|
|
24048
24076
|
composerFocusRequestSequence,
|
|
24049
24077
|
isAgentProviderReady,
|
|
24050
24078
|
slashStatusLimits,
|
|
@@ -24391,6 +24419,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24391
24419
|
mentionPalette: labels.mentionPalette,
|
|
24392
24420
|
removeMention: labels.removeMention,
|
|
24393
24421
|
addReference: labels.addReference,
|
|
24422
|
+
addContent: labels.addContent,
|
|
24394
24423
|
referenceWorkspaceFiles: labels.referenceWorkspaceFiles,
|
|
24395
24424
|
providerSwitchLabel: labels.providerSwitchLabel,
|
|
24396
24425
|
projectLocked: labels.projectLocked,
|
|
@@ -24403,6 +24432,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24403
24432
|
interactivePromptLabels,
|
|
24404
24433
|
labels.defaultModel,
|
|
24405
24434
|
labels.addReference,
|
|
24435
|
+
labels.addContent,
|
|
24406
24436
|
labels.deleteQueuedPrompt,
|
|
24407
24437
|
labels.editQueuedPrompt,
|
|
24408
24438
|
labels.fileMentionEmpty,
|
|
@@ -24618,6 +24648,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24618
24648
|
placeholder: viewModel.hasSentUserMessage ? labels.followupPlaceholder : labels.initialPlaceholder,
|
|
24619
24649
|
showStopButton,
|
|
24620
24650
|
previewMode,
|
|
24651
|
+
workspaceReferencePickerOpen,
|
|
24621
24652
|
// Plan decisions replace the composer via bottomDockReplacementPrompt;
|
|
24622
24653
|
// approval / ask-user embed here (composerActivePrompt encodes that).
|
|
24623
24654
|
activePrompt: composerActivePrompt,
|
|
@@ -24671,6 +24702,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24671
24702
|
labels.initialPlaceholder,
|
|
24672
24703
|
labels.promptTips,
|
|
24673
24704
|
previewMode,
|
|
24705
|
+
workspaceReferencePickerOpen,
|
|
24674
24706
|
composerActivePrompt,
|
|
24675
24707
|
editQueuedPrompt,
|
|
24676
24708
|
onCapabilitySettingsRequest,
|
|
@@ -25456,7 +25488,8 @@ var AgentGUIConversationRailStorePane = memo(
|
|
|
25456
25488
|
conversations,
|
|
25457
25489
|
store,
|
|
25458
25490
|
storeState: _storeState,
|
|
25459
|
-
userProjects
|
|
25491
|
+
userProjects,
|
|
25492
|
+
workspaceId
|
|
25460
25493
|
}) {
|
|
25461
25494
|
"use memo";
|
|
25462
25495
|
const state = useSnapshot(store);
|
|
@@ -25465,7 +25498,8 @@ var AgentGUIConversationRailStorePane = memo(
|
|
|
25465
25498
|
{
|
|
25466
25499
|
...state,
|
|
25467
25500
|
conversations,
|
|
25468
|
-
userProjects
|
|
25501
|
+
userProjects,
|
|
25502
|
+
workspaceId
|
|
25469
25503
|
}
|
|
25470
25504
|
);
|
|
25471
25505
|
}
|
|
@@ -25477,6 +25511,40 @@ function normalizeConversationRailProjectPath(path) {
|
|
|
25477
25511
|
}
|
|
25478
25512
|
return normalized.replace(/\/+$/, "") || "/";
|
|
25479
25513
|
}
|
|
25514
|
+
function conversationRailPageCursor(conversations) {
|
|
25515
|
+
let boundary = null;
|
|
25516
|
+
for (const conversation of conversations) {
|
|
25517
|
+
if (!conversation.id.trim()) {
|
|
25518
|
+
continue;
|
|
25519
|
+
}
|
|
25520
|
+
if (!boundary) {
|
|
25521
|
+
boundary = conversation;
|
|
25522
|
+
continue;
|
|
25523
|
+
}
|
|
25524
|
+
if (conversation.updatedAtUnixMs < boundary.updatedAtUnixMs || conversation.updatedAtUnixMs === boundary.updatedAtUnixMs && conversation.id.trim() > boundary.id.trim()) {
|
|
25525
|
+
boundary = conversation;
|
|
25526
|
+
}
|
|
25527
|
+
}
|
|
25528
|
+
if (!boundary) {
|
|
25529
|
+
return null;
|
|
25530
|
+
}
|
|
25531
|
+
return `${boundary.updatedAtUnixMs}|${boundary.id.trim()}`;
|
|
25532
|
+
}
|
|
25533
|
+
function mergeConversationRailPageItems(base, loaded) {
|
|
25534
|
+
if (loaded.length === 0) {
|
|
25535
|
+
return base;
|
|
25536
|
+
}
|
|
25537
|
+
const ids = new Set(base.map((conversation) => conversation.id));
|
|
25538
|
+
const merged = [...base];
|
|
25539
|
+
for (const conversation of loaded) {
|
|
25540
|
+
if (ids.has(conversation.id)) {
|
|
25541
|
+
continue;
|
|
25542
|
+
}
|
|
25543
|
+
ids.add(conversation.id);
|
|
25544
|
+
merged.push(conversation);
|
|
25545
|
+
}
|
|
25546
|
+
return merged;
|
|
25547
|
+
}
|
|
25480
25548
|
function stabilizeConversationSections(previous, next) {
|
|
25481
25549
|
if (!previous) {
|
|
25482
25550
|
return [...next];
|
|
@@ -25537,6 +25605,97 @@ function stabilizeConversationSectionItems(previous, next) {
|
|
|
25537
25605
|
});
|
|
25538
25606
|
return changed ? stable : previous;
|
|
25539
25607
|
}
|
|
25608
|
+
function updateConversationSectionsFromSummaries(previous, conversations) {
|
|
25609
|
+
if (!previous || conversations.length === 0) {
|
|
25610
|
+
return previous;
|
|
25611
|
+
}
|
|
25612
|
+
const summariesById = new Map(
|
|
25613
|
+
conversations.map((conversation) => [conversation.id, conversation])
|
|
25614
|
+
);
|
|
25615
|
+
let changed = false;
|
|
25616
|
+
const nextSections = previous.map((section) => {
|
|
25617
|
+
let sectionChanged = false;
|
|
25618
|
+
const items = section.items.map((item) => {
|
|
25619
|
+
const summary = summariesById.get(item.id);
|
|
25620
|
+
if (!summary) {
|
|
25621
|
+
return item;
|
|
25622
|
+
}
|
|
25623
|
+
const nextItem = {
|
|
25624
|
+
...summary,
|
|
25625
|
+
project: item.project
|
|
25626
|
+
};
|
|
25627
|
+
if (conversationSummariesRenderEqual2(item, nextItem)) {
|
|
25628
|
+
return item;
|
|
25629
|
+
}
|
|
25630
|
+
sectionChanged = true;
|
|
25631
|
+
return nextItem;
|
|
25632
|
+
});
|
|
25633
|
+
if (!sectionChanged) {
|
|
25634
|
+
return section;
|
|
25635
|
+
}
|
|
25636
|
+
changed = true;
|
|
25637
|
+
return {
|
|
25638
|
+
...section,
|
|
25639
|
+
items
|
|
25640
|
+
};
|
|
25641
|
+
});
|
|
25642
|
+
return changed ? nextSections : previous;
|
|
25643
|
+
}
|
|
25644
|
+
function projectRuntimeSectionsToConversationSections(input) {
|
|
25645
|
+
const pinned = [];
|
|
25646
|
+
const result = [];
|
|
25647
|
+
for (const section of input.sections) {
|
|
25648
|
+
const project = section.userProject ? {
|
|
25649
|
+
createdAtUnixMs: section.userProject.createdAtUnixMs,
|
|
25650
|
+
id: section.userProject.id,
|
|
25651
|
+
label: section.userProject.label,
|
|
25652
|
+
lastUsedAtUnixMs: section.userProject.lastUsedAtUnixMs,
|
|
25653
|
+
path: section.userProject.path,
|
|
25654
|
+
updatedAtUnixMs: section.userProject.updatedAtUnixMs
|
|
25655
|
+
} : null;
|
|
25656
|
+
const conversations = buildAgentGUIConversationSummaries({
|
|
25657
|
+
conversationFilter: input.conversationFilter,
|
|
25658
|
+
provider: AGENT_GUI_CONVERSATION_RAIL_PROJECTION_PROVIDER,
|
|
25659
|
+
snapshot: {
|
|
25660
|
+
composerOptionsByProvider: {},
|
|
25661
|
+
presences: [],
|
|
25662
|
+
sessionMessagesById: {},
|
|
25663
|
+
sessions: section.sessions,
|
|
25664
|
+
workspaceId: input.workspaceId
|
|
25665
|
+
},
|
|
25666
|
+
userProjects: []
|
|
25667
|
+
}).map((conversation) => ({
|
|
25668
|
+
...conversation,
|
|
25669
|
+
project: section.kind === "project" ? project : null
|
|
25670
|
+
}));
|
|
25671
|
+
const items = conversations.filter((conversation) => {
|
|
25672
|
+
if ((conversation.pinnedAtUnixMs ?? 0) > 0) {
|
|
25673
|
+
pinned.push(conversation);
|
|
25674
|
+
return false;
|
|
25675
|
+
}
|
|
25676
|
+
return true;
|
|
25677
|
+
});
|
|
25678
|
+
result.push({
|
|
25679
|
+
id: section.sectionKey,
|
|
25680
|
+
kind: section.kind,
|
|
25681
|
+
label: section.kind === "project" ? section.userProject?.label ?? section.sectionKey : input.labels.sectionConversations,
|
|
25682
|
+
project,
|
|
25683
|
+
items
|
|
25684
|
+
});
|
|
25685
|
+
}
|
|
25686
|
+
if (pinned.length > 0) {
|
|
25687
|
+
result.unshift({
|
|
25688
|
+
id: "pinned",
|
|
25689
|
+
kind: "pinned",
|
|
25690
|
+
label: input.labels.sectionPinned,
|
|
25691
|
+
project: null,
|
|
25692
|
+
items: pinned.sort(
|
|
25693
|
+
(left, right) => (right.pinnedAtUnixMs ?? 0) - (left.pinnedAtUnixMs ?? 0) || (right.sortTimeUnixMs ?? right.updatedAtUnixMs) - (left.sortTimeUnixMs ?? left.updatedAtUnixMs) || left.id.localeCompare(right.id)
|
|
25694
|
+
)
|
|
25695
|
+
});
|
|
25696
|
+
}
|
|
25697
|
+
return result;
|
|
25698
|
+
}
|
|
25540
25699
|
function conversationSummariesRenderEqual2(left, right) {
|
|
25541
25700
|
return left.id === right.id && left.provider === right.provider && left.title === right.title && left.titleFallback === right.titleFallback && left.status === right.status && left.cwd === right.cwd && left.pinnedAtUnixMs === right.pinnedAtUnixMs && left.sortTimeUnixMs === right.sortTimeUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.isImported === right.isImported && left.hasUnreadCompletion === right.hasUnreadCompletion && left.unreadCompletionKey === right.unreadCompletionKey && conversationProjectsRenderEqual2(left.project, right.project) && conversationSyncStatesRenderEqual(left.syncState, right.syncState);
|
|
25542
25701
|
}
|
|
@@ -25700,9 +25859,239 @@ var AgentGUIProviderRail = memo(function AgentGUIProviderRail2({
|
|
|
25700
25859
|
}
|
|
25701
25860
|
);
|
|
25702
25861
|
});
|
|
25862
|
+
function useAgentGUIConversationRail({
|
|
25863
|
+
conversationFilter,
|
|
25864
|
+
conversationQuery,
|
|
25865
|
+
conversations,
|
|
25866
|
+
labels,
|
|
25867
|
+
previewMode,
|
|
25868
|
+
userProjects,
|
|
25869
|
+
workspaceId
|
|
25870
|
+
}) {
|
|
25871
|
+
const agentActivityRuntime = useAgentActivityRuntime();
|
|
25872
|
+
const [runtimeRailSections, setRuntimeRailSections] = useState11(null);
|
|
25873
|
+
const [sectionPageStates, setSectionPageStates] = useState11(() => /* @__PURE__ */ new Map());
|
|
25874
|
+
const pagingRequestSequenceRef = useRef12(0);
|
|
25875
|
+
const pagingAbortControllersRef = useRef12(/* @__PURE__ */ new Map());
|
|
25876
|
+
const runtimeListSessionSections = agentActivityRuntime.listSessionSections;
|
|
25877
|
+
const runtimeListSessionSectionPage = agentActivityRuntime.listSessionSectionPage;
|
|
25878
|
+
const runtimeSectionsEnabled = !previewMode && Boolean(runtimeListSessionSections) && Boolean(runtimeListSessionSectionPage);
|
|
25879
|
+
const sectionAgentTargetId = conversationFilter.kind === "agentTarget" ? conversationFilter.agentTargetId.trim() : "";
|
|
25880
|
+
const userProjectPaths = useMemo10(
|
|
25881
|
+
() => userProjects.map((project) => project.path.trim()).filter((path) => path.length > 0),
|
|
25882
|
+
[userProjects]
|
|
25883
|
+
);
|
|
25884
|
+
const userProjectPathKey = useMemo10(
|
|
25885
|
+
() => JSON.stringify(userProjectPaths),
|
|
25886
|
+
[userProjectPaths]
|
|
25887
|
+
);
|
|
25888
|
+
const sectionProjectionLabels = useMemo10(
|
|
25889
|
+
() => ({
|
|
25890
|
+
sectionConversations: labels.sectionConversations,
|
|
25891
|
+
sectionPinned: labels.sectionPinned
|
|
25892
|
+
}),
|
|
25893
|
+
[labels.sectionConversations, labels.sectionPinned]
|
|
25894
|
+
);
|
|
25895
|
+
useEffect12(() => {
|
|
25896
|
+
pagingRequestSequenceRef.current += 1;
|
|
25897
|
+
for (const controller of pagingAbortControllersRef.current.values()) {
|
|
25898
|
+
controller.abort();
|
|
25899
|
+
}
|
|
25900
|
+
pagingAbortControllersRef.current.clear();
|
|
25901
|
+
setRuntimeRailSections(null);
|
|
25902
|
+
setSectionPageStates(/* @__PURE__ */ new Map());
|
|
25903
|
+
return () => {
|
|
25904
|
+
pagingRequestSequenceRef.current += 1;
|
|
25905
|
+
for (const controller of pagingAbortControllersRef.current.values()) {
|
|
25906
|
+
controller.abort();
|
|
25907
|
+
}
|
|
25908
|
+
pagingAbortControllersRef.current.clear();
|
|
25909
|
+
};
|
|
25910
|
+
}, [conversationFilter, userProjectPathKey, workspaceId]);
|
|
25911
|
+
const conversationMembershipKey = useMemo10(
|
|
25912
|
+
() => conversations.map(
|
|
25913
|
+
(conversation) => `${conversation.id}:${conversation.pinnedAtUnixMs ?? 0}`
|
|
25914
|
+
).join("|"),
|
|
25915
|
+
[conversations]
|
|
25916
|
+
);
|
|
25917
|
+
useEffect12(() => {
|
|
25918
|
+
if (!runtimeSectionsEnabled || !runtimeListSessionSections) {
|
|
25919
|
+
return;
|
|
25920
|
+
}
|
|
25921
|
+
const requestSequence = pagingRequestSequenceRef.current;
|
|
25922
|
+
const abortController = new AbortController();
|
|
25923
|
+
void runtimeListSessionSections({
|
|
25924
|
+
agentTargetId: sectionAgentTargetId || void 0,
|
|
25925
|
+
limitPerSection: AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE,
|
|
25926
|
+
signal: abortController.signal,
|
|
25927
|
+
workspaceId
|
|
25928
|
+
}).then((page) => {
|
|
25929
|
+
if (abortController.signal.aborted || requestSequence !== pagingRequestSequenceRef.current) {
|
|
25930
|
+
return;
|
|
25931
|
+
}
|
|
25932
|
+
const sections = projectRuntimeSectionsToConversationSections({
|
|
25933
|
+
conversationFilter,
|
|
25934
|
+
labels: sectionProjectionLabels,
|
|
25935
|
+
sections: page.sections,
|
|
25936
|
+
workspaceId: page.workspaceId
|
|
25937
|
+
});
|
|
25938
|
+
setRuntimeRailSections(
|
|
25939
|
+
(current) => stabilizeConversationSections(current, sections)
|
|
25940
|
+
);
|
|
25941
|
+
setSectionPageStates(() => {
|
|
25942
|
+
const next = /* @__PURE__ */ new Map();
|
|
25943
|
+
for (const section of page.sections) {
|
|
25944
|
+
next.set(section.sectionKey, {
|
|
25945
|
+
hasMore: section.hasMore,
|
|
25946
|
+
isLoading: false,
|
|
25947
|
+
nextCursor: section.nextCursor ?? null
|
|
25948
|
+
});
|
|
25949
|
+
}
|
|
25950
|
+
return next;
|
|
25951
|
+
});
|
|
25952
|
+
}).catch(() => {
|
|
25953
|
+
if (abortController.signal.aborted || requestSequence !== pagingRequestSequenceRef.current) {
|
|
25954
|
+
return;
|
|
25955
|
+
}
|
|
25956
|
+
setRuntimeRailSections([]);
|
|
25957
|
+
});
|
|
25958
|
+
return () => {
|
|
25959
|
+
abortController.abort();
|
|
25960
|
+
};
|
|
25961
|
+
}, [
|
|
25962
|
+
conversationFilter,
|
|
25963
|
+
conversationMembershipKey,
|
|
25964
|
+
runtimeListSessionSections,
|
|
25965
|
+
runtimeSectionsEnabled,
|
|
25966
|
+
sectionProjectionLabels,
|
|
25967
|
+
sectionAgentTargetId,
|
|
25968
|
+
userProjectPathKey,
|
|
25969
|
+
workspaceId
|
|
25970
|
+
]);
|
|
25971
|
+
useEffect12(() => {
|
|
25972
|
+
if (!runtimeSectionsEnabled) {
|
|
25973
|
+
return;
|
|
25974
|
+
}
|
|
25975
|
+
setRuntimeRailSections(
|
|
25976
|
+
(current) => updateConversationSectionsFromSummaries(current, conversations)
|
|
25977
|
+
);
|
|
25978
|
+
}, [conversations, runtimeSectionsEnabled]);
|
|
25979
|
+
const loadMoreSectionConversations = useCallback10(
|
|
25980
|
+
(section) => {
|
|
25981
|
+
if (!runtimeListSessionSectionPage || previewMode || conversationQuery.trim()) {
|
|
25982
|
+
return;
|
|
25983
|
+
}
|
|
25984
|
+
if (section.kind === "pinned") {
|
|
25985
|
+
return;
|
|
25986
|
+
}
|
|
25987
|
+
const currentPageState = sectionPageStates.get(section.id);
|
|
25988
|
+
if (currentPageState?.isLoading || currentPageState?.hasMore === false) {
|
|
25989
|
+
return;
|
|
25990
|
+
}
|
|
25991
|
+
const fallbackCursor = conversationRailPageCursor(section.items);
|
|
25992
|
+
const cursor = currentPageState?.nextCursor ?? fallbackCursor;
|
|
25993
|
+
const requestSequence = pagingRequestSequenceRef.current;
|
|
25994
|
+
const abortController = new AbortController();
|
|
25995
|
+
pagingAbortControllersRef.current.set(section.id, abortController);
|
|
25996
|
+
setSectionPageStates((current) => {
|
|
25997
|
+
const next = new Map(current);
|
|
25998
|
+
next.set(section.id, {
|
|
25999
|
+
hasMore: currentPageState?.hasMore ?? true,
|
|
26000
|
+
isLoading: true,
|
|
26001
|
+
nextCursor: currentPageState?.nextCursor ?? null
|
|
26002
|
+
});
|
|
26003
|
+
return next;
|
|
26004
|
+
});
|
|
26005
|
+
void runtimeListSessionSectionPage({
|
|
26006
|
+
agentTargetId: sectionAgentTargetId || void 0,
|
|
26007
|
+
cursor: cursor || void 0,
|
|
26008
|
+
limit: AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE,
|
|
26009
|
+
sectionKey: section.id,
|
|
26010
|
+
signal: abortController.signal,
|
|
26011
|
+
workspaceId
|
|
26012
|
+
}).then((pageSection) => {
|
|
26013
|
+
if (abortController.signal.aborted || requestSequence !== pagingRequestSequenceRef.current) {
|
|
26014
|
+
return;
|
|
26015
|
+
}
|
|
26016
|
+
const pageConversations = buildAgentGUIConversationSummaries({
|
|
26017
|
+
conversationFilter,
|
|
26018
|
+
provider: AGENT_GUI_CONVERSATION_RAIL_PROJECTION_PROVIDER,
|
|
26019
|
+
snapshot: {
|
|
26020
|
+
composerOptionsByProvider: {},
|
|
26021
|
+
presences: [],
|
|
26022
|
+
sessionMessagesById: {},
|
|
26023
|
+
sessions: pageSection.sessions,
|
|
26024
|
+
workspaceId
|
|
26025
|
+
},
|
|
26026
|
+
userProjects: []
|
|
26027
|
+
}).map((conversation) => ({
|
|
26028
|
+
...conversation,
|
|
26029
|
+
project: section.kind === "project" ? section.project : null
|
|
26030
|
+
}));
|
|
26031
|
+
setRuntimeRailSections((current) => {
|
|
26032
|
+
if (!current) {
|
|
26033
|
+
return current;
|
|
26034
|
+
}
|
|
26035
|
+
return current.map(
|
|
26036
|
+
(candidate) => candidate.id === section.id ? {
|
|
26037
|
+
...candidate,
|
|
26038
|
+
items: mergeConversationRailPageItems(
|
|
26039
|
+
candidate.items,
|
|
26040
|
+
pageConversations
|
|
26041
|
+
)
|
|
26042
|
+
} : candidate
|
|
26043
|
+
);
|
|
26044
|
+
});
|
|
26045
|
+
setSectionPageStates((current) => {
|
|
26046
|
+
const next = new Map(current);
|
|
26047
|
+
next.set(section.id, {
|
|
26048
|
+
hasMore: pageSection.hasMore,
|
|
26049
|
+
isLoading: false,
|
|
26050
|
+
nextCursor: pageSection.nextCursor ?? null
|
|
26051
|
+
});
|
|
26052
|
+
return next;
|
|
26053
|
+
});
|
|
26054
|
+
}).catch(() => {
|
|
26055
|
+
if (abortController.signal.aborted || requestSequence !== pagingRequestSequenceRef.current) {
|
|
26056
|
+
return;
|
|
26057
|
+
}
|
|
26058
|
+
setSectionPageStates((current) => {
|
|
26059
|
+
const next = new Map(current);
|
|
26060
|
+
const existing = next.get(section.id);
|
|
26061
|
+
next.set(section.id, {
|
|
26062
|
+
hasMore: existing?.hasMore ?? true,
|
|
26063
|
+
isLoading: false,
|
|
26064
|
+
nextCursor: existing?.nextCursor ?? null
|
|
26065
|
+
});
|
|
26066
|
+
return next;
|
|
26067
|
+
});
|
|
26068
|
+
}).finally(() => {
|
|
26069
|
+
if (pagingAbortControllersRef.current.get(section.id) === abortController) {
|
|
26070
|
+
pagingAbortControllersRef.current.delete(section.id);
|
|
26071
|
+
}
|
|
26072
|
+
});
|
|
26073
|
+
},
|
|
26074
|
+
[
|
|
26075
|
+
conversationFilter,
|
|
26076
|
+
conversationQuery,
|
|
26077
|
+
previewMode,
|
|
26078
|
+
runtimeListSessionSectionPage,
|
|
26079
|
+
sectionAgentTargetId,
|
|
26080
|
+
sectionPageStates,
|
|
26081
|
+
workspaceId
|
|
26082
|
+
]
|
|
26083
|
+
);
|
|
26084
|
+
return {
|
|
26085
|
+
loadMoreSectionConversations,
|
|
26086
|
+
runtimeSectionsEnabled,
|
|
26087
|
+
runtimeRailSections,
|
|
26088
|
+
sectionPageStates
|
|
26089
|
+
};
|
|
26090
|
+
}
|
|
25703
26091
|
var AgentGUIConversationRailPane = memo(
|
|
25704
26092
|
function AgentGUIConversationRailPane2({
|
|
25705
26093
|
conversations,
|
|
26094
|
+
workspaceId,
|
|
25706
26095
|
userProjects,
|
|
25707
26096
|
activeConversationId,
|
|
25708
26097
|
pendingDeleteConversationId,
|
|
@@ -25756,7 +26145,23 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25756
26145
|
const conversationItemElementsRef = useRef12(
|
|
25757
26146
|
/* @__PURE__ */ new Map()
|
|
25758
26147
|
);
|
|
26148
|
+
const activeConversationScrollCompletedRef = useRef12(null);
|
|
26149
|
+
const previousActiveConversationIdRef = useRef12(null);
|
|
25759
26150
|
const groupedConversationsRef = useRef12(null);
|
|
26151
|
+
const {
|
|
26152
|
+
loadMoreSectionConversations,
|
|
26153
|
+
runtimeSectionsEnabled,
|
|
26154
|
+
runtimeRailSections,
|
|
26155
|
+
sectionPageStates
|
|
26156
|
+
} = useAgentGUIConversationRail({
|
|
26157
|
+
conversationFilter,
|
|
26158
|
+
conversationQuery,
|
|
26159
|
+
conversations,
|
|
26160
|
+
labels,
|
|
26161
|
+
previewMode,
|
|
26162
|
+
userProjects,
|
|
26163
|
+
workspaceId
|
|
26164
|
+
});
|
|
25760
26165
|
useEffect12(() => {
|
|
25761
26166
|
const timer = window.setInterval(() => {
|
|
25762
26167
|
setCurrentTimeMs(Date.now());
|
|
@@ -25765,26 +26170,37 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25765
26170
|
window.clearInterval(timer);
|
|
25766
26171
|
};
|
|
25767
26172
|
}, []);
|
|
26173
|
+
const displayConversations = useMemo10(
|
|
26174
|
+
() => runtimeSectionsEnabled ? runtimeRailSections?.flatMap((section) => section.items) ?? [] : runtimeRailSections ? runtimeRailSections.flatMap((section) => section.items) : conversations,
|
|
26175
|
+
[conversations, runtimeRailSections, runtimeSectionsEnabled]
|
|
26176
|
+
);
|
|
25768
26177
|
const filteredConversationResult = useMemo10(() => {
|
|
25769
26178
|
const startedAtMs = agentGuiPerfNowMs();
|
|
25770
26179
|
const query = conversationQuery.trim().toLowerCase();
|
|
25771
|
-
const items = !query ?
|
|
26180
|
+
const items = !query ? displayConversations : displayConversations.filter(
|
|
25772
26181
|
(candidate) => conversationPlainTitle(candidate, labels, uiLanguage).toLowerCase().includes(query)
|
|
25773
26182
|
);
|
|
25774
26183
|
return {
|
|
25775
26184
|
items,
|
|
25776
26185
|
filterMs: roundAgentGuiPerfMs(agentGuiPerfNowMs() - startedAtMs)
|
|
25777
26186
|
};
|
|
25778
|
-
}, [conversationQuery,
|
|
26187
|
+
}, [conversationQuery, displayConversations, labels, uiLanguage]);
|
|
25779
26188
|
const filteredConversations = filteredConversationResult.items;
|
|
25780
26189
|
const groupedConversationResult = useMemo10(() => {
|
|
25781
26190
|
const startedAtMs = agentGuiPerfNowMs();
|
|
25782
|
-
const
|
|
25783
|
-
|
|
25784
|
-
|
|
25785
|
-
|
|
25786
|
-
|
|
25787
|
-
|
|
26191
|
+
const query = conversationQuery.trim();
|
|
26192
|
+
const rawGroups = runtimeSectionsEnabled || runtimeRailSections ? runtimeRailSections ? !query ? runtimeRailSections : runtimeRailSections.map((section) => ({
|
|
26193
|
+
...section,
|
|
26194
|
+
items: section.items.filter(
|
|
26195
|
+
(item) => filteredConversations.some(
|
|
26196
|
+
(conversation) => conversation.id === item.id
|
|
26197
|
+
)
|
|
26198
|
+
)
|
|
26199
|
+
})).filter(
|
|
26200
|
+
(section) => section.kind !== "pinned" || section.items.length > 0
|
|
26201
|
+
) : [] : groupConversations(filteredConversations, labels, userProjects, {
|
|
26202
|
+
includeEmptyConversations: !query
|
|
26203
|
+
});
|
|
25788
26204
|
const groups = stabilizeConversationSections(
|
|
25789
26205
|
groupedConversationsRef.current,
|
|
25790
26206
|
rawGroups
|
|
@@ -25794,7 +26210,14 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25794
26210
|
groups,
|
|
25795
26211
|
groupMs: roundAgentGuiPerfMs(agentGuiPerfNowMs() - startedAtMs)
|
|
25796
26212
|
};
|
|
25797
|
-
}, [
|
|
26213
|
+
}, [
|
|
26214
|
+
conversationQuery,
|
|
26215
|
+
filteredConversations,
|
|
26216
|
+
labels,
|
|
26217
|
+
runtimeRailSections,
|
|
26218
|
+
runtimeSectionsEnabled,
|
|
26219
|
+
userProjects
|
|
26220
|
+
]);
|
|
25798
26221
|
const groupedConversations = groupedConversationResult.groups;
|
|
25799
26222
|
const toggleProjectSectionCollapsed = useCallback10((sectionId) => {
|
|
25800
26223
|
setCollapsedProjectSectionIds((current) => {
|
|
@@ -25815,7 +26238,7 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25815
26238
|
);
|
|
25816
26239
|
const projectConversationCountsByPath = useMemo10(() => {
|
|
25817
26240
|
const counts = /* @__PURE__ */ new Map();
|
|
25818
|
-
for (const conversation of
|
|
26241
|
+
for (const conversation of displayConversations) {
|
|
25819
26242
|
const normalizedPath = normalizeConversationRailProjectPath(
|
|
25820
26243
|
conversation.project?.path
|
|
25821
26244
|
);
|
|
@@ -25825,7 +26248,8 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25825
26248
|
counts.set(normalizedPath, (counts.get(normalizedPath) ?? 0) + 1);
|
|
25826
26249
|
}
|
|
25827
26250
|
return counts;
|
|
25828
|
-
}, [
|
|
26251
|
+
}, [displayConversations]);
|
|
26252
|
+
const isRuntimeRailLoading = runtimeSectionsEnabled && runtimeRailSections === null;
|
|
25829
26253
|
const registerConversationItemElement = useCallback10(
|
|
25830
26254
|
(itemId, element) => {
|
|
25831
26255
|
if (element) {
|
|
@@ -25837,10 +26261,25 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25837
26261
|
[]
|
|
25838
26262
|
);
|
|
25839
26263
|
useLayoutEffect4(() => {
|
|
25840
|
-
|
|
26264
|
+
const activeId = activeConversationId?.trim() ?? "";
|
|
26265
|
+
if (!activeId) {
|
|
26266
|
+
previousActiveConversationIdRef.current = null;
|
|
26267
|
+
activeConversationScrollCompletedRef.current = null;
|
|
25841
26268
|
return;
|
|
25842
26269
|
}
|
|
25843
|
-
|
|
26270
|
+
if (previousActiveConversationIdRef.current !== activeId) {
|
|
26271
|
+
previousActiveConversationIdRef.current = activeId;
|
|
26272
|
+
activeConversationScrollCompletedRef.current = null;
|
|
26273
|
+
}
|
|
26274
|
+
if (activeConversationScrollCompletedRef.current === activeId) {
|
|
26275
|
+
return;
|
|
26276
|
+
}
|
|
26277
|
+
const activeElement = conversationItemElementsRef.current.get(activeId);
|
|
26278
|
+
if (!activeElement) {
|
|
26279
|
+
return;
|
|
26280
|
+
}
|
|
26281
|
+
activeElement.scrollIntoView({ block: "nearest" });
|
|
26282
|
+
activeConversationScrollCompletedRef.current = activeId;
|
|
25844
26283
|
}, [activeConversationId, groupedConversationIdentityKey]);
|
|
25845
26284
|
return /* @__PURE__ */ jsxs17(
|
|
25846
26285
|
"aside",
|
|
@@ -25917,7 +26356,7 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25917
26356
|
className: "min-h-0 flex-1 [&_[data-orientation=vertical][data-slot=scroll-area-scrollbar]]:opacity-100",
|
|
25918
26357
|
viewportRef: conversationListRef,
|
|
25919
26358
|
viewportClassName: AgentGUINode_styles_default.conversationList,
|
|
25920
|
-
children: isLoadingConversations && conversations.length === 0 ? /* @__PURE__ */ jsx31(
|
|
26359
|
+
children: isRuntimeRailLoading || isLoadingConversations && conversations.length === 0 ? /* @__PURE__ */ jsx31(
|
|
25921
26360
|
AgentConversationListSkeleton,
|
|
25922
26361
|
{
|
|
25923
26362
|
label: labels.loadingConversations
|
|
@@ -25930,6 +26369,8 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25930
26369
|
const showProjectRailHeader = !conversationQuery.trim() && section.kind !== "pinned" && (sectionIndex === 0 || groupedConversations[sectionIndex - 1]?.kind === "pinned");
|
|
25931
26370
|
const isSectionCollapsed = isProjectSection && collapsedProjectSectionIds.has(section.id);
|
|
25932
26371
|
const projectConversationCount = normalizedProjectPath ? projectConversationCountsByPath.get(normalizedProjectPath) ?? 0 : 0;
|
|
26372
|
+
const sectionPageState = sectionPageStates.get(section.id);
|
|
26373
|
+
const sectionHasMore = !conversationQuery.trim() && section.kind !== "pinned" && sectionPageState?.hasMore === true;
|
|
25933
26374
|
return /* @__PURE__ */ jsxs17(Fragment7, { children: [
|
|
25934
26375
|
showProjectRailHeader ? /* @__PURE__ */ jsx31(
|
|
25935
26376
|
AgentGUIProjectRailHeader,
|
|
@@ -25946,6 +26387,7 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25946
26387
|
createConversationDisabled,
|
|
25947
26388
|
currentTimeMs,
|
|
25948
26389
|
isDeletingConversation,
|
|
26390
|
+
isLoadingMoreConversations: sectionPageState?.isLoading ?? false,
|
|
25949
26391
|
isSectionCollapsed,
|
|
25950
26392
|
labels,
|
|
25951
26393
|
pendingDeleteConversationId,
|
|
@@ -25955,10 +26397,12 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25955
26397
|
projectPath,
|
|
25956
26398
|
registerItemElement: registerConversationItemElement,
|
|
25957
26399
|
section,
|
|
26400
|
+
sectionHasMore,
|
|
25958
26401
|
uiLanguage,
|
|
25959
26402
|
onCancelDeleteConversation,
|
|
25960
26403
|
onConfirmDeleteConversation,
|
|
25961
26404
|
onCreateConversation,
|
|
26405
|
+
onLoadMoreConversations: loadMoreSectionConversations,
|
|
25962
26406
|
onRequestDeleteConversation,
|
|
25963
26407
|
onSelectConversation,
|
|
25964
26408
|
setPendingProjectAction,
|
|
@@ -26094,6 +26538,8 @@ var AgentGUIConversationRailSection = memo(
|
|
|
26094
26538
|
pendingDeleteConversationId,
|
|
26095
26539
|
previewMode,
|
|
26096
26540
|
isDeletingConversation,
|
|
26541
|
+
isLoadingMoreConversations,
|
|
26542
|
+
sectionHasMore,
|
|
26097
26543
|
createConversationDisabled,
|
|
26098
26544
|
currentTimeMs,
|
|
26099
26545
|
labels,
|
|
@@ -26102,6 +26548,7 @@ var AgentGUIConversationRailSection = memo(
|
|
|
26102
26548
|
onCreateConversation,
|
|
26103
26549
|
onToggleProjectSectionCollapsed,
|
|
26104
26550
|
onSelectConversation,
|
|
26551
|
+
onLoadMoreConversations,
|
|
26105
26552
|
setPendingProjectAction,
|
|
26106
26553
|
onToggleConversationPinned,
|
|
26107
26554
|
onOpenProjectFiles,
|
|
@@ -26117,16 +26564,29 @@ var AgentGUIConversationRailSection = memo(
|
|
|
26117
26564
|
);
|
|
26118
26565
|
const visibleItemCount = isSectionCollapsed ? 0 : Math.min(visibleItemLimit, section.items.length);
|
|
26119
26566
|
const visibleItems = isSectionCollapsed ? [] : section.items.slice(0, visibleItemCount);
|
|
26120
|
-
const canShowMore = !isSectionCollapsed && visibleItemCount < section.items.length;
|
|
26567
|
+
const canShowMore = !isSectionCollapsed && (visibleItemCount < section.items.length || sectionHasMore);
|
|
26121
26568
|
const canShowLess = !isSectionCollapsed && visibleItemCount > AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE;
|
|
26122
26569
|
const showMoreConversations = useCallback10(() => {
|
|
26570
|
+
if (visibleItemCount >= section.items.length && sectionHasMore) {
|
|
26571
|
+
onLoadMoreConversations(section);
|
|
26572
|
+
setVisibleItemLimit(
|
|
26573
|
+
(current) => current + AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE
|
|
26574
|
+
);
|
|
26575
|
+
return;
|
|
26576
|
+
}
|
|
26123
26577
|
setVisibleItemLimit(
|
|
26124
26578
|
(current) => Math.min(
|
|
26125
26579
|
section.items.length,
|
|
26126
26580
|
current + AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE
|
|
26127
26581
|
)
|
|
26128
26582
|
);
|
|
26129
|
-
}, [
|
|
26583
|
+
}, [
|
|
26584
|
+
onLoadMoreConversations,
|
|
26585
|
+
section,
|
|
26586
|
+
section.items.length,
|
|
26587
|
+
sectionHasMore,
|
|
26588
|
+
visibleItemCount
|
|
26589
|
+
]);
|
|
26130
26590
|
const showLessConversations = useCallback10(() => {
|
|
26131
26591
|
setVisibleItemLimit(AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE);
|
|
26132
26592
|
}, []);
|
|
@@ -26419,6 +26879,7 @@ var AgentGUIConversationRailSection = memo(
|
|
|
26419
26879
|
{
|
|
26420
26880
|
type: "button",
|
|
26421
26881
|
className: AgentGUINode_styles_default.conversationSectionPaginationButton,
|
|
26882
|
+
disabled: isLoadingMoreConversations,
|
|
26422
26883
|
onClick: showMoreConversations,
|
|
26423
26884
|
children: labels.showMoreConversations
|
|
26424
26885
|
}
|
|
@@ -28212,6 +28673,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
28212
28673
|
mentionPalette: t("agentHost.agentGui.mentionPalette"),
|
|
28213
28674
|
removeMention: t("common.remove"),
|
|
28214
28675
|
addReference: t("agentHost.agentGui.addReference"),
|
|
28676
|
+
addContent: t("agentHost.agentGui.addContent"),
|
|
28215
28677
|
referenceWorkspaceFiles: t("agentHost.issue.referenceWorkspaceFiles")
|
|
28216
28678
|
}),
|
|
28217
28679
|
[displayProviderLabel, fallbackAgentTitle, t]
|