@tutti-os/agent-gui 0.0.54 → 0.0.56

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.
Files changed (46) hide show
  1. package/dist/{AgentMentionSearchController-DzhWr0PN.d.ts → AgentMentionSearchController-Po0KQLcL.d.ts} +13 -1
  2. package/dist/agent-conversation/index.d.ts +1 -1
  3. package/dist/agent-conversation/index.js +6 -6
  4. package/dist/agent-message-center/index.d.ts +1 -1
  5. package/dist/agent-message-center/index.js +8 -8
  6. package/dist/app/renderer/agentactivity.css +21 -4
  7. package/dist/{chunk-PBHTLI3E.js → chunk-4URDQNBP.js} +2 -2
  8. package/dist/{chunk-2XVECUTU.js → chunk-54CMFCHF.js} +3 -1
  9. package/dist/chunk-54CMFCHF.js.map +1 -0
  10. package/dist/{chunk-H2YWXFYX.js → chunk-5PGMLZ4W.js} +2 -2
  11. package/dist/{chunk-ZFDO72FE.js → chunk-6QFURP4M.js} +16 -3
  12. package/dist/chunk-6QFURP4M.js.map +1 -0
  13. package/dist/{chunk-6AXH2BOD.js → chunk-752VTG4P.js} +5 -5
  14. package/dist/{chunk-BGZ2OSDQ.js → chunk-EVVIWZLX.js} +2 -2
  15. package/dist/{chunk-JRA44NYI.js → chunk-MXDPRBS6.js} +143 -4
  16. package/dist/chunk-MXDPRBS6.js.map +1 -0
  17. package/dist/{chunk-CMOGPJ23.js → chunk-PQYMG6PQ.js} +2 -2
  18. package/dist/{chunk-7ZDLFTVL.js → chunk-PQYSB2WC.js} +13 -5
  19. package/dist/{chunk-7ZDLFTVL.js.map → chunk-PQYSB2WC.js.map} +1 -1
  20. package/dist/{chunk-GL54NRMB.js → chunk-S6PCOX3S.js} +40 -1
  21. package/dist/chunk-S6PCOX3S.js.map +1 -0
  22. package/dist/{chunk-WMQN7SZC.js → chunk-SITURZG6.js} +2 -2
  23. package/dist/{chunk-EXZH66UE.js → chunk-X4C4HD6E.js} +5 -5
  24. package/dist/context-mention-palette/index.d.ts +2 -2
  25. package/dist/context-mention-palette/index.js +7 -7
  26. package/dist/i18n/index.d.ts +2 -0
  27. package/dist/i18n/index.js +2 -2
  28. package/dist/index.d.ts +43 -5
  29. package/dist/index.js +477 -119
  30. package/dist/index.js.map +1 -1
  31. package/dist/workbench/index.js +3 -3
  32. package/dist/workbench/sessionTitle.js +3 -3
  33. package/dist/workspace-agent-generated-files.js +3 -3
  34. package/dist/{workspaceLinkActions-C6POH38D.d.ts → workspaceLinkActions-Bjy_XfBm.d.ts} +8 -1
  35. package/package.json +12 -12
  36. package/dist/chunk-2XVECUTU.js.map +0 -1
  37. package/dist/chunk-GL54NRMB.js.map +0 -1
  38. package/dist/chunk-JRA44NYI.js.map +0 -1
  39. package/dist/chunk-ZFDO72FE.js.map +0 -1
  40. /package/dist/{chunk-PBHTLI3E.js.map → chunk-4URDQNBP.js.map} +0 -0
  41. /package/dist/{chunk-H2YWXFYX.js.map → chunk-5PGMLZ4W.js.map} +0 -0
  42. /package/dist/{chunk-6AXH2BOD.js.map → chunk-752VTG4P.js.map} +0 -0
  43. /package/dist/{chunk-BGZ2OSDQ.js.map → chunk-EVVIWZLX.js.map} +0 -0
  44. /package/dist/{chunk-CMOGPJ23.js.map → chunk-PQYMG6PQ.js.map} +0 -0
  45. /package/dist/{chunk-WMQN7SZC.js.map → chunk-SITURZG6.js.map} +0 -0
  46. /package/dist/{chunk-EXZH66UE.js.map → chunk-X4C4HD6E.js.map} +0 -0
package/dist/index.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  import {
23
23
  AgentInteractivePromptSurface,
24
24
  approvalOptionDisplayLabel
25
- } from "./chunk-6AXH2BOD.js";
25
+ } from "./chunk-752VTG4P.js";
26
26
  import {
27
27
  PLAN_IMPLEMENTATION_ACTION_FEEDBACK,
28
28
  PLAN_IMPLEMENTATION_ACTION_IMPLEMENT,
@@ -41,7 +41,7 @@ import {
41
41
  resolveAgentGUIExplicitConversationTitle,
42
42
  resolveAgentGUIProviderDisplayLabel,
43
43
  resolveAgentGUIProviderIdentity
44
- } from "./chunk-CMOGPJ23.js";
44
+ } from "./chunk-PQYMG6PQ.js";
45
45
  import {
46
46
  AgentConversationFlow,
47
47
  Button,
@@ -63,14 +63,14 @@ import {
63
63
  skillTriggerForPrefix,
64
64
  toLocalShortDateTime,
65
65
  useProjectedAgentConversation
66
- } from "./chunk-EXZH66UE.js";
66
+ } from "./chunk-X4C4HD6E.js";
67
67
  import {
68
68
  AgentMessageMarkdown,
69
69
  AgentTargetPresentationProvider,
70
70
  ZoomableImage,
71
71
  cn,
72
72
  resolveWorkspaceLinkAction
73
- } from "./chunk-ZFDO72FE.js";
73
+ } from "./chunk-6QFURP4M.js";
74
74
  import {
75
75
  AGENT_MENTION_FILTER_TAB_ORDER,
76
76
  AgentFileMentionPalette,
@@ -78,7 +78,7 @@ import {
78
78
  DEFAULT_AGENT_MENTION_FILTER,
79
79
  agentMentionItemKey,
80
80
  preloadAgentMentionBrowse
81
- } from "./chunk-7ZDLFTVL.js";
81
+ } from "./chunk-PQYSB2WC.js";
82
82
  import {
83
83
  WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN,
84
84
  buildWorkspaceAgentActivityListViewModel,
@@ -88,10 +88,10 @@ import {
88
88
  isWorkspaceAgentUntitledTask,
89
89
  mergeWorkspaceAgentActivityDurableAndOverlayMessages,
90
90
  selectWorkspaceAgentActivityOverlayMessages
91
- } from "./chunk-PBHTLI3E.js";
91
+ } from "./chunk-4URDQNBP.js";
92
92
  import {
93
93
  Spinner
94
- } from "./chunk-WMQN7SZC.js";
94
+ } from "./chunk-SITURZG6.js";
95
95
  import {
96
96
  resolveWorkspaceAgentSessionSortTimeUnixMs
97
97
  } from "./chunk-IBIMGLCD.js";
@@ -102,7 +102,7 @@ import {
102
102
  mentionItemToAttrs,
103
103
  normalizeAgentSessionMentionTitle,
104
104
  parseMentionItemFromHref
105
- } from "./chunk-JRA44NYI.js";
105
+ } from "./chunk-MXDPRBS6.js";
106
106
  import "./chunk-Y35GDLP2.js";
107
107
  import "./chunk-LUGELG5V.js";
108
108
  import {
@@ -111,17 +111,20 @@ import {
111
111
  MANAGED_AGENT_ICON_FALLBACK_URL,
112
112
  MANAGED_AGENT_ICON_URLS,
113
113
  getAgentActivityRuntime,
114
+ getAgentCustomMentionKind,
114
115
  getOptionalAgentActivityRuntime,
115
116
  getOptionalAgentHostApi,
116
117
  normalizeManagedAgentProvider,
118
+ registerAgentCustomMentionKind,
117
119
  resetAgentActivityRuntimeForTests,
120
+ resetAgentCustomMentionKindsForTests,
118
121
  setAgentActivityRuntimeForTests,
119
122
  useAgentActivityRuntime,
120
123
  useAgentActivitySnapshot,
121
124
  useAgentHostApi,
122
125
  useOptionalAgentActivityRuntime,
123
126
  useOptionalAgentHostApi
124
- } from "./chunk-GL54NRMB.js";
127
+ } from "./chunk-S6PCOX3S.js";
125
128
  import "./chunk-TYGL25EL.js";
126
129
  import "./chunk-PJP5BUU6.js";
127
130
  import "./chunk-MTFSQWZ6.js";
@@ -138,8 +141,8 @@ import {
138
141
  agentGuiI18nResources,
139
142
  translate,
140
143
  useTranslation
141
- } from "./chunk-H2YWXFYX.js";
142
- import "./chunk-2XVECUTU.js";
144
+ } from "./chunk-5PGMLZ4W.js";
145
+ import "./chunk-54CMFCHF.js";
143
146
 
144
147
  // shared/agentActivitySnapshotProjection.ts
