@tutti-os/agent-gui 0.0.74 → 0.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/agent-conversation/index.d.ts +4 -4
- package/dist/agent-conversation/index.js +8 -8
- package/dist/agent-message-center/index.d.ts +2 -2
- package/dist/agent-message-center/index.js +170 -12
- package/dist/agent-message-center/index.js.map +1 -1
- package/dist/{agentConversationVM-DPAgUJlR.d.ts → agentConversationVM-BgoqFyE9.d.ts} +1 -1
- package/dist/{agentGuiNodeTypes-C0WUHQzu.d.ts → agentGuiNodeTypes-CmuJ7VDZ.d.ts} +15 -5
- package/dist/app/renderer/agentactivity.css +110 -27
- package/dist/app/renderer/assets/icons/agents/cursor-colorful.png +0 -0
- package/dist/app/renderer/assets/icons/agents/opencode-rounded.png +0 -0
- package/dist/app/renderer/assets/icons/agents/provider-rail-opencode-colorful.png +0 -0
- package/dist/{chunk-GLMDAZSQ.js → chunk-3FYA2K4P.js} +76 -7
- package/dist/chunk-3FYA2K4P.js.map +1 -0
- package/dist/{chunk-RA3OUR64.js → chunk-4HP6V2YA.js} +16 -2
- package/dist/chunk-4HP6V2YA.js.map +1 -0
- package/dist/{chunk-W5AJTBA7.js → chunk-4TNM6ZEC.js} +3 -100
- package/dist/chunk-4TNM6ZEC.js.map +1 -0
- package/dist/{chunk-6EREXANR.js → chunk-52GTPN7X.js} +3 -14
- package/dist/chunk-52GTPN7X.js.map +1 -0
- package/dist/{chunk-ZSYDFQ4N.js → chunk-7GSBP5CN.js} +36 -15
- package/dist/chunk-7GSBP5CN.js.map +1 -0
- package/dist/{chunk-T5CEU7WH.js → chunk-BEM3KDOJ.js} +3 -3
- package/dist/chunk-BEM3KDOJ.js.map +1 -0
- package/dist/{chunk-VERGPY42.js → chunk-GZX2SGAG.js} +2 -2
- package/dist/{chunk-NO7WDGST.js → chunk-KELYWKTC.js} +28 -6
- package/dist/chunk-KELYWKTC.js.map +1 -0
- package/dist/{chunk-FPODKSSV.js → chunk-L2ZMLLYL.js} +12 -5
- package/dist/chunk-L2ZMLLYL.js.map +1 -0
- package/dist/{chunk-LWFV4PS5.js → chunk-M6FZ2YIR.js} +3 -3
- package/dist/chunk-M6FZ2YIR.js.map +1 -0
- package/dist/{chunk-D2Z2QZVE.js → chunk-MNESUMOS.js} +2 -2
- package/dist/{chunk-KVS7J7BJ.js → chunk-QDKD6RNC.js} +15 -6
- package/dist/{chunk-KVS7J7BJ.js.map → chunk-QDKD6RNC.js.map} +1 -1
- package/dist/{chunk-FHWE5SUF.js → chunk-RIRFNGPB.js} +7 -3
- package/dist/chunk-RIRFNGPB.js.map +1 -0
- package/dist/{chunk-SL2QSEIE.js → chunk-SYWMKIRW.js} +4 -4
- package/dist/{chunk-RF7GK4SM.js → chunk-U6AZ3XQS.js} +25 -6
- package/dist/chunk-U6AZ3XQS.js.map +1 -0
- package/dist/{chunk-Z72JKSAY.js → chunk-U6EDUTUO.js} +4 -4
- package/dist/{chunk-MYD37I32.js → chunk-VAKFNNKT.js} +1 -15
- package/dist/chunk-VAKFNNKT.js.map +1 -0
- package/dist/{chunk-BTUOROCD.js → chunk-XW4CVBUH.js} +2 -2
- package/dist/chunk-XW4CVBUH.js.map +1 -0
- package/dist/{chunk-4XIHKCWC.js → chunk-YWQHNFYA.js} +2 -2
- package/dist/context-mention-palette/index.js +9 -9
- package/dist/i18n/index.d.ts +2 -96
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +49 -7
- package/dist/index.js +1167 -617
- package/dist/index.js.map +1 -1
- package/dist/plan-decision-ops.d.ts +2 -2
- package/dist/queued-prompt-runtime.d.ts +3 -5
- package/dist/queued-prompt-runtime.js +1 -1
- package/dist/workbench/contribution.js +5 -5
- package/dist/workbench/index.js +8 -8
- package/dist/workbench/launch.d.ts +1 -1
- package/dist/workbench/launch.js +2 -2
- package/dist/workbench/providerCatalog.js +1 -1
- package/dist/workbench/sessionTitle.js +3 -3
- package/dist/workbench/state.js +2 -2
- package/dist/workspace-agent-generated-files.d.ts +1 -1
- package/dist/workspace-agent-generated-files.js +4 -4
- package/dist/{workspaceAgentActivityListViewModel-DJvAqZso.d.ts → workspaceAgentActivityListViewModel-TXH1VXrk.d.ts} +0 -10
- package/package.json +12 -12
- package/dist/chunk-6EREXANR.js.map +0 -1
- package/dist/chunk-BTUOROCD.js.map +0 -1
- package/dist/chunk-FHWE5SUF.js.map +0 -1
- package/dist/chunk-FPODKSSV.js.map +0 -1
- package/dist/chunk-GLMDAZSQ.js.map +0 -1
- package/dist/chunk-LWFV4PS5.js.map +0 -1
- package/dist/chunk-MYD37I32.js.map +0 -1
- package/dist/chunk-NO7WDGST.js.map +0 -1
- package/dist/chunk-RA3OUR64.js.map +0 -1
- package/dist/chunk-RF7GK4SM.js.map +0 -1
- package/dist/chunk-T5CEU7WH.js.map +0 -1
- package/dist/chunk-W5AJTBA7.js.map +0 -1
- package/dist/chunk-ZSYDFQ4N.js.map +0 -1
- /package/dist/{chunk-VERGPY42.js.map → chunk-GZX2SGAG.js.map} +0 -0
- /package/dist/{chunk-D2Z2QZVE.js.map → chunk-MNESUMOS.js.map} +0 -0
- /package/dist/{chunk-SL2QSEIE.js.map → chunk-SYWMKIRW.js.map} +0 -0
- /package/dist/{chunk-Z72JKSAY.js.map → chunk-U6EDUTUO.js.map} +0 -0
- /package/dist/{chunk-4XIHKCWC.js.map → chunk-YWQHNFYA.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
resolveAgentGuiSessionProviderFlatIconUrl,
|
|
12
12
|
resolveNextAgentGUIConversationRailWidthPx,
|
|
13
13
|
shouldAutoCollapseAgentGUIConversationRail
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-U6AZ3XQS.js";
|
|
15
15
|
import {
|
|
16
16
|
agentGUIDefaultTargetProviders,
|
|
17
17
|
agentGUIProviderTargetRefsEqual,
|
|
@@ -23,16 +23,16 @@ import {
|
|
|
23
23
|
localAgentGUIProviderTargetId,
|
|
24
24
|
normalizeAgentGUIProviderTargets,
|
|
25
25
|
resolveAgentGUIProviderTarget
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-BEM3KDOJ.js";
|
|
27
|
+
import "./chunk-L2ZMLLYL.js";
|
|
28
28
|
import "./chunk-BT2DT2P7.js";
|
|
29
29
|
import {
|
|
30
30
|
resolveAgentGuiWorkbenchProviderLabel
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-XW4CVBUH.js";
|
|
32
32
|
import {
|
|
33
33
|
AgentInteractivePromptSurface,
|
|
34
34
|
approvalOptionDisplayLabel
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-U6EDUTUO.js";
|
|
36
36
|
import {
|
|
37
37
|
PLAN_IMPLEMENTATION_ACTION_FEEDBACK,
|
|
38
38
|
PLAN_IMPLEMENTATION_ACTION_IMPLEMENT,
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
resolveAgentGUIExplicitConversationTitle,
|
|
52
52
|
resolveAgentGUIProviderDisplayLabel,
|
|
53
53
|
resolveAgentGUIProviderIdentity
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-M6FZ2YIR.js";
|
|
55
55
|
import {
|
|
56
56
|
AGENT_PASTED_TEXT_BLOCK_KIND,
|
|
57
57
|
AGENT_PASTED_TEXT_MENTION_KIND,
|
|
@@ -88,14 +88,14 @@ import {
|
|
|
88
88
|
textPromptContent,
|
|
89
89
|
toLocalShortDateTime,
|
|
90
90
|
useProjectedAgentConversation
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-7GSBP5CN.js";
|
|
92
92
|
import {
|
|
93
93
|
AgentMessageMarkdown,
|
|
94
94
|
AgentTargetPresentationProvider,
|
|
95
95
|
ZoomableImage,
|
|
96
96
|
cn,
|
|
97
97
|
resolveWorkspaceLinkAction
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-3FYA2K4P.js";
|
|
99
99
|
import {
|
|
100
100
|
openAgentEnvPanel
|
|
101
101
|
} from "./chunk-PSLAWU25.js";
|
|
@@ -106,17 +106,18 @@ import {
|
|
|
106
106
|
DEFAULT_AGENT_MENTION_FILTER,
|
|
107
107
|
agentMentionItemKey,
|
|
108
108
|
preloadAgentMentionBrowse
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-QDKD6RNC.js";
|
|
110
110
|
import {
|
|
111
111
|
buildWorkspaceAgentActivityListViewModel,
|
|
112
112
|
isWorkspaceAgentUntitledTask
|
|
113
|
-
} from "./chunk-
|
|
114
|
-
import "./chunk-
|
|
113
|
+
} from "./chunk-52GTPN7X.js";
|
|
114
|
+
import "./chunk-GZX2SGAG.js";
|
|
115
115
|
import {
|
|
116
116
|
resolveWorkspaceAgentSessionSortTimeUnixMs
|
|
117
117
|
} from "./chunk-IBIMGLCD.js";
|
|
118
118
|
import {
|
|
119
119
|
AGENT_RICH_TEXT_CARET_ANCHOR,
|
|
120
|
+
AgentMentionTooltipProviderScope,
|
|
120
121
|
createAgentSessionMarkdownLink,
|
|
121
122
|
createAgentSessionMentionHref,
|
|
122
123
|
exitAgentFileMentionSuggestion,
|
|
@@ -124,7 +125,7 @@ import {
|
|
|
124
125
|
mentionItemToAttrs,
|
|
125
126
|
normalizeAgentSessionMentionTitle,
|
|
126
127
|
parseMentionItemFromHref
|
|
127
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-KELYWKTC.js";
|
|
128
129
|
import "./chunk-Y35GDLP2.js";
|
|
129
130
|
import "./chunk-LUGELG5V.js";
|
|
130
131
|
import {
|
|
@@ -133,6 +134,7 @@ import {
|
|
|
133
134
|
MANAGED_AGENT_ICON_FALLBACK_URL,
|
|
134
135
|
MANAGED_AGENT_ICON_URLS,
|
|
135
136
|
MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS,
|
|
137
|
+
agentActivityRuntimeCapabilityEnabled,
|
|
136
138
|
getAgentActivityRuntime,
|
|
137
139
|
getAgentActivityRuntimeByOrigin,
|
|
138
140
|
getAgentCustomMentionKind,
|
|
@@ -148,36 +150,37 @@ import {
|
|
|
148
150
|
useAgentHostApi,
|
|
149
151
|
useOptionalAgentActivityRuntime,
|
|
150
152
|
useOptionalAgentHostApi
|
|
151
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-RIRFNGPB.js";
|
|
152
154
|
import {
|
|
153
155
|
WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN,
|
|
154
156
|
createWorkspaceAgentActivityUserMessageIdFromClientSubmitId,
|
|
155
157
|
isWorkspaceAgentActivityOptimisticMessage,
|
|
156
158
|
isWorkspaceAgentActivityRuntimeSessionOrigin,
|
|
157
159
|
mergeWorkspaceAgentActivityDurableAndOverlayMessages,
|
|
160
|
+
minFiniteDurableWorkspaceAgentActivityMessageVersion,
|
|
158
161
|
selectWorkspaceAgentActivityOverlayMessages
|
|
159
|
-
} from "./chunk-
|
|
162
|
+
} from "./chunk-4HP6V2YA.js";
|
|
160
163
|
import {
|
|
161
164
|
AgentGuiI18nProvider,
|
|
162
165
|
agentGuiI18nModule,
|
|
163
166
|
agentGuiI18nResources,
|
|
164
167
|
translate,
|
|
165
168
|
useTranslation
|
|
166
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-YWQHNFYA.js";
|
|
167
170
|
import "./chunk-PJP5BUU6.js";
|
|
168
171
|
import {
|
|
169
172
|
agentColorfulUrl,
|
|
170
173
|
cursorColorfulUrl,
|
|
171
174
|
normalizeManagedAgentProvider
|
|
172
|
-
} from "./chunk-
|
|
173
|
-
import "./chunk-
|
|
175
|
+
} from "./chunk-SYWMKIRW.js";
|
|
176
|
+
import "./chunk-4TNM6ZEC.js";
|
|
174
177
|
import {
|
|
175
178
|
AGENT_CONTEXT_MENTION_PROVIDER_IDS
|
|
176
179
|
} from "./chunk-JM24HADP.js";
|
|
177
180
|
import "./chunk-GCBDIQDX.js";
|
|
178
181
|
import {
|
|
179
182
|
createAgentQueuedPromptRuntime
|
|
180
|
-
} from "./chunk-
|
|
183
|
+
} from "./chunk-VAKFNNKT.js";
|
|
181
184
|
|
|
182
185
|
// shared/agentActivitySnapshotProjection.ts
|
|
183
186
|
import {
|
|
@@ -343,7 +346,7 @@ import { memo as memo4 } from "react";
|
|
|
343
346
|
import { TooltipProvider as TooltipProvider4 } from "@tutti-os/ui-system";
|
|
344
347
|
|
|
345
348
|
// agent-gui/agentGuiNode/AgentGUINode.tsx
|
|
346
|
-
import { memo as memo3, useCallback as useCallback12, useEffect as
|
|
349
|
+
import { memo as memo3, useCallback as useCallback12, useEffect as useEffect17, useMemo as useMemo11 } from "react";
|
|
347
350
|
import { createWorkspaceUserProjectI18nRuntime } from "@tutti-os/workspace-user-project/i18n";
|
|
348
351
|
import { createWorkspaceFileManagerI18nRuntime } from "@tutti-os/workspace-file-manager";
|
|
349
352
|
|
|
@@ -2493,6 +2496,9 @@ function agentGUIConversationProjectSummaryFromProject(matchedProject) {
|
|
|
2493
2496
|
path: matchedProject.path,
|
|
2494
2497
|
label: resolveWorkspaceUserProjectDisplayLabel(matchedProject)
|
|
2495
2498
|
};
|
|
2499
|
+
if (matchedProject.sectionKey !== void 0) {
|
|
2500
|
+
summary.sectionKey = matchedProject.sectionKey;
|
|
2501
|
+
}
|
|
2496
2502
|
if (matchedProject.createdAtUnixMs !== void 0) {
|
|
2497
2503
|
summary.createdAtUnixMs = matchedProject.createdAtUnixMs;
|
|
2498
2504
|
}
|
|
@@ -2926,6 +2932,7 @@ function workspaceAgentMessagesFromTimelineItems(timelineItems) {
|
|
|
2926
2932
|
...item.status ? { status: item.status } : {},
|
|
2927
2933
|
payload: {
|
|
2928
2934
|
...item.payload,
|
|
2935
|
+
__agentGuiTimelineProjection: true,
|
|
2929
2936
|
content: item.payload?.content ?? item.content,
|
|
2930
2937
|
text: item.payload?.text ?? item.content,
|
|
2931
2938
|
callType: item.callType,
|
|
@@ -4243,8 +4250,7 @@ function ensureActivityStreamUpstream(entry) {
|
|
|
4243
4250
|
const runtime = getAgentActivityRuntimeByOrigin(entry.payload.origin);
|
|
4244
4251
|
if (runtime) {
|
|
4245
4252
|
try {
|
|
4246
|
-
|
|
4247
|
-
entry.releaseRuntimeEvents = ensureSessionSynchronized({
|
|
4253
|
+
entry.releaseRuntimeEvents = runtime.ensureSessionSynchronized({
|
|
4248
4254
|
workspaceId: entry.payload.workspaceId,
|
|
4249
4255
|
agentSessionId: entry.payload.agentSessionId,
|
|
4250
4256
|
onError: (error) => {
|
|
@@ -4795,11 +4801,11 @@ function conversationFilterKey(filter) {
|
|
|
4795
4801
|
}
|
|
4796
4802
|
return `agent-target:${normalized.agentTargetId}`;
|
|
4797
4803
|
}
|
|
4798
|
-
function
|
|
4804
|
+
function conversationMatchesQueryFilter(conversation, filter) {
|
|
4799
4805
|
if (!conversation || filter.kind !== "agentTarget") {
|
|
4800
4806
|
return true;
|
|
4801
4807
|
}
|
|
4802
|
-
return
|
|
4808
|
+
return (conversation.agentTargetId?.trim() ?? "") === filter.agentTargetId;
|
|
4803
4809
|
}
|
|
4804
4810
|
function createAgentGUIConversationListQueryKey(input) {
|
|
4805
4811
|
const normalized = normalizeQuery(input);
|
|
@@ -5643,7 +5649,12 @@ async function refreshAgentGUIConversationListQuery(query, reason, options = {})
|
|
|
5643
5649
|
} : workspaceAgentSnapshot,
|
|
5644
5650
|
provider: state.query.provider,
|
|
5645
5651
|
sessionMessagesById: sessionMessagesByIdForSummaries
|
|
5646
|
-
})
|
|
5652
|
+
}).filter(
|
|
5653
|
+
(conversation) => conversationMatchesQueryFilter(
|
|
5654
|
+
conversation,
|
|
5655
|
+
state.query.conversationFilter
|
|
5656
|
+
)
|
|
5657
|
+
);
|
|
5647
5658
|
const conversationsToDecorate = canApplyDirtySessionProjection ? /* @__PURE__ */ new Set([
|
|
5648
5659
|
...dirtySessionIds,
|
|
5649
5660
|
...baseConversations.map((conversation) => conversation.id)
|
|
@@ -5661,30 +5672,16 @@ async function refreshAgentGUIConversationListQuery(query, reason, options = {})
|
|
|
5661
5672
|
return agentSessionId && agentTargetId ? [[agentSessionId, agentTargetId]] : [];
|
|
5662
5673
|
})
|
|
5663
5674
|
);
|
|
5664
|
-
const snapshotSessionProviderById = new Map(
|
|
5665
|
-
workspaceAgentSnapshot.sessions.flatMap((session) => {
|
|
5666
|
-
const agentSessionId = session.agentSessionId.trim();
|
|
5667
|
-
const provider = session.provider?.trim() ?? "";
|
|
5668
|
-
return agentSessionId && provider ? [[agentSessionId, provider]] : [];
|
|
5669
|
-
})
|
|
5670
|
-
);
|
|
5671
5675
|
const retainableForQueryFilter = (agentSessionId) => {
|
|
5672
5676
|
const filter = state.query.conversationFilter;
|
|
5673
5677
|
if (filter.kind !== "agentTarget") {
|
|
5674
5678
|
return true;
|
|
5675
5679
|
}
|
|
5676
5680
|
const snapshotAgentTargetId = snapshotSessionAgentTargetIdById.get(agentSessionId);
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
return matchesAgentGUIConversationSummaryFilter(
|
|
5680
|
-
{
|
|
5681
|
-
agentTargetId: snapshotAgentTargetId ?? null,
|
|
5682
|
-
provider: snapshotProvider ?? null
|
|
5683
|
-
},
|
|
5684
|
-
filter
|
|
5685
|
-
);
|
|
5681
|
+
if (snapshotAgentTargetId) {
|
|
5682
|
+
return snapshotAgentTargetId === filter.agentTargetId;
|
|
5686
5683
|
}
|
|
5687
|
-
return
|
|
5684
|
+
return conversationMatchesQueryFilter(
|
|
5688
5685
|
currentConversationsById.get(agentSessionId),
|
|
5689
5686
|
filter
|
|
5690
5687
|
);
|
|
@@ -6865,11 +6862,29 @@ function sanitizeComposerSettingsForTarget(input) {
|
|
|
6865
6862
|
function agentGUIProviderTargetsEqual(left, right) {
|
|
6866
6863
|
return left.provider === right.provider && left.targetId === right.targetId && (left.agentTargetId ?? null) === (right.agentTargetId ?? null) && agentGUIProviderTargetRefsEqual(left.ref, right.ref);
|
|
6867
6864
|
}
|
|
6868
|
-
function
|
|
6869
|
-
const reportDiagnostic =
|
|
6870
|
-
|
|
6871
|
-
|
|
6865
|
+
function reportAgentGUIDiagnostic(runtime, input) {
|
|
6866
|
+
const reportDiagnostic = runtime.reportDiagnostic;
|
|
6867
|
+
try {
|
|
6868
|
+
if (reportDiagnostic) {
|
|
6869
|
+
void Promise.resolve(reportDiagnostic.call(runtime, input)).catch(
|
|
6870
|
+
() => {
|
|
6871
|
+
}
|
|
6872
|
+
);
|
|
6873
|
+
return;
|
|
6874
|
+
}
|
|
6875
|
+
if (!agentGUIDevConsoleDiagnosticSinkEnabled(runtime)) {
|
|
6876
|
+
return;
|
|
6877
|
+
}
|
|
6878
|
+
const level = input.level ?? "info";
|
|
6879
|
+
const consoleMethod = level === "error" ? console.error : level === "warn" ? console.warn : level === "debug" ? console.debug : console.info;
|
|
6880
|
+
consoleMethod.call(console, "[agent-gui]", input.event, input);
|
|
6881
|
+
} catch {
|
|
6872
6882
|
}
|
|
6883
|
+
}
|
|
6884
|
+
function agentGUIDevConsoleDiagnosticSinkEnabled(runtime) {
|
|
6885
|
+
return runtime.devDiagnosticConsoleSink !== false && typeof process !== "undefined" && (process.env.NODE_ENV === "development" || process.env.AGENT_GUI_DEV_DIAGNOSTIC_CONSOLE === "1");
|
|
6886
|
+
}
|
|
6887
|
+
function reportAgentGUIRuntimeError(input) {
|
|
6873
6888
|
const details = {
|
|
6874
6889
|
error: normalizeAgentGUIDiagnosticError(input.error),
|
|
6875
6890
|
errorCode: getAgentGUIErrorCode(input.error),
|
|
@@ -6879,19 +6894,13 @@ function reportAgentGUIRuntimeError(input) {
|
|
|
6879
6894
|
...input.requestId !== void 0 && input.requestId !== null ? { requestId: input.requestId } : {},
|
|
6880
6895
|
...input.context ?? {}
|
|
6881
6896
|
};
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
workspaceId: input.workspaceId
|
|
6890
|
-
})
|
|
6891
|
-
).catch(() => {
|
|
6892
|
-
});
|
|
6893
|
-
} catch {
|
|
6894
|
-
}
|
|
6897
|
+
reportAgentGUIDiagnostic(input.runtime, {
|
|
6898
|
+
details,
|
|
6899
|
+
event: "agent.gui.caught_error",
|
|
6900
|
+
level: "error",
|
|
6901
|
+
source: "agent-gui",
|
|
6902
|
+
workspaceId: input.workspaceId
|
|
6903
|
+
});
|
|
6895
6904
|
}
|
|
6896
6905
|
function showAgentGUIControllerErrorToast(hostToast, message) {
|
|
6897
6906
|
if (hostToast?.error) {
|
|
@@ -6901,102 +6910,70 @@ function showAgentGUIControllerErrorToast(hostToast, message) {
|
|
|
6901
6910
|
toast.error(message);
|
|
6902
6911
|
}
|
|
6903
6912
|
function reportAgentGUIConversationFilterTargetUnresolved(input) {
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
},
|
|
6917
|
-
event: "agent.gui.conversation_filter.target_unresolved",
|
|
6918
|
-
level: "warn",
|
|
6919
|
-
source: "agent-gui",
|
|
6920
|
-
workspaceId: input.workspaceId
|
|
6921
|
-
})
|
|
6922
|
-
).catch(() => {
|
|
6923
|
-
});
|
|
6924
|
-
} catch {
|
|
6925
|
-
}
|
|
6913
|
+
reportAgentGUIDiagnostic(input.runtime, {
|
|
6914
|
+
details: {
|
|
6915
|
+
provider: input.provider,
|
|
6916
|
+
providerTargetCount: input.providerTargetCount,
|
|
6917
|
+
providerTargetId: input.providerTargetId,
|
|
6918
|
+
reason: input.reason
|
|
6919
|
+
},
|
|
6920
|
+
event: "agent.gui.conversation_filter.target_unresolved",
|
|
6921
|
+
level: "warn",
|
|
6922
|
+
source: "agent-gui",
|
|
6923
|
+
workspaceId: input.workspaceId
|
|
6924
|
+
});
|
|
6926
6925
|
}
|
|
6927
6926
|
function reportAgentGUIMessagePageDiagnostic(input) {
|
|
6928
|
-
const reportDiagnostic = input.runtime.reportDiagnostic;
|
|
6929
|
-
if (!reportDiagnostic) {
|
|
6930
|
-
return;
|
|
6931
|
-
}
|
|
6932
6927
|
const versions = (input.messages ?? []).map((message) => message.version).filter((version) => Number.isFinite(version));
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
workspaceId: input.workspaceId
|
|
6949
|
-
})
|
|
6950
|
-
).catch(() => {
|
|
6951
|
-
});
|
|
6952
|
-
} catch {
|
|
6953
|
-
}
|
|
6928
|
+
reportAgentGUIDiagnostic(input.runtime, {
|
|
6929
|
+
details: {
|
|
6930
|
+
agentSessionId: input.agentSessionId,
|
|
6931
|
+
...input.messages ? {
|
|
6932
|
+
firstVersion: versions.length ? Math.min(...versions) : null,
|
|
6933
|
+
lastVersion: versions.length ? Math.max(...versions) : null,
|
|
6934
|
+
messageCount: input.messages.length
|
|
6935
|
+
} : {},
|
|
6936
|
+
...input.details ?? {}
|
|
6937
|
+
},
|
|
6938
|
+
event: input.event,
|
|
6939
|
+
level: input.level ?? "info",
|
|
6940
|
+
source: "agent-gui",
|
|
6941
|
+
workspaceId: input.workspaceId
|
|
6942
|
+
});
|
|
6954
6943
|
}
|
|
6955
6944
|
function reportAgentGUIRenderStateDiagnostic(input) {
|
|
6956
|
-
|
|
6957
|
-
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
input.activeSessionState
|
|
6989
|
-
)
|
|
6990
|
-
},
|
|
6991
|
-
event: "agent.gui.node.render_state_changed",
|
|
6992
|
-
level: "info",
|
|
6993
|
-
source: "agent-gui",
|
|
6994
|
-
workspaceId: input.workspaceId
|
|
6995
|
-
})
|
|
6996
|
-
).catch(() => {
|
|
6997
|
-
});
|
|
6998
|
-
} catch {
|
|
6999
|
-
}
|
|
6945
|
+
reportAgentGUIDiagnostic(input.runtime, {
|
|
6946
|
+
details: {
|
|
6947
|
+
activeActivityDisplayStatus: input.activeActivityDisplayStatus,
|
|
6948
|
+
activeConversationBusy: input.activeConversationBusy,
|
|
6949
|
+
activeConversationId: input.activeConversationId,
|
|
6950
|
+
activeConversationStatus: input.activeConversation?.status ?? null,
|
|
6951
|
+
activeHasPendingSubmittedTurn: input.activeHasPendingSubmittedTurn,
|
|
6952
|
+
activeLiveState: input.activeLiveState,
|
|
6953
|
+
activeSubmitBlocked: input.activeSubmitBlocked,
|
|
6954
|
+
canQueueWhileBusy: input.canQueueWhileBusy,
|
|
6955
|
+
canSubmit: input.canSubmit,
|
|
6956
|
+
conversation: agentGUIConversationDiagnosticDetails(input.conversation),
|
|
6957
|
+
isCreatingConversation: input.isCreatingConversation,
|
|
6958
|
+
isLoadingMessages: input.isLoadingMessages,
|
|
6959
|
+
isSubmitting: input.isSubmitting,
|
|
6960
|
+
pendingApprovalRequestId: input.pendingApproval?.requestId ?? null,
|
|
6961
|
+
pendingInteractivePromptKind: input.pendingInteractivePrompt?.kind ?? null,
|
|
6962
|
+
pendingInteractivePromptRequestId: promptRequestId(
|
|
6963
|
+
input.pendingInteractivePrompt
|
|
6964
|
+
),
|
|
6965
|
+
runtimeSession: agentGUIRuntimeSessionDiagnosticDetails(
|
|
6966
|
+
input.activeRuntimeSession
|
|
6967
|
+
),
|
|
6968
|
+
sessionState: agentGUISessionStateDiagnosticDetails(
|
|
6969
|
+
input.activeSessionState
|
|
6970
|
+
)
|
|
6971
|
+
},
|
|
6972
|
+
event: "agent.gui.node.render_state_changed",
|
|
6973
|
+
level: "info",
|
|
6974
|
+
source: "agent-gui",
|
|
6975
|
+
workspaceId: input.workspaceId
|
|
6976
|
+
});
|
|
7000
6977
|
}
|
|
7001
6978
|
function reportAgentGUIActiveConversationCleared(input) {
|
|
7002
6979
|
const reportDiagnostic = input.runtime.reportDiagnostic;
|
|
@@ -7799,14 +7776,7 @@ function messageActivityTimeUnixMs(message) {
|
|
|
7799
7776
|
return null;
|
|
7800
7777
|
}
|
|
7801
7778
|
function minFiniteMessageVersion(messages) {
|
|
7802
|
-
|
|
7803
|
-
for (const message of messages) {
|
|
7804
|
-
if (!Number.isFinite(message.version) || isWorkspaceAgentActivityOptimisticMessage(message)) {
|
|
7805
|
-
continue;
|
|
7806
|
-
}
|
|
7807
|
-
result = result === null ? message.version : Math.min(result, message.version);
|
|
7808
|
-
}
|
|
7809
|
-
return result;
|
|
7779
|
+
return minFiniteDurableWorkspaceAgentActivityMessageVersion(messages);
|
|
7810
7780
|
}
|
|
7811
7781
|
function isUserTextMessage(message) {
|
|
7812
7782
|
return message.kind.trim().toLowerCase() === "text" && message.role.trim().toLowerCase() === "user" && workspaceAgentActivityMessageText(message).trim() !== "";
|
|
@@ -8489,6 +8459,9 @@ function useStableStringArrayByValue(values) {
|
|
|
8489
8459
|
}
|
|
8490
8460
|
return currentValues ?? values;
|
|
8491
8461
|
}
|
|
8462
|
+
function agentGUISectionActionAgentTargetId(filter) {
|
|
8463
|
+
return filter.kind === "agentTarget" ? normalizeOptionalText2(filter.agentTargetId) ?? void 0 : void 0;
|
|
8464
|
+
}
|
|
8492
8465
|
function agentSessionStatusBusy(input) {
|
|
8493
8466
|
const normalized = normalizeOptionalWorkspaceAgentStatus(input);
|
|
8494
8467
|
return normalized?.kind === "working" || normalized?.kind === "waiting";
|
|
@@ -8949,6 +8922,22 @@ function useAgentGUINodeController({
|
|
|
8949
8922
|
onShowMessage
|
|
8950
8923
|
}) {
|
|
8951
8924
|
const agentActivityRuntime = useAgentActivityRuntime();
|
|
8925
|
+
const canCancel = agentActivityRuntimeCapabilityEnabled(
|
|
8926
|
+
agentActivityRuntime,
|
|
8927
|
+
"canCancel"
|
|
8928
|
+
);
|
|
8929
|
+
const canSubmitInteractive = agentActivityRuntimeCapabilityEnabled(
|
|
8930
|
+
agentActivityRuntime,
|
|
8931
|
+
"canSubmitInteractive"
|
|
8932
|
+
);
|
|
8933
|
+
const canGoalControl = agentActivityRuntimeCapabilityEnabled(
|
|
8934
|
+
agentActivityRuntime,
|
|
8935
|
+
"canGoalControl"
|
|
8936
|
+
);
|
|
8937
|
+
const canUploadAttachment = agentActivityRuntimeCapabilityEnabled(
|
|
8938
|
+
agentActivityRuntime,
|
|
8939
|
+
"canUploadAttachment"
|
|
8940
|
+
);
|
|
8952
8941
|
const agentActivityRuntimeOrigin = agentActivityRuntime.origin?.trim() || AGENT_GUI_RUNTIME_SESSION_ORIGIN;
|
|
8953
8942
|
const agentQueuedPromptRuntime = useAgentQueuedPromptRuntime();
|
|
8954
8943
|
const agentHostApi = useAgentHostApi();
|
|
@@ -9205,6 +9194,7 @@ function useAgentGUINodeController({
|
|
|
9205
9194
|
pendingDeleteProjectConversations,
|
|
9206
9195
|
setPendingDeleteProjectConversations
|
|
9207
9196
|
] = useState4(null);
|
|
9197
|
+
const [pendingDeleteConversations, setPendingDeleteConversations] = useState4(null);
|
|
9208
9198
|
const [listError, setListError] = useState4(null);
|
|
9209
9199
|
const [detailError, setDetailError] = useState4(null);
|
|
9210
9200
|
const [statePatchErrorBySessionId, setStatePatchErrorBySessionId] = useState4({});
|
|
@@ -9257,7 +9247,7 @@ function useAgentGUINodeController({
|
|
|
9257
9247
|
) ? true : selectedModelForPromptImages === null ? false : providerComposerOptions?.models.find(
|
|
9258
9248
|
(option) => option.value === selectedModelForPromptImages
|
|
9259
9249
|
)?.supportsImageInput ?? false;
|
|
9260
|
-
const promptImagesSupported = (resolvedPromptImagesSupported ?? true) && selectedModelImageInputSupported;
|
|
9250
|
+
const promptImagesSupported = canUploadAttachment && (resolvedPromptImagesSupported ?? true) && selectedModelImageInputSupported;
|
|
9261
9251
|
const compactSupported = resolveAgentActivityCapability2("compact", {
|
|
9262
9252
|
composerOptions: providerComposerOptions,
|
|
9263
9253
|
sessionRuntimeContext: activeSessionRuntimeContext
|
|
@@ -12405,6 +12395,16 @@ function useAgentGUINodeController({
|
|
|
12405
12395
|
setIsLoadingMessages(false);
|
|
12406
12396
|
setDetailError(null);
|
|
12407
12397
|
persistActiveConversation(null);
|
|
12398
|
+
const homeDraftKeysToClear = /* @__PURE__ */ new Set();
|
|
12399
|
+
if (previous) {
|
|
12400
|
+
const selectedTargetData = selectedComposerTargetDataRef.current;
|
|
12401
|
+
homeDraftKeysToClear.add(
|
|
12402
|
+
nodeDefaultDraftContentKey(
|
|
12403
|
+
selectedTargetData.provider,
|
|
12404
|
+
selectedTargetData.agentTargetId
|
|
12405
|
+
)
|
|
12406
|
+
);
|
|
12407
|
+
}
|
|
12408
12408
|
const filter = conversationFilterRef.current;
|
|
12409
12409
|
if (filter.kind === "agentTarget") {
|
|
12410
12410
|
const filterTarget = resolveAgentGUIProviderTarget({
|
|
@@ -12416,8 +12416,31 @@ function useAgentGUINodeController({
|
|
|
12416
12416
|
});
|
|
12417
12417
|
if (filterTarget && filterTarget.disabled !== true && (filterTarget.agentTargetId?.trim() ?? "") === filter.agentTargetId) {
|
|
12418
12418
|
setHomeComposerTargetOverride(filterTarget);
|
|
12419
|
+
if (previous) {
|
|
12420
|
+
homeDraftKeysToClear.add(
|
|
12421
|
+
nodeDefaultDraftContentKey(
|
|
12422
|
+
filterTarget.provider,
|
|
12423
|
+
filterTarget.agentTargetId
|
|
12424
|
+
)
|
|
12425
|
+
);
|
|
12426
|
+
}
|
|
12419
12427
|
}
|
|
12420
12428
|
}
|
|
12429
|
+
const clearHomeDrafts = (current) => {
|
|
12430
|
+
let next = null;
|
|
12431
|
+
for (const key of homeDraftKeysToClear) {
|
|
12432
|
+
const existing = current[key];
|
|
12433
|
+
if (existing && agentComposerDraftHasContent(existing)) {
|
|
12434
|
+
next = next ?? { ...current };
|
|
12435
|
+
next[key] = emptyAgentComposerDraft();
|
|
12436
|
+
}
|
|
12437
|
+
}
|
|
12438
|
+
return next ?? current;
|
|
12439
|
+
};
|
|
12440
|
+
draftBySessionIdRef.current = clearHomeDrafts(
|
|
12441
|
+
draftBySessionIdRef.current
|
|
12442
|
+
);
|
|
12443
|
+
setDraftBySessionId(clearHomeDrafts);
|
|
12421
12444
|
loadDraftComposerOptions();
|
|
12422
12445
|
},
|
|
12423
12446
|
[
|
|
@@ -12987,6 +13010,9 @@ function useAgentGUINodeController({
|
|
|
12987
13010
|
if (!normalizedAgentSessionId) {
|
|
12988
13011
|
return false;
|
|
12989
13012
|
}
|
|
13013
|
+
if (isCreatingConversationRef.current && startingConversationIdRef.current === normalizedAgentSessionId) {
|
|
13014
|
+
return true;
|
|
13015
|
+
}
|
|
12990
13016
|
if (pendingTurnIdBySessionIdRef.current[normalizedAgentSessionId]) {
|
|
12991
13017
|
return true;
|
|
12992
13018
|
}
|
|
@@ -13066,7 +13092,7 @@ function useAgentGUINodeController({
|
|
|
13066
13092
|
);
|
|
13067
13093
|
const goalControl = useCallback4(
|
|
13068
13094
|
(action, objective) => {
|
|
13069
|
-
if (previewMode) {
|
|
13095
|
+
if (previewMode || !canGoalControl) {
|
|
13070
13096
|
return;
|
|
13071
13097
|
}
|
|
13072
13098
|
const agentSessionId = activeConversationIdRef.current;
|
|
@@ -13096,6 +13122,7 @@ function useAgentGUINodeController({
|
|
|
13096
13122
|
},
|
|
13097
13123
|
[
|
|
13098
13124
|
agentActivityRuntime,
|
|
13125
|
+
canGoalControl,
|
|
13099
13126
|
executePrompt,
|
|
13100
13127
|
isCurrentConversation,
|
|
13101
13128
|
previewMode,
|
|
@@ -13223,6 +13250,9 @@ function useAgentGUINodeController({
|
|
|
13223
13250
|
}, []);
|
|
13224
13251
|
const submitInteractivePrompt = useCallback4(
|
|
13225
13252
|
(input) => {
|
|
13253
|
+
if (!canSubmitInteractive) {
|
|
13254
|
+
return;
|
|
13255
|
+
}
|
|
13226
13256
|
if (input.action === PLAN_IMPLEMENTATION_ACTION_IMPLEMENT) {
|
|
13227
13257
|
planActionsRef.current.implement();
|
|
13228
13258
|
return;
|
|
@@ -13288,7 +13318,8 @@ function useAgentGUINodeController({
|
|
|
13288
13318
|
loadSessionState,
|
|
13289
13319
|
refreshMessagesFromSnapshot,
|
|
13290
13320
|
workspaceId,
|
|
13291
|
-
agentActivityRuntime
|
|
13321
|
+
agentActivityRuntime,
|
|
13322
|
+
canSubmitInteractive
|
|
13292
13323
|
]
|
|
13293
13324
|
);
|
|
13294
13325
|
const submitApprovalOption = useCallback4(
|
|
@@ -13299,6 +13330,9 @@ function useAgentGUINodeController({
|
|
|
13299
13330
|
);
|
|
13300
13331
|
const interruptCurrentTurn = useCallback4(
|
|
13301
13332
|
(noRunningResponseMessage) => {
|
|
13333
|
+
if (!canCancel) {
|
|
13334
|
+
return;
|
|
13335
|
+
}
|
|
13302
13336
|
const agentSessionId = activeConversationIdRef.current;
|
|
13303
13337
|
if (!agentSessionId || interruptingSessionIds[agentSessionId]) {
|
|
13304
13338
|
return;
|
|
@@ -13407,7 +13441,8 @@ function useAgentGUINodeController({
|
|
|
13407
13441
|
runtimeSessionsBySessionId,
|
|
13408
13442
|
activeSessionState,
|
|
13409
13443
|
workspaceId,
|
|
13410
|
-
agentActivityRuntime
|
|
13444
|
+
agentActivityRuntime,
|
|
13445
|
+
canCancel
|
|
13411
13446
|
]
|
|
13412
13447
|
);
|
|
13413
13448
|
useEffect4(() => {
|
|
@@ -13584,6 +13619,20 @@ function useAgentGUINodeController({
|
|
|
13584
13619
|
target: targetData,
|
|
13585
13620
|
options: snapshotComposerOptions
|
|
13586
13621
|
});
|
|
13622
|
+
agentActivityRuntime.reportDiagnostic?.({
|
|
13623
|
+
details: {
|
|
13624
|
+
agentTargetId: targetData.agentTargetId ?? null,
|
|
13625
|
+
changedFields: Object.keys(supportedNextSettings).sort().join(","),
|
|
13626
|
+
nextModel: supportedNextSettings.model ?? null,
|
|
13627
|
+
previousModel: previousSettings.model ?? null,
|
|
13628
|
+
provider: targetData.provider,
|
|
13629
|
+
reason: "no_active_conversation",
|
|
13630
|
+
resolvedModel: targetSafeMerged.model ?? null
|
|
13631
|
+
},
|
|
13632
|
+
event: "agent.gui.composer_settings.default_only",
|
|
13633
|
+
level: "info",
|
|
13634
|
+
workspaceId
|
|
13635
|
+
});
|
|
13587
13636
|
draftSettingsBySessionIdRef.current = {
|
|
13588
13637
|
...draftSettingsBySessionIdRef.current,
|
|
13589
13638
|
[defaultDraftKey]: targetSafeMerged
|
|
@@ -13674,7 +13723,54 @@ function useAgentGUINodeController({
|
|
|
13674
13723
|
);
|
|
13675
13724
|
}
|
|
13676
13725
|
}
|
|
13677
|
-
|
|
13726
|
+
const sessionSettingsPatchKeys = Object.keys(sessionSettingsPatch).sort();
|
|
13727
|
+
if (sessionSettingsPatchKeys.length === 0 && (nextModel !== void 0 || nextReasoningEffort !== void 0 || nextSpeed !== void 0 || nextPlanMode !== void 0 || nextPermission !== void 0 || nextBrowserUse !== void 0 || nextComputerUse !== void 0)) {
|
|
13728
|
+
agentActivityRuntime.reportDiagnostic?.({
|
|
13729
|
+
details: {
|
|
13730
|
+
agentSessionId,
|
|
13731
|
+
agentTargetId: normalizeOptionalText2(dataRef.current.agentTargetId),
|
|
13732
|
+
attemptedModel: nextModel ?? null,
|
|
13733
|
+
currentModel,
|
|
13734
|
+
provider: dataRef.current.provider,
|
|
13735
|
+
reason: "settings_already_current"
|
|
13736
|
+
},
|
|
13737
|
+
event: "agent.gui.composer_settings.update_noop",
|
|
13738
|
+
level: "info",
|
|
13739
|
+
workspaceId
|
|
13740
|
+
});
|
|
13741
|
+
}
|
|
13742
|
+
if (sessionSettingsPatchKeys.length > 0 && activeSessionState2 === null && !isPreActivationSession) {
|
|
13743
|
+
agentActivityRuntime.reportDiagnostic?.({
|
|
13744
|
+
details: {
|
|
13745
|
+
agentSessionId,
|
|
13746
|
+
agentTargetId: normalizeOptionalText2(dataRef.current.agentTargetId),
|
|
13747
|
+
changedFields: sessionSettingsPatchKeys.join(","),
|
|
13748
|
+
currentModel,
|
|
13749
|
+
nextModel: sessionSettingsPatch.model ?? null,
|
|
13750
|
+
provider: dataRef.current.provider,
|
|
13751
|
+
reason: "missing_active_session_state"
|
|
13752
|
+
},
|
|
13753
|
+
event: "agent.gui.composer_settings.update_skipped",
|
|
13754
|
+
level: "warn",
|
|
13755
|
+
workspaceId
|
|
13756
|
+
});
|
|
13757
|
+
}
|
|
13758
|
+
if (sessionSettingsPatchKeys.length > 0 && (activeSessionState2 !== null || isPreActivationSession)) {
|
|
13759
|
+
agentActivityRuntime.reportDiagnostic?.({
|
|
13760
|
+
details: {
|
|
13761
|
+
agentSessionId,
|
|
13762
|
+
agentTargetId: normalizeOptionalText2(dataRef.current.agentTargetId),
|
|
13763
|
+
changedFields: sessionSettingsPatchKeys.join(","),
|
|
13764
|
+
currentModel,
|
|
13765
|
+
isPreActivationSession,
|
|
13766
|
+
nextModel: sessionSettingsPatch.model ?? null,
|
|
13767
|
+
provider: dataRef.current.provider,
|
|
13768
|
+
turnPhase: activeSessionState2?.turnLifecycle?.phase ?? null
|
|
13769
|
+
},
|
|
13770
|
+
event: "agent.gui.composer_settings.update_requested",
|
|
13771
|
+
level: "info",
|
|
13772
|
+
workspaceId
|
|
13773
|
+
});
|
|
13678
13774
|
updateAgentSessionViewControlState(
|
|
13679
13775
|
sessionViewRef(agentSessionId),
|
|
13680
13776
|
(existing) => {
|
|
@@ -13964,30 +14060,54 @@ function useAgentGUINodeController({
|
|
|
13964
14060
|
if (!normalizedPath || isDeletingProjectConversations) {
|
|
13965
14061
|
return;
|
|
13966
14062
|
}
|
|
13967
|
-
const
|
|
13968
|
-
|
|
13969
|
-
resolveAgentGUIConversationProject(
|
|
13970
|
-
conversation2.cwd,
|
|
13971
|
-
userProjectsRef.current,
|
|
13972
|
-
{ isNoProjectPath: isNoProjectPathRef.current }
|
|
13973
|
-
)?.path
|
|
13974
|
-
) === normalizedPath
|
|
13975
|
-
);
|
|
13976
|
-
if (targetConversations.length === 0) {
|
|
14063
|
+
const countSessionSection = agentActivityRuntime.countSessionSection;
|
|
14064
|
+
if (!countSessionSection) {
|
|
13977
14065
|
return;
|
|
13978
14066
|
}
|
|
13979
14067
|
const project = userProjectsRef.current.find(
|
|
13980
14068
|
(candidate) => normalizeProjectConversationPath(candidate.path) === normalizedPath
|
|
13981
14069
|
);
|
|
14070
|
+
setDetailError(null);
|
|
14071
|
+
setListError(null);
|
|
13982
14072
|
setPendingDeleteProjectConversations({
|
|
13983
|
-
conversationCount:
|
|
14073
|
+
conversationCount: null,
|
|
13984
14074
|
label: project?.label?.trim() || path,
|
|
13985
14075
|
path: normalizedPath
|
|
13986
14076
|
});
|
|
13987
|
-
|
|
13988
|
-
|
|
14077
|
+
void countSessionSection({
|
|
14078
|
+
agentTargetId: agentGUISectionActionAgentTargetId(
|
|
14079
|
+
conversationFilterRef.current
|
|
14080
|
+
),
|
|
14081
|
+
sectionKey: projectConversationSectionKey(normalizedPath),
|
|
14082
|
+
workspaceId
|
|
14083
|
+
}).then((count) => {
|
|
14084
|
+
if (count.count <= 0) {
|
|
14085
|
+
setPendingDeleteProjectConversations(
|
|
14086
|
+
(current) => current?.path === normalizedPath ? null : current
|
|
14087
|
+
);
|
|
14088
|
+
return;
|
|
14089
|
+
}
|
|
14090
|
+
setPendingDeleteProjectConversations(
|
|
14091
|
+
(current) => current?.path === normalizedPath ? {
|
|
14092
|
+
...current,
|
|
14093
|
+
conversationCount: count.count
|
|
14094
|
+
} : current
|
|
14095
|
+
);
|
|
14096
|
+
}).catch((error) => {
|
|
14097
|
+
const message = getAgentGUIErrorMessage(error);
|
|
14098
|
+
setPendingDeleteProjectConversations(
|
|
14099
|
+
(current) => current?.path === normalizedPath ? null : current
|
|
14100
|
+
);
|
|
14101
|
+
setListError(message);
|
|
14102
|
+
showAgentGUIControllerErrorToast(agentHostApi.toast, message);
|
|
14103
|
+
});
|
|
13989
14104
|
},
|
|
13990
|
-
[
|
|
14105
|
+
[
|
|
14106
|
+
agentActivityRuntime,
|
|
14107
|
+
agentHostApi.toast,
|
|
14108
|
+
isDeletingProjectConversations,
|
|
14109
|
+
workspaceId
|
|
14110
|
+
]
|
|
13991
14111
|
);
|
|
13992
14112
|
const cancelDeleteProjectConversations = useCallback4(() => {
|
|
13993
14113
|
if (isDeletingProjectConversations) {
|
|
@@ -14155,181 +14275,226 @@ function useAgentGUINodeController({
|
|
|
14155
14275
|
removeConversations
|
|
14156
14276
|
]
|
|
14157
14277
|
);
|
|
14158
|
-
const confirmDeleteProjectConversations = useCallback4(
|
|
14159
|
-
|
|
14160
|
-
|
|
14161
|
-
|
|
14162
|
-
|
|
14163
|
-
|
|
14164
|
-
|
|
14165
|
-
|
|
14166
|
-
|
|
14167
|
-
|
|
14168
|
-
|
|
14169
|
-
|
|
14170
|
-
|
|
14171
|
-
|
|
14172
|
-
|
|
14173
|
-
|
|
14174
|
-
|
|
14175
|
-
|
|
14176
|
-
|
|
14177
|
-
|
|
14178
|
-
|
|
14179
|
-
|
|
14180
|
-
|
|
14181
|
-
|
|
14182
|
-
|
|
14183
|
-
|
|
14184
|
-
|
|
14185
|
-
|
|
14186
|
-
|
|
14278
|
+
const confirmDeleteProjectConversations = useCallback4(() => {
|
|
14279
|
+
const target = pendingDeleteProjectConversations;
|
|
14280
|
+
if (!target || isDeletingProjectConversations) {
|
|
14281
|
+
return;
|
|
14282
|
+
}
|
|
14283
|
+
if (target.conversationCount === null) {
|
|
14284
|
+
return;
|
|
14285
|
+
}
|
|
14286
|
+
const targetConversations = conversationsRef.current.filter(
|
|
14287
|
+
(conversation2) => normalizeProjectConversationPath(
|
|
14288
|
+
resolveAgentGUIConversationProject(
|
|
14289
|
+
conversation2.cwd,
|
|
14290
|
+
userProjectsRef.current,
|
|
14291
|
+
{ isNoProjectPath: isNoProjectPathRef.current }
|
|
14292
|
+
)?.path
|
|
14293
|
+
) === target.path
|
|
14294
|
+
);
|
|
14295
|
+
const seedTargetIds = new Set(
|
|
14296
|
+
targetConversations.map((conversation2) => conversation2.id)
|
|
14297
|
+
);
|
|
14298
|
+
const deleteSessionSection = agentActivityRuntime.deleteSessionSection;
|
|
14299
|
+
if (!deleteSessionSection) {
|
|
14300
|
+
return;
|
|
14301
|
+
}
|
|
14302
|
+
setIsDeletingProjectConversations(true);
|
|
14303
|
+
setDetailError(null);
|
|
14304
|
+
setListError(null);
|
|
14305
|
+
const activeDeletedConversationId = activeConversationIdRef.current;
|
|
14306
|
+
if (activeDeletedConversationId && seedTargetIds.has(activeDeletedConversationId)) {
|
|
14307
|
+
clearSelectedConversationNotFoundRetry();
|
|
14308
|
+
setIsLoadingMessages(true);
|
|
14309
|
+
setAgentSessionViewMessagesLoading(
|
|
14310
|
+
sessionViewRef(activeDeletedConversationId),
|
|
14311
|
+
true
|
|
14312
|
+
);
|
|
14313
|
+
}
|
|
14314
|
+
const targetSectionKey = projectConversationSectionKey(target.path);
|
|
14315
|
+
void deleteSessionSection({
|
|
14316
|
+
agentTargetId: agentGUISectionActionAgentTargetId(
|
|
14317
|
+
conversationFilterRef.current
|
|
14318
|
+
),
|
|
14319
|
+
sectionKey: targetSectionKey,
|
|
14320
|
+
workspaceId
|
|
14321
|
+
}).then((result) => {
|
|
14322
|
+
const targetIds = new Set(
|
|
14323
|
+
result.removedSessionIds.map((id) => id.trim()).filter((id) => id !== "")
|
|
14187
14324
|
);
|
|
14188
|
-
if (
|
|
14325
|
+
if (targetIds.size === 0) {
|
|
14189
14326
|
setPendingDeleteProjectConversations(null);
|
|
14190
14327
|
return;
|
|
14191
14328
|
}
|
|
14192
|
-
|
|
14193
|
-
|
|
14194
|
-
|
|
14195
|
-
|
|
14196
|
-
|
|
14197
|
-
|
|
14198
|
-
|
|
14199
|
-
|
|
14200
|
-
|
|
14201
|
-
|
|
14329
|
+
finalizeConversationBatchDeletion(targetIds);
|
|
14330
|
+
setPendingDeleteProjectConversations(null);
|
|
14331
|
+
}).catch((error) => {
|
|
14332
|
+
const message = getAgentGUIErrorMessage(error);
|
|
14333
|
+
reportAgentGUIRuntimeError({
|
|
14334
|
+
error,
|
|
14335
|
+
phase: "delete_conversation",
|
|
14336
|
+
provider: dataRef.current.provider,
|
|
14337
|
+
runtime: agentActivityRuntime,
|
|
14338
|
+
workspaceId,
|
|
14339
|
+
context: {
|
|
14340
|
+
projectPath: target.path,
|
|
14341
|
+
sectionKey: targetSectionKey,
|
|
14342
|
+
conversationCount: target.conversationCount
|
|
14343
|
+
}
|
|
14344
|
+
});
|
|
14345
|
+
setListError(message);
|
|
14346
|
+
showAgentGUIControllerErrorToast(agentHostApi.toast, message);
|
|
14347
|
+
if (activeDeletedConversationId && activeConversationIdRef.current === activeDeletedConversationId) {
|
|
14348
|
+
setIsLoadingMessages(false);
|
|
14202
14349
|
setAgentSessionViewMessagesLoading(
|
|
14203
14350
|
sessionViewRef(activeDeletedConversationId),
|
|
14204
|
-
|
|
14351
|
+
false
|
|
14205
14352
|
);
|
|
14206
14353
|
}
|
|
14207
|
-
|
|
14208
|
-
|
|
14209
|
-
|
|
14210
|
-
|
|
14211
|
-
|
|
14212
|
-
|
|
14213
|
-
|
|
14214
|
-
|
|
14215
|
-
|
|
14216
|
-
|
|
14217
|
-
|
|
14218
|
-
|
|
14219
|
-
|
|
14220
|
-
|
|
14221
|
-
|
|
14222
|
-
|
|
14223
|
-
|
|
14224
|
-
|
|
14225
|
-
|
|
14226
|
-
|
|
14227
|
-
|
|
14228
|
-
|
|
14229
|
-
|
|
14230
|
-
|
|
14231
|
-
|
|
14232
|
-
|
|
14233
|
-
|
|
14234
|
-
|
|
14235
|
-
|
|
14236
|
-
|
|
14237
|
-
|
|
14238
|
-
);
|
|
14239
|
-
}
|
|
14240
|
-
}).finally(() => {
|
|
14241
|
-
setIsDeletingProjectConversations(false);
|
|
14242
|
-
});
|
|
14243
|
-
},
|
|
14244
|
-
[
|
|
14245
|
-
activation,
|
|
14246
|
-
agentActivityRuntime,
|
|
14247
|
-
conversationListQuery,
|
|
14248
|
-
clearSelectedConversationNotFoundRetry,
|
|
14249
|
-
finalizeConversationBatchDeletion,
|
|
14250
|
-
isDeletingProjectConversations,
|
|
14251
|
-
markSelectedConversationDetailPending,
|
|
14252
|
-
pendingDeleteProjectConversations,
|
|
14253
|
-
persistActiveConversation,
|
|
14254
|
-
sessionViewRef,
|
|
14255
|
-
setTransientConversation,
|
|
14256
|
-
removeConversations,
|
|
14257
|
-
agentHostApi.toast,
|
|
14354
|
+
}).finally(() => {
|
|
14355
|
+
setIsDeletingProjectConversations(false);
|
|
14356
|
+
});
|
|
14357
|
+
}, [
|
|
14358
|
+
agentActivityRuntime,
|
|
14359
|
+
clearSelectedConversationNotFoundRetry,
|
|
14360
|
+
finalizeConversationBatchDeletion,
|
|
14361
|
+
isDeletingProjectConversations,
|
|
14362
|
+
pendingDeleteProjectConversations,
|
|
14363
|
+
sessionViewRef,
|
|
14364
|
+
agentHostApi.toast,
|
|
14365
|
+
workspaceId
|
|
14366
|
+
]);
|
|
14367
|
+
const requestDeleteConversations = useCallback4(() => {
|
|
14368
|
+
if (isDeletingProjectConversations) {
|
|
14369
|
+
return;
|
|
14370
|
+
}
|
|
14371
|
+
const countSessionSection = agentActivityRuntime.countSessionSection;
|
|
14372
|
+
if (!countSessionSection) {
|
|
14373
|
+
return;
|
|
14374
|
+
}
|
|
14375
|
+
setDetailError(null);
|
|
14376
|
+
setListError(null);
|
|
14377
|
+
setPendingDeleteConversations({
|
|
14378
|
+
conversationCount: null
|
|
14379
|
+
});
|
|
14380
|
+
void countSessionSection({
|
|
14381
|
+
agentTargetId: agentGUISectionActionAgentTargetId(
|
|
14382
|
+
conversationFilterRef.current
|
|
14383
|
+
),
|
|
14384
|
+
sectionKey: "conversations",
|
|
14258
14385
|
workspaceId
|
|
14259
|
-
|
|
14260
|
-
|
|
14261
|
-
|
|
14262
|
-
(agentSessionIds) => {
|
|
14263
|
-
if (isDeletingProjectConversations) {
|
|
14386
|
+
}).then((count) => {
|
|
14387
|
+
if (count.count <= 0) {
|
|
14388
|
+
setPendingDeleteConversations(null);
|
|
14264
14389
|
return;
|
|
14265
14390
|
}
|
|
14266
|
-
|
|
14267
|
-
|
|
14391
|
+
setPendingDeleteConversations(
|
|
14392
|
+
(current) => current ? {
|
|
14393
|
+
conversationCount: count.count
|
|
14394
|
+
} : current
|
|
14268
14395
|
);
|
|
14269
|
-
|
|
14270
|
-
|
|
14396
|
+
}).catch((error) => {
|
|
14397
|
+
const message = getAgentGUIErrorMessage(error);
|
|
14398
|
+
setPendingDeleteConversations(null);
|
|
14399
|
+
setListError(message);
|
|
14400
|
+
showAgentGUIControllerErrorToast(agentHostApi.toast, message);
|
|
14401
|
+
});
|
|
14402
|
+
}, [
|
|
14403
|
+
agentActivityRuntime,
|
|
14404
|
+
agentHostApi.toast,
|
|
14405
|
+
isDeletingProjectConversations,
|
|
14406
|
+
workspaceId
|
|
14407
|
+
]);
|
|
14408
|
+
const cancelDeleteConversations = useCallback4(() => {
|
|
14409
|
+
if (isDeletingProjectConversations) {
|
|
14410
|
+
return;
|
|
14411
|
+
}
|
|
14412
|
+
setPendingDeleteConversations(null);
|
|
14413
|
+
}, [isDeletingProjectConversations]);
|
|
14414
|
+
const confirmDeleteConversations = useCallback4(() => {
|
|
14415
|
+
const target = pendingDeleteConversations;
|
|
14416
|
+
if (!target || isDeletingProjectConversations) {
|
|
14417
|
+
return;
|
|
14418
|
+
}
|
|
14419
|
+
if (target.conversationCount === null) {
|
|
14420
|
+
return;
|
|
14421
|
+
}
|
|
14422
|
+
const deleteSessionSection = agentActivityRuntime.deleteSessionSection;
|
|
14423
|
+
if (!deleteSessionSection) {
|
|
14424
|
+
return;
|
|
14425
|
+
}
|
|
14426
|
+
const seedTargetIds = new Set(
|
|
14427
|
+
conversationsRef.current.filter(
|
|
14428
|
+
(conversation2) => !resolveAgentGUIConversationProject(
|
|
14429
|
+
conversation2.cwd,
|
|
14430
|
+
userProjectsRef.current,
|
|
14431
|
+
{ isNoProjectPath: isNoProjectPathRef.current }
|
|
14432
|
+
)
|
|
14433
|
+
).map((conversation2) => conversation2.id)
|
|
14434
|
+
);
|
|
14435
|
+
setIsDeletingProjectConversations(true);
|
|
14436
|
+
setDetailError(null);
|
|
14437
|
+
setListError(null);
|
|
14438
|
+
const activeDeletedConversationId = activeConversationIdRef.current;
|
|
14439
|
+
if (activeDeletedConversationId && seedTargetIds.has(activeDeletedConversationId)) {
|
|
14440
|
+
clearSelectedConversationNotFoundRetry();
|
|
14441
|
+
setIsLoadingMessages(true);
|
|
14442
|
+
setAgentSessionViewMessagesLoading(
|
|
14443
|
+
sessionViewRef(activeDeletedConversationId),
|
|
14444
|
+
true
|
|
14445
|
+
);
|
|
14446
|
+
}
|
|
14447
|
+
void deleteSessionSection({
|
|
14448
|
+
agentTargetId: agentGUISectionActionAgentTargetId(
|
|
14449
|
+
conversationFilterRef.current
|
|
14450
|
+
),
|
|
14451
|
+
sectionKey: "conversations",
|
|
14452
|
+
workspaceId
|
|
14453
|
+
}).then((result) => {
|
|
14454
|
+
const targetIds = new Set(
|
|
14455
|
+
result.removedSessionIds.map((id) => id.trim()).filter((id) => id !== "")
|
|
14271
14456
|
);
|
|
14272
|
-
if (
|
|
14457
|
+
if (targetIds.size === 0) {
|
|
14458
|
+
setPendingDeleteConversations(null);
|
|
14273
14459
|
return;
|
|
14274
14460
|
}
|
|
14275
|
-
|
|
14276
|
-
|
|
14277
|
-
|
|
14278
|
-
const
|
|
14279
|
-
|
|
14280
|
-
|
|
14281
|
-
|
|
14461
|
+
finalizeConversationBatchDeletion(targetIds);
|
|
14462
|
+
setPendingDeleteConversations(null);
|
|
14463
|
+
}).catch((error) => {
|
|
14464
|
+
const message = getAgentGUIErrorMessage(error);
|
|
14465
|
+
reportAgentGUIRuntimeError({
|
|
14466
|
+
error,
|
|
14467
|
+
phase: "delete_conversation",
|
|
14468
|
+
provider: dataRef.current.provider,
|
|
14469
|
+
runtime: agentActivityRuntime,
|
|
14470
|
+
workspaceId,
|
|
14471
|
+
context: {
|
|
14472
|
+
conversationCount: target.conversationCount,
|
|
14473
|
+
sectionKey: "conversations"
|
|
14474
|
+
}
|
|
14475
|
+
});
|
|
14476
|
+
setListError(message);
|
|
14477
|
+
showAgentGUIControllerErrorToast(agentHostApi.toast, message);
|
|
14478
|
+
if (activeDeletedConversationId && activeConversationIdRef.current === activeDeletedConversationId) {
|
|
14479
|
+
setIsLoadingMessages(false);
|
|
14282
14480
|
setAgentSessionViewMessagesLoading(
|
|
14283
14481
|
sessionViewRef(activeDeletedConversationId),
|
|
14284
|
-
|
|
14482
|
+
false
|
|
14285
14483
|
);
|
|
14286
14484
|
}
|
|
14287
|
-
|
|
14288
|
-
|
|
14289
|
-
|
|
14290
|
-
|
|
14291
|
-
|
|
14292
|
-
|
|
14293
|
-
|
|
14294
|
-
|
|
14295
|
-
|
|
14296
|
-
|
|
14297
|
-
|
|
14298
|
-
|
|
14299
|
-
|
|
14300
|
-
error,
|
|
14301
|
-
phase: "delete_conversation",
|
|
14302
|
-
provider: dataRef.current.provider,
|
|
14303
|
-
runtime: agentActivityRuntime,
|
|
14304
|
-
workspaceId,
|
|
14305
|
-
context: {
|
|
14306
|
-
conversationCount: targetConversations.length
|
|
14307
|
-
}
|
|
14308
|
-
});
|
|
14309
|
-
setListError(message);
|
|
14310
|
-
showAgentGUIControllerErrorToast(agentHostApi.toast, message);
|
|
14311
|
-
if (activeDeletedConversationId && activeConversationIdRef.current === activeDeletedConversationId) {
|
|
14312
|
-
setIsLoadingMessages(false);
|
|
14313
|
-
setAgentSessionViewMessagesLoading(
|
|
14314
|
-
sessionViewRef(activeDeletedConversationId),
|
|
14315
|
-
false
|
|
14316
|
-
);
|
|
14317
|
-
}
|
|
14318
|
-
}).finally(() => {
|
|
14319
|
-
setIsDeletingProjectConversations(false);
|
|
14320
|
-
});
|
|
14321
|
-
},
|
|
14322
|
-
[
|
|
14323
|
-
activation,
|
|
14324
|
-
agentActivityRuntime,
|
|
14325
|
-
clearSelectedConversationNotFoundRetry,
|
|
14326
|
-
finalizeConversationBatchDeletion,
|
|
14327
|
-
isDeletingProjectConversations,
|
|
14328
|
-
sessionViewRef,
|
|
14329
|
-
agentHostApi.toast,
|
|
14330
|
-
workspaceId
|
|
14331
|
-
]
|
|
14332
|
-
);
|
|
14485
|
+
}).finally(() => {
|
|
14486
|
+
setIsDeletingProjectConversations(false);
|
|
14487
|
+
});
|
|
14488
|
+
}, [
|
|
14489
|
+
agentActivityRuntime,
|
|
14490
|
+
clearSelectedConversationNotFoundRetry,
|
|
14491
|
+
finalizeConversationBatchDeletion,
|
|
14492
|
+
isDeletingProjectConversations,
|
|
14493
|
+
pendingDeleteConversations,
|
|
14494
|
+
sessionViewRef,
|
|
14495
|
+
agentHostApi.toast,
|
|
14496
|
+
workspaceId
|
|
14497
|
+
]);
|
|
14333
14498
|
const toggleConversationPinned = useCallback4(
|
|
14334
14499
|
(agentSessionId, pinned) => {
|
|
14335
14500
|
const normalizedAgentSessionId = agentSessionId.trim();
|
|
@@ -14825,11 +14990,11 @@ function useAgentGUINodeController({
|
|
|
14825
14990
|
activeRawPromptRequestId,
|
|
14826
14991
|
suppressedPromptRequestId
|
|
14827
14992
|
]);
|
|
14828
|
-
const pendingApproval = hasProviderSessionNotFoundError || isActivePromptSuppressed ? null : rawPendingApproval;
|
|
14829
|
-
const serverInteractivePrompt = hasProviderSessionNotFoundError || isActivePromptSuppressed ? null : rawPendingInteractivePrompt;
|
|
14993
|
+
const pendingApproval = !canSubmitInteractive || hasProviderSessionNotFoundError || isActivePromptSuppressed ? null : rawPendingApproval;
|
|
14994
|
+
const serverInteractivePrompt = !canSubmitInteractive || hasProviderSessionNotFoundError || isActivePromptSuppressed ? null : rawPendingInteractivePrompt;
|
|
14830
14995
|
const isInterrupting = activeConversationId !== null && Boolean(interruptingSessionIds[activeConversationId]);
|
|
14831
14996
|
const isCancelPending = activeConversationId !== null && Boolean(pendingInterruptSessionIds[activeConversationId]);
|
|
14832
|
-
const queuedPrompts = activeConversationId ?
|
|
14997
|
+
const queuedPrompts = activeConversationId ? activeQueuedPrompts : EMPTY_QUEUED_PROMPTS;
|
|
14833
14998
|
const drainingQueuedPromptId = activeQueuedPromptClaim?.promptId ?? null;
|
|
14834
14999
|
const sessionSettings = useStableComposerSettings(
|
|
14835
15000
|
cloneComposerSettings(activeSessionState?.settings ?? null)
|
|
@@ -14911,7 +15076,7 @@ function useAgentGUINodeController({
|
|
|
14911
15076
|
);
|
|
14912
15077
|
const planImplementationTurnId = activeConversationId !== null && dataRef.current.provider === "codex" && composerSupport.plan && Boolean(draftSettings.planMode) && activeConversation?.status !== "working" ? latestPlanTurnId(activeTimelineItems) : null;
|
|
14913
15078
|
planImplementationTurnIdRef.current = planImplementationTurnId;
|
|
14914
|
-
const planImplementationPromptVM = planImplementationTurnId !== null && activeConversationId !== null && dismissedPlanTurnIdBySessionId[activeConversationId] !== planImplementationTurnId ? planImplementationPromptFromPlanTurn(
|
|
15079
|
+
const planImplementationPromptVM = canSubmitInteractive && planImplementationTurnId !== null && activeConversationId !== null && dismissedPlanTurnIdBySessionId[activeConversationId] !== planImplementationTurnId ? planImplementationPromptFromPlanTurn(
|
|
14915
15080
|
planImplementationTurnId,
|
|
14916
15081
|
activeConversation?.title ?? ""
|
|
14917
15082
|
) : null;
|
|
@@ -14991,10 +15156,9 @@ function useAgentGUINodeController({
|
|
|
14991
15156
|
pendingApproval
|
|
14992
15157
|
]);
|
|
14993
15158
|
const canSubmit = !providerTargetsLoading && activeLiveState !== "activating" && activeLiveState !== "failed" && !activeConversationResumeUnavailable && (activeConversationId !== null || effectiveSelectedProviderTarget.disabled !== true) && (composerTargetData.provider !== "openclaw" || openclawGateway?.status === "ready") && pendingApproval === null && pendingInteractivePrompt === null && sessionChrome.auth === null && !activeConversationBusy && !isCreatingConversation && !isSubmitting && !isInterrupting;
|
|
14994
|
-
const
|
|
15159
|
+
const activeConversationCreatePending = Boolean(activeConversationId) && isCreatingConversation && startingConversationIdRef.current === activeConversationId;
|
|
15160
|
+
const canQueueWhileBusy = Boolean(activeConversationId) && (activeConversationCreatePending || activeConversationBusy || isSubmitting || Boolean(activeSessionState?.pendingInteractive));
|
|
14995
15161
|
useEffect4(() => {
|
|
14996
|
-
const firstVersion = minFiniteMessageVersion(activeMessages);
|
|
14997
|
-
const lastVersion = maxFiniteMessageVersion(activeMessages);
|
|
14998
15162
|
const diagnosticKey = [
|
|
14999
15163
|
activeConversationId ?? "",
|
|
15000
15164
|
activeConversation?.status ?? "",
|
|
@@ -15016,10 +15180,9 @@ function useAgentGUINodeController({
|
|
|
15016
15180
|
activeSubmitBlocked ? "submit-blocked" : "submit-open",
|
|
15017
15181
|
pendingApproval?.requestId ?? "",
|
|
15018
15182
|
promptRequestId(pendingInteractivePrompt) ?? "",
|
|
15019
|
-
conversation?.
|
|
15020
|
-
conversation?.
|
|
15021
|
-
|
|
15022
|
-
lastVersion ?? "",
|
|
15183
|
+
conversation?.activity.status ?? "",
|
|
15184
|
+
conversation?.pendingApproval?.requestId ?? "",
|
|
15185
|
+
promptRequestId(conversation?.pendingInteractivePrompt ?? null) ?? "",
|
|
15023
15186
|
isCreatingConversation ? "creating" : "",
|
|
15024
15187
|
isLoadingMessages ? "loading-messages" : "",
|
|
15025
15188
|
isSubmitting ? "submitting" : "",
|
|
@@ -15058,7 +15221,6 @@ function useAgentGUINodeController({
|
|
|
15058
15221
|
activeConversationId,
|
|
15059
15222
|
activeHasPendingSubmittedTurn,
|
|
15060
15223
|
activeLiveState,
|
|
15061
|
-
activeMessages,
|
|
15062
15224
|
activeRuntimeSession,
|
|
15063
15225
|
activeSessionState,
|
|
15064
15226
|
activeSubmitBlocked,
|
|
@@ -15512,6 +15674,12 @@ function useAgentGUINodeController({
|
|
|
15512
15674
|
const stableRequestDeleteProjectConversations = useStableControllerEventCallback(requestDeleteProjectConversations);
|
|
15513
15675
|
const stableCancelDeleteProjectConversations = useStableControllerEventCallback(cancelDeleteProjectConversations);
|
|
15514
15676
|
const stableConfirmDeleteProjectConversations = useStableControllerEventCallback(confirmDeleteProjectConversations);
|
|
15677
|
+
const stableRequestDeleteConversations = useStableControllerEventCallback(
|
|
15678
|
+
requestDeleteConversations
|
|
15679
|
+
);
|
|
15680
|
+
const stableCancelDeleteConversations = useStableControllerEventCallback(
|
|
15681
|
+
cancelDeleteConversations
|
|
15682
|
+
);
|
|
15515
15683
|
const stableConfirmDeleteConversations = useStableControllerEventCallback(
|
|
15516
15684
|
confirmDeleteConversations
|
|
15517
15685
|
);
|
|
@@ -15571,6 +15739,8 @@ function useAgentGUINodeController({
|
|
|
15571
15739
|
requestDeleteProjectConversations: stableRequestDeleteProjectConversations,
|
|
15572
15740
|
cancelDeleteProjectConversations: stableCancelDeleteProjectConversations,
|
|
15573
15741
|
confirmDeleteProjectConversations: stableConfirmDeleteProjectConversations,
|
|
15742
|
+
requestDeleteConversations: stableRequestDeleteConversations,
|
|
15743
|
+
cancelDeleteConversations: stableCancelDeleteConversations,
|
|
15574
15744
|
confirmDeleteConversations: stableConfirmDeleteConversations,
|
|
15575
15745
|
toggleConversationPinned: stableToggleConversationPinned,
|
|
15576
15746
|
markConversationUnread: stableMarkConversationUnread,
|
|
@@ -15584,6 +15754,7 @@ function useAgentGUINodeController({
|
|
|
15584
15754
|
}),
|
|
15585
15755
|
[
|
|
15586
15756
|
stableCancelDeleteConversation,
|
|
15757
|
+
stableCancelDeleteConversations,
|
|
15587
15758
|
stableCancelDeleteProjectConversations,
|
|
15588
15759
|
stableConfirmDeleteConversation,
|
|
15589
15760
|
stableConfirmDeleteConversations,
|
|
@@ -15598,6 +15769,7 @@ function useAgentGUINodeController({
|
|
|
15598
15769
|
stableRemoveQueuedPrompt,
|
|
15599
15770
|
stableRenameConversation,
|
|
15600
15771
|
stableRequestDeleteConversation,
|
|
15772
|
+
stableRequestDeleteConversations,
|
|
15601
15773
|
stableRequestDeleteProjectConversations,
|
|
15602
15774
|
stableRetryActivation,
|
|
15603
15775
|
stableRetryOpenclawGateway,
|
|
@@ -15649,6 +15821,10 @@ function useAgentGUINodeController({
|
|
|
15649
15821
|
isInterrupting,
|
|
15650
15822
|
isCancelPending,
|
|
15651
15823
|
isRespondingApproval,
|
|
15824
|
+
canCancel,
|
|
15825
|
+
canSubmitInteractive,
|
|
15826
|
+
canGoalControl,
|
|
15827
|
+
canUploadAttachment,
|
|
15652
15828
|
promptImagesSupported,
|
|
15653
15829
|
compactSupported,
|
|
15654
15830
|
goalPauseSupported,
|
|
@@ -15659,6 +15835,7 @@ function useAgentGUINodeController({
|
|
|
15659
15835
|
isDeletingProjectConversations,
|
|
15660
15836
|
pendingDeleteConversation,
|
|
15661
15837
|
pendingDeleteProjectConversations,
|
|
15838
|
+
pendingDeleteConversations,
|
|
15662
15839
|
pendingApproval,
|
|
15663
15840
|
pendingInteractivePrompt,
|
|
15664
15841
|
activeLiveState,
|
|
@@ -15695,6 +15872,10 @@ function useAgentGUINodeController({
|
|
|
15695
15872
|
availableCommands,
|
|
15696
15873
|
availableSkills,
|
|
15697
15874
|
canSubmit,
|
|
15875
|
+
canCancel,
|
|
15876
|
+
canSubmitInteractive,
|
|
15877
|
+
canGoalControl,
|
|
15878
|
+
canUploadAttachment,
|
|
15698
15879
|
canQueueWhileBusy,
|
|
15699
15880
|
conversation,
|
|
15700
15881
|
conversationFilter,
|
|
@@ -15732,6 +15913,7 @@ function useAgentGUINodeController({
|
|
|
15732
15913
|
hasSentUserMessage,
|
|
15733
15914
|
pendingDeleteConversation,
|
|
15734
15915
|
pendingDeleteProjectConversations,
|
|
15916
|
+
pendingDeleteConversations,
|
|
15735
15917
|
pendingApproval,
|
|
15736
15918
|
pendingInteractivePrompt,
|
|
15737
15919
|
effectiveSelectedProviderTarget.disabled,
|
|
@@ -15755,6 +15937,10 @@ function normalizeProjectConversationPath(path) {
|
|
|
15755
15937
|
}
|
|
15756
15938
|
return normalized.replace(/\/+$/, "") || "/";
|
|
15757
15939
|
}
|
|
15940
|
+
function projectConversationSectionKey(path) {
|
|
15941
|
+
const normalizedPath = normalizeProjectConversationPath(path);
|
|
15942
|
+
return normalizedPath ? `project:${normalizedPath}` : "";
|
|
15943
|
+
}
|
|
15758
15944
|
function omitConversationLocalState(current, conversationIds) {
|
|
15759
15945
|
let changed = false;
|
|
15760
15946
|
const next = { ...current };
|
|
@@ -15932,9 +16118,9 @@ import {
|
|
|
15932
16118
|
Fragment as Fragment8,
|
|
15933
16119
|
memo as memo2,
|
|
15934
16120
|
useCallback as useCallback10,
|
|
15935
|
-
useEffect as
|
|
16121
|
+
useEffect as useEffect15,
|
|
15936
16122
|
useLayoutEffect as useLayoutEffect4,
|
|
15937
|
-
useMemo as
|
|
16123
|
+
useMemo as useMemo10,
|
|
15938
16124
|
useRef as useRef12,
|
|
15939
16125
|
useState as useState14
|
|
15940
16126
|
} from "react";
|
|
@@ -16142,7 +16328,11 @@ import {
|
|
|
16142
16328
|
cn as cn3
|
|
16143
16329
|
} from "@tutti-os/ui-system";
|
|
16144
16330
|
import { WorkspaceUserProjectSelect as WorkspaceUserProjectSelect2 } from "@tutti-os/workspace-user-project/ui";
|
|
16145
|
-
import {
|
|
16331
|
+
import {
|
|
16332
|
+
BareIconButton,
|
|
16333
|
+
Input as Input2,
|
|
16334
|
+
ScrollArea
|
|
16335
|
+
} from "@tutti-os/ui-system/components";
|
|
16146
16336
|
import {
|
|
16147
16337
|
CreateChatIcon,
|
|
16148
16338
|
FolderIcon as FolderIcon2,
|
|
@@ -17293,9 +17483,9 @@ function AgentGoalBanner({
|
|
|
17293
17483
|
// agent-gui/agentGuiNode/AgentComposer.tsx
|
|
17294
17484
|
import {
|
|
17295
17485
|
useCallback as useCallback9,
|
|
17296
|
-
useEffect as
|
|
17486
|
+
useEffect as useEffect14,
|
|
17297
17487
|
useLayoutEffect as useLayoutEffect3,
|
|
17298
|
-
useMemo as
|
|
17488
|
+
useMemo as useMemo9,
|
|
17299
17489
|
useRef as useRef11,
|
|
17300
17490
|
useState as useState13
|
|
17301
17491
|
} from "react";
|
|
@@ -17519,6 +17709,7 @@ var CLAUDE_CODE_FALLBACK_COMMANDS = [
|
|
|
17519
17709
|
var CURSOR_FALLBACK_COMMANDS = [];
|
|
17520
17710
|
var OPENCODE_FALLBACK_COMMANDS = [
|
|
17521
17711
|
{ name: "compact" },
|
|
17712
|
+
{ name: "goal" },
|
|
17522
17713
|
{ name: REVIEW_COMMAND }
|
|
17523
17714
|
];
|
|
17524
17715
|
var CLAUDE_CODE_SLASH_PALETTE_COMMANDS = /* @__PURE__ */ new Set([
|
|
@@ -17577,6 +17768,7 @@ function resolveSlashCommandsForProvider({
|
|
|
17577
17768
|
hasCompactableContext = true,
|
|
17578
17769
|
compactSupported,
|
|
17579
17770
|
planSupported = false,
|
|
17771
|
+
goalSupported = true,
|
|
17580
17772
|
browserSupported = false,
|
|
17581
17773
|
computerSupported = false
|
|
17582
17774
|
}) {
|
|
@@ -17592,7 +17784,7 @@ function resolveSlashCommandsForProvider({
|
|
|
17592
17784
|
);
|
|
17593
17785
|
const commandEntries = mergedEntries.filter((entry) => {
|
|
17594
17786
|
const commandName = normalizedCommandName(entry);
|
|
17595
|
-
return commandName !== "plan" && isSlashPaletteCommandVisible(provider, commandName);
|
|
17787
|
+
return commandName !== "plan" && (goalSupported !== false || commandName !== "goal") && isSlashPaletteCommandVisible(provider, commandName);
|
|
17596
17788
|
});
|
|
17597
17789
|
const planEntries = planSupported && isACPProvider(provider) ? [PLAN_MODE_COMMAND] : [];
|
|
17598
17790
|
const capabilityEntries = [];
|
|
@@ -17978,7 +18170,9 @@ function slashPaletteEntryIcon(entry) {
|
|
|
17978
18170
|
|
|
17979
18171
|
// agent-gui/agentGuiNode/AgentQueuedPromptPanel.tsx
|
|
17980
18172
|
import {
|
|
18173
|
+
useEffect as useEffect9,
|
|
17981
18174
|
useLayoutEffect,
|
|
18175
|
+
useMemo as useMemo4,
|
|
17982
18176
|
useRef as useRef7,
|
|
17983
18177
|
useState as useState8
|
|
17984
18178
|
} from "react";
|
|
@@ -17992,9 +18186,81 @@ import {
|
|
|
17992
18186
|
import { jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
17993
18187
|
var EMPTY_WORKSPACE_APP_ICONS = [];
|
|
17994
18188
|
function queuedPromptImages(queuedPrompt) {
|
|
17995
|
-
return agentPromptContentImageBlocks(
|
|
17996
|
-
|
|
18189
|
+
return agentPromptContentImageBlocks(queuedPrompt.content);
|
|
18190
|
+
}
|
|
18191
|
+
function queuedPromptImageDataUrl(image) {
|
|
18192
|
+
const data = image.data?.trim() ?? "";
|
|
18193
|
+
const mimeType = image.mimeType.trim();
|
|
18194
|
+
if (!data || !mimeType) {
|
|
18195
|
+
return null;
|
|
18196
|
+
}
|
|
18197
|
+
return data.startsWith("data:") ? data : `data:${mimeType};base64,${data}`;
|
|
18198
|
+
}
|
|
18199
|
+
function queuedPromptImageKey(queuedPrompt, image, index) {
|
|
18200
|
+
return [
|
|
18201
|
+
queuedPrompt.id,
|
|
18202
|
+
index,
|
|
18203
|
+
image.attachmentId?.trim() ?? "",
|
|
18204
|
+
image.path?.trim() ?? "",
|
|
18205
|
+
image.name?.trim() ?? "",
|
|
18206
|
+
image.mimeType
|
|
18207
|
+
].join(":");
|
|
18208
|
+
}
|
|
18209
|
+
function useQueuedPromptImageSources(input) {
|
|
18210
|
+
const runtime = useOptionalAgentActivityRuntime();
|
|
18211
|
+
const [sources, setSources] = useState8(() => /* @__PURE__ */ new Map());
|
|
18212
|
+
const workspaceId = input.workspaceId?.trim() ?? "";
|
|
18213
|
+
const agentSessionId = input.agentSessionId?.trim() ?? "";
|
|
18214
|
+
const missingImages = useMemo4(
|
|
18215
|
+
() => input.images.filter(({ image, key }) => {
|
|
18216
|
+
const attachmentId = image.attachmentId?.trim() ?? "";
|
|
18217
|
+
const path = image.path?.trim() ?? "";
|
|
18218
|
+
return !queuedPromptImageDataUrl(image) && !sources.has(key) && Boolean(attachmentId || path) && Boolean(workspaceId);
|
|
18219
|
+
}),
|
|
18220
|
+
[input.images, sources, workspaceId]
|
|
17997
18221
|
);
|
|
18222
|
+
useEffect9(() => {
|
|
18223
|
+
if (!runtime?.readSessionAttachment && !runtime?.readPromptAsset || missingImages.length === 0) {
|
|
18224
|
+
return;
|
|
18225
|
+
}
|
|
18226
|
+
let canceled = false;
|
|
18227
|
+
for (const { image, key } of missingImages) {
|
|
18228
|
+
const attachmentId = image.attachmentId?.trim() ?? "";
|
|
18229
|
+
const path = image.path?.trim() ?? "";
|
|
18230
|
+
const readImage = attachmentId ? runtime.readSessionAttachment?.({
|
|
18231
|
+
workspaceId,
|
|
18232
|
+
agentSessionId,
|
|
18233
|
+
attachmentId
|
|
18234
|
+
}) : runtime.readPromptAsset?.({
|
|
18235
|
+
workspaceId,
|
|
18236
|
+
agentSessionId,
|
|
18237
|
+
mimeType: image.mimeType,
|
|
18238
|
+
name: image.name,
|
|
18239
|
+
path
|
|
18240
|
+
});
|
|
18241
|
+
if (!readImage) {
|
|
18242
|
+
continue;
|
|
18243
|
+
}
|
|
18244
|
+
void readImage.then((asset) => {
|
|
18245
|
+
if (canceled) {
|
|
18246
|
+
return;
|
|
18247
|
+
}
|
|
18248
|
+
setSources((current) => {
|
|
18249
|
+
if (current.has(key)) {
|
|
18250
|
+
return current;
|
|
18251
|
+
}
|
|
18252
|
+
const next = new Map(current);
|
|
18253
|
+
next.set(key, `data:${asset.mimeType};base64,${asset.data}`);
|
|
18254
|
+
return next;
|
|
18255
|
+
});
|
|
18256
|
+
}).catch(() => {
|
|
18257
|
+
});
|
|
18258
|
+
}
|
|
18259
|
+
return () => {
|
|
18260
|
+
canceled = true;
|
|
18261
|
+
};
|
|
18262
|
+
}, [agentSessionId, missingImages, runtime, workspaceId]);
|
|
18263
|
+
return sources;
|
|
17998
18264
|
}
|
|
17999
18265
|
function queuedPromptDisplayText(queuedPrompt) {
|
|
18000
18266
|
const prompt = agentPromptContentDisplayText(queuedPrompt.content);
|
|
@@ -18017,7 +18283,9 @@ function AgentQueuedPromptPanel({
|
|
|
18017
18283
|
onSendQueuedPromptNext,
|
|
18018
18284
|
onRemoveQueuedPrompt,
|
|
18019
18285
|
onEditQueuedPrompt,
|
|
18286
|
+
agentSessionId = null,
|
|
18020
18287
|
onLinkClick,
|
|
18288
|
+
workspaceId = null,
|
|
18021
18289
|
workspaceAppIcons = EMPTY_WORKSPACE_APP_ICONS
|
|
18022
18290
|
}) {
|
|
18023
18291
|
"use memo";
|
|
@@ -18027,6 +18295,20 @@ function AgentQueuedPromptPanel({
|
|
|
18027
18295
|
const pointerHandledEditPromptIdRef = useRef7(null);
|
|
18028
18296
|
const [isSinglePromptOverflowing, setIsSinglePromptOverflowing] = useState8(false);
|
|
18029
18297
|
const [expandedListMaxHeightPx, setExpandedListMaxHeightPx] = useState8(280);
|
|
18298
|
+
const queuedPromptImageEntries = useMemo4(
|
|
18299
|
+
() => queuedPrompts.flatMap(
|
|
18300
|
+
(queuedPrompt) => queuedPromptImages(queuedPrompt).slice(0, 3).map((image, index) => ({
|
|
18301
|
+
image,
|
|
18302
|
+
key: queuedPromptImageKey(queuedPrompt, image, index)
|
|
18303
|
+
}))
|
|
18304
|
+
),
|
|
18305
|
+
[queuedPrompts]
|
|
18306
|
+
);
|
|
18307
|
+
const queuedPromptImageSources = useQueuedPromptImageSources({
|
|
18308
|
+
agentSessionId,
|
|
18309
|
+
images: queuedPromptImageEntries,
|
|
18310
|
+
workspaceId
|
|
18311
|
+
});
|
|
18030
18312
|
const singlePromptHasImages = queuedPrompts.length === 1 && queuedPromptImages(queuedPrompts[0]).length > 0;
|
|
18031
18313
|
const canExpand = queuedPrompts.length > 1 || singlePromptHasImages || isSinglePromptOverflowing;
|
|
18032
18314
|
const panelStyle = {
|
|
@@ -18177,7 +18459,15 @@ function AgentQueuedPromptPanel({
|
|
|
18177
18459
|
}
|
|
18178
18460
|
) : null,
|
|
18179
18461
|
images.length > 0 ? /* @__PURE__ */ jsx25("div", { className: AgentGUINode_styles_default.composerQueuedPromptImages, children: images.slice(0, 3).map((image, index) => {
|
|
18180
|
-
const
|
|
18462
|
+
const imageKey = queuedPromptImageKey(
|
|
18463
|
+
queuedPrompt,
|
|
18464
|
+
image,
|
|
18465
|
+
index
|
|
18466
|
+
);
|
|
18467
|
+
const src = queuedPromptImageSources.get(imageKey) ?? queuedPromptImageDataUrl(image);
|
|
18468
|
+
if (!src) {
|
|
18469
|
+
return null;
|
|
18470
|
+
}
|
|
18181
18471
|
return /* @__PURE__ */ jsx25(
|
|
18182
18472
|
ZoomableImage,
|
|
18183
18473
|
{
|
|
@@ -18187,7 +18477,7 @@ function AgentQueuedPromptPanel({
|
|
|
18187
18477
|
src,
|
|
18188
18478
|
wrapElement: "span"
|
|
18189
18479
|
},
|
|
18190
|
-
|
|
18480
|
+
imageKey
|
|
18191
18481
|
);
|
|
18192
18482
|
}) }) : null
|
|
18193
18483
|
] }) }),
|
|
@@ -18264,8 +18554,8 @@ function AgentQueuedPromptPanel({
|
|
|
18264
18554
|
import {
|
|
18265
18555
|
Fragment as Fragment4,
|
|
18266
18556
|
cloneElement,
|
|
18267
|
-
useEffect as
|
|
18268
|
-
useMemo as
|
|
18557
|
+
useEffect as useEffect10,
|
|
18558
|
+
useMemo as useMemo5,
|
|
18269
18559
|
useState as useState9
|
|
18270
18560
|
} from "react";
|
|
18271
18561
|
import { ChevronDown, ZapIcon as ZapIcon2 } from "lucide-react";
|
|
@@ -18767,11 +19057,11 @@ function AgentProjectDropdown({
|
|
|
18767
19057
|
}) {
|
|
18768
19058
|
"use memo";
|
|
18769
19059
|
const agentHostApi = useAgentHostApi();
|
|
18770
|
-
const resolvedLabels =
|
|
19060
|
+
const resolvedLabels = useMemo5(
|
|
18771
19061
|
() => resolveWorkspaceUserProjectSelectLabels(i18n, labels),
|
|
18772
19062
|
[i18n, labels]
|
|
18773
19063
|
);
|
|
18774
|
-
const userProjectApi =
|
|
19064
|
+
const userProjectApi = useMemo5(
|
|
18775
19065
|
() => !previewMode && agentHostApi.userProjects ? {
|
|
18776
19066
|
...agentHostApi.userProjects,
|
|
18777
19067
|
selectDirectory: selectProjectDirectory ?? agentHostApi.workspace.selectDirectory
|
|
@@ -19003,7 +19293,7 @@ function AgentProjectMissingStatusProbe({
|
|
|
19003
19293
|
"use memo";
|
|
19004
19294
|
const agentHostApi = useAgentHostApi();
|
|
19005
19295
|
const selectedPath = composerSettings.selectedProjectPath?.trim() ?? "";
|
|
19006
|
-
|
|
19296
|
+
useEffect10(() => {
|
|
19007
19297
|
let canceled = false;
|
|
19008
19298
|
const userProjects = agentHostApi.userProjects;
|
|
19009
19299
|
if (!userProjects || !composerSettings.projectLocked || !selectedPath) {
|
|
@@ -19374,9 +19664,9 @@ function ComposerModelOptionTooltip({
|
|
|
19374
19664
|
import {
|
|
19375
19665
|
forwardRef as forwardRef3,
|
|
19376
19666
|
useCallback as useCallback6,
|
|
19377
|
-
useEffect as
|
|
19667
|
+
useEffect as useEffect11,
|
|
19378
19668
|
useImperativeHandle as useImperativeHandle2,
|
|
19379
|
-
useMemo as
|
|
19669
|
+
useMemo as useMemo6,
|
|
19380
19670
|
useRef as useRef8,
|
|
19381
19671
|
useState as useState10
|
|
19382
19672
|
} from "react";
|
|
@@ -19493,7 +19783,7 @@ function hasWorkspaceFileDropData(dataTransfer) {
|
|
|
19493
19783
|
WORKSPACE_FILE_DROP_MIME_TYPE
|
|
19494
19784
|
);
|
|
19495
19785
|
}
|
|
19496
|
-
function readWorkspaceFileDropEntries(dataTransfer
|
|
19786
|
+
function readWorkspaceFileDropEntries(dataTransfer) {
|
|
19497
19787
|
if (!hasWorkspaceFileDropData(dataTransfer)) {
|
|
19498
19788
|
return [];
|
|
19499
19789
|
}
|
|
@@ -19518,16 +19808,7 @@ function readWorkspaceFileDropEntries(dataTransfer, options = {}) {
|
|
|
19518
19808
|
})
|
|
19519
19809
|
);
|
|
19520
19810
|
}
|
|
19521
|
-
|
|
19522
|
-
return [];
|
|
19523
|
-
}
|
|
19524
|
-
return normalizeWorkspaceFileDropEntries(
|
|
19525
|
-
parsed.paths.filter((value) => typeof value === "string").map((path) => ({
|
|
19526
|
-
path,
|
|
19527
|
-
name: basenameWorkspacePath(path),
|
|
19528
|
-
kind: "unknown"
|
|
19529
|
-
}))
|
|
19530
|
-
);
|
|
19811
|
+
return [];
|
|
19531
19812
|
} catch {
|
|
19532
19813
|
return [];
|
|
19533
19814
|
}
|
|
@@ -20065,7 +20346,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
20065
20346
|
scrollEditorSelectionIntoView(currentEditor);
|
|
20066
20347
|
});
|
|
20067
20348
|
};
|
|
20068
|
-
const extensions =
|
|
20349
|
+
const extensions = useMemo6(
|
|
20069
20350
|
() => [
|
|
20070
20351
|
...createAgentRichTextInputExtensions(
|
|
20071
20352
|
{
|
|
@@ -20323,9 +20604,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
20323
20604
|
if (!hasWorkspaceFileDropData(dataTransfer)) {
|
|
20324
20605
|
return false;
|
|
20325
20606
|
}
|
|
20326
|
-
const entries = readWorkspaceFileDropEntries(dataTransfer
|
|
20327
|
-
includeLegacyPaths: false
|
|
20328
|
-
});
|
|
20607
|
+
const entries = readWorkspaceFileDropEntries(dataTransfer);
|
|
20329
20608
|
if (entries.length === 0) {
|
|
20330
20609
|
return false;
|
|
20331
20610
|
}
|
|
@@ -20379,9 +20658,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
20379
20658
|
if (!currentEditor || currentEditor.isDestroyed) {
|
|
20380
20659
|
return true;
|
|
20381
20660
|
}
|
|
20382
|
-
const entries = readWorkspaceFileDropEntries(dataTransfer
|
|
20383
|
-
includeLegacyPaths: false
|
|
20384
|
-
});
|
|
20661
|
+
const entries = readWorkspaceFileDropEntries(dataTransfer);
|
|
20385
20662
|
if (entries.length === 0) {
|
|
20386
20663
|
return true;
|
|
20387
20664
|
}
|
|
@@ -20462,10 +20739,10 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
20462
20739
|
}
|
|
20463
20740
|
onSubmitRef.current();
|
|
20464
20741
|
};
|
|
20465
|
-
|
|
20742
|
+
useEffect11(() => {
|
|
20466
20743
|
editorRef.current = editor;
|
|
20467
20744
|
}, [editor]);
|
|
20468
|
-
|
|
20745
|
+
useEffect11(
|
|
20469
20746
|
() => () => {
|
|
20470
20747
|
if (scrollFrameRef.current !== null && typeof window.cancelAnimationFrame === "function") {
|
|
20471
20748
|
window.cancelAnimationFrame(scrollFrameRef.current);
|
|
@@ -20473,7 +20750,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
20473
20750
|
},
|
|
20474
20751
|
[]
|
|
20475
20752
|
);
|
|
20476
|
-
|
|
20753
|
+
useEffect11(() => {
|
|
20477
20754
|
if (!contextMenu) {
|
|
20478
20755
|
return;
|
|
20479
20756
|
}
|
|
@@ -20579,7 +20856,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
20579
20856
|
}),
|
|
20580
20857
|
[]
|
|
20581
20858
|
);
|
|
20582
|
-
|
|
20859
|
+
useEffect11(() => {
|
|
20583
20860
|
if (!editor) {
|
|
20584
20861
|
return;
|
|
20585
20862
|
}
|
|
@@ -20590,7 +20867,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
20590
20867
|
editor.state.tr.setMeta("agentRichTextPlaceholder", placeholder)
|
|
20591
20868
|
);
|
|
20592
20869
|
}, [disabled, editor, placeholder]);
|
|
20593
|
-
|
|
20870
|
+
useEffect11(() => {
|
|
20594
20871
|
if (!editor || editor.isDestroyed) {
|
|
20595
20872
|
return;
|
|
20596
20873
|
}
|
|
@@ -20832,7 +21109,7 @@ function AgentSlashStatusPanel({
|
|
|
20832
21109
|
}
|
|
20833
21110
|
|
|
20834
21111
|
// agent-gui/agentGuiNode/AgentReviewPickerPanel.tsx
|
|
20835
|
-
import { useCallback as useCallback7, useEffect as
|
|
21112
|
+
import { useCallback as useCallback7, useEffect as useEffect12, useMemo as useMemo7, useRef as useRef9, useState as useState11 } from "react";
|
|
20836
21113
|
import { menuItemClassName } from "@tutti-os/ui-system";
|
|
20837
21114
|
|
|
20838
21115
|
// agent-gui/agentGuiNode/AgentReviewBranchController.ts
|
|
@@ -20961,7 +21238,7 @@ function AgentReviewPickerPanel({
|
|
|
20961
21238
|
currentBranch: null,
|
|
20962
21239
|
error: null
|
|
20963
21240
|
});
|
|
20964
|
-
|
|
21241
|
+
useEffect12(() => {
|
|
20965
21242
|
const controller = new AgentReviewBranchController();
|
|
20966
21243
|
reviewBranchControllerRef.current = controller;
|
|
20967
21244
|
const unsubscribe = controller.subscribe(setBranchState);
|
|
@@ -20971,7 +21248,7 @@ function AgentReviewPickerPanel({
|
|
|
20971
21248
|
reviewBranchControllerRef.current = null;
|
|
20972
21249
|
};
|
|
20973
21250
|
}, []);
|
|
20974
|
-
|
|
21251
|
+
useEffect12(() => {
|
|
20975
21252
|
const controller = reviewBranchControllerRef.current;
|
|
20976
21253
|
if (!controller) {
|
|
20977
21254
|
return;
|
|
@@ -20981,7 +21258,7 @@ function AgentReviewPickerPanel({
|
|
|
20981
21258
|
controller.ensureLoaded();
|
|
20982
21259
|
}
|
|
20983
21260
|
}, [onRequestGitBranches, stage]);
|
|
20984
|
-
|
|
21261
|
+
useEffect12(() => {
|
|
20985
21262
|
searchInputRef.current?.focus();
|
|
20986
21263
|
}, [stage]);
|
|
20987
21264
|
const submit = useCallback7(
|
|
@@ -21002,7 +21279,7 @@ function AgentReviewPickerPanel({
|
|
|
21002
21279
|
}, []);
|
|
21003
21280
|
const trimmedQuery = query.trim();
|
|
21004
21281
|
const normalizedQuery = trimmedQuery.toLowerCase();
|
|
21005
|
-
const entries =
|
|
21282
|
+
const entries = useMemo7(() => {
|
|
21006
21283
|
if (stage === "root") {
|
|
21007
21284
|
const options = [
|
|
21008
21285
|
{
|
|
@@ -21071,7 +21348,7 @@ function AgentReviewPickerPanel({
|
|
|
21071
21348
|
goToStage
|
|
21072
21349
|
]);
|
|
21073
21350
|
const safeHighlightedIndex = entries.length === 0 ? -1 : Math.min(highlightedIndex, entries.length - 1);
|
|
21074
|
-
|
|
21351
|
+
useEffect12(() => {
|
|
21075
21352
|
highlightedOptionRef.current?.scrollIntoView({ block: "nearest" });
|
|
21076
21353
|
}, [safeHighlightedIndex]);
|
|
21077
21354
|
const searchPlaceholder = stage === "base" ? labels.branchPlaceholder : stage === "commit" ? labels.commitPlaceholder : stage === "custom" ? labels.customPlaceholder : labels.searchPlaceholder;
|
|
@@ -21194,9 +21471,9 @@ function AgentReviewPickerPanel({
|
|
|
21194
21471
|
import {
|
|
21195
21472
|
forwardRef as forwardRef4,
|
|
21196
21473
|
useCallback as useCallback8,
|
|
21197
|
-
useEffect as
|
|
21474
|
+
useEffect as useEffect13,
|
|
21198
21475
|
useLayoutEffect as useLayoutEffect2,
|
|
21199
|
-
useMemo as
|
|
21476
|
+
useMemo as useMemo8,
|
|
21200
21477
|
useRef as useRef10,
|
|
21201
21478
|
useState as useState12
|
|
21202
21479
|
} from "react";
|
|
@@ -21362,7 +21639,7 @@ var ComposerFloatingMenuSurface = forwardRef4(function ComposerFloatingMenuSurfa
|
|
|
21362
21639
|
},
|
|
21363
21640
|
[forwardedRef, surfaceRef]
|
|
21364
21641
|
);
|
|
21365
|
-
|
|
21642
|
+
useEffect13(() => {
|
|
21366
21643
|
if (!open || !onDismiss) {
|
|
21367
21644
|
return;
|
|
21368
21645
|
}
|
|
@@ -21405,7 +21682,7 @@ var ComposerFloatingMenuSurface = forwardRef4(function ComposerFloatingMenuSurfa
|
|
|
21405
21682
|
window.removeEventListener("blur", onDismiss);
|
|
21406
21683
|
};
|
|
21407
21684
|
}, [anchorRef, dismissBoundaryRef, onDismiss, open]);
|
|
21408
|
-
const style =
|
|
21685
|
+
const style = useMemo8(() => {
|
|
21409
21686
|
const baseStyle = {
|
|
21410
21687
|
position: "fixed",
|
|
21411
21688
|
left: `${frame?.left ?? 0}px`,
|
|
@@ -21593,7 +21870,7 @@ function AgentUsageChip({
|
|
|
21593
21870
|
closeUsagePopover
|
|
21594
21871
|
]
|
|
21595
21872
|
);
|
|
21596
|
-
|
|
21873
|
+
useEffect14(
|
|
21597
21874
|
() => () => {
|
|
21598
21875
|
clearUsagePopoverHoverTimer();
|
|
21599
21876
|
clearUsagePopoverCloseTimer();
|
|
@@ -21826,7 +22103,7 @@ function AgentComposerHandoffIcon({
|
|
|
21826
22103
|
}) {
|
|
21827
22104
|
const [isLottieReady, setIsLottieReady] = useState13(false);
|
|
21828
22105
|
const shouldLoadAnimation = !disabled && isPlaying;
|
|
21829
|
-
|
|
22106
|
+
useEffect14(() => {
|
|
21830
22107
|
if (!shouldLoadAnimation) {
|
|
21831
22108
|
return;
|
|
21832
22109
|
}
|
|
@@ -21920,6 +22197,8 @@ function AgentComposer({
|
|
|
21920
22197
|
previewMode = false,
|
|
21921
22198
|
workspaceReferencePickerOpen = false,
|
|
21922
22199
|
promptImagesSupported = true,
|
|
22200
|
+
canGoalControl = true,
|
|
22201
|
+
canUploadAttachment = true,
|
|
21923
22202
|
composerFocusRequestSequence = null,
|
|
21924
22203
|
layoutMode = "dock",
|
|
21925
22204
|
providerSelectLabel = "",
|
|
@@ -21950,7 +22229,7 @@ function AgentComposer({
|
|
|
21950
22229
|
}) {
|
|
21951
22230
|
"use memo";
|
|
21952
22231
|
const draftPrompt = draftContent.prompt;
|
|
21953
|
-
const goalDraftObjective = goalDraftObjectiveFromPrompt(draftPrompt);
|
|
22232
|
+
const goalDraftObjective = canGoalControl ? goalDraftObjectiveFromPrompt(draftPrompt) : null;
|
|
21954
22233
|
const isGoalModeActive = goalDraftObjective !== null;
|
|
21955
22234
|
const draftImages = draftContent.images;
|
|
21956
22235
|
const draftFiles = draftContent.files ?? [];
|
|
@@ -21959,7 +22238,7 @@ function AgentComposer({
|
|
|
21959
22238
|
const agentHostApi = useOptionalAgentHostApi();
|
|
21960
22239
|
const getReferenceForFile = agentHostApi?.workspace.getReferenceForFile;
|
|
21961
22240
|
const promptFileUploadSupported = Boolean(
|
|
21962
|
-
agentActivityRuntime?.uploadPromptContent && (agentActivityRuntime.promptContentUploadSupport?.file ?? true)
|
|
22241
|
+
canUploadAttachment && agentActivityRuntime?.uploadPromptContent && (agentActivityRuntime.promptContentUploadSupport?.file ?? true)
|
|
21963
22242
|
);
|
|
21964
22243
|
const promptFilesSupported = Boolean(
|
|
21965
22244
|
resolveDroppedFileReferences && promptFileUploadSupported
|
|
@@ -22026,19 +22305,21 @@ function AgentComposer({
|
|
|
22026
22305
|
const promptBeforeSelection = editorHandleRef.current?.getPromptTextBeforeSelection() ?? "";
|
|
22027
22306
|
const skillQueryDraft = promptBeforeSelection || paletteDraftPrompt;
|
|
22028
22307
|
const skillQueryMatch = getAgentComposerTriggerQueryMatch(skillQueryDraft);
|
|
22029
|
-
const resolvedSlashCommands =
|
|
22308
|
+
const resolvedSlashCommands = useMemo9(
|
|
22030
22309
|
() => resolveSlashCommandsForProvider({
|
|
22031
22310
|
provider,
|
|
22032
22311
|
commands: availableCommands,
|
|
22033
22312
|
hasCompactableContext,
|
|
22034
22313
|
compactSupported,
|
|
22035
22314
|
planSupported: composerSettings.supportsPlanMode,
|
|
22315
|
+
goalSupported: canGoalControl,
|
|
22036
22316
|
browserSupported: Boolean(composerSettings.supportsBrowser),
|
|
22037
22317
|
computerSupported: Boolean(composerSettings.supportsComputerUse)
|
|
22038
22318
|
}),
|
|
22039
22319
|
[
|
|
22040
22320
|
availableCommands,
|
|
22041
22321
|
compactSupported,
|
|
22322
|
+
canGoalControl,
|
|
22042
22323
|
composerSettings.supportsPlanMode,
|
|
22043
22324
|
composerSettings.supportsBrowser,
|
|
22044
22325
|
composerSettings.supportsComputerUse,
|
|
@@ -22046,11 +22327,11 @@ function AgentComposer({
|
|
|
22046
22327
|
provider
|
|
22047
22328
|
]
|
|
22048
22329
|
);
|
|
22049
|
-
const filteredCommands =
|
|
22330
|
+
const filteredCommands = useMemo9(
|
|
22050
22331
|
() => slashQuery === null ? [] : filterSlashCommands(resolvedSlashCommands, slashQuery),
|
|
22051
22332
|
[resolvedSlashCommands, slashQuery]
|
|
22052
22333
|
);
|
|
22053
|
-
const filteredSkills =
|
|
22334
|
+
const filteredSkills = useMemo9(
|
|
22054
22335
|
() => skillQueryMatch === null ? [] : filterProviderSkillsForTrigger({
|
|
22055
22336
|
skills: availableSkills,
|
|
22056
22337
|
query: skillQueryMatch.query,
|
|
@@ -22058,7 +22339,7 @@ function AgentComposer({
|
|
|
22058
22339
|
}),
|
|
22059
22340
|
[availableSkills, skillQueryMatch]
|
|
22060
22341
|
);
|
|
22061
|
-
const availableCapabilities =
|
|
22342
|
+
const availableCapabilities = useMemo9(() => {
|
|
22062
22343
|
const entries = [];
|
|
22063
22344
|
if (composerSettings.supportsBrowser) {
|
|
22064
22345
|
entries.push({
|
|
@@ -22083,7 +22364,7 @@ function AgentComposer({
|
|
|
22083
22364
|
labels.browserUseCapabilityLabel,
|
|
22084
22365
|
labels.computerUseCapabilityLabel
|
|
22085
22366
|
]);
|
|
22086
|
-
const slashPaletteEntries =
|
|
22367
|
+
const slashPaletteEntries = useMemo9(() => {
|
|
22087
22368
|
const commandEntries = filteredCommands.flatMap((command) => {
|
|
22088
22369
|
if (isSlashCommandCapability(command)) {
|
|
22089
22370
|
const browserConnectionMode = capabilityMenuState?.browserUse?.connectionMode ?? null;
|
|
@@ -22180,10 +22461,10 @@ function AgentComposer({
|
|
|
22180
22461
|
slashPaletteEntries.length
|
|
22181
22462
|
);
|
|
22182
22463
|
const [mentionPaletteFrame, setMentionPaletteFrame] = useState13(null);
|
|
22183
|
-
|
|
22464
|
+
useEffect14(() => {
|
|
22184
22465
|
setHighlightedIndex(0);
|
|
22185
22466
|
}, [skillQueryMatch?.prefix, skillQueryMatch?.query, slashQuery]);
|
|
22186
|
-
|
|
22467
|
+
useEffect14(() => {
|
|
22187
22468
|
const preferredKey = shouldResetMentionHighlightToFilter && mentionSearchState.mode === "browse" ? `category:${mentionSearchState.filter}` : null;
|
|
22188
22469
|
if (shouldResetMentionHighlightToFilter) {
|
|
22189
22470
|
const nextKey = repairMentionPaletteHighlight({
|
|
@@ -22215,7 +22496,7 @@ function AgentComposer({
|
|
|
22215
22496
|
mentionSearchState,
|
|
22216
22497
|
shouldResetMentionHighlightToFilter
|
|
22217
22498
|
]);
|
|
22218
|
-
|
|
22499
|
+
useEffect14(() => {
|
|
22219
22500
|
const controller = new AgentMentionSearchController({
|
|
22220
22501
|
contextMentionProviders
|
|
22221
22502
|
});
|
|
@@ -22227,7 +22508,7 @@ function AgentComposer({
|
|
|
22227
22508
|
mentionControllerRef.current = null;
|
|
22228
22509
|
};
|
|
22229
22510
|
}, [contextMentionProviders]);
|
|
22230
|
-
|
|
22511
|
+
useEffect14(() => {
|
|
22231
22512
|
const isExternalDraftReplacement = draftPromptRef.current !== draftPrompt;
|
|
22232
22513
|
draftPromptRef.current = draftPrompt;
|
|
22233
22514
|
setPaletteDraftPrompt(goalDraftObjective ?? draftPrompt);
|
|
@@ -22239,16 +22520,16 @@ function AgentComposer({
|
|
|
22239
22520
|
});
|
|
22240
22521
|
}
|
|
22241
22522
|
}, [draftPrompt, goalDraftObjective]);
|
|
22242
|
-
|
|
22523
|
+
useEffect14(() => {
|
|
22243
22524
|
draftImagesRef.current = draftImages;
|
|
22244
22525
|
}, [draftImages]);
|
|
22245
|
-
|
|
22526
|
+
useEffect14(() => {
|
|
22246
22527
|
draftFilesRef.current = draftFiles;
|
|
22247
22528
|
}, [draftFiles]);
|
|
22248
|
-
|
|
22529
|
+
useEffect14(() => {
|
|
22249
22530
|
draftLargeTextsRef.current = draftLargeTexts;
|
|
22250
22531
|
}, [draftLargeTexts]);
|
|
22251
|
-
|
|
22532
|
+
useEffect14(() => {
|
|
22252
22533
|
if (previousSlashStatusAgentSessionIdRef.current === slashStatusAgentSessionId) {
|
|
22253
22534
|
return;
|
|
22254
22535
|
}
|
|
@@ -22288,7 +22569,7 @@ function AgentComposer({
|
|
|
22288
22569
|
},
|
|
22289
22570
|
[clearSlashCommandDraft, onSubmit]
|
|
22290
22571
|
);
|
|
22291
|
-
const reviewBranchLoader =
|
|
22572
|
+
const reviewBranchLoader = useMemo9(() => {
|
|
22292
22573
|
if (!onRequestGitBranches) {
|
|
22293
22574
|
return null;
|
|
22294
22575
|
}
|
|
@@ -22480,7 +22761,7 @@ function AgentComposer({
|
|
|
22480
22761
|
if (!agentComposerDraftHasContent(nextDraftContent)) {
|
|
22481
22762
|
return;
|
|
22482
22763
|
}
|
|
22483
|
-
if (currentDraftImages.length > 0 && !promptImagesSupported) {
|
|
22764
|
+
if (currentDraftImages.length > 0 && (!canUploadAttachment || !promptImagesSupported)) {
|
|
22484
22765
|
onPromptImagesUnsupported?.();
|
|
22485
22766
|
return;
|
|
22486
22767
|
}
|
|
@@ -22762,7 +23043,7 @@ function AgentComposer({
|
|
|
22762
23043
|
const handlePaletteKeyDown = useStableEventCallback(
|
|
22763
23044
|
(event) => handleFileMentionKeyDown(event) || handleSlashPaletteKeyDown(event) || handleSlashCommandMenuKeyDown(event) || handlePlanModeToggleKeyDown(event)
|
|
22764
23045
|
);
|
|
22765
|
-
|
|
23046
|
+
useEffect14(() => {
|
|
22766
23047
|
if (!showPalette || workspaceReferencePickerOpen) {
|
|
22767
23048
|
return;
|
|
22768
23049
|
}
|
|
@@ -22828,12 +23109,12 @@ function AgentComposer({
|
|
|
22828
23109
|
},
|
|
22829
23110
|
[onLinkAction, workspacePath]
|
|
22830
23111
|
);
|
|
22831
|
-
|
|
23112
|
+
useEffect14(() => {
|
|
22832
23113
|
if (!showFileMentionPalette && shouldCenterMentionHighlight) {
|
|
22833
23114
|
setShouldCenterMentionHighlight(false);
|
|
22834
23115
|
}
|
|
22835
23116
|
}, [shouldCenterMentionHighlight, showFileMentionPalette]);
|
|
22836
|
-
|
|
23117
|
+
useEffect14(() => {
|
|
22837
23118
|
if (!showFileMentionPalette) {
|
|
22838
23119
|
return;
|
|
22839
23120
|
}
|
|
@@ -22870,7 +23151,7 @@ function AgentComposer({
|
|
|
22870
23151
|
onDraftContentChange({ ...draftContent, prompt: nextGoalPrompt });
|
|
22871
23152
|
return;
|
|
22872
23153
|
}
|
|
22873
|
-
const nextGoalObjective = goalDraftObjectiveFromPrompt(nextDraft);
|
|
23154
|
+
const nextGoalObjective = canGoalControl ? goalDraftObjectiveFromPrompt(nextDraft) : null;
|
|
22874
23155
|
if (nextGoalObjective !== null) {
|
|
22875
23156
|
const nextGoalPrompt = buildGoalModePrompt(nextGoalObjective);
|
|
22876
23157
|
draftPromptRef.current = nextGoalPrompt;
|
|
@@ -22904,7 +23185,7 @@ function AgentComposer({
|
|
|
22904
23185
|
if (images.length === 0) {
|
|
22905
23186
|
return;
|
|
22906
23187
|
}
|
|
22907
|
-
if (!promptImagesSupported) {
|
|
23188
|
+
if (!canUploadAttachment || !promptImagesSupported) {
|
|
22908
23189
|
onPromptImagesUnsupported?.();
|
|
22909
23190
|
return;
|
|
22910
23191
|
}
|
|
@@ -22916,7 +23197,7 @@ function AgentComposer({
|
|
|
22916
23197
|
if (remainingSlots === 0) {
|
|
22917
23198
|
return;
|
|
22918
23199
|
}
|
|
22919
|
-
const uploadPromptContent = agentActivityRuntime?.uploadPromptContent && (agentActivityRuntime.promptContentUploadSupport?.image ?? true) ? agentActivityRuntime.uploadPromptContent : void 0;
|
|
23200
|
+
const uploadPromptContent = canUploadAttachment && agentActivityRuntime?.uploadPromptContent && (agentActivityRuntime.promptContentUploadSupport?.image ?? true) ? agentActivityRuntime.uploadPromptContent : void 0;
|
|
22920
23201
|
const nextImages = images.slice(0, remainingSlots).map((image) => ({
|
|
22921
23202
|
id: `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,
|
|
22922
23203
|
name: image.name,
|
|
@@ -22996,6 +23277,7 @@ function AgentComposer({
|
|
|
22996
23277
|
},
|
|
22997
23278
|
[
|
|
22998
23279
|
agentActivityRuntime,
|
|
23280
|
+
canUploadAttachment,
|
|
22999
23281
|
onDraftContentChange,
|
|
23000
23282
|
onPromptImagesUnsupported,
|
|
23001
23283
|
promptImagesSupported,
|
|
@@ -23080,7 +23362,7 @@ ${item.text}` : item.text;
|
|
|
23080
23362
|
if (!normalizedText.trim()) {
|
|
23081
23363
|
return;
|
|
23082
23364
|
}
|
|
23083
|
-
const uploadPromptContent = agentActivityRuntime?.uploadPromptContent && (agentActivityRuntime.promptContentUploadSupport?.file ?? true) ? agentActivityRuntime.uploadPromptContent : void 0;
|
|
23365
|
+
const uploadPromptContent = canUploadAttachment && agentActivityRuntime?.uploadPromptContent && (agentActivityRuntime.promptContentUploadSupport?.file ?? true) ? agentActivityRuntime.uploadPromptContent : void 0;
|
|
23084
23366
|
if (!uploadPromptContent) {
|
|
23085
23367
|
const currentPrompt = draftPromptRef.current;
|
|
23086
23368
|
const nextPrompt = currentPrompt.trim() ? `${currentPrompt}
|
|
@@ -23165,7 +23447,12 @@ ${normalizedText}` : normalizedText;
|
|
|
23165
23447
|
});
|
|
23166
23448
|
});
|
|
23167
23449
|
},
|
|
23168
|
-
[
|
|
23450
|
+
[
|
|
23451
|
+
agentActivityRuntime,
|
|
23452
|
+
canUploadAttachment,
|
|
23453
|
+
onDraftContentChange,
|
|
23454
|
+
workspaceId
|
|
23455
|
+
]
|
|
23169
23456
|
);
|
|
23170
23457
|
const applyReferencePickResult = useCallback9(
|
|
23171
23458
|
async (result) => {
|
|
@@ -23320,7 +23607,7 @@ ${normalizedText}` : normalizedText;
|
|
|
23320
23607
|
window.removeEventListener("scroll", syncMentionPaletteFrame, true);
|
|
23321
23608
|
};
|
|
23322
23609
|
}, [showFileMentionPalette, syncMentionPaletteFrame]);
|
|
23323
|
-
const mentionPaletteStyle =
|
|
23610
|
+
const mentionPaletteStyle = useMemo9(
|
|
23324
23611
|
() => ({
|
|
23325
23612
|
position: "fixed",
|
|
23326
23613
|
left: `${mentionPaletteFrame?.left ?? 0}px`,
|
|
@@ -23337,11 +23624,11 @@ ${normalizedText}` : normalizedText;
|
|
|
23337
23624
|
const mentionPaletteHeightPx = mentionPaletteFrame?.height ?? MENTION_PALETTE_MIN_HEIGHT_PX;
|
|
23338
23625
|
const isHeroLayout = layoutMode === "hero";
|
|
23339
23626
|
const composerClassName = isHeroLayout ? AgentGUINode_styles_default.composerHero : AgentGUINode_styles_default.composer;
|
|
23340
|
-
const providerSwitchTargets =
|
|
23627
|
+
const providerSwitchTargets = useMemo9(
|
|
23341
23628
|
() => providerTargets.filter(Boolean),
|
|
23342
23629
|
[providerTargets]
|
|
23343
23630
|
);
|
|
23344
|
-
const enabledProviderSwitchTargets =
|
|
23631
|
+
const enabledProviderSwitchTargets = useMemo9(
|
|
23345
23632
|
() => providerSwitchTargets.filter((target) => target.disabled !== true),
|
|
23346
23633
|
[providerSwitchTargets]
|
|
23347
23634
|
);
|
|
@@ -23352,7 +23639,7 @@ ${normalizedText}` : normalizedText;
|
|
|
23352
23639
|
const providerMenuTargets = selectedProviderSwitchTarget && !enabledProviderSwitchTargets.some(
|
|
23353
23640
|
(target) => target.targetId === selectedProviderSwitchTarget.targetId
|
|
23354
23641
|
) ? [selectedProviderSwitchTarget, ...enabledProviderSwitchTargets] : enabledProviderSwitchTargets;
|
|
23355
|
-
const enabledHandoffProviderTargets =
|
|
23642
|
+
const enabledHandoffProviderTargets = useMemo9(
|
|
23356
23643
|
() => (handoffProviderTargets ?? providerMenuTargets).filter(
|
|
23357
23644
|
(target) => target.disabled !== true
|
|
23358
23645
|
),
|
|
@@ -23403,7 +23690,7 @@ ${normalizedText}` : normalizedText;
|
|
|
23403
23690
|
);
|
|
23404
23691
|
const [fileDropOverlayHost, setFileDropOverlayHost] = useState13(null);
|
|
23405
23692
|
const [fileDropOverlayActive, setFileDropOverlayActive] = useState13(false);
|
|
23406
|
-
|
|
23693
|
+
useEffect14(() => {
|
|
23407
23694
|
const composer = composerRef.current;
|
|
23408
23695
|
const dropTarget = composer?.closest("#agent-gui-detail") ?? composer;
|
|
23409
23696
|
if (!dropTarget) {
|
|
@@ -23550,7 +23837,7 @@ ${normalizedText}` : normalizedText;
|
|
|
23550
23837
|
promptImagesSupported,
|
|
23551
23838
|
scheduleComposerFocus
|
|
23552
23839
|
]);
|
|
23553
|
-
|
|
23840
|
+
useEffect14(() => {
|
|
23554
23841
|
if (!isActive) {
|
|
23555
23842
|
wasActiveRef.current = false;
|
|
23556
23843
|
return;
|
|
@@ -23560,7 +23847,7 @@ ${normalizedText}` : normalizedText;
|
|
|
23560
23847
|
}
|
|
23561
23848
|
wasActiveRef.current = true;
|
|
23562
23849
|
}, [isActive, scheduleComposerFocus]);
|
|
23563
|
-
|
|
23850
|
+
useEffect14(() => {
|
|
23564
23851
|
if (composerFocusRequestSequence === null || composerFocusRequestSequence === lastComposerFocusRequestRef.current) {
|
|
23565
23852
|
return;
|
|
23566
23853
|
}
|
|
@@ -23742,11 +24029,11 @@ ${normalizedText}` : normalizedText;
|
|
|
23742
24029
|
isHeroLayout,
|
|
23743
24030
|
paletteDraftPrompt
|
|
23744
24031
|
]);
|
|
23745
|
-
const inputShellStyle =
|
|
24032
|
+
const inputShellStyle = useMemo9(
|
|
23746
24033
|
() => showFileMentionPalette || showFloatingCommandMenu ? { zIndex: composerPaletteZIndex } : void 0,
|
|
23747
24034
|
[showFileMentionPalette, showFloatingCommandMenu]
|
|
23748
24035
|
);
|
|
23749
|
-
const promptInputAreaStyle =
|
|
24036
|
+
const promptInputAreaStyle = useMemo9(
|
|
23750
24037
|
() => isHeroLayout ? void 0 : {
|
|
23751
24038
|
"--agent-gui-composer-attachment-height": `${dockComposerAttachmentHeight}px`,
|
|
23752
24039
|
"--agent-gui-composer-input-height": `${dockComposerInputHeight}px`,
|
|
@@ -23786,7 +24073,7 @@ ${normalizedText}` : normalizedText;
|
|
|
23786
24073
|
const effectivePlaceholder = disabledReasonText || placeholder;
|
|
23787
24074
|
const visibleDraftFiles = draftFiles;
|
|
23788
24075
|
const visibleDraftLargeTexts = draftLargeTexts;
|
|
23789
|
-
|
|
24076
|
+
useEffect14(() => {
|
|
23790
24077
|
if (previousSelectedProjectPathRef.current === selectedProjectPath) {
|
|
23791
24078
|
return;
|
|
23792
24079
|
}
|
|
@@ -23802,7 +24089,7 @@ ${normalizedText}` : normalizedText;
|
|
|
23802
24089
|
sessionCwd: selectedProjectPath || null
|
|
23803
24090
|
});
|
|
23804
24091
|
}, [currentUserId, fileMentionSuggestion, selectedProjectPath, workspaceId]);
|
|
23805
|
-
|
|
24092
|
+
useEffect14(() => {
|
|
23806
24093
|
setDismissedPromptRequestId(null);
|
|
23807
24094
|
}, [activePromptRequestId]);
|
|
23808
24095
|
const submitInteractivePromptAndDismiss = useCallback9(
|
|
@@ -23976,7 +24263,9 @@ ${normalizedText}` : normalizedText;
|
|
|
23976
24263
|
onSendQueuedPromptNext,
|
|
23977
24264
|
onRemoveQueuedPrompt,
|
|
23978
24265
|
onEditQueuedPrompt,
|
|
24266
|
+
agentSessionId: slashStatusAgentSessionId,
|
|
23979
24267
|
onLinkClick: handleLinkClick,
|
|
24268
|
+
workspaceId,
|
|
23980
24269
|
workspaceAppIcons
|
|
23981
24270
|
}
|
|
23982
24271
|
)
|
|
@@ -24212,7 +24501,7 @@ ${normalizedText}` : normalizedText;
|
|
|
24212
24501
|
onFileMentionSuggestionChange: handleFileMentionSuggestionChange,
|
|
24213
24502
|
onFileMentionSuggestionKeyDown: handleFileMentionKeyDown,
|
|
24214
24503
|
onLinkClick: handleLinkClick,
|
|
24215
|
-
promptImagesSupported,
|
|
24504
|
+
promptImagesSupported: canUploadAttachment && promptImagesSupported,
|
|
24216
24505
|
onPromptImagesUnsupported,
|
|
24217
24506
|
onPasteImages: handlePastedImages,
|
|
24218
24507
|
onPasteLargeText: handlePastedLargeText,
|
|
@@ -24666,7 +24955,7 @@ ${normalizedText}` : normalizedText;
|
|
|
24666
24955
|
] })
|
|
24667
24956
|
}
|
|
24668
24957
|
) : null,
|
|
24669
|
-
isGoalModeActive ? /* @__PURE__ */ jsx31(
|
|
24958
|
+
canGoalControl && isGoalModeActive ? /* @__PURE__ */ jsx31(
|
|
24670
24959
|
"button",
|
|
24671
24960
|
{
|
|
24672
24961
|
type: "button",
|
|
@@ -25161,7 +25450,7 @@ function groupConversations(conversations, labels, userProjects = [], options =
|
|
|
25161
25450
|
const normalizeProjectPath = (path) => normalizeConversationProjectPathCached(path, normalizedProjectPathByPath);
|
|
25162
25451
|
userProjects.forEach((project, projectOrder) => {
|
|
25163
25452
|
const normalizedPath = normalizeProjectPath(project.path);
|
|
25164
|
-
const sectionId =
|
|
25453
|
+
const sectionId = conversationProjectSectionId(project, normalizedPath);
|
|
25165
25454
|
if (projectGroups.has(sectionId)) {
|
|
25166
25455
|
return;
|
|
25167
25456
|
}
|
|
@@ -25211,7 +25500,10 @@ function groupConversations(conversations, labels, userProjects = [], options =
|
|
|
25211
25500
|
continue;
|
|
25212
25501
|
}
|
|
25213
25502
|
const normalizedPath = normalizeProjectPath(conversation.project.path);
|
|
25214
|
-
const sectionId =
|
|
25503
|
+
const sectionId = conversationProjectSectionId(
|
|
25504
|
+
conversation.project,
|
|
25505
|
+
normalizedPath
|
|
25506
|
+
);
|
|
25215
25507
|
const existing = projectGroups.get(sectionId);
|
|
25216
25508
|
if (existing) {
|
|
25217
25509
|
existing.items.push(conversation);
|
|
@@ -25244,6 +25536,17 @@ function groupConversations(conversations, labels, userProjects = [], options =
|
|
|
25244
25536
|
);
|
|
25245
25537
|
return groups;
|
|
25246
25538
|
}
|
|
25539
|
+
function filterConversationSectionsBySearchMatches(sections, matchingConversations) {
|
|
25540
|
+
const matchingConversationIds = new Set(
|
|
25541
|
+
matchingConversations.map((conversation) => conversation.id)
|
|
25542
|
+
);
|
|
25543
|
+
return sections.map((section) => ({
|
|
25544
|
+
...section,
|
|
25545
|
+
items: section.items.filter(
|
|
25546
|
+
(item) => matchingConversationIds.has(item.id)
|
|
25547
|
+
)
|
|
25548
|
+
})).filter((section) => section.items.length > 0);
|
|
25549
|
+
}
|
|
25247
25550
|
function resolveConversationProjectUpdatedAtUnixMs(project) {
|
|
25248
25551
|
if (!project) {
|
|
25249
25552
|
return 0;
|
|
@@ -25262,6 +25565,9 @@ function normalizeConversationProjectPathCached(path, normalizedPathByPath) {
|
|
|
25262
25565
|
normalizedPathByPath.set(path, normalized);
|
|
25263
25566
|
return normalized;
|
|
25264
25567
|
}
|
|
25568
|
+
function conversationProjectSectionId(project, normalizedPath) {
|
|
25569
|
+
return project.sectionKey?.trim() || `project:${normalizedPath}`;
|
|
25570
|
+
}
|
|
25265
25571
|
function conversationMetaKind(conversation) {
|
|
25266
25572
|
if (conversation.status === "working") {
|
|
25267
25573
|
return "loading";
|
|
@@ -25429,6 +25735,7 @@ var AGENT_GUI_TOP_HISTORY_PREFETCH_THRESHOLD_PX = 240;
|
|
|
25429
25735
|
var AGENT_GUI_TOP_MASK_SCROLL_EPSILON_PX = 1;
|
|
25430
25736
|
var AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE = 5;
|
|
25431
25737
|
var AGENT_GUI_CONVERSATION_RAIL_LOADING_SKELETON_DELAY_MS = 300;
|
|
25738
|
+
var AGENT_GUI_CONVERSATION_RAIL_VISIBILITY_EPSILON_PX = 1;
|
|
25432
25739
|
var AGENT_GUI_CONVERSATION_RAIL_PROJECTION_PROVIDER = "codex";
|
|
25433
25740
|
var AGENT_GUI_TIMELINE_SCROLL_AREA_CONTENT_STYLE = {
|
|
25434
25741
|
width: "100%",
|
|
@@ -25440,16 +25747,29 @@ var AGENT_GUI_TIMELINE_SCROLL_AREA_CONTENT_STYLE = {
|
|
|
25440
25747
|
var EMPTY_WORKSPACE_APP_ICONS3 = [];
|
|
25441
25748
|
var AGENT_GUI_CONFIRMATION_DIALOG_CLASS_NAME = "nodrag tsh-desktop-no-drag [-webkit-app-region:no-drag]";
|
|
25442
25749
|
var AGENT_GUI_CONFIRMATION_DIALOG_OVERLAY_CLASS_NAME = "nodrag tsh-desktop-no-drag [-webkit-app-region:no-drag]";
|
|
25750
|
+
function isElementFullyVisibleWithin(element, viewport) {
|
|
25751
|
+
const elementRect = element.getBoundingClientRect();
|
|
25752
|
+
const viewportRect = viewport.getBoundingClientRect();
|
|
25753
|
+
return elementRect.top >= viewportRect.top - AGENT_GUI_CONVERSATION_RAIL_VISIBILITY_EPSILON_PX && elementRect.bottom <= viewportRect.bottom + AGENT_GUI_CONVERSATION_RAIL_VISIBILITY_EPSILON_PX;
|
|
25754
|
+
}
|
|
25755
|
+
function setBooleanStateIfChanged(stateRef, setState, nextState) {
|
|
25756
|
+
if (stateRef.current === nextState) {
|
|
25757
|
+
return;
|
|
25758
|
+
}
|
|
25759
|
+
stateRef.current = nextState;
|
|
25760
|
+
setState(nextState);
|
|
25761
|
+
}
|
|
25443
25762
|
function resolveAgentGUIHeroIconUrl(provider) {
|
|
25444
25763
|
const normalizedProvider = normalizeManagedAgentProvider(provider);
|
|
25445
25764
|
return MANAGED_AGENT_ICON_URLS[normalizedProvider] ?? MANAGED_AGENT_ICON_FALLBACK_URL;
|
|
25446
25765
|
}
|
|
25766
|
+
var HERO_USES_PROVIDER_RAIL_ICON = /* @__PURE__ */ new Set(["cursor", "opencode"]);
|
|
25447
25767
|
function agentGUIProviderIconPresentation(provider, iconUrl) {
|
|
25448
25768
|
const normalizedProvider = normalizeManagedAgentProvider(provider);
|
|
25449
25769
|
const providerRailIconUrl = MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS[normalizedProvider] ?? null;
|
|
25450
25770
|
return {
|
|
25451
25771
|
provider: normalizedProvider,
|
|
25452
|
-
iconUrl: (normalizedProvider
|
|
25772
|
+
iconUrl: (HERO_USES_PROVIDER_RAIL_ICON.has(normalizedProvider) ? providerRailIconUrl : null) || iconUrl?.trim() || resolveAgentGUIHeroIconUrl(normalizedProvider)
|
|
25453
25773
|
};
|
|
25454
25774
|
}
|
|
25455
25775
|
function agentGUIProviderRailIconPresentation(provider, iconUrl) {
|
|
@@ -25457,7 +25777,7 @@ function agentGUIProviderRailIconPresentation(provider, iconUrl) {
|
|
|
25457
25777
|
const providerRailIconUrl = MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS[normalizedProvider] ?? null;
|
|
25458
25778
|
return {
|
|
25459
25779
|
provider: normalizedProvider,
|
|
25460
|
-
iconUrl: (normalizedProvider
|
|
25780
|
+
iconUrl: (HERO_USES_PROVIDER_RAIL_ICON.has(normalizedProvider) ? providerRailIconUrl : null) || iconUrl?.trim() || providerRailIconUrl || resolveAgentGUIHeroIconUrl(normalizedProvider)
|
|
25461
25781
|
};
|
|
25462
25782
|
}
|
|
25463
25783
|
function shouldEmphasizeEmptyHeroProvider(label) {
|
|
@@ -25473,7 +25793,7 @@ function agentGuiPerfNowMs() {
|
|
|
25473
25793
|
}
|
|
25474
25794
|
function useDelayedBoolean(value, delayMs) {
|
|
25475
25795
|
const [delayedValue, setDelayedValue] = useState14(false);
|
|
25476
|
-
|
|
25796
|
+
useEffect15(() => {
|
|
25477
25797
|
if (!value) {
|
|
25478
25798
|
setDelayedValue(false);
|
|
25479
25799
|
return void 0;
|
|
@@ -25764,7 +26084,7 @@ function AgentGUINodeView({
|
|
|
25764
26084
|
newConversationRequestSequence
|
|
25765
26085
|
);
|
|
25766
26086
|
const workspaceReferencePickerResolverRef = useRef12(null);
|
|
25767
|
-
const emptyReferencePickResult =
|
|
26087
|
+
const emptyReferencePickResult = useMemo10(
|
|
25768
26088
|
() => ({ files: [], mentionItems: [] }),
|
|
25769
26089
|
[]
|
|
25770
26090
|
);
|
|
@@ -25866,7 +26186,7 @@ function AgentGUINodeView({
|
|
|
25866
26186
|
},
|
|
25867
26187
|
[hostLocalFileSourceId, settleReferencePicker]
|
|
25868
26188
|
);
|
|
25869
|
-
const openclawGateway =
|
|
26189
|
+
const openclawGateway = useMemo10(
|
|
25870
26190
|
() => viewModel.openclawGateway ?? (viewModel.data.provider === "openclaw" ? { status: "starting", error: null } : null),
|
|
25871
26191
|
[viewModel.data.provider, viewModel.openclawGateway]
|
|
25872
26192
|
);
|
|
@@ -25883,9 +26203,21 @@ function AgentGUINodeView({
|
|
|
25883
26203
|
actions.toggleConversationPinned
|
|
25884
26204
|
);
|
|
25885
26205
|
const removeProject = useStableEventCallback2(actions.removeProject);
|
|
26206
|
+
const requestDeleteProjectConversations = useStableEventCallback2(
|
|
26207
|
+
actions.requestDeleteProjectConversations
|
|
26208
|
+
);
|
|
26209
|
+
const cancelDeleteProjectConversations = useStableEventCallback2(
|
|
26210
|
+
actions.cancelDeleteProjectConversations
|
|
26211
|
+
);
|
|
25886
26212
|
const confirmDeleteProjectConversations = useStableEventCallback2(
|
|
25887
26213
|
actions.confirmDeleteProjectConversations
|
|
25888
26214
|
);
|
|
26215
|
+
const requestDeleteConversations = useStableEventCallback2(
|
|
26216
|
+
actions.requestDeleteConversations
|
|
26217
|
+
);
|
|
26218
|
+
const cancelDeleteConversations = useStableEventCallback2(
|
|
26219
|
+
actions.cancelDeleteConversations
|
|
26220
|
+
);
|
|
25889
26221
|
const confirmDeleteConversations = useStableEventCallback2(
|
|
25890
26222
|
actions.confirmDeleteConversations
|
|
25891
26223
|
);
|
|
@@ -25931,7 +26263,7 @@ function AgentGUINodeView({
|
|
|
25931
26263
|
viewModel.composerSettings.selectedProjectPath
|
|
25932
26264
|
]
|
|
25933
26265
|
);
|
|
25934
|
-
|
|
26266
|
+
useEffect15(() => {
|
|
25935
26267
|
if (newConversationRequestSequence === null || handledNewConversationRequestSequenceRef.current === newConversationRequestSequence) {
|
|
25936
26268
|
return;
|
|
25937
26269
|
}
|
|
@@ -25944,7 +26276,7 @@ function AgentGUINodeView({
|
|
|
25944
26276
|
newConversationRequestSequence,
|
|
25945
26277
|
requestCreateConversation
|
|
25946
26278
|
]);
|
|
25947
|
-
const effectiveWorkspaceAppIcons =
|
|
26279
|
+
const effectiveWorkspaceAppIcons = useMemo10(
|
|
25948
26280
|
() => mergeWorkspaceAppIconsFromCommands({
|
|
25949
26281
|
commands: viewModel.availableCommands,
|
|
25950
26282
|
workspaceAppIcons,
|
|
@@ -26021,7 +26353,7 @@ function AgentGUINodeView({
|
|
|
26021
26353
|
},
|
|
26022
26354
|
[onConversationRailWidthChanged]
|
|
26023
26355
|
);
|
|
26024
|
-
|
|
26356
|
+
useEffect15(() => {
|
|
26025
26357
|
if (isRailResizing || railResizeWidthPx === null) {
|
|
26026
26358
|
return;
|
|
26027
26359
|
}
|
|
@@ -26075,7 +26407,7 @@ function AgentGUINodeView({
|
|
|
26075
26407
|
const effectiveRailSlashStatusLimits = railSlashStatusLimits ?? slashStatusLimits;
|
|
26076
26408
|
const shouldShowProviderRailConfigButton = viewModel.conversationFilter.kind === "all" || viewModel.selectedProviderTarget?.disabled !== true;
|
|
26077
26409
|
const shouldShowProviderRailConfigMenu = shouldShowProviderRailConfigButton && viewModel.conversationFilter.kind !== "all";
|
|
26078
|
-
const effectiveProviderAuthAccountLabel =
|
|
26410
|
+
const effectiveProviderAuthAccountLabel = useMemo10(() => {
|
|
26079
26411
|
const provider = (effectiveRailConfigProvider ?? viewModel.data.provider)?.trim() ?? "";
|
|
26080
26412
|
if (!provider) {
|
|
26081
26413
|
return null;
|
|
@@ -26099,19 +26431,13 @@ function AgentGUINodeView({
|
|
|
26099
26431
|
}, []);
|
|
26100
26432
|
const [renameConversationTarget, setRenameConversationTarget] = useState14(null);
|
|
26101
26433
|
const [renameConversationDialogOpen, setRenameConversationDialogOpen] = useState14(false);
|
|
26102
|
-
const requestRenameConversation =
|
|
26103
|
-
(
|
|
26104
|
-
|
|
26105
|
-
|
|
26106
|
-
|
|
26107
|
-
if (target) {
|
|
26108
|
-
setRenameConversationTarget(target);
|
|
26109
|
-
setRenameConversationDialogOpen(true);
|
|
26110
|
-
}
|
|
26111
|
-
},
|
|
26112
|
-
[viewModel.activeConversation, viewModel.conversations]
|
|
26434
|
+
const requestRenameConversation = useStableEventCallback2(
|
|
26435
|
+
(conversation) => {
|
|
26436
|
+
setRenameConversationTarget(conversation);
|
|
26437
|
+
setRenameConversationDialogOpen(true);
|
|
26438
|
+
}
|
|
26113
26439
|
);
|
|
26114
|
-
const conversationRailStoreState =
|
|
26440
|
+
const conversationRailStoreState = useMemo10(
|
|
26115
26441
|
() => ({
|
|
26116
26442
|
activeConversationId: viewModel.activeConversationId,
|
|
26117
26443
|
pendingDeleteConversationId: viewModel.pendingDeleteConversation?.id ?? null,
|
|
@@ -26136,8 +26462,14 @@ function AgentGUINodeView({
|
|
|
26136
26462
|
onSelectConversation: selectConversation,
|
|
26137
26463
|
onToggleConversationPinned: toggleConversationPinned,
|
|
26138
26464
|
onMarkConversationUnread: actions.markConversationUnread,
|
|
26465
|
+
pendingDeleteProjectConversations: viewModel.pendingDeleteProjectConversations,
|
|
26466
|
+
pendingDeleteConversations: viewModel.pendingDeleteConversations,
|
|
26139
26467
|
onRemoveProject: removeProject,
|
|
26468
|
+
onRequestDeleteProjectConversations: requestDeleteProjectConversations,
|
|
26469
|
+
onCancelDeleteProjectConversations: cancelDeleteProjectConversations,
|
|
26140
26470
|
onConfirmDeleteProjectConversations: confirmDeleteProjectConversations,
|
|
26471
|
+
onRequestDeleteConversations: requestDeleteConversations,
|
|
26472
|
+
onCancelDeleteConversations: cancelDeleteConversations,
|
|
26141
26473
|
onConfirmDeleteConversations: confirmDeleteConversations,
|
|
26142
26474
|
onRequestDeleteConversation: requestDeleteConversation,
|
|
26143
26475
|
onRequestRenameConversation: requestRenameConversation,
|
|
@@ -26148,6 +26480,8 @@ function AgentGUINodeView({
|
|
|
26148
26480
|
selectProjectDirectory
|
|
26149
26481
|
}),
|
|
26150
26482
|
[
|
|
26483
|
+
cancelDeleteProjectConversations,
|
|
26484
|
+
cancelDeleteConversations,
|
|
26151
26485
|
cancelDeleteConversation,
|
|
26152
26486
|
confirmDeleteConversation,
|
|
26153
26487
|
confirmDeleteConversations,
|
|
@@ -26162,6 +26496,8 @@ function AgentGUINodeView({
|
|
|
26162
26496
|
actions.updateConversationFilter,
|
|
26163
26497
|
previewMode,
|
|
26164
26498
|
removeProject,
|
|
26499
|
+
requestDeleteProjectConversations,
|
|
26500
|
+
requestDeleteConversations,
|
|
26165
26501
|
requestCreateConversation,
|
|
26166
26502
|
requestDeleteConversation,
|
|
26167
26503
|
requestRenameConversation,
|
|
@@ -26179,6 +26515,8 @@ function AgentGUINodeView({
|
|
|
26179
26515
|
viewModel.isDeletingProjectConversations,
|
|
26180
26516
|
viewModel.isLoadingConversations,
|
|
26181
26517
|
viewModel.pendingDeleteConversation?.id,
|
|
26518
|
+
viewModel.pendingDeleteProjectConversations,
|
|
26519
|
+
viewModel.pendingDeleteConversations,
|
|
26182
26520
|
workspaceUserProjectI18n
|
|
26183
26521
|
]
|
|
26184
26522
|
);
|
|
@@ -26195,7 +26533,7 @@ function AgentGUINodeView({
|
|
|
26195
26533
|
conversationRailStore,
|
|
26196
26534
|
conversationRailStoreState
|
|
26197
26535
|
);
|
|
26198
|
-
const agentTargetPresentations =
|
|
26536
|
+
const agentTargetPresentations = useMemo10(
|
|
26199
26537
|
() => viewModel.providerTargets.flatMap(
|
|
26200
26538
|
(target) => target.agentTargetId ? [
|
|
26201
26539
|
{
|
|
@@ -26434,7 +26772,7 @@ function AgentGUINodeView({
|
|
|
26434
26772
|
}
|
|
26435
26773
|
)
|
|
26436
26774
|
] });
|
|
26437
|
-
return
|
|
26775
|
+
return /* @__PURE__ */ jsx34(TooltipProvider3, { children: /* @__PURE__ */ jsx34(AgentMentionTooltipProviderScope, { withTooltipProvider: false, children: content }) });
|
|
26438
26776
|
}
|
|
26439
26777
|
var AgentGUIRenameConversationDialog = memo2(
|
|
26440
26778
|
function AgentGUIRenameConversationDialog2({
|
|
@@ -26450,7 +26788,7 @@ var AgentGUIRenameConversationDialog = memo2(
|
|
|
26450
26788
|
const [isSaving, setIsSaving] = useState14(false);
|
|
26451
26789
|
const inputRef = useRef12(null);
|
|
26452
26790
|
const trimmedTitle = title.trim();
|
|
26453
|
-
|
|
26791
|
+
useEffect15(() => {
|
|
26454
26792
|
if (!open || !conversation) {
|
|
26455
26793
|
setTitle("");
|
|
26456
26794
|
setIsSaving(false);
|
|
@@ -26458,7 +26796,7 @@ var AgentGUIRenameConversationDialog = memo2(
|
|
|
26458
26796
|
}
|
|
26459
26797
|
setTitle(conversationPlainTitle(conversation, labels, uiLanguage));
|
|
26460
26798
|
}, [conversation, labels, open, uiLanguage]);
|
|
26461
|
-
|
|
26799
|
+
useEffect15(() => {
|
|
26462
26800
|
if (!open) {
|
|
26463
26801
|
return;
|
|
26464
26802
|
}
|
|
@@ -26490,7 +26828,7 @@ var AgentGUIRenameConversationDialog = memo2(
|
|
|
26490
26828
|
ConfirmationDialog,
|
|
26491
26829
|
{
|
|
26492
26830
|
cancelLabel: labels.cancel,
|
|
26493
|
-
className: "sm:max-w-[480px]",
|
|
26831
|
+
className: "bg-[var(--background-fronted)] sm:max-w-[480px]",
|
|
26494
26832
|
confirmBusy: isSaving,
|
|
26495
26833
|
confirmDisabled: !trimmedTitle,
|
|
26496
26834
|
confirmLabel: labels.renameSessionSave,
|
|
@@ -26530,11 +26868,12 @@ var AgentGUIRenameConversationDialog = memo2(
|
|
|
26530
26868
|
onConfirm: confirmRename,
|
|
26531
26869
|
onOpenChange,
|
|
26532
26870
|
children: /* @__PURE__ */ jsx34(
|
|
26533
|
-
|
|
26871
|
+
Input2,
|
|
26534
26872
|
{
|
|
26535
26873
|
ref: inputRef,
|
|
26536
26874
|
"aria-label": labels.renameSessionTitle,
|
|
26537
|
-
className: "h-
|
|
26875
|
+
className: "h-9",
|
|
26876
|
+
variant: "md",
|
|
26538
26877
|
placeholder: labels.renameSessionPlaceholder,
|
|
26539
26878
|
value: title,
|
|
26540
26879
|
onChange: (event) => setTitle(event.currentTarget.value),
|
|
@@ -26647,6 +26986,8 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
26647
26986
|
const pendingRestoreScrollRef = useRef12(null);
|
|
26648
26987
|
const [isTimelineScrolledToTop, setIsTimelineScrolledToTop] = useState14(true);
|
|
26649
26988
|
const [isTimelineScrolledToBottom, setIsTimelineScrolledToBottom] = useState14(true);
|
|
26989
|
+
const isTimelineScrolledToTopRef = useRef12(true);
|
|
26990
|
+
const isTimelineScrolledToBottomRef = useRef12(true);
|
|
26650
26991
|
const [
|
|
26651
26992
|
bottomDockDismissedPromptRequestId,
|
|
26652
26993
|
setBottomDockDismissedPromptRequestId
|
|
@@ -26661,11 +27002,11 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
26661
27002
|
const emptyProviderReadinessGate = !hasActiveConversation ? selectedProviderTargetComingSoon ? { status: "coming_soon" } : viewModel.providerReadinessGate : null;
|
|
26662
27003
|
const activePrompt = viewModel.pendingInteractivePrompt ?? viewModel.pendingApproval;
|
|
26663
27004
|
const activePromptRequestId = activePrompt?.requestId ?? null;
|
|
26664
|
-
const sessionChrome =
|
|
27005
|
+
const sessionChrome = useMemo10(
|
|
26665
27006
|
() => ({ ...viewModel.sessionChrome, approval: null }),
|
|
26666
27007
|
[viewModel.sessionChrome]
|
|
26667
27008
|
);
|
|
26668
|
-
const rawSlashStatus =
|
|
27009
|
+
const rawSlashStatus = useMemo10(
|
|
26669
27010
|
() => resolveSlashStatus({
|
|
26670
27011
|
rawState: viewModel.sessionChrome.rawState,
|
|
26671
27012
|
limits: slashStatusLimits,
|
|
@@ -26678,7 +27019,7 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
26678
27019
|
]
|
|
26679
27020
|
);
|
|
26680
27021
|
const slashStatus = useStableSlashStatus(rawSlashStatus);
|
|
26681
|
-
const displayedInlineNotice =
|
|
27022
|
+
const displayedInlineNotice = useMemo10(() => {
|
|
26682
27023
|
const inlineNotice = viewModel.inlineNotice;
|
|
26683
27024
|
const inlineNoticeMessage = inlineNotice?.message.trim() ?? "";
|
|
26684
27025
|
if (!inlineNotice || inlineNoticeMessage === "") {
|
|
@@ -26702,7 +27043,7 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
26702
27043
|
viewModel.activeLiveState,
|
|
26703
27044
|
viewModel.inlineNotice
|
|
26704
27045
|
]);
|
|
26705
|
-
const inlineNoticeChrome =
|
|
27046
|
+
const inlineNoticeChrome = useMemo10(() => {
|
|
26706
27047
|
if (!displayedInlineNotice) {
|
|
26707
27048
|
return null;
|
|
26708
27049
|
}
|
|
@@ -26745,14 +27086,14 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
26745
27086
|
const submitDisabled = isCollaboratorConversation || !isAgentProviderReady || !viewModel.canSubmit && !canQueueWhileBusy;
|
|
26746
27087
|
const hasNonRetryableRecoveryFailure = sessionChrome.recovery?.kind === "failed" && sessionChrome.recovery.canRetry === false;
|
|
26747
27088
|
const composerDisabled = hasNonRetryableRecoveryFailure || isCollaboratorConversation || !isAgentProviderReady || !canQueueWhileBusy && (viewModel.pendingApproval !== null || viewModel.pendingInteractivePrompt !== null || viewModel.isSubmitting || viewModel.isInterrupting || viewModel.isCreatingConversation);
|
|
26748
|
-
const showStopButton = !viewModel.isSubmitting && viewModel.activeLiveState !== "failed" && sessionChrome.auth === null && (activeConversationTurnBusy || viewModel.pendingApproval !== null || viewModel.pendingInteractivePrompt !== null || viewModel.isInterrupting);
|
|
27089
|
+
const showStopButton = viewModel.canCancel && !viewModel.isSubmitting && viewModel.activeLiveState !== "failed" && sessionChrome.auth === null && (activeConversationTurnBusy || viewModel.pendingApproval !== null || viewModel.pendingInteractivePrompt !== null || viewModel.isInterrupting);
|
|
26749
27090
|
const syncStatus = resolveSyncIndicatorStatus(
|
|
26750
27091
|
viewModel.activeConversation?.syncState?.status
|
|
26751
27092
|
);
|
|
26752
27093
|
const syncLabel = syncStateLabel(syncStatus, labels);
|
|
26753
27094
|
const showSyncIndicator = Boolean(viewModel.activeConversation?.syncState);
|
|
26754
27095
|
const showFailedSyncLabel = showSyncIndicator && syncStatus === "failed";
|
|
26755
|
-
const conversationFlowLabels =
|
|
27096
|
+
const conversationFlowLabels = useMemo10(
|
|
26756
27097
|
() => ({
|
|
26757
27098
|
thinkingLabel: labels.thinkingLabel,
|
|
26758
27099
|
toolCallsLabel: labels.toolCallsLabel,
|
|
@@ -26768,7 +27109,7 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
26768
27109
|
labels.userMessageLocator
|
|
26769
27110
|
]
|
|
26770
27111
|
);
|
|
26771
|
-
const conversationFlowEmpty =
|
|
27112
|
+
const conversationFlowEmpty = useMemo10(
|
|
26772
27113
|
() => /* @__PURE__ */ jsxs21(
|
|
26773
27114
|
"div",
|
|
26774
27115
|
{
|
|
@@ -26782,7 +27123,7 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
26782
27123
|
),
|
|
26783
27124
|
[labels.conversationUnavailable]
|
|
26784
27125
|
);
|
|
26785
|
-
const chromeLabels =
|
|
27126
|
+
const chromeLabels = useMemo10(
|
|
26786
27127
|
() => ({
|
|
26787
27128
|
approvalRequired: labels.approvalRequired,
|
|
26788
27129
|
authRequired: labels.authRequired,
|
|
@@ -26803,7 +27144,7 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
26803
27144
|
viewModel.isCancelPending
|
|
26804
27145
|
]
|
|
26805
27146
|
);
|
|
26806
|
-
const goalBannerLabels =
|
|
27147
|
+
const goalBannerLabels = useMemo10(
|
|
26807
27148
|
() => ({
|
|
26808
27149
|
titleActive: labels.goalTitleActive,
|
|
26809
27150
|
titlePaused: labels.goalTitlePaused,
|
|
@@ -26833,7 +27174,7 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
26833
27174
|
labels.goalClearAction
|
|
26834
27175
|
]
|
|
26835
27176
|
);
|
|
26836
|
-
const interactivePromptLabels =
|
|
27177
|
+
const interactivePromptLabels = useMemo10(
|
|
26837
27178
|
() => ({
|
|
26838
27179
|
approvalLead: labels.approvalRequired,
|
|
26839
27180
|
planLead: labels.planLead,
|
|
@@ -26871,7 +27212,7 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
26871
27212
|
labels.planImplementationSkip
|
|
26872
27213
|
]
|
|
26873
27214
|
);
|
|
26874
|
-
const composerLabels =
|
|
27215
|
+
const composerLabels = useMemo10(
|
|
26875
27216
|
() => ({
|
|
26876
27217
|
send: labels.send,
|
|
26877
27218
|
modelLabel: labels.modelLabel,
|
|
@@ -27225,7 +27566,7 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
27225
27566
|
const agentTargetId = viewModel.data.agentTargetId;
|
|
27226
27567
|
return !agentTargetId || target.targetId === agentTargetId || target.agentTargetId === agentTargetId;
|
|
27227
27568
|
}) ?? viewModel.selectedProviderTarget;
|
|
27228
|
-
const bottomDockComposerProps =
|
|
27569
|
+
const bottomDockComposerProps = useMemo10(
|
|
27229
27570
|
() => ({
|
|
27230
27571
|
workspaceId: viewModel.workspaceId,
|
|
27231
27572
|
workspacePath: viewModel.workspacePath,
|
|
@@ -27265,6 +27606,8 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
27265
27606
|
composerFocusRequestSequence,
|
|
27266
27607
|
isActive,
|
|
27267
27608
|
promptImagesSupported: viewModel.promptImagesSupported,
|
|
27609
|
+
canGoalControl: viewModel.canGoalControl,
|
|
27610
|
+
canUploadAttachment: viewModel.canUploadAttachment,
|
|
27268
27611
|
providerSelectLabel: labels.providerSwitchLabel,
|
|
27269
27612
|
handoffLabel: labels.handoffConversation,
|
|
27270
27613
|
handoffMenuLabel: labels.handoffConversationMenu,
|
|
@@ -27374,6 +27717,8 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
27374
27717
|
viewModel.isInterrupting,
|
|
27375
27718
|
viewModel.isRespondingApproval,
|
|
27376
27719
|
viewModel.promptImagesSupported,
|
|
27720
|
+
viewModel.canGoalControl,
|
|
27721
|
+
viewModel.canUploadAttachment,
|
|
27377
27722
|
viewModel.queuedPrompts,
|
|
27378
27723
|
viewModel.usage,
|
|
27379
27724
|
viewModel.workspaceId,
|
|
@@ -27383,7 +27728,7 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
27383
27728
|
selectHomeComposerAgentTargetAndFocus
|
|
27384
27729
|
]
|
|
27385
27730
|
);
|
|
27386
|
-
const emptyHeroComposerProps =
|
|
27731
|
+
const emptyHeroComposerProps = useMemo10(
|
|
27387
27732
|
() => ({
|
|
27388
27733
|
...bottomDockComposerProps,
|
|
27389
27734
|
layoutMode: "hero"
|
|
@@ -27393,14 +27738,14 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
27393
27738
|
const emptyHeroProvider = viewModel.selectedProviderTarget?.provider ?? viewModel.data.provider;
|
|
27394
27739
|
const emptyHeroProviderLabel = labels.emptyProviderForProvider?.(emptyHeroProvider) ?? labels.emptyProvider ?? "";
|
|
27395
27740
|
const emptyHeroLabel = labels.emptyForProvider?.(emptyHeroProvider) ?? labels.empty;
|
|
27396
|
-
const emptyHeroIconPresentations =
|
|
27741
|
+
const emptyHeroIconPresentations = useMemo10(
|
|
27397
27742
|
() => viewModel.conversationFilter.kind === "all" ? agentGUILaunchpadIconPresentations() : [agentGUIProviderIconPresentation(emptyHeroProvider)],
|
|
27398
27743
|
[emptyHeroProvider, viewModel.conversationFilter]
|
|
27399
27744
|
);
|
|
27400
27745
|
const disabledProviderTarget = selectedProviderTargetComingSoon ? viewModel.selectedProviderTarget ?? null : null;
|
|
27401
27746
|
const shouldRenderProviderUnavailableState = !hasActiveConversation && disabledProviderTarget !== null && renderProviderUnavailableState !== void 0;
|
|
27402
27747
|
const shouldRenderProviderReadinessGateState = !hasActiveConversation && emptyProviderReadinessGate !== null && renderProviderReadinessGateState !== void 0;
|
|
27403
|
-
const bottomDockStoreState =
|
|
27748
|
+
const bottomDockStoreState = useMemo10(
|
|
27404
27749
|
() => ({
|
|
27405
27750
|
// The lifted prompt is rendered from props on the pane; the store still
|
|
27406
27751
|
// carries it so the snapshot revision tracks prompt changes.
|
|
@@ -27436,7 +27781,7 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
27436
27781
|
viewModel.drainingQueuedPromptId ?? "",
|
|
27437
27782
|
viewModel.isRespondingApproval ? "1" : "0"
|
|
27438
27783
|
].join("|");
|
|
27439
|
-
|
|
27784
|
+
useEffect15(() => {
|
|
27440
27785
|
setBottomDockDismissedPromptRequestId(null);
|
|
27441
27786
|
}, [activePromptRequestId]);
|
|
27442
27787
|
useLayoutEffect4(() => {
|
|
@@ -27449,8 +27794,16 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
27449
27794
|
timelineScrollAnchorRef.current = null;
|
|
27450
27795
|
pendingPrependScrollAnchorRef.current = null;
|
|
27451
27796
|
submittedPromptScrollConversationRef.current = null;
|
|
27452
|
-
|
|
27453
|
-
|
|
27797
|
+
setBooleanStateIfChanged(
|
|
27798
|
+
isTimelineScrolledToTopRef,
|
|
27799
|
+
setIsTimelineScrolledToTop,
|
|
27800
|
+
true
|
|
27801
|
+
);
|
|
27802
|
+
setBooleanStateIfChanged(
|
|
27803
|
+
isTimelineScrolledToBottomRef,
|
|
27804
|
+
setIsTimelineScrolledToBottom,
|
|
27805
|
+
true
|
|
27806
|
+
);
|
|
27454
27807
|
return;
|
|
27455
27808
|
}
|
|
27456
27809
|
const maxScrollTop = Math.max(
|
|
@@ -27525,10 +27878,14 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
27525
27878
|
scrollTop: nextScrollTop,
|
|
27526
27879
|
clientHeight: timeline.clientHeight
|
|
27527
27880
|
};
|
|
27528
|
-
|
|
27881
|
+
setBooleanStateIfChanged(
|
|
27882
|
+
isTimelineScrolledToTopRef,
|
|
27883
|
+
setIsTimelineScrolledToTop,
|
|
27529
27884
|
nextScrollTop <= AGENT_GUI_TOP_MASK_SCROLL_EPSILON_PX
|
|
27530
27885
|
);
|
|
27531
|
-
|
|
27886
|
+
setBooleanStateIfChanged(
|
|
27887
|
+
isTimelineScrolledToBottomRef,
|
|
27888
|
+
setIsTimelineScrolledToBottom,
|
|
27532
27889
|
maxScrollTop - nextScrollTop <= AGENT_GUI_STICK_TO_BOTTOM_THRESHOLD_PX
|
|
27533
27890
|
);
|
|
27534
27891
|
}, [
|
|
@@ -27596,10 +27953,16 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
27596
27953
|
scrollTop: maxScrollTop,
|
|
27597
27954
|
clientHeight: timeline.clientHeight
|
|
27598
27955
|
};
|
|
27599
|
-
|
|
27956
|
+
setBooleanStateIfChanged(
|
|
27957
|
+
isTimelineScrolledToTopRef,
|
|
27958
|
+
setIsTimelineScrolledToTop,
|
|
27600
27959
|
maxScrollTop <= AGENT_GUI_TOP_MASK_SCROLL_EPSILON_PX
|
|
27601
27960
|
);
|
|
27602
|
-
|
|
27961
|
+
setBooleanStateIfChanged(
|
|
27962
|
+
isTimelineScrolledToBottomRef,
|
|
27963
|
+
setIsTimelineScrolledToBottom,
|
|
27964
|
+
true
|
|
27965
|
+
);
|
|
27603
27966
|
});
|
|
27604
27967
|
};
|
|
27605
27968
|
syncBottomDockSpace();
|
|
@@ -27633,7 +27996,7 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
27633
27996
|
observer.disconnect();
|
|
27634
27997
|
};
|
|
27635
27998
|
}, [bottomDockStoreRevision, viewModel.activeConversationId]);
|
|
27636
|
-
|
|
27999
|
+
useEffect15(() => {
|
|
27637
28000
|
const timeline = timelineRef.current;
|
|
27638
28001
|
const activeConversationId = viewModel.activeConversationId;
|
|
27639
28002
|
if (!timeline || !activeConversationId) {
|
|
@@ -27648,10 +28011,16 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
27648
28011
|
clientHeight: timeline.clientHeight
|
|
27649
28012
|
};
|
|
27650
28013
|
const atBottom = timeline.scrollHeight - scrollTop - timeline.clientHeight <= AGENT_GUI_STICK_TO_BOTTOM_THRESHOLD_PX;
|
|
27651
|
-
|
|
28014
|
+
setBooleanStateIfChanged(
|
|
28015
|
+
isTimelineScrolledToTopRef,
|
|
28016
|
+
setIsTimelineScrolledToTop,
|
|
27652
28017
|
scrollTop <= AGENT_GUI_TOP_MASK_SCROLL_EPSILON_PX
|
|
27653
28018
|
);
|
|
27654
|
-
|
|
28019
|
+
setBooleanStateIfChanged(
|
|
28020
|
+
isTimelineScrolledToBottomRef,
|
|
28021
|
+
setIsTimelineScrolledToBottom,
|
|
28022
|
+
atBottom
|
|
28023
|
+
);
|
|
27655
28024
|
if (pendingRestoreScrollRef.current?.conversationId !== activeConversationId) {
|
|
27656
28025
|
timelineScrollPositionsRef.current.set(activeConversationId, {
|
|
27657
28026
|
scrollTop,
|
|
@@ -27667,9 +28036,17 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
27667
28036
|
actions.loadOlderConversationMessages();
|
|
27668
28037
|
}
|
|
27669
28038
|
};
|
|
27670
|
-
|
|
28039
|
+
let initialCaptureFrameId = window.requestAnimationFrame(
|
|
28040
|
+
() => {
|
|
28041
|
+
initialCaptureFrameId = null;
|
|
28042
|
+
captureScrollAnchor();
|
|
28043
|
+
}
|
|
28044
|
+
);
|
|
27671
28045
|
timeline.addEventListener("scroll", captureScrollAnchor, { passive: true });
|
|
27672
28046
|
return () => {
|
|
28047
|
+
if (initialCaptureFrameId !== null) {
|
|
28048
|
+
window.cancelAnimationFrame(initialCaptureFrameId);
|
|
28049
|
+
}
|
|
27673
28050
|
timeline.removeEventListener("scroll", captureScrollAnchor);
|
|
27674
28051
|
};
|
|
27675
28052
|
}, [
|
|
@@ -27695,10 +28072,16 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
27695
28072
|
scrollTop: maxScrollTop,
|
|
27696
28073
|
clientHeight: timeline.clientHeight
|
|
27697
28074
|
};
|
|
27698
|
-
|
|
28075
|
+
setBooleanStateIfChanged(
|
|
28076
|
+
isTimelineScrolledToTopRef,
|
|
28077
|
+
setIsTimelineScrolledToTop,
|
|
27699
28078
|
maxScrollTop <= AGENT_GUI_TOP_MASK_SCROLL_EPSILON_PX
|
|
27700
28079
|
);
|
|
27701
|
-
|
|
28080
|
+
setBooleanStateIfChanged(
|
|
28081
|
+
isTimelineScrolledToBottomRef,
|
|
28082
|
+
setIsTimelineScrolledToBottom,
|
|
28083
|
+
true
|
|
28084
|
+
);
|
|
27702
28085
|
}, [viewModel.activeConversationId]);
|
|
27703
28086
|
return /* @__PURE__ */ jsxs21("main", { className: AgentGUINode_styles_default.detail, children: [
|
|
27704
28087
|
/* @__PURE__ */ jsx34(
|
|
@@ -27781,6 +28164,12 @@ var AgentGUIDetailPane = memo2(function AgentGUIDetailPane2({
|
|
|
27781
28164
|
provider: emptyHeroProvider,
|
|
27782
28165
|
gate: emptyProviderReadinessGate,
|
|
27783
28166
|
showAllProviders: viewModel.conversationFilter.kind === "all",
|
|
28167
|
+
emptyLabel: emptyHeroLabel,
|
|
28168
|
+
emptyProvider: emptyHeroProviderLabel,
|
|
28169
|
+
providerTargets: composerProviderTargets,
|
|
28170
|
+
selectedProviderTarget: viewModel.selectedProviderTarget,
|
|
28171
|
+
onProviderSelect: canSwitchComposerProvider && viewModel.activeConversationId === null ? selectHomeComposerAgentTargetAndFocus : void 0,
|
|
28172
|
+
providerSelectLabel: labels.providerSwitchLabel,
|
|
27784
28173
|
labels
|
|
27785
28174
|
}
|
|
27786
28175
|
) : /* @__PURE__ */ jsx34(
|
|
@@ -27937,7 +28326,7 @@ function useOptionalStableEventCallback(callback) {
|
|
|
27937
28326
|
useLayoutEffect4(() => {
|
|
27938
28327
|
callbackRef.current = callback;
|
|
27939
28328
|
}, [callback]);
|
|
27940
|
-
return
|
|
28329
|
+
return useMemo10(() => {
|
|
27941
28330
|
if (callback == null) {
|
|
27942
28331
|
return void 0;
|
|
27943
28332
|
}
|
|
@@ -27976,7 +28365,10 @@ var AgentGUIEmptyHeroPane = memo2(function AgentGUIEmptyHeroPane2({
|
|
|
27976
28365
|
{
|
|
27977
28366
|
activeProvider: provider,
|
|
27978
28367
|
className: AgentGUINode_styles_default.emptyHeroLaunchpadIcon,
|
|
27979
|
-
icons: heroIconPresentations
|
|
28368
|
+
icons: heroIconPresentations,
|
|
28369
|
+
providerTargets,
|
|
28370
|
+
onProviderSelect,
|
|
28371
|
+
providerSelectLabel
|
|
27980
28372
|
},
|
|
27981
28373
|
heroIconAnimationKey
|
|
27982
28374
|
) : /* @__PURE__ */ jsx34(
|
|
@@ -28028,11 +28420,17 @@ var AgentGUIProviderReadinessGatePane = memo2(
|
|
|
28028
28420
|
provider,
|
|
28029
28421
|
gate,
|
|
28030
28422
|
showAllProviders = false,
|
|
28423
|
+
emptyLabel,
|
|
28424
|
+
emptyProvider,
|
|
28425
|
+
providerTargets,
|
|
28426
|
+
selectedProviderTarget,
|
|
28427
|
+
onProviderSelect,
|
|
28428
|
+
providerSelectLabel,
|
|
28031
28429
|
labels
|
|
28032
28430
|
}) {
|
|
28033
28431
|
"use memo";
|
|
28034
28432
|
const heroIconUrl = resolveAgentGUIHeroIconUrl(provider);
|
|
28035
|
-
const launchpadIconPresentations =
|
|
28433
|
+
const launchpadIconPresentations = useMemo10(
|
|
28036
28434
|
() => agentGUILaunchpadIconPresentations(),
|
|
28037
28435
|
[]
|
|
28038
28436
|
);
|
|
@@ -28043,6 +28441,7 @@ var AgentGUIProviderReadinessGatePane = memo2(
|
|
|
28043
28441
|
showAllProviders: showAllProvidersChecking
|
|
28044
28442
|
});
|
|
28045
28443
|
const action = providerGateAction(gate.status);
|
|
28444
|
+
const useSharedHeroTitle = gate.status === "not_installed" || gate.status === "auth_required";
|
|
28046
28445
|
const pendingLabel = pendingAction === "install" ? labels.providerGatePendingInstall : pendingAction === "login" ? labels.providerGatePendingLogin : pendingAction === "refresh" ? labels.providerGatePendingRefresh : null;
|
|
28047
28446
|
return /* @__PURE__ */ jsx34("div", { className: AgentGUINode_styles_default.emptyHero, children: /* @__PURE__ */ jsxs21(
|
|
28048
28447
|
"div",
|
|
@@ -28051,11 +28450,15 @@ var AgentGUIProviderReadinessGatePane = memo2(
|
|
|
28051
28450
|
"data-testid": "agent-gui-provider-readiness-gate",
|
|
28052
28451
|
role: "status",
|
|
28053
28452
|
children: [
|
|
28054
|
-
|
|
28453
|
+
showAllProviders ? /* @__PURE__ */ jsx34(
|
|
28055
28454
|
AgentGUIAllProviderGridIcon,
|
|
28056
28455
|
{
|
|
28456
|
+
activeProvider: provider,
|
|
28057
28457
|
className: AgentGUINode_styles_default.emptyHeroLaunchpadIcon,
|
|
28058
|
-
icons: launchpadIconPresentations
|
|
28458
|
+
icons: launchpadIconPresentations,
|
|
28459
|
+
providerTargets,
|
|
28460
|
+
onProviderSelect,
|
|
28461
|
+
providerSelectLabel
|
|
28059
28462
|
}
|
|
28060
28463
|
) : /* @__PURE__ */ jsx34(
|
|
28061
28464
|
"img",
|
|
@@ -28067,8 +28470,25 @@ var AgentGUIProviderReadinessGatePane = memo2(
|
|
|
28067
28470
|
alt: ""
|
|
28068
28471
|
}
|
|
28069
28472
|
),
|
|
28070
|
-
/* @__PURE__ */ jsx34("h2", { className: AgentGUINode_styles_default.emptyHeroTitle, children:
|
|
28071
|
-
|
|
28473
|
+
/* @__PURE__ */ jsx34("h2", { className: AgentGUINode_styles_default.emptyHeroTitle, children: useSharedHeroTitle ? /* @__PURE__ */ jsx34(
|
|
28474
|
+
EmptyHeroTitle,
|
|
28475
|
+
{
|
|
28476
|
+
label: emptyLabel,
|
|
28477
|
+
providerLabel: emptyProvider,
|
|
28478
|
+
providerSelectLabel,
|
|
28479
|
+
providerTargets,
|
|
28480
|
+
selectedProviderTarget,
|
|
28481
|
+
onProviderSelect
|
|
28482
|
+
}
|
|
28483
|
+
) : content.title }),
|
|
28484
|
+
/* @__PURE__ */ jsx34(
|
|
28485
|
+
"p",
|
|
28486
|
+
{
|
|
28487
|
+
className: AgentGUINode_styles_default.emptyProviderGateDescription,
|
|
28488
|
+
"data-testid": "agent-gui-provider-readiness-gate-description",
|
|
28489
|
+
children: content.description
|
|
28490
|
+
}
|
|
28491
|
+
),
|
|
28072
28492
|
pendingLabel && !action ? /* @__PURE__ */ jsx34(
|
|
28073
28493
|
"div",
|
|
28074
28494
|
{
|
|
@@ -28164,18 +28584,25 @@ function providerGateAction(status) {
|
|
|
28164
28584
|
function AgentGUIAllProviderGridIcon({
|
|
28165
28585
|
activeProvider,
|
|
28166
28586
|
className,
|
|
28167
|
-
icons
|
|
28587
|
+
icons,
|
|
28588
|
+
providerTargets,
|
|
28589
|
+
onProviderSelect,
|
|
28590
|
+
providerSelectLabel
|
|
28168
28591
|
}) {
|
|
28592
|
+
const interactive = onProviderSelect != null && (providerTargets?.length ?? 0) > 0;
|
|
28169
28593
|
return /* @__PURE__ */ jsx34(
|
|
28170
28594
|
"span",
|
|
28171
28595
|
{
|
|
28172
|
-
"aria-hidden": "true",
|
|
28596
|
+
"aria-hidden": interactive ? void 0 : "true",
|
|
28173
28597
|
className: [AgentGUINode_styles_default.providerRailAvatar, className].filter(Boolean).join(" "),
|
|
28174
28598
|
children: /* @__PURE__ */ jsx34(
|
|
28175
28599
|
AgentGUILaunchpadIconGrid,
|
|
28176
28600
|
{
|
|
28177
28601
|
activeProvider,
|
|
28178
|
-
icons
|
|
28602
|
+
icons,
|
|
28603
|
+
providerTargets,
|
|
28604
|
+
onProviderSelect,
|
|
28605
|
+
providerSelectLabel
|
|
28179
28606
|
}
|
|
28180
28607
|
)
|
|
28181
28608
|
}
|
|
@@ -28195,22 +28622,82 @@ function AgentGUIUnifiedProviderIcon({
|
|
|
28195
28622
|
}
|
|
28196
28623
|
) });
|
|
28197
28624
|
}
|
|
28625
|
+
var AGENT_GUI_HERO_STRIP_INACTIVE_OPACITY = 0.4;
|
|
28626
|
+
function agentGUIHeroStripOpacity(isActive) {
|
|
28627
|
+
return isActive ? 1 : AGENT_GUI_HERO_STRIP_INACTIVE_OPACITY;
|
|
28628
|
+
}
|
|
28629
|
+
function agentGUILaunchpadProviderTarget(providerTargets, provider) {
|
|
28630
|
+
const normalized = normalizeManagedAgentProvider(provider);
|
|
28631
|
+
return providerTargets.find(
|
|
28632
|
+
(target) => target.disabled !== true && normalizeManagedAgentProvider(target.provider) === normalized
|
|
28633
|
+
) ?? null;
|
|
28634
|
+
}
|
|
28198
28635
|
function AgentGUILaunchpadIconGrid({
|
|
28199
28636
|
activeProvider,
|
|
28200
|
-
icons
|
|
28637
|
+
icons,
|
|
28638
|
+
providerTargets,
|
|
28639
|
+
onProviderSelect,
|
|
28640
|
+
providerSelectLabel
|
|
28201
28641
|
}) {
|
|
28202
28642
|
const normalizedActiveProvider = activeProvider ? normalizeManagedAgentProvider(activeProvider) : null;
|
|
28203
|
-
|
|
28643
|
+
const activeIndex = normalizedActiveProvider === null ? -1 : icons.findIndex(
|
|
28644
|
+
(icon) => normalizeManagedAgentProvider(icon.provider) === normalizedActiveProvider
|
|
28645
|
+
);
|
|
28646
|
+
const interactive = onProviderSelect != null && (providerTargets?.length ?? 0) > 0;
|
|
28647
|
+
const renderItem = (icon, isActive) => {
|
|
28648
|
+
const key = `${icon.provider}:${icon.iconUrl}`;
|
|
28649
|
+
const style = { opacity: agentGUIHeroStripOpacity(isActive) };
|
|
28650
|
+
const dataActive = normalizedActiveProvider === null ? void 0 : isActive;
|
|
28651
|
+
const target = interactive ? agentGUILaunchpadProviderTarget(providerTargets ?? [], icon.provider) : null;
|
|
28652
|
+
if (target && onProviderSelect) {
|
|
28653
|
+
const label = providerSelectLabel ? `${providerSelectLabel}: ${target.label}` : target.label;
|
|
28654
|
+
return /* @__PURE__ */ jsx34(
|
|
28655
|
+
"button",
|
|
28656
|
+
{
|
|
28657
|
+
type: "button",
|
|
28658
|
+
className: AgentGUINode_styles_default.providerRailLaunchpadItem,
|
|
28659
|
+
"data-provider-active": dataActive,
|
|
28660
|
+
"aria-label": label,
|
|
28661
|
+
"aria-pressed": isActive,
|
|
28662
|
+
title: target.label,
|
|
28663
|
+
style,
|
|
28664
|
+
onClick: () => onProviderSelect({
|
|
28665
|
+
provider: target.provider,
|
|
28666
|
+
providerTargetId: target.targetId
|
|
28667
|
+
}),
|
|
28668
|
+
children: /* @__PURE__ */ jsx34(
|
|
28669
|
+
AgentGUIProviderIconVisual,
|
|
28670
|
+
{
|
|
28671
|
+
ariaHidden: true,
|
|
28672
|
+
imageClassName: "",
|
|
28673
|
+
icon
|
|
28674
|
+
}
|
|
28675
|
+
)
|
|
28676
|
+
},
|
|
28677
|
+
key
|
|
28678
|
+
);
|
|
28679
|
+
}
|
|
28204
28680
|
return /* @__PURE__ */ jsx34(
|
|
28205
28681
|
"span",
|
|
28206
28682
|
{
|
|
28207
28683
|
className: AgentGUINode_styles_default.providerRailLaunchpadItem,
|
|
28208
|
-
"data-provider-active":
|
|
28684
|
+
"data-provider-active": dataActive,
|
|
28685
|
+
style,
|
|
28209
28686
|
children: /* @__PURE__ */ jsx34(AgentGUIProviderIconVisual, { imageClassName: "", icon })
|
|
28210
28687
|
},
|
|
28211
|
-
|
|
28688
|
+
key
|
|
28212
28689
|
);
|
|
28213
|
-
}
|
|
28690
|
+
};
|
|
28691
|
+
return /* @__PURE__ */ jsx34(
|
|
28692
|
+
"span",
|
|
28693
|
+
{
|
|
28694
|
+
"aria-hidden": interactive ? void 0 : "true",
|
|
28695
|
+
className: AgentGUINode_styles_default.providerRailLaunchpadIcon,
|
|
28696
|
+
children: icons.map(
|
|
28697
|
+
(icon, index) => renderItem(icon, activeIndex < 0 ? true : index === activeIndex)
|
|
28698
|
+
)
|
|
28699
|
+
}
|
|
28700
|
+
);
|
|
28214
28701
|
}
|
|
28215
28702
|
function AgentGUIProviderIconVisual({
|
|
28216
28703
|
ariaHidden = false,
|
|
@@ -28348,7 +28835,7 @@ var AgentGUIBottomDockPane = memo2(function AgentGUIBottomDockPane2({
|
|
|
28348
28835
|
const goalTokenBudget = goal ? numberValue2(goal.tokenBudget) : null;
|
|
28349
28836
|
const goalTokensUsed = goal ? numberValue2(goal.tokensUsed) : null;
|
|
28350
28837
|
const goalTimeUsedSeconds = goal ? numberValue2(goal.timeUsedSeconds) : null;
|
|
28351
|
-
const showGoalBanner = isGoalBannerVisible(goalObjective, goalStatus);
|
|
28838
|
+
const showGoalBanner = composerProps.canGoalControl && isGoalBannerVisible(goalObjective, goalStatus);
|
|
28352
28839
|
return /* @__PURE__ */ jsxs21(
|
|
28353
28840
|
"div",
|
|
28354
28841
|
{
|
|
@@ -28464,7 +28951,7 @@ function syncAgentGUIConversationRailStore(store, next) {
|
|
|
28464
28951
|
Object.assign(store, next);
|
|
28465
28952
|
}
|
|
28466
28953
|
function agentGUIConversationRailStoreSnapshotsEqual(current, next) {
|
|
28467
|
-
return current.activeConversationId === next.activeConversationId && current.pendingDeleteConversationId === next.pendingDeleteConversationId && current.isLoadingConversations === next.isLoadingConversations && current.isDeletingConversation === next.isDeletingConversation && current.isDeletingProjectConversations === next.isDeletingProjectConversations && current.labels === next.labels && current.workspaceUserProjectI18n === next.workspaceUserProjectI18n && current.uiLanguage === next.uiLanguage && current.previewMode === next.previewMode && current.createConversationDisabled === next.createConversationDisabled && current.openclawGateway === next.openclawGateway && current.isCollapsed === next.isCollapsed && current.providerTargets === next.providerTargets && current.providerTargetsLoading === next.providerTargetsLoading && current.conversationFilter === next.conversationFilter && current.sectionAgentTargetFallbackId === next.sectionAgentTargetFallbackId && current.onUpdateConversationFilter === next.onUpdateConversationFilter && current.onSelectConversationFilterTarget === next.onSelectConversationFilterTarget && current.onCreateConversation === next.onCreateConversation && current.onRetryOpenclawGateway === next.onRetryOpenclawGateway && current.onSelectConversation === next.onSelectConversation && current.onToggleConversationPinned === next.onToggleConversationPinned && current.onMarkConversationUnread === next.onMarkConversationUnread && current.onOpenProjectFiles === next.onOpenProjectFiles && current.onOpenConversationWindow === next.onOpenConversationWindow && current.selectProjectDirectory === next.selectProjectDirectory && current.onRemoveProject === next.onRemoveProject && current.onConfirmDeleteProjectConversations === next.onConfirmDeleteProjectConversations && current.onRequestDeleteConversation === next.onRequestDeleteConversation && current.onRequestRenameConversation === next.onRequestRenameConversation && current.onCancelDeleteConversation === next.onCancelDeleteConversation && current.onConfirmDeleteConversation === next.onConfirmDeleteConversation;
|
|
28954
|
+
return current.activeConversationId === next.activeConversationId && current.pendingDeleteConversationId === next.pendingDeleteConversationId && current.pendingDeleteProjectConversations === next.pendingDeleteProjectConversations && current.pendingDeleteConversations === next.pendingDeleteConversations && current.isLoadingConversations === next.isLoadingConversations && current.isDeletingConversation === next.isDeletingConversation && current.isDeletingProjectConversations === next.isDeletingProjectConversations && current.labels === next.labels && current.workspaceUserProjectI18n === next.workspaceUserProjectI18n && current.uiLanguage === next.uiLanguage && current.previewMode === next.previewMode && current.createConversationDisabled === next.createConversationDisabled && current.openclawGateway === next.openclawGateway && current.isCollapsed === next.isCollapsed && current.providerTargets === next.providerTargets && current.providerTargetsLoading === next.providerTargetsLoading && current.conversationFilter === next.conversationFilter && current.sectionAgentTargetFallbackId === next.sectionAgentTargetFallbackId && current.onUpdateConversationFilter === next.onUpdateConversationFilter && current.onSelectConversationFilterTarget === next.onSelectConversationFilterTarget && current.onCreateConversation === next.onCreateConversation && current.onRetryOpenclawGateway === next.onRetryOpenclawGateway && current.onSelectConversation === next.onSelectConversation && current.onToggleConversationPinned === next.onToggleConversationPinned && current.onMarkConversationUnread === next.onMarkConversationUnread && current.onOpenProjectFiles === next.onOpenProjectFiles && current.onOpenConversationWindow === next.onOpenConversationWindow && current.selectProjectDirectory === next.selectProjectDirectory && current.onRemoveProject === next.onRemoveProject && current.onRequestDeleteProjectConversations === next.onRequestDeleteProjectConversations && current.onCancelDeleteProjectConversations === next.onCancelDeleteProjectConversations && current.onConfirmDeleteProjectConversations === next.onConfirmDeleteProjectConversations && current.onRequestDeleteConversations === next.onRequestDeleteConversations && current.onCancelDeleteConversations === next.onCancelDeleteConversations && current.onConfirmDeleteConversations === next.onConfirmDeleteConversations && current.onRequestDeleteConversation === next.onRequestDeleteConversation && current.onRequestRenameConversation === next.onRequestRenameConversation && current.onCancelDeleteConversation === next.onCancelDeleteConversation && current.onConfirmDeleteConversation === next.onConfirmDeleteConversation;
|
|
28468
28955
|
}
|
|
28469
28956
|
var AgentGUIConversationRailStorePane = memo2(
|
|
28470
28957
|
function AgentGUIConversationRailStorePane2({
|
|
@@ -28496,6 +28983,18 @@ function normalizeConversationRailProjectPath(path) {
|
|
|
28496
28983
|
}
|
|
28497
28984
|
return normalized.replace(/\/+$/, "") || "/";
|
|
28498
28985
|
}
|
|
28986
|
+
function preserveAdvancedConversationRailPageState(existing, nextCursor) {
|
|
28987
|
+
if (!existing) {
|
|
28988
|
+
return null;
|
|
28989
|
+
}
|
|
28990
|
+
if (existing.hasMore === false) {
|
|
28991
|
+
return existing;
|
|
28992
|
+
}
|
|
28993
|
+
if (existing.nextCursor && existing.nextCursor !== nextCursor) {
|
|
28994
|
+
return existing;
|
|
28995
|
+
}
|
|
28996
|
+
return null;
|
|
28997
|
+
}
|
|
28499
28998
|
function conversationRailPageCursor(conversations) {
|
|
28500
28999
|
let boundary = null;
|
|
28501
29000
|
for (const conversation of conversations) {
|
|
@@ -28599,7 +29098,10 @@ function updateConversationSectionsFromSummaries(previous, conversations, option
|
|
|
28599
29098
|
if ((conversation.pinnedAtUnixMs ?? 0) > 0) {
|
|
28600
29099
|
continue;
|
|
28601
29100
|
}
|
|
28602
|
-
|
|
29101
|
+
if (conversation.project) {
|
|
29102
|
+
continue;
|
|
29103
|
+
}
|
|
29104
|
+
const sectionId = "conversations";
|
|
28603
29105
|
const items = summarySectionItemsById.get(sectionId) ?? [];
|
|
28604
29106
|
items.push(conversation);
|
|
28605
29107
|
summarySectionItemsById.set(sectionId, items);
|
|
@@ -28655,30 +29157,31 @@ function updateConversationSectionsFromSummaries(previous, conversations, option
|
|
|
28655
29157
|
};
|
|
28656
29158
|
}
|
|
28657
29159
|
const summaryItems = summarySectionItemsById.get(section.id) ?? [];
|
|
28658
|
-
const summaryIdsForSection = new Set(summaryItems.map((item) => item.id));
|
|
28659
29160
|
const items = section.items.map((item) => {
|
|
28660
29161
|
seenIds.add(item.id);
|
|
28661
29162
|
const summary = summariesById.get(item.id);
|
|
28662
29163
|
if (!summary) {
|
|
28663
29164
|
return item;
|
|
28664
29165
|
}
|
|
29166
|
+
if ((summary.pinnedAtUnixMs ?? 0) > 0) {
|
|
29167
|
+
sectionChanged = true;
|
|
29168
|
+
return null;
|
|
29169
|
+
}
|
|
28665
29170
|
const nextItem = section.project ? {
|
|
28666
29171
|
...summary,
|
|
28667
29172
|
project: section.project
|
|
28668
|
-
} :
|
|
29173
|
+
} : {
|
|
29174
|
+
...summary,
|
|
29175
|
+
project: null
|
|
29176
|
+
};
|
|
28669
29177
|
if (conversationSummariesRenderEqual2(item, nextItem)) {
|
|
28670
29178
|
return item;
|
|
28671
29179
|
}
|
|
28672
29180
|
sectionChanged = true;
|
|
28673
29181
|
return nextItem;
|
|
28674
|
-
}).filter(
|
|
28675
|
-
|
|
28676
|
-
|
|
28677
|
-
return true;
|
|
28678
|
-
}
|
|
28679
|
-
sectionChanged = true;
|
|
28680
|
-
return false;
|
|
28681
|
-
});
|
|
29182
|
+
}).filter(
|
|
29183
|
+
(item) => item !== null
|
|
29184
|
+
);
|
|
28682
29185
|
const nextSection = sectionChanged ? {
|
|
28683
29186
|
...section,
|
|
28684
29187
|
items
|
|
@@ -28733,7 +29236,7 @@ function updateConversationSectionsFromSummaries(previous, conversations, option
|
|
|
28733
29236
|
});
|
|
28734
29237
|
}
|
|
28735
29238
|
for (const conversation of newConversations) {
|
|
28736
|
-
const targetSectionId =
|
|
29239
|
+
const targetSectionId = "conversations";
|
|
28737
29240
|
const targetIndex = sectionsWithInsertions.findIndex(
|
|
28738
29241
|
(section) => section.id === targetSectionId
|
|
28739
29242
|
);
|
|
@@ -28747,9 +29250,9 @@ function updateConversationSectionsFromSummaries(previous, conversations, option
|
|
|
28747
29250
|
}
|
|
28748
29251
|
sectionsWithInsertions.push({
|
|
28749
29252
|
id: targetSectionId,
|
|
28750
|
-
kind:
|
|
28751
|
-
label:
|
|
28752
|
-
project:
|
|
29253
|
+
kind: "conversations",
|
|
29254
|
+
label: options.sectionConversationsLabel,
|
|
29255
|
+
project: null,
|
|
28753
29256
|
items: [conversation]
|
|
28754
29257
|
});
|
|
28755
29258
|
}
|
|
@@ -28781,6 +29284,7 @@ function projectRuntimeSectionsToConversationSections(input) {
|
|
|
28781
29284
|
label: section.userProject.label,
|
|
28782
29285
|
lastUsedAtUnixMs: section.userProject.lastUsedAtUnixMs,
|
|
28783
29286
|
path: section.userProject.path,
|
|
29287
|
+
sectionKey: section.userProject.sectionKey,
|
|
28784
29288
|
updatedAtUnixMs: section.userProject.updatedAtUnixMs
|
|
28785
29289
|
} : null;
|
|
28786
29290
|
const conversations = buildAgentGUIConversationSummaries({
|
|
@@ -28835,15 +29339,15 @@ function conversationSyncStatesRenderEqual(left, right) {
|
|
|
28835
29339
|
return left === right || (!left || !right ? (left ?? null) === (right ?? null) : left.workspaceId === right.workspaceId && left.agentSessionId === right.agentSessionId && left.status === right.status && left.pendingTimelineItemCount === right.pendingTimelineItemCount && left.pendingStatePatchCount === right.pendingStatePatchCount && left.attemptCount === right.attemptCount && left.failedReportCount === right.failedReportCount && left.lastError === right.lastError && left.lastAttemptAtUnixMs === right.lastAttemptAtUnixMs && left.lastSyncedAtUnixMs === right.lastSyncedAtUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs);
|
|
28836
29340
|
}
|
|
28837
29341
|
function conversationProjectsRenderEqual2(left, right) {
|
|
28838
|
-
return left === right || (!left || !right ? !left && !right : left.id === right.id && left.path === right.path && left.label === right.label && left.createdAtUnixMs === right.createdAtUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.lastUsedAtUnixMs === right.lastUsedAtUnixMs);
|
|
29342
|
+
return left === right || (!left || !right ? !left && !right : left.id === right.id && left.path === right.path && left.label === right.label && left.sectionKey === right.sectionKey && left.createdAtUnixMs === right.createdAtUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.lastUsedAtUnixMs === right.lastUsedAtUnixMs);
|
|
28839
29343
|
}
|
|
28840
29344
|
var agentGUIProviderRailOrder = [
|
|
28841
29345
|
"codex",
|
|
28842
29346
|
"claude-code",
|
|
28843
29347
|
"cursor",
|
|
28844
|
-
"opencode",
|
|
28845
29348
|
"tutti-agent",
|
|
28846
29349
|
"nexight",
|
|
29350
|
+
"opencode",
|
|
28847
29351
|
"hermes",
|
|
28848
29352
|
"openclaw"
|
|
28849
29353
|
];
|
|
@@ -28868,7 +29372,10 @@ function agentGUILaunchpadIconPresentations() {
|
|
|
28868
29372
|
agentGUIProviderRailIconPresentation("codex"),
|
|
28869
29373
|
agentGUIProviderRailIconPresentation("claude-code"),
|
|
28870
29374
|
agentGUIProviderRailIconPresentation("cursor"),
|
|
28871
|
-
agentGUIProviderRailIconPresentation("tutti")
|
|
29375
|
+
agentGUIProviderRailIconPresentation("tutti"),
|
|
29376
|
+
agentGUIProviderRailIconPresentation("opencode"),
|
|
29377
|
+
agentGUIProviderRailIconPresentation("hermes"),
|
|
29378
|
+
agentGUIProviderRailIconPresentation("openclaw")
|
|
28872
29379
|
];
|
|
28873
29380
|
}
|
|
28874
29381
|
function agentGUIConversationProviderIconUrl(provider) {
|
|
@@ -28949,7 +29456,7 @@ var AgentGUIProviderRail = memo2(function AgentGUIProviderRail2({
|
|
|
28949
29456
|
onUpdateConversationFilter
|
|
28950
29457
|
}) {
|
|
28951
29458
|
"use memo";
|
|
28952
|
-
const providerRailOrderStorageKey =
|
|
29459
|
+
const providerRailOrderStorageKey = useMemo10(
|
|
28953
29460
|
() => agentGUIProviderRailOrderStorageKey(workspaceId),
|
|
28954
29461
|
[workspaceId]
|
|
28955
29462
|
);
|
|
@@ -28967,7 +29474,7 @@ var AgentGUIProviderRail = memo2(function AgentGUIProviderRail2({
|
|
|
28967
29474
|
},
|
|
28968
29475
|
[]
|
|
28969
29476
|
);
|
|
28970
|
-
|
|
29477
|
+
useEffect15(() => {
|
|
28971
29478
|
setProviderRailOrder(
|
|
28972
29479
|
parseAgentGUIProviderRailOrder(
|
|
28973
29480
|
globalThis.localStorage?.getItem(providerRailOrderStorageKey)
|
|
@@ -28984,7 +29491,7 @@ var AgentGUIProviderRail = memo2(function AgentGUIProviderRail2({
|
|
|
28984
29491
|
},
|
|
28985
29492
|
[providerRailOrderStorageKey]
|
|
28986
29493
|
);
|
|
28987
|
-
const railProviderTargets =
|
|
29494
|
+
const railProviderTargets = useMemo10(
|
|
28988
29495
|
() => agentGUIProviderRailTargets(
|
|
28989
29496
|
providerTargets,
|
|
28990
29497
|
providerTargetsLoading,
|
|
@@ -28998,7 +29505,7 @@ var AgentGUIProviderRail = memo2(function AgentGUIProviderRail2({
|
|
|
28998
29505
|
providerTargetsLoading
|
|
28999
29506
|
]
|
|
29000
29507
|
);
|
|
29001
|
-
const providerTiles =
|
|
29508
|
+
const providerTiles = useMemo10(() => {
|
|
29002
29509
|
const targets = [...railProviderTargets];
|
|
29003
29510
|
const orderedTargets = providerRailMode === "exact" ? targets : (() => {
|
|
29004
29511
|
const originalIndexByTarget = /* @__PURE__ */ new Map();
|
|
@@ -29022,7 +29529,7 @@ var AgentGUIProviderRail = memo2(function AgentGUIProviderRail2({
|
|
|
29022
29529
|
})();
|
|
29023
29530
|
return applyAgentGUIProviderRailOrder(orderedTargets, providerRailOrder);
|
|
29024
29531
|
}, [providerRailMode, providerRailOrder, railProviderTargets]);
|
|
29025
|
-
const visibleProviderTiles =
|
|
29532
|
+
const visibleProviderTiles = useMemo10(() => {
|
|
29026
29533
|
if (!providerTiles.some((target) => target.provider === "tutti-agent")) {
|
|
29027
29534
|
return providerTiles;
|
|
29028
29535
|
}
|
|
@@ -29371,7 +29878,7 @@ var AgentGUIAccountRewardToast = memo2(function AgentGUIAccountRewardToast2({
|
|
|
29371
29878
|
labels
|
|
29372
29879
|
}) {
|
|
29373
29880
|
"use memo";
|
|
29374
|
-
|
|
29881
|
+
useEffect15(() => {
|
|
29375
29882
|
if (!toast2.visible) {
|
|
29376
29883
|
return;
|
|
29377
29884
|
}
|
|
@@ -29782,25 +30289,25 @@ function useAgentGUIConversationRail({
|
|
|
29782
30289
|
const runtimeListPinnedSessionsPage = agentActivityRuntime.listPinnedSessionsPage;
|
|
29783
30290
|
const runtimeSectionsEnabled = !previewMode && Boolean(runtimeListSessionSections) && Boolean(runtimeListSessionSectionPage);
|
|
29784
30291
|
const sectionAgentTargetId = conversationFilter.kind === "agentTarget" ? conversationFilter.agentTargetId.trim() : sectionAgentTargetFallbackId?.trim() ?? "";
|
|
29785
|
-
const userProjectPaths =
|
|
30292
|
+
const userProjectPaths = useMemo10(
|
|
29786
30293
|
() => userProjects.map((project) => project.path.trim()).filter((path) => path.length > 0),
|
|
29787
30294
|
[userProjects]
|
|
29788
30295
|
);
|
|
29789
|
-
const userProjectPathKey =
|
|
30296
|
+
const userProjectPathKey = useMemo10(
|
|
29790
30297
|
() => JSON.stringify(userProjectPaths),
|
|
29791
30298
|
[userProjectPaths]
|
|
29792
30299
|
);
|
|
29793
|
-
const sectionProjectionLabels =
|
|
30300
|
+
const sectionProjectionLabels = useMemo10(
|
|
29794
30301
|
() => ({
|
|
29795
30302
|
sectionConversations: labels.sectionConversations,
|
|
29796
30303
|
sectionPinned: labels.sectionPinned
|
|
29797
30304
|
}),
|
|
29798
30305
|
[labels.sectionConversations, labels.sectionPinned]
|
|
29799
30306
|
);
|
|
29800
|
-
|
|
30307
|
+
useEffect15(() => {
|
|
29801
30308
|
conversationsRef.current = conversations;
|
|
29802
30309
|
}, [conversations]);
|
|
29803
|
-
|
|
30310
|
+
useEffect15(() => {
|
|
29804
30311
|
const workspaceChanged = workspaceIdRef.current !== workspaceId;
|
|
29805
30312
|
workspaceIdRef.current = workspaceId;
|
|
29806
30313
|
pagingRequestSequenceRef.current += 1;
|
|
@@ -29820,13 +30327,13 @@ function useAgentGUIConversationRail({
|
|
|
29820
30327
|
pagingAbortControllersRef.current.clear();
|
|
29821
30328
|
};
|
|
29822
30329
|
}, [conversationFilter, userProjectPathKey, workspaceId]);
|
|
29823
|
-
const conversationMembershipKey =
|
|
30330
|
+
const conversationMembershipKey = useMemo10(
|
|
29824
30331
|
() => conversations.map(
|
|
29825
30332
|
(conversation) => `${conversation.id}:${conversation.pinnedAtUnixMs ?? 0}`
|
|
29826
30333
|
).join("|"),
|
|
29827
30334
|
[conversations]
|
|
29828
30335
|
);
|
|
29829
|
-
|
|
30336
|
+
useEffect15(() => {
|
|
29830
30337
|
if (!runtimeSectionsEnabled || !runtimeListSessionSections) {
|
|
29831
30338
|
setRuntimeRailSectionsPending(false);
|
|
29832
30339
|
return;
|
|
@@ -29865,20 +30372,30 @@ function useAgentGUIConversationRail({
|
|
|
29865
30372
|
)
|
|
29866
30373
|
);
|
|
29867
30374
|
setRuntimeRailSectionsPending(false);
|
|
29868
|
-
setSectionPageStates(() => {
|
|
30375
|
+
setSectionPageStates((current) => {
|
|
29869
30376
|
const next = /* @__PURE__ */ new Map();
|
|
29870
30377
|
if (page.pinned) {
|
|
30378
|
+
const nextCursor = page.pinned.nextCursor ?? null;
|
|
30379
|
+
const preserved = preserveAdvancedConversationRailPageState(
|
|
30380
|
+
current.get("pinned"),
|
|
30381
|
+
nextCursor
|
|
30382
|
+
);
|
|
29871
30383
|
next.set("pinned", {
|
|
29872
|
-
hasMore: page.pinned.hasMore,
|
|
30384
|
+
hasMore: preserved?.hasMore ?? page.pinned.hasMore,
|
|
29873
30385
|
isLoading: false,
|
|
29874
|
-
nextCursor:
|
|
30386
|
+
nextCursor: preserved?.nextCursor ?? nextCursor
|
|
29875
30387
|
});
|
|
29876
30388
|
}
|
|
29877
30389
|
for (const section of page.sections) {
|
|
30390
|
+
const nextCursor = section.nextCursor ?? null;
|
|
30391
|
+
const preserved = preserveAdvancedConversationRailPageState(
|
|
30392
|
+
current.get(section.sectionKey),
|
|
30393
|
+
nextCursor
|
|
30394
|
+
);
|
|
29878
30395
|
next.set(section.sectionKey, {
|
|
29879
|
-
hasMore: section.hasMore,
|
|
30396
|
+
hasMore: preserved?.hasMore ?? section.hasMore,
|
|
29880
30397
|
isLoading: false,
|
|
29881
|
-
nextCursor:
|
|
30398
|
+
nextCursor: preserved?.nextCursor ?? nextCursor
|
|
29882
30399
|
});
|
|
29883
30400
|
}
|
|
29884
30401
|
return next;
|
|
@@ -29904,7 +30421,7 @@ function useAgentGUIConversationRail({
|
|
|
29904
30421
|
userProjectPathKey,
|
|
29905
30422
|
workspaceId
|
|
29906
30423
|
]);
|
|
29907
|
-
|
|
30424
|
+
useEffect15(() => {
|
|
29908
30425
|
if (!runtimeSectionsEnabled) {
|
|
29909
30426
|
return;
|
|
29910
30427
|
}
|
|
@@ -30145,8 +30662,14 @@ var AgentGUIConversationRailPane = memo2(
|
|
|
30145
30662
|
onOpenProjectFiles,
|
|
30146
30663
|
onOpenConversationWindow,
|
|
30147
30664
|
selectProjectDirectory,
|
|
30665
|
+
pendingDeleteProjectConversations,
|
|
30666
|
+
pendingDeleteConversations,
|
|
30148
30667
|
onRemoveProject,
|
|
30668
|
+
onRequestDeleteProjectConversations,
|
|
30669
|
+
onCancelDeleteProjectConversations,
|
|
30149
30670
|
onConfirmDeleteProjectConversations,
|
|
30671
|
+
onRequestDeleteConversations,
|
|
30672
|
+
onCancelDeleteConversations,
|
|
30150
30673
|
onConfirmDeleteConversations,
|
|
30151
30674
|
onRequestDeleteConversation,
|
|
30152
30675
|
onRequestRenameConversation,
|
|
@@ -30164,6 +30687,7 @@ var AgentGUIConversationRailPane = memo2(
|
|
|
30164
30687
|
/* @__PURE__ */ new Map()
|
|
30165
30688
|
);
|
|
30166
30689
|
const activeConversationScrollCompletedRef = useRef12(null);
|
|
30690
|
+
const activeConversationScrollFrameRef = useRef12(null);
|
|
30167
30691
|
const previousActiveConversationIdRef = useRef12(null);
|
|
30168
30692
|
const groupedConversationsRef = useRef12(null);
|
|
30169
30693
|
const {
|
|
@@ -30182,7 +30706,7 @@ var AgentGUIConversationRailPane = memo2(
|
|
|
30182
30706
|
userProjects,
|
|
30183
30707
|
workspaceId
|
|
30184
30708
|
});
|
|
30185
|
-
|
|
30709
|
+
useEffect15(() => {
|
|
30186
30710
|
const timer = window.setInterval(() => {
|
|
30187
30711
|
setCurrentTimeMs(Date.now());
|
|
30188
30712
|
}, 6e4);
|
|
@@ -30190,11 +30714,11 @@ var AgentGUIConversationRailPane = memo2(
|
|
|
30190
30714
|
window.clearInterval(timer);
|
|
30191
30715
|
};
|
|
30192
30716
|
}, []);
|
|
30193
|
-
const displayConversations =
|
|
30717
|
+
const displayConversations = useMemo10(
|
|
30194
30718
|
() => runtimeSectionsEnabled ? runtimeRailSections?.flatMap((section) => section.items) ?? [] : runtimeRailSections ? runtimeRailSections.flatMap((section) => section.items) : conversations,
|
|
30195
30719
|
[conversations, runtimeRailSections, runtimeSectionsEnabled]
|
|
30196
30720
|
);
|
|
30197
|
-
const filteredConversationResult =
|
|
30721
|
+
const filteredConversationResult = useMemo10(() => {
|
|
30198
30722
|
const startedAtMs = agentGuiPerfNowMs();
|
|
30199
30723
|
const query = conversationQuery.trim().toLowerCase();
|
|
30200
30724
|
const items = !query ? displayConversations : displayConversations.filter(
|
|
@@ -30206,18 +30730,12 @@ var AgentGUIConversationRailPane = memo2(
|
|
|
30206
30730
|
};
|
|
30207
30731
|
}, [conversationQuery, displayConversations, labels, uiLanguage]);
|
|
30208
30732
|
const filteredConversations = filteredConversationResult.items;
|
|
30209
|
-
const groupedConversationResult =
|
|
30733
|
+
const groupedConversationResult = useMemo10(() => {
|
|
30210
30734
|
const startedAtMs = agentGuiPerfNowMs();
|
|
30211
30735
|
const query = conversationQuery.trim();
|
|
30212
|
-
const rawGroups = runtimeSectionsEnabled || runtimeRailSections ? runtimeRailSections ? !query ? runtimeRailSections :
|
|
30213
|
-
|
|
30214
|
-
|
|
30215
|
-
(item) => filteredConversations.some(
|
|
30216
|
-
(conversation) => conversation.id === item.id
|
|
30217
|
-
)
|
|
30218
|
-
)
|
|
30219
|
-
})).filter(
|
|
30220
|
-
(section) => section.kind !== "pinned" || section.items.length > 0
|
|
30736
|
+
const rawGroups = runtimeSectionsEnabled || runtimeRailSections ? runtimeRailSections ? !query ? runtimeRailSections : filterConversationSectionsBySearchMatches(
|
|
30737
|
+
runtimeRailSections,
|
|
30738
|
+
filteredConversations
|
|
30221
30739
|
) : [] : groupConversations(filteredConversations, labels, userProjects, {
|
|
30222
30740
|
includeEmptyConversations: !query
|
|
30223
30741
|
});
|
|
@@ -30250,13 +30768,13 @@ var AgentGUIConversationRailPane = memo2(
|
|
|
30250
30768
|
return next;
|
|
30251
30769
|
});
|
|
30252
30770
|
}, []);
|
|
30253
|
-
const groupedConversationIdentityKey =
|
|
30771
|
+
const groupedConversationIdentityKey = useMemo10(
|
|
30254
30772
|
() => groupedConversations.map(
|
|
30255
30773
|
(section) => `${section.id}:${section.items.map((item) => item.id).join(",")}`
|
|
30256
30774
|
).join("|"),
|
|
30257
30775
|
[groupedConversations]
|
|
30258
30776
|
);
|
|
30259
|
-
const projectConversationCountsByPath =
|
|
30777
|
+
const projectConversationCountsByPath = useMemo10(() => {
|
|
30260
30778
|
const counts = /* @__PURE__ */ new Map();
|
|
30261
30779
|
for (const conversation of displayConversations) {
|
|
30262
30780
|
const normalizedPath = normalizeConversationRailProjectPath(
|
|
@@ -30291,6 +30809,10 @@ var AgentGUIConversationRailPane = memo2(
|
|
|
30291
30809
|
if (!activeId) {
|
|
30292
30810
|
previousActiveConversationIdRef.current = null;
|
|
30293
30811
|
activeConversationScrollCompletedRef.current = null;
|
|
30812
|
+
if (activeConversationScrollFrameRef.current !== null) {
|
|
30813
|
+
window.cancelAnimationFrame(activeConversationScrollFrameRef.current);
|
|
30814
|
+
activeConversationScrollFrameRef.current = null;
|
|
30815
|
+
}
|
|
30294
30816
|
return;
|
|
30295
30817
|
}
|
|
30296
30818
|
if (previousActiveConversationIdRef.current !== activeId) {
|
|
@@ -30304,8 +30826,35 @@ var AgentGUIConversationRailPane = memo2(
|
|
|
30304
30826
|
if (!activeElement) {
|
|
30305
30827
|
return;
|
|
30306
30828
|
}
|
|
30307
|
-
|
|
30308
|
-
|
|
30829
|
+
const viewport = conversationListRef.current ?? railElementRef.current;
|
|
30830
|
+
if (!viewport || isElementFullyVisibleWithin(activeElement, viewport)) {
|
|
30831
|
+
activeConversationScrollCompletedRef.current = activeId;
|
|
30832
|
+
return;
|
|
30833
|
+
}
|
|
30834
|
+
const animationFrameId = window.requestAnimationFrame(() => {
|
|
30835
|
+
activeConversationScrollFrameRef.current = null;
|
|
30836
|
+
if (previousActiveConversationIdRef.current !== activeId) {
|
|
30837
|
+
return;
|
|
30838
|
+
}
|
|
30839
|
+
const nextActiveElement = conversationItemElementsRef.current.get(activeId);
|
|
30840
|
+
if (!nextActiveElement) {
|
|
30841
|
+
return;
|
|
30842
|
+
}
|
|
30843
|
+
const nextViewport = conversationListRef.current ?? railElementRef.current;
|
|
30844
|
+
if (nextViewport && isElementFullyVisibleWithin(nextActiveElement, nextViewport)) {
|
|
30845
|
+
activeConversationScrollCompletedRef.current = activeId;
|
|
30846
|
+
return;
|
|
30847
|
+
}
|
|
30848
|
+
nextActiveElement.scrollIntoView({ block: "nearest" });
|
|
30849
|
+
activeConversationScrollCompletedRef.current = activeId;
|
|
30850
|
+
});
|
|
30851
|
+
activeConversationScrollFrameRef.current = animationFrameId;
|
|
30852
|
+
return () => {
|
|
30853
|
+
if (activeConversationScrollFrameRef.current === animationFrameId) {
|
|
30854
|
+
window.cancelAnimationFrame(animationFrameId);
|
|
30855
|
+
activeConversationScrollFrameRef.current = null;
|
|
30856
|
+
}
|
|
30857
|
+
};
|
|
30309
30858
|
}, [activeConversationId, groupedConversationIdentityKey]);
|
|
30310
30859
|
return /* @__PURE__ */ jsxs21(
|
|
30311
30860
|
"aside",
|
|
@@ -30407,6 +30956,8 @@ var AgentGUIConversationRailPane = memo2(
|
|
|
30407
30956
|
onConfirmDeleteConversation,
|
|
30408
30957
|
onCreateConversation,
|
|
30409
30958
|
onLoadMoreConversations: loadMoreSectionConversations,
|
|
30959
|
+
onRequestDeleteProjectConversations,
|
|
30960
|
+
onRequestDeleteConversations,
|
|
30410
30961
|
onRequestDeleteConversation,
|
|
30411
30962
|
onRequestRenameConversation,
|
|
30412
30963
|
onSelectConversation,
|
|
@@ -30428,29 +30979,34 @@ var AgentGUIConversationRailPane = memo2(
|
|
|
30428
30979
|
{
|
|
30429
30980
|
cancelLabel: labels.cancel,
|
|
30430
30981
|
className: AGENT_GUI_CONFIRMATION_DIALOG_CLASS_NAME,
|
|
30431
|
-
confirmBusy:
|
|
30432
|
-
|
|
30433
|
-
|
|
30434
|
-
|
|
30435
|
-
|
|
30436
|
-
|
|
30437
|
-
|
|
30982
|
+
confirmBusy: pendingDeleteProjectConversations?.conversationCount === null || pendingDeleteConversations?.conversationCount === null || (pendingDeleteProjectConversations !== null || pendingDeleteConversations !== null) && isDeletingProjectConversations,
|
|
30983
|
+
confirmDisabled: pendingDeleteProjectConversations?.conversationCount === null || pendingDeleteConversations?.conversationCount === null,
|
|
30984
|
+
confirmLabel: pendingDeleteProjectConversations ? labels.batchDeleteProjectSessionsConfirm : pendingDeleteConversations ? labels.batchDeleteConversationsConfirm : labels.removeProject,
|
|
30985
|
+
description: pendingDeleteProjectConversations ? pendingDeleteProjectConversations.conversationCount === null ? labels.loadingConversations : labels.batchDeleteProjectSessionsBody(
|
|
30986
|
+
pendingDeleteProjectConversations.conversationCount,
|
|
30987
|
+
pendingDeleteProjectConversations.label
|
|
30988
|
+
) : pendingDeleteConversations ? pendingDeleteConversations.conversationCount === null ? labels.loadingConversations : labels.batchDeleteConversationsBody(
|
|
30989
|
+
pendingDeleteConversations.conversationCount
|
|
30438
30990
|
) : pendingProjectAction ? labels.removeProjectConfirmDescription(
|
|
30439
30991
|
pendingProjectAction.label
|
|
30440
30992
|
) : void 0,
|
|
30441
|
-
onCancel: () =>
|
|
30442
|
-
onConfirm: () => {
|
|
30443
|
-
const action = pendingProjectAction;
|
|
30993
|
+
onCancel: () => {
|
|
30444
30994
|
setPendingProjectAction(null);
|
|
30445
|
-
|
|
30995
|
+
onCancelDeleteProjectConversations();
|
|
30996
|
+
onCancelDeleteConversations();
|
|
30997
|
+
},
|
|
30998
|
+
onConfirm: () => {
|
|
30999
|
+
if (pendingDeleteProjectConversations) {
|
|
31000
|
+
onConfirmDeleteProjectConversations();
|
|
30446
31001
|
return;
|
|
30447
31002
|
}
|
|
30448
|
-
if (
|
|
30449
|
-
|
|
31003
|
+
if (pendingDeleteConversations) {
|
|
31004
|
+
onConfirmDeleteConversations();
|
|
30450
31005
|
return;
|
|
30451
31006
|
}
|
|
30452
|
-
|
|
30453
|
-
|
|
31007
|
+
const action = pendingProjectAction;
|
|
31008
|
+
setPendingProjectAction(null);
|
|
31009
|
+
if (!action) {
|
|
30454
31010
|
return;
|
|
30455
31011
|
}
|
|
30456
31012
|
onRemoveProject(action.path);
|
|
@@ -30458,11 +31014,13 @@ var AgentGUIConversationRailPane = memo2(
|
|
|
30458
31014
|
onOpenChange: (open) => {
|
|
30459
31015
|
if (!open) {
|
|
30460
31016
|
setPendingProjectAction(null);
|
|
31017
|
+
onCancelDeleteProjectConversations();
|
|
31018
|
+
onCancelDeleteConversations();
|
|
30461
31019
|
}
|
|
30462
31020
|
},
|
|
30463
|
-
open: pendingProjectAction !== null,
|
|
31021
|
+
open: pendingDeleteProjectConversations !== null || pendingDeleteConversations !== null || pendingProjectAction !== null,
|
|
30464
31022
|
overlayClassName: AGENT_GUI_CONFIRMATION_DIALOG_OVERLAY_CLASS_NAME,
|
|
30465
|
-
title:
|
|
31023
|
+
title: pendingDeleteProjectConversations ? labels.batchDeleteProjectSessionsTitle : pendingDeleteConversations ? labels.batchDeleteConversationsTitle : labels.removeProjectConfirmTitle,
|
|
30466
31024
|
tone: "destructive"
|
|
30467
31025
|
}
|
|
30468
31026
|
)
|
|
@@ -30499,6 +31057,8 @@ var AgentGUIConversationRailSection = memo2(
|
|
|
30499
31057
|
onMarkConversationUnread,
|
|
30500
31058
|
onOpenProjectFiles,
|
|
30501
31059
|
onOpenConversationWindow,
|
|
31060
|
+
onRequestDeleteProjectConversations,
|
|
31061
|
+
onRequestDeleteConversations,
|
|
30502
31062
|
onRequestDeleteConversation,
|
|
30503
31063
|
onRequestRenameConversation,
|
|
30504
31064
|
onCancelDeleteConversation,
|
|
@@ -30510,7 +31070,7 @@ var AgentGUIConversationRailSection = memo2(
|
|
|
30510
31070
|
AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE
|
|
30511
31071
|
);
|
|
30512
31072
|
const visibleItemCount = isSectionCollapsed ? 0 : Math.min(visibleItemLimit, section.items.length);
|
|
30513
|
-
const visibleItems =
|
|
31073
|
+
const visibleItems = useMemo10(() => {
|
|
30514
31074
|
if (isSectionCollapsed) {
|
|
30515
31075
|
return [];
|
|
30516
31076
|
}
|
|
@@ -30717,13 +31277,7 @@ var AgentGUIConversationRailSection = memo2(
|
|
|
30717
31277
|
{
|
|
30718
31278
|
className: `${AgentGUINode_styles_default.composerMenuItem} nodrag [-webkit-app-region:no-drag]`,
|
|
30719
31279
|
onSelect: () => {
|
|
30720
|
-
|
|
30721
|
-
setPendingProjectAction({
|
|
30722
|
-
kind: "batch-delete",
|
|
30723
|
-
conversationCount: projectConversationCount,
|
|
30724
|
-
label,
|
|
30725
|
-
path: projectPath
|
|
30726
|
-
});
|
|
31280
|
+
onRequestDeleteProjectConversations(projectPath);
|
|
30727
31281
|
},
|
|
30728
31282
|
children: /* @__PURE__ */ jsx34("span", { children: labels.batchDeleteProjectSessions })
|
|
30729
31283
|
}
|
|
@@ -30799,12 +31353,7 @@ var AgentGUIConversationRailSection = memo2(
|
|
|
30799
31353
|
{
|
|
30800
31354
|
className: `${AgentGUINode_styles_default.composerMenuItem} nodrag [-webkit-app-region:no-drag]`,
|
|
30801
31355
|
onSelect: () => {
|
|
30802
|
-
|
|
30803
|
-
kind: "batch-delete-conversations",
|
|
30804
|
-
conversationCount: section.items.length,
|
|
30805
|
-
label: section.label,
|
|
30806
|
-
sessionIds: section.items.map((item) => item.id)
|
|
30807
|
-
});
|
|
31356
|
+
onRequestDeleteConversations();
|
|
30808
31357
|
},
|
|
30809
31358
|
children: /* @__PURE__ */ jsx34("span", { children: labels.batchDeleteConversations })
|
|
30810
31359
|
}
|
|
@@ -30936,8 +31485,8 @@ var AgentGUIConversationRailItem = memo2(
|
|
|
30936
31485
|
onRequestDeleteConversation(item.id);
|
|
30937
31486
|
}, [item.id, onRequestDeleteConversation]);
|
|
30938
31487
|
const handleRequestRename = useCallback10(() => {
|
|
30939
|
-
onRequestRenameConversation(item
|
|
30940
|
-
}, [item
|
|
31488
|
+
onRequestRenameConversation(item);
|
|
31489
|
+
}, [item, onRequestRenameConversation]);
|
|
30941
31490
|
const handleContextMenuRename = useCallback10(() => {
|
|
30942
31491
|
if (contextMenuRenameRequestedRef.current) {
|
|
30943
31492
|
return;
|
|
@@ -31176,7 +31725,7 @@ function AgentGUIProjectRailHeader({
|
|
|
31176
31725
|
}) {
|
|
31177
31726
|
"use memo";
|
|
31178
31727
|
const agentHostApi = useAgentHostApi();
|
|
31179
|
-
const userProjectApi =
|
|
31728
|
+
const userProjectApi = useMemo10(
|
|
31180
31729
|
() => agentHostApi.userProjects ? {
|
|
31181
31730
|
...agentHostApi.userProjects,
|
|
31182
31731
|
selectDirectory: selectProjectDirectory ?? agentHostApi.workspace.selectDirectory
|
|
@@ -31478,7 +32027,7 @@ function appendDockProbeUsageLines(probe, lines, isLoadingUsage, t) {
|
|
|
31478
32027
|
import { Info as Info3 } from "lucide-react";
|
|
31479
32028
|
import {
|
|
31480
32029
|
useCallback as useCallback11,
|
|
31481
|
-
useEffect as
|
|
32030
|
+
useEffect as useEffect16,
|
|
31482
32031
|
useLayoutEffect as useLayoutEffect5,
|
|
31483
32032
|
useRef as useRef13,
|
|
31484
32033
|
useState as useState15
|
|
@@ -31561,7 +32110,7 @@ function AgentProbeInfoPopover({
|
|
|
31561
32110
|
maxWidth: availableWidth
|
|
31562
32111
|
});
|
|
31563
32112
|
}, []);
|
|
31564
|
-
|
|
32113
|
+
useEffect16(() => {
|
|
31565
32114
|
if (!isOpen) {
|
|
31566
32115
|
return;
|
|
31567
32116
|
}
|
|
@@ -31707,7 +32256,7 @@ var AGENT_HOST_MANAGED_TOOLCHAIN_AGENTS = [
|
|
|
31707
32256
|
{
|
|
31708
32257
|
id: "opencode",
|
|
31709
32258
|
// i18n-check-ignore: Provider brand name.
|
|
31710
|
-
label: "
|
|
32259
|
+
label: "Open Code",
|
|
31711
32260
|
toolIds: ["opencode-cli"],
|
|
31712
32261
|
agentIds: ["opencode"],
|
|
31713
32262
|
runtimeManaged: true,
|
|
@@ -32137,11 +32686,11 @@ var AgentGUINode = memo3(function AgentGUINode2({
|
|
|
32137
32686
|
}) {
|
|
32138
32687
|
"use memo";
|
|
32139
32688
|
const { i18n, locale, t } = useTranslation();
|
|
32140
|
-
const workspaceUserProjectI18n =
|
|
32689
|
+
const workspaceUserProjectI18n = useMemo11(
|
|
32141
32690
|
() => createWorkspaceUserProjectI18nRuntime(i18n),
|
|
32142
32691
|
[i18n]
|
|
32143
32692
|
);
|
|
32144
|
-
const workspaceFileManagerI18n =
|
|
32693
|
+
const workspaceFileManagerI18n = useMemo11(
|
|
32145
32694
|
() => typeof i18n?.t === "function" ? createWorkspaceFileManagerI18nRuntime(i18n) : null,
|
|
32146
32695
|
[i18n]
|
|
32147
32696
|
);
|
|
@@ -32206,7 +32755,7 @@ var AgentGUINode = memo3(function AgentGUINode2({
|
|
|
32206
32755
|
const isConversationRailManuallyCollapsed = state.conversationRailCollapsed === true;
|
|
32207
32756
|
const isConversationRailAutoCollapsed = shouldAutoCollapseAgentGUIConversationRail(width);
|
|
32208
32757
|
const isConversationRailCollapsed = isConversationRailManuallyCollapsed || isConversationRailAutoCollapsed;
|
|
32209
|
-
const minSize =
|
|
32758
|
+
const minSize = useMemo11(
|
|
32210
32759
|
() => ({
|
|
32211
32760
|
...resolveCanonicalNodeMinSize("agentGui"),
|
|
32212
32761
|
width: AGENT_GUI_COLLAPSED_MIN_WIDTH_PX
|
|
@@ -32295,7 +32844,7 @@ var AgentGUINode = memo3(function AgentGUINode2({
|
|
|
32295
32844
|
},
|
|
32296
32845
|
[actions, onUpdateNode, previewMode]
|
|
32297
32846
|
);
|
|
32298
|
-
const viewActions =
|
|
32847
|
+
const viewActions = useMemo11(
|
|
32299
32848
|
() => ({
|
|
32300
32849
|
...actions,
|
|
32301
32850
|
createConversation: handleCreateConversation
|
|
@@ -32308,7 +32857,7 @@ var AgentGUINode = memo3(function AgentGUINode2({
|
|
|
32308
32857
|
const selectedProviderTargetLabel = viewModel.selectedProviderTarget?.label ?? resolveAgentGUIProviderDisplayLabel(state.provider, fallbackAgentTitle);
|
|
32309
32858
|
const displayProviderLabel = viewModel.activeConversation ? resolveAgentGUIProviderDisplayLabel(activeProvider, fallbackAgentTitle) : selectedProviderTargetLabel;
|
|
32310
32859
|
const activeConversationDockTitle = viewModel.activeConversation ? resolveAgentGUIDockConversationTitle(viewModel.activeConversation) : null;
|
|
32311
|
-
|
|
32860
|
+
useEffect17(() => {
|
|
32312
32861
|
if (previewMode || !viewModel.activeConversation) {
|
|
32313
32862
|
return;
|
|
32314
32863
|
}
|
|
@@ -32338,7 +32887,7 @@ var AgentGUINode = memo3(function AgentGUINode2({
|
|
|
32338
32887
|
state.lastActiveConversationTitle,
|
|
32339
32888
|
viewModel.activeConversation
|
|
32340
32889
|
]);
|
|
32341
|
-
const labels =
|
|
32890
|
+
const labels = useMemo11(
|
|
32342
32891
|
() => ({
|
|
32343
32892
|
initialPlaceholder: t("agentHost.agentGui.initialPlaceholder", {
|
|
32344
32893
|
provider: displayProviderLabel
|
|
@@ -32937,7 +33486,7 @@ var AgentGUINode = memo3(function AgentGUINode2({
|
|
|
32937
33486
|
workspaceAppIcons
|
|
32938
33487
|
]
|
|
32939
33488
|
);
|
|
32940
|
-
const workspaceFileReferenceCopy =
|
|
33489
|
+
const workspaceFileReferenceCopy = useMemo11(
|
|
32941
33490
|
() => ({
|
|
32942
33491
|
t(key, values) {
|
|
32943
33492
|
const localeKey = workspaceFileReferenceLocaleKeyByPickerKey[key];
|
|
@@ -32948,28 +33497,28 @@ var AgentGUINode = memo3(function AgentGUINode2({
|
|
|
32948
33497
|
);
|
|
32949
33498
|
const windowTitle = title;
|
|
32950
33499
|
const activeProbeProvider = activeProvider;
|
|
32951
|
-
const railStatusProvider =
|
|
33500
|
+
const railStatusProvider = useMemo11(
|
|
32952
33501
|
() => resolveAgentGUIRailStatusProvider({
|
|
32953
33502
|
conversationFilter: viewModel.conversationFilter,
|
|
32954
33503
|
providerTargets: viewModel.providerTargets
|
|
32955
33504
|
}),
|
|
32956
33505
|
[viewModel.conversationFilter, viewModel.providerTargets]
|
|
32957
33506
|
);
|
|
32958
|
-
const activeAgentProbe =
|
|
33507
|
+
const activeAgentProbe = useMemo11(
|
|
32959
33508
|
() => findWorkspaceAgentProbeForDockProvider(
|
|
32960
33509
|
workspaceAgentProbes?.snapshot ?? null,
|
|
32961
33510
|
activeProbeProvider
|
|
32962
33511
|
),
|
|
32963
33512
|
[activeProbeProvider, workspaceAgentProbes?.snapshot]
|
|
32964
33513
|
);
|
|
32965
|
-
const railAgentProbe =
|
|
33514
|
+
const railAgentProbe = useMemo11(
|
|
32966
33515
|
() => railStatusProvider ? findWorkspaceAgentProbeForDockProvider(
|
|
32967
33516
|
workspaceAgentProbes?.snapshot ?? null,
|
|
32968
33517
|
railStatusProvider
|
|
32969
33518
|
) : null,
|
|
32970
33519
|
[railStatusProvider, workspaceAgentProbes?.snapshot]
|
|
32971
33520
|
);
|
|
32972
|
-
const isActiveAgentProviderReady =
|
|
33521
|
+
const isActiveAgentProviderReady = useMemo11(() => {
|
|
32973
33522
|
const managedAgent = getAgentHostManagedToolchainAgentByName(
|
|
32974
33523
|
activeReadinessProvider
|
|
32975
33524
|
);
|
|
@@ -32984,14 +33533,14 @@ var AgentGUINode = memo3(function AgentGUINode2({
|
|
|
32984
33533
|
managedAgentsState
|
|
32985
33534
|
) === "installed";
|
|
32986
33535
|
}, [activeReadinessProvider, managedAgentsState]);
|
|
32987
|
-
const runtimeSlashStatusQuotas =
|
|
33536
|
+
const runtimeSlashStatusQuotas = useMemo11(
|
|
32988
33537
|
() => slashStatusQuotasFromRuntimeUsage(
|
|
32989
33538
|
viewModel.sessionChrome.rawState?.runtimeContext?.usage
|
|
32990
33539
|
),
|
|
32991
33540
|
[viewModel.sessionChrome.rawState?.runtimeContext?.usage]
|
|
32992
33541
|
);
|
|
32993
33542
|
const slashStatusQuotaSource = activeAgentProbe?.usage?.quotas && activeAgentProbe.usage.quotas.length > 0 ? activeAgentProbe.usage.quotas : runtimeSlashStatusQuotas;
|
|
32994
|
-
const slashStatusLimits =
|
|
33543
|
+
const slashStatusLimits = useMemo11(
|
|
32995
33544
|
() => slashStatusLimitsFromQuotas(
|
|
32996
33545
|
slashStatusQuotaSource,
|
|
32997
33546
|
viewModel.composerSettings.selectedModelValue ?? viewModel.composerSettings.draftSettings.model,
|
|
@@ -33005,7 +33554,7 @@ var AgentGUINode = memo3(function AgentGUINode2({
|
|
|
33005
33554
|
]
|
|
33006
33555
|
);
|
|
33007
33556
|
const railSlashStatusQuotaSource = railStatusProvider && railAgentProbe?.usage?.quotas && railAgentProbe.usage.quotas.length > 0 ? railAgentProbe.usage.quotas : [];
|
|
33008
|
-
const railSlashStatusLimits =
|
|
33557
|
+
const railSlashStatusLimits = useMemo11(
|
|
33009
33558
|
() => slashStatusLimitsFromQuotas(railSlashStatusQuotaSource, null, t),
|
|
33010
33559
|
[railSlashStatusQuotaSource, t]
|
|
33011
33560
|
);
|
|
@@ -33013,7 +33562,7 @@ var AgentGUINode = memo3(function AgentGUINode2({
|
|
|
33013
33562
|
const slashStatusUsageCapturedAtUnixMs = slashStatusUsageProbe?.usage?.capturedAtUnixMs ?? null;
|
|
33014
33563
|
const slashStatusUsageDidFail = workspaceAgentProbes?.usageLoadFailed ?? false;
|
|
33015
33564
|
const slashStatusUsageAttempted = Boolean(slashStatusUsageProbe?.usage) || Boolean(slashStatusUsageProbe?.lastError);
|
|
33016
|
-
const agentProbeLines =
|
|
33565
|
+
const agentProbeLines = useMemo11(() => {
|
|
33017
33566
|
return buildDockAgentProbeTooltipLines(
|
|
33018
33567
|
activeAgentProbe,
|
|
33019
33568
|
workspaceAgentProbes?.isLoadingAvailability ?? false,
|
|
@@ -33029,7 +33578,7 @@ var AgentGUINode = memo3(function AgentGUINode2({
|
|
|
33029
33578
|
workspaceAgentProbes?.isLoadingUsage,
|
|
33030
33579
|
t
|
|
33031
33580
|
]);
|
|
33032
|
-
|
|
33581
|
+
useEffect17(() => {
|
|
33033
33582
|
if (previewMode || !onAgentProbeDemandChange) {
|
|
33034
33583
|
return;
|
|
33035
33584
|
}
|
|
@@ -33039,7 +33588,7 @@ var AgentGUINode = memo3(function AgentGUINode2({
|
|
|
33039
33588
|
onAgentProbeDemandChange(null, probeSourceId);
|
|
33040
33589
|
};
|
|
33041
33590
|
}, [activeProbeProvider, nodeId, onAgentProbeDemandChange, previewMode]);
|
|
33042
|
-
|
|
33591
|
+
useEffect17(() => {
|
|
33043
33592
|
if (previewMode || !onAgentProbeDemandChange || !railStatusProvider || railStatusProvider === activeProbeProvider) {
|
|
33044
33593
|
return;
|
|
33045
33594
|
}
|
|
@@ -33251,6 +33800,7 @@ export {
|
|
|
33251
33800
|
AgentGUI,
|
|
33252
33801
|
AgentGuiI18nProvider,
|
|
33253
33802
|
AgentQueuedPromptRuntimeProvider,
|
|
33803
|
+
agentActivityRuntimeCapabilityEnabled,
|
|
33254
33804
|
agentGUIDefaultTargetProviders,
|
|
33255
33805
|
agentGuiDockIconUrl,
|
|
33256
33806
|
agentGuiDockIconUrls,
|