@tutti-os/agent-gui 0.0.48 → 0.0.50
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.d.ts +5 -3
- package/dist/agent-conversation/index.js +6 -6
- package/dist/agent-message-center/index.d.ts +1 -1
- package/dist/agent-message-center/index.js +8 -8
- package/dist/{agentConversationVM-DSXrFL9v.d.ts → agentConversationVM-Qbz9GBwR.d.ts} +25 -0
- package/dist/{agentGuiNodeTypes-Bp1G8pOj.d.ts → agentGuiNodeTypes-wzOITHRW.d.ts} +1 -1
- package/dist/app/renderer/agentactivity.css +466 -85
- package/dist/{chunk-2RYZ4EBF.js → chunk-5Y3PC7HP.js} +9 -4
- package/dist/chunk-5Y3PC7HP.js.map +1 -0
- package/dist/{chunk-U6JWW45G.js → chunk-66EQ6EQO.js} +1 -1
- package/dist/chunk-66EQ6EQO.js.map +1 -0
- package/dist/{chunk-7W3VWU5R.js → chunk-ARCM7YB2.js} +2 -2
- package/dist/{chunk-RNIY43TA.js → chunk-BQVYICR7.js} +5 -5
- package/dist/{chunk-ZVKRNEOF.js → chunk-DPG2J7N5.js} +2 -2
- package/dist/{chunk-VGDPBC6W.js → chunk-FS26J46N.js} +5 -5
- package/dist/{chunk-OB43QOMC.js → chunk-FYVVHRLZ.js} +2 -2
- package/dist/{chunk-EUOGIKT7.js → chunk-HDBKB5RA.js} +2 -2
- package/dist/{chunk-R6GOICRO.js → chunk-OBFDA7RG.js} +69 -10
- package/dist/chunk-OBFDA7RG.js.map +1 -0
- package/dist/{chunk-LWMC2YA3.js → chunk-RPXRNKU5.js} +1793 -599
- package/dist/chunk-RPXRNKU5.js.map +1 -0
- package/dist/{chunk-SD56WDSC.js → chunk-TG3ZXLPM.js} +42 -1
- package/dist/chunk-TG3ZXLPM.js.map +1 -0
- package/dist/{chunk-OYQZRLJQ.js → chunk-UUY5VEK4.js} +2 -2
- package/dist/{chunk-6YN7HQL5.js → chunk-VKP5ZW5O.js} +5 -3
- package/dist/{chunk-6YN7HQL5.js.map → chunk-VKP5ZW5O.js.map} +1 -1
- package/dist/{chunk-N6HRVMIS.js → chunk-Y7ZVTWMZ.js} +2 -2
- package/dist/{chunk-NETHPCSA.js → chunk-ZTSS2NU2.js} +23 -1
- package/dist/chunk-ZTSS2NU2.js.map +1 -0
- package/dist/context-mention-palette/index.js +7 -7
- package/dist/i18n/index.d.ts +22 -0
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +50 -3
- package/dist/index.js +911 -818
- package/dist/index.js.map +1 -1
- package/dist/plan-decision-ops.d.ts +1 -1
- package/dist/queued-prompt-runtime.d.ts +3 -2
- package/dist/queued-prompt-runtime.js +1 -1
- package/dist/workbench/contribution.d.ts +5 -1
- package/dist/workbench/contribution.js +4 -2
- package/dist/workbench/index.js +5 -5
- package/dist/workbench/launch.d.ts +26 -1
- package/dist/workbench/launch.js +13 -3
- package/dist/workbench/sessionTitle.js +3 -3
- package/dist/workspace-agent-generated-files.js +3 -3
- package/package.json +12 -12
- package/dist/chunk-2RYZ4EBF.js.map +0 -1
- package/dist/chunk-LWMC2YA3.js.map +0 -1
- package/dist/chunk-NETHPCSA.js.map +0 -1
- package/dist/chunk-R6GOICRO.js.map +0 -1
- package/dist/chunk-SD56WDSC.js.map +0 -1
- package/dist/chunk-U6JWW45G.js.map +0 -1
- /package/dist/{chunk-7W3VWU5R.js.map → chunk-ARCM7YB2.js.map} +0 -0
- /package/dist/{chunk-RNIY43TA.js.map → chunk-BQVYICR7.js.map} +0 -0
- /package/dist/{chunk-ZVKRNEOF.js.map → chunk-DPG2J7N5.js.map} +0 -0
- /package/dist/{chunk-VGDPBC6W.js.map → chunk-FS26J46N.js.map} +0 -0
- /package/dist/{chunk-OB43QOMC.js.map → chunk-FYVVHRLZ.js.map} +0 -0
- /package/dist/{chunk-EUOGIKT7.js.map → chunk-HDBKB5RA.js.map} +0 -0
- /package/dist/{chunk-OYQZRLJQ.js.map → chunk-UUY5VEK4.js.map} +0 -0
- /package/dist/{chunk-N6HRVMIS.js.map → chunk-Y7ZVTWMZ.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-FS26J46N.js";
|
|
26
26
|
import {
|
|
27
27
|
PLAN_IMPLEMENTATION_ACTION_FEEDBACK,
|
|
28
28
|
PLAN_IMPLEMENTATION_ACTION_IMPLEMENT,
|
|
@@ -41,17 +41,20 @@ import {
|
|
|
41
41
|
resolveAgentGUIExplicitConversationTitle,
|
|
42
42
|
resolveAgentGUIProviderDisplayLabel,
|
|
43
43
|
resolveAgentGUIProviderIdentity
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-DPG2J7N5.js";
|
|
45
45
|
import {
|
|
46
46
|
AgentConversationFlow,
|
|
47
47
|
Button,
|
|
48
48
|
agentRichTextContentToPromptText,
|
|
49
|
+
attachSubAgentLanesToConversationVM,
|
|
50
|
+
buildSubAgentLanesByCallId,
|
|
49
51
|
buildWorkspaceAgentSessionDetailViewModel,
|
|
50
52
|
createAgentRichTextInputExtensions,
|
|
51
53
|
editorToPromptText,
|
|
52
54
|
getAppErrorCode,
|
|
53
55
|
labelForProviderSkill,
|
|
54
56
|
openAgentEnvPanel,
|
|
57
|
+
partitionSubAgentTimelineItems,
|
|
55
58
|
plainTextToAgentRichTextDoc,
|
|
56
59
|
plainTextToAgentRichTextInlineContent,
|
|
57
60
|
projectAgentConversationVM,
|
|
@@ -60,13 +63,13 @@ import {
|
|
|
60
63
|
skillTriggerForPrefix,
|
|
61
64
|
toLocalShortDateTime,
|
|
62
65
|
useProjectedAgentConversation
|
|
63
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-RPXRNKU5.js";
|
|
64
67
|
import {
|
|
65
68
|
AgentMessageMarkdown,
|
|
66
69
|
ZoomableImage,
|
|
67
70
|
cn,
|
|
68
71
|
resolveWorkspaceLinkAction
|
|
69
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-VKP5ZW5O.js";
|
|
70
73
|
import {
|
|
71
74
|
AGENT_MENTION_FILTER_TAB_ORDER,
|
|
72
75
|
AgentFileMentionPalette,
|
|
@@ -74,7 +77,7 @@ import {
|
|
|
74
77
|
DEFAULT_AGENT_MENTION_FILTER,
|
|
75
78
|
agentMentionItemKey,
|
|
76
79
|
preloadAgentMentionBrowse
|
|
77
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-BQVYICR7.js";
|
|
78
81
|
import {
|
|
79
82
|
WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN,
|
|
80
83
|
buildWorkspaceAgentActivityListViewModel,
|
|
@@ -84,13 +87,13 @@ import {
|
|
|
84
87
|
isWorkspaceAgentUntitledTask,
|
|
85
88
|
mergeWorkspaceAgentActivityDurableAndOverlayMessages,
|
|
86
89
|
selectWorkspaceAgentActivityOverlayMessages
|
|
87
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-ARCM7YB2.js";
|
|
88
91
|
import {
|
|
89
92
|
MANAGED_AGENT_ICON_FALLBACK_URL,
|
|
90
93
|
MANAGED_AGENT_ICON_URLS,
|
|
91
94
|
Spinner,
|
|
92
95
|
normalizeManagedAgentProvider
|
|
93
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-HDBKB5RA.js";
|
|
94
97
|
import {
|
|
95
98
|
resolveWorkspaceAgentSessionSortTimeUnixMs
|
|
96
99
|
} from "./chunk-IBIMGLCD.js";
|
|
@@ -102,7 +105,7 @@ import {
|
|
|
102
105
|
mentionItemToAttrs,
|
|
103
106
|
normalizeAgentSessionMentionTitle,
|
|
104
107
|
parseMentionItemFromHref
|
|
105
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-UUY5VEK4.js";
|
|
106
109
|
import "./chunk-Y35GDLP2.js";
|
|
107
110
|
import "./chunk-LUGELG5V.js";
|
|
108
111
|
import {
|
|
@@ -118,7 +121,7 @@ import {
|
|
|
118
121
|
useAgentHostApi,
|
|
119
122
|
useOptionalAgentActivityRuntime,
|
|
120
123
|
useOptionalAgentHostApi
|
|
121
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-66EQ6EQO.js";
|
|
122
125
|
import "./chunk-TYGL25EL.js";
|
|
123
126
|
import "./chunk-PJP5BUU6.js";
|
|
124
127
|
import {
|
|
@@ -127,15 +130,15 @@ import {
|
|
|
127
130
|
import "./chunk-GCBDIQDX.js";
|
|
128
131
|
import {
|
|
129
132
|
createAgentQueuedPromptRuntime
|
|
130
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-TG3ZXLPM.js";
|
|
131
134
|
import {
|
|
132
135
|
AgentGuiI18nProvider,
|
|
133
136
|
agentGuiI18nModule,
|
|
134
137
|
agentGuiI18nResources,
|
|
135
138
|
translate,
|
|
136
139
|
useTranslation
|
|
137
|
-
} from "./chunk-
|
|
138
|
-
import "./chunk-
|
|
140
|
+
} from "./chunk-Y7ZVTWMZ.js";
|
|
141
|
+
import "./chunk-ZTSS2NU2.js";
|
|
139
142
|
|
|
140
143
|
// shared/agentActivitySnapshotProjection.ts
|
|
141
144
|
import {
|
|
@@ -301,7 +304,7 @@ import { memo as memo3 } from "react";
|
|
|
301
304
|
import { TooltipProvider as TooltipProvider3 } from "@tutti-os/ui-system";
|
|
302
305
|
|
|
303
306
|
// agent-gui/agentGuiNode/AgentGUINode.tsx
|
|
304
|
-
import { memo as memo2, useCallback as
|
|
307
|
+
import { memo as memo2, useCallback as useCallback12, useEffect as useEffect14, useMemo as useMemo11 } from "react";
|
|
305
308
|
import { createWorkspaceUserProjectI18nRuntime } from "@tutti-os/workspace-user-project/i18n";
|
|
306
309
|
import { createWorkspaceFileManagerI18nRuntime } from "@tutti-os/workspace-file-manager";
|
|
307
310
|
|
|
@@ -2549,8 +2552,14 @@ function buildAgentGUIConversationModels({
|
|
|
2549
2552
|
if (!detail) {
|
|
2550
2553
|
return { conversation: null, detail: null };
|
|
2551
2554
|
}
|
|
2555
|
+
const subAgentLanesByCallId = buildSubAgentLanesByCallId(
|
|
2556
|
+
partitionSubAgentTimelineItems(timelineItems)
|
|
2557
|
+
);
|
|
2552
2558
|
return {
|
|
2553
|
-
conversation:
|
|
2559
|
+
conversation: attachSubAgentLanesToConversationVM(
|
|
2560
|
+
projectAgentConversationVM(detail, { avoidGroupingEdits }),
|
|
2561
|
+
subAgentLanesByCallId
|
|
2562
|
+
),
|
|
2554
2563
|
detail
|
|
2555
2564
|
};
|
|
2556
2565
|
}
|
|
@@ -6509,7 +6518,6 @@ var AGENT_PROVIDER_SESSION_NOT_FOUND_ERROR = "agent.provider_session_not_found";
|
|
|
6509
6518
|
var AGENT_RESUME_SESSION_NOT_LOCAL_ERROR = "agent.resume_session_not_local";
|
|
6510
6519
|
var AGENT_SETTINGS_REQUIRE_NEW_SESSION_ERROR = "agent.settings_require_new_session";
|
|
6511
6520
|
var AGENT_SESSION_NOT_FOUND_ERROR = "session.not_found";
|
|
6512
|
-
var AGENT_SESSION_ACTIVE_TURN_CONFLICT_MESSAGE = "agent session already has an active turn";
|
|
6513
6521
|
var AGENT_PROVIDER_SESSION_NOT_FOUND_FALLBACK_MESSAGE = "The previous agent session can no longer be restored.";
|
|
6514
6522
|
var AGENT_RESUME_SESSION_NOT_LOCAL_FALLBACK_MESSAGE = "The previous agent session is not available on this machine.";
|
|
6515
6523
|
var AGENT_GUI_CAUGHT_ERROR_STACK_LIMIT = 4e3;
|
|
@@ -7103,10 +7111,6 @@ function buildContinueInNewConversationPrompt(input) {
|
|
|
7103
7111
|
}
|
|
7104
7112
|
return `${mention} ${existingDraftPrompt}`;
|
|
7105
7113
|
}
|
|
7106
|
-
function isAgentSessionActiveTurnConflictError(error) {
|
|
7107
|
-
const message = getAgentGUIRawErrorMessage(error);
|
|
7108
|
-
return message?.toLowerCase().includes(AGENT_SESSION_ACTIVE_TURN_CONFLICT_MESSAGE) ?? false;
|
|
7109
|
-
}
|
|
7110
7114
|
function resolveConversationUpdatedAtUnixMsFromSessionState(input) {
|
|
7111
7115
|
if (input.source === "conversation-selected") {
|
|
7112
7116
|
return input.currentUpdatedAtUnixMs;
|
|
@@ -8472,15 +8476,6 @@ function useAgentGUINodeController({
|
|
|
8472
8476
|
);
|
|
8473
8477
|
const pendingCreateOwnerKey = nodeId?.trim() ?? "";
|
|
8474
8478
|
const conversationListActiveOwnerKey = pendingCreateOwnerKey || generatedControllerOwnerKey;
|
|
8475
|
-
const queuedPromptOwnerId = conversationListActiveOwnerKey;
|
|
8476
|
-
useEffect4(() => {
|
|
8477
|
-
if (previewMode) {
|
|
8478
|
-
return;
|
|
8479
|
-
}
|
|
8480
|
-
return () => {
|
|
8481
|
-
agentQueuedPromptRuntime.releaseOwner(queuedPromptOwnerId);
|
|
8482
|
-
};
|
|
8483
|
-
}, [agentQueuedPromptRuntime, previewMode, queuedPromptOwnerId]);
|
|
8484
8479
|
const resolvePendingCreateConversationId = useCallback4(
|
|
8485
8480
|
() => conversationListQuery && pendingCreateOwnerKey ? getAgentGUIConversationCreatePending({
|
|
8486
8481
|
query: conversationListQuery,
|
|
@@ -8529,9 +8524,6 @@ function useAgentGUINodeController({
|
|
|
8529
8524
|
});
|
|
8530
8525
|
const activeQueuedPrompts = activeQueuedPromptSnapshot?.prompts ?? EMPTY_QUEUED_PROMPTS;
|
|
8531
8526
|
const activeQueuedPromptClaim = activeQueuedPromptSnapshot?.claim ?? null;
|
|
8532
|
-
const activeFailedQueuedPromptId = activeQueuedPromptSnapshot?.failedPromptId ?? null;
|
|
8533
|
-
const activeQueuedPromptRetryBlock = activeQueuedPromptSnapshot?.retryBlock ?? null;
|
|
8534
|
-
const activeSendNextQueuedPromptId = activeQueuedPromptSnapshot?.sendNextPromptId ?? null;
|
|
8535
8527
|
const [interruptingSessionIds, setInterruptingSessionIds] = useState4({});
|
|
8536
8528
|
const [pendingInterruptSessionIds, setPendingInterruptSessionIds] = useState4({});
|
|
8537
8529
|
const [
|
|
@@ -8993,6 +8985,9 @@ function useAgentGUINodeController({
|
|
|
8993
8985
|
if (externalId === (activeConversationIdRef.current ?? "")) return;
|
|
8994
8986
|
if (!externalId) {
|
|
8995
8987
|
const previous = activeConversationIdRef.current;
|
|
8988
|
+
if (!previous && isComposerHomeRef.current && intent.tag === "home") {
|
|
8989
|
+
return;
|
|
8990
|
+
}
|
|
8996
8991
|
reportAgentGUIActiveConversationCleared({
|
|
8997
8992
|
details: {
|
|
8998
8993
|
dataLastActiveAgentSessionId: data.lastActiveAgentSessionId ?? null,
|
|
@@ -11297,7 +11292,7 @@ function useAgentGUINodeController({
|
|
|
11297
11292
|
});
|
|
11298
11293
|
persistActiveConversation(conversation2.id);
|
|
11299
11294
|
setIsLoadingMessages(true);
|
|
11300
|
-
void
|
|
11295
|
+
void loadSelectedConversationMessages(conversation2.id);
|
|
11301
11296
|
void loadSessionState(conversation2.id);
|
|
11302
11297
|
void syncConversationListProjection(conversation2.id);
|
|
11303
11298
|
}).catch((error) => {
|
|
@@ -11309,7 +11304,7 @@ function useAgentGUINodeController({
|
|
|
11309
11304
|
conversationId: pendingCreateAgentSessionId ?? agentSessionId
|
|
11310
11305
|
});
|
|
11311
11306
|
}
|
|
11312
|
-
const shouldShowErrorOnHome = startingConversationIdRef.current === agentSessionId || activeConversationIdRef.current === null
|
|
11307
|
+
const shouldShowErrorOnHome = startingConversationIdRef.current === agentSessionId || activeConversationIdRef.current === null;
|
|
11313
11308
|
const submitTrace = submitTraceBySessionIdRef.current[agentSessionId];
|
|
11314
11309
|
if (submitTrace) {
|
|
11315
11310
|
const nextTraces = { ...submitTraceBySessionIdRef.current };
|
|
@@ -11384,6 +11379,7 @@ function useAgentGUINodeController({
|
|
|
11384
11379
|
isCreatingConversation,
|
|
11385
11380
|
openclawGateway?.status,
|
|
11386
11381
|
syncConversationListProjection,
|
|
11382
|
+
loadSelectedConversationMessages,
|
|
11387
11383
|
loadSessionState,
|
|
11388
11384
|
refreshMessagesFromSnapshot,
|
|
11389
11385
|
persistActiveConversation,
|
|
@@ -11628,18 +11624,19 @@ function useAgentGUINodeController({
|
|
|
11628
11624
|
workspaceId
|
|
11629
11625
|
]);
|
|
11630
11626
|
const executePrompt = useCallback4(
|
|
11631
|
-
(agentSessionId, content,
|
|
11627
|
+
(agentSessionId, content, displayPrompt) => {
|
|
11632
11628
|
const normalizedContent = normalizeAgentPromptContentBlocks(content);
|
|
11633
11629
|
if (!agentSessionId || normalizedContent.length === 0) {
|
|
11634
11630
|
return;
|
|
11635
11631
|
}
|
|
11632
|
+
const targetIsActiveConversation = activeConversationIdRef.current === agentSessionId;
|
|
11636
11633
|
const submittedPromptText = displayPrompt && displayPrompt.trim() ? displayPrompt : agentPromptContentDisplayText(normalizedContent);
|
|
11637
11634
|
const submittedAtUnixMs = Date.now();
|
|
11638
11635
|
const submitTrace = createAgentSubmitTraceState({
|
|
11639
11636
|
agentSessionId,
|
|
11640
11637
|
content: normalizedContent,
|
|
11641
11638
|
prompt: submittedPromptText,
|
|
11642
|
-
queued:
|
|
11639
|
+
queued: false,
|
|
11643
11640
|
startedAtUnixMs: submittedAtUnixMs
|
|
11644
11641
|
});
|
|
11645
11642
|
const targetConversation = resolveConversationSummaryById(
|
|
@@ -11662,7 +11659,7 @@ function useAgentGUINodeController({
|
|
|
11662
11659
|
conversationKnown: targetConversation !== null,
|
|
11663
11660
|
conversationStatus: previousConversationStatus,
|
|
11664
11661
|
isComposerHome: isComposerHomeRef.current,
|
|
11665
|
-
targetIsActiveConversation
|
|
11662
|
+
targetIsActiveConversation,
|
|
11666
11663
|
targetMode: "existing"
|
|
11667
11664
|
}
|
|
11668
11665
|
});
|
|
@@ -11717,28 +11714,24 @@ function useAgentGUINodeController({
|
|
|
11717
11714
|
trace: submitTrace,
|
|
11718
11715
|
workspaceId
|
|
11719
11716
|
});
|
|
11720
|
-
|
|
11721
|
-
|
|
11722
|
-
|
|
11723
|
-
|
|
11724
|
-
|
|
11725
|
-
|
|
11726
|
-
|
|
11727
|
-
|
|
11728
|
-
|
|
11729
|
-
|
|
11730
|
-
|
|
11731
|
-
|
|
11732
|
-
|
|
11733
|
-
|
|
11734
|
-
|
|
11735
|
-
|
|
11736
|
-
|
|
11737
|
-
|
|
11738
|
-
trace: submitTrace,
|
|
11739
|
-
workspaceId
|
|
11740
|
-
});
|
|
11741
|
-
}
|
|
11717
|
+
recordLocalMessages(agentSessionId, [
|
|
11718
|
+
createOptimisticPromptMessage({
|
|
11719
|
+
workspaceId,
|
|
11720
|
+
agentSessionId,
|
|
11721
|
+
turnId: pendingOptimisticTurnId,
|
|
11722
|
+
clientSubmitId: submitTrace.clientSubmitId,
|
|
11723
|
+
userId: currentUserId?.trim() || "user",
|
|
11724
|
+
prompt: submittedPromptText,
|
|
11725
|
+
content: normalizedContent,
|
|
11726
|
+
occurredAtUnixMs: submittedAtUnixMs
|
|
11727
|
+
})
|
|
11728
|
+
]);
|
|
11729
|
+
reportAgentSubmitTraceDiagnostic({
|
|
11730
|
+
event: "optimistic_user_message_recorded",
|
|
11731
|
+
runtime: agentActivityRuntime,
|
|
11732
|
+
trace: submitTrace,
|
|
11733
|
+
workspaceId
|
|
11734
|
+
});
|
|
11742
11735
|
void Promise.resolve().then(() => {
|
|
11743
11736
|
reportAgentSubmitTraceDiagnostic({
|
|
11744
11737
|
event: "send_input.requested",
|
|
@@ -11798,63 +11791,30 @@ function useAgentGUINodeController({
|
|
|
11798
11791
|
updatedAtUnixMs: Date.now()
|
|
11799
11792
|
});
|
|
11800
11793
|
}
|
|
11801
|
-
|
|
11802
|
-
|
|
11803
|
-
|
|
11804
|
-
|
|
11805
|
-
|
|
11806
|
-
|
|
11807
|
-
|
|
11808
|
-
return current;
|
|
11809
|
-
}
|
|
11810
|
-
return {
|
|
11811
|
-
...current,
|
|
11812
|
-
[agentSessionId]: emptyAgentComposerDraft()
|
|
11813
|
-
};
|
|
11814
|
-
});
|
|
11815
|
-
}
|
|
11816
|
-
if (queuedPromptId) {
|
|
11817
|
-
if (queuedPromptClaim) {
|
|
11818
|
-
queuedPromptClaimCompleted = agentQueuedPromptRuntime.completeClaim({
|
|
11819
|
-
workspaceId,
|
|
11820
|
-
agentSessionId,
|
|
11821
|
-
ownerId: queuedPromptClaim.ownerId,
|
|
11822
|
-
claimId: queuedPromptClaim.claimId
|
|
11823
|
-
});
|
|
11794
|
+
setDraftBySessionId((current) => {
|
|
11795
|
+
const currentDraft = current[agentSessionId];
|
|
11796
|
+
if (!shouldClearSubmittedDraft({
|
|
11797
|
+
currentDraft,
|
|
11798
|
+
submittedContent: normalizedContent
|
|
11799
|
+
})) {
|
|
11800
|
+
return current;
|
|
11824
11801
|
}
|
|
11825
|
-
|
|
11802
|
+
return {
|
|
11803
|
+
...current,
|
|
11804
|
+
[agentSessionId]: emptyAgentComposerDraft()
|
|
11805
|
+
};
|
|
11806
|
+
});
|
|
11826
11807
|
const submittedTurnId = result.turnId.trim();
|
|
11827
11808
|
if (submittedTurnId) {
|
|
11828
11809
|
pendingTurnIdBySessionIdRef.current = {
|
|
11829
11810
|
...pendingTurnIdBySessionIdRef.current,
|
|
11830
11811
|
[agentSessionId]: submittedTurnId
|
|
11831
11812
|
};
|
|
11832
|
-
|
|
11833
|
-
|
|
11834
|
-
|
|
11835
|
-
|
|
11836
|
-
|
|
11837
|
-
);
|
|
11838
|
-
} else {
|
|
11839
|
-
recordLocalMessages(agentSessionId, [
|
|
11840
|
-
createOptimisticPromptMessage({
|
|
11841
|
-
workspaceId,
|
|
11842
|
-
agentSessionId,
|
|
11843
|
-
turnId: submittedTurnId,
|
|
11844
|
-
clientSubmitId: submitTrace.clientSubmitId,
|
|
11845
|
-
userId: currentUserId?.trim() || "user",
|
|
11846
|
-
prompt: submittedPromptText,
|
|
11847
|
-
content: normalizedContent,
|
|
11848
|
-
occurredAtUnixMs: Date.now()
|
|
11849
|
-
})
|
|
11850
|
-
]);
|
|
11851
|
-
reportAgentSubmitTraceDiagnostic({
|
|
11852
|
-
event: "optimistic_user_message_recorded",
|
|
11853
|
-
runtime: agentActivityRuntime,
|
|
11854
|
-
trace: submitTrace,
|
|
11855
|
-
workspaceId
|
|
11856
|
-
});
|
|
11857
|
-
}
|
|
11813
|
+
retargetOptimisticPromptTurn(
|
|
11814
|
+
agentSessionId,
|
|
11815
|
+
submitTrace.clientSubmitId,
|
|
11816
|
+
submittedTurnId
|
|
11817
|
+
);
|
|
11858
11818
|
scheduleAgentSubmitTracePaint({
|
|
11859
11819
|
runtime: agentActivityRuntime,
|
|
11860
11820
|
trace: submitTrace,
|
|
@@ -11872,9 +11832,7 @@ function useAgentGUINodeController({
|
|
|
11872
11832
|
const nextTraces = { ...submitTraceBySessionIdRef.current };
|
|
11873
11833
|
delete nextTraces[agentSessionId];
|
|
11874
11834
|
submitTraceBySessionIdRef.current = nextTraces;
|
|
11875
|
-
|
|
11876
|
-
removeOptimisticPrompt(agentSessionId, submitTrace.clientSubmitId);
|
|
11877
|
-
}
|
|
11835
|
+
removeOptimisticPrompt(agentSessionId, submitTrace.clientSubmitId);
|
|
11878
11836
|
const nextPendingTurns = { ...pendingTurnIdBySessionIdRef.current };
|
|
11879
11837
|
delete nextPendingTurns[agentSessionId];
|
|
11880
11838
|
pendingTurnIdBySessionIdRef.current = nextPendingTurns;
|
|
@@ -11887,14 +11845,7 @@ function useAgentGUINodeController({
|
|
|
11887
11845
|
errorCode: getAgentGUIErrorCode(error)
|
|
11888
11846
|
}
|
|
11889
11847
|
});
|
|
11890
|
-
|
|
11891
|
-
const currentConversationSummary = resolveConversationSummaryById(
|
|
11892
|
-
conversations,
|
|
11893
|
-
agentSessionId,
|
|
11894
|
-
transientConversationRef.current
|
|
11895
|
-
);
|
|
11896
|
-
const shouldRetryQueuedPromptOnNextActivity = queuedPromptId !== void 0 && isAgentSessionActiveTurnConflictError(error);
|
|
11897
|
-
if (!shouldRetryQueuedPromptOnNextActivity && previousConversationStatus && previousConversationStatus !== "working") {
|
|
11848
|
+
if (previousConversationStatus && previousConversationStatus !== "working") {
|
|
11898
11849
|
patchConversation(
|
|
11899
11850
|
agentSessionId,
|
|
11900
11851
|
(conversation2) => conversation2.status === "working" ? {
|
|
@@ -11911,13 +11862,9 @@ function useAgentGUINodeController({
|
|
|
11911
11862
|
});
|
|
11912
11863
|
}
|
|
11913
11864
|
}
|
|
11914
|
-
if (isCurrentConversation(agentSessionId)
|
|
11865
|
+
if (isCurrentConversation(agentSessionId)) {
|
|
11915
11866
|
reportAgentGUIRuntimeError({
|
|
11916
11867
|
agentSessionId,
|
|
11917
|
-
context: {
|
|
11918
|
-
queuedPrompt: queuedPromptId !== void 0,
|
|
11919
|
-
retryQueuedPromptOnNextActivity: shouldRetryQueuedPromptOnNextActivity
|
|
11920
|
-
},
|
|
11921
11868
|
error,
|
|
11922
11869
|
phase: "send_prompt",
|
|
11923
11870
|
provider: dataRef.current.provider,
|
|
@@ -11926,25 +11873,6 @@ function useAgentGUINodeController({
|
|
|
11926
11873
|
});
|
|
11927
11874
|
setDetailError(getAgentGUIErrorMessage(error));
|
|
11928
11875
|
}
|
|
11929
|
-
if (queuedPromptId) {
|
|
11930
|
-
if (shouldRetryQueuedPromptOnNextActivity) {
|
|
11931
|
-
agentQueuedPromptRuntime.setRetryBlock({
|
|
11932
|
-
workspaceId,
|
|
11933
|
-
agentSessionId,
|
|
11934
|
-
retryBlock: {
|
|
11935
|
-
queuedPromptId,
|
|
11936
|
-
sessionStateUpdatedAtUnixMs: currentSessionState?.updatedAtUnixMs ?? null,
|
|
11937
|
-
conversationUpdatedAtUnixMs: currentConversationSummary?.updatedAtUnixMs ?? null
|
|
11938
|
-
}
|
|
11939
|
-
});
|
|
11940
|
-
} else {
|
|
11941
|
-
agentQueuedPromptRuntime.markPromptFailed({
|
|
11942
|
-
workspaceId,
|
|
11943
|
-
agentSessionId,
|
|
11944
|
-
promptId: queuedPromptId
|
|
11945
|
-
});
|
|
11946
|
-
}
|
|
11947
|
-
}
|
|
11948
11876
|
}).finally(() => {
|
|
11949
11877
|
if (conversationListQuery) {
|
|
11950
11878
|
clearAgentGUIConversationSubmitPending({
|
|
@@ -11953,22 +11881,12 @@ function useAgentGUINodeController({
|
|
|
11953
11881
|
});
|
|
11954
11882
|
}
|
|
11955
11883
|
setLocalIsSubmitting(false);
|
|
11956
|
-
if (queuedPromptClaim && !queuedPromptClaimCompleted) {
|
|
11957
|
-
agentQueuedPromptRuntime.releaseClaim({
|
|
11958
|
-
workspaceId,
|
|
11959
|
-
agentSessionId,
|
|
11960
|
-
ownerId: queuedPromptClaim.ownerId,
|
|
11961
|
-
claimId: queuedPromptClaim.claimId
|
|
11962
|
-
});
|
|
11963
|
-
}
|
|
11964
11884
|
});
|
|
11965
11885
|
},
|
|
11966
11886
|
[
|
|
11967
|
-
agentQueuedPromptRuntime,
|
|
11968
11887
|
currentUserId,
|
|
11969
11888
|
isCurrentConversation,
|
|
11970
11889
|
applyStatePatch,
|
|
11971
|
-
conversations,
|
|
11972
11890
|
conversationListQuery,
|
|
11973
11891
|
syncConversationListProjection,
|
|
11974
11892
|
loadSessionState,
|
|
@@ -12066,12 +11984,7 @@ function useAgentGUINodeController({
|
|
|
12066
11984
|
);
|
|
12067
11985
|
return;
|
|
12068
11986
|
}
|
|
12069
|
-
executePrompt(
|
|
12070
|
-
agentSessionId,
|
|
12071
|
-
normalizedContent,
|
|
12072
|
-
void 0,
|
|
12073
|
-
displayPromptText
|
|
12074
|
-
);
|
|
11987
|
+
executePrompt(agentSessionId, normalizedContent, displayPromptText);
|
|
12075
11988
|
},
|
|
12076
11989
|
[
|
|
12077
11990
|
activation,
|
|
@@ -12718,155 +12631,6 @@ function useAgentGUINodeController({
|
|
|
12718
12631
|
feedback: submitPlanFeedback,
|
|
12719
12632
|
skip: dismissPlanImplementation
|
|
12720
12633
|
};
|
|
12721
|
-
useEffect4(() => {
|
|
12722
|
-
if (previewMode) {
|
|
12723
|
-
return;
|
|
12724
|
-
}
|
|
12725
|
-
if (!activeConversationId) {
|
|
12726
|
-
return;
|
|
12727
|
-
}
|
|
12728
|
-
const queuedPrompt = activeQueuedPrompts[0] ?? null;
|
|
12729
|
-
const activeSessionState2 = getAgentSessionView(sessionViewRef(activeConversationId))?.controlState ?? null;
|
|
12730
|
-
const activeConversationSummary = resolveConversationSummaryById(
|
|
12731
|
-
conversations,
|
|
12732
|
-
activeConversationId,
|
|
12733
|
-
transientConversationRef.current
|
|
12734
|
-
);
|
|
12735
|
-
const blockedByStaleActiveTurnConflict = queuedPrompt !== null && activeQueuedPromptRetryBlock?.queuedPromptId === queuedPrompt.id && activeQueuedPromptRetryBlock.sessionStateUpdatedAtUnixMs === (activeSessionState2?.updatedAtUnixMs ?? null) && activeQueuedPromptRetryBlock.conversationUpdatedAtUnixMs === (activeConversationSummary?.updatedAtUnixMs ?? null);
|
|
12736
|
-
const canDrainQueuedPrompt = queuedPrompt !== null && queuedPrompt.id !== activeFailedQueuedPromptId && !blockedByStaleActiveTurnConflict && activeQueuedPromptClaim === null && !isSubmitting && !isRespondingApproval && !activeSessionState2?.pendingInteractive && !agentActivityDisplayStatusBusy(
|
|
12737
|
-
agentActivityDisplayStatuses.get(activeConversationId)
|
|
12738
|
-
);
|
|
12739
|
-
if (!canDrainQueuedPrompt) {
|
|
12740
|
-
return;
|
|
12741
|
-
}
|
|
12742
|
-
const claimResult = agentQueuedPromptRuntime.claimNextToDrain({
|
|
12743
|
-
workspaceId,
|
|
12744
|
-
agentSessionId: activeConversationId,
|
|
12745
|
-
ownerId: queuedPromptOwnerId
|
|
12746
|
-
});
|
|
12747
|
-
if (!claimResult) {
|
|
12748
|
-
return;
|
|
12749
|
-
}
|
|
12750
|
-
executePrompt(
|
|
12751
|
-
activeConversationId,
|
|
12752
|
-
claimResult.prompt.content,
|
|
12753
|
-
claimResult.prompt.id,
|
|
12754
|
-
claimResult.prompt.displayPrompt,
|
|
12755
|
-
claimResult.claim
|
|
12756
|
-
);
|
|
12757
|
-
}, [
|
|
12758
|
-
activeConversationId,
|
|
12759
|
-
activeFailedQueuedPromptId,
|
|
12760
|
-
activeQueuedPromptClaim,
|
|
12761
|
-
activeQueuedPromptRetryBlock,
|
|
12762
|
-
activeQueuedPrompts,
|
|
12763
|
-
agentQueuedPromptRuntime,
|
|
12764
|
-
agentActivityDisplayStatuses,
|
|
12765
|
-
conversations,
|
|
12766
|
-
executePrompt,
|
|
12767
|
-
isRespondingApproval,
|
|
12768
|
-
isSubmitting,
|
|
12769
|
-
previewMode,
|
|
12770
|
-
queuedPromptOwnerId,
|
|
12771
|
-
workspaceId
|
|
12772
|
-
]);
|
|
12773
|
-
useEffect4(() => {
|
|
12774
|
-
if (previewMode) {
|
|
12775
|
-
return;
|
|
12776
|
-
}
|
|
12777
|
-
if (!activeConversationId) {
|
|
12778
|
-
return;
|
|
12779
|
-
}
|
|
12780
|
-
if (!activeSendNextQueuedPromptId || activeQueuedPrompts[0]?.id !== activeSendNextQueuedPromptId) {
|
|
12781
|
-
return;
|
|
12782
|
-
}
|
|
12783
|
-
const activeSessionState2 = getAgentSessionView(sessionViewRef(activeConversationId))?.controlState ?? null;
|
|
12784
|
-
const activeConversationSummary = resolveConversationSummaryById(
|
|
12785
|
-
conversations,
|
|
12786
|
-
activeConversationId,
|
|
12787
|
-
transientConversationRef.current
|
|
12788
|
-
);
|
|
12789
|
-
const activeActivityDisplayStatus2 = agentActivityDisplayStatuses.get(activeConversationId) ?? null;
|
|
12790
|
-
const shouldInterrupt = activeQueuedPromptClaim === null && !isSubmitting && activeActivityDisplayStatus2 === "working";
|
|
12791
|
-
if (!shouldInterrupt || interruptingSessionIds[activeConversationId]) {
|
|
12792
|
-
return;
|
|
12793
|
-
}
|
|
12794
|
-
setInterruptingSessionIds((current) => ({
|
|
12795
|
-
...current,
|
|
12796
|
-
[activeConversationId]: true
|
|
12797
|
-
}));
|
|
12798
|
-
setDetailError(null);
|
|
12799
|
-
void Promise.resolve().then(() => {
|
|
12800
|
-
if (!isCurrentConversation(activeConversationId)) {
|
|
12801
|
-
return null;
|
|
12802
|
-
}
|
|
12803
|
-
return agentActivityRuntime.cancelSession({
|
|
12804
|
-
workspaceId,
|
|
12805
|
-
agentSessionId: activeConversationId
|
|
12806
|
-
});
|
|
12807
|
-
}).then((result) => {
|
|
12808
|
-
if (!result || !isCurrentConversation(activeConversationId)) {
|
|
12809
|
-
return;
|
|
12810
|
-
}
|
|
12811
|
-
reportAgentGUICancelDiagnostic({
|
|
12812
|
-
agentSessionId: activeConversationId,
|
|
12813
|
-
busySource: cancelBusySource({
|
|
12814
|
-
conversationStatus: activeConversationSummary?.status ?? null,
|
|
12815
|
-
hasActivePrompt: false,
|
|
12816
|
-
runtimeSessionStatus: runtimeSessionsBySessionId.get(activeConversationId)?.status ?? null,
|
|
12817
|
-
sessionStateStatus: activeSessionState2?.status ?? null
|
|
12818
|
-
}),
|
|
12819
|
-
currentSessionStatus: activeSessionState2?.status ?? null,
|
|
12820
|
-
phase: "drain_queued_prompt_interrupt",
|
|
12821
|
-
provider: dataRef.current.provider,
|
|
12822
|
-
result,
|
|
12823
|
-
runtime: agentActivityRuntime,
|
|
12824
|
-
workspaceId
|
|
12825
|
-
});
|
|
12826
|
-
void refreshMessagesFromSnapshot(activeConversationId);
|
|
12827
|
-
void loadSessionState(activeConversationId);
|
|
12828
|
-
void syncConversationListProjection(activeConversationId);
|
|
12829
|
-
}).catch((error) => {
|
|
12830
|
-
if (isCurrentConversation(activeConversationId)) {
|
|
12831
|
-
reportAgentGUIRuntimeError({
|
|
12832
|
-
agentSessionId: activeConversationId,
|
|
12833
|
-
error,
|
|
12834
|
-
phase: "drain_queued_prompt_interrupt",
|
|
12835
|
-
provider: dataRef.current.provider,
|
|
12836
|
-
runtime: agentActivityRuntime,
|
|
12837
|
-
workspaceId
|
|
12838
|
-
});
|
|
12839
|
-
setDetailError(getAgentGUIErrorMessage(error));
|
|
12840
|
-
}
|
|
12841
|
-
}).finally(() => {
|
|
12842
|
-
setInterruptingSessionIds((current) => {
|
|
12843
|
-
if (!current[activeConversationId]) {
|
|
12844
|
-
return current;
|
|
12845
|
-
}
|
|
12846
|
-
const next = { ...current };
|
|
12847
|
-
delete next[activeConversationId];
|
|
12848
|
-
return next;
|
|
12849
|
-
});
|
|
12850
|
-
});
|
|
12851
|
-
}, [
|
|
12852
|
-
activeConversationId,
|
|
12853
|
-
activeQueuedPromptClaim,
|
|
12854
|
-
activeQueuedPrompts,
|
|
12855
|
-
activeSendNextQueuedPromptId,
|
|
12856
|
-
agentActivityDisplayStatuses,
|
|
12857
|
-
conversations,
|
|
12858
|
-
interruptingSessionIds,
|
|
12859
|
-
isCurrentConversation,
|
|
12860
|
-
isSubmitting,
|
|
12861
|
-
syncConversationListProjection,
|
|
12862
|
-
loadSessionState,
|
|
12863
|
-
refreshMessagesFromSnapshot,
|
|
12864
|
-
previewMode,
|
|
12865
|
-
runtimeSessionsBySessionId,
|
|
12866
|
-
workspaceId,
|
|
12867
|
-
sessionViewRef,
|
|
12868
|
-
agentActivityRuntime
|
|
12869
|
-
]);
|
|
12870
12634
|
const requestDeleteConversation = useCallback4(
|
|
12871
12635
|
(agentSessionId) => {
|
|
12872
12636
|
const normalized = agentSessionId.trim();
|
|
@@ -14401,12 +14165,12 @@ function normalizeInteractiveQuestions(value) {
|
|
|
14401
14165
|
import {
|
|
14402
14166
|
Fragment as Fragment7,
|
|
14403
14167
|
memo,
|
|
14404
|
-
useCallback as
|
|
14168
|
+
useCallback as useCallback10,
|
|
14405
14169
|
useEffect as useEffect12,
|
|
14406
|
-
useLayoutEffect as
|
|
14170
|
+
useLayoutEffect as useLayoutEffect4,
|
|
14407
14171
|
useMemo as useMemo10,
|
|
14408
|
-
useRef as
|
|
14409
|
-
useState as
|
|
14172
|
+
useRef as useRef12,
|
|
14173
|
+
useState as useState11
|
|
14410
14174
|
} from "react";
|
|
14411
14175
|
import { useSnapshot } from "valtio";
|
|
14412
14176
|
import { proxy as proxy2 } from "valtio/vanilla";
|
|
@@ -14986,12 +14750,6 @@ function isTaskSearchImeComposing(event) {
|
|
|
14986
14750
|
}
|
|
14987
14751
|
|
|
14988
14752
|
// agent-gui/agentGuiNode/AgentSessionChrome.tsx
|
|
14989
|
-
import {
|
|
14990
|
-
useCallback as useCallback6,
|
|
14991
|
-
useLayoutEffect,
|
|
14992
|
-
useRef as useRef6,
|
|
14993
|
-
useState as useState5
|
|
14994
|
-
} from "react";
|
|
14995
14753
|
import { Button as Button2 } from "@tutti-os/ui-system";
|
|
14996
14754
|
|
|
14997
14755
|
// app/renderer/components/icons/CastIcon.tsx
|
|
@@ -15135,8 +14893,14 @@ var CastIcon = forwardRef2(
|
|
|
15135
14893
|
);
|
|
15136
14894
|
CastIcon.displayName = "CastIcon";
|
|
15137
14895
|
|
|
15138
|
-
//
|
|
15139
|
-
import {
|
|
14896
|
+
// app/renderer/components/ui/tooltip.tsx
|
|
14897
|
+
import {
|
|
14898
|
+
Tooltip,
|
|
14899
|
+
TooltipContent,
|
|
14900
|
+
TooltipPortal,
|
|
14901
|
+
TooltipProvider,
|
|
14902
|
+
TooltipTrigger
|
|
14903
|
+
} from "@tutti-os/ui-system";
|
|
15140
14904
|
|
|
15141
14905
|
// agent-gui/agentGuiNode/AgentGUIChrome.styles.ts
|
|
15142
14906
|
var styles2 = {
|
|
@@ -15148,8 +14912,8 @@ var styles2 = {
|
|
|
15148
14912
|
chromeCardConnecting: "agent-gui-chrome__card--connecting",
|
|
15149
14913
|
chromeCardDanger: "agent-gui-chrome__card--danger",
|
|
15150
14914
|
chromeIcon: "agent-gui-chrome__icon",
|
|
15151
|
-
chromeExpandCue: "agent-gui-chrome__expand-cue",
|
|
15152
14915
|
chromeMessageSlot: "agent-gui-chrome__message-slot",
|
|
14916
|
+
chromeMessageTooltip: "agent-gui-chrome__message-tooltip",
|
|
15153
14917
|
chromeInlineActions: "agent-gui-chrome__inline-actions",
|
|
15154
14918
|
chromeNoticeDescription: "agent-gui-chrome__notice-description",
|
|
15155
14919
|
chromeNoticeMessage: "agent-gui-chrome__notice-message",
|
|
@@ -15183,6 +14947,24 @@ function LoadingEllipsis() {
|
|
|
15183
14947
|
/* @__PURE__ */ jsx19("span", {})
|
|
15184
14948
|
] });
|
|
15185
14949
|
}
|
|
14950
|
+
function ChromeMessageTooltip({
|
|
14951
|
+
message,
|
|
14952
|
+
children
|
|
14953
|
+
}) {
|
|
14954
|
+
"use memo";
|
|
14955
|
+
return /* @__PURE__ */ jsx19(TooltipProvider, { delayDuration: 250, children: /* @__PURE__ */ jsxs7(Tooltip, { children: [
|
|
14956
|
+
/* @__PURE__ */ jsx19(TooltipTrigger, { asChild: true, children }),
|
|
14957
|
+
/* @__PURE__ */ jsx19(
|
|
14958
|
+
TooltipContent,
|
|
14959
|
+
{
|
|
14960
|
+
className: AgentGUIChrome_styles_default.chromeMessageTooltip,
|
|
14961
|
+
side: "top",
|
|
14962
|
+
sideOffset: 6,
|
|
14963
|
+
children: message
|
|
14964
|
+
}
|
|
14965
|
+
)
|
|
14966
|
+
] }) });
|
|
14967
|
+
}
|
|
15186
14968
|
function AgentChromeNotice({
|
|
15187
14969
|
tone,
|
|
15188
14970
|
title,
|
|
@@ -15200,8 +14982,6 @@ function AgentChromeNotice({
|
|
|
15200
14982
|
AgentGUIChrome_styles_default.chromeCard,
|
|
15201
14983
|
tone === "danger" ? AgentGUIChrome_styles_default.chromeCardDanger : AgentGUIChrome_styles_default.chromeCardWarning
|
|
15202
14984
|
),
|
|
15203
|
-
"data-expandable": "false",
|
|
15204
|
-
"data-expanded": "false",
|
|
15205
14985
|
role,
|
|
15206
14986
|
"data-testid": testId,
|
|
15207
14987
|
children: /* @__PURE__ */ jsx19("div", { className: AgentGUIChrome_styles_default.chromeMetaRow, children: /* @__PURE__ */ jsxs7("div", { className: AgentGUIChrome_styles_default.chromeMessageSlot, children: [
|
|
@@ -15221,44 +15001,6 @@ function AgentChromeNotice({
|
|
|
15221
15001
|
}
|
|
15222
15002
|
) });
|
|
15223
15003
|
}
|
|
15224
|
-
var compactChromeCardHeightPx = 36;
|
|
15225
|
-
var chromeCardExpandedHeightProperty = "--agent-gui-chrome-card-expanded-height";
|
|
15226
|
-
function hasElementOverflow(element) {
|
|
15227
|
-
if (!element) {
|
|
15228
|
-
return false;
|
|
15229
|
-
}
|
|
15230
|
-
return element.scrollWidth > element.clientWidth + 1 || element.scrollHeight > element.clientHeight + 1;
|
|
15231
|
-
}
|
|
15232
|
-
function areCardSetsEqual(left, right) {
|
|
15233
|
-
if (left.size !== right.size) {
|
|
15234
|
-
return false;
|
|
15235
|
-
}
|
|
15236
|
-
for (const card of left) {
|
|
15237
|
-
if (!right.has(card)) {
|
|
15238
|
-
return false;
|
|
15239
|
-
}
|
|
15240
|
-
}
|
|
15241
|
-
return true;
|
|
15242
|
-
}
|
|
15243
|
-
function parseCssPixelValue(value) {
|
|
15244
|
-
const parsedValue = Number.parseFloat(value);
|
|
15245
|
-
return Number.isFinite(parsedValue) ? parsedValue : 0;
|
|
15246
|
-
}
|
|
15247
|
-
function measureExpandedChromeCardHeight(element) {
|
|
15248
|
-
if (!element || element.dataset.expanded !== "true") {
|
|
15249
|
-
return;
|
|
15250
|
-
}
|
|
15251
|
-
const computedStyle = window.getComputedStyle(element);
|
|
15252
|
-
const borderBlockPx = parseCssPixelValue(computedStyle.borderTopWidth) + parseCssPixelValue(computedStyle.borderBottomWidth);
|
|
15253
|
-
const measuredHeightPx = Math.max(
|
|
15254
|
-
compactChromeCardHeightPx,
|
|
15255
|
-
Math.ceil(element.scrollHeight + borderBlockPx)
|
|
15256
|
-
);
|
|
15257
|
-
const nextHeight = `${measuredHeightPx}px`;
|
|
15258
|
-
if (element.style.getPropertyValue(chromeCardExpandedHeightProperty) !== nextHeight) {
|
|
15259
|
-
element.style.setProperty(chromeCardExpandedHeightProperty, nextHeight);
|
|
15260
|
-
}
|
|
15261
|
-
}
|
|
15262
15004
|
function AgentSessionChrome({
|
|
15263
15005
|
chrome,
|
|
15264
15006
|
isRespondingApproval,
|
|
@@ -15269,163 +15011,41 @@ function AgentSessionChrome({
|
|
|
15269
15011
|
labels
|
|
15270
15012
|
}) {
|
|
15271
15013
|
"use memo";
|
|
15272
|
-
const [expandedCards, setExpandedCards] = useState5(() => /* @__PURE__ */ new Set());
|
|
15273
|
-
const [expandableCards, setExpandableCards] = useState5(() => /* @__PURE__ */ new Set());
|
|
15274
|
-
const expandedCardsRef = useRef6(expandedCards);
|
|
15275
|
-
expandedCardsRef.current = expandedCards;
|
|
15276
|
-
const authCardRef = useRef6(null);
|
|
15277
|
-
const recoveryCardRef = useRef6(null);
|
|
15278
|
-
const authMessageRef = useRef6(null);
|
|
15279
|
-
const recoveryMessageRef = useRef6(null);
|
|
15280
15014
|
const visibleAuth = chrome.recovery?.kind === "activating" ? null : chrome.auth;
|
|
15281
15015
|
const visibleRecovery = chrome.recovery;
|
|
15282
15016
|
const recoveryMessage = visibleRecovery?.kind === "activating" ? labels.activatingSession : visibleRecovery?.message ?? "";
|
|
15283
15017
|
const recoveryHasInlineAction = visibleRecovery?.kind === "failed" && (visibleRecovery.followupAction === "continue-in-new-conversation" || visibleRecovery.canRetry !== false);
|
|
15284
15018
|
const activatingMessage = splitTrailingEllipsis(recoveryMessage);
|
|
15285
|
-
const measureExpandableCards = useCallback6(() => {
|
|
15286
|
-
const nextExpandableCards = /* @__PURE__ */ new Set();
|
|
15287
|
-
if (expandedCardsRef.current.has("auth") || hasElementOverflow(authMessageRef.current)) {
|
|
15288
|
-
nextExpandableCards.add("auth");
|
|
15289
|
-
}
|
|
15290
|
-
if (expandedCardsRef.current.has("recovery") || hasElementOverflow(recoveryMessageRef.current)) {
|
|
15291
|
-
nextExpandableCards.add("recovery");
|
|
15292
|
-
}
|
|
15293
|
-
setExpandableCards(
|
|
15294
|
-
(current) => areCardSetsEqual(current, nextExpandableCards) ? current : nextExpandableCards
|
|
15295
|
-
);
|
|
15296
|
-
setExpandedCards((current) => {
|
|
15297
|
-
const nextExpandedCards = new Set(
|
|
15298
|
-
[...current].filter((card) => nextExpandableCards.has(card))
|
|
15299
|
-
);
|
|
15300
|
-
return areCardSetsEqual(current, nextExpandedCards) ? current : nextExpandedCards;
|
|
15301
|
-
});
|
|
15302
|
-
}, []);
|
|
15303
|
-
const measureChromeLayout = useCallback6(() => {
|
|
15304
|
-
measureExpandedChromeCardHeight(authCardRef.current);
|
|
15305
|
-
measureExpandedChromeCardHeight(recoveryCardRef.current);
|
|
15306
|
-
measureExpandableCards();
|
|
15307
|
-
}, [measureExpandableCards]);
|
|
15308
|
-
useLayoutEffect(() => {
|
|
15309
|
-
measureChromeLayout();
|
|
15310
|
-
const ResizeObserverConstructor = window.ResizeObserver;
|
|
15311
|
-
if (ResizeObserverConstructor) {
|
|
15312
|
-
const resizeObserver = new ResizeObserverConstructor(measureChromeLayout);
|
|
15313
|
-
for (const element of [
|
|
15314
|
-
authCardRef.current,
|
|
15315
|
-
recoveryCardRef.current,
|
|
15316
|
-
authMessageRef.current,
|
|
15317
|
-
recoveryMessageRef.current
|
|
15318
|
-
]) {
|
|
15319
|
-
if (element) {
|
|
15320
|
-
resizeObserver.observe(element);
|
|
15321
|
-
if (element.parentElement) {
|
|
15322
|
-
resizeObserver.observe(element.parentElement);
|
|
15323
|
-
}
|
|
15324
|
-
}
|
|
15325
|
-
}
|
|
15326
|
-
return () => resizeObserver.disconnect();
|
|
15327
|
-
}
|
|
15328
|
-
window.addEventListener("resize", measureChromeLayout);
|
|
15329
|
-
return () => window.removeEventListener("resize", measureChromeLayout);
|
|
15330
|
-
}, [
|
|
15331
|
-
expandedCards,
|
|
15332
|
-
visibleAuth?.message,
|
|
15333
|
-
measureChromeLayout,
|
|
15334
|
-
recoveryMessage
|
|
15335
|
-
]);
|
|
15336
15019
|
const hasContent = visibleAuth !== null || chrome.approval !== null || visibleRecovery !== null;
|
|
15337
15020
|
if (!hasContent) {
|
|
15338
15021
|
return null;
|
|
15339
15022
|
}
|
|
15340
|
-
const toggleExpandedCard = (card) => {
|
|
15341
|
-
if (!expandableCards.has(card)) {
|
|
15342
|
-
return;
|
|
15343
|
-
}
|
|
15344
|
-
setExpandedCards((current) => {
|
|
15345
|
-
const next = new Set(current);
|
|
15346
|
-
if (next.has(card)) {
|
|
15347
|
-
next.delete(card);
|
|
15348
|
-
} else {
|
|
15349
|
-
next.add(card);
|
|
15350
|
-
}
|
|
15351
|
-
return next;
|
|
15352
|
-
});
|
|
15353
|
-
};
|
|
15354
|
-
const handleExpandableCardKeyDown = (card) => (event) => {
|
|
15355
|
-
if (event.key !== "Enter" && event.key !== " ") {
|
|
15356
|
-
return;
|
|
15357
|
-
}
|
|
15358
|
-
event.preventDefault();
|
|
15359
|
-
toggleExpandedCard(card);
|
|
15360
|
-
};
|
|
15361
|
-
const stopCardToggle = (event) => {
|
|
15362
|
-
event.stopPropagation();
|
|
15363
|
-
};
|
|
15364
15023
|
return /* @__PURE__ */ jsxs7("div", { className: AgentGUIChrome_styles_default.sessionChrome, children: [
|
|
15365
|
-
visibleAuth ? /* @__PURE__ */ jsx19(
|
|
15366
|
-
"
|
|
15367
|
-
{
|
|
15368
|
-
|
|
15369
|
-
|
|
15370
|
-
|
|
15371
|
-
|
|
15372
|
-
|
|
15373
|
-
|
|
15374
|
-
|
|
15375
|
-
|
|
15376
|
-
|
|
15377
|
-
|
|
15378
|
-
|
|
15379
|
-
|
|
15380
|
-
|
|
15381
|
-
|
|
15382
|
-
|
|
15383
|
-
|
|
15384
|
-
|
|
15385
|
-
|
|
15386
|
-
|
|
15387
|
-
|
|
15388
|
-
|
|
15389
|
-
|
|
15390
|
-
className: AgentGUIChrome_styles_default.chromeExpandCue,
|
|
15391
|
-
"data-visible": expandableCards.has("auth") ? "true" : "false",
|
|
15392
|
-
"data-testid": "agent-session-chrome-auth-expand-cue",
|
|
15393
|
-
size: 16,
|
|
15394
|
-
strokeWidth: 2
|
|
15395
|
-
}
|
|
15396
|
-
)
|
|
15397
|
-
] }),
|
|
15398
|
-
/* @__PURE__ */ jsxs7("div", { className: AgentGUIChrome_styles_default.chromeInlineActions, children: [
|
|
15399
|
-
onAuthLogin ? /* @__PURE__ */ jsx19(
|
|
15400
|
-
Button2,
|
|
15401
|
-
{
|
|
15402
|
-
type: "button",
|
|
15403
|
-
variant: "ghost",
|
|
15404
|
-
size: "sm",
|
|
15405
|
-
onClick: (event) => {
|
|
15406
|
-
stopCardToggle(event);
|
|
15407
|
-
onAuthLogin();
|
|
15408
|
-
},
|
|
15409
|
-
children: labels.authLogin ?? labels.retryActivation
|
|
15410
|
-
}
|
|
15411
|
-
) : null,
|
|
15412
|
-
/* @__PURE__ */ jsx19(
|
|
15413
|
-
Button2,
|
|
15414
|
-
{
|
|
15415
|
-
type: "button",
|
|
15416
|
-
variant: "ghost",
|
|
15417
|
-
size: "sm",
|
|
15418
|
-
onClick: (event) => {
|
|
15419
|
-
stopCardToggle(event);
|
|
15420
|
-
onRetryActivation();
|
|
15421
|
-
},
|
|
15422
|
-
children: labels.retryActivation
|
|
15423
|
-
}
|
|
15424
|
-
)
|
|
15425
|
-
] })
|
|
15426
|
-
] })
|
|
15427
|
-
}
|
|
15428
|
-
) : null,
|
|
15024
|
+
visibleAuth ? /* @__PURE__ */ jsx19("section", { className: cn(AgentGUIChrome_styles_default.chromeCard, AgentGUIChrome_styles_default.chromeCardWarning), children: /* @__PURE__ */ jsxs7("div", { className: AgentGUIChrome_styles_default.chromeMetaRow, children: [
|
|
15025
|
+
/* @__PURE__ */ jsx19("div", { className: AgentGUIChrome_styles_default.chromeMessageSlot, children: /* @__PURE__ */ jsx19(ChromeMessageTooltip, { message: visibleAuth.message, children: /* @__PURE__ */ jsx19("p", { className: AgentGUIChrome_styles_default.chromeMessage, tabIndex: 0, children: visibleAuth.message }) }) }),
|
|
15026
|
+
/* @__PURE__ */ jsxs7("div", { className: AgentGUIChrome_styles_default.chromeInlineActions, children: [
|
|
15027
|
+
onAuthLogin ? /* @__PURE__ */ jsx19(
|
|
15028
|
+
Button2,
|
|
15029
|
+
{
|
|
15030
|
+
type: "button",
|
|
15031
|
+
variant: "ghost",
|
|
15032
|
+
size: "sm",
|
|
15033
|
+
onClick: () => onAuthLogin(),
|
|
15034
|
+
children: labels.authLogin ?? labels.retryActivation
|
|
15035
|
+
}
|
|
15036
|
+
) : null,
|
|
15037
|
+
/* @__PURE__ */ jsx19(
|
|
15038
|
+
Button2,
|
|
15039
|
+
{
|
|
15040
|
+
type: "button",
|
|
15041
|
+
variant: "ghost",
|
|
15042
|
+
size: "sm",
|
|
15043
|
+
onClick: () => onRetryActivation(),
|
|
15044
|
+
children: labels.retryActivation
|
|
15045
|
+
}
|
|
15046
|
+
)
|
|
15047
|
+
] })
|
|
15048
|
+
] }) }) : null,
|
|
15429
15049
|
chrome.approval ? /* @__PURE__ */ jsxs7("section", { className: cn(AgentGUIChrome_styles_default.chromeCard, AgentGUIChrome_styles_default.chromeCardAction), children: [
|
|
15430
15050
|
/* @__PURE__ */ jsx19("div", { className: AgentGUIChrome_styles_default.chromeTitle, children: labels.approvalRequired }),
|
|
15431
15051
|
/* @__PURE__ */ jsx19("p", { className: AgentGUIChrome_styles_default.chromeMessage, children: chrome.approval.title }),
|
|
@@ -15446,19 +15066,13 @@ function AgentSessionChrome({
|
|
|
15446
15066
|
visibleRecovery ? /* @__PURE__ */ jsx19(
|
|
15447
15067
|
"section",
|
|
15448
15068
|
{
|
|
15449
|
-
ref: recoveryCardRef,
|
|
15450
15069
|
role: visibleRecovery.kind === "failed" ? "alert" : void 0,
|
|
15451
15070
|
"aria-live": visibleRecovery.kind === "failed" ? "assertive" : void 0,
|
|
15452
|
-
"data-expandable": expandableCards.has("recovery") ? "true" : "false",
|
|
15453
|
-
"data-expanded": expandedCards.has("recovery") && expandableCards.has("recovery") ? "true" : "false",
|
|
15454
15071
|
"data-has-inline-actions": recoveryHasInlineAction ? "true" : "false",
|
|
15455
|
-
tabIndex: expandableCards.has("recovery") ? 0 : void 0,
|
|
15456
15072
|
className: cn(
|
|
15457
15073
|
AgentGUIChrome_styles_default.chromeCard,
|
|
15458
15074
|
visibleRecovery.kind === "failed" ? AgentGUIChrome_styles_default.chromeCardDanger : visibleRecovery.kind === "warning" ? AgentGUIChrome_styles_default.chromeCardDanger : visibleRecovery.kind === "activating" ? AgentGUIChrome_styles_default.chromeCardConnecting : AgentGUIChrome_styles_default.chromeCardMuted
|
|
15459
15075
|
),
|
|
15460
|
-
onClick: () => toggleExpandedCard("recovery"),
|
|
15461
|
-
onKeyDown: handleExpandableCardKeyDown("recovery"),
|
|
15462
15076
|
children: /* @__PURE__ */ jsxs7("div", { className: AgentGUIChrome_styles_default.chromeMetaRow, children: [
|
|
15463
15077
|
/* @__PURE__ */ jsxs7("div", { className: AgentGUIChrome_styles_default.chromeMessageSlot, children: [
|
|
15464
15078
|
visibleRecovery.kind === "activating" ? /* @__PURE__ */ jsx19(
|
|
@@ -15471,30 +15085,18 @@ function AgentSessionChrome({
|
|
|
15471
15085
|
size: 16
|
|
15472
15086
|
}
|
|
15473
15087
|
) : null,
|
|
15474
|
-
/* @__PURE__ */ jsx19(
|
|
15088
|
+
/* @__PURE__ */ jsx19(ChromeMessageTooltip, { message: recoveryMessage, children: /* @__PURE__ */ jsx19(
|
|
15475
15089
|
"p",
|
|
15476
15090
|
{
|
|
15477
|
-
ref: recoveryMessageRef,
|
|
15478
15091
|
className: AgentGUIChrome_styles_default.chromeMessage,
|
|
15479
15092
|
"aria-label": visibleRecovery.kind === "activating" ? recoveryMessage : void 0,
|
|
15480
|
-
|
|
15093
|
+
tabIndex: 0,
|
|
15481
15094
|
children: visibleRecovery.kind === "activating" ? /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
15482
15095
|
/* @__PURE__ */ jsx19("span", { className: "tsh-inline-loading-label", children: activatingMessage.label }),
|
|
15483
15096
|
activatingMessage.ellipsis ? /* @__PURE__ */ jsx19(LoadingEllipsis, {}) : null
|
|
15484
15097
|
] }) : recoveryMessage
|
|
15485
15098
|
}
|
|
15486
|
-
)
|
|
15487
|
-
/* @__PURE__ */ jsx19(
|
|
15488
|
-
ChevronDown,
|
|
15489
|
-
{
|
|
15490
|
-
"aria-hidden": "true",
|
|
15491
|
-
className: AgentGUIChrome_styles_default.chromeExpandCue,
|
|
15492
|
-
"data-visible": expandableCards.has("recovery") ? "true" : "false",
|
|
15493
|
-
"data-testid": "agent-session-chrome-recovery-expand-cue",
|
|
15494
|
-
size: 16,
|
|
15495
|
-
strokeWidth: 2
|
|
15496
|
-
}
|
|
15497
|
-
)
|
|
15099
|
+
) })
|
|
15498
15100
|
] }),
|
|
15499
15101
|
/* @__PURE__ */ jsx19("div", { className: AgentGUIChrome_styles_default.chromeInlineActions, children: visibleRecovery.kind === "failed" && visibleRecovery.followupAction === "continue-in-new-conversation" ? /* @__PURE__ */ jsx19(
|
|
15500
15102
|
Button2,
|
|
@@ -15503,10 +15105,7 @@ function AgentSessionChrome({
|
|
|
15503
15105
|
variant: "ghost",
|
|
15504
15106
|
size: "sm",
|
|
15505
15107
|
className: AgentGUIChrome_styles_default.chromeDangerGhostButton,
|
|
15506
|
-
onClick: (
|
|
15507
|
-
stopCardToggle(event);
|
|
15508
|
-
onContinueInNewConversation();
|
|
15509
|
-
},
|
|
15108
|
+
onClick: () => onContinueInNewConversation(),
|
|
15510
15109
|
children: labels.continueInNewConversation
|
|
15511
15110
|
}
|
|
15512
15111
|
) : visibleRecovery.kind === "failed" && visibleRecovery.canRetry !== false ? /* @__PURE__ */ jsx19(
|
|
@@ -15516,10 +15115,7 @@ function AgentSessionChrome({
|
|
|
15516
15115
|
variant: "ghost",
|
|
15517
15116
|
size: "sm",
|
|
15518
15117
|
className: AgentGUIChrome_styles_default.chromeDangerGhostButton,
|
|
15519
|
-
onClick: (
|
|
15520
|
-
stopCardToggle(event);
|
|
15521
|
-
onRetryActivation();
|
|
15522
|
-
},
|
|
15118
|
+
onClick: () => onRetryActivation(),
|
|
15523
15119
|
children: labels.retryActivation
|
|
15524
15120
|
}
|
|
15525
15121
|
) : null })
|
|
@@ -15589,8 +15185,6 @@ function AgentGoalBanner({
|
|
|
15589
15185
|
"section",
|
|
15590
15186
|
{
|
|
15591
15187
|
className: cn(AgentGUIChrome_styles_default.chromeCard, AgentGUIChrome_styles_default.chromeCardMuted),
|
|
15592
|
-
"data-expandable": "false",
|
|
15593
|
-
"data-expanded": "false",
|
|
15594
15188
|
role: "status",
|
|
15595
15189
|
"data-testid": "agent-gui-goal-banner",
|
|
15596
15190
|
children: /* @__PURE__ */ jsxs8("div", { className: AgentGUIChrome_styles_default.chromeMetaRow, children: [
|
|
@@ -15623,25 +15217,14 @@ function AgentGoalBanner({
|
|
|
15623
15217
|
|
|
15624
15218
|
// agent-gui/agentGuiNode/AgentComposer.tsx
|
|
15625
15219
|
import {
|
|
15626
|
-
useCallback as
|
|
15220
|
+
useCallback as useCallback9,
|
|
15627
15221
|
useEffect as useEffect11,
|
|
15628
|
-
useLayoutEffect as
|
|
15222
|
+
useLayoutEffect as useLayoutEffect3,
|
|
15629
15223
|
useMemo as useMemo9,
|
|
15630
|
-
useRef as
|
|
15631
|
-
useState as
|
|
15224
|
+
useRef as useRef11,
|
|
15225
|
+
useState as useState10
|
|
15632
15226
|
} from "react";
|
|
15633
15227
|
import { createPortal as createPortal3 } from "react-dom";
|
|
15634
|
-
|
|
15635
|
-
// app/renderer/components/ui/tooltip.tsx
|
|
15636
|
-
import {
|
|
15637
|
-
Tooltip,
|
|
15638
|
-
TooltipContent,
|
|
15639
|
-
TooltipPortal,
|
|
15640
|
-
TooltipProvider,
|
|
15641
|
-
TooltipTrigger
|
|
15642
|
-
} from "@tutti-os/ui-system";
|
|
15643
|
-
|
|
15644
|
-
// agent-gui/agentGuiNode/AgentComposer.tsx
|
|
15645
15228
|
import { AddIcon, Button as Button3, Select as Select2, SelectTrigger as SelectTrigger2 } from "@tutti-os/ui-system";
|
|
15646
15229
|
import { ListChecks as ListChecks2, Target as Target3, X } from "lucide-react";
|
|
15647
15230
|
import {
|
|
@@ -16085,7 +15668,7 @@ function filterUnavailableSlashCommands(commands, input) {
|
|
|
16085
15668
|
}
|
|
16086
15669
|
|
|
16087
15670
|
// agent-gui/agentGuiNode/AgentSlashCommandPalette.tsx
|
|
16088
|
-
import { Fragment as Fragment3, useEffect as useEffect6, useRef as
|
|
15671
|
+
import { Fragment as Fragment3, useEffect as useEffect6, useRef as useRef6 } from "react";
|
|
16089
15672
|
import {
|
|
16090
15673
|
Globe,
|
|
16091
15674
|
Info,
|
|
@@ -16099,7 +15682,7 @@ import {
|
|
|
16099
15682
|
import { jsx as jsx21, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
16100
15683
|
var paletteStyles = {
|
|
16101
15684
|
palette: "nodrag agent-gui-node__mention-palette flex h-full min-h-0 flex-col gap-1 overflow-y-auto px-1 pb-1 pt-2 [-webkit-app-region:no-drag]",
|
|
16102
|
-
option: "nodrag relative flex min-h-9 w-full min-w-0 cursor-pointer select-none items-center gap-2 overflow-hidden rounded-[6px] border-0 bg-transparent px-2.5 py-2 text-left text-[13px] text-[var(--text-primary)] outline-hidden transition-colors duration-200 [-webkit-app-region:no-drag] focus-visible:outline-none active:bg-[var(--transparency-active)] data-[highlighted]:bg-[var(--transparency-block)] data-[highlighted]:text-[var(--text-primary)] [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
15685
|
+
option: "nodrag relative flex min-h-9 w-full min-w-0 cursor-pointer select-none items-center gap-2 overflow-hidden rounded-[6px] border-0 bg-transparent px-2.5 py-2 text-left text-[13px] text-[var(--text-primary)] outline-hidden transition-colors duration-200 [-webkit-app-region:no-drag] hover:bg-[var(--transparency-block)] focus-visible:bg-[var(--transparency-block)] focus-visible:outline-none active:bg-[var(--transparency-active)] data-[highlighted]:bg-[var(--transparency-block)] data-[highlighted]:text-[var(--text-primary)] [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
16103
15686
|
icon: "flex w-3 shrink-0 items-center justify-center self-center text-[var(--text-secondary)]",
|
|
16104
15687
|
copy: "flex min-w-0 flex-1 items-center gap-1 overflow-hidden leading-[16px]",
|
|
16105
15688
|
name: "flex min-w-0 max-w-[48%] shrink-0 items-center gap-1 overflow-hidden",
|
|
@@ -16128,7 +15711,7 @@ function AgentSlashCommandPalette({
|
|
|
16128
15711
|
onSelectSkill
|
|
16129
15712
|
}) {
|
|
16130
15713
|
"use memo";
|
|
16131
|
-
const highlightedOptionRef =
|
|
15714
|
+
const highlightedOptionRef = useRef6(null);
|
|
16132
15715
|
useEffect6(() => {
|
|
16133
15716
|
highlightedOptionRef.current?.scrollIntoView({ block: "nearest" });
|
|
16134
15717
|
}, [highlightedIndex]);
|
|
@@ -16285,9 +15868,9 @@ function slashPaletteEntryIcon(entry) {
|
|
|
16285
15868
|
|
|
16286
15869
|
// agent-gui/agentGuiNode/AgentQueuedPromptPanel.tsx
|
|
16287
15870
|
import {
|
|
16288
|
-
useLayoutEffect
|
|
16289
|
-
useRef as
|
|
16290
|
-
useState as
|
|
15871
|
+
useLayoutEffect,
|
|
15872
|
+
useRef as useRef7,
|
|
15873
|
+
useState as useState5
|
|
16291
15874
|
} from "react";
|
|
16292
15875
|
import { ChevronRight } from "lucide-react";
|
|
16293
15876
|
|
|
@@ -16453,12 +16036,12 @@ function AgentQueuedPromptPanel({
|
|
|
16453
16036
|
workspaceAppIcons = EMPTY_WORKSPACE_APP_ICONS
|
|
16454
16037
|
}) {
|
|
16455
16038
|
"use memo";
|
|
16456
|
-
const [isExpanded, setIsExpanded] =
|
|
16457
|
-
const singlePromptTextRef =
|
|
16458
|
-
const queuedPromptListRef =
|
|
16459
|
-
const pointerHandledEditPromptIdRef =
|
|
16460
|
-
const [isSinglePromptOverflowing, setIsSinglePromptOverflowing] =
|
|
16461
|
-
const [expandedListMaxHeightPx, setExpandedListMaxHeightPx] =
|
|
16039
|
+
const [isExpanded, setIsExpanded] = useState5(false);
|
|
16040
|
+
const singlePromptTextRef = useRef7(null);
|
|
16041
|
+
const queuedPromptListRef = useRef7(null);
|
|
16042
|
+
const pointerHandledEditPromptIdRef = useRef7(null);
|
|
16043
|
+
const [isSinglePromptOverflowing, setIsSinglePromptOverflowing] = useState5(false);
|
|
16044
|
+
const [expandedListMaxHeightPx, setExpandedListMaxHeightPx] = useState5(280);
|
|
16462
16045
|
const singlePromptHasImages = queuedPrompts.length === 1 && queuedPromptImages(queuedPrompts[0]).length > 0;
|
|
16463
16046
|
const canExpand = queuedPrompts.length > 1 || singlePromptHasImages || isSinglePromptOverflowing;
|
|
16464
16047
|
const panelStyle = {
|
|
@@ -16498,7 +16081,7 @@ function AgentQueuedPromptPanel({
|
|
|
16498
16081
|
}
|
|
16499
16082
|
editQueuedPrompt(queuedPromptId);
|
|
16500
16083
|
};
|
|
16501
|
-
|
|
16084
|
+
useLayoutEffect(() => {
|
|
16502
16085
|
if (queuedPrompts.length !== 1) {
|
|
16503
16086
|
setIsSinglePromptOverflowing(false);
|
|
16504
16087
|
return;
|
|
@@ -16520,12 +16103,12 @@ function AgentQueuedPromptPanel({
|
|
|
16520
16103
|
resizeObserver?.disconnect();
|
|
16521
16104
|
};
|
|
16522
16105
|
}, [queuedPrompts]);
|
|
16523
|
-
|
|
16106
|
+
useLayoutEffect(() => {
|
|
16524
16107
|
if (!canExpand && isExpanded) {
|
|
16525
16108
|
setIsExpanded(false);
|
|
16526
16109
|
}
|
|
16527
16110
|
}, [canExpand, isExpanded]);
|
|
16528
|
-
|
|
16111
|
+
useLayoutEffect(() => {
|
|
16529
16112
|
const element = queuedPromptListRef.current;
|
|
16530
16113
|
if (!element) {
|
|
16531
16114
|
return;
|
|
@@ -16699,9 +16282,9 @@ import {
|
|
|
16699
16282
|
cloneElement,
|
|
16700
16283
|
useEffect as useEffect7,
|
|
16701
16284
|
useMemo as useMemo5,
|
|
16702
|
-
useState as
|
|
16285
|
+
useState as useState6
|
|
16703
16286
|
} from "react";
|
|
16704
|
-
import { ChevronDown
|
|
16287
|
+
import { ChevronDown, ZapIcon as ZapIcon2 } from "lucide-react";
|
|
16705
16288
|
import {
|
|
16706
16289
|
WorkspaceUserProjectSelect,
|
|
16707
16290
|
resolveWorkspaceUserProjectSelectLabels
|
|
@@ -17124,7 +16707,7 @@ function AgentProjectDropdown({
|
|
|
17124
16707
|
]
|
|
17125
16708
|
}
|
|
17126
16709
|
),
|
|
17127
|
-
/* @__PURE__ */ jsx23(
|
|
16710
|
+
/* @__PURE__ */ jsx23(ChevronDown, { "aria-hidden": "true", className: "shrink-0", size: 16 })
|
|
17128
16711
|
]
|
|
17129
16712
|
}
|
|
17130
16713
|
);
|
|
@@ -17172,7 +16755,7 @@ function AgentPermissionModeDropdown({
|
|
|
17172
16755
|
onSettingsChange
|
|
17173
16756
|
}) {
|
|
17174
16757
|
"use memo";
|
|
17175
|
-
const [isSelectOpen, setIsSelectOpen] =
|
|
16758
|
+
const [isSelectOpen, setIsSelectOpen] = useState6(false);
|
|
17176
16759
|
const isLoading = composerSettings.isSettingsLoading || composerSettings.isModelOptionsLoading === true;
|
|
17177
16760
|
const availableOptions = composerSettings.availablePermissionModes ?? [];
|
|
17178
16761
|
const selectedValue = composerSettings.selectedPermissionModeValue ?? composerSettings.draftSettings.permissionModeId;
|
|
@@ -17214,7 +16797,7 @@ function AgentPermissionModeDropdown({
|
|
|
17214
16797
|
"data-permission-tone": triggerTone,
|
|
17215
16798
|
children: [
|
|
17216
16799
|
/* @__PURE__ */ jsx23("span", { className: "flex min-w-0 flex-1 items-center", children: /* @__PURE__ */ jsx23("span", { className: "truncate", children: triggerLabel }) }),
|
|
17217
|
-
/* @__PURE__ */ jsx23(
|
|
16800
|
+
/* @__PURE__ */ jsx23(ChevronDown, { "aria-hidden": "true", className: "shrink-0", size: 16 })
|
|
17218
16801
|
]
|
|
17219
16802
|
}
|
|
17220
16803
|
);
|
|
@@ -17402,7 +16985,7 @@ function AgentModelReasoningDropdown({
|
|
|
17402
16985
|
onSettingsChange
|
|
17403
16986
|
}) {
|
|
17404
16987
|
"use memo";
|
|
17405
|
-
const [menuOpen, setMenuOpen] =
|
|
16988
|
+
const [menuOpen, setMenuOpen] = useState6(false);
|
|
17406
16989
|
const menu = buildComposerModelMenuModel(composerSettings, labels);
|
|
17407
16990
|
const menuDisabled = disabled || menu.disabled;
|
|
17408
16991
|
const isModelLoading = composerSettings.isModelOptionsLoading || composerSettings.isSettingsLoading;
|
|
@@ -17438,7 +17021,7 @@ function AgentModelReasoningDropdown({
|
|
|
17438
17021
|
/* @__PURE__ */ jsx23("span", { className: "shrink-0", children: menu.trigger.reasoningLabel })
|
|
17439
17022
|
] })
|
|
17440
17023
|
] }),
|
|
17441
|
-
/* @__PURE__ */ jsx23(
|
|
17024
|
+
/* @__PURE__ */ jsx23(ChevronDown, { "aria-hidden": "true", className: "shrink-0", size: 16 })
|
|
17442
17025
|
]
|
|
17443
17026
|
}
|
|
17444
17027
|
);
|
|
@@ -17669,12 +17252,12 @@ function ComposerModelOptionTooltip({
|
|
|
17669
17252
|
// agent-gui/agentGuiNode/agentRichText/AgentRichTextEditor.tsx
|
|
17670
17253
|
import {
|
|
17671
17254
|
forwardRef as forwardRef3,
|
|
17672
|
-
useCallback as
|
|
17255
|
+
useCallback as useCallback6,
|
|
17673
17256
|
useEffect as useEffect8,
|
|
17674
17257
|
useImperativeHandle as useImperativeHandle2,
|
|
17675
17258
|
useMemo as useMemo6,
|
|
17676
|
-
useRef as
|
|
17677
|
-
useState as
|
|
17259
|
+
useRef as useRef8,
|
|
17260
|
+
useState as useState7
|
|
17678
17261
|
} from "react";
|
|
17679
17262
|
import { createPortal } from "react-dom";
|
|
17680
17263
|
import { Extension } from "@tiptap/core";
|
|
@@ -18233,34 +17816,34 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18233
17816
|
}, ref) {
|
|
18234
17817
|
"use memo";
|
|
18235
17818
|
const { t } = useTranslation();
|
|
18236
|
-
const lastEmittedPromptRef =
|
|
18237
|
-
const editorRef =
|
|
18238
|
-
const onChangeRef =
|
|
18239
|
-
const onSubmitRef =
|
|
18240
|
-
const onSubmitGuidanceRef =
|
|
18241
|
-
const onKeyDownForPaletteRef =
|
|
18242
|
-
const onFileMentionSuggestionChangeRef =
|
|
17819
|
+
const lastEmittedPromptRef = useRef8(value);
|
|
17820
|
+
const editorRef = useRef8(null);
|
|
17821
|
+
const onChangeRef = useRef8(onChange);
|
|
17822
|
+
const onSubmitRef = useRef8(onSubmit);
|
|
17823
|
+
const onSubmitGuidanceRef = useRef8(onSubmitGuidance);
|
|
17824
|
+
const onKeyDownForPaletteRef = useRef8(onKeyDownForPalette);
|
|
17825
|
+
const onFileMentionSuggestionChangeRef = useRef8(
|
|
18243
17826
|
onFileMentionSuggestionChange
|
|
18244
17827
|
);
|
|
18245
|
-
const onFileMentionSuggestionKeyDownRef =
|
|
17828
|
+
const onFileMentionSuggestionKeyDownRef = useRef8(
|
|
18246
17829
|
onFileMentionSuggestionKeyDown
|
|
18247
17830
|
);
|
|
18248
|
-
const onLinkClickRef =
|
|
18249
|
-
const onPromptImagesUnsupportedRef =
|
|
18250
|
-
const onPasteImagesRef =
|
|
18251
|
-
const onDropFilesRef =
|
|
18252
|
-
const promptImagesSupportedRef =
|
|
18253
|
-
const getReferenceForFileRef =
|
|
18254
|
-
const placeholderRef =
|
|
18255
|
-
const removeMentionLabelRef =
|
|
18256
|
-
const availableSkillsRef =
|
|
18257
|
-
const availableCapabilitiesRef =
|
|
18258
|
-
const scrollFrameRef =
|
|
18259
|
-
const [contextMenu, setContextMenu] =
|
|
18260
|
-
const closeContextMenu =
|
|
17831
|
+
const onLinkClickRef = useRef8(onLinkClick);
|
|
17832
|
+
const onPromptImagesUnsupportedRef = useRef8(onPromptImagesUnsupported);
|
|
17833
|
+
const onPasteImagesRef = useRef8(onPasteImages);
|
|
17834
|
+
const onDropFilesRef = useRef8(onDropFiles);
|
|
17835
|
+
const promptImagesSupportedRef = useRef8(promptImagesSupported);
|
|
17836
|
+
const getReferenceForFileRef = useRef8(getReferenceForFile);
|
|
17837
|
+
const placeholderRef = useRef8(placeholder);
|
|
17838
|
+
const removeMentionLabelRef = useRef8(removeMentionLabel);
|
|
17839
|
+
const availableSkillsRef = useRef8(availableSkills);
|
|
17840
|
+
const availableCapabilitiesRef = useRef8(availableCapabilities);
|
|
17841
|
+
const scrollFrameRef = useRef8(null);
|
|
17842
|
+
const [contextMenu, setContextMenu] = useState7(null);
|
|
17843
|
+
const closeContextMenu = useCallback6(() => {
|
|
18261
17844
|
setContextMenu(null);
|
|
18262
17845
|
}, []);
|
|
18263
|
-
const insertPlainText =
|
|
17846
|
+
const insertPlainText = useCallback6((text) => {
|
|
18264
17847
|
const currentEditor = editorRef.current;
|
|
18265
17848
|
if (!currentEditor || currentEditor.isDestroyed || !text) {
|
|
18266
17849
|
return;
|
|
@@ -18272,7 +17855,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18272
17855
|
})
|
|
18273
17856
|
).run();
|
|
18274
17857
|
}, []);
|
|
18275
|
-
const copySelection =
|
|
17858
|
+
const copySelection = useCallback6(async () => {
|
|
18276
17859
|
const currentEditor = editorRef.current;
|
|
18277
17860
|
const selectedText = contextMenu && contextMenu.hasSelection && currentEditor ? readPromptTextRange(
|
|
18278
17861
|
currentEditor,
|
|
@@ -18285,7 +17868,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18285
17868
|
}
|
|
18286
17869
|
await writePlainTextToClipboard(selectedText);
|
|
18287
17870
|
}, [closeContextMenu, contextMenu]);
|
|
18288
|
-
const cutSelection =
|
|
17871
|
+
const cutSelection = useCallback6(async () => {
|
|
18289
17872
|
const currentEditor = editorRef.current;
|
|
18290
17873
|
const selectionFrom = contextMenu?.selectionFrom ?? null;
|
|
18291
17874
|
const selectionTo = contextMenu?.selectionTo ?? null;
|
|
@@ -18304,7 +17887,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18304
17887
|
const { from, to } = selectionFrom !== null && selectionTo !== null && selectionFrom < selectionTo ? { from: selectionFrom, to: selectionTo } : currentEditor.state.selection;
|
|
18305
17888
|
currentEditor.chain().focus().deleteRange({ from, to }).run();
|
|
18306
17889
|
}, [closeContextMenu, contextMenu, disabled]);
|
|
18307
|
-
const pasteClipboardText =
|
|
17890
|
+
const pasteClipboardText = useCallback6(async () => {
|
|
18308
17891
|
closeContextMenu();
|
|
18309
17892
|
if (disabled) {
|
|
18310
17893
|
return;
|
|
@@ -18918,8 +18501,8 @@ function AgentRichTextContextMenuButton({
|
|
|
18918
18501
|
label,
|
|
18919
18502
|
onSelect
|
|
18920
18503
|
}) {
|
|
18921
|
-
const selectionStartedRef =
|
|
18922
|
-
const select =
|
|
18504
|
+
const selectionStartedRef = useRef8(false);
|
|
18505
|
+
const select = useCallback6(() => {
|
|
18923
18506
|
if (disabled || selectionStartedRef.current) {
|
|
18924
18507
|
return;
|
|
18925
18508
|
}
|
|
@@ -19076,7 +18659,7 @@ function AgentSlashStatusPanel({
|
|
|
19076
18659
|
}
|
|
19077
18660
|
|
|
19078
18661
|
// agent-gui/agentGuiNode/AgentReviewPickerPanel.tsx
|
|
19079
|
-
import { useCallback as
|
|
18662
|
+
import { useCallback as useCallback7, useEffect as useEffect9, useMemo as useMemo7, useRef as useRef9, useState as useState8 } from "react";
|
|
19080
18663
|
import { menuItemClassName } from "@tutti-os/ui-system";
|
|
19081
18664
|
|
|
19082
18665
|
// agent-gui/agentGuiNode/AgentReviewBranchController.ts
|
|
@@ -19191,15 +18774,15 @@ function AgentReviewPickerPanel({
|
|
|
19191
18774
|
onSubmitReview,
|
|
19192
18775
|
onClose
|
|
19193
18776
|
}) {
|
|
19194
|
-
const [stage, setStage] =
|
|
19195
|
-
const [query, setQuery] =
|
|
19196
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
19197
|
-
const searchInputRef =
|
|
19198
|
-
const highlightedOptionRef =
|
|
19199
|
-
const reviewBranchControllerRef =
|
|
18777
|
+
const [stage, setStage] = useState8("root");
|
|
18778
|
+
const [query, setQuery] = useState8("");
|
|
18779
|
+
const [highlightedIndex, setHighlightedIndex] = useState8(0);
|
|
18780
|
+
const searchInputRef = useRef9(null);
|
|
18781
|
+
const highlightedOptionRef = useRef9(null);
|
|
18782
|
+
const reviewBranchControllerRef = useRef9(
|
|
19200
18783
|
null
|
|
19201
18784
|
);
|
|
19202
|
-
const [branchState, setBranchState] =
|
|
18785
|
+
const [branchState, setBranchState] = useState8({
|
|
19203
18786
|
status: "idle",
|
|
19204
18787
|
branches: [],
|
|
19205
18788
|
currentBranch: null,
|
|
@@ -19228,18 +18811,18 @@ function AgentReviewPickerPanel({
|
|
|
19228
18811
|
useEffect9(() => {
|
|
19229
18812
|
searchInputRef.current?.focus();
|
|
19230
18813
|
}, [stage]);
|
|
19231
|
-
const submit =
|
|
18814
|
+
const submit = useCallback7(
|
|
19232
18815
|
(command) => {
|
|
19233
18816
|
onSubmitReview(command);
|
|
19234
18817
|
},
|
|
19235
18818
|
[onSubmitReview]
|
|
19236
18819
|
);
|
|
19237
|
-
const goToStage =
|
|
18820
|
+
const goToStage = useCallback7((next) => {
|
|
19238
18821
|
setStage(next);
|
|
19239
18822
|
setQuery("");
|
|
19240
18823
|
setHighlightedIndex(0);
|
|
19241
18824
|
}, []);
|
|
19242
|
-
const goBackToRoot =
|
|
18825
|
+
const goBackToRoot = useCallback7(() => {
|
|
19243
18826
|
setStage("root");
|
|
19244
18827
|
setQuery("");
|
|
19245
18828
|
setHighlightedIndex(0);
|
|
@@ -19327,7 +18910,7 @@ function AgentReviewPickerPanel({
|
|
|
19327
18910
|
emptyMessage = labels.branchEmpty;
|
|
19328
18911
|
}
|
|
19329
18912
|
}
|
|
19330
|
-
const handleKeyDown =
|
|
18913
|
+
const handleKeyDown = useCallback7(
|
|
19331
18914
|
(event) => {
|
|
19332
18915
|
if (event.key === "ArrowDown") {
|
|
19333
18916
|
event.preventDefault();
|
|
@@ -19437,12 +19020,12 @@ function AgentReviewPickerPanel({
|
|
|
19437
19020
|
// agent-gui/agentGuiNode/composerFloatingMenu/ComposerFloatingMenuSurface.tsx
|
|
19438
19021
|
import {
|
|
19439
19022
|
forwardRef as forwardRef4,
|
|
19440
|
-
useCallback as
|
|
19023
|
+
useCallback as useCallback8,
|
|
19441
19024
|
useEffect as useEffect10,
|
|
19442
|
-
useLayoutEffect as
|
|
19025
|
+
useLayoutEffect as useLayoutEffect2,
|
|
19443
19026
|
useMemo as useMemo8,
|
|
19444
|
-
useRef as
|
|
19445
|
-
useState as
|
|
19027
|
+
useRef as useRef10,
|
|
19028
|
+
useState as useState9
|
|
19446
19029
|
} from "react";
|
|
19447
19030
|
import { createPortal as createPortal2 } from "react-dom";
|
|
19448
19031
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
@@ -19519,8 +19102,8 @@ function useComposerAnchoredMenuFrame({
|
|
|
19519
19102
|
maxHeight,
|
|
19520
19103
|
open
|
|
19521
19104
|
}) {
|
|
19522
|
-
const [frame, setFrame] =
|
|
19523
|
-
const syncFrame =
|
|
19105
|
+
const [frame, setFrame] = useState9(null);
|
|
19106
|
+
const syncFrame = useCallback8(() => {
|
|
19524
19107
|
const anchor = anchorRef.current;
|
|
19525
19108
|
if (!anchor || typeof window === "undefined") {
|
|
19526
19109
|
setFrame(null);
|
|
@@ -19531,7 +19114,7 @@ function useComposerAnchoredMenuFrame({
|
|
|
19531
19114
|
(previous) => sameComposerAnchoredMenuFrame(previous, nextFrame) ? previous : nextFrame
|
|
19532
19115
|
);
|
|
19533
19116
|
}, [anchorRef, maxHeight]);
|
|
19534
|
-
|
|
19117
|
+
useLayoutEffect2(() => {
|
|
19535
19118
|
if (!open) {
|
|
19536
19119
|
setFrame(null);
|
|
19537
19120
|
return;
|
|
@@ -19573,13 +19156,13 @@ var ComposerFloatingMenuSurface = forwardRef4(function ComposerFloatingMenuSurfa
|
|
|
19573
19156
|
surfaceRef,
|
|
19574
19157
|
testId
|
|
19575
19158
|
}, forwardedRef) {
|
|
19576
|
-
const localSurfaceRef =
|
|
19159
|
+
const localSurfaceRef = useRef10(null);
|
|
19577
19160
|
const frame = useComposerAnchoredMenuFrame({
|
|
19578
19161
|
anchorRef,
|
|
19579
19162
|
maxHeight,
|
|
19580
19163
|
open
|
|
19581
19164
|
});
|
|
19582
|
-
const setSurfaceRef =
|
|
19165
|
+
const setSurfaceRef = useCallback8(
|
|
19583
19166
|
(node) => {
|
|
19584
19167
|
localSurfaceRef.current = node;
|
|
19585
19168
|
assignRef(surfaceRef, node);
|
|
@@ -19721,32 +19304,32 @@ function AgentUsageChip({
|
|
|
19721
19304
|
compactDisabled
|
|
19722
19305
|
}) {
|
|
19723
19306
|
"use memo";
|
|
19724
|
-
const [usagePopoverOpen, setUsagePopoverOpen] =
|
|
19725
|
-
const usagePopoverHoverTimerRef =
|
|
19307
|
+
const [usagePopoverOpen, setUsagePopoverOpen] = useState10(false);
|
|
19308
|
+
const usagePopoverHoverTimerRef = useRef11(null);
|
|
19726
19309
|
const clampedPercent = Math.max(0, Math.min(100, percentUsed));
|
|
19727
19310
|
const chipLabel = labels.usageChipLabel({ percent: clampedPercent });
|
|
19728
19311
|
const showTokens = usedTokens !== null && totalTokens !== null;
|
|
19729
19312
|
const usageLevel = agentUsageChipLevel(clampedPercent);
|
|
19730
19313
|
const ringColor = agentUsageRingColor(usageLevel);
|
|
19731
|
-
const usagePopoverCloseTimerRef =
|
|
19732
|
-
const clearUsagePopoverHoverTimer =
|
|
19314
|
+
const usagePopoverCloseTimerRef = useRef11(null);
|
|
19315
|
+
const clearUsagePopoverHoverTimer = useCallback9(() => {
|
|
19733
19316
|
if (usagePopoverHoverTimerRef.current) {
|
|
19734
19317
|
clearTimeout(usagePopoverHoverTimerRef.current);
|
|
19735
19318
|
usagePopoverHoverTimerRef.current = null;
|
|
19736
19319
|
}
|
|
19737
19320
|
}, []);
|
|
19738
|
-
const clearUsagePopoverCloseTimer =
|
|
19321
|
+
const clearUsagePopoverCloseTimer = useCallback9(() => {
|
|
19739
19322
|
if (usagePopoverCloseTimerRef.current) {
|
|
19740
19323
|
clearTimeout(usagePopoverCloseTimerRef.current);
|
|
19741
19324
|
usagePopoverCloseTimerRef.current = null;
|
|
19742
19325
|
}
|
|
19743
19326
|
}, []);
|
|
19744
|
-
const openUsagePopover =
|
|
19327
|
+
const openUsagePopover = useCallback9(() => {
|
|
19745
19328
|
clearUsagePopoverHoverTimer();
|
|
19746
19329
|
clearUsagePopoverCloseTimer();
|
|
19747
19330
|
setUsagePopoverOpen(true);
|
|
19748
19331
|
}, [clearUsagePopoverCloseTimer, clearUsagePopoverHoverTimer]);
|
|
19749
|
-
const openUsagePopoverAfterHoverDelay =
|
|
19332
|
+
const openUsagePopoverAfterHoverDelay = useCallback9(() => {
|
|
19750
19333
|
clearUsagePopoverHoverTimer();
|
|
19751
19334
|
clearUsagePopoverCloseTimer();
|
|
19752
19335
|
usagePopoverHoverTimerRef.current = setTimeout(() => {
|
|
@@ -19754,12 +19337,12 @@ function AgentUsageChip({
|
|
|
19754
19337
|
setUsagePopoverOpen(true);
|
|
19755
19338
|
}, USAGE_POPOVER_HOVER_DELAY_MS);
|
|
19756
19339
|
}, [clearUsagePopoverCloseTimer, clearUsagePopoverHoverTimer]);
|
|
19757
|
-
const closeUsagePopover =
|
|
19340
|
+
const closeUsagePopover = useCallback9(() => {
|
|
19758
19341
|
clearUsagePopoverHoverTimer();
|
|
19759
19342
|
clearUsagePopoverCloseTimer();
|
|
19760
19343
|
setUsagePopoverOpen(false);
|
|
19761
19344
|
}, [clearUsagePopoverCloseTimer, clearUsagePopoverHoverTimer]);
|
|
19762
|
-
const scheduleUsagePopoverClose =
|
|
19345
|
+
const scheduleUsagePopoverClose = useCallback9(() => {
|
|
19763
19346
|
clearUsagePopoverHoverTimer();
|
|
19764
19347
|
clearUsagePopoverCloseTimer();
|
|
19765
19348
|
usagePopoverCloseTimerRef.current = setTimeout(() => {
|
|
@@ -19767,7 +19350,7 @@ function AgentUsageChip({
|
|
|
19767
19350
|
setUsagePopoverOpen(false);
|
|
19768
19351
|
}, 140);
|
|
19769
19352
|
}, [clearUsagePopoverCloseTimer, clearUsagePopoverHoverTimer]);
|
|
19770
|
-
const handleUsagePopoverOpenChange =
|
|
19353
|
+
const handleUsagePopoverOpenChange = useCallback9(
|
|
19771
19354
|
(open) => {
|
|
19772
19355
|
if (open) {
|
|
19773
19356
|
openUsagePopover();
|
|
@@ -20001,28 +19584,28 @@ function AgentComposer({
|
|
|
20001
19584
|
const promptFilesSupported = Boolean(
|
|
20002
19585
|
resolveDroppedFileReferences && promptFileUploadSupported
|
|
20003
19586
|
);
|
|
20004
|
-
const [isPaletteOpen, setIsPaletteOpen] =
|
|
20005
|
-
const [isReviewPickerOpen, setIsReviewPickerOpen] =
|
|
20006
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
20007
|
-
const [mentionHighlightedKey, setMentionHighlightedKey] =
|
|
20008
|
-
const [shouldCenterMentionHighlight, setShouldCenterMentionHighlight] =
|
|
19587
|
+
const [isPaletteOpen, setIsPaletteOpen] = useState10(true);
|
|
19588
|
+
const [isReviewPickerOpen, setIsReviewPickerOpen] = useState10(false);
|
|
19589
|
+
const [highlightedIndex, setHighlightedIndex] = useState10(0);
|
|
19590
|
+
const [mentionHighlightedKey, setMentionHighlightedKey] = useState10(null);
|
|
19591
|
+
const [shouldCenterMentionHighlight, setShouldCenterMentionHighlight] = useState10(false);
|
|
20009
19592
|
const [
|
|
20010
19593
|
shouldResetMentionHighlightToFilter,
|
|
20011
19594
|
setShouldResetMentionHighlightToFilter
|
|
20012
|
-
] =
|
|
20013
|
-
const [paletteDraftPrompt, setPaletteDraftPrompt] =
|
|
19595
|
+
] = useState10(false);
|
|
19596
|
+
const [paletteDraftPrompt, setPaletteDraftPrompt] = useState10(
|
|
20014
19597
|
goalDraftObjective ?? draftPrompt
|
|
20015
19598
|
);
|
|
20016
|
-
const [fileMentionSuggestion, setFileMentionSuggestion] =
|
|
20017
|
-
const [isSelectedProjectMissing, setIsSelectedProjectMissing] =
|
|
20018
|
-
const [isSlashStatusPanelOpen, setIsSlashStatusPanelOpen] =
|
|
19599
|
+
const [fileMentionSuggestion, setFileMentionSuggestion] = useState10(null);
|
|
19600
|
+
const [isSelectedProjectMissing, setIsSelectedProjectMissing] = useState10(false);
|
|
19601
|
+
const [isSlashStatusPanelOpen, setIsSlashStatusPanelOpen] = useState10(false);
|
|
20019
19602
|
const slashStatusAgentSessionId = slashStatus?.agentSessionId ?? null;
|
|
20020
|
-
const previousSlashStatusAgentSessionIdRef =
|
|
19603
|
+
const previousSlashStatusAgentSessionIdRef = useRef11(
|
|
20021
19604
|
slashStatusAgentSessionId
|
|
20022
19605
|
);
|
|
20023
19606
|
const selectedProjectPath = composerSettings.selectedProjectPath?.trim() ?? "";
|
|
20024
|
-
const previousSelectedProjectPathRef =
|
|
20025
|
-
const [mentionSearchState, setMentionSearchState] =
|
|
19607
|
+
const previousSelectedProjectPathRef = useRef11(selectedProjectPath);
|
|
19608
|
+
const [mentionSearchState, setMentionSearchState] = useState10({
|
|
20026
19609
|
status: "idle",
|
|
20027
19610
|
query: "",
|
|
20028
19611
|
mode: "browse",
|
|
@@ -20031,30 +19614,30 @@ function AgentComposer({
|
|
|
20031
19614
|
groups: [],
|
|
20032
19615
|
error: null
|
|
20033
19616
|
});
|
|
20034
|
-
const composerRef =
|
|
20035
|
-
const inputShellRef =
|
|
20036
|
-
const promptInputAreaRef =
|
|
20037
|
-
const paletteContentRef =
|
|
20038
|
-
const draftPromptRef =
|
|
20039
|
-
const draftImagesRef =
|
|
20040
|
-
const draftFilesRef =
|
|
20041
|
-
const promptTipRef =
|
|
20042
|
-
const mentionControllerRef =
|
|
19617
|
+
const composerRef = useRef11(null);
|
|
19618
|
+
const inputShellRef = useRef11(null);
|
|
19619
|
+
const promptInputAreaRef = useRef11(null);
|
|
19620
|
+
const paletteContentRef = useRef11(null);
|
|
19621
|
+
const draftPromptRef = useRef11(draftPrompt);
|
|
19622
|
+
const draftImagesRef = useRef11(draftImages);
|
|
19623
|
+
const draftFilesRef = useRef11(draftFiles);
|
|
19624
|
+
const promptTipRef = useRef11(null);
|
|
19625
|
+
const mentionControllerRef = useRef11(
|
|
20043
19626
|
null
|
|
20044
19627
|
);
|
|
20045
|
-
const editorHandleRef =
|
|
20046
|
-
const wasActiveRef =
|
|
20047
|
-
const lastComposerFocusRequestRef =
|
|
20048
|
-
const autoMentionHighlightedKeyRef =
|
|
20049
|
-
const [isPromptTipOverflowing, setIsPromptTipOverflowing] =
|
|
20050
|
-
const [dockComposerInputHeight, setDockComposerInputHeight] =
|
|
19628
|
+
const editorHandleRef = useRef11(null);
|
|
19629
|
+
const wasActiveRef = useRef11(isActive);
|
|
19630
|
+
const lastComposerFocusRequestRef = useRef11(null);
|
|
19631
|
+
const autoMentionHighlightedKeyRef = useRef11(null);
|
|
19632
|
+
const [isPromptTipOverflowing, setIsPromptTipOverflowing] = useState10(false);
|
|
19633
|
+
const [dockComposerInputHeight, setDockComposerInputHeight] = useState10(
|
|
20051
19634
|
DOCK_COMPOSER_INPUT_MIN_HEIGHT
|
|
20052
19635
|
);
|
|
20053
|
-
const [dockComposerInputMaxHeight, setDockComposerInputMaxHeight] =
|
|
19636
|
+
const [dockComposerInputMaxHeight, setDockComposerInputMaxHeight] = useState10(
|
|
20054
19637
|
DOCK_COMPOSER_INPUT_MAX_HEIGHT
|
|
20055
19638
|
);
|
|
20056
|
-
const [dockComposerAttachmentHeight, setDockComposerAttachmentHeight] =
|
|
20057
|
-
const [dockComposerTextHeight, setDockComposerTextHeight] =
|
|
19639
|
+
const [dockComposerAttachmentHeight, setDockComposerAttachmentHeight] = useState10(0);
|
|
19640
|
+
const [dockComposerTextHeight, setDockComposerTextHeight] = useState10(
|
|
20058
19641
|
DOCK_COMPOSER_INPUT_MIN_HEIGHT
|
|
20059
19642
|
);
|
|
20060
19643
|
const slashQuery = isGoalModeActive ? null : getPromptStartSlashCommandQuery(paletteDraftPrompt);
|
|
@@ -20214,7 +19797,7 @@ function AgentComposer({
|
|
|
20214
19797
|
highlightedIndex,
|
|
20215
19798
|
slashPaletteEntries.length
|
|
20216
19799
|
);
|
|
20217
|
-
const [mentionPaletteFrame, setMentionPaletteFrame] =
|
|
19800
|
+
const [mentionPaletteFrame, setMentionPaletteFrame] = useState10(null);
|
|
20218
19801
|
useEffect11(() => {
|
|
20219
19802
|
setHighlightedIndex(0);
|
|
20220
19803
|
}, [skillQueryMatch?.prefix, skillQueryMatch?.query, slashQuery]);
|
|
@@ -20287,26 +19870,26 @@ function AgentComposer({
|
|
|
20287
19870
|
previousSlashStatusAgentSessionIdRef.current = slashStatusAgentSessionId;
|
|
20288
19871
|
setIsSlashStatusPanelOpen(false);
|
|
20289
19872
|
}, [slashStatusAgentSessionId]);
|
|
20290
|
-
const clearSlashCommandDraft =
|
|
19873
|
+
const clearSlashCommandDraft = useCallback9(() => {
|
|
20291
19874
|
draftPromptRef.current = "";
|
|
20292
19875
|
setPaletteDraftPrompt("");
|
|
20293
19876
|
setIsPaletteOpen(false);
|
|
20294
19877
|
onDraftContentChange(emptyAgentComposerDraft());
|
|
20295
19878
|
}, [onDraftContentChange]);
|
|
20296
|
-
const closeSlashStatusPanel =
|
|
19879
|
+
const closeSlashStatusPanel = useCallback9(() => {
|
|
20297
19880
|
setIsSlashStatusPanelOpen(false);
|
|
20298
19881
|
}, []);
|
|
20299
19882
|
const settingsControlsDisabled = isSendingTurn || isSubmittingPrompt || showStopButton;
|
|
20300
19883
|
const composerControlsHardDisabled = isSelectedProjectMissing || isSubmittingPrompt || disabled && !isSendingTurn && !showStopButton;
|
|
20301
|
-
const closeReviewPicker =
|
|
19884
|
+
const closeReviewPicker = useCallback9(() => {
|
|
20302
19885
|
setIsReviewPickerOpen(false);
|
|
20303
19886
|
}, []);
|
|
20304
|
-
const closeSlashFloatingMenu =
|
|
19887
|
+
const closeSlashFloatingMenu = useCallback9(() => {
|
|
20305
19888
|
setIsSlashStatusPanelOpen(false);
|
|
20306
19889
|
setIsReviewPickerOpen(false);
|
|
20307
19890
|
setIsPaletteOpen(false);
|
|
20308
19891
|
}, []);
|
|
20309
|
-
const submitReviewCommand =
|
|
19892
|
+
const submitReviewCommand = useCallback9(
|
|
20310
19893
|
(command) => {
|
|
20311
19894
|
setIsReviewPickerOpen(false);
|
|
20312
19895
|
clearSlashCommandDraft();
|
|
@@ -20326,7 +19909,7 @@ function AgentComposer({
|
|
|
20326
19909
|
}
|
|
20327
19910
|
return null;
|
|
20328
19911
|
}, [onRequestGitBranches, selectedProjectPath, slashStatusAgentSessionId]);
|
|
20329
|
-
const executeSlashCommandEffect =
|
|
19912
|
+
const executeSlashCommandEffect = useCallback9(
|
|
20330
19913
|
(effect) => {
|
|
20331
19914
|
if (effect.kind === "submitPrompt") {
|
|
20332
19915
|
clearSlashCommandDraft();
|
|
@@ -20422,7 +20005,7 @@ function AgentComposer({
|
|
|
20422
20005
|
settingsControlsDisabled
|
|
20423
20006
|
]
|
|
20424
20007
|
);
|
|
20425
|
-
const selectCommand =
|
|
20008
|
+
const selectCommand = useCallback9(
|
|
20426
20009
|
(command) => {
|
|
20427
20010
|
const selectionEffect = resolveSlashCommandSelectionEffect({
|
|
20428
20011
|
provider,
|
|
@@ -20433,7 +20016,7 @@ function AgentComposer({
|
|
|
20433
20016
|
},
|
|
20434
20017
|
[executeSlashCommandEffect, provider]
|
|
20435
20018
|
);
|
|
20436
|
-
const selectCapability =
|
|
20019
|
+
const selectCapability = useCallback9(
|
|
20437
20020
|
(capability) => {
|
|
20438
20021
|
const selectionEffect = resolveSlashCommandSelectionEffect({
|
|
20439
20022
|
provider,
|
|
@@ -20444,14 +20027,14 @@ function AgentComposer({
|
|
|
20444
20027
|
},
|
|
20445
20028
|
[executeSlashCommandEffect, provider]
|
|
20446
20029
|
);
|
|
20447
|
-
const selectCapabilitySettings =
|
|
20030
|
+
const selectCapabilitySettings = useCallback9(
|
|
20448
20031
|
(capability) => {
|
|
20449
20032
|
onCapabilitySettingsRequest?.(capability.capability);
|
|
20450
20033
|
setIsPaletteOpen(false);
|
|
20451
20034
|
},
|
|
20452
20035
|
[onCapabilitySettingsRequest]
|
|
20453
20036
|
);
|
|
20454
|
-
const selectSkill =
|
|
20037
|
+
const selectSkill = useCallback9(
|
|
20455
20038
|
(skill) => {
|
|
20456
20039
|
const trigger = skillTriggerForPrefix(skill, skillQueryMatch?.prefix);
|
|
20457
20040
|
const replacedDraft = trigger && skillQueryMatch && promptBeforeSelection !== "" ? editorHandleRef.current?.replaceTextBeforeSelection(
|
|
@@ -20543,7 +20126,7 @@ function AgentComposer({
|
|
|
20543
20126
|
onDraftContentChange(emptyAgentComposerDraft());
|
|
20544
20127
|
}
|
|
20545
20128
|
);
|
|
20546
|
-
const submit =
|
|
20129
|
+
const submit = useCallback9(
|
|
20547
20130
|
(event) => {
|
|
20548
20131
|
event.preventDefault();
|
|
20549
20132
|
submitCurrentPrompt();
|
|
@@ -20603,7 +20186,7 @@ function AgentComposer({
|
|
|
20603
20186
|
return true;
|
|
20604
20187
|
}
|
|
20605
20188
|
);
|
|
20606
|
-
const selectFileMention =
|
|
20189
|
+
const selectFileMention = useCallback9(
|
|
20607
20190
|
(entry) => {
|
|
20608
20191
|
if (entry.kind === "file" && entry.mentionNavigation === "agent-generated-folder-back" && mentionControllerRef.current?.selectAgentGeneratedMentionItem(entry)) {
|
|
20609
20192
|
return;
|
|
@@ -20618,7 +20201,7 @@ function AgentComposer({
|
|
|
20618
20201
|
},
|
|
20619
20202
|
[fileMentionSuggestion]
|
|
20620
20203
|
);
|
|
20621
|
-
const closeFileMentionPalette =
|
|
20204
|
+
const closeFileMentionPalette = useCallback9(() => {
|
|
20622
20205
|
if (fileMentionSuggestion) {
|
|
20623
20206
|
exitAgentFileMentionSuggestion(fileMentionSuggestion.editor);
|
|
20624
20207
|
}
|
|
@@ -20626,7 +20209,7 @@ function AgentComposer({
|
|
|
20626
20209
|
setFileMentionSuggestion(null);
|
|
20627
20210
|
setIsPaletteOpen(false);
|
|
20628
20211
|
}, [fileMentionSuggestion]);
|
|
20629
|
-
const clearActiveFileMentionTrigger =
|
|
20212
|
+
const clearActiveFileMentionTrigger = useCallback9(() => {
|
|
20630
20213
|
if (!fileMentionSuggestion) {
|
|
20631
20214
|
return;
|
|
20632
20215
|
}
|
|
@@ -20642,14 +20225,14 @@ function AgentComposer({
|
|
|
20642
20225
|
setPaletteDraftPrompt(nextDraft);
|
|
20643
20226
|
onDraftContentChange({ ...draftContent, prompt: nextDraft });
|
|
20644
20227
|
}, [draftContent, fileMentionSuggestion, onDraftContentChange]);
|
|
20645
|
-
const closeOpenPalette =
|
|
20228
|
+
const closeOpenPalette = useCallback9(() => {
|
|
20646
20229
|
if (showFileMentionPalette) {
|
|
20647
20230
|
closeFileMentionPalette();
|
|
20648
20231
|
return;
|
|
20649
20232
|
}
|
|
20650
20233
|
setIsPaletteOpen(false);
|
|
20651
20234
|
}, [closeFileMentionPalette, showFileMentionPalette]);
|
|
20652
|
-
const createFileMentionPaletteAdapter =
|
|
20235
|
+
const createFileMentionPaletteAdapter = useCallback9(
|
|
20653
20236
|
(highlightedKey = mentionHighlightedKey) => createMentionPaletteStateAdapter({
|
|
20654
20237
|
state: mentionSearchState,
|
|
20655
20238
|
highlightedKey,
|
|
@@ -20678,23 +20261,23 @@ function AgentComposer({
|
|
|
20678
20261
|
}),
|
|
20679
20262
|
[mentionHighlightedKey, mentionSearchState, selectFileMention]
|
|
20680
20263
|
);
|
|
20681
|
-
const moveFileMentionSelection =
|
|
20264
|
+
const moveFileMentionSelection = useCallback9(
|
|
20682
20265
|
(delta) => {
|
|
20683
20266
|
createFileMentionPaletteAdapter().moveSelection(delta);
|
|
20684
20267
|
},
|
|
20685
20268
|
[createFileMentionPaletteAdapter]
|
|
20686
20269
|
);
|
|
20687
|
-
const handleMentionHighlightChange =
|
|
20270
|
+
const handleMentionHighlightChange = useCallback9((key) => {
|
|
20688
20271
|
autoMentionHighlightedKeyRef.current = null;
|
|
20689
20272
|
setMentionHighlightedKey(key);
|
|
20690
20273
|
}, []);
|
|
20691
|
-
const cycleFileMentionFilter =
|
|
20274
|
+
const cycleFileMentionFilter = useCallback9(
|
|
20692
20275
|
(delta = 1) => {
|
|
20693
20276
|
createFileMentionPaletteAdapter().cycleCategory(delta);
|
|
20694
20277
|
},
|
|
20695
20278
|
[createFileMentionPaletteAdapter]
|
|
20696
20279
|
);
|
|
20697
|
-
const navigateFileMentionHierarchy =
|
|
20280
|
+
const navigateFileMentionHierarchy = useCallback9(
|
|
20698
20281
|
(delta) => {
|
|
20699
20282
|
if (delta === -1) {
|
|
20700
20283
|
return mentionControllerRef.current?.exitAgentGeneratedBrowse() ?? false;
|
|
@@ -20710,13 +20293,13 @@ function AgentComposer({
|
|
|
20710
20293
|
},
|
|
20711
20294
|
[createFileMentionPaletteAdapter]
|
|
20712
20295
|
);
|
|
20713
|
-
const navigateIntoFileMentionItem =
|
|
20296
|
+
const navigateIntoFileMentionItem = useCallback9(
|
|
20714
20297
|
(item) => {
|
|
20715
20298
|
mentionControllerRef.current?.selectAgentGeneratedMentionItem(item);
|
|
20716
20299
|
},
|
|
20717
20300
|
[]
|
|
20718
20301
|
);
|
|
20719
|
-
const handleFileMentionKeyDown =
|
|
20302
|
+
const handleFileMentionKeyDown = useCallback9(
|
|
20720
20303
|
(event) => {
|
|
20721
20304
|
if (!showFileMentionPalette) {
|
|
20722
20305
|
return false;
|
|
@@ -20740,7 +20323,7 @@ function AgentComposer({
|
|
|
20740
20323
|
showFileMentionPalette
|
|
20741
20324
|
]
|
|
20742
20325
|
);
|
|
20743
|
-
const handlePlanModeToggleKeyDown =
|
|
20326
|
+
const handlePlanModeToggleKeyDown = useCallback9(
|
|
20744
20327
|
(event) => {
|
|
20745
20328
|
if (event.key !== "Tab" || !event.shiftKey || event.metaKey || event.ctrlKey || event.altKey) {
|
|
20746
20329
|
return false;
|
|
@@ -20795,7 +20378,7 @@ function AgentComposer({
|
|
|
20795
20378
|
});
|
|
20796
20379
|
};
|
|
20797
20380
|
}, [handlePaletteKeyDown, showPalette]);
|
|
20798
|
-
const handleFileMentionSuggestionChange =
|
|
20381
|
+
const handleFileMentionSuggestionChange = useCallback9(
|
|
20799
20382
|
(state) => {
|
|
20800
20383
|
setFileMentionSuggestion(state);
|
|
20801
20384
|
if (!state) {
|
|
@@ -20812,8 +20395,8 @@ function AgentComposer({
|
|
|
20812
20395
|
},
|
|
20813
20396
|
[currentUserId, selectedProjectPath, workspaceId]
|
|
20814
20397
|
);
|
|
20815
|
-
const openReferencesForEntityRef =
|
|
20816
|
-
const handleLinkClick =
|
|
20398
|
+
const openReferencesForEntityRef = useRef11(null);
|
|
20399
|
+
const handleLinkClick = useCallback9(
|
|
20817
20400
|
(href) => {
|
|
20818
20401
|
const item = parseMentionItemFromHref({ name: "", href });
|
|
20819
20402
|
if (item?.kind === "workspace-reference") {
|
|
@@ -20888,7 +20471,7 @@ function AgentComposer({
|
|
|
20888
20471
|
onDraftContentChange({ ...draftContent, prompt: nextDraft });
|
|
20889
20472
|
}
|
|
20890
20473
|
);
|
|
20891
|
-
const clearGoalModeBadge =
|
|
20474
|
+
const clearGoalModeBadge = useCallback9(() => {
|
|
20892
20475
|
if (!isGoalModeActive) {
|
|
20893
20476
|
return;
|
|
20894
20477
|
}
|
|
@@ -20902,7 +20485,7 @@ function AgentComposer({
|
|
|
20902
20485
|
isGoalModeActive,
|
|
20903
20486
|
onDraftContentChange
|
|
20904
20487
|
]);
|
|
20905
|
-
const addDraftImages =
|
|
20488
|
+
const addDraftImages = useCallback9(
|
|
20906
20489
|
(images) => {
|
|
20907
20490
|
if (images.length === 0) {
|
|
20908
20491
|
return;
|
|
@@ -20999,7 +20582,7 @@ function AgentComposer({
|
|
|
20999
20582
|
workspaceId
|
|
21000
20583
|
]
|
|
21001
20584
|
);
|
|
21002
|
-
const removeDraftImage =
|
|
20585
|
+
const removeDraftImage = useCallback9(
|
|
21003
20586
|
(id) => {
|
|
21004
20587
|
const nextDraftImages = draftImagesRef.current.filter(
|
|
21005
20588
|
(image) => image.id !== id
|
|
@@ -21013,7 +20596,7 @@ function AgentComposer({
|
|
|
21013
20596
|
},
|
|
21014
20597
|
[onDraftContentChange]
|
|
21015
20598
|
);
|
|
21016
|
-
const removeDraftFile =
|
|
20599
|
+
const removeDraftFile = useCallback9(
|
|
21017
20600
|
(id) => {
|
|
21018
20601
|
const nextDraftFiles = draftFilesRef.current.filter(
|
|
21019
20602
|
(file) => file.id !== id
|
|
@@ -21027,7 +20610,7 @@ function AgentComposer({
|
|
|
21027
20610
|
},
|
|
21028
20611
|
[onDraftContentChange]
|
|
21029
20612
|
);
|
|
21030
|
-
const applyReferencePickResult =
|
|
20613
|
+
const applyReferencePickResult = useCallback9(
|
|
21031
20614
|
async (result) => {
|
|
21032
20615
|
if (result.files.length > 0) {
|
|
21033
20616
|
const uploadPromptContent = promptFileUploadSupported ? agentActivityRuntime?.uploadPromptContent : void 0;
|
|
@@ -21076,13 +20659,13 @@ function AgentComposer({
|
|
|
21076
20659
|
},
|
|
21077
20660
|
[agentActivityRuntime, promptFileUploadSupported, workspaceId]
|
|
21078
20661
|
);
|
|
21079
|
-
const handleWorkspaceReferencePicker =
|
|
20662
|
+
const handleWorkspaceReferencePicker = useCallback9(async () => {
|
|
21080
20663
|
if (!onRequestWorkspaceReferences) {
|
|
21081
20664
|
return;
|
|
21082
20665
|
}
|
|
21083
20666
|
await applyReferencePickResult(await onRequestWorkspaceReferences());
|
|
21084
20667
|
}, [applyReferencePickResult, onRequestWorkspaceReferences]);
|
|
21085
|
-
const applyDroppedFileReferences =
|
|
20668
|
+
const applyDroppedFileReferences = useCallback9(
|
|
21086
20669
|
async (files) => {
|
|
21087
20670
|
if (!promptFilesSupported || !resolveDroppedFileReferences || files.length === 0) {
|
|
21088
20671
|
return;
|
|
@@ -21099,7 +20682,7 @@ function AgentComposer({
|
|
|
21099
20682
|
resolveDroppedFileReferences
|
|
21100
20683
|
]
|
|
21101
20684
|
);
|
|
21102
|
-
const handleOpenReferencesForEntity =
|
|
20685
|
+
const handleOpenReferencesForEntity = useCallback9(
|
|
21103
20686
|
(entity) => {
|
|
21104
20687
|
clearActiveFileMentionTrigger();
|
|
21105
20688
|
closeFileMentionPalette();
|
|
@@ -21118,7 +20701,7 @@ function AgentComposer({
|
|
|
21118
20701
|
]
|
|
21119
20702
|
);
|
|
21120
20703
|
openReferencesForEntityRef.current = handleOpenReferencesForEntity;
|
|
21121
|
-
const syncMentionPaletteFrame =
|
|
20704
|
+
const syncMentionPaletteFrame = useCallback9(() => {
|
|
21122
20705
|
const anchor = inputShellRef.current;
|
|
21123
20706
|
if (!anchor || typeof window === "undefined") {
|
|
21124
20707
|
setMentionPaletteFrame(null);
|
|
@@ -21158,7 +20741,7 @@ function AgentComposer({
|
|
|
21158
20741
|
zIndex: resolveMentionPaletteZIndex(anchor)
|
|
21159
20742
|
});
|
|
21160
20743
|
}, []);
|
|
21161
|
-
|
|
20744
|
+
useLayoutEffect3(() => {
|
|
21162
20745
|
if (!showFileMentionPalette) {
|
|
21163
20746
|
setMentionPaletteFrame(null);
|
|
21164
20747
|
return;
|
|
@@ -21202,7 +20785,7 @@ function AgentComposer({
|
|
|
21202
20785
|
isHeroLayout && AgentGUINode_styles_default.composerInputShellHero
|
|
21203
20786
|
);
|
|
21204
20787
|
const inputDisabled = isSelectedProjectMissing || disabled && !canQueueWhileBusy;
|
|
21205
|
-
const scheduleComposerFocus =
|
|
20788
|
+
const scheduleComposerFocus = useCallback9(() => {
|
|
21206
20789
|
if (inputDisabled) {
|
|
21207
20790
|
return;
|
|
21208
20791
|
}
|
|
@@ -21212,7 +20795,7 @@ function AgentComposer({
|
|
|
21212
20795
|
});
|
|
21213
20796
|
});
|
|
21214
20797
|
}, [inputDisabled]);
|
|
21215
|
-
const handlePastedImages =
|
|
20798
|
+
const handlePastedImages = useCallback9(
|
|
21216
20799
|
(images) => {
|
|
21217
20800
|
addDraftImages(images);
|
|
21218
20801
|
scheduleComposerFocus();
|
|
@@ -21351,7 +20934,7 @@ function AgentComposer({
|
|
|
21351
20934
|
"--agent-gui-prompt-tip-count": promptTips.length,
|
|
21352
20935
|
"--agent-gui-prompt-tip-cycle-duration": `${promptTips.length * PROMPT_TIP_CYCLE_STEP_MS}ms`
|
|
21353
20936
|
} : void 0;
|
|
21354
|
-
|
|
20937
|
+
useLayoutEffect3(() => {
|
|
21355
20938
|
if (previewMode) {
|
|
21356
20939
|
setIsPromptTipOverflowing(false);
|
|
21357
20940
|
return;
|
|
@@ -21385,7 +20968,7 @@ function AgentComposer({
|
|
|
21385
20968
|
isPromptTipOverflowing,
|
|
21386
20969
|
previewMode
|
|
21387
20970
|
]);
|
|
21388
|
-
|
|
20971
|
+
useLayoutEffect3(() => {
|
|
21389
20972
|
if (isHeroLayout) {
|
|
21390
20973
|
setDockComposerInputHeight(DOCK_COMPOSER_INPUT_MIN_HEIGHT);
|
|
21391
20974
|
setDockComposerInputMaxHeight(DOCK_COMPOSER_INPUT_MAX_HEIGHT);
|
|
@@ -21532,7 +21115,7 @@ function AgentComposer({
|
|
|
21532
21115
|
const sendButtonState = isQueueMode ? "queue" : shouldShowStopButton ? isInterrupting ? "stopping" : "interrupt" : isSendingTurn ? "loading" : "send";
|
|
21533
21116
|
const sendButtonBusy = isSendingTurn && !isQueueMode;
|
|
21534
21117
|
const activePromptRequestId = activePrompt?.requestId ?? null;
|
|
21535
|
-
const [dismissedPromptRequestId, setDismissedPromptRequestId] =
|
|
21118
|
+
const [dismissedPromptRequestId, setDismissedPromptRequestId] = useState10(null);
|
|
21536
21119
|
const visibleActivePrompt = activePrompt && dismissedPromptRequestId !== activePromptRequestId ? activePrompt : null;
|
|
21537
21120
|
const disabledReasonText = disabledReason?.trim() ?? "";
|
|
21538
21121
|
const effectivePlaceholder = disabledReasonText || placeholder;
|
|
@@ -21556,7 +21139,7 @@ function AgentComposer({
|
|
|
21556
21139
|
useEffect11(() => {
|
|
21557
21140
|
setDismissedPromptRequestId(null);
|
|
21558
21141
|
}, [activePromptRequestId]);
|
|
21559
|
-
const submitInteractivePromptAndDismiss =
|
|
21142
|
+
const submitInteractivePromptAndDismiss = useCallback9(
|
|
21560
21143
|
(input) => {
|
|
21561
21144
|
onSubmitInteractivePrompt(input);
|
|
21562
21145
|
setDismissedPromptRequestId(input.requestId);
|
|
@@ -22283,7 +21866,7 @@ function AgentComposerDraftImagePreview({
|
|
|
22283
21866
|
removeLabel,
|
|
22284
21867
|
onRemove
|
|
22285
21868
|
}) {
|
|
22286
|
-
const [aspectRatio, setAspectRatio] =
|
|
21869
|
+
const [aspectRatio, setAspectRatio] = useState10(1);
|
|
22287
21870
|
const previewWidth = Math.round(
|
|
22288
21871
|
Math.min(
|
|
22289
21872
|
DRAFT_IMAGE_PREVIEW_MAX_WIDTH_PX,
|
|
@@ -22433,9 +22016,9 @@ function isSlashCommandCapability(command) {
|
|
|
22433
22016
|
return "kind" in command && command.kind === "capability";
|
|
22434
22017
|
}
|
|
22435
22018
|
function useStableEventCallback(callback) {
|
|
22436
|
-
const callbackRef =
|
|
22019
|
+
const callbackRef = useRef11(callback);
|
|
22437
22020
|
callbackRef.current = callback;
|
|
22438
|
-
return
|
|
22021
|
+
return useCallback9((...args) => callbackRef.current(...args), []);
|
|
22439
22022
|
}
|
|
22440
22023
|
function SendFilledIcon() {
|
|
22441
22024
|
"use memo";
|
|
@@ -22675,7 +22258,7 @@ function groupConversations(conversations, labels, userProjects = [], options =
|
|
|
22675
22258
|
}
|
|
22676
22259
|
groups.push(
|
|
22677
22260
|
...[...projectGroups.values()].sort(
|
|
22678
|
-
(left, right) => left.sectionOrder - right.sectionOrder || right.projectUpdatedAtUnixMs - left.projectUpdatedAtUnixMs || left.projectOrder - right.projectOrder || left.label.localeCompare(right.label) || left.id.localeCompare(right.id)
|
|
22261
|
+
(left, right) => left.sectionOrder - right.sectionOrder || Number(right.items.length > 0) - Number(left.items.length > 0) || right.projectUpdatedAtUnixMs - left.projectUpdatedAtUnixMs || left.projectOrder - right.projectOrder || left.label.localeCompare(right.label) || left.id.localeCompare(right.id)
|
|
22679
22262
|
).map(
|
|
22680
22263
|
({
|
|
22681
22264
|
projectOrder: _projectOrder,
|
|
@@ -22932,7 +22515,7 @@ function slashStatusesEqual(left, right) {
|
|
|
22932
22515
|
return (left.agentSessionId ?? null) === (right.agentSessionId ?? null) && (left.baseUrl ?? null) === (right.baseUrl ?? null) && (left.contextWindow?.usedTokens ?? null) === (right.contextWindow?.usedTokens ?? null) && (left.contextWindow?.totalTokens ?? null) === (right.contextWindow?.totalTokens ?? null) && slashStatusLimitsEqual(left.limits, right.limits) && Boolean(left.limitsLoading) === Boolean(right.limitsLoading);
|
|
22933
22516
|
}
|
|
22934
22517
|
function useStableSlashStatus(status) {
|
|
22935
|
-
const statusRef =
|
|
22518
|
+
const statusRef = useRef12(null);
|
|
22936
22519
|
if (statusRef.current === null || !slashStatusesEqual(statusRef.current, status)) {
|
|
22937
22520
|
statusRef.current = status;
|
|
22938
22521
|
}
|
|
@@ -23019,32 +22602,32 @@ function AgentGUINodeView({
|
|
|
23019
22602
|
workspaceAppIcons = EMPTY_WORKSPACE_APP_ICONS3
|
|
23020
22603
|
}) {
|
|
23021
22604
|
"use memo";
|
|
23022
|
-
const layoutElementRef =
|
|
23023
|
-
const railResizeInteractionRef =
|
|
23024
|
-
const [isRailResizing, setIsRailResizing] =
|
|
23025
|
-
const [railResizeWidthPx, setRailResizeWidthPx] =
|
|
22605
|
+
const layoutElementRef = useRef12(null);
|
|
22606
|
+
const railResizeInteractionRef = useRef12(null);
|
|
22607
|
+
const [isRailResizing, setIsRailResizing] = useState11(false);
|
|
22608
|
+
const [railResizeWidthPx, setRailResizeWidthPx] = useState11(
|
|
23026
22609
|
null
|
|
23027
22610
|
);
|
|
23028
|
-
const [workspaceReferencePickerOpen, setWorkspaceReferencePickerOpen] =
|
|
23029
|
-
const [workspaceReferencePickerTarget, setWorkspaceReferencePickerTarget] =
|
|
22611
|
+
const [workspaceReferencePickerOpen, setWorkspaceReferencePickerOpen] = useState11(false);
|
|
22612
|
+
const [workspaceReferencePickerTarget, setWorkspaceReferencePickerTarget] = useState11(null);
|
|
23030
22613
|
const [
|
|
23031
22614
|
localComposerFocusRequestSequence,
|
|
23032
22615
|
setLocalComposerFocusRequestSequence
|
|
23033
|
-
] =
|
|
23034
|
-
const handledNewConversationRequestSequenceRef =
|
|
22616
|
+
] = useState11(0);
|
|
22617
|
+
const handledNewConversationRequestSequenceRef = useRef12(
|
|
23035
22618
|
newConversationRequestSequence
|
|
23036
22619
|
);
|
|
23037
|
-
const workspaceReferencePickerResolverRef =
|
|
22620
|
+
const workspaceReferencePickerResolverRef = useRef12(null);
|
|
23038
22621
|
const emptyReferencePickResult = useMemo10(
|
|
23039
22622
|
() => ({ files: [], mentionItems: [] }),
|
|
23040
22623
|
[]
|
|
23041
22624
|
);
|
|
23042
22625
|
const hostLocalFileSourceId = "host-local-file";
|
|
23043
|
-
const isWorkspaceReferencePickerNodeSelectable =
|
|
22626
|
+
const isWorkspaceReferencePickerNodeSelectable = useCallback10(
|
|
23044
22627
|
(node) => node.ref.sourceId !== hostLocalFileSourceId || node.kind === "file",
|
|
23045
22628
|
[hostLocalFileSourceId]
|
|
23046
22629
|
);
|
|
23047
|
-
const requestWorkspaceReferences =
|
|
22630
|
+
const requestWorkspaceReferences = useCallback10(
|
|
23048
22631
|
async (entity) => {
|
|
23049
22632
|
if (previewMode) {
|
|
23050
22633
|
return emptyReferencePickResult;
|
|
@@ -23076,13 +22659,13 @@ function AgentGUINodeView({
|
|
|
23076
22659
|
workspaceFileReferenceCopy
|
|
23077
22660
|
]
|
|
23078
22661
|
);
|
|
23079
|
-
const closeWorkspaceReferencePicker =
|
|
22662
|
+
const closeWorkspaceReferencePicker = useCallback10(() => {
|
|
23080
22663
|
workspaceReferencePickerResolverRef.current?.(emptyReferencePickResult);
|
|
23081
22664
|
workspaceReferencePickerResolverRef.current = null;
|
|
23082
22665
|
setWorkspaceReferencePickerOpen(false);
|
|
23083
22666
|
setWorkspaceReferencePickerTarget(null);
|
|
23084
22667
|
}, [emptyReferencePickResult]);
|
|
23085
|
-
const settleReferencePicker =
|
|
22668
|
+
const settleReferencePicker = useCallback10(
|
|
23086
22669
|
(result, addedFiles) => {
|
|
23087
22670
|
workspaceReferencePickerResolverRef.current?.(result);
|
|
23088
22671
|
workspaceReferencePickerResolverRef.current = null;
|
|
@@ -23094,13 +22677,13 @@ function AgentGUINodeView({
|
|
|
23094
22677
|
},
|
|
23095
22678
|
[onWorkspaceFileReferencesAdded]
|
|
23096
22679
|
);
|
|
23097
|
-
const confirmWorkspaceReferencePicker =
|
|
22680
|
+
const confirmWorkspaceReferencePicker = useCallback10(
|
|
23098
22681
|
(refs) => {
|
|
23099
22682
|
settleReferencePicker({ files: refs, mentionItems: [] }, refs);
|
|
23100
22683
|
},
|
|
23101
22684
|
[settleReferencePicker]
|
|
23102
22685
|
);
|
|
23103
|
-
const confirmWorkspaceReferenceBundles =
|
|
22686
|
+
const confirmWorkspaceReferenceBundles = useCallback10(
|
|
23104
22687
|
(result) => {
|
|
23105
22688
|
const workspaceRefs = result.files.filter(
|
|
23106
22689
|
(ref) => ref.sourceId !== hostLocalFileSourceId
|
|
@@ -23174,7 +22757,7 @@ function AgentGUINodeView({
|
|
|
23174
22757
|
);
|
|
23175
22758
|
const openProjectFiles = useOptionalStableEventCallback(onLinkAction);
|
|
23176
22759
|
const detailComposerFocusRequestSequence = localComposerFocusRequestSequence === 0 ? composerFocusRequestSequence : (composerFocusRequestSequence ?? 0) + localComposerFocusRequestSequence;
|
|
23177
|
-
const requestCreateConversation =
|
|
22760
|
+
const requestCreateConversation = useCallback10(
|
|
23178
22761
|
(options) => {
|
|
23179
22762
|
if (previewMode) {
|
|
23180
22763
|
return;
|
|
@@ -23219,14 +22802,14 @@ function AgentGUINodeView({
|
|
|
23219
22802
|
}),
|
|
23220
22803
|
[viewModel.availableCommands, viewModel.workspaceId, workspaceAppIcons]
|
|
23221
22804
|
);
|
|
23222
|
-
const clampConversationRailWidth =
|
|
22805
|
+
const clampConversationRailWidth = useCallback10(
|
|
23223
22806
|
(widthPx) => Math.min(
|
|
23224
22807
|
conversationRailMaxWidthPx,
|
|
23225
22808
|
Math.max(conversationRailMinWidthPx, widthPx)
|
|
23226
22809
|
),
|
|
23227
22810
|
[conversationRailMaxWidthPx, conversationRailMinWidthPx]
|
|
23228
22811
|
);
|
|
23229
|
-
const handleConversationRailResizePointerDown =
|
|
22812
|
+
const handleConversationRailResizePointerDown = useCallback10(
|
|
23230
22813
|
(event) => {
|
|
23231
22814
|
if (previewMode) {
|
|
23232
22815
|
return;
|
|
@@ -23247,7 +22830,7 @@ function AgentGUINodeView({
|
|
|
23247
22830
|
},
|
|
23248
22831
|
[conversationRailCollapsed, conversationRailWidthPx, previewMode]
|
|
23249
22832
|
);
|
|
23250
|
-
const handleConversationRailResizePointerMove =
|
|
22833
|
+
const handleConversationRailResizePointerMove = useCallback10(
|
|
23251
22834
|
(event) => {
|
|
23252
22835
|
if (previewMode) {
|
|
23253
22836
|
return;
|
|
@@ -23270,7 +22853,7 @@ function AgentGUINodeView({
|
|
|
23270
22853
|
},
|
|
23271
22854
|
[clampConversationRailWidth, previewMode]
|
|
23272
22855
|
);
|
|
23273
|
-
const endConversationRailResize =
|
|
22856
|
+
const endConversationRailResize = useCallback10(
|
|
23274
22857
|
(event) => {
|
|
23275
22858
|
const resizeState = railResizeInteractionRef.current;
|
|
23276
22859
|
if (event && resizeState?.pointerId === event.pointerId && event.currentTarget.hasPointerCapture?.(event.pointerId)) {
|
|
@@ -23301,7 +22884,7 @@ function AgentGUINodeView({
|
|
|
23301
22884
|
isRailResizing,
|
|
23302
22885
|
railResizeWidthPx
|
|
23303
22886
|
]);
|
|
23304
|
-
const handleConversationRailResizeKeyDown =
|
|
22887
|
+
const handleConversationRailResizeKeyDown = useCallback10(
|
|
23305
22888
|
(event) => {
|
|
23306
22889
|
if (previewMode) {
|
|
23307
22890
|
return;
|
|
@@ -23333,7 +22916,7 @@ function AgentGUINodeView({
|
|
|
23333
22916
|
"--agent-gui-detail-min-width": `${detailMinWidthPx}px`,
|
|
23334
22917
|
gridTemplateColumns: conversationRailCollapsed ? "0 minmax(var(--agent-gui-detail-min-width), 1fr)" : "var(--agent-gui-conversation-rail-width) minmax(var(--agent-gui-detail-min-width), 1fr)"
|
|
23335
22918
|
};
|
|
23336
|
-
const openAgentEnvSetup =
|
|
22919
|
+
const openAgentEnvSetup = useCallback10(() => {
|
|
23337
22920
|
openAgentEnvPanel({ provider: viewModel.data.provider, focus: null });
|
|
23338
22921
|
}, [viewModel.data.provider]);
|
|
23339
22922
|
const conversationRailStoreState = useMemo10(
|
|
@@ -23396,7 +22979,7 @@ function AgentGUINodeView({
|
|
|
23396
22979
|
workspaceUserProjectI18n
|
|
23397
22980
|
]
|
|
23398
22981
|
);
|
|
23399
|
-
const conversationRailStoreRef =
|
|
22982
|
+
const conversationRailStoreRef = useRef12(
|
|
23400
22983
|
null
|
|
23401
22984
|
);
|
|
23402
22985
|
if (conversationRailStoreRef.current === null) {
|
|
@@ -23431,9 +23014,11 @@ function AgentGUINodeView({
|
|
|
23431
23014
|
AgentGUIConversationRailStorePane,
|
|
23432
23015
|
{
|
|
23433
23016
|
conversations: viewModel.conversations,
|
|
23017
|
+
provider: viewModel.data.provider,
|
|
23434
23018
|
store: conversationRailStore,
|
|
23435
23019
|
storeState: conversationRailStoreState,
|
|
23436
|
-
userProjects: viewModel.userProjects
|
|
23020
|
+
userProjects: viewModel.userProjects,
|
|
23021
|
+
workspaceId: viewModel.workspaceId
|
|
23437
23022
|
}
|
|
23438
23023
|
)
|
|
23439
23024
|
}
|
|
@@ -23606,15 +23191,16 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
23606
23191
|
workspaceAppIcons = EMPTY_WORKSPACE_APP_ICONS3
|
|
23607
23192
|
}) {
|
|
23608
23193
|
"use memo";
|
|
23609
|
-
const timelineRef =
|
|
23610
|
-
const bottomDockRef =
|
|
23611
|
-
const timelineScrollAnchorRef =
|
|
23612
|
-
const
|
|
23613
|
-
const
|
|
23194
|
+
const timelineRef = useRef12(null);
|
|
23195
|
+
const bottomDockRef = useRef12(null);
|
|
23196
|
+
const timelineScrollAnchorRef = useRef12(null);
|
|
23197
|
+
const submittedPromptScrollConversationRef = useRef12(null);
|
|
23198
|
+
const pendingPrependScrollAnchorRef = useRef12(null);
|
|
23199
|
+
const [isTimelineScrolledToTop, setIsTimelineScrolledToTop] = useState11(true);
|
|
23614
23200
|
const [
|
|
23615
23201
|
bottomDockDismissedPromptRequestId,
|
|
23616
23202
|
setBottomDockDismissedPromptRequestId
|
|
23617
|
-
] =
|
|
23203
|
+
] = useState11(null);
|
|
23618
23204
|
const conversation = useProjectedAgentConversation({
|
|
23619
23205
|
conversation: viewModel.conversation,
|
|
23620
23206
|
detail: viewModel.conversationDetail,
|
|
@@ -23719,13 +23305,15 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
23719
23305
|
thinkingLabel: labels.thinkingLabel,
|
|
23720
23306
|
toolCallsLabel: labels.toolCallsLabel,
|
|
23721
23307
|
processing: labels.processing,
|
|
23722
|
-
turnSummary: labels.turnSummary
|
|
23308
|
+
turnSummary: labels.turnSummary,
|
|
23309
|
+
userMessageLocator: labels.userMessageLocator
|
|
23723
23310
|
}),
|
|
23724
23311
|
[
|
|
23725
23312
|
labels.processing,
|
|
23726
23313
|
labels.thinkingLabel,
|
|
23727
23314
|
labels.toolCallsLabel,
|
|
23728
|
-
labels.turnSummary
|
|
23315
|
+
labels.turnSummary,
|
|
23316
|
+
labels.userMessageLocator
|
|
23729
23317
|
]
|
|
23730
23318
|
);
|
|
23731
23319
|
const conversationFlowEmpty = useMemo10(
|
|
@@ -24048,7 +23636,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24048
23636
|
labels.stopping
|
|
24049
23637
|
]
|
|
24050
23638
|
);
|
|
24051
|
-
const handleInterruptCurrentTurn =
|
|
23639
|
+
const handleInterruptCurrentTurn = useCallback10(() => {
|
|
24052
23640
|
actions.interruptCurrentTurn(labels.noRunningResponse);
|
|
24053
23641
|
}, [actions.interruptCurrentTurn, labels.noRunningResponse]);
|
|
24054
23642
|
const submitApprovalOption = useStableEventCallback2(
|
|
@@ -24069,6 +23657,28 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24069
23657
|
const submitGuidancePrompt = useStableEventCallback2(
|
|
24070
23658
|
actions.submitGuidancePrompt
|
|
24071
23659
|
);
|
|
23660
|
+
const requestSubmittedPromptScrollToBottom = useCallback10(() => {
|
|
23661
|
+
const activeConversationId = viewModel.activeConversationId;
|
|
23662
|
+
if (!activeConversationId) {
|
|
23663
|
+
return;
|
|
23664
|
+
}
|
|
23665
|
+
submittedPromptScrollConversationRef.current = activeConversationId;
|
|
23666
|
+
pendingPrependScrollAnchorRef.current = null;
|
|
23667
|
+
}, [viewModel.activeConversationId]);
|
|
23668
|
+
const submitPromptAndScrollToBottom = useCallback10(
|
|
23669
|
+
(content, displayPrompt) => {
|
|
23670
|
+
requestSubmittedPromptScrollToBottom();
|
|
23671
|
+
submitPrompt(content, displayPrompt);
|
|
23672
|
+
},
|
|
23673
|
+
[requestSubmittedPromptScrollToBottom, submitPrompt]
|
|
23674
|
+
);
|
|
23675
|
+
const submitGuidancePromptAndScrollToBottom = useCallback10(
|
|
23676
|
+
(content, displayPrompt) => {
|
|
23677
|
+
requestSubmittedPromptScrollToBottom();
|
|
23678
|
+
submitGuidancePrompt(content, displayPrompt);
|
|
23679
|
+
},
|
|
23680
|
+
[requestSubmittedPromptScrollToBottom, submitGuidancePrompt]
|
|
23681
|
+
);
|
|
24072
23682
|
const showPromptImagesUnsupported = useStableEventCallback2(
|
|
24073
23683
|
actions.showPromptImagesUnsupported
|
|
24074
23684
|
);
|
|
@@ -24089,7 +23699,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24089
23699
|
);
|
|
24090
23700
|
const stableRequestGitBranches = useOptionalStableEventCallback(onRequestGitBranches);
|
|
24091
23701
|
const authLogin = useOptionalStableEventCallback(onAgentProviderLogin);
|
|
24092
|
-
const submitBottomDockInteractivePrompt =
|
|
23702
|
+
const submitBottomDockInteractivePrompt = useCallback10(
|
|
24093
23703
|
(input) => {
|
|
24094
23704
|
submitInteractivePrompt(input);
|
|
24095
23705
|
setBottomDockDismissedPromptRequestId(input.requestId);
|
|
@@ -24138,8 +23748,8 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24138
23748
|
onDraftContentChange: updateDraftContent,
|
|
24139
23749
|
onProjectPathChange: updateSelectedProjectPath,
|
|
24140
23750
|
onSettingsChange: updateComposerSettings,
|
|
24141
|
-
onSubmit:
|
|
24142
|
-
onSubmitGuidance:
|
|
23751
|
+
onSubmit: submitPromptAndScrollToBottom,
|
|
23752
|
+
onSubmitGuidance: submitGuidancePromptAndScrollToBottom,
|
|
24143
23753
|
onPromptImagesUnsupported: showPromptImagesUnsupported,
|
|
24144
23754
|
onSendQueuedPromptNext: sendQueuedPromptNext,
|
|
24145
23755
|
onRemoveQueuedPrompt: removeQueuedPrompt,
|
|
@@ -24180,8 +23790,8 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24180
23790
|
slashStatus,
|
|
24181
23791
|
submitDisabled,
|
|
24182
23792
|
submitInteractivePrompt,
|
|
24183
|
-
|
|
24184
|
-
|
|
23793
|
+
submitPromptAndScrollToBottom,
|
|
23794
|
+
submitGuidancePromptAndScrollToBottom,
|
|
24185
23795
|
uiLanguage,
|
|
24186
23796
|
stableLinkAction,
|
|
24187
23797
|
stableRequestGitBranches,
|
|
@@ -24236,7 +23846,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24236
23846
|
viewModel.isRespondingApproval
|
|
24237
23847
|
]
|
|
24238
23848
|
);
|
|
24239
|
-
const bottomDockStoreRef =
|
|
23849
|
+
const bottomDockStoreRef = useRef12(null);
|
|
24240
23850
|
if (bottomDockStoreRef.current === null) {
|
|
24241
23851
|
bottomDockStoreRef.current = createAgentGUIBottomDockStore(bottomDockStoreState);
|
|
24242
23852
|
}
|
|
@@ -24256,7 +23866,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24256
23866
|
useEffect12(() => {
|
|
24257
23867
|
setBottomDockDismissedPromptRequestId(null);
|
|
24258
23868
|
}, [activePromptRequestId]);
|
|
24259
|
-
|
|
23869
|
+
useLayoutEffect4(() => {
|
|
24260
23870
|
const timeline = timelineRef.current;
|
|
24261
23871
|
if (!timeline) {
|
|
24262
23872
|
return;
|
|
@@ -24265,6 +23875,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24265
23875
|
if (!activeConversationId) {
|
|
24266
23876
|
timelineScrollAnchorRef.current = null;
|
|
24267
23877
|
pendingPrependScrollAnchorRef.current = null;
|
|
23878
|
+
submittedPromptScrollConversationRef.current = null;
|
|
24268
23879
|
setIsTimelineScrolledToTop(true);
|
|
24269
23880
|
return;
|
|
24270
23881
|
}
|
|
@@ -24274,10 +23885,15 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24274
23885
|
);
|
|
24275
23886
|
const anchor = timelineScrollAnchorRef.current;
|
|
24276
23887
|
const prependAnchor = pendingPrependScrollAnchorRef.current;
|
|
23888
|
+
const shouldScrollSubmittedPromptToBottom = submittedPromptScrollConversationRef.current === activeConversationId;
|
|
24277
23889
|
let nextScrollTop = timeline.scrollTop;
|
|
24278
|
-
if (!anchor || anchor.conversationId !== activeConversationId) {
|
|
24279
|
-
timeline
|
|
23890
|
+
if (!anchor || anchor.conversationId !== activeConversationId || shouldScrollSubmittedPromptToBottom) {
|
|
23891
|
+
setTimelineScrollTopInstantly(timeline, maxScrollTop);
|
|
24280
23892
|
nextScrollTop = maxScrollTop;
|
|
23893
|
+
submittedPromptScrollConversationRef.current = null;
|
|
23894
|
+
if (shouldScrollSubmittedPromptToBottom) {
|
|
23895
|
+
pendingPrependScrollAnchorRef.current = null;
|
|
23896
|
+
}
|
|
24281
23897
|
} else if (prependAnchor?.conversationId === activeConversationId) {
|
|
24282
23898
|
const nextScrollHeight = timeline.scrollHeight;
|
|
24283
23899
|
const delta = nextScrollHeight - prependAnchor.scrollHeight;
|
|
@@ -24317,7 +23933,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24317
23933
|
viewModel.activeConversationId,
|
|
24318
23934
|
viewModel.isLoadingOlderMessages
|
|
24319
23935
|
]);
|
|
24320
|
-
|
|
23936
|
+
useLayoutEffect4(() => {
|
|
24321
23937
|
const timeline = timelineRef.current;
|
|
24322
23938
|
const bottomDock = bottomDockRef.current;
|
|
24323
23939
|
const activeConversationId = viewModel.activeConversationId;
|
|
@@ -24621,15 +24237,15 @@ function AgentRunPathInfo({
|
|
|
24621
24237
|
] });
|
|
24622
24238
|
}
|
|
24623
24239
|
function useStableEventCallback2(callback) {
|
|
24624
|
-
const callbackRef =
|
|
24625
|
-
|
|
24240
|
+
const callbackRef = useRef12(callback);
|
|
24241
|
+
useLayoutEffect4(() => {
|
|
24626
24242
|
callbackRef.current = callback;
|
|
24627
24243
|
}, [callback]);
|
|
24628
|
-
return
|
|
24244
|
+
return useCallback10((...args) => callbackRef.current(...args), []);
|
|
24629
24245
|
}
|
|
24630
24246
|
function useOptionalStableEventCallback(callback) {
|
|
24631
|
-
const callbackRef =
|
|
24632
|
-
|
|
24247
|
+
const callbackRef = useRef12(callback);
|
|
24248
|
+
useLayoutEffect4(() => {
|
|
24633
24249
|
callbackRef.current = callback;
|
|
24634
24250
|
}, [callback]);
|
|
24635
24251
|
return useMemo10(() => {
|
|
@@ -24827,9 +24443,11 @@ function agentGUIConversationRailStoreSnapshotsEqual(current, next) {
|
|
|
24827
24443
|
var AgentGUIConversationRailStorePane = memo(
|
|
24828
24444
|
function AgentGUIConversationRailStorePane2({
|
|
24829
24445
|
conversations,
|
|
24446
|
+
provider,
|
|
24830
24447
|
store,
|
|
24831
24448
|
storeState: _storeState,
|
|
24832
|
-
userProjects
|
|
24449
|
+
userProjects,
|
|
24450
|
+
workspaceId
|
|
24833
24451
|
}) {
|
|
24834
24452
|
"use memo";
|
|
24835
24453
|
const state = useSnapshot(store);
|
|
@@ -24838,7 +24456,9 @@ var AgentGUIConversationRailStorePane = memo(
|
|
|
24838
24456
|
{
|
|
24839
24457
|
...state,
|
|
24840
24458
|
conversations,
|
|
24841
|
-
|
|
24459
|
+
provider,
|
|
24460
|
+
userProjects,
|
|
24461
|
+
workspaceId
|
|
24842
24462
|
}
|
|
24843
24463
|
);
|
|
24844
24464
|
}
|
|
@@ -24850,6 +24470,47 @@ function normalizeConversationRailProjectPath(path) {
|
|
|
24850
24470
|
}
|
|
24851
24471
|
return normalized.replace(/\/+$/, "") || "/";
|
|
24852
24472
|
}
|
|
24473
|
+
function buildRailSessionGroupProjects({
|
|
24474
|
+
groups,
|
|
24475
|
+
userProjects
|
|
24476
|
+
}) {
|
|
24477
|
+
const userProjectByPath = new Map(
|
|
24478
|
+
userProjects.map((project) => [
|
|
24479
|
+
normalizeConversationRailProjectPath(project.path),
|
|
24480
|
+
project
|
|
24481
|
+
])
|
|
24482
|
+
);
|
|
24483
|
+
const groupProjectPaths = /* @__PURE__ */ new Set();
|
|
24484
|
+
const groupProjects = [];
|
|
24485
|
+
for (const group of groups) {
|
|
24486
|
+
const normalizedPath = normalizeConversationRailProjectPath(group.cwd);
|
|
24487
|
+
if (!normalizedPath || groupProjectPaths.has(normalizedPath)) {
|
|
24488
|
+
continue;
|
|
24489
|
+
}
|
|
24490
|
+
groupProjectPaths.add(normalizedPath);
|
|
24491
|
+
const existingProject = userProjectByPath.get(normalizedPath);
|
|
24492
|
+
groupProjects.push({
|
|
24493
|
+
...existingProject ?? {
|
|
24494
|
+
id: `agent-session-group:${normalizedPath}`,
|
|
24495
|
+
label: labelFromProjectPath(normalizedPath),
|
|
24496
|
+
path: group.cwd
|
|
24497
|
+
},
|
|
24498
|
+
lastUsedAtUnixMs: group.latestSessionUpdatedAtUnixMs,
|
|
24499
|
+
updatedAtUnixMs: group.latestSessionUpdatedAtUnixMs
|
|
24500
|
+
});
|
|
24501
|
+
}
|
|
24502
|
+
const emptyUserProjects = userProjects.filter(
|
|
24503
|
+
(project) => !groupProjectPaths.has(normalizeConversationRailProjectPath(project.path))
|
|
24504
|
+
);
|
|
24505
|
+
return [...groupProjects, ...emptyUserProjects];
|
|
24506
|
+
}
|
|
24507
|
+
function labelFromProjectPath(path) {
|
|
24508
|
+
const normalized = normalizeConversationRailProjectPath(path);
|
|
24509
|
+
if (!normalized || normalized === "/") {
|
|
24510
|
+
return path || "/";
|
|
24511
|
+
}
|
|
24512
|
+
return normalized.split("/").filter(Boolean).at(-1) ?? normalized;
|
|
24513
|
+
}
|
|
24853
24514
|
function stabilizeConversationSections(previous, next) {
|
|
24854
24515
|
if (!previous) {
|
|
24855
24516
|
return [...next];
|
|
@@ -24883,6 +24544,37 @@ function stabilizeConversationSections(previous, next) {
|
|
|
24883
24544
|
});
|
|
24884
24545
|
return changed ? stable : previous;
|
|
24885
24546
|
}
|
|
24547
|
+
function mergeRefreshedRailSessionGroups(current, refreshed) {
|
|
24548
|
+
const currentByCwd = new Map(current.map((group) => [group.cwd, group]));
|
|
24549
|
+
return refreshed.map((group) => {
|
|
24550
|
+
const existing = currentByCwd.get(group.cwd);
|
|
24551
|
+
if (!existing || existing.sessions.length <= group.sessions.length) {
|
|
24552
|
+
return group;
|
|
24553
|
+
}
|
|
24554
|
+
const sessionIds = new Set(
|
|
24555
|
+
group.sessions.map((session) => session.agentSessionId)
|
|
24556
|
+
);
|
|
24557
|
+
const sessions = [...group.sessions];
|
|
24558
|
+
for (const session of existing.sessions) {
|
|
24559
|
+
if (sessions.length >= group.sessionCount) {
|
|
24560
|
+
break;
|
|
24561
|
+
}
|
|
24562
|
+
if (sessionIds.has(session.agentSessionId)) {
|
|
24563
|
+
continue;
|
|
24564
|
+
}
|
|
24565
|
+
sessionIds.add(session.agentSessionId);
|
|
24566
|
+
sessions.push(session);
|
|
24567
|
+
}
|
|
24568
|
+
const preservedLoadedPages = sessions.length > group.sessions.length;
|
|
24569
|
+
const hasMore = preservedLoadedPages ? existing.hasMore && sessions.length < group.sessionCount : group.hasMore;
|
|
24570
|
+
return {
|
|
24571
|
+
...group,
|
|
24572
|
+
hasMore,
|
|
24573
|
+
nextCursor: hasMore ? preservedLoadedPages ? existing.nextCursor : group.nextCursor : void 0,
|
|
24574
|
+
sessions
|
|
24575
|
+
};
|
|
24576
|
+
});
|
|
24577
|
+
}
|
|
24886
24578
|
function stabilizeConversationSectionItems(previous, next) {
|
|
24887
24579
|
if (previous.length !== next.length) {
|
|
24888
24580
|
const previousById = /* @__PURE__ */ new Map();
|
|
@@ -24922,6 +24614,8 @@ function conversationProjectsRenderEqual2(left, right) {
|
|
|
24922
24614
|
var AgentGUIConversationRailPane = memo(
|
|
24923
24615
|
function AgentGUIConversationRailPane2({
|
|
24924
24616
|
conversations,
|
|
24617
|
+
provider,
|
|
24618
|
+
workspaceId,
|
|
24925
24619
|
userProjects,
|
|
24926
24620
|
activeConversationId,
|
|
24927
24621
|
pendingDeleteConversationId,
|
|
@@ -24952,16 +24646,31 @@ var AgentGUIConversationRailPane = memo(
|
|
|
24952
24646
|
onConfirmDeleteConversation
|
|
24953
24647
|
}) {
|
|
24954
24648
|
"use memo";
|
|
24955
|
-
const
|
|
24956
|
-
const [
|
|
24957
|
-
const [
|
|
24958
|
-
const [
|
|
24959
|
-
const
|
|
24960
|
-
const
|
|
24961
|
-
|
|
24649
|
+
const agentActivityRuntime = useAgentActivityRuntime();
|
|
24650
|
+
const [conversationQuery, setConversationQuery] = useState11("");
|
|
24651
|
+
const [searchConversations, setSearchConversations] = useState11([]);
|
|
24652
|
+
const [searchConversationQuery, setSearchConversationQuery] = useState11("");
|
|
24653
|
+
const [searchHasMore, setSearchHasMore] = useState11(false);
|
|
24654
|
+
const [searchNextCursor, setSearchNextCursor] = useState11(
|
|
24655
|
+
null
|
|
24656
|
+
);
|
|
24657
|
+
const [
|
|
24658
|
+
isLoadingMoreSearchConversations,
|
|
24659
|
+
setIsLoadingMoreSearchConversations
|
|
24660
|
+
] = useState11(false);
|
|
24661
|
+
const [railSessionGroups, setRailSessionGroups] = useState11([]);
|
|
24662
|
+
const [activeConversationOverlay, setActiveConversationOverlay] = useState11(null);
|
|
24663
|
+
const [loadingMoreSectionIds, setLoadingMoreSectionIds] = useState11(() => /* @__PURE__ */ new Set());
|
|
24664
|
+
const [collapsedProjectSectionIds, setCollapsedProjectSectionIds] = useState11(() => /* @__PURE__ */ new Set());
|
|
24665
|
+
const [currentTimeMs, setCurrentTimeMs] = useState11(() => Date.now());
|
|
24666
|
+
const [pendingProjectAction, setPendingProjectAction] = useState11(null);
|
|
24667
|
+
const railElementRef = useRef12(null);
|
|
24668
|
+
const conversationListRef = useRef12(null);
|
|
24669
|
+
const conversationItemElementsRef = useRef12(
|
|
24962
24670
|
/* @__PURE__ */ new Map()
|
|
24963
24671
|
);
|
|
24964
|
-
const groupedConversationsRef =
|
|
24672
|
+
const groupedConversationsRef = useRef12(null);
|
|
24673
|
+
const wasDeletingConversationRef = useRef12(false);
|
|
24965
24674
|
useEffect12(() => {
|
|
24966
24675
|
const timer = window.setInterval(() => {
|
|
24967
24676
|
setCurrentTimeMs(Date.now());
|
|
@@ -24970,25 +24679,217 @@ var AgentGUIConversationRailPane = memo(
|
|
|
24970
24679
|
window.clearInterval(timer);
|
|
24971
24680
|
};
|
|
24972
24681
|
}, []);
|
|
24682
|
+
const trimmedConversationQuery = conversationQuery.trim();
|
|
24683
|
+
const hasConversationQuery = trimmedConversationQuery.length > 0;
|
|
24684
|
+
const hasRuntimeGroupSource = !previewMode && Boolean(agentActivityRuntime.listSessionGroups);
|
|
24685
|
+
const conversationIdentityKey = useMemo10(
|
|
24686
|
+
() => conversations.map((conversation) => conversation.id).join("|"),
|
|
24687
|
+
[conversations]
|
|
24688
|
+
);
|
|
24689
|
+
const railSessionGroupProjects = useMemo10(
|
|
24690
|
+
() => buildRailSessionGroupProjects({
|
|
24691
|
+
groups: railSessionGroups,
|
|
24692
|
+
userProjects
|
|
24693
|
+
}),
|
|
24694
|
+
[railSessionGroups, userProjects]
|
|
24695
|
+
);
|
|
24696
|
+
const defaultRailGroupConversations = useMemo10(() => {
|
|
24697
|
+
const freshConversationById = new Map(
|
|
24698
|
+
conversations.map((conversation) => [conversation.id, conversation])
|
|
24699
|
+
);
|
|
24700
|
+
return buildAgentGUIConversationSummaries({
|
|
24701
|
+
provider,
|
|
24702
|
+
snapshot: {
|
|
24703
|
+
composerOptionsByProvider: {},
|
|
24704
|
+
presences: [],
|
|
24705
|
+
sessionMessagesById: {},
|
|
24706
|
+
sessions: railSessionGroups.flatMap((group) => group.sessions),
|
|
24707
|
+
workspaceId
|
|
24708
|
+
},
|
|
24709
|
+
userProjects: railSessionGroupProjects
|
|
24710
|
+
}).map(
|
|
24711
|
+
(conversation) => freshConversationById.get(conversation.id) ?? conversation
|
|
24712
|
+
);
|
|
24713
|
+
}, [
|
|
24714
|
+
conversations,
|
|
24715
|
+
provider,
|
|
24716
|
+
railSessionGroupProjects,
|
|
24717
|
+
railSessionGroups,
|
|
24718
|
+
workspaceId
|
|
24719
|
+
]);
|
|
24720
|
+
const defaultRailSourceConversations = useMemo10(() => {
|
|
24721
|
+
const source = hasRuntimeGroupSource ? defaultRailGroupConversations : conversations;
|
|
24722
|
+
if (!activeConversationOverlay || source.some((item) => item.id === activeConversationOverlay.id)) {
|
|
24723
|
+
return source;
|
|
24724
|
+
}
|
|
24725
|
+
return [...source, activeConversationOverlay];
|
|
24726
|
+
}, [
|
|
24727
|
+
activeConversationOverlay,
|
|
24728
|
+
conversations,
|
|
24729
|
+
defaultRailGroupConversations,
|
|
24730
|
+
hasRuntimeGroupSource
|
|
24731
|
+
]);
|
|
24732
|
+
const effectiveSearchConversations = searchConversationQuery === trimmedConversationQuery ? searchConversations : [];
|
|
24733
|
+
const railSourceConversations = hasConversationQuery ? effectiveSearchConversations : defaultRailSourceConversations;
|
|
24734
|
+
const runtimeSearchSessions = agentActivityRuntime.searchSessions;
|
|
24735
|
+
useEffect12(() => {
|
|
24736
|
+
if (!activeConversationOverlay || activeConversationOverlay.id !== activeConversationId) {
|
|
24737
|
+
return;
|
|
24738
|
+
}
|
|
24739
|
+
if (defaultRailGroupConversations.some(
|
|
24740
|
+
(item) => item.id === activeConversationOverlay.id
|
|
24741
|
+
)) {
|
|
24742
|
+
setActiveConversationOverlay(null);
|
|
24743
|
+
}
|
|
24744
|
+
}, [
|
|
24745
|
+
activeConversationId,
|
|
24746
|
+
activeConversationOverlay,
|
|
24747
|
+
defaultRailGroupConversations
|
|
24748
|
+
]);
|
|
24749
|
+
useEffect12(() => {
|
|
24750
|
+
if (!hasConversationQuery) {
|
|
24751
|
+
setSearchConversationQuery("");
|
|
24752
|
+
setSearchConversations([]);
|
|
24753
|
+
setSearchHasMore(false);
|
|
24754
|
+
setSearchNextCursor(null);
|
|
24755
|
+
return;
|
|
24756
|
+
}
|
|
24757
|
+
if (!runtimeSearchSessions) {
|
|
24758
|
+
return;
|
|
24759
|
+
}
|
|
24760
|
+
let disposed = false;
|
|
24761
|
+
const timer = window.setTimeout(() => {
|
|
24762
|
+
void runtimeSearchSessions({
|
|
24763
|
+
limit: 100,
|
|
24764
|
+
query: trimmedConversationQuery,
|
|
24765
|
+
workspaceId
|
|
24766
|
+
}).then((result) => {
|
|
24767
|
+
if (disposed) {
|
|
24768
|
+
return;
|
|
24769
|
+
}
|
|
24770
|
+
setSearchConversationQuery(trimmedConversationQuery);
|
|
24771
|
+
setSearchConversations(
|
|
24772
|
+
buildAgentGUIConversationSummaries({
|
|
24773
|
+
provider,
|
|
24774
|
+
snapshot: {
|
|
24775
|
+
composerOptionsByProvider: {},
|
|
24776
|
+
presences: [],
|
|
24777
|
+
sessionMessagesById: {},
|
|
24778
|
+
sessions: result.sessions,
|
|
24779
|
+
workspaceId: result.workspaceId
|
|
24780
|
+
},
|
|
24781
|
+
userProjects
|
|
24782
|
+
})
|
|
24783
|
+
);
|
|
24784
|
+
setSearchHasMore(result.hasMore);
|
|
24785
|
+
setSearchNextCursor(result.nextCursor ?? null);
|
|
24786
|
+
}).catch(() => {
|
|
24787
|
+
if (!disposed) {
|
|
24788
|
+
setSearchConversationQuery(trimmedConversationQuery);
|
|
24789
|
+
setSearchConversations([]);
|
|
24790
|
+
setSearchHasMore(false);
|
|
24791
|
+
setSearchNextCursor(null);
|
|
24792
|
+
}
|
|
24793
|
+
});
|
|
24794
|
+
}, 150);
|
|
24795
|
+
return () => {
|
|
24796
|
+
disposed = true;
|
|
24797
|
+
window.clearTimeout(timer);
|
|
24798
|
+
};
|
|
24799
|
+
}, [
|
|
24800
|
+
hasConversationQuery,
|
|
24801
|
+
provider,
|
|
24802
|
+
runtimeSearchSessions,
|
|
24803
|
+
trimmedConversationQuery,
|
|
24804
|
+
userProjects,
|
|
24805
|
+
workspaceId
|
|
24806
|
+
]);
|
|
24807
|
+
useEffect12(() => {
|
|
24808
|
+
if (!hasConversationQuery || runtimeSearchSessions) {
|
|
24809
|
+
return;
|
|
24810
|
+
}
|
|
24811
|
+
setSearchConversationQuery(trimmedConversationQuery);
|
|
24812
|
+
setSearchConversations(
|
|
24813
|
+
conversations.filter(
|
|
24814
|
+
(candidate) => conversationPlainTitle(candidate, labels, uiLanguage).toLowerCase().includes(trimmedConversationQuery.toLowerCase())
|
|
24815
|
+
)
|
|
24816
|
+
);
|
|
24817
|
+
setSearchHasMore(false);
|
|
24818
|
+
setSearchNextCursor(null);
|
|
24819
|
+
}, [
|
|
24820
|
+
conversations,
|
|
24821
|
+
hasConversationQuery,
|
|
24822
|
+
labels,
|
|
24823
|
+
runtimeSearchSessions,
|
|
24824
|
+
trimmedConversationQuery,
|
|
24825
|
+
uiLanguage
|
|
24826
|
+
]);
|
|
24827
|
+
useEffect12(() => {
|
|
24828
|
+
if (!agentActivityRuntime.listSessionGroups || previewMode) {
|
|
24829
|
+
setRailSessionGroups([]);
|
|
24830
|
+
return;
|
|
24831
|
+
}
|
|
24832
|
+
let disposed = false;
|
|
24833
|
+
const isDeletingNow = isDeletingConversation || isDeletingProjectConversations;
|
|
24834
|
+
const resetLoadedGroups = wasDeletingConversationRef.current && !isDeletingNow;
|
|
24835
|
+
wasDeletingConversationRef.current = isDeletingNow;
|
|
24836
|
+
void agentActivityRuntime.listSessionGroups({
|
|
24837
|
+
sessionLimit: AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE,
|
|
24838
|
+
visibleOnly: true,
|
|
24839
|
+
workspaceId
|
|
24840
|
+
}).then((result) => {
|
|
24841
|
+
if (!disposed) {
|
|
24842
|
+
setRailSessionGroups(
|
|
24843
|
+
(current) => resetLoadedGroups ? result.groups : mergeRefreshedRailSessionGroups(current, result.groups)
|
|
24844
|
+
);
|
|
24845
|
+
}
|
|
24846
|
+
}).catch(() => {
|
|
24847
|
+
if (!disposed) {
|
|
24848
|
+
setRailSessionGroups([]);
|
|
24849
|
+
}
|
|
24850
|
+
});
|
|
24851
|
+
return () => {
|
|
24852
|
+
disposed = true;
|
|
24853
|
+
};
|
|
24854
|
+
}, [
|
|
24855
|
+
agentActivityRuntime,
|
|
24856
|
+
conversationIdentityKey,
|
|
24857
|
+
isDeletingConversation,
|
|
24858
|
+
isDeletingProjectConversations,
|
|
24859
|
+
previewMode,
|
|
24860
|
+
workspaceId
|
|
24861
|
+
]);
|
|
24862
|
+
const groupingProjects = hasConversationQuery ? [] : hasRuntimeGroupSource ? railSessionGroupProjects : userProjects;
|
|
24863
|
+
const showEmptyConversationSection = useMemo10(
|
|
24864
|
+
() => !hasConversationQuery && (hasRuntimeGroupSource ? railSessionGroups.some((group) => !group.cwd.trim()) : !conversations.some(
|
|
24865
|
+
(conversation) => conversation.project == null
|
|
24866
|
+
)),
|
|
24867
|
+
[
|
|
24868
|
+
conversations,
|
|
24869
|
+
hasConversationQuery,
|
|
24870
|
+
hasRuntimeGroupSource,
|
|
24871
|
+
railSessionGroups
|
|
24872
|
+
]
|
|
24873
|
+
);
|
|
24973
24874
|
const filteredConversationResult = useMemo10(() => {
|
|
24974
24875
|
const startedAtMs = agentGuiPerfNowMs();
|
|
24975
|
-
const query =
|
|
24976
|
-
const items = !query ?
|
|
24876
|
+
const query = trimmedConversationQuery.toLowerCase();
|
|
24877
|
+
const items = !query ? railSourceConversations : railSourceConversations.filter(
|
|
24977
24878
|
(candidate) => conversationPlainTitle(candidate, labels, uiLanguage).toLowerCase().includes(query)
|
|
24978
24879
|
);
|
|
24979
24880
|
return {
|
|
24980
24881
|
items,
|
|
24981
24882
|
filterMs: roundAgentGuiPerfMs(agentGuiPerfNowMs() - startedAtMs)
|
|
24982
24883
|
};
|
|
24983
|
-
}, [
|
|
24884
|
+
}, [labels, railSourceConversations, trimmedConversationQuery, uiLanguage]);
|
|
24984
24885
|
const filteredConversations = filteredConversationResult.items;
|
|
24985
24886
|
const groupedConversationResult = useMemo10(() => {
|
|
24986
24887
|
const startedAtMs = agentGuiPerfNowMs();
|
|
24987
24888
|
const rawGroups = groupConversations(
|
|
24988
24889
|
filteredConversations,
|
|
24989
24890
|
labels,
|
|
24990
|
-
|
|
24991
|
-
{ includeEmptyConversations:
|
|
24891
|
+
groupingProjects,
|
|
24892
|
+
{ includeEmptyConversations: showEmptyConversationSection }
|
|
24992
24893
|
);
|
|
24993
24894
|
const groups = stabilizeConversationSections(
|
|
24994
24895
|
groupedConversationsRef.current,
|
|
@@ -24999,9 +24900,14 @@ var AgentGUIConversationRailPane = memo(
|
|
|
24999
24900
|
groups,
|
|
25000
24901
|
groupMs: roundAgentGuiPerfMs(agentGuiPerfNowMs() - startedAtMs)
|
|
25001
24902
|
};
|
|
25002
|
-
}, [
|
|
24903
|
+
}, [
|
|
24904
|
+
filteredConversations,
|
|
24905
|
+
groupingProjects,
|
|
24906
|
+
labels,
|
|
24907
|
+
showEmptyConversationSection
|
|
24908
|
+
]);
|
|
25003
24909
|
const groupedConversations = groupedConversationResult.groups;
|
|
25004
|
-
const toggleProjectSectionCollapsed =
|
|
24910
|
+
const toggleProjectSectionCollapsed = useCallback10((sectionId) => {
|
|
25005
24911
|
setCollapsedProjectSectionIds((current) => {
|
|
25006
24912
|
const next = new Set(current);
|
|
25007
24913
|
if (next.has(sectionId)) {
|
|
@@ -25020,18 +24926,141 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25020
24926
|
);
|
|
25021
24927
|
const projectConversationCountsByPath = useMemo10(() => {
|
|
25022
24928
|
const counts = /* @__PURE__ */ new Map();
|
|
24929
|
+
const pathsFromGroups = /* @__PURE__ */ new Set();
|
|
24930
|
+
for (const group of railSessionGroups) {
|
|
24931
|
+
const normalizedPath = normalizeConversationRailProjectPath(group.cwd);
|
|
24932
|
+
if (!normalizedPath) {
|
|
24933
|
+
continue;
|
|
24934
|
+
}
|
|
24935
|
+
counts.set(normalizedPath, group.sessionCount);
|
|
24936
|
+
pathsFromGroups.add(normalizedPath);
|
|
24937
|
+
}
|
|
25023
24938
|
for (const conversation of conversations) {
|
|
25024
24939
|
const normalizedPath = normalizeConversationRailProjectPath(
|
|
25025
24940
|
conversation.project?.path
|
|
25026
24941
|
);
|
|
25027
|
-
if (!normalizedPath) {
|
|
24942
|
+
if (!normalizedPath || pathsFromGroups.has(normalizedPath)) {
|
|
25028
24943
|
continue;
|
|
25029
24944
|
}
|
|
25030
24945
|
counts.set(normalizedPath, (counts.get(normalizedPath) ?? 0) + 1);
|
|
25031
24946
|
}
|
|
25032
24947
|
return counts;
|
|
25033
|
-
}, [conversations]);
|
|
25034
|
-
const
|
|
24948
|
+
}, [conversations, railSessionGroups]);
|
|
24949
|
+
const railSessionGroupBySectionId = useMemo10(() => {
|
|
24950
|
+
const groupsBySectionId = /* @__PURE__ */ new Map();
|
|
24951
|
+
for (const group of railSessionGroups) {
|
|
24952
|
+
const normalizedPath = normalizeConversationRailProjectPath(group.cwd);
|
|
24953
|
+
groupsBySectionId.set(
|
|
24954
|
+
normalizedPath ? `project:${normalizedPath}` : "conversations",
|
|
24955
|
+
group
|
|
24956
|
+
);
|
|
24957
|
+
}
|
|
24958
|
+
return groupsBySectionId;
|
|
24959
|
+
}, [railSessionGroups]);
|
|
24960
|
+
const loadMoreSectionConversations = useCallback10(
|
|
24961
|
+
(sectionId) => {
|
|
24962
|
+
const group = railSessionGroupBySectionId.get(sectionId);
|
|
24963
|
+
const listSessionsPage = agentActivityRuntime.listSessionsPage;
|
|
24964
|
+
if (!group?.hasMore || !group.nextCursor || !listSessionsPage) {
|
|
24965
|
+
return;
|
|
24966
|
+
}
|
|
24967
|
+
setLoadingMoreSectionIds((current) => {
|
|
24968
|
+
if (current.has(sectionId)) {
|
|
24969
|
+
return current;
|
|
24970
|
+
}
|
|
24971
|
+
const next = new Set(current);
|
|
24972
|
+
next.add(sectionId);
|
|
24973
|
+
return next;
|
|
24974
|
+
});
|
|
24975
|
+
void listSessionsPage({
|
|
24976
|
+
cursor: group.nextCursor,
|
|
24977
|
+
cwd: group.cwd,
|
|
24978
|
+
limit: AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE,
|
|
24979
|
+
visibleOnly: true,
|
|
24980
|
+
workspaceId
|
|
24981
|
+
}).then((page) => {
|
|
24982
|
+
setRailSessionGroups(
|
|
24983
|
+
(current) => current.map((candidate) => {
|
|
24984
|
+
if (candidate.cwd !== group.cwd) {
|
|
24985
|
+
return candidate;
|
|
24986
|
+
}
|
|
24987
|
+
const sessionIds = new Set(
|
|
24988
|
+
candidate.sessions.map((session) => session.agentSessionId)
|
|
24989
|
+
);
|
|
24990
|
+
const nextSessions = [...candidate.sessions];
|
|
24991
|
+
for (const session of page.sessions) {
|
|
24992
|
+
if (!sessionIds.has(session.agentSessionId)) {
|
|
24993
|
+
sessionIds.add(session.agentSessionId);
|
|
24994
|
+
nextSessions.push(session);
|
|
24995
|
+
}
|
|
24996
|
+
}
|
|
24997
|
+
return {
|
|
24998
|
+
...candidate,
|
|
24999
|
+
hasMore: page.hasMore,
|
|
25000
|
+
nextCursor: page.nextCursor,
|
|
25001
|
+
sessions: nextSessions
|
|
25002
|
+
};
|
|
25003
|
+
})
|
|
25004
|
+
);
|
|
25005
|
+
}).finally(() => {
|
|
25006
|
+
setLoadingMoreSectionIds((current) => {
|
|
25007
|
+
if (!current.has(sectionId)) {
|
|
25008
|
+
return current;
|
|
25009
|
+
}
|
|
25010
|
+
const next = new Set(current);
|
|
25011
|
+
next.delete(sectionId);
|
|
25012
|
+
return next;
|
|
25013
|
+
});
|
|
25014
|
+
});
|
|
25015
|
+
},
|
|
25016
|
+
[agentActivityRuntime, railSessionGroupBySectionId, workspaceId]
|
|
25017
|
+
);
|
|
25018
|
+
const loadMoreSearchConversations = useCallback10(() => {
|
|
25019
|
+
const searchSessions = agentActivityRuntime.searchSessions;
|
|
25020
|
+
if (!searchSessions || !searchHasMore || !searchNextCursor || isLoadingMoreSearchConversations) {
|
|
25021
|
+
return;
|
|
25022
|
+
}
|
|
25023
|
+
setIsLoadingMoreSearchConversations(true);
|
|
25024
|
+
void searchSessions({
|
|
25025
|
+
cursor: searchNextCursor,
|
|
25026
|
+
limit: 100,
|
|
25027
|
+
query: trimmedConversationQuery,
|
|
25028
|
+
workspaceId
|
|
25029
|
+
}).then((result) => {
|
|
25030
|
+
const nextConversations = buildAgentGUIConversationSummaries({
|
|
25031
|
+
provider,
|
|
25032
|
+
snapshot: {
|
|
25033
|
+
composerOptionsByProvider: {},
|
|
25034
|
+
presences: [],
|
|
25035
|
+
sessionMessagesById: {},
|
|
25036
|
+
sessions: result.sessions,
|
|
25037
|
+
workspaceId: result.workspaceId
|
|
25038
|
+
},
|
|
25039
|
+
userProjects
|
|
25040
|
+
});
|
|
25041
|
+
setSearchConversations((current) => {
|
|
25042
|
+
const currentIds = new Set(current.map((item) => item.id));
|
|
25043
|
+
return [
|
|
25044
|
+
...current,
|
|
25045
|
+
...nextConversations.filter((item) => !currentIds.has(item.id))
|
|
25046
|
+
];
|
|
25047
|
+
});
|
|
25048
|
+
setSearchHasMore(result.hasMore);
|
|
25049
|
+
setSearchNextCursor(result.nextCursor ?? null);
|
|
25050
|
+
}).finally(() => {
|
|
25051
|
+
setIsLoadingMoreSearchConversations(false);
|
|
25052
|
+
});
|
|
25053
|
+
}, [
|
|
25054
|
+
agentActivityRuntime,
|
|
25055
|
+
isLoadingMoreSearchConversations,
|
|
25056
|
+
provider,
|
|
25057
|
+
searchHasMore,
|
|
25058
|
+
searchNextCursor,
|
|
25059
|
+
trimmedConversationQuery,
|
|
25060
|
+
userProjects,
|
|
25061
|
+
workspaceId
|
|
25062
|
+
]);
|
|
25063
|
+
const registerConversationItemElement = useCallback10(
|
|
25035
25064
|
(itemId, element) => {
|
|
25036
25065
|
if (element) {
|
|
25037
25066
|
conversationItemElementsRef.current.set(itemId, element);
|
|
@@ -25041,7 +25070,47 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25041
25070
|
},
|
|
25042
25071
|
[]
|
|
25043
25072
|
);
|
|
25044
|
-
|
|
25073
|
+
const handleSelectConversation = useCallback10(
|
|
25074
|
+
(agentSessionId) => {
|
|
25075
|
+
const normalizedAgentSessionId = agentSessionId.trim();
|
|
25076
|
+
if (!normalizedAgentSessionId) {
|
|
25077
|
+
return;
|
|
25078
|
+
}
|
|
25079
|
+
const isLoadedConversation = conversations.some(
|
|
25080
|
+
(conversation) => conversation.id === normalizedAgentSessionId
|
|
25081
|
+
);
|
|
25082
|
+
if (!hasConversationQuery || isLoadedConversation) {
|
|
25083
|
+
onSelectConversation(normalizedAgentSessionId);
|
|
25084
|
+
return;
|
|
25085
|
+
}
|
|
25086
|
+
void agentActivityRuntime.getSession(workspaceId, normalizedAgentSessionId).then((session) => {
|
|
25087
|
+
const [overlay] = buildAgentGUIConversationSummaries({
|
|
25088
|
+
provider,
|
|
25089
|
+
snapshot: {
|
|
25090
|
+
composerOptionsByProvider: {},
|
|
25091
|
+
presences: [],
|
|
25092
|
+
sessionMessagesById: {},
|
|
25093
|
+
sessions: [session],
|
|
25094
|
+
workspaceId
|
|
25095
|
+
},
|
|
25096
|
+
userProjects: railSessionGroupProjects
|
|
25097
|
+
});
|
|
25098
|
+
setActiveConversationOverlay(overlay ?? null);
|
|
25099
|
+
onSelectConversation(normalizedAgentSessionId);
|
|
25100
|
+
}).catch(() => {
|
|
25101
|
+
});
|
|
25102
|
+
},
|
|
25103
|
+
[
|
|
25104
|
+
agentActivityRuntime,
|
|
25105
|
+
conversations,
|
|
25106
|
+
hasConversationQuery,
|
|
25107
|
+
onSelectConversation,
|
|
25108
|
+
provider,
|
|
25109
|
+
railSessionGroupProjects,
|
|
25110
|
+
workspaceId
|
|
25111
|
+
]
|
|
25112
|
+
);
|
|
25113
|
+
useLayoutEffect4(() => {
|
|
25045
25114
|
if (!activeConversationId) {
|
|
25046
25115
|
return;
|
|
25047
25116
|
}
|
|
@@ -25123,6 +25192,9 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25123
25192
|
const showProjectRailHeader = !conversationQuery.trim() && section.kind !== "pinned" && (sectionIndex === 0 || groupedConversations[sectionIndex - 1]?.kind === "pinned");
|
|
25124
25193
|
const isSectionCollapsed = isProjectSection && collapsedProjectSectionIds.has(section.id);
|
|
25125
25194
|
const projectConversationCount = normalizedProjectPath ? projectConversationCountsByPath.get(normalizedProjectPath) ?? 0 : 0;
|
|
25195
|
+
const sectionSessionGroup = railSessionGroupBySectionId.get(
|
|
25196
|
+
section.id
|
|
25197
|
+
);
|
|
25126
25198
|
return /* @__PURE__ */ jsxs17(Fragment7, { children: [
|
|
25127
25199
|
showProjectRailHeader ? /* @__PURE__ */ jsx31(
|
|
25128
25200
|
AgentGUIProjectRailHeader,
|
|
@@ -25139,11 +25211,13 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25139
25211
|
createConversationDisabled,
|
|
25140
25212
|
currentTimeMs,
|
|
25141
25213
|
isDeletingConversation,
|
|
25214
|
+
isLoadingMoreConversations: hasConversationQuery ? isLoadingMoreSearchConversations : loadingMoreSectionIds.has(section.id),
|
|
25142
25215
|
isSectionCollapsed,
|
|
25143
25216
|
labels,
|
|
25144
25217
|
pendingDeleteConversationId,
|
|
25145
25218
|
previewMode,
|
|
25146
25219
|
projectConversationCount,
|
|
25220
|
+
sectionHasMore: hasConversationQuery ? searchHasMore : Boolean(sectionSessionGroup?.hasMore),
|
|
25147
25221
|
projectLabel,
|
|
25148
25222
|
projectPath,
|
|
25149
25223
|
registerItemElement: registerConversationItemElement,
|
|
@@ -25153,11 +25227,12 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25153
25227
|
onConfirmDeleteConversation,
|
|
25154
25228
|
onCreateConversation,
|
|
25155
25229
|
onRequestDeleteConversation,
|
|
25156
|
-
onSelectConversation,
|
|
25230
|
+
onSelectConversation: handleSelectConversation,
|
|
25157
25231
|
setPendingProjectAction,
|
|
25158
25232
|
onToggleConversationPinned,
|
|
25159
25233
|
onOpenProjectFiles,
|
|
25160
25234
|
onOpenConversationWindow,
|
|
25235
|
+
onLoadMoreConversations: hasConversationQuery ? loadMoreSearchConversations : loadMoreSectionConversations,
|
|
25161
25236
|
onToggleProjectSectionCollapsed: toggleProjectSectionCollapsed
|
|
25162
25237
|
}
|
|
25163
25238
|
)
|
|
@@ -25215,7 +25290,7 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25215
25290
|
{
|
|
25216
25291
|
type: "button",
|
|
25217
25292
|
"data-testid": "agent-gui-config-env-setup",
|
|
25218
|
-
className: "nodrag -mx-1 flex w-[calc(100%+0.5rem)] items-center gap-2 rounded-[6px] px-2 py-1 text-[13px] text-
|
|
25293
|
+
className: "nodrag -mx-1 flex w-[calc(100%+0.5rem)] items-center gap-2 rounded-[6px] px-2 py-1 text-[13px] text-[var(--text-primary)] transition-colors hover:bg-[var(--transparency-hover)] hover:text-[var(--text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--border-focus)] disabled:text-[var(--text-tertiary)] [-webkit-app-region:no-drag]",
|
|
25219
25294
|
disabled: previewMode,
|
|
25220
25295
|
onClick: () => onOpenAgentEnvSetup(),
|
|
25221
25296
|
children: [
|
|
@@ -25287,6 +25362,8 @@ var AgentGUIConversationRailSection = memo(
|
|
|
25287
25362
|
pendingDeleteConversationId,
|
|
25288
25363
|
previewMode,
|
|
25289
25364
|
isDeletingConversation,
|
|
25365
|
+
isLoadingMoreConversations,
|
|
25366
|
+
sectionHasMore,
|
|
25290
25367
|
createConversationDisabled,
|
|
25291
25368
|
currentTimeMs,
|
|
25292
25369
|
labels,
|
|
@@ -25295,6 +25372,7 @@ var AgentGUIConversationRailSection = memo(
|
|
|
25295
25372
|
onCreateConversation,
|
|
25296
25373
|
onToggleProjectSectionCollapsed,
|
|
25297
25374
|
onSelectConversation,
|
|
25375
|
+
onLoadMoreConversations,
|
|
25298
25376
|
setPendingProjectAction,
|
|
25299
25377
|
onToggleConversationPinned,
|
|
25300
25378
|
onOpenProjectFiles,
|
|
@@ -25305,27 +25383,40 @@ var AgentGUIConversationRailSection = memo(
|
|
|
25305
25383
|
}) {
|
|
25306
25384
|
"use memo";
|
|
25307
25385
|
const isProjectSection = section.kind === "project";
|
|
25308
|
-
const [visibleItemLimit, setVisibleItemLimit] =
|
|
25386
|
+
const [visibleItemLimit, setVisibleItemLimit] = useState11(
|
|
25309
25387
|
AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE
|
|
25310
25388
|
);
|
|
25311
25389
|
const visibleItemCount = isSectionCollapsed ? 0 : Math.min(visibleItemLimit, section.items.length);
|
|
25312
25390
|
const visibleItems = isSectionCollapsed ? [] : section.items.slice(0, visibleItemCount);
|
|
25313
|
-
const canShowMore = !isSectionCollapsed && visibleItemCount < section.items.length;
|
|
25391
|
+
const canShowMore = !isSectionCollapsed && (visibleItemCount < section.items.length || sectionHasMore);
|
|
25314
25392
|
const canShowLess = !isSectionCollapsed && visibleItemCount > AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE;
|
|
25315
|
-
const showMoreConversations =
|
|
25393
|
+
const showMoreConversations = useCallback10(() => {
|
|
25394
|
+
if (visibleItemCount >= section.items.length && sectionHasMore) {
|
|
25395
|
+
onLoadMoreConversations(section.id);
|
|
25396
|
+
setVisibleItemLimit(
|
|
25397
|
+
(current) => current + AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE
|
|
25398
|
+
);
|
|
25399
|
+
return;
|
|
25400
|
+
}
|
|
25316
25401
|
setVisibleItemLimit(
|
|
25317
25402
|
(current) => Math.min(
|
|
25318
25403
|
section.items.length,
|
|
25319
25404
|
current + AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE
|
|
25320
25405
|
)
|
|
25321
25406
|
);
|
|
25322
|
-
}, [
|
|
25323
|
-
|
|
25407
|
+
}, [
|
|
25408
|
+
onLoadMoreConversations,
|
|
25409
|
+
section.id,
|
|
25410
|
+
section.items.length,
|
|
25411
|
+
sectionHasMore,
|
|
25412
|
+
visibleItemCount
|
|
25413
|
+
]);
|
|
25414
|
+
const showLessConversations = useCallback10(() => {
|
|
25324
25415
|
setVisibleItemLimit(AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE);
|
|
25325
25416
|
}, []);
|
|
25326
25417
|
const canCreateConversationFromSection = section.kind === "conversations" || Boolean(projectPath);
|
|
25327
25418
|
const createConversationLabel = projectPath ? labels.projectSectionEdit : labels.newConversation;
|
|
25328
|
-
const handleCreateConversation =
|
|
25419
|
+
const handleCreateConversation = useCallback10(() => {
|
|
25329
25420
|
if (projectPath) {
|
|
25330
25421
|
onCreateConversation({ projectPath, source: "project_section" });
|
|
25331
25422
|
return;
|
|
@@ -25612,6 +25703,7 @@ var AgentGUIConversationRailSection = memo(
|
|
|
25612
25703
|
{
|
|
25613
25704
|
type: "button",
|
|
25614
25705
|
className: AgentGUINode_styles_default.conversationSectionPaginationButton,
|
|
25706
|
+
disabled: isLoadingMoreConversations,
|
|
25615
25707
|
onClick: showMoreConversations,
|
|
25616
25708
|
children: labels.showMoreConversations
|
|
25617
25709
|
}
|
|
@@ -25654,27 +25746,27 @@ var AgentGUIConversationRailItem = memo(
|
|
|
25654
25746
|
}) {
|
|
25655
25747
|
"use memo";
|
|
25656
25748
|
const pinned = (item.pinnedAtUnixMs ?? 0) > 0;
|
|
25657
|
-
const setItemElement =
|
|
25749
|
+
const setItemElement = useCallback10(
|
|
25658
25750
|
(element) => {
|
|
25659
25751
|
registerItemElement(item.id, element);
|
|
25660
25752
|
},
|
|
25661
25753
|
[item.id, registerItemElement]
|
|
25662
25754
|
);
|
|
25663
|
-
const handleMouseLeave =
|
|
25755
|
+
const handleMouseLeave = useCallback10(() => {
|
|
25664
25756
|
if (isPendingDeleteConversation) {
|
|
25665
25757
|
onCancelDeleteConversation();
|
|
25666
25758
|
}
|
|
25667
25759
|
}, [isPendingDeleteConversation, onCancelDeleteConversation]);
|
|
25668
|
-
const handleSelect =
|
|
25760
|
+
const handleSelect = useCallback10(() => {
|
|
25669
25761
|
onSelectConversation(item.id);
|
|
25670
25762
|
}, [item.id, onSelectConversation]);
|
|
25671
|
-
const handleTogglePinned =
|
|
25763
|
+
const handleTogglePinned = useCallback10(() => {
|
|
25672
25764
|
onToggleConversationPinned(item.id, !pinned);
|
|
25673
25765
|
}, [item.id, onToggleConversationPinned, pinned]);
|
|
25674
|
-
const handleOpenConversationWindow =
|
|
25766
|
+
const handleOpenConversationWindow = useCallback10(() => {
|
|
25675
25767
|
onOpenConversationWindow?.(item.id);
|
|
25676
25768
|
}, [item.id, onOpenConversationWindow]);
|
|
25677
|
-
const handleRequestDelete =
|
|
25769
|
+
const handleRequestDelete = useCallback10(() => {
|
|
25678
25770
|
onRequestDeleteConversation(item.id);
|
|
25679
25771
|
}, [item.id, onRequestDeleteConversation]);
|
|
25680
25772
|
return /* @__PURE__ */ jsxs17(
|
|
@@ -26099,11 +26191,11 @@ function appendDockProbeUsageLines(probe, lines, isLoadingUsage, t) {
|
|
|
26099
26191
|
// agent-gui/workspaceDesktop/view/AgentProbeInfoPopover.tsx
|
|
26100
26192
|
import { Info as Info3 } from "lucide-react";
|
|
26101
26193
|
import {
|
|
26102
|
-
useCallback as
|
|
26194
|
+
useCallback as useCallback11,
|
|
26103
26195
|
useEffect as useEffect13,
|
|
26104
|
-
useLayoutEffect as
|
|
26105
|
-
useRef as
|
|
26106
|
-
useState as
|
|
26196
|
+
useLayoutEffect as useLayoutEffect5,
|
|
26197
|
+
useRef as useRef13,
|
|
26198
|
+
useState as useState12
|
|
26107
26199
|
} from "react";
|
|
26108
26200
|
import { createPortal as createPortal4 } from "react-dom";
|
|
26109
26201
|
import { Fragment as Fragment9, jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
@@ -26139,18 +26231,18 @@ function AgentProbeInfoPopover({
|
|
|
26139
26231
|
className
|
|
26140
26232
|
}) {
|
|
26141
26233
|
"use memo";
|
|
26142
|
-
const anchorRef =
|
|
26143
|
-
const popoverRef =
|
|
26144
|
-
const [isOpen, setIsOpen] =
|
|
26145
|
-
const [popoverStyle, setPopoverStyle] =
|
|
26146
|
-
const closeIfPointerLeavesPopover =
|
|
26234
|
+
const anchorRef = useRef13(null);
|
|
26235
|
+
const popoverRef = useRef13(null);
|
|
26236
|
+
const [isOpen, setIsOpen] = useState12(false);
|
|
26237
|
+
const [popoverStyle, setPopoverStyle] = useState12(null);
|
|
26238
|
+
const closeIfPointerLeavesPopover = useCallback11((event) => {
|
|
26147
26239
|
const nextTarget = event.relatedTarget;
|
|
26148
26240
|
if (nextTarget instanceof Node && (anchorRef.current?.contains(nextTarget) || popoverRef.current?.contains(nextTarget))) {
|
|
26149
26241
|
return;
|
|
26150
26242
|
}
|
|
26151
26243
|
setIsOpen(false);
|
|
26152
26244
|
}, []);
|
|
26153
|
-
const updatePopoverPosition =
|
|
26245
|
+
const updatePopoverPosition = useCallback11(() => {
|
|
26154
26246
|
const anchor = anchorRef.current;
|
|
26155
26247
|
if (!anchor) {
|
|
26156
26248
|
return;
|
|
@@ -26182,7 +26274,7 @@ function AgentProbeInfoPopover({
|
|
|
26182
26274
|
}
|
|
26183
26275
|
updatePopoverPosition();
|
|
26184
26276
|
}, [isOpen, lines, updatePopoverPosition]);
|
|
26185
|
-
|
|
26277
|
+
useLayoutEffect5(() => {
|
|
26186
26278
|
if (!isOpen) {
|
|
26187
26279
|
return;
|
|
26188
26280
|
}
|
|
@@ -26662,7 +26754,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26662
26754
|
() => typeof i18n?.t === "function" ? createWorkspaceFileManagerI18nRuntime(i18n) : null,
|
|
26663
26755
|
[i18n]
|
|
26664
26756
|
);
|
|
26665
|
-
const handleLinkAction =
|
|
26757
|
+
const handleLinkAction = useCallback12(
|
|
26666
26758
|
(action) => {
|
|
26667
26759
|
onLinkAction?.(
|
|
26668
26760
|
action.type === "open-agent-session" && !action.provider ? { ...action, provider: state.provider } : action
|
|
@@ -26670,7 +26762,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26670
26762
|
},
|
|
26671
26763
|
[onLinkAction, state.provider]
|
|
26672
26764
|
);
|
|
26673
|
-
const handleAgentProviderLogin =
|
|
26765
|
+
const handleAgentProviderLogin = useCallback12(
|
|
26674
26766
|
(provider) => {
|
|
26675
26767
|
const resolvedProvider = normalizeAgentGUIProviderIdentity(provider);
|
|
26676
26768
|
onAgentProviderLogin?.(
|
|
@@ -26679,7 +26771,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26679
26771
|
},
|
|
26680
26772
|
[onAgentProviderLogin, state.provider]
|
|
26681
26773
|
);
|
|
26682
|
-
const handleWorkspaceFileReferencesAdded =
|
|
26774
|
+
const handleWorkspaceFileReferencesAdded = useCallback12(
|
|
26683
26775
|
(references) => {
|
|
26684
26776
|
onWorkspaceFileReferencesAdded?.({
|
|
26685
26777
|
provider: state.provider,
|
|
@@ -26688,7 +26780,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26688
26780
|
},
|
|
26689
26781
|
[onWorkspaceFileReferencesAdded, state.provider]
|
|
26690
26782
|
);
|
|
26691
|
-
const handleDataChange =
|
|
26783
|
+
const handleDataChange = useCallback12(
|
|
26692
26784
|
(updater) => {
|
|
26693
26785
|
if (previewMode) {
|
|
26694
26786
|
return;
|
|
@@ -26697,7 +26789,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26697
26789
|
},
|
|
26698
26790
|
[onUpdateNode, previewMode]
|
|
26699
26791
|
);
|
|
26700
|
-
const handleConversationRailWidthChanged =
|
|
26792
|
+
const handleConversationRailWidthChanged = useCallback12(
|
|
26701
26793
|
(widthPx) => {
|
|
26702
26794
|
if (previewMode) {
|
|
26703
26795
|
return;
|
|
@@ -26729,7 +26821,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26729
26821
|
}),
|
|
26730
26822
|
[]
|
|
26731
26823
|
);
|
|
26732
|
-
const toggleConversationRailCollapsed =
|
|
26824
|
+
const toggleConversationRailCollapsed = useCallback12(() => {
|
|
26733
26825
|
if (previewMode) {
|
|
26734
26826
|
return;
|
|
26735
26827
|
}
|
|
@@ -26738,7 +26830,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26738
26830
|
conversationRailCollapsed: current.conversationRailCollapsed !== true
|
|
26739
26831
|
}));
|
|
26740
26832
|
}, [onUpdateNode, previewMode]);
|
|
26741
|
-
const handleConversationRailToggle =
|
|
26833
|
+
const handleConversationRailToggle = useCallback12(() => {
|
|
26742
26834
|
if (previewMode) {
|
|
26743
26835
|
return;
|
|
26744
26836
|
}
|
|
@@ -26792,7 +26884,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26792
26884
|
onRememberComposerDefaults,
|
|
26793
26885
|
onShowMessage
|
|
26794
26886
|
});
|
|
26795
|
-
const handleCreateConversation =
|
|
26887
|
+
const handleCreateConversation = useCallback12(
|
|
26796
26888
|
(...args) => {
|
|
26797
26889
|
if (!previewMode) {
|
|
26798
26890
|
onUpdateNode(
|
|
@@ -27036,6 +27128,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
27036
27128
|
goalClearHint: t("agentHost.agentGui.goalClearHint"),
|
|
27037
27129
|
processing: t("agentHost.agentGui.processing"),
|
|
27038
27130
|
turnSummary: t("agentHost.agentGui.turnSummary"),
|
|
27131
|
+
userMessageLocator: t("agentHost.agentGui.userMessageLocator"),
|
|
27039
27132
|
planLead: t("agentHost.agentGui.planLead"),
|
|
27040
27133
|
planModes: [
|
|
27041
27134
|
{
|