@tutti-os/agent-gui 0.0.54 → 0.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-conversation/index.js +2 -2
- package/dist/app/renderer/agentactivity.css +21 -4
- package/dist/{chunk-7ZDLFTVL.js → chunk-7H4IH67L.js} +2 -2
- package/dist/{chunk-EXZH66UE.js → chunk-GBAQVKQN.js} +2 -2
- package/dist/{chunk-JRA44NYI.js → chunk-NBTJEF3H.js} +4 -1
- package/dist/chunk-NBTJEF3H.js.map +1 -0
- package/dist/context-mention-palette/index.js +2 -2
- package/dist/index.js +463 -111
- package/dist/index.js.map +1 -1
- package/package.json +14 -14
- package/dist/chunk-JRA44NYI.js.map +0 -1
- /package/dist/{chunk-7ZDLFTVL.js.map → chunk-7H4IH67L.js.map} +0 -0
- /package/dist/{chunk-EXZH66UE.js.map → chunk-GBAQVKQN.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
skillTriggerForPrefix,
|
|
64
64
|
toLocalShortDateTime,
|
|
65
65
|
useProjectedAgentConversation
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-GBAQVKQN.js";
|
|
67
67
|
import {
|
|
68
68
|
AgentMessageMarkdown,
|
|
69
69
|
AgentTargetPresentationProvider,
|
|
@@ -78,7 +78,7 @@ import {
|
|
|
78
78
|
DEFAULT_AGENT_MENTION_FILTER,
|
|
79
79
|
agentMentionItemKey,
|
|
80
80
|
preloadAgentMentionBrowse
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-7H4IH67L.js";
|
|
82
82
|
import {
|
|
83
83
|
WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN,
|
|
84
84
|
buildWorkspaceAgentActivityListViewModel,
|
|
@@ -102,7 +102,7 @@ import {
|
|
|
102
102
|
mentionItemToAttrs,
|
|
103
103
|
normalizeAgentSessionMentionTitle,
|
|
104
104
|
parseMentionItemFromHref
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-NBTJEF3H.js";
|
|
106
106
|
import "./chunk-Y35GDLP2.js";
|
|
107
107
|
import "./chunk-LUGELG5V.js";
|
|
108
108
|
import {
|
|
@@ -6557,7 +6557,10 @@ function buildNodeDefaultComposerSettings(data, options) {
|
|
|
6557
6557
|
}
|
|
6558
6558
|
function nodeComposerOverridesForProvider(data) {
|
|
6559
6559
|
const agentTargetId = normalizeOptionalText(data.agentTargetId);
|
|
6560
|
-
|
|
6560
|
+
if (agentTargetId) {
|
|
6561
|
+
return data.composerOverridesByAgentTargetId?.[agentTargetId] ?? null;
|
|
6562
|
+
}
|
|
6563
|
+
return data.composerOverridesByProvider?.[data.provider] ?? data.composerOverrides ?? null;
|
|
6561
6564
|
}
|
|
6562
6565
|
function composerSupportForProvider(provider) {
|
|
6563
6566
|
if (provider === "claude-code" || provider === "codex" || provider === "gemini") {
|
|
@@ -6656,6 +6659,103 @@ function composerDefaultsFromSettings(settings) {
|
|
|
6656
6659
|
}
|
|
6657
6660
|
return Object.keys(defaults).length > 0 ? defaults : null;
|
|
6658
6661
|
}
|
|
6662
|
+
function composerTargetDataFromProviderTarget(input) {
|
|
6663
|
+
const agentTargetId = normalizeOptionalText2(input.target.agentTargetId);
|
|
6664
|
+
const useLegacyProviderTargetRef = !agentTargetId && input.isExplicit;
|
|
6665
|
+
const providerTargetId = useLegacyProviderTargetRef ? input.target.targetId : null;
|
|
6666
|
+
const providerTargetRef = useLegacyProviderTargetRef ? input.target.ref : null;
|
|
6667
|
+
const currentAgentTargetId = normalizeOptionalText2(
|
|
6668
|
+
input.current.agentTargetId
|
|
6669
|
+
);
|
|
6670
|
+
const currentProviderTargetId = normalizeOptionalText2(
|
|
6671
|
+
input.current.providerTargetId
|
|
6672
|
+
);
|
|
6673
|
+
const canPromoteLegacyComposerOverrides = agentTargetId !== null && currentAgentTargetId === null && currentProviderTargetId === null && input.current.providerTargetRef == null && input.current.provider === input.target.provider && input.current.composerOverrides != null && !input.current.composerOverridesByAgentTargetId?.[agentTargetId];
|
|
6674
|
+
const composerOverridesByAgentTargetId = canPromoteLegacyComposerOverrides ? {
|
|
6675
|
+
...input.current.composerOverridesByAgentTargetId ?? {},
|
|
6676
|
+
[agentTargetId]: input.current.composerOverrides
|
|
6677
|
+
} : input.current.composerOverridesByAgentTargetId;
|
|
6678
|
+
const currentTargetIdentityChanged = input.current.provider !== input.target.provider || currentAgentTargetId !== null && currentAgentTargetId !== agentTargetId || currentProviderTargetId !== null && currentProviderTargetId !== providerTargetId || input.current.providerTargetRef != null && !agentGUIProviderTargetRefsEqual(
|
|
6679
|
+
input.current.providerTargetRef,
|
|
6680
|
+
providerTargetRef
|
|
6681
|
+
);
|
|
6682
|
+
return {
|
|
6683
|
+
agentTargetId,
|
|
6684
|
+
provider: input.target.provider,
|
|
6685
|
+
providerTargetId,
|
|
6686
|
+
providerTargetRef,
|
|
6687
|
+
targetId: input.target.targetId,
|
|
6688
|
+
data: {
|
|
6689
|
+
...input.current,
|
|
6690
|
+
provider: input.target.provider,
|
|
6691
|
+
agentTargetId,
|
|
6692
|
+
providerTargetId,
|
|
6693
|
+
providerTargetRef,
|
|
6694
|
+
composerOverrides: canPromoteLegacyComposerOverrides ? null : currentTargetIdentityChanged ? null : input.current.composerOverrides,
|
|
6695
|
+
composerOverridesByAgentTargetId
|
|
6696
|
+
}
|
|
6697
|
+
};
|
|
6698
|
+
}
|
|
6699
|
+
function composerTargetDataFromNodeData(data) {
|
|
6700
|
+
const agentTargetId = normalizeOptionalText2(data.agentTargetId);
|
|
6701
|
+
const providerTargetId = data.providerTargetId ?? null;
|
|
6702
|
+
return {
|
|
6703
|
+
agentTargetId,
|
|
6704
|
+
provider: data.provider,
|
|
6705
|
+
providerTargetId,
|
|
6706
|
+
providerTargetRef: data.providerTargetRef ?? null,
|
|
6707
|
+
targetId: agentTargetId ?? providerTargetId ?? `local:${data.provider}`,
|
|
6708
|
+
data
|
|
6709
|
+
};
|
|
6710
|
+
}
|
|
6711
|
+
function agentGUINodeDataHasComposerTarget(data) {
|
|
6712
|
+
return normalizeOptionalText2(data.agentTargetId) !== null || normalizeOptionalText2(data.providerTargetId) !== null || data.providerTargetRef != null;
|
|
6713
|
+
}
|
|
6714
|
+
function composerOptionsForTarget(input) {
|
|
6715
|
+
if (input.target.agentTargetId) {
|
|
6716
|
+
const targetOptions = input.snapshot.composerOptionsByAgentTargetId?.[input.target.agentTargetId] ?? null;
|
|
6717
|
+
if (targetOptions) {
|
|
6718
|
+
return targetOptions;
|
|
6719
|
+
}
|
|
6720
|
+
return null;
|
|
6721
|
+
}
|
|
6722
|
+
return input.snapshot.composerOptionsByProvider?.[input.target.provider] ?? null;
|
|
6723
|
+
}
|
|
6724
|
+
function composerOptionValues(options) {
|
|
6725
|
+
return new Set(options.map((option) => option.value));
|
|
6726
|
+
}
|
|
6727
|
+
function sanitizeComposerSettingsForOptions(settings, options) {
|
|
6728
|
+
if (!options) {
|
|
6729
|
+
return settings;
|
|
6730
|
+
}
|
|
6731
|
+
const modelValues = composerOptionValues(options.models);
|
|
6732
|
+
const reasoningValues = composerOptionValues(options.reasoningEfforts);
|
|
6733
|
+
const speedValues = composerOptionValues(options.speeds ?? []);
|
|
6734
|
+
const permissionValues = new Set(
|
|
6735
|
+
options.permissionConfig?.modes.map((mode) => mode.id) ?? []
|
|
6736
|
+
);
|
|
6737
|
+
const model = normalizeOptionalText2(settings.model);
|
|
6738
|
+
const reasoningEffort = normalizeOptionalText2(settings.reasoningEffort);
|
|
6739
|
+
const speed = normalizeOptionalText2(settings.speed);
|
|
6740
|
+
const permissionModeId = normalizePermissionModeId(settings.permissionModeId);
|
|
6741
|
+
const modelOptionsAreAuthoritative = options.provider === "claude-code";
|
|
6742
|
+
return {
|
|
6743
|
+
...settings,
|
|
6744
|
+
model: modelOptionsAreAuthoritative && model && modelValues.size > 0 && !modelValues.has(model) ? null : model,
|
|
6745
|
+
reasoningEffort: reasoningEffort && reasoningValues.size > 0 && !reasoningValues.has(reasoningEffort) ? null : reasoningEffort,
|
|
6746
|
+
speed: speed && speedValues.size > 0 && !speedValues.has(speed) ? null : speed,
|
|
6747
|
+
permissionModeId: permissionModeId && permissionValues.size > 0 && !permissionValues.has(permissionModeId) ? null : permissionModeId
|
|
6748
|
+
};
|
|
6749
|
+
}
|
|
6750
|
+
function sanitizeComposerSettingsForTarget(input) {
|
|
6751
|
+
if (!input.target.agentTargetId) {
|
|
6752
|
+
return input.settings;
|
|
6753
|
+
}
|
|
6754
|
+
return sanitizeComposerSettingsForOptions(input.settings, input.options);
|
|
6755
|
+
}
|
|
6756
|
+
function agentGUIProviderTargetsEqual(left, right) {
|
|
6757
|
+
return left.provider === right.provider && left.targetId === right.targetId && (left.agentTargetId ?? null) === (right.agentTargetId ?? null) && agentGUIProviderTargetRefsEqual(left.ref, right.ref);
|
|
6758
|
+
}
|
|
6659
6759
|
function reportAgentGUIRuntimeError(input) {
|
|
6660
6760
|
const reportDiagnostic = input.runtime.reportDiagnostic;
|
|
6661
6761
|
if (!reportDiagnostic) {
|
|
@@ -8291,7 +8391,13 @@ function readNodeDefaultDraftContent(input) {
|
|
|
8291
8391
|
return input.drafts[nodeDefaultDraftContentKey(input.data.provider, input.data.agentTargetId)] ?? input.drafts[nodeDefaultDraftContentKey(input.data.provider)] ?? input.drafts[NODE_DEFAULT_DRAFT_KEY] ?? EMPTY_AGENT_COMPOSER_DRAFT;
|
|
8292
8392
|
}
|
|
8293
8393
|
function readNodeDefaultDraftSettings(input) {
|
|
8294
|
-
|
|
8394
|
+
const agentTargetId = normalizeOptionalText2(input.data.agentTargetId);
|
|
8395
|
+
if (agentTargetId) {
|
|
8396
|
+
return input.drafts[nodeDefaultDraftKey(input.data.provider, agentTargetId)] ?? buildNodeDefaultComposerSettings(input.data, {
|
|
8397
|
+
defaultReasoningEffort: input.defaultReasoningEffort
|
|
8398
|
+
});
|
|
8399
|
+
}
|
|
8400
|
+
return input.drafts[nodeDefaultDraftKey(input.data.provider)] ?? input.drafts[NODE_DEFAULT_DRAFT_KEY] ?? buildNodeDefaultComposerSettings(input.data, {
|
|
8295
8401
|
defaultReasoningEffort: input.defaultReasoningEffort
|
|
8296
8402
|
});
|
|
8297
8403
|
}
|
|
@@ -8632,6 +8738,56 @@ function useAgentGUINodeController({
|
|
|
8632
8738
|
),
|
|
8633
8739
|
[normalizedExplicitProviderTargets, selectedProviderTarget]
|
|
8634
8740
|
);
|
|
8741
|
+
const [homeComposerTargetOverride, setHomeComposerTargetOverride] = useState4(null);
|
|
8742
|
+
const homeComposerTargetOverrideIsExplicit = useMemo4(
|
|
8743
|
+
() => homeComposerTargetOverride ? normalizedExplicitProviderTargets.some(
|
|
8744
|
+
(target) => target.provider === homeComposerTargetOverride.provider && target.targetId === homeComposerTargetOverride.targetId && agentGUIProviderTargetRefsEqual(
|
|
8745
|
+
target.ref,
|
|
8746
|
+
homeComposerTargetOverride.ref
|
|
8747
|
+
)
|
|
8748
|
+
) : false,
|
|
8749
|
+
[homeComposerTargetOverride, normalizedExplicitProviderTargets]
|
|
8750
|
+
);
|
|
8751
|
+
const effectiveSelectedProviderTarget = homeComposerTargetOverride ?? selectedProviderTarget;
|
|
8752
|
+
const effectiveSelectedProviderTargetIsExplicit = homeComposerTargetOverride ? homeComposerTargetOverrideIsExplicit : selectedProviderTargetIsExplicit;
|
|
8753
|
+
const nodeComposerTargetResolvedByProviderTarget = agentGUINodeDataHasComposerTarget(data) && (normalizeOptionalText2(data.agentTargetId) !== null && selectedProviderTarget.agentTargetId === normalizeOptionalText2(data.agentTargetId) || normalizeOptionalText2(data.providerTargetId) !== null && selectedProviderTarget.targetId === normalizeOptionalText2(data.providerTargetId) || data.providerTargetRef != null && agentGUIProviderTargetRefsEqual(
|
|
8754
|
+
selectedProviderTarget.ref,
|
|
8755
|
+
data.providerTargetRef
|
|
8756
|
+
));
|
|
8757
|
+
const selectedComposerTargetData = useMemo4(
|
|
8758
|
+
() => homeComposerTargetOverride ? composerTargetDataFromProviderTarget({
|
|
8759
|
+
current: data,
|
|
8760
|
+
isExplicit: homeComposerTargetOverrideIsExplicit,
|
|
8761
|
+
target: homeComposerTargetOverride
|
|
8762
|
+
}) : nodeComposerTargetResolvedByProviderTarget ? composerTargetDataFromProviderTarget({
|
|
8763
|
+
current: data,
|
|
8764
|
+
isExplicit: selectedProviderTargetIsExplicit,
|
|
8765
|
+
target: selectedProviderTarget
|
|
8766
|
+
}) : agentGUINodeDataHasComposerTarget(data) ? composerTargetDataFromNodeData(data) : composerTargetDataFromProviderTarget({
|
|
8767
|
+
current: data,
|
|
8768
|
+
isExplicit: selectedProviderTargetIsExplicit,
|
|
8769
|
+
target: selectedProviderTarget
|
|
8770
|
+
}),
|
|
8771
|
+
[
|
|
8772
|
+
data,
|
|
8773
|
+
homeComposerTargetOverride,
|
|
8774
|
+
homeComposerTargetOverrideIsExplicit,
|
|
8775
|
+
nodeComposerTargetResolvedByProviderTarget,
|
|
8776
|
+
selectedProviderTarget,
|
|
8777
|
+
selectedProviderTargetIsExplicit
|
|
8778
|
+
]
|
|
8779
|
+
);
|
|
8780
|
+
useEffect4(() => {
|
|
8781
|
+
if (!homeComposerTargetOverride) {
|
|
8782
|
+
return;
|
|
8783
|
+
}
|
|
8784
|
+
if (agentGUIProviderTargetsEqual(
|
|
8785
|
+
homeComposerTargetOverride,
|
|
8786
|
+
selectedProviderTarget
|
|
8787
|
+
)) {
|
|
8788
|
+
setHomeComposerTargetOverride(null);
|
|
8789
|
+
}
|
|
8790
|
+
}, [homeComposerTargetOverride, selectedProviderTarget]);
|
|
8635
8791
|
const agentActivityDisplayStatusesRef = useRef4(null);
|
|
8636
8792
|
const agentActivityDisplayStatuses = useMemo4(() => {
|
|
8637
8793
|
const next = selectSessionDisplayStatuses(agentActivitySnapshot);
|
|
@@ -8761,7 +8917,11 @@ function useAgentGUINodeController({
|
|
|
8761
8917
|
sessionViewRef(activeConversationId)
|
|
8762
8918
|
);
|
|
8763
8919
|
const activeSessionState = activeSessionView?.controlState ?? null;
|
|
8764
|
-
const
|
|
8920
|
+
const composerTargetData = activeConversationId === null ? selectedComposerTargetData : composerTargetDataFromNodeData(data);
|
|
8921
|
+
const providerComposerOptions = composerOptionsForTarget({
|
|
8922
|
+
snapshot: agentActivitySnapshot,
|
|
8923
|
+
target: composerTargetData
|
|
8924
|
+
});
|
|
8765
8925
|
const resolvedPromptImagesSupported = resolveAgentActivityCapability2(
|
|
8766
8926
|
"imageInput",
|
|
8767
8927
|
{
|
|
@@ -8786,7 +8946,7 @@ function useAgentGUINodeController({
|
|
|
8786
8946
|
),
|
|
8787
8947
|
[providerComposerOptions, activeSessionRuntimeContext]
|
|
8788
8948
|
);
|
|
8789
|
-
const supports = composerSupportForProvider(
|
|
8949
|
+
const supports = composerSupportForProvider(composerTargetData.provider);
|
|
8790
8950
|
const usage = useMemo4(
|
|
8791
8951
|
() => resolveAgentActivityUsage({
|
|
8792
8952
|
sessionRuntimeContext: activeSessionRuntimeContext
|
|
@@ -8988,12 +9148,14 @@ function useAgentGUINodeController({
|
|
|
8988
9148
|
agentActivitySnapshot
|
|
8989
9149
|
);
|
|
8990
9150
|
const dataRef = useRef4(data);
|
|
8991
|
-
const selectedProviderTargetRef = useRef4(
|
|
8992
|
-
selectedProviderTargetRef.current =
|
|
9151
|
+
const selectedProviderTargetRef = useRef4(effectiveSelectedProviderTarget);
|
|
9152
|
+
selectedProviderTargetRef.current = effectiveSelectedProviderTarget;
|
|
8993
9153
|
const selectedProviderTargetIsExplicitRef = useRef4(
|
|
8994
|
-
|
|
9154
|
+
effectiveSelectedProviderTargetIsExplicit
|
|
8995
9155
|
);
|
|
8996
|
-
selectedProviderTargetIsExplicitRef.current =
|
|
9156
|
+
selectedProviderTargetIsExplicitRef.current = effectiveSelectedProviderTargetIsExplicit;
|
|
9157
|
+
const selectedComposerTargetDataRef = useRef4(selectedComposerTargetData);
|
|
9158
|
+
selectedComposerTargetDataRef.current = selectedComposerTargetData;
|
|
8997
9159
|
const draftSettingsBySessionIdRef = useRef4(draftSettingsBySessionId);
|
|
8998
9160
|
const onDataChangeRef = useRef4(onDataChange);
|
|
8999
9161
|
const onRememberComposerDefaultsRef = useRef4(onRememberComposerDefaults);
|
|
@@ -9226,6 +9388,12 @@ function useAgentGUINodeController({
|
|
|
9226
9388
|
useEffect4(() => {
|
|
9227
9389
|
isComposerHomeRef.current = isComposerHome;
|
|
9228
9390
|
}, [isComposerHome]);
|
|
9391
|
+
useEffect4(() => {
|
|
9392
|
+
if (activeConversationId === null && isComposerHome) {
|
|
9393
|
+
return;
|
|
9394
|
+
}
|
|
9395
|
+
setHomeComposerTargetOverride(null);
|
|
9396
|
+
}, [activeConversationId, isComposerHome]);
|
|
9229
9397
|
useEffect4(() => {
|
|
9230
9398
|
isCreatingConversationRef.current = isCreatingConversation;
|
|
9231
9399
|
}, [isCreatingConversation]);
|
|
@@ -10511,15 +10679,15 @@ function useAgentGUINodeController({
|
|
|
10511
10679
|
useEffect4(() => {
|
|
10512
10680
|
reloadSelectedConversationRef.current = reloadSelectedConversation;
|
|
10513
10681
|
}, [reloadSelectedConversation]);
|
|
10514
|
-
const
|
|
10515
|
-
(options) => {
|
|
10516
|
-
const provider =
|
|
10517
|
-
const agentTargetId =
|
|
10682
|
+
const loadComposerOptionsForTarget = useCallback4(
|
|
10683
|
+
(targetData, options) => {
|
|
10684
|
+
const provider = targetData.provider;
|
|
10685
|
+
const agentTargetId = targetData.agentTargetId;
|
|
10518
10686
|
if (isCreatingConversationRef.current) {
|
|
10519
10687
|
return;
|
|
10520
10688
|
}
|
|
10521
10689
|
const settings = readNodeDefaultDraftSettings({
|
|
10522
|
-
data:
|
|
10690
|
+
data: targetData.data,
|
|
10523
10691
|
defaultReasoningEffort,
|
|
10524
10692
|
drafts: draftSettingsBySessionIdRef.current
|
|
10525
10693
|
});
|
|
@@ -10537,6 +10705,13 @@ function useAgentGUINodeController({
|
|
|
10537
10705
|
},
|
|
10538
10706
|
[agentActivityRuntime, defaultReasoningEffort, workspaceId, workspacePath]
|
|
10539
10707
|
);
|
|
10708
|
+
const loadDraftComposerOptions = useCallback4(
|
|
10709
|
+
(options) => {
|
|
10710
|
+
const targetData = activeConversationIdRef.current === null ? selectedComposerTargetDataRef.current : composerTargetDataFromNodeData(dataRef.current);
|
|
10711
|
+
loadComposerOptionsForTarget(targetData, options);
|
|
10712
|
+
},
|
|
10713
|
+
[loadComposerOptionsForTarget]
|
|
10714
|
+
);
|
|
10540
10715
|
useEffect4(() => {
|
|
10541
10716
|
if (previewMode) {
|
|
10542
10717
|
return;
|
|
@@ -10544,7 +10719,7 @@ function useAgentGUINodeController({
|
|
|
10544
10719
|
if (!supports.model && !supports.reasoning && !supports.permission) {
|
|
10545
10720
|
return;
|
|
10546
10721
|
}
|
|
10547
|
-
const projectKey = `${
|
|
10722
|
+
const projectKey = `${composerTargetData.agentTargetId ?? composerTargetData.provider}\0${selectedProjectPath ?? ""}`;
|
|
10548
10723
|
const previousProjectKey = composerOptionsProjectKeyRef.current;
|
|
10549
10724
|
composerOptionsProjectKeyRef.current = projectKey;
|
|
10550
10725
|
if (previousProjectKey === null || previousProjectKey === projectKey) {
|
|
@@ -10552,8 +10727,8 @@ function useAgentGUINodeController({
|
|
|
10552
10727
|
}
|
|
10553
10728
|
loadDraftComposerOptions({ force: true });
|
|
10554
10729
|
}, [
|
|
10555
|
-
|
|
10556
|
-
|
|
10730
|
+
composerTargetData.agentTargetId,
|
|
10731
|
+
composerTargetData.provider,
|
|
10557
10732
|
loadDraftComposerOptions,
|
|
10558
10733
|
previewMode,
|
|
10559
10734
|
selectedProjectPath,
|
|
@@ -10576,7 +10751,7 @@ function useAgentGUINodeController({
|
|
|
10576
10751
|
merge: mergeAgentModelCatalogInvalidationEvents
|
|
10577
10752
|
},
|
|
10578
10753
|
(event) => {
|
|
10579
|
-
const provider = dataRef.current.provider;
|
|
10754
|
+
const provider = activeConversationIdRef.current === null ? selectedComposerTargetDataRef.current.provider : dataRef.current.provider;
|
|
10580
10755
|
const currentActiveConversationId = activeConversationIdRef.current;
|
|
10581
10756
|
if (!event.providers.includes(provider)) {
|
|
10582
10757
|
return;
|
|
@@ -10608,12 +10783,12 @@ function useAgentGUINodeController({
|
|
|
10608
10783
|
return;
|
|
10609
10784
|
}
|
|
10610
10785
|
loadDraftComposerOptions(
|
|
10611
|
-
|
|
10786
|
+
composerTargetData.provider === "claude-code" && isComposerHome ? { force: true } : void 0
|
|
10612
10787
|
);
|
|
10613
10788
|
}, [
|
|
10614
10789
|
activeConversationId,
|
|
10615
|
-
|
|
10616
|
-
|
|
10790
|
+
composerTargetData.agentTargetId,
|
|
10791
|
+
composerTargetData.provider,
|
|
10617
10792
|
isComposerHome,
|
|
10618
10793
|
loadDraftComposerOptions,
|
|
10619
10794
|
previewMode
|
|
@@ -11206,10 +11381,11 @@ function useAgentGUINodeController({
|
|
|
11206
11381
|
const startConversation = useCallback4(
|
|
11207
11382
|
(initialContentInput, displayPrompt) => {
|
|
11208
11383
|
const target = selectedProviderTargetRef.current;
|
|
11209
|
-
|
|
11384
|
+
const targetData = selectedComposerTargetDataRef.current;
|
|
11385
|
+
if (isCreatingConversation || target.disabled === true || targetData.provider === "openclaw" && openclawGateway?.status !== "ready") {
|
|
11210
11386
|
return;
|
|
11211
11387
|
}
|
|
11212
|
-
const agentTargetId =
|
|
11388
|
+
const agentTargetId = targetData.agentTargetId ?? "";
|
|
11213
11389
|
if (!agentTargetId && selectedProviderTargetIsExplicitRef.current) {
|
|
11214
11390
|
setDetailError(translate("agentHost.agentGui.agentTargetRequired"));
|
|
11215
11391
|
return;
|
|
@@ -11219,8 +11395,11 @@ function useAgentGUINodeController({
|
|
|
11219
11395
|
) : textPromptContent(normalizeOptionalPrompt(initialContentInput));
|
|
11220
11396
|
const initialDisplayPrompt = displayPrompt && displayPrompt.trim() ? displayPrompt : void 0;
|
|
11221
11397
|
const normalizedInitialPrompt = initialDisplayPrompt ?? agentPromptContentDisplayText(normalizedInitialContent);
|
|
11222
|
-
const initialConversationTitle = normalizedInitialPrompt || AGENT_PROVIDER_LABEL[
|
|
11223
|
-
const submittedHomeDraftKey = nodeDefaultDraftContentKey(
|
|
11398
|
+
const initialConversationTitle = normalizedInitialPrompt || AGENT_PROVIDER_LABEL[targetData.provider];
|
|
11399
|
+
const submittedHomeDraftKey = nodeDefaultDraftContentKey(
|
|
11400
|
+
targetData.provider,
|
|
11401
|
+
targetData.agentTargetId
|
|
11402
|
+
);
|
|
11224
11403
|
const submittedHomeDraft = draftBySessionIdRef.current[submittedHomeDraftKey] ?? EMPTY_AGENT_COMPOSER_DRAFT;
|
|
11225
11404
|
isCreatingConversationRef.current = true;
|
|
11226
11405
|
setLocalIsCreatingConversation(true);
|
|
@@ -11228,31 +11407,39 @@ function useAgentGUINodeController({
|
|
|
11228
11407
|
let pendingCreateAgentSessionId = null;
|
|
11229
11408
|
let pendingOptimisticConversation = null;
|
|
11230
11409
|
void (async () => {
|
|
11231
|
-
const
|
|
11232
|
-
const
|
|
11233
|
-
const agentTargetId2 = target2.agentTargetId?.trim() ?? "";
|
|
11234
|
-
const shouldUseProviderTargetRef = !agentTargetId2 && selectedProviderTargetIsExplicitRef.current;
|
|
11410
|
+
const provider = targetData.provider;
|
|
11411
|
+
const agentTargetId2 = targetData.agentTargetId ?? "";
|
|
11235
11412
|
onDataChangeRef.current(
|
|
11236
|
-
(current) => current.provider === provider && (current.agentTargetId ?? null) === (agentTargetId2 || null) && (current.providerTargetId ?? null) ===
|
|
11413
|
+
(current) => current.provider === provider && (current.agentTargetId ?? null) === (agentTargetId2 || null) && (current.providerTargetId ?? null) === targetData.providerTargetId && agentGUIProviderTargetRefsEqual(
|
|
11237
11414
|
current.providerTargetRef,
|
|
11238
|
-
|
|
11415
|
+
targetData.providerTargetRef
|
|
11239
11416
|
) ? current : {
|
|
11240
11417
|
...current,
|
|
11241
11418
|
provider,
|
|
11242
11419
|
agentTargetId: agentTargetId2 || null,
|
|
11243
|
-
providerTargetId:
|
|
11244
|
-
providerTargetRef:
|
|
11420
|
+
providerTargetId: targetData.providerTargetId,
|
|
11421
|
+
providerTargetRef: targetData.providerTargetRef
|
|
11245
11422
|
}
|
|
11246
11423
|
);
|
|
11247
|
-
const currentData = dataRef.current.provider === provider ? dataRef.current : data;
|
|
11248
11424
|
const selectedProjectPath2 = selectedProjectPathRef.current;
|
|
11249
11425
|
const initialNodeSettings = readNodeDefaultDraftSettings({
|
|
11250
|
-
data:
|
|
11426
|
+
data: targetData.data,
|
|
11251
11427
|
defaultReasoningEffort,
|
|
11252
11428
|
drafts: draftSettingsBySessionIdRef.current
|
|
11253
11429
|
});
|
|
11430
|
+
const snapshotComposerOptions = composerOptionsForTarget({
|
|
11431
|
+
snapshot: agentActivityRuntime.getSnapshot(workspaceId),
|
|
11432
|
+
target: targetData
|
|
11433
|
+
});
|
|
11434
|
+
const targetSafeInitialNodeSettings = sanitizeComposerSettingsForTarget(
|
|
11435
|
+
{
|
|
11436
|
+
settings: initialNodeSettings,
|
|
11437
|
+
target: targetData,
|
|
11438
|
+
options: snapshotComposerOptions
|
|
11439
|
+
}
|
|
11440
|
+
);
|
|
11254
11441
|
const initialSettings = resolveEffectiveComposerSettings({
|
|
11255
|
-
settings:
|
|
11442
|
+
settings: targetSafeInitialNodeSettings
|
|
11256
11443
|
});
|
|
11257
11444
|
const currentActiveConversationId = activeConversationIdRef.current;
|
|
11258
11445
|
const currentActiveConversation = currentActiveConversationId ? resolveConversationSummaryById(
|
|
@@ -11260,7 +11447,7 @@ function useAgentGUINodeController({
|
|
|
11260
11447
|
currentActiveConversationId,
|
|
11261
11448
|
transientConversationRef.current
|
|
11262
11449
|
) : null;
|
|
11263
|
-
const inheritedModel = normalizeOptionalText2(
|
|
11450
|
+
const inheritedModel = normalizeOptionalText2(targetSafeInitialNodeSettings.model) === null ? resolveSameProviderActiveSessionModel({
|
|
11264
11451
|
activeProvider: currentActiveConversation?.provider ?? null,
|
|
11265
11452
|
agentSessionId: currentActiveConversationId,
|
|
11266
11453
|
provider,
|
|
@@ -11271,7 +11458,11 @@ function useAgentGUINodeController({
|
|
|
11271
11458
|
lastActiveModelByProviderRef.current[provider]
|
|
11272
11459
|
) : null;
|
|
11273
11460
|
const effectiveInitialSettings = inheritedModel === null ? initialSettings : { ...initialSettings, model: inheritedModel };
|
|
11274
|
-
const
|
|
11461
|
+
const targetSafeEffectiveInitialSettings = sanitizeComposerSettingsForTarget({
|
|
11462
|
+
settings: effectiveInitialSettings,
|
|
11463
|
+
target: targetData,
|
|
11464
|
+
options: snapshotComposerOptions
|
|
11465
|
+
});
|
|
11275
11466
|
const snapshotDraftAgentSessionId = normalizedInitialContent.length > 0 && provider === "claude-code" ? draftAgentSessionIdFromComposerOptions(snapshotComposerOptions) : null;
|
|
11276
11467
|
const draftAgentSessionId = snapshotDraftAgentSessionId && !activatedConversationIdsRef.current.has(
|
|
11277
11468
|
snapshotDraftAgentSessionId
|
|
@@ -11334,11 +11525,11 @@ function useAgentGUINodeController({
|
|
|
11334
11525
|
startingConversationIdRef.current = agentSessionId;
|
|
11335
11526
|
draftSettingsBySessionIdRef.current = {
|
|
11336
11527
|
...draftSettingsBySessionIdRef.current,
|
|
11337
|
-
[agentSessionId]:
|
|
11528
|
+
[agentSessionId]: targetSafeEffectiveInitialSettings
|
|
11338
11529
|
};
|
|
11339
11530
|
setDraftSettingsBySessionId((current) => ({
|
|
11340
11531
|
...current,
|
|
11341
|
-
[agentSessionId]:
|
|
11532
|
+
[agentSessionId]: targetSafeEffectiveInitialSettings
|
|
11342
11533
|
}));
|
|
11343
11534
|
const optimisticPromptMessage = createOptimisticPromptMessage({
|
|
11344
11535
|
workspaceId,
|
|
@@ -11372,13 +11563,13 @@ function useAgentGUINodeController({
|
|
|
11372
11563
|
agentSessionId,
|
|
11373
11564
|
agentTargetId: agentTargetId2 || null,
|
|
11374
11565
|
provider,
|
|
11375
|
-
providerTargetRef:
|
|
11566
|
+
providerTargetRef: targetData.providerTargetRef,
|
|
11376
11567
|
cwd: selectedProjectPath2 ?? "",
|
|
11377
11568
|
initialContent: normalizedInitialContent,
|
|
11378
11569
|
initialDisplayPrompt,
|
|
11379
11570
|
metadata: agentSubmitTraceMetadata(submitTrace),
|
|
11380
11571
|
title: initialConversationTitle,
|
|
11381
|
-
settings:
|
|
11572
|
+
settings: targetSafeEffectiveInitialSettings,
|
|
11382
11573
|
openclawGatewayReady: provider === "openclaw" ? openclawGateway?.status === "ready" : void 0
|
|
11383
11574
|
});
|
|
11384
11575
|
})().then((result) => {
|
|
@@ -11701,9 +11892,13 @@ function useAgentGUINodeController({
|
|
|
11701
11892
|
setActiveConversationId(null);
|
|
11702
11893
|
setIsLoadingMessages(false);
|
|
11703
11894
|
setDetailError(null);
|
|
11895
|
+
const targetData = selectedComposerTargetDataRef.current;
|
|
11704
11896
|
setDraftBySessionId((current) => ({
|
|
11705
11897
|
...current,
|
|
11706
|
-
[nodeDefaultDraftContentKey(
|
|
11898
|
+
[nodeDefaultDraftContentKey(
|
|
11899
|
+
targetData.provider,
|
|
11900
|
+
targetData.agentTargetId
|
|
11901
|
+
)]: {
|
|
11707
11902
|
...emptyAgentComposerDraft(),
|
|
11708
11903
|
prompt: draftPrompt2
|
|
11709
11904
|
}
|
|
@@ -11766,9 +11961,13 @@ function useAgentGUINodeController({
|
|
|
11766
11961
|
setActiveConversationId(null);
|
|
11767
11962
|
setIsLoadingMessages(false);
|
|
11768
11963
|
setDetailError(null);
|
|
11964
|
+
const targetData = selectedComposerTargetDataRef.current;
|
|
11769
11965
|
setDraftBySessionId((current) => ({
|
|
11770
11966
|
...current,
|
|
11771
|
-
[nodeDefaultDraftContentKey(
|
|
11967
|
+
[nodeDefaultDraftContentKey(
|
|
11968
|
+
targetData.provider,
|
|
11969
|
+
targetData.agentTargetId
|
|
11970
|
+
)]: {
|
|
11772
11971
|
prompt: nextDraftPrompt,
|
|
11773
11972
|
images: []
|
|
11774
11973
|
}
|
|
@@ -12560,7 +12759,8 @@ function useAgentGUINodeController({
|
|
|
12560
12759
|
}, [activeConversationId]);
|
|
12561
12760
|
const updateDraftContent = useCallback4((draftContent2) => {
|
|
12562
12761
|
const agentSessionId = activeConversationIdRef.current;
|
|
12563
|
-
const
|
|
12762
|
+
const targetData = selectedComposerTargetDataRef.current;
|
|
12763
|
+
const draftKey = agentSessionId ?? nodeDefaultDraftContentKey(targetData.provider, targetData.agentTargetId);
|
|
12564
12764
|
draftBySessionIdRef.current = {
|
|
12565
12765
|
...draftBySessionIdRef.current,
|
|
12566
12766
|
[draftKey]: draftContent2
|
|
@@ -12658,12 +12858,13 @@ function useAgentGUINodeController({
|
|
|
12658
12858
|
};
|
|
12659
12859
|
const agentSessionId = activeConversationIdRef.current;
|
|
12660
12860
|
if (!agentSessionId) {
|
|
12861
|
+
const targetData = selectedComposerTargetDataRef.current;
|
|
12661
12862
|
const defaultDraftKey = nodeDefaultDraftKey(
|
|
12662
|
-
|
|
12663
|
-
|
|
12863
|
+
targetData.provider,
|
|
12864
|
+
targetData.agentTargetId
|
|
12664
12865
|
);
|
|
12665
12866
|
const storedDefaults = readNodeDefaultDraftSettings({
|
|
12666
|
-
data:
|
|
12867
|
+
data: targetData.data,
|
|
12667
12868
|
defaultReasoningEffort,
|
|
12668
12869
|
drafts: draftSettingsBySessionIdRef.current
|
|
12669
12870
|
});
|
|
@@ -12677,29 +12878,47 @@ function useAgentGUINodeController({
|
|
|
12677
12878
|
browserUse: supportedNextSettings.browserUse ?? previousSettings.browserUse,
|
|
12678
12879
|
computerUse: supportedNextSettings.computerUse ?? previousSettings.computerUse
|
|
12679
12880
|
};
|
|
12881
|
+
const snapshotComposerOptions = composerOptionsForTarget({
|
|
12882
|
+
snapshot: agentActivityRuntime.getSnapshot(workspaceId),
|
|
12883
|
+
target: targetData
|
|
12884
|
+
});
|
|
12885
|
+
const targetSafeMerged = sanitizeComposerSettingsForTarget({
|
|
12886
|
+
settings: merged,
|
|
12887
|
+
target: targetData,
|
|
12888
|
+
options: snapshotComposerOptions
|
|
12889
|
+
});
|
|
12680
12890
|
draftSettingsBySessionIdRef.current = {
|
|
12681
12891
|
...draftSettingsBySessionIdRef.current,
|
|
12682
|
-
[defaultDraftKey]:
|
|
12892
|
+
[defaultDraftKey]: targetSafeMerged
|
|
12683
12893
|
};
|
|
12684
12894
|
setDraftSettingsBySessionId((current) => ({
|
|
12685
12895
|
...current,
|
|
12686
|
-
[defaultDraftKey]:
|
|
12896
|
+
[defaultDraftKey]: targetSafeMerged
|
|
12687
12897
|
}));
|
|
12688
12898
|
onDataChangeRef.current(
|
|
12689
|
-
(current) => nodeDataFromComposerSettings(
|
|
12899
|
+
(current) => nodeDataFromComposerSettings(
|
|
12900
|
+
{
|
|
12901
|
+
...current,
|
|
12902
|
+
provider: targetData.provider,
|
|
12903
|
+
agentTargetId: targetData.agentTargetId,
|
|
12904
|
+
providerTargetId: targetData.providerTargetId,
|
|
12905
|
+
providerTargetRef: targetData.providerTargetRef
|
|
12906
|
+
},
|
|
12907
|
+
targetSafeMerged
|
|
12908
|
+
)
|
|
12690
12909
|
);
|
|
12691
12910
|
void onRememberComposerDefaultsRef.current?.({
|
|
12692
|
-
provider:
|
|
12693
|
-
defaults: composerDefaultsFromSettings(
|
|
12911
|
+
provider: targetData.provider,
|
|
12912
|
+
defaults: composerDefaultsFromSettings(targetSafeMerged)
|
|
12694
12913
|
});
|
|
12695
12914
|
void agentActivityRuntime.trackDraftComposerSettingsChange?.({
|
|
12696
12915
|
workspaceId,
|
|
12697
|
-
provider:
|
|
12916
|
+
provider: targetData.provider,
|
|
12698
12917
|
previousSettings,
|
|
12699
|
-
nextSettings:
|
|
12918
|
+
nextSettings: targetSafeMerged
|
|
12700
12919
|
});
|
|
12701
12920
|
loadDraftComposerOptions(
|
|
12702
|
-
|
|
12921
|
+
targetData.provider === "claude-code" ? { force: true } : void 0
|
|
12703
12922
|
);
|
|
12704
12923
|
return;
|
|
12705
12924
|
}
|
|
@@ -13545,7 +13764,7 @@ function useAgentGUINodeController({
|
|
|
13545
13764
|
activeSessionState?.turnLifecycle?.settling
|
|
13546
13765
|
]);
|
|
13547
13766
|
const draftContent = activeConversationId ? draftBySessionId[activeConversationId] ?? EMPTY_AGENT_COMPOSER_DRAFT : readNodeDefaultDraftContent({
|
|
13548
|
-
data,
|
|
13767
|
+
data: selectedComposerTargetData.data,
|
|
13549
13768
|
drafts: draftBySessionId
|
|
13550
13769
|
});
|
|
13551
13770
|
const draftPrompt = draftContent.prompt;
|
|
@@ -13707,16 +13926,65 @@ function useAgentGUINodeController({
|
|
|
13707
13926
|
);
|
|
13708
13927
|
const storedNodeDefaultSettings = useStableComposerSettings(
|
|
13709
13928
|
readNodeDefaultDraftSettings({
|
|
13710
|
-
data,
|
|
13929
|
+
data: activeConversationId === null ? selectedComposerTargetData.data : data,
|
|
13711
13930
|
defaultReasoningEffort,
|
|
13712
13931
|
drafts: draftSettingsBySessionId
|
|
13713
13932
|
})
|
|
13714
13933
|
);
|
|
13934
|
+
const targetSafeNodeDefaultSettings = useStableComposerSettings(
|
|
13935
|
+
activeConversationId === null ? sanitizeComposerSettingsForTarget({
|
|
13936
|
+
settings: storedNodeDefaultSettings,
|
|
13937
|
+
target: selectedComposerTargetData,
|
|
13938
|
+
options: providerComposerOptions
|
|
13939
|
+
}) : storedNodeDefaultSettings
|
|
13940
|
+
);
|
|
13715
13941
|
const homeComposerSettings = useStableComposerSettings(
|
|
13716
13942
|
resolveEffectiveComposerSettings({
|
|
13717
|
-
settings:
|
|
13943
|
+
settings: targetSafeNodeDefaultSettings
|
|
13718
13944
|
})
|
|
13719
13945
|
);
|
|
13946
|
+
useEffect4(() => {
|
|
13947
|
+
if (activeConversationId !== null || !selectedComposerTargetData.agentTargetId || !providerComposerOptions || sameComposerSettings(
|
|
13948
|
+
storedNodeDefaultSettings,
|
|
13949
|
+
targetSafeNodeDefaultSettings
|
|
13950
|
+
)) {
|
|
13951
|
+
return;
|
|
13952
|
+
}
|
|
13953
|
+
const targetDefaultDraftKey = nodeDefaultDraftKey(
|
|
13954
|
+
selectedComposerTargetData.provider,
|
|
13955
|
+
selectedComposerTargetData.agentTargetId
|
|
13956
|
+
);
|
|
13957
|
+
draftSettingsBySessionIdRef.current = {
|
|
13958
|
+
...draftSettingsBySessionIdRef.current,
|
|
13959
|
+
[targetDefaultDraftKey]: targetSafeNodeDefaultSettings
|
|
13960
|
+
};
|
|
13961
|
+
setDraftSettingsBySessionId((current) => ({
|
|
13962
|
+
...current,
|
|
13963
|
+
[targetDefaultDraftKey]: targetSafeNodeDefaultSettings
|
|
13964
|
+
}));
|
|
13965
|
+
onDataChangeRef.current(
|
|
13966
|
+
(current) => nodeDataFromComposerSettings(
|
|
13967
|
+
{
|
|
13968
|
+
...current,
|
|
13969
|
+
provider: selectedComposerTargetData.provider,
|
|
13970
|
+
agentTargetId: selectedComposerTargetData.agentTargetId,
|
|
13971
|
+
providerTargetId: selectedComposerTargetData.providerTargetId,
|
|
13972
|
+
providerTargetRef: selectedComposerTargetData.providerTargetRef
|
|
13973
|
+
},
|
|
13974
|
+
targetSafeNodeDefaultSettings
|
|
13975
|
+
)
|
|
13976
|
+
);
|
|
13977
|
+
void onRememberComposerDefaultsRef.current?.({
|
|
13978
|
+
provider: selectedComposerTargetData.provider,
|
|
13979
|
+
defaults: composerDefaultsFromSettings(targetSafeNodeDefaultSettings)
|
|
13980
|
+
});
|
|
13981
|
+
}, [
|
|
13982
|
+
activeConversationId,
|
|
13983
|
+
providerComposerOptions,
|
|
13984
|
+
selectedComposerTargetData,
|
|
13985
|
+
storedNodeDefaultSettings,
|
|
13986
|
+
targetSafeNodeDefaultSettings
|
|
13987
|
+
]);
|
|
13720
13988
|
const activeConversationDraftSettings = activeConversationId ? draftSettingsBySessionId[activeConversationId] ?? null : null;
|
|
13721
13989
|
const defaultConversationDraftSettings = useStableComposerSettings({
|
|
13722
13990
|
...activeConversationDraftSettings ?? homeComposerSettings,
|
|
@@ -13807,7 +14075,7 @@ function useAgentGUINodeController({
|
|
|
13807
14075
|
hasProviderSessionNotFoundError,
|
|
13808
14076
|
pendingApproval
|
|
13809
14077
|
]);
|
|
13810
|
-
const canSubmit = !providerTargetsLoading && activeLiveState !== "activating" && activeLiveState !== "failed" && !activeConversationResumeUnavailable && (activeConversationId !== null ||
|
|
14078
|
+
const canSubmit = !providerTargetsLoading && activeLiveState !== "activating" && activeLiveState !== "failed" && !activeConversationResumeUnavailable && (activeConversationId !== null || effectiveSelectedProviderTarget.disabled !== true) && (composerTargetData.provider !== "openclaw" || openclawGateway?.status === "ready") && pendingApproval === null && pendingInteractivePrompt === null && sessionChrome.auth === null && !isCreatingConversation && !isSubmitting && !isInterrupting;
|
|
13811
14079
|
const canQueueWhileBusy = Boolean(activeConversationId) && (activeConversationBusy || isSubmitting || Boolean(activeSessionState?.pendingInteractive));
|
|
13812
14080
|
useEffect4(() => {
|
|
13813
14081
|
const firstVersion = minFiniteMessageVersion(activeMessages);
|
|
@@ -13921,7 +14189,9 @@ function useAgentGUINodeController({
|
|
|
13921
14189
|
"models"
|
|
13922
14190
|
);
|
|
13923
14191
|
const optionsLoading = isSettingsLoading || isModelOptionsLoading;
|
|
13924
|
-
const providerSupport = composerSupportForProvider(
|
|
14192
|
+
const providerSupport = composerSupportForProvider(
|
|
14193
|
+
composerTargetData.provider
|
|
14194
|
+
);
|
|
13925
14195
|
const selectedModelValue = draftModel;
|
|
13926
14196
|
const selectedReasoningEffortValue = draftReasoningEffort;
|
|
13927
14197
|
const selectedSpeedValue = draftSpeed;
|
|
@@ -13946,7 +14216,7 @@ function useAgentGUINodeController({
|
|
|
13946
14216
|
supportsComputerUse: composerSupport.computer,
|
|
13947
14217
|
supportsPermissionMode: supportsPermissionMode || optionsLoading && providerSupport.permission,
|
|
13948
14218
|
supportsPlanMode: composerSupport.plan,
|
|
13949
|
-
planExclusiveWithPermissionMode:
|
|
14219
|
+
planExclusiveWithPermissionMode: composerTargetData.provider === "claude-code",
|
|
13950
14220
|
isSettingsLoading,
|
|
13951
14221
|
isModelOptionsLoading,
|
|
13952
14222
|
modelUnavailable: activeConversationId !== null && sessionSettings === null && composerSupport.model && draftModel === null,
|
|
@@ -13963,7 +14233,7 @@ function useAgentGUINodeController({
|
|
|
13963
14233
|
availableModels: composerSupport.model && hasOptionsSource && activeSessionModelSelection !== null ? activeSessionModelSelection.options : [],
|
|
13964
14234
|
availableReasoningEfforts: composerSupport.reasoning && hasOptionsSource && activeSessionReasoningSelection !== null ? activeSessionReasoningSelection.options : [],
|
|
13965
14235
|
availableSpeeds: composerSupport.speed && hasOptionsSource && activeSessionSpeedSelection !== null ? activeSessionSpeedSelection.options : [],
|
|
13966
|
-
availablePermissionModes: supportsPermissionMode ? permissionModeOptions(
|
|
14236
|
+
availablePermissionModes: supportsPermissionMode ? permissionModeOptions(composerTargetData.provider, permissionConfig) : []
|
|
13967
14237
|
};
|
|
13968
14238
|
}, [
|
|
13969
14239
|
activeConversationId,
|
|
@@ -13972,7 +14242,7 @@ function useAgentGUINodeController({
|
|
|
13972
14242
|
activeSessionReasoningSelection,
|
|
13973
14243
|
activeSessionSpeedSelection,
|
|
13974
14244
|
activeSessionRuntimeContext,
|
|
13975
|
-
|
|
14245
|
+
composerTargetData.provider,
|
|
13976
14246
|
draftSettings.permissionModeId,
|
|
13977
14247
|
draftSettings.planMode,
|
|
13978
14248
|
providerComposerOptions,
|
|
@@ -13984,19 +14254,6 @@ function useAgentGUINodeController({
|
|
|
13984
14254
|
draftSpeed
|
|
13985
14255
|
]);
|
|
13986
14256
|
const stableComposerSettings = useStableComposerSettingsVM(composerSettings);
|
|
13987
|
-
const prevSettingsLoadingRef = useRef4(null);
|
|
13988
|
-
useEffect4(() => {
|
|
13989
|
-
const nextLoading = stableComposerSettings.isSettingsLoading;
|
|
13990
|
-
if (prevSettingsLoadingRef.current === nextLoading) {
|
|
13991
|
-
return;
|
|
13992
|
-
}
|
|
13993
|
-
prevSettingsLoadingRef.current = nextLoading;
|
|
13994
|
-
}, [
|
|
13995
|
-
activeConversationId,
|
|
13996
|
-
data.provider,
|
|
13997
|
-
stableComposerSettings.availableModels.length,
|
|
13998
|
-
stableComposerSettings.isSettingsLoading
|
|
13999
|
-
]);
|
|
14000
14257
|
const updateConversationFilter = useCallback4(
|
|
14001
14258
|
(filter) => {
|
|
14002
14259
|
if (!canUseConversationTargetFilter) {
|
|
@@ -14026,9 +14283,15 @@ function useAgentGUINodeController({
|
|
|
14026
14283
|
if (nextTarget.disabled === true) {
|
|
14027
14284
|
return;
|
|
14028
14285
|
}
|
|
14029
|
-
const
|
|
14286
|
+
const nextTargetIsExplicit = normalizedExplicitProviderTargets.some(
|
|
14030
14287
|
(target) => target.provider === nextTarget.provider && target.targetId === nextTarget.targetId && agentGUIProviderTargetRefsEqual(target.ref, nextTarget.ref)
|
|
14031
14288
|
);
|
|
14289
|
+
const nextTargetData = composerTargetDataFromProviderTarget({
|
|
14290
|
+
current: dataRef.current,
|
|
14291
|
+
isExplicit: nextTargetIsExplicit,
|
|
14292
|
+
target: nextTarget
|
|
14293
|
+
});
|
|
14294
|
+
setHomeComposerTargetOverride(nextTarget);
|
|
14032
14295
|
const previous = activeConversationIdRef.current;
|
|
14033
14296
|
if (previous) {
|
|
14034
14297
|
void activation.unactivate(previous);
|
|
@@ -14042,26 +14305,33 @@ function useAgentGUINodeController({
|
|
|
14042
14305
|
setDetailError(null);
|
|
14043
14306
|
persistActiveConversation(null);
|
|
14044
14307
|
onDataChangeRef.current((current) => {
|
|
14045
|
-
const
|
|
14308
|
+
const currentNextTargetData = composerTargetDataFromProviderTarget({
|
|
14309
|
+
current,
|
|
14310
|
+
isExplicit: nextTargetIsExplicit,
|
|
14311
|
+
target: nextTarget
|
|
14312
|
+
});
|
|
14313
|
+
const nextAgentTargetId = currentNextTargetData.agentTargetId;
|
|
14314
|
+
const currentTargetId = current.agentTargetId ?? current.providerTargetId ?? null;
|
|
14315
|
+
const nextTargetId = nextAgentTargetId ?? nextTarget.targetId;
|
|
14316
|
+
const providerTargetChanged = current.provider !== nextProvider || (currentTargetId !== null || nextAgentTargetId !== null) && currentTargetId !== nextTargetId;
|
|
14046
14317
|
const nextData = {
|
|
14047
14318
|
...current,
|
|
14048
|
-
provider:
|
|
14049
|
-
agentTargetId:
|
|
14319
|
+
provider: currentNextTargetData.provider,
|
|
14320
|
+
agentTargetId: currentNextTargetData.agentTargetId,
|
|
14050
14321
|
lastActiveAgentSessionId: null,
|
|
14051
|
-
providerTargetId:
|
|
14052
|
-
providerTargetRef:
|
|
14322
|
+
providerTargetId: currentNextTargetData.providerTargetId,
|
|
14323
|
+
providerTargetRef: currentNextTargetData.providerTargetRef,
|
|
14324
|
+
composerOverrides: providerTargetChanged ? null : current.composerOverrides
|
|
14053
14325
|
};
|
|
14054
14326
|
dataRef.current = nextData;
|
|
14055
14327
|
return nextData;
|
|
14056
14328
|
});
|
|
14057
|
-
|
|
14058
|
-
loadDraftComposerOptions({ force: true });
|
|
14059
|
-
}, 0);
|
|
14329
|
+
loadComposerOptionsForTarget(nextTargetData, { force: true });
|
|
14060
14330
|
},
|
|
14061
14331
|
[
|
|
14062
14332
|
activation,
|
|
14063
14333
|
defaultProviderTargetId,
|
|
14064
|
-
|
|
14334
|
+
loadComposerOptionsForTarget,
|
|
14065
14335
|
normalizedExplicitProviderTargets,
|
|
14066
14336
|
normalizedProviderTargets,
|
|
14067
14337
|
persistActiveConversation,
|
|
@@ -14088,16 +14358,11 @@ function useAgentGUINodeController({
|
|
|
14088
14358
|
const agentTargetId = nextTarget.agentTargetId?.trim() ?? "";
|
|
14089
14359
|
const nextFilter = agentTargetId ? { kind: "agentTarget", agentTargetId } : { kind: "all" };
|
|
14090
14360
|
setConversationFilter(nextFilter);
|
|
14091
|
-
selectProvider({
|
|
14092
|
-
provider: nextTarget.provider,
|
|
14093
|
-
providerTargetId: nextTarget.targetId
|
|
14094
|
-
});
|
|
14095
14361
|
},
|
|
14096
14362
|
[
|
|
14097
14363
|
canUseConversationTargetFilter,
|
|
14098
14364
|
defaultProviderTargetId,
|
|
14099
14365
|
normalizedProviderTargets,
|
|
14100
|
-
selectProvider,
|
|
14101
14366
|
shouldFallbackToLocalProviderTargets
|
|
14102
14367
|
]
|
|
14103
14368
|
);
|
|
@@ -14159,6 +14424,7 @@ function useAgentGUINodeController({
|
|
|
14159
14424
|
const stableUpdateConversationFilter = useStableControllerEventCallback(
|
|
14160
14425
|
updateConversationFilter
|
|
14161
14426
|
);
|
|
14427
|
+
const viewData = activeConversationId === null ? selectedComposerTargetData.data : data;
|
|
14162
14428
|
const controllerActions = useMemo4(
|
|
14163
14429
|
() => ({
|
|
14164
14430
|
updateConversationFilter: stableUpdateConversationFilter,
|
|
@@ -14231,8 +14497,8 @@ function useAgentGUINodeController({
|
|
|
14231
14497
|
workspaceId,
|
|
14232
14498
|
workspacePath,
|
|
14233
14499
|
currentUserId,
|
|
14234
|
-
data,
|
|
14235
|
-
selectedProviderTarget,
|
|
14500
|
+
data: viewData,
|
|
14501
|
+
selectedProviderTarget: effectiveSelectedProviderTarget,
|
|
14236
14502
|
providerTargets: normalizedProviderTargets,
|
|
14237
14503
|
providerTargetsLoading,
|
|
14238
14504
|
conversationScope,
|
|
@@ -14304,7 +14570,7 @@ function useAgentGUINodeController({
|
|
|
14304
14570
|
conversationDetail,
|
|
14305
14571
|
controllerActions,
|
|
14306
14572
|
data,
|
|
14307
|
-
|
|
14573
|
+
effectiveSelectedProviderTarget,
|
|
14308
14574
|
normalizedProviderTargets,
|
|
14309
14575
|
providerTargetsLoading,
|
|
14310
14576
|
detailError,
|
|
@@ -14332,7 +14598,7 @@ function useAgentGUINodeController({
|
|
|
14332
14598
|
pendingDeleteProjectConversations,
|
|
14333
14599
|
pendingApproval,
|
|
14334
14600
|
pendingInteractivePrompt,
|
|
14335
|
-
|
|
14601
|
+
effectiveSelectedProviderTarget.disabled,
|
|
14336
14602
|
queuedPrompts,
|
|
14337
14603
|
drainingQueuedPromptId,
|
|
14338
14604
|
currentUserId,
|
|
@@ -14340,6 +14606,7 @@ function useAgentGUINodeController({
|
|
|
14340
14606
|
workspacePath,
|
|
14341
14607
|
stableComposerSettings,
|
|
14342
14608
|
sessionChrome,
|
|
14609
|
+
viewData,
|
|
14343
14610
|
userProjects,
|
|
14344
14611
|
visibleConversations
|
|
14345
14612
|
]
|
|
@@ -18220,6 +18487,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18220
18487
|
const removeMentionLabelRef = useRef8(removeMentionLabel);
|
|
18221
18488
|
const availableSkillsRef = useRef8(availableSkills);
|
|
18222
18489
|
const availableCapabilitiesRef = useRef8(availableCapabilities);
|
|
18490
|
+
const suppressPastedAtSuggestionRef = useRef8(false);
|
|
18223
18491
|
const scrollFrameRef = useRef8(null);
|
|
18224
18492
|
const [contextMenu, setContextMenu] = useState7(null);
|
|
18225
18493
|
const closeContextMenu = useCallback6(() => {
|
|
@@ -18230,6 +18498,12 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18230
18498
|
if (!currentEditor || currentEditor.isDestroyed || !text) {
|
|
18231
18499
|
return;
|
|
18232
18500
|
}
|
|
18501
|
+
suppressPastedAtSuggestionRef.current = text.includes("@") && !text.endsWith("@");
|
|
18502
|
+
if (suppressPastedAtSuggestionRef.current) {
|
|
18503
|
+
window.setTimeout(() => {
|
|
18504
|
+
suppressPastedAtSuggestionRef.current = false;
|
|
18505
|
+
}, 0);
|
|
18506
|
+
}
|
|
18233
18507
|
currentEditor.chain().focus().insertContent(
|
|
18234
18508
|
plainTextToAgentRichTextInlineContent(text, {
|
|
18235
18509
|
capabilities: availableCapabilitiesRef.current,
|
|
@@ -18303,7 +18577,8 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18303
18577
|
enableSuggestions: enableFileMentionSuggestions,
|
|
18304
18578
|
onSuggestionChange: (state) => onFileMentionSuggestionChangeRef.current?.(state),
|
|
18305
18579
|
onSuggestionKeyDown: (event) => onFileMentionSuggestionKeyDownRef.current?.(event) ?? false,
|
|
18306
|
-
removeActionAriaLabel: removeMentionLabelRef.current
|
|
18580
|
+
removeActionAriaLabel: removeMentionLabelRef.current,
|
|
18581
|
+
shouldSuppressSuggestion: () => suppressPastedAtSuggestionRef.current
|
|
18307
18582
|
},
|
|
18308
18583
|
{ skills: availableSkillsRef.current },
|
|
18309
18584
|
{ capabilities: availableCapabilitiesRef.current }
|
|
@@ -18491,6 +18766,12 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
18491
18766
|
currentEditor.state.doc.content.size
|
|
18492
18767
|
);
|
|
18493
18768
|
}
|
|
18769
|
+
suppressPastedAtSuggestionRef.current = text.includes("@") && !text.endsWith("@");
|
|
18770
|
+
if (suppressPastedAtSuggestionRef.current) {
|
|
18771
|
+
window.setTimeout(() => {
|
|
18772
|
+
suppressPastedAtSuggestionRef.current = false;
|
|
18773
|
+
}, 0);
|
|
18774
|
+
}
|
|
18494
18775
|
currentEditor.commands.insertContent(
|
|
18495
18776
|
plainTextToAgentRichTextInlineContent(text, {
|
|
18496
18777
|
capabilities: availableCapabilitiesRef.current,
|
|
@@ -19837,7 +20118,7 @@ function AgentUsageChip({
|
|
|
19837
20118
|
var composerStyles = {
|
|
19838
20119
|
footerGroup: AgentGUINode_styles_default.composerFooterLeft,
|
|
19839
20120
|
footerGroupRight: AgentGUINode_styles_default.composerFooterRight,
|
|
19840
|
-
dropdownSurface: "nodrag isolate rounded-[12px] border border-hairline bg-background-fronted p-[4px] text-foreground shadow-[var(--
|
|
20121
|
+
dropdownSurface: "nodrag isolate rounded-[12px] border border-hairline bg-background-fronted p-[4px] text-foreground shadow-[var(--shadow-panel)] [-webkit-app-region:no-drag]"
|
|
19841
20122
|
};
|
|
19842
20123
|
var workspaceReferenceSelectValue = "__tutti_workspace_reference_idle__";
|
|
19843
20124
|
var workspaceReferenceOptionValue = "__tutti_workspace_reference_add__";
|
|
@@ -23051,6 +23332,8 @@ function AgentGUINodeView({
|
|
|
23051
23332
|
isAgentProviderReady,
|
|
23052
23333
|
slashStatusLimits = [],
|
|
23053
23334
|
slashStatusLimitsLoading = false,
|
|
23335
|
+
railConfigProvider,
|
|
23336
|
+
railSlashStatusLimits,
|
|
23054
23337
|
previewMode = false,
|
|
23055
23338
|
onAgentProviderLogin,
|
|
23056
23339
|
actions,
|
|
@@ -23393,9 +23676,14 @@ function AgentGUINodeView({
|
|
|
23393
23676
|
"--agent-gui-detail-min-width": `${detailMinWidthPx}px`,
|
|
23394
23677
|
gridTemplateColumns: conversationRailCollapsed ? "0 minmax(var(--agent-gui-detail-min-width), 1fr)" : "var(--agent-gui-conversation-rail-width) minmax(var(--agent-gui-detail-min-width), 1fr)"
|
|
23395
23678
|
};
|
|
23679
|
+
const effectiveRailConfigProvider = railConfigProvider === void 0 ? viewModel.data.provider : railConfigProvider;
|
|
23680
|
+
const effectiveRailSlashStatusLimits = railSlashStatusLimits ?? slashStatusLimits;
|
|
23396
23681
|
const openAgentEnvSetup = useCallback10(() => {
|
|
23397
|
-
|
|
23398
|
-
|
|
23682
|
+
if (!effectiveRailConfigProvider) {
|
|
23683
|
+
return;
|
|
23684
|
+
}
|
|
23685
|
+
openAgentEnvPanel({ provider: effectiveRailConfigProvider, focus: null });
|
|
23686
|
+
}, [effectiveRailConfigProvider]);
|
|
23399
23687
|
const conversationRailStoreState = useMemo10(
|
|
23400
23688
|
() => ({
|
|
23401
23689
|
activeConversationId: viewModel.activeConversationId,
|
|
@@ -23410,7 +23698,8 @@ function AgentGUINodeView({
|
|
|
23410
23698
|
createConversationDisabled,
|
|
23411
23699
|
openclawGateway,
|
|
23412
23700
|
isCollapsed: conversationRailCollapsed,
|
|
23413
|
-
|
|
23701
|
+
railConfigProvider: effectiveRailConfigProvider,
|
|
23702
|
+
slashStatusLimits: effectiveRailSlashStatusLimits,
|
|
23414
23703
|
selectedProviderTarget: viewModel.selectedProviderTarget,
|
|
23415
23704
|
providerTargets: viewModel.providerTargets,
|
|
23416
23705
|
providerTargetsLoading: viewModel.providerTargetsLoading,
|
|
@@ -23453,7 +23742,8 @@ function AgentGUINodeView({
|
|
|
23453
23742
|
retryOpenclawGateway,
|
|
23454
23743
|
selectConversation,
|
|
23455
23744
|
selectProjectDirectory,
|
|
23456
|
-
|
|
23745
|
+
effectiveRailConfigProvider,
|
|
23746
|
+
effectiveRailSlashStatusLimits,
|
|
23457
23747
|
viewModel.selectedProviderTarget,
|
|
23458
23748
|
viewModel.providerTargets,
|
|
23459
23749
|
viewModel.providerTargetsLoading,
|
|
@@ -24353,6 +24643,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24353
24643
|
}),
|
|
24354
24644
|
[bottomDockComposerProps]
|
|
24355
24645
|
);
|
|
24646
|
+
const emptyHeroProvider = viewModel.selectedProviderTarget?.provider ?? viewModel.data.provider;
|
|
24356
24647
|
const bottomDockStoreState = useMemo10(
|
|
24357
24648
|
() => ({
|
|
24358
24649
|
// The lifted prompt is rendered from props on the pane; the store still
|
|
@@ -24637,7 +24928,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
|
|
|
24637
24928
|
children: !hasActiveConversation ? /* @__PURE__ */ jsx31(
|
|
24638
24929
|
AgentGUIEmptyHeroPane,
|
|
24639
24930
|
{
|
|
24640
|
-
provider:
|
|
24931
|
+
provider: emptyHeroProvider,
|
|
24641
24932
|
emptyLabel: labels.empty,
|
|
24642
24933
|
emptyProvider: labels.emptyProvider ?? "",
|
|
24643
24934
|
inlineNoticeChrome,
|
|
@@ -24964,7 +25255,7 @@ function syncAgentGUIConversationRailStore(store, next) {
|
|
|
24964
25255
|
Object.assign(store, next);
|
|
24965
25256
|
}
|
|
24966
25257
|
function agentGUIConversationRailStoreSnapshotsEqual(current, next) {
|
|
24967
|
-
return current.activeConversationId === next.activeConversationId && current.pendingDeleteConversationId === next.pendingDeleteConversationId && current.isLoadingConversations === next.isLoadingConversations && current.isDeletingConversation === next.isDeletingConversation && current.isDeletingProjectConversations === next.isDeletingProjectConversations && current.labels === next.labels && current.workspaceUserProjectI18n === next.workspaceUserProjectI18n && current.uiLanguage === next.uiLanguage && current.previewMode === next.previewMode && current.createConversationDisabled === next.createConversationDisabled && current.openclawGateway === next.openclawGateway && current.isCollapsed === next.isCollapsed && current.selectedProviderTarget === next.selectedProviderTarget && current.providerTargets === next.providerTargets && current.providerTargetsLoading === next.providerTargetsLoading && current.conversationScope === next.conversationScope && current.conversationFilter === next.conversationFilter && current.onUpdateConversationFilter === next.onUpdateConversationFilter && current.onSelectConversationFilterTarget === next.onSelectConversationFilterTarget && current.onCreateConversation === next.onCreateConversation && current.onOpenAgentEnvSetup === next.onOpenAgentEnvSetup && current.onRetryOpenclawGateway === next.onRetryOpenclawGateway && current.onSelectConversation === next.onSelectConversation && current.onToggleConversationPinned === next.onToggleConversationPinned && current.onOpenProjectFiles === next.onOpenProjectFiles && current.onOpenConversationWindow === next.onOpenConversationWindow && current.selectProjectDirectory === next.selectProjectDirectory && current.onRemoveProject === next.onRemoveProject && current.onConfirmDeleteProjectConversations === next.onConfirmDeleteProjectConversations && current.onRequestDeleteConversation === next.onRequestDeleteConversation && current.onCancelDeleteConversation === next.onCancelDeleteConversation && current.onConfirmDeleteConversation === next.onConfirmDeleteConversation;
|
|
25258
|
+
return current.activeConversationId === next.activeConversationId && current.pendingDeleteConversationId === next.pendingDeleteConversationId && current.isLoadingConversations === next.isLoadingConversations && current.isDeletingConversation === next.isDeletingConversation && current.isDeletingProjectConversations === next.isDeletingProjectConversations && current.labels === next.labels && current.workspaceUserProjectI18n === next.workspaceUserProjectI18n && current.uiLanguage === next.uiLanguage && current.previewMode === next.previewMode && current.createConversationDisabled === next.createConversationDisabled && current.openclawGateway === next.openclawGateway && current.isCollapsed === next.isCollapsed && current.railConfigProvider === next.railConfigProvider && current.slashStatusLimits === next.slashStatusLimits && current.selectedProviderTarget === next.selectedProviderTarget && current.providerTargets === next.providerTargets && current.providerTargetsLoading === next.providerTargetsLoading && current.conversationScope === next.conversationScope && current.conversationFilter === next.conversationFilter && current.onUpdateConversationFilter === next.onUpdateConversationFilter && current.onSelectConversationFilterTarget === next.onSelectConversationFilterTarget && current.onCreateConversation === next.onCreateConversation && current.onOpenAgentEnvSetup === next.onOpenAgentEnvSetup && current.onRetryOpenclawGateway === next.onRetryOpenclawGateway && current.onSelectConversation === next.onSelectConversation && current.onToggleConversationPinned === next.onToggleConversationPinned && current.onOpenProjectFiles === next.onOpenProjectFiles && current.onOpenConversationWindow === next.onOpenConversationWindow && current.selectProjectDirectory === next.selectProjectDirectory && current.onRemoveProject === next.onRemoveProject && current.onConfirmDeleteProjectConversations === next.onConfirmDeleteProjectConversations && current.onRequestDeleteConversation === next.onRequestDeleteConversation && current.onCancelDeleteConversation === next.onCancelDeleteConversation && current.onConfirmDeleteConversation === next.onConfirmDeleteConversation;
|
|
24968
25259
|
}
|
|
24969
25260
|
var AgentGUIConversationRailStorePane = memo(
|
|
24970
25261
|
function AgentGUIConversationRailStorePane2({
|
|
@@ -25231,6 +25522,7 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25231
25522
|
createConversationDisabled,
|
|
25232
25523
|
openclawGateway,
|
|
25233
25524
|
isCollapsed,
|
|
25525
|
+
railConfigProvider,
|
|
25234
25526
|
slashStatusLimits,
|
|
25235
25527
|
providerTargets,
|
|
25236
25528
|
providerTargetsLoading,
|
|
@@ -25486,7 +25778,7 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25486
25778
|
})
|
|
25487
25779
|
}
|
|
25488
25780
|
),
|
|
25489
|
-
/* @__PURE__ */ jsx31("div", { className: "shrink-0 px-2 py-1.5", children: /* @__PURE__ */ jsxs17(Popover, { children: [
|
|
25781
|
+
railConfigProvider ? /* @__PURE__ */ jsx31("div", { className: "shrink-0 px-2 py-1.5", children: /* @__PURE__ */ jsxs17(Popover, { children: [
|
|
25490
25782
|
/* @__PURE__ */ jsx31(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs17(
|
|
25491
25783
|
Button,
|
|
25492
25784
|
{
|
|
@@ -25548,7 +25840,7 @@ var AgentGUIConversationRailPane = memo(
|
|
|
25548
25840
|
] })
|
|
25549
25841
|
}
|
|
25550
25842
|
)
|
|
25551
|
-
] }) }),
|
|
25843
|
+
] }) }) : null,
|
|
25552
25844
|
/* @__PURE__ */ jsx31(
|
|
25553
25845
|
ConfirmationDialog,
|
|
25554
25846
|
{
|
|
@@ -26909,8 +27201,24 @@ function filterSlashStatusQuotasForModel(quotas, selectedModel) {
|
|
|
26909
27201
|
function normalizeSlashStatusModelName(value) {
|
|
26910
27202
|
return value?.trim().toLowerCase().replace(/[^a-z0-9]+/gu, "-").replace(/^-+|-+$/gu, "") ?? "";
|
|
26911
27203
|
}
|
|
27204
|
+
function resolveAgentGUIRailStatusProvider(input) {
|
|
27205
|
+
if (input.conversationScope !== "multi-provider") {
|
|
27206
|
+
return input.activeProvider;
|
|
27207
|
+
}
|
|
27208
|
+
const filter = input.conversationFilter;
|
|
27209
|
+
if (filter.kind !== "agentTarget") {
|
|
27210
|
+
return null;
|
|
27211
|
+
}
|
|
27212
|
+
const target = input.providerTargets.find(
|
|
27213
|
+
(candidate) => candidate.disabled !== true && (candidate.agentTargetId?.trim() ?? "") === filter.agentTargetId
|
|
27214
|
+
);
|
|
27215
|
+
return target ? target.provider : null;
|
|
27216
|
+
}
|
|
26912
27217
|
function agentGuiStateEquals(left, right) {
|
|
26913
|
-
return left === right || left.provider === right.provider && (left.agentTargetId ?? null) === (right.agentTargetId ?? null) &&
|
|
27218
|
+
return left === right || left.provider === right.provider && (left.agentTargetId ?? null) === (right.agentTargetId ?? null) && (left.providerTargetId ?? null) === (right.providerTargetId ?? null) && agentGUIProviderTargetRefsEqual(
|
|
27219
|
+
left.providerTargetRef,
|
|
27220
|
+
right.providerTargetRef
|
|
27221
|
+
) && 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(
|
|
26914
27222
|
left.composerOverridesByProvider,
|
|
26915
27223
|
right.composerOverridesByProvider
|
|
26916
27224
|
) && composerOverridesByAgentTargetIdEqual(
|
|
@@ -26948,11 +27256,11 @@ function composerOverridesByAgentTargetIdEqual(left, right) {
|
|
|
26948
27256
|
return true;
|
|
26949
27257
|
}
|
|
26950
27258
|
function areAgentGUINodePropsEqual(previous, next) {
|
|
26951
|
-
return previous.nodeId === next.nodeId && previous.workspaceId === next.workspaceId && previous.currentUserId === next.currentUserId && previous.workspacePath === next.workspacePath && previous.workspaceFileReferenceAdapter === next.workspaceFileReferenceAdapter && previous.resolveDroppedFileReferences === next.resolveDroppedFileReferences && previous.selectProjectDirectory === next.selectProjectDirectory && previous.referenceSourceAggregator === next.referenceSourceAggregator && previous.resolveWorkspaceReferenceEntryIconUrl === next.resolveWorkspaceReferenceEntryIconUrl && 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.providerTargetsLoading === next.providerTargetsLoading && previous.defaultProviderTargetId === next.defaultProviderTargetId && previous.conversationScope === next.conversationScope && 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(
|
|
27259
|
+
return previous.nodeId === next.nodeId && previous.workspaceId === next.workspaceId && previous.currentUserId === next.currentUserId && previous.workspacePath === next.workspacePath && previous.workspaceFileReferenceAdapter === next.workspaceFileReferenceAdapter && previous.resolveDroppedFileReferences === next.resolveDroppedFileReferences && previous.selectProjectDirectory === next.selectProjectDirectory && previous.referenceSourceAggregator === next.referenceSourceAggregator && previous.resolveWorkspaceReferenceEntryIconUrl === next.resolveWorkspaceReferenceEntryIconUrl && 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.providerTargetsLoading === next.providerTargetsLoading && previous.defaultProviderTargetId === next.defaultProviderTargetId && previous.conversationScope === next.conversationScope && 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 && (previous.conversationScope === "multi-provider" || next.conversationScope === "multi-provider" ? previous.workspaceAgentProbes === next.workspaceAgentProbes : workspaceAgentProbeRenderStateEqualsForProvider(
|
|
26952
27260
|
previous.workspaceAgentProbes,
|
|
26953
27261
|
next.workspaceAgentProbes,
|
|
26954
27262
|
previous.state.provider
|
|
26955
|
-
) && previous.onAgentProbeDemandChange === next.onAgentProbeDemandChange && previous.onAgentProbeRefreshRequest === next.onAgentProbeRefreshRequest && previous.managedAgentsState === next.managedAgentsState && previous.contextMentionProviders === next.contextMentionProviders && previous.workspaceAppIcons === next.workspaceAppIcons && previous.embedded === next.embedded && previous.previewMode === next.previewMode && previous.isActive === next.isActive && previous.composerFocusRequestSequence === next.composerFocusRequestSequence && previous.newConversationRequestSequence === next.newConversationRequestSequence && previous.openSessionRequest === next.openSessionRequest && previous.prefillPromptRequest === next.prefillPromptRequest;
|
|
27263
|
+
)) && previous.onAgentProbeDemandChange === next.onAgentProbeDemandChange && previous.onAgentProbeRefreshRequest === next.onAgentProbeRefreshRequest && previous.managedAgentsState === next.managedAgentsState && previous.contextMentionProviders === next.contextMentionProviders && previous.workspaceAppIcons === next.workspaceAppIcons && previous.embedded === next.embedded && previous.previewMode === next.previewMode && previous.isActive === next.isActive && previous.composerFocusRequestSequence === next.composerFocusRequestSequence && previous.newConversationRequestSequence === next.newConversationRequestSequence && previous.openSessionRequest === next.openSessionRequest && previous.prefillPromptRequest === next.prefillPromptRequest;
|
|
26956
27264
|
}
|
|
26957
27265
|
var AgentGUINode = memo2(function AgentGUINode2({
|
|
26958
27266
|
nodeId,
|
|
@@ -27679,6 +27987,20 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
27679
27987
|
const windowTitle = collapsedWindowConversationTitle || (isConversationRailCollapsed ? activeConversationWindowTitle : null) || windowAgentTitle || title;
|
|
27680
27988
|
const windowTitleIconUrl = agentGuiDockIconUrls[activeProvider] ?? null;
|
|
27681
27989
|
const activeProbeProvider = activeProvider;
|
|
27990
|
+
const railStatusProvider = useMemo11(
|
|
27991
|
+
() => resolveAgentGUIRailStatusProvider({
|
|
27992
|
+
activeProvider: activeProbeProvider,
|
|
27993
|
+
conversationFilter: viewModel.conversationFilter,
|
|
27994
|
+
conversationScope: viewModel.conversationScope,
|
|
27995
|
+
providerTargets: viewModel.providerTargets
|
|
27996
|
+
}),
|
|
27997
|
+
[
|
|
27998
|
+
activeProbeProvider,
|
|
27999
|
+
viewModel.conversationFilter,
|
|
28000
|
+
viewModel.conversationScope,
|
|
28001
|
+
viewModel.providerTargets
|
|
28002
|
+
]
|
|
28003
|
+
);
|
|
27682
28004
|
const activeAgentProbe = useMemo11(
|
|
27683
28005
|
() => findWorkspaceAgentProbeForDockProvider(
|
|
27684
28006
|
workspaceAgentProbes?.snapshot ?? null,
|
|
@@ -27686,6 +28008,13 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
27686
28008
|
),
|
|
27687
28009
|
[activeProbeProvider, workspaceAgentProbes?.snapshot]
|
|
27688
28010
|
);
|
|
28011
|
+
const railAgentProbe = useMemo11(
|
|
28012
|
+
() => railStatusProvider ? findWorkspaceAgentProbeForDockProvider(
|
|
28013
|
+
workspaceAgentProbes?.snapshot ?? null,
|
|
28014
|
+
railStatusProvider
|
|
28015
|
+
) : null,
|
|
28016
|
+
[railStatusProvider, workspaceAgentProbes?.snapshot]
|
|
28017
|
+
);
|
|
27689
28018
|
const isActiveAgentProviderReady = useMemo11(() => {
|
|
27690
28019
|
const managedAgent = getAgentHostManagedToolchainAgentByName(activeProbeProvider);
|
|
27691
28020
|
if (!managedAgent) {
|
|
@@ -27719,6 +28048,11 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
27719
28048
|
viewModel.composerSettings.selectedModelValue
|
|
27720
28049
|
]
|
|
27721
28050
|
);
|
|
28051
|
+
const railSlashStatusQuotaSource = railStatusProvider && railAgentProbe?.usage?.quotas && railAgentProbe.usage.quotas.length > 0 ? railAgentProbe.usage.quotas : [];
|
|
28052
|
+
const railSlashStatusLimits = useMemo11(
|
|
28053
|
+
() => slashStatusLimitsFromQuotas(railSlashStatusQuotaSource, null, t),
|
|
28054
|
+
[railSlashStatusQuotaSource, t]
|
|
28055
|
+
);
|
|
27722
28056
|
const agentProbeLines = useMemo11(() => {
|
|
27723
28057
|
return buildDockAgentProbeTooltipLines(
|
|
27724
28058
|
activeAgentProbe,
|
|
@@ -27745,6 +28079,22 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
27745
28079
|
onAgentProbeDemandChange(null, probeSourceId);
|
|
27746
28080
|
};
|
|
27747
28081
|
}, [activeProbeProvider, nodeId, onAgentProbeDemandChange, previewMode]);
|
|
28082
|
+
useEffect14(() => {
|
|
28083
|
+
if (previewMode || !onAgentProbeDemandChange || !railStatusProvider || railStatusProvider === activeProbeProvider) {
|
|
28084
|
+
return;
|
|
28085
|
+
}
|
|
28086
|
+
const probeSourceId = `agent-gui:${nodeId}:rail`;
|
|
28087
|
+
onAgentProbeDemandChange(railStatusProvider, probeSourceId);
|
|
28088
|
+
return () => {
|
|
28089
|
+
onAgentProbeDemandChange(null, probeSourceId);
|
|
28090
|
+
};
|
|
28091
|
+
}, [
|
|
28092
|
+
activeProbeProvider,
|
|
28093
|
+
nodeId,
|
|
28094
|
+
onAgentProbeDemandChange,
|
|
28095
|
+
previewMode,
|
|
28096
|
+
railStatusProvider
|
|
28097
|
+
]);
|
|
27748
28098
|
const handleAgentProbeInfoOpen = useCallback12(() => {
|
|
27749
28099
|
if (previewMode || !onAgentProbeRefreshRequest) {
|
|
27750
28100
|
return;
|
|
@@ -27831,6 +28181,8 @@ var AgentGUINode = memo2(function AgentGUINode2({
|
|
|
27831
28181
|
isAgentProviderReady: isActiveAgentProviderReady,
|
|
27832
28182
|
slashStatusLimits,
|
|
27833
28183
|
slashStatusLimitsLoading: workspaceAgentProbes?.isLoadingUsage ?? false,
|
|
28184
|
+
railConfigProvider: railStatusProvider,
|
|
28185
|
+
railSlashStatusLimits,
|
|
27834
28186
|
previewMode,
|
|
27835
28187
|
onLinkAction: handleLinkAction,
|
|
27836
28188
|
capabilityMenuState,
|