145
148
  import {
@@ -6557,7 +6560,10 @@ function buildNodeDefaultComposerSettings(data, options) {
6557
6560
  }
6558
6561
  function nodeComposerOverridesForProvider(data) {
6559
6562
  const agentTargetId = normalizeOptionalText(data.agentTargetId);
6560
- return (agentTargetId ? data.composerOverridesByAgentTargetId?.[agentTargetId] : null) ?? data.composerOverridesByProvider?.[data.provider] ?? data.composerOverrides ?? null;
6563
+ if (agentTargetId) {
6564
+ return data.composerOverridesByAgentTargetId?.[agentTargetId] ?? null;
6565
+ }
6566
+ return data.composerOverridesByProvider?.[data.provider] ?? data.composerOverrides ?? null;
6561
6567
  }
6562
6568
  function composerSupportForProvider(provider) {
6563
6569
  if (provider === "claude-code" || provider === "codex" || provider === "gemini") {
@@ -6656,6 +6662,103 @@ function composerDefaultsFromSettings(settings) {
6656
6662
  }
6657
6663
  return Object.keys(defaults).length > 0 ? defaults : null;
6658
6664
  }
6665
+ function composerTargetDataFromProviderTarget(input) {
6666
+ const agentTargetId = normalizeOptionalText2(input.target.agentTargetId);
6667
+ const useLegacyProviderTargetRef = !agentTargetId && input.isExplicit;
6668
+ const providerTargetId = useLegacyProviderTargetRef ? input.target.targetId : null;
6669
+ const providerTargetRef = useLegacyProviderTargetRef ? input.target.ref : null;
6670
+ const currentAgentTargetId = normalizeOptionalText2(
6671
+ input.current.agentTargetId
6672
+ );
6673
+ const currentProviderTargetId = normalizeOptionalText2(
6674
+ input.current.providerTargetId
6675
+ );
6676
+ 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];
6677
+ const composerOverridesByAgentTargetId = canPromoteLegacyComposerOverrides ? {
6678
+ ...input.current.composerOverridesByAgentTargetId ?? {},
6679
+ [agentTargetId]: input.current.composerOverrides
6680
+ } : input.current.composerOverridesByAgentTargetId;
6681
+ const currentTargetIdentityChanged = input.current.provider !== input.target.provider || currentAgentTargetId !== null && currentAgentTargetId !== agentTargetId || currentProviderTargetId !== null && currentProviderTargetId !== providerTargetId || input.current.providerTargetRef != null && !agentGUIProviderTargetRefsEqual(
6682
+ input.current.providerTargetRef,
6683
+ providerTargetRef
6684
+ );
6685
+ return {
6686
+ agentTargetId,
6687
+ provider: input.target.provider,
6688
+ providerTargetId,
6689
+ providerTargetRef,
6690
+ targetId: input.target.targetId,
6691
+ data: {
6692
+ ...input.current,
6693
+ provider: input.target.provider,
6694
+ agentTargetId,
6695
+ providerTargetId,
6696
+ providerTargetRef,
6697
+ composerOverrides: canPromoteLegacyComposerOverrides ? null : currentTargetIdentityChanged ? null : input.current.composerOverrides,
6698
+ composerOverridesByAgentTargetId
6699
+ }
6700
+ };
6701
+ }
6702
+ function composerTargetDataFromNodeData(data) {
6703
+ const agentTargetId = normalizeOptionalText2(data.agentTargetId);
6704
+ const providerTargetId = data.providerTargetId ?? null;
6705
+ return {
6706
+ agentTargetId,
6707
+ provider: data.provider,
6708
+ providerTargetId,
6709
+ providerTargetRef: data.providerTargetRef ?? null,
6710
+ targetId: agentTargetId ?? providerTargetId ?? `local:${data.provider}`,
6711
+ data
6712
+ };
6713
+ }
6714
+ function agentGUINodeDataHasComposerTarget(data) {
6715
+ return normalizeOptionalText2(data.agentTargetId) !== null || normalizeOptionalText2(data.providerTargetId) !== null || data.providerTargetRef != null;
6716
+ }
6717
+ function composerOptionsForTarget(input) {
6718
+ if (input.target.agentTargetId) {
6719
+ const targetOptions = input.snapshot.composerOptionsByAgentTargetId?.[input.target.agentTargetId] ?? null;
6720
+ if (targetOptions) {
6721
+ return targetOptions;
6722
+ }
6723
+ return null;
6724
+ }
6725
+ return input.snapshot.composerOptionsByProvider?.[input.target.provider] ?? null;
6726
+ }
6727
+ function composerOptionValues(options) {
6728
+ return new Set(options.map((option) => option.value));
6729
+ }
6730
+ function sanitizeComposerSettingsForOptions(settings, options) {
6731
+ if (!options) {
6732
+ return settings;
6733
+ }
6734
+ const modelValues = composerOptionValues(options.models);
6735
+ const reasoningValues = composerOptionValues(options.reasoningEfforts);
6736
+ const speedValues = composerOptionValues(options.speeds ?? []);
6737
+ const permissionValues = new Set(
6738
+ options.permissionConfig?.modes.map((mode) => mode.id) ?? []
6739
+ );
6740
+ const model = normalizeOptionalText2(settings.model);
6741
+ const reasoningEffort = normalizeOptionalText2(settings.reasoningEffort);
6742
+ const speed = normalizeOptionalText2(settings.speed);
6743
+ const permissionModeId = normalizePermissionModeId(settings.permissionModeId);
6744
+ const modelOptionsAreAuthoritative = options.provider === "claude-code";
6745
+ return {
6746
+ ...settings,
6747
+ model: modelOptionsAreAuthoritative && model && modelValues.size > 0 && !modelValues.has(model) ? null : model,
6748
+ reasoningEffort: reasoningEffort && reasoningValues.size > 0 && !reasoningValues.has(reasoningEffort) ? null : reasoningEffort,
6749
+ speed: speed && speedValues.size > 0 && !speedValues.has(speed) ? null : speed,
6750
+ permissionModeId: permissionModeId && permissionValues.size > 0 && !permissionValues.has(permissionModeId) ? null : permissionModeId
6751
+ };
6752
+ }
6753
+ function sanitizeComposerSettingsForTarget(input) {
6754
+ if (!input.target.agentTargetId) {
6755
+ return input.settings;
6756
+ }
6757
+ return sanitizeComposerSettingsForOptions(input.settings, input.options);
6758
+ }
6759
+ function agentGUIProviderTargetsEqual(left, right) {
6760
+ return left.provider === right.provider && left.targetId === right.targetId && (left.agentTargetId ?? null) === (right.agentTargetId ?? null) && agentGUIProviderTargetRefsEqual(left.ref, right.ref);
6761
+ }
6659
6762
  function reportAgentGUIRuntimeError(input) {
6660
6763
  const reportDiagnostic = input.runtime.reportDiagnostic;
6661
6764
  if (!reportDiagnostic) {
@@ -8291,7 +8394,13 @@ function readNodeDefaultDraftContent(input) {
8291
8394
  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
8395
  }
8293
8396
  function readNodeDefaultDraftSettings(input) {
8294
- return input.drafts[nodeDefaultDraftKey(input.data.provider, input.data.agentTargetId)] ?? input.drafts[nodeDefaultDraftKey(input.data.provider)] ?? input.drafts[NODE_DEFAULT_DRAFT_KEY] ?? buildNodeDefaultComposerSettings(input.data, {
8397
+ const agentTargetId = normalizeOptionalText2(input.data.agentTargetId);
8398
+ if (agentTargetId) {
8399
+ return input.drafts[nodeDefaultDraftKey(input.data.provider, agentTargetId)] ?? buildNodeDefaultComposerSettings(input.data, {
8400
+ defaultReasoningEffort: input.defaultReasoningEffort
8401
+ });
8402
+ }
8403
+ return input.drafts[nodeDefaultDraftKey(input.data.provider)] ?? input.drafts[NODE_DEFAULT_DRAFT_KEY] ?? buildNodeDefaultComposerSettings(input.data, {
8295
8404
  defaultReasoningEffort: input.defaultReasoningEffort
8296
8405
  });
8297
8406
  }
@@ -8632,6 +8741,56 @@ function useAgentGUINodeController({
8632
8741
  ),
8633
8742
  [normalizedExplicitProviderTargets, selectedProviderTarget]
8634
8743
  );
8744
+ const [homeComposerTargetOverride, setHomeComposerTargetOverride] = useState4(null);
8745
+ const homeComposerTargetOverrideIsExplicit = useMemo4(
8746
+ () => homeComposerTargetOverride ? normalizedExplicitProviderTargets.some(
8747
+ (target) => target.provider === homeComposerTargetOverride.provider && target.targetId === homeComposerTargetOverride.targetId && agentGUIProviderTargetRefsEqual(
8748
+ target.ref,
8749
+ homeComposerTargetOverride.ref
8750
+ )
8751
+ ) : false,
8752
+ [homeComposerTargetOverride, normalizedExplicitProviderTargets]
8753
+ );
8754
+ const effectiveSelectedProviderTarget = homeComposerTargetOverride ?? selectedProviderTarget;
8755
+ const effectiveSelectedProviderTargetIsExplicit = homeComposerTargetOverride ? homeComposerTargetOverrideIsExplicit : selectedProviderTargetIsExplicit;
8756
+ 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(
8757
+ selectedProviderTarget.ref,
8758
+ data.providerTargetRef
8759
+ ));
8760
+ const selectedComposerTargetData = useMemo4(
8761
+ () => homeComposerTargetOverride ? composerTargetDataFromProviderTarget({
8762
+ current: data,
8763
+ isExplicit: homeComposerTargetOverrideIsExplicit,
8764
+ target: homeComposerTargetOverride
8765
+ }) : nodeComposerTargetResolvedByProviderTarget ? composerTargetDataFromProviderTarget({
8766
+ current: data,
8767
+ isExplicit: selectedProviderTargetIsExplicit,
8768
+ target: selectedProviderTarget
8769
+ }) : agentGUINodeDataHasComposerTarget(data) ? composerTargetDataFromNodeData(data) : composerTargetDataFromProviderTarget({
8770
+ current: data,
8771
+ isExplicit: selectedProviderTargetIsExplicit,
8772
+ target: selectedProviderTarget
8773
+ }),
8774
+ [
8775
+ data,
8776
+ homeComposerTargetOverride,
8777
+ homeComposerTargetOverrideIsExplicit,
8778
+ nodeComposerTargetResolvedByProviderTarget,
8779
+ selectedProviderTarget,
8780
+ selectedProviderTargetIsExplicit
8781
+ ]
8782
+ );
8783
+ useEffect4(() => {
8784
+ if (!homeComposerTargetOverride) {
8785
+ return;
8786
+ }
8787
+ if (agentGUIProviderTargetsEqual(
8788
+ homeComposerTargetOverride,
8789
+ selectedProviderTarget
8790
+ )) {
8791
+ setHomeComposerTargetOverride(null);
8792
+ }
8793
+ }, [homeComposerTargetOverride, selectedProviderTarget]);
8635
8794
  const agentActivityDisplayStatusesRef = useRef4(null);
8636
8795
  const agentActivityDisplayStatuses = useMemo4(() => {
8637
8796
  const next = selectSessionDisplayStatuses(agentActivitySnapshot);
@@ -8761,7 +8920,11 @@ function useAgentGUINodeController({
8761
8920
  sessionViewRef(activeConversationId)
8762
8921
  );
8763
8922
  const activeSessionState = activeSessionView?.controlState ?? null;
8764
- const providerComposerOptions = (data.agentTargetId ? agentActivitySnapshot.composerOptionsByAgentTargetId?.[data.agentTargetId] : null) ?? agentActivitySnapshot.composerOptionsByProvider?.[data.provider] ?? null;
8923
+ const composerTargetData = activeConversationId === null ? selectedComposerTargetData : composerTargetDataFromNodeData(data);
8924
+ const providerComposerOptions = composerOptionsForTarget({
8925
+ snapshot: agentActivitySnapshot,
8926
+ target: composerTargetData
8927
+ });
8765
8928
  const resolvedPromptImagesSupported = resolveAgentActivityCapability2(
8766
8929
  "imageInput",
8767
8930
  {
@@ -8786,7 +8949,7 @@ function useAgentGUINodeController({
8786
8949
  ),
8787
8950
  [providerComposerOptions, activeSessionRuntimeContext]
8788
8951
  );
8789
- const supports = composerSupportForProvider(data.provider);
8952
+ const supports = composerSupportForProvider(composerTargetData.provider);
8790
8953
  const usage = useMemo4(
8791
8954
  () => resolveAgentActivityUsage({
8792
8955
  sessionRuntimeContext: activeSessionRuntimeContext
@@ -8988,12 +9151,14 @@ function useAgentGUINodeController({
8988
9151
  agentActivitySnapshot
8989
9152
  );
8990
9153
  const dataRef = useRef4(data);
8991
- const selectedProviderTargetRef = useRef4(selectedProviderTarget);
8992
- selectedProviderTargetRef.current = selectedProviderTarget;
9154
+ const selectedProviderTargetRef = useRef4(effectiveSelectedProviderTarget);
9155
+ selectedProviderTargetRef.current = effectiveSelectedProviderTarget;
8993
9156
  const selectedProviderTargetIsExplicitRef = useRef4(
8994
- selectedProviderTargetIsExplicit
9157
+ effectiveSelectedProviderTargetIsExplicit
8995
9158
  );
8996
- selectedProviderTargetIsExplicitRef.current = selectedProviderTargetIsExplicit;
9159
+ selectedProviderTargetIsExplicitRef.current = effectiveSelectedProviderTargetIsExplicit;
9160
+ const selectedComposerTargetDataRef = useRef4(selectedComposerTargetData);
9161
+ selectedComposerTargetDataRef.current = selectedComposerTargetData;
8997
9162
  const draftSettingsBySessionIdRef = useRef4(draftSettingsBySessionId);
8998
9163
  const onDataChangeRef = useRef4(onDataChange);
8999
9164
  const onRememberComposerDefaultsRef = useRef4(onRememberComposerDefaults);
@@ -9226,6 +9391,12 @@ function useAgentGUINodeController({
9226
9391
  useEffect4(() => {
9227
9392
  isComposerHomeRef.current = isComposerHome;
9228
9393
  }, [isComposerHome]);
9394
+ useEffect4(() => {
9395
+ if (activeConversationId === null && isComposerHome) {
9396
+ return;
9397
+ }
9398
+ setHomeComposerTargetOverride(null);
9399
+ }, [activeConversationId, isComposerHome]);
9229
9400
  useEffect4(() => {
9230
9401
  isCreatingConversationRef.current = isCreatingConversation;
9231
9402
  }, [isCreatingConversation]);
@@ -10511,15 +10682,15 @@ function useAgentGUINodeController({
10511
10682
  useEffect4(() => {
10512
10683
  reloadSelectedConversationRef.current = reloadSelectedConversation;
10513
10684
  }, [reloadSelectedConversation]);
10514
- const loadDraftComposerOptions = useCallback4(
10515
- (options) => {
10516
- const provider = dataRef.current.provider;
10517
- const agentTargetId = dataRef.current.agentTargetId ?? null;
10685
+ const loadComposerOptionsForTarget = useCallback4(
10686
+ (targetData, options) => {
10687
+ const provider = targetData.provider;
10688
+ const agentTargetId = targetData.agentTargetId;
10518
10689
  if (isCreatingConversationRef.current) {
10519
10690
  return;
10520
10691
  }
10521
10692
  const settings = readNodeDefaultDraftSettings({
10522
- data: dataRef.current,
10693
+ data: targetData.data,
10523
10694
  defaultReasoningEffort,
10524
10695
  drafts: draftSettingsBySessionIdRef.current
10525
10696
  });
@@ -10537,6 +10708,13 @@ function useAgentGUINodeController({
10537
10708
  },
10538
10709
  [agentActivityRuntime, defaultReasoningEffort, workspaceId, workspacePath]
10539
10710
  );
10711
+ const loadDraftComposerOptions = useCallback4(
10712
+ (options) => {
10713
+ const targetData = activeConversationIdRef.current === null ? selectedComposerTargetDataRef.current : composerTargetDataFromNodeData(dataRef.current);
10714
+ loadComposerOptionsForTarget(targetData, options);
10715
+ },
10716
+ [loadComposerOptionsForTarget]
10717
+ );
10540
10718
  useEffect4(() => {
10541
10719
  if (previewMode) {
10542
10720
  return;
@@ -10544,7 +10722,7 @@ function useAgentGUINodeController({
10544
10722
  if (!supports.model && !supports.reasoning && !supports.permission) {
10545
10723
  return;
10546
10724
  }
10547
- const projectKey = `${data.agentTargetId ?? data.provider}\0${selectedProjectPath ?? ""}`;
10725
+ const projectKey = `${composerTargetData.agentTargetId ?? composerTargetData.provider}\0${selectedProjectPath ?? ""}`;
10548
10726
  const previousProjectKey = composerOptionsProjectKeyRef.current;
10549
10727
  composerOptionsProjectKeyRef.current = projectKey;
10550
10728
  if (previousProjectKey === null || previousProjectKey === projectKey) {
@@ -10552,8 +10730,8 @@ function useAgentGUINodeController({
10552
10730
  }
10553
10731
  loadDraftComposerOptions({ force: true });
10554
10732
  }, [
10555
- data.agentTargetId,
10556
- data.provider,
10733
+ composerTargetData.agentTargetId,
10734
+ composerTargetData.provider,
10557
10735
  loadDraftComposerOptions,
10558
10736
  previewMode,
10559
10737
  selectedProjectPath,
@@ -10576,7 +10754,7 @@ function useAgentGUINodeController({
10576
10754
  merge: mergeAgentModelCatalogInvalidationEvents
10577
10755
  },
10578
10756
  (event) => {
10579
- const provider = dataRef.current.provider;
10757
+ const provider = activeConversationIdRef.current === null ? selectedComposerTargetDataRef.current.provider : dataRef.current.provider;
10580
10758
  const currentActiveConversationId = activeConversationIdRef.current;
10581
10759
  if (!event.providers.includes(provider)) {
10582
10760
  return;
@@ -10608,12 +10786,12 @@ function useAgentGUINodeController({
10608
10786
  return;
10609
10787
  }
10610
10788
  loadDraftComposerOptions(
10611
- data.provider === "claude-code" && isComposerHome ? { force: true } : void 0
10789
+ composerTargetData.provider === "claude-code" && isComposerHome ? { force: true } : void 0
10612
10790
  );
10613
10791
  }, [
10614
10792
  activeConversationId,
10615
- data.agentTargetId,
10616
- data.provider,
10793
+ composerTargetData.agentTargetId,
10794
+ composerTargetData.provider,
10617
10795
  isComposerHome,
10618
10796
  loadDraftComposerOptions,
10619
10797
  previewMode
@@ -11206,10 +11384,11 @@ function useAgentGUINodeController({
11206
11384
  const startConversation = useCallback4(
11207
11385
  (initialContentInput, displayPrompt) => {
11208
11386
  const target = selectedProviderTargetRef.current;
11209
- if (isCreatingConversation || target.disabled === true || data.provider === "openclaw" && openclawGateway?.status !== "ready") {
11387
+ const targetData = selectedComposerTargetDataRef.current;
11388
+ if (isCreatingConversation || target.disabled === true || targetData.provider === "openclaw" && openclawGateway?.status !== "ready") {
11210
11389
  return;
11211
11390
  }
11212
- const agentTargetId = target.agentTargetId?.trim() ?? "";
11391
+ const agentTargetId = targetData.agentTargetId ?? "";
11213
11392
  if (!agentTargetId && selectedProviderTargetIsExplicitRef.current) {
11214
11393
  setDetailError(translate("agentHost.agentGui.agentTargetRequired"));
11215
11394
  return;
@@ -11219,8 +11398,11 @@ function useAgentGUINodeController({
11219
11398
  ) : textPromptContent(normalizeOptionalPrompt(initialContentInput));
11220
11399
  const initialDisplayPrompt = displayPrompt && displayPrompt.trim() ? displayPrompt : void 0;
11221
11400
  const normalizedInitialPrompt = initialDisplayPrompt ?? agentPromptContentDisplayText(normalizedInitialContent);
11222
- const initialConversationTitle = normalizedInitialPrompt || AGENT_PROVIDER_LABEL[data.provider];
11223
- const submittedHomeDraftKey = nodeDefaultDraftContentKey(data.provider);
11401
+ const initialConversationTitle = normalizedInitialPrompt || AGENT_PROVIDER_LABEL[targetData.provider];
11402
+ const submittedHomeDraftKey = nodeDefaultDraftContentKey(
11403
+ targetData.provider,
11404
+ targetData.agentTargetId
11405
+ );
11224
11406
  const submittedHomeDraft = draftBySessionIdRef.current[submittedHomeDraftKey] ?? EMPTY_AGENT_COMPOSER_DRAFT;
11225
11407
  isCreatingConversationRef.current = true;
11226
11408
  setLocalIsCreatingConversation(true);
@@ -11228,31 +11410,39 @@ function useAgentGUINodeController({
11228
11410
  let pendingCreateAgentSessionId = null;
11229
11411
  let pendingOptimisticConversation = null;
11230
11412
  void (async () => {
11231
- const target2 = selectedProviderTargetRef.current;
11232
- const provider = target2.provider;
11233
- const agentTargetId2 = target2.agentTargetId?.trim() ?? "";
11234
- const shouldUseProviderTargetRef = !agentTargetId2 && selectedProviderTargetIsExplicitRef.current;
11413
+ const provider = targetData.provider;
11414
+ const agentTargetId2 = targetData.agentTargetId ?? "";
11235
11415
  onDataChangeRef.current(
11236
- (current) => current.provider === provider && (current.agentTargetId ?? null) === (agentTargetId2 || null) && (current.providerTargetId ?? null) === (shouldUseProviderTargetRef ? target2.targetId : null) && agentGUIProviderTargetRefsEqual(
11416
+ (current) => current.provider === provider && (current.agentTargetId ?? null) === (agentTargetId2 || null) && (current.providerTargetId ?? null) === targetData.providerTargetId && agentGUIProviderTargetRefsEqual(
11237
11417
  current.providerTargetRef,
11238
- shouldUseProviderTargetRef ? target2.ref : null
11418
+ targetData.providerTargetRef
11239
11419
  ) ? current : {
11240
11420
  ...current,
11241
11421
  provider,
11242
11422
  agentTargetId: agentTargetId2 || null,
11243
- providerTargetId: shouldUseProviderTargetRef ? target2.targetId : null,
11244
- providerTargetRef: shouldUseProviderTargetRef ? target2.ref : null
11423
+ providerTargetId: targetData.providerTargetId,
11424
+ providerTargetRef: targetData.providerTargetRef
11245
11425
  }
11246
11426
  );
11247
- const currentData = dataRef.current.provider === provider ? dataRef.current : data;
11248
11427
  const selectedProjectPath2 = selectedProjectPathRef.current;
11249
11428
  const initialNodeSettings = readNodeDefaultDraftSettings({
11250
- data: currentData,
11429
+ data: targetData.data,
11251
11430
  defaultReasoningEffort,
11252
11431
  drafts: draftSettingsBySessionIdRef.current
11253
11432
  });
11433
+ const snapshotComposerOptions = composerOptionsForTarget({
11434
+ snapshot: agentActivityRuntime.getSnapshot(workspaceId),
11435
+ target: targetData
11436
+ });
11437
+ const targetSafeInitialNodeSettings = sanitizeComposerSettingsForTarget(
11438
+ {
11439
+ settings: initialNodeSettings,
11440
+ target: targetData,
11441
+ options: snapshotComposerOptions
11442
+ }
11443
+ );
11254
11444
  const initialSettings = resolveEffectiveComposerSettings({
11255
- settings: initialNodeSettings
11445
+ settings: targetSafeInitialNodeSettings
11256
11446
  });
11257
11447
  const currentActiveConversationId = activeConversationIdRef.current;
11258
11448
  const currentActiveConversation = currentActiveConversationId ? resolveConversationSummaryById(
@@ -11260,7 +11450,7 @@ function useAgentGUINodeController({
11260
11450
  currentActiveConversationId,
11261
11451
  transientConversationRef.current
11262
11452
  ) : null;
11263
- const inheritedModel = normalizeOptionalText2(initialNodeSettings.model) === null ? resolveSameProviderActiveSessionModel({
11453
+ const inheritedModel = normalizeOptionalText2(targetSafeInitialNodeSettings.model) === null ? resolveSameProviderActiveSessionModel({
11264
11454
  activeProvider: currentActiveConversation?.provider ?? null,
11265
11455
  agentSessionId: currentActiveConversationId,
11266
11456
  provider,
@@ -11271,7 +11461,11 @@ function useAgentGUINodeController({
11271
11461
  lastActiveModelByProviderRef.current[provider]
11272
11462
  ) : null;
11273
11463
  const effectiveInitialSettings = inheritedModel === null ? initialSettings : { ...initialSettings, model: inheritedModel };
11274
- const snapshotComposerOptions = (agentTargetId2 ? agentActivityRuntime.getSnapshot(workspaceId).composerOptionsByAgentTargetId?.[agentTargetId2] : null) ?? agentActivityRuntime.getSnapshot(workspaceId).composerOptionsByProvider?.[provider] ?? null;
11464
+ const targetSafeEffectiveInitialSettings = sanitizeComposerSettingsForTarget({
11465
+ settings: effectiveInitialSettings,
11466
+ target: targetData,
11467
+ options: snapshotComposerOptions
11468
+ });
11275
11469
  const snapshotDraftAgentSessionId = normalizedInitialContent.length > 0 && provider === "claude-code" ? draftAgentSessionIdFromComposerOptions(snapshotComposerOptions) : null;
11276
11470
  const draftAgentSessionId = snapshotDraftAgentSessionId && !activatedConversationIdsRef.current.has(
11277
11471
  snapshotDraftAgentSessionId
@@ -11334,11 +11528,11 @@ function useAgentGUINodeController({
11334
11528
  startingConversationIdRef.current = agentSessionId;
11335
11529
  draftSettingsBySessionIdRef.current = {
11336
11530
  ...draftSettingsBySessionIdRef.current,
11337
- [agentSessionId]: effectiveInitialSettings
11531
+ [agentSessionId]: targetSafeEffectiveInitialSettings
11338
11532
  };
11339
11533
  setDraftSettingsBySessionId((current) => ({
11340
11534
  ...current,
11341
- [agentSessionId]: effectiveInitialSettings
11535
+ [agentSessionId]: targetSafeEffectiveInitialSettings
11342
11536
  }));
11343
11537
  const optimisticPromptMessage = createOptimisticPromptMessage({
11344
11538
  workspaceId,
@@ -11372,13 +11566,13 @@ function useAgentGUINodeController({
11372
11566
  agentSessionId,
11373
11567
  agentTargetId: agentTargetId2 || null,
11374
11568
  provider,
11375
- providerTargetRef: shouldUseProviderTargetRef ? target2.ref : null,
11569
+ providerTargetRef: targetData.providerTargetRef,
11376
11570
  cwd: selectedProjectPath2 ?? "",
11377
11571
  initialContent: normalizedInitialContent,
11378
11572
  initialDisplayPrompt,
11379
11573
  metadata: agentSubmitTraceMetadata(submitTrace),
11380
11574
  title: initialConversationTitle,
11381
- settings: effectiveInitialSettings,
11575
+ settings: targetSafeEffectiveInitialSettings,
11382
11576
  openclawGatewayReady: provider === "openclaw" ? openclawGateway?.status === "ready" : void 0
11383
11577
  });
11384
11578
  })().then((result) => {
@@ -11701,9 +11895,13 @@ function useAgentGUINodeController({
11701
11895
  setActiveConversationId(null);
11702
11896
  setIsLoadingMessages(false);
11703
11897
  setDetailError(null);
11898
+ const targetData = selectedComposerTargetDataRef.current;
11704
11899
  setDraftBySessionId((current) => ({
11705
11900
  ...current,
11706
- [nodeDefaultDraftContentKey(dataRef.current.provider)]: {
11901
+ [nodeDefaultDraftContentKey(
11902
+ targetData.provider,
11903
+ targetData.agentTargetId
11904
+ )]: {
11707
11905
  ...emptyAgentComposerDraft(),
11708
11906
  prompt: draftPrompt2
11709
11907
  }
@@ -11766,9 +11964,13 @@ function useAgentGUINodeController({
11766
11964
  setActiveConversationId(null);
11767
11965
  setIsLoadingMessages(false);
11768
11966
  setDetailError(null);
11967
+ const targetData = selectedComposerTargetDataRef.current;
11769
11968
  setDraftBySessionId((current) => ({
11770
11969
  ...current,
11771
- [nodeDefaultDraftContentKey(dataRef.current.provider)]: {
11970
+ [nodeDefaultDraftContentKey(
11971
+ targetData.provider,
11972
+ targetData.agentTargetId
11973
+ )]: {
11772
11974
  prompt: nextDraftPrompt,
11773
11975
  images: []
11774
11976
  }
@@ -12560,7 +12762,8 @@ function useAgentGUINodeController({
12560
12762
  }, [activeConversationId]);
12561
12763
  const updateDraftContent = useCallback4((draftContent2) => {
12562
12764
  const agentSessionId = activeConversationIdRef.current;
12563
- const draftKey = agentSessionId ?? nodeDefaultDraftContentKey(dataRef.current.provider);
12765
+ const targetData = selectedComposerTargetDataRef.current;
12766
+ const draftKey = agentSessionId ?? nodeDefaultDraftContentKey(targetData.provider, targetData.agentTargetId);
12564
12767
  draftBySessionIdRef.current = {
12565
12768
  ...draftBySessionIdRef.current,
12566
12769
  [draftKey]: draftContent2
@@ -12658,12 +12861,13 @@ function useAgentGUINodeController({
12658
12861
  };
12659
12862
  const agentSessionId = activeConversationIdRef.current;
12660
12863
  if (!agentSessionId) {
12864
+ const targetData = selectedComposerTargetDataRef.current;
12661
12865
  const defaultDraftKey = nodeDefaultDraftKey(
12662
- dataRef.current.provider,
12663
- dataRef.current.agentTargetId
12866
+ targetData.provider,
12867
+ targetData.agentTargetId
12664
12868
  );
12665
12869
  const storedDefaults = readNodeDefaultDraftSettings({
12666
- data: dataRef.current,
12870
+ data: targetData.data,
12667
12871
  defaultReasoningEffort,
12668
12872
  drafts: draftSettingsBySessionIdRef.current
12669
12873
  });
@@ -12677,29 +12881,47 @@ function useAgentGUINodeController({
12677
12881
  browserUse: supportedNextSettings.browserUse ?? previousSettings.browserUse,
12678
12882
  computerUse: supportedNextSettings.computerUse ?? previousSettings.computerUse
12679
12883
  };
12884
+ const snapshotComposerOptions = composerOptionsForTarget({
12885
+ snapshot: agentActivityRuntime.getSnapshot(workspaceId),
12886
+ target: targetData
12887
+ });
12888
+ const targetSafeMerged = sanitizeComposerSettingsForTarget({
12889
+ settings: merged,
12890
+ target: targetData,
12891
+ options: snapshotComposerOptions
12892
+ });
12680
12893
  draftSettingsBySessionIdRef.current = {
12681
12894
  ...draftSettingsBySessionIdRef.current,
12682
- [defaultDraftKey]: merged
12895
+ [defaultDraftKey]: targetSafeMerged
12683
12896
  };
12684
12897
  setDraftSettingsBySessionId((current) => ({
12685
12898
  ...current,
12686
- [defaultDraftKey]: merged
12899
+ [defaultDraftKey]: targetSafeMerged
12687
12900
  }));
12688
12901
  onDataChangeRef.current(
12689
- (current) => nodeDataFromComposerSettings(current, merged)
12902
+ (current) => nodeDataFromComposerSettings(
12903
+ {
12904
+ ...current,
12905
+ provider: targetData.provider,
12906
+ agentTargetId: targetData.agentTargetId,
12907
+ providerTargetId: targetData.providerTargetId,
12908
+ providerTargetRef: targetData.providerTargetRef
12909
+ },
12910
+ targetSafeMerged
12911
+ )
12690
12912
  );
12691
12913
  void onRememberComposerDefaultsRef.current?.({
12692
- provider: dataRef.current.provider,
12693
- defaults: composerDefaultsFromSettings(merged)
12914
+ provider: targetData.provider,
12915
+ defaults: composerDefaultsFromSettings(targetSafeMerged)
12694
12916
  });
12695
12917
  void agentActivityRuntime.trackDraftComposerSettingsChange?.({
12696
12918
  workspaceId,
12697
- provider: dataRef.current.provider,
12919
+ provider: targetData.provider,
12698
12920
  previousSettings,
12699
- nextSettings: merged
12921
+ nextSettings: targetSafeMerged
12700
12922
  });
12701
12923
  loadDraftComposerOptions(
12702
- dataRef.current.provider === "claude-code" ? { force: true } : void 0
12924
+ targetData.provider === "claude-code" ? { force: true } : void 0
12703
12925
  );
12704
12926
  return;
12705
12927
  }
@@ -13545,7 +13767,7 @@ function useAgentGUINodeController({
13545
13767
  activeSessionState?.turnLifecycle?.settling
13546
13768
  ]);
13547
13769
  const draftContent = activeConversationId ? draftBySessionId[activeConversationId] ?? EMPTY_AGENT_COMPOSER_DRAFT : readNodeDefaultDraftContent({
13548
- data,
13770
+ data: selectedComposerTargetData.data,
13549
13771
  drafts: draftBySessionId
13550
13772
  });
13551
13773
  const draftPrompt = draftContent.prompt;
@@ -13707,16 +13929,65 @@ function useAgentGUINodeController({
13707
13929
  );
13708
13930
  const storedNodeDefaultSettings = useStableComposerSettings(
13709
13931
  readNodeDefaultDraftSettings({
13710
- data,
13932
+ data: activeConversationId === null ? selectedComposerTargetData.data : data,
13711
13933
  defaultReasoningEffort,
13712
13934
  drafts: draftSettingsBySessionId
13713
13935
  })
13714
13936
  );
13937
+ const targetSafeNodeDefaultSettings = useStableComposerSettings(
13938
+ activeConversationId === null ? sanitizeComposerSettingsForTarget({
13939
+ settings: storedNodeDefaultSettings,
13940
+ target: selectedComposerTargetData,
13941
+ options: providerComposerOptions
13942
+ }) : storedNodeDefaultSettings
13943
+ );
13715
13944
  const homeComposerSettings = useStableComposerSettings(
13716
13945
  resolveEffectiveComposerSettings({
13717
- settings: storedNodeDefaultSettings
13946
+ settings: targetSafeNodeDefaultSettings
13718
13947
  })
13719
13948
  );
13949
+ useEffect4(() => {
13950
+ if (activeConversationId !== null || !selectedComposerTargetData.agentTargetId || !providerComposerOptions || sameComposerSettings(
13951
+ storedNodeDefaultSettings,
13952
+ targetSafeNodeDefaultSettings
13953
+ )) {
13954
+ return;
13955
+ }
13956
+ const targetDefaultDraftKey = nodeDefaultDraftKey(
13957
+ selectedComposerTargetData.provider,
13958
+ selectedComposerTargetData.agentTargetId
13959
+ );
13960
+ draftSettingsBySessionIdRef.current = {
13961
+ ...draftSettingsBySessionIdRef.current,
13962
+ [targetDefaultDraftKey]: targetSafeNodeDefaultSettings
13963
+ };
13964
+ setDraftSettingsBySessionId((current) => ({
13965
+ ...current,
13966
+ [targetDefaultDraftKey]: targetSafeNodeDefaultSettings
13967
+ }));
13968
+ onDataChangeRef.current(
13969
+ (current) => nodeDataFromComposerSettings(
13970
+ {
13971
+ ...current,
13972
+ provider: selectedComposerTargetData.provider,
13973
+ agentTargetId: selectedComposerTargetData.agentTargetId,
13974
+ providerTargetId: selectedComposerTargetData.providerTargetId,
13975
+ providerTargetRef: selectedComposerTargetData.providerTargetRef
13976
+ },
13977
+ targetSafeNodeDefaultSettings
13978
+ )
13979
+ );
13980
+ void onRememberComposerDefaultsRef.current?.({
13981
+ provider: selectedComposerTargetData.provider,
13982
+ defaults: composerDefaultsFromSettings(targetSafeNodeDefaultSettings)
13983
+ });
13984
+ }, [
13985
+ activeConversationId,
13986
+ providerComposerOptions,
13987
+ selectedComposerTargetData,
13988
+ storedNodeDefaultSettings,
13989
+ targetSafeNodeDefaultSettings
13990
+ ]);
13720
13991
  const activeConversationDraftSettings = activeConversationId ? draftSettingsBySessionId[activeConversationId] ?? null : null;
13721
13992
  const defaultConversationDraftSettings = useStableComposerSettings({
13722
13993
  ...activeConversationDraftSettings ?? homeComposerSettings,
@@ -13807,7 +14078,7 @@ function useAgentGUINodeController({
13807
14078
  hasProviderSessionNotFoundError,
13808
14079
  pendingApproval
13809
14080
  ]);
13810
- const canSubmit = !providerTargetsLoading && 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;
14081
+ 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
14082
  const canQueueWhileBusy = Boolean(activeConversationId) && (activeConversationBusy || isSubmitting || Boolean(activeSessionState?.pendingInteractive));
13812
14083
  useEffect4(() => {
13813
14084
  const firstVersion = minFiniteMessageVersion(activeMessages);
@@ -13921,7 +14192,9 @@ function useAgentGUINodeController({
13921
14192
  "models"
13922
14193
  );
13923
14194
  const optionsLoading = isSettingsLoading || isModelOptionsLoading;
13924
- const providerSupport = composerSupportForProvider(data.provider);
14195
+ const providerSupport = composerSupportForProvider(
14196
+ composerTargetData.provider
14197
+ );
13925
14198
  const selectedModelValue = draftModel;
13926
14199
  const selectedReasoningEffortValue = draftReasoningEffort;
13927
14200
  const selectedSpeedValue = draftSpeed;
@@ -13946,7 +14219,7 @@ function useAgentGUINodeController({
13946
14219
  supportsComputerUse: composerSupport.computer,
13947
14220
  supportsPermissionMode: supportsPermissionMode || optionsLoading && providerSupport.permission,
13948
14221
  supportsPlanMode: composerSupport.plan,
13949
- planExclusiveWithPermissionMode: data.provider === "claude-code",
14222
+ planExclusiveWithPermissionMode: composerTargetData.provider === "claude-code",
13950
14223
  isSettingsLoading,
13951
14224
  isModelOptionsLoading,
13952
14225
  modelUnavailable: activeConversationId !== null && sessionSettings === null && composerSupport.model && draftModel === null,
@@ -13963,7 +14236,7 @@ function useAgentGUINodeController({
13963
14236
  availableModels: composerSupport.model && hasOptionsSource && activeSessionModelSelection !== null ? activeSessionModelSelection.options : [],
13964
14237
  availableReasoningEfforts: composerSupport.reasoning && hasOptionsSource && activeSessionReasoningSelection !== null ? activeSessionReasoningSelection.options : [],
13965
14238
  availableSpeeds: composerSupport.speed && hasOptionsSource && activeSessionSpeedSelection !== null ? activeSessionSpeedSelection.options : [],
13966
- availablePermissionModes: supportsPermissionMode ? permissionModeOptions(data.provider, permissionConfig) : []
14239
+ availablePermissionModes: supportsPermissionMode ? permissionModeOptions(composerTargetData.provider, permissionConfig) : []
13967
14240
  };
13968
14241
  }, [
13969
14242
  activeConversationId,
@@ -13972,7 +14245,7 @@ function useAgentGUINodeController({
13972
14245
  activeSessionReasoningSelection,
13973
14246
  activeSessionSpeedSelection,
13974
14247
  activeSessionRuntimeContext,
13975
- data.provider,
14248
+ composerTargetData.provider,
13976
14249
  draftSettings.permissionModeId,
13977
14250
  draftSettings.planMode,
13978
14251
  providerComposerOptions,
@@ -13984,19 +14257,6 @@ function useAgentGUINodeController({
13984
14257
  draftSpeed
13985
14258
  ]);
13986
14259
  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
14260
  const updateConversationFilter = useCallback4(
14001
14261
  (filter) => {
14002
14262
  if (!canUseConversationTargetFilter) {
@@ -14026,9 +14286,15 @@ function useAgentGUINodeController({
14026
14286
  if (nextTarget.disabled === true) {
14027
14287
  return;
14028
14288
  }
14029
- const shouldUseProviderTargetRef = normalizedExplicitProviderTargets.some(
14289
+ const nextTargetIsExplicit = normalizedExplicitProviderTargets.some(
14030
14290
  (target) => target.provider === nextTarget.provider && target.targetId === nextTarget.targetId && agentGUIProviderTargetRefsEqual(target.ref, nextTarget.ref)
14031
14291
  );
14292
+ const nextTargetData = composerTargetDataFromProviderTarget({
14293
+ current: dataRef.current,
14294
+ isExplicit: nextTargetIsExplicit,
14295
+ target: nextTarget
14296
+ });
14297
+ setHomeComposerTargetOverride(nextTarget);
14032
14298
  const previous = activeConversationIdRef.current;
14033
14299
  if (previous) {
14034
14300
  void activation.unactivate(previous);
@@ -14042,26 +14308,33 @@ function useAgentGUINodeController({
14042
14308
  setDetailError(null);
14043
14309
  persistActiveConversation(null);
14044
14310
  onDataChangeRef.current((current) => {
14045
- const nextAgentTargetId = shouldUseProviderTargetRef ? nextTarget.agentTargetId ?? null : null;
14311
+ const currentNextTargetData = composerTargetDataFromProviderTarget({
14312
+ current,
14313
+ isExplicit: nextTargetIsExplicit,
14314
+ target: nextTarget
14315
+ });
14316
+ const nextAgentTargetId = currentNextTargetData.agentTargetId;
14317
+ const currentTargetId = current.agentTargetId ?? current.providerTargetId ?? null;
14318
+ const nextTargetId = nextAgentTargetId ?? nextTarget.targetId;
14319
+ const providerTargetChanged = current.provider !== nextProvider || (currentTargetId !== null || nextAgentTargetId !== null) && currentTargetId !== nextTargetId;
14046
14320
  const nextData = {
14047
14321
  ...current,
14048
- provider: nextProvider,
14049
- agentTargetId: nextAgentTargetId,
14322
+ provider: currentNextTargetData.provider,
14323
+ agentTargetId: currentNextTargetData.agentTargetId,
14050
14324
  lastActiveAgentSessionId: null,
14051
- providerTargetId: null,
14052
- providerTargetRef: null
14325
+ providerTargetId: currentNextTargetData.providerTargetId,
14326
+ providerTargetRef: currentNextTargetData.providerTargetRef,
14327
+ composerOverrides: providerTargetChanged ? null : current.composerOverrides
14053
14328
  };
14054
14329
  dataRef.current = nextData;
14055
14330
  return nextData;
14056
14331
  });
14057
- window.setTimeout(() => {
14058
- loadDraftComposerOptions({ force: true });
14059
- }, 0);
14332
+ loadComposerOptionsForTarget(nextTargetData, { force: true });
14060
14333
  },
14061
14334
  [
14062
14335
  activation,
14063
14336
  defaultProviderTargetId,
14064
- loadDraftComposerOptions,
14337
+ loadComposerOptionsForTarget,
14065
14338
  normalizedExplicitProviderTargets,
14066
14339
  normalizedProviderTargets,
14067
14340
  persistActiveConversation,
@@ -14088,16 +14361,11 @@ function useAgentGUINodeController({
14088
14361
  const agentTargetId = nextTarget.agentTargetId?.trim() ?? "";
14089
14362
  const nextFilter = agentTargetId ? { kind: "agentTarget", agentTargetId } : { kind: "all" };
14090
14363
  setConversationFilter(nextFilter);
14091
- selectProvider({
14092
- provider: nextTarget.provider,
14093
- providerTargetId: nextTarget.targetId
14094
- });
14095
14364
  },
14096
14365
  [
14097
14366
  canUseConversationTargetFilter,
14098
14367
  defaultProviderTargetId,
14099
14368
  normalizedProviderTargets,
14100
- selectProvider,
14101
14369
  shouldFallbackToLocalProviderTargets
14102
14370
  ]
14103
14371
  );
@@ -14159,6 +14427,7 @@ function useAgentGUINodeController({
14159
14427
  const stableUpdateConversationFilter = useStableControllerEventCallback(
14160
14428
  updateConversationFilter
14161
14429
  );
14430
+ const viewData = activeConversationId === null ? selectedComposerTargetData.data : data;
14162
14431
  const controllerActions = useMemo4(
14163
14432
  () => ({
14164
14433
  updateConversationFilter: stableUpdateConversationFilter,
@@ -14231,8 +14500,8 @@ function useAgentGUINodeController({
14231
14500
  workspaceId,
14232
14501
  workspacePath,
14233
14502
  currentUserId,
14234
- data,
14235
- selectedProviderTarget,
14503
+ data: viewData,
14504
+ selectedProviderTarget: effectiveSelectedProviderTarget,
14236
14505
  providerTargets: normalizedProviderTargets,
14237
14506
  providerTargetsLoading,
14238
14507
  conversationScope,
@@ -14304,7 +14573,7 @@ function useAgentGUINodeController({
14304
14573
  conversationDetail,
14305
14574
  controllerActions,
14306
14575
  data,
14307
- selectedProviderTarget,
14576
+ effectiveSelectedProviderTarget,
14308
14577
  normalizedProviderTargets,
14309
14578
  providerTargetsLoading,
14310
14579
  detailError,
@@ -14332,7 +14601,7 @@ function useAgentGUINodeController({
14332
14601
  pendingDeleteProjectConversations,
14333
14602
  pendingApproval,
14334
14603
  pendingInteractivePrompt,
14335
- selectedProviderTarget.disabled,
14604
+ effectiveSelectedProviderTarget.disabled,
14336
14605
  queuedPrompts,
14337
14606
  drainingQueuedPromptId,
14338
14607
  currentUserId,
@@ -14340,6 +14609,7 @@ function useAgentGUINodeController({
14340
14609
  workspacePath,
14341
14610
  stableComposerSettings,
14342
14611
  sessionChrome,
14612
+ viewData,
14343
14613
  userProjects,
14344
14614
  visibleConversations
14345
14615
  ]
@@ -18220,6 +18490,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
18220
18490
  const removeMentionLabelRef = useRef8(removeMentionLabel);
18221
18491
  const availableSkillsRef = useRef8(availableSkills);
18222
18492
  const availableCapabilitiesRef = useRef8(availableCapabilities);
18493
+ const suppressPastedAtSuggestionRef = useRef8(false);
18223
18494
  const scrollFrameRef = useRef8(null);
18224
18495
  const [contextMenu, setContextMenu] = useState7(null);
18225
18496
  const closeContextMenu = useCallback6(() => {
@@ -18230,6 +18501,12 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
18230
18501
  if (!currentEditor || currentEditor.isDestroyed || !text) {
18231
18502
  return;
18232
18503
  }
18504
+ suppressPastedAtSuggestionRef.current = text.includes("@") && !text.endsWith("@");
18505
+ if (suppressPastedAtSuggestionRef.current) {
18506
+ window.setTimeout(() => {
18507
+ suppressPastedAtSuggestionRef.current = false;
18508
+ }, 0);
18509
+ }
18233
18510
  currentEditor.chain().focus().insertContent(
18234
18511
  plainTextToAgentRichTextInlineContent(text, {
18235
18512
  capabilities: availableCapabilitiesRef.current,
@@ -18303,7 +18580,8 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
18303
18580
  enableSuggestions: enableFileMentionSuggestions,
18304
18581
  onSuggestionChange: (state) => onFileMentionSuggestionChangeRef.current?.(state),
18305
18582
  onSuggestionKeyDown: (event) => onFileMentionSuggestionKeyDownRef.current?.(event) ?? false,
18306
- removeActionAriaLabel: removeMentionLabelRef.current
18583
+ removeActionAriaLabel: removeMentionLabelRef.current,
18584
+ shouldSuppressSuggestion: () => suppressPastedAtSuggestionRef.current
18307
18585
  },
18308
18586
  { skills: availableSkillsRef.current },
18309
18587
  { capabilities: availableCapabilitiesRef.current }
@@ -18491,6 +18769,12 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
18491
18769
  currentEditor.state.doc.content.size
18492
18770
  );
18493
18771
  }
18772
+ suppressPastedAtSuggestionRef.current = text.includes("@") && !text.endsWith("@");
18773
+ if (suppressPastedAtSuggestionRef.current) {
18774
+ window.setTimeout(() => {
18775
+ suppressPastedAtSuggestionRef.current = false;
18776
+ }, 0);
18777
+ }
18494
18778
  currentEditor.commands.insertContent(
18495
18779
  plainTextToAgentRichTextInlineContent(text, {
18496
18780
  capabilities: availableCapabilitiesRef.current,
@@ -19837,7 +20121,7 @@ function AgentUsageChip({
19837
20121
  var composerStyles = {
19838
20122
  footerGroup: AgentGUINode_styles_default.composerFooterLeft,
19839
20123
  footerGroupRight: AgentGUINode_styles_default.composerFooterRight,
19840
- dropdownSurface: "nodrag isolate rounded-[12px] border border-hairline bg-background-fronted p-[4px] text-foreground shadow-[var(--tsh-shell-shadow)] [-webkit-app-region:no-drag]"
20124
+ 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
20125
  };
19842
20126
  var workspaceReferenceSelectValue = "__tutti_workspace_reference_idle__";
19843
20127
  var workspaceReferenceOptionValue = "__tutti_workspace_reference_add__";
@@ -23051,6 +23335,8 @@ function AgentGUINodeView({
23051
23335
  isAgentProviderReady,
23052
23336
  slashStatusLimits = [],
23053
23337
  slashStatusLimitsLoading = false,
23338
+ railConfigProvider,
23339
+ railSlashStatusLimits,
23054
23340
  previewMode = false,
23055
23341
  onAgentProviderLogin,
23056
23342
  actions,
@@ -23393,9 +23679,14 @@ function AgentGUINodeView({
23393
23679
  "--agent-gui-detail-min-width": `${detailMinWidthPx}px`,
23394
23680
  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
23681
  };
23682
+ const effectiveRailConfigProvider = railConfigProvider === void 0 ? viewModel.data.provider : railConfigProvider;
23683
+ const effectiveRailSlashStatusLimits = railSlashStatusLimits ?? slashStatusLimits;
23396
23684
  const openAgentEnvSetup = useCallback10(() => {
23397
- openAgentEnvPanel({ provider: viewModel.data.provider, focus: null });
23398
- }, [viewModel.data.provider]);
23685
+ if (!effectiveRailConfigProvider) {
23686
+ return;
23687
+ }
23688
+ openAgentEnvPanel({ provider: effectiveRailConfigProvider, focus: null });
23689
+ }, [effectiveRailConfigProvider]);
23399
23690
  const conversationRailStoreState = useMemo10(
23400
23691
  () => ({
23401
23692
  activeConversationId: viewModel.activeConversationId,
@@ -23410,7 +23701,8 @@ function AgentGUINodeView({
23410
23701
  createConversationDisabled,
23411
23702
  openclawGateway,
23412
23703
  isCollapsed: conversationRailCollapsed,
23413
- slashStatusLimits,
23704
+ railConfigProvider: effectiveRailConfigProvider,
23705
+ slashStatusLimits: effectiveRailSlashStatusLimits,
23414
23706
  selectedProviderTarget: viewModel.selectedProviderTarget,
23415
23707
  providerTargets: viewModel.providerTargets,
23416
23708
  providerTargetsLoading: viewModel.providerTargetsLoading,
@@ -23453,7 +23745,8 @@ function AgentGUINodeView({
23453
23745
  retryOpenclawGateway,
23454
23746
  selectConversation,
23455
23747
  selectProjectDirectory,
23456
- slashStatusLimits,
23748
+ effectiveRailConfigProvider,
23749
+ effectiveRailSlashStatusLimits,
23457
23750
  viewModel.selectedProviderTarget,
23458
23751
  viewModel.providerTargets,
23459
23752
  viewModel.providerTargetsLoading,
@@ -24353,6 +24646,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
24353
24646
  }),
24354
24647
  [bottomDockComposerProps]
24355
24648
  );
24649
+ const emptyHeroProvider = viewModel.selectedProviderTarget?.provider ?? viewModel.data.provider;
24356
24650
  const bottomDockStoreState = useMemo10(
24357
24651
  () => ({
24358
24652
  // The lifted prompt is rendered from props on the pane; the store still
@@ -24637,7 +24931,7 @@ var AgentGUIDetailPane = memo(function AgentGUIDetailPane2({
24637
24931
  children: !hasActiveConversation ? /* @__PURE__ */ jsx31(
24638
24932
  AgentGUIEmptyHeroPane,
24639
24933
  {
24640
- provider: viewModel.data.provider,
24934
+ provider: emptyHeroProvider,
24641
24935
  emptyLabel: labels.empty,
24642
24936
  emptyProvider: labels.emptyProvider ?? "",
24643
24937
  inlineNoticeChrome,
@@ -24964,7 +25258,7 @@ function syncAgentGUIConversationRailStore(store, next) {
24964
25258
  Object.assign(store, next);
24965
25259
  }
24966
25260
  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;
25261
+ 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
25262
  }
24969
25263
  var AgentGUIConversationRailStorePane = memo(
24970
25264
  function AgentGUIConversationRailStorePane2({
@@ -25231,6 +25525,7 @@ var AgentGUIConversationRailPane = memo(
25231
25525
  createConversationDisabled,
25232
25526
  openclawGateway,
25233
25527
  isCollapsed,
25528
+ railConfigProvider,
25234
25529
  slashStatusLimits,
25235
25530
  providerTargets,
25236
25531
  providerTargetsLoading,
@@ -25486,7 +25781,7 @@ var AgentGUIConversationRailPane = memo(
25486
25781
  })
25487
25782
  }
25488
25783
  ),
25489
- /* @__PURE__ */ jsx31("div", { className: "shrink-0 px-2 py-1.5", children: /* @__PURE__ */ jsxs17(Popover, { children: [
25784
+ railConfigProvider ? /* @__PURE__ */ jsx31("div", { className: "shrink-0 px-2 py-1.5", children: /* @__PURE__ */ jsxs17(Popover, { children: [
25490
25785
  /* @__PURE__ */ jsx31(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs17(
25491
25786
  Button,
25492
25787
  {
@@ -25548,7 +25843,7 @@ var AgentGUIConversationRailPane = memo(
25548
25843
  ] })
25549
25844
  }
25550
25845
  )
25551
- ] }) }),
25846
+ ] }) }) : null,
25552
25847
  /* @__PURE__ */ jsx31(
25553
25848
  ConfirmationDialog,
25554
25849
  {
@@ -26909,8 +27204,24 @@ function filterSlashStatusQuotasForModel(quotas, selectedModel) {
26909
27204
  function normalizeSlashStatusModelName(value) {
26910
27205
  return value?.trim().toLowerCase().replace(/[^a-z0-9]+/gu, "-").replace(/^-+|-+$/gu, "") ?? "";
26911
27206
  }
27207
+ function resolveAgentGUIRailStatusProvider(input) {
27208
+ if (input.conversationScope !== "multi-provider") {
27209
+ return input.activeProvider;
27210
+ }
27211
+ const filter = input.conversationFilter;
27212
+ if (filter.kind !== "agentTarget") {
27213
+ return null;
27214
+ }
27215
+ const target = input.providerTargets.find(
27216
+ (candidate) => candidate.disabled !== true && (candidate.agentTargetId?.trim() ?? "") === filter.agentTargetId
27217
+ );
27218
+ return target ? target.provider : null;
27219
+ }
26912
27220
  function agentGuiStateEquals(left, right) {
26913
- return left === right || left.provider === right.provider && (left.agentTargetId ?? null) === (right.agentTargetId ?? null) && 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(
27221
+ return left === right || left.provider === right.provider && (left.agentTargetId ?? null) === (right.agentTargetId ?? null) && (left.providerTargetId ?? null) === (right.providerTargetId ?? null) && agentGUIProviderTargetRefsEqual(
27222
+ left.providerTargetRef,
27223
+ right.providerTargetRef
27224
+ ) && 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
27225
  left.composerOverridesByProvider,
26915
27226
  right.composerOverridesByProvider
26916
27227
  ) && composerOverridesByAgentTargetIdEqual(
@@ -26948,11 +27259,11 @@ function composerOverridesByAgentTargetIdEqual(left, right) {
26948
27259
  return true;
26949
27260
  }
26950
27261
  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(
27262
+ 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
27263
  previous.workspaceAgentProbes,
26953
27264
  next.workspaceAgentProbes,
26954
27265
  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;
27266
+ )) && 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
27267
  }
26957
27268
  var AgentGUINode = memo2(function AgentGUINode2({
26958
27269
  nodeId,
@@ -27679,6 +27990,20 @@ var AgentGUINode = memo2(function AgentGUINode2({
27679
27990
  const windowTitle = collapsedWindowConversationTitle || (isConversationRailCollapsed ? activeConversationWindowTitle : null) || windowAgentTitle || title;
27680
27991
  const windowTitleIconUrl = agentGuiDockIconUrls[activeProvider] ?? null;
27681
27992
  const activeProbeProvider = activeProvider;
27993
+ const railStatusProvider = useMemo11(
27994
+ () => resolveAgentGUIRailStatusProvider({
27995
+ activeProvider: activeProbeProvider,
27996
+ conversationFilter: viewModel.conversationFilter,
27997
+ conversationScope: viewModel.conversationScope,
27998
+ providerTargets: viewModel.providerTargets
27999
+ }),
28000
+ [
28001
+ activeProbeProvider,
28002
+ viewModel.conversationFilter,
28003
+ viewModel.conversationScope,
28004
+ viewModel.providerTargets
28005
+ ]
28006
+ );
27682
28007
  const activeAgentProbe = useMemo11(
27683
28008
  () => findWorkspaceAgentProbeForDockProvider(
27684
28009
  workspaceAgentProbes?.snapshot ?? null,
@@ -27686,6 +28011,13 @@ var AgentGUINode = memo2(function AgentGUINode2({
27686
28011
  ),
27687
28012
  [activeProbeProvider, workspaceAgentProbes?.snapshot]
27688
28013
  );
28014
+ const railAgentProbe = useMemo11(
28015
+ () => railStatusProvider ? findWorkspaceAgentProbeForDockProvider(
28016
+ workspaceAgentProbes?.snapshot ?? null,
28017
+ railStatusProvider
28018
+ ) : null,
28019
+ [railStatusProvider, workspaceAgentProbes?.snapshot]
28020
+ );
27689
28021
  const isActiveAgentProviderReady = useMemo11(() => {
27690
28022
  const managedAgent = getAgentHostManagedToolchainAgentByName(activeProbeProvider);
27691
28023
  if (!managedAgent) {
@@ -27719,6 +28051,11 @@ var AgentGUINode = memo2(function AgentGUINode2({
27719
28051
  viewModel.composerSettings.selectedModelValue
27720
28052
  ]
27721
28053
  );
28054
+ const railSlashStatusQuotaSource = railStatusProvider && railAgentProbe?.usage?.quotas && railAgentProbe.usage.quotas.length > 0 ? railAgentProbe.usage.quotas : [];
28055
+ const railSlashStatusLimits = useMemo11(
28056
+ () => slashStatusLimitsFromQuotas(railSlashStatusQuotaSource, null, t),
28057
+ [railSlashStatusQuotaSource, t]
28058
+ );
27722
28059
  const agentProbeLines = useMemo11(() => {
27723
28060
  return buildDockAgentProbeTooltipLines(
27724
28061
  activeAgentProbe,
@@ -27745,6 +28082,22 @@ var AgentGUINode = memo2(function AgentGUINode2({
27745
28082
  onAgentProbeDemandChange(null, probeSourceId);
27746
28083
  };
27747
28084
  }, [activeProbeProvider, nodeId, onAgentProbeDemandChange, previewMode]);
28085
+ useEffect14(() => {
28086
+ if (previewMode || !onAgentProbeDemandChange || !railStatusProvider || railStatusProvider === activeProbeProvider) {
28087
+ return;
28088
+ }
28089
+ const probeSourceId = `agent-gui:${nodeId}:rail`;
28090
+ onAgentProbeDemandChange(railStatusProvider, probeSourceId);
28091
+ return () => {
28092
+ onAgentProbeDemandChange(null, probeSourceId);
28093
+ };
28094
+ }, [
28095
+ activeProbeProvider,
28096
+ nodeId,
28097
+ onAgentProbeDemandChange,
28098
+ previewMode,
28099
+ railStatusProvider
28100
+ ]);
27748
28101
  const handleAgentProbeInfoOpen = useCallback12(() => {
27749
28102
  if (previewMode || !onAgentProbeRefreshRequest) {
27750
28103
  return;
@@ -27831,6 +28184,8 @@ var AgentGUINode = memo2(function AgentGUINode2({
27831
28184
  isAgentProviderReady: isActiveAgentProviderReady,
27832
28185
  slashStatusLimits,
27833
28186
  slashStatusLimitsLoading: workspaceAgentProbes?.isLoadingUsage ?? false,
28187
+ railConfigProvider: railStatusProvider,
28188
+ railSlashStatusLimits,
27834
28189
  previewMode,
27835
28190
  onLinkAction: handleLinkAction,
27836
28191
  capabilityMenuState,
@@ -27915,12 +28270,15 @@ export {
27915
28270
  createLocalAgentGUIProviderTarget,
27916
28271
  createLocalAgentGUIProviderTargets,
27917
28272
  getAgentActivityRuntime,
28273
+ getAgentCustomMentionKind,
27918
28274
  getOptionalAgentActivityRuntime,
27919
28275
  localAgentGUIProviderTargetId,
27920
28276
  normalizeAgentGUIProviderTargets,
27921
28277
  preloadAgentMentionBrowse,
27922
28278
  projectCoreSessionStatus,
28279
+ registerAgentCustomMentionKind,
27923
28280
  resetAgentActivityRuntimeForTests,
28281
+ resetAgentCustomMentionKindsForTests,
27924
28282
  resetAgentQueuedPromptRuntimeForTests,
27925
28283
  resolveAgentGUIExpandedWindowFrame,
27926
28284
  resolveAgentGUIProviderTarget,