@tutti-os/agent-gui 0.0.39 → 0.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/dist/{AgentMessageMarkdown-BVeh06AJ.d.ts → AgentMessageMarkdown-Cts0dAIm.d.ts} +4 -156
- package/dist/agent-conversation/index.d.ts +2 -1
- package/dist/agent-conversation/index.js +5 -5
- package/dist/agent-message-center/index.js +7 -7
- package/dist/agent-message-center/index.js.map +1 -1
- package/dist/app/renderer/agentactivity.css +298 -21
- package/dist/{chunk-46IYJEZX.js → chunk-3PVSIL3H.js} +5 -5
- package/dist/{chunk-RE3AHBX6.js → chunk-3WZWZHAJ.js} +2 -2
- package/dist/{chunk-Y2DQJPTL.js → chunk-42WP3P5C.js} +2 -2
- package/dist/chunk-4K22O34C.js +123 -0
- package/dist/chunk-4K22O34C.js.map +1 -0
- package/dist/{chunk-Y5SE2XMU.js → chunk-5LVFYNIP.js} +5 -2
- package/dist/{chunk-Y5SE2XMU.js.map → chunk-5LVFYNIP.js.map} +1 -1
- package/dist/{chunk-C7ZZZXKB.js → chunk-5U4SXENC.js} +5 -5
- package/dist/{chunk-ZWJBG2JM.js → chunk-EFDGMXTB.js} +62 -7
- package/dist/chunk-EFDGMXTB.js.map +1 -0
- package/dist/{chunk-JNGYJ7GM.js → chunk-EU7RWKHE.js} +2 -2
- package/dist/{chunk-IXIGWLQY.js → chunk-F5DYXCY3.js} +1 -1
- package/dist/{chunk-IXIGWLQY.js.map → chunk-F5DYXCY3.js.map} +1 -1
- package/dist/{chunk-WJPEKD3F.js → chunk-LKOPLDPM.js} +5 -1
- package/dist/chunk-LKOPLDPM.js.map +1 -0
- package/dist/{chunk-3AXEEQMV.js → chunk-MUJYJDZH.js} +12 -11
- package/dist/chunk-MUJYJDZH.js.map +1 -0
- package/dist/{chunk-5HQDW73P.js → chunk-OLZP2EFK.js} +231 -46
- package/dist/chunk-OLZP2EFK.js.map +1 -0
- package/dist/{chunk-XL2EKJTQ.js → chunk-QIPMH6XO.js} +137 -37
- package/dist/chunk-QIPMH6XO.js.map +1 -0
- package/dist/{chunk-B2JKDZSR.js → chunk-TXXWUG2J.js} +1 -1
- package/dist/chunk-TXXWUG2J.js.map +1 -0
- package/dist/context-mention-palette/index.js +6 -6
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/index.js +1 -1
- package/dist/index.d.ts +134 -102
- package/dist/index.js +374 -154
- package/dist/index.js.map +1 -1
- package/dist/types-xMz0lJWt.d.ts +173 -0
- package/dist/workbench/contribution.d.ts +5 -0
- package/dist/workbench/contribution.js +5 -4
- package/dist/workbench/index.d.ts +11 -3
- package/dist/workbench/index.js +5 -4
- package/dist/workbench/launch.d.ts +1 -0
- package/dist/workbench/launch.js +2 -2
- package/dist/workbench/providerCatalog.d.ts +1 -0
- package/dist/workbench/state.d.ts +1 -0
- package/dist/workbench/state.js +2 -1
- package/dist/workbench/types.d.ts +6 -0
- package/dist/workbench/types.js +1 -1
- package/dist/workspace-agent-generated-files.js +2 -2
- package/package.json +12 -12
- package/dist/chunk-3AXEEQMV.js.map +0 -1
- package/dist/chunk-5HQDW73P.js.map +0 -1
- package/dist/chunk-B2JKDZSR.js.map +0 -1
- package/dist/chunk-WJPEKD3F.js.map +0 -1
- package/dist/chunk-XL2EKJTQ.js.map +0 -1
- package/dist/chunk-ZWJBG2JM.js.map +0 -1
- /package/dist/{chunk-46IYJEZX.js.map → chunk-3PVSIL3H.js.map} +0 -0
- /package/dist/{chunk-RE3AHBX6.js.map → chunk-3WZWZHAJ.js.map} +0 -0
- /package/dist/{chunk-Y2DQJPTL.js.map → chunk-42WP3P5C.js.map} +0 -0
- /package/dist/{chunk-C7ZZZXKB.js.map → chunk-5U4SXENC.js.map} +0 -0
- /package/dist/{chunk-JNGYJ7GM.js.map → chunk-EU7RWKHE.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -10,11 +10,20 @@ import {
|
|
|
10
10
|
resolveNextAgentGUIConversationRailWidthPx,
|
|
11
11
|
shouldAutoCollapseAgentGUIConversationRail
|
|
12
12
|
} from "./chunk-Q75AK47T.js";
|
|
13
|
+
import {
|
|
14
|
+
agentGUIDefaultTargetProviders,
|
|
15
|
+
agentGUIProviderTargetRefsEqual,
|
|
16
|
+
createLocalAgentGUIProviderTarget,
|
|
17
|
+
createLocalAgentGUIProviderTargets,
|
|
18
|
+
localAgentGUIProviderTargetId,
|
|
19
|
+
normalizeAgentGUIProviderTargets,
|
|
20
|
+
resolveAgentGUIProviderTarget
|
|
21
|
+
} from "./chunk-4K22O34C.js";
|
|
13
22
|
import {
|
|
14
23
|
AgentInteractivePromptSurface,
|
|
15
24
|
approvalOptionDisplayLabel,
|
|
16
25
|
formatAgentSessionMentionText
|
|
17
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-3PVSIL3H.js";
|
|
18
27
|
import {
|
|
19
28
|
PLAN_IMPLEMENTATION_ACTION_FEEDBACK,
|
|
20
29
|
PLAN_IMPLEMENTATION_ACTION_IMPLEMENT,
|
|
@@ -38,14 +47,13 @@ import {
|
|
|
38
47
|
skillDescriptionForDisplay,
|
|
39
48
|
skillTriggerForPrefix,
|
|
40
49
|
useProjectedAgentConversation
|
|
41
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-MUJYJDZH.js";
|
|
42
51
|
import {
|
|
43
52
|
AgentMessageMarkdown,
|
|
44
|
-
ConversationImageContextMenu,
|
|
45
53
|
ZoomableImage,
|
|
46
54
|
cn,
|
|
47
55
|
resolveWorkspaceLinkAction
|
|
48
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-OLZP2EFK.js";
|
|
49
57
|
import {
|
|
50
58
|
AGENT_MENTION_FILTER_TAB_ORDER,
|
|
51
59
|
AgentFileMentionPalette,
|
|
@@ -53,7 +61,7 @@ import {
|
|
|
53
61
|
DEFAULT_AGENT_MENTION_FILTER,
|
|
54
62
|
agentMentionItemKey,
|
|
55
63
|
preloadAgentMentionBrowse
|
|
56
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-5U4SXENC.js";
|
|
57
65
|
import {
|
|
58
66
|
WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN,
|
|
59
67
|
buildWorkspaceAgentActivityListViewModel,
|
|
@@ -63,13 +71,13 @@ import {
|
|
|
63
71
|
isWorkspaceAgentUntitledTask,
|
|
64
72
|
mergeWorkspaceAgentActivityDurableAndOverlayMessages,
|
|
65
73
|
selectWorkspaceAgentActivityOverlayMessages
|
|
66
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-5LVFYNIP.js";
|
|
67
75
|
import {
|
|
68
76
|
MANAGED_AGENT_ICON_FALLBACK_URL,
|
|
69
77
|
MANAGED_AGENT_ICON_URLS,
|
|
70
78
|
Spinner,
|
|
71
79
|
normalizeManagedAgentProvider
|
|
72
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-42WP3P5C.js";
|
|
73
81
|
import "./chunk-MTFSQWZ6.js";
|
|
74
82
|
import {
|
|
75
83
|
resolveWorkspaceAgentSessionSortTimeUnixMs
|
|
@@ -80,7 +88,7 @@ import {
|
|
|
80
88
|
mentionItemToAttrs,
|
|
81
89
|
normalizeAgentSessionMentionTitle,
|
|
82
90
|
parseMentionItemFromHref
|
|
83
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-3WZWZHAJ.js";
|
|
84
92
|
import "./chunk-Y35GDLP2.js";
|
|
85
93
|
import {
|
|
86
94
|
AgentActivityHostProvider,
|
|
@@ -94,7 +102,7 @@ import {
|
|
|
94
102
|
useAgentActivitySnapshot,
|
|
95
103
|
useAgentHostApi,
|
|
96
104
|
useOptionalAgentActivityRuntime
|
|
97
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-TXXWUG2J.js";
|
|
98
106
|
import "./chunk-TYGL25EL.js";
|
|
99
107
|
import {
|
|
100
108
|
AGENT_CONTEXT_MENTION_PROVIDER_IDS
|
|
@@ -109,7 +117,7 @@ import {
|
|
|
109
117
|
getActiveUiLanguage,
|
|
110
118
|
translate,
|
|
111
119
|
useTranslation
|
|
112
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-LKOPLDPM.js";
|
|
113
121
|
import "./chunk-LUGELG5V.js";
|
|
114
122
|
import "./chunk-PJP5BUU6.js";
|
|
115
123
|
|
|
@@ -2066,6 +2074,7 @@ function WorkspaceNodeWindow({
|
|
|
2066
2074
|
const resolvedStyle = sizeStyle ?? style;
|
|
2067
2075
|
const renderedChildren = typeof children === "function" ? children(renderedFrame) : children;
|
|
2068
2076
|
const rootStyle = appearance === "embedded" ? {
|
|
2077
|
+
"--node-header-padding-x": "16px",
|
|
2069
2078
|
...resolvedStyle,
|
|
2070
2079
|
width: "100%",
|
|
2071
2080
|
height: "100%",
|
|
@@ -2076,6 +2085,7 @@ function WorkspaceNodeWindow({
|
|
|
2076
2085
|
backdropFilter: "none",
|
|
2077
2086
|
WebkitBackdropFilter: "none"
|
|
2078
2087
|
} : {
|
|
2088
|
+
"--node-header-padding-x": "16px",
|
|
2079
2089
|
...resolvedStyle,
|
|
2080
2090
|
background: "transparent",
|
|
2081
2091
|
border: "1px solid var(--node-window-border)",
|
|
@@ -2131,7 +2141,7 @@ function WorkspaceNodeWindow({
|
|
|
2131
2141
|
/* @__PURE__ */ jsxs3(
|
|
2132
2142
|
"div",
|
|
2133
2143
|
{
|
|
2134
|
-
className: "workspace-node-window__title flex min-w-0 flex-1 items-center gap-
|
|
2144
|
+
className: "workspace-node-window__title flex min-w-0 max-w-[280px] flex-1 items-center gap-2 text-[13px] leading-[18px] font-semibold text-foreground",
|
|
2135
2145
|
"data-workspace-node-window-title": "true",
|
|
2136
2146
|
title,
|
|
2137
2147
|
children: [
|
|
@@ -2143,7 +2153,7 @@ function WorkspaceNodeWindow({
|
|
|
2143
2153
|
children: titleIcon
|
|
2144
2154
|
}
|
|
2145
2155
|
) : null,
|
|
2146
|
-
/* @__PURE__ */ jsx11("span", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap", children: title }),
|
|
2156
|
+
/* @__PURE__ */ jsx11("span", { className: "block min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap", children: title }),
|
|
2147
2157
|
titleAccessory ? /* @__PURE__ */ jsx11(
|
|
2148
2158
|
"span",
|
|
2149
2159
|
{
|
|
@@ -2834,6 +2844,7 @@ function conversationSummaryFromActivity(activity, session, options) {
|
|
|
2834
2844
|
pinnedAtUnixMs: session?.pinnedAtUnixMs ?? null,
|
|
2835
2845
|
sortTimeUnixMs: activity.sortTimeUnixMs,
|
|
2836
2846
|
updatedAtUnixMs: session?.updatedAtUnixMs || activity.sortTimeUnixMs || 0,
|
|
2847
|
+
...isImportedWorkspaceAgentSession(session) ? { isImported: true } : {},
|
|
2837
2848
|
syncState: session?.syncState
|
|
2838
2849
|
};
|
|
2839
2850
|
}
|
|
@@ -2847,6 +2858,9 @@ function isExternalImportNoProjectSession(session) {
|
|
|
2847
2858
|
const runtimeContext = session && "runtimeContext" in session ? session.runtimeContext : void 0;
|
|
2848
2859
|
return runtimeContext?.externalImportNoProject === true;
|
|
2849
2860
|
}
|
|
2861
|
+
function isImportedWorkspaceAgentSession(session) {
|
|
2862
|
+
return session?.runtimeContext?.imported === true;
|
|
2863
|
+
}
|
|
2850
2864
|
function isSameAgentGUIConversationProject(left, right) {
|
|
2851
2865
|
if (!left && !right) {
|
|
2852
2866
|
return true;
|
|
@@ -3508,7 +3522,7 @@ function projectWorkspaceAgentMessagesToTimelineItems(messages) {
|
|
|
3508
3522
|
const seq = index + 1;
|
|
3509
3523
|
const eventId = message.messageId.trim() || `message:${id}`;
|
|
3510
3524
|
const turnId = message.turnId?.trim() || void 0;
|
|
3511
|
-
const occurredAtUnixMs = message
|
|
3525
|
+
const occurredAtUnixMs = messageDisplayOrderTime(message);
|
|
3512
3526
|
if (kind === "tool_call") {
|
|
3513
3527
|
const callId = firstNonEmptyString(
|
|
3514
3528
|
messagePayloadString(message, "callId"),
|
|
@@ -3682,7 +3696,7 @@ function workspaceTimelineFields(workspaceId) {
|
|
|
3682
3696
|
};
|
|
3683
3697
|
}
|
|
3684
3698
|
function compareMessagesByDisplayOrder(left, right) {
|
|
3685
|
-
return
|
|
3699
|
+
return messageDisplayOrderTime(left) - messageDisplayOrderTime(right) || normalizedPositiveNumber(left.version) - normalizedPositiveNumber(right.version) || normalizedPositiveNumber(left.id) - normalizedPositiveNumber(right.id) || (left.version ?? 0) - (right.version ?? 0) || left.messageId.localeCompare(right.messageId);
|
|
3686
3700
|
}
|
|
3687
3701
|
function normalizedMessageId(id, index) {
|
|
3688
3702
|
const normalizedId = typeof id === "number" ? id : 0;
|
|
@@ -3691,8 +3705,8 @@ function normalizedMessageId(id, index) {
|
|
|
3691
3705
|
function normalizedPositiveNumber(value) {
|
|
3692
3706
|
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : 0;
|
|
3693
3707
|
}
|
|
3694
|
-
function
|
|
3695
|
-
return normalizedPositiveNumber(message.
|
|
3708
|
+
function messageDisplayOrderTime(message) {
|
|
3709
|
+
return normalizedPositiveNumber(message.startedAtUnixMs) || normalizedPositiveNumber(message.occurredAtUnixMs) || normalizedPositiveNumber(message.completedAtUnixMs);
|
|
3696
3710
|
}
|
|
3697
3711
|
function toolCallItemType(status) {
|
|
3698
3712
|
switch (normalizeToken(status)) {
|
|
@@ -3823,7 +3837,30 @@ import {
|
|
|
3823
3837
|
mergeAgentActivityMessages
|
|
3824
3838
|
} from "@tutti-os/agent-activity-core";
|
|
3825
3839
|
function mergeWorkspaceAgentMessages(previous, incoming) {
|
|
3826
|
-
|
|
3840
|
+
const previousDurableMessages = previous.filter(
|
|
3841
|
+
(message) => !isWorkspaceAgentActivityOptimisticMessage(message)
|
|
3842
|
+
);
|
|
3843
|
+
const incomingDurableMessages = incoming.filter(
|
|
3844
|
+
(message) => !isWorkspaceAgentActivityOptimisticMessage(message)
|
|
3845
|
+
);
|
|
3846
|
+
const durableMessages = mergeAgentActivityMessages(
|
|
3847
|
+
previousDurableMessages,
|
|
3848
|
+
incomingDurableMessages
|
|
3849
|
+
);
|
|
3850
|
+
const previousOptimisticMessages = previous.filter(
|
|
3851
|
+
isWorkspaceAgentActivityOptimisticMessage
|
|
3852
|
+
);
|
|
3853
|
+
const incomingOptimisticMessages = incoming.filter(
|
|
3854
|
+
isWorkspaceAgentActivityOptimisticMessage
|
|
3855
|
+
);
|
|
3856
|
+
const localMessages = mergeAgentActivityMessages(
|
|
3857
|
+
previousOptimisticMessages,
|
|
3858
|
+
incomingOptimisticMessages
|
|
3859
|
+
);
|
|
3860
|
+
return mergeWorkspaceAgentActivityDurableAndOverlayMessages({
|
|
3861
|
+
durableMessages,
|
|
3862
|
+
localMessages
|
|
3863
|
+
});
|
|
3827
3864
|
}
|
|
3828
3865
|
|
|
3829
3866
|
// host/agentHostAccountStore.ts
|
|
@@ -4106,7 +4143,6 @@ function subscribeCoalesced(type, options, callback) {
|
|
|
4106
4143
|
|
|
4107
4144
|
// contexts/workspace/presentation/renderer/agentSessions/agentSessionViewStore.ts
|
|
4108
4145
|
import { useSyncExternalStore } from "react";
|
|
4109
|
-
import { mergeAgentActivityMessages as mergeAgentActivityMessages2 } from "@tutti-os/agent-activity-core";
|
|
4110
4146
|
var STREAM_LINGER_MS = 15e3;
|
|
4111
4147
|
var EMPTY_AGENT_SESSION_VIEW_STORE_SNAPSHOT = {
|
|
4112
4148
|
sessionViewsBySessionKey: {}
|
|
@@ -4701,7 +4737,7 @@ function createEmptySessionView(ref) {
|
|
|
4701
4737
|
};
|
|
4702
4738
|
}
|
|
4703
4739
|
function mergeMessages(left, right) {
|
|
4704
|
-
return
|
|
4740
|
+
return mergeWorkspaceAgentMessages(left, right);
|
|
4705
4741
|
}
|
|
4706
4742
|
function sameMessages(left, right) {
|
|
4707
4743
|
if (left.length !== right.length) {
|
|
@@ -4831,7 +4867,7 @@ function useWatchAgentSessions(input) {
|
|
|
4831
4867
|
}
|
|
4832
4868
|
|
|
4833
4869
|
// contexts/workspace/presentation/renderer/agentGuiConversationList/agentGuiConversationListStore.ts
|
|
4834
|
-
import { mergeAgentActivityMessages as
|
|
4870
|
+
import { mergeAgentActivityMessages as mergeAgentActivityMessages2 } from "@tutti-os/agent-activity-core";
|
|
4835
4871
|
|
|
4836
4872
|
// contexts/workspace/presentation/renderer/agentGuiConversationList/agentGuiConversationListPendingState.ts
|
|
4837
4873
|
var pendingCreateConversationIdsByQueryKey = /* @__PURE__ */ new Map();
|
|
@@ -5235,6 +5271,7 @@ function mergeLoadedConversation(current, incoming) {
|
|
|
5235
5271
|
const merged = {
|
|
5236
5272
|
...incoming,
|
|
5237
5273
|
...mergeLoadedConversationTitleFields(current, incoming, preferCurrent),
|
|
5274
|
+
...incoming.isImported === true || current?.isImported === true ? { isImported: true } : {},
|
|
5238
5275
|
hasUnreadCompletion: incoming.hasUnreadCompletion || (preferCurrent ? current?.hasUnreadCompletion : false),
|
|
5239
5276
|
unreadCompletionKey: incoming.unreadCompletionKey ?? (preferCurrent ? current?.unreadCompletionKey : null),
|
|
5240
5277
|
pinnedAtUnixMs,
|
|
@@ -5273,7 +5310,7 @@ function areConversationProjectsEqual(left, right) {
|
|
|
5273
5310
|
return left.id === right.id && left.path === right.path && left.label === right.label && left.createdAtUnixMs === right.createdAtUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.lastUsedAtUnixMs === right.lastUsedAtUnixMs;
|
|
5274
5311
|
}
|
|
5275
5312
|
function areConversationsEqual(left, right) {
|
|
5276
|
-
return left.id === right.id && left.userId === right.userId && left.provider === right.provider && left.title === right.title && left.status === right.status && left.cwd === right.cwd && areConversationProjectsEqual(left.project, right.project) && left.sortTimeUnixMs === right.sortTimeUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && (left.pinnedAtUnixMs ?? 0) === (right.pinnedAtUnixMs ?? 0) && left.hasUnreadCompletion === right.hasUnreadCompletion && left.unreadCompletionKey === right.unreadCompletionKey && areConversationTitleFallbacksEqual(
|
|
5313
|
+
return left.id === right.id && left.userId === right.userId && left.provider === right.provider && left.title === right.title && left.status === right.status && left.cwd === right.cwd && areConversationProjectsEqual(left.project, right.project) && left.sortTimeUnixMs === right.sortTimeUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && (left.pinnedAtUnixMs ?? 0) === (right.pinnedAtUnixMs ?? 0) && left.isImported === right.isImported && left.hasUnreadCompletion === right.hasUnreadCompletion && left.unreadCompletionKey === right.unreadCompletionKey && areConversationTitleFallbacksEqual(
|
|
5277
5314
|
left.titleFallback,
|
|
5278
5315
|
right.titleFallback
|
|
5279
5316
|
) && areConversationSyncStatesEqual(left.syncState, right.syncState);
|
|
@@ -5356,6 +5393,9 @@ function describeConversationListChange(previous, next) {
|
|
|
5356
5393
|
"pinnedAtUnixMs"
|
|
5357
5394
|
);
|
|
5358
5395
|
}
|
|
5396
|
+
if (left.isImported !== right.isImported) {
|
|
5397
|
+
addChangedConversationField(fields, changedIds, right.id, "isImported");
|
|
5398
|
+
}
|
|
5359
5399
|
if (left.hasUnreadCompletion !== right.hasUnreadCompletion) {
|
|
5360
5400
|
addChangedConversationField(
|
|
5361
5401
|
fields,
|
|
@@ -5549,7 +5589,7 @@ function nonEmptySessionMessagesById(durableMessagesBySessionId, sessionViewData
|
|
|
5549
5589
|
function mergeSessionMessagesById(left, right) {
|
|
5550
5590
|
const next = { ...left };
|
|
5551
5591
|
for (const [agentSessionId, messages] of Object.entries(right)) {
|
|
5552
|
-
next[agentSessionId] =
|
|
5592
|
+
next[agentSessionId] = mergeAgentActivityMessages2(
|
|
5553
5593
|
next[agentSessionId] ?? [],
|
|
5554
5594
|
messages
|
|
5555
5595
|
);
|
|
@@ -5628,7 +5668,7 @@ function decorateConversationForRefresh(input) {
|
|
|
5628
5668
|
messages: input.mergedMessages
|
|
5629
5669
|
});
|
|
5630
5670
|
const hasUnreadCompletion = Boolean(
|
|
5631
|
-
completionKey && !isCompletedRead(input.readState, completionKey) && !hasActiveConversationOwner(input.queryKey, input.conversation.id)
|
|
5671
|
+
completionKey && input.conversation.isImported !== true && !isCompletedRead(input.readState, completionKey) && !hasActiveConversationOwner(input.queryKey, input.conversation.id)
|
|
5632
5672
|
);
|
|
5633
5673
|
const nextConversation = {
|
|
5634
5674
|
...input.conversation,
|
|
@@ -6038,7 +6078,7 @@ function markAgentGUIConversationCompletionObserved(input) {
|
|
|
6038
6078
|
updateCompletedReadState(queryState, completionKey);
|
|
6039
6079
|
}
|
|
6040
6080
|
const canShowCompletion = conversation.status === "completed" || input.allowReadyStatus === true;
|
|
6041
|
-
const hasUnreadCompletion = canShowCompletion && shouldMarkUnread && !isCompletedRead(
|
|
6081
|
+
const hasUnreadCompletion = canShowCompletion && conversation.isImported !== true && shouldMarkUnread && !isCompletedRead(
|
|
6042
6082
|
readStateByQueryKey.get(queryState.queryKey) ?? emptyWorkspaceAgentReadState(),
|
|
6043
6083
|
completionKey
|
|
6044
6084
|
);
|
|
@@ -6259,6 +6299,7 @@ function useAgentGUIActivation({
|
|
|
6259
6299
|
initialDisplayPrompt: input.initialDisplayPrompt,
|
|
6260
6300
|
metadata: input.metadata,
|
|
6261
6301
|
title: input.title,
|
|
6302
|
+
providerTargetRef: input.providerTargetRef,
|
|
6262
6303
|
settings: input.settings,
|
|
6263
6304
|
visible: input.visible,
|
|
6264
6305
|
openclawGatewayReady: input.openclawGatewayReady
|
|
@@ -6645,6 +6686,22 @@ var AGENT_PROVIDER_SESSION_NOT_FOUND_FALLBACK_MESSAGE = "The previous agent sess
|
|
|
6645
6686
|
var AGENT_RESUME_SESSION_NOT_LOCAL_FALLBACK_MESSAGE = "The previous agent session is not available on this machine.";
|
|
6646
6687
|
var AGENT_GUI_CAUGHT_ERROR_STACK_LIMIT = 4e3;
|
|
6647
6688
|
var SELECTED_SESSION_NOT_FOUND_RETRY_DELAY_MS = 150;
|
|
6689
|
+
function composerDefaultsFromSettings(settings) {
|
|
6690
|
+
const defaults = {};
|
|
6691
|
+
const model = normalizeOptionalText2(settings.model);
|
|
6692
|
+
const permissionModeId = normalizeOptionalText2(settings.permissionModeId);
|
|
6693
|
+
const reasoningEffort = normalizeOptionalText2(settings.reasoningEffort);
|
|
6694
|
+
if (model) {
|
|
6695
|
+
defaults.model = model;
|
|
6696
|
+
}
|
|
6697
|
+
if (permissionModeId) {
|
|
6698
|
+
defaults.permissionModeId = permissionModeId;
|
|
6699
|
+
}
|
|
6700
|
+
if (reasoningEffort) {
|
|
6701
|
+
defaults.reasoningEffort = reasoningEffort;
|
|
6702
|
+
}
|
|
6703
|
+
return Object.keys(defaults).length > 0 ? defaults : null;
|
|
6704
|
+
}
|
|
6648
6705
|
function reportAgentGUIRuntimeError(input) {
|
|
6649
6706
|
const reportDiagnostic = input.runtime.reportDiagnostic;
|
|
6650
6707
|
if (!reportDiagnostic) {
|
|
@@ -6824,6 +6881,32 @@ function reportAgentGUISubmitWithoutActiveConversation(input) {
|
|
|
6824
6881
|
} catch {
|
|
6825
6882
|
}
|
|
6826
6883
|
}
|
|
6884
|
+
function reportAgentGUISubmitRecoveredActiveConversation(input) {
|
|
6885
|
+
const reportDiagnostic = input.runtime.reportDiagnostic;
|
|
6886
|
+
if (!reportDiagnostic) {
|
|
6887
|
+
return;
|
|
6888
|
+
}
|
|
6889
|
+
try {
|
|
6890
|
+
void Promise.resolve(
|
|
6891
|
+
reportDiagnostic.call(input.runtime, {
|
|
6892
|
+
details: {
|
|
6893
|
+
blockCount: input.blockCount,
|
|
6894
|
+
conversationCount: input.conversationCount,
|
|
6895
|
+
conversationListQueryReady: input.conversationListQueryReady,
|
|
6896
|
+
promptLength: input.promptLength,
|
|
6897
|
+
provider: input.provider,
|
|
6898
|
+
recoveredAgentSessionId: input.recoveredAgentSessionId
|
|
6899
|
+
},
|
|
6900
|
+
event: "agent.gui.submit.recovered_active_conversation",
|
|
6901
|
+
level: "info",
|
|
6902
|
+
source: "agent-gui",
|
|
6903
|
+
workspaceId: input.workspaceId
|
|
6904
|
+
})
|
|
6905
|
+
).catch(() => {
|
|
6906
|
+
});
|
|
6907
|
+
} catch {
|
|
6908
|
+
}
|
|
6909
|
+
}
|
|
6827
6910
|
function reportAgentGUICancelDiagnostic(input) {
|
|
6828
6911
|
if (input.result.canceled) {
|
|
6829
6912
|
return;
|
|
@@ -7293,7 +7376,7 @@ function conversationSummariesRenderEqual(left, right) {
|
|
|
7293
7376
|
return left.id === right.id && left.userId === right.userId && left.provider === right.provider && left.title === right.title && conversationTitleFallbacksRenderEqual(
|
|
7294
7377
|
left.titleFallback,
|
|
7295
7378
|
right.titleFallback
|
|
7296
|
-
) && left.status === right.status && left.cwd === right.cwd && left.pinnedAtUnixMs === right.pinnedAtUnixMs && left.sortTimeUnixMs === right.sortTimeUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.hasUnreadCompletion === right.hasUnreadCompletion && left.unreadCompletionKey === right.unreadCompletionKey && conversationProjectsRenderEqual(left.project, right.project) && conversationSyncStatesEqual(left.syncState, right.syncState);
|
|
7379
|
+
) && left.status === right.status && left.cwd === right.cwd && left.pinnedAtUnixMs === right.pinnedAtUnixMs && left.sortTimeUnixMs === right.sortTimeUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.isImported === right.isImported && left.hasUnreadCompletion === right.hasUnreadCompletion && left.unreadCompletionKey === right.unreadCompletionKey && conversationProjectsRenderEqual(left.project, right.project) && conversationSyncStatesEqual(left.syncState, right.syncState);
|
|
7297
7380
|
}
|
|
7298
7381
|
function conversationTitleFallbacksRenderEqual(left, right) {
|
|
7299
7382
|
return left === right || JSON.stringify(left ?? null) === JSON.stringify(right ?? null);
|
|
@@ -8446,15 +8529,51 @@ function useAgentGUINodeController({
|
|
|
8446
8529
|
workspacePath,
|
|
8447
8530
|
avoidGroupingEdits,
|
|
8448
8531
|
data,
|
|
8532
|
+
providerTargets,
|
|
8533
|
+
defaultProviderTargetId = null,
|
|
8449
8534
|
openSessionRequest = null,
|
|
8450
8535
|
prefillPromptRequest = null,
|
|
8451
8536
|
previewMode = false,
|
|
8452
8537
|
onDataChange,
|
|
8538
|
+
onRememberComposerDefaults,
|
|
8453
8539
|
onShowMessage
|
|
8454
8540
|
}) {
|
|
8455
8541
|
const agentActivityRuntime = useAgentActivityRuntime();
|
|
8456
8542
|
const agentHostApi = useAgentHostApi();
|
|
8457
8543
|
const agentActivitySnapshot = useAgentActivitySnapshot(workspaceId);
|
|
8544
|
+
const normalizedExplicitProviderTargets = useMemo4(
|
|
8545
|
+
() => normalizeAgentGUIProviderTargets(providerTargets, {
|
|
8546
|
+
fallbackToLocal: false
|
|
8547
|
+
}),
|
|
8548
|
+
[providerTargets]
|
|
8549
|
+
);
|
|
8550
|
+
const normalizedProviderTargets = useMemo4(
|
|
8551
|
+
() => normalizedExplicitProviderTargets.length > 0 ? normalizedExplicitProviderTargets : normalizeAgentGUIProviderTargets(null),
|
|
8552
|
+
[normalizedExplicitProviderTargets]
|
|
8553
|
+
);
|
|
8554
|
+
const selectedProviderTarget = useMemo4(
|
|
8555
|
+
() => resolveAgentGUIProviderTarget({
|
|
8556
|
+
defaultProviderTargetId,
|
|
8557
|
+
provider: data.provider,
|
|
8558
|
+
providerTargetId: data.providerTargetId,
|
|
8559
|
+
providerTargets: normalizedProviderTargets
|
|
8560
|
+
}),
|
|
8561
|
+
[
|
|
8562
|
+
data.provider,
|
|
8563
|
+
data.providerTargetId,
|
|
8564
|
+
defaultProviderTargetId,
|
|
8565
|
+
normalizedProviderTargets
|
|
8566
|
+
]
|
|
8567
|
+
);
|
|
8568
|
+
const selectedProviderTargetIsExplicit = useMemo4(
|
|
8569
|
+
() => normalizedExplicitProviderTargets.some(
|
|
8570
|
+
(target) => target.provider === selectedProviderTarget.provider && target.targetId === selectedProviderTarget.targetId && agentGUIProviderTargetRefsEqual(
|
|
8571
|
+
target.ref,
|
|
8572
|
+
selectedProviderTarget.ref
|
|
8573
|
+
)
|
|
8574
|
+
),
|
|
8575
|
+
[normalizedExplicitProviderTargets, selectedProviderTarget]
|
|
8576
|
+
);
|
|
8458
8577
|
const agentActivityDisplayStatusesRef = useRef4(null);
|
|
8459
8578
|
const agentActivityDisplayStatuses = useMemo4(() => {
|
|
8460
8579
|
const next = selectSessionDisplayStatuses(agentActivitySnapshot);
|
|
@@ -8800,8 +8919,15 @@ function useAgentGUINodeController({
|
|
|
8800
8919
|
agentActivitySnapshot
|
|
8801
8920
|
);
|
|
8802
8921
|
const dataRef = useRef4(data);
|
|
8922
|
+
const selectedProviderTargetRef = useRef4(selectedProviderTarget);
|
|
8923
|
+
selectedProviderTargetRef.current = selectedProviderTarget;
|
|
8924
|
+
const selectedProviderTargetIsExplicitRef = useRef4(
|
|
8925
|
+
selectedProviderTargetIsExplicit
|
|
8926
|
+
);
|
|
8927
|
+
selectedProviderTargetIsExplicitRef.current = selectedProviderTargetIsExplicit;
|
|
8803
8928
|
const draftSettingsBySessionIdRef = useRef4(draftSettingsBySessionId);
|
|
8804
8929
|
const onDataChangeRef = useRef4(onDataChange);
|
|
8930
|
+
const onRememberComposerDefaultsRef = useRef4(onRememberComposerDefaults);
|
|
8805
8931
|
const onShowMessageRef = useRef4(onShowMessage);
|
|
8806
8932
|
const handledPrefillPromptSequenceRef = useRef4(null);
|
|
8807
8933
|
const pendingAutoSubmitPromptRef = useRef4(null);
|
|
@@ -8824,6 +8950,9 @@ function useAgentGUINodeController({
|
|
|
8824
8950
|
});
|
|
8825
8951
|
const selectedConversationMessageLoadSeqRef = useRef4(0);
|
|
8826
8952
|
const selectedConversationOlderMessageLoadSeqRef = useRef4(0);
|
|
8953
|
+
const failedOlderMessageCursorBySessionIdRef = useRef4(
|
|
8954
|
+
/* @__PURE__ */ new Map()
|
|
8955
|
+
);
|
|
8827
8956
|
const lastConversationProjectionDiagnosticKeyRef = useRef4(
|
|
8828
8957
|
null
|
|
8829
8958
|
);
|
|
@@ -9071,6 +9200,9 @@ function useAgentGUINodeController({
|
|
|
9071
9200
|
useEffect4(() => {
|
|
9072
9201
|
onDataChangeRef.current = onDataChange;
|
|
9073
9202
|
}, [onDataChange]);
|
|
9203
|
+
useEffect4(() => {
|
|
9204
|
+
onRememberComposerDefaultsRef.current = onRememberComposerDefaults;
|
|
9205
|
+
}, [onRememberComposerDefaults]);
|
|
9074
9206
|
useEffect4(() => {
|
|
9075
9207
|
onShowMessageRef.current = onShowMessage;
|
|
9076
9208
|
}, [onShowMessage]);
|
|
@@ -10035,6 +10167,9 @@ function useAgentGUINodeController({
|
|
|
10035
10167
|
durableMessages: detailMessages,
|
|
10036
10168
|
localMessages: windowOverlayMessages
|
|
10037
10169
|
});
|
|
10170
|
+
failedOlderMessageCursorBySessionIdRef.current.delete(
|
|
10171
|
+
normalizedAgentSessionId
|
|
10172
|
+
);
|
|
10038
10173
|
setAgentSessionViewDetailMessages(
|
|
10039
10174
|
sessionViewRef(normalizedAgentSessionId),
|
|
10040
10175
|
detailMessages,
|
|
@@ -10111,6 +10246,23 @@ function useAgentGUINodeController({
|
|
|
10111
10246
|
});
|
|
10112
10247
|
return;
|
|
10113
10248
|
}
|
|
10249
|
+
const beforeVersion = currentView.oldestLoadedVersion;
|
|
10250
|
+
if (failedOlderMessageCursorBySessionIdRef.current.get(
|
|
10251
|
+
normalizedAgentSessionId
|
|
10252
|
+
) === beforeVersion) {
|
|
10253
|
+
reportAgentGUIMessagePageDiagnostic({
|
|
10254
|
+
agentSessionId: normalizedAgentSessionId,
|
|
10255
|
+
details: {
|
|
10256
|
+
beforeVersion,
|
|
10257
|
+
reason: "previous_cursor_error"
|
|
10258
|
+
},
|
|
10259
|
+
event: "agent.gui.messages.older.suppressed_after_error",
|
|
10260
|
+
level: "warn",
|
|
10261
|
+
runtime: agentActivityRuntime,
|
|
10262
|
+
workspaceId
|
|
10263
|
+
});
|
|
10264
|
+
return;
|
|
10265
|
+
}
|
|
10114
10266
|
const requestId = ++selectedConversationOlderMessageLoadSeqRef.current;
|
|
10115
10267
|
setAgentSessionViewOlderMessagesLoading(
|
|
10116
10268
|
sessionViewRef(normalizedAgentSessionId),
|
|
@@ -10120,7 +10272,7 @@ function useAgentGUINodeController({
|
|
|
10120
10272
|
reportAgentGUIMessagePageDiagnostic({
|
|
10121
10273
|
agentSessionId: normalizedAgentSessionId,
|
|
10122
10274
|
details: {
|
|
10123
|
-
beforeVersion
|
|
10275
|
+
beforeVersion,
|
|
10124
10276
|
limit: AGENT_GUI_DETAIL_MESSAGES_PAGE_SIZE,
|
|
10125
10277
|
order: "desc",
|
|
10126
10278
|
requestId
|
|
@@ -10132,7 +10284,7 @@ function useAgentGUINodeController({
|
|
|
10132
10284
|
const page = await agentActivityRuntime.listSessionMessages({
|
|
10133
10285
|
workspaceId,
|
|
10134
10286
|
agentSessionId: normalizedAgentSessionId,
|
|
10135
|
-
beforeVersion
|
|
10287
|
+
beforeVersion,
|
|
10136
10288
|
cache: false,
|
|
10137
10289
|
limit: AGENT_GUI_DETAIL_MESSAGES_PAGE_SIZE,
|
|
10138
10290
|
order: "desc"
|
|
@@ -10147,7 +10299,7 @@ function useAgentGUINodeController({
|
|
|
10147
10299
|
reportAgentGUIMessagePageDiagnostic({
|
|
10148
10300
|
agentSessionId: normalizedAgentSessionId,
|
|
10149
10301
|
details: {
|
|
10150
|
-
beforeVersion
|
|
10302
|
+
beforeVersion,
|
|
10151
10303
|
hasMore: page.hasMore,
|
|
10152
10304
|
latestVersion: page.latestVersion,
|
|
10153
10305
|
requestId
|
|
@@ -10157,6 +10309,9 @@ function useAgentGUINodeController({
|
|
|
10157
10309
|
runtime: agentActivityRuntime,
|
|
10158
10310
|
workspaceId
|
|
10159
10311
|
});
|
|
10312
|
+
failedOlderMessageCursorBySessionIdRef.current.delete(
|
|
10313
|
+
normalizedAgentSessionId
|
|
10314
|
+
);
|
|
10160
10315
|
const nextDetailMessages = mergeWorkspaceAgentMessages(
|
|
10161
10316
|
currentView.detailMessages,
|
|
10162
10317
|
page.messages
|
|
@@ -10191,8 +10346,16 @@ function useAgentGUINodeController({
|
|
|
10191
10346
|
);
|
|
10192
10347
|
return;
|
|
10193
10348
|
}
|
|
10349
|
+
failedOlderMessageCursorBySessionIdRef.current.set(
|
|
10350
|
+
normalizedAgentSessionId,
|
|
10351
|
+
beforeVersion
|
|
10352
|
+
);
|
|
10194
10353
|
reportAgentGUIRuntimeError({
|
|
10195
10354
|
agentSessionId: normalizedAgentSessionId,
|
|
10355
|
+
context: {
|
|
10356
|
+
beforeVersion,
|
|
10357
|
+
requestId
|
|
10358
|
+
},
|
|
10196
10359
|
error,
|
|
10197
10360
|
phase: "load_session_messages",
|
|
10198
10361
|
provider: dataRef.current.provider,
|
|
@@ -10368,6 +10531,18 @@ function useAgentGUINodeController({
|
|
|
10368
10531
|
),
|
|
10369
10532
|
[loadSessionState]
|
|
10370
10533
|
);
|
|
10534
|
+
const scheduleActivityStreamStateReloadRef = useRef4(
|
|
10535
|
+
scheduleActivityStreamStateReload
|
|
10536
|
+
);
|
|
10537
|
+
const clearSelectedConversationNotFoundRetryRef = useRef4(
|
|
10538
|
+
clearSelectedConversationNotFoundRetry
|
|
10539
|
+
);
|
|
10540
|
+
useEffect4(() => {
|
|
10541
|
+
scheduleActivityStreamStateReloadRef.current = scheduleActivityStreamStateReload;
|
|
10542
|
+
}, [scheduleActivityStreamStateReload]);
|
|
10543
|
+
useEffect4(() => {
|
|
10544
|
+
clearSelectedConversationNotFoundRetryRef.current = clearSelectedConversationNotFoundRetry;
|
|
10545
|
+
}, [clearSelectedConversationNotFoundRetry]);
|
|
10371
10546
|
const applyTimelineProjectionUpdate = useCallback4(
|
|
10372
10547
|
(agentSessionId, nextItems, mergedItems) => {
|
|
10373
10548
|
if (nextItems.length === 0) {
|
|
@@ -10468,20 +10643,30 @@ function useAgentGUINodeController({
|
|
|
10468
10643
|
}
|
|
10469
10644
|
const currentMessages = getAgentSessionView(sessionViewRef(agentSessionId))?.overlayMessages ?? [];
|
|
10470
10645
|
const currentDetailMessages = getAgentSessionView(sessionViewRef(agentSessionId))?.detailMessages ?? [];
|
|
10646
|
+
const currentDurableDetailMessages = currentDetailMessages.filter(
|
|
10647
|
+
(message) => !isWorkspaceAgentActivityOptimisticMessage(message)
|
|
10648
|
+
);
|
|
10649
|
+
const detailWindowScopeMessages = currentMessages.length > 0 ? mergeWorkspaceAgentMessages(
|
|
10650
|
+
currentDurableDetailMessages,
|
|
10651
|
+
currentMessages
|
|
10652
|
+
) : currentDurableDetailMessages;
|
|
10471
10653
|
const durableSnapshotMessages = agentActivitySnapshot.sessionMessagesById[agentSessionId] ?? [];
|
|
10472
10654
|
const detailWindowMessages = filterMessagesForDetailWindowOverlay({
|
|
10473
|
-
detailMessages:
|
|
10655
|
+
detailMessages: detailWindowScopeMessages,
|
|
10474
10656
|
durableMessages: durableSnapshotMessages,
|
|
10475
10657
|
localMessages: nextMessages
|
|
10476
10658
|
});
|
|
10477
|
-
const
|
|
10478
|
-
|
|
10479
|
-
|
|
10480
|
-
|
|
10481
|
-
|
|
10659
|
+
const durableDetailWindowMessages = detailWindowMessages.filter(
|
|
10660
|
+
(message) => !isWorkspaceAgentActivityOptimisticMessage(message)
|
|
10661
|
+
);
|
|
10662
|
+
const nextDetailMessages = durableDetailWindowMessages.length > 0 ? mergeWorkspaceAgentMessages(
|
|
10663
|
+
currentDurableDetailMessages,
|
|
10664
|
+
durableDetailWindowMessages
|
|
10665
|
+
) : currentDurableDetailMessages;
|
|
10666
|
+
if (durableDetailWindowMessages.length > 0) {
|
|
10482
10667
|
mergeAgentSessionViewDetailMessages(
|
|
10483
10668
|
sessionViewRef(agentSessionId),
|
|
10484
|
-
|
|
10669
|
+
durableDetailWindowMessages
|
|
10485
10670
|
);
|
|
10486
10671
|
}
|
|
10487
10672
|
const durableMessages = nextDetailMessages.length > 0 ? nextDetailMessages : durableSnapshotMessages;
|
|
@@ -10853,8 +11038,8 @@ function useAgentGUINodeController({
|
|
|
10853
11038
|
useEffect4(() => {
|
|
10854
11039
|
isMountedRef.current = true;
|
|
10855
11040
|
return () => {
|
|
10856
|
-
|
|
10857
|
-
|
|
11041
|
+
scheduleActivityStreamStateReloadRef.current.cancel();
|
|
11042
|
+
clearSelectedConversationNotFoundRetryRef.current();
|
|
10858
11043
|
const current = activeConversationIdRef.current;
|
|
10859
11044
|
const pendingNewConversationId = startingConversationIdRef.current;
|
|
10860
11045
|
isMountedRef.current = false;
|
|
@@ -10868,13 +11053,11 @@ function useAgentGUINodeController({
|
|
|
10868
11053
|
void unactivateRef.current(pendingNewConversationId);
|
|
10869
11054
|
}
|
|
10870
11055
|
};
|
|
10871
|
-
}, [
|
|
10872
|
-
scheduleActivityStreamStateReload,
|
|
10873
|
-
clearSelectedConversationNotFoundRetry
|
|
10874
|
-
]);
|
|
11056
|
+
}, []);
|
|
10875
11057
|
const startConversation = useCallback4(
|
|
10876
11058
|
(initialContentInput, displayPrompt) => {
|
|
10877
|
-
|
|
11059
|
+
const target = selectedProviderTargetRef.current;
|
|
11060
|
+
if (isCreatingConversation || target.disabled === true || data.provider === "openclaw" && openclawGateway?.status !== "ready") {
|
|
10878
11061
|
return;
|
|
10879
11062
|
}
|
|
10880
11063
|
const normalizedInitialContent = Array.isArray(initialContentInput) ? normalizeAgentPromptContentBlocks(
|
|
@@ -10891,7 +11074,20 @@ function useAgentGUINodeController({
|
|
|
10891
11074
|
let pendingCreateAgentSessionId = null;
|
|
10892
11075
|
let pendingOptimisticConversation = null;
|
|
10893
11076
|
void (async () => {
|
|
10894
|
-
const
|
|
11077
|
+
const target2 = selectedProviderTargetRef.current;
|
|
11078
|
+
const provider = target2.provider;
|
|
11079
|
+
const shouldUseProviderTargetRef = selectedProviderTargetIsExplicitRef.current;
|
|
11080
|
+
onDataChangeRef.current(
|
|
11081
|
+
(current) => current.provider === provider && (current.providerTargetId ?? null) === (shouldUseProviderTargetRef ? target2.targetId : null) && agentGUIProviderTargetRefsEqual(
|
|
11082
|
+
current.providerTargetRef,
|
|
11083
|
+
shouldUseProviderTargetRef ? target2.ref : null
|
|
11084
|
+
) ? current : {
|
|
11085
|
+
...current,
|
|
11086
|
+
provider,
|
|
11087
|
+
providerTargetId: shouldUseProviderTargetRef ? target2.targetId : null,
|
|
11088
|
+
providerTargetRef: shouldUseProviderTargetRef ? target2.ref : null
|
|
11089
|
+
}
|
|
11090
|
+
);
|
|
10895
11091
|
const currentData = dataRef.current.provider === provider ? dataRef.current : data;
|
|
10896
11092
|
const selectedProjectPath2 = selectedProjectPathRef.current;
|
|
10897
11093
|
const initialNodeSettings = readNodeDefaultDraftSettings({
|
|
@@ -10998,9 +11194,6 @@ function useAgentGUINodeController({
|
|
|
10998
11194
|
content: [...normalizedInitialContent],
|
|
10999
11195
|
occurredAtUnixMs: createdAtUnixMs
|
|
11000
11196
|
});
|
|
11001
|
-
mergeAgentSessionViewDetailMessages(sessionViewRef(agentSessionId), [
|
|
11002
|
-
optimisticPromptMessage
|
|
11003
|
-
]);
|
|
11004
11197
|
mergeAgentSessionViewOverlayMessages(sessionViewRef(agentSessionId), [
|
|
11005
11198
|
optimisticPromptMessage
|
|
11006
11199
|
]);
|
|
@@ -11022,6 +11215,7 @@ function useAgentGUINodeController({
|
|
|
11022
11215
|
mode: "new",
|
|
11023
11216
|
agentSessionId,
|
|
11024
11217
|
provider,
|
|
11218
|
+
providerTargetRef: shouldUseProviderTargetRef ? target2.ref : null,
|
|
11025
11219
|
cwd: selectedProjectPath2 ?? "",
|
|
11026
11220
|
initialContent: normalizedInitialContent,
|
|
11027
11221
|
initialDisplayPrompt,
|
|
@@ -11868,35 +12062,8 @@ function useAgentGUINodeController({
|
|
|
11868
12062
|
},
|
|
11869
12063
|
[agentActivityDisplayStatuses, isRespondingApproval, isSubmitting]
|
|
11870
12064
|
);
|
|
11871
|
-
const
|
|
11872
|
-
(
|
|
11873
|
-
const agentSessionId = activeConversationIdRef.current;
|
|
11874
|
-
const normalizedContent = normalizeAgentPromptContentBlocks(content);
|
|
11875
|
-
if (normalizedContent.length === 0) {
|
|
11876
|
-
return;
|
|
11877
|
-
}
|
|
11878
|
-
const displayPromptText = displayPrompt && displayPrompt.trim() ? displayPrompt : void 0;
|
|
11879
|
-
if (resolvedPromptImagesSupported === false && agentPromptContentHasImage(normalizedContent)) {
|
|
11880
|
-
setDetailError(translate("agentHost.agentGui.promptImagesUnsupported"));
|
|
11881
|
-
return;
|
|
11882
|
-
}
|
|
11883
|
-
if (!agentSessionId) {
|
|
11884
|
-
if (!isComposerHomeRef.current) {
|
|
11885
|
-
reportAgentGUISubmitWithoutActiveConversation({
|
|
11886
|
-
blockCount: normalizedContent.length,
|
|
11887
|
-
conversationCount: conversationsRef.current.length,
|
|
11888
|
-
conversationListQueryReady: conversationListQuery !== null,
|
|
11889
|
-
dataLastActiveAgentSessionId: dataRef.current.lastActiveAgentSessionId ?? null,
|
|
11890
|
-
isComposerHome: isComposerHomeRef.current,
|
|
11891
|
-
promptLength: agentPromptContentDisplayText(normalizedContent).length,
|
|
11892
|
-
provider: dataRef.current.provider ?? null,
|
|
11893
|
-
runtime: agentActivityRuntime,
|
|
11894
|
-
workspaceId
|
|
11895
|
-
});
|
|
11896
|
-
}
|
|
11897
|
-
startConversation(normalizedContent, displayPromptText);
|
|
11898
|
-
return;
|
|
11899
|
-
}
|
|
12065
|
+
const submitExistingPrompt = useCallback4(
|
|
12066
|
+
(agentSessionId, normalizedContent, displayPromptText) => {
|
|
11900
12067
|
if (isSessionMarkedNonResumable(agentSessionId)) {
|
|
11901
12068
|
setDetailError(
|
|
11902
12069
|
getAgentGUIErrorMessage(buildResumeSessionNotLocalActivationError())
|
|
@@ -11932,14 +12099,78 @@ function useAgentGUINodeController({
|
|
|
11932
12099
|
},
|
|
11933
12100
|
[
|
|
11934
12101
|
activation,
|
|
11935
|
-
agentActivityRuntime,
|
|
11936
|
-
conversationListQuery,
|
|
11937
12102
|
executePrompt,
|
|
11938
12103
|
isSessionMarkedNonResumable,
|
|
11939
|
-
resolvedPromptImagesSupported,
|
|
11940
12104
|
queuePromptLocally,
|
|
11941
|
-
shouldQueuePromptLocally
|
|
12105
|
+
shouldQueuePromptLocally
|
|
12106
|
+
]
|
|
12107
|
+
);
|
|
12108
|
+
const submitPrompt = useCallback4(
|
|
12109
|
+
(content, displayPrompt) => {
|
|
12110
|
+
const agentSessionId = activeConversationIdRef.current;
|
|
12111
|
+
const normalizedContent = normalizeAgentPromptContentBlocks(content);
|
|
12112
|
+
if (normalizedContent.length === 0) {
|
|
12113
|
+
return;
|
|
12114
|
+
}
|
|
12115
|
+
const displayPromptText = displayPrompt && displayPrompt.trim() ? displayPrompt : void 0;
|
|
12116
|
+
if (resolvedPromptImagesSupported === false && agentPromptContentHasImage(normalizedContent)) {
|
|
12117
|
+
setDetailError(translate("agentHost.agentGui.promptImagesUnsupported"));
|
|
12118
|
+
return;
|
|
12119
|
+
}
|
|
12120
|
+
if (!agentSessionId) {
|
|
12121
|
+
if (!isComposerHomeRef.current) {
|
|
12122
|
+
const promptLength = agentPromptContentDisplayText(normalizedContent).length;
|
|
12123
|
+
reportAgentGUISubmitWithoutActiveConversation({
|
|
12124
|
+
blockCount: normalizedContent.length,
|
|
12125
|
+
conversationCount: conversationsRef.current.length,
|
|
12126
|
+
conversationListQueryReady: conversationListQuery !== null,
|
|
12127
|
+
dataLastActiveAgentSessionId: dataRef.current.lastActiveAgentSessionId ?? null,
|
|
12128
|
+
isComposerHome: isComposerHomeRef.current,
|
|
12129
|
+
promptLength,
|
|
12130
|
+
provider: dataRef.current.provider ?? null,
|
|
12131
|
+
runtime: agentActivityRuntime,
|
|
12132
|
+
workspaceId
|
|
12133
|
+
});
|
|
12134
|
+
const recoveredAgentSessionId = dataRef.current.lastActiveAgentSessionId?.trim() ?? "";
|
|
12135
|
+
if (recoveredAgentSessionId) {
|
|
12136
|
+
reportAgentGUISubmitRecoveredActiveConversation({
|
|
12137
|
+
blockCount: normalizedContent.length,
|
|
12138
|
+
conversationCount: conversationsRef.current.length,
|
|
12139
|
+
conversationListQueryReady: conversationListQuery !== null,
|
|
12140
|
+
promptLength,
|
|
12141
|
+
provider: dataRef.current.provider ?? null,
|
|
12142
|
+
recoveredAgentSessionId,
|
|
12143
|
+
runtime: agentActivityRuntime,
|
|
12144
|
+
workspaceId
|
|
12145
|
+
});
|
|
12146
|
+
activeConversationIdRef.current = recoveredAgentSessionId;
|
|
12147
|
+
setActiveConversationId(recoveredAgentSessionId);
|
|
12148
|
+
setIntent({ tag: "active", id: recoveredAgentSessionId });
|
|
12149
|
+
persistActiveConversation(recoveredAgentSessionId);
|
|
12150
|
+
submitExistingPrompt(
|
|
12151
|
+
recoveredAgentSessionId,
|
|
12152
|
+
normalizedContent,
|
|
12153
|
+
displayPromptText
|
|
12154
|
+
);
|
|
12155
|
+
return;
|
|
12156
|
+
}
|
|
12157
|
+
}
|
|
12158
|
+
startConversation(normalizedContent, displayPromptText);
|
|
12159
|
+
return;
|
|
12160
|
+
}
|
|
12161
|
+
submitExistingPrompt(
|
|
12162
|
+
agentSessionId,
|
|
12163
|
+
normalizedContent,
|
|
12164
|
+
displayPromptText
|
|
12165
|
+
);
|
|
12166
|
+
},
|
|
12167
|
+
[
|
|
12168
|
+
agentActivityRuntime,
|
|
12169
|
+
conversationListQuery,
|
|
12170
|
+
resolvedPromptImagesSupported,
|
|
12171
|
+
persistActiveConversation,
|
|
11942
12172
|
startConversation,
|
|
12173
|
+
submitExistingPrompt,
|
|
11943
12174
|
workspaceId
|
|
11944
12175
|
]
|
|
11945
12176
|
);
|
|
@@ -12198,17 +12429,7 @@ function useAgentGUINodeController({
|
|
|
12198
12429
|
}, []);
|
|
12199
12430
|
const flushQueuedComposerSettingsUpdate = useCallback4(
|
|
12200
12431
|
(input) => {
|
|
12201
|
-
const { agentSessionId,
|
|
12202
|
-
const persistNodeDefaults = () => {
|
|
12203
|
-
const defaultDraftKey = nodeDefaultDraftKey(dataRef.current.provider);
|
|
12204
|
-
setDraftSettingsBySessionId((current) => ({
|
|
12205
|
-
...current,
|
|
12206
|
-
[defaultDraftKey]: nextNodeDefaults
|
|
12207
|
-
}));
|
|
12208
|
-
onDataChangeRef.current(
|
|
12209
|
-
(current) => nodeDataFromComposerSettings(current, nextNodeDefaults)
|
|
12210
|
-
);
|
|
12211
|
-
};
|
|
12432
|
+
const { agentSessionId, sessionSettingsPatch } = input;
|
|
12212
12433
|
void agentActivityRuntime.updateSessionSettings({
|
|
12213
12434
|
workspaceId,
|
|
12214
12435
|
agentSessionId,
|
|
@@ -12237,7 +12458,6 @@ function useAgentGUINodeController({
|
|
|
12237
12458
|
} : existing
|
|
12238
12459
|
);
|
|
12239
12460
|
if (queuedUpdate === null) {
|
|
12240
|
-
persistNodeDefaults();
|
|
12241
12461
|
if (sessionSettingsPatch.model !== void 0 && dataRef.current.provider === "claude-code") {
|
|
12242
12462
|
void loadSessionState(agentSessionId, {
|
|
12243
12463
|
source: "settings-update",
|
|
@@ -12272,8 +12492,7 @@ function useAgentGUINodeController({
|
|
|
12272
12492
|
delete queuedComposerSettingsUpdatesRef.current[agentSessionId];
|
|
12273
12493
|
flushQueuedComposerSettingsUpdate({
|
|
12274
12494
|
agentSessionId,
|
|
12275
|
-
sessionSettingsPatch: queuedUpdate.sessionSettingsPatch
|
|
12276
|
-
nextNodeDefaults: queuedUpdate.nextNodeDefaults
|
|
12495
|
+
sessionSettingsPatch: queuedUpdate.sessionSettingsPatch
|
|
12277
12496
|
});
|
|
12278
12497
|
return;
|
|
12279
12498
|
}
|
|
@@ -12323,6 +12542,10 @@ function useAgentGUINodeController({
|
|
|
12323
12542
|
onDataChangeRef.current(
|
|
12324
12543
|
(current) => nodeDataFromComposerSettings(current, merged)
|
|
12325
12544
|
);
|
|
12545
|
+
void onRememberComposerDefaultsRef.current?.({
|
|
12546
|
+
provider: dataRef.current.provider,
|
|
12547
|
+
defaults: composerDefaultsFromSettings(merged)
|
|
12548
|
+
});
|
|
12326
12549
|
void agentActivityRuntime.trackDraftComposerSettingsChange?.({
|
|
12327
12550
|
workspaceId,
|
|
12328
12551
|
provider: dataRef.current.provider,
|
|
@@ -12338,43 +12561,7 @@ function useAgentGUINodeController({
|
|
|
12338
12561
|
const sessionSettings2 = cloneComposerSettings(
|
|
12339
12562
|
activeSessionState2?.settings ?? null
|
|
12340
12563
|
);
|
|
12341
|
-
const
|
|
12342
|
-
data: dataRef.current,
|
|
12343
|
-
defaultReasoningEffort,
|
|
12344
|
-
drafts: draftSettingsBySessionIdRef.current
|
|
12345
|
-
});
|
|
12346
|
-
const baseDefaultsFromSession = {
|
|
12347
|
-
...currentDefaults,
|
|
12348
|
-
model: sessionSettings2?.model ?? currentDefaults.model,
|
|
12349
|
-
reasoningEffort: sessionSettings2?.reasoningEffort ?? currentDefaults.reasoningEffort,
|
|
12350
|
-
speed: sessionSettings2?.speed ?? currentDefaults.speed,
|
|
12351
|
-
planMode: sessionSettings2?.planMode ?? currentDefaults.planMode,
|
|
12352
|
-
browserUse: sessionSettings2?.browserUse ?? currentDefaults.browserUse,
|
|
12353
|
-
computerUse: sessionSettings2?.computerUse ?? currentDefaults.computerUse,
|
|
12354
|
-
permissionModeId: sessionSettings2?.permissionModeId ?? currentDefaults.permissionModeId
|
|
12355
|
-
};
|
|
12356
|
-
const nextNodeDefaults = {
|
|
12357
|
-
...baseDefaultsFromSession,
|
|
12358
|
-
model: supportedNextSettings.model !== void 0 ? supportedNextSettings.model : baseDefaultsFromSession.model,
|
|
12359
|
-
reasoningEffort: supportedNextSettings.reasoningEffort !== void 0 ? supportedNextSettings.reasoningEffort : baseDefaultsFromSession.reasoningEffort,
|
|
12360
|
-
speed: supportedNextSettings.speed !== void 0 ? supportedNextSettings.speed : baseDefaultsFromSession.speed,
|
|
12361
|
-
planMode: supportedNextSettings.planMode ?? baseDefaultsFromSession.planMode,
|
|
12362
|
-
browserUse: supportedNextSettings.browserUse ?? baseDefaultsFromSession.browserUse,
|
|
12363
|
-
permissionModeId: supportedNextSettings.permissionModeId !== void 0 ? supportedNextSettings.permissionModeId : baseDefaultsFromSession.permissionModeId
|
|
12364
|
-
};
|
|
12365
|
-
const persistNodeDefaults = () => {
|
|
12366
|
-
const defaultDraftKey = nodeDefaultDraftKey(dataRef.current.provider);
|
|
12367
|
-
setDraftSettingsBySessionId((current) => ({
|
|
12368
|
-
...current,
|
|
12369
|
-
[defaultDraftKey]: nextNodeDefaults
|
|
12370
|
-
}));
|
|
12371
|
-
onDataChangeRef.current(
|
|
12372
|
-
(current) => nodeDataFromComposerSettings(current, nextNodeDefaults)
|
|
12373
|
-
);
|
|
12374
|
-
};
|
|
12375
|
-
const nextPermission = normalizeOptionalText2(
|
|
12376
|
-
nextSettings.permissionModeId ?? sessionSettings2?.permissionModeId ?? currentDefaults.permissionModeId
|
|
12377
|
-
);
|
|
12564
|
+
const nextPermission = supportedNextSettings.permissionModeId !== void 0 ? normalizeOptionalText2(supportedNextSettings.permissionModeId) : void 0;
|
|
12378
12565
|
const currentPermission = normalizeOptionalText2(
|
|
12379
12566
|
sessionSettings2?.permissionModeId
|
|
12380
12567
|
);
|
|
@@ -12409,11 +12596,10 @@ function useAgentGUINodeController({
|
|
|
12409
12596
|
if (nextComputerUse !== void 0 && nextComputerUse !== currentComputerUse) {
|
|
12410
12597
|
sessionSettingsPatch.computerUse = nextComputerUse;
|
|
12411
12598
|
}
|
|
12412
|
-
if (nextPermission && nextPermission !== currentPermission && activeSessionState2 !== null) {
|
|
12599
|
+
if (nextPermission !== void 0 && nextPermission && nextPermission !== currentPermission && activeSessionState2 !== null) {
|
|
12413
12600
|
sessionSettingsPatch.permissionModeId = normalizePermissionModeId(nextPermission);
|
|
12414
12601
|
}
|
|
12415
12602
|
if (Object.keys(sessionSettingsPatch).length > 0 && activeSessionState2 !== null) {
|
|
12416
|
-
persistNodeDefaults();
|
|
12417
12603
|
updateAgentSessionViewControlState(
|
|
12418
12604
|
sessionViewRef(agentSessionId),
|
|
12419
12605
|
(existing) => existing ? {
|
|
@@ -12436,20 +12622,17 @@ function useAgentGUINodeController({
|
|
|
12436
12622
|
sessionSettingsPatch: {
|
|
12437
12623
|
...queuedUpdate?.sessionSettingsPatch ?? {},
|
|
12438
12624
|
...sessionSettingsPatch
|
|
12439
|
-
}
|
|
12440
|
-
nextNodeDefaults
|
|
12625
|
+
}
|
|
12441
12626
|
};
|
|
12442
12627
|
} else {
|
|
12443
12628
|
markSessionSettingsRequestState(agentSessionId, true);
|
|
12444
12629
|
flushQueuedComposerSettingsUpdate({
|
|
12445
12630
|
agentSessionId,
|
|
12446
|
-
sessionSettingsPatch
|
|
12447
|
-
nextNodeDefaults
|
|
12631
|
+
sessionSettingsPatch
|
|
12448
12632
|
});
|
|
12449
12633
|
}
|
|
12450
12634
|
return;
|
|
12451
12635
|
}
|
|
12452
|
-
persistNodeDefaults();
|
|
12453
12636
|
},
|
|
12454
12637
|
[
|
|
12455
12638
|
defaultReasoningEffort,
|
|
@@ -13630,7 +13813,7 @@ function useAgentGUINodeController({
|
|
|
13630
13813
|
hasProviderSessionNotFoundError,
|
|
13631
13814
|
pendingApproval
|
|
13632
13815
|
]);
|
|
13633
|
-
const canSubmit = activeLiveState !== "activating" && activeLiveState !== "failed" && !activeConversationResumeUnavailable && (data.provider !== "openclaw" || openclawGateway?.status === "ready") && pendingApproval === null && pendingInteractivePrompt === null && sessionChrome.auth === null && !isCreatingConversation && !isSubmitting && !isInterrupting;
|
|
13816
|
+
const canSubmit = activeLiveState !== "activating" && activeLiveState !== "failed" && !activeConversationResumeUnavailable && (activeConversationId !== null || selectedProviderTarget.disabled !== true) && (data.provider !== "openclaw" || openclawGateway?.status === "ready") && pendingApproval === null && pendingInteractivePrompt === null && sessionChrome.auth === null && !isCreatingConversation && !isSubmitting && !isInterrupting;
|
|
13634
13817
|
const canQueueWhileBusy = Boolean(activeConversationId) && (activeConversationBusy || isSubmitting);
|
|
13635
13818
|
useEffect4(() => {
|
|
13636
13819
|
const firstVersion = minFiniteMessageVersion(activeMessages);
|
|
@@ -13929,6 +14112,7 @@ function useAgentGUINodeController({
|
|
|
13929
14112
|
workspacePath,
|
|
13930
14113
|
currentUserId,
|
|
13931
14114
|
data,
|
|
14115
|
+
selectedProviderTarget,
|
|
13932
14116
|
conversations: visibleConversations,
|
|
13933
14117
|
userProjects,
|
|
13934
14118
|
activeConversation,
|
|
@@ -13993,6 +14177,7 @@ function useAgentGUINodeController({
|
|
|
13993
14177
|
conversationDetail,
|
|
13994
14178
|
controllerActions,
|
|
13995
14179
|
data,
|
|
14180
|
+
selectedProviderTarget,
|
|
13996
14181
|
detailError,
|
|
13997
14182
|
draftContent,
|
|
13998
14183
|
draftPrompt,
|
|
@@ -14017,6 +14202,7 @@ function useAgentGUINodeController({
|
|
|
14017
14202
|
pendingDeleteProjectConversations,
|
|
14018
14203
|
pendingApproval,
|
|
14019
14204
|
pendingInteractivePrompt,
|
|
14205
|
+
selectedProviderTarget.disabled,
|
|
14020
14206
|
queuedPrompts,
|
|
14021
14207
|
drainingQueuedPromptId,
|
|
14022
14208
|
currentUserId,
|
|
@@ -16263,9 +16449,7 @@ function AgentQueuedPromptPanel({
|
|
|
16263
16449
|
}
|
|
16264
16450
|
const measure = () => {
|
|
16265
16451
|
const viewportCap = typeof window === "undefined" ? 280 : Math.round(window.innerHeight * 0.38);
|
|
16266
|
-
setExpandedListMaxHeightPx(
|
|
16267
|
-
Math.max(32, Math.min(280, viewportCap, element.scrollHeight))
|
|
16268
|
-
);
|
|
16452
|
+
setExpandedListMaxHeightPx(Math.max(32, Math.min(280, viewportCap)));
|
|
16269
16453
|
};
|
|
16270
16454
|
measure();
|
|
16271
16455
|
const resizeObserver = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
|
|
@@ -21017,7 +21201,7 @@ function AgentComposer({
|
|
|
21017
21201
|
className: cn(
|
|
21018
21202
|
AgentGUINode_styles_default.composerMenuTrigger,
|
|
21019
21203
|
AgentGUINode_styles_default.composerReferenceTrigger,
|
|
21020
|
-
"w-auto justify-center
|
|
21204
|
+
"w-auto justify-center text-[var(--agent-gui-text-secondary)] [&_svg]:shrink-0"
|
|
21021
21205
|
),
|
|
21022
21206
|
children: /* @__PURE__ */ jsx27(
|
|
21023
21207
|
AddIcon,
|
|
@@ -21053,7 +21237,7 @@ function AgentComposer({
|
|
|
21053
21237
|
className: cn(
|
|
21054
21238
|
AgentGUINode_styles_default.composerMenuTrigger,
|
|
21055
21239
|
AgentGUINode_styles_default.composerReferenceTrigger,
|
|
21056
|
-
"w-auto justify-center
|
|
21240
|
+
"w-auto justify-center text-[var(--agent-gui-text-secondary)] [&>svg:last-child]:hidden [&_svg]:shrink-0"
|
|
21057
21241
|
),
|
|
21058
21242
|
children: /* @__PURE__ */ jsx27(
|
|
21059
21243
|
AddIcon,
|
|
@@ -21295,13 +21479,14 @@ function AgentComposerDraftImagePreview({
|
|
|
21295
21479
|
"data-upload-error": image.uploadError ? "true" : void 0,
|
|
21296
21480
|
style: previewStyle,
|
|
21297
21481
|
children: [
|
|
21298
|
-
/* @__PURE__ */ jsx27(
|
|
21482
|
+
/* @__PURE__ */ jsx27(
|
|
21299
21483
|
ZoomableImage,
|
|
21300
21484
|
{
|
|
21301
21485
|
src: image.previewUrl,
|
|
21302
21486
|
alt: image.name,
|
|
21303
21487
|
className: "size-full object-contain",
|
|
21304
21488
|
draggable: false,
|
|
21489
|
+
downloadName: image.name || "image.png",
|
|
21305
21490
|
onLoad: (event) => {
|
|
21306
21491
|
const element = event.currentTarget;
|
|
21307
21492
|
const width = element.naturalWidth;
|
|
@@ -21316,7 +21501,7 @@ function AgentComposerDraftImagePreview({
|
|
|
21316
21501
|
setAspectRatio(nextRatio);
|
|
21317
21502
|
}
|
|
21318
21503
|
}
|
|
21319
|
-
)
|
|
21504
|
+
),
|
|
21320
21505
|
image.uploading ? /* @__PURE__ */ jsx27(
|
|
21321
21506
|
"div",
|
|
21322
21507
|
{
|
|
@@ -23736,7 +23921,7 @@ function stabilizeConversationSectionItems(previous, next) {
|
|
|
23736
23921
|
return changed ? stable : previous;
|
|
23737
23922
|
}
|
|
23738
23923
|
function conversationSummariesRenderEqual2(left, right) {
|
|
23739
|
-
return left.id === right.id && left.provider === right.provider && left.title === right.title && left.titleFallback === right.titleFallback && left.status === right.status && left.cwd === right.cwd && left.pinnedAtUnixMs === right.pinnedAtUnixMs && left.sortTimeUnixMs === right.sortTimeUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.hasUnreadCompletion === right.hasUnreadCompletion && left.unreadCompletionKey === right.unreadCompletionKey && conversationProjectsRenderEqual2(left.project, right.project) && conversationSyncStatesRenderEqual(left.syncState, right.syncState);
|
|
23924
|
+
return left.id === right.id && left.provider === right.provider && left.title === right.title && left.titleFallback === right.titleFallback && left.status === right.status && left.cwd === right.cwd && left.pinnedAtUnixMs === right.pinnedAtUnixMs && left.sortTimeUnixMs === right.sortTimeUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.isImported === right.isImported && left.hasUnreadCompletion === right.hasUnreadCompletion && left.unreadCompletionKey === right.unreadCompletionKey && conversationProjectsRenderEqual2(left.project, right.project) && conversationSyncStatesRenderEqual(left.syncState, right.syncState);
|
|
23740
23925
|
}
|
|
23741
23926
|
function conversationSyncStatesRenderEqual(left, right) {
|
|
23742
23927
|
return left === right || (!left || !right ? (left ?? null) === (right ?? null) : left.workspaceId === right.workspaceId && left.agentSessionId === right.agentSessionId && left.status === right.status && left.pendingTimelineItemCount === right.pendingTimelineItemCount && left.pendingStatePatchCount === right.pendingStatePatchCount && left.attemptCount === right.attemptCount && left.failedReportCount === right.failedReportCount && left.lastError === right.lastError && left.lastAttemptAtUnixMs === right.lastAttemptAtUnixMs && left.lastSyncedAtUnixMs === right.lastSyncedAtUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs);
|
|
@@ -25318,7 +25503,10 @@ function normalizeSlashStatusModelName(value) {
|
|
|
25318
25503
|
return value?.trim().toLowerCase().replace(/[^a-z0-9]+/gu, "-").replace(/^-+|-+$/gu, "") ?? "";
|
|
25319
25504
|
}
|
|
25320
25505
|
function agentGuiStateEquals(left, right) {
|
|
25321
|
-
return left === right || left.provider === right.provider &&
|
|
25506
|
+
return left === right || left.provider === right.provider && (left.providerTargetId ?? null) === (right.providerTargetId ?? null) && agentGUIProviderTargetRefsEqual(
|
|
25507
|
+
left.providerTargetRef,
|
|
25508
|
+
right.providerTargetRef
|
|
25509
|
+
) && left.lastActiveAgentSessionId === right.lastActiveAgentSessionId && left.conversationRailWidthPx === right.conversationRailWidthPx && left.conversationRailCollapsed === right.conversationRailCollapsed && (left.composerOverrides?.model ?? null) === (right.composerOverrides?.model ?? null) && (left.composerOverrides?.reasoningEffort ?? null) === (right.composerOverrides?.reasoningEffort ?? null) && (left.composerOverrides?.planMode ?? null) === (right.composerOverrides?.planMode ?? null) && (left.composerOverrides?.permissionModeId ?? null) === (right.composerOverrides?.permissionModeId ?? null) && composerOverridesByProviderEqual(
|
|
25322
25510
|
left.composerOverridesByProvider,
|
|
25323
25511
|
right.composerOverridesByProvider
|
|
25324
25512
|
);
|
|
@@ -25339,7 +25527,7 @@ function composerOverridesByProviderEqual(left, right) {
|
|
|
25339
25527
|
return true;
|
|
25340
25528
|
}
|
|
25341
25529
|
function areAgentGUINodePropsEqual(previous, next) {
|
|
25342
|
-
return previous.nodeId === next.nodeId && previous.workspaceId === next.workspaceId && previous.currentUserId === next.currentUserId && previous.workspacePath === next.workspacePath && previous.workspaceFileReferenceAdapter === next.workspaceFileReferenceAdapter && previous.selectProjectDirectory === next.selectProjectDirectory && previous.referenceSourceAggregator === next.referenceSourceAggregator && previous.resolveMentionReferenceTarget === next.resolveMentionReferenceTarget && previous.resolveWorkspaceReferenceInitialTarget === next.resolveWorkspaceReferenceInitialTarget && previous.onWorkspaceFileReferencesAdded === next.onWorkspaceFileReferencesAdded && previous.agentSettings.avoidGroupingEdits === next.agentSettings.avoidGroupingEdits && previous.title === next.title && agentGuiStateEquals(previous.state, next.state) && previous.position.x === next.position.x && previous.position.y === next.position.y && previous.width === next.width && previous.height === next.height && previous.desktopSize.width === next.desktopSize.width && previous.desktopSize.height === next.desktopSize.height && previous.onLinkAction === next.onLinkAction && previous.onCapabilitySettingsRequest === next.onCapabilitySettingsRequest && previous.onAgentProviderLogin === next.onAgentProviderLogin && previous.onClose === next.onClose && previous.onResize === next.onResize && previous.onUpdateNode === next.onUpdateNode && previous.onOpenConversationWindow === next.onOpenConversationWindow && previous.isMaximized === next.isMaximized && previous.isMuted === next.isMuted && previous.onMinimize === next.onMinimize && previous.onToggleMaximize === next.onToggleMaximize && previous.onShowMessage === next.onShowMessage && workspaceAgentProbeRenderStateEqualsForProvider(
|
|
25530
|
+
return previous.nodeId === next.nodeId && previous.workspaceId === next.workspaceId && previous.currentUserId === next.currentUserId && previous.workspacePath === next.workspacePath && previous.workspaceFileReferenceAdapter === next.workspaceFileReferenceAdapter && previous.selectProjectDirectory === next.selectProjectDirectory && previous.referenceSourceAggregator === next.referenceSourceAggregator && previous.resolveMentionReferenceTarget === next.resolveMentionReferenceTarget && previous.resolveWorkspaceReferenceInitialTarget === next.resolveWorkspaceReferenceInitialTarget && previous.onWorkspaceFileReferencesAdded === next.onWorkspaceFileReferencesAdded && previous.agentSettings.avoidGroupingEdits === next.agentSettings.avoidGroupingEdits && previous.title === next.title && agentGuiStateEquals(previous.state, next.state) && previous.position.x === next.position.x && previous.position.y === next.position.y && previous.width === next.width && previous.height === next.height && previous.desktopSize.width === next.desktopSize.width && previous.desktopSize.height === next.desktopSize.height && previous.onLinkAction === next.onLinkAction && previous.onCapabilitySettingsRequest === next.onCapabilitySettingsRequest && previous.onAgentProviderLogin === next.onAgentProviderLogin && previous.providerTargets === next.providerTargets && previous.defaultProviderTargetId === next.defaultProviderTargetId && previous.onClose === next.onClose && previous.onResize === next.onResize && previous.onUpdateNode === next.onUpdateNode && previous.onRememberComposerDefaults === next.onRememberComposerDefaults && previous.onOpenConversationWindow === next.onOpenConversationWindow && previous.isMaximized === next.isMaximized && previous.isMuted === next.isMuted && previous.onMinimize === next.onMinimize && previous.onToggleMaximize === next.onToggleMaximize && previous.onShowMessage === next.onShowMessage && workspaceAgentProbeRenderStateEqualsForProvider(
|
|
25343
25531
|
previous.workspaceAgentProbes,
|
|
25344
25532
|
next.workspaceAgentProbes,
|
|
25345
25533
|
previous.state.provider
|
|
@@ -25367,11 +25555,14 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
25367
25555
|
capabilityMenuState,
|
|
25368
25556
|
onCapabilitySettingsRequest,
|
|
25369
25557
|
onAgentProviderLogin,
|
|
25558
|
+
providerTargets,
|
|
25559
|
+
defaultProviderTargetId = null,
|
|
25370
25560
|
onWorkspaceFileReferencesAdded,
|
|
25371
25561
|
onOpenConversationWindow,
|
|
25372
25562
|
onClose,
|
|
25373
25563
|
onResize,
|
|
25374
25564
|
onUpdateNode,
|
|
25565
|
+
onRememberComposerDefaults,
|
|
25375
25566
|
isMaximized = false,
|
|
25376
25567
|
isActive,
|
|
25377
25568
|
composerFocusRequestSequence = null,
|
|
@@ -25523,17 +25714,40 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
25523
25714
|
data: state,
|
|
25524
25715
|
openSessionRequest,
|
|
25525
25716
|
prefillPromptRequest,
|
|
25717
|
+
providerTargets,
|
|
25718
|
+
defaultProviderTargetId,
|
|
25526
25719
|
previewMode,
|
|
25527
25720
|
onDataChange: handleDataChange,
|
|
25721
|
+
onRememberComposerDefaults,
|
|
25528
25722
|
onShowMessage
|
|
25529
25723
|
});
|
|
25724
|
+
const handleCreateConversation = useCallback13(
|
|
25725
|
+
(...args) => {
|
|
25726
|
+
if (!previewMode) {
|
|
25727
|
+
onUpdateNode(
|
|
25728
|
+
(current) => current.lastActiveAgentSessionId === null && (current.lastActiveConversationTitle ?? null) === null ? current : {
|
|
25729
|
+
...current,
|
|
25730
|
+
lastActiveAgentSessionId: null,
|
|
25731
|
+
lastActiveConversationTitle: null
|
|
25732
|
+
}
|
|
25733
|
+
);
|
|
25734
|
+
}
|
|
25735
|
+
actions.createConversation(...args);
|
|
25736
|
+
},
|
|
25737
|
+
[actions, onUpdateNode, previewMode]
|
|
25738
|
+
);
|
|
25739
|
+
const viewActions = useMemo11(
|
|
25740
|
+
() => ({
|
|
25741
|
+
...actions,
|
|
25742
|
+
createConversation: handleCreateConversation
|
|
25743
|
+
}),
|
|
25744
|
+
[actions, handleCreateConversation]
|
|
25745
|
+
);
|
|
25530
25746
|
const fallbackAgentTitle = t("sidebar.fallbackAgentLabel");
|
|
25531
25747
|
const activeProvider = viewModel.activeConversation?.provider ?? state.provider;
|
|
25532
|
-
const
|
|
25533
|
-
|
|
25534
|
-
|
|
25535
|
-
);
|
|
25536
|
-
const windowAgentTitle = getAgentHostManagedToolchainAgentByName(activeProvider)?.label ?? displayProviderLabel;
|
|
25748
|
+
const selectedProviderTargetLabel = viewModel.selectedProviderTarget?.label ?? resolveAgentGUIProviderDisplayLabel(state.provider, fallbackAgentTitle);
|
|
25749
|
+
const displayProviderLabel = viewModel.activeConversation ? resolveAgentGUIProviderDisplayLabel(activeProvider, fallbackAgentTitle) : selectedProviderTargetLabel;
|
|
25750
|
+
const windowAgentTitle = viewModel.activeConversation ? getAgentHostManagedToolchainAgentByName(activeProvider)?.label ?? displayProviderLabel : displayProviderLabel;
|
|
25537
25751
|
const activeConversationDockTitle = viewModel.activeConversation ? resolveAgentGUIDockConversationTitle(viewModel.activeConversation) : null;
|
|
25538
25752
|
const activeConversationWindowTitle = viewModel.activeConversation ? formatAgentSessionMentionText(
|
|
25539
25753
|
resolveAgentGUIConversationDisplayTitle(
|
|
@@ -26109,7 +26323,7 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
26109
26323
|
AgentGUINodeView,
|
|
26110
26324
|
{
|
|
26111
26325
|
viewModel,
|
|
26112
|
-
actions,
|
|
26326
|
+
actions: viewActions,
|
|
26113
26327
|
isActive,
|
|
26114
26328
|
composerFocusRequestSequence,
|
|
26115
26329
|
newConversationRequestSequence,
|
|
@@ -26185,18 +26399,24 @@ export {
|
|
|
26185
26399
|
AgentActivityRuntimeProvider,
|
|
26186
26400
|
AgentGUI,
|
|
26187
26401
|
AgentGuiI18nProvider,
|
|
26402
|
+
agentGUIDefaultTargetProviders,
|
|
26188
26403
|
agentGuiDockIconUrl,
|
|
26189
26404
|
agentGuiDockIconUrls,
|
|
26190
26405
|
agentGuiI18nModule,
|
|
26191
26406
|
agentGuiI18nResources,
|
|
26192
26407
|
agentHostSnapshotFromAgentActivitySnapshot,
|
|
26193
26408
|
buildAgentActivitySnapshotProjection,
|
|
26409
|
+
createLocalAgentGUIProviderTarget,
|
|
26410
|
+
createLocalAgentGUIProviderTargets,
|
|
26194
26411
|
getAgentActivityRuntime,
|
|
26195
26412
|
getOptionalAgentActivityRuntime,
|
|
26413
|
+
localAgentGUIProviderTargetId,
|
|
26414
|
+
normalizeAgentGUIProviderTargets,
|
|
26196
26415
|
preloadAgentMentionBrowse,
|
|
26197
26416
|
projectCoreSessionStatus,
|
|
26198
26417
|
resetAgentActivityRuntimeForTests,
|
|
26199
26418
|
resolveAgentGUIExpandedWindowFrame,
|
|
26419
|
+
resolveAgentGUIProviderTarget,
|
|
26200
26420
|
selectNeedsAttentionCount2 as selectNeedsAttentionCount,
|
|
26201
26421
|
selectNeedsAttentionItems2 as selectNeedsAttentionItems,
|
|
26202
26422
|
setAgentActivityRuntimeForTests,
|