@tutti-os/agent-gui 0.0.39 → 0.0.40
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-GDgLA-im.d.ts} +3 -156
- package/dist/agent-conversation/index.d.ts +2 -1
- package/dist/agent-conversation/index.js +3 -3
- package/dist/agent-message-center/index.js +3 -3
- package/dist/chunk-4K22O34C.js +123 -0
- package/dist/chunk-4K22O34C.js.map +1 -0
- package/dist/{chunk-3AXEEQMV.js → chunk-DO7D7OOL.js} +3 -3
- package/dist/{chunk-ZWJBG2JM.js → chunk-EFDGMXTB.js} +62 -7
- package/dist/chunk-EFDGMXTB.js.map +1 -0
- package/dist/{chunk-C7ZZZXKB.js → chunk-EQ4RSPQE.js} +2 -2
- 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-XL2EKJTQ.js → chunk-R7XH3C4Y.js} +3 -3
- package/dist/{chunk-B2JKDZSR.js → chunk-TXXWUG2J.js} +1 -1
- package/dist/chunk-TXXWUG2J.js.map +1 -0
- package/dist/{chunk-46IYJEZX.js → chunk-UUM2GZXH.js} +3 -3
- package/dist/{chunk-5HQDW73P.js → chunk-WC34LVH6.js} +2 -2
- package/dist/context-mention-palette/index.js +2 -2
- package/dist/index.d.ts +124 -102
- package/dist/index.js +243 -57
- package/dist/index.js.map +1 -1
- package/dist/types-xMz0lJWt.d.ts +173 -0
- package/dist/workbench/contribution.d.ts +1 -0
- package/dist/workbench/contribution.js +5 -4
- package/dist/workbench/index.d.ts +1 -0
- 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/package.json +12 -12
- package/dist/chunk-B2JKDZSR.js.map +0 -1
- package/dist/chunk-ZWJBG2JM.js.map +0 -1
- /package/dist/{chunk-3AXEEQMV.js.map → chunk-DO7D7OOL.js.map} +0 -0
- /package/dist/{chunk-C7ZZZXKB.js.map → chunk-EQ4RSPQE.js.map} +0 -0
- /package/dist/{chunk-JNGYJ7GM.js.map → chunk-EU7RWKHE.js.map} +0 -0
- /package/dist/{chunk-XL2EKJTQ.js.map → chunk-R7XH3C4Y.js.map} +0 -0
- /package/dist/{chunk-46IYJEZX.js.map → chunk-UUM2GZXH.js.map} +0 -0
- /package/dist/{chunk-5HQDW73P.js.map → chunk-WC34LVH6.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-UUM2GZXH.js";
|
|
18
27
|
import {
|
|
19
28
|
PLAN_IMPLEMENTATION_ACTION_FEEDBACK,
|
|
20
29
|
PLAN_IMPLEMENTATION_ACTION_IMPLEMENT,
|
|
@@ -38,14 +47,14 @@ import {
|
|
|
38
47
|
skillDescriptionForDisplay,
|
|
39
48
|
skillTriggerForPrefix,
|
|
40
49
|
useProjectedAgentConversation
|
|
41
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-DO7D7OOL.js";
|
|
42
51
|
import {
|
|
43
52
|
AgentMessageMarkdown,
|
|
44
53
|
ConversationImageContextMenu,
|
|
45
54
|
ZoomableImage,
|
|
46
55
|
cn,
|
|
47
56
|
resolveWorkspaceLinkAction
|
|
48
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-WC34LVH6.js";
|
|
49
58
|
import {
|
|
50
59
|
AGENT_MENTION_FILTER_TAB_ORDER,
|
|
51
60
|
AgentFileMentionPalette,
|
|
@@ -53,7 +62,7 @@ import {
|
|
|
53
62
|
DEFAULT_AGENT_MENTION_FILTER,
|
|
54
63
|
agentMentionItemKey,
|
|
55
64
|
preloadAgentMentionBrowse
|
|
56
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-EQ4RSPQE.js";
|
|
57
66
|
import {
|
|
58
67
|
WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN,
|
|
59
68
|
buildWorkspaceAgentActivityListViewModel,
|
|
@@ -94,7 +103,7 @@ import {
|
|
|
94
103
|
useAgentActivitySnapshot,
|
|
95
104
|
useAgentHostApi,
|
|
96
105
|
useOptionalAgentActivityRuntime
|
|
97
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-TXXWUG2J.js";
|
|
98
107
|
import "./chunk-TYGL25EL.js";
|
|
99
108
|
import {
|
|
100
109
|
AGENT_CONTEXT_MENTION_PROVIDER_IDS
|
|
@@ -6259,6 +6268,7 @@ function useAgentGUIActivation({
|
|
|
6259
6268
|
initialDisplayPrompt: input.initialDisplayPrompt,
|
|
6260
6269
|
metadata: input.metadata,
|
|
6261
6270
|
title: input.title,
|
|
6271
|
+
providerTargetRef: input.providerTargetRef,
|
|
6262
6272
|
settings: input.settings,
|
|
6263
6273
|
visible: input.visible,
|
|
6264
6274
|
openclawGatewayReady: input.openclawGatewayReady
|
|
@@ -6824,6 +6834,32 @@ function reportAgentGUISubmitWithoutActiveConversation(input) {
|
|
|
6824
6834
|
} catch {
|
|
6825
6835
|
}
|
|
6826
6836
|
}
|
|
6837
|
+
function reportAgentGUISubmitRecoveredActiveConversation(input) {
|
|
6838
|
+
const reportDiagnostic = input.runtime.reportDiagnostic;
|
|
6839
|
+
if (!reportDiagnostic) {
|
|
6840
|
+
return;
|
|
6841
|
+
}
|
|
6842
|
+
try {
|
|
6843
|
+
void Promise.resolve(
|
|
6844
|
+
reportDiagnostic.call(input.runtime, {
|
|
6845
|
+
details: {
|
|
6846
|
+
blockCount: input.blockCount,
|
|
6847
|
+
conversationCount: input.conversationCount,
|
|
6848
|
+
conversationListQueryReady: input.conversationListQueryReady,
|
|
6849
|
+
promptLength: input.promptLength,
|
|
6850
|
+
provider: input.provider,
|
|
6851
|
+
recoveredAgentSessionId: input.recoveredAgentSessionId
|
|
6852
|
+
},
|
|
6853
|
+
event: "agent.gui.submit.recovered_active_conversation",
|
|
6854
|
+
level: "info",
|
|
6855
|
+
source: "agent-gui",
|
|
6856
|
+
workspaceId: input.workspaceId
|
|
6857
|
+
})
|
|
6858
|
+
).catch(() => {
|
|
6859
|
+
});
|
|
6860
|
+
} catch {
|
|
6861
|
+
}
|
|
6862
|
+
}
|
|
6827
6863
|
function reportAgentGUICancelDiagnostic(input) {
|
|
6828
6864
|
if (input.result.canceled) {
|
|
6829
6865
|
return;
|
|
@@ -8446,6 +8482,8 @@ function useAgentGUINodeController({
|
|
|
8446
8482
|
workspacePath,
|
|
8447
8483
|
avoidGroupingEdits,
|
|
8448
8484
|
data,
|
|
8485
|
+
providerTargets,
|
|
8486
|
+
defaultProviderTargetId = null,
|
|
8449
8487
|
openSessionRequest = null,
|
|
8450
8488
|
prefillPromptRequest = null,
|
|
8451
8489
|
previewMode = false,
|
|
@@ -8455,6 +8493,39 @@ function useAgentGUINodeController({
|
|
|
8455
8493
|
const agentActivityRuntime = useAgentActivityRuntime();
|
|
8456
8494
|
const agentHostApi = useAgentHostApi();
|
|
8457
8495
|
const agentActivitySnapshot = useAgentActivitySnapshot(workspaceId);
|
|
8496
|
+
const normalizedExplicitProviderTargets = useMemo4(
|
|
8497
|
+
() => normalizeAgentGUIProviderTargets(providerTargets, {
|
|
8498
|
+
fallbackToLocal: false
|
|
8499
|
+
}),
|
|
8500
|
+
[providerTargets]
|
|
8501
|
+
);
|
|
8502
|
+
const normalizedProviderTargets = useMemo4(
|
|
8503
|
+
() => normalizedExplicitProviderTargets.length > 0 ? normalizedExplicitProviderTargets : normalizeAgentGUIProviderTargets(null),
|
|
8504
|
+
[normalizedExplicitProviderTargets]
|
|
8505
|
+
);
|
|
8506
|
+
const selectedProviderTarget = useMemo4(
|
|
8507
|
+
() => resolveAgentGUIProviderTarget({
|
|
8508
|
+
defaultProviderTargetId,
|
|
8509
|
+
provider: data.provider,
|
|
8510
|
+
providerTargetId: data.providerTargetId,
|
|
8511
|
+
providerTargets: normalizedProviderTargets
|
|
8512
|
+
}),
|
|
8513
|
+
[
|
|
8514
|
+
data.provider,
|
|
8515
|
+
data.providerTargetId,
|
|
8516
|
+
defaultProviderTargetId,
|
|
8517
|
+
normalizedProviderTargets
|
|
8518
|
+
]
|
|
8519
|
+
);
|
|
8520
|
+
const selectedProviderTargetIsExplicit = useMemo4(
|
|
8521
|
+
() => normalizedExplicitProviderTargets.some(
|
|
8522
|
+
(target) => target.provider === selectedProviderTarget.provider && target.targetId === selectedProviderTarget.targetId && agentGUIProviderTargetRefsEqual(
|
|
8523
|
+
target.ref,
|
|
8524
|
+
selectedProviderTarget.ref
|
|
8525
|
+
)
|
|
8526
|
+
),
|
|
8527
|
+
[normalizedExplicitProviderTargets, selectedProviderTarget]
|
|
8528
|
+
);
|
|
8458
8529
|
const agentActivityDisplayStatusesRef = useRef4(null);
|
|
8459
8530
|
const agentActivityDisplayStatuses = useMemo4(() => {
|
|
8460
8531
|
const next = selectSessionDisplayStatuses(agentActivitySnapshot);
|
|
@@ -8800,6 +8871,12 @@ function useAgentGUINodeController({
|
|
|
8800
8871
|
agentActivitySnapshot
|
|
8801
8872
|
);
|
|
8802
8873
|
const dataRef = useRef4(data);
|
|
8874
|
+
const selectedProviderTargetRef = useRef4(selectedProviderTarget);
|
|
8875
|
+
selectedProviderTargetRef.current = selectedProviderTarget;
|
|
8876
|
+
const selectedProviderTargetIsExplicitRef = useRef4(
|
|
8877
|
+
selectedProviderTargetIsExplicit
|
|
8878
|
+
);
|
|
8879
|
+
selectedProviderTargetIsExplicitRef.current = selectedProviderTargetIsExplicit;
|
|
8803
8880
|
const draftSettingsBySessionIdRef = useRef4(draftSettingsBySessionId);
|
|
8804
8881
|
const onDataChangeRef = useRef4(onDataChange);
|
|
8805
8882
|
const onShowMessageRef = useRef4(onShowMessage);
|
|
@@ -8824,6 +8901,9 @@ function useAgentGUINodeController({
|
|
|
8824
8901
|
});
|
|
8825
8902
|
const selectedConversationMessageLoadSeqRef = useRef4(0);
|
|
8826
8903
|
const selectedConversationOlderMessageLoadSeqRef = useRef4(0);
|
|
8904
|
+
const failedOlderMessageCursorBySessionIdRef = useRef4(
|
|
8905
|
+
/* @__PURE__ */ new Map()
|
|
8906
|
+
);
|
|
8827
8907
|
const lastConversationProjectionDiagnosticKeyRef = useRef4(
|
|
8828
8908
|
null
|
|
8829
8909
|
);
|
|
@@ -10035,6 +10115,9 @@ function useAgentGUINodeController({
|
|
|
10035
10115
|
durableMessages: detailMessages,
|
|
10036
10116
|
localMessages: windowOverlayMessages
|
|
10037
10117
|
});
|
|
10118
|
+
failedOlderMessageCursorBySessionIdRef.current.delete(
|
|
10119
|
+
normalizedAgentSessionId
|
|
10120
|
+
);
|
|
10038
10121
|
setAgentSessionViewDetailMessages(
|
|
10039
10122
|
sessionViewRef(normalizedAgentSessionId),
|
|
10040
10123
|
detailMessages,
|
|
@@ -10111,6 +10194,23 @@ function useAgentGUINodeController({
|
|
|
10111
10194
|
});
|
|
10112
10195
|
return;
|
|
10113
10196
|
}
|
|
10197
|
+
const beforeVersion = currentView.oldestLoadedVersion;
|
|
10198
|
+
if (failedOlderMessageCursorBySessionIdRef.current.get(
|
|
10199
|
+
normalizedAgentSessionId
|
|
10200
|
+
) === beforeVersion) {
|
|
10201
|
+
reportAgentGUIMessagePageDiagnostic({
|
|
10202
|
+
agentSessionId: normalizedAgentSessionId,
|
|
10203
|
+
details: {
|
|
10204
|
+
beforeVersion,
|
|
10205
|
+
reason: "previous_cursor_error"
|
|
10206
|
+
},
|
|
10207
|
+
event: "agent.gui.messages.older.suppressed_after_error",
|
|
10208
|
+
level: "warn",
|
|
10209
|
+
runtime: agentActivityRuntime,
|
|
10210
|
+
workspaceId
|
|
10211
|
+
});
|
|
10212
|
+
return;
|
|
10213
|
+
}
|
|
10114
10214
|
const requestId = ++selectedConversationOlderMessageLoadSeqRef.current;
|
|
10115
10215
|
setAgentSessionViewOlderMessagesLoading(
|
|
10116
10216
|
sessionViewRef(normalizedAgentSessionId),
|
|
@@ -10120,7 +10220,7 @@ function useAgentGUINodeController({
|
|
|
10120
10220
|
reportAgentGUIMessagePageDiagnostic({
|
|
10121
10221
|
agentSessionId: normalizedAgentSessionId,
|
|
10122
10222
|
details: {
|
|
10123
|
-
beforeVersion
|
|
10223
|
+
beforeVersion,
|
|
10124
10224
|
limit: AGENT_GUI_DETAIL_MESSAGES_PAGE_SIZE,
|
|
10125
10225
|
order: "desc",
|
|
10126
10226
|
requestId
|
|
@@ -10132,7 +10232,7 @@ function useAgentGUINodeController({
|
|
|
10132
10232
|
const page = await agentActivityRuntime.listSessionMessages({
|
|
10133
10233
|
workspaceId,
|
|
10134
10234
|
agentSessionId: normalizedAgentSessionId,
|
|
10135
|
-
beforeVersion
|
|
10235
|
+
beforeVersion,
|
|
10136
10236
|
cache: false,
|
|
10137
10237
|
limit: AGENT_GUI_DETAIL_MESSAGES_PAGE_SIZE,
|
|
10138
10238
|
order: "desc"
|
|
@@ -10147,7 +10247,7 @@ function useAgentGUINodeController({
|
|
|
10147
10247
|
reportAgentGUIMessagePageDiagnostic({
|
|
10148
10248
|
agentSessionId: normalizedAgentSessionId,
|
|
10149
10249
|
details: {
|
|
10150
|
-
beforeVersion
|
|
10250
|
+
beforeVersion,
|
|
10151
10251
|
hasMore: page.hasMore,
|
|
10152
10252
|
latestVersion: page.latestVersion,
|
|
10153
10253
|
requestId
|
|
@@ -10157,6 +10257,9 @@ function useAgentGUINodeController({
|
|
|
10157
10257
|
runtime: agentActivityRuntime,
|
|
10158
10258
|
workspaceId
|
|
10159
10259
|
});
|
|
10260
|
+
failedOlderMessageCursorBySessionIdRef.current.delete(
|
|
10261
|
+
normalizedAgentSessionId
|
|
10262
|
+
);
|
|
10160
10263
|
const nextDetailMessages = mergeWorkspaceAgentMessages(
|
|
10161
10264
|
currentView.detailMessages,
|
|
10162
10265
|
page.messages
|
|
@@ -10191,8 +10294,16 @@ function useAgentGUINodeController({
|
|
|
10191
10294
|
);
|
|
10192
10295
|
return;
|
|
10193
10296
|
}
|
|
10297
|
+
failedOlderMessageCursorBySessionIdRef.current.set(
|
|
10298
|
+
normalizedAgentSessionId,
|
|
10299
|
+
beforeVersion
|
|
10300
|
+
);
|
|
10194
10301
|
reportAgentGUIRuntimeError({
|
|
10195
10302
|
agentSessionId: normalizedAgentSessionId,
|
|
10303
|
+
context: {
|
|
10304
|
+
beforeVersion,
|
|
10305
|
+
requestId
|
|
10306
|
+
},
|
|
10196
10307
|
error,
|
|
10197
10308
|
phase: "load_session_messages",
|
|
10198
10309
|
provider: dataRef.current.provider,
|
|
@@ -10368,6 +10479,18 @@ function useAgentGUINodeController({
|
|
|
10368
10479
|
),
|
|
10369
10480
|
[loadSessionState]
|
|
10370
10481
|
);
|
|
10482
|
+
const scheduleActivityStreamStateReloadRef = useRef4(
|
|
10483
|
+
scheduleActivityStreamStateReload
|
|
10484
|
+
);
|
|
10485
|
+
const clearSelectedConversationNotFoundRetryRef = useRef4(
|
|
10486
|
+
clearSelectedConversationNotFoundRetry
|
|
10487
|
+
);
|
|
10488
|
+
useEffect4(() => {
|
|
10489
|
+
scheduleActivityStreamStateReloadRef.current = scheduleActivityStreamStateReload;
|
|
10490
|
+
}, [scheduleActivityStreamStateReload]);
|
|
10491
|
+
useEffect4(() => {
|
|
10492
|
+
clearSelectedConversationNotFoundRetryRef.current = clearSelectedConversationNotFoundRetry;
|
|
10493
|
+
}, [clearSelectedConversationNotFoundRetry]);
|
|
10371
10494
|
const applyTimelineProjectionUpdate = useCallback4(
|
|
10372
10495
|
(agentSessionId, nextItems, mergedItems) => {
|
|
10373
10496
|
if (nextItems.length === 0) {
|
|
@@ -10853,8 +10976,8 @@ function useAgentGUINodeController({
|
|
|
10853
10976
|
useEffect4(() => {
|
|
10854
10977
|
isMountedRef.current = true;
|
|
10855
10978
|
return () => {
|
|
10856
|
-
|
|
10857
|
-
|
|
10979
|
+
scheduleActivityStreamStateReloadRef.current.cancel();
|
|
10980
|
+
clearSelectedConversationNotFoundRetryRef.current();
|
|
10858
10981
|
const current = activeConversationIdRef.current;
|
|
10859
10982
|
const pendingNewConversationId = startingConversationIdRef.current;
|
|
10860
10983
|
isMountedRef.current = false;
|
|
@@ -10868,13 +10991,11 @@ function useAgentGUINodeController({
|
|
|
10868
10991
|
void unactivateRef.current(pendingNewConversationId);
|
|
10869
10992
|
}
|
|
10870
10993
|
};
|
|
10871
|
-
}, [
|
|
10872
|
-
scheduleActivityStreamStateReload,
|
|
10873
|
-
clearSelectedConversationNotFoundRetry
|
|
10874
|
-
]);
|
|
10994
|
+
}, []);
|
|
10875
10995
|
const startConversation = useCallback4(
|
|
10876
10996
|
(initialContentInput, displayPrompt) => {
|
|
10877
|
-
|
|
10997
|
+
const target = selectedProviderTargetRef.current;
|
|
10998
|
+
if (isCreatingConversation || target.disabled === true || data.provider === "openclaw" && openclawGateway?.status !== "ready") {
|
|
10878
10999
|
return;
|
|
10879
11000
|
}
|
|
10880
11001
|
const normalizedInitialContent = Array.isArray(initialContentInput) ? normalizeAgentPromptContentBlocks(
|
|
@@ -10891,7 +11012,20 @@ function useAgentGUINodeController({
|
|
|
10891
11012
|
let pendingCreateAgentSessionId = null;
|
|
10892
11013
|
let pendingOptimisticConversation = null;
|
|
10893
11014
|
void (async () => {
|
|
10894
|
-
const
|
|
11015
|
+
const target2 = selectedProviderTargetRef.current;
|
|
11016
|
+
const provider = target2.provider;
|
|
11017
|
+
const shouldUseProviderTargetRef = selectedProviderTargetIsExplicitRef.current;
|
|
11018
|
+
onDataChangeRef.current(
|
|
11019
|
+
(current) => current.provider === provider && (current.providerTargetId ?? null) === (shouldUseProviderTargetRef ? target2.targetId : null) && agentGUIProviderTargetRefsEqual(
|
|
11020
|
+
current.providerTargetRef,
|
|
11021
|
+
shouldUseProviderTargetRef ? target2.ref : null
|
|
11022
|
+
) ? current : {
|
|
11023
|
+
...current,
|
|
11024
|
+
provider,
|
|
11025
|
+
providerTargetId: shouldUseProviderTargetRef ? target2.targetId : null,
|
|
11026
|
+
providerTargetRef: shouldUseProviderTargetRef ? target2.ref : null
|
|
11027
|
+
}
|
|
11028
|
+
);
|
|
10895
11029
|
const currentData = dataRef.current.provider === provider ? dataRef.current : data;
|
|
10896
11030
|
const selectedProjectPath2 = selectedProjectPathRef.current;
|
|
10897
11031
|
const initialNodeSettings = readNodeDefaultDraftSettings({
|
|
@@ -11022,6 +11156,7 @@ function useAgentGUINodeController({
|
|
|
11022
11156
|
mode: "new",
|
|
11023
11157
|
agentSessionId,
|
|
11024
11158
|
provider,
|
|
11159
|
+
providerTargetRef: shouldUseProviderTargetRef ? target2.ref : null,
|
|
11025
11160
|
cwd: selectedProjectPath2 ?? "",
|
|
11026
11161
|
initialContent: normalizedInitialContent,
|
|
11027
11162
|
initialDisplayPrompt,
|
|
@@ -11868,35 +12003,8 @@ function useAgentGUINodeController({
|
|
|
11868
12003
|
},
|
|
11869
12004
|
[agentActivityDisplayStatuses, isRespondingApproval, isSubmitting]
|
|
11870
12005
|
);
|
|
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
|
-
}
|
|
12006
|
+
const submitExistingPrompt = useCallback4(
|
|
12007
|
+
(agentSessionId, normalizedContent, displayPromptText) => {
|
|
11900
12008
|
if (isSessionMarkedNonResumable(agentSessionId)) {
|
|
11901
12009
|
setDetailError(
|
|
11902
12010
|
getAgentGUIErrorMessage(buildResumeSessionNotLocalActivationError())
|
|
@@ -11932,14 +12040,78 @@ function useAgentGUINodeController({
|
|
|
11932
12040
|
},
|
|
11933
12041
|
[
|
|
11934
12042
|
activation,
|
|
11935
|
-
agentActivityRuntime,
|
|
11936
|
-
conversationListQuery,
|
|
11937
12043
|
executePrompt,
|
|
11938
12044
|
isSessionMarkedNonResumable,
|
|
11939
|
-
resolvedPromptImagesSupported,
|
|
11940
12045
|
queuePromptLocally,
|
|
11941
|
-
shouldQueuePromptLocally
|
|
12046
|
+
shouldQueuePromptLocally
|
|
12047
|
+
]
|
|
12048
|
+
);
|
|
12049
|
+
const submitPrompt = useCallback4(
|
|
12050
|
+
(content, displayPrompt) => {
|
|
12051
|
+
const agentSessionId = activeConversationIdRef.current;
|
|
12052
|
+
const normalizedContent = normalizeAgentPromptContentBlocks(content);
|
|
12053
|
+
if (normalizedContent.length === 0) {
|
|
12054
|
+
return;
|
|
12055
|
+
}
|
|
12056
|
+
const displayPromptText = displayPrompt && displayPrompt.trim() ? displayPrompt : void 0;
|
|
12057
|
+
if (resolvedPromptImagesSupported === false && agentPromptContentHasImage(normalizedContent)) {
|
|
12058
|
+
setDetailError(translate("agentHost.agentGui.promptImagesUnsupported"));
|
|
12059
|
+
return;
|
|
12060
|
+
}
|
|
12061
|
+
if (!agentSessionId) {
|
|
12062
|
+
if (!isComposerHomeRef.current) {
|
|
12063
|
+
const promptLength = agentPromptContentDisplayText(normalizedContent).length;
|
|
12064
|
+
reportAgentGUISubmitWithoutActiveConversation({
|
|
12065
|
+
blockCount: normalizedContent.length,
|
|
12066
|
+
conversationCount: conversationsRef.current.length,
|
|
12067
|
+
conversationListQueryReady: conversationListQuery !== null,
|
|
12068
|
+
dataLastActiveAgentSessionId: dataRef.current.lastActiveAgentSessionId ?? null,
|
|
12069
|
+
isComposerHome: isComposerHomeRef.current,
|
|
12070
|
+
promptLength,
|
|
12071
|
+
provider: dataRef.current.provider ?? null,
|
|
12072
|
+
runtime: agentActivityRuntime,
|
|
12073
|
+
workspaceId
|
|
12074
|
+
});
|
|
12075
|
+
const recoveredAgentSessionId = dataRef.current.lastActiveAgentSessionId?.trim() ?? "";
|
|
12076
|
+
if (recoveredAgentSessionId) {
|
|
12077
|
+
reportAgentGUISubmitRecoveredActiveConversation({
|
|
12078
|
+
blockCount: normalizedContent.length,
|
|
12079
|
+
conversationCount: conversationsRef.current.length,
|
|
12080
|
+
conversationListQueryReady: conversationListQuery !== null,
|
|
12081
|
+
promptLength,
|
|
12082
|
+
provider: dataRef.current.provider ?? null,
|
|
12083
|
+
recoveredAgentSessionId,
|
|
12084
|
+
runtime: agentActivityRuntime,
|
|
12085
|
+
workspaceId
|
|
12086
|
+
});
|
|
12087
|
+
activeConversationIdRef.current = recoveredAgentSessionId;
|
|
12088
|
+
setActiveConversationId(recoveredAgentSessionId);
|
|
12089
|
+
setIntent({ tag: "active", id: recoveredAgentSessionId });
|
|
12090
|
+
persistActiveConversation(recoveredAgentSessionId);
|
|
12091
|
+
submitExistingPrompt(
|
|
12092
|
+
recoveredAgentSessionId,
|
|
12093
|
+
normalizedContent,
|
|
12094
|
+
displayPromptText
|
|
12095
|
+
);
|
|
12096
|
+
return;
|
|
12097
|
+
}
|
|
12098
|
+
}
|
|
12099
|
+
startConversation(normalizedContent, displayPromptText);
|
|
12100
|
+
return;
|
|
12101
|
+
}
|
|
12102
|
+
submitExistingPrompt(
|
|
12103
|
+
agentSessionId,
|
|
12104
|
+
normalizedContent,
|
|
12105
|
+
displayPromptText
|
|
12106
|
+
);
|
|
12107
|
+
},
|
|
12108
|
+
[
|
|
12109
|
+
agentActivityRuntime,
|
|
12110
|
+
conversationListQuery,
|
|
12111
|
+
resolvedPromptImagesSupported,
|
|
12112
|
+
persistActiveConversation,
|
|
11942
12113
|
startConversation,
|
|
12114
|
+
submitExistingPrompt,
|
|
11943
12115
|
workspaceId
|
|
11944
12116
|
]
|
|
11945
12117
|
);
|
|
@@ -13630,7 +13802,7 @@ function useAgentGUINodeController({
|
|
|
13630
13802
|
hasProviderSessionNotFoundError,
|
|
13631
13803
|
pendingApproval
|
|
13632
13804
|
]);
|
|
13633
|
-
const canSubmit = activeLiveState !== "activating" && activeLiveState !== "failed" && !activeConversationResumeUnavailable && (data.provider !== "openclaw" || openclawGateway?.status === "ready") && pendingApproval === null && pendingInteractivePrompt === null && sessionChrome.auth === null && !isCreatingConversation && !isSubmitting && !isInterrupting;
|
|
13805
|
+
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
13806
|
const canQueueWhileBusy = Boolean(activeConversationId) && (activeConversationBusy || isSubmitting);
|
|
13635
13807
|
useEffect4(() => {
|
|
13636
13808
|
const firstVersion = minFiniteMessageVersion(activeMessages);
|
|
@@ -13929,6 +14101,7 @@ function useAgentGUINodeController({
|
|
|
13929
14101
|
workspacePath,
|
|
13930
14102
|
currentUserId,
|
|
13931
14103
|
data,
|
|
14104
|
+
selectedProviderTarget,
|
|
13932
14105
|
conversations: visibleConversations,
|
|
13933
14106
|
userProjects,
|
|
13934
14107
|
activeConversation,
|
|
@@ -13993,6 +14166,7 @@ function useAgentGUINodeController({
|
|
|
13993
14166
|
conversationDetail,
|
|
13994
14167
|
controllerActions,
|
|
13995
14168
|
data,
|
|
14169
|
+
selectedProviderTarget,
|
|
13996
14170
|
detailError,
|
|
13997
14171
|
draftContent,
|
|
13998
14172
|
draftPrompt,
|
|
@@ -14017,6 +14191,7 @@ function useAgentGUINodeController({
|
|
|
14017
14191
|
pendingDeleteProjectConversations,
|
|
14018
14192
|
pendingApproval,
|
|
14019
14193
|
pendingInteractivePrompt,
|
|
14194
|
+
selectedProviderTarget.disabled,
|
|
14020
14195
|
queuedPrompts,
|
|
14021
14196
|
drainingQueuedPromptId,
|
|
14022
14197
|
currentUserId,
|
|
@@ -25318,7 +25493,10 @@ function normalizeSlashStatusModelName(value) {
|
|
|
25318
25493
|
return value?.trim().toLowerCase().replace(/[^a-z0-9]+/gu, "-").replace(/^-+|-+$/gu, "") ?? "";
|
|
25319
25494
|
}
|
|
25320
25495
|
function agentGuiStateEquals(left, right) {
|
|
25321
|
-
return left === right || left.provider === right.provider &&
|
|
25496
|
+
return left === right || left.provider === right.provider && (left.providerTargetId ?? null) === (right.providerTargetId ?? null) && agentGUIProviderTargetRefsEqual(
|
|
25497
|
+
left.providerTargetRef,
|
|
25498
|
+
right.providerTargetRef
|
|
25499
|
+
) && 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
25500
|
left.composerOverridesByProvider,
|
|
25323
25501
|
right.composerOverridesByProvider
|
|
25324
25502
|
);
|
|
@@ -25339,7 +25517,7 @@ function composerOverridesByProviderEqual(left, right) {
|
|
|
25339
25517
|
return true;
|
|
25340
25518
|
}
|
|
25341
25519
|
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(
|
|
25520
|
+
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.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
25521
|
previous.workspaceAgentProbes,
|
|
25344
25522
|
next.workspaceAgentProbes,
|
|
25345
25523
|
previous.state.provider
|
|
@@ -25367,6 +25545,8 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
25367
25545
|
capabilityMenuState,
|
|
25368
25546
|
onCapabilitySettingsRequest,
|
|
25369
25547
|
onAgentProviderLogin,
|
|
25548
|
+
providerTargets,
|
|
25549
|
+
defaultProviderTargetId = null,
|
|
25370
25550
|
onWorkspaceFileReferencesAdded,
|
|
25371
25551
|
onOpenConversationWindow,
|
|
25372
25552
|
onClose,
|
|
@@ -25523,17 +25703,17 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
25523
25703
|
data: state,
|
|
25524
25704
|
openSessionRequest,
|
|
25525
25705
|
prefillPromptRequest,
|
|
25706
|
+
providerTargets,
|
|
25707
|
+
defaultProviderTargetId,
|
|
25526
25708
|
previewMode,
|
|
25527
25709
|
onDataChange: handleDataChange,
|
|
25528
25710
|
onShowMessage
|
|
25529
25711
|
});
|
|
25530
25712
|
const fallbackAgentTitle = t("sidebar.fallbackAgentLabel");
|
|
25531
25713
|
const activeProvider = viewModel.activeConversation?.provider ?? state.provider;
|
|
25532
|
-
const
|
|
25533
|
-
|
|
25534
|
-
|
|
25535
|
-
);
|
|
25536
|
-
const windowAgentTitle = getAgentHostManagedToolchainAgentByName(activeProvider)?.label ?? displayProviderLabel;
|
|
25714
|
+
const selectedProviderTargetLabel = viewModel.selectedProviderTarget?.label ?? resolveAgentGUIProviderDisplayLabel(state.provider, fallbackAgentTitle);
|
|
25715
|
+
const displayProviderLabel = viewModel.activeConversation ? resolveAgentGUIProviderDisplayLabel(activeProvider, fallbackAgentTitle) : selectedProviderTargetLabel;
|
|
25716
|
+
const windowAgentTitle = viewModel.activeConversation ? getAgentHostManagedToolchainAgentByName(activeProvider)?.label ?? displayProviderLabel : displayProviderLabel;
|
|
25537
25717
|
const activeConversationDockTitle = viewModel.activeConversation ? resolveAgentGUIDockConversationTitle(viewModel.activeConversation) : null;
|
|
25538
25718
|
const activeConversationWindowTitle = viewModel.activeConversation ? formatAgentSessionMentionText(
|
|
25539
25719
|
resolveAgentGUIConversationDisplayTitle(
|
|
@@ -26185,18 +26365,24 @@ export {
|
|
|
26185
26365
|
AgentActivityRuntimeProvider,
|
|
26186
26366
|
AgentGUI,
|
|
26187
26367
|
AgentGuiI18nProvider,
|
|
26368
|
+
agentGUIDefaultTargetProviders,
|
|
26188
26369
|
agentGuiDockIconUrl,
|
|
26189
26370
|
agentGuiDockIconUrls,
|
|
26190
26371
|
agentGuiI18nModule,
|
|
26191
26372
|
agentGuiI18nResources,
|
|
26192
26373
|
agentHostSnapshotFromAgentActivitySnapshot,
|
|
26193
26374
|
buildAgentActivitySnapshotProjection,
|
|
26375
|
+
createLocalAgentGUIProviderTarget,
|
|
26376
|
+
createLocalAgentGUIProviderTargets,
|
|
26194
26377
|
getAgentActivityRuntime,
|
|
26195
26378
|
getOptionalAgentActivityRuntime,
|
|
26379
|
+
localAgentGUIProviderTargetId,
|
|
26380
|
+
normalizeAgentGUIProviderTargets,
|
|
26196
26381
|
preloadAgentMentionBrowse,
|
|
26197
26382
|
projectCoreSessionStatus,
|
|
26198
26383
|
resetAgentActivityRuntimeForTests,
|
|
26199
26384
|
resolveAgentGUIExpandedWindowFrame,
|
|
26385
|
+
resolveAgentGUIProviderTarget,
|
|
26200
26386
|
selectNeedsAttentionCount2 as selectNeedsAttentionCount,
|
|
26201
26387
|
selectNeedsAttentionItems2 as selectNeedsAttentionItems,
|
|
26202
26388
|
setAgentActivityRuntimeForTests,
|