@tutti-os/agent-gui 0.0.104 → 0.0.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AgentGUI-DQ9gVoXh.d.ts → AgentGUI-Do6py-T_.d.ts} +10 -5
- package/dist/AgentRichTextReadonly-F6PHC5SX.js +18 -0
- package/dist/AgentRichTextReadonly-F6PHC5SX.js.map +1 -0
- package/dist/agent-conversation/index.d.ts +3 -3
- package/dist/agent-conversation/index.js +11 -7
- package/dist/agent-conversation/index.js.map +1 -1
- package/dist/agent-gui.d.ts +4 -4
- package/dist/agent-gui.js +18 -14
- package/dist/agent-message-center/index.d.ts +1 -1
- package/dist/agent-message-center/index.js +13 -9
- package/dist/agent-message-center/index.js.map +1 -1
- package/dist/{agentConversationVM-CkcYM5Wg.d.ts → agentConversationVM-Bf3Zv3iI.d.ts} +9 -1
- package/dist/{agentFileMentionContracts-58IjMU-u.d.ts → agentFileMentionContracts-B70VnPWO.d.ts} +2 -0
- package/dist/{agentGuiNodeTypes-B9vcvjmR.d.ts → agentGuiNodeTypes-DbgQBiYz.d.ts} +4 -1
- package/dist/app/renderer/agentactivity.css +99 -0
- package/dist/{chunk-FJ4W2VC5.js → chunk-4ZWV57MF.js} +42 -10
- package/dist/chunk-4ZWV57MF.js.map +1 -0
- package/dist/{chunk-VAB7EIL5.js → chunk-6R7GHXRQ.js} +12 -6
- package/dist/chunk-6R7GHXRQ.js.map +1 -0
- package/dist/{chunk-TPV2SV6L.js → chunk-7MPN2JGL.js} +122 -154
- package/dist/chunk-7MPN2JGL.js.map +1 -0
- package/dist/{chunk-5X7YDOC6.js → chunk-D2JUDUYY.js} +1 -1
- package/dist/chunk-D2JUDUYY.js.map +1 -0
- package/dist/{chunk-HLVC4NNL.js → chunk-IR2CL2X2.js} +721 -1280
- package/dist/chunk-IR2CL2X2.js.map +1 -0
- package/dist/{chunk-NOXQOGT5.js → chunk-J2HG7UCP.js} +46 -22
- package/dist/chunk-J2HG7UCP.js.map +1 -0
- package/dist/{chunk-747L443E.js → chunk-JG7HGKZL.js} +595 -61
- package/dist/chunk-JG7HGKZL.js.map +1 -0
- package/dist/chunk-KPMQGPYU.js +43 -0
- package/dist/chunk-KPMQGPYU.js.map +1 -0
- package/dist/{chunk-OFSDOID4.js → chunk-LDZ6C3YV.js} +3 -39
- package/dist/chunk-LDZ6C3YV.js.map +1 -0
- package/dist/{chunk-7N524ZK7.js → chunk-N3HTEYLZ.js} +1308 -936
- package/dist/chunk-N3HTEYLZ.js.map +1 -0
- package/dist/{chunk-MUPZPISC.js → chunk-N4WVVCNI.js} +2 -2
- package/dist/{chunk-F5LFPORI.js → chunk-OWW7CU4U.js} +2 -2
- package/dist/chunk-SN6UYX54.js +42 -0
- package/dist/chunk-SN6UYX54.js.map +1 -0
- package/dist/{chunk-SKCLZXSW.js → chunk-TKBEVCHG.js} +5 -1
- package/dist/chunk-TKBEVCHG.js.map +1 -0
- package/dist/chunk-UFIEUC3Y.js +755 -0
- package/dist/chunk-UFIEUC3Y.js.map +1 -0
- package/dist/{chunk-AKKDP2LI.js → chunk-V5ROOS2O.js} +124 -2
- package/dist/chunk-V5ROOS2O.js.map +1 -0
- package/dist/chunk-XJ34OIEQ.js +18 -0
- package/dist/chunk-XJ34OIEQ.js.map +1 -0
- package/dist/{chunk-QI3JAO4J.js → chunk-ZSJBCZUH.js} +54 -7
- package/dist/chunk-ZSJBCZUH.js.map +1 -0
- package/dist/context-mention-palette/index.d.ts +1 -1
- package/dist/context-mention-palette/index.js +10 -8
- package/dist/{contribution-CTVBPN0R.d.ts → contribution-C6K5YfJ7.d.ts} +1 -0
- package/dist/custom-mention.d.ts +6 -0
- package/dist/custom-mention.js +1 -1
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +6 -6
- package/dist/index.js +18 -14
- package/dist/index.js.map +1 -1
- package/dist/mention-search.d.ts +42 -6
- package/dist/mention-search.js +8 -6
- package/dist/workbench/contribution.d.ts +1 -1
- package/dist/workbench/contribution.js +3 -3
- package/dist/workbench/index.d.ts +3 -2
- package/dist/workbench/index.js +3 -3
- package/dist/workbench/sessionTitle.js +2 -2
- package/package.json +12 -12
- package/dist/chunk-5X7YDOC6.js.map +0 -1
- package/dist/chunk-747L443E.js.map +0 -1
- package/dist/chunk-7N524ZK7.js.map +0 -1
- package/dist/chunk-AKKDP2LI.js.map +0 -1
- package/dist/chunk-FJ4W2VC5.js.map +0 -1
- package/dist/chunk-HLVC4NNL.js.map +0 -1
- package/dist/chunk-NOXQOGT5.js.map +0 -1
- package/dist/chunk-OFSDOID4.js.map +0 -1
- package/dist/chunk-QI3JAO4J.js.map +0 -1
- package/dist/chunk-SKCLZXSW.js.map +0 -1
- package/dist/chunk-TPV2SV6L.js.map +0 -1
- package/dist/chunk-VAB7EIL5.js.map +0 -1
- /package/dist/{chunk-MUPZPISC.js.map → chunk-N4WVVCNI.js.map} +0 -0
- /package/dist/{chunk-F5LFPORI.js.map → chunk-OWW7CU4U.js.map} +0 -0
|
@@ -9,19 +9,23 @@ import {
|
|
|
9
9
|
resolveAgentGuiSessionProviderFlatIconUrl,
|
|
10
10
|
resolveNextAgentGUIConversationRailWidthPx,
|
|
11
11
|
shouldAutoCollapseAgentGUIConversationRail
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZSJBCZUH.js";
|
|
13
13
|
import {
|
|
14
14
|
AGENT_PROVIDERS,
|
|
15
15
|
AGENT_PROVIDER_LABEL,
|
|
16
16
|
deriveAgentGUIOptimisticConversationTitle,
|
|
17
17
|
isAgentGUIProviderUnresolved,
|
|
18
18
|
normalizeAgentGUIProviderIdentity,
|
|
19
|
+
resolveAgentGUIConversationBrowserFreeTitle,
|
|
19
20
|
resolveAgentGUIConversationDisplayTitle,
|
|
20
21
|
resolveAgentGUIConversationTitle,
|
|
22
|
+
resolveAgentGUIConversationTitleDisplayPrompt,
|
|
23
|
+
resolveAgentGUIConversationTitleLeadingMentionKind,
|
|
21
24
|
resolveAgentGUIExplicitConversationTitle,
|
|
25
|
+
resolveAgentGUIFirstUserMessageDisplayPrompt,
|
|
22
26
|
resolveAgentGUIProviderDisplayLabel,
|
|
23
27
|
resolveAgentGUIProviderIdentity
|
|
24
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-V5ROOS2O.js";
|
|
25
29
|
import {
|
|
26
30
|
resolveAgentGuiWorkbenchProviderLabel
|
|
27
31
|
} from "./chunk-L3GMMGRS.js";
|
|
@@ -30,48 +34,50 @@ import {
|
|
|
30
34
|
Button,
|
|
31
35
|
MAX_AGENT_COMPOSER_DRAFT_IMAGES,
|
|
32
36
|
agentComposerDraftAttachmentProjection,
|
|
33
|
-
agentComposerDraftDisplayPrompt,
|
|
34
37
|
agentComposerDraftFiles,
|
|
35
38
|
agentComposerDraftHasContent,
|
|
36
39
|
agentComposerDraftImages,
|
|
37
40
|
agentComposerDraftLargeTexts,
|
|
38
41
|
agentComposerDraftPrompt,
|
|
39
|
-
agentComposerDraftToPromptContent,
|
|
40
42
|
agentPromptContentDisplayText,
|
|
41
43
|
agentPromptContentHasImage,
|
|
42
44
|
agentPromptContentImageBlocks,
|
|
43
45
|
agentPromptContentToComposerDraft,
|
|
44
|
-
agentRichTextContentToPromptText,
|
|
45
46
|
buildAgentComposerDraft,
|
|
46
47
|
buildWorkspaceAgentSessionDetailViewModel,
|
|
47
|
-
createAgentRichTextInputExtensions,
|
|
48
|
-
editorToPromptText,
|
|
49
48
|
emptyAgentComposerDraft,
|
|
50
49
|
getAppErrorCode,
|
|
51
50
|
isWorkspaceAgentToolCallItem,
|
|
52
|
-
labelForProviderSkill,
|
|
53
51
|
materializePastedTextInstructions,
|
|
54
52
|
normalizeAgentPromptContentBlocks,
|
|
55
53
|
pastedTextPreview,
|
|
56
|
-
|
|
57
|
-
plainTextToAgentRichTextInlineContent,
|
|
54
|
+
projectAgentComposerDraftSubmission,
|
|
58
55
|
projectAgentConversationVM,
|
|
56
|
+
resolveWorkspaceAgentNoticeCommandSemantics,
|
|
59
57
|
resolveWorkspaceAgentToolName,
|
|
60
|
-
skillDescriptionForDisplay,
|
|
61
|
-
skillTriggerForPrefix,
|
|
62
58
|
snapshotAgentComposerDraft,
|
|
63
59
|
textPromptContent,
|
|
64
60
|
toLocalShortDateTime,
|
|
65
61
|
updateAgentComposerDraft,
|
|
66
62
|
useProjectedAgentConversation
|
|
67
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-IR2CL2X2.js";
|
|
64
|
+
import {
|
|
65
|
+
agentRichTextContentToPromptText,
|
|
66
|
+
createAgentRichTextInputExtensions,
|
|
67
|
+
editorToPromptText,
|
|
68
|
+
labelForProviderSkill,
|
|
69
|
+
plainTextToAgentRichTextDoc,
|
|
70
|
+
plainTextToAgentRichTextInlineContent,
|
|
71
|
+
skillDescriptionForDisplay,
|
|
72
|
+
skillTriggerForPrefix
|
|
73
|
+
} from "./chunk-UFIEUC3Y.js";
|
|
68
74
|
import {
|
|
69
75
|
openAgentEnvPanel
|
|
70
76
|
} from "./chunk-7BXWPI4F.js";
|
|
71
77
|
import {
|
|
72
78
|
AgentFileMentionPalette,
|
|
73
79
|
agentMentionItemKey
|
|
74
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-6R7GHXRQ.js";
|
|
75
81
|
import {
|
|
76
82
|
normalizeAgentGUIAgents,
|
|
77
83
|
projectAgentGUIAgentsToInternalTargets
|
|
@@ -82,17 +88,18 @@ import {
|
|
|
82
88
|
DEFAULT_AGENT_MENTION_FILTER,
|
|
83
89
|
agentGuiScheduler,
|
|
84
90
|
buildWorkspaceAgentActivityListViewModel
|
|
85
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-JG7HGKZL.js";
|
|
86
92
|
import {
|
|
87
93
|
AGENT_RICH_TEXT_CARET_ANCHOR,
|
|
88
94
|
createAgentSessionMarkdownLink,
|
|
89
95
|
createAgentSessionMentionHref,
|
|
90
96
|
exitAgentFileMentionSuggestion,
|
|
91
97
|
formatAgentMentionMarkdown,
|
|
98
|
+
materializeAgentCustomMentionPromptText,
|
|
92
99
|
mentionItemToAttrs,
|
|
93
100
|
normalizeAgentSessionMentionTitle,
|
|
94
101
|
parseMentionItemFromHref
|
|
95
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-J2HG7UCP.js";
|
|
96
103
|
import {
|
|
97
104
|
AgentInteractivePromptSurface,
|
|
98
105
|
PLAN_IMPLEMENTATION_ACTION_FEEDBACK,
|
|
@@ -102,34 +109,38 @@ import {
|
|
|
102
109
|
dispatchAgentPlanPromptAction,
|
|
103
110
|
latestPlanTurnId,
|
|
104
111
|
planImplementationPromptFromPlanTurn
|
|
105
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-4ZWV57MF.js";
|
|
106
113
|
import {
|
|
107
114
|
useEngineSelector
|
|
108
115
|
} from "./chunk-2RQM7PJN.js";
|
|
109
116
|
import {
|
|
110
117
|
AgentMessageMarkdown,
|
|
111
|
-
AgentTargetPresentationProvider,
|
|
112
118
|
ZoomableImage,
|
|
119
|
+
resolveWorkspaceLinkAction
|
|
120
|
+
} from "./chunk-7MPN2JGL.js";
|
|
121
|
+
import {
|
|
122
|
+
AgentTargetPresentationProvider,
|
|
113
123
|
cn,
|
|
114
124
|
resolveAgentTargetPresentation,
|
|
115
|
-
resolveWorkspaceLinkAction,
|
|
116
125
|
useAgentTargetPresentations
|
|
117
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-KPMQGPYU.js";
|
|
118
127
|
import {
|
|
119
128
|
resolveWorkspaceAgentSessionSortTimeUnixMs
|
|
120
129
|
} from "./chunk-YMXYBG7U.js";
|
|
121
130
|
import {
|
|
122
131
|
AgentActivityHostProvider,
|
|
123
|
-
MANAGED_AGENT_ICON_FALLBACK_URL,
|
|
124
|
-
MANAGED_AGENT_ICON_URLS,
|
|
125
|
-
MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS,
|
|
126
132
|
getOptionalAgentHostApi,
|
|
127
133
|
useAgentActivityRuntime,
|
|
128
134
|
useAgentActivitySnapshot,
|
|
129
135
|
useAgentHostApi,
|
|
130
136
|
useOptionalAgentActivityRuntime,
|
|
131
137
|
useOptionalAgentHostApi
|
|
132
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-LDZ6C3YV.js";
|
|
139
|
+
import {
|
|
140
|
+
MANAGED_AGENT_ICON_FALLBACK_URL,
|
|
141
|
+
MANAGED_AGENT_ICON_URLS,
|
|
142
|
+
MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS
|
|
143
|
+
} from "./chunk-SN6UYX54.js";
|
|
133
144
|
import {
|
|
134
145
|
normalizeManagedAgentProvider
|
|
135
146
|
} from "./chunk-H6IQ63DQ.js";
|
|
@@ -137,7 +148,7 @@ import {
|
|
|
137
148
|
AgentGuiI18nProvider,
|
|
138
149
|
translate,
|
|
139
150
|
useTranslation
|
|
140
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-OWW7CU4U.js";
|
|
141
152
|
import {
|
|
142
153
|
migratedAgentGUIProviderIdentityCatalog,
|
|
143
154
|
resolveAgentGUIProviderCatalogIdentity,
|
|
@@ -150,7 +161,7 @@ import {
|
|
|
150
161
|
|
|
151
162
|
// AgentGUI.tsx
|
|
152
163
|
import { memo as memo15 } from "react";
|
|
153
|
-
import { TooltipProvider as
|
|
164
|
+
import { TooltipProvider as TooltipProvider5 } from "@tutti-os/ui-system";
|
|
154
165
|
|
|
155
166
|
// agent-gui/agentGuiNode/AgentGUINode.tsx
|
|
156
167
|
import { memo as memo14, useCallback as useCallback50, useEffect as useEffect39, useMemo as useMemo39 } from "react";
|
|
@@ -2008,7 +2019,7 @@ import {
|
|
|
2008
2019
|
selectEngineSessionIsRespondingToInteraction as selectEngineSessionIsRespondingToInteraction2,
|
|
2009
2020
|
selectWorkspaceAgentConsumerSessions as selectWorkspaceAgentConsumerSessions2
|
|
2010
2021
|
} from "@tutti-os/agent-activity-core";
|
|
2011
|
-
import { useCallback as useCallback24, useEffect as useEffect14, useMemo as useMemo18, useRef as
|
|
2022
|
+
import { useCallback as useCallback24, useEffect as useEffect14, useMemo as useMemo18, useRef as useRef17 } from "react";
|
|
2012
2023
|
|
|
2013
2024
|
// host/agentHostAccountStore.ts
|
|
2014
2025
|
import { create as create2 } from "zustand";
|
|
@@ -2222,8 +2233,9 @@ function projectWorkspaceAgentMessagesToTimelineItems(messages) {
|
|
|
2222
2233
|
});
|
|
2223
2234
|
}
|
|
2224
2235
|
if (kind === "text" && (role === "assistant" || role === "agent")) {
|
|
2236
|
+
const projectedMessage = normalizeLegacyCompactNotice(message, payload);
|
|
2225
2237
|
return messageTimelineItem({
|
|
2226
|
-
message,
|
|
2238
|
+
message: projectedMessage,
|
|
2227
2239
|
id,
|
|
2228
2240
|
seq,
|
|
2229
2241
|
eventId,
|
|
@@ -2231,7 +2243,7 @@ function projectWorkspaceAgentMessagesToTimelineItems(messages) {
|
|
|
2231
2243
|
actorType: "agent",
|
|
2232
2244
|
itemType: "message.assistant",
|
|
2233
2245
|
role: "assistant",
|
|
2234
|
-
content: messageText(
|
|
2246
|
+
content: messageText(projectedMessage),
|
|
2235
2247
|
occurredAtUnixMs
|
|
2236
2248
|
});
|
|
2237
2249
|
}
|
|
@@ -2264,6 +2276,40 @@ function projectWorkspaceAgentMessagesToTimelineItems(messages) {
|
|
|
2264
2276
|
});
|
|
2265
2277
|
});
|
|
2266
2278
|
}
|
|
2279
|
+
function normalizeLegacyCompactNotice(message, payload) {
|
|
2280
|
+
const commandSemantics = resolveWorkspaceAgentNoticeCommandSemantics({
|
|
2281
|
+
eventId: message.messageId,
|
|
2282
|
+
messageSemantics: message.semantics,
|
|
2283
|
+
payload,
|
|
2284
|
+
status: message.status
|
|
2285
|
+
});
|
|
2286
|
+
if (commandSemantics?.command !== "compact") {
|
|
2287
|
+
return message;
|
|
2288
|
+
}
|
|
2289
|
+
const commandStatus = commandSemantics.commandStatus;
|
|
2290
|
+
const title = stringValue(payload.title) || (commandStatus === "completed" ? "Context compacted." : commandStatus === "running" ? "Compacting context." : "Context compaction interrupted.");
|
|
2291
|
+
const originalText = messageText(message);
|
|
2292
|
+
const detail = stringValue(payload.detail) || (commandStatus === "failed" || commandStatus === "canceled" ? originalText.replace(/^Compacting failed:\s*/iu, "").trim() : "");
|
|
2293
|
+
return {
|
|
2294
|
+
...message,
|
|
2295
|
+
semantics: {
|
|
2296
|
+
...message.semantics,
|
|
2297
|
+
noticeCommand: "compact",
|
|
2298
|
+
noticeCommandStatus: commandStatus
|
|
2299
|
+
},
|
|
2300
|
+
payload: {
|
|
2301
|
+
...payload,
|
|
2302
|
+
kind: "agent_system_notice",
|
|
2303
|
+
noticeKind: stringValue(payload.noticeKind) || "system_notice",
|
|
2304
|
+
noticeCommand: "compact",
|
|
2305
|
+
noticeCommandStatus: commandStatus,
|
|
2306
|
+
title,
|
|
2307
|
+
text: title,
|
|
2308
|
+
content: title,
|
|
2309
|
+
...detail ? { detail } : {}
|
|
2310
|
+
}
|
|
2311
|
+
};
|
|
2312
|
+
}
|
|
2267
2313
|
function latestMessageSnapshots(messages) {
|
|
2268
2314
|
const latestByKey = /* @__PURE__ */ new Map();
|
|
2269
2315
|
const unkeyedMessages = [];
|
|
@@ -2283,9 +2329,11 @@ function latestMessageSnapshots(messages) {
|
|
|
2283
2329
|
return [...unkeyedMessages, ...latestByKey.values()];
|
|
2284
2330
|
}
|
|
2285
2331
|
function mergeMessageSnapshot(previous, next) {
|
|
2332
|
+
const semantics = previous?.semantics || next.semantics ? { ...previous?.semantics, ...next.semantics } : void 0;
|
|
2286
2333
|
return {
|
|
2287
2334
|
...previous,
|
|
2288
2335
|
...next,
|
|
2336
|
+
...semantics ? { semantics } : {},
|
|
2289
2337
|
payload: {
|
|
2290
2338
|
...previous?.payload ?? {},
|
|
2291
2339
|
...next.payload ?? {}
|
|
@@ -2324,6 +2372,7 @@ function messageTimelineItem({
|
|
|
2324
2372
|
itemType,
|
|
2325
2373
|
role,
|
|
2326
2374
|
status: message.status,
|
|
2375
|
+
...message.semantics ? { messageSemantics: message.semantics } : {},
|
|
2327
2376
|
content,
|
|
2328
2377
|
payload: normalizedPayload(message.payload),
|
|
2329
2378
|
...occurredAtUnixMs !== void 0 ? { occurredAtUnixMs } : {},
|
|
@@ -3253,6 +3302,7 @@ function conversationSummaryFromAgentSession(session, options = {}) {
|
|
|
3253
3302
|
session.activeTurnId ? "working" : "idle"
|
|
3254
3303
|
),
|
|
3255
3304
|
cwd: session.cwd?.trim() ?? "",
|
|
3305
|
+
railSectionKey: session.railSectionKey,
|
|
3256
3306
|
project: resolveConversationProject(session, projectResolver),
|
|
3257
3307
|
...isExternalImportNoProjectSession(session) ? { projectMode: "none" } : {},
|
|
3258
3308
|
pinnedAtUnixMs: session.pinnedAtUnixMs ?? null,
|
|
@@ -4991,7 +5041,12 @@ function toRuntimeSendContent(content) {
|
|
|
4991
5041
|
return materializePastedTextInstructions(content, {
|
|
4992
5042
|
header: () => translate("agentHost.agentGui.pastedTextFilesHeader"),
|
|
4993
5043
|
line: (preview, path) => translate("agentHost.agentGui.pastedTextFileLine", { preview, path })
|
|
4994
|
-
})
|
|
5044
|
+
}).map(
|
|
5045
|
+
(block) => block.type === "text" ? {
|
|
5046
|
+
...block,
|
|
5047
|
+
text: materializeAgentCustomMentionPromptText(block.text ?? "").trim()
|
|
5048
|
+
} : block
|
|
5049
|
+
);
|
|
4995
5050
|
}
|
|
4996
5051
|
function shouldClearSubmittedDraft(input) {
|
|
4997
5052
|
return Boolean(
|
|
@@ -5284,16 +5339,16 @@ function conversationDetailSessionsEqual(left, right) {
|
|
|
5284
5339
|
return left.workspaceId === right.workspaceId && left.agentSessionId === right.agentSessionId && left.userId === right.userId && left.agentTargetId === right.agentTargetId && left.provider === right.provider && left.providerSessionId === right.providerSessionId && left.model === right.model && left.resumable === right.resumable && left.endedAtUnixMs === right.endedAtUnixMs && left.title === right.title && left.pinnedAtUnixMs === right.pinnedAtUnixMs && left.createdAtUnixMs === right.createdAtUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.cwd === right.cwd && left.activeTurnId === right.activeTurnId && left.activeTurn?.updatedAtUnixMs === right.activeTurn?.updatedAtUnixMs && left.latestTurn?.updatedAtUnixMs === right.latestTurn?.updatedAtUnixMs && left.pendingInteractions === right.pendingInteractions && left.latestTurnInteractions === right.latestTurnInteractions;
|
|
5285
5340
|
}
|
|
5286
5341
|
function conversationSummariesRenderEqual(left, right) {
|
|
5287
|
-
return left.id === right.id && left.userId === right.userId && left.provider === right.provider && left.title === right.title && conversationTitleFallbacksRenderEqual(
|
|
5342
|
+
return left.id === right.id && left.userId === right.userId && left.provider === right.provider && left.title === right.title && left.titleLeadingMentionKind === right.titleLeadingMentionKind && conversationTitleFallbacksRenderEqual(
|
|
5288
5343
|
left.titleFallback,
|
|
5289
5344
|
right.titleFallback
|
|
5290
|
-
) && left.status === right.status && left.cwd === right.cwd && left.pinnedAtUnixMs === right.pinnedAtUnixMs && left.sortTimeUnixMs === right.sortTimeUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.projectionSource === right.projectionSource && left.isImported === right.isImported && left.hasUnreadCompletion === right.hasUnreadCompletion && left.unreadCompletionKey === right.unreadCompletionKey && conversationProjectsRenderEqual(left.project, right.project);
|
|
5345
|
+
) && left.status === right.status && left.cwd === right.cwd && left.railSectionKey === right.railSectionKey && left.pinnedAtUnixMs === right.pinnedAtUnixMs && left.sortTimeUnixMs === right.sortTimeUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.projectionSource === right.projectionSource && left.isImported === right.isImported && left.hasUnreadCompletion === right.hasUnreadCompletion && left.unreadCompletionKey === right.unreadCompletionKey && conversationProjectsRenderEqual(left.project, right.project);
|
|
5291
5346
|
}
|
|
5292
5347
|
function conversationTitleFallbacksRenderEqual(left, right) {
|
|
5293
5348
|
return left === right || JSON.stringify(left ?? null) === JSON.stringify(right ?? null);
|
|
5294
5349
|
}
|
|
5295
5350
|
function conversationProjectsRenderEqual(left, right) {
|
|
5296
|
-
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);
|
|
5351
|
+
return left === right || (!left || !right ? !left && !right : left.id === right.id && left.path === right.path && left.sectionKey === right.sectionKey && left.label === right.label && left.createdAtUnixMs === right.createdAtUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.lastUsedAtUnixMs === right.lastUsedAtUnixMs);
|
|
5297
5352
|
}
|
|
5298
5353
|
function draftAgentSessionIdFromComposerOptions(options) {
|
|
5299
5354
|
return normalizeConfigOptionValue(options?.draftAgentSessionId);
|
|
@@ -6432,21 +6487,66 @@ import {
|
|
|
6432
6487
|
selectPendingActivations,
|
|
6433
6488
|
selectWorkspaceReconcileState
|
|
6434
6489
|
} from "@tutti-os/agent-activity-core";
|
|
6435
|
-
|
|
6490
|
+
|
|
6491
|
+
// shared/agentConversationRailTitlePromptSelector.ts
|
|
6492
|
+
import {
|
|
6493
|
+
selectSessionMessagesById
|
|
6494
|
+
} from "@tutti-os/agent-activity-core";
|
|
6495
|
+
function createAgentGUIConversationRailTitlePromptSelector() {
|
|
6496
|
+
let previous = {};
|
|
6497
|
+
return (state) => {
|
|
6498
|
+
const next = {};
|
|
6499
|
+
for (const [agentSessionId, messages] of Object.entries(
|
|
6500
|
+
selectSessionMessagesById(state)
|
|
6501
|
+
)) {
|
|
6502
|
+
const displayPrompt = resolveAgentGUIFirstUserMessageDisplayPrompt(messages);
|
|
6503
|
+
if (displayPrompt) {
|
|
6504
|
+
next[agentSessionId] = displayPrompt;
|
|
6505
|
+
}
|
|
6506
|
+
}
|
|
6507
|
+
if (agentGUIConversationRailTitlePromptsEqual(previous, next)) {
|
|
6508
|
+
return previous;
|
|
6509
|
+
}
|
|
6510
|
+
previous = next;
|
|
6511
|
+
return previous;
|
|
6512
|
+
};
|
|
6513
|
+
}
|
|
6514
|
+
function agentGUIConversationRailTitlePromptsEqual(left, right) {
|
|
6515
|
+
const leftKeys = Object.keys(left);
|
|
6516
|
+
const rightKeys = Object.keys(right);
|
|
6517
|
+
return leftKeys.length === rightKeys.length && leftKeys.every((key) => left[key] === right[key]);
|
|
6518
|
+
}
|
|
6519
|
+
|
|
6520
|
+
// contexts/workspace/presentation/renderer/agentGuiConversationList/useAgentGuiConversationList.ts
|
|
6521
|
+
var EMPTY_AGENT_GUI_AGENT_TARGETS = [];
|
|
6522
|
+
function projectCanonicalAgentGUIConversationSummaries(sessions, firstUserDisplayPromptsBySessionId = {}) {
|
|
6436
6523
|
return sessions.map((item) => {
|
|
6437
6524
|
const provider = resolveAgentGUIProviderIdentity({
|
|
6438
6525
|
sessionProvider: item.session.provider
|
|
6439
6526
|
});
|
|
6440
|
-
const { title
|
|
6527
|
+
const { title: canonicalTitle } = resolveAgentGUIConversationTitle(
|
|
6441
6528
|
item.session.title
|
|
6442
6529
|
);
|
|
6530
|
+
const firstUserDisplayPrompt = firstUserDisplayPromptsBySessionId[item.session.agentSessionId];
|
|
6531
|
+
const titleDisplayPrompt = resolveAgentGUIConversationTitleDisplayPrompt({
|
|
6532
|
+
firstUserDisplayPrompt,
|
|
6533
|
+
title: canonicalTitle
|
|
6534
|
+
});
|
|
6535
|
+
const { title, titleFallback } = resolveAgentGUIConversationTitle(
|
|
6536
|
+
resolveAgentGUIConversationBrowserFreeTitle({
|
|
6537
|
+
firstUserDisplayPrompt,
|
|
6538
|
+
title: canonicalTitle
|
|
6539
|
+
})
|
|
6540
|
+
);
|
|
6443
6541
|
const canonicalUpdatedAtUnixMs = item.session.updatedAtUnixMs ?? item.session.createdAtUnixMs ?? 0;
|
|
6542
|
+
const titleLeadingMentionKind = resolveAgentGUIConversationTitleLeadingMentionKind(titleDisplayPrompt);
|
|
6444
6543
|
return {
|
|
6445
6544
|
agentTargetId: item.session.agentTargetId ?? null,
|
|
6446
6545
|
cwd: item.session.cwd,
|
|
6447
6546
|
id: item.session.agentSessionId,
|
|
6448
6547
|
pinnedAtUnixMs: item.session.pinnedAtUnixMs ?? null,
|
|
6449
6548
|
provider,
|
|
6549
|
+
railSectionKey: item.session.railSectionKey,
|
|
6450
6550
|
resumable: item.session.resumable,
|
|
6451
6551
|
sortTimeUnixMs: resolveWorkspaceAgentSessionSortTimeUnixMs({
|
|
6452
6552
|
createdAtUnixMs: item.session.createdAtUnixMs,
|
|
@@ -6454,13 +6554,14 @@ function projectCanonicalAgentGUIConversationSummaries(sessions) {
|
|
|
6454
6554
|
}),
|
|
6455
6555
|
status: item.displayStatus === "idle" ? "ready" : item.displayStatus,
|
|
6456
6556
|
title,
|
|
6557
|
+
titleLeadingMentionKind,
|
|
6457
6558
|
titleFallback,
|
|
6458
6559
|
updatedAtUnixMs: canonicalUpdatedAtUnixMs,
|
|
6459
6560
|
userId: item.session.userId?.trim() ?? ""
|
|
6460
6561
|
};
|
|
6461
6562
|
});
|
|
6462
6563
|
}
|
|
6463
|
-
function useAgentGuiConversationList(engine, query, agentTargets =
|
|
6564
|
+
function useAgentGuiConversationList(engine, query, agentTargets = EMPTY_AGENT_GUI_AGENT_TARGETS) {
|
|
6464
6565
|
const workspaceReconcile = useEngineSelector(
|
|
6465
6566
|
engine,
|
|
6466
6567
|
selectWorkspaceReconcileState
|
|
@@ -6475,6 +6576,15 @@ function useAgentGuiConversationList(engine, query, agentTargets = []) {
|
|
|
6475
6576
|
selectPendingActivations,
|
|
6476
6577
|
pendingActivationsEqual
|
|
6477
6578
|
);
|
|
6579
|
+
const selectRailTitlePrompts = useMemo5(
|
|
6580
|
+
() => createAgentGUIConversationRailTitlePromptSelector(),
|
|
6581
|
+
[engine]
|
|
6582
|
+
);
|
|
6583
|
+
const firstUserDisplayPromptsBySessionId = useEngineSelector(
|
|
6584
|
+
engine,
|
|
6585
|
+
selectRailTitlePrompts,
|
|
6586
|
+
Object.is
|
|
6587
|
+
);
|
|
6478
6588
|
return useMemo5(() => {
|
|
6479
6589
|
if (!query) return null;
|
|
6480
6590
|
const canonicalIds = new Set(
|
|
@@ -6494,9 +6604,24 @@ function useAgentGuiConversationList(engine, query, agentTargets = []) {
|
|
|
6494
6604
|
const provider = resolveAgentGUIProviderIdentity({
|
|
6495
6605
|
sessionProvider: target?.provider ?? query.provider
|
|
6496
6606
|
});
|
|
6497
|
-
const { title
|
|
6607
|
+
const { title: canonicalTitle } = resolveAgentGUIConversationTitle(
|
|
6498
6608
|
activation.optimisticTitle ?? activation.title ?? ""
|
|
6499
6609
|
);
|
|
6610
|
+
const titleDisplayPrompt = resolveAgentGUIConversationTitleDisplayPrompt({
|
|
6611
|
+
activation,
|
|
6612
|
+
allowEmptyTitle: true,
|
|
6613
|
+
title: canonicalTitle
|
|
6614
|
+
});
|
|
6615
|
+
const { title, titleFallback } = resolveAgentGUIConversationTitle(
|
|
6616
|
+
resolveAgentGUIConversationBrowserFreeTitle({
|
|
6617
|
+
activation,
|
|
6618
|
+
allowEmptyTitle: true,
|
|
6619
|
+
title: canonicalTitle
|
|
6620
|
+
})
|
|
6621
|
+
);
|
|
6622
|
+
const titleLeadingMentionKind = resolveAgentGUIConversationTitleLeadingMentionKind(
|
|
6623
|
+
titleDisplayPrompt
|
|
6624
|
+
);
|
|
6500
6625
|
return {
|
|
6501
6626
|
agentTargetId: activation.agentTargetId,
|
|
6502
6627
|
cwd: activation.cwd,
|
|
@@ -6506,6 +6631,7 @@ function useAgentGuiConversationList(engine, query, agentTargets = []) {
|
|
|
6506
6631
|
status: "working",
|
|
6507
6632
|
projectionSource: "pending_activation",
|
|
6508
6633
|
title,
|
|
6634
|
+
titleLeadingMentionKind,
|
|
6509
6635
|
titleFallback,
|
|
6510
6636
|
updatedAtUnixMs: activation.requestedAtUnixMs,
|
|
6511
6637
|
userId: query.userId
|
|
@@ -6515,7 +6641,8 @@ function useAgentGuiConversationList(engine, query, agentTargets = []) {
|
|
|
6515
6641
|
...projectCanonicalAgentGUIConversationSummaries(
|
|
6516
6642
|
sessions.filter(
|
|
6517
6643
|
(item) => item.session.workspaceId === query.workspaceId
|
|
6518
|
-
)
|
|
6644
|
+
),
|
|
6645
|
+
firstUserDisplayPromptsBySessionId
|
|
6519
6646
|
).map((conversation) => {
|
|
6520
6647
|
const canonicalUpdatedAtUnixMs = conversation.updatedAtUnixMs;
|
|
6521
6648
|
const activation = latestNewActivationBySessionId.get(conversation.id);
|
|
@@ -6523,11 +6650,27 @@ function useAgentGuiConversationList(engine, query, agentTargets = []) {
|
|
|
6523
6650
|
const optimisticTitle = activation?.optimisticTitle?.trim() ?? "";
|
|
6524
6651
|
const shouldUseOptimisticTitle = conversation.title.trim().length === 0 && optimisticTitle.length > 0;
|
|
6525
6652
|
const projectedTitle = shouldUseOptimisticTitle ? optimisticTitle : activationIsNewer && activation?.title ? activation.title : conversation.title;
|
|
6526
|
-
const { title
|
|
6653
|
+
const { title: projectedCanonicalTitle } = resolveAgentGUIConversationTitle(projectedTitle);
|
|
6654
|
+
const titleDisplayPrompt = resolveAgentGUIConversationTitleDisplayPrompt({
|
|
6655
|
+
activation,
|
|
6656
|
+
allowEmptyTitle: shouldUseOptimisticTitle,
|
|
6657
|
+
title: projectedCanonicalTitle
|
|
6658
|
+
});
|
|
6659
|
+
const { title, titleFallback } = resolveAgentGUIConversationTitle(
|
|
6660
|
+
resolveAgentGUIConversationBrowserFreeTitle({
|
|
6661
|
+
activation,
|
|
6662
|
+
allowEmptyTitle: shouldUseOptimisticTitle,
|
|
6663
|
+
title: projectedCanonicalTitle
|
|
6664
|
+
})
|
|
6665
|
+
);
|
|
6666
|
+
const titleLeadingMentionKind = resolveAgentGUIConversationTitleLeadingMentionKind(
|
|
6667
|
+
titleDisplayPrompt
|
|
6668
|
+
) ?? conversation.titleLeadingMentionKind;
|
|
6527
6669
|
return {
|
|
6528
6670
|
...conversation,
|
|
6529
6671
|
sortTimeUnixMs: activationIsNewer ? activation.requestedAtUnixMs : conversation.sortTimeUnixMs,
|
|
6530
6672
|
title,
|
|
6673
|
+
titleLeadingMentionKind,
|
|
6531
6674
|
titleFallback,
|
|
6532
6675
|
updatedAtUnixMs: activationIsNewer ? activation.requestedAtUnixMs : canonicalUpdatedAtUnixMs
|
|
6533
6676
|
};
|
|
@@ -6557,7 +6700,14 @@ function useAgentGuiConversationList(engine, query, agentTargets = []) {
|
|
|
6557
6700
|
query.sessionOrigin
|
|
6558
6701
|
].join("::")
|
|
6559
6702
|
};
|
|
6560
|
-
}, [
|
|
6703
|
+
}, [
|
|
6704
|
+
agentTargets,
|
|
6705
|
+
firstUserDisplayPromptsBySessionId,
|
|
6706
|
+
pendingActivations,
|
|
6707
|
+
query,
|
|
6708
|
+
sessions,
|
|
6709
|
+
workspaceReconcile
|
|
6710
|
+
]);
|
|
6561
6711
|
}
|
|
6562
6712
|
function pendingActivationsEqual(left, right) {
|
|
6563
6713
|
return left.length === right.length && left.every((item, index) => item === right[index]);
|
|
@@ -6566,7 +6716,9 @@ function consumerSessionsEqual(left, right) {
|
|
|
6566
6716
|
if (left.length !== right.length) return false;
|
|
6567
6717
|
return left.every((item, index) => {
|
|
6568
6718
|
const other = right[index];
|
|
6569
|
-
return other !== void 0 && item.session === other.session && item.activeTurn === other.activeTurn && item.latestTurn === other.latestTurn && item.pendingInteractions === other.pendingInteractions && item.
|
|
6719
|
+
return other !== void 0 && item.session === other.session && item.activeTurn === other.activeTurn && item.latestTurn === other.latestTurn && item.pendingInteractions.length === other.pendingInteractions.length && item.pendingInteractions.every(
|
|
6720
|
+
(interaction, interactionIndex) => interaction === other.pendingInteractions[interactionIndex]
|
|
6721
|
+
) && item.displayStatus === other.displayStatus;
|
|
6570
6722
|
});
|
|
6571
6723
|
}
|
|
6572
6724
|
|
|
@@ -6767,7 +6919,7 @@ function useAgentGUIComposerCapabilities(input) {
|
|
|
6767
6919
|
import {
|
|
6768
6920
|
selectLatestActivationForSession as selectLatestActivationForSession2
|
|
6769
6921
|
} from "@tutti-os/agent-activity-core";
|
|
6770
|
-
import { useCallback as useCallback7, useEffect as useEffect5 } from "react";
|
|
6922
|
+
import { useCallback as useCallback7, useEffect as useEffect5, useRef as useRef8 } from "react";
|
|
6771
6923
|
|
|
6772
6924
|
// host/agentHostEventBus.ts
|
|
6773
6925
|
var LOG_PREFIX = "[agent-host-event-bus]";
|
|
@@ -6923,6 +7075,10 @@ function subscribeCoalesced(type, options, callback) {
|
|
|
6923
7075
|
|
|
6924
7076
|
// agent-gui/agentGuiNode/controller/useAgentGUIComposerOptionsSync.ts
|
|
6925
7077
|
function useAgentGUIComposerOptionsSync(input) {
|
|
7078
|
+
const previousActiveConversationIdRef = useRef8(input.activeConversationId);
|
|
7079
|
+
const previousIsCreatingConversationRef = useRef8(
|
|
7080
|
+
input.isCreatingConversation
|
|
7081
|
+
);
|
|
6926
7082
|
const loadComposerOptionsForTarget = useCallback7(
|
|
6927
7083
|
(targetData, options) => {
|
|
6928
7084
|
if (input.isCreatingConversation || !targetData.agentTargetId) return;
|
|
@@ -7018,8 +7174,12 @@ function useAgentGUIComposerOptionsSync(input) {
|
|
|
7018
7174
|
}, [input.loadSessionState, input.previewMode, loadDraftComposerOptions]);
|
|
7019
7175
|
useEffect5(() => {
|
|
7020
7176
|
if (input.previewMode) return;
|
|
7177
|
+
const conversationActivated = input.activeConversationId !== null && previousActiveConversationIdRef.current !== input.activeConversationId;
|
|
7178
|
+
const conversationCreationSettled = previousIsCreatingConversationRef.current && !input.isCreatingConversation;
|
|
7179
|
+
previousActiveConversationIdRef.current = input.activeConversationId;
|
|
7180
|
+
previousIsCreatingConversationRef.current = input.isCreatingConversation;
|
|
7021
7181
|
loadDraftComposerOptions(
|
|
7022
|
-
input.providerComposerOptions?.behavior?.prewarmDraftSession === true && input.isComposerHome ? { force: true } : void 0
|
|
7182
|
+
conversationActivated || conversationCreationSettled || input.providerComposerOptions?.behavior?.prewarmDraftSession === true && input.isComposerHome ? { force: true } : void 0
|
|
7023
7183
|
);
|
|
7024
7184
|
}, [
|
|
7025
7185
|
input.activeConversationId,
|
|
@@ -7067,54 +7227,54 @@ function useAgentGUIComposerOptionsSync(input) {
|
|
|
7067
7227
|
}
|
|
7068
7228
|
|
|
7069
7229
|
// agent-gui/agentGuiNode/controller/useAgentGUIControllerRefs.ts
|
|
7070
|
-
import { useRef as
|
|
7230
|
+
import { useRef as useRef9 } from "react";
|
|
7071
7231
|
function useAgentGUIControllerRefs(input) {
|
|
7072
|
-
const activeConversationIdRef =
|
|
7073
|
-
const selectedProjectPathRef =
|
|
7074
|
-
const userProjectsRef =
|
|
7075
|
-
const isNoProjectPathRef =
|
|
7076
|
-
const userProjectsLoadSeqRef =
|
|
7077
|
-
const composerOptionsProjectKeyRef =
|
|
7078
|
-
const conversationsRef =
|
|
7079
|
-
const isMountedRef =
|
|
7080
|
-
const agentActivitySnapshotRef =
|
|
7081
|
-
const dataRef =
|
|
7082
|
-
const selectedAgentTargetRef =
|
|
7083
|
-
const selectedAgentTargetIsExplicitRef =
|
|
7232
|
+
const activeConversationIdRef = useRef9(input.activeConversationId);
|
|
7233
|
+
const selectedProjectPathRef = useRef9(input.selectedProjectPath);
|
|
7234
|
+
const userProjectsRef = useRef9(input.userProjects);
|
|
7235
|
+
const isNoProjectPathRef = useRef9(input.isNoProjectPath);
|
|
7236
|
+
const userProjectsLoadSeqRef = useRef9(0);
|
|
7237
|
+
const composerOptionsProjectKeyRef = useRef9(null);
|
|
7238
|
+
const conversationsRef = useRef9(input.conversations);
|
|
7239
|
+
const isMountedRef = useRef9(true);
|
|
7240
|
+
const agentActivitySnapshotRef = useRef9(input.agentActivitySnapshot);
|
|
7241
|
+
const dataRef = useRef9(input.data);
|
|
7242
|
+
const selectedAgentTargetRef = useRef9(input.effectiveSelectedProviderTarget);
|
|
7243
|
+
const selectedAgentTargetIsExplicitRef = useRef9(
|
|
7084
7244
|
input.homeComposerTargetOverride ? true : input.selectedAgentTargetIsExplicit
|
|
7085
7245
|
);
|
|
7086
|
-
const agentTargetsProvidedRef =
|
|
7087
|
-
const selectedComposerTargetDataRef =
|
|
7246
|
+
const agentTargetsProvidedRef = useRef9(input.agentTargetsProvided);
|
|
7247
|
+
const selectedComposerTargetDataRef = useRef9(
|
|
7088
7248
|
input.selectedComposerTargetData
|
|
7089
7249
|
);
|
|
7090
|
-
const draftByScopeKeyRef =
|
|
7091
|
-
const draftSettingsBySessionIdRef =
|
|
7092
|
-
const onDataChangeRef =
|
|
7093
|
-
const onRememberComposerDefaultsRef =
|
|
7250
|
+
const draftByScopeKeyRef = useRef9(input.draftByScopeKey);
|
|
7251
|
+
const draftSettingsBySessionIdRef = useRef9(input.draftSettingsBySessionId);
|
|
7252
|
+
const onDataChangeRef = useRef9(input.onDataChange);
|
|
7253
|
+
const onRememberComposerDefaultsRef = useRef9(
|
|
7094
7254
|
input.onRememberComposerDefaults
|
|
7095
7255
|
);
|
|
7096
|
-
const onShowMessageRef =
|
|
7097
|
-
const handledPrefillPromptSequenceRef =
|
|
7098
|
-
const handledComposerAppendSequenceRef =
|
|
7099
|
-
const loadDraftComposerOptionsRef =
|
|
7256
|
+
const onShowMessageRef = useRef9(input.onShowMessage);
|
|
7257
|
+
const handledPrefillPromptSequenceRef = useRef9(null);
|
|
7258
|
+
const handledComposerAppendSequenceRef = useRef9(null);
|
|
7259
|
+
const loadDraftComposerOptionsRef = useRef9(() => {
|
|
7100
7260
|
});
|
|
7101
|
-
const lastActiveModelByProviderRef =
|
|
7102
|
-
const conversationIdsRef =
|
|
7261
|
+
const lastActiveModelByProviderRef = useRef9({});
|
|
7262
|
+
const conversationIdsRef = useRef9(
|
|
7103
7263
|
new Set(input.conversations.map((conversation) => conversation.id))
|
|
7104
7264
|
);
|
|
7105
|
-
const lastRenderStateDiagnosticKeyRef =
|
|
7106
|
-
const handledOpenSessionSequenceRef =
|
|
7107
|
-
const pendingOpenSessionRequestRef =
|
|
7108
|
-
const executePromptRef =
|
|
7265
|
+
const lastRenderStateDiagnosticKeyRef = useRef9(null);
|
|
7266
|
+
const handledOpenSessionSequenceRef = useRef9(null);
|
|
7267
|
+
const pendingOpenSessionRequestRef = useRef9(null);
|
|
7268
|
+
const executePromptRef = useRef9(() => {
|
|
7109
7269
|
});
|
|
7110
|
-
const submitPromptRef =
|
|
7270
|
+
const submitPromptRef = useRef9(() => {
|
|
7111
7271
|
});
|
|
7112
|
-
const reloadSelectedConversationRef =
|
|
7272
|
+
const reloadSelectedConversationRef = useRef9(() => {
|
|
7113
7273
|
});
|
|
7114
|
-
const syncConversationListProjectionRef =
|
|
7274
|
+
const syncConversationListProjectionRef = useRef9(async () => {
|
|
7115
7275
|
});
|
|
7116
|
-
const isComposerHomeRef =
|
|
7117
|
-
const isCreatingConversationRef =
|
|
7276
|
+
const isComposerHomeRef = useRef9(input.isComposerHome);
|
|
7277
|
+
const isCreatingConversationRef = useRef9(input.isCreatingConversation);
|
|
7118
7278
|
activeConversationIdRef.current = input.activeConversationId;
|
|
7119
7279
|
selectedProjectPathRef.current = input.selectedProjectPath;
|
|
7120
7280
|
userProjectsRef.current = input.userProjects;
|
|
@@ -7179,9 +7339,26 @@ import { useCallback as useCallback18 } from "react";
|
|
|
7179
7339
|
|
|
7180
7340
|
// agent-gui/agentGuiNode/controller/useAgentGUIComposerSettingsActions.ts
|
|
7181
7341
|
import {
|
|
7182
|
-
selectEngineSession
|
|
7342
|
+
selectEngineSession,
|
|
7343
|
+
selectEngineSessionSettingsUpdate
|
|
7183
7344
|
} from "@tutti-os/agent-activity-core";
|
|
7184
7345
|
import { useCallback as useCallback8 } from "react";
|
|
7346
|
+
|
|
7347
|
+
// agent-gui/agentGuiNode/model/composerModeSelection.ts
|
|
7348
|
+
function permissionModeSelectionPatch(permissionModeId, options) {
|
|
7349
|
+
return options.clearsPlanMode ? { permissionModeId, planMode: false } : { permissionModeId };
|
|
7350
|
+
}
|
|
7351
|
+
function resolvePermissionModeControlsDisabled(options) {
|
|
7352
|
+
if (options.changeDuringTurnSupported) {
|
|
7353
|
+
return options.isSubmittingPrompt;
|
|
7354
|
+
}
|
|
7355
|
+
return options.isSendingTurn || options.isSubmittingPrompt || options.showStopButton;
|
|
7356
|
+
}
|
|
7357
|
+
function shouldRetrySessionSettingsUpdate(status) {
|
|
7358
|
+
return status === "unknown";
|
|
7359
|
+
}
|
|
7360
|
+
|
|
7361
|
+
// agent-gui/agentGuiNode/controller/useAgentGUIComposerSettingsActions.ts
|
|
7185
7362
|
function useAgentGUIComposerSettingsActions(input) {
|
|
7186
7363
|
const {
|
|
7187
7364
|
activation,
|
|
@@ -7333,27 +7510,35 @@ function useAgentGUIComposerSettingsActions(input) {
|
|
|
7333
7510
|
}
|
|
7334
7511
|
}
|
|
7335
7512
|
if (Object.keys(sessionSettingsPatch).length > 0 && (canonicalSession !== null || isPreActivationSession)) {
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7513
|
+
const rememberedDefaultsPatch = composerDefaultsPatchFromSettings(
|
|
7514
|
+
sessionSettingsPatch,
|
|
7515
|
+
sessionSettingsPatch
|
|
7516
|
+
);
|
|
7517
|
+
if (rememberedDefaultsPatch) {
|
|
7518
|
+
const defaultAgentTargetId = normalizeOptionalText(canonicalSession?.agentTargetId) ?? normalizeOptionalText(dataRef.current.agentTargetId);
|
|
7519
|
+
const defaultProvider = canonicalSession?.provider ?? dataRef.current.provider;
|
|
7520
|
+
void onRememberComposerDefaultsRef.current?.({
|
|
7521
|
+
agentTargetId: defaultAgentTargetId,
|
|
7522
|
+
provider: defaultProvider,
|
|
7523
|
+
defaults: rememberedDefaultsPatch
|
|
7524
|
+
});
|
|
7525
|
+
const durableNodeDefaultsPatch = {};
|
|
7526
|
+
for (const field of rememberComposerDefaultsFields) {
|
|
7527
|
+
if (sessionSettingsPatch[field] !== void 0) {
|
|
7528
|
+
durableNodeDefaultsPatch[field] = sessionSettingsPatch[field];
|
|
7529
|
+
}
|
|
7348
7530
|
}
|
|
7349
|
-
}
|
|
7350
|
-
if (Object.keys(durableNodeDefaultsPatch).length > 0) {
|
|
7351
7531
|
const defaultDraftKey = nodeDefaultDraftKey(
|
|
7352
|
-
|
|
7353
|
-
|
|
7532
|
+
defaultProvider,
|
|
7533
|
+
defaultAgentTargetId
|
|
7354
7534
|
);
|
|
7535
|
+
const defaultData = {
|
|
7536
|
+
...dataRef.current,
|
|
7537
|
+
provider: defaultProvider,
|
|
7538
|
+
agentTargetId: defaultAgentTargetId
|
|
7539
|
+
};
|
|
7355
7540
|
const storedNodeDefaults = readNodeDefaultDraftSettings({
|
|
7356
|
-
data:
|
|
7541
|
+
data: defaultData,
|
|
7357
7542
|
defaultReasoningEffort,
|
|
7358
7543
|
drafts: draftSettingsBySessionIdRef.current
|
|
7359
7544
|
});
|
|
@@ -7370,7 +7555,14 @@ function useAgentGUIComposerSettingsActions(input) {
|
|
|
7370
7555
|
[defaultDraftKey]: nextNodeDefaults
|
|
7371
7556
|
}));
|
|
7372
7557
|
onDataChangeRef.current(
|
|
7373
|
-
(current) => nodeDataFromComposerSettings(
|
|
7558
|
+
(current) => nodeDataFromComposerSettings(
|
|
7559
|
+
{
|
|
7560
|
+
...current,
|
|
7561
|
+
provider: defaultProvider,
|
|
7562
|
+
agentTargetId: defaultAgentTargetId
|
|
7563
|
+
},
|
|
7564
|
+
nextNodeDefaults
|
|
7565
|
+
)
|
|
7374
7566
|
);
|
|
7375
7567
|
}
|
|
7376
7568
|
if (isPreActivationSession) {
|
|
@@ -7380,9 +7572,14 @@ function useAgentGUIComposerSettingsActions(input) {
|
|
|
7380
7572
|
settings: { ...sessionSettingsPatch }
|
|
7381
7573
|
});
|
|
7382
7574
|
} else {
|
|
7575
|
+
const settingsUpdate = selectEngineSessionSettingsUpdate(
|
|
7576
|
+
sessionEngine.getSnapshot(),
|
|
7577
|
+
agentSessionId
|
|
7578
|
+
);
|
|
7383
7579
|
sessionEngine.dispatch({
|
|
7384
7580
|
agentSessionId,
|
|
7385
7581
|
commandId: `settings:${createAgentGUIConversationId()}`,
|
|
7582
|
+
retry: shouldRetrySessionSettingsUpdate(settingsUpdate?.status),
|
|
7386
7583
|
settings: { ...sessionSettingsPatch },
|
|
7387
7584
|
timeoutMs: 3e4,
|
|
7388
7585
|
type: "session/settingsUpdateRequested",
|
|
@@ -7407,12 +7604,12 @@ function useAgentGUIComposerSettingsActions(input) {
|
|
|
7407
7604
|
}
|
|
7408
7605
|
|
|
7409
7606
|
// agent-gui/agentGuiNode/controller/useAgentGUIContinueConversation.ts
|
|
7410
|
-
import { useCallback as useCallback9, useRef as
|
|
7607
|
+
import { useCallback as useCallback9, useRef as useRef10 } from "react";
|
|
7411
7608
|
function buildContinueInNewConversationDraft(input) {
|
|
7412
7609
|
return updateAgentComposerDraft(input.sourceDraft, { prompt: input.prompt });
|
|
7413
7610
|
}
|
|
7414
7611
|
function useAgentGUIContinueConversation(input) {
|
|
7415
|
-
const inputRef =
|
|
7612
|
+
const inputRef = useRef10(input);
|
|
7416
7613
|
inputRef.current = input;
|
|
7417
7614
|
return useCallback9(() => {
|
|
7418
7615
|
const current = inputRef.current;
|
|
@@ -7829,6 +8026,17 @@ import {
|
|
|
7829
8026
|
} from "react";
|
|
7830
8027
|
|
|
7831
8028
|
// agent-gui/agentGuiNode/controller/useAgentGUIComposerAppendRequest.ts
|
|
8029
|
+
function appendAgentGUIComposerPrompt(draft, incomingPrompt) {
|
|
8030
|
+
const currentPrompt = agentComposerDraftPrompt(draft);
|
|
8031
|
+
const normalizedPrompt = incomingPrompt.trim();
|
|
8032
|
+
if (!normalizedPrompt || currentPrompt.includes(normalizedPrompt)) {
|
|
8033
|
+
return draft;
|
|
8034
|
+
}
|
|
8035
|
+
const separator = currentPrompt && !/\s$/u.test(currentPrompt) ? " " : "";
|
|
8036
|
+
return updateAgentComposerDraft(draft, {
|
|
8037
|
+
prompt: `${currentPrompt}${separator}${normalizedPrompt} `
|
|
8038
|
+
});
|
|
8039
|
+
}
|
|
7832
8040
|
function appendAgentGUIComposerFiles(draft, incomingFiles) {
|
|
7833
8041
|
const files = agentComposerDraftFiles(draft);
|
|
7834
8042
|
const knownIds = new Set(files.map((file) => file.id));
|
|
@@ -7856,7 +8064,10 @@ function resolveAgentGUIComposerAppendRequest(input) {
|
|
|
7856
8064
|
const currentDraft = draftByScopeKey[draftKey] ?? emptyAgentComposerDraft();
|
|
7857
8065
|
return {
|
|
7858
8066
|
draftKey,
|
|
7859
|
-
nextDraft: appendAgentGUIComposerFiles(
|
|
8067
|
+
nextDraft: appendAgentGUIComposerFiles(
|
|
8068
|
+
appendAgentGUIComposerPrompt(currentDraft, request.prompt ?? ""),
|
|
8069
|
+
request.files ?? []
|
|
8070
|
+
),
|
|
7860
8071
|
sequence: request.sequence
|
|
7861
8072
|
};
|
|
7862
8073
|
}
|
|
@@ -10170,9 +10381,9 @@ function useAgentGUIControllerActions(actions) {
|
|
|
10170
10381
|
import {
|
|
10171
10382
|
selectEngineAvailableCommands
|
|
10172
10383
|
} from "@tutti-os/agent-activity-core";
|
|
10173
|
-
import { useEffect as useEffect9, useMemo as useMemo11, useRef as
|
|
10384
|
+
import { useEffect as useEffect9, useMemo as useMemo11, useRef as useRef11 } from "react";
|
|
10174
10385
|
function useAgentGUIConversationDetail(input) {
|
|
10175
|
-
const projectionConversationRef =
|
|
10386
|
+
const projectionConversationRef = useRef11(null);
|
|
10176
10387
|
const activeCanonicalLiveTurn = Boolean(
|
|
10177
10388
|
input.activeTurn && input.activeTurn.phase !== "settled"
|
|
10178
10389
|
);
|
|
@@ -10257,7 +10468,7 @@ function useAgentGUIConversationDetail(input) {
|
|
|
10257
10468
|
}
|
|
10258
10469
|
return conversationModels.conversation;
|
|
10259
10470
|
}, [conversationDetail, conversationModels.conversation]);
|
|
10260
|
-
const diagnosticKeyRef =
|
|
10471
|
+
const diagnosticKeyRef = useRef11(null);
|
|
10261
10472
|
useEffect9(() => {
|
|
10262
10473
|
if (!input.activeConversationId || !conversation) {
|
|
10263
10474
|
diagnosticKeyRef.current = null;
|
|
@@ -10348,9 +10559,9 @@ function useAgentGUIConversationDetail(input) {
|
|
|
10348
10559
|
}
|
|
10349
10560
|
|
|
10350
10561
|
// agent-gui/agentGuiNode/controller/useAgentGUIConversationPresentation.ts
|
|
10351
|
-
import { useEffect as useEffect10, useMemo as useMemo12, useRef as
|
|
10562
|
+
import { useEffect as useEffect10, useMemo as useMemo12, useRef as useRef12 } from "react";
|
|
10352
10563
|
function useAgentGUIConversationPresentation(input) {
|
|
10353
|
-
const visibleConversationsRef =
|
|
10564
|
+
const visibleConversationsRef = useRef12(
|
|
10354
10565
|
null
|
|
10355
10566
|
);
|
|
10356
10567
|
const conversationProjection = useMemo12(() => {
|
|
@@ -10381,7 +10592,7 @@ function useAgentGUIConversationPresentation(input) {
|
|
|
10381
10592
|
input.userProjects
|
|
10382
10593
|
]);
|
|
10383
10594
|
const visibleConversations = conversationProjection.visibleConversations;
|
|
10384
|
-
const activeConversationRef =
|
|
10595
|
+
const activeConversationRef = useRef12(
|
|
10385
10596
|
null
|
|
10386
10597
|
);
|
|
10387
10598
|
const activeConversation = useMemo12(() => {
|
|
@@ -10512,10 +10723,10 @@ function useAgentGUIConversationPresentation(input) {
|
|
|
10512
10723
|
import {
|
|
10513
10724
|
useCallback as useCallback19,
|
|
10514
10725
|
useEffect as useEffect11,
|
|
10515
|
-
useRef as
|
|
10726
|
+
useRef as useRef13
|
|
10516
10727
|
} from "react";
|
|
10517
10728
|
function useAgentGUIProviderHome(input) {
|
|
10518
|
-
const inputRef =
|
|
10729
|
+
const inputRef = useRef13(input);
|
|
10519
10730
|
inputRef.current = input;
|
|
10520
10731
|
const resolveDefaultHomeComposerTarget = useCallback19(() => {
|
|
10521
10732
|
const current = inputRef.current;
|
|
@@ -11317,7 +11528,7 @@ import {
|
|
|
11317
11528
|
selectEngineSessionError,
|
|
11318
11529
|
selectEngineSessionIsRespondingToInteraction,
|
|
11319
11530
|
selectEngineSessionReconcile as selectEngineSessionReconcile2,
|
|
11320
|
-
selectEngineSessionSettingsUpdate,
|
|
11531
|
+
selectEngineSessionSettingsUpdate as selectEngineSessionSettingsUpdate2,
|
|
11321
11532
|
selectEngineSubmitAvailability,
|
|
11322
11533
|
selectLatestActivationForSession as selectLatestActivationForSession4,
|
|
11323
11534
|
selectLatestPendingSubmitForSession,
|
|
@@ -11447,7 +11658,7 @@ function useAgentGUISessionEngineState(input) {
|
|
|
11447
11658
|
);
|
|
11448
11659
|
const activeEngineSettingsUpdate = useEngineSelector(
|
|
11449
11660
|
sessionEngine,
|
|
11450
|
-
(state) =>
|
|
11661
|
+
(state) => selectEngineSessionSettingsUpdate2(state, activeConversationId)
|
|
11451
11662
|
);
|
|
11452
11663
|
const activeEngineError = activeEngineLifecycleError ?? activeEngineInteractionError ?? activeEngineSettingsUpdate?.errorMessage ?? activeEngineQueueError;
|
|
11453
11664
|
const isRespondingToInteraction = useEngineSelector(
|
|
@@ -11506,7 +11717,7 @@ import { useCallback as useCallback23, useMemo as useMemo17 } from "react";
|
|
|
11506
11717
|
import { useCallback as useCallback22 } from "react";
|
|
11507
11718
|
|
|
11508
11719
|
// contexts/workspace/presentation/renderer/agentSessions/useAgentSessionPagingState.ts
|
|
11509
|
-
import { useCallback as useCallback20, useRef as
|
|
11720
|
+
import { useCallback as useCallback20, useRef as useRef14, useState as useState5 } from "react";
|
|
11510
11721
|
var EMPTY_ENTRY = {
|
|
11511
11722
|
error: null,
|
|
11512
11723
|
isLoadingMessages: false,
|
|
@@ -11514,7 +11725,7 @@ var EMPTY_ENTRY = {
|
|
|
11514
11725
|
};
|
|
11515
11726
|
function useAgentSessionPagingState() {
|
|
11516
11727
|
const [entries, setEntries] = useState5({});
|
|
11517
|
-
const entriesRef =
|
|
11728
|
+
const entriesRef = useRef14(entries);
|
|
11518
11729
|
entriesRef.current = entries;
|
|
11519
11730
|
const update = useCallback20(
|
|
11520
11731
|
(ref, updater) => {
|
|
@@ -11560,7 +11771,7 @@ function sessionKey(ref) {
|
|
|
11560
11771
|
}
|
|
11561
11772
|
|
|
11562
11773
|
// contexts/workspace/presentation/renderer/agentSessions/useAgentSessionTransport.ts
|
|
11563
|
-
import { useCallback as useCallback21, useRef as
|
|
11774
|
+
import { useCallback as useCallback21, useRef as useRef15, useState as useState6 } from "react";
|
|
11564
11775
|
var EMPTY_ENTRY2 = {
|
|
11565
11776
|
olderMessages: [],
|
|
11566
11777
|
hasOlderMessages: false,
|
|
@@ -11568,7 +11779,7 @@ var EMPTY_ENTRY2 = {
|
|
|
11568
11779
|
};
|
|
11569
11780
|
function useAgentSessionTransport() {
|
|
11570
11781
|
const [entries, setEntries] = useState6({});
|
|
11571
|
-
const entriesRef =
|
|
11782
|
+
const entriesRef = useRef15(entries);
|
|
11572
11783
|
entriesRef.current = entries;
|
|
11573
11784
|
const update = useCallback21(
|
|
11574
11785
|
(ref, updater) => {
|
|
@@ -11845,7 +12056,7 @@ function useAgentGUISessionDetailTransport(input) {
|
|
|
11845
12056
|
}
|
|
11846
12057
|
|
|
11847
12058
|
// agent-gui/agentGuiNode/controller/useAgentGUILocalState.ts
|
|
11848
|
-
import { useRef as
|
|
12059
|
+
import { useRef as useRef16, useState as useState7 } from "react";
|
|
11849
12060
|
function useAgentGUILocalState({
|
|
11850
12061
|
data,
|
|
11851
12062
|
userProjectsApi
|
|
@@ -11864,7 +12075,7 @@ function useAgentGUILocalState({
|
|
|
11864
12075
|
data.lastActiveAgentSessionId === null
|
|
11865
12076
|
);
|
|
11866
12077
|
const [draftByScopeKey, setDraftByScopeKey] = useState7({});
|
|
11867
|
-
const submittedDraftSnapshotsRef =
|
|
12078
|
+
const submittedDraftSnapshotsRef = useRef16({});
|
|
11868
12079
|
const [draftSettingsBySessionId, setDraftSettingsBySessionId] = useState7({});
|
|
11869
12080
|
const [isLoadingMessages, setIsLoadingMessages] = useState7(false);
|
|
11870
12081
|
const [isDeletingConversation, setIsDeletingConversation] = useState7(false);
|
|
@@ -12042,9 +12253,9 @@ function useAgentGUINodeController({
|
|
|
12042
12253
|
)
|
|
12043
12254
|
)
|
|
12044
12255
|
);
|
|
12045
|
-
const updateComposerSettingsRef =
|
|
12256
|
+
const updateComposerSettingsRef = useRef17(() => {
|
|
12046
12257
|
});
|
|
12047
|
-
const planActionsRef =
|
|
12258
|
+
const planActionsRef = useRef17({ implement: () => {
|
|
12048
12259
|
}, feedback: () => {
|
|
12049
12260
|
}, skip: () => {
|
|
12050
12261
|
} });
|
|
@@ -12063,7 +12274,7 @@ function useAgentGUINodeController({
|
|
|
12063
12274
|
defaultReasoningEffort,
|
|
12064
12275
|
providerComposerOptions
|
|
12065
12276
|
} = composerCapabilities;
|
|
12066
|
-
const planImplementationTurnIdRef =
|
|
12277
|
+
const planImplementationTurnIdRef = useRef17(null);
|
|
12067
12278
|
const accountProfilesByUserId = useAccountStore(
|
|
12068
12279
|
(state) => state.profilesByUserId
|
|
12069
12280
|
);
|
|
@@ -12449,10 +12660,10 @@ import {
|
|
|
12449
12660
|
useCallback as useCallback48,
|
|
12450
12661
|
useEffect as useEffect37,
|
|
12451
12662
|
useMemo as useMemo37,
|
|
12452
|
-
useRef as
|
|
12663
|
+
useRef as useRef43,
|
|
12453
12664
|
useState as useState36
|
|
12454
12665
|
} from "react";
|
|
12455
|
-
import { TooltipProvider as
|
|
12666
|
+
import { TooltipProvider as TooltipProvider4 } from "@tutti-os/ui-system";
|
|
12456
12667
|
|
|
12457
12668
|
// shared/workspaceSettingsPanel/workspaceSettingsPanelStore.ts
|
|
12458
12669
|
import { useSnapshot } from "valtio";
|
|
@@ -12596,6 +12807,7 @@ var styles = {
|
|
|
12596
12807
|
conversationStatusGlyph: "agent-gui-node__conversation-status-glyph",
|
|
12597
12808
|
conversationTime: "agent-gui-node__conversation-time",
|
|
12598
12809
|
conversationTitle: "agent-gui-node__conversation-title",
|
|
12810
|
+
conversationTitleMentionIcon: "agent-gui-node__conversation-title-mention-icon",
|
|
12599
12811
|
conversationTitleRow: "agent-gui-node__conversation-title-row",
|
|
12600
12812
|
conversationUnreadLamp: "agent-gui-node__conversation-unread-lamp",
|
|
12601
12813
|
detailHeader: "agent-gui-node__detail-header",
|
|
@@ -12683,7 +12895,7 @@ var styles = {
|
|
|
12683
12895
|
var AgentGUINode_styles_default = styles;
|
|
12684
12896
|
|
|
12685
12897
|
// agent-gui/agentGuiNode/view/agentGUIViewUtils.ts
|
|
12686
|
-
import { useCallback as useCallback25, useLayoutEffect, useMemo as useMemo19, useRef as
|
|
12898
|
+
import { useCallback as useCallback25, useLayoutEffect, useMemo as useMemo19, useRef as useRef18 } from "react";
|
|
12687
12899
|
function objectRecord(value) {
|
|
12688
12900
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
12689
12901
|
}
|
|
@@ -12701,14 +12913,14 @@ function stringValue3(value) {
|
|
|
12701
12913
|
return typeof value === "string" ? value : "";
|
|
12702
12914
|
}
|
|
12703
12915
|
function useStableEventCallback(callback) {
|
|
12704
|
-
const callbackRef =
|
|
12916
|
+
const callbackRef = useRef18(callback);
|
|
12705
12917
|
useLayoutEffect(() => {
|
|
12706
12918
|
callbackRef.current = callback;
|
|
12707
12919
|
}, [callback]);
|
|
12708
12920
|
return useCallback25((...args) => callbackRef.current(...args), []);
|
|
12709
12921
|
}
|
|
12710
12922
|
function useOptionalStableEventCallback(callback) {
|
|
12711
|
-
const callbackRef =
|
|
12923
|
+
const callbackRef = useRef18(callback);
|
|
12712
12924
|
useLayoutEffect(() => {
|
|
12713
12925
|
callbackRef.current = callback;
|
|
12714
12926
|
}, [callback]);
|
|
@@ -13335,10 +13547,10 @@ import {
|
|
|
13335
13547
|
memo as memo4,
|
|
13336
13548
|
useCallback as useCallback40,
|
|
13337
13549
|
useMemo as useMemo30,
|
|
13338
|
-
useRef as
|
|
13550
|
+
useRef as useRef32,
|
|
13339
13551
|
useState as useState24
|
|
13340
13552
|
} from "react";
|
|
13341
|
-
import { Tooltip as
|
|
13553
|
+
import { Tooltip as Tooltip5, TooltipContent as TooltipContent5, TooltipTrigger as TooltipTrigger5 } from "@tutti-os/ui-system";
|
|
13342
13554
|
|
|
13343
13555
|
// agent-gui/agentGuiNode/model/agentGuiProviderRailOrder.ts
|
|
13344
13556
|
var AGENT_GUI_PROVIDER_RAIL_PREFERENCES_STORAGE_KEY = "agent-gui:provider-rail-preferences";
|
|
@@ -14886,13 +15098,7 @@ var AgentGUIHeroAgentCarousel = class extends Component {
|
|
|
14886
15098
|
};
|
|
14887
15099
|
|
|
14888
15100
|
// agent-gui/agentGuiNode/AgentSessionChrome.tsx
|
|
14889
|
-
import {
|
|
14890
|
-
Button as Button2,
|
|
14891
|
-
Tooltip,
|
|
14892
|
-
TooltipContent,
|
|
14893
|
-
TooltipProvider,
|
|
14894
|
-
TooltipTrigger
|
|
14895
|
-
} from "@tutti-os/ui-system";
|
|
15101
|
+
import { Button as Button2 } from "@tutti-os/ui-system";
|
|
14896
15102
|
|
|
14897
15103
|
// app/renderer/components/icons/CastIcon.tsx
|
|
14898
15104
|
import {
|
|
@@ -14900,7 +15106,7 @@ import {
|
|
|
14900
15106
|
useCallback as useCallback27,
|
|
14901
15107
|
useEffect as useEffect17,
|
|
14902
15108
|
useImperativeHandle,
|
|
14903
|
-
useRef as
|
|
15109
|
+
useRef as useRef19
|
|
14904
15110
|
} from "react";
|
|
14905
15111
|
import {
|
|
14906
15112
|
motion as motion2,
|
|
@@ -14931,7 +15137,7 @@ var CastIcon = forwardRef2(
|
|
|
14931
15137
|
}, ref) => {
|
|
14932
15138
|
const controls = useAnimation();
|
|
14933
15139
|
const reduceMotion = useReducedMotion();
|
|
14934
|
-
const isControlledRef =
|
|
15140
|
+
const isControlledRef = useRef19(false);
|
|
14935
15141
|
const startAnimation = useCallback27(() => {
|
|
14936
15142
|
if (reduceMotion) {
|
|
14937
15143
|
return;
|
|
@@ -15047,7 +15253,6 @@ var styles2 = {
|
|
|
15047
15253
|
chromeCardSuccess: "agent-gui-chrome__card--success",
|
|
15048
15254
|
chromeIcon: "agent-gui-chrome__icon",
|
|
15049
15255
|
chromeMessageSlot: "agent-gui-chrome__message-slot",
|
|
15050
|
-
chromeMessageTooltip: "agent-gui-chrome__message-tooltip",
|
|
15051
15256
|
chromeInlineActions: "agent-gui-chrome__inline-actions",
|
|
15052
15257
|
chromeNoticeDescription: "agent-gui-chrome__notice-description",
|
|
15053
15258
|
chromeNoticeMessage: "agent-gui-chrome__notice-message",
|
|
@@ -15084,24 +15289,6 @@ function LoadingEllipsis() {
|
|
|
15084
15289
|
/* @__PURE__ */ jsx19("span", {})
|
|
15085
15290
|
] });
|
|
15086
15291
|
}
|
|
15087
|
-
function ChromeMessageTooltip({
|
|
15088
|
-
message,
|
|
15089
|
-
children
|
|
15090
|
-
}) {
|
|
15091
|
-
"use memo";
|
|
15092
|
-
return /* @__PURE__ */ jsx19(TooltipProvider, { delayDuration: 250, children: /* @__PURE__ */ jsxs12(Tooltip, { children: [
|
|
15093
|
-
/* @__PURE__ */ jsx19(TooltipTrigger, { asChild: true, children }),
|
|
15094
|
-
/* @__PURE__ */ jsx19(
|
|
15095
|
-
TooltipContent,
|
|
15096
|
-
{
|
|
15097
|
-
className: AgentGUIChrome_styles_default.chromeMessageTooltip,
|
|
15098
|
-
side: "top",
|
|
15099
|
-
sideOffset: 6,
|
|
15100
|
-
children: message
|
|
15101
|
-
}
|
|
15102
|
-
)
|
|
15103
|
-
] }) });
|
|
15104
|
-
}
|
|
15105
15292
|
function AgentChromeNotice({
|
|
15106
15293
|
tone,
|
|
15107
15294
|
title,
|
|
@@ -15157,7 +15344,15 @@ function AgentSessionChrome({
|
|
|
15157
15344
|
}
|
|
15158
15345
|
return /* @__PURE__ */ jsxs12("div", { className: AgentGUIChrome_styles_default.sessionChrome, children: [
|
|
15159
15346
|
visibleAuth ? /* @__PURE__ */ jsx19("section", { className: cn(AgentGUIChrome_styles_default.chromeCard, AgentGUIChrome_styles_default.chromeCardWarning), children: /* @__PURE__ */ jsxs12("div", { className: AgentGUIChrome_styles_default.chromeMetaRow, children: [
|
|
15160
|
-
/* @__PURE__ */ jsx19("div", { className: AgentGUIChrome_styles_default.chromeMessageSlot, children: /* @__PURE__ */ jsx19(
|
|
15347
|
+
/* @__PURE__ */ jsx19("div", { className: AgentGUIChrome_styles_default.chromeMessageSlot, children: /* @__PURE__ */ jsx19(
|
|
15348
|
+
"p",
|
|
15349
|
+
{
|
|
15350
|
+
className: AgentGUIChrome_styles_default.chromeMessage,
|
|
15351
|
+
tabIndex: 0,
|
|
15352
|
+
title: visibleAuth.message,
|
|
15353
|
+
children: visibleAuth.message
|
|
15354
|
+
}
|
|
15355
|
+
) }),
|
|
15161
15356
|
/* @__PURE__ */ jsxs12("div", { className: AgentGUIChrome_styles_default.chromeInlineActions, children: [
|
|
15162
15357
|
onAuthLogin ? /* @__PURE__ */ jsx19(
|
|
15163
15358
|
Button2,
|
|
@@ -15220,18 +15415,19 @@ function AgentSessionChrome({
|
|
|
15220
15415
|
size: 16
|
|
15221
15416
|
}
|
|
15222
15417
|
) : null,
|
|
15223
|
-
/* @__PURE__ */ jsx19(
|
|
15418
|
+
/* @__PURE__ */ jsx19(
|
|
15224
15419
|
"p",
|
|
15225
15420
|
{
|
|
15226
15421
|
className: AgentGUIChrome_styles_default.chromeMessage,
|
|
15227
15422
|
"aria-label": visibleRecovery.kind === "activating" ? recoveryMessage : void 0,
|
|
15228
15423
|
tabIndex: 0,
|
|
15424
|
+
title: recoveryMessage,
|
|
15229
15425
|
children: visibleRecovery.kind === "activating" ? /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
15230
15426
|
/* @__PURE__ */ jsx19("span", { className: "tsh-inline-loading-label", children: activatingMessage.label }),
|
|
15231
15427
|
activatingMessage.ellipsis ? /* @__PURE__ */ jsx19(LoadingEllipsis, {}) : null
|
|
15232
15428
|
] }) : recoveryMessage
|
|
15233
15429
|
}
|
|
15234
|
-
)
|
|
15430
|
+
)
|
|
15235
15431
|
] }),
|
|
15236
15432
|
/* @__PURE__ */ jsx19("div", { className: AgentGUIChrome_styles_default.chromeInlineActions, children: visibleRecovery.kind === "resume-unavailable" ? /* @__PURE__ */ jsx19(
|
|
15237
15433
|
Button2,
|
|
@@ -15261,7 +15457,7 @@ function AgentSessionChrome({
|
|
|
15261
15457
|
}
|
|
15262
15458
|
|
|
15263
15459
|
// agent-gui/agentGuiNode/AgentComposer.tsx
|
|
15264
|
-
import { useEffect as useEffect28, useRef as
|
|
15460
|
+
import { useEffect as useEffect28, useRef as useRef30, useState as useState20 } from "react";
|
|
15265
15461
|
import { repairMentionPaletteHighlight } from "@tutti-os/ui-rich-text/at-panel";
|
|
15266
15462
|
|
|
15267
15463
|
// agent-gui/agentGuiNode/AgentSlashStatusPanel.tsx
|
|
@@ -15392,7 +15588,7 @@ function AgentSlashStatusPanel({
|
|
|
15392
15588
|
import { flushSync as flushSync3 } from "react-dom";
|
|
15393
15589
|
import {
|
|
15394
15590
|
useCallback as useCallback28,
|
|
15395
|
-
useRef as
|
|
15591
|
+
useRef as useRef20
|
|
15396
15592
|
} from "react";
|
|
15397
15593
|
|
|
15398
15594
|
// agent-gui/agentGuiNode/composer/composerDraftUtils.ts
|
|
@@ -15454,7 +15650,7 @@ function agentComposerDevConsoleDiagnosticSinkEnabled(runtime) {
|
|
|
15454
15650
|
|
|
15455
15651
|
// agent-gui/agentGuiNode/composer/useComposerDraftAttachments.ts
|
|
15456
15652
|
function useStableEventCallback2(callback) {
|
|
15457
|
-
const callbackRef =
|
|
15653
|
+
const callbackRef = useRef20(callback);
|
|
15458
15654
|
callbackRef.current = callback;
|
|
15459
15655
|
return useCallback28((...args) => callbackRef.current(...args), []);
|
|
15460
15656
|
}
|
|
@@ -15510,7 +15706,7 @@ function useComposerDraftAttachments({
|
|
|
15510
15706
|
return next;
|
|
15511
15707
|
}
|
|
15512
15708
|
);
|
|
15513
|
-
const openReferencesForEntityRef =
|
|
15709
|
+
const openReferencesForEntityRef = useRef20(null);
|
|
15514
15710
|
const handleDraftChange = useStableEventCallback2(
|
|
15515
15711
|
(nextDraft) => {
|
|
15516
15712
|
if (isGoalModeActive) {
|
|
@@ -16512,7 +16708,7 @@ import {
|
|
|
16512
16708
|
import {
|
|
16513
16709
|
useCallback as useCallback29,
|
|
16514
16710
|
useEffect as useEffect18,
|
|
16515
|
-
useRef as
|
|
16711
|
+
useRef as useRef21,
|
|
16516
16712
|
useState as useState10
|
|
16517
16713
|
} from "react";
|
|
16518
16714
|
import {
|
|
@@ -16560,14 +16756,14 @@ function AgentUsageChip({
|
|
|
16560
16756
|
}) {
|
|
16561
16757
|
"use memo";
|
|
16562
16758
|
const [usagePopoverOpen, setUsagePopoverOpen] = useState10(false);
|
|
16563
|
-
const usagePopoverHoverTimerRef =
|
|
16564
|
-
const usagePopoverContentRef =
|
|
16759
|
+
const usagePopoverHoverTimerRef = useRef21(null);
|
|
16760
|
+
const usagePopoverContentRef = useRef21(null);
|
|
16565
16761
|
const clampedPercent = Math.max(0, Math.min(100, percentUsed));
|
|
16566
16762
|
const chipLabel = labels.usageChipLabel({ percent: clampedPercent });
|
|
16567
16763
|
const showTokens = usedTokens !== null && totalTokens !== null;
|
|
16568
16764
|
const usageLevel = agentUsageChipLevel(clampedPercent);
|
|
16569
16765
|
const ringColor = agentUsageRingColor(usageLevel);
|
|
16570
|
-
const usagePopoverCloseTimerRef =
|
|
16766
|
+
const usagePopoverCloseTimerRef = useRef21(null);
|
|
16571
16767
|
const clearUsagePopoverHoverTimer = useCallback29(() => {
|
|
16572
16768
|
if (usagePopoverHoverTimerRef.current) {
|
|
16573
16769
|
clearTimeout(usagePopoverHoverTimerRef.current);
|
|
@@ -16993,23 +17189,10 @@ function useMentionPaletteFrame(inputShellRef, showFileMentionPalette) {
|
|
|
16993
17189
|
import {
|
|
16994
17190
|
useCallback as useCallback31,
|
|
16995
17191
|
useMemo as useMemo23,
|
|
16996
|
-
useRef as
|
|
17192
|
+
useRef as useRef22
|
|
16997
17193
|
} from "react";
|
|
16998
|
-
|
|
16999
|
-
// agent-gui/agentGuiNode/model/composerModeSelection.ts
|
|
17000
|
-
function permissionModeSelectionPatch(permissionModeId, options) {
|
|
17001
|
-
return options.clearsPlanMode ? { permissionModeId, planMode: false } : { permissionModeId };
|
|
17002
|
-
}
|
|
17003
|
-
function resolvePermissionModeControlsDisabled(options) {
|
|
17004
|
-
if (options.changeDuringTurnSupported) {
|
|
17005
|
-
return options.isSubmittingPrompt;
|
|
17006
|
-
}
|
|
17007
|
-
return options.isSendingTurn || options.isSubmittingPrompt || options.showStopButton;
|
|
17008
|
-
}
|
|
17009
|
-
|
|
17010
|
-
// agent-gui/agentGuiNode/composer/useComposerSlashActions.ts
|
|
17011
17194
|
function useStableEventCallback3(callback) {
|
|
17012
|
-
const callbackRef =
|
|
17195
|
+
const callbackRef = useRef22(callback);
|
|
17013
17196
|
callbackRef.current = callback;
|
|
17014
17197
|
return useCallback31((...args) => callbackRef.current(...args), []);
|
|
17015
17198
|
}
|
|
@@ -17322,25 +17505,24 @@ function useComposerSlashActions(input) {
|
|
|
17322
17505
|
}
|
|
17323
17506
|
}
|
|
17324
17507
|
setIsPaletteOpen(false);
|
|
17325
|
-
const
|
|
17508
|
+
const submission = projectAgentComposerDraftSubmission({
|
|
17326
17509
|
draft: nextDraftContent,
|
|
17327
17510
|
skills: availableSkills
|
|
17328
17511
|
});
|
|
17329
|
-
const submitDisplayPrompt = agentComposerDraftDisplayPrompt(nextDraftContent);
|
|
17330
17512
|
if (options?.guidance === true) {
|
|
17331
17513
|
if (!onSubmitGuidance) {
|
|
17332
17514
|
return;
|
|
17333
17515
|
}
|
|
17334
|
-
if (
|
|
17335
|
-
onSubmitGuidance(
|
|
17516
|
+
if (submission.displayPrompt) {
|
|
17517
|
+
onSubmitGuidance(submission.content, submission.displayPrompt);
|
|
17336
17518
|
} else {
|
|
17337
|
-
onSubmitGuidance(
|
|
17519
|
+
onSubmitGuidance(submission.content);
|
|
17338
17520
|
}
|
|
17339
17521
|
} else {
|
|
17340
|
-
if (
|
|
17341
|
-
onSubmit(
|
|
17522
|
+
if (submission.displayPrompt) {
|
|
17523
|
+
onSubmit(submission.content, submission.displayPrompt);
|
|
17342
17524
|
} else {
|
|
17343
|
-
onSubmit(
|
|
17525
|
+
onSubmit(submission.content);
|
|
17344
17526
|
}
|
|
17345
17527
|
}
|
|
17346
17528
|
}
|
|
@@ -17431,7 +17613,7 @@ function useComposerSlashActions(input) {
|
|
|
17431
17613
|
import {
|
|
17432
17614
|
useCallback as useCallback32,
|
|
17433
17615
|
useEffect as useEffect19,
|
|
17434
|
-
useRef as
|
|
17616
|
+
useRef as useRef23
|
|
17435
17617
|
} from "react";
|
|
17436
17618
|
import {
|
|
17437
17619
|
createMentionPaletteStateAdapter,
|
|
@@ -17451,7 +17633,7 @@ function isAgentRichTextImeComposing(event) {
|
|
|
17451
17633
|
|
|
17452
17634
|
// agent-gui/agentGuiNode/composer/useComposerMentionActions.ts
|
|
17453
17635
|
function useStableEventCallback4(callback) {
|
|
17454
|
-
const callbackRef =
|
|
17636
|
+
const callbackRef = useRef23(callback);
|
|
17455
17637
|
callbackRef.current = callback;
|
|
17456
17638
|
return useCallback32((...args) => callbackRef.current(...args), []);
|
|
17457
17639
|
}
|
|
@@ -18655,17 +18837,17 @@ import { createPortal as createPortal4 } from "react-dom";
|
|
|
18655
18837
|
import {
|
|
18656
18838
|
Popover as Popover3,
|
|
18657
18839
|
PopoverAnchor as PopoverAnchor2,
|
|
18658
|
-
Tooltip as
|
|
18659
|
-
TooltipContent as
|
|
18660
|
-
TooltipProvider as
|
|
18661
|
-
TooltipTrigger as
|
|
18840
|
+
Tooltip as Tooltip4,
|
|
18841
|
+
TooltipContent as TooltipContent4,
|
|
18842
|
+
TooltipProvider as TooltipProvider3,
|
|
18843
|
+
TooltipTrigger as TooltipTrigger4
|
|
18662
18844
|
} from "@tutti-os/ui-system";
|
|
18663
18845
|
|
|
18664
18846
|
// agent-gui/agentGuiNode/AgentQueuedPromptPanel.tsx
|
|
18665
18847
|
import {
|
|
18666
18848
|
Component as Component2,
|
|
18667
18849
|
useLayoutEffect as useLayoutEffect4,
|
|
18668
|
-
useRef as
|
|
18850
|
+
useRef as useRef24,
|
|
18669
18851
|
useState as useState15
|
|
18670
18852
|
} from "react";
|
|
18671
18853
|
import { ChevronRight } from "lucide-react";
|
|
@@ -18674,10 +18856,10 @@ import {
|
|
|
18674
18856
|
DropdownMenuContent as DropdownMenuContent2,
|
|
18675
18857
|
DropdownMenuItem,
|
|
18676
18858
|
DropdownMenuTrigger as DropdownMenuTrigger2,
|
|
18677
|
-
Tooltip
|
|
18678
|
-
TooltipContent
|
|
18679
|
-
TooltipProvider
|
|
18680
|
-
TooltipTrigger
|
|
18859
|
+
Tooltip,
|
|
18860
|
+
TooltipContent,
|
|
18861
|
+
TooltipProvider,
|
|
18862
|
+
TooltipTrigger,
|
|
18681
18863
|
useTextOverflow
|
|
18682
18864
|
} from "@tutti-os/ui-system";
|
|
18683
18865
|
import { extractPlainTextFromContent } from "@tutti-os/ui-rich-text";
|
|
@@ -18926,9 +19108,9 @@ function AgentQueuedPromptText({
|
|
|
18926
19108
|
)
|
|
18927
19109
|
}
|
|
18928
19110
|
);
|
|
18929
|
-
return /* @__PURE__ */ jsx24(
|
|
18930
|
-
/* @__PURE__ */ jsx24(
|
|
18931
|
-
overflowing && title ? /* @__PURE__ */ jsx24(
|
|
19111
|
+
return /* @__PURE__ */ jsx24(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs17(Tooltip, { children: [
|
|
19112
|
+
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: content }),
|
|
19113
|
+
overflowing && title ? /* @__PURE__ */ jsx24(TooltipContent, { className: "max-w-[min(520px,calc(100vw-32px))] whitespace-pre-wrap text-left [overflow-wrap:anywhere]", children: title }) : null
|
|
18932
19114
|
] }) });
|
|
18933
19115
|
}
|
|
18934
19116
|
function AgentQueuedPromptPanel({
|
|
@@ -18947,9 +19129,9 @@ function AgentQueuedPromptPanel({
|
|
|
18947
19129
|
"use memo";
|
|
18948
19130
|
const runtime = useOptionalAgentActivityRuntime();
|
|
18949
19131
|
const [isExpanded, setIsExpanded] = useState15(false);
|
|
18950
|
-
const singlePromptTextRef =
|
|
18951
|
-
const queuedPromptListRef =
|
|
18952
|
-
const pointerHandledEditPromptIdRef =
|
|
19132
|
+
const singlePromptTextRef = useRef24(null);
|
|
19133
|
+
const queuedPromptListRef = useRef24(null);
|
|
19134
|
+
const pointerHandledEditPromptIdRef = useRef24(null);
|
|
18953
19135
|
const [isSinglePromptOverflowing, setIsSinglePromptOverflowing] = useState15(false);
|
|
18954
19136
|
const [expandedListMaxHeightPx, setExpandedListMaxHeightPx] = useState15(280);
|
|
18955
19137
|
const singlePromptHasImages = queuedPrompts.length === 1 && queuedPromptImages(queuedPrompts[0]).length > 0;
|
|
@@ -19203,9 +19385,9 @@ import {
|
|
|
19203
19385
|
SelectContent,
|
|
19204
19386
|
SelectItem,
|
|
19205
19387
|
SelectTrigger,
|
|
19206
|
-
Tooltip as
|
|
19207
|
-
TooltipContent as
|
|
19208
|
-
TooltipTrigger as
|
|
19388
|
+
Tooltip as Tooltip2,
|
|
19389
|
+
TooltipContent as TooltipContent2,
|
|
19390
|
+
TooltipTrigger as TooltipTrigger2,
|
|
19209
19391
|
cn as cn3
|
|
19210
19392
|
} from "@tutti-os/ui-system";
|
|
19211
19393
|
|
|
@@ -19799,12 +19981,6 @@ function AgentPermissionModeDropdown({
|
|
|
19799
19981
|
})
|
|
19800
19982
|
);
|
|
19801
19983
|
};
|
|
19802
|
-
const handleSelectedItemPointerDown = (event, permissionModeId) => {
|
|
19803
|
-
if (selectDisabled || event.button !== 0 || event.ctrlKey) {
|
|
19804
|
-
return;
|
|
19805
|
-
}
|
|
19806
|
-
applyPermissionModeId(permissionModeId);
|
|
19807
|
-
};
|
|
19808
19984
|
const trigger = /* @__PURE__ */ jsxs19(
|
|
19809
19985
|
"button",
|
|
19810
19986
|
{
|
|
@@ -19853,9 +20029,9 @@ function AgentPermissionModeDropdown({
|
|
|
19853
20029
|
// The trigger is disabled while loading, so pointer events never reach
|
|
19854
20030
|
// it. Target the tooltip at a focusable wrapper span (Radix's pattern
|
|
19855
20031
|
// for disabled triggers) so hover/focus reliably surfaces the hint.
|
|
19856
|
-
/* @__PURE__ */ jsxs19(
|
|
19857
|
-
/* @__PURE__ */ jsx26(
|
|
19858
|
-
/* @__PURE__ */ jsx26(
|
|
20032
|
+
/* @__PURE__ */ jsxs19(Tooltip2, { children: [
|
|
20033
|
+
/* @__PURE__ */ jsx26(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ jsx26("span", { className: "inline-flex", tabIndex: 0, children: selectTrigger }) }),
|
|
20034
|
+
/* @__PURE__ */ jsx26(TooltipContent2, { side: "top", children: labels.loadingOptions })
|
|
19859
20035
|
] })
|
|
19860
20036
|
) : selectTrigger,
|
|
19861
20037
|
isSelectOpen ? /* @__PURE__ */ jsx26(
|
|
@@ -19875,7 +20051,6 @@ function AgentPermissionModeDropdown({
|
|
|
19875
20051
|
value: option.value,
|
|
19876
20052
|
disabled: selectDisabled,
|
|
19877
20053
|
className: cn3(AgentGUINode_styles_default.composerMenuItem, "group/composer-option"),
|
|
19878
|
-
onPointerDown: (event) => handleSelectedItemPointerDown(event, option.value),
|
|
19879
20054
|
children: /* @__PURE__ */ jsxs19("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
19880
20055
|
/* @__PURE__ */ jsx26("span", { className: "min-w-0 truncate", children: option.label }),
|
|
19881
20056
|
option.description ? /* @__PURE__ */ jsx26(
|
|
@@ -19972,9 +20147,9 @@ function ComposerOptionInfoTooltip({
|
|
|
19972
20147
|
if (!tooltipsEnabled) {
|
|
19973
20148
|
return trigger;
|
|
19974
20149
|
}
|
|
19975
|
-
return /* @__PURE__ */ jsxs19(
|
|
19976
|
-
/* @__PURE__ */ jsx26(
|
|
19977
|
-
/* @__PURE__ */ jsx26(
|
|
20150
|
+
return /* @__PURE__ */ jsxs19(Tooltip2, { children: [
|
|
20151
|
+
/* @__PURE__ */ jsx26(TooltipTrigger2, { asChild: true, children: trigger }),
|
|
20152
|
+
/* @__PURE__ */ jsx26(TooltipContent2, { side: "right", className: "max-w-[240px] whitespace-normal", children: description })
|
|
19978
20153
|
] });
|
|
19979
20154
|
}
|
|
19980
20155
|
function resolvePermissionModeTriggerTone(value) {
|
|
@@ -20055,9 +20230,9 @@ function AgentModelReasoningDropdown({
|
|
|
20055
20230
|
// The trigger is disabled while loading, so pointer events never reach
|
|
20056
20231
|
// it. Target the tooltip at a focusable wrapper span (Radix's pattern
|
|
20057
20232
|
// for disabled triggers) so hover/focus reliably surfaces the hint.
|
|
20058
|
-
/* @__PURE__ */ jsxs19(
|
|
20059
|
-
/* @__PURE__ */ jsx26(
|
|
20060
|
-
/* @__PURE__ */ jsx26(
|
|
20233
|
+
/* @__PURE__ */ jsxs19(Tooltip2, { children: [
|
|
20234
|
+
/* @__PURE__ */ jsx26(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ jsx26("span", { className: "inline-flex", tabIndex: 0, children: /* @__PURE__ */ jsx26(DropdownMenuTrigger3, { asChild: true, disabled: menuDisabled, children: trigger }) }) }),
|
|
20235
|
+
/* @__PURE__ */ jsx26(TooltipContent2, { side: "top", children: labels.loadingOptions })
|
|
20061
20236
|
] })
|
|
20062
20237
|
) : /* @__PURE__ */ jsx26(DropdownMenuTrigger3, { asChild: true, disabled: menuDisabled, children: trigger }),
|
|
20063
20238
|
/* @__PURE__ */ jsxs19(
|
|
@@ -20260,12 +20435,12 @@ function ComposerModelOptionTooltip({
|
|
|
20260
20435
|
if (!tooltipsEnabled || !option.tooltip) {
|
|
20261
20436
|
return children;
|
|
20262
20437
|
}
|
|
20263
|
-
return /* @__PURE__ */ jsxs19(
|
|
20264
|
-
/* @__PURE__ */ jsx26(
|
|
20438
|
+
return /* @__PURE__ */ jsxs19(Tooltip2, { children: [
|
|
20439
|
+
/* @__PURE__ */ jsx26(TooltipTrigger2, { asChild: true, children: cloneElement(children, {
|
|
20265
20440
|
"data-agent-model-option-tooltip-trigger": "true"
|
|
20266
20441
|
}) }),
|
|
20267
20442
|
/* @__PURE__ */ jsxs19(
|
|
20268
|
-
|
|
20443
|
+
TooltipContent2,
|
|
20269
20444
|
{
|
|
20270
20445
|
side: "right",
|
|
20271
20446
|
align: "start",
|
|
@@ -20289,7 +20464,7 @@ import {
|
|
|
20289
20464
|
useCallback as useCallback36,
|
|
20290
20465
|
useEffect as useEffect24,
|
|
20291
20466
|
useMemo as useMemo26,
|
|
20292
|
-
useRef as
|
|
20467
|
+
useRef as useRef26,
|
|
20293
20468
|
useState as useState17
|
|
20294
20469
|
} from "react";
|
|
20295
20470
|
import { useEditor } from "@tiptap/react";
|
|
@@ -20817,7 +20992,7 @@ function useAgentRichTextEditorHandle(input) {
|
|
|
20817
20992
|
// agent-gui/agentGuiNode/agentRichText/AgentRichTextEditorSurface.tsx
|
|
20818
20993
|
import {
|
|
20819
20994
|
useCallback as useCallback35,
|
|
20820
|
-
useRef as
|
|
20995
|
+
useRef as useRef25
|
|
20821
20996
|
} from "react";
|
|
20822
20997
|
import { createPortal as createPortal2 } from "react-dom";
|
|
20823
20998
|
import { EditorContent } from "@tiptap/react";
|
|
@@ -20905,7 +21080,7 @@ function AgentRichTextContextMenuButton({
|
|
|
20905
21080
|
label,
|
|
20906
21081
|
onSelect
|
|
20907
21082
|
}) {
|
|
20908
|
-
const selectionStartedRef =
|
|
21083
|
+
const selectionStartedRef = useRef25(false);
|
|
20909
21084
|
const select = useCallback35(() => {
|
|
20910
21085
|
if (disabled || selectionStartedRef.current) return;
|
|
20911
21086
|
selectionStartedRef.current = true;
|
|
@@ -21007,34 +21182,34 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
21007
21182
|
}, ref) {
|
|
21008
21183
|
"use memo";
|
|
21009
21184
|
const { t } = useTranslation();
|
|
21010
|
-
const lastEmittedPromptRef =
|
|
21011
|
-
const editorRef =
|
|
21012
|
-
const onChangeRef =
|
|
21013
|
-
const onFocusRef =
|
|
21014
|
-
const onUserContentChangeRef =
|
|
21015
|
-
const pendingFocusMethodRef =
|
|
21016
|
-
const onSubmitRef =
|
|
21017
|
-
const onSubmitGuidanceRef =
|
|
21018
|
-
const onKeyDownForPaletteRef =
|
|
21019
|
-
const onFileMentionSuggestionChangeRef =
|
|
21185
|
+
const lastEmittedPromptRef = useRef26(value);
|
|
21186
|
+
const editorRef = useRef26(null);
|
|
21187
|
+
const onChangeRef = useRef26(onChange);
|
|
21188
|
+
const onFocusRef = useRef26(onFocus);
|
|
21189
|
+
const onUserContentChangeRef = useRef26(onUserContentChange);
|
|
21190
|
+
const pendingFocusMethodRef = useRef26(null);
|
|
21191
|
+
const onSubmitRef = useRef26(onSubmit);
|
|
21192
|
+
const onSubmitGuidanceRef = useRef26(onSubmitGuidance);
|
|
21193
|
+
const onKeyDownForPaletteRef = useRef26(onKeyDownForPalette);
|
|
21194
|
+
const onFileMentionSuggestionChangeRef = useRef26(
|
|
21020
21195
|
onFileMentionSuggestionChange
|
|
21021
21196
|
);
|
|
21022
|
-
const onFileMentionSuggestionKeyDownRef =
|
|
21197
|
+
const onFileMentionSuggestionKeyDownRef = useRef26(
|
|
21023
21198
|
onFileMentionSuggestionKeyDown
|
|
21024
21199
|
);
|
|
21025
|
-
const onLinkClickRef =
|
|
21026
|
-
const onPromptImagesUnsupportedRef =
|
|
21027
|
-
const onPasteImagesRef =
|
|
21028
|
-
const onPasteLargeTextRef =
|
|
21029
|
-
const onDropFilesRef =
|
|
21030
|
-
const promptImagesSupportedRef =
|
|
21031
|
-
const getReferenceForFileRef =
|
|
21032
|
-
const placeholderRef =
|
|
21033
|
-
const removeMentionLabelRef =
|
|
21034
|
-
const availableSkillsRef =
|
|
21035
|
-
const availableCapabilitiesRef =
|
|
21036
|
-
const suppressPastedAtSuggestionRef =
|
|
21037
|
-
const scrollFrameRef =
|
|
21200
|
+
const onLinkClickRef = useRef26(onLinkClick);
|
|
21201
|
+
const onPromptImagesUnsupportedRef = useRef26(onPromptImagesUnsupported);
|
|
21202
|
+
const onPasteImagesRef = useRef26(onPasteImages);
|
|
21203
|
+
const onPasteLargeTextRef = useRef26(onPasteLargeText);
|
|
21204
|
+
const onDropFilesRef = useRef26(onDropFiles);
|
|
21205
|
+
const promptImagesSupportedRef = useRef26(promptImagesSupported);
|
|
21206
|
+
const getReferenceForFileRef = useRef26(getReferenceForFile);
|
|
21207
|
+
const placeholderRef = useRef26(placeholder);
|
|
21208
|
+
const removeMentionLabelRef = useRef26(removeMentionLabel);
|
|
21209
|
+
const availableSkillsRef = useRef26(availableSkills);
|
|
21210
|
+
const availableCapabilitiesRef = useRef26(availableCapabilities);
|
|
21211
|
+
const suppressPastedAtSuggestionRef = useRef26(false);
|
|
21212
|
+
const scrollFrameRef = useRef26(null);
|
|
21038
21213
|
const [contextMenu, setContextMenu] = useState17(null);
|
|
21039
21214
|
const closeContextMenu = useCallback36(() => {
|
|
21040
21215
|
setContextMenu(null);
|
|
@@ -21619,7 +21794,7 @@ function AgentReferenceProvenanceFilterControl({
|
|
|
21619
21794
|
}
|
|
21620
21795
|
|
|
21621
21796
|
// agent-gui/agentGuiNode/AgentSlashCommandPalette.tsx
|
|
21622
|
-
import { Fragment as Fragment8, useEffect as useEffect25, useRef as
|
|
21797
|
+
import { Fragment as Fragment8, useEffect as useEffect25, useRef as useRef27 } from "react";
|
|
21623
21798
|
import { Spinner as Spinner3 } from "@tutti-os/ui-system";
|
|
21624
21799
|
import {
|
|
21625
21800
|
Globe,
|
|
@@ -21666,7 +21841,7 @@ function AgentSlashCommandPalette({
|
|
|
21666
21841
|
onSelectSkill
|
|
21667
21842
|
}) {
|
|
21668
21843
|
"use memo";
|
|
21669
|
-
const highlightedOptionRef =
|
|
21844
|
+
const highlightedOptionRef = useRef27(null);
|
|
21670
21845
|
useEffect25(() => {
|
|
21671
21846
|
highlightedOptionRef.current?.scrollIntoView({ block: "nearest" });
|
|
21672
21847
|
}, [highlightedIndex]);
|
|
@@ -21867,7 +22042,7 @@ function slashPaletteEntryIcon(entry) {
|
|
|
21867
22042
|
}
|
|
21868
22043
|
|
|
21869
22044
|
// agent-gui/agentGuiNode/AgentReviewPickerPanel.tsx
|
|
21870
|
-
import { useCallback as useCallback37, useEffect as useEffect26, useMemo as useMemo27, useRef as
|
|
22045
|
+
import { useCallback as useCallback37, useEffect as useEffect26, useMemo as useMemo27, useRef as useRef28, useState as useState18 } from "react";
|
|
21871
22046
|
import { menuItemClassName } from "@tutti-os/ui-system";
|
|
21872
22047
|
|
|
21873
22048
|
// agent-gui/agentGuiNode/AgentReviewBranchController.ts
|
|
@@ -21985,9 +22160,9 @@ function AgentReviewPickerPanel({
|
|
|
21985
22160
|
const [stage, setStage] = useState18("root");
|
|
21986
22161
|
const [query, setQuery] = useState18("");
|
|
21987
22162
|
const [highlightedIndex, setHighlightedIndex] = useState18(0);
|
|
21988
|
-
const searchInputRef =
|
|
21989
|
-
const highlightedOptionRef =
|
|
21990
|
-
const reviewBranchControllerRef =
|
|
22163
|
+
const searchInputRef = useRef28(null);
|
|
22164
|
+
const highlightedOptionRef = useRef28(null);
|
|
22165
|
+
const reviewBranchControllerRef = useRef28(
|
|
21991
22166
|
null
|
|
21992
22167
|
);
|
|
21993
22168
|
const [branchState, setBranchState] = useState18({
|
|
@@ -22232,7 +22407,7 @@ import {
|
|
|
22232
22407
|
useEffect as useEffect27,
|
|
22233
22408
|
useLayoutEffect as useLayoutEffect5,
|
|
22234
22409
|
useMemo as useMemo28,
|
|
22235
|
-
useRef as
|
|
22410
|
+
useRef as useRef29,
|
|
22236
22411
|
useState as useState19
|
|
22237
22412
|
} from "react";
|
|
22238
22413
|
import { createPortal as createPortal3 } from "react-dom";
|
|
@@ -22379,7 +22554,7 @@ var ComposerFloatingMenuSurface = forwardRef4(function ComposerFloatingMenuSurfa
|
|
|
22379
22554
|
surfaceRef,
|
|
22380
22555
|
testId
|
|
22381
22556
|
}, forwardedRef) {
|
|
22382
|
-
const localSurfaceRef =
|
|
22557
|
+
const localSurfaceRef = useRef29(null);
|
|
22383
22558
|
const frame = useComposerAnchoredMenuFrame({
|
|
22384
22559
|
anchorRef,
|
|
22385
22560
|
maxHeight,
|
|
@@ -22645,10 +22820,10 @@ import {
|
|
|
22645
22820
|
SelectContent as SelectContent2,
|
|
22646
22821
|
SelectItem as SelectItem2,
|
|
22647
22822
|
SelectTrigger as SelectTrigger2,
|
|
22648
|
-
Tooltip as
|
|
22649
|
-
TooltipContent as
|
|
22650
|
-
TooltipProvider as
|
|
22651
|
-
TooltipTrigger as
|
|
22823
|
+
Tooltip as Tooltip3,
|
|
22824
|
+
TooltipContent as TooltipContent3,
|
|
22825
|
+
TooltipProvider as TooltipProvider2,
|
|
22826
|
+
TooltipTrigger as TooltipTrigger3
|
|
22652
22827
|
} from "@tutti-os/ui-system";
|
|
22653
22828
|
|
|
22654
22829
|
// app/renderer/assets/icons/add-lined-bold.svg
|
|
@@ -22700,8 +22875,8 @@ function ComposerFooter({
|
|
|
22700
22875
|
return /* @__PURE__ */ jsx34(Fragment10, { children: /* @__PURE__ */ jsxs24("div", { className: AgentGUINode_styles_default.composerFooter, children: [
|
|
22701
22876
|
/* @__PURE__ */ jsxs24("div", { className: composerStyles.footerGroup, children: [
|
|
22702
22877
|
/* @__PURE__ */ jsxs24("div", { className: "inline-flex shrink-0 items-center gap-1", children: [
|
|
22703
|
-
previewMode ? /* @__PURE__ */ jsx34(
|
|
22704
|
-
/* @__PURE__ */ jsx34(
|
|
22878
|
+
previewMode ? /* @__PURE__ */ jsx34(TooltipProvider2, { delayDuration: 120, children: /* @__PURE__ */ jsxs24(Tooltip3, { children: [
|
|
22879
|
+
/* @__PURE__ */ jsx34(TooltipTrigger3, { asChild: true, children: /* @__PURE__ */ jsx34(
|
|
22705
22880
|
"button",
|
|
22706
22881
|
{
|
|
22707
22882
|
type: "button",
|
|
@@ -22720,50 +22895,47 @@ function ComposerFooter({
|
|
|
22720
22895
|
)
|
|
22721
22896
|
}
|
|
22722
22897
|
) }),
|
|
22723
|
-
/* @__PURE__ */ jsx34(
|
|
22724
|
-
] }) }) : /* @__PURE__ */ jsx34(
|
|
22725
|
-
|
|
22726
|
-
|
|
22727
|
-
|
|
22728
|
-
|
|
22729
|
-
|
|
22730
|
-
|
|
22731
|
-
|
|
22732
|
-
|
|
22733
|
-
|
|
22734
|
-
|
|
22735
|
-
|
|
22736
|
-
|
|
22737
|
-
|
|
22738
|
-
|
|
22739
|
-
|
|
22740
|
-
|
|
22741
|
-
|
|
22742
|
-
|
|
22743
|
-
|
|
22744
|
-
|
|
22745
|
-
|
|
22746
|
-
|
|
22747
|
-
|
|
22748
|
-
|
|
22749
|
-
|
|
22750
|
-
|
|
22751
|
-
|
|
22752
|
-
|
|
22753
|
-
|
|
22754
|
-
|
|
22755
|
-
|
|
22756
|
-
|
|
22757
|
-
|
|
22758
|
-
|
|
22759
|
-
|
|
22760
|
-
|
|
22761
|
-
|
|
22762
|
-
|
|
22763
|
-
/* @__PURE__ */ jsx34(
|
|
22764
|
-
] }) }),
|
|
22765
|
-
/* @__PURE__ */ jsx34(TooltipProvider3, { delayDuration: 120, children: /* @__PURE__ */ jsxs24(Tooltip4, { children: [
|
|
22766
|
-
/* @__PURE__ */ jsx34(TooltipTrigger4, { asChild: true, children: /* @__PURE__ */ jsx34(
|
|
22898
|
+
/* @__PURE__ */ jsx34(TooltipContent3, { side: "top", children: labels.addContent })
|
|
22899
|
+
] }) }) : /* @__PURE__ */ jsx34(
|
|
22900
|
+
Select2,
|
|
22901
|
+
{
|
|
22902
|
+
open: false,
|
|
22903
|
+
value: workspaceReferenceSelectValue,
|
|
22904
|
+
disabled: !onRequestWorkspaceReferences || composerControlsHardDisabled,
|
|
22905
|
+
onOpenChange: (isOpen) => {
|
|
22906
|
+
if (isOpen) {
|
|
22907
|
+
void handleWorkspaceReferencePicker();
|
|
22908
|
+
}
|
|
22909
|
+
},
|
|
22910
|
+
onValueChange: (nextValue) => {
|
|
22911
|
+
if (nextValue === workspaceReferenceOptionValue) {
|
|
22912
|
+
void handleWorkspaceReferencePicker();
|
|
22913
|
+
}
|
|
22914
|
+
},
|
|
22915
|
+
children: /* @__PURE__ */ jsx34(
|
|
22916
|
+
SelectTrigger2,
|
|
22917
|
+
{
|
|
22918
|
+
size: "sm",
|
|
22919
|
+
"aria-label": labels.referenceWorkspaceFiles,
|
|
22920
|
+
title: labels.addContent,
|
|
22921
|
+
className: cn(
|
|
22922
|
+
AgentGUINode_styles_default.composerMenuTrigger,
|
|
22923
|
+
AgentGUINode_styles_default.composerReferenceTrigger,
|
|
22924
|
+
"group w-auto justify-center text-[var(--agent-gui-text-secondary)] [&>svg:last-child]:hidden"
|
|
22925
|
+
),
|
|
22926
|
+
children: /* @__PURE__ */ jsx34(
|
|
22927
|
+
AgentComposerMaskIcon,
|
|
22928
|
+
{
|
|
22929
|
+
iconUrl: add_lined_bold_default,
|
|
22930
|
+
marker: "reference-add"
|
|
22931
|
+
}
|
|
22932
|
+
)
|
|
22933
|
+
}
|
|
22934
|
+
)
|
|
22935
|
+
}
|
|
22936
|
+
),
|
|
22937
|
+
/* @__PURE__ */ jsx34(TooltipProvider2, { delayDuration: 120, children: /* @__PURE__ */ jsxs24(Tooltip3, { children: [
|
|
22938
|
+
/* @__PURE__ */ jsx34(TooltipTrigger3, { asChild: true, children: /* @__PURE__ */ jsx34(
|
|
22767
22939
|
"button",
|
|
22768
22940
|
{
|
|
22769
22941
|
type: "button",
|
|
@@ -22795,140 +22967,57 @@ function ComposerFooter({
|
|
|
22795
22967
|
)
|
|
22796
22968
|
}
|
|
22797
22969
|
) }),
|
|
22798
|
-
/* @__PURE__ */ jsx34(
|
|
22970
|
+
/* @__PURE__ */ jsx34(TooltipContent3, { side: "top", children: labels.mentionPalette })
|
|
22799
22971
|
] }) })
|
|
22800
22972
|
] }),
|
|
22801
|
-
showHandoffSelect ? /* @__PURE__ */
|
|
22802
|
-
/* @__PURE__ */ jsxs24(
|
|
22803
|
-
Select2,
|
|
22804
|
-
{
|
|
22805
|
-
value: HANDOFF_SELECT_IDLE_VALUE,
|
|
22806
|
-
disabled: handoffDisabled,
|
|
22807
|
-
onValueChange: (nextTargetId) => {
|
|
22808
|
-
const target = handoffMenuTargets.find(
|
|
22809
|
-
(candidate) => candidate.targetId === nextTargetId
|
|
22810
|
-
);
|
|
22811
|
-
if (!target || target.disabled === true) {
|
|
22812
|
-
return;
|
|
22813
|
-
}
|
|
22814
|
-
onHandoffConversation?.(target);
|
|
22815
|
-
},
|
|
22816
|
-
children: [
|
|
22817
|
-
/* @__PURE__ */ jsx34(TooltipTrigger4, { asChild: true, children: /* @__PURE__ */ jsx34(
|
|
22818
|
-
SelectTrigger2,
|
|
22819
|
-
{
|
|
22820
|
-
size: "sm",
|
|
22821
|
-
"aria-label": effectiveHandoffLabel,
|
|
22822
|
-
title: labels.handoffConversationTooltip,
|
|
22823
|
-
onBlur: () => {
|
|
22824
|
-
setIsHandoffIconPlaying(false);
|
|
22825
|
-
},
|
|
22826
|
-
onFocus: () => {
|
|
22827
|
-
setIsHandoffIconPlaying(true);
|
|
22828
|
-
},
|
|
22829
|
-
onMouseEnter: () => {
|
|
22830
|
-
setIsHandoffIconPlaying(true);
|
|
22831
|
-
},
|
|
22832
|
-
onMouseLeave: () => {
|
|
22833
|
-
setIsHandoffIconPlaying(false);
|
|
22834
|
-
},
|
|
22835
|
-
className: cn(
|
|
22836
|
-
AgentGUINode_styles_default.composerMenuTrigger,
|
|
22837
|
-
AgentGUINode_styles_default.composerProviderSelect,
|
|
22838
|
-
AgentGUINode_styles_default.composerHandoffTrigger,
|
|
22839
|
-
"w-auto max-w-[180px] [&>svg:last-child]:hidden"
|
|
22840
|
-
),
|
|
22841
|
-
children: /* @__PURE__ */ jsxs24("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
22842
|
-
/* @__PURE__ */ jsx34(
|
|
22843
|
-
AgentComposerHandoffIcon,
|
|
22844
|
-
{
|
|
22845
|
-
disabled: handoffDisabled,
|
|
22846
|
-
isPlaying: isHandoffIconPlaying
|
|
22847
|
-
}
|
|
22848
|
-
),
|
|
22849
|
-
/* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate", children: effectiveHandoffLabel })
|
|
22850
|
-
] })
|
|
22851
|
-
}
|
|
22852
|
-
) }),
|
|
22853
|
-
/* @__PURE__ */ jsx34(
|
|
22854
|
-
SelectContent2,
|
|
22855
|
-
{
|
|
22856
|
-
align: "start",
|
|
22857
|
-
className: cn(
|
|
22858
|
-
AgentGUINode_styles_default.composerMenuContent,
|
|
22859
|
-
AgentGUINode_styles_default.composerHandoffMenuContent,
|
|
22860
|
-
"min-w-[190px]"
|
|
22861
|
-
),
|
|
22862
|
-
"aria-label": effectiveHandoffMenuLabel,
|
|
22863
|
-
children: handoffMenuTargets.map((target) => /* @__PURE__ */ jsx34(
|
|
22864
|
-
SelectItem2,
|
|
22865
|
-
{
|
|
22866
|
-
value: target.targetId,
|
|
22867
|
-
className: cn(AgentGUINode_styles_default.composerMenuItem, "gap-2"),
|
|
22868
|
-
disabled: target.disabled === true,
|
|
22869
|
-
children: /* @__PURE__ */ jsxs24("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
22870
|
-
/* @__PURE__ */ jsx34(
|
|
22871
|
-
"img",
|
|
22872
|
-
{
|
|
22873
|
-
alt: "",
|
|
22874
|
-
"aria-hidden": "true",
|
|
22875
|
-
className: "size-4 shrink-0 rounded-[4px]",
|
|
22876
|
-
src: resolveComposerProviderTargetIconUrl(target)
|
|
22877
|
-
}
|
|
22878
|
-
),
|
|
22879
|
-
/* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate", children: target.label })
|
|
22880
|
-
] })
|
|
22881
|
-
},
|
|
22882
|
-
`${target.provider}:${target.targetId}`
|
|
22883
|
-
))
|
|
22884
|
-
}
|
|
22885
|
-
)
|
|
22886
|
-
]
|
|
22887
|
-
}
|
|
22888
|
-
),
|
|
22889
|
-
/* @__PURE__ */ jsx34(TooltipContent4, { side: "top", children: labels.handoffConversationTooltip })
|
|
22890
|
-
] }) }) : showProviderSelect && selectedProviderSwitchTarget ? /* @__PURE__ */ jsxs24(
|
|
22973
|
+
showHandoffSelect ? /* @__PURE__ */ jsxs24(
|
|
22891
22974
|
Select2,
|
|
22892
22975
|
{
|
|
22893
|
-
value:
|
|
22894
|
-
disabled:
|
|
22976
|
+
value: HANDOFF_SELECT_IDLE_VALUE,
|
|
22977
|
+
disabled: handoffDisabled,
|
|
22895
22978
|
onValueChange: (nextTargetId) => {
|
|
22896
|
-
const target =
|
|
22979
|
+
const target = handoffMenuTargets.find(
|
|
22897
22980
|
(candidate) => candidate.targetId === nextTargetId
|
|
22898
22981
|
);
|
|
22899
|
-
if (!target) {
|
|
22982
|
+
if (!target || target.disabled === true) {
|
|
22900
22983
|
return;
|
|
22901
22984
|
}
|
|
22902
|
-
|
|
22903
|
-
provider: target.provider,
|
|
22904
|
-
agentTargetId: target.targetId
|
|
22905
|
-
});
|
|
22985
|
+
onHandoffConversation?.(target);
|
|
22906
22986
|
},
|
|
22907
22987
|
children: [
|
|
22908
22988
|
/* @__PURE__ */ jsx34(
|
|
22909
22989
|
SelectTrigger2,
|
|
22910
22990
|
{
|
|
22911
22991
|
size: "sm",
|
|
22912
|
-
"aria-label":
|
|
22913
|
-
title:
|
|
22992
|
+
"aria-label": effectiveHandoffLabel,
|
|
22993
|
+
title: labels.handoffConversationTooltip,
|
|
22994
|
+
onBlur: () => {
|
|
22995
|
+
setIsHandoffIconPlaying(false);
|
|
22996
|
+
},
|
|
22997
|
+
onFocus: () => {
|
|
22998
|
+
setIsHandoffIconPlaying(true);
|
|
22999
|
+
},
|
|
23000
|
+
onMouseEnter: () => {
|
|
23001
|
+
setIsHandoffIconPlaying(true);
|
|
23002
|
+
},
|
|
23003
|
+
onMouseLeave: () => {
|
|
23004
|
+
setIsHandoffIconPlaying(false);
|
|
23005
|
+
},
|
|
22914
23006
|
className: cn(
|
|
22915
23007
|
AgentGUINode_styles_default.composerMenuTrigger,
|
|
22916
23008
|
AgentGUINode_styles_default.composerProviderSelect,
|
|
22917
|
-
|
|
23009
|
+
AgentGUINode_styles_default.composerHandoffTrigger,
|
|
23010
|
+
"w-auto max-w-[180px] [&>svg:last-child]:hidden"
|
|
22918
23011
|
),
|
|
22919
23012
|
children: /* @__PURE__ */ jsxs24("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
22920
23013
|
/* @__PURE__ */ jsx34(
|
|
22921
|
-
|
|
23014
|
+
AgentComposerHandoffIcon,
|
|
22922
23015
|
{
|
|
22923
|
-
|
|
22924
|
-
|
|
22925
|
-
className: "size-4 shrink-0 rounded-[4px]",
|
|
22926
|
-
src: resolveComposerProviderTargetIconUrl(
|
|
22927
|
-
selectedProviderSwitchTarget
|
|
22928
|
-
)
|
|
23016
|
+
disabled: handoffDisabled,
|
|
23017
|
+
isPlaying: isHandoffIconPlaying
|
|
22929
23018
|
}
|
|
22930
23019
|
),
|
|
22931
|
-
/* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate", children:
|
|
23020
|
+
/* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate", children: effectiveHandoffLabel })
|
|
22932
23021
|
] })
|
|
22933
23022
|
}
|
|
22934
23023
|
),
|
|
@@ -22936,8 +23025,88 @@ function ComposerFooter({
|
|
|
22936
23025
|
SelectContent2,
|
|
22937
23026
|
{
|
|
22938
23027
|
align: "start",
|
|
22939
|
-
className: cn(
|
|
22940
|
-
|
|
23028
|
+
className: cn(
|
|
23029
|
+
AgentGUINode_styles_default.composerMenuContent,
|
|
23030
|
+
AgentGUINode_styles_default.composerHandoffMenuContent,
|
|
23031
|
+
"min-w-[190px]"
|
|
23032
|
+
),
|
|
23033
|
+
"aria-label": effectiveHandoffMenuLabel,
|
|
23034
|
+
children: handoffMenuTargets.map((target) => /* @__PURE__ */ jsx34(
|
|
23035
|
+
SelectItem2,
|
|
23036
|
+
{
|
|
23037
|
+
value: target.targetId,
|
|
23038
|
+
className: cn(AgentGUINode_styles_default.composerMenuItem, "gap-2"),
|
|
23039
|
+
disabled: target.disabled === true,
|
|
23040
|
+
children: /* @__PURE__ */ jsxs24("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
23041
|
+
/* @__PURE__ */ jsx34(
|
|
23042
|
+
"img",
|
|
23043
|
+
{
|
|
23044
|
+
alt: "",
|
|
23045
|
+
"aria-hidden": "true",
|
|
23046
|
+
className: "size-4 shrink-0 rounded-[4px]",
|
|
23047
|
+
src: resolveComposerProviderTargetIconUrl(target)
|
|
23048
|
+
}
|
|
23049
|
+
),
|
|
23050
|
+
/* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate", children: target.label })
|
|
23051
|
+
] })
|
|
23052
|
+
},
|
|
23053
|
+
`${target.provider}:${target.targetId}`
|
|
23054
|
+
))
|
|
23055
|
+
}
|
|
23056
|
+
)
|
|
23057
|
+
]
|
|
23058
|
+
}
|
|
23059
|
+
) : showProviderSelect && selectedProviderSwitchTarget ? /* @__PURE__ */ jsxs24(
|
|
23060
|
+
Select2,
|
|
23061
|
+
{
|
|
23062
|
+
value: selectedProviderSwitchTarget.targetId,
|
|
23063
|
+
disabled: providerSelectDisabled,
|
|
23064
|
+
onValueChange: (nextTargetId) => {
|
|
23065
|
+
const target = providerMenuTargets.find(
|
|
23066
|
+
(candidate) => candidate.targetId === nextTargetId
|
|
23067
|
+
);
|
|
23068
|
+
if (!target) {
|
|
23069
|
+
return;
|
|
23070
|
+
}
|
|
23071
|
+
onProviderSelect?.({
|
|
23072
|
+
provider: target.provider,
|
|
23073
|
+
agentTargetId: target.targetId
|
|
23074
|
+
});
|
|
23075
|
+
},
|
|
23076
|
+
children: [
|
|
23077
|
+
/* @__PURE__ */ jsx34(
|
|
23078
|
+
SelectTrigger2,
|
|
23079
|
+
{
|
|
23080
|
+
size: "sm",
|
|
23081
|
+
"aria-label": providerSelectLabel,
|
|
23082
|
+
title: providerSelectLabel,
|
|
23083
|
+
className: cn(
|
|
23084
|
+
AgentGUINode_styles_default.composerMenuTrigger,
|
|
23085
|
+
AgentGUINode_styles_default.composerProviderSelect,
|
|
23086
|
+
"w-auto max-w-[180px]"
|
|
23087
|
+
),
|
|
23088
|
+
children: /* @__PURE__ */ jsxs24("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
23089
|
+
/* @__PURE__ */ jsx34(
|
|
23090
|
+
"img",
|
|
23091
|
+
{
|
|
23092
|
+
alt: "",
|
|
23093
|
+
"aria-hidden": "true",
|
|
23094
|
+
className: "size-4 shrink-0 rounded-[4px]",
|
|
23095
|
+
src: resolveComposerProviderTargetIconUrl(
|
|
23096
|
+
selectedProviderSwitchTarget
|
|
23097
|
+
)
|
|
23098
|
+
}
|
|
23099
|
+
),
|
|
23100
|
+
/* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate", children: selectedProviderLabel })
|
|
23101
|
+
] })
|
|
23102
|
+
}
|
|
23103
|
+
),
|
|
23104
|
+
/* @__PURE__ */ jsx34(
|
|
23105
|
+
SelectContent2,
|
|
23106
|
+
{
|
|
23107
|
+
align: "start",
|
|
23108
|
+
className: cn(AgentGUINode_styles_default.composerMenuContent, "min-w-[190px]"),
|
|
23109
|
+
children: providerMenuTargets.map((target) => /* @__PURE__ */ jsx34(
|
|
22941
23110
|
SelectItem2,
|
|
22942
23111
|
{
|
|
22943
23112
|
value: target.targetId,
|
|
@@ -23654,10 +23823,10 @@ function AgentComposerView(input) {
|
|
|
23654
23823
|
{
|
|
23655
23824
|
className: AgentGUINode_styles_default.composerPromptTips,
|
|
23656
23825
|
"data-testid": "agent-gui-prompt-tips",
|
|
23657
|
-
children: !previewMode && input.isPromptTipOverflowing && promptTipNode ? /* @__PURE__ */ jsx35(
|
|
23658
|
-
/* @__PURE__ */ jsx35(
|
|
23826
|
+
children: !previewMode && input.isPromptTipOverflowing && promptTipNode ? /* @__PURE__ */ jsx35(TooltipProvider3, { delayDuration: 0, children: /* @__PURE__ */ jsxs25(Tooltip4, { children: [
|
|
23827
|
+
/* @__PURE__ */ jsx35(TooltipTrigger4, { asChild: true, children: promptTipNode }),
|
|
23659
23828
|
/* @__PURE__ */ jsx35(
|
|
23660
|
-
|
|
23829
|
+
TooltipContent4,
|
|
23661
23830
|
{
|
|
23662
23831
|
align: "end",
|
|
23663
23832
|
className: AgentGUINode_styles_default.composerPromptTipTooltip,
|
|
@@ -23791,11 +23960,11 @@ function AgentComposer(props) {
|
|
|
23791
23960
|
const [isSelectedProjectMissing, setIsSelectedProjectMissing] = useState20(false);
|
|
23792
23961
|
const [isSlashStatusPanelOpen, setIsSlashStatusPanelOpen] = useState20(false);
|
|
23793
23962
|
const slashStatusAgentSessionId = slashStatus?.agentSessionId ?? null;
|
|
23794
|
-
const previousSlashStatusAgentSessionIdRef =
|
|
23963
|
+
const previousSlashStatusAgentSessionIdRef = useRef30(
|
|
23795
23964
|
slashStatusAgentSessionId
|
|
23796
23965
|
);
|
|
23797
23966
|
const selectedProjectPath = composerSettings.selectedProjectPath?.trim() ?? "";
|
|
23798
|
-
const previousSelectedProjectPathRef =
|
|
23967
|
+
const previousSelectedProjectPathRef = useRef30(selectedProjectPath);
|
|
23799
23968
|
const [mentionSearchState, setMentionSearchState] = useState20({
|
|
23800
23969
|
status: "idle",
|
|
23801
23970
|
query: "",
|
|
@@ -23805,26 +23974,26 @@ function AgentComposer(props) {
|
|
|
23805
23974
|
groups: [],
|
|
23806
23975
|
error: null
|
|
23807
23976
|
});
|
|
23808
|
-
const composerRef =
|
|
23809
|
-
const inputShellRef =
|
|
23810
|
-
const promptInputAreaRef =
|
|
23811
|
-
const paletteContentRef =
|
|
23812
|
-
const draftPromptRef =
|
|
23813
|
-
const draftImagesRef =
|
|
23814
|
-
const draftFilesRef =
|
|
23815
|
-
const draftLargeTextsRef =
|
|
23816
|
-
const draftByScopeKeyRef =
|
|
23977
|
+
const composerRef = useRef30(null);
|
|
23978
|
+
const inputShellRef = useRef30(null);
|
|
23979
|
+
const promptInputAreaRef = useRef30(null);
|
|
23980
|
+
const paletteContentRef = useRef30(null);
|
|
23981
|
+
const draftPromptRef = useRef30(draftPrompt);
|
|
23982
|
+
const draftImagesRef = useRef30(draftImages);
|
|
23983
|
+
const draftFilesRef = useRef30(draftFiles);
|
|
23984
|
+
const draftLargeTextsRef = useRef30(draftLargeTexts);
|
|
23985
|
+
const draftByScopeKeyRef = useRef30({
|
|
23817
23986
|
[draftScopeKey]: draftContent
|
|
23818
23987
|
});
|
|
23819
23988
|
draftByScopeKeyRef.current[draftScopeKey] = draftContent;
|
|
23820
|
-
const promptTipRef =
|
|
23821
|
-
const mentionControllerRef =
|
|
23989
|
+
const promptTipRef = useRef30(null);
|
|
23990
|
+
const mentionControllerRef = useRef30(
|
|
23822
23991
|
null
|
|
23823
23992
|
);
|
|
23824
|
-
const editorHandleRef =
|
|
23825
|
-
const wasActiveRef =
|
|
23826
|
-
const lastComposerFocusRequestRef =
|
|
23827
|
-
const autoMentionHighlightedKeyRef =
|
|
23993
|
+
const editorHandleRef = useRef30(null);
|
|
23994
|
+
const wasActiveRef = useRef30(isActive);
|
|
23995
|
+
const lastComposerFocusRequestRef = useRef30(null);
|
|
23996
|
+
const autoMentionHighlightedKeyRef = useRef30(null);
|
|
23828
23997
|
const [isPromptTipOverflowing, setIsPromptTipOverflowing] = useState20(false);
|
|
23829
23998
|
const [dockComposerInputHeight, setDockComposerInputHeight] = useState20(
|
|
23830
23999
|
DOCK_COMPOSER_INPUT_MIN_HEIGHT2
|
|
@@ -24996,7 +25165,7 @@ function EmptyHeroTitle({
|
|
|
24996
25165
|
|
|
24997
25166
|
// agent-gui/agentGuiNode/view/AgentGUIProviderManagerDialog.tsx
|
|
24998
25167
|
import {
|
|
24999
|
-
useRef as
|
|
25168
|
+
useRef as useRef31,
|
|
25000
25169
|
useState as useState22
|
|
25001
25170
|
} from "react";
|
|
25002
25171
|
import { CircleMinus, CirclePlus } from "lucide-react";
|
|
@@ -25038,12 +25207,12 @@ function AgentGUIProviderManagerDialog({
|
|
|
25038
25207
|
null
|
|
25039
25208
|
);
|
|
25040
25209
|
const [dragPreview, setDragPreview] = useState22(null);
|
|
25041
|
-
const dragStateRef =
|
|
25042
|
-
const dragPreviewRef =
|
|
25210
|
+
const dragStateRef = useRef31(null);
|
|
25211
|
+
const dragPreviewRef = useRef31(null);
|
|
25043
25212
|
const [longPressTargetId, setLongPressTargetId] = useState22(
|
|
25044
25213
|
null
|
|
25045
25214
|
);
|
|
25046
|
-
const longPressOriginRef =
|
|
25215
|
+
const longPressOriginRef = useRef31(null);
|
|
25047
25216
|
const finalAvailableAgent = availableTargets.length === 1;
|
|
25048
25217
|
const showRunningAgentBlocked = (targetId) => {
|
|
25049
25218
|
const target = targets.find((candidate) => candidate.targetId === targetId);
|
|
@@ -25642,7 +25811,7 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
25642
25811
|
preferences: providerRailPreferences
|
|
25643
25812
|
} = useAgentGUIProviderRailPreferences();
|
|
25644
25813
|
const [dragState, setDragState] = useState24(null);
|
|
25645
|
-
const dragStateRef =
|
|
25814
|
+
const dragStateRef = useRef32(null);
|
|
25646
25815
|
const setProviderRailDragState = useCallback40(
|
|
25647
25816
|
(nextDragState) => {
|
|
25648
25817
|
dragStateRef.current = nextDragState;
|
|
@@ -26102,9 +26271,9 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
26102
26271
|
if (previewMode) {
|
|
26103
26272
|
return tile;
|
|
26104
26273
|
}
|
|
26105
|
-
return /* @__PURE__ */ jsxs30(
|
|
26106
|
-
/* @__PURE__ */ jsx41(
|
|
26107
|
-
/* @__PURE__ */ jsx41(
|
|
26274
|
+
return /* @__PURE__ */ jsxs30(Tooltip5, { children: [
|
|
26275
|
+
/* @__PURE__ */ jsx41(TooltipTrigger5, { asChild: true, children: tile }),
|
|
26276
|
+
/* @__PURE__ */ jsx41(TooltipContent5, { side: "right", sideOffset: -4, children: label })
|
|
26108
26277
|
] }, `${target.provider}:${target.targetId}:tooltip`);
|
|
26109
26278
|
})
|
|
26110
26279
|
]
|
|
@@ -26125,7 +26294,7 @@ import {
|
|
|
26125
26294
|
useEffect as useEffect30,
|
|
26126
26295
|
useLayoutEffect as useLayoutEffect6,
|
|
26127
26296
|
useMemo as useMemo32,
|
|
26128
|
-
useRef as
|
|
26297
|
+
useRef as useRef34,
|
|
26129
26298
|
useState as useState27
|
|
26130
26299
|
} from "react";
|
|
26131
26300
|
import {
|
|
@@ -26254,279 +26423,10 @@ function AgentConversationListSkeleton({
|
|
|
26254
26423
|
);
|
|
26255
26424
|
}
|
|
26256
26425
|
|
|
26257
|
-
// agent-gui/agentGuiNode/agentGuiNodeViewConversation.tsx
|
|
26258
|
-
import { Spinner as Spinner5 } from "@tutti-os/ui-system";
|
|
26259
|
-
import { AskLinedIcon } from "@tutti-os/ui-system/icons";
|
|
26260
|
-
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
26261
|
-
function ConversationMeta({
|
|
26262
|
-
item,
|
|
26263
|
-
nowMs,
|
|
26264
|
-
labels
|
|
26265
|
-
}) {
|
|
26266
|
-
"use memo";
|
|
26267
|
-
const kind = conversationMetaKind(item);
|
|
26268
|
-
if (kind === "loading") {
|
|
26269
|
-
return /* @__PURE__ */ jsx44(
|
|
26270
|
-
"span",
|
|
26271
|
-
{
|
|
26272
|
-
className: AgentGUINode_styles_default.conversationMeta,
|
|
26273
|
-
"data-kind": kind,
|
|
26274
|
-
"data-testid": `agent-gui-conversation-meta-${item.id}`,
|
|
26275
|
-
children: /* @__PURE__ */ jsx44(LoadingGlyph, {})
|
|
26276
|
-
}
|
|
26277
|
-
);
|
|
26278
|
-
}
|
|
26279
|
-
if (kind === "waiting") {
|
|
26280
|
-
return /* @__PURE__ */ jsx44(
|
|
26281
|
-
"span",
|
|
26282
|
-
{
|
|
26283
|
-
className: AgentGUINode_styles_default.conversationMeta,
|
|
26284
|
-
"data-kind": kind,
|
|
26285
|
-
"data-testid": `agent-gui-conversation-meta-${item.id}`,
|
|
26286
|
-
children: /* @__PURE__ */ jsx44(
|
|
26287
|
-
AskLinedIcon,
|
|
26288
|
-
{
|
|
26289
|
-
"aria-hidden": "true",
|
|
26290
|
-
className: AgentGUINode_styles_default.conversationStatusGlyph
|
|
26291
|
-
}
|
|
26292
|
-
)
|
|
26293
|
-
}
|
|
26294
|
-
);
|
|
26295
|
-
}
|
|
26296
|
-
if (kind === "failed") {
|
|
26297
|
-
return /* @__PURE__ */ jsx44(
|
|
26298
|
-
"span",
|
|
26299
|
-
{
|
|
26300
|
-
className: AgentGUINode_styles_default.conversationMeta,
|
|
26301
|
-
"data-kind": kind,
|
|
26302
|
-
"data-testid": `agent-gui-conversation-meta-${item.id}`,
|
|
26303
|
-
children: /* @__PURE__ */ jsx44(AttentionGlyph, {})
|
|
26304
|
-
}
|
|
26305
|
-
);
|
|
26306
|
-
}
|
|
26307
|
-
if (kind === "unread-complete") {
|
|
26308
|
-
return /* @__PURE__ */ jsx44(
|
|
26309
|
-
"span",
|
|
26310
|
-
{
|
|
26311
|
-
className: AgentGUINode_styles_default.conversationMeta,
|
|
26312
|
-
"data-kind": kind,
|
|
26313
|
-
"data-testid": `agent-gui-conversation-meta-${item.id}`,
|
|
26314
|
-
children: /* @__PURE__ */ jsx44("span", { className: AgentGUINode_styles_default.conversationUnreadLamp, "aria-hidden": "true" })
|
|
26315
|
-
}
|
|
26316
|
-
);
|
|
26317
|
-
}
|
|
26318
|
-
return /* @__PURE__ */ jsx44(
|
|
26319
|
-
"span",
|
|
26320
|
-
{
|
|
26321
|
-
className: AgentGUINode_styles_default.conversationMeta,
|
|
26322
|
-
"data-kind": kind,
|
|
26323
|
-
"data-testid": `agent-gui-conversation-meta-${item.id}`,
|
|
26324
|
-
children: /* @__PURE__ */ jsx44("span", { className: AgentGUINode_styles_default.conversationTime, children: formatConversationRelativeTime(
|
|
26325
|
-
resolveAgentGUIConversationSortTimeUnixMs(item),
|
|
26326
|
-
nowMs,
|
|
26327
|
-
labels
|
|
26328
|
-
) })
|
|
26329
|
-
}
|
|
26330
|
-
);
|
|
26331
|
-
}
|
|
26332
|
-
function groupConversations(conversations, labels, userProjects = [], options = {}) {
|
|
26333
|
-
const groups = [];
|
|
26334
|
-
const pinned = conversations.filter((conversation) => (conversation.pinnedAtUnixMs ?? 0) > 0).sort(
|
|
26335
|
-
(left, right) => (right.pinnedAtUnixMs ?? 0) - (left.pinnedAtUnixMs ?? 0) || resolveAgentGUIConversationSortTimeUnixMs(right) - resolveAgentGUIConversationSortTimeUnixMs(left) || left.id.localeCompare(right.id)
|
|
26336
|
-
);
|
|
26337
|
-
if (pinned.length > 0) {
|
|
26338
|
-
groups.push({
|
|
26339
|
-
id: "pinned",
|
|
26340
|
-
kind: "pinned",
|
|
26341
|
-
label: labels.sectionPinned,
|
|
26342
|
-
project: null,
|
|
26343
|
-
items: pinned
|
|
26344
|
-
});
|
|
26345
|
-
}
|
|
26346
|
-
const projectGroups = /* @__PURE__ */ new Map();
|
|
26347
|
-
const normalizedProjectPathByPath = /* @__PURE__ */ new Map();
|
|
26348
|
-
const normalizeProjectPath = (path) => normalizeConversationProjectPathCached(path, normalizedProjectPathByPath);
|
|
26349
|
-
userProjects.forEach((project, projectOrder) => {
|
|
26350
|
-
const normalizedPath = normalizeProjectPath(project.path);
|
|
26351
|
-
const sectionId = conversationProjectSectionId(project, normalizedPath);
|
|
26352
|
-
if (projectGroups.has(sectionId)) {
|
|
26353
|
-
return;
|
|
26354
|
-
}
|
|
26355
|
-
projectGroups.set(sectionId, {
|
|
26356
|
-
id: sectionId,
|
|
26357
|
-
kind: "project",
|
|
26358
|
-
label: project.label,
|
|
26359
|
-
project,
|
|
26360
|
-
items: [],
|
|
26361
|
-
projectOrder,
|
|
26362
|
-
sectionOrder: 0,
|
|
26363
|
-
projectUpdatedAtUnixMs: resolveConversationProjectUpdatedAtUnixMs(project)
|
|
26364
|
-
});
|
|
26365
|
-
});
|
|
26366
|
-
if (options.includeEmptyConversations) {
|
|
26367
|
-
projectGroups.set("conversations", {
|
|
26368
|
-
id: "conversations",
|
|
26369
|
-
kind: "conversations",
|
|
26370
|
-
label: labels.sectionConversations,
|
|
26371
|
-
project: null,
|
|
26372
|
-
items: [],
|
|
26373
|
-
projectOrder: Number.MAX_SAFE_INTEGER,
|
|
26374
|
-
sectionOrder: 1,
|
|
26375
|
-
projectUpdatedAtUnixMs: 0
|
|
26376
|
-
});
|
|
26377
|
-
}
|
|
26378
|
-
for (const conversation of conversations) {
|
|
26379
|
-
if ((conversation.pinnedAtUnixMs ?? 0) > 0) {
|
|
26380
|
-
continue;
|
|
26381
|
-
}
|
|
26382
|
-
if (!conversation.project) {
|
|
26383
|
-
const existing2 = projectGroups.get("conversations");
|
|
26384
|
-
if (existing2) {
|
|
26385
|
-
existing2.items.push(conversation);
|
|
26386
|
-
continue;
|
|
26387
|
-
}
|
|
26388
|
-
projectGroups.set("conversations", {
|
|
26389
|
-
id: "conversations",
|
|
26390
|
-
kind: "conversations",
|
|
26391
|
-
label: labels.sectionConversations,
|
|
26392
|
-
project: null,
|
|
26393
|
-
items: [conversation],
|
|
26394
|
-
projectOrder: Number.MAX_SAFE_INTEGER,
|
|
26395
|
-
sectionOrder: 1,
|
|
26396
|
-
projectUpdatedAtUnixMs: 0
|
|
26397
|
-
});
|
|
26398
|
-
continue;
|
|
26399
|
-
}
|
|
26400
|
-
const normalizedPath = normalizeProjectPath(conversation.project.path);
|
|
26401
|
-
const sectionId = conversationProjectSectionId(
|
|
26402
|
-
conversation.project,
|
|
26403
|
-
normalizedPath
|
|
26404
|
-
);
|
|
26405
|
-
const existing = projectGroups.get(sectionId);
|
|
26406
|
-
if (existing) {
|
|
26407
|
-
existing.items.push(conversation);
|
|
26408
|
-
continue;
|
|
26409
|
-
}
|
|
26410
|
-
projectGroups.set(sectionId, {
|
|
26411
|
-
id: sectionId,
|
|
26412
|
-
kind: "project",
|
|
26413
|
-
label: conversation.project.label,
|
|
26414
|
-
project: conversation.project,
|
|
26415
|
-
items: [conversation],
|
|
26416
|
-
projectOrder: Number.MAX_SAFE_INTEGER - 1,
|
|
26417
|
-
sectionOrder: 0,
|
|
26418
|
-
projectUpdatedAtUnixMs: resolveConversationProjectUpdatedAtUnixMs(
|
|
26419
|
-
conversation.project
|
|
26420
|
-
)
|
|
26421
|
-
});
|
|
26422
|
-
}
|
|
26423
|
-
groups.push(
|
|
26424
|
-
...[...projectGroups.values()].filter(
|
|
26425
|
-
(group) => options.includeEmptyConversations || group.items.length > 0
|
|
26426
|
-
).sort(
|
|
26427
|
-
(left, right) => left.sectionOrder - right.sectionOrder || right.projectUpdatedAtUnixMs - left.projectUpdatedAtUnixMs || left.projectOrder - right.projectOrder || left.label.localeCompare(right.label) || left.id.localeCompare(right.id)
|
|
26428
|
-
).map(
|
|
26429
|
-
({
|
|
26430
|
-
projectOrder: _projectOrder,
|
|
26431
|
-
sectionOrder: _sectionOrder,
|
|
26432
|
-
projectUpdatedAtUnixMs: _projectUpdatedAtUnixMs,
|
|
26433
|
-
...group
|
|
26434
|
-
}) => group
|
|
26435
|
-
)
|
|
26436
|
-
);
|
|
26437
|
-
return groups;
|
|
26438
|
-
}
|
|
26439
|
-
function resolveConversationProjectUpdatedAtUnixMs(project) {
|
|
26440
|
-
if (!project) {
|
|
26441
|
-
return 0;
|
|
26442
|
-
}
|
|
26443
|
-
return project.updatedAtUnixMs ?? project.lastUsedAtUnixMs ?? project.createdAtUnixMs ?? 0;
|
|
26444
|
-
}
|
|
26445
|
-
function normalizeConversationProjectPathCached(path, normalizedPathByPath) {
|
|
26446
|
-
const cached = normalizedPathByPath.get(path);
|
|
26447
|
-
if (cached !== void 0) {
|
|
26448
|
-
return cached;
|
|
26449
|
-
}
|
|
26450
|
-
const normalized = normalizeAgentGUIProjectPath(path);
|
|
26451
|
-
normalizedPathByPath.set(path, normalized);
|
|
26452
|
-
return normalized;
|
|
26453
|
-
}
|
|
26454
|
-
function conversationProjectSectionId(project, normalizedPath) {
|
|
26455
|
-
return project.sectionKey?.trim() || `project:${normalizedPath}`;
|
|
26456
|
-
}
|
|
26457
|
-
function conversationMetaKind(conversation) {
|
|
26458
|
-
if (conversation.status === "working") {
|
|
26459
|
-
return "loading";
|
|
26460
|
-
}
|
|
26461
|
-
if (conversation.status === "waiting") {
|
|
26462
|
-
return "waiting";
|
|
26463
|
-
}
|
|
26464
|
-
if (conversation.status === "failed") {
|
|
26465
|
-
return "failed";
|
|
26466
|
-
}
|
|
26467
|
-
if (conversation.hasUnreadCompletion) {
|
|
26468
|
-
return "unread-complete";
|
|
26469
|
-
}
|
|
26470
|
-
return "time";
|
|
26471
|
-
}
|
|
26472
|
-
function formatConversationRelativeTime(updatedAtUnixMs, nowMs, labels) {
|
|
26473
|
-
const elapsedMs = Math.max(0, nowMs - updatedAtUnixMs);
|
|
26474
|
-
const elapsedMinutes = Math.floor(elapsedMs / (60 * 1e3));
|
|
26475
|
-
if (elapsedMinutes < 1) {
|
|
26476
|
-
return labels.relativeTimeJustNow;
|
|
26477
|
-
}
|
|
26478
|
-
if (elapsedMinutes < 60) {
|
|
26479
|
-
return labels.relativeTimeMinutes(elapsedMinutes);
|
|
26480
|
-
}
|
|
26481
|
-
const elapsedHours = Math.floor(elapsedMinutes / 60);
|
|
26482
|
-
if (elapsedHours < 24) {
|
|
26483
|
-
return labels.relativeTimeHours(elapsedHours);
|
|
26484
|
-
}
|
|
26485
|
-
const elapsedDays = Math.floor(elapsedHours / 24);
|
|
26486
|
-
if (elapsedDays < 30) {
|
|
26487
|
-
return labels.relativeTimeDays(elapsedDays);
|
|
26488
|
-
}
|
|
26489
|
-
const elapsedMonths = Math.floor(elapsedDays / 30);
|
|
26490
|
-
if (elapsedMonths < 12) {
|
|
26491
|
-
return labels.relativeTimeMonths(elapsedMonths);
|
|
26492
|
-
}
|
|
26493
|
-
return labels.relativeTimeYears(Math.floor(elapsedDays / 365));
|
|
26494
|
-
}
|
|
26495
|
-
function LoadingGlyph() {
|
|
26496
|
-
"use memo";
|
|
26497
|
-
return /* @__PURE__ */ jsx44(
|
|
26498
|
-
Spinner5,
|
|
26499
|
-
{
|
|
26500
|
-
className: AgentGUINode_styles_default.conversationStatusGlyph,
|
|
26501
|
-
size: 14,
|
|
26502
|
-
style: { color: "var(--text-secondary)" },
|
|
26503
|
-
strokeWidth: 2.25,
|
|
26504
|
-
trackColor: "color-mix(in srgb, currentColor 24%, transparent)",
|
|
26505
|
-
testId: "agent-gui-conversation-spinner"
|
|
26506
|
-
}
|
|
26507
|
-
);
|
|
26508
|
-
}
|
|
26509
|
-
function AttentionGlyph() {
|
|
26510
|
-
"use memo";
|
|
26511
|
-
return /* @__PURE__ */ jsx44(
|
|
26512
|
-
"svg",
|
|
26513
|
-
{
|
|
26514
|
-
viewBox: "0 0 24 24",
|
|
26515
|
-
fill: "none",
|
|
26516
|
-
"aria-hidden": "true",
|
|
26517
|
-
className: AgentGUINode_styles_default.conversationStatusGlyph,
|
|
26518
|
-
children: /* @__PURE__ */ jsx44(
|
|
26519
|
-
"path",
|
|
26520
|
-
{
|
|
26521
|
-
d: "M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM12.5 15C12.7761 15 13 15.2239 13 15.5V16.5C13 16.7761 12.7761 17 12.5 17H11.5C11.2239 17 11 16.7761 11 16.5V15.5C11 15.2239 11.2239 15 11.5 15H12.5ZM12.5 7C12.7761 7 13 7.22386 13 7.5V13.5C13 13.7761 12.7761 14 12.5 14H11.5C11.2239 14 11 13.7761 11 13.5V7.5C11 7.22386 11.2239 7 11.5 7H12.5Z",
|
|
26522
|
-
fill: "currentColor"
|
|
26523
|
-
}
|
|
26524
|
-
)
|
|
26525
|
-
}
|
|
26526
|
-
);
|
|
26527
|
-
}
|
|
26528
|
-
|
|
26529
26426
|
// agent-gui/agentGuiNode/model/agentGuiConversationRail.ts
|
|
26427
|
+
function isConversationRailInitialLoadPending(input) {
|
|
26428
|
+
return input.runtimeSectionsEnabled && input.pending && input.sections === null;
|
|
26429
|
+
}
|
|
26530
26430
|
function canonicalConversationRailSummaries(conversations) {
|
|
26531
26431
|
return conversations.filter(
|
|
26532
26432
|
(conversation) => conversation.projectionSource !== "pending_activation"
|
|
@@ -26543,12 +26443,13 @@ function projectConversationRailSectionsWithTransientConversations(input) {
|
|
|
26543
26443
|
const loadedIds = new Set(
|
|
26544
26444
|
input.sections.flatMap((section) => section.items.map((item) => item.id))
|
|
26545
26445
|
);
|
|
26546
|
-
const transientSections =
|
|
26547
|
-
transientConversations.filter(
|
|
26446
|
+
const transientSections = projectConversationsByExactRailSectionKey({
|
|
26447
|
+
conversations: transientConversations.filter(
|
|
26548
26448
|
(conversation) => !loadedIds.has(conversation.id)
|
|
26549
26449
|
),
|
|
26550
|
-
input.labels
|
|
26551
|
-
|
|
26450
|
+
labels: input.labels,
|
|
26451
|
+
sections: input.sections
|
|
26452
|
+
});
|
|
26552
26453
|
if (transientSections.length === 0) {
|
|
26553
26454
|
return input.sections;
|
|
26554
26455
|
}
|
|
@@ -26607,44 +26508,33 @@ function projectConversationRailSectionsWithActiveConversation(input) {
|
|
|
26607
26508
|
if (!activeConversation || !activeConversationId) {
|
|
26608
26509
|
return { activeOverlay: null, sections: input.sections };
|
|
26609
26510
|
}
|
|
26610
|
-
const
|
|
26611
|
-
|
|
26511
|
+
const activeSectionId = conversationRailSectionId(activeConversation);
|
|
26512
|
+
if (!activeSectionId) {
|
|
26513
|
+
return { activeOverlay: null, sections: input.sections };
|
|
26514
|
+
}
|
|
26515
|
+
const matchingSection = input.sections.find(
|
|
26516
|
+
(section) => section.id === activeSectionId
|
|
26612
26517
|
);
|
|
26613
|
-
if (
|
|
26518
|
+
if (matchingSection) {
|
|
26614
26519
|
return {
|
|
26615
26520
|
activeOverlay: {
|
|
26616
|
-
conversation:
|
|
26521
|
+
conversation: matchingSection.kind === "project" ? conversationWithRailProject(
|
|
26617
26522
|
activeConversation,
|
|
26618
|
-
|
|
26523
|
+
matchingSection.project
|
|
26619
26524
|
) : activeConversation,
|
|
26620
|
-
sectionId:
|
|
26525
|
+
sectionId: matchingSection.id
|
|
26621
26526
|
},
|
|
26622
26527
|
sections: input.sections
|
|
26623
26528
|
};
|
|
26624
26529
|
}
|
|
26625
|
-
const activeSection =
|
|
26626
|
-
|
|
26530
|
+
const activeSection = createExactConversationRailSection(
|
|
26531
|
+
activeConversation,
|
|
26627
26532
|
input.labels
|
|
26628
|
-
)
|
|
26533
|
+
);
|
|
26629
26534
|
if (!activeSection) {
|
|
26630
26535
|
return { activeOverlay: null, sections: input.sections };
|
|
26631
26536
|
}
|
|
26632
|
-
const
|
|
26633
|
-
(section) => section.id === activeSection.id
|
|
26634
|
-
);
|
|
26635
|
-
if (matchingSectionIndex >= 0) {
|
|
26636
|
-
const matchingSection = input.sections[matchingSectionIndex];
|
|
26637
|
-
return {
|
|
26638
|
-
activeOverlay: {
|
|
26639
|
-
conversation: matchingSection?.kind === "project" ? conversationWithRailProject(
|
|
26640
|
-
activeConversation,
|
|
26641
|
-
matchingSection.project
|
|
26642
|
-
) : activeConversation,
|
|
26643
|
-
sectionId: activeSection.id
|
|
26644
|
-
},
|
|
26645
|
-
sections: input.sections
|
|
26646
|
-
};
|
|
26647
|
-
}
|
|
26537
|
+
const projectedConversation = activeSection.items[0] ?? activeConversation;
|
|
26648
26538
|
const transientSection = { ...activeSection, items: [] };
|
|
26649
26539
|
let sections;
|
|
26650
26540
|
if (activeSection.kind === "pinned") {
|
|
@@ -26667,7 +26557,7 @@ function projectConversationRailSectionsWithActiveConversation(input) {
|
|
|
26667
26557
|
}
|
|
26668
26558
|
return {
|
|
26669
26559
|
activeOverlay: {
|
|
26670
|
-
conversation:
|
|
26560
|
+
conversation: projectedConversation,
|
|
26671
26561
|
sectionId: activeSection.id
|
|
26672
26562
|
},
|
|
26673
26563
|
sections
|
|
@@ -26676,6 +26566,139 @@ function projectConversationRailSectionsWithActiveConversation(input) {
|
|
|
26676
26566
|
function conversationWithRailProject(conversation, project) {
|
|
26677
26567
|
return conversationProjectsRenderEqual2(conversation.project, project) ? conversation : { ...conversation, project };
|
|
26678
26568
|
}
|
|
26569
|
+
function conversationRailSectionId(conversation) {
|
|
26570
|
+
if ((conversation.pinnedAtUnixMs ?? 0) > 0) {
|
|
26571
|
+
return "pinned";
|
|
26572
|
+
}
|
|
26573
|
+
const sectionKey = conversation.railSectionKey?.trim() ?? "";
|
|
26574
|
+
return sectionKey || null;
|
|
26575
|
+
}
|
|
26576
|
+
function createExactConversationRailSection(conversation, labels) {
|
|
26577
|
+
const sectionId = conversationRailSectionId(conversation);
|
|
26578
|
+
if (!sectionId) {
|
|
26579
|
+
return null;
|
|
26580
|
+
}
|
|
26581
|
+
if (sectionId === "pinned") {
|
|
26582
|
+
return {
|
|
26583
|
+
id: sectionId,
|
|
26584
|
+
kind: "pinned",
|
|
26585
|
+
label: labels.sectionPinned,
|
|
26586
|
+
project: null,
|
|
26587
|
+
items: [{ ...conversation, project: null }]
|
|
26588
|
+
};
|
|
26589
|
+
}
|
|
26590
|
+
if (sectionId === "conversations") {
|
|
26591
|
+
return {
|
|
26592
|
+
id: sectionId,
|
|
26593
|
+
kind: "conversations",
|
|
26594
|
+
label: labels.sectionConversations,
|
|
26595
|
+
project: null,
|
|
26596
|
+
items: [{ ...conversation, project: null }]
|
|
26597
|
+
};
|
|
26598
|
+
}
|
|
26599
|
+
const project = conversation.project;
|
|
26600
|
+
if (project?.sectionKey?.trim() !== sectionId) {
|
|
26601
|
+
return null;
|
|
26602
|
+
}
|
|
26603
|
+
return {
|
|
26604
|
+
id: sectionId,
|
|
26605
|
+
kind: "project",
|
|
26606
|
+
label: project.label,
|
|
26607
|
+
project,
|
|
26608
|
+
items: [conversationWithRailProject(conversation, project)]
|
|
26609
|
+
};
|
|
26610
|
+
}
|
|
26611
|
+
function projectConversationsByExactRailSectionKey(input) {
|
|
26612
|
+
const sectionTemplates = new Map(
|
|
26613
|
+
input.sections.map((section) => [section.id, section])
|
|
26614
|
+
);
|
|
26615
|
+
const projected = /* @__PURE__ */ new Map();
|
|
26616
|
+
if (input.includeEmptySections) {
|
|
26617
|
+
for (const section of input.sections) {
|
|
26618
|
+
if (section.kind === "pinned") continue;
|
|
26619
|
+
projected.set(section.id, { ...section, items: [] });
|
|
26620
|
+
}
|
|
26621
|
+
}
|
|
26622
|
+
for (const conversation of input.conversations) {
|
|
26623
|
+
const sectionId = conversationRailSectionId(conversation);
|
|
26624
|
+
if (!sectionId) continue;
|
|
26625
|
+
const template = sectionTemplates.get(sectionId);
|
|
26626
|
+
const section = template ?? createExactConversationRailSection(conversation, input.labels);
|
|
26627
|
+
if (!section) continue;
|
|
26628
|
+
const projectedConversation = section.kind === "project" ? conversationWithRailProject(conversation, section.project) : conversation.project ? { ...conversation, project: null } : conversation;
|
|
26629
|
+
const existing = projected.get(sectionId);
|
|
26630
|
+
if (existing) {
|
|
26631
|
+
existing.items.push(projectedConversation);
|
|
26632
|
+
continue;
|
|
26633
|
+
}
|
|
26634
|
+
projected.set(sectionId, {
|
|
26635
|
+
...section,
|
|
26636
|
+
items: [projectedConversation]
|
|
26637
|
+
});
|
|
26638
|
+
}
|
|
26639
|
+
const sorted = new Map(
|
|
26640
|
+
[...projected].map(([id, section]) => [
|
|
26641
|
+
id,
|
|
26642
|
+
{
|
|
26643
|
+
...section,
|
|
26644
|
+
items: section.kind === "pinned" ? sortPinnedConversations(section.items) : sortConversations(section.items)
|
|
26645
|
+
}
|
|
26646
|
+
])
|
|
26647
|
+
);
|
|
26648
|
+
const result = [];
|
|
26649
|
+
const append = (id) => {
|
|
26650
|
+
const section = sorted.get(id);
|
|
26651
|
+
if (!section) return;
|
|
26652
|
+
result.push(section);
|
|
26653
|
+
sorted.delete(id);
|
|
26654
|
+
};
|
|
26655
|
+
append("pinned");
|
|
26656
|
+
for (const section of input.sections) {
|
|
26657
|
+
if (section.kind === "pinned" || section.kind === "conversations") {
|
|
26658
|
+
continue;
|
|
26659
|
+
}
|
|
26660
|
+
append(section.id);
|
|
26661
|
+
}
|
|
26662
|
+
[...sorted.values()].filter((section) => section.kind === "project").sort((left, right) => left.id.localeCompare(right.id)).forEach((section) => append(section.id));
|
|
26663
|
+
for (const section of input.sections) {
|
|
26664
|
+
if (section.kind === "conversations") append(section.id);
|
|
26665
|
+
}
|
|
26666
|
+
append("conversations");
|
|
26667
|
+
[...sorted.keys()].sort().forEach(append);
|
|
26668
|
+
return result;
|
|
26669
|
+
}
|
|
26670
|
+
function projectConversationRailSectionsByExactKey(input) {
|
|
26671
|
+
const seen = /* @__PURE__ */ new Set();
|
|
26672
|
+
const sections = input.userProjects.flatMap(
|
|
26673
|
+
(project) => {
|
|
26674
|
+
const sectionKey = project.sectionKey?.trim() ?? "";
|
|
26675
|
+
if (!sectionKey || seen.has(sectionKey)) return [];
|
|
26676
|
+
seen.add(sectionKey);
|
|
26677
|
+
return [
|
|
26678
|
+
{
|
|
26679
|
+
id: sectionKey,
|
|
26680
|
+
kind: "project",
|
|
26681
|
+
label: project.label,
|
|
26682
|
+
project,
|
|
26683
|
+
items: []
|
|
26684
|
+
}
|
|
26685
|
+
];
|
|
26686
|
+
}
|
|
26687
|
+
);
|
|
26688
|
+
sections.push({
|
|
26689
|
+
id: "conversations",
|
|
26690
|
+
kind: "conversations",
|
|
26691
|
+
label: input.labels.sectionConversations,
|
|
26692
|
+
project: null,
|
|
26693
|
+
items: []
|
|
26694
|
+
});
|
|
26695
|
+
return projectConversationsByExactRailSectionKey({
|
|
26696
|
+
conversations: input.conversations,
|
|
26697
|
+
labels: input.labels,
|
|
26698
|
+
sections,
|
|
26699
|
+
includeEmptySections: input.includeEmptySections
|
|
26700
|
+
});
|
|
26701
|
+
}
|
|
26679
26702
|
function planRuntimeRailMembershipRefresh(input) {
|
|
26680
26703
|
const previousPendingIds = new Set(
|
|
26681
26704
|
input.previous.flatMap((conversation) => {
|
|
@@ -26794,12 +26817,17 @@ function projectConversationRailMemberships(input) {
|
|
|
26794
26817
|
items: section.sessionIds.flatMap((id) => {
|
|
26795
26818
|
const conversation = conversationsById.get(id);
|
|
26796
26819
|
if (!conversation) return [];
|
|
26820
|
+
const exactSectionId = conversationRailSectionId(conversation);
|
|
26821
|
+
if (exactSectionId !== section.id) return [];
|
|
26797
26822
|
return [
|
|
26798
26823
|
section.kind === "project" ? { ...conversation, project: section.project } : { ...conversation, project: null }
|
|
26799
26824
|
];
|
|
26800
26825
|
})
|
|
26801
26826
|
}));
|
|
26802
26827
|
}
|
|
26828
|
+
function projectConversationRailSearchSections(input) {
|
|
26829
|
+
return projectConversationsByExactRailSectionKey(input);
|
|
26830
|
+
}
|
|
26803
26831
|
function stabilizeConversationSections(previous, next) {
|
|
26804
26832
|
if (!previous) {
|
|
26805
26833
|
return [...next];
|
|
@@ -26887,10 +26915,60 @@ function comparePinnedConversations(left, right) {
|
|
|
26887
26915
|
return (right.pinnedAtUnixMs ?? 0) - (left.pinnedAtUnixMs ?? 0) || (right.sortTimeUnixMs ?? right.updatedAtUnixMs) - (left.sortTimeUnixMs ?? left.updatedAtUnixMs) || left.id.localeCompare(right.id);
|
|
26888
26916
|
}
|
|
26889
26917
|
function conversationSummariesRenderEqual2(left, right) {
|
|
26890
|
-
return left.id === right.id && left.agentTargetId === right.agentTargetId && left.provider === right.provider && left.title === right.title && left.titleFallback === right.titleFallback && left.status === right.status && left.cwd === right.cwd && left.pinnedAtUnixMs === right.pinnedAtUnixMs && left.sortTimeUnixMs === right.sortTimeUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.projectionSource === right.projectionSource && left.isImported === right.isImported && left.hasUnreadCompletion === right.hasUnreadCompletion && left.unreadCompletionKey === right.unreadCompletionKey && conversationProjectsRenderEqual2(left.project, right.project);
|
|
26918
|
+
return left.id === right.id && left.agentTargetId === right.agentTargetId && left.provider === right.provider && left.title === right.title && left.titleLeadingMentionKind === right.titleLeadingMentionKind && left.titleFallback === right.titleFallback && left.status === right.status && left.cwd === right.cwd && left.railSectionKey === right.railSectionKey && left.pinnedAtUnixMs === right.pinnedAtUnixMs && left.sortTimeUnixMs === right.sortTimeUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.projectionSource === right.projectionSource && left.isImported === right.isImported && left.hasUnreadCompletion === right.hasUnreadCompletion && left.unreadCompletionKey === right.unreadCompletionKey && conversationProjectsRenderEqual2(left.project, right.project);
|
|
26891
26919
|
}
|
|
26892
26920
|
function conversationProjectsRenderEqual2(left, right) {
|
|
26893
|
-
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 && left.sectionKey === right.sectionKey);
|
|
26921
|
+
return left === right || (!left || !right ? !left && !right : left.id === right.id && left.path === right.path && left.sectionKey === right.sectionKey && left.label === right.label && left.createdAtUnixMs === right.createdAtUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.lastUsedAtUnixMs === right.lastUsedAtUnixMs && left.sectionKey === right.sectionKey);
|
|
26922
|
+
}
|
|
26923
|
+
|
|
26924
|
+
// agent-gui/agentGuiNode/model/agentGuiConversationRailSectionTemplates.ts
|
|
26925
|
+
function preserveConversationRailSectionTemplates(input) {
|
|
26926
|
+
const existingById = new Map(
|
|
26927
|
+
input.sections.map((section) => [section.id, section])
|
|
26928
|
+
);
|
|
26929
|
+
const result = [];
|
|
26930
|
+
const pinned = existingById.get("pinned");
|
|
26931
|
+
if (pinned && pinned.items.length > 0) {
|
|
26932
|
+
result.push(pinned);
|
|
26933
|
+
}
|
|
26934
|
+
existingById.delete("pinned");
|
|
26935
|
+
const projectSectionKeys = /* @__PURE__ */ new Set();
|
|
26936
|
+
for (const project of input.userProjects) {
|
|
26937
|
+
const sectionKey = project.sectionKey?.trim() ?? "";
|
|
26938
|
+
if (!sectionKey || projectSectionKeys.has(sectionKey)) continue;
|
|
26939
|
+
projectSectionKeys.add(sectionKey);
|
|
26940
|
+
const existing = existingById.get(sectionKey);
|
|
26941
|
+
result.push({
|
|
26942
|
+
id: sectionKey,
|
|
26943
|
+
kind: "project",
|
|
26944
|
+
label: project.label,
|
|
26945
|
+
project,
|
|
26946
|
+
items: existing?.items ?? []
|
|
26947
|
+
});
|
|
26948
|
+
existingById.delete(sectionKey);
|
|
26949
|
+
}
|
|
26950
|
+
for (const section of input.sections) {
|
|
26951
|
+
if (section.kind !== "project" || !existingById.has(section.id)) continue;
|
|
26952
|
+
result.push(section);
|
|
26953
|
+
existingById.delete(section.id);
|
|
26954
|
+
}
|
|
26955
|
+
const conversations = existingById.get("conversations");
|
|
26956
|
+
result.push(
|
|
26957
|
+
conversations ?? {
|
|
26958
|
+
id: "conversations",
|
|
26959
|
+
kind: "conversations",
|
|
26960
|
+
label: input.labels.sectionConversations,
|
|
26961
|
+
project: null,
|
|
26962
|
+
items: []
|
|
26963
|
+
}
|
|
26964
|
+
);
|
|
26965
|
+
existingById.delete("conversations");
|
|
26966
|
+
for (const section of input.sections) {
|
|
26967
|
+
if (!existingById.has(section.id)) continue;
|
|
26968
|
+
result.push(section);
|
|
26969
|
+
existingById.delete(section.id);
|
|
26970
|
+
}
|
|
26971
|
+
return result;
|
|
26894
26972
|
}
|
|
26895
26973
|
|
|
26896
26974
|
// agent-gui/agentGuiNode/view/AgentGUIConversationRailSection.tsx
|
|
@@ -26901,9 +26979,9 @@ import {
|
|
|
26901
26979
|
DropdownMenuContent as DropdownMenuContent4,
|
|
26902
26980
|
DropdownMenuItem as DropdownMenuItem3,
|
|
26903
26981
|
DropdownMenuTrigger as DropdownMenuTrigger4,
|
|
26904
|
-
Tooltip as
|
|
26905
|
-
TooltipContent as
|
|
26906
|
-
TooltipTrigger as
|
|
26982
|
+
Tooltip as Tooltip6,
|
|
26983
|
+
TooltipContent as TooltipContent6,
|
|
26984
|
+
TooltipTrigger as TooltipTrigger6
|
|
26907
26985
|
} from "@tutti-os/ui-system";
|
|
26908
26986
|
import { BareIconButton as BareIconButton2 } from "@tutti-os/ui-system/components";
|
|
26909
26987
|
import {
|
|
@@ -26918,7 +26996,7 @@ import {
|
|
|
26918
26996
|
memo as memo5,
|
|
26919
26997
|
useCallback as useCallback41,
|
|
26920
26998
|
useMemo as useMemo31,
|
|
26921
|
-
useRef as
|
|
26999
|
+
useRef as useRef33,
|
|
26922
27000
|
useState as useState25
|
|
26923
27001
|
} from "react";
|
|
26924
27002
|
import { ExternalLink as ExternalLink2 } from "lucide-react";
|
|
@@ -26927,6 +27005,11 @@ import {
|
|
|
26927
27005
|
ContextMenuContent,
|
|
26928
27006
|
ContextMenuItem,
|
|
26929
27007
|
ContextMenuTrigger,
|
|
27008
|
+
AgentSessionsIcon,
|
|
27009
|
+
FileIcon,
|
|
27010
|
+
IssueIcon,
|
|
27011
|
+
NavAgentsIcon,
|
|
27012
|
+
NavApplicationsLinedIcon,
|
|
26930
27013
|
NewWorkspaceLinedIcon as NewWorkspaceLinedIcon2,
|
|
26931
27014
|
cn as cn5
|
|
26932
27015
|
} from "@tutti-os/ui-system";
|
|
@@ -26934,10 +27017,10 @@ import { BareIconButton } from "@tutti-os/ui-system/components";
|
|
|
26934
27017
|
import { WorkspaceUserProjectSelect as WorkspaceUserProjectSelect2 } from "@tutti-os/workspace-user-project/ui";
|
|
26935
27018
|
|
|
26936
27019
|
// app/renderer/components/icons/PinFilledIcon.tsx
|
|
26937
|
-
import { jsx as
|
|
27020
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
26938
27021
|
function PinFilledIcon(props) {
|
|
26939
27022
|
"use memo";
|
|
26940
|
-
return /* @__PURE__ */
|
|
27023
|
+
return /* @__PURE__ */ jsx44(
|
|
26941
27024
|
"svg",
|
|
26942
27025
|
{
|
|
26943
27026
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -26945,16 +27028,16 @@ function PinFilledIcon(props) {
|
|
|
26945
27028
|
fill: "currentColor",
|
|
26946
27029
|
"aria-hidden": true,
|
|
26947
27030
|
...props,
|
|
26948
|
-
children: /* @__PURE__ */
|
|
27031
|
+
children: /* @__PURE__ */ jsx44("path", { d: "M21.6066 8.05025C22.1692 8.61286 22.4849 9.37592 22.4849 10.1716C22.4849 10.9672 22.1692 11.7303 21.6066 12.2929C21.044 12.8555 20.2809 13.1713 19.4853 13.1713C18.6896 13.1713 17.9266 12.8555 17.3639 12.2929L14.7054 14.9514L14.6142 15.0564C14.531 15.1669 14.4714 15.2943 14.4395 15.43C14.3972 15.6109 14.406 15.8 14.4651 15.9762L14.4678 15.9831L15.0873 17.8717L15.1466 18.072C15.2691 18.5425 15.2761 19.037 15.1646 19.5124C15.0372 20.0557 14.7607 20.5526 14.3663 20.9474L13.8284 21.4853C13.4533 21.8604 12.9446 22.0709 12.4142 22.0709C11.8838 22.0709 11.3751 21.8604 11 21.4853L7.46445 17.9497L4.63603 20.7782C4.2455 21.1687 3.61234 21.1687 3.22181 20.7782C2.83129 20.3877 2.83129 19.7545 3.22181 19.364L6.05024 16.5355L2.51471 13C2.13963 12.6249 1.92913 12.1162 1.92913 11.5858C1.92913 11.0554 2.13963 10.5466 2.51471 10.1716L3.05263 9.63365L3.20524 9.49209C3.57235 9.17309 4.01205 8.94693 4.48756 8.83539C5.03093 8.70798 5.59924 8.73494 6.12827 8.91273L8.01688 9.53214L8.02379 9.5349C8.19995 9.59404 8.38907 9.60282 8.57 9.56045C8.7057 9.52863 8.83304 9.46898 8.94358 9.38575L9.04854 9.2946L11.7071 6.63604C11.1445 6.07343 10.8287 5.31037 10.8287 4.51472C10.8287 3.71907 11.1445 2.95601 11.7071 2.3934C12.2697 1.83079 13.0328 1.51504 13.8284 1.51504C14.6241 1.51504 15.3871 1.83079 15.9497 2.3934L21.6066 8.05025Z" })
|
|
26949
27032
|
}
|
|
26950
27033
|
);
|
|
26951
27034
|
}
|
|
26952
27035
|
|
|
26953
27036
|
// app/renderer/components/icons/PinLinedIcon.tsx
|
|
26954
|
-
import { jsx as
|
|
27037
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
26955
27038
|
function PinLinedIcon(props) {
|
|
26956
27039
|
"use memo";
|
|
26957
|
-
return /* @__PURE__ */
|
|
27040
|
+
return /* @__PURE__ */ jsx45(
|
|
26958
27041
|
"svg",
|
|
26959
27042
|
{
|
|
26960
27043
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -26962,7 +27045,154 @@ function PinLinedIcon(props) {
|
|
|
26962
27045
|
fill: "currentColor",
|
|
26963
27046
|
"aria-hidden": true,
|
|
26964
27047
|
...props,
|
|
26965
|
-
children: /* @__PURE__ */
|
|
27048
|
+
children: /* @__PURE__ */ jsx45("path", { d: "M21.6066 8.05025C22.1692 8.61286 22.4849 9.37592 22.4849 10.1716C22.4849 10.9672 22.1692 11.7303 21.6066 12.2929C21.044 12.8555 20.2809 13.1713 19.4853 13.1713C18.6896 13.1713 17.9266 12.8555 17.3639 12.2929L14.7054 14.9514L14.6142 15.0564C14.531 15.1669 14.4714 15.2943 14.4395 15.43C14.3972 15.6109 14.406 15.8 14.4651 15.9762L14.4678 15.9831L15.0873 17.8717L15.1466 18.072C15.2691 18.5425 15.2761 19.037 15.1646 19.5124C15.0372 20.0557 14.7607 20.5526 14.3663 20.9474L13.8284 21.4853C13.4533 21.8604 12.9446 22.0709 12.4142 22.0709C11.8838 22.0709 11.3751 21.8604 11 21.4853L7.46445 17.9497L4.63603 20.7782C4.2455 21.1687 3.61234 21.1687 3.22181 20.7782C2.83129 20.3877 2.83129 19.7545 3.22181 19.364L6.05024 16.5355L2.51471 13C2.13963 12.6249 1.92913 12.1162 1.92913 11.5858C1.92913 11.0554 2.13963 10.5466 2.51471 10.1716L3.05263 9.63365L3.20524 9.49209C3.57235 9.17309 4.01205 8.94693 4.48756 8.83539C5.03093 8.70798 5.59924 8.73494 6.12827 8.91273L8.01688 9.53214L8.02379 9.5349C8.19995 9.59404 8.38907 9.60282 8.57 9.56045C8.7057 9.52863 8.83304 9.46898 8.94358 9.38575L9.04854 9.2946L11.7071 6.63604C11.1445 6.07343 10.8287 5.31037 10.8287 4.51472C10.8287 3.71907 11.1445 2.95601 11.7071 2.3934C12.2697 1.83079 13.0328 1.51504 13.8284 1.51504C14.6241 1.51504 15.3871 1.83079 15.9497 2.3934L21.6066 8.05025ZM14.5355 3.80761C14.348 3.62008 14.0936 3.51483 13.8284 3.51483C13.5632 3.51483 13.3088 3.62008 13.1213 3.80761C12.9338 3.99515 12.8285 4.2495 12.8285 4.51472C12.8285 4.74685 12.9091 4.97066 13.055 5.14863L13.2539 5.36822C13.5457 5.72416 13.7069 6.17177 13.7069 6.63604C13.7069 7.16647 13.4964 7.67518 13.1213 8.05025L10.4621 10.7095C10.0673 11.1038 9.57037 11.3803 9.02713 11.5078C8.48575 11.6347 7.92002 11.6071 7.39264 11.4311V11.4325L5.49781 10.811L5.49091 10.8082C5.31475 10.7491 5.12562 10.7403 4.94469 10.7827C4.76366 10.8251 4.59774 10.9172 4.46615 11.0486L3.92892 11.5858L12.4142 20.0711L12.9514 19.5338C13.0828 19.4022 13.1748 19.2363 13.2173 19.0553C13.2597 18.8744 13.2509 18.6852 13.1917 18.5091L13.189 18.5022L12.5675 16.6073L12.5682 16.6067C12.3924 16.0795 12.3654 15.514 12.4922 14.9729C12.6197 14.4296 12.8962 13.9327 13.2905 13.5379L15.9497 10.8787C16.3248 10.5036 16.8335 10.2931 17.3639 10.2931C17.8282 10.2931 18.2758 10.4543 18.6318 10.7461L18.8514 10.945C19.0293 11.0909 19.2531 11.1715 19.4853 11.1715C19.7505 11.1715 20.0048 11.0662 20.1924 10.8787C20.3799 10.6911 20.4852 10.4368 20.4852 10.1716C20.4852 9.90636 20.3799 9.652 20.1924 9.46447L14.5355 3.80761Z" })
|
|
27049
|
+
}
|
|
27050
|
+
);
|
|
27051
|
+
}
|
|
27052
|
+
|
|
27053
|
+
// agent-gui/agentGuiNode/agentGuiNodeViewConversation.tsx
|
|
27054
|
+
import { Spinner as Spinner5 } from "@tutti-os/ui-system";
|
|
27055
|
+
import { AskLinedIcon } from "@tutti-os/ui-system/icons";
|
|
27056
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
27057
|
+
function ConversationMeta({
|
|
27058
|
+
item,
|
|
27059
|
+
nowMs,
|
|
27060
|
+
labels
|
|
27061
|
+
}) {
|
|
27062
|
+
"use memo";
|
|
27063
|
+
const kind = conversationMetaKind(item);
|
|
27064
|
+
if (kind === "loading") {
|
|
27065
|
+
return /* @__PURE__ */ jsx46(
|
|
27066
|
+
"span",
|
|
27067
|
+
{
|
|
27068
|
+
className: AgentGUINode_styles_default.conversationMeta,
|
|
27069
|
+
"data-kind": kind,
|
|
27070
|
+
"data-testid": `agent-gui-conversation-meta-${item.id}`,
|
|
27071
|
+
children: /* @__PURE__ */ jsx46(LoadingGlyph, {})
|
|
27072
|
+
}
|
|
27073
|
+
);
|
|
27074
|
+
}
|
|
27075
|
+
if (kind === "waiting") {
|
|
27076
|
+
return /* @__PURE__ */ jsx46(
|
|
27077
|
+
"span",
|
|
27078
|
+
{
|
|
27079
|
+
className: AgentGUINode_styles_default.conversationMeta,
|
|
27080
|
+
"data-kind": kind,
|
|
27081
|
+
"data-testid": `agent-gui-conversation-meta-${item.id}`,
|
|
27082
|
+
children: /* @__PURE__ */ jsx46(
|
|
27083
|
+
AskLinedIcon,
|
|
27084
|
+
{
|
|
27085
|
+
"aria-hidden": "true",
|
|
27086
|
+
className: AgentGUINode_styles_default.conversationStatusGlyph
|
|
27087
|
+
}
|
|
27088
|
+
)
|
|
27089
|
+
}
|
|
27090
|
+
);
|
|
27091
|
+
}
|
|
27092
|
+
if (kind === "failed") {
|
|
27093
|
+
return /* @__PURE__ */ jsx46(
|
|
27094
|
+
"span",
|
|
27095
|
+
{
|
|
27096
|
+
className: AgentGUINode_styles_default.conversationMeta,
|
|
27097
|
+
"data-kind": kind,
|
|
27098
|
+
"data-testid": `agent-gui-conversation-meta-${item.id}`,
|
|
27099
|
+
children: /* @__PURE__ */ jsx46(AttentionGlyph, {})
|
|
27100
|
+
}
|
|
27101
|
+
);
|
|
27102
|
+
}
|
|
27103
|
+
if (kind === "unread-complete") {
|
|
27104
|
+
return /* @__PURE__ */ jsx46(
|
|
27105
|
+
"span",
|
|
27106
|
+
{
|
|
27107
|
+
className: AgentGUINode_styles_default.conversationMeta,
|
|
27108
|
+
"data-kind": kind,
|
|
27109
|
+
"data-testid": `agent-gui-conversation-meta-${item.id}`,
|
|
27110
|
+
children: /* @__PURE__ */ jsx46("span", { className: AgentGUINode_styles_default.conversationUnreadLamp, "aria-hidden": "true" })
|
|
27111
|
+
}
|
|
27112
|
+
);
|
|
27113
|
+
}
|
|
27114
|
+
return /* @__PURE__ */ jsx46(
|
|
27115
|
+
"span",
|
|
27116
|
+
{
|
|
27117
|
+
className: AgentGUINode_styles_default.conversationMeta,
|
|
27118
|
+
"data-kind": kind,
|
|
27119
|
+
"data-testid": `agent-gui-conversation-meta-${item.id}`,
|
|
27120
|
+
children: /* @__PURE__ */ jsx46("span", { className: AgentGUINode_styles_default.conversationTime, children: formatConversationRelativeTime(
|
|
27121
|
+
resolveAgentGUIConversationSortTimeUnixMs(item),
|
|
27122
|
+
nowMs,
|
|
27123
|
+
labels
|
|
27124
|
+
) })
|
|
27125
|
+
}
|
|
27126
|
+
);
|
|
27127
|
+
}
|
|
27128
|
+
function conversationMetaKind(conversation) {
|
|
27129
|
+
if (conversation.status === "working") {
|
|
27130
|
+
return "loading";
|
|
27131
|
+
}
|
|
27132
|
+
if (conversation.status === "waiting") {
|
|
27133
|
+
return "waiting";
|
|
27134
|
+
}
|
|
27135
|
+
if (conversation.status === "failed") {
|
|
27136
|
+
return "failed";
|
|
27137
|
+
}
|
|
27138
|
+
if (conversation.hasUnreadCompletion) {
|
|
27139
|
+
return "unread-complete";
|
|
27140
|
+
}
|
|
27141
|
+
return "time";
|
|
27142
|
+
}
|
|
27143
|
+
function formatConversationRelativeTime(updatedAtUnixMs, nowMs, labels) {
|
|
27144
|
+
const elapsedMs = Math.max(0, nowMs - updatedAtUnixMs);
|
|
27145
|
+
const elapsedMinutes = Math.floor(elapsedMs / (60 * 1e3));
|
|
27146
|
+
if (elapsedMinutes < 1) {
|
|
27147
|
+
return labels.relativeTimeJustNow;
|
|
27148
|
+
}
|
|
27149
|
+
if (elapsedMinutes < 60) {
|
|
27150
|
+
return labels.relativeTimeMinutes(elapsedMinutes);
|
|
27151
|
+
}
|
|
27152
|
+
const elapsedHours = Math.floor(elapsedMinutes / 60);
|
|
27153
|
+
if (elapsedHours < 24) {
|
|
27154
|
+
return labels.relativeTimeHours(elapsedHours);
|
|
27155
|
+
}
|
|
27156
|
+
const elapsedDays = Math.floor(elapsedHours / 24);
|
|
27157
|
+
if (elapsedDays < 30) {
|
|
27158
|
+
return labels.relativeTimeDays(elapsedDays);
|
|
27159
|
+
}
|
|
27160
|
+
const elapsedMonths = Math.floor(elapsedDays / 30);
|
|
27161
|
+
if (elapsedMonths < 12) {
|
|
27162
|
+
return labels.relativeTimeMonths(elapsedMonths);
|
|
27163
|
+
}
|
|
27164
|
+
return labels.relativeTimeYears(Math.floor(elapsedDays / 365));
|
|
27165
|
+
}
|
|
27166
|
+
function LoadingGlyph() {
|
|
27167
|
+
"use memo";
|
|
27168
|
+
return /* @__PURE__ */ jsx46(
|
|
27169
|
+
Spinner5,
|
|
27170
|
+
{
|
|
27171
|
+
className: AgentGUINode_styles_default.conversationStatusGlyph,
|
|
27172
|
+
size: 14,
|
|
27173
|
+
style: { color: "var(--text-secondary)" },
|
|
27174
|
+
strokeWidth: 2.25,
|
|
27175
|
+
trackColor: "color-mix(in srgb, currentColor 24%, transparent)",
|
|
27176
|
+
testId: "agent-gui-conversation-spinner"
|
|
27177
|
+
}
|
|
27178
|
+
);
|
|
27179
|
+
}
|
|
27180
|
+
function AttentionGlyph() {
|
|
27181
|
+
"use memo";
|
|
27182
|
+
return /* @__PURE__ */ jsx46(
|
|
27183
|
+
"svg",
|
|
27184
|
+
{
|
|
27185
|
+
viewBox: "0 0 24 24",
|
|
27186
|
+
fill: "none",
|
|
27187
|
+
"aria-hidden": "true",
|
|
27188
|
+
className: AgentGUINode_styles_default.conversationStatusGlyph,
|
|
27189
|
+
children: /* @__PURE__ */ jsx46(
|
|
27190
|
+
"path",
|
|
27191
|
+
{
|
|
27192
|
+
d: "M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM12.5 15C12.7761 15 13 15.2239 13 15.5V16.5C13 16.7761 12.7761 17 12.5 17H11.5C11.2239 17 11 16.7761 11 16.5V15.5C11 15.2239 11.2239 15 11.5 15H12.5ZM12.5 7C12.7761 7 13 7.22386 13 7.5V13.5C13 13.7761 12.7761 14 12.5 14H11.5C11.2239 14 11 13.7761 11 13.5V7.5C11 7.22386 11.2239 7 11.5 7H12.5Z",
|
|
27193
|
+
fill: "currentColor"
|
|
27194
|
+
}
|
|
27195
|
+
)
|
|
26966
27196
|
}
|
|
26967
27197
|
);
|
|
26968
27198
|
}
|
|
@@ -26977,6 +27207,10 @@ function agentGUIConversationIconUrl(provider, agentTargetId, workspaceId, agent
|
|
|
26977
27207
|
});
|
|
26978
27208
|
return resolveAgentGuiSessionProviderFlatIconUrl(provider) || targetPresentation?.iconUrl?.trim() || null;
|
|
26979
27209
|
}
|
|
27210
|
+
function agentGUIConversationRailTitle(item, labels, uiLanguage) {
|
|
27211
|
+
const title = conversationPlainTitle(item, labels, uiLanguage);
|
|
27212
|
+
return item.titleLeadingMentionKind ? title.replace(/^@\s*/, "") : title;
|
|
27213
|
+
}
|
|
26980
27214
|
var AgentGUIConversationRailItem = memo5(
|
|
26981
27215
|
function AgentGUIConversationRailItem2({
|
|
26982
27216
|
item,
|
|
@@ -27015,9 +27249,9 @@ var AgentGUIConversationRailItem = memo5(
|
|
|
27015
27249
|
[item.id, registerItemElement]
|
|
27016
27250
|
);
|
|
27017
27251
|
const [contextMenuResetKey, setContextMenuResetKey] = useState25(0);
|
|
27018
|
-
const contextMenuRenameRequestedRef =
|
|
27019
|
-
const contextMenuOpenConversationWindowRequestedRef =
|
|
27020
|
-
const contextMenuCopySessionLinkRequestedRef =
|
|
27252
|
+
const contextMenuRenameRequestedRef = useRef33(false);
|
|
27253
|
+
const contextMenuOpenConversationWindowRequestedRef = useRef33(false);
|
|
27254
|
+
const contextMenuCopySessionLinkRequestedRef = useRef33(false);
|
|
27021
27255
|
const agentHostApi = useOptionalAgentHostApi();
|
|
27022
27256
|
const handleMouseLeave = useCallback41(() => {
|
|
27023
27257
|
if (isPendingDeleteConversation && !isRailInteractionLocked()) {
|
|
@@ -27166,7 +27400,21 @@ var AgentGUIConversationRailItem = memo5(
|
|
|
27166
27400
|
}
|
|
27167
27401
|
}
|
|
27168
27402
|
) : null,
|
|
27169
|
-
/* @__PURE__ */ jsx47(
|
|
27403
|
+
item.titleLeadingMentionKind ? /* @__PURE__ */ jsx47(
|
|
27404
|
+
"span",
|
|
27405
|
+
{
|
|
27406
|
+
"aria-hidden": "true",
|
|
27407
|
+
className: AgentGUINode_styles_default.conversationTitleMentionIcon,
|
|
27408
|
+
"data-agent-gui-conversation-title-mention-icon": item.titleLeadingMentionKind,
|
|
27409
|
+
children: /* @__PURE__ */ jsx47(
|
|
27410
|
+
ConversationTitleMentionIcon,
|
|
27411
|
+
{
|
|
27412
|
+
kind: item.titleLeadingMentionKind
|
|
27413
|
+
}
|
|
27414
|
+
)
|
|
27415
|
+
}
|
|
27416
|
+
) : null,
|
|
27417
|
+
/* @__PURE__ */ jsx47("span", { className: AgentGUINode_styles_default.conversationTitle, children: agentGUIConversationRailTitle(item, labels, uiLanguage) })
|
|
27170
27418
|
] }),
|
|
27171
27419
|
/* @__PURE__ */ jsx47(ConversationMeta, { item, nowMs: currentTimeMs, labels })
|
|
27172
27420
|
]
|
|
@@ -27320,6 +27568,15 @@ var AgentGUIConversationRailItem = memo5(
|
|
|
27320
27568
|
] }, contextMenuResetKey);
|
|
27321
27569
|
}
|
|
27322
27570
|
);
|
|
27571
|
+
function ConversationTitleMentionIcon({
|
|
27572
|
+
kind
|
|
27573
|
+
}) {
|
|
27574
|
+
if (kind === "task") return /* @__PURE__ */ jsx47(IssueIcon, {});
|
|
27575
|
+
if (kind === "app") return /* @__PURE__ */ jsx47(NavApplicationsLinedIcon, {});
|
|
27576
|
+
if (kind === "file") return /* @__PURE__ */ jsx47(FileIcon, {});
|
|
27577
|
+
if (kind === "agent") return /* @__PURE__ */ jsx47(NavAgentsIcon, {});
|
|
27578
|
+
return /* @__PURE__ */ jsx47(AgentSessionsIcon, {});
|
|
27579
|
+
}
|
|
27323
27580
|
function AgentGUIProjectRailHeader({
|
|
27324
27581
|
disabled,
|
|
27325
27582
|
labels,
|
|
@@ -27587,8 +27844,8 @@ var AgentGUIConversationRailSection = memo6(
|
|
|
27587
27844
|
onClick: handleCreateConversation,
|
|
27588
27845
|
children: /* @__PURE__ */ jsx48(CreateChatIcon, { "aria-hidden": "true" })
|
|
27589
27846
|
}
|
|
27590
|
-
) }) : /* @__PURE__ */ jsxs34(
|
|
27591
|
-
/* @__PURE__ */ jsx48(
|
|
27847
|
+
) }) : /* @__PURE__ */ jsxs34(Tooltip6, { children: [
|
|
27848
|
+
/* @__PURE__ */ jsx48(TooltipTrigger6, { asChild: true, children: /* @__PURE__ */ jsx48(
|
|
27592
27849
|
"span",
|
|
27593
27850
|
{
|
|
27594
27851
|
className: AgentGUINode_styles_default.conversationSectionActionTooltipWrap,
|
|
@@ -27606,7 +27863,7 @@ var AgentGUIConversationRailSection = memo6(
|
|
|
27606
27863
|
}
|
|
27607
27864
|
) }),
|
|
27608
27865
|
/* @__PURE__ */ jsx48(
|
|
27609
|
-
|
|
27866
|
+
TooltipContent6,
|
|
27610
27867
|
{
|
|
27611
27868
|
side: "top",
|
|
27612
27869
|
sideOffset: 6,
|
|
@@ -27630,12 +27887,12 @@ var AgentGUIConversationRailSection = memo6(
|
|
|
27630
27887
|
}
|
|
27631
27888
|
)
|
|
27632
27889
|
}
|
|
27633
|
-
) }) : /* @__PURE__ */ jsxs34(
|
|
27634
|
-
/* @__PURE__ */ jsx48(
|
|
27890
|
+
) }) : /* @__PURE__ */ jsxs34(Tooltip6, { children: [
|
|
27891
|
+
/* @__PURE__ */ jsx48(TooltipTrigger6, { asChild: true, children: /* @__PURE__ */ jsx48(
|
|
27635
27892
|
"span",
|
|
27636
27893
|
{
|
|
27637
27894
|
className: AgentGUINode_styles_default.conversationSectionActionTooltipWrap,
|
|
27638
|
-
children: /* @__PURE__ */ jsx48(
|
|
27895
|
+
children: /* @__PURE__ */ jsx48(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx48(
|
|
27639
27896
|
BareIconButton2,
|
|
27640
27897
|
{
|
|
27641
27898
|
className: AgentGUINode_styles_default.conversationSectionMoreButton,
|
|
@@ -27643,11 +27900,11 @@ var AgentGUIConversationRailSection = memo6(
|
|
|
27643
27900
|
size: "sm",
|
|
27644
27901
|
children: /* @__PURE__ */ jsx48(MoreHorizontalIcon, { "aria-hidden": "true" })
|
|
27645
27902
|
}
|
|
27646
|
-
)
|
|
27903
|
+
) })
|
|
27647
27904
|
}
|
|
27648
|
-
) })
|
|
27905
|
+
) }),
|
|
27649
27906
|
/* @__PURE__ */ jsx48(
|
|
27650
|
-
|
|
27907
|
+
TooltipContent6,
|
|
27651
27908
|
{
|
|
27652
27909
|
side: "right",
|
|
27653
27910
|
sideOffset: 6,
|
|
@@ -27730,12 +27987,12 @@ var AgentGUIConversationRailSection = memo6(
|
|
|
27730
27987
|
}
|
|
27731
27988
|
)
|
|
27732
27989
|
}
|
|
27733
|
-
) }) : /* @__PURE__ */ jsxs34(
|
|
27734
|
-
/* @__PURE__ */ jsx48(
|
|
27990
|
+
) }) : /* @__PURE__ */ jsxs34(Tooltip6, { children: [
|
|
27991
|
+
/* @__PURE__ */ jsx48(TooltipTrigger6, { asChild: true, children: /* @__PURE__ */ jsx48(
|
|
27735
27992
|
"span",
|
|
27736
27993
|
{
|
|
27737
27994
|
className: AgentGUINode_styles_default.conversationSectionActionTooltipWrap,
|
|
27738
|
-
children: /* @__PURE__ */ jsx48(
|
|
27995
|
+
children: /* @__PURE__ */ jsx48(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx48(
|
|
27739
27996
|
BareIconButton2,
|
|
27740
27997
|
{
|
|
27741
27998
|
className: AgentGUINode_styles_default.conversationSectionMoreButton,
|
|
@@ -27743,11 +28000,11 @@ var AgentGUIConversationRailSection = memo6(
|
|
|
27743
28000
|
size: "sm",
|
|
27744
28001
|
children: /* @__PURE__ */ jsx48(MoreHorizontalIcon, { "aria-hidden": "true" })
|
|
27745
28002
|
}
|
|
27746
|
-
)
|
|
28003
|
+
) })
|
|
27747
28004
|
}
|
|
27748
|
-
) })
|
|
28005
|
+
) }),
|
|
27749
28006
|
/* @__PURE__ */ jsx48(
|
|
27750
|
-
|
|
28007
|
+
TooltipContent6,
|
|
27751
28008
|
{
|
|
27752
28009
|
side: "right",
|
|
27753
28010
|
sideOffset: 6,
|
|
@@ -27902,15 +28159,15 @@ var AgentGUIConversationRailPane = memo7(
|
|
|
27902
28159
|
const [pendingProjectAction, setPendingProjectAction] = useState27(null);
|
|
27903
28160
|
const [isRequestingBatchDeletion, setIsRequestingBatchDeletion] = useState27(false);
|
|
27904
28161
|
const { railSearch } = railQuery;
|
|
27905
|
-
const railElementRef =
|
|
27906
|
-
const conversationListRef =
|
|
27907
|
-
const conversationItemElementsRef =
|
|
28162
|
+
const railElementRef = useRef34(null);
|
|
28163
|
+
const conversationListRef = useRef34(null);
|
|
28164
|
+
const conversationItemElementsRef = useRef34(
|
|
27908
28165
|
/* @__PURE__ */ new Map()
|
|
27909
28166
|
);
|
|
27910
|
-
const activeConversationScrollCompletedRef =
|
|
27911
|
-
const previousActiveConversationIdRef =
|
|
27912
|
-
const railActiveConversationRef =
|
|
27913
|
-
const groupedConversationsRef =
|
|
28167
|
+
const activeConversationScrollCompletedRef = useRef34(null);
|
|
28168
|
+
const previousActiveConversationIdRef = useRef34(null);
|
|
28169
|
+
const railActiveConversationRef = useRef34([]);
|
|
28170
|
+
const groupedConversationsRef = useRef34(null);
|
|
27914
28171
|
const {
|
|
27915
28172
|
loadMoreSectionConversations,
|
|
27916
28173
|
isInteractionLocked,
|
|
@@ -27933,7 +28190,7 @@ var AgentGUIConversationRailPane = memo7(
|
|
|
27933
28190
|
const railConversationEntities = [...railConversationEntitiesById.values()];
|
|
27934
28191
|
const hasConversationQuery = conversationQuery.trim().length > 0;
|
|
27935
28192
|
const backendSearchActive = hasConversationQuery && railSearch.enabled;
|
|
27936
|
-
const railInteractionsLocked =
|
|
28193
|
+
const railInteractionsLocked = isInteractionLocked();
|
|
27937
28194
|
const backendSearchConversations = backendSearchActive ? railSearch.sessionIds.flatMap((id) => {
|
|
27938
28195
|
const conversation = railConversationEntitiesById.get(id);
|
|
27939
28196
|
return conversation ? [conversation] : [];
|
|
@@ -27965,7 +28222,11 @@ var AgentGUIConversationRailPane = memo7(
|
|
|
27965
28222
|
labels,
|
|
27966
28223
|
sections: runtimeSectionsWithTransientConversations
|
|
27967
28224
|
});
|
|
27968
|
-
const runtimeDisplaySections =
|
|
28225
|
+
const runtimeDisplaySections = preserveConversationRailSectionTemplates({
|
|
28226
|
+
labels,
|
|
28227
|
+
sections: runtimeDisplayProjection.sections,
|
|
28228
|
+
userProjects
|
|
28229
|
+
});
|
|
27969
28230
|
const railActiveOverlay = runtimeDisplayProjection.activeOverlay;
|
|
27970
28231
|
useEffect30(() => {
|
|
27971
28232
|
const timer = window.setInterval(() => {
|
|
@@ -28017,8 +28278,10 @@ var AgentGUIConversationRailPane = memo7(
|
|
|
28017
28278
|
const groupedConversationResult = useMemo32(() => {
|
|
28018
28279
|
const startedAtMs = agentGuiPerfNowMs();
|
|
28019
28280
|
const query = conversationQuery.trim();
|
|
28020
|
-
const rawGroups = backendSearchActive ?
|
|
28021
|
-
|
|
28281
|
+
const rawGroups = backendSearchActive ? projectConversationRailSearchSections({
|
|
28282
|
+
conversations: filteredConversations,
|
|
28283
|
+
labels,
|
|
28284
|
+
sections: runtimeDisplaySections
|
|
28022
28285
|
}) : runtimeSectionsEnabled || runtimeRailSections ? runtimeDisplaySections.length > 0 ? !query ? runtimeDisplaySections : runtimeDisplaySections.map((section) => ({
|
|
28023
28286
|
...section,
|
|
28024
28287
|
items: section.items.filter(
|
|
@@ -28030,8 +28293,11 @@ var AgentGUIConversationRailPane = memo7(
|
|
|
28030
28293
|
(section) => section.items.length > 0 || section.id === railActiveOverlay?.sectionId && filteredConversations.some(
|
|
28031
28294
|
(conversation) => conversation.id === railActiveOverlay.conversation.id
|
|
28032
28295
|
)
|
|
28033
|
-
) : [] :
|
|
28034
|
-
|
|
28296
|
+
) : [] : projectConversationRailSectionsByExactKey({
|
|
28297
|
+
conversations: filteredConversations,
|
|
28298
|
+
labels,
|
|
28299
|
+
userProjects,
|
|
28300
|
+
includeEmptySections: !query
|
|
28035
28301
|
});
|
|
28036
28302
|
const groups = stabilizeConversationSections(
|
|
28037
28303
|
groupedConversationsRef.current,
|
|
@@ -28102,7 +28368,11 @@ var AgentGUIConversationRailPane = memo7(
|
|
|
28102
28368
|
sectionAgentTargetId
|
|
28103
28369
|
]
|
|
28104
28370
|
);
|
|
28105
|
-
const isRuntimeRailLoading =
|
|
28371
|
+
const isRuntimeRailLoading = isConversationRailInitialLoadPending({
|
|
28372
|
+
pending: runtimeRailSectionsPending,
|
|
28373
|
+
runtimeSectionsEnabled,
|
|
28374
|
+
sections: runtimeRailMemberships
|
|
28375
|
+
});
|
|
28106
28376
|
const isConversationRailListLoading = backendSearchActive ? railSearch.pending : isRuntimeRailLoading || isLoadingConversations && conversations.length === 0;
|
|
28107
28377
|
const shouldShowConversationSkeleton = useDelayedBoolean(
|
|
28108
28378
|
isConversationRailListLoading,
|
|
@@ -28198,96 +28468,89 @@ var AgentGUIConversationRailPane = memo7(
|
|
|
28198
28468
|
children: labels.retrySearch
|
|
28199
28469
|
}
|
|
28200
28470
|
)
|
|
28201
|
-
] }) : shouldShowConversationEmptyState ? /* @__PURE__ */ jsx49("div", { className: AgentGUINode_styles_default.emptyState, children: /* @__PURE__ */ jsx49("span", { children: conversationQuery.trim() ? labels.searchNoConversations : conversations.length === 0 ? labels.noConversations : labels.conversationUnavailable }) }) : /* @__PURE__ */ jsx49(
|
|
28202
|
-
"
|
|
28203
|
-
|
|
28204
|
-
|
|
28205
|
-
|
|
28206
|
-
|
|
28207
|
-
|
|
28208
|
-
|
|
28209
|
-
|
|
28210
|
-
|
|
28211
|
-
|
|
28212
|
-
|
|
28213
|
-
|
|
28214
|
-
|
|
28215
|
-
|
|
28216
|
-
|
|
28217
|
-
|
|
28218
|
-
|
|
28219
|
-
|
|
28220
|
-
|
|
28221
|
-
|
|
28222
|
-
|
|
28223
|
-
|
|
28224
|
-
|
|
28225
|
-
|
|
28226
|
-
|
|
28227
|
-
|
|
28228
|
-
|
|
28229
|
-
|
|
28230
|
-
|
|
28231
|
-
|
|
28232
|
-
|
|
28233
|
-
|
|
28234
|
-
|
|
28235
|
-
|
|
28236
|
-
|
|
28237
|
-
|
|
28238
|
-
|
|
28239
|
-
|
|
28240
|
-
|
|
28241
|
-
|
|
28242
|
-
|
|
28243
|
-
|
|
28244
|
-
|
|
28245
|
-
|
|
28246
|
-
|
|
28247
|
-
|
|
28248
|
-
|
|
28249
|
-
|
|
28250
|
-
|
|
28251
|
-
|
|
28252
|
-
|
|
28253
|
-
|
|
28254
|
-
|
|
28255
|
-
|
|
28256
|
-
|
|
28257
|
-
|
|
28258
|
-
|
|
28259
|
-
|
|
28260
|
-
|
|
28261
|
-
|
|
28262
|
-
|
|
28263
|
-
|
|
28264
|
-
|
|
28265
|
-
|
|
28266
|
-
|
|
28267
|
-
|
|
28268
|
-
|
|
28269
|
-
|
|
28270
|
-
|
|
28271
|
-
|
|
28272
|
-
|
|
28273
|
-
|
|
28274
|
-
|
|
28275
|
-
|
|
28276
|
-
|
|
28277
|
-
|
|
28278
|
-
|
|
28279
|
-
|
|
28280
|
-
|
|
28281
|
-
|
|
28282
|
-
|
|
28283
|
-
|
|
28284
|
-
onToggleProjectSectionCollapsed: toggleProjectSectionCollapsed
|
|
28285
|
-
}
|
|
28286
|
-
)
|
|
28287
|
-
] }, section.id);
|
|
28288
|
-
})
|
|
28289
|
-
}
|
|
28290
|
-
)
|
|
28471
|
+
] }) : shouldShowConversationEmptyState ? /* @__PURE__ */ jsx49("div", { className: AgentGUINode_styles_default.emptyState, children: /* @__PURE__ */ jsx49("span", { children: conversationQuery.trim() ? labels.searchNoConversations : conversations.length === 0 ? labels.noConversations : labels.conversationUnavailable }) }) : /* @__PURE__ */ jsx49("fieldset", { className: "contents", disabled: railInteractionsLocked, children: groupedConversations.map((section, sectionIndex) => {
|
|
28472
|
+
const projectPath = section.kind === "project" ? section.project?.path ?? "" : "";
|
|
28473
|
+
const projectLabel = section.kind === "project" ? section.label : "";
|
|
28474
|
+
const isProjectSection = section.kind === "project";
|
|
28475
|
+
const showProjectRailHeader = !conversationQuery.trim() && section.kind !== "pinned" && (sectionIndex === 0 || groupedConversations[sectionIndex - 1]?.kind === "pinned");
|
|
28476
|
+
const isSectionCollapsed = isProjectSection && collapsedProjectSectionIds.has(section.id);
|
|
28477
|
+
const sectionPageState = sectionPageStates.get(section.id);
|
|
28478
|
+
const searchSectionHasMore = backendSearchActive && sectionIndex === groupedConversations.length - 1 && railSearch.hasMore;
|
|
28479
|
+
const activeOverlayConversation = !backendSearchActive && railActiveOverlay?.sectionId === section.id && (!conversationQuery.trim() || filteredConversations.some(
|
|
28480
|
+
(conversation) => conversation.id === railActiveOverlay.conversation.id
|
|
28481
|
+
)) ? railActiveOverlay.conversation : null;
|
|
28482
|
+
const activeOverlayIsCanonical = Boolean(
|
|
28483
|
+
activeOverlayConversation && section.items.some(
|
|
28484
|
+
(item) => item.projectionSource !== "pending_activation" && item.id === activeOverlayConversation.id
|
|
28485
|
+
)
|
|
28486
|
+
);
|
|
28487
|
+
const activeOverlayCountsTowardTotal = Boolean(
|
|
28488
|
+
activeOverlayConversation && activeOverlayConversation.projectionSource !== "pending_activation" && matchesAgentGUIConversationSummaryFilter(
|
|
28489
|
+
activeOverlayConversation,
|
|
28490
|
+
conversationFilter
|
|
28491
|
+
)
|
|
28492
|
+
);
|
|
28493
|
+
const sectionTotalCount = backendSearchActive ? section.items.length + (searchSectionHasMore ? 1 : 0) : sectionPageState?.totalCount ?? section.items.filter(
|
|
28494
|
+
(item) => item.projectionSource !== "pending_activation"
|
|
28495
|
+
).length + (activeOverlayCountsTowardTotal && !activeOverlayIsCanonical ? 1 : 0);
|
|
28496
|
+
const sectionHasMore = searchSectionHasMore || !conversationQuery.trim() && sectionPageState?.hasMore === true;
|
|
28497
|
+
return /* @__PURE__ */ jsxs35(Fragment13, { children: [
|
|
28498
|
+
showProjectRailHeader ? /* @__PURE__ */ jsx49(
|
|
28499
|
+
AgentGUIProjectRailHeader,
|
|
28500
|
+
{
|
|
28501
|
+
disabled: railInteractionsLocked,
|
|
28502
|
+
labels,
|
|
28503
|
+
selectProjectDirectory,
|
|
28504
|
+
workspaceUserProjectI18n
|
|
28505
|
+
}
|
|
28506
|
+
) : null,
|
|
28507
|
+
/* @__PURE__ */ jsx49(
|
|
28508
|
+
AgentGUIConversationRailSection,
|
|
28509
|
+
{
|
|
28510
|
+
activeConversation: activeOverlayConversation,
|
|
28511
|
+
activeConversationCountsTowardTotal: activeOverlayCountsTowardTotal,
|
|
28512
|
+
activeConversationId,
|
|
28513
|
+
createConversationDisabled,
|
|
28514
|
+
currentTimeMs,
|
|
28515
|
+
isDeletingConversation,
|
|
28516
|
+
isDeletingProjectConversations,
|
|
28517
|
+
isRequestingBatchDeletion,
|
|
28518
|
+
isConversationSearchActive: Boolean(
|
|
28519
|
+
conversationQuery.trim()
|
|
28520
|
+
),
|
|
28521
|
+
isLoadingMoreConversations: backendSearchActive ? railSearch.loadingMore : sectionPageState?.isLoading ?? false,
|
|
28522
|
+
isRailInteractionLocked: isInteractionLocked,
|
|
28523
|
+
isSectionCollapsed,
|
|
28524
|
+
labels,
|
|
28525
|
+
pendingDeleteConversationId,
|
|
28526
|
+
paginationScopeKey: sectionPaginationScopeKey,
|
|
28527
|
+
previewMode,
|
|
28528
|
+
projectLabel,
|
|
28529
|
+
projectPath,
|
|
28530
|
+
registerItemElement: registerConversationItemElement,
|
|
28531
|
+
section,
|
|
28532
|
+
sectionHasMore,
|
|
28533
|
+
sectionTotalCount,
|
|
28534
|
+
uiLanguage,
|
|
28535
|
+
workspaceId,
|
|
28536
|
+
onCancelDeleteConversation,
|
|
28537
|
+
onConfirmDeleteConversation,
|
|
28538
|
+
onCreateConversation,
|
|
28539
|
+
onLoadMoreConversations: backendSearchActive ? railSearch.loadMore : loadMoreSectionConversations,
|
|
28540
|
+
onRequestDeleteConversation,
|
|
28541
|
+
onRequestRenameConversation,
|
|
28542
|
+
onSelectConversation,
|
|
28543
|
+
onRequestSectionBatchDeletion: requestSectionBatchDeletion,
|
|
28544
|
+
setPendingProjectAction,
|
|
28545
|
+
onToggleConversationPinned,
|
|
28546
|
+
onMarkConversationUnread,
|
|
28547
|
+
onOpenProjectFiles,
|
|
28548
|
+
onOpenConversationWindow,
|
|
28549
|
+
onToggleProjectSectionCollapsed: toggleProjectSectionCollapsed
|
|
28550
|
+
}
|
|
28551
|
+
)
|
|
28552
|
+
] }, section.id);
|
|
28553
|
+
}) })
|
|
28291
28554
|
}
|
|
28292
28555
|
),
|
|
28293
28556
|
footer ? /* @__PURE__ */ jsx49("div", { className: "shrink-0 pb-2", children: footer }) : null,
|
|
@@ -28346,13 +28609,73 @@ var AgentGUIConversationRailPane = memo7(
|
|
|
28346
28609
|
import {
|
|
28347
28610
|
selectWorkspaceAgentConsumerSessions as selectWorkspaceAgentConsumerSessions4
|
|
28348
28611
|
} from "@tutti-os/agent-activity-core";
|
|
28349
|
-
import { useEffect as useEffect31, useMemo as useMemo33, useRef as
|
|
28612
|
+
import { useEffect as useEffect31, useMemo as useMemo33, useRef as useRef35 } from "react";
|
|
28350
28613
|
|
|
28351
28614
|
// agent-gui/agentGuiNode/controller/AgentGUIConversationRailQueryController.ts
|
|
28352
28615
|
import {
|
|
28353
28616
|
selectPendingActivations as selectPendingActivations3,
|
|
28354
28617
|
selectWorkspaceAgentConsumerSessions as selectWorkspaceAgentConsumerSessions3
|
|
28355
28618
|
} from "@tutti-os/agent-activity-core";
|
|
28619
|
+
|
|
28620
|
+
// agent-gui/agentGuiNode/controller/agentGuiConversationRailDiagnostics.ts
|
|
28621
|
+
var CONVERSATION_RAIL_SLOW_DIAGNOSTIC_THRESHOLD_MS = 250;
|
|
28622
|
+
function emitConversationRailFirstPagesDiagnostic(input) {
|
|
28623
|
+
if (input.status === "ready" && input.durationMs < input.diagnosticSlowThresholdMs) {
|
|
28624
|
+
return;
|
|
28625
|
+
}
|
|
28626
|
+
const payload = {
|
|
28627
|
+
agentTargetId: input.agentTargetId,
|
|
28628
|
+
controllerApplyMs: input.controllerApplyMs,
|
|
28629
|
+
durationMs: input.durationMs,
|
|
28630
|
+
...input.status === "error" ? { errorKind: conversationRailErrorKind(input.error) } : {},
|
|
28631
|
+
event: input.status === "error" ? "agent_gui.conversation_rail.first_pages_failed" : "agent_gui.conversation_rail.first_pages_slow",
|
|
28632
|
+
requestId: input.requestId,
|
|
28633
|
+
requestMs: input.requestMs,
|
|
28634
|
+
refreshReason: input.refreshReason,
|
|
28635
|
+
returnedSessionCount: input.returnedSessionCount,
|
|
28636
|
+
sectionCount: input.sectionCount,
|
|
28637
|
+
status: input.status,
|
|
28638
|
+
workspaceId: input.workspaceId
|
|
28639
|
+
};
|
|
28640
|
+
try {
|
|
28641
|
+
input.diagnosticLogger(payload);
|
|
28642
|
+
} catch (error) {
|
|
28643
|
+
ignoreConversationRailDiagnosticFailure(error);
|
|
28644
|
+
}
|
|
28645
|
+
}
|
|
28646
|
+
function createConversationRailDiagnosticLogger(runtime) {
|
|
28647
|
+
return (payload) => {
|
|
28648
|
+
const reportDiagnostic = runtime.reportDiagnostic;
|
|
28649
|
+
if (!reportDiagnostic) return;
|
|
28650
|
+
try {
|
|
28651
|
+
void Promise.resolve(
|
|
28652
|
+
reportDiagnostic.call(runtime, {
|
|
28653
|
+
details: { ...payload },
|
|
28654
|
+
event: payload.event,
|
|
28655
|
+
level: payload.status === "error" ? "warn" : "info",
|
|
28656
|
+
source: "agent-gui",
|
|
28657
|
+
workspaceId: payload.workspaceId
|
|
28658
|
+
})
|
|
28659
|
+
).catch(ignoreConversationRailDiagnosticFailure);
|
|
28660
|
+
} catch (error) {
|
|
28661
|
+
ignoreConversationRailDiagnosticFailure(error);
|
|
28662
|
+
}
|
|
28663
|
+
};
|
|
28664
|
+
}
|
|
28665
|
+
function ignoreConversationRailDiagnosticFailure(error) {
|
|
28666
|
+
void error;
|
|
28667
|
+
}
|
|
28668
|
+
function conversationRailErrorKind(error) {
|
|
28669
|
+
if (error instanceof Error) {
|
|
28670
|
+
return error.name || "Error";
|
|
28671
|
+
}
|
|
28672
|
+
if (typeof error === "string") {
|
|
28673
|
+
return "string";
|
|
28674
|
+
}
|
|
28675
|
+
return error === null ? "null" : typeof error;
|
|
28676
|
+
}
|
|
28677
|
+
|
|
28678
|
+
// agent-gui/agentGuiNode/controller/AgentGUIConversationRailQueryController.ts
|
|
28356
28679
|
var SECTION_PAGE_SIZE = 5;
|
|
28357
28680
|
var SEARCH_PAGE_SIZE = 100;
|
|
28358
28681
|
var CONVERSATION_SEARCH_DEBOUNCE_MS = 300;
|
|
@@ -28375,12 +28698,15 @@ var EMPTY_QUERY_STATE = {
|
|
|
28375
28698
|
};
|
|
28376
28699
|
var AgentGUIConversationRailQueryController = class {
|
|
28377
28700
|
getSnapshot = () => this.snapshot;
|
|
28378
|
-
isInteractionLocked = () => this.
|
|
28701
|
+
isInteractionLocked = () => this.queryState.pending && this.queryState.resolvedScopeKey !== this.railSectionQueryKey && !(this.searchQuery && this.snapshot.railSearch.enabled);
|
|
28379
28702
|
subscribe = (listener) => {
|
|
28380
28703
|
this.listeners.add(listener);
|
|
28381
28704
|
return () => this.listeners.delete(listener);
|
|
28382
28705
|
};
|
|
28383
28706
|
engine;
|
|
28707
|
+
diagnosticLogger;
|
|
28708
|
+
diagnosticNow;
|
|
28709
|
+
diagnosticSlowThresholdMs;
|
|
28384
28710
|
getActiveConversationId;
|
|
28385
28711
|
listeners = /* @__PURE__ */ new Set();
|
|
28386
28712
|
runtime;
|
|
@@ -28404,6 +28730,9 @@ var AgentGUIConversationRailQueryController = class {
|
|
|
28404
28730
|
previousMembershipRecords;
|
|
28405
28731
|
unsubscribeEngine = null;
|
|
28406
28732
|
constructor(input) {
|
|
28733
|
+
this.diagnosticLogger = input.diagnosticLogger ?? createConversationRailDiagnosticLogger(input.runtime);
|
|
28734
|
+
this.diagnosticNow = input.diagnosticNow ?? Date.now;
|
|
28735
|
+
this.diagnosticSlowThresholdMs = input.diagnosticSlowThresholdMs ?? CONVERSATION_RAIL_SLOW_DIAGNOSTIC_THRESHOLD_MS;
|
|
28407
28736
|
this.engine = input.engine;
|
|
28408
28737
|
this.getActiveConversationId = input.getActiveConversationId;
|
|
28409
28738
|
this.runtime = input.runtime;
|
|
@@ -28421,7 +28750,7 @@ var AgentGUIConversationRailQueryController = class {
|
|
|
28421
28750
|
this.unsubscribeEngine = this.engine.subscribe((state) => {
|
|
28422
28751
|
this.handleEngineState(state);
|
|
28423
28752
|
});
|
|
28424
|
-
if (this.scope) this.refreshFirstPages();
|
|
28753
|
+
if (this.scope) this.refreshFirstPages("attach");
|
|
28425
28754
|
if (this.searchQuery) this.requestSearch();
|
|
28426
28755
|
return () => this.detach();
|
|
28427
28756
|
}
|
|
@@ -28449,7 +28778,7 @@ var AgentGUIConversationRailQueryController = class {
|
|
|
28449
28778
|
reconcilingSessionIds: []
|
|
28450
28779
|
};
|
|
28451
28780
|
this.emit();
|
|
28452
|
-
if (this.attached) this.refreshFirstPages();
|
|
28781
|
+
if (this.attached) this.refreshFirstPages("scope_change");
|
|
28453
28782
|
if (this.searchQuery) this.requestSearch();
|
|
28454
28783
|
}
|
|
28455
28784
|
setSearchQuery(value) {
|
|
@@ -28619,9 +28948,9 @@ var AgentGUIConversationRailQueryController = class {
|
|
|
28619
28948
|
)
|
|
28620
28949
|
};
|
|
28621
28950
|
this.emit();
|
|
28622
|
-
this.refreshFirstPages();
|
|
28951
|
+
this.refreshFirstPages("membership_change");
|
|
28623
28952
|
}
|
|
28624
|
-
refreshFirstPages() {
|
|
28953
|
+
refreshFirstPages(refreshReason) {
|
|
28625
28954
|
const listSections = this.runtime.listSessionSections;
|
|
28626
28955
|
const scopeKey = this.railSectionQueryKey;
|
|
28627
28956
|
if (!this.runtimeSectionsEnabled() || !listSections || !scopeKey) {
|
|
@@ -28631,6 +28960,7 @@ var AgentGUIConversationRailQueryController = class {
|
|
|
28631
28960
|
}
|
|
28632
28961
|
this.pagingRequestSequence += 1;
|
|
28633
28962
|
const requestSequence = this.pagingRequestSequence;
|
|
28963
|
+
const requestStartedAt = this.diagnosticNow();
|
|
28634
28964
|
const wasResolvedForScope = this.queryState.resolvedScopeKey === scopeKey && this.queryState.sections !== null;
|
|
28635
28965
|
this.cancelPagingRequests(false);
|
|
28636
28966
|
const abortController = new AbortController();
|
|
@@ -28649,6 +28979,7 @@ var AgentGUIConversationRailQueryController = class {
|
|
|
28649
28979
|
if (abortController.signal.aborted || requestSequence !== this.pagingRequestSequence || scopeKey !== this.railSectionQueryKey) {
|
|
28650
28980
|
return;
|
|
28651
28981
|
}
|
|
28982
|
+
const requestResolvedAt = this.diagnosticNow();
|
|
28652
28983
|
const sections = projectRuntimeSectionsToConversationRailMemberships({
|
|
28653
28984
|
pinned: page.pinned,
|
|
28654
28985
|
sections: page.sections
|
|
@@ -28672,10 +29003,44 @@ var AgentGUIConversationRailQueryController = class {
|
|
|
28672
29003
|
sections
|
|
28673
29004
|
};
|
|
28674
29005
|
this.emit();
|
|
28675
|
-
|
|
29006
|
+
const completedAt = this.diagnosticNow();
|
|
29007
|
+
emitConversationRailFirstPagesDiagnostic({
|
|
29008
|
+
agentTargetId: this.sectionAgentTargetId || null,
|
|
29009
|
+
controllerApplyMs: Math.max(0, completedAt - requestResolvedAt),
|
|
29010
|
+
diagnosticLogger: this.diagnosticLogger,
|
|
29011
|
+
diagnosticSlowThresholdMs: this.diagnosticSlowThresholdMs,
|
|
29012
|
+
durationMs: Math.max(0, completedAt - requestStartedAt),
|
|
29013
|
+
requestId: requestSequence,
|
|
29014
|
+
requestMs: Math.max(0, requestResolvedAt - requestStartedAt),
|
|
29015
|
+
refreshReason,
|
|
29016
|
+
returnedSessionCount: (page.pinned?.sessions.length ?? 0) + page.sections.reduce(
|
|
29017
|
+
(count, section) => count + section.sessions.length,
|
|
29018
|
+
0
|
|
29019
|
+
),
|
|
29020
|
+
sectionCount: page.sections.length + (page.pinned ? 1 : 0),
|
|
29021
|
+
status: "ready",
|
|
29022
|
+
workspaceId: this.workspaceId
|
|
29023
|
+
});
|
|
29024
|
+
}).catch((error) => {
|
|
28676
29025
|
if (abortController.signal.aborted || requestSequence !== this.pagingRequestSequence || scopeKey !== this.railSectionQueryKey) {
|
|
28677
29026
|
return;
|
|
28678
29027
|
}
|
|
29028
|
+
const failedAt = this.diagnosticNow();
|
|
29029
|
+
emitConversationRailFirstPagesDiagnostic({
|
|
29030
|
+
agentTargetId: this.sectionAgentTargetId || null,
|
|
29031
|
+
controllerApplyMs: 0,
|
|
29032
|
+
diagnosticLogger: this.diagnosticLogger,
|
|
29033
|
+
diagnosticSlowThresholdMs: this.diagnosticSlowThresholdMs,
|
|
29034
|
+
durationMs: Math.max(0, failedAt - requestStartedAt),
|
|
29035
|
+
error,
|
|
29036
|
+
requestId: requestSequence,
|
|
29037
|
+
requestMs: Math.max(0, failedAt - requestStartedAt),
|
|
29038
|
+
refreshReason,
|
|
29039
|
+
returnedSessionCount: 0,
|
|
29040
|
+
sectionCount: 0,
|
|
29041
|
+
status: "error",
|
|
29042
|
+
workspaceId: this.workspaceId
|
|
29043
|
+
});
|
|
28679
29044
|
this.queryState = wasResolvedForScope ? {
|
|
28680
29045
|
...this.queryState,
|
|
28681
29046
|
pending: false,
|
|
@@ -28890,7 +29255,7 @@ function useAgentGUIConversationRailQuery({
|
|
|
28890
29255
|
() => runtime.getSessionEngine(workspaceId),
|
|
28891
29256
|
[runtime, workspaceId]
|
|
28892
29257
|
);
|
|
28893
|
-
const activeConversationIdRef =
|
|
29258
|
+
const activeConversationIdRef = useRef35(activeConversationId);
|
|
28894
29259
|
activeConversationIdRef.current = activeConversationId;
|
|
28895
29260
|
const controller = useMemo33(
|
|
28896
29261
|
() => new AgentGUIConversationRailQueryController({
|
|
@@ -28923,6 +29288,12 @@ function useAgentGUIConversationRailQuery({
|
|
|
28923
29288
|
identitySnapshot,
|
|
28924
29289
|
Object.is
|
|
28925
29290
|
);
|
|
29291
|
+
const selectRuntimeRailConversations = useMemo33(
|
|
29292
|
+
() => createRuntimeRailConversationsSelector(
|
|
29293
|
+
createAgentGUIConversationRailTitlePromptSelector()
|
|
29294
|
+
),
|
|
29295
|
+
[]
|
|
29296
|
+
);
|
|
28926
29297
|
const runtimeRailConversations = useEngineSelector(
|
|
28927
29298
|
engine,
|
|
28928
29299
|
selectRuntimeRailConversations,
|
|
@@ -28943,9 +29314,10 @@ function useAgentGUIConversationRailQuery({
|
|
|
28943
29314
|
[controller, querySnapshot, runtimeRailConversations]
|
|
28944
29315
|
);
|
|
28945
29316
|
}
|
|
28946
|
-
function
|
|
28947
|
-
return projectCanonicalAgentGUIConversationSummaries(
|
|
28948
|
-
selectWorkspaceAgentConsumerSessions4(state)
|
|
29317
|
+
function createRuntimeRailConversationsSelector(selectTitlePrompts) {
|
|
29318
|
+
return (state) => projectCanonicalAgentGUIConversationSummaries(
|
|
29319
|
+
selectWorkspaceAgentConsumerSessions4(state),
|
|
29320
|
+
selectTitlePrompts(state)
|
|
28949
29321
|
);
|
|
28950
29322
|
}
|
|
28951
29323
|
function conversationSummaryListsRenderEqual(left, right) {
|
|
@@ -28990,13 +29362,13 @@ import {
|
|
|
28990
29362
|
useCallback as useCallback45,
|
|
28991
29363
|
useEffect as useEffect34,
|
|
28992
29364
|
useMemo as useMemo35,
|
|
28993
|
-
useRef as
|
|
29365
|
+
useRef as useRef38,
|
|
28994
29366
|
useState as useState33
|
|
28995
29367
|
} from "react";
|
|
28996
29368
|
import { ScrollArea as ScrollArea2 } from "@tutti-os/ui-system/components";
|
|
28997
29369
|
|
|
28998
29370
|
// agent-gui/agentGuiNode/view/agentGUIDetailModelHelpers.ts
|
|
28999
|
-
import { useRef as
|
|
29371
|
+
import { useRef as useRef36 } from "react";
|
|
29000
29372
|
function commandAppSource(command) {
|
|
29001
29373
|
if (!command || typeof command !== "object" || !("source" in command)) {
|
|
29002
29374
|
return null;
|
|
@@ -29076,7 +29448,7 @@ function slashStatusesEqual(left, right) {
|
|
|
29076
29448
|
return (left.agentSessionId ?? null) === (right.agentSessionId ?? null) && (left.baseUrl ?? null) === (right.baseUrl ?? null) && (left.contextWindow?.usedTokens ?? null) === (right.contextWindow?.usedTokens ?? null) && (left.contextWindow?.totalTokens ?? null) === (right.contextWindow?.totalTokens ?? null) && slashStatusLimitsEqual(left.limits, right.limits) && Boolean(left.limitsLoading) === Boolean(right.limitsLoading) && Boolean(left.limitsUnavailable) === Boolean(right.limitsUnavailable);
|
|
29077
29449
|
}
|
|
29078
29450
|
function useStableSlashStatus(status) {
|
|
29079
|
-
const statusRef =
|
|
29451
|
+
const statusRef = useRef36(null);
|
|
29080
29452
|
if (statusRef.current === null || !slashStatusesEqual(statusRef.current, status)) {
|
|
29081
29453
|
statusRef.current = status;
|
|
29082
29454
|
}
|
|
@@ -29521,7 +29893,7 @@ var AgentGUIBottomDockPane = memo9(function AgentGUIBottomDockPane2({
|
|
|
29521
29893
|
// agent-gui/agentGuiNode/view/AgentGUIDetailHeader.tsx
|
|
29522
29894
|
import { memo as memo10 } from "react";
|
|
29523
29895
|
import { Info as Info2 } from "lucide-react";
|
|
29524
|
-
import { Tooltip as
|
|
29896
|
+
import { Tooltip as Tooltip7, TooltipContent as TooltipContent7, TooltipTrigger as TooltipTrigger7 } from "@tutti-os/ui-system";
|
|
29525
29897
|
import { jsx as jsx53, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
29526
29898
|
var AgentGUIDetailHeader = memo10(function AgentGUIDetailHeader2({
|
|
29527
29899
|
activeConversation,
|
|
@@ -29557,10 +29929,10 @@ function AgentRunPathInfo({
|
|
|
29557
29929
|
if (previewMode) {
|
|
29558
29930
|
return trigger;
|
|
29559
29931
|
}
|
|
29560
|
-
return /* @__PURE__ */ jsxs38(
|
|
29561
|
-
/* @__PURE__ */ jsx53(
|
|
29932
|
+
return /* @__PURE__ */ jsxs38(Tooltip7, { children: [
|
|
29933
|
+
/* @__PURE__ */ jsx53(TooltipTrigger7, { asChild: true, children: trigger }),
|
|
29562
29934
|
/* @__PURE__ */ jsx53(
|
|
29563
|
-
|
|
29935
|
+
TooltipContent7,
|
|
29564
29936
|
{
|
|
29565
29937
|
side: "top",
|
|
29566
29938
|
align: "start",
|
|
@@ -29675,7 +30047,7 @@ import {
|
|
|
29675
30047
|
useCallback as useCallback44,
|
|
29676
30048
|
useEffect as useEffect33,
|
|
29677
30049
|
useLayoutEffect as useLayoutEffect7,
|
|
29678
|
-
useRef as
|
|
30050
|
+
useRef as useRef37,
|
|
29679
30051
|
useState as useState31
|
|
29680
30052
|
} from "react";
|
|
29681
30053
|
var AGENT_GUI_STICK_TO_BOTTOM_THRESHOLD_PX = 24;
|
|
@@ -29697,8 +30069,8 @@ function useAgentGUIDetailScroll(input) {
|
|
|
29697
30069
|
} = input;
|
|
29698
30070
|
const [isTimelineScrolledToTop, setIsTimelineScrolledToTop] = useState31(true);
|
|
29699
30071
|
const [isTimelineScrolledToBottom, setIsTimelineScrolledToBottom] = useState31(true);
|
|
29700
|
-
const bottomLockOwnerRef =
|
|
29701
|
-
const userScrollAwayIntentConversationRef =
|
|
30072
|
+
const bottomLockOwnerRef = useRef37(null);
|
|
30073
|
+
const userScrollAwayIntentConversationRef = useRef37(null);
|
|
29702
30074
|
useLayoutEffect7(() => {
|
|
29703
30075
|
const timeline = timelineRef.current;
|
|
29704
30076
|
if (!timeline) {
|
|
@@ -30671,11 +31043,11 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
30671
31043
|
renderProviderUnavailableState
|
|
30672
31044
|
}) {
|
|
30673
31045
|
"use memo";
|
|
30674
|
-
const timelineRef =
|
|
30675
|
-
const bottomDockRef =
|
|
30676
|
-
const timelineScrollAnchorRef =
|
|
30677
|
-
const submittedPromptScrollConversationRef =
|
|
30678
|
-
const pendingPrependScrollAnchorRef =
|
|
31046
|
+
const timelineRef = useRef38(null);
|
|
31047
|
+
const bottomDockRef = useRef38(null);
|
|
31048
|
+
const timelineScrollAnchorRef = useRef38(null);
|
|
31049
|
+
const submittedPromptScrollConversationRef = useRef38(null);
|
|
31050
|
+
const pendingPrependScrollAnchorRef = useRef38(null);
|
|
30679
31051
|
const [
|
|
30680
31052
|
bottomDockDismissedPromptRequestId,
|
|
30681
31053
|
setBottomDockDismissedPromptRequestId
|
|
@@ -31170,7 +31542,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
31170
31542
|
});
|
|
31171
31543
|
|
|
31172
31544
|
// agent-gui/agentGuiNode/view/AgentGUIRenameConversationDialog.tsx
|
|
31173
|
-
import { memo as memo13, useCallback as useCallback46, useEffect as useEffect35, useRef as
|
|
31545
|
+
import { memo as memo13, useCallback as useCallback46, useEffect as useEffect35, useRef as useRef39, useState as useState34 } from "react";
|
|
31174
31546
|
import { ConfirmationDialog as ConfirmationDialog2 } from "@tutti-os/ui-system";
|
|
31175
31547
|
import { jsx as jsx59, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
31176
31548
|
var AgentGUIRenameConversationDialog = memo13(
|
|
@@ -31184,9 +31556,9 @@ var AgentGUIRenameConversationDialog = memo13(
|
|
|
31184
31556
|
"use memo";
|
|
31185
31557
|
const [title, setTitle] = useState34("");
|
|
31186
31558
|
const [isSaving, setIsSaving] = useState34(false);
|
|
31187
|
-
const isSavingRef =
|
|
31188
|
-
const armedPointerActionRef =
|
|
31189
|
-
const inputRef =
|
|
31559
|
+
const isSavingRef = useRef39(false);
|
|
31560
|
+
const armedPointerActionRef = useRef39(null);
|
|
31561
|
+
const inputRef = useRef39(null);
|
|
31190
31562
|
const trimmedTitle = title.trim();
|
|
31191
31563
|
useEffect35(() => {
|
|
31192
31564
|
if (!open || !conversation) {
|
|
@@ -31414,7 +31786,7 @@ function AgentGUIReferencePickerSurface({
|
|
|
31414
31786
|
}
|
|
31415
31787
|
|
|
31416
31788
|
// agent-gui/agentGuiNode/view/useAgentGUIWorkspaceReferencePicker.ts
|
|
31417
|
-
import { useCallback as useCallback47, useMemo as useMemo36, useRef as
|
|
31789
|
+
import { useCallback as useCallback47, useMemo as useMemo36, useRef as useRef40, useState as useState35 } from "react";
|
|
31418
31790
|
import { createRichTextMentionHref } from "@tutti-os/ui-rich-text/core";
|
|
31419
31791
|
function useAgentGUIWorkspaceReferencePicker(input) {
|
|
31420
31792
|
const {
|
|
@@ -31429,7 +31801,7 @@ function useAgentGUIWorkspaceReferencePicker(input) {
|
|
|
31429
31801
|
} = input;
|
|
31430
31802
|
const [workspaceReferencePickerOpen, setWorkspaceReferencePickerOpen] = useState35(false);
|
|
31431
31803
|
const [workspaceReferencePickerTarget, setWorkspaceReferencePickerTarget] = useState35(null);
|
|
31432
|
-
const workspaceReferencePickerResolverRef =
|
|
31804
|
+
const workspaceReferencePickerResolverRef = useRef40(null);
|
|
31433
31805
|
const emptyReferencePickResult = useMemo36(
|
|
31434
31806
|
() => ({ files: [], mentionItems: [] }),
|
|
31435
31807
|
[]
|
|
@@ -31544,7 +31916,7 @@ function useAgentGUIWorkspaceReferencePicker(input) {
|
|
|
31544
31916
|
}
|
|
31545
31917
|
|
|
31546
31918
|
// agent-gui/agentGuiNode/engagement/useAgentGUINodeEngagement.ts
|
|
31547
|
-
import { useRef as
|
|
31919
|
+
import { useRef as useRef42 } from "react";
|
|
31548
31920
|
|
|
31549
31921
|
// agent-gui/agentGuiNode/engagement/projectAgentGUIEngagementContext.ts
|
|
31550
31922
|
function projectAgentGUIEngagementContext(viewModel, composerReady) {
|
|
@@ -31576,7 +31948,7 @@ function createAgentGUIEngagementContextKey(input) {
|
|
|
31576
31948
|
}
|
|
31577
31949
|
|
|
31578
31950
|
// agent-gui/agentGuiNode/engagement/useAgentGUIPanelEngagement.ts
|
|
31579
|
-
import { useEffect as useEffect36, useRef as
|
|
31951
|
+
import { useEffect as useEffect36, useRef as useRef41 } from "react";
|
|
31580
31952
|
|
|
31581
31953
|
// agent-gui/agentGuiNode/engagement/AgentGUIPanelEngagementController.ts
|
|
31582
31954
|
var AGENT_GUI_PANEL_EXPOSURE_DWELL_MS = 1e3;
|
|
@@ -31730,10 +32102,10 @@ function documentIsVisible() {
|
|
|
31730
32102
|
|
|
31731
32103
|
// agent-gui/agentGuiNode/engagement/useAgentGUIPanelEngagement.ts
|
|
31732
32104
|
function useAgentGUIPanelEngagement(input) {
|
|
31733
|
-
const inputRef =
|
|
31734
|
-
const controllerRef =
|
|
31735
|
-
const intersectionRatioRef =
|
|
31736
|
-
const engagementRef =
|
|
32105
|
+
const inputRef = useRef41(input);
|
|
32106
|
+
const controllerRef = useRef41(null);
|
|
32107
|
+
const intersectionRatioRef = useRef41(0);
|
|
32108
|
+
const engagementRef = useRef41(null);
|
|
31737
32109
|
inputRef.current = input;
|
|
31738
32110
|
if (!engagementRef.current) {
|
|
31739
32111
|
engagementRef.current = {
|
|
@@ -31773,7 +32145,7 @@ function useAgentGUIPanelEngagement(input) {
|
|
|
31773
32145
|
|
|
31774
32146
|
// agent-gui/agentGuiNode/engagement/useAgentGUINodeEngagement.ts
|
|
31775
32147
|
function useAgentGUINodeEngagement(input) {
|
|
31776
|
-
const layoutElementRef =
|
|
32148
|
+
const layoutElementRef = useRef42(null);
|
|
31777
32149
|
const projected = projectAgentGUIEngagementContext(
|
|
31778
32150
|
input.viewModel,
|
|
31779
32151
|
input.composerReady
|
|
@@ -31862,7 +32234,7 @@ function AgentGUINodeView({
|
|
|
31862
32234
|
viewModel
|
|
31863
32235
|
});
|
|
31864
32236
|
const [providerManagerOpen, setProviderManagerOpen] = useState36(false);
|
|
31865
|
-
const railResizeInteractionRef =
|
|
32237
|
+
const railResizeInteractionRef = useRef43(null);
|
|
31866
32238
|
const [isRailResizing, setIsRailResizing] = useState36(false);
|
|
31867
32239
|
const [railResizeWidthPx, setRailResizeWidthPx] = useState36(
|
|
31868
32240
|
null
|
|
@@ -31871,7 +32243,7 @@ function AgentGUINodeView({
|
|
|
31871
32243
|
localComposerFocusRequestSequence,
|
|
31872
32244
|
setLocalComposerFocusRequestSequence
|
|
31873
32245
|
] = useState36(0);
|
|
31874
|
-
const handledNewConversationRequestSequenceRef =
|
|
32246
|
+
const handledNewConversationRequestSequenceRef = useRef43(
|
|
31875
32247
|
newConversationRequestSequence
|
|
31876
32248
|
);
|
|
31877
32249
|
const {
|
|
@@ -32438,7 +32810,7 @@ function AgentGUINodeView({
|
|
|
32438
32810
|
}
|
|
32439
32811
|
)
|
|
32440
32812
|
] });
|
|
32441
|
-
return previewMode ? content : /* @__PURE__ */ jsx61(
|
|
32813
|
+
return previewMode ? content : /* @__PURE__ */ jsx61(TooltipProvider4, { children: content });
|
|
32442
32814
|
}
|
|
32443
32815
|
|
|
32444
32816
|
// agent-gui/workspaceDesktop/view/desktopDockAgentProbeTooltipModel.ts
|
|
@@ -32615,7 +32987,7 @@ import {
|
|
|
32615
32987
|
useCallback as useCallback49,
|
|
32616
32988
|
useEffect as useEffect38,
|
|
32617
32989
|
useLayoutEffect as useLayoutEffect9,
|
|
32618
|
-
useRef as
|
|
32990
|
+
useRef as useRef44,
|
|
32619
32991
|
useState as useState37
|
|
32620
32992
|
} from "react";
|
|
32621
32993
|
import { createPortal as createPortal5 } from "react-dom";
|
|
@@ -32653,8 +33025,8 @@ function AgentProbeInfoPopover({
|
|
|
32653
33025
|
onOpen
|
|
32654
33026
|
}) {
|
|
32655
33027
|
"use memo";
|
|
32656
|
-
const anchorRef =
|
|
32657
|
-
const popoverRef =
|
|
33028
|
+
const anchorRef = useRef44(null);
|
|
33029
|
+
const popoverRef = useRef44(null);
|
|
32658
33030
|
const [isOpen, setIsOpen] = useState37(false);
|
|
32659
33031
|
const [popoverStyle, setPopoverStyle] = useState37(null);
|
|
32660
33032
|
const openPopover = useCallback49(() => {
|
|
@@ -34267,7 +34639,7 @@ var AgentGUI = memo15(function AgentGUI2({
|
|
|
34267
34639
|
children: /* @__PURE__ */ jsx64(AgentGUINode, { ...nodeProps })
|
|
34268
34640
|
}
|
|
34269
34641
|
) });
|
|
34270
|
-
return props.frame.previewMode ? content : /* @__PURE__ */ jsx64(
|
|
34642
|
+
return props.frame.previewMode ? content : /* @__PURE__ */ jsx64(TooltipProvider5, { delayDuration: 120, skipDelayDuration: 0, children: content });
|
|
34271
34643
|
});
|
|
34272
34644
|
|
|
34273
34645
|
export {
|
|
@@ -34280,4 +34652,4 @@ export {
|
|
|
34280
34652
|
resolveAgentGUIAgentTarget,
|
|
34281
34653
|
AgentGUI
|
|
34282
34654
|
};
|
|
34283
|
-
//# sourceMappingURL=chunk-
|
|
34655
|
+
//# sourceMappingURL=chunk-N3HTEYLZ.js.map
|