@tutti-os/agent-gui 0.0.48 → 0.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-conversation/index.js +5 -5
- package/dist/agent-message-center/index.js +7 -7
- package/dist/app/renderer/agentactivity.css +40 -81
- package/dist/{chunk-RNIY43TA.js → chunk-5HJWT6YN.js} +4 -4
- package/dist/{chunk-OYQZRLJQ.js → chunk-6KQHNUR5.js} +2 -2
- package/dist/{chunk-N6HRVMIS.js → chunk-77UR4G7P.js} +2 -2
- package/dist/{chunk-VGDPBC6W.js → chunk-A2EN24OI.js} +4 -4
- package/dist/{chunk-2RYZ4EBF.js → chunk-AKK7UOAS.js} +2 -2
- package/dist/{chunk-EUOGIKT7.js → chunk-AYEYXKLF.js} +2 -2
- package/dist/{chunk-OB43QOMC.js → chunk-FSRS2JFR.js} +2 -2
- package/dist/{chunk-NETHPCSA.js → chunk-K6SRLYC3.js} +7 -1
- package/dist/chunk-K6SRLYC3.js.map +1 -0
- package/dist/{chunk-7W3VWU5R.js → chunk-Q3MOU4CD.js} +2 -2
- package/dist/{chunk-R6GOICRO.js → chunk-QGBIGRZA.js} +56 -9
- package/dist/chunk-QGBIGRZA.js.map +1 -0
- package/dist/{chunk-6YN7HQL5.js → chunk-RJR2OZ6T.js} +2 -2
- package/dist/{chunk-SD56WDSC.js → chunk-TG3ZXLPM.js} +42 -1
- package/dist/chunk-TG3ZXLPM.js.map +1 -0
- package/dist/{chunk-ZVKRNEOF.js → chunk-TTDBLIQ3.js} +2 -2
- package/dist/{chunk-LWMC2YA3.js → chunk-XRJZCEOX.js} +35 -11
- package/dist/chunk-XRJZCEOX.js.map +1 -0
- package/dist/context-mention-palette/index.js +6 -6
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/index.js +2 -2
- package/dist/index.js +402 -799
- package/dist/index.js.map +1 -1
- package/dist/queued-prompt-runtime.d.ts +1 -0
- package/dist/queued-prompt-runtime.js +1 -1
- package/dist/workbench/contribution.js +2 -2
- package/dist/workbench/index.js +5 -5
- package/dist/workbench/launch.d.ts +22 -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-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-RNIY43TA.js.map → chunk-5HJWT6YN.js.map} +0 -0
- /package/dist/{chunk-OYQZRLJQ.js.map → chunk-6KQHNUR5.js.map} +0 -0
- /package/dist/{chunk-N6HRVMIS.js.map → chunk-77UR4G7P.js.map} +0 -0
- /package/dist/{chunk-VGDPBC6W.js.map → chunk-A2EN24OI.js.map} +0 -0
- /package/dist/{chunk-2RYZ4EBF.js.map → chunk-AKK7UOAS.js.map} +0 -0
- /package/dist/{chunk-EUOGIKT7.js.map → chunk-AYEYXKLF.js.map} +0 -0
- /package/dist/{chunk-OB43QOMC.js.map → chunk-FSRS2JFR.js.map} +0 -0
- /package/dist/{chunk-7W3VWU5R.js.map → chunk-Q3MOU4CD.js.map} +0 -0
- /package/dist/{chunk-6YN7HQL5.js.map → chunk-RJR2OZ6T.js.map} +0 -0
- /package/dist/{chunk-ZVKRNEOF.js.map → chunk-TTDBLIQ3.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-A2EN24OI.js";
|
|
26
26
|
import {
|
|
27
27
|
PLAN_IMPLEMENTATION_ACTION_FEEDBACK,
|
|
28
28
|
PLAN_IMPLEMENTATION_ACTION_IMPLEMENT,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
resolveAgentGUIExplicitConversationTitle,
|
|
42
42
|
resolveAgentGUIProviderDisplayLabel,
|
|
43
43
|
resolveAgentGUIProviderIdentity
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-TTDBLIQ3.js";
|
|
45
45
|
import {
|
|
46
46
|
AgentConversationFlow,
|
|
47
47
|
Button,
|
|
@@ -60,13 +60,13 @@ import {
|
|
|
60
60
|
skillTriggerForPrefix,
|
|
61
61
|
toLocalShortDateTime,
|
|
62
62
|
useProjectedAgentConversation
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-XRJZCEOX.js";
|
|
64
64
|
import {
|
|
65
65
|
AgentMessageMarkdown,
|
|
66
66
|
ZoomableImage,
|
|
67
67
|
cn,
|
|
68
68
|
resolveWorkspaceLinkAction
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-RJR2OZ6T.js";
|
|
70
70
|
import {
|
|
71
71
|
AGENT_MENTION_FILTER_TAB_ORDER,
|
|
72
72
|
AgentFileMentionPalette,
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
DEFAULT_AGENT_MENTION_FILTER,
|
|
75
75
|
agentMentionItemKey,
|
|
76
76
|
preloadAgentMentionBrowse
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-5HJWT6YN.js";
|
|
78
78
|
import {
|
|
79
79
|
WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN,
|
|
80
80
|
buildWorkspaceAgentActivityListViewModel,
|
|
@@ -84,13 +84,13 @@ import {
|
|
|
84
84
|
isWorkspaceAgentUntitledTask,
|
|
85
85
|
mergeWorkspaceAgentActivityDurableAndOverlayMessages,
|
|
86
86
|
selectWorkspaceAgentActivityOverlayMessages
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-Q3MOU4CD.js";
|
|
88
88
|
import {
|
|
89
89
|
MANAGED_AGENT_ICON_FALLBACK_URL,
|
|
90
90
|
MANAGED_AGENT_ICON_URLS,
|
|
91
91
|
Spinner,
|
|
92
92
|
normalizeManagedAgentProvider
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-AYEYXKLF.js";
|
|
94
94
|
import {
|
|
95
95
|
resolveWorkspaceAgentSessionSortTimeUnixMs
|
|
96
96
|
} from "./chunk-IBIMGLCD.js";
|
|
@@ -102,7 +102,7 @@ import {
|
|
|
102
102
|
mentionItemToAttrs,
|
|
103
103
|
normalizeAgentSessionMentionTitle,
|
|
104
104
|
parseMentionItemFromHref
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-6KQHNUR5.js";
|
|
106
106
|
import "./chunk-Y35GDLP2.js";
|
|
107
107
|
import "./chunk-LUGELG5V.js";
|
|
108
108
|
import {
|
|
@@ -127,15 +127,15 @@ import {
|
|
|
127
127
|
import "./chunk-GCBDIQDX.js";
|
|
128
128
|
import {
|
|
129
129
|
createAgentQueuedPromptRuntime
|
|
130
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-TG3ZXLPM.js";
|
|
131
131
|
import {
|
|
132
132
|
AgentGuiI18nProvider,
|
|
133
133
|
agentGuiI18nModule,
|
|
134
134
|
agentGuiI18nResources,
|
|
135
135
|
translate,
|
|
136
136
|
useTranslation
|
|
137
|
-
} from "./chunk-
|
|
138
|
-
import "./chunk-
|
|
137
|
+
} from "./chunk-77UR4G7P.js";
|
|
138
|
+
import "./chunk-K6SRLYC3.js";
|
|
139
139
|
|
|
140
140
|
// shared/agentActivitySnapshotProjection.ts
|
|
141
141
|
import {
|
|
@@ -301,7 +301,7 @@ import { memo as memo3 } from "react";
|
|
|
301
301
|
import { TooltipProvider as TooltipProvider3 } from "@tutti-os/ui-system";
|
|
302
302
|
|
|
303
303
|
// agent-gui/agentGuiNode/AgentGUINode.tsx
|
|
304
|
-
import { memo as memo2, useCallback as
|
|
304
|
+
import { memo as memo2, useCallback as useCallback12, useEffect as useEffect14, useMemo as useMemo11 } from "react";
|
|
305
305
|
import { createWorkspaceUserProjectI18nRuntime } from "@tutti-os/workspace-user-project/i18n";
|
|
306
306
|
import { createWorkspaceFileManagerI18nRuntime } from "@tutti-os/workspace-file-manager";
|
|
307
307
|
|
|
@@ -6509,7 +6509,6 @@ var AGENT_PROVIDER_SESSION_NOT_FOUND_ERROR = "agent.provider_session_not_found";
|
|
|
6509
6509
|
var AGENT_RESUME_SESSION_NOT_LOCAL_ERROR = "agent.resume_session_not_local";
|
|
6510
6510
|
var AGENT_SETTINGS_REQUIRE_NEW_SESSION_ERROR = "agent.settings_require_new_session";
|
|
6511
6511
|
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
6512
|
var AGENT_PROVIDER_SESSION_NOT_FOUND_FALLBACK_MESSAGE = "The previous agent session can no longer be restored.";
|
|
6514
6513
|
var AGENT_RESUME_SESSION_NOT_LOCAL_FALLBACK_MESSAGE = "The previous agent session is not available on this machine.";
|
|
6515
6514
|
var AGENT_GUI_CAUGHT_ERROR_STACK_LIMIT = 4e3;
|
|
@@ -7103,10 +7102,6 @@ function buildContinueInNewConversationPrompt(input) {
|
|
|
7103
7102
|
}
|
|
7104
7103
|
return `${mention} ${existingDraftPrompt}`;
|
|
7105
7104
|
}
|
|
7106
|
-
function isAgentSessionActiveTurnConflictError(error) {
|
|
7107
|
-
const message = getAgentGUIRawErrorMessage(error);
|
|
7108
|
-
return message?.toLowerCase().includes(AGENT_SESSION_ACTIVE_TURN_CONFLICT_MESSAGE) ?? false;
|
|
7109
|
-
}
|
|
7110
7105
|
function resolveConversationUpdatedAtUnixMsFromSessionState(input) {
|
|
7111
7106
|
if (input.source === "conversation-selected") {
|
|
7112
7107
|
return input.currentUpdatedAtUnixMs;
|
|
@@ -8472,15 +8467,6 @@ function useAgentGUINodeController({
|
|
|
8472
8467
|
);
|
|
8473
8468
|
const pendingCreateOwnerKey = nodeId?.trim() ?? "";
|
|
8474
8469
|
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
8470
|
const resolvePendingCreateConversationId = useCallback4(
|
|
8485
8471
|
() => conversationListQuery && pendingCreateOwnerKey ? getAgentGUIConversationCreatePending({
|
|
8486
8472
|
query: conversationListQuery,
|
|
@@ -8529,9 +8515,6 @@ function useAgentGUINodeController({
|
|
|
8529
8515
|
});
|
|
8530
8516
|
const activeQueuedPrompts = activeQueuedPromptSnapshot?.prompts ?? EMPTY_QUEUED_PROMPTS;
|
|
8531
8517
|
const activeQueuedPromptClaim = activeQueuedPromptSnapshot?.claim ?? null;
|
|
8532
|
-
const activeFailedQueuedPromptId = activeQueuedPromptSnapshot?.failedPromptId ?? null;
|
|
8533
|
-
const activeQueuedPromptRetryBlock = activeQueuedPromptSnapshot?.retryBlock ?? null;
|
|
8534
|
-
const activeSendNextQueuedPromptId = activeQueuedPromptSnapshot?.sendNextPromptId ?? null;
|
|
8535
8518
|
const [interruptingSessionIds, setInterruptingSessionIds] = useState4({});
|
|
8536
8519
|
const [pendingInterruptSessionIds, setPendingInterruptSessionIds] = useState4({});
|
|
8537
8520
|
const [
|
|
@@ -8993,6 +8976,9 @@ function useAgentGUINodeController({
|
|
|
8993
8976
|
if (externalId === (activeConversationIdRef.current ?? "")) return;
|
|
8994
8977
|
if (!externalId) {
|
|
8995
8978
|
const previous = activeConversationIdRef.current;
|
|
8979
|
+
if (!previous && isComposerHomeRef.current && intent.tag === "home") {
|
|
8980
|
+
return;
|
|
8981
|
+
}
|
|
8996
8982
|
reportAgentGUIActiveConversationCleared({
|
|
8997
8983
|
details: {
|
|
8998
8984
|
dataLastActiveAgentSessionId: data.lastActiveAgentSessionId ?? null,
|
|
@@ -11297,7 +11283,7 @@ function useAgentGUINodeController({
|
|
|
11297
11283
|
});
|
|
11298
11284
|
persistActiveConversation(conversation2.id);
|
|
11299
11285
|
setIsLoadingMessages(true);
|
|
11300
|
-
void
|
|
11286
|
+
void loadSelectedConversationMessages(conversation2.id);
|
|
11301
11287
|
void loadSessionState(conversation2.id);
|
|
11302
11288
|
void syncConversationListProjection(conversation2.id);
|
|
11303
11289
|
}).catch((error) => {
|
|
@@ -11309,7 +11295,7 @@ function useAgentGUINodeController({
|
|
|
11309
11295
|
conversationId: pendingCreateAgentSessionId ?? agentSessionId
|
|
11310
11296
|
});
|
|
11311
11297
|
}
|
|
11312
|
-
const shouldShowErrorOnHome = startingConversationIdRef.current === agentSessionId || activeConversationIdRef.current === null
|
|
11298
|
+
const shouldShowErrorOnHome = startingConversationIdRef.current === agentSessionId || activeConversationIdRef.current === null;
|
|
11313
11299
|
const submitTrace = submitTraceBySessionIdRef.current[agentSessionId];
|
|
11314
11300
|
if (submitTrace) {
|
|
11315
11301
|
const nextTraces = { ...submitTraceBySessionIdRef.current };
|
|
@@ -11384,6 +11370,7 @@ function useAgentGUINodeController({
|
|
|
11384
11370
|
isCreatingConversation,
|
|
11385
11371
|
openclawGateway?.status,
|
|
11386
11372
|
syncConversationListProjection,
|
|
11373
|
+
loadSelectedConversationMessages,
|
|
11387
11374
|
loadSessionState,
|
|
11388
11375
|
refreshMessagesFromSnapshot,
|
|
11389
11376
|
persistActiveConversation,
|
|
@@ -11628,18 +11615,19 @@ function useAgentGUINodeController({
|
|
|
11628
11615
|
workspaceId
|
|
11629
11616
|
]);
|
|
11630
11617
|
const executePrompt = useCallback4(
|
|
11631
|
-
(agentSessionId, content,
|
|
11618
|
+
(agentSessionId, content, displayPrompt) => {
|
|
11632
11619
|
const normalizedContent = normalizeAgentPromptContentBlocks(content);
|
|
11633
11620
|
if (!agentSessionId || normalizedContent.length === 0) {
|
|
11634
11621
|
return;
|
|
11635
11622
|
}
|
|
11623
|
+
const targetIsActiveConversation = activeConversationIdRef.current === agentSessionId;
|
|
11636
11624
|
const submittedPromptText = displayPrompt && displayPrompt.trim() ? displayPrompt : agentPromptContentDisplayText(normalizedContent);
|
|
11637
11625
|
const submittedAtUnixMs = Date.now();
|
|
11638
11626
|
const submitTrace = createAgentSubmitTraceState({
|
|
11639
11627
|
agentSessionId,
|
|
11640
11628
|
content: normalizedContent,
|
|
11641
11629
|
prompt: submittedPromptText,
|
|
11642
|
-
queued:
|
|
11630
|
+
queued: false,
|
|
11643
11631
|
startedAtUnixMs: submittedAtUnixMs
|
|
11644
11632
|
});
|
|
11645
11633
|
const targetConversation = resolveConversationSummaryById(
|
|
@@ -11662,7 +11650,7 @@ function useAgentGUINodeController({
|
|
|
11662
11650
|
conversationKnown: targetConversation !== null,
|
|
11663
11651
|
conversationStatus: previousConversationStatus,
|
|
11664
11652
|
isComposerHome: isComposerHomeRef.current,
|
|
11665
|
-
targetIsActiveConversation
|
|
11653
|
+
targetIsActiveConversation,
|
|
11666
11654
|
targetMode: "existing"
|
|
11667
11655
|
}
|
|
11668
11656
|
});
|
|
@@ -11717,28 +11705,24 @@ function useAgentGUINodeController({
|
|
|
11717
11705
|
trace: submitTrace,
|
|
11718
11706
|
workspaceId
|
|
11719
11707
|
});
|
|
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
|
-
}
|
|
11708
|
+
recordLocalMessages(agentSessionId, [
|
|
11709
|
+
createOptimisticPromptMessage({
|
|
11710
|
+
workspaceId,
|
|
11711
|
+
agentSessionId,
|
|
11712
|
+
turnId: pendingOptimisticTurnId,
|
|
11713
|
+
clientSubmitId: submitTrace.clientSubmitId,
|
|
11714
|
+
userId: currentUserId?.trim() || "user",
|
|
11715
|
+
prompt: submittedPromptText,
|
|
11716
|
+
content: normalizedContent,
|
|
11717
|
+
occurredAtUnixMs: submittedAtUnixMs
|
|
11718
|
+
})
|
|
11719
|
+
]);
|
|
11720
|
+
reportAgentSubmitTraceDiagnostic({
|
|
11721
|
+
event: "optimistic_user_message_recorded",
|
|
11722
|
+
runtime: agentActivityRuntime,
|
|
11723
|
+
trace: submitTrace,
|
|
11724
|
+
workspaceId
|
|
11725
|
+
});
|
|
11742
11726
|
void Promise.resolve().then(() => {
|
|
11743
11727
|
reportAgentSubmitTraceDiagnostic({
|
|
11744
11728
|
event: "send_input.requested",
|
|
@@ -11798,63 +11782,30 @@ function useAgentGUINodeController({
|
|
|
11798
11782
|
updatedAtUnixMs: Date.now()
|
|
11799
11783
|
});
|
|
11800
11784
|
}
|
|
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
|
-
});
|
|
11785
|
+
setDraftBySessionId((current) => {
|
|
11786
|
+
const currentDraft = current[agentSessionId];
|
|
11787
|
+
if (!shouldClearSubmittedDraft({
|
|
11788
|
+
currentDraft,
|
|
11789
|
+
submittedContent: normalizedContent
|
|
11790
|
+
})) {
|
|
11791
|
+
return current;
|
|
11824
11792
|
}
|
|
11825
|
-
|
|
11793
|
+
return {
|
|
11794
|
+
...current,
|
|
11795
|
+
[agentSessionId]: emptyAgentComposerDraft()
|
|
11796
|
+
};
|
|
11797
|
+
});
|
|
11826
11798
|
const submittedTurnId = result.turnId.trim();
|
|
11827
11799
|
if (submittedTurnId) {
|
|
11828
11800
|
pendingTurnIdBySessionIdRef.current = {
|
|
11829
11801
|
...pendingTurnIdBySessionIdRef.current,
|
|
11830
11802
|
[agentSessionId]: submittedTurnId
|
|
11831
11803
|
};
|
|
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
|
-
}
|
|
11804
|
+
retargetOptimisticPromptTurn(
|
|
11805
|
+
agentSessionId,
|
|
11806
|
+
submitTrace.clientSubmitId,
|
|
11807
|
+
submittedTurnId
|
|
11808
|
+
);
|
|
11858
11809
|
scheduleAgentSubmitTracePaint({
|
|
11859
11810
|
runtime: agentActivityRuntime,
|
|
11860
11811
|
trace: submitTrace,
|
|
@@ -11872,9 +11823,7 @@ function useAgentGUINodeController({
|
|
|
11872
11823
|
const nextTraces = { ...submitTraceBySessionIdRef.current };
|
|
11873
11824
|
delete nextTraces[agentSessionId];
|
|
11874
11825
|
submitTraceBySessionIdRef.current = nextTraces;
|
|
11875
|
-
|
|
11876
|
-
removeOptimisticPrompt(agentSessionId, submitTrace.clientSubmitId);
|
|
11877
|
-
}
|
|
11826
|
+
removeOptimisticPrompt(agentSessionId, submitTrace.clientSubmitId);
|
|
11878
11827
|
const nextPendingTurns = { ...pendingTurnIdBySessionIdRef.current };
|
|
11879
11828
|
delete nextPendingTurns[agentSessionId];
|
|
11880
11829
|
pendingTurnIdBySessionIdRef.current = nextPendingTurns;
|
|
@@ -11887,14 +11836,7 @@ function useAgentGUINodeController({
|
|
|
11887
11836
|
errorCode: getAgentGUIErrorCode(error)
|
|
11888
11837
|
}
|
|
11889
11838
|
});
|
|
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") {
|
|
11839
|
+
if (previousConversationStatus && previousConversationStatus !== "working") {
|
|
11898
11840
|
patchConversation(
|
|
11899
11841
|
agentSessionId,
|
|
11900
11842
|
(conversation2) => conversation2.status === "working" ? {
|
|
@@ -11911,13 +11853,9 @@ function useAgentGUINodeController({
|
|
|
11911
11853
|
});
|
|
11912
11854
|
}
|
|
11913
11855
|
}
|
|
11914
|
-
if (isCurrentConversation(agentSessionId)
|
|
11856
|
+
if (isCurrentConversation(agentSessionId)) {
|
|
11915
11857
|
reportAgentGUIRuntimeError({
|
|
11916
11858
|
agentSessionId,
|
|
11917
|
-
context: {
|
|
11918
|
-
queuedPrompt: queuedPromptId !== void 0,
|
|
11919
|
-
retryQueuedPromptOnNextActivity: shouldRetryQueuedPromptOnNextActivity
|
|
11920
|
-
},
|
|
11921
11859
|
error,
|
|
11922
11860
|
phase: "send_prompt",
|
|
11923
11861
|
provider: dataRef.current.provider,
|
|
@@ -11926,25 +11864,6 @@ function useAgentGUINodeController({
|
|
|
11926
11864
|
});
|
|
11927
11865
|
setDetailError(getAgentGUIErrorMessage(error));
|
|
11928
11866
|
}
|
|
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
11867
|
}).finally(() => {
|
|
11949
11868
|
if (conversationListQuery) {
|
|
11950
11869
|
clearAgentGUIConversationSubmitPending({
|
|
@@ -11953,22 +11872,12 @@ function useAgentGUINodeController({
|
|
|
11953
11872
|
});
|
|
11954
11873
|
}
|
|
11955
11874
|
setLocalIsSubmitting(false);
|
|
11956
|
-
if (queuedPromptClaim && !queuedPromptClaimCompleted) {
|
|
11957
|
-
agentQueuedPromptRuntime.releaseClaim({
|
|
11958
|
-
workspaceId,
|
|
11959
|
-
agentSessionId,
|
|
11960
|
-
ownerId: queuedPromptClaim.ownerId,
|
|
11961
|
-
claimId: queuedPromptClaim.claimId
|
|
11962
|
-
});
|
|
11963
|
-
}
|
|
11964
11875
|
});
|
|
11965
11876
|
},
|
|
11966
11877
|
[
|
|
11967
|
-
agentQueuedPromptRuntime,
|
|
11968
11878
|
currentUserId,
|
|
11969
11879
|
isCurrentConversation,
|
|
11970
11880
|
applyStatePatch,
|
|
11971
|
-
conversations,
|
|
11972
11881
|
conversationListQuery,
|
|
11973
11882
|
syncConversationListProjection,
|
|
11974
11883
|
loadSessionState,
|
|
@@ -12066,12 +11975,7 @@ function useAgentGUINodeController({
|
|
|
12066
11975
|
);
|
|
12067
11976
|
return;
|
|
12068
11977
|
}
|
|
12069
|
-
executePrompt(
|
|
12070
|
-
agentSessionId,
|
|
12071
|
-
normalizedContent,
|
|
12072
|
-
void 0,
|
|
12073
|
-
displayPromptText
|
|
12074
|
-
);
|
|
11978
|
+
executePrompt(agentSessionId, normalizedContent, displayPromptText);
|
|
12075
11979
|
},
|
|
12076
11980
|
[
|
|
12077
11981
|
activation,
|
|
@@ -12718,155 +12622,6 @@ function useAgentGUINodeController({
|
|
|
12718
12622
|
feedback: submitPlanFeedback,
|
|
12719
12623
|
skip: dismissPlanImplementation
|
|
12720
12624
|
};
|
|
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
12625
|
const requestDeleteConversation = useCallback4(
|
|
12871
12626
|
(agentSessionId) => {
|
|
12872
12627
|
const normalized = agentSessionId.trim();
|
|
@@ -14401,12 +14156,12 @@ function normalizeInteractiveQuestions(value) {
|
|
|
14401
14156
|
import {
|
|
14402
14157
|
Fragment as Fragment7,
|
|
14403
14158
|
memo,
|
|
14404
|
-
useCallback as
|
|
14159
|
+
useCallback as useCallback10,
|
|
14405
14160
|
useEffect as useEffect12,
|
|
14406
|
-
useLayoutEffect as
|
|
14161
|
+
useLayoutEffect as useLayoutEffect4,
|
|
14407
14162
|
useMemo as useMemo10,
|
|
14408
|
-
useRef as
|
|
14409
|
-
useState as
|
|
14163
|
+
useRef as useRef12,
|
|
14164
|
+
useState as useState11
|
|
14410
14165
|
} from "react";
|
|
14411
14166
|
import { useSnapshot } from "valtio";
|
|
14412
14167
|
import { proxy as proxy2 } from "valtio/vanilla";
|
|
@@ -14986,12 +14741,6 @@ function isTaskSearchImeComposing(event) {
|
|
|
14986
14741
|
}
|
|
14987
14742
|
|
|
14988
14743
|
// 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
14744
|
import { Button as Button2 } from "@tutti-os/ui-system";
|
|
14996
14745
|
|
|
14997
14746
|
// app/renderer/components/icons/CastIcon.tsx
|
|
@@ -15135,8 +14884,14 @@ var CastIcon = forwardRef2(
|
|
|
15135
14884
|
);
|
|
15136
14885
|
CastIcon.displayName = "CastIcon";
|
|
15137
14886
|
|
|
15138
|
-
//
|
|
15139
|
-
import {
|
|
14887
|
+
// app/renderer/components/ui/tooltip.tsx
|
|
14888
|
+
import {
|
|
14889
|
+
Tooltip,
|
|
14890
|
+
TooltipContent,
|
|
14891
|
+
TooltipPortal,
|
|
14892
|
+
TooltipProvider,
|
|
14893
|
+
TooltipTrigger
|
|
14894
|
+
} from "@tutti-os/ui-system";
|
|
15140
14895
|
|
|
15141
14896
|
// agent-gui/agentGuiNode/AgentGUIChrome.styles.ts
|
|
15142
14897
|
var styles2 = {
|
|
@@ -15148,8 +14903,8 @@ var styles2 = {
|
|
|
15148
14903
|
chromeCardConnecting: "agent-gui-chrome__card--connecting",
|
|
15149
14904
|
chromeCardDanger: "agent-gui-chrome__card--danger",
|
|
15150
14905
|
chromeIcon: "agent-gui-chrome__icon",
|
|
15151
|
-
chromeExpandCue: "agent-gui-chrome__expand-cue",
|
|
15152
14906
|
chromeMessageSlot: "agent-gui-chrome__message-slot",
|
|
14907
|
+
chromeMessageTooltip: "agent-gui-chrome__message-tooltip",
|
|
15153
14908
|
chromeInlineActions: "agent-gui-chrome__inline-actions",
|
|
15154
14909
|
chromeNoticeDescription: "agent-gui-chrome__notice-description",
|
|
15155
14910
|
chromeNoticeMessage: "agent-gui-chrome__notice-message",
|
|
@@ -15183,6 +14938,24 @@ function LoadingEllipsis() {
|
|
|
15183
14938
|
/* @__PURE__ */ jsx19("span", {})
|
|
15184
14939
|
] });
|
|
15185
14940
|
}
|
|
14941
|
+
function ChromeMessageTooltip({
|
|
14942
|
+
message,
|
|
14943
|
+
children
|
|
14944
|
+
}) {
|
|
14945
|
+
"use memo";
|
|
14946
|
+
return /* @__PURE__ */ jsx19(TooltipProvider, { delayDuration: 250, children: /* @__PURE__ */ jsxs7(Tooltip, { children: [
|
|
14947
|
+
/* @__PURE__ */ jsx19(TooltipTrigger, { asChild: true, children }),
|
|
14948
|
+
/* @__PURE__ */ jsx19(
|
|
14949
|
+
TooltipContent,
|
|
14950
|
+
{
|
|
14951
|
+
className: AgentGUIChrome_styles_default.chromeMessageTooltip,
|
|
14952
|
+
side: "top",
|
|
14953
|
+
sideOffset: 6,
|
|
14954
|
+
children: message
|
|
14955
|
+
}
|
|
14956
|
+
)
|
|
14957
|
+
] }) });
|
|
14958
|
+
}
|
|
15186
14959
|
function AgentChromeNotice({
|
|
15187
14960
|
tone,
|
|
15188
14961
|
title,
|
|
@@ -15200,8 +14973,6 @@ function AgentChromeNotice({
|
|
|
15200
14973
|
AgentGUIChrome_styles_default.chromeCard,
|
|
15201
14974
|
tone === "danger" ? AgentGUIChrome_styles_default.chromeCardDanger : AgentGUIChrome_styles_default.chromeCardWarning
|
|
15202
14975
|
),
|
|
15203
|
-
"data-expandable": "false",
|
|
15204
|
-
"data-expanded": "false",
|
|
15205
14976
|
role,
|
|
15206
14977
|
"data-testid": testId,
|
|
15207
14978
|
children: /* @__PURE__ */ jsx19("div", { className: AgentGUIChrome_styles_default.chromeMetaRow, children: /* @__PURE__ */ jsxs7("div", { className: AgentGUIChrome_styles_default.chromeMessageSlot, children: [
|
|
@@ -15221,44 +14992,6 @@ function AgentChromeNotice({
|
|
|
15221
14992
|
}
|
|
15222
14993
|
) });
|
|
15223
14994
|
}
|
|
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
14995
|
function AgentSessionChrome({
|
|
15263
14996
|
chrome,
|
|
15264
14997
|
isRespondingApproval,
|
|
@@ -15269,163 +15002,41 @@ function AgentSessionChrome({
|
|
|
15269
15002
|
labels
|
|
15270
15003
|
}) {
|
|
15271
15004
|
"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
15005
|
const visibleAuth = chrome.recovery?.kind === "activating" ? null : chrome.auth;
|
|
15281
15006
|
const visibleRecovery = chrome.recovery;
|
|
15282
15007
|
const recoveryMessage = visibleRecovery?.kind === "activating" ? labels.activatingSession : visibleRecovery?.message ?? "";
|
|
15283
15008
|
const recoveryHasInlineAction = visibleRecovery?.kind === "failed" && (visibleRecovery.followupAction === "continue-in-new-conversation" || visibleRecovery.canRetry !== false);
|
|
15284
15009
|
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
15010
|
const hasContent = visibleAuth !== null || chrome.approval !== null || visibleRecovery !== null;
|
|
15337
15011
|
if (!hasContent) {
|
|
15338
15012
|
return null;
|
|
15339
15013
|
}
|
|
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
15014
|
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,
|
|
15015
|
+
visibleAuth ? /* @__PURE__ */ jsx19("section", { className: cn(AgentGUIChrome_styles_default.chromeCard, AgentGUIChrome_styles_default.chromeCardWarning), children: /* @__PURE__ */ jsxs7("div", { className: AgentGUIChrome_styles_default.chromeMetaRow, children: [
|
|
15016
|
+
/* @__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 }) }) }),
|
|
15017
|
+
/* @__PURE__ */ jsxs7("div", { className: AgentGUIChrome_styles_default.chromeInlineActions, children: [
|
|
15018
|
+
onAuthLogin ? /* @__PURE__ */ jsx19(
|
|
15019
|
+
Button2,
|
|
15020
|
+
{
|
|
15021
|
+
type: "button",
|
|
15022
|
+
variant: "ghost",
|
|
15023
|
+
size: "sm",
|
|
15024
|
+
onClick: () => onAuthLogin(),
|
|
15025
|
+
children: labels.authLogin ?? labels.retryActivation
|
|
15026
|
+
}
|
|
15027
|
+
) : null,
|
|
15028
|
+
/* @__PURE__ */ jsx19(
|
|
15029
|
+
Button2,
|
|
15030
|
+
{
|
|
15031
|
+
type: "button",
|
|
15032
|
+
variant: "ghost",
|
|
15033
|
+
size: "sm",
|
|
15034
|
+
onClick: () => onRetryActivation(),
|
|
15035
|
+
children: labels.retryActivation
|
|
15036
|
+
}
|
|
15037
|
+
)
|
|
15038
|
+
] })
|
|
15039
|
+
] }) }) : null,
|
|
15429
15040
|
chrome.approval ? /* @__PURE__ */ jsxs7("section", { className: cn(AgentGUIChrome_styles_default.chromeCard, AgentGUIChrome_styles_default.chromeCardAction), children: [
|
|
15430
15041
|
/* @__PURE__ */ jsx19("div", { className: AgentGUIChrome_styles_default.chromeTitle, children: labels.approvalRequired }),
|
|
15431
15042
|
/* @__PURE__ */ jsx19("p", { className: AgentGUIChrome_styles_default.chromeMessage, children: chrome.approval.title }),
|
|
@@ -15446,19 +15057,13 @@ function AgentSessionChrome({
|
|
|
15446
15057
|
visibleRecovery ? /* @__PURE__ */ jsx19(
|
|
15447
15058
|
"section",
|
|
15448
15059
|
{
|
|
15449
|
-
ref: recoveryCardRef,
|
|
15450
15060
|
role: visibleRecovery.kind === "failed" ? "alert" : void 0,
|
|
15451
15061
|
"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
15062
|
"data-has-inline-actions": recoveryHasInlineAction ? "true" : "false",
|
|
15455
|
-
tabIndex: expandableCards.has("recovery") ? 0 : void 0,
|
|
15456
15063
|
className: cn(
|
|
15457
15064
|
AgentGUIChrome_styles_default.chromeCard,
|
|
15458
15065
|
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
15066
|
),
|
|
15460
|
-
onClick: () => toggleExpandedCard("recovery"),
|
|
15461
|
-
onKeyDown: handleExpandableCardKeyDown("recovery"),
|
|
15462
15067
|
children: /* @__PURE__ */ jsxs7("div", { className: AgentGUIChrome_styles_default.chromeMetaRow, children: [
|
|
15463
15068
|
/* @__PURE__ */ jsxs7("div", { className: AgentGUIChrome_styles_default.chromeMessageSlot, children: [
|
|
15464
15069
|
visibleRecovery.kind === "activating" ? /* @__PURE__ */ jsx19(
|
|
@@ -15471,30 +15076,18 @@ function AgentSessionChrome({
|
|
|
15471
15076
|
size: 16
|
|
15472
15077
|
}
|
|
15473
15078
|
) : null,
|
|
15474
|
-
/* @__PURE__ */ jsx19(
|
|
15079
|
+
/* @__PURE__ */ jsx19(ChromeMessageTooltip, { message: recoveryMessage, children: /* @__PURE__ */ jsx19(
|
|
15475
15080
|
"p",
|
|
15476
15081
|
{
|
|
15477
|
-
ref: recoveryMessageRef,
|
|
15478
15082
|
className: AgentGUIChrome_styles_default.chromeMessage,
|
|
15479
15083
|
"aria-label": visibleRecovery.kind === "activating" ? recoveryMessage : void 0,
|
|
15480
|
-
|
|
15084
|
+
tabIndex: 0,
|
|
15481
15085
|
children: visibleRecovery.kind === "activating" ? /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
15482
15086
|
/* @__PURE__ */ jsx19("span", { className: "tsh-inline-loading-label", children: activatingMessage.label }),
|
|
15483
15087
|
activatingMessage.ellipsis ? /* @__PURE__ */ jsx19(LoadingEllipsis, {}) : null
|
|
15484
15088
|
] }) : recoveryMessage
|
|
15485
15089
|
}
|
|
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
|
-
)
|
|
15090
|
+
) })
|
|
15498
15091
|
] }),
|
|
15499
15092
|
/* @__PURE__ */ jsx19("div", { className: AgentGUIChrome_styles_default.chromeInlineActions, children: visibleRecovery.kind === "failed" && visibleRecovery.followupAction === "continue-in-new-conversation" ? /* @__PURE__ */ jsx19(
|
|
15500
15093
|
Button2,
|
|
@@ -15503,10 +15096,7 @@ function AgentSessionChrome({
|
|
|
15503
15096
|
variant: "ghost",
|
|
15504
15097
|
size: "sm",
|
|
15505
15098
|
className: AgentGUIChrome_styles_default.chromeDangerGhostButton,
|
|
15506
|
-
onClick: (
|
|
15507
|
-
stopCardToggle(event);
|
|
15508
|
-
onContinueInNewConversation();
|
|
15509
|
-
},
|
|
15099
|
+
onClick: () => onContinueInNewConversation(),
|
|
15510
15100
|
children: labels.continueInNewConversation
|
|
15511
15101
|
}
|
|
15512
15102
|
) : visibleRecovery.kind === "failed" && visibleRecovery.canRetry !== false ? /* @__PURE__ */ jsx19(
|
|
@@ -15516,10 +15106,7 @@ function AgentSessionChrome({
|
|
|
15516
15106
|
variant: "ghost",
|
|
15517
15107
|
size: "sm",
|
|
15518
15108
|
className: AgentGUIChrome_styles_default.chromeDangerGhostButton,
|
|
15519
|
-
onClick: (
|
|
15520
|
-
stopCardToggle(event);
|
|
15521
|
-
onRetryActivation();
|
|
15522
|
-
},
|
|
15109
|
+
onClick: () => onRetryActivation(),
|
|
15523
15110
|
children: labels.retryActivation
|
|
15524
15111
|
}
|
|
15525
15112
|
) : null })
|
|
@@ -15589,8 +15176,6 @@ function AgentGoalBanner({
|
|
|
15589
15176
|
"section",
|
|
15590
15177
|
{
|
|
15591
15178
|
className: cn(AgentGUIChrome_styles_default.chromeCard, AgentGUIChrome_styles_default.chromeCardMuted),
|
|
15592
|
-
"data-expandable": "false",
|
|
15593
|
-
"data-expanded": "false",
|
|
15594
15179
|
role: "status",
|
|
15595
15180
|
"data-testid": "agent-gui-goal-banner",
|
|
15596
15181
|
children: /* @__PURE__ */ jsxs8("div", { className: AgentGUIChrome_styles_default.chromeMetaRow, children: [
|
|
@@ -15623,25 +15208,14 @@ function AgentGoalBanner({
|
|
|
15623
15208
|
|
|
15624
15209
|
// agent-gui/agentGuiNode/AgentComposer.tsx
|
|
15625
15210
|
import {
|
|
15626
|
-
useCallback as
|
|
15211
|
+
useCallback as useCallback9,
|
|
15627
15212
|
useEffect as useEffect11,
|
|
15628
|
-
useLayoutEffect as
|
|
15213
|
+
useLayoutEffect as useLayoutEffect3,
|
|
15629
15214
|
useMemo as useMemo9,
|
|
15630
|
-
useRef as
|
|
15631
|
-
useState as
|
|
15215
|
+
useRef as useRef11,
|
|
15216
|
+
useState as useState10
|
|
15632
15217
|
} from "react";
|
|
15633
15218
|
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
15219
|
import { AddIcon, Button as Button3, Select as Select2, SelectTrigger as SelectTrigger2 } from "@tutti-os/ui-system";
|
|
15646
15220
|
import { ListChecks as ListChecks2, Target as Target3, X } from "lucide-react";
|
|
15647
15221
|
import {
|
|
@@ -16085,7 +15659,7 @@ function filterUnavailableSlashCommands(commands, input) {
|
|
|
16085
15659
|
}
|
|
16086
15660
|
|
|
16087
15661
|
// agent-gui/agentGuiNode/AgentSlashCommandPalette.tsx
|
|
16088
|
-
import { Fragment as Fragment3, useEffect as useEffect6, useRef as
|
|
15662
|
+
import { Fragment as Fragment3, useEffect as useEffect6, useRef as useRef6 } from "react";
|
|
16089
15663
|
import {
|
|
16090
15664
|
Globe,
|
|
16091
15665
|
Info,
|
|
@@ -16099,7 +15673,7 @@ import {
|
|
|
16099
15673
|
import { jsx as jsx21, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
16100
15674
|
var paletteStyles = {
|
|
16101
15675
|
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",
|
|
15676
|
+
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
15677
|
icon: "flex w-3 shrink-0 items-center justify-center self-center text-[var(--text-secondary)]",
|
|
16104
15678
|
copy: "flex min-w-0 flex-1 items-center gap-1 overflow-hidden leading-[16px]",
|
|
16105
15679
|
name: "flex min-w-0 max-w-[48%] shrink-0 items-center gap-1 overflow-hidden",
|
|
@@ -16128,7 +15702,7 @@ function AgentSlashCommandPalette({
|
|
|
16128
15702
|
onSelectSkill
|
|
16129
15703
|
}) {
|
|
16130
15704
|
"use memo";
|
|
16131
|
-
const highlightedOptionRef =
|
|
15705
|
+
const highlightedOptionRef = useRef6(null);
|
|
16132
15706
|
useEffect6(() => {
|
|
16133
15707
|
highlightedOptionRef.current?.scrollIntoView({ block: "nearest" });
|
|
16134
15708
|
}, [highlightedIndex]);
|
|
@@ -16285,9 +15859,9 @@ function slashPaletteEntryIcon(entry) {
|
|
|
16285
15859
|
|
|
16286
15860
|
// agent-gui/agentGuiNode/AgentQueuedPromptPanel.tsx
|
|
16287
15861
|
import {
|
|
16288
|
-
useLayoutEffect
|
|
16289
|
-
useRef as
|
|
16290
|
-
useState as
|
|
15862
|
+
useLayoutEffect,
|
|
15863
|
+
useRef as useRef7,
|
|
15864
|
+
useState as useState5
|
|
16291
15865
|
} from "react";
|
|
16292
15866
|
import { ChevronRight } from "lucide-react";
|
|
16293
15867
|
|
|
@@ -16453,12 +16027,12 @@ function AgentQueuedPromptPanel({
|
|
|
16453
16027
|
workspaceAppIcons = EMPTY_WORKSPACE_APP_ICONS
|
|
16454
16028
|
}) {
|
|
16455
16029
|
"use memo";
|
|
16456
|
-
const [isExpanded, setIsExpanded] =
|
|
16457
|
-
const singlePromptTextRef =
|
|
16458
|
-
const queuedPromptListRef =
|
|
16459
|
-
const pointerHandledEditPromptIdRef =
|
|
16460
|
-
const [isSinglePromptOverflowing, setIsSinglePromptOverflowing] =
|
|
16461
|
-
const [expandedListMaxHeightPx, setExpandedListMaxHeightPx] =
|
|
16030
|
+
const [isExpanded, setIsExpanded] = useState5(false);
|
|
16031
|
+
const singlePromptTextRef = useRef7(null);
|
|
16032
|
+
const queuedPromptListRef = useRef7(null);
|
|
16033
|
+
const pointerHandledEditPromptIdRef = useRef7(null);
|
|
16034
|
+
const [isSinglePromptOverflowing, setIsSinglePromptOverflowing] = useState5(false);
|
|
16035
|
+
const [expandedListMaxHeightPx, setExpandedListMaxHeightPx] = useState5(280);
|
|
16462
16036
|
const singlePromptHasImages = queuedPrompts.length === 1 && queuedPromptImages(queuedPrompts[0]).length > 0;
|
|
16463
16037
|
const canExpand = queuedPrompts.length > 1 || singlePromptHasImages || isSinglePromptOverflowing;
|
|
16464
16038
|
const panelStyle = {
|
|
@@ -16498,7 +16072,7 @@ function AgentQueuedPromptPanel({
|
|
|
16498
16072
|
}
|
|
16499
16073
|
editQueuedPrompt(queuedPromptId);
|
|
16500
16074
|
};
|
|
16501
|
-
|
|
16075
|
+
useLayoutEffect(() => {
|
|
16502
16076
|
if (queuedPrompts.length !== 1) {
|
|
16503
16077
|
setIsSinglePromptOverflowing(false);
|
|
16504
16078
|
return;
|
|
@@ -16520,12 +16094,12 @@ function AgentQueuedPromptPanel({
|
|
|
16520
16094
|
resizeObserver?.disconnect();
|
|
16521
16095
|
};
|
|
16522
16096
|
}, [queuedPrompts]);
|
|
16523
|
-
|
|
16097
|
+
useLayoutEffect(() => {
|
|
16524
16098
|
if (!canExpand && isExpanded) {
|
|
16525
16099
|
setIsExpanded(false);
|
|
16526
16100
|
}
|
|
16527
16101
|
}, [canExpand, isExpanded]);
|
|
16528
|
-
|
|
16102
|
+
useLayoutEffect(() => {
|
|
16529
16103
|
const element = queuedPromptListRef.current;
|
|
16530
16104
|
if (!element) {
|
|
16531
16105
|
return;
|
|
@@ -16699,9 +16273,9 @@ import {
|
|
|
16699
16273
|
cloneElement,
|
|
16700
16274
|
useEffect as useEffect7,
|
|
16701
16275
|
useMemo as useMemo5,
|
|
16702
|
-
useState as
|
|
16276
|
+
useState as useState6
|
|
16703
16277
|
} from "react";
|
|
16704
|
-
import { ChevronDown
|
|
16278
|
+
import { ChevronDown, ZapIcon as ZapIcon2 } from "lucide-react";
|
|
16705
16279
|
import {
|
|
16706
16280
|
WorkspaceUserProjectSelect,
|
|
16707
16281
|
resolveWorkspaceUserProjectSelectLabels
|
|
@@ -17124,7 +16698,7 @@ function AgentProjectDropdown({
|
|
|
17124
16698
|
]
|
|
17125
16699
|
}
|
|
17126
16700
|
),
|
|
17127
|
-
/* @__PURE__ */ jsx23(
|
|
16701
|
+
/* @__PURE__ */ jsx23(ChevronDown, { "aria-hidden": "true", className: "shrink-0", size: 16 })
|
|
17128
16702
|
]
|
|
17129
16703
|
}
|
|
17130
16704
|
);
|
|
@@ -17172,7 +16746,7 @@ function AgentPermissionModeDropdown({
|
|
|
17172
16746
|
onSettingsChange
|
|
17173
16747
|
}) {
|
|
17174
16748
|
"use memo";
|
|
17175
|
-
const [isSelectOpen, setIsSelectOpen] =
|
|
16749
|
+
const [isSelectOpen, setIsSelectOpen] = useState6(false);
|
|
17176
16750
|
const isLoading = composerSettings.isSettingsLoading || composerSettings.isModelOptionsLoading === true;
|
|
17177
16751
|
const availableOptions = composerSettings.availablePermissionModes ?? [];
|
|
17178
16752
|
const selectedValue = composerSettings.selectedPermissionModeValue ?? composerSettings.draftSettings.permissionModeId;
|
|
@@ -17214,7 +16788,7 @@ function AgentPermissionModeDropdown({
|
|
|
17214
16788
|
"data-permission-tone": triggerTone,
|
|
17215
16789
|
children: [
|
|
17216
16790
|
/* @__PURE__ */ jsx23("span", { className: "flex min-w-0 flex-1 items-center", children: /* @__PURE__ */ jsx23("span", { className: "truncate", children: triggerLabel }) }),
|
|
17217
|
-
/* @__PURE__ */ jsx23(
|
|
16791
|
+
/* @__PURE__ */ jsx23(ChevronDown, { "aria-hidden": "true", className: "shrink-0", size: 16 })
|
|
17218
16792
|
]
|
|
17219
16793
|
}
|
|
17220
16794
|
);
|
|
@@ -17402,7 +16976,7 @@ function AgentModelReasoningDropdown({
|
|
|
17402
16976
|
onSettingsChange
|
|
17403
16977
|
}) {
|
|
17404
16978
|
"use memo";
|
|
17405
|
-
const [menuOpen, setMenuOpen] =
|
|
16979
|
+
const [menuOpen, setMenuOpen] = useState6(false);
|
|
17406
16980
|
const menu = buildComposerModelMenuModel(composerSettings, labels);
|
|
17407
16981
|
const menuDisabled = disabled || menu.disabled;
|
|
17408
16982
|
const isModelLoading = composerSettings.isModelOptionsLoading || composerSettings.isSettingsLoading;
|
|
@@ -17438,7 +17012,7 @@ function AgentModelReasoningDropdown({
|
|
|
17438
17012
|
/* @__PURE__ */ jsx23("span", { className: "shrink-0", children: menu.trigger.reasoningLabel })
|
|
17439
17013
|
] })
|
|
17440
17014
|
] }),
|
|
17441
|
-
/* @__PURE__ */ jsx23(
|
|
17015
|
+
/* @__PURE__ */ jsx23(ChevronDown, { "aria-hidden": "true", className: "shrink-0", size: 16 })
|
|
17442
17016
|
]
|
|
17443
17017
|
}
|
|
17444
17018
|
);
|
|
@@ -17669,12 +17243,12 @@ function ComposerModelOptionTooltip({
|
|
|
17669
17243
|
// agent-gui/agentGuiNode/agentRichText/AgentRichTextEditor.tsx
|
|
17670
17244
|
import {
|
|
17671
17245
|
forwardRef as forwardRef3,
|
|
17672
|
-
useCallback as
|
|
17246
|
+
useCallback as useCallback6,
|
|
17673
17247
|
useEffect as useEffect8,
|
|
17674
17248
|
useImperativeHandle as useImperativeHandle2,
|
|
17675
17249
|
useMemo as useMemo6,
|
|
17676
|
-
useRef as
|
|
17677
|
-
useState as
|
|
17250
|
+
useRef as useRef8,
|
|
17251
|
+
useState as useState7
|
|
17678
17252
|
} from "react";
|
|
17679
17253
|
import { createPortal } from "react-dom";
|
|
17680
17254
|
import { Extension } from "@tiptap/core";
|
|
@@ -18233,34 +17807,34 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18233
17807
|
}, ref) {
|
|
18234
17808
|
"use memo";
|
|
18235
17809
|
const { t } = useTranslation();
|
|
18236
|
-
const lastEmittedPromptRef =
|
|
18237
|
-
const editorRef =
|
|
18238
|
-
const onChangeRef =
|
|
18239
|
-
const onSubmitRef =
|
|
18240
|
-
const onSubmitGuidanceRef =
|
|
18241
|
-
const onKeyDownForPaletteRef =
|
|
18242
|
-
const onFileMentionSuggestionChangeRef =
|
|
17810
|
+
const lastEmittedPromptRef = useRef8(value);
|
|
17811
|
+
const editorRef = useRef8(null);
|
|
17812
|
+
const onChangeRef = useRef8(onChange);
|
|
17813
|
+
const onSubmitRef = useRef8(onSubmit);
|
|
17814
|
+
const onSubmitGuidanceRef = useRef8(onSubmitGuidance);
|
|
17815
|
+
const onKeyDownForPaletteRef = useRef8(onKeyDownForPalette);
|
|
17816
|
+
const onFileMentionSuggestionChangeRef = useRef8(
|
|
18243
17817
|
onFileMentionSuggestionChange
|
|
18244
17818
|
);
|
|
18245
|
-
const onFileMentionSuggestionKeyDownRef =
|
|
17819
|
+
const onFileMentionSuggestionKeyDownRef = useRef8(
|
|
18246
17820
|
onFileMentionSuggestionKeyDown
|
|
18247
17821
|
);
|
|
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 =
|
|
17822
|
+
const onLinkClickRef = useRef8(onLinkClick);
|
|
17823
|
+
const onPromptImagesUnsupportedRef = useRef8(onPromptImagesUnsupported);
|
|
17824
|
+
const onPasteImagesRef = useRef8(onPasteImages);
|
|
17825
|
+
const onDropFilesRef = useRef8(onDropFiles);
|
|
17826
|
+
const promptImagesSupportedRef = useRef8(promptImagesSupported);
|
|
17827
|
+
const getReferenceForFileRef = useRef8(getReferenceForFile);
|
|
17828
|
+
const placeholderRef = useRef8(placeholder);
|
|
17829
|
+
const removeMentionLabelRef = useRef8(removeMentionLabel);
|
|
17830
|
+
const availableSkillsRef = useRef8(availableSkills);
|
|
17831
|
+
const availableCapabilitiesRef = useRef8(availableCapabilities);
|
|
17832
|
+
const scrollFrameRef = useRef8(null);
|
|
17833
|
+
const [contextMenu, setContextMenu] = useState7(null);
|
|
17834
|
+
const closeContextMenu = useCallback6(() => {
|
|
18261
17835
|
setContextMenu(null);
|
|
18262
17836
|
}, []);
|
|
18263
|
-
const insertPlainText =
|
|
17837
|
+
const insertPlainText = useCallback6((text) => {
|
|
18264
17838
|
const currentEditor = editorRef.current;
|
|
18265
17839
|
if (!currentEditor || currentEditor.isDestroyed || !text) {
|
|
18266
17840
|
return;
|
|
@@ -18272,7 +17846,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18272
17846
|
})
|
|
18273
17847
|
).run();
|
|
18274
17848
|
}, []);
|
|
18275
|
-
const copySelection =
|
|
17849
|
+
const copySelection = useCallback6(async () => {
|
|
18276
17850
|
const currentEditor = editorRef.current;
|
|
18277
17851
|
const selectedText = contextMenu && contextMenu.hasSelection && currentEditor ? readPromptTextRange(
|
|
18278
17852
|
currentEditor,
|
|
@@ -18285,7 +17859,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18285
17859
|
}
|
|
18286
17860
|
await writePlainTextToClipboard(selectedText);
|
|
18287
17861
|
}, [closeContextMenu, contextMenu]);
|
|
18288
|
-
const cutSelection =
|
|
17862
|
+
const cutSelection = useCallback6(async () => {
|
|
18289
17863
|
const currentEditor = editorRef.current;
|
|
18290
17864
|
const selectionFrom = contextMenu?.selectionFrom ?? null;
|
|
18291
17865
|
const selectionTo = contextMenu?.selectionTo ?? null;
|
|
@@ -18304,7 +17878,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18304
17878
|
const { from, to } = selectionFrom !== null && selectionTo !== null && selectionFrom < selectionTo ? { from: selectionFrom, to: selectionTo } : currentEditor.state.selection;
|
|
18305
17879
|
currentEditor.chain().focus().deleteRange({ from, to }).run();
|
|
18306
17880
|
}, [closeContextMenu, contextMenu, disabled]);
|
|
18307
|
-
const pasteClipboardText =
|
|
17881
|
+
const pasteClipboardText = useCallback6(async () => {
|
|
18308
17882
|
closeContextMenu();
|
|
18309
17883
|
if (disabled) {
|
|
18310
17884
|
return;
|
|
@@ -18918,8 +18492,8 @@ function AgentRichTextContextMenuButton({
|
|
|
18918
18492
|
label,
|
|
18919
18493
|
onSelect
|
|
18920
18494
|
}) {
|
|
18921
|
-
const selectionStartedRef =
|
|
18922
|
-
const select =
|
|
18495
|
+
const selectionStartedRef = useRef8(false);
|
|
18496
|
+
const select = useCallback6(() => {
|
|
18923
18497
|
if (disabled || selectionStartedRef.current) {
|
|
18924
18498
|
return;
|
|
18925
18499
|
}
|
|
@@ -19076,7 +18650,7 @@ function AgentSlashStatusPanel({
|
|
|
19076
18650
|
}
|
|
19077
18651
|
|
|
19078
18652
|
// agent-gui/agentGuiNode/AgentReviewPickerPanel.tsx
|
|
19079
|
-
import { useCallback as
|
|
18653
|
+
import { useCallback as useCallback7, useEffect as useEffect9, useMemo as useMemo7, useRef as useRef9, useState as useState8 } from "react";
|
|
19080
18654
|
import { menuItemClassName } from "@tutti-os/ui-system";
|
|
19081
18655
|
|
|
19082
18656
|
// agent-gui/agentGuiNode/AgentReviewBranchController.ts
|
|
@@ -19191,15 +18765,15 @@ function AgentReviewPickerPanel({
|
|
|
19191
18765
|
onSubmitReview,
|
|
19192
18766
|
onClose
|
|
19193
18767
|
}) {
|
|
19194
|
-
const [stage, setStage] =
|
|
19195
|
-
const [query, setQuery] =
|
|
19196
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
19197
|
-
const searchInputRef =
|
|
19198
|
-
const highlightedOptionRef =
|
|
19199
|
-
const reviewBranchControllerRef =
|
|
18768
|
+
const [stage, setStage] = useState8("root");
|
|
18769
|
+
const [query, setQuery] = useState8("");
|
|
18770
|
+
const [highlightedIndex, setHighlightedIndex] = useState8(0);
|
|
18771
|
+
const searchInputRef = useRef9(null);
|
|
18772
|
+
const highlightedOptionRef = useRef9(null);
|
|
18773
|
+
const reviewBranchControllerRef = useRef9(
|
|
19200
18774
|
null
|
|
19201
18775
|
);
|
|
19202
|
-
const [branchState, setBranchState] =
|
|
18776
|
+
const [branchState, setBranchState] = useState8({
|
|
19203
18777
|
status: "idle",
|
|
19204
18778
|
branches: [],
|
|
19205
18779
|
currentBranch: null,
|
|
@@ -19228,18 +18802,18 @@ function AgentReviewPickerPanel({
|
|
|
19228
18802
|
useEffect9(() => {
|
|
19229
18803
|
searchInputRef.current?.focus();
|
|
19230
18804
|
}, [stage]);
|
|
19231
|
-
const submit =
|
|
18805
|
+
const submit = useCallback7(
|
|
19232
18806
|
(command) => {
|
|
19233
18807
|
onSubmitReview(command);
|
|
19234
18808
|
},
|
|
19235
18809
|
[onSubmitReview]
|
|
19236
18810
|
);
|
|
19237
|
-
const goToStage =
|
|
18811
|
+
const goToStage = useCallback7((next) => {
|
|
19238
18812
|
setStage(next);
|
|
19239
18813
|
setQuery("");
|
|
19240
18814
|
setHighlightedIndex(0);
|
|
19241
18815
|
}, []);
|
|
19242
|
-
const goBackToRoot =
|
|
18816
|
+
const goBackToRoot = useCallback7(() => {
|
|
19243
18817
|
setStage("root");
|
|
19244
18818
|
setQuery("");
|
|
19245
18819
|
setHighlightedIndex(0);
|
|
@@ -19327,7 +18901,7 @@ function AgentReviewPickerPanel({
|
|
|
19327
18901
|
emptyMessage = labels.branchEmpty;
|
|
19328
18902
|
}
|
|
19329
18903
|
}
|
|
19330
|
-
const handleKeyDown =
|
|
18904
|
+
const handleKeyDown = useCallback7(
|
|
19331
18905
|
(event) => {
|
|
19332
18906
|
if (event.key === "ArrowDown") {
|
|
19333
18907
|
event.preventDefault();
|
|
@@ -19437,12 +19011,12 @@ function AgentReviewPickerPanel({
|
|
|
19437
19011
|
// agent-gui/agentGuiNode/composerFloatingMenu/ComposerFloatingMenuSurface.tsx
|
|
19438
19012
|
import {
|
|
19439
19013
|
forwardRef as forwardRef4,
|
|
19440
|
-
useCallback as
|
|
19014
|
+
useCallback as useCallback8,
|
|
19441
19015
|
useEffect as useEffect10,
|
|
19442
|
-
useLayoutEffect as
|
|
19016
|
+
useLayoutEffect as useLayoutEffect2,
|
|
19443
19017
|
useMemo as useMemo8,
|
|
19444
|
-
useRef as
|
|
19445
|
-
useState as
|
|
19018
|
+
useRef as useRef10,
|
|
19019
|
+
useState as useState9
|
|
19446
19020
|
} from "react";
|
|
19447
19021
|
import { createPortal as createPortal2 } from "react-dom";
|
|
19448
19022
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
@@ -19519,8 +19093,8 @@ function useComposerAnchoredMenuFrame({
|
|
|
19519
19093
|
maxHeight,
|
|
19520
19094
|
open
|
|
19521
19095
|
}) {
|
|
19522
|
-
const [frame, setFrame] =
|
|
19523
|
-
const syncFrame =
|
|
19096
|
+
const [frame, setFrame] = useState9(null);
|
|
19097
|
+
const syncFrame = useCallback8(() => {
|
|
19524
19098
|
const anchor = anchorRef.current;
|
|
19525
19099
|
if (!anchor || typeof window === "undefined") {
|
|
19526
19100
|
setFrame(null);
|
|
@@ -19531,7 +19105,7 @@ function useComposerAnchoredMenuFrame({
|
|
|
19531
19105
|
(previous) => sameComposerAnchoredMenuFrame(previous, nextFrame) ? previous : nextFrame
|
|
19532
19106
|
);
|
|
19533
19107
|
}, [anchorRef, maxHeight]);
|
|
19534
|
-
|
|
19108
|
+
useLayoutEffect2(() => {
|
|
19535
19109
|
if (!open) {
|
|
19536
19110
|
setFrame(null);
|
|
19537
19111
|
return;
|
|
@@ -19573,13 +19147,13 @@ var ComposerFloatingMenuSurface = forwardRef4(function ComposerFloatingMenuSurfa
|
|
|
19573
19147
|
surfaceRef,
|
|
19574
19148
|
testId
|
|
19575
19149
|
}, forwardedRef) {
|
|
19576
|
-
const localSurfaceRef =
|
|
19150
|
+
const localSurfaceRef = useRef10(null);
|
|
19577
19151
|
const frame = useComposerAnchoredMenuFrame({
|
|
19578
19152
|
anchorRef,
|
|
19579
19153
|
maxHeight,
|
|
19580
19154
|
open
|
|
19581
19155
|
});
|
|
19582
|
-
const setSurfaceRef =
|
|
19156
|
+
const setSurfaceRef = useCallback8(
|
|
19583
19157
|
(node) => {
|
|
19584
19158
|
localSurfaceRef.current = node;
|
|
19585
19159
|
assignRef(surfaceRef, node);
|
|
@@ -19721,32 +19295,32 @@ function AgentUsageChip({
|
|
|
19721
19295
|
compactDisabled
|
|
19722
19296
|
}) {
|
|
19723
19297
|
"use memo";
|
|
19724
|
-
const [usagePopoverOpen, setUsagePopoverOpen] =
|
|
19725
|
-
const usagePopoverHoverTimerRef =
|
|
19298
|
+
const [usagePopoverOpen, setUsagePopoverOpen] = useState10(false);
|
|
19299
|
+
const usagePopoverHoverTimerRef = useRef11(null);
|
|
19726
19300
|
const clampedPercent = Math.max(0, Math.min(100, percentUsed));
|
|
19727
19301
|
const chipLabel = labels.usageChipLabel({ percent: clampedPercent });
|
|
19728
19302
|
const showTokens = usedTokens !== null && totalTokens !== null;
|
|
19729
19303
|
const usageLevel = agentUsageChipLevel(clampedPercent);
|
|
19730
19304
|
const ringColor = agentUsageRingColor(usageLevel);
|
|
19731
|
-
const usagePopoverCloseTimerRef =
|
|
19732
|
-
const clearUsagePopoverHoverTimer =
|
|
19305
|
+
const usagePopoverCloseTimerRef = useRef11(null);
|
|
19306
|
+
const clearUsagePopoverHoverTimer = useCallback9(() => {
|
|
19733
19307
|
if (usagePopoverHoverTimerRef.current) {
|
|
19734
19308
|
clearTimeout(usagePopoverHoverTimerRef.current);
|
|
19735
19309
|
usagePopoverHoverTimerRef.current = null;
|
|
19736
19310
|
}
|
|
19737
19311
|
}, []);
|
|
19738
|
-
const clearUsagePopoverCloseTimer =
|
|
19312
|
+
const clearUsagePopoverCloseTimer = useCallback9(() => {
|
|
19739
19313
|
if (usagePopoverCloseTimerRef.current) {
|
|
19740
19314
|
clearTimeout(usagePopoverCloseTimerRef.current);
|
|
19741
19315
|
usagePopoverCloseTimerRef.current = null;
|
|
19742
19316
|
}
|
|
19743
19317
|
}, []);
|
|
19744
|
-
const openUsagePopover =
|
|
19318
|
+
const openUsagePopover = useCallback9(() => {
|
|
19745
19319
|
clearUsagePopoverHoverTimer();
|
|
19746
19320
|
clearUsagePopoverCloseTimer();
|
|
19747
19321
|
setUsagePopoverOpen(true);
|
|
19748
19322
|
}, [clearUsagePopoverCloseTimer, clearUsagePopoverHoverTimer]);
|
|
19749
|
-
const openUsagePopoverAfterHoverDelay =
|
|
19323
|
+
const openUsagePopoverAfterHoverDelay = useCallback9(() => {
|
|
19750
19324
|
clearUsagePopoverHoverTimer();
|
|
19751
19325
|
clearUsagePopoverCloseTimer();
|
|
19752
19326
|
usagePopoverHoverTimerRef.current = setTimeout(() => {
|
|
@@ -19754,12 +19328,12 @@ function AgentUsageChip({
|
|
|
19754
19328
|
setUsagePopoverOpen(true);
|
|
19755
19329
|
}, USAGE_POPOVER_HOVER_DELAY_MS);
|
|
19756
19330
|
}, [clearUsagePopoverCloseTimer, clearUsagePopoverHoverTimer]);
|
|
19757
|
-
const closeUsagePopover =
|
|
19331
|
+
const closeUsagePopover = useCallback9(() => {
|
|
19758
19332
|
clearUsagePopoverHoverTimer();
|
|
19759
19333
|
clearUsagePopoverCloseTimer();
|
|
19760
19334
|
setUsagePopoverOpen(false);
|
|
19761
19335
|
}, [clearUsagePopoverCloseTimer, clearUsagePopoverHoverTimer]);
|
|
19762
|
-
const scheduleUsagePopoverClose =
|
|
19336
|
+
const scheduleUsagePopoverClose = useCallback9(() => {
|
|
19763
19337
|
clearUsagePopoverHoverTimer();
|
|
19764
19338
|
clearUsagePopoverCloseTimer();
|
|
19765
19339
|
usagePopoverCloseTimerRef.current = setTimeout(() => {
|
|
@@ -19767,7 +19341,7 @@ function AgentUsageChip({
|
|
|
19767
19341
|
setUsagePopoverOpen(false);
|
|
19768
19342
|
}, 140);
|
|
19769
19343
|
}, [clearUsagePopoverCloseTimer, clearUsagePopoverHoverTimer]);
|
|
19770
|
-
const handleUsagePopoverOpenChange =
|
|
19344
|
+
const handleUsagePopoverOpenChange = useCallback9(
|
|
19771
19345
|
(open) => {
|
|
19772
19346
|
if (open) {
|
|
19773
19347
|
openUsagePopover();
|
|
@@ -20001,28 +19575,28 @@ function AgentComposer({
|
|
|
20001
19575
|
const promptFilesSupported = Boolean(
|
|
20002
19576
|
resolveDroppedFileReferences && promptFileUploadSupported
|
|
20003
19577
|
);
|
|
20004
|
-
const [isPaletteOpen, setIsPaletteOpen] =
|
|
20005
|
-
const [isReviewPickerOpen, setIsReviewPickerOpen] =
|
|
20006
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
20007
|
-
const [mentionHighlightedKey, setMentionHighlightedKey] =
|
|
20008
|
-
const [shouldCenterMentionHighlight, setShouldCenterMentionHighlight] =
|
|
19578
|
+
const [isPaletteOpen, setIsPaletteOpen] = useState10(true);
|
|
19579
|
+
const [isReviewPickerOpen, setIsReviewPickerOpen] = useState10(false);
|
|
19580
|
+
const [highlightedIndex, setHighlightedIndex] = useState10(0);
|
|
19581
|
+
const [mentionHighlightedKey, setMentionHighlightedKey] = useState10(null);
|
|
19582
|
+
const [shouldCenterMentionHighlight, setShouldCenterMentionHighlight] = useState10(false);
|
|
20009
19583
|
const [
|
|
20010
19584
|
shouldResetMentionHighlightToFilter,
|
|
20011
19585
|
setShouldResetMentionHighlightToFilter
|
|
20012
|
-
] =
|
|
20013
|
-
const [paletteDraftPrompt, setPaletteDraftPrompt] =
|
|
19586
|
+
] = useState10(false);
|
|
19587
|
+
const [paletteDraftPrompt, setPaletteDraftPrompt] = useState10(
|
|
20014
19588
|
goalDraftObjective ?? draftPrompt
|
|
20015
19589
|
);
|
|
20016
|
-
const [fileMentionSuggestion, setFileMentionSuggestion] =
|
|
20017
|
-
const [isSelectedProjectMissing, setIsSelectedProjectMissing] =
|
|
20018
|
-
const [isSlashStatusPanelOpen, setIsSlashStatusPanelOpen] =
|
|
19590
|
+
const [fileMentionSuggestion, setFileMentionSuggestion] = useState10(null);
|
|
19591
|
+
const [isSelectedProjectMissing, setIsSelectedProjectMissing] = useState10(false);
|
|
19592
|
+
const [isSlashStatusPanelOpen, setIsSlashStatusPanelOpen] = useState10(false);
|
|
20019
19593
|
const slashStatusAgentSessionId = slashStatus?.agentSessionId ?? null;
|
|
20020
|
-
const previousSlashStatusAgentSessionIdRef =
|
|
19594
|
+
const previousSlashStatusAgentSessionIdRef = useRef11(
|
|
20021
19595
|
slashStatusAgentSessionId
|
|
20022
19596
|
);
|
|
20023
19597
|
const selectedProjectPath = composerSettings.selectedProjectPath?.trim() ?? "";
|
|
20024
|
-
const previousSelectedProjectPathRef =
|
|
20025
|
-
const [mentionSearchState, setMentionSearchState] =
|
|
19598
|
+
const previousSelectedProjectPathRef = useRef11(selectedProjectPath);
|
|
19599
|
+
const [mentionSearchState, setMentionSearchState] = useState10({
|
|
20026
19600
|
status: "idle",
|
|
20027
19601
|
query: "",
|
|
20028
19602
|
mode: "browse",
|
|
@@ -20031,30 +19605,30 @@ function AgentComposer({
|
|
|
20031
19605
|
groups: [],
|
|
20032
19606
|
error: null
|
|
20033
19607
|
});
|
|
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 =
|
|
19608
|
+
const composerRef = useRef11(null);
|
|
19609
|
+
const inputShellRef = useRef11(null);
|
|
19610
|
+
const promptInputAreaRef = useRef11(null);
|
|
19611
|
+
const paletteContentRef = useRef11(null);
|
|
19612
|
+
const draftPromptRef = useRef11(draftPrompt);
|
|
19613
|
+
const draftImagesRef = useRef11(draftImages);
|
|
19614
|
+
const draftFilesRef = useRef11(draftFiles);
|
|
19615
|
+
const promptTipRef = useRef11(null);
|
|
19616
|
+
const mentionControllerRef = useRef11(
|
|
20043
19617
|
null
|
|
20044
19618
|
);
|
|
20045
|
-
const editorHandleRef =
|
|
20046
|
-
const wasActiveRef =
|
|
20047
|
-
const lastComposerFocusRequestRef =
|
|
20048
|
-
const autoMentionHighlightedKeyRef =
|
|
20049
|
-
const [isPromptTipOverflowing, setIsPromptTipOverflowing] =
|
|
20050
|
-
const [dockComposerInputHeight, setDockComposerInputHeight] =
|
|
19619
|
+
const editorHandleRef = useRef11(null);
|
|
19620
|
+
const wasActiveRef = useRef11(isActive);
|
|
19621
|
+
const lastComposerFocusRequestRef = useRef11(null);
|
|
19622
|
+
const autoMentionHighlightedKeyRef = useRef11(null);
|
|
19623
|
+
const [isPromptTipOverflowing, setIsPromptTipOverflowing] = useState10(false);
|
|
19624
|
+
const [dockComposerInputHeight, setDockComposerInputHeight] = useState10(
|
|
20051
19625
|
DOCK_COMPOSER_INPUT_MIN_HEIGHT
|
|
20052
19626
|
);
|
|
20053
|
-
const [dockComposerInputMaxHeight, setDockComposerInputMaxHeight] =
|
|
19627
|
+
const [dockComposerInputMaxHeight, setDockComposerInputMaxHeight] = useState10(
|
|
20054
19628
|
DOCK_COMPOSER_INPUT_MAX_HEIGHT
|
|
20055
19629
|
);
|
|
20056
|
-
const [dockComposerAttachmentHeight, setDockComposerAttachmentHeight] =
|
|
20057
|
-
const [dockComposerTextHeight, setDockComposerTextHeight] =
|
|
19630
|
+
const [dockComposerAttachmentHeight, setDockComposerAttachmentHeight] = useState10(0);
|
|
19631
|
+
const [dockComposerTextHeight, setDockComposerTextHeight] = useState10(
|
|
20058
19632
|
DOCK_COMPOSER_INPUT_MIN_HEIGHT
|
|
20059
19633
|
);
|
|
20060
19634
|
const slashQuery = isGoalModeActive ? null : getPromptStartSlashCommandQuery(paletteDraftPrompt);
|
|
@@ -20214,7 +19788,7 @@ function AgentComposer({
|
|
|
20214
19788
|
highlightedIndex,
|
|
20215
19789
|
slashPaletteEntries.length
|
|
20216
19790
|
);
|
|
20217
|
-
const [mentionPaletteFrame, setMentionPaletteFrame] =
|
|
19791
|
+
const [mentionPaletteFrame, setMentionPaletteFrame] = useState10(null);
|
|
20218
19792
|
useEffect11(() => {
|
|
20219
19793
|
setHighlightedIndex(0);
|
|
20220
19794
|
}, [skillQueryMatch?.prefix, skillQueryMatch?.query, slashQuery]);
|
|
@@ -20287,26 +19861,26 @@ function AgentComposer({
|
|
|
20287
19861
|
previousSlashStatusAgentSessionIdRef.current = slashStatusAgentSessionId;
|
|
20288
19862
|
setIsSlashStatusPanelOpen(false);
|
|
20289
19863
|
}, [slashStatusAgentSessionId]);
|
|
20290
|
-
const clearSlashCommandDraft =
|
|
19864
|
+
const clearSlashCommandDraft = useCallback9(() => {
|
|
20291
19865
|
draftPromptRef.current = "";
|
|
20292
19866
|
setPaletteDraftPrompt("");
|
|
20293
19867
|
setIsPaletteOpen(false);
|
|
20294
19868
|
onDraftContentChange(emptyAgentComposerDraft());
|
|
20295
19869
|
}, [onDraftContentChange]);
|
|
20296
|
-
const closeSlashStatusPanel =
|
|
19870
|
+
const closeSlashStatusPanel = useCallback9(() => {
|
|
20297
19871
|
setIsSlashStatusPanelOpen(false);
|
|
20298
19872
|
}, []);
|
|
20299
19873
|
const settingsControlsDisabled = isSendingTurn || isSubmittingPrompt || showStopButton;
|
|
20300
19874
|
const composerControlsHardDisabled = isSelectedProjectMissing || isSubmittingPrompt || disabled && !isSendingTurn && !showStopButton;
|
|
20301
|
-
const closeReviewPicker =
|
|
19875
|
+
const closeReviewPicker = useCallback9(() => {
|
|
20302
19876
|
setIsReviewPickerOpen(false);
|
|
20303
19877
|
}, []);
|
|
20304
|
-
const closeSlashFloatingMenu =
|
|
19878
|
+
const closeSlashFloatingMenu = useCallback9(() => {
|
|
20305
19879
|
setIsSlashStatusPanelOpen(false);
|
|
20306
19880
|
setIsReviewPickerOpen(false);
|
|
20307
19881
|
setIsPaletteOpen(false);
|
|
20308
19882
|
}, []);
|
|
20309
|
-
const submitReviewCommand =
|
|
19883
|
+
const submitReviewCommand = useCallback9(
|
|
20310
19884
|
(command) => {
|
|
20311
19885
|
setIsReviewPickerOpen(false);
|
|
20312
19886
|
clearSlashCommandDraft();
|
|
@@ -20326,7 +19900,7 @@ function AgentComposer({
|
|
|
20326
19900
|
}
|
|
20327
19901
|
return null;
|
|
20328
19902
|
}, [onRequestGitBranches, selectedProjectPath, slashStatusAgentSessionId]);
|
|
20329
|
-
const executeSlashCommandEffect =
|
|
19903
|
+
const executeSlashCommandEffect = useCallback9(
|
|
20330
19904
|
(effect) => {
|
|
20331
19905
|
if (effect.kind === "submitPrompt") {
|
|
20332
19906
|
clearSlashCommandDraft();
|
|
@@ -20422,7 +19996,7 @@ function AgentComposer({
|
|
|
20422
19996
|
settingsControlsDisabled
|
|
20423
19997
|
]
|
|
20424
19998
|
);
|
|
20425
|
-
const selectCommand =
|
|
19999
|
+
const selectCommand = useCallback9(
|
|
20426
20000
|
(command) => {
|
|
20427
20001
|
const selectionEffect = resolveSlashCommandSelectionEffect({
|
|
20428
20002
|
provider,
|
|
@@ -20433,7 +20007,7 @@ function AgentComposer({
|
|
|
20433
20007
|
},
|
|
20434
20008
|
[executeSlashCommandEffect, provider]
|
|
20435
20009
|
);
|
|
20436
|
-
const selectCapability =
|
|
20010
|
+
const selectCapability = useCallback9(
|
|
20437
20011
|
(capability) => {
|
|
20438
20012
|
const selectionEffect = resolveSlashCommandSelectionEffect({
|
|
20439
20013
|
provider,
|
|
@@ -20444,14 +20018,14 @@ function AgentComposer({
|
|
|
20444
20018
|
},
|
|
20445
20019
|
[executeSlashCommandEffect, provider]
|
|
20446
20020
|
);
|
|
20447
|
-
const selectCapabilitySettings =
|
|
20021
|
+
const selectCapabilitySettings = useCallback9(
|
|
20448
20022
|
(capability) => {
|
|
20449
20023
|
onCapabilitySettingsRequest?.(capability.capability);
|
|
20450
20024
|
setIsPaletteOpen(false);
|
|
20451
20025
|
},
|
|
20452
20026
|
[onCapabilitySettingsRequest]
|
|
20453
20027
|
);
|
|
20454
|
-
const selectSkill =
|
|
20028
|
+
const selectSkill = useCallback9(
|
|
20455
20029
|
(skill) => {
|
|
20456
20030
|
const trigger = skillTriggerForPrefix(skill, skillQueryMatch?.prefix);
|
|
20457
20031
|
const replacedDraft = trigger && skillQueryMatch && promptBeforeSelection !== "" ? editorHandleRef.current?.replaceTextBeforeSelection(
|
|
@@ -20543,7 +20117,7 @@ function AgentComposer({
|
|
|
20543
20117
|
onDraftContentChange(emptyAgentComposerDraft());
|
|
20544
20118
|
}
|
|
20545
20119
|
);
|
|
20546
|
-
const submit =
|
|
20120
|
+
const submit = useCallback9(
|
|
20547
20121
|
(event) => {
|
|
20548
20122
|
event.preventDefault();
|
|
20549
20123
|
submitCurrentPrompt();
|
|
@@ -20603,7 +20177,7 @@ function AgentComposer({
|
|
|
20603
20177
|
return true;
|
|
20604
20178
|
}
|
|
20605
20179
|
);
|
|
20606
|
-
const selectFileMention =
|
|
20180
|
+
const selectFileMention = useCallback9(
|
|
20607
20181
|
(entry) => {
|
|
20608
20182
|
if (entry.kind === "file" && entry.mentionNavigation === "agent-generated-folder-back" && mentionControllerRef.current?.selectAgentGeneratedMentionItem(entry)) {
|
|
20609
20183
|
return;
|
|
@@ -20618,7 +20192,7 @@ function AgentComposer({
|
|
|
20618
20192
|
},
|
|
20619
20193
|
[fileMentionSuggestion]
|
|
20620
20194
|
);
|
|
20621
|
-
const closeFileMentionPalette =
|
|
20195
|
+
const closeFileMentionPalette = useCallback9(() => {
|
|
20622
20196
|
if (fileMentionSuggestion) {
|
|
20623
20197
|
exitAgentFileMentionSuggestion(fileMentionSuggestion.editor);
|
|
20624
20198
|
}
|
|
@@ -20626,7 +20200,7 @@ function AgentComposer({
|
|
|
20626
20200
|
setFileMentionSuggestion(null);
|
|
20627
20201
|
setIsPaletteOpen(false);
|
|
20628
20202
|
}, [fileMentionSuggestion]);
|
|
20629
|
-
const clearActiveFileMentionTrigger =
|
|
20203
|
+
const clearActiveFileMentionTrigger = useCallback9(() => {
|
|
20630
20204
|
if (!fileMentionSuggestion) {
|
|
20631
20205
|
return;
|
|
20632
20206
|
}
|
|
@@ -20642,14 +20216,14 @@ function AgentComposer({
|
|
|
20642
20216
|
setPaletteDraftPrompt(nextDraft);
|
|
20643
20217
|
onDraftContentChange({ ...draftContent, prompt: nextDraft });
|
|
20644
20218
|
}, [draftContent, fileMentionSuggestion, onDraftContentChange]);
|
|
20645
|
-
const closeOpenPalette =
|
|
20219
|
+
const closeOpenPalette = useCallback9(() => {
|
|
20646
20220
|
if (showFileMentionPalette) {
|
|
20647
20221
|
closeFileMentionPalette();
|
|
20648
20222
|
return;
|
|
20649
20223
|
}
|
|
20650
20224
|
setIsPaletteOpen(false);
|
|
20651
20225
|
}, [closeFileMentionPalette, showFileMentionPalette]);
|
|
20652
|
-
const createFileMentionPaletteAdapter =
|
|
20226
|
+
const createFileMentionPaletteAdapter = useCallback9(
|
|
20653
20227
|
(highlightedKey = mentionHighlightedKey) => createMentionPaletteStateAdapter({
|
|
20654
20228
|
state: mentionSearchState,
|
|
20655
20229
|
highlightedKey,
|
|
@@ -20678,23 +20252,23 @@ function AgentComposer({
|
|
|
20678
20252
|
}),
|
|
20679
20253
|
[mentionHighlightedKey, mentionSearchState, selectFileMention]
|
|
20680
20254
|
);
|
|
20681
|
-
const moveFileMentionSelection =
|
|
20255
|
+
const moveFileMentionSelection = useCallback9(
|
|
20682
20256
|
(delta) => {
|
|
20683
20257
|
createFileMentionPaletteAdapter().moveSelection(delta);
|
|
20684
20258
|
},
|
|
20685
20259
|
[createFileMentionPaletteAdapter]
|
|
20686
20260
|
);
|
|
20687
|
-
const handleMentionHighlightChange =
|
|
20261
|
+
const handleMentionHighlightChange = useCallback9((key) => {
|
|
20688
20262
|
autoMentionHighlightedKeyRef.current = null;
|
|
20689
20263
|
setMentionHighlightedKey(key);
|
|
20690
20264
|
}, []);
|
|
20691
|
-
const cycleFileMentionFilter =
|
|
20265
|
+
const cycleFileMentionFilter = useCallback9(
|
|
20692
20266
|
(delta = 1) => {
|
|
20693
20267
|
createFileMentionPaletteAdapter().cycleCategory(delta);
|
|
20694
20268
|
},
|
|
20695
20269
|
[createFileMentionPaletteAdapter]
|
|
20696
20270
|
);
|
|
20697
|
-
const navigateFileMentionHierarchy =
|
|
20271
|
+
const navigateFileMentionHierarchy = useCallback9(
|
|
20698
20272
|
(delta) => {
|
|
20699
20273
|
if (delta === -1) {
|
|
20700
20274
|
return mentionControllerRef.current?.exitAgentGeneratedBrowse() ?? false;
|
|
@@ -20710,13 +20284,13 @@ function AgentComposer({
|
|
|
20710
20284
|
},
|
|
20711
20285
|
[createFileMentionPaletteAdapter]
|
|
20712
20286
|
);
|
|
20713
|
-
const navigateIntoFileMentionItem =
|
|
20287
|
+
const navigateIntoFileMentionItem = useCallback9(
|
|
20714
20288
|
(item) => {
|
|
20715
20289
|
mentionControllerRef.current?.selectAgentGeneratedMentionItem(item);
|
|
20716
20290
|
},
|
|
20717
20291
|
[]
|
|
20718
20292
|
);
|
|
20719
|
-
const handleFileMentionKeyDown =
|
|
20293
|
+
const handleFileMentionKeyDown = useCallback9(
|
|
20720
20294
|
(event) => {
|
|
20721
20295
|
if (!showFileMentionPalette) {
|
|
20722
20296
|
return false;
|
|
@@ -20740,7 +20314,7 @@ function AgentComposer({
|
|
|
20740
20314
|
showFileMentionPalette
|
|
20741
20315
|
]
|
|
20742
20316
|
);
|
|
20743
|
-
const handlePlanModeToggleKeyDown =
|
|
20317
|
+
const handlePlanModeToggleKeyDown = useCallback9(
|
|
20744
20318
|
(event) => {
|
|
20745
20319
|
if (event.key !== "Tab" || !event.shiftKey || event.metaKey || event.ctrlKey || event.altKey) {
|
|
20746
20320
|
return false;
|
|
@@ -20795,7 +20369,7 @@ function AgentComposer({
|
|
|
20795
20369
|
});
|
|
20796
20370
|
};
|
|
20797
20371
|
}, [handlePaletteKeyDown, showPalette]);
|
|
20798
|
-
const handleFileMentionSuggestionChange =
|
|
20372
|
+
const handleFileMentionSuggestionChange = useCallback9(
|
|
20799
20373
|
(state) => {
|
|
20800
20374
|
setFileMentionSuggestion(state);
|
|
20801
20375
|
if (!state) {
|
|
@@ -20812,8 +20386,8 @@ function AgentComposer({
|
|
|
20812
20386
|
},
|
|
20813
20387
|
[currentUserId, selectedProjectPath, workspaceId]
|
|
20814
20388
|
);
|
|
20815
|
-
const openReferencesForEntityRef =
|
|
20816
|
-
const handleLinkClick =
|
|
20389
|
+
const openReferencesForEntityRef = useRef11(null);
|
|
20390
|
+
const handleLinkClick = useCallback9(
|
|
20817
20391
|
(href) => {
|
|
20818
20392
|
const item = parseMentionItemFromHref({ name: "", href });
|
|
20819
20393
|
if (item?.kind === "workspace-reference") {
|
|
@@ -20888,7 +20462,7 @@ function AgentComposer({
|
|
|
20888
20462
|
onDraftContentChange({ ...draftContent, prompt: nextDraft });
|
|
20889
20463
|
}
|
|
20890
20464
|
);
|
|
20891
|
-
const clearGoalModeBadge =
|
|
20465
|
+
const clearGoalModeBadge = useCallback9(() => {
|
|
20892
20466
|
if (!isGoalModeActive) {
|
|
20893
20467
|
return;
|
|
20894
20468
|
}
|
|
@@ -20902,7 +20476,7 @@ function AgentComposer({
|
|
|
20902
20476
|
isGoalModeActive,
|
|
20903
20477
|
onDraftContentChange
|
|
20904
20478
|
]);
|
|
20905
|
-
const addDraftImages =
|
|
20479
|
+
const addDraftImages = useCallback9(
|
|
20906
20480
|
(images) => {
|
|
20907
20481
|
if (images.length === 0) {
|
|
20908
20482
|
return;
|
|
@@ -20999,7 +20573,7 @@ function AgentComposer({
|
|
|
20999
20573
|
workspaceId
|
|
21000
20574
|
]
|
|
21001
20575
|
);
|
|
21002
|
-
const removeDraftImage =
|
|
20576
|
+
const removeDraftImage = useCallback9(
|
|
21003
20577
|
(id) => {
|
|
21004
20578
|
const nextDraftImages = draftImagesRef.current.filter(
|
|
21005
20579
|
(image) => image.id !== id
|
|
@@ -21013,7 +20587,7 @@ function AgentComposer({
|
|
|
21013
20587
|
},
|
|
21014
20588
|
[onDraftContentChange]
|
|
21015
20589
|
);
|
|
21016
|
-
const removeDraftFile =
|
|
20590
|
+
const removeDraftFile = useCallback9(
|
|
21017
20591
|
(id) => {
|
|
21018
20592
|
const nextDraftFiles = draftFilesRef.current.filter(
|
|
21019
20593
|
(file) => file.id !== id
|
|
@@ -21027,7 +20601,7 @@ function AgentComposer({
|
|
|
21027
20601
|
},
|
|
21028
20602
|
[onDraftContentChange]
|
|
21029
20603
|
);
|
|
21030
|
-
const applyReferencePickResult =
|
|
20604
|
+
const applyReferencePickResult = useCallback9(
|
|
21031
20605
|
async (result) => {
|
|
21032
20606
|
if (result.files.length > 0) {
|
|
21033
20607
|
const uploadPromptContent = promptFileUploadSupported ? agentActivityRuntime?.uploadPromptContent : void 0;
|
|
@@ -21076,13 +20650,13 @@ function AgentComposer({
|
|
|
21076
20650
|
},
|
|
21077
20651
|
[agentActivityRuntime, promptFileUploadSupported, workspaceId]
|
|
21078
20652
|
);
|
|
21079
|
-
const handleWorkspaceReferencePicker =
|
|
20653
|
+
const handleWorkspaceReferencePicker = useCallback9(async () => {
|
|
21080
20654
|
if (!onRequestWorkspaceReferences) {
|
|
21081
20655
|
return;
|
|
21082
20656
|
}
|
|
21083
20657
|
await applyReferencePickResult(await onRequestWorkspaceReferences());
|
|
21084
20658
|
}, [applyReferencePickResult, onRequestWorkspaceReferences]);
|
|
21085
|
-
const applyDroppedFileReferences =
|
|
20659
|
+
const applyDroppedFileReferences = useCallback9(
|
|
21086
20660
|
async (files) => {
|
|
21087
20661
|
if (!promptFilesSupported || !resolveDroppedFileReferences || files.length === 0) {
|
|
21088
20662
|
return;
|
|
@@ -21099,7 +20673,7 @@ function AgentComposer({
|
|
|
21099
20673
|
resolveDroppedFileReferences
|
|
21100
20674
|
]
|
|
21101
20675
|
);
|
|
21102
|
-
const handleOpenReferencesForEntity =
|
|
20676
|
+
const handleOpenReferencesForEntity = useCallback9(
|
|
21103
20677
|
(entity) => {
|
|
21104
20678
|
clearActiveFileMentionTrigger();
|
|
21105
20679
|
closeFileMentionPalette();
|
|
@@ -21118,7 +20692,7 @@ function AgentComposer({
|
|
|
21118
20692
|
]
|
|
21119
20693
|
);
|
|
21120
20694
|
openReferencesForEntityRef.current = handleOpenReferencesForEntity;
|
|
21121
|
-
const syncMentionPaletteFrame =
|
|
20695
|
+
const syncMentionPaletteFrame = useCallback9(() => {
|
|
21122
20696
|
const anchor = inputShellRef.current;
|
|
21123
20697
|
if (!anchor || typeof window === "undefined") {
|
|
21124
20698
|
setMentionPaletteFrame(null);
|
|
@@ -21158,7 +20732,7 @@ function AgentComposer({
|
|
|
21158
20732
|
zIndex: resolveMentionPaletteZIndex(anchor)
|
|
21159
20733
|
});
|
|
21160
20734
|
}, []);
|
|
21161
|
-
|
|
20735
|
+
useLayoutEffect3(() => {
|
|
21162
20736
|
if (!showFileMentionPalette) {
|
|
21163
20737
|
setMentionPaletteFrame(null);
|
|
21164
20738
|
return;
|
|
@@ -21202,7 +20776,7 @@ function AgentComposer({
|
|
|
21202
20776
|
isHeroLayout && AgentGUINode_styles_default.composerInputShellHero
|
|
21203
20777
|
);
|
|
21204
20778
|
const inputDisabled = isSelectedProjectMissing || disabled && !canQueueWhileBusy;
|
|
21205
|
-
const scheduleComposerFocus =
|
|
20779
|
+
const scheduleComposerFocus = useCallback9(() => {
|
|
21206
20780
|
if (inputDisabled) {
|
|
21207
20781
|
return;
|
|
21208
20782
|
}
|
|
@@ -21212,7 +20786,7 @@ function AgentComposer({
|
|
|
21212
20786
|
});
|
|
21213
20787
|
});
|
|
21214
20788
|
}, [inputDisabled]);
|
|
21215
|
-
const handlePastedImages =
|
|
20789
|
+
const handlePastedImages = useCallback9(
|
|
21216
20790
|
(images) => {
|
|
21217
20791
|
addDraftImages(images);
|
|
21218
20792
|
scheduleComposerFocus();
|
|
@@ -21351,7 +20925,7 @@ function AgentComposer({
|
|
|
21351
20925
|
"--agent-gui-prompt-tip-count": promptTips.length,
|
|
21352
20926
|
"--agent-gui-prompt-tip-cycle-duration": `${promptTips.length * PROMPT_TIP_CYCLE_STEP_MS}ms`
|
|
21353
20927
|
} : void 0;
|
|
21354
|
-
|
|
20928
|
+
useLayoutEffect3(() => {
|
|
21355
20929
|
if (previewMode) {
|
|
21356
20930
|
setIsPromptTipOverflowing(false);
|
|
21357
20931
|
return;
|
|
@@ -21385,7 +20959,7 @@ function AgentComposer({
|
|
|
21385
20959
|
isPromptTipOverflowing,
|
|
21386
20960
|
previewMode
|
|
21387
20961
|
]);
|
|
21388
|
-
|
|
20962
|
+
useLayoutEffect3(() => {
|
|
21389
20963
|
if (isHeroLayout) {
|
|
21390
20964
|
setDockComposerInputHeight(DOCK_COMPOSER_INPUT_MIN_HEIGHT);
|
|
21391
20965
|
setDockComposerInputMaxHeight(DOCK_COMPOSER_INPUT_MAX_HEIGHT);
|
|
@@ -21532,7 +21106,7 @@ function AgentComposer({
|
|
|
21532
21106
|
const sendButtonState = isQueueMode ? "queue" : shouldShowStopButton ? isInterrupting ? "stopping" : "interrupt" : isSendingTurn ? "loading" : "send";
|
|
21533
21107
|
const sendButtonBusy = isSendingTurn && !isQueueMode;
|
|
21534
21108
|
const activePromptRequestId = activePrompt?.requestId ?? null;
|
|
21535
|
-
const [dismissedPromptRequestId, setDismissedPromptRequestId] =
|
|
21109
|
+
const [dismissedPromptRequestId, setDismissedPromptRequestId] = useState10(null);
|
|
21536
21110
|
const visibleActivePrompt = activePrompt && dismissedPromptRequestId !== activePromptRequestId ? activePrompt : null;
|
|
21537
21111
|
const disabledReasonText = disabledReason?.trim() ?? "";
|
|
21538
21112
|
const effectivePlaceholder = disabledReasonText || placeholder;
|
|
@@ -21556,7 +21130,7 @@ function AgentComposer({
|
|
|
21556
21130
|
useEffect11(() => {
|
|
21557
21131
|
setDismissedPromptRequestId(null);
|
|
21558
21132
|
}, [activePromptRequestId]);
|
|
21559
|
-
const submitInteractivePromptAndDismiss =
|
|
21133
|
+
const submitInteractivePromptAndDismiss = useCallback9(
|
|
21560
21134
|
(input) => {
|
|
21561
21135
|
onSubmitInteractivePrompt(input);
|
|
21562
21136
|
setDismissedPromptRequestId(input.requestId);
|
|
@@ -22283,7 +21857,7 @@ function AgentComposerDraftImagePreview({
|
|
|
22283
21857
|
removeLabel,
|
|
22284
21858
|
onRemove
|
|
22285
21859
|
}) {
|
|
22286
|
-
const [aspectRatio, setAspectRatio] =
|
|
21860
|
+
const [aspectRatio, setAspectRatio] = useState10(1);
|
|
22287
21861
|
const previewWidth = Math.round(
|
|
22288
21862
|
Math.min(
|
|
22289
21863
|
DRAFT_IMAGE_PREVIEW_MAX_WIDTH_PX,
|
|
@@ -22433,9 +22007,9 @@ function isSlashCommandCapability(command) {
|
|
|
22433
22007
|
return "kind" in command && command.kind === "capability";
|
|
22434
22008
|
}
|
|
22435
22009
|
function useStableEventCallback(callback) {
|
|
22436
|
-
const callbackRef =
|
|
22010
|
+
const callbackRef = useRef11(callback);
|
|
22437
22011
|
callbackRef.current = callback;
|
|
22438
|
-
return
|
|
22012
|
+
return useCallback9((...args) => callbackRef.current(...args), []);
|
|
22439
22013
|
}
|
|
22440
22014
|
function SendFilledIcon() {
|
|
22441
22015
|
"use memo";
|
|
@@ -22932,7 +22506,7 @@ function slashStatusesEqual(left, right) {
|
|
|
22932
22506
|
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
22507
|
}
|
|
22934
22508
|
function useStableSlashStatus(status) {
|
|
22935
|
-
const statusRef =
|
|
22509
|
+
const statusRef = useRef12(null);
|
|
22936
22510
|
if (statusRef.current === null || !slashStatusesEqual(statusRef.current, status)) {
|
|
22937
22511
|
statusRef.current = status;
|
|
22938
22512
|
}
|
|
@@ -23019,32 +22593,32 @@ function AgentGUINodeView({
|
|
|
23019
22593
|
workspaceAppIcons = EMPTY_WORKSPACE_APP_ICONS3
|
|
23020
22594
|
}) {
|
|
23021
22595
|
"use memo";
|
|
23022
|
-
const layoutElementRef =
|
|
23023
|
-
const railResizeInteractionRef =
|
|
23024
|
-
const [isRailResizing, setIsRailResizing] =
|
|
23025
|
-
const [railResizeWidthPx, setRailResizeWidthPx] =
|
|
22596
|
+
const layoutElementRef = useRef12(null);
|
|
22597
|
+
const railResizeInteractionRef = useRef12(null);
|
|
22598
|
+
const [isRailResizing, setIsRailResizing] = useState11(false);
|
|
22599
|
+
const [railResizeWidthPx, setRailResizeWidthPx] = useState11(
|
|
23026
22600
|
null
|
|
23027
22601
|
);
|
|
23028
|
-
const [workspaceReferencePickerOpen, setWorkspaceReferencePickerOpen] =
|
|
23029
|
-
const [workspaceReferencePickerTarget, setWorkspaceReferencePickerTarget] =
|
|
22602
|
+
const [workspaceReferencePickerOpen, setWorkspaceReferencePickerOpen] = useState11(false);
|
|
22603
|
+
const [workspaceReferencePickerTarget, setWorkspaceReferencePickerTarget] = useState11(null);
|
|
23030
22604
|
const [
|
|
23031
22605
|
localComposerFocusRequestSequence,
|
|
23032
22606
|
setLocalComposerFocusRequestSequence
|
|
23033
|
-
] =
|
|
23034
|
-
const handledNewConversationRequestSequenceRef =
|
|
22607
|
+
] = useState11(0);
|
|
22608
|
+
const handledNewConversationRequestSequenceRef = useRef12(
|
|
23035
22609
|
newConversationRequestSequence
|
|
23036
22610
|
);
|
|
23037
|
-
const workspaceReferencePickerResolverRef =
|
|
22611
|
+
const workspaceReferencePickerResolverRef = useRef12(null);
|
|
23038
22612
|
const emptyReferencePickResult = useMemo10(
|
|
23039
22613
|
() => ({ files: [], mentionItems: [] }),
|
|
23040
22614
|
[]
|
|
23041
22615
|
);
|
|
23042
22616
|
const hostLocalFileSourceId = "host-local-file";
|
|
23043
|
-
const isWorkspaceReferencePickerNodeSelectable =
|
|
22617
|
+
const isWorkspaceReferencePickerNodeSelectable = useCallback10(
|
|
23044
22618
|
(node) => node.ref.sourceId !== hostLocalFileSourceId || node.kind === "file",
|
|
23045
22619
|
[hostLocalFileSourceId]
|
|
23046
22620
|
);
|
|
23047
|
-
const requestWorkspaceReferences =
|
|
22621
|
+
const requestWorkspaceReferences = useCallback10(
|
|
23048
22622
|
async (entity) => {
|
|
23049
22623
|
if (previewMode) {
|
|
23050
22624
|
return emptyReferencePickResult;
|
|
@@ -23076,13 +22650,13 @@ function AgentGUINodeView({
|
|
|
23076
22650
|
workspaceFileReferenceCopy
|
|
23077
22651
|
]
|
|
23078
22652
|
);
|
|
23079
|
-
const closeWorkspaceReferencePicker =
|
|
22653
|
+
const closeWorkspaceReferencePicker = useCallback10(() => {
|
|
23080
22654
|
workspaceReferencePickerResolverRef.current?.(emptyReferencePickResult);
|
|
23081
22655
|
workspaceReferencePickerResolverRef.current = null;
|
|
23082
22656
|
setWorkspaceReferencePickerOpen(false);
|
|
23083
22657
|
setWorkspaceReferencePickerTarget(null);
|
|
23084
22658
|
}, [emptyReferencePickResult]);
|
|
23085
|
-
const settleReferencePicker =
|
|
22659
|
+
const settleReferencePicker = useCallback10(
|
|
23086
22660
|
(result, addedFiles) => {
|
|
23087
22661
|
workspaceReferencePickerResolverRef.current?.(result);
|
|
23088
22662
|
workspaceReferencePickerResolverRef.current = null;
|
|
@@ -23094,13 +22668,13 @@ function AgentGUINodeView({
|
|
|
23094
22668
|
},
|
|
23095
22669
|
[onWorkspaceFileReferencesAdded]
|
|
23096
22670
|
);
|
|
23097
|
-
const confirmWorkspaceReferencePicker =
|
|
22671
|
+
const confirmWorkspaceReferencePicker = useCallback10(
|
|
23098
22672
|
(refs) => {
|
|
23099
22673
|
settleReferencePicker({ files: refs, mentionItems: [] }, refs);
|
|
23100
22674
|
},
|
|
23101
22675
|
[settleReferencePicker]
|
|
23102
22676
|
);
|
|
23103
|
-
const confirmWorkspaceReferenceBundles =
|
|
22677
|
+
const confirmWorkspaceReferenceBundles = useCallback10(
|
|
23104
22678
|
(result) => {
|
|
23105
22679
|
const workspaceRefs = result.files.filter(
|
|
23106
22680
|
(ref) => ref.sourceId !== hostLocalFileSourceId
|
|
@@ -23174,7 +22748,7 @@ function AgentGUINodeView({
|
|
|
23174
22748
|
);
|
|
23175
22749
|
const openProjectFiles = useOptionalStableEventCallback(onLinkAction);
|
|
23176
22750
|
const detailComposerFocusRequestSequence = localComposerFocusRequestSequence === 0 ? composerFocusRequestSequence : (composerFocusRequestSequence ?? 0) + localComposerFocusRequestSequence;
|
|
23177
|
-
const requestCreateConversation =
|
|
22751
|
+
const requestCreateConversation = useCallback10(
|
|
23178
22752
|
(options) => {
|
|
23179
22753
|
if (previewMode) {
|
|
23180
22754
|
return;
|
|
@@ -23219,14 +22793,14 @@ function AgentGUINodeView({
|
|
|
23219
22793
|
}),
|
|
23220
22794
|
[viewModel.availableCommands, viewModel.workspaceId, workspaceAppIcons]
|
|
23221
22795
|
);
|
|
23222
|
-
const clampConversationRailWidth =
|
|
22796
|
+
const clampConversationRailWidth = useCallback10(
|
|
23223
22797
|
(widthPx) => Math.min(
|
|
23224
22798
|
conversationRailMaxWidthPx,
|
|
23225
22799
|
Math.max(conversationRailMinWidthPx, widthPx)
|
|
23226
22800
|
),
|
|
23227
22801
|
[conversationRailMaxWidthPx, conversationRailMinWidthPx]
|
|
23228
22802
|
);
|
|
23229
|
-
const handleConversationRailResizePointerDown =
|
|
22803
|
+
const handleConversationRailResizePointerDown = useCallback10(
|
|
23230
22804
|
(event) => {
|
|
23231
22805
|
if (previewMode) {
|
|
23232
22806
|
return;
|
|
@@ -23247,7 +22821,7 @@ function AgentGUINodeView({
|
|
|
23247
22821
|
},
|
|
23248
22822
|
[conversationRailCollapsed, conversationRailWidthPx, previewMode]
|
|
23249
22823
|
);
|
|
23250
|
-
const handleConversationRailResizePointerMove =
|
|
22824
|
+
const handleConversationRailResizePointerMove = useCallback10(
|
|
23251
22825
|
(event) => {
|
|
23252
22826
|
if (previewMode) {
|
|
23253
22827
|
return;
|
|
@@ -23270,7 +22844,7 @@ function AgentGUINodeView({
|
|
|
23270
22844
|
},
|
|
23271
22845
|
[clampConversationRailWidth, previewMode]
|
|
23272
22846
|
);
|
|
23273
|
-
const endConversationRailResize =
|
|
22847
|
+
const endConversationRailResize = useCallback10(
|
|
23274
22848
|
(event) => {
|
|
23275
22849
|
const resizeState = railResizeInteractionRef.current;
|
|
23276
22850
|
if (event && resizeState?.pointerId === event.pointerId && event.currentTarget.hasPointerCapture?.(event.pointerId)) {
|
|
@@ -23301,7 +22875,7 @@ function AgentGUINodeView({
|
|
|
23301
22875
|
isRailResizing,
|
|
23302
22876
|
railResizeWidthPx
|
|
23303
22877
|
]);
|
|
23304
|
-
const handleConversationRailResizeKeyDown =
|
|
22878
|
+
const handleConversationRailResizeKeyDown = useCallback10(
|
|
23305
22879
|
(event) => {
|
|
23306
22880
|
if (previewMode) {
|
|
23307
22881
|
return;
|
|
@@ -23333,7 +22907,7 @@ function AgentGUINodeView({
|
|
|
23333
22907
|
"--agent-gui-detail-min-width": `${detailMinWidthPx}px`,
|
|
23334
22908
|
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
22909
|
};
|
|
23336
|
-
const openAgentEnvSetup =
|
|
22910
|
+
const openAgentEnvSetup = useCallback10(() => {
|
|
23337
22911
|
openAgentEnvPanel({ provider: viewModel.data.provider, focus: null });
|
|
23338
22912
|
}, [viewModel.data.provider]);
|
|
23339
22913
|
const conversationRailStoreState = useMemo10(
|
|
@@ -23396,7 +22970,7 @@ function AgentGUINodeView({
|
|
|
23396
22970
|
workspaceUserProjectI18n
|
|
23397
22971
|
]
|
|
23398
22972
|
);
|
|
23399
|
-
const conversationRailStoreRef =
|
|
22973
|
+
const conversationRailStoreRef = useRef12(
|
|
23400
22974
|
null
|
|
23401
22975
|
);
|
|
23402
22976
|
if (conversationRailStoreRef.current === null) {
|
|
@@ -23606,15 +23180,16 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
23606
23180
|
workspaceAppIcons = EMPTY_WORKSPACE_APP_ICONS3
|
|
23607
23181
|
}) {
|
|
23608
23182
|
"use memo";
|
|
23609
|
-
const timelineRef =
|
|
23610
|
-
const bottomDockRef =
|
|
23611
|
-
const timelineScrollAnchorRef =
|
|
23612
|
-
const
|
|
23613
|
-
const
|
|
23183
|
+
const timelineRef = useRef12(null);
|
|
23184
|
+
const bottomDockRef = useRef12(null);
|
|
23185
|
+
const timelineScrollAnchorRef = useRef12(null);
|
|
23186
|
+
const submittedPromptScrollConversationRef = useRef12(null);
|
|
23187
|
+
const pendingPrependScrollAnchorRef = useRef12(null);
|
|
23188
|
+
const [isTimelineScrolledToTop, setIsTimelineScrolledToTop] = useState11(true);
|
|
23614
23189
|
const [
|
|
23615
23190
|
bottomDockDismissedPromptRequestId,
|
|
23616
23191
|
setBottomDockDismissedPromptRequestId
|
|
23617
|
-
] =
|
|
23192
|
+
] = useState11(null);
|
|
23618
23193
|
const conversation = useProjectedAgentConversation({
|
|
23619
23194
|
conversation: viewModel.conversation,
|
|
23620
23195
|
detail: viewModel.conversationDetail,
|
|
@@ -24048,7 +23623,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24048
23623
|
labels.stopping
|
|
24049
23624
|
]
|
|
24050
23625
|
);
|
|
24051
|
-
const handleInterruptCurrentTurn =
|
|
23626
|
+
const handleInterruptCurrentTurn = useCallback10(() => {
|
|
24052
23627
|
actions.interruptCurrentTurn(labels.noRunningResponse);
|
|
24053
23628
|
}, [actions.interruptCurrentTurn, labels.noRunningResponse]);
|
|
24054
23629
|
const submitApprovalOption = useStableEventCallback2(
|
|
@@ -24069,6 +23644,28 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24069
23644
|
const submitGuidancePrompt = useStableEventCallback2(
|
|
24070
23645
|
actions.submitGuidancePrompt
|
|
24071
23646
|
);
|
|
23647
|
+
const requestSubmittedPromptScrollToBottom = useCallback10(() => {
|
|
23648
|
+
const activeConversationId = viewModel.activeConversationId;
|
|
23649
|
+
if (!activeConversationId) {
|
|
23650
|
+
return;
|
|
23651
|
+
}
|
|
23652
|
+
submittedPromptScrollConversationRef.current = activeConversationId;
|
|
23653
|
+
pendingPrependScrollAnchorRef.current = null;
|
|
23654
|
+
}, [viewModel.activeConversationId]);
|
|
23655
|
+
const submitPromptAndScrollToBottom = useCallback10(
|
|
23656
|
+
(content, displayPrompt) => {
|
|
23657
|
+
requestSubmittedPromptScrollToBottom();
|
|
23658
|
+
submitPrompt(content, displayPrompt);
|
|
23659
|
+
},
|
|
23660
|
+
[requestSubmittedPromptScrollToBottom, submitPrompt]
|
|
23661
|
+
);
|
|
23662
|
+
const submitGuidancePromptAndScrollToBottom = useCallback10(
|
|
23663
|
+
(content, displayPrompt) => {
|
|
23664
|
+
requestSubmittedPromptScrollToBottom();
|
|
23665
|
+
submitGuidancePrompt(content, displayPrompt);
|
|
23666
|
+
},
|
|
23667
|
+
[requestSubmittedPromptScrollToBottom, submitGuidancePrompt]
|
|
23668
|
+
);
|
|
24072
23669
|
const showPromptImagesUnsupported = useStableEventCallback2(
|
|
24073
23670
|
actions.showPromptImagesUnsupported
|
|
24074
23671
|
);
|
|
@@ -24089,7 +23686,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24089
23686
|
);
|
|
24090
23687
|
const stableRequestGitBranches = useOptionalStableEventCallback(onRequestGitBranches);
|
|
24091
23688
|
const authLogin = useOptionalStableEventCallback(onAgentProviderLogin);
|
|
24092
|
-
const submitBottomDockInteractivePrompt =
|
|
23689
|
+
const submitBottomDockInteractivePrompt = useCallback10(
|
|
24093
23690
|
(input) => {
|
|
24094
23691
|
submitInteractivePrompt(input);
|
|
24095
23692
|
setBottomDockDismissedPromptRequestId(input.requestId);
|
|
@@ -24138,8 +23735,8 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24138
23735
|
onDraftContentChange: updateDraftContent,
|
|
24139
23736
|
onProjectPathChange: updateSelectedProjectPath,
|
|
24140
23737
|
onSettingsChange: updateComposerSettings,
|
|
24141
|
-
onSubmit:
|
|
24142
|
-
onSubmitGuidance:
|
|
23738
|
+
onSubmit: submitPromptAndScrollToBottom,
|
|
23739
|
+
onSubmitGuidance: submitGuidancePromptAndScrollToBottom,
|
|
24143
23740
|
onPromptImagesUnsupported: showPromptImagesUnsupported,
|
|
24144
23741
|
onSendQueuedPromptNext: sendQueuedPromptNext,
|
|
24145
23742
|
onRemoveQueuedPrompt: removeQueuedPrompt,
|
|
@@ -24180,8 +23777,8 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24180
23777
|
slashStatus,
|
|
24181
23778
|
submitDisabled,
|
|
24182
23779
|
submitInteractivePrompt,
|
|
24183
|
-
|
|
24184
|
-
|
|
23780
|
+
submitPromptAndScrollToBottom,
|
|
23781
|
+
submitGuidancePromptAndScrollToBottom,
|
|
24185
23782
|
uiLanguage,
|
|
24186
23783
|
stableLinkAction,
|
|
24187
23784
|
stableRequestGitBranches,
|
|
@@ -24236,7 +23833,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24236
23833
|
viewModel.isRespondingApproval
|
|
24237
23834
|
]
|
|
24238
23835
|
);
|
|
24239
|
-
const bottomDockStoreRef =
|
|
23836
|
+
const bottomDockStoreRef = useRef12(null);
|
|
24240
23837
|
if (bottomDockStoreRef.current === null) {
|
|
24241
23838
|
bottomDockStoreRef.current = createAgentGUIBottomDockStore(bottomDockStoreState);
|
|
24242
23839
|
}
|
|
@@ -24256,7 +23853,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24256
23853
|
useEffect12(() => {
|
|
24257
23854
|
setBottomDockDismissedPromptRequestId(null);
|
|
24258
23855
|
}, [activePromptRequestId]);
|
|
24259
|
-
|
|
23856
|
+
useLayoutEffect4(() => {
|
|
24260
23857
|
const timeline = timelineRef.current;
|
|
24261
23858
|
if (!timeline) {
|
|
24262
23859
|
return;
|
|
@@ -24265,6 +23862,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24265
23862
|
if (!activeConversationId) {
|
|
24266
23863
|
timelineScrollAnchorRef.current = null;
|
|
24267
23864
|
pendingPrependScrollAnchorRef.current = null;
|
|
23865
|
+
submittedPromptScrollConversationRef.current = null;
|
|
24268
23866
|
setIsTimelineScrolledToTop(true);
|
|
24269
23867
|
return;
|
|
24270
23868
|
}
|
|
@@ -24274,10 +23872,15 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24274
23872
|
);
|
|
24275
23873
|
const anchor = timelineScrollAnchorRef.current;
|
|
24276
23874
|
const prependAnchor = pendingPrependScrollAnchorRef.current;
|
|
23875
|
+
const shouldScrollSubmittedPromptToBottom = submittedPromptScrollConversationRef.current === activeConversationId;
|
|
24277
23876
|
let nextScrollTop = timeline.scrollTop;
|
|
24278
|
-
if (!anchor || anchor.conversationId !== activeConversationId) {
|
|
24279
|
-
timeline
|
|
23877
|
+
if (!anchor || anchor.conversationId !== activeConversationId || shouldScrollSubmittedPromptToBottom) {
|
|
23878
|
+
setTimelineScrollTopInstantly(timeline, maxScrollTop);
|
|
24280
23879
|
nextScrollTop = maxScrollTop;
|
|
23880
|
+
submittedPromptScrollConversationRef.current = null;
|
|
23881
|
+
if (shouldScrollSubmittedPromptToBottom) {
|
|
23882
|
+
pendingPrependScrollAnchorRef.current = null;
|
|
23883
|
+
}
|
|
24281
23884
|
} else if (prependAnchor?.conversationId === activeConversationId) {
|
|
24282
23885
|
const nextScrollHeight = timeline.scrollHeight;
|
|
24283
23886
|
const delta = nextScrollHeight - prependAnchor.scrollHeight;
|
|
@@ -24317,7 +23920,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24317
23920
|
viewModel.activeConversationId,
|
|
24318
23921
|
viewModel.isLoadingOlderMessages
|
|
24319
23922
|
]);
|
|
24320
|
-
|
|
23923
|
+
useLayoutEffect4(() => {
|
|
24321
23924
|
const timeline = timelineRef.current;
|
|
24322
23925
|
const bottomDock = bottomDockRef.current;
|
|
24323
23926
|
const activeConversationId = viewModel.activeConversationId;
|
|
@@ -24621,15 +24224,15 @@ function AgentRunPathInfo({
|
|
|
24621
24224
|
] });
|
|
24622
24225
|
}
|
|
24623
24226
|
function useStableEventCallback2(callback) {
|
|
24624
|
-
const callbackRef =
|
|
24625
|
-
|
|
24227
|
+
const callbackRef = useRef12(callback);
|
|
24228
|
+
useLayoutEffect4(() => {
|
|
24626
24229
|
callbackRef.current = callback;
|
|
24627
24230
|
}, [callback]);
|
|
24628
|
-
return
|
|
24231
|
+
return useCallback10((...args) => callbackRef.current(...args), []);
|
|
24629
24232
|
}
|
|
24630
24233
|
function useOptionalStableEventCallback(callback) {
|
|
24631
|
-
const callbackRef =
|
|
24632
|
-
|
|
24234
|
+
const callbackRef = useRef12(callback);
|
|
24235
|
+
useLayoutEffect4(() => {
|
|
24633
24236
|
callbackRef.current = callback;
|
|
24634
24237
|
}, [callback]);
|
|
24635
24238
|
return useMemo10(() => {
|
|
@@ -24952,16 +24555,16 @@ var AgentGUIConversationRailPane = memo(
|
|
|
24952
24555
|
onConfirmDeleteConversation
|
|
24953
24556
|
}) {
|
|
24954
24557
|
"use memo";
|
|
24955
|
-
const [conversationQuery, setConversationQuery] =
|
|
24956
|
-
const [collapsedProjectSectionIds, setCollapsedProjectSectionIds] =
|
|
24957
|
-
const [currentTimeMs, setCurrentTimeMs] =
|
|
24958
|
-
const [pendingProjectAction, setPendingProjectAction] =
|
|
24959
|
-
const railElementRef =
|
|
24960
|
-
const conversationListRef =
|
|
24961
|
-
const conversationItemElementsRef =
|
|
24558
|
+
const [conversationQuery, setConversationQuery] = useState11("");
|
|
24559
|
+
const [collapsedProjectSectionIds, setCollapsedProjectSectionIds] = useState11(() => /* @__PURE__ */ new Set());
|
|
24560
|
+
const [currentTimeMs, setCurrentTimeMs] = useState11(() => Date.now());
|
|
24561
|
+
const [pendingProjectAction, setPendingProjectAction] = useState11(null);
|
|
24562
|
+
const railElementRef = useRef12(null);
|
|
24563
|
+
const conversationListRef = useRef12(null);
|
|
24564
|
+
const conversationItemElementsRef = useRef12(
|
|
24962
24565
|
/* @__PURE__ */ new Map()
|
|
24963
24566
|
);
|
|
24964
|
-
const groupedConversationsRef =
|
|
24567
|
+
const groupedConversationsRef = useRef12(null);
|
|
24965
24568
|
useEffect12(() => {
|
|
24966
24569
|
const timer = window.setInterval(() => {
|
|
24967
24570
|
setCurrentTimeMs(Date.now());
|
|
@@ -25001,7 +24604,7 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25001
24604
|
};
|
|
25002
24605
|
}, [conversationQuery, filteredConversations, labels, userProjects]);
|
|
25003
24606
|
const groupedConversations = groupedConversationResult.groups;
|
|
25004
|
-
const toggleProjectSectionCollapsed =
|
|
24607
|
+
const toggleProjectSectionCollapsed = useCallback10((sectionId) => {
|
|
25005
24608
|
setCollapsedProjectSectionIds((current) => {
|
|
25006
24609
|
const next = new Set(current);
|
|
25007
24610
|
if (next.has(sectionId)) {
|
|
@@ -25031,7 +24634,7 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25031
24634
|
}
|
|
25032
24635
|
return counts;
|
|
25033
24636
|
}, [conversations]);
|
|
25034
|
-
const registerConversationItemElement =
|
|
24637
|
+
const registerConversationItemElement = useCallback10(
|
|
25035
24638
|
(itemId, element) => {
|
|
25036
24639
|
if (element) {
|
|
25037
24640
|
conversationItemElementsRef.current.set(itemId, element);
|
|
@@ -25041,7 +24644,7 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25041
24644
|
},
|
|
25042
24645
|
[]
|
|
25043
24646
|
);
|
|
25044
|
-
|
|
24647
|
+
useLayoutEffect4(() => {
|
|
25045
24648
|
if (!activeConversationId) {
|
|
25046
24649
|
return;
|
|
25047
24650
|
}
|
|
@@ -25215,7 +24818,7 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25215
24818
|
{
|
|
25216
24819
|
type: "button",
|
|
25217
24820
|
"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-
|
|
24821
|
+
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
24822
|
disabled: previewMode,
|
|
25220
24823
|
onClick: () => onOpenAgentEnvSetup(),
|
|
25221
24824
|
children: [
|
|
@@ -25305,14 +24908,14 @@ var AgentGUIConversationRailSection = memo(
|
|
|
25305
24908
|
}) {
|
|
25306
24909
|
"use memo";
|
|
25307
24910
|
const isProjectSection = section.kind === "project";
|
|
25308
|
-
const [visibleItemLimit, setVisibleItemLimit] =
|
|
24911
|
+
const [visibleItemLimit, setVisibleItemLimit] = useState11(
|
|
25309
24912
|
AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE
|
|
25310
24913
|
);
|
|
25311
24914
|
const visibleItemCount = isSectionCollapsed ? 0 : Math.min(visibleItemLimit, section.items.length);
|
|
25312
24915
|
const visibleItems = isSectionCollapsed ? [] : section.items.slice(0, visibleItemCount);
|
|
25313
24916
|
const canShowMore = !isSectionCollapsed && visibleItemCount < section.items.length;
|
|
25314
24917
|
const canShowLess = !isSectionCollapsed && visibleItemCount > AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE;
|
|
25315
|
-
const showMoreConversations =
|
|
24918
|
+
const showMoreConversations = useCallback10(() => {
|
|
25316
24919
|
setVisibleItemLimit(
|
|
25317
24920
|
(current) => Math.min(
|
|
25318
24921
|
section.items.length,
|
|
@@ -25320,12 +24923,12 @@ var AgentGUIConversationRailSection = memo(
|
|
|
25320
24923
|
)
|
|
25321
24924
|
);
|
|
25322
24925
|
}, [section.items.length]);
|
|
25323
|
-
const showLessConversations =
|
|
24926
|
+
const showLessConversations = useCallback10(() => {
|
|
25324
24927
|
setVisibleItemLimit(AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE);
|
|
25325
24928
|
}, []);
|
|
25326
24929
|
const canCreateConversationFromSection = section.kind === "conversations" || Boolean(projectPath);
|
|
25327
24930
|
const createConversationLabel = projectPath ? labels.projectSectionEdit : labels.newConversation;
|
|
25328
|
-
const handleCreateConversation =
|
|
24931
|
+
const handleCreateConversation = useCallback10(() => {
|
|
25329
24932
|
if (projectPath) {
|
|
25330
24933
|
onCreateConversation({ projectPath, source: "project_section" });
|
|
25331
24934
|
return;
|
|
@@ -25654,27 +25257,27 @@ var AgentGUIConversationRailItem = memo(
|
|
|
25654
25257
|
}) {
|
|
25655
25258
|
"use memo";
|
|
25656
25259
|
const pinned = (item.pinnedAtUnixMs ?? 0) > 0;
|
|
25657
|
-
const setItemElement =
|
|
25260
|
+
const setItemElement = useCallback10(
|
|
25658
25261
|
(element) => {
|
|
25659
25262
|
registerItemElement(item.id, element);
|
|
25660
25263
|
},
|
|
25661
25264
|
[item.id, registerItemElement]
|
|
25662
25265
|
);
|
|
25663
|
-
const handleMouseLeave =
|
|
25266
|
+
const handleMouseLeave = useCallback10(() => {
|
|
25664
25267
|
if (isPendingDeleteConversation) {
|
|
25665
25268
|
onCancelDeleteConversation();
|
|
25666
25269
|
}
|
|
25667
25270
|
}, [isPendingDeleteConversation, onCancelDeleteConversation]);
|
|
25668
|
-
const handleSelect =
|
|
25271
|
+
const handleSelect = useCallback10(() => {
|
|
25669
25272
|
onSelectConversation(item.id);
|
|
25670
25273
|
}, [item.id, onSelectConversation]);
|
|
25671
|
-
const handleTogglePinned =
|
|
25274
|
+
const handleTogglePinned = useCallback10(() => {
|
|
25672
25275
|
onToggleConversationPinned(item.id, !pinned);
|
|
25673
25276
|
}, [item.id, onToggleConversationPinned, pinned]);
|
|
25674
|
-
const handleOpenConversationWindow =
|
|
25277
|
+
const handleOpenConversationWindow = useCallback10(() => {
|
|
25675
25278
|
onOpenConversationWindow?.(item.id);
|
|
25676
25279
|
}, [item.id, onOpenConversationWindow]);
|
|
25677
|
-
const handleRequestDelete =
|
|
25280
|
+
const handleRequestDelete = useCallback10(() => {
|
|
25678
25281
|
onRequestDeleteConversation(item.id);
|
|
25679
25282
|
}, [item.id, onRequestDeleteConversation]);
|
|
25680
25283
|
return /* @__PURE__ */ jsxs17(
|
|
@@ -26099,11 +25702,11 @@ function appendDockProbeUsageLines(probe, lines, isLoadingUsage, t) {
|
|
|
26099
25702
|
// agent-gui/workspaceDesktop/view/AgentProbeInfoPopover.tsx
|
|
26100
25703
|
import { Info as Info3 } from "lucide-react";
|
|
26101
25704
|
import {
|
|
26102
|
-
useCallback as
|
|
25705
|
+
useCallback as useCallback11,
|
|
26103
25706
|
useEffect as useEffect13,
|
|
26104
|
-
useLayoutEffect as
|
|
26105
|
-
useRef as
|
|
26106
|
-
useState as
|
|
25707
|
+
useLayoutEffect as useLayoutEffect5,
|
|
25708
|
+
useRef as useRef13,
|
|
25709
|
+
useState as useState12
|
|
26107
25710
|
} from "react";
|
|
26108
25711
|
import { createPortal as createPortal4 } from "react-dom";
|
|
26109
25712
|
import { Fragment as Fragment9, jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
@@ -26139,18 +25742,18 @@ function AgentProbeInfoPopover({
|
|
|
26139
25742
|
className
|
|
26140
25743
|
}) {
|
|
26141
25744
|
"use memo";
|
|
26142
|
-
const anchorRef =
|
|
26143
|
-
const popoverRef =
|
|
26144
|
-
const [isOpen, setIsOpen] =
|
|
26145
|
-
const [popoverStyle, setPopoverStyle] =
|
|
26146
|
-
const closeIfPointerLeavesPopover =
|
|
25745
|
+
const anchorRef = useRef13(null);
|
|
25746
|
+
const popoverRef = useRef13(null);
|
|
25747
|
+
const [isOpen, setIsOpen] = useState12(false);
|
|
25748
|
+
const [popoverStyle, setPopoverStyle] = useState12(null);
|
|
25749
|
+
const closeIfPointerLeavesPopover = useCallback11((event) => {
|
|
26147
25750
|
const nextTarget = event.relatedTarget;
|
|
26148
25751
|
if (nextTarget instanceof Node && (anchorRef.current?.contains(nextTarget) || popoverRef.current?.contains(nextTarget))) {
|
|
26149
25752
|
return;
|
|
26150
25753
|
}
|
|
26151
25754
|
setIsOpen(false);
|
|
26152
25755
|
}, []);
|
|
26153
|
-
const updatePopoverPosition =
|
|
25756
|
+
const updatePopoverPosition = useCallback11(() => {
|
|
26154
25757
|
const anchor = anchorRef.current;
|
|
26155
25758
|
if (!anchor) {
|
|
26156
25759
|
return;
|
|
@@ -26182,7 +25785,7 @@ function AgentProbeInfoPopover({
|
|
|
26182
25785
|
}
|
|
26183
25786
|
updatePopoverPosition();
|
|
26184
25787
|
}, [isOpen, lines, updatePopoverPosition]);
|
|
26185
|
-
|
|
25788
|
+
useLayoutEffect5(() => {
|
|
26186
25789
|
if (!isOpen) {
|
|
26187
25790
|
return;
|
|
26188
25791
|
}
|
|
@@ -26662,7 +26265,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26662
26265
|
() => typeof i18n?.t === "function" ? createWorkspaceFileManagerI18nRuntime(i18n) : null,
|
|
26663
26266
|
[i18n]
|
|
26664
26267
|
);
|
|
26665
|
-
const handleLinkAction =
|
|
26268
|
+
const handleLinkAction = useCallback12(
|
|
26666
26269
|
(action) => {
|
|
26667
26270
|
onLinkAction?.(
|
|
26668
26271
|
action.type === "open-agent-session" && !action.provider ? { ...action, provider: state.provider } : action
|
|
@@ -26670,7 +26273,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26670
26273
|
},
|
|
26671
26274
|
[onLinkAction, state.provider]
|
|
26672
26275
|
);
|
|
26673
|
-
const handleAgentProviderLogin =
|
|
26276
|
+
const handleAgentProviderLogin = useCallback12(
|
|
26674
26277
|
(provider) => {
|
|
26675
26278
|
const resolvedProvider = normalizeAgentGUIProviderIdentity(provider);
|
|
26676
26279
|
onAgentProviderLogin?.(
|
|
@@ -26679,7 +26282,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26679
26282
|
},
|
|
26680
26283
|
[onAgentProviderLogin, state.provider]
|
|
26681
26284
|
);
|
|
26682
|
-
const handleWorkspaceFileReferencesAdded =
|
|
26285
|
+
const handleWorkspaceFileReferencesAdded = useCallback12(
|
|
26683
26286
|
(references) => {
|
|
26684
26287
|
onWorkspaceFileReferencesAdded?.({
|
|
26685
26288
|
provider: state.provider,
|
|
@@ -26688,7 +26291,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26688
26291
|
},
|
|
26689
26292
|
[onWorkspaceFileReferencesAdded, state.provider]
|
|
26690
26293
|
);
|
|
26691
|
-
const handleDataChange =
|
|
26294
|
+
const handleDataChange = useCallback12(
|
|
26692
26295
|
(updater) => {
|
|
26693
26296
|
if (previewMode) {
|
|
26694
26297
|
return;
|
|
@@ -26697,7 +26300,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26697
26300
|
},
|
|
26698
26301
|
[onUpdateNode, previewMode]
|
|
26699
26302
|
);
|
|
26700
|
-
const handleConversationRailWidthChanged =
|
|
26303
|
+
const handleConversationRailWidthChanged = useCallback12(
|
|
26701
26304
|
(widthPx) => {
|
|
26702
26305
|
if (previewMode) {
|
|
26703
26306
|
return;
|
|
@@ -26729,7 +26332,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26729
26332
|
}),
|
|
26730
26333
|
[]
|
|
26731
26334
|
);
|
|
26732
|
-
const toggleConversationRailCollapsed =
|
|
26335
|
+
const toggleConversationRailCollapsed = useCallback12(() => {
|
|
26733
26336
|
if (previewMode) {
|
|
26734
26337
|
return;
|
|
26735
26338
|
}
|
|
@@ -26738,7 +26341,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26738
26341
|
conversationRailCollapsed: current.conversationRailCollapsed !== true
|
|
26739
26342
|
}));
|
|
26740
26343
|
}, [onUpdateNode, previewMode]);
|
|
26741
|
-
const handleConversationRailToggle =
|
|
26344
|
+
const handleConversationRailToggle = useCallback12(() => {
|
|
26742
26345
|
if (previewMode) {
|
|
26743
26346
|
return;
|
|
26744
26347
|
}
|
|
@@ -26792,7 +26395,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26792
26395
|
onRememberComposerDefaults,
|
|
26793
26396
|
onShowMessage
|
|
26794
26397
|
});
|
|
26795
|
-
const handleCreateConversation =
|
|
26398
|
+
const handleCreateConversation = useCallback12(
|
|
26796
26399
|
(...args) => {
|
|
26797
26400
|
if (!previewMode) {
|
|
26798
26401
|
onUpdateNode(
|