@tutti-os/agent-gui 0.0.104 → 0.0.106

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 (81) hide show
  1. package/dist/{AgentGUI-DQ9gVoXh.d.ts → AgentGUI-Do6py-T_.d.ts} +10 -5
  2. package/dist/AgentRichTextReadonly-F6PHC5SX.js +18 -0
  3. package/dist/AgentRichTextReadonly-F6PHC5SX.js.map +1 -0
  4. package/dist/agent-conversation/index.d.ts +3 -3
  5. package/dist/agent-conversation/index.js +11 -7
  6. package/dist/agent-conversation/index.js.map +1 -1
  7. package/dist/agent-gui.d.ts +4 -4
  8. package/dist/agent-gui.js +18 -14
  9. package/dist/agent-message-center/index.d.ts +1 -1
  10. package/dist/agent-message-center/index.js +13 -9
  11. package/dist/agent-message-center/index.js.map +1 -1
  12. package/dist/{agentConversationVM-CkcYM5Wg.d.ts → agentConversationVM-Bf3Zv3iI.d.ts} +9 -1
  13. package/dist/{agentFileMentionContracts-58IjMU-u.d.ts → agentFileMentionContracts-B70VnPWO.d.ts} +2 -0
  14. package/dist/{agentGuiNodeTypes-B9vcvjmR.d.ts → agentGuiNodeTypes-DbgQBiYz.d.ts} +4 -1
  15. package/dist/app/renderer/agentactivity.css +99 -0
  16. package/dist/{chunk-7N524ZK7.js → chunk-4HSLSSPJ.js} +1387 -941
  17. package/dist/chunk-4HSLSSPJ.js.map +1 -0
  18. package/dist/{chunk-FJ4W2VC5.js → chunk-4ZWV57MF.js} +42 -10
  19. package/dist/chunk-4ZWV57MF.js.map +1 -0
  20. package/dist/{chunk-TPV2SV6L.js → chunk-7MPN2JGL.js} +122 -154
  21. package/dist/chunk-7MPN2JGL.js.map +1 -0
  22. package/dist/{chunk-747L443E.js → chunk-BXOKBZH4.js} +728 -77
  23. package/dist/chunk-BXOKBZH4.js.map +1 -0
  24. package/dist/{chunk-5X7YDOC6.js → chunk-D2JUDUYY.js} +1 -1
  25. package/dist/chunk-D2JUDUYY.js.map +1 -0
  26. package/dist/{chunk-HLVC4NNL.js → chunk-IR2CL2X2.js} +721 -1280
  27. package/dist/chunk-IR2CL2X2.js.map +1 -0
  28. package/dist/{chunk-NOXQOGT5.js → chunk-J2HG7UCP.js} +46 -22
  29. package/dist/chunk-J2HG7UCP.js.map +1 -0
  30. package/dist/chunk-KPMQGPYU.js +43 -0
  31. package/dist/chunk-KPMQGPYU.js.map +1 -0
  32. package/dist/{chunk-OFSDOID4.js → chunk-LDZ6C3YV.js} +3 -39
  33. package/dist/chunk-LDZ6C3YV.js.map +1 -0
  34. package/dist/{chunk-MUPZPISC.js → chunk-N4WVVCNI.js} +2 -2
  35. package/dist/{chunk-F5LFPORI.js → chunk-OWW7CU4U.js} +2 -2
  36. package/dist/{chunk-VAB7EIL5.js → chunk-P3CVAWGJ.js} +19 -8
  37. package/dist/chunk-P3CVAWGJ.js.map +1 -0
  38. package/dist/chunk-SN6UYX54.js +42 -0
  39. package/dist/chunk-SN6UYX54.js.map +1 -0
  40. package/dist/{chunk-SKCLZXSW.js → chunk-TKBEVCHG.js} +5 -1
  41. package/dist/chunk-TKBEVCHG.js.map +1 -0
  42. package/dist/chunk-UFIEUC3Y.js +755 -0
  43. package/dist/chunk-UFIEUC3Y.js.map +1 -0
  44. package/dist/{chunk-AKKDP2LI.js → chunk-V5ROOS2O.js} +124 -2
  45. package/dist/chunk-V5ROOS2O.js.map +1 -0
  46. package/dist/chunk-XJ34OIEQ.js +18 -0
  47. package/dist/chunk-XJ34OIEQ.js.map +1 -0
  48. package/dist/{chunk-QI3JAO4J.js → chunk-ZSJBCZUH.js} +54 -7
  49. package/dist/chunk-ZSJBCZUH.js.map +1 -0
  50. package/dist/context-mention-palette/index.d.ts +1 -1
  51. package/dist/context-mention-palette/index.js +10 -8
  52. package/dist/{contribution-CTVBPN0R.d.ts → contribution-C6K5YfJ7.d.ts} +1 -0
  53. package/dist/custom-mention.d.ts +6 -0
  54. package/dist/custom-mention.js +1 -1
  55. package/dist/i18n/index.d.ts +4 -0
  56. package/dist/i18n/index.js +2 -2
  57. package/dist/index.d.ts +6 -6
  58. package/dist/index.js +18 -14
  59. package/dist/index.js.map +1 -1
  60. package/dist/mention-search.d.ts +47 -7
  61. package/dist/mention-search.js +8 -6
  62. package/dist/workbench/contribution.d.ts +1 -1
  63. package/dist/workbench/contribution.js +3 -3
  64. package/dist/workbench/index.d.ts +3 -2
  65. package/dist/workbench/index.js +3 -3
  66. package/dist/workbench/sessionTitle.js +2 -2
  67. package/package.json +12 -12
  68. package/dist/chunk-5X7YDOC6.js.map +0 -1
  69. package/dist/chunk-747L443E.js.map +0 -1
  70. package/dist/chunk-7N524ZK7.js.map +0 -1
  71. package/dist/chunk-AKKDP2LI.js.map +0 -1
  72. package/dist/chunk-FJ4W2VC5.js.map +0 -1
  73. package/dist/chunk-HLVC4NNL.js.map +0 -1
  74. package/dist/chunk-NOXQOGT5.js.map +0 -1
  75. package/dist/chunk-OFSDOID4.js.map +0 -1
  76. package/dist/chunk-QI3JAO4J.js.map +0 -1
  77. package/dist/chunk-SKCLZXSW.js.map +0 -1
  78. package/dist/chunk-TPV2SV6L.js.map +0 -1
  79. package/dist/chunk-VAB7EIL5.js.map +0 -1
  80. /package/dist/{chunk-MUPZPISC.js.map → chunk-N4WVVCNI.js.map} +0 -0
  81. /package/dist/{chunk-F5LFPORI.js.map → chunk-OWW7CU4U.js.map} +0 -0
@@ -9,19 +9,23 @@ import {
9
9
  resolveAgentGuiSessionProviderFlatIconUrl,
10
10
  resolveNextAgentGUIConversationRailWidthPx,
11
11
  shouldAutoCollapseAgentGUIConversationRail
12
- } from "./chunk-QI3JAO4J.js";
12
+ } from "./chunk-ZSJBCZUH.js";
13
13
  import {
14
14
  AGENT_PROVIDERS,
15
15
  AGENT_PROVIDER_LABEL,
16
16
  deriveAgentGUIOptimisticConversationTitle,
17
17
  isAgentGUIProviderUnresolved,
18
18
  normalizeAgentGUIProviderIdentity,
19
+ resolveAgentGUIConversationBrowserFreeTitle,
19
20
  resolveAgentGUIConversationDisplayTitle,
20
21
  resolveAgentGUIConversationTitle,
22
+ resolveAgentGUIConversationTitleDisplayPrompt,
23
+ resolveAgentGUIConversationTitleLeadingMentionKind,
21
24
  resolveAgentGUIExplicitConversationTitle,
25
+ resolveAgentGUIFirstUserMessageDisplayPrompt,
22
26
  resolveAgentGUIProviderDisplayLabel,
23
27
  resolveAgentGUIProviderIdentity
24
- } from "./chunk-AKKDP2LI.js";
28
+ } from "./chunk-V5ROOS2O.js";
25
29
  import {
26
30
  resolveAgentGuiWorkbenchProviderLabel
27
31
  } from "./chunk-L3GMMGRS.js";
@@ -30,48 +34,50 @@ import {
30
34
  Button,
31
35
  MAX_AGENT_COMPOSER_DRAFT_IMAGES,
32
36
  agentComposerDraftAttachmentProjection,
33
- agentComposerDraftDisplayPrompt,
34
37
  agentComposerDraftFiles,
35
38
  agentComposerDraftHasContent,
36
39
  agentComposerDraftImages,
37
40
  agentComposerDraftLargeTexts,
38
41
  agentComposerDraftPrompt,
39
- agentComposerDraftToPromptContent,
40
42
  agentPromptContentDisplayText,
41
43
  agentPromptContentHasImage,
42
44
  agentPromptContentImageBlocks,
43
45
  agentPromptContentToComposerDraft,
44
- agentRichTextContentToPromptText,
45
46
  buildAgentComposerDraft,
46
47
  buildWorkspaceAgentSessionDetailViewModel,
47
- createAgentRichTextInputExtensions,
48
- editorToPromptText,
49
48
  emptyAgentComposerDraft,
50
49
  getAppErrorCode,
51
50
  isWorkspaceAgentToolCallItem,
52
- labelForProviderSkill,
53
51
  materializePastedTextInstructions,
54
52
  normalizeAgentPromptContentBlocks,
55
53
  pastedTextPreview,
56
- plainTextToAgentRichTextDoc,
57
- plainTextToAgentRichTextInlineContent,
54
+ projectAgentComposerDraftSubmission,
58
55
  projectAgentConversationVM,
56
+ resolveWorkspaceAgentNoticeCommandSemantics,
59
57
  resolveWorkspaceAgentToolName,
60
- skillDescriptionForDisplay,
61
- skillTriggerForPrefix,
62
58
  snapshotAgentComposerDraft,
63
59
  textPromptContent,
64
60
  toLocalShortDateTime,
65
61
  updateAgentComposerDraft,
66
62
  useProjectedAgentConversation
67
- } from "./chunk-HLVC4NNL.js";
63
+ } from "./chunk-IR2CL2X2.js";
64
+ import {
65
+ agentRichTextContentToPromptText,
66
+ createAgentRichTextInputExtensions,
67
+ editorToPromptText,
68
+ labelForProviderSkill,
69
+ plainTextToAgentRichTextDoc,
70
+ plainTextToAgentRichTextInlineContent,
71
+ skillDescriptionForDisplay,
72
+ skillTriggerForPrefix
73
+ } from "./chunk-UFIEUC3Y.js";
68
74
  import {
69
75
  openAgentEnvPanel
70
76
  } from "./chunk-7BXWPI4F.js";
71
77
  import {
72
78
  AgentFileMentionPalette,
73
79
  agentMentionItemKey
74
- } from "./chunk-VAB7EIL5.js";
80
+ } from "./chunk-P3CVAWGJ.js";
75
81
  import {
76
82
  normalizeAgentGUIAgents,
77
83
  projectAgentGUIAgentsToInternalTargets
@@ -82,17 +88,18 @@ import {
82
88
  DEFAULT_AGENT_MENTION_FILTER,
83
89
  agentGuiScheduler,
84
90
  buildWorkspaceAgentActivityListViewModel
85
- } from "./chunk-747L443E.js";
91
+ } from "./chunk-BXOKBZH4.js";
86
92
  import {
87
93
  AGENT_RICH_TEXT_CARET_ANCHOR,
88
94
  createAgentSessionMarkdownLink,
89
95
  createAgentSessionMentionHref,
90
96
  exitAgentFileMentionSuggestion,
91
97
  formatAgentMentionMarkdown,
98
+ materializeAgentCustomMentionPromptText,
92
99
  mentionItemToAttrs,
93
100
  normalizeAgentSessionMentionTitle,
94
101
  parseMentionItemFromHref
95
- } from "./chunk-NOXQOGT5.js";
102
+ } from "./chunk-J2HG7UCP.js";
96
103
  import {
97
104
  AgentInteractivePromptSurface,
98
105
  PLAN_IMPLEMENTATION_ACTION_FEEDBACK,
@@ -102,34 +109,38 @@ import {
102
109
  dispatchAgentPlanPromptAction,
103
110
  latestPlanTurnId,
104
111
  planImplementationPromptFromPlanTurn
105
- } from "./chunk-FJ4W2VC5.js";
112
+ } from "./chunk-4ZWV57MF.js";
106
113
  import {
107
114
  useEngineSelector
108
115
  } from "./chunk-2RQM7PJN.js";
109
116
  import {
110
117
  AgentMessageMarkdown,
111
- AgentTargetPresentationProvider,
112
118
  ZoomableImage,
119
+ resolveWorkspaceLinkAction
120
+ } from "./chunk-7MPN2JGL.js";
121
+ import {
122
+ AgentTargetPresentationProvider,
113
123
  cn,
114
124
  resolveAgentTargetPresentation,
115
- resolveWorkspaceLinkAction,
116
125
  useAgentTargetPresentations
117
- } from "./chunk-TPV2SV6L.js";
126
+ } from "./chunk-KPMQGPYU.js";
118
127
  import {
119
128
  resolveWorkspaceAgentSessionSortTimeUnixMs
120
129
  } from "./chunk-YMXYBG7U.js";
121
130
  import {
122
131
  AgentActivityHostProvider,
123
- MANAGED_AGENT_ICON_FALLBACK_URL,
124
- MANAGED_AGENT_ICON_URLS,
125
- MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS,
126
132
  getOptionalAgentHostApi,
127
133
  useAgentActivityRuntime,
128
134
  useAgentActivitySnapshot,
129
135
  useAgentHostApi,
130
136
  useOptionalAgentActivityRuntime,
131
137
  useOptionalAgentHostApi
132
- } from "./chunk-OFSDOID4.js";
138
+ } from "./chunk-LDZ6C3YV.js";
139
+ import {
140
+ MANAGED_AGENT_ICON_FALLBACK_URL,
141
+ MANAGED_AGENT_ICON_URLS,
142
+ MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS
143
+ } from "./chunk-SN6UYX54.js";
133
144
  import {
134
145
  normalizeManagedAgentProvider
135
146
  } from "./chunk-H6IQ63DQ.js";
@@ -137,7 +148,7 @@ import {
137
148
  AgentGuiI18nProvider,
138
149
  translate,
139
150
  useTranslation
140
- } from "./chunk-F5LFPORI.js";
151
+ } from "./chunk-OWW7CU4U.js";
141
152
  import {
142
153
  migratedAgentGUIProviderIdentityCatalog,
143
154
  resolveAgentGUIProviderCatalogIdentity,
@@ -150,7 +161,7 @@ import {
150
161
 
151
162
  // AgentGUI.tsx
152
163
  import { memo as memo15 } from "react";
153
- import { TooltipProvider as TooltipProvider6 } from "@tutti-os/ui-system";
164
+ import { TooltipProvider as TooltipProvider5 } from "@tutti-os/ui-system";
154
165
 
155
166
  // agent-gui/agentGuiNode/AgentGUINode.tsx
156
167
  import { memo as memo14, useCallback as useCallback50, useEffect as useEffect39, useMemo as useMemo39 } from "react";
@@ -2008,7 +2019,7 @@ import {
2008
2019
  selectEngineSessionIsRespondingToInteraction as selectEngineSessionIsRespondingToInteraction2,
2009
2020
  selectWorkspaceAgentConsumerSessions as selectWorkspaceAgentConsumerSessions2
2010
2021
  } from "@tutti-os/agent-activity-core";
2011
- import { useCallback as useCallback24, useEffect as useEffect14, useMemo as useMemo18, useRef as useRef16 } from "react";
2022
+ import { useCallback as useCallback24, useEffect as useEffect14, useMemo as useMemo18, useRef as useRef17 } from "react";
2012
2023
 
2013
2024
  // host/agentHostAccountStore.ts
2014
2025
  import { create as create2 } from "zustand";
@@ -2207,7 +2218,7 @@ function projectWorkspaceAgentMessagesToTimelineItems(messages) {
2207
2218
  occurredAtUnixMs
2208
2219
  });
2209
2220
  }
2210
- if (kind === "text" && role === "user") {
2221
+ if ((kind === "text" || kind === "session_audit") && role === "user") {
2211
2222
  return messageTimelineItem({
2212
2223
  message,
2213
2224
  id,
@@ -2222,8 +2233,9 @@ function projectWorkspaceAgentMessagesToTimelineItems(messages) {
2222
2233
  });
2223
2234
  }
2224
2235
  if (kind === "text" && (role === "assistant" || role === "agent")) {
2236
+ const projectedMessage = normalizeLegacyCompactNotice(message, payload);
2225
2237
  return messageTimelineItem({
2226
- message,
2238
+ message: projectedMessage,
2227
2239
  id,
2228
2240
  seq,
2229
2241
  eventId,
@@ -2231,7 +2243,7 @@ function projectWorkspaceAgentMessagesToTimelineItems(messages) {
2231
2243
  actorType: "agent",
2232
2244
  itemType: "message.assistant",
2233
2245
  role: "assistant",
2234
- content: messageText(message),
2246
+ content: messageText(projectedMessage),
2235
2247
  occurredAtUnixMs
2236
2248
  });
2237
2249
  }
@@ -2264,6 +2276,40 @@ function projectWorkspaceAgentMessagesToTimelineItems(messages) {
2264
2276
  });
2265
2277
  });
2266
2278
  }
2279
+ function normalizeLegacyCompactNotice(message, payload) {
2280
+ const commandSemantics = resolveWorkspaceAgentNoticeCommandSemantics({
2281
+ eventId: message.messageId,
2282
+ messageSemantics: message.semantics,
2283
+ payload,
2284
+ status: message.status
2285
+ });
2286
+ if (commandSemantics?.command !== "compact") {
2287
+ return message;
2288
+ }
2289
+ const commandStatus = commandSemantics.commandStatus;
2290
+ const title = stringValue(payload.title) || (commandStatus === "completed" ? "Context compacted." : commandStatus === "running" ? "Compacting context." : "Context compaction interrupted.");
2291
+ const originalText = messageText(message);
2292
+ const detail = stringValue(payload.detail) || (commandStatus === "failed" || commandStatus === "canceled" ? originalText.replace(/^Compacting failed:\s*/iu, "").trim() : "");
2293
+ return {
2294
+ ...message,
2295
+ semantics: {
2296
+ ...message.semantics,
2297
+ noticeCommand: "compact",
2298
+ noticeCommandStatus: commandStatus
2299
+ },
2300
+ payload: {
2301
+ ...payload,
2302
+ kind: "agent_system_notice",
2303
+ noticeKind: stringValue(payload.noticeKind) || "system_notice",
2304
+ noticeCommand: "compact",
2305
+ noticeCommandStatus: commandStatus,
2306
+ title,
2307
+ text: title,
2308
+ content: title,
2309
+ ...detail ? { detail } : {}
2310
+ }
2311
+ };
2312
+ }
2267
2313
  function latestMessageSnapshots(messages) {
2268
2314
  const latestByKey = /* @__PURE__ */ new Map();
2269
2315
  const unkeyedMessages = [];
@@ -2283,9 +2329,11 @@ function latestMessageSnapshots(messages) {
2283
2329
  return [...unkeyedMessages, ...latestByKey.values()];
2284
2330
  }
2285
2331
  function mergeMessageSnapshot(previous, next) {
2332
+ const semantics = previous?.semantics || next.semantics ? { ...previous?.semantics, ...next.semantics } : void 0;
2286
2333
  return {
2287
2334
  ...previous,
2288
2335
  ...next,
2336
+ ...semantics ? { semantics } : {},
2289
2337
  payload: {
2290
2338
  ...previous?.payload ?? {},
2291
2339
  ...next.payload ?? {}
@@ -2324,6 +2372,7 @@ function messageTimelineItem({
2324
2372
  itemType,
2325
2373
  role,
2326
2374
  status: message.status,
2375
+ ...message.semantics ? { messageSemantics: message.semantics } : {},
2327
2376
  content,
2328
2377
  payload: normalizedPayload(message.payload),
2329
2378
  ...occurredAtUnixMs !== void 0 ? { occurredAtUnixMs } : {},
@@ -3253,6 +3302,7 @@ function conversationSummaryFromAgentSession(session, options = {}) {
3253
3302
  session.activeTurnId ? "working" : "idle"
3254
3303
  ),
3255
3304
  cwd: session.cwd?.trim() ?? "",
3305
+ railSectionKey: session.railSectionKey,
3256
3306
  project: resolveConversationProject(session, projectResolver),
3257
3307
  ...isExternalImportNoProjectSession(session) ? { projectMode: "none" } : {},
3258
3308
  pinnedAtUnixMs: session.pinnedAtUnixMs ?? null,
@@ -4991,7 +5041,12 @@ function toRuntimeSendContent(content) {
4991
5041
  return materializePastedTextInstructions(content, {
4992
5042
  header: () => translate("agentHost.agentGui.pastedTextFilesHeader"),
4993
5043
  line: (preview, path) => translate("agentHost.agentGui.pastedTextFileLine", { preview, path })
4994
- });
5044
+ }).map(
5045
+ (block) => block.type === "text" ? {
5046
+ ...block,
5047
+ text: materializeAgentCustomMentionPromptText(block.text ?? "").trim()
5048
+ } : block
5049
+ );
4995
5050
  }
4996
5051
  function shouldClearSubmittedDraft(input) {
4997
5052
  return Boolean(
@@ -5284,16 +5339,16 @@ function conversationDetailSessionsEqual(left, right) {
5284
5339
  return left.workspaceId === right.workspaceId && left.agentSessionId === right.agentSessionId && left.userId === right.userId && left.agentTargetId === right.agentTargetId && left.provider === right.provider && left.providerSessionId === right.providerSessionId && left.model === right.model && left.resumable === right.resumable && left.endedAtUnixMs === right.endedAtUnixMs && left.title === right.title && left.pinnedAtUnixMs === right.pinnedAtUnixMs && left.createdAtUnixMs === right.createdAtUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.cwd === right.cwd && left.activeTurnId === right.activeTurnId && left.activeTurn?.updatedAtUnixMs === right.activeTurn?.updatedAtUnixMs && left.latestTurn?.updatedAtUnixMs === right.latestTurn?.updatedAtUnixMs && left.pendingInteractions === right.pendingInteractions && left.latestTurnInteractions === right.latestTurnInteractions;
5285
5340
  }
5286
5341
  function conversationSummariesRenderEqual(left, right) {
5287
- return left.id === right.id && left.userId === right.userId && left.provider === right.provider && left.title === right.title && conversationTitleFallbacksRenderEqual(
5342
+ return left.id === right.id && left.userId === right.userId && left.provider === right.provider && left.title === right.title && left.titleLeadingMentionKind === right.titleLeadingMentionKind && conversationTitleFallbacksRenderEqual(
5288
5343
  left.titleFallback,
5289
5344
  right.titleFallback
5290
- ) && left.status === right.status && left.cwd === right.cwd && left.pinnedAtUnixMs === right.pinnedAtUnixMs && left.sortTimeUnixMs === right.sortTimeUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.projectionSource === right.projectionSource && left.isImported === right.isImported && left.hasUnreadCompletion === right.hasUnreadCompletion && left.unreadCompletionKey === right.unreadCompletionKey && conversationProjectsRenderEqual(left.project, right.project);
5345
+ ) && left.status === right.status && left.cwd === right.cwd && left.railSectionKey === right.railSectionKey && left.pinnedAtUnixMs === right.pinnedAtUnixMs && left.sortTimeUnixMs === right.sortTimeUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.projectionSource === right.projectionSource && left.isImported === right.isImported && left.hasUnreadCompletion === right.hasUnreadCompletion && left.unreadCompletionKey === right.unreadCompletionKey && conversationProjectsRenderEqual(left.project, right.project);
5291
5346
  }
5292
5347
  function conversationTitleFallbacksRenderEqual(left, right) {
5293
5348
  return left === right || JSON.stringify(left ?? null) === JSON.stringify(right ?? null);
5294
5349
  }
5295
5350
  function conversationProjectsRenderEqual(left, right) {
5296
- return left === right || (!left || !right ? !left && !right : left.id === right.id && left.path === right.path && left.label === right.label && left.createdAtUnixMs === right.createdAtUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.lastUsedAtUnixMs === right.lastUsedAtUnixMs);
5351
+ return left === right || (!left || !right ? !left && !right : left.id === right.id && left.path === right.path && left.sectionKey === right.sectionKey && left.label === right.label && left.createdAtUnixMs === right.createdAtUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.lastUsedAtUnixMs === right.lastUsedAtUnixMs);
5297
5352
  }
5298
5353
  function draftAgentSessionIdFromComposerOptions(options) {
5299
5354
  return normalizeConfigOptionValue(options?.draftAgentSessionId);
@@ -5811,6 +5866,7 @@ function useAgentGUIActivation({
5811
5866
  ...input.initialContent ? { content: input.initialContent } : {},
5812
5867
  ...input.cwd !== void 0 ? { cwd: input.cwd } : {},
5813
5868
  expiresAtUnixMs: requestedAtUnixMs + ACTIVATION_EXPIRY_MS,
5869
+ ...input.initialTurnExpected !== void 0 ? { initialTurnExpected: input.initialTurnExpected } : {},
5814
5870
  ...input.initialDisplayPrompt ? { initialDisplayPrompt: input.initialDisplayPrompt } : {},
5815
5871
  ...input.runtimeContent ? { runtimeContent: input.runtimeContent } : {},
5816
5872
  ...input.submitDiagnostics ? { submitDiagnostics: input.submitDiagnostics } : {},
@@ -6432,21 +6488,66 @@ import {
6432
6488
  selectPendingActivations,
6433
6489
  selectWorkspaceReconcileState
6434
6490
  } from "@tutti-os/agent-activity-core";
6435
- function projectCanonicalAgentGUIConversationSummaries(sessions) {
6491
+
6492
+ // shared/agentConversationRailTitlePromptSelector.ts
6493
+ import {
6494
+ selectSessionMessagesById
6495
+ } from "@tutti-os/agent-activity-core";
6496
+ function createAgentGUIConversationRailTitlePromptSelector() {
6497
+ let previous = {};
6498
+ return (state) => {
6499
+ const next = {};
6500
+ for (const [agentSessionId, messages] of Object.entries(
6501
+ selectSessionMessagesById(state)
6502
+ )) {
6503
+ const displayPrompt = resolveAgentGUIFirstUserMessageDisplayPrompt(messages);
6504
+ if (displayPrompt) {
6505
+ next[agentSessionId] = displayPrompt;
6506
+ }
6507
+ }
6508
+ if (agentGUIConversationRailTitlePromptsEqual(previous, next)) {
6509
+ return previous;
6510
+ }
6511
+ previous = next;
6512
+ return previous;
6513
+ };
6514
+ }
6515
+ function agentGUIConversationRailTitlePromptsEqual(left, right) {
6516
+ const leftKeys = Object.keys(left);
6517
+ const rightKeys = Object.keys(right);
6518
+ return leftKeys.length === rightKeys.length && leftKeys.every((key) => left[key] === right[key]);
6519
+ }
6520
+
6521
+ // contexts/workspace/presentation/renderer/agentGuiConversationList/useAgentGuiConversationList.ts
6522
+ var EMPTY_AGENT_GUI_AGENT_TARGETS = [];
6523
+ function projectCanonicalAgentGUIConversationSummaries(sessions, firstUserDisplayPromptsBySessionId = {}) {
6436
6524
  return sessions.map((item) => {
6437
6525
  const provider = resolveAgentGUIProviderIdentity({
6438
6526
  sessionProvider: item.session.provider
6439
6527
  });
6440
- const { title, titleFallback } = resolveAgentGUIConversationTitle(
6528
+ const { title: canonicalTitle } = resolveAgentGUIConversationTitle(
6441
6529
  item.session.title
6442
6530
  );
6531
+ const firstUserDisplayPrompt = firstUserDisplayPromptsBySessionId[item.session.agentSessionId];
6532
+ const titleDisplayPrompt = resolveAgentGUIConversationTitleDisplayPrompt({
6533
+ firstUserDisplayPrompt,
6534
+ title: canonicalTitle
6535
+ });
6536
+ const { title, titleFallback } = resolveAgentGUIConversationTitle(
6537
+ resolveAgentGUIConversationBrowserFreeTitle({
6538
+ firstUserDisplayPrompt,
6539
+ title: canonicalTitle
6540
+ })
6541
+ );
6443
6542
  const canonicalUpdatedAtUnixMs = item.session.updatedAtUnixMs ?? item.session.createdAtUnixMs ?? 0;
6543
+ const titleLeadingMentionKind = resolveAgentGUIConversationTitleLeadingMentionKind(titleDisplayPrompt);
6444
6544
  return {
6445
6545
  agentTargetId: item.session.agentTargetId ?? null,
6446
6546
  cwd: item.session.cwd,
6447
6547
  id: item.session.agentSessionId,
6448
6548
  pinnedAtUnixMs: item.session.pinnedAtUnixMs ?? null,
6449
6549
  provider,
6550
+ railSectionKey: item.session.railSectionKey,
6450
6551
  resumable: item.session.resumable,
6451
6552
  sortTimeUnixMs: resolveWorkspaceAgentSessionSortTimeUnixMs({
6452
6553
  createdAtUnixMs: item.session.createdAtUnixMs,
@@ -6454,13 +6555,14 @@ function projectCanonicalAgentGUIConversationSummaries(sessions) {
6454
6555
  }),
6455
6556
  status: item.displayStatus === "idle" ? "ready" : item.displayStatus,
6456
6557
  title,
6558
+ titleLeadingMentionKind,
6457
6559
  titleFallback,
6458
6560
  updatedAtUnixMs: canonicalUpdatedAtUnixMs,
6459
6561
  userId: item.session.userId?.trim() ?? ""
6460
6562
  };
6461
6563
  });
6462
6564
  }
6463
- function useAgentGuiConversationList(engine, query, agentTargets = []) {
6565
+ function useAgentGuiConversationList(engine, query, agentTargets = EMPTY_AGENT_GUI_AGENT_TARGETS) {
6464
6566
  const workspaceReconcile = useEngineSelector(
6465
6567
  engine,
6466
6568
  selectWorkspaceReconcileState
@@ -6475,6 +6577,15 @@ function useAgentGuiConversationList(engine, query, agentTargets = []) {
6475
6577
  selectPendingActivations,
6476
6578
  pendingActivationsEqual
6477
6579
  );
6580
+ const selectRailTitlePrompts = useMemo5(
6581
+ () => createAgentGUIConversationRailTitlePromptSelector(),
6582
+ [engine]
6583
+ );
6584
+ const firstUserDisplayPromptsBySessionId = useEngineSelector(
6585
+ engine,
6586
+ selectRailTitlePrompts,
6587
+ Object.is
6588
+ );
6478
6589
  return useMemo5(() => {
6479
6590
  if (!query) return null;
6480
6591
  const canonicalIds = new Set(
@@ -6494,9 +6605,24 @@ function useAgentGuiConversationList(engine, query, agentTargets = []) {
6494
6605
  const provider = resolveAgentGUIProviderIdentity({
6495
6606
  sessionProvider: target?.provider ?? query.provider
6496
6607
  });
6497
- const { title, titleFallback } = resolveAgentGUIConversationTitle(
6608
+ const { title: canonicalTitle } = resolveAgentGUIConversationTitle(
6498
6609
  activation.optimisticTitle ?? activation.title ?? ""
6499
6610
  );
6611
+ const titleDisplayPrompt = resolveAgentGUIConversationTitleDisplayPrompt({
6612
+ activation,
6613
+ allowEmptyTitle: true,
6614
+ title: canonicalTitle
6615
+ });
6616
+ const { title, titleFallback } = resolveAgentGUIConversationTitle(
6617
+ resolveAgentGUIConversationBrowserFreeTitle({
6618
+ activation,
6619
+ allowEmptyTitle: true,
6620
+ title: canonicalTitle
6621
+ })
6622
+ );
6623
+ const titleLeadingMentionKind = resolveAgentGUIConversationTitleLeadingMentionKind(
6624
+ titleDisplayPrompt
6625
+ );
6500
6626
  return {
6501
6627
  agentTargetId: activation.agentTargetId,
6502
6628
  cwd: activation.cwd,
@@ -6506,6 +6632,7 @@ function useAgentGuiConversationList(engine, query, agentTargets = []) {
6506
6632
  status: "working",
6507
6633
  projectionSource: "pending_activation",
6508
6634
  title,
6635
+ titleLeadingMentionKind,
6509
6636
  titleFallback,
6510
6637
  updatedAtUnixMs: activation.requestedAtUnixMs,
6511
6638
  userId: query.userId
@@ -6515,7 +6642,8 @@ function useAgentGuiConversationList(engine, query, agentTargets = []) {
6515
6642
  ...projectCanonicalAgentGUIConversationSummaries(
6516
6643
  sessions.filter(
6517
6644
  (item) => item.session.workspaceId === query.workspaceId
6518
- )
6645
+ ),
6646
+ firstUserDisplayPromptsBySessionId
6519
6647
  ).map((conversation) => {
6520
6648
  const canonicalUpdatedAtUnixMs = conversation.updatedAtUnixMs;
6521
6649
  const activation = latestNewActivationBySessionId.get(conversation.id);
@@ -6523,11 +6651,27 @@ function useAgentGuiConversationList(engine, query, agentTargets = []) {
6523
6651
  const optimisticTitle = activation?.optimisticTitle?.trim() ?? "";
6524
6652
  const shouldUseOptimisticTitle = conversation.title.trim().length === 0 && optimisticTitle.length > 0;
6525
6653
  const projectedTitle = shouldUseOptimisticTitle ? optimisticTitle : activationIsNewer && activation?.title ? activation.title : conversation.title;
6526
- const { title, titleFallback } = resolveAgentGUIConversationTitle(projectedTitle);
6654
+ const { title: projectedCanonicalTitle } = resolveAgentGUIConversationTitle(projectedTitle);
6655
+ const titleDisplayPrompt = resolveAgentGUIConversationTitleDisplayPrompt({
6656
+ activation,
6657
+ allowEmptyTitle: shouldUseOptimisticTitle,
6658
+ title: projectedCanonicalTitle
6659
+ });
6660
+ const { title, titleFallback } = resolveAgentGUIConversationTitle(
6661
+ resolveAgentGUIConversationBrowserFreeTitle({
6662
+ activation,
6663
+ allowEmptyTitle: shouldUseOptimisticTitle,
6664
+ title: projectedCanonicalTitle
6665
+ })
6666
+ );
6667
+ const titleLeadingMentionKind = resolveAgentGUIConversationTitleLeadingMentionKind(
6668
+ titleDisplayPrompt
6669
+ ) ?? conversation.titleLeadingMentionKind;
6527
6670
  return {
6528
6671
  ...conversation,
6529
6672
  sortTimeUnixMs: activationIsNewer ? activation.requestedAtUnixMs : conversation.sortTimeUnixMs,
6530
6673
  title,
6674
+ titleLeadingMentionKind,
6531
6675
  titleFallback,
6532
6676
  updatedAtUnixMs: activationIsNewer ? activation.requestedAtUnixMs : canonicalUpdatedAtUnixMs
6533
6677
  };
@@ -6557,7 +6701,14 @@ function useAgentGuiConversationList(engine, query, agentTargets = []) {
6557
6701
  query.sessionOrigin
6558
6702
  ].join("::")
6559
6703
  };
6560
- }, [agentTargets, pendingActivations, query, sessions, workspaceReconcile]);
6704
+ }, [
6705
+ agentTargets,
6706
+ firstUserDisplayPromptsBySessionId,
6707
+ pendingActivations,
6708
+ query,
6709
+ sessions,
6710
+ workspaceReconcile
6711
+ ]);
6561
6712
  }
6562
6713
  function pendingActivationsEqual(left, right) {
6563
6714
  return left.length === right.length && left.every((item, index) => item === right[index]);
@@ -6566,7 +6717,9 @@ function consumerSessionsEqual(left, right) {
6566
6717
  if (left.length !== right.length) return false;
6567
6718
  return left.every((item, index) => {
6568
6719
  const other = right[index];
6569
- return other !== void 0 && item.session === other.session && item.activeTurn === other.activeTurn && item.latestTurn === other.latestTurn && item.pendingInteractions === other.pendingInteractions && item.displayStatus === other.displayStatus;
6720
+ return other !== void 0 && item.session === other.session && item.activeTurn === other.activeTurn && item.latestTurn === other.latestTurn && item.pendingInteractions.length === other.pendingInteractions.length && item.pendingInteractions.every(
6721
+ (interaction, interactionIndex) => interaction === other.pendingInteractions[interactionIndex]
6722
+ ) && item.displayStatus === other.displayStatus;
6570
6723
  });
6571
6724
  }
6572
6725
 
@@ -6767,7 +6920,7 @@ function useAgentGUIComposerCapabilities(input) {
6767
6920
  import {
6768
6921
  selectLatestActivationForSession as selectLatestActivationForSession2
6769
6922
  } from "@tutti-os/agent-activity-core";
6770
- import { useCallback as useCallback7, useEffect as useEffect5 } from "react";
6923
+ import { useCallback as useCallback7, useEffect as useEffect5, useRef as useRef8 } from "react";
6771
6924
 
6772
6925
  // host/agentHostEventBus.ts
6773
6926
  var LOG_PREFIX = "[agent-host-event-bus]";
@@ -6923,6 +7076,10 @@ function subscribeCoalesced(type, options, callback) {
6923
7076
 
6924
7077
  // agent-gui/agentGuiNode/controller/useAgentGUIComposerOptionsSync.ts
6925
7078
  function useAgentGUIComposerOptionsSync(input) {
7079
+ const previousActiveConversationIdRef = useRef8(input.activeConversationId);
7080
+ const previousIsCreatingConversationRef = useRef8(
7081
+ input.isCreatingConversation
7082
+ );
6926
7083
  const loadComposerOptionsForTarget = useCallback7(
6927
7084
  (targetData, options) => {
6928
7085
  if (input.isCreatingConversation || !targetData.agentTargetId) return;
@@ -7018,8 +7175,12 @@ function useAgentGUIComposerOptionsSync(input) {
7018
7175
  }, [input.loadSessionState, input.previewMode, loadDraftComposerOptions]);
7019
7176
  useEffect5(() => {
7020
7177
  if (input.previewMode) return;
7178
+ const conversationActivated = input.activeConversationId !== null && previousActiveConversationIdRef.current !== input.activeConversationId;
7179
+ const conversationCreationSettled = previousIsCreatingConversationRef.current && !input.isCreatingConversation;
7180
+ previousActiveConversationIdRef.current = input.activeConversationId;
7181
+ previousIsCreatingConversationRef.current = input.isCreatingConversation;
7021
7182
  loadDraftComposerOptions(
7022
- input.providerComposerOptions?.behavior?.prewarmDraftSession === true && input.isComposerHome ? { force: true } : void 0
7183
+ conversationActivated || conversationCreationSettled || input.providerComposerOptions?.behavior?.prewarmDraftSession === true && input.isComposerHome ? { force: true } : void 0
7023
7184
  );
7024
7185
  }, [
7025
7186
  input.activeConversationId,
@@ -7067,54 +7228,54 @@ function useAgentGUIComposerOptionsSync(input) {
7067
7228
  }
7068
7229
 
7069
7230
  // agent-gui/agentGuiNode/controller/useAgentGUIControllerRefs.ts
7070
- import { useRef as useRef8 } from "react";
7231
+ import { useRef as useRef9 } from "react";
7071
7232
  function useAgentGUIControllerRefs(input) {
7072
- const activeConversationIdRef = useRef8(input.activeConversationId);
7073
- const selectedProjectPathRef = useRef8(input.selectedProjectPath);
7074
- const userProjectsRef = useRef8(input.userProjects);
7075
- const isNoProjectPathRef = useRef8(input.isNoProjectPath);
7076
- const userProjectsLoadSeqRef = useRef8(0);
7077
- const composerOptionsProjectKeyRef = useRef8(null);
7078
- const conversationsRef = useRef8(input.conversations);
7079
- const isMountedRef = useRef8(true);
7080
- const agentActivitySnapshotRef = useRef8(input.agentActivitySnapshot);
7081
- const dataRef = useRef8(input.data);
7082
- const selectedAgentTargetRef = useRef8(input.effectiveSelectedProviderTarget);
7083
- const selectedAgentTargetIsExplicitRef = useRef8(
7233
+ const activeConversationIdRef = useRef9(input.activeConversationId);
7234
+ const selectedProjectPathRef = useRef9(input.selectedProjectPath);
7235
+ const userProjectsRef = useRef9(input.userProjects);
7236
+ const isNoProjectPathRef = useRef9(input.isNoProjectPath);
7237
+ const userProjectsLoadSeqRef = useRef9(0);
7238
+ const composerOptionsProjectKeyRef = useRef9(null);
7239
+ const conversationsRef = useRef9(input.conversations);
7240
+ const isMountedRef = useRef9(true);
7241
+ const agentActivitySnapshotRef = useRef9(input.agentActivitySnapshot);
7242
+ const dataRef = useRef9(input.data);
7243
+ const selectedAgentTargetRef = useRef9(input.effectiveSelectedProviderTarget);
7244
+ const selectedAgentTargetIsExplicitRef = useRef9(
7084
7245
  input.homeComposerTargetOverride ? true : input.selectedAgentTargetIsExplicit
7085
7246
  );
7086
- const agentTargetsProvidedRef = useRef8(input.agentTargetsProvided);
7087
- const selectedComposerTargetDataRef = useRef8(
7247
+ const agentTargetsProvidedRef = useRef9(input.agentTargetsProvided);
7248
+ const selectedComposerTargetDataRef = useRef9(
7088
7249
  input.selectedComposerTargetData
7089
7250
  );
7090
- const draftByScopeKeyRef = useRef8(input.draftByScopeKey);
7091
- const draftSettingsBySessionIdRef = useRef8(input.draftSettingsBySessionId);
7092
- const onDataChangeRef = useRef8(input.onDataChange);
7093
- const onRememberComposerDefaultsRef = useRef8(
7251
+ const draftByScopeKeyRef = useRef9(input.draftByScopeKey);
7252
+ const draftSettingsBySessionIdRef = useRef9(input.draftSettingsBySessionId);
7253
+ const onDataChangeRef = useRef9(input.onDataChange);
7254
+ const onRememberComposerDefaultsRef = useRef9(
7094
7255
  input.onRememberComposerDefaults
7095
7256
  );
7096
- const onShowMessageRef = useRef8(input.onShowMessage);
7097
- const handledPrefillPromptSequenceRef = useRef8(null);
7098
- const handledComposerAppendSequenceRef = useRef8(null);
7099
- const loadDraftComposerOptionsRef = useRef8(() => {
7257
+ const onShowMessageRef = useRef9(input.onShowMessage);
7258
+ const handledPrefillPromptSequenceRef = useRef9(null);
7259
+ const handledComposerAppendSequenceRef = useRef9(null);
7260
+ const loadDraftComposerOptionsRef = useRef9(() => {
7100
7261
  });
7101
- const lastActiveModelByProviderRef = useRef8({});
7102
- const conversationIdsRef = useRef8(
7262
+ const lastActiveModelByProviderRef = useRef9({});
7263
+ const conversationIdsRef = useRef9(
7103
7264
  new Set(input.conversations.map((conversation) => conversation.id))
7104
7265
  );
7105
- const lastRenderStateDiagnosticKeyRef = useRef8(null);
7106
- const handledOpenSessionSequenceRef = useRef8(null);
7107
- const pendingOpenSessionRequestRef = useRef8(null);
7108
- const executePromptRef = useRef8(() => {
7266
+ const lastRenderStateDiagnosticKeyRef = useRef9(null);
7267
+ const handledOpenSessionSequenceRef = useRef9(null);
7268
+ const pendingOpenSessionRequestRef = useRef9(null);
7269
+ const executePromptRef = useRef9(() => {
7109
7270
  });
7110
- const submitPromptRef = useRef8(() => {
7271
+ const submitPromptRef = useRef9(() => {
7111
7272
  });
7112
- const reloadSelectedConversationRef = useRef8(() => {
7273
+ const reloadSelectedConversationRef = useRef9(() => {
7113
7274
  });
7114
- const syncConversationListProjectionRef = useRef8(async () => {
7275
+ const syncConversationListProjectionRef = useRef9(async () => {
7115
7276
  });
7116
- const isComposerHomeRef = useRef8(input.isComposerHome);
7117
- const isCreatingConversationRef = useRef8(input.isCreatingConversation);
7277
+ const isComposerHomeRef = useRef9(input.isComposerHome);
7278
+ const isCreatingConversationRef = useRef9(input.isCreatingConversation);
7118
7279
  activeConversationIdRef.current = input.activeConversationId;
7119
7280
  selectedProjectPathRef.current = input.selectedProjectPath;
7120
7281
  userProjectsRef.current = input.userProjects;
@@ -7179,9 +7340,26 @@ import { useCallback as useCallback18 } from "react";
7179
7340
 
7180
7341
  // agent-gui/agentGuiNode/controller/useAgentGUIComposerSettingsActions.ts
7181
7342
  import {
7182
- selectEngineSession
7343
+ selectEngineSession,
7344
+ selectEngineSessionSettingsUpdate
7183
7345
  } from "@tutti-os/agent-activity-core";
7184
7346
  import { useCallback as useCallback8 } from "react";
7347
+
7348
+ // agent-gui/agentGuiNode/model/composerModeSelection.ts
7349
+ function permissionModeSelectionPatch(permissionModeId, options) {
7350
+ return options.clearsPlanMode ? { permissionModeId, planMode: false } : { permissionModeId };
7351
+ }
7352
+ function resolvePermissionModeControlsDisabled(options) {
7353
+ if (options.changeDuringTurnSupported) {
7354
+ return options.isSubmittingPrompt;
7355
+ }
7356
+ return options.isSendingTurn || options.isSubmittingPrompt || options.showStopButton;
7357
+ }
7358
+ function shouldRetrySessionSettingsUpdate(status) {
7359
+ return status === "unknown";
7360
+ }
7361
+
7362
+ // agent-gui/agentGuiNode/controller/useAgentGUIComposerSettingsActions.ts
7185
7363
  function useAgentGUIComposerSettingsActions(input) {
7186
7364
  const {
7187
7365
  activation,
@@ -7333,27 +7511,35 @@ function useAgentGUIComposerSettingsActions(input) {
7333
7511
  }
7334
7512
  }
7335
7513
  if (Object.keys(sessionSettingsPatch).length > 0 && (canonicalSession !== null || isPreActivationSession)) {
7336
- void onRememberComposerDefaultsRef.current?.({
7337
- agentTargetId: normalizeOptionalText(dataRef.current.agentTargetId),
7338
- provider: dataRef.current.provider,
7339
- defaults: composerDefaultsPatchFromSettings(
7340
- sessionSettingsPatch,
7341
- sessionSettingsPatch
7342
- )
7343
- });
7344
- const durableNodeDefaultsPatch = {};
7345
- for (const field of rememberComposerDefaultsFields) {
7346
- if (sessionSettingsPatch[field] !== void 0) {
7347
- durableNodeDefaultsPatch[field] = sessionSettingsPatch[field];
7514
+ const rememberedDefaultsPatch = composerDefaultsPatchFromSettings(
7515
+ sessionSettingsPatch,
7516
+ sessionSettingsPatch
7517
+ );
7518
+ if (rememberedDefaultsPatch) {
7519
+ const defaultAgentTargetId = normalizeOptionalText(canonicalSession?.agentTargetId) ?? normalizeOptionalText(dataRef.current.agentTargetId);
7520
+ const defaultProvider = canonicalSession?.provider ?? dataRef.current.provider;
7521
+ void onRememberComposerDefaultsRef.current?.({
7522
+ agentTargetId: defaultAgentTargetId,
7523
+ provider: defaultProvider,
7524
+ defaults: rememberedDefaultsPatch
7525
+ });
7526
+ const durableNodeDefaultsPatch = {};
7527
+ for (const field of rememberComposerDefaultsFields) {
7528
+ if (sessionSettingsPatch[field] !== void 0) {
7529
+ durableNodeDefaultsPatch[field] = sessionSettingsPatch[field];
7530
+ }
7348
7531
  }
7349
- }
7350
- if (Object.keys(durableNodeDefaultsPatch).length > 0) {
7351
7532
  const defaultDraftKey = nodeDefaultDraftKey(
7352
- dataRef.current.provider,
7353
- dataRef.current.agentTargetId
7533
+ defaultProvider,
7534
+ defaultAgentTargetId
7354
7535
  );
7536
+ const defaultData = {
7537
+ ...dataRef.current,
7538
+ provider: defaultProvider,
7539
+ agentTargetId: defaultAgentTargetId
7540
+ };
7355
7541
  const storedNodeDefaults = readNodeDefaultDraftSettings({
7356
- data: dataRef.current,
7542
+ data: defaultData,
7357
7543
  defaultReasoningEffort,
7358
7544
  drafts: draftSettingsBySessionIdRef.current
7359
7545
  });
@@ -7370,7 +7556,14 @@ function useAgentGUIComposerSettingsActions(input) {
7370
7556
  [defaultDraftKey]: nextNodeDefaults
7371
7557
  }));
7372
7558
  onDataChangeRef.current(
7373
- (current) => nodeDataFromComposerSettings(current, nextNodeDefaults)
7559
+ (current) => nodeDataFromComposerSettings(
7560
+ {
7561
+ ...current,
7562
+ provider: defaultProvider,
7563
+ agentTargetId: defaultAgentTargetId
7564
+ },
7565
+ nextNodeDefaults
7566
+ )
7374
7567
  );
7375
7568
  }
7376
7569
  if (isPreActivationSession) {
@@ -7380,9 +7573,14 @@ function useAgentGUIComposerSettingsActions(input) {
7380
7573
  settings: { ...sessionSettingsPatch }
7381
7574
  });
7382
7575
  } else {
7576
+ const settingsUpdate = selectEngineSessionSettingsUpdate(
7577
+ sessionEngine.getSnapshot(),
7578
+ agentSessionId
7579
+ );
7383
7580
  sessionEngine.dispatch({
7384
7581
  agentSessionId,
7385
7582
  commandId: `settings:${createAgentGUIConversationId()}`,
7583
+ retry: shouldRetrySessionSettingsUpdate(settingsUpdate?.status),
7386
7584
  settings: { ...sessionSettingsPatch },
7387
7585
  timeoutMs: 3e4,
7388
7586
  type: "session/settingsUpdateRequested",
@@ -7407,12 +7605,12 @@ function useAgentGUIComposerSettingsActions(input) {
7407
7605
  }
7408
7606
 
7409
7607
  // agent-gui/agentGuiNode/controller/useAgentGUIContinueConversation.ts
7410
- import { useCallback as useCallback9, useRef as useRef9 } from "react";
7608
+ import { useCallback as useCallback9, useRef as useRef10 } from "react";
7411
7609
  function buildContinueInNewConversationDraft(input) {
7412
7610
  return updateAgentComposerDraft(input.sourceDraft, { prompt: input.prompt });
7413
7611
  }
7414
7612
  function useAgentGUIContinueConversation(input) {
7415
- const inputRef = useRef9(input);
7613
+ const inputRef = useRef10(input);
7416
7614
  inputRef.current = input;
7417
7615
  return useCallback9(() => {
7418
7616
  const current = inputRef.current;
@@ -7829,6 +8027,17 @@ import {
7829
8027
  } from "react";
7830
8028
 
7831
8029
  // agent-gui/agentGuiNode/controller/useAgentGUIComposerAppendRequest.ts
8030
+ function appendAgentGUIComposerPrompt(draft, incomingPrompt) {
8031
+ const currentPrompt = agentComposerDraftPrompt(draft);
8032
+ const normalizedPrompt = incomingPrompt.trim();
8033
+ if (!normalizedPrompt || currentPrompt.includes(normalizedPrompt)) {
8034
+ return draft;
8035
+ }
8036
+ const separator = currentPrompt && !/\s$/u.test(currentPrompt) ? " " : "";
8037
+ return updateAgentComposerDraft(draft, {
8038
+ prompt: `${currentPrompt}${separator}${normalizedPrompt} `
8039
+ });
8040
+ }
7832
8041
  function appendAgentGUIComposerFiles(draft, incomingFiles) {
7833
8042
  const files = agentComposerDraftFiles(draft);
7834
8043
  const knownIds = new Set(files.map((file) => file.id));
@@ -7856,7 +8065,10 @@ function resolveAgentGUIComposerAppendRequest(input) {
7856
8065
  const currentDraft = draftByScopeKey[draftKey] ?? emptyAgentComposerDraft();
7857
8066
  return {
7858
8067
  draftKey,
7859
- nextDraft: appendAgentGUIComposerFiles(currentDraft, request.files),
8068
+ nextDraft: appendAgentGUIComposerFiles(
8069
+ appendAgentGUIComposerPrompt(currentDraft, request.prompt ?? ""),
8070
+ request.files ?? []
8071
+ ),
7860
8072
  sequence: request.sequence
7861
8073
  };
7862
8074
  }
@@ -8271,7 +8483,7 @@ function useAgentGUINewConversationActivation(input) {
8271
8483
  isConversationStale
8272
8484
  } = input;
8273
8485
  const startConversation = useCallback14(
8274
- (initialContentInput, displayPrompt, submitOptions) => {
8486
+ (initialContentInput, displayPrompt, submitOptions, initialTurnExpected) => {
8275
8487
  const target = selectedAgentTargetRef.current;
8276
8488
  const targetData = selectedComposerTargetDataRef.current;
8277
8489
  if (target.disabled === true) {
@@ -8373,6 +8585,7 @@ function useAgentGUINewConversationActivation(input) {
8373
8585
  clientSubmitId: submitTrace.clientSubmitId,
8374
8586
  cwd: selectedProjectPath ?? "",
8375
8587
  initialContent: normalizedInitialContent,
8588
+ ...initialTurnExpected !== void 0 ? { initialTurnExpected } : {},
8376
8589
  initialDisplayPrompt,
8377
8590
  runtimeContent: toRuntimeSendContent(normalizedInitialContent),
8378
8591
  submitDiagnostics: agentSubmitTraceDiagnostics(submitTrace),
@@ -8678,6 +8891,29 @@ function resolveAgentGUIInteractionTarget(interactions, requestId) {
8678
8891
  }
8679
8892
 
8680
8893
  // agent-gui/agentGuiNode/controller/useAgentGUISubmitInteractionActions.ts
8894
+ function typedGoalControlFromComposer(content, _displayPrompt) {
8895
+ if (content.length !== 1 || content[0]?.type !== "text") {
8896
+ return null;
8897
+ }
8898
+ const prompt = (content[0].text ?? "").trim();
8899
+ const match = /^\/goal(?:\s+([\s\S]+))?$/iu.exec(prompt);
8900
+ const args = match?.[1]?.trim() ?? "";
8901
+ if (!match || !args) {
8902
+ return null;
8903
+ }
8904
+ switch (args.toLowerCase()) {
8905
+ case "clear":
8906
+ case "reset":
8907
+ return { action: "clear" };
8908
+ case "pause":
8909
+ return { action: "pause" };
8910
+ case "resume":
8911
+ case "active":
8912
+ return { action: "resume" };
8913
+ default:
8914
+ return { action: "set", objective: args };
8915
+ }
8916
+ }
8681
8917
  function useAgentGUISubmitInteractionActions(input) {
8682
8918
  const {
8683
8919
  activation,
@@ -8888,7 +9124,7 @@ function useAgentGUISubmitInteractionActions(input) {
8888
9124
  [activation, executePrompt, isSessionMarkedNonResumable, workspaceId]
8889
9125
  );
8890
9126
  const goalControl = useCallback17(
8891
- (action, objective) => {
9127
+ (action, objective, submittedDraftScopeKey) => {
8892
9128
  if (previewMode) {
8893
9129
  return;
8894
9130
  }
@@ -8896,6 +9132,13 @@ function useAgentGUISubmitInteractionActions(input) {
8896
9132
  if (!agentSessionId) {
8897
9133
  return;
8898
9134
  }
9135
+ const submittedDraftSnapshot = submittedDraftScopeKey ? {
9136
+ sourceScopeKey: submittedDraftScopeKey,
9137
+ content: snapshotAgentComposerDraft(
9138
+ draftByScopeKeyRef.current[submittedDraftScopeKey] ?? emptyAgentComposerDraft()
9139
+ ),
9140
+ targetAgentSessionId: agentSessionId
9141
+ } : null;
8899
9142
  setDetailError(null);
8900
9143
  void agentActivityRuntime.goalControl({
8901
9144
  workspaceId,
@@ -8903,6 +9146,16 @@ function useAgentGUISubmitInteractionActions(input) {
8903
9146
  action,
8904
9147
  ...objective !== void 0 ? { objective } : {}
8905
9148
  }).then(() => {
9149
+ if (submittedDraftSnapshot) {
9150
+ setDraftByScopeKey((current) => {
9151
+ const next = clearSubmittedDraftIfUnchanged({
9152
+ drafts: current,
9153
+ snapshot: submittedDraftSnapshot
9154
+ });
9155
+ draftByScopeKeyRef.current = next;
9156
+ return next;
9157
+ });
9158
+ }
8906
9159
  if (action !== "clear" || !isCurrentConversation(agentSessionId)) {
8907
9160
  return;
8908
9161
  }
@@ -8918,6 +9171,7 @@ function useAgentGUISubmitInteractionActions(input) {
8918
9171
  agentActivityRuntime,
8919
9172
  isCurrentConversation,
8920
9173
  previewMode,
9174
+ setDraftByScopeKey,
8921
9175
  setDetailError,
8922
9176
  setGoalClearNoticeSequence,
8923
9177
  workspaceId
@@ -8934,6 +9188,10 @@ function useAgentGUISubmitInteractionActions(input) {
8934
9188
  return;
8935
9189
  }
8936
9190
  const displayPromptText = displayPrompt && displayPrompt.trim() ? displayPrompt : void 0;
9191
+ const typedGoal = typedGoalControlFromComposer(
9192
+ normalizedContent,
9193
+ displayPromptText
9194
+ );
8937
9195
  if (!promptImagesSupported && agentPromptContentHasImage(normalizedContent)) {
8938
9196
  setDetailError(translate("agentHost.agentGui.promptImagesUnsupported"));
8939
9197
  return;
@@ -8968,6 +9226,14 @@ function useAgentGUISubmitInteractionActions(input) {
8968
9226
  setActiveConversationId(recoveredAgentSessionId);
8969
9227
  setIntent({ tag: "active", id: recoveredAgentSessionId });
8970
9228
  persistActiveConversation(recoveredAgentSessionId);
9229
+ if (typedGoal) {
9230
+ goalControl(
9231
+ typedGoal.action,
9232
+ typedGoal.objective,
9233
+ resolveAgentComposerDraftScopeKey({})
9234
+ );
9235
+ return;
9236
+ }
8971
9237
  submitExistingPrompt(
8972
9238
  recoveredAgentSessionId,
8973
9239
  normalizedContent,
@@ -8988,7 +9254,8 @@ function useAgentGUISubmitInteractionActions(input) {
8988
9254
  const activationResult = startConversation(
8989
9255
  normalizedContent,
8990
9256
  displayPromptText,
8991
- options
9257
+ options,
9258
+ typedGoal ? false : void 0
8992
9259
  );
8993
9260
  if (activationResult) {
8994
9261
  draftByScopeKeyRef.current = clearSubmittedAgentGUIHomeDraft({
@@ -9006,6 +9273,14 @@ function useAgentGUISubmitInteractionActions(input) {
9006
9273
  }
9007
9274
  return;
9008
9275
  }
9276
+ if (typedGoal) {
9277
+ goalControl(
9278
+ typedGoal.action,
9279
+ typedGoal.objective,
9280
+ resolveAgentComposerDraftScopeKey({ agentSessionId })
9281
+ );
9282
+ return;
9283
+ }
9009
9284
  submitExistingPrompt(
9010
9285
  agentSessionId,
9011
9286
  normalizedContent,
@@ -9021,6 +9296,7 @@ function useAgentGUISubmitInteractionActions(input) {
9021
9296
  conversationListQuery,
9022
9297
  previewMode,
9023
9298
  promptImagesSupported,
9299
+ goalControl,
9024
9300
  persistActiveConversation,
9025
9301
  startConversation,
9026
9302
  submitExistingPrompt,
@@ -10170,9 +10446,9 @@ function useAgentGUIControllerActions(actions) {
10170
10446
  import {
10171
10447
  selectEngineAvailableCommands
10172
10448
  } from "@tutti-os/agent-activity-core";
10173
- import { useEffect as useEffect9, useMemo as useMemo11, useRef as useRef10 } from "react";
10449
+ import { useEffect as useEffect9, useMemo as useMemo11, useRef as useRef11 } from "react";
10174
10450
  function useAgentGUIConversationDetail(input) {
10175
- const projectionConversationRef = useRef10(null);
10451
+ const projectionConversationRef = useRef11(null);
10176
10452
  const activeCanonicalLiveTurn = Boolean(
10177
10453
  input.activeTurn && input.activeTurn.phase !== "settled"
10178
10454
  );
@@ -10257,7 +10533,7 @@ function useAgentGUIConversationDetail(input) {
10257
10533
  }
10258
10534
  return conversationModels.conversation;
10259
10535
  }, [conversationDetail, conversationModels.conversation]);
10260
- const diagnosticKeyRef = useRef10(null);
10536
+ const diagnosticKeyRef = useRef11(null);
10261
10537
  useEffect9(() => {
10262
10538
  if (!input.activeConversationId || !conversation) {
10263
10539
  diagnosticKeyRef.current = null;
@@ -10348,9 +10624,9 @@ function useAgentGUIConversationDetail(input) {
10348
10624
  }
10349
10625
 
10350
10626
  // agent-gui/agentGuiNode/controller/useAgentGUIConversationPresentation.ts
10351
- import { useEffect as useEffect10, useMemo as useMemo12, useRef as useRef11 } from "react";
10627
+ import { useEffect as useEffect10, useMemo as useMemo12, useRef as useRef12 } from "react";
10352
10628
  function useAgentGUIConversationPresentation(input) {
10353
- const visibleConversationsRef = useRef11(
10629
+ const visibleConversationsRef = useRef12(
10354
10630
  null
10355
10631
  );
10356
10632
  const conversationProjection = useMemo12(() => {
@@ -10381,7 +10657,7 @@ function useAgentGUIConversationPresentation(input) {
10381
10657
  input.userProjects
10382
10658
  ]);
10383
10659
  const visibleConversations = conversationProjection.visibleConversations;
10384
- const activeConversationRef = useRef11(
10660
+ const activeConversationRef = useRef12(
10385
10661
  null
10386
10662
  );
10387
10663
  const activeConversation = useMemo12(() => {
@@ -10512,10 +10788,10 @@ function useAgentGUIConversationPresentation(input) {
10512
10788
  import {
10513
10789
  useCallback as useCallback19,
10514
10790
  useEffect as useEffect11,
10515
- useRef as useRef12
10791
+ useRef as useRef13
10516
10792
  } from "react";
10517
10793
  function useAgentGUIProviderHome(input) {
10518
- const inputRef = useRef12(input);
10794
+ const inputRef = useRef13(input);
10519
10795
  inputRef.current = input;
10520
10796
  const resolveDefaultHomeComposerTarget = useCallback19(() => {
10521
10797
  const current = inputRef.current;
@@ -11317,7 +11593,7 @@ import {
11317
11593
  selectEngineSessionError,
11318
11594
  selectEngineSessionIsRespondingToInteraction,
11319
11595
  selectEngineSessionReconcile as selectEngineSessionReconcile2,
11320
- selectEngineSessionSettingsUpdate,
11596
+ selectEngineSessionSettingsUpdate as selectEngineSessionSettingsUpdate2,
11321
11597
  selectEngineSubmitAvailability,
11322
11598
  selectLatestActivationForSession as selectLatestActivationForSession4,
11323
11599
  selectLatestPendingSubmitForSession,
@@ -11447,7 +11723,7 @@ function useAgentGUISessionEngineState(input) {
11447
11723
  );
11448
11724
  const activeEngineSettingsUpdate = useEngineSelector(
11449
11725
  sessionEngine,
11450
- (state) => selectEngineSessionSettingsUpdate(state, activeConversationId)
11726
+ (state) => selectEngineSessionSettingsUpdate2(state, activeConversationId)
11451
11727
  );
11452
11728
  const activeEngineError = activeEngineLifecycleError ?? activeEngineInteractionError ?? activeEngineSettingsUpdate?.errorMessage ?? activeEngineQueueError;
11453
11729
  const isRespondingToInteraction = useEngineSelector(
@@ -11506,7 +11782,7 @@ import { useCallback as useCallback23, useMemo as useMemo17 } from "react";
11506
11782
  import { useCallback as useCallback22 } from "react";
11507
11783
 
11508
11784
  // contexts/workspace/presentation/renderer/agentSessions/useAgentSessionPagingState.ts
11509
- import { useCallback as useCallback20, useRef as useRef13, useState as useState5 } from "react";
11785
+ import { useCallback as useCallback20, useRef as useRef14, useState as useState5 } from "react";
11510
11786
  var EMPTY_ENTRY = {
11511
11787
  error: null,
11512
11788
  isLoadingMessages: false,
@@ -11514,7 +11790,7 @@ var EMPTY_ENTRY = {
11514
11790
  };
11515
11791
  function useAgentSessionPagingState() {
11516
11792
  const [entries, setEntries] = useState5({});
11517
- const entriesRef = useRef13(entries);
11793
+ const entriesRef = useRef14(entries);
11518
11794
  entriesRef.current = entries;
11519
11795
  const update = useCallback20(
11520
11796
  (ref, updater) => {
@@ -11560,7 +11836,7 @@ function sessionKey(ref) {
11560
11836
  }
11561
11837
 
11562
11838
  // contexts/workspace/presentation/renderer/agentSessions/useAgentSessionTransport.ts
11563
- import { useCallback as useCallback21, useRef as useRef14, useState as useState6 } from "react";
11839
+ import { useCallback as useCallback21, useRef as useRef15, useState as useState6 } from "react";
11564
11840
  var EMPTY_ENTRY2 = {
11565
11841
  olderMessages: [],
11566
11842
  hasOlderMessages: false,
@@ -11568,7 +11844,7 @@ var EMPTY_ENTRY2 = {
11568
11844
  };
11569
11845
  function useAgentSessionTransport() {
11570
11846
  const [entries, setEntries] = useState6({});
11571
- const entriesRef = useRef14(entries);
11847
+ const entriesRef = useRef15(entries);
11572
11848
  entriesRef.current = entries;
11573
11849
  const update = useCallback21(
11574
11850
  (ref, updater) => {
@@ -11845,7 +12121,7 @@ function useAgentGUISessionDetailTransport(input) {
11845
12121
  }
11846
12122
 
11847
12123
  // agent-gui/agentGuiNode/controller/useAgentGUILocalState.ts
11848
- import { useRef as useRef15, useState as useState7 } from "react";
12124
+ import { useRef as useRef16, useState as useState7 } from "react";
11849
12125
  function useAgentGUILocalState({
11850
12126
  data,
11851
12127
  userProjectsApi
@@ -11864,7 +12140,7 @@ function useAgentGUILocalState({
11864
12140
  data.lastActiveAgentSessionId === null
11865
12141
  );
11866
12142
  const [draftByScopeKey, setDraftByScopeKey] = useState7({});
11867
- const submittedDraftSnapshotsRef = useRef15({});
12143
+ const submittedDraftSnapshotsRef = useRef16({});
11868
12144
  const [draftSettingsBySessionId, setDraftSettingsBySessionId] = useState7({});
11869
12145
  const [isLoadingMessages, setIsLoadingMessages] = useState7(false);
11870
12146
  const [isDeletingConversation, setIsDeletingConversation] = useState7(false);
@@ -12042,9 +12318,9 @@ function useAgentGUINodeController({
12042
12318
  )
12043
12319
  )
12044
12320
  );
12045
- const updateComposerSettingsRef = useRef16(() => {
12321
+ const updateComposerSettingsRef = useRef17(() => {
12046
12322
  });
12047
- const planActionsRef = useRef16({ implement: () => {
12323
+ const planActionsRef = useRef17({ implement: () => {
12048
12324
  }, feedback: () => {
12049
12325
  }, skip: () => {
12050
12326
  } });
@@ -12063,7 +12339,7 @@ function useAgentGUINodeController({
12063
12339
  defaultReasoningEffort,
12064
12340
  providerComposerOptions
12065
12341
  } = composerCapabilities;
12066
- const planImplementationTurnIdRef = useRef16(null);
12342
+ const planImplementationTurnIdRef = useRef17(null);
12067
12343
  const accountProfilesByUserId = useAccountStore(
12068
12344
  (state) => state.profilesByUserId
12069
12345
  );
@@ -12449,10 +12725,10 @@ import {
12449
12725
  useCallback as useCallback48,
12450
12726
  useEffect as useEffect37,
12451
12727
  useMemo as useMemo37,
12452
- useRef as useRef42,
12728
+ useRef as useRef43,
12453
12729
  useState as useState36
12454
12730
  } from "react";
12455
- import { TooltipProvider as TooltipProvider5 } from "@tutti-os/ui-system";
12731
+ import { TooltipProvider as TooltipProvider4 } from "@tutti-os/ui-system";
12456
12732
 
12457
12733
  // shared/workspaceSettingsPanel/workspaceSettingsPanelStore.ts
12458
12734
  import { useSnapshot } from "valtio";
@@ -12596,6 +12872,7 @@ var styles = {
12596
12872
  conversationStatusGlyph: "agent-gui-node__conversation-status-glyph",
12597
12873
  conversationTime: "agent-gui-node__conversation-time",
12598
12874
  conversationTitle: "agent-gui-node__conversation-title",
12875
+ conversationTitleMentionIcon: "agent-gui-node__conversation-title-mention-icon",
12599
12876
  conversationTitleRow: "agent-gui-node__conversation-title-row",
12600
12877
  conversationUnreadLamp: "agent-gui-node__conversation-unread-lamp",
12601
12878
  detailHeader: "agent-gui-node__detail-header",
@@ -12683,7 +12960,7 @@ var styles = {
12683
12960
  var AgentGUINode_styles_default = styles;
12684
12961
 
12685
12962
  // agent-gui/agentGuiNode/view/agentGUIViewUtils.ts
12686
- import { useCallback as useCallback25, useLayoutEffect, useMemo as useMemo19, useRef as useRef17 } from "react";
12963
+ import { useCallback as useCallback25, useLayoutEffect, useMemo as useMemo19, useRef as useRef18 } from "react";
12687
12964
  function objectRecord(value) {
12688
12965
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
12689
12966
  }
@@ -12701,14 +12978,14 @@ function stringValue3(value) {
12701
12978
  return typeof value === "string" ? value : "";
12702
12979
  }
12703
12980
  function useStableEventCallback(callback) {
12704
- const callbackRef = useRef17(callback);
12981
+ const callbackRef = useRef18(callback);
12705
12982
  useLayoutEffect(() => {
12706
12983
  callbackRef.current = callback;
12707
12984
  }, [callback]);
12708
12985
  return useCallback25((...args) => callbackRef.current(...args), []);
12709
12986
  }
12710
12987
  function useOptionalStableEventCallback(callback) {
12711
- const callbackRef = useRef17(callback);
12988
+ const callbackRef = useRef18(callback);
12712
12989
  useLayoutEffect(() => {
12713
12990
  callbackRef.current = callback;
12714
12991
  }, [callback]);
@@ -13335,10 +13612,10 @@ import {
13335
13612
  memo as memo4,
13336
13613
  useCallback as useCallback40,
13337
13614
  useMemo as useMemo30,
13338
- useRef as useRef31,
13615
+ useRef as useRef32,
13339
13616
  useState as useState24
13340
13617
  } from "react";
13341
- import { Tooltip as Tooltip6, TooltipContent as TooltipContent6, TooltipTrigger as TooltipTrigger6 } from "@tutti-os/ui-system";
13618
+ import { Tooltip as Tooltip5, TooltipContent as TooltipContent5, TooltipTrigger as TooltipTrigger5 } from "@tutti-os/ui-system";
13342
13619
 
13343
13620
  // agent-gui/agentGuiNode/model/agentGuiProviderRailOrder.ts
13344
13621
  var AGENT_GUI_PROVIDER_RAIL_PREFERENCES_STORAGE_KEY = "agent-gui:provider-rail-preferences";
@@ -14886,13 +15163,7 @@ var AgentGUIHeroAgentCarousel = class extends Component {
14886
15163
  };
14887
15164
 
14888
15165
  // agent-gui/agentGuiNode/AgentSessionChrome.tsx
14889
- import {
14890
- Button as Button2,
14891
- Tooltip,
14892
- TooltipContent,
14893
- TooltipProvider,
14894
- TooltipTrigger
14895
- } from "@tutti-os/ui-system";
15166
+ import { Button as Button2 } from "@tutti-os/ui-system";
14896
15167
 
14897
15168
  // app/renderer/components/icons/CastIcon.tsx
14898
15169
  import {
@@ -14900,7 +15171,7 @@ import {
14900
15171
  useCallback as useCallback27,
14901
15172
  useEffect as useEffect17,
14902
15173
  useImperativeHandle,
14903
- useRef as useRef18
15174
+ useRef as useRef19
14904
15175
  } from "react";
14905
15176
  import {
14906
15177
  motion as motion2,
@@ -14931,7 +15202,7 @@ var CastIcon = forwardRef2(
14931
15202
  }, ref) => {
14932
15203
  const controls = useAnimation();
14933
15204
  const reduceMotion = useReducedMotion();
14934
- const isControlledRef = useRef18(false);
15205
+ const isControlledRef = useRef19(false);
14935
15206
  const startAnimation = useCallback27(() => {
14936
15207
  if (reduceMotion) {
14937
15208
  return;
@@ -15047,7 +15318,6 @@ var styles2 = {
15047
15318
  chromeCardSuccess: "agent-gui-chrome__card--success",
15048
15319
  chromeIcon: "agent-gui-chrome__icon",
15049
15320
  chromeMessageSlot: "agent-gui-chrome__message-slot",
15050
- chromeMessageTooltip: "agent-gui-chrome__message-tooltip",
15051
15321
  chromeInlineActions: "agent-gui-chrome__inline-actions",
15052
15322
  chromeNoticeDescription: "agent-gui-chrome__notice-description",
15053
15323
  chromeNoticeMessage: "agent-gui-chrome__notice-message",
@@ -15084,24 +15354,6 @@ function LoadingEllipsis() {
15084
15354
  /* @__PURE__ */ jsx19("span", {})
15085
15355
  ] });
15086
15356
  }
15087
- function ChromeMessageTooltip({
15088
- message,
15089
- children
15090
- }) {
15091
- "use memo";
15092
- return /* @__PURE__ */ jsx19(TooltipProvider, { delayDuration: 250, children: /* @__PURE__ */ jsxs12(Tooltip, { children: [
15093
- /* @__PURE__ */ jsx19(TooltipTrigger, { asChild: true, children }),
15094
- /* @__PURE__ */ jsx19(
15095
- TooltipContent,
15096
- {
15097
- className: AgentGUIChrome_styles_default.chromeMessageTooltip,
15098
- side: "top",
15099
- sideOffset: 6,
15100
- children: message
15101
- }
15102
- )
15103
- ] }) });
15104
- }
15105
15357
  function AgentChromeNotice({
15106
15358
  tone,
15107
15359
  title,
@@ -15157,7 +15409,15 @@ function AgentSessionChrome({
15157
15409
  }
15158
15410
  return /* @__PURE__ */ jsxs12("div", { className: AgentGUIChrome_styles_default.sessionChrome, children: [
15159
15411
  visibleAuth ? /* @__PURE__ */ jsx19("section", { className: cn(AgentGUIChrome_styles_default.chromeCard, AgentGUIChrome_styles_default.chromeCardWarning), children: /* @__PURE__ */ jsxs12("div", { className: AgentGUIChrome_styles_default.chromeMetaRow, children: [
15160
- /* @__PURE__ */ jsx19("div", { className: AgentGUIChrome_styles_default.chromeMessageSlot, children: /* @__PURE__ */ jsx19(ChromeMessageTooltip, { message: visibleAuth.message, children: /* @__PURE__ */ jsx19("p", { className: AgentGUIChrome_styles_default.chromeMessage, tabIndex: 0, children: visibleAuth.message }) }) }),
15412
+ /* @__PURE__ */ jsx19("div", { className: AgentGUIChrome_styles_default.chromeMessageSlot, children: /* @__PURE__ */ jsx19(
15413
+ "p",
15414
+ {
15415
+ className: AgentGUIChrome_styles_default.chromeMessage,
15416
+ tabIndex: 0,
15417
+ title: visibleAuth.message,
15418
+ children: visibleAuth.message
15419
+ }
15420
+ ) }),
15161
15421
  /* @__PURE__ */ jsxs12("div", { className: AgentGUIChrome_styles_default.chromeInlineActions, children: [
15162
15422
  onAuthLogin ? /* @__PURE__ */ jsx19(
15163
15423
  Button2,
@@ -15220,18 +15480,19 @@ function AgentSessionChrome({
15220
15480
  size: 16
15221
15481
  }
15222
15482
  ) : null,
15223
- /* @__PURE__ */ jsx19(ChromeMessageTooltip, { message: recoveryMessage, children: /* @__PURE__ */ jsx19(
15483
+ /* @__PURE__ */ jsx19(
15224
15484
  "p",
15225
15485
  {
15226
15486
  className: AgentGUIChrome_styles_default.chromeMessage,
15227
15487
  "aria-label": visibleRecovery.kind === "activating" ? recoveryMessage : void 0,
15228
15488
  tabIndex: 0,
15489
+ title: recoveryMessage,
15229
15490
  children: visibleRecovery.kind === "activating" ? /* @__PURE__ */ jsxs12(Fragment3, { children: [
15230
15491
  /* @__PURE__ */ jsx19("span", { className: "tsh-inline-loading-label", children: activatingMessage.label }),
15231
15492
  activatingMessage.ellipsis ? /* @__PURE__ */ jsx19(LoadingEllipsis, {}) : null
15232
15493
  ] }) : recoveryMessage
15233
15494
  }
15234
- ) })
15495
+ )
15235
15496
  ] }),
15236
15497
  /* @__PURE__ */ jsx19("div", { className: AgentGUIChrome_styles_default.chromeInlineActions, children: visibleRecovery.kind === "resume-unavailable" ? /* @__PURE__ */ jsx19(
15237
15498
  Button2,
@@ -15261,7 +15522,7 @@ function AgentSessionChrome({
15261
15522
  }
15262
15523
 
15263
15524
  // agent-gui/agentGuiNode/AgentComposer.tsx
15264
- import { useEffect as useEffect28, useRef as useRef29, useState as useState20 } from "react";
15525
+ import { useEffect as useEffect28, useRef as useRef30, useState as useState20 } from "react";
15265
15526
  import { repairMentionPaletteHighlight } from "@tutti-os/ui-rich-text/at-panel";
15266
15527
 
15267
15528
  // agent-gui/agentGuiNode/AgentSlashStatusPanel.tsx
@@ -15392,7 +15653,7 @@ function AgentSlashStatusPanel({
15392
15653
  import { flushSync as flushSync3 } from "react-dom";
15393
15654
  import {
15394
15655
  useCallback as useCallback28,
15395
- useRef as useRef19
15656
+ useRef as useRef20
15396
15657
  } from "react";
15397
15658
 
15398
15659
  // agent-gui/agentGuiNode/composer/composerDraftUtils.ts
@@ -15454,7 +15715,7 @@ function agentComposerDevConsoleDiagnosticSinkEnabled(runtime) {
15454
15715
 
15455
15716
  // agent-gui/agentGuiNode/composer/useComposerDraftAttachments.ts
15456
15717
  function useStableEventCallback2(callback) {
15457
- const callbackRef = useRef19(callback);
15718
+ const callbackRef = useRef20(callback);
15458
15719
  callbackRef.current = callback;
15459
15720
  return useCallback28((...args) => callbackRef.current(...args), []);
15460
15721
  }
@@ -15510,7 +15771,7 @@ function useComposerDraftAttachments({
15510
15771
  return next;
15511
15772
  }
15512
15773
  );
15513
- const openReferencesForEntityRef = useRef19(null);
15774
+ const openReferencesForEntityRef = useRef20(null);
15514
15775
  const handleDraftChange = useStableEventCallback2(
15515
15776
  (nextDraft) => {
15516
15777
  if (isGoalModeActive) {
@@ -16512,7 +16773,7 @@ import {
16512
16773
  import {
16513
16774
  useCallback as useCallback29,
16514
16775
  useEffect as useEffect18,
16515
- useRef as useRef20,
16776
+ useRef as useRef21,
16516
16777
  useState as useState10
16517
16778
  } from "react";
16518
16779
  import {
@@ -16560,14 +16821,14 @@ function AgentUsageChip({
16560
16821
  }) {
16561
16822
  "use memo";
16562
16823
  const [usagePopoverOpen, setUsagePopoverOpen] = useState10(false);
16563
- const usagePopoverHoverTimerRef = useRef20(null);
16564
- const usagePopoverContentRef = useRef20(null);
16824
+ const usagePopoverHoverTimerRef = useRef21(null);
16825
+ const usagePopoverContentRef = useRef21(null);
16565
16826
  const clampedPercent = Math.max(0, Math.min(100, percentUsed));
16566
16827
  const chipLabel = labels.usageChipLabel({ percent: clampedPercent });
16567
16828
  const showTokens = usedTokens !== null && totalTokens !== null;
16568
16829
  const usageLevel = agentUsageChipLevel(clampedPercent);
16569
16830
  const ringColor = agentUsageRingColor(usageLevel);
16570
- const usagePopoverCloseTimerRef = useRef20(null);
16831
+ const usagePopoverCloseTimerRef = useRef21(null);
16571
16832
  const clearUsagePopoverHoverTimer = useCallback29(() => {
16572
16833
  if (usagePopoverHoverTimerRef.current) {
16573
16834
  clearTimeout(usagePopoverHoverTimerRef.current);
@@ -16993,23 +17254,10 @@ function useMentionPaletteFrame(inputShellRef, showFileMentionPalette) {
16993
17254
  import {
16994
17255
  useCallback as useCallback31,
16995
17256
  useMemo as useMemo23,
16996
- useRef as useRef21
17257
+ useRef as useRef22
16997
17258
  } from "react";
16998
-
16999
- // agent-gui/agentGuiNode/model/composerModeSelection.ts
17000
- function permissionModeSelectionPatch(permissionModeId, options) {
17001
- return options.clearsPlanMode ? { permissionModeId, planMode: false } : { permissionModeId };
17002
- }
17003
- function resolvePermissionModeControlsDisabled(options) {
17004
- if (options.changeDuringTurnSupported) {
17005
- return options.isSubmittingPrompt;
17006
- }
17007
- return options.isSendingTurn || options.isSubmittingPrompt || options.showStopButton;
17008
- }
17009
-
17010
- // agent-gui/agentGuiNode/composer/useComposerSlashActions.ts
17011
17259
  function useStableEventCallback3(callback) {
17012
- const callbackRef = useRef21(callback);
17260
+ const callbackRef = useRef22(callback);
17013
17261
  callbackRef.current = callback;
17014
17262
  return useCallback31((...args) => callbackRef.current(...args), []);
17015
17263
  }
@@ -17322,25 +17570,24 @@ function useComposerSlashActions(input) {
17322
17570
  }
17323
17571
  }
17324
17572
  setIsPaletteOpen(false);
17325
- const submitContent = agentComposerDraftToPromptContent({
17573
+ const submission = projectAgentComposerDraftSubmission({
17326
17574
  draft: nextDraftContent,
17327
17575
  skills: availableSkills
17328
17576
  });
17329
- const submitDisplayPrompt = agentComposerDraftDisplayPrompt(nextDraftContent);
17330
17577
  if (options?.guidance === true) {
17331
17578
  if (!onSubmitGuidance) {
17332
17579
  return;
17333
17580
  }
17334
- if (submitDisplayPrompt) {
17335
- onSubmitGuidance(submitContent, submitDisplayPrompt);
17581
+ if (submission.displayPrompt) {
17582
+ onSubmitGuidance(submission.content, submission.displayPrompt);
17336
17583
  } else {
17337
- onSubmitGuidance(submitContent);
17584
+ onSubmitGuidance(submission.content);
17338
17585
  }
17339
17586
  } else {
17340
- if (submitDisplayPrompt) {
17341
- onSubmit(submitContent, submitDisplayPrompt);
17587
+ if (submission.displayPrompt) {
17588
+ onSubmit(submission.content, submission.displayPrompt);
17342
17589
  } else {
17343
- onSubmit(submitContent);
17590
+ onSubmit(submission.content);
17344
17591
  }
17345
17592
  }
17346
17593
  }
@@ -17431,7 +17678,7 @@ function useComposerSlashActions(input) {
17431
17678
  import {
17432
17679
  useCallback as useCallback32,
17433
17680
  useEffect as useEffect19,
17434
- useRef as useRef22
17681
+ useRef as useRef23
17435
17682
  } from "react";
17436
17683
  import {
17437
17684
  createMentionPaletteStateAdapter,
@@ -17451,7 +17698,7 @@ function isAgentRichTextImeComposing(event) {
17451
17698
 
17452
17699
  // agent-gui/agentGuiNode/composer/useComposerMentionActions.ts
17453
17700
  function useStableEventCallback4(callback) {
17454
- const callbackRef = useRef22(callback);
17701
+ const callbackRef = useRef23(callback);
17455
17702
  callbackRef.current = callback;
17456
17703
  return useCallback32((...args) => callbackRef.current(...args), []);
17457
17704
  }
@@ -18655,17 +18902,17 @@ import { createPortal as createPortal4 } from "react-dom";
18655
18902
  import {
18656
18903
  Popover as Popover3,
18657
18904
  PopoverAnchor as PopoverAnchor2,
18658
- Tooltip as Tooltip5,
18659
- TooltipContent as TooltipContent5,
18660
- TooltipProvider as TooltipProvider4,
18661
- TooltipTrigger as TooltipTrigger5
18905
+ Tooltip as Tooltip4,
18906
+ TooltipContent as TooltipContent4,
18907
+ TooltipProvider as TooltipProvider3,
18908
+ TooltipTrigger as TooltipTrigger4
18662
18909
  } from "@tutti-os/ui-system";
18663
18910
 
18664
18911
  // agent-gui/agentGuiNode/AgentQueuedPromptPanel.tsx
18665
18912
  import {
18666
18913
  Component as Component2,
18667
18914
  useLayoutEffect as useLayoutEffect4,
18668
- useRef as useRef23,
18915
+ useRef as useRef24,
18669
18916
  useState as useState15
18670
18917
  } from "react";
18671
18918
  import { ChevronRight } from "lucide-react";
@@ -18674,10 +18921,10 @@ import {
18674
18921
  DropdownMenuContent as DropdownMenuContent2,
18675
18922
  DropdownMenuItem,
18676
18923
  DropdownMenuTrigger as DropdownMenuTrigger2,
18677
- Tooltip as Tooltip2,
18678
- TooltipContent as TooltipContent2,
18679
- TooltipProvider as TooltipProvider2,
18680
- TooltipTrigger as TooltipTrigger2,
18924
+ Tooltip,
18925
+ TooltipContent,
18926
+ TooltipProvider,
18927
+ TooltipTrigger,
18681
18928
  useTextOverflow
18682
18929
  } from "@tutti-os/ui-system";
18683
18930
  import { extractPlainTextFromContent } from "@tutti-os/ui-rich-text";
@@ -18926,9 +19173,9 @@ function AgentQueuedPromptText({
18926
19173
  )
18927
19174
  }
18928
19175
  );
18929
- return /* @__PURE__ */ jsx24(TooltipProvider2, { delayDuration: 200, children: /* @__PURE__ */ jsxs17(Tooltip2, { children: [
18930
- /* @__PURE__ */ jsx24(TooltipTrigger2, { asChild: true, children: content }),
18931
- overflowing && title ? /* @__PURE__ */ jsx24(TooltipContent2, { className: "max-w-[min(520px,calc(100vw-32px))] whitespace-pre-wrap text-left [overflow-wrap:anywhere]", children: title }) : null
19176
+ return /* @__PURE__ */ jsx24(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs17(Tooltip, { children: [
19177
+ /* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: content }),
19178
+ overflowing && title ? /* @__PURE__ */ jsx24(TooltipContent, { className: "max-w-[min(520px,calc(100vw-32px))] whitespace-pre-wrap text-left [overflow-wrap:anywhere]", children: title }) : null
18932
19179
  ] }) });
18933
19180
  }
18934
19181
  function AgentQueuedPromptPanel({
@@ -18947,9 +19194,9 @@ function AgentQueuedPromptPanel({
18947
19194
  "use memo";
18948
19195
  const runtime = useOptionalAgentActivityRuntime();
18949
19196
  const [isExpanded, setIsExpanded] = useState15(false);
18950
- const singlePromptTextRef = useRef23(null);
18951
- const queuedPromptListRef = useRef23(null);
18952
- const pointerHandledEditPromptIdRef = useRef23(null);
19197
+ const singlePromptTextRef = useRef24(null);
19198
+ const queuedPromptListRef = useRef24(null);
19199
+ const pointerHandledEditPromptIdRef = useRef24(null);
18953
19200
  const [isSinglePromptOverflowing, setIsSinglePromptOverflowing] = useState15(false);
18954
19201
  const [expandedListMaxHeightPx, setExpandedListMaxHeightPx] = useState15(280);
18955
19202
  const singlePromptHasImages = queuedPrompts.length === 1 && queuedPromptImages(queuedPrompts[0]).length > 0;
@@ -19203,9 +19450,9 @@ import {
19203
19450
  SelectContent,
19204
19451
  SelectItem,
19205
19452
  SelectTrigger,
19206
- Tooltip as Tooltip3,
19207
- TooltipContent as TooltipContent3,
19208
- TooltipTrigger as TooltipTrigger3,
19453
+ Tooltip as Tooltip2,
19454
+ TooltipContent as TooltipContent2,
19455
+ TooltipTrigger as TooltipTrigger2,
19209
19456
  cn as cn3
19210
19457
  } from "@tutti-os/ui-system";
19211
19458
 
@@ -19799,12 +20046,6 @@ function AgentPermissionModeDropdown({
19799
20046
  })
19800
20047
  );
19801
20048
  };
19802
- const handleSelectedItemPointerDown = (event, permissionModeId) => {
19803
- if (selectDisabled || event.button !== 0 || event.ctrlKey) {
19804
- return;
19805
- }
19806
- applyPermissionModeId(permissionModeId);
19807
- };
19808
20049
  const trigger = /* @__PURE__ */ jsxs19(
19809
20050
  "button",
19810
20051
  {
@@ -19853,9 +20094,9 @@ function AgentPermissionModeDropdown({
19853
20094
  // The trigger is disabled while loading, so pointer events never reach
19854
20095
  // it. Target the tooltip at a focusable wrapper span (Radix's pattern
19855
20096
  // for disabled triggers) so hover/focus reliably surfaces the hint.
19856
- /* @__PURE__ */ jsxs19(Tooltip3, { children: [
19857
- /* @__PURE__ */ jsx26(TooltipTrigger3, { asChild: true, children: /* @__PURE__ */ jsx26("span", { className: "inline-flex", tabIndex: 0, children: selectTrigger }) }),
19858
- /* @__PURE__ */ jsx26(TooltipContent3, { side: "top", children: labels.loadingOptions })
20097
+ /* @__PURE__ */ jsxs19(Tooltip2, { children: [
20098
+ /* @__PURE__ */ jsx26(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ jsx26("span", { className: "inline-flex", tabIndex: 0, children: selectTrigger }) }),
20099
+ /* @__PURE__ */ jsx26(TooltipContent2, { side: "top", children: labels.loadingOptions })
19859
20100
  ] })
19860
20101
  ) : selectTrigger,
19861
20102
  isSelectOpen ? /* @__PURE__ */ jsx26(
@@ -19875,7 +20116,6 @@ function AgentPermissionModeDropdown({
19875
20116
  value: option.value,
19876
20117
  disabled: selectDisabled,
19877
20118
  className: cn3(AgentGUINode_styles_default.composerMenuItem, "group/composer-option"),
19878
- onPointerDown: (event) => handleSelectedItemPointerDown(event, option.value),
19879
20119
  children: /* @__PURE__ */ jsxs19("span", { className: "flex min-w-0 items-center gap-1.5", children: [
19880
20120
  /* @__PURE__ */ jsx26("span", { className: "min-w-0 truncate", children: option.label }),
19881
20121
  option.description ? /* @__PURE__ */ jsx26(
@@ -19972,9 +20212,9 @@ function ComposerOptionInfoTooltip({
19972
20212
  if (!tooltipsEnabled) {
19973
20213
  return trigger;
19974
20214
  }
19975
- return /* @__PURE__ */ jsxs19(Tooltip3, { children: [
19976
- /* @__PURE__ */ jsx26(TooltipTrigger3, { asChild: true, children: trigger }),
19977
- /* @__PURE__ */ jsx26(TooltipContent3, { side: "right", className: "max-w-[240px] whitespace-normal", children: description })
20215
+ return /* @__PURE__ */ jsxs19(Tooltip2, { children: [
20216
+ /* @__PURE__ */ jsx26(TooltipTrigger2, { asChild: true, children: trigger }),
20217
+ /* @__PURE__ */ jsx26(TooltipContent2, { side: "right", className: "max-w-[240px] whitespace-normal", children: description })
19978
20218
  ] });
19979
20219
  }
19980
20220
  function resolvePermissionModeTriggerTone(value) {
@@ -20055,9 +20295,9 @@ function AgentModelReasoningDropdown({
20055
20295
  // The trigger is disabled while loading, so pointer events never reach
20056
20296
  // it. Target the tooltip at a focusable wrapper span (Radix's pattern
20057
20297
  // for disabled triggers) so hover/focus reliably surfaces the hint.
20058
- /* @__PURE__ */ jsxs19(Tooltip3, { children: [
20059
- /* @__PURE__ */ jsx26(TooltipTrigger3, { asChild: true, children: /* @__PURE__ */ jsx26("span", { className: "inline-flex", tabIndex: 0, children: /* @__PURE__ */ jsx26(DropdownMenuTrigger3, { asChild: true, disabled: menuDisabled, children: trigger }) }) }),
20060
- /* @__PURE__ */ jsx26(TooltipContent3, { side: "top", children: labels.loadingOptions })
20298
+ /* @__PURE__ */ jsxs19(Tooltip2, { children: [
20299
+ /* @__PURE__ */ jsx26(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ jsx26("span", { className: "inline-flex", tabIndex: 0, children: /* @__PURE__ */ jsx26(DropdownMenuTrigger3, { asChild: true, disabled: menuDisabled, children: trigger }) }) }),
20300
+ /* @__PURE__ */ jsx26(TooltipContent2, { side: "top", children: labels.loadingOptions })
20061
20301
  ] })
20062
20302
  ) : /* @__PURE__ */ jsx26(DropdownMenuTrigger3, { asChild: true, disabled: menuDisabled, children: trigger }),
20063
20303
  /* @__PURE__ */ jsxs19(
@@ -20260,12 +20500,12 @@ function ComposerModelOptionTooltip({
20260
20500
  if (!tooltipsEnabled || !option.tooltip) {
20261
20501
  return children;
20262
20502
  }
20263
- return /* @__PURE__ */ jsxs19(Tooltip3, { children: [
20264
- /* @__PURE__ */ jsx26(TooltipTrigger3, { asChild: true, children: cloneElement(children, {
20503
+ return /* @__PURE__ */ jsxs19(Tooltip2, { children: [
20504
+ /* @__PURE__ */ jsx26(TooltipTrigger2, { asChild: true, children: cloneElement(children, {
20265
20505
  "data-agent-model-option-tooltip-trigger": "true"
20266
20506
  }) }),
20267
20507
  /* @__PURE__ */ jsxs19(
20268
- TooltipContent3,
20508
+ TooltipContent2,
20269
20509
  {
20270
20510
  side: "right",
20271
20511
  align: "start",
@@ -20289,7 +20529,7 @@ import {
20289
20529
  useCallback as useCallback36,
20290
20530
  useEffect as useEffect24,
20291
20531
  useMemo as useMemo26,
20292
- useRef as useRef25,
20532
+ useRef as useRef26,
20293
20533
  useState as useState17
20294
20534
  } from "react";
20295
20535
  import { useEditor } from "@tiptap/react";
@@ -20817,7 +21057,7 @@ function useAgentRichTextEditorHandle(input) {
20817
21057
  // agent-gui/agentGuiNode/agentRichText/AgentRichTextEditorSurface.tsx
20818
21058
  import {
20819
21059
  useCallback as useCallback35,
20820
- useRef as useRef24
21060
+ useRef as useRef25
20821
21061
  } from "react";
20822
21062
  import { createPortal as createPortal2 } from "react-dom";
20823
21063
  import { EditorContent } from "@tiptap/react";
@@ -20905,7 +21145,7 @@ function AgentRichTextContextMenuButton({
20905
21145
  label,
20906
21146
  onSelect
20907
21147
  }) {
20908
- const selectionStartedRef = useRef24(false);
21148
+ const selectionStartedRef = useRef25(false);
20909
21149
  const select = useCallback35(() => {
20910
21150
  if (disabled || selectionStartedRef.current) return;
20911
21151
  selectionStartedRef.current = true;
@@ -21007,34 +21247,34 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
21007
21247
  }, ref) {
21008
21248
  "use memo";
21009
21249
  const { t } = useTranslation();
21010
- const lastEmittedPromptRef = useRef25(value);
21011
- const editorRef = useRef25(null);
21012
- const onChangeRef = useRef25(onChange);
21013
- const onFocusRef = useRef25(onFocus);
21014
- const onUserContentChangeRef = useRef25(onUserContentChange);
21015
- const pendingFocusMethodRef = useRef25(null);
21016
- const onSubmitRef = useRef25(onSubmit);
21017
- const onSubmitGuidanceRef = useRef25(onSubmitGuidance);
21018
- const onKeyDownForPaletteRef = useRef25(onKeyDownForPalette);
21019
- const onFileMentionSuggestionChangeRef = useRef25(
21250
+ const lastEmittedPromptRef = useRef26(value);
21251
+ const editorRef = useRef26(null);
21252
+ const onChangeRef = useRef26(onChange);
21253
+ const onFocusRef = useRef26(onFocus);
21254
+ const onUserContentChangeRef = useRef26(onUserContentChange);
21255
+ const pendingFocusMethodRef = useRef26(null);
21256
+ const onSubmitRef = useRef26(onSubmit);
21257
+ const onSubmitGuidanceRef = useRef26(onSubmitGuidance);
21258
+ const onKeyDownForPaletteRef = useRef26(onKeyDownForPalette);
21259
+ const onFileMentionSuggestionChangeRef = useRef26(
21020
21260
  onFileMentionSuggestionChange
21021
21261
  );
21022
- const onFileMentionSuggestionKeyDownRef = useRef25(
21262
+ const onFileMentionSuggestionKeyDownRef = useRef26(
21023
21263
  onFileMentionSuggestionKeyDown
21024
21264
  );
21025
- const onLinkClickRef = useRef25(onLinkClick);
21026
- const onPromptImagesUnsupportedRef = useRef25(onPromptImagesUnsupported);
21027
- const onPasteImagesRef = useRef25(onPasteImages);
21028
- const onPasteLargeTextRef = useRef25(onPasteLargeText);
21029
- const onDropFilesRef = useRef25(onDropFiles);
21030
- const promptImagesSupportedRef = useRef25(promptImagesSupported);
21031
- const getReferenceForFileRef = useRef25(getReferenceForFile);
21032
- const placeholderRef = useRef25(placeholder);
21033
- const removeMentionLabelRef = useRef25(removeMentionLabel);
21034
- const availableSkillsRef = useRef25(availableSkills);
21035
- const availableCapabilitiesRef = useRef25(availableCapabilities);
21036
- const suppressPastedAtSuggestionRef = useRef25(false);
21037
- const scrollFrameRef = useRef25(null);
21265
+ const onLinkClickRef = useRef26(onLinkClick);
21266
+ const onPromptImagesUnsupportedRef = useRef26(onPromptImagesUnsupported);
21267
+ const onPasteImagesRef = useRef26(onPasteImages);
21268
+ const onPasteLargeTextRef = useRef26(onPasteLargeText);
21269
+ const onDropFilesRef = useRef26(onDropFiles);
21270
+ const promptImagesSupportedRef = useRef26(promptImagesSupported);
21271
+ const getReferenceForFileRef = useRef26(getReferenceForFile);
21272
+ const placeholderRef = useRef26(placeholder);
21273
+ const removeMentionLabelRef = useRef26(removeMentionLabel);
21274
+ const availableSkillsRef = useRef26(availableSkills);
21275
+ const availableCapabilitiesRef = useRef26(availableCapabilities);
21276
+ const suppressPastedAtSuggestionRef = useRef26(false);
21277
+ const scrollFrameRef = useRef26(null);
21038
21278
  const [contextMenu, setContextMenu] = useState17(null);
21039
21279
  const closeContextMenu = useCallback36(() => {
21040
21280
  setContextMenu(null);
@@ -21619,7 +21859,7 @@ function AgentReferenceProvenanceFilterControl({
21619
21859
  }
21620
21860
 
21621
21861
  // agent-gui/agentGuiNode/AgentSlashCommandPalette.tsx
21622
- import { Fragment as Fragment8, useEffect as useEffect25, useRef as useRef26 } from "react";
21862
+ import { Fragment as Fragment8, useEffect as useEffect25, useRef as useRef27 } from "react";
21623
21863
  import { Spinner as Spinner3 } from "@tutti-os/ui-system";
21624
21864
  import {
21625
21865
  Globe,
@@ -21666,7 +21906,7 @@ function AgentSlashCommandPalette({
21666
21906
  onSelectSkill
21667
21907
  }) {
21668
21908
  "use memo";
21669
- const highlightedOptionRef = useRef26(null);
21909
+ const highlightedOptionRef = useRef27(null);
21670
21910
  useEffect25(() => {
21671
21911
  highlightedOptionRef.current?.scrollIntoView({ block: "nearest" });
21672
21912
  }, [highlightedIndex]);
@@ -21867,7 +22107,7 @@ function slashPaletteEntryIcon(entry) {
21867
22107
  }
21868
22108
 
21869
22109
  // agent-gui/agentGuiNode/AgentReviewPickerPanel.tsx
21870
- import { useCallback as useCallback37, useEffect as useEffect26, useMemo as useMemo27, useRef as useRef27, useState as useState18 } from "react";
22110
+ import { useCallback as useCallback37, useEffect as useEffect26, useMemo as useMemo27, useRef as useRef28, useState as useState18 } from "react";
21871
22111
  import { menuItemClassName } from "@tutti-os/ui-system";
21872
22112
 
21873
22113
  // agent-gui/agentGuiNode/AgentReviewBranchController.ts
@@ -21985,9 +22225,9 @@ function AgentReviewPickerPanel({
21985
22225
  const [stage, setStage] = useState18("root");
21986
22226
  const [query, setQuery] = useState18("");
21987
22227
  const [highlightedIndex, setHighlightedIndex] = useState18(0);
21988
- const searchInputRef = useRef27(null);
21989
- const highlightedOptionRef = useRef27(null);
21990
- const reviewBranchControllerRef = useRef27(
22228
+ const searchInputRef = useRef28(null);
22229
+ const highlightedOptionRef = useRef28(null);
22230
+ const reviewBranchControllerRef = useRef28(
21991
22231
  null
21992
22232
  );
21993
22233
  const [branchState, setBranchState] = useState18({
@@ -22232,7 +22472,7 @@ import {
22232
22472
  useEffect as useEffect27,
22233
22473
  useLayoutEffect as useLayoutEffect5,
22234
22474
  useMemo as useMemo28,
22235
- useRef as useRef28,
22475
+ useRef as useRef29,
22236
22476
  useState as useState19
22237
22477
  } from "react";
22238
22478
  import { createPortal as createPortal3 } from "react-dom";
@@ -22379,7 +22619,7 @@ var ComposerFloatingMenuSurface = forwardRef4(function ComposerFloatingMenuSurfa
22379
22619
  surfaceRef,
22380
22620
  testId
22381
22621
  }, forwardedRef) {
22382
- const localSurfaceRef = useRef28(null);
22622
+ const localSurfaceRef = useRef29(null);
22383
22623
  const frame = useComposerAnchoredMenuFrame({
22384
22624
  anchorRef,
22385
22625
  maxHeight,
@@ -22645,10 +22885,10 @@ import {
22645
22885
  SelectContent as SelectContent2,
22646
22886
  SelectItem as SelectItem2,
22647
22887
  SelectTrigger as SelectTrigger2,
22648
- Tooltip as Tooltip4,
22649
- TooltipContent as TooltipContent4,
22650
- TooltipProvider as TooltipProvider3,
22651
- TooltipTrigger as TooltipTrigger4
22888
+ Tooltip as Tooltip3,
22889
+ TooltipContent as TooltipContent3,
22890
+ TooltipProvider as TooltipProvider2,
22891
+ TooltipTrigger as TooltipTrigger3
22652
22892
  } from "@tutti-os/ui-system";
22653
22893
 
22654
22894
  // app/renderer/assets/icons/add-lined-bold.svg
@@ -22700,8 +22940,8 @@ function ComposerFooter({
22700
22940
  return /* @__PURE__ */ jsx34(Fragment10, { children: /* @__PURE__ */ jsxs24("div", { className: AgentGUINode_styles_default.composerFooter, children: [
22701
22941
  /* @__PURE__ */ jsxs24("div", { className: composerStyles.footerGroup, children: [
22702
22942
  /* @__PURE__ */ jsxs24("div", { className: "inline-flex shrink-0 items-center gap-1", children: [
22703
- previewMode ? /* @__PURE__ */ jsx34(TooltipProvider3, { delayDuration: 120, children: /* @__PURE__ */ jsxs24(Tooltip4, { children: [
22704
- /* @__PURE__ */ jsx34(TooltipTrigger4, { asChild: true, children: /* @__PURE__ */ jsx34(
22943
+ previewMode ? /* @__PURE__ */ jsx34(TooltipProvider2, { delayDuration: 120, children: /* @__PURE__ */ jsxs24(Tooltip3, { children: [
22944
+ /* @__PURE__ */ jsx34(TooltipTrigger3, { asChild: true, children: /* @__PURE__ */ jsx34(
22705
22945
  "button",
22706
22946
  {
22707
22947
  type: "button",
@@ -22720,50 +22960,47 @@ function ComposerFooter({
22720
22960
  )
22721
22961
  }
22722
22962
  ) }),
22723
- /* @__PURE__ */ jsx34(TooltipContent4, { side: "top", children: labels.addContent })
22724
- ] }) }) : /* @__PURE__ */ jsx34(TooltipProvider3, { delayDuration: 120, children: /* @__PURE__ */ jsxs24(Tooltip4, { children: [
22725
- /* @__PURE__ */ jsx34(
22726
- Select2,
22727
- {
22728
- open: false,
22729
- value: workspaceReferenceSelectValue,
22730
- disabled: !onRequestWorkspaceReferences || composerControlsHardDisabled,
22731
- onOpenChange: (isOpen) => {
22732
- if (isOpen) {
22733
- void handleWorkspaceReferencePicker();
22734
- }
22735
- },
22736
- onValueChange: (nextValue) => {
22737
- if (nextValue === workspaceReferenceOptionValue) {
22738
- void handleWorkspaceReferencePicker();
22739
- }
22740
- },
22741
- children: /* @__PURE__ */ jsx34(TooltipTrigger4, { asChild: true, children: /* @__PURE__ */ jsx34(
22742
- SelectTrigger2,
22743
- {
22744
- size: "sm",
22745
- "aria-label": labels.referenceWorkspaceFiles,
22746
- title: labels.referenceWorkspaceFiles,
22747
- className: cn(
22748
- AgentGUINode_styles_default.composerMenuTrigger,
22749
- AgentGUINode_styles_default.composerReferenceTrigger,
22750
- "group w-auto justify-center text-[var(--agent-gui-text-secondary)] [&>svg:last-child]:hidden"
22751
- ),
22752
- children: /* @__PURE__ */ jsx34(
22753
- AgentComposerMaskIcon,
22754
- {
22755
- iconUrl: add_lined_bold_default,
22756
- marker: "reference-add"
22757
- }
22758
- )
22759
- }
22760
- ) })
22761
- }
22762
- ),
22763
- /* @__PURE__ */ jsx34(TooltipContent4, { side: "top", children: labels.addContent })
22764
- ] }) }),
22765
- /* @__PURE__ */ jsx34(TooltipProvider3, { delayDuration: 120, children: /* @__PURE__ */ jsxs24(Tooltip4, { children: [
22766
- /* @__PURE__ */ jsx34(TooltipTrigger4, { asChild: true, children: /* @__PURE__ */ jsx34(
22963
+ /* @__PURE__ */ jsx34(TooltipContent3, { side: "top", children: labels.addContent })
22964
+ ] }) }) : /* @__PURE__ */ jsx34(
22965
+ Select2,
22966
+ {
22967
+ open: false,
22968
+ value: workspaceReferenceSelectValue,
22969
+ disabled: !onRequestWorkspaceReferences || composerControlsHardDisabled,
22970
+ onOpenChange: (isOpen) => {
22971
+ if (isOpen) {
22972
+ void handleWorkspaceReferencePicker();
22973
+ }
22974
+ },
22975
+ onValueChange: (nextValue) => {
22976
+ if (nextValue === workspaceReferenceOptionValue) {
22977
+ void handleWorkspaceReferencePicker();
22978
+ }
22979
+ },
22980
+ children: /* @__PURE__ */ jsx34(
22981
+ SelectTrigger2,
22982
+ {
22983
+ size: "sm",
22984
+ "aria-label": labels.referenceWorkspaceFiles,
22985
+ title: labels.addContent,
22986
+ className: cn(
22987
+ AgentGUINode_styles_default.composerMenuTrigger,
22988
+ AgentGUINode_styles_default.composerReferenceTrigger,
22989
+ "group w-auto justify-center text-[var(--agent-gui-text-secondary)] [&>svg:last-child]:hidden"
22990
+ ),
22991
+ children: /* @__PURE__ */ jsx34(
22992
+ AgentComposerMaskIcon,
22993
+ {
22994
+ iconUrl: add_lined_bold_default,
22995
+ marker: "reference-add"
22996
+ }
22997
+ )
22998
+ }
22999
+ )
23000
+ }
23001
+ ),
23002
+ /* @__PURE__ */ jsx34(TooltipProvider2, { delayDuration: 120, children: /* @__PURE__ */ jsxs24(Tooltip3, { children: [
23003
+ /* @__PURE__ */ jsx34(TooltipTrigger3, { asChild: true, children: /* @__PURE__ */ jsx34(
22767
23004
  "button",
22768
23005
  {
22769
23006
  type: "button",
@@ -22795,140 +23032,57 @@ function ComposerFooter({
22795
23032
  )
22796
23033
  }
22797
23034
  ) }),
22798
- /* @__PURE__ */ jsx34(TooltipContent4, { side: "top", children: labels.mentionPalette })
23035
+ /* @__PURE__ */ jsx34(TooltipContent3, { side: "top", children: labels.mentionPalette })
22799
23036
  ] }) })
22800
23037
  ] }),
22801
- showHandoffSelect ? /* @__PURE__ */ jsx34(TooltipProvider3, { children: /* @__PURE__ */ jsxs24(Tooltip4, { children: [
22802
- /* @__PURE__ */ jsxs24(
22803
- Select2,
22804
- {
22805
- value: HANDOFF_SELECT_IDLE_VALUE,
22806
- disabled: handoffDisabled,
22807
- onValueChange: (nextTargetId) => {
22808
- const target = handoffMenuTargets.find(
22809
- (candidate) => candidate.targetId === nextTargetId
22810
- );
22811
- if (!target || target.disabled === true) {
22812
- return;
22813
- }
22814
- onHandoffConversation?.(target);
22815
- },
22816
- children: [
22817
- /* @__PURE__ */ jsx34(TooltipTrigger4, { asChild: true, children: /* @__PURE__ */ jsx34(
22818
- SelectTrigger2,
22819
- {
22820
- size: "sm",
22821
- "aria-label": effectiveHandoffLabel,
22822
- title: labels.handoffConversationTooltip,
22823
- onBlur: () => {
22824
- setIsHandoffIconPlaying(false);
22825
- },
22826
- onFocus: () => {
22827
- setIsHandoffIconPlaying(true);
22828
- },
22829
- onMouseEnter: () => {
22830
- setIsHandoffIconPlaying(true);
22831
- },
22832
- onMouseLeave: () => {
22833
- setIsHandoffIconPlaying(false);
22834
- },
22835
- className: cn(
22836
- AgentGUINode_styles_default.composerMenuTrigger,
22837
- AgentGUINode_styles_default.composerProviderSelect,
22838
- AgentGUINode_styles_default.composerHandoffTrigger,
22839
- "w-auto max-w-[180px] [&>svg:last-child]:hidden"
22840
- ),
22841
- children: /* @__PURE__ */ jsxs24("span", { className: "flex min-w-0 items-center gap-1.5", children: [
22842
- /* @__PURE__ */ jsx34(
22843
- AgentComposerHandoffIcon,
22844
- {
22845
- disabled: handoffDisabled,
22846
- isPlaying: isHandoffIconPlaying
22847
- }
22848
- ),
22849
- /* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate", children: effectiveHandoffLabel })
22850
- ] })
22851
- }
22852
- ) }),
22853
- /* @__PURE__ */ jsx34(
22854
- SelectContent2,
22855
- {
22856
- align: "start",
22857
- className: cn(
22858
- AgentGUINode_styles_default.composerMenuContent,
22859
- AgentGUINode_styles_default.composerHandoffMenuContent,
22860
- "min-w-[190px]"
22861
- ),
22862
- "aria-label": effectiveHandoffMenuLabel,
22863
- children: handoffMenuTargets.map((target) => /* @__PURE__ */ jsx34(
22864
- SelectItem2,
22865
- {
22866
- value: target.targetId,
22867
- className: cn(AgentGUINode_styles_default.composerMenuItem, "gap-2"),
22868
- disabled: target.disabled === true,
22869
- children: /* @__PURE__ */ jsxs24("span", { className: "flex min-w-0 items-center gap-1.5", children: [
22870
- /* @__PURE__ */ jsx34(
22871
- "img",
22872
- {
22873
- alt: "",
22874
- "aria-hidden": "true",
22875
- className: "size-4 shrink-0 rounded-[4px]",
22876
- src: resolveComposerProviderTargetIconUrl(target)
22877
- }
22878
- ),
22879
- /* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate", children: target.label })
22880
- ] })
22881
- },
22882
- `${target.provider}:${target.targetId}`
22883
- ))
22884
- }
22885
- )
22886
- ]
22887
- }
22888
- ),
22889
- /* @__PURE__ */ jsx34(TooltipContent4, { side: "top", children: labels.handoffConversationTooltip })
22890
- ] }) }) : showProviderSelect && selectedProviderSwitchTarget ? /* @__PURE__ */ jsxs24(
23038
+ showHandoffSelect ? /* @__PURE__ */ jsxs24(
22891
23039
  Select2,
22892
23040
  {
22893
- value: selectedProviderSwitchTarget.targetId,
22894
- disabled: providerSelectDisabled,
23041
+ value: HANDOFF_SELECT_IDLE_VALUE,
23042
+ disabled: handoffDisabled,
22895
23043
  onValueChange: (nextTargetId) => {
22896
- const target = providerMenuTargets.find(
23044
+ const target = handoffMenuTargets.find(
22897
23045
  (candidate) => candidate.targetId === nextTargetId
22898
23046
  );
22899
- if (!target) {
23047
+ if (!target || target.disabled === true) {
22900
23048
  return;
22901
23049
  }
22902
- onProviderSelect?.({
22903
- provider: target.provider,
22904
- agentTargetId: target.targetId
22905
- });
23050
+ onHandoffConversation?.(target);
22906
23051
  },
22907
23052
  children: [
22908
23053
  /* @__PURE__ */ jsx34(
22909
23054
  SelectTrigger2,
22910
23055
  {
22911
23056
  size: "sm",
22912
- "aria-label": providerSelectLabel,
22913
- title: providerSelectLabel,
23057
+ "aria-label": effectiveHandoffLabel,
23058
+ title: labels.handoffConversationTooltip,
23059
+ onBlur: () => {
23060
+ setIsHandoffIconPlaying(false);
23061
+ },
23062
+ onFocus: () => {
23063
+ setIsHandoffIconPlaying(true);
23064
+ },
23065
+ onMouseEnter: () => {
23066
+ setIsHandoffIconPlaying(true);
23067
+ },
23068
+ onMouseLeave: () => {
23069
+ setIsHandoffIconPlaying(false);
23070
+ },
22914
23071
  className: cn(
22915
23072
  AgentGUINode_styles_default.composerMenuTrigger,
22916
23073
  AgentGUINode_styles_default.composerProviderSelect,
22917
- "w-auto max-w-[180px]"
23074
+ AgentGUINode_styles_default.composerHandoffTrigger,
23075
+ "w-auto max-w-[180px] [&>svg:last-child]:hidden"
22918
23076
  ),
22919
23077
  children: /* @__PURE__ */ jsxs24("span", { className: "flex min-w-0 items-center gap-1.5", children: [
22920
23078
  /* @__PURE__ */ jsx34(
22921
- "img",
23079
+ AgentComposerHandoffIcon,
22922
23080
  {
22923
- alt: "",
22924
- "aria-hidden": "true",
22925
- className: "size-4 shrink-0 rounded-[4px]",
22926
- src: resolveComposerProviderTargetIconUrl(
22927
- selectedProviderSwitchTarget
22928
- )
23081
+ disabled: handoffDisabled,
23082
+ isPlaying: isHandoffIconPlaying
22929
23083
  }
22930
23084
  ),
22931
- /* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate", children: selectedProviderLabel })
23085
+ /* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate", children: effectiveHandoffLabel })
22932
23086
  ] })
22933
23087
  }
22934
23088
  ),
@@ -22936,8 +23090,88 @@ function ComposerFooter({
22936
23090
  SelectContent2,
22937
23091
  {
22938
23092
  align: "start",
22939
- className: cn(AgentGUINode_styles_default.composerMenuContent, "min-w-[190px]"),
22940
- children: providerMenuTargets.map((target) => /* @__PURE__ */ jsx34(
23093
+ className: cn(
23094
+ AgentGUINode_styles_default.composerMenuContent,
23095
+ AgentGUINode_styles_default.composerHandoffMenuContent,
23096
+ "min-w-[190px]"
23097
+ ),
23098
+ "aria-label": effectiveHandoffMenuLabel,
23099
+ children: handoffMenuTargets.map((target) => /* @__PURE__ */ jsx34(
23100
+ SelectItem2,
23101
+ {
23102
+ value: target.targetId,
23103
+ className: cn(AgentGUINode_styles_default.composerMenuItem, "gap-2"),
23104
+ disabled: target.disabled === true,
23105
+ children: /* @__PURE__ */ jsxs24("span", { className: "flex min-w-0 items-center gap-1.5", children: [
23106
+ /* @__PURE__ */ jsx34(
23107
+ "img",
23108
+ {
23109
+ alt: "",
23110
+ "aria-hidden": "true",
23111
+ className: "size-4 shrink-0 rounded-[4px]",
23112
+ src: resolveComposerProviderTargetIconUrl(target)
23113
+ }
23114
+ ),
23115
+ /* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate", children: target.label })
23116
+ ] })
23117
+ },
23118
+ `${target.provider}:${target.targetId}`
23119
+ ))
23120
+ }
23121
+ )
23122
+ ]
23123
+ }
23124
+ ) : showProviderSelect && selectedProviderSwitchTarget ? /* @__PURE__ */ jsxs24(
23125
+ Select2,
23126
+ {
23127
+ value: selectedProviderSwitchTarget.targetId,
23128
+ disabled: providerSelectDisabled,
23129
+ onValueChange: (nextTargetId) => {
23130
+ const target = providerMenuTargets.find(
23131
+ (candidate) => candidate.targetId === nextTargetId
23132
+ );
23133
+ if (!target) {
23134
+ return;
23135
+ }
23136
+ onProviderSelect?.({
23137
+ provider: target.provider,
23138
+ agentTargetId: target.targetId
23139
+ });
23140
+ },
23141
+ children: [
23142
+ /* @__PURE__ */ jsx34(
23143
+ SelectTrigger2,
23144
+ {
23145
+ size: "sm",
23146
+ "aria-label": providerSelectLabel,
23147
+ title: providerSelectLabel,
23148
+ className: cn(
23149
+ AgentGUINode_styles_default.composerMenuTrigger,
23150
+ AgentGUINode_styles_default.composerProviderSelect,
23151
+ "w-auto max-w-[180px]"
23152
+ ),
23153
+ children: /* @__PURE__ */ jsxs24("span", { className: "flex min-w-0 items-center gap-1.5", children: [
23154
+ /* @__PURE__ */ jsx34(
23155
+ "img",
23156
+ {
23157
+ alt: "",
23158
+ "aria-hidden": "true",
23159
+ className: "size-4 shrink-0 rounded-[4px]",
23160
+ src: resolveComposerProviderTargetIconUrl(
23161
+ selectedProviderSwitchTarget
23162
+ )
23163
+ }
23164
+ ),
23165
+ /* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate", children: selectedProviderLabel })
23166
+ ] })
23167
+ }
23168
+ ),
23169
+ /* @__PURE__ */ jsx34(
23170
+ SelectContent2,
23171
+ {
23172
+ align: "start",
23173
+ className: cn(AgentGUINode_styles_default.composerMenuContent, "min-w-[190px]"),
23174
+ children: providerMenuTargets.map((target) => /* @__PURE__ */ jsx34(
22941
23175
  SelectItem2,
22942
23176
  {
22943
23177
  value: target.targetId,
@@ -23654,10 +23888,10 @@ function AgentComposerView(input) {
23654
23888
  {
23655
23889
  className: AgentGUINode_styles_default.composerPromptTips,
23656
23890
  "data-testid": "agent-gui-prompt-tips",
23657
- children: !previewMode && input.isPromptTipOverflowing && promptTipNode ? /* @__PURE__ */ jsx35(TooltipProvider4, { delayDuration: 0, children: /* @__PURE__ */ jsxs25(Tooltip5, { children: [
23658
- /* @__PURE__ */ jsx35(TooltipTrigger5, { asChild: true, children: promptTipNode }),
23891
+ children: !previewMode && input.isPromptTipOverflowing && promptTipNode ? /* @__PURE__ */ jsx35(TooltipProvider3, { delayDuration: 0, children: /* @__PURE__ */ jsxs25(Tooltip4, { children: [
23892
+ /* @__PURE__ */ jsx35(TooltipTrigger4, { asChild: true, children: promptTipNode }),
23659
23893
  /* @__PURE__ */ jsx35(
23660
- TooltipContent5,
23894
+ TooltipContent4,
23661
23895
  {
23662
23896
  align: "end",
23663
23897
  className: AgentGUINode_styles_default.composerPromptTipTooltip,
@@ -23791,11 +24025,11 @@ function AgentComposer(props) {
23791
24025
  const [isSelectedProjectMissing, setIsSelectedProjectMissing] = useState20(false);
23792
24026
  const [isSlashStatusPanelOpen, setIsSlashStatusPanelOpen] = useState20(false);
23793
24027
  const slashStatusAgentSessionId = slashStatus?.agentSessionId ?? null;
23794
- const previousSlashStatusAgentSessionIdRef = useRef29(
24028
+ const previousSlashStatusAgentSessionIdRef = useRef30(
23795
24029
  slashStatusAgentSessionId
23796
24030
  );
23797
24031
  const selectedProjectPath = composerSettings.selectedProjectPath?.trim() ?? "";
23798
- const previousSelectedProjectPathRef = useRef29(selectedProjectPath);
24032
+ const previousSelectedProjectPathRef = useRef30(selectedProjectPath);
23799
24033
  const [mentionSearchState, setMentionSearchState] = useState20({
23800
24034
  status: "idle",
23801
24035
  query: "",
@@ -23805,26 +24039,26 @@ function AgentComposer(props) {
23805
24039
  groups: [],
23806
24040
  error: null
23807
24041
  });
23808
- const composerRef = useRef29(null);
23809
- const inputShellRef = useRef29(null);
23810
- const promptInputAreaRef = useRef29(null);
23811
- const paletteContentRef = useRef29(null);
23812
- const draftPromptRef = useRef29(draftPrompt);
23813
- const draftImagesRef = useRef29(draftImages);
23814
- const draftFilesRef = useRef29(draftFiles);
23815
- const draftLargeTextsRef = useRef29(draftLargeTexts);
23816
- const draftByScopeKeyRef = useRef29({
24042
+ const composerRef = useRef30(null);
24043
+ const inputShellRef = useRef30(null);
24044
+ const promptInputAreaRef = useRef30(null);
24045
+ const paletteContentRef = useRef30(null);
24046
+ const draftPromptRef = useRef30(draftPrompt);
24047
+ const draftImagesRef = useRef30(draftImages);
24048
+ const draftFilesRef = useRef30(draftFiles);
24049
+ const draftLargeTextsRef = useRef30(draftLargeTexts);
24050
+ const draftByScopeKeyRef = useRef30({
23817
24051
  [draftScopeKey]: draftContent
23818
24052
  });
23819
24053
  draftByScopeKeyRef.current[draftScopeKey] = draftContent;
23820
- const promptTipRef = useRef29(null);
23821
- const mentionControllerRef = useRef29(
24054
+ const promptTipRef = useRef30(null);
24055
+ const mentionControllerRef = useRef30(
23822
24056
  null
23823
24057
  );
23824
- const editorHandleRef = useRef29(null);
23825
- const wasActiveRef = useRef29(isActive);
23826
- const lastComposerFocusRequestRef = useRef29(null);
23827
- const autoMentionHighlightedKeyRef = useRef29(null);
24058
+ const editorHandleRef = useRef30(null);
24059
+ const wasActiveRef = useRef30(isActive);
24060
+ const lastComposerFocusRequestRef = useRef30(null);
24061
+ const autoMentionHighlightedKeyRef = useRef30(null);
23828
24062
  const [isPromptTipOverflowing, setIsPromptTipOverflowing] = useState20(false);
23829
24063
  const [dockComposerInputHeight, setDockComposerInputHeight] = useState20(
23830
24064
  DOCK_COMPOSER_INPUT_MIN_HEIGHT2
@@ -23912,6 +24146,9 @@ function AgentComposer(props) {
23912
24146
  const controller = new AgentMentionSearchController({
23913
24147
  contextMentionProviders
23914
24148
  });
24149
+ controller.setProvenanceCatalog(
24150
+ referenceProvenanceFilter?.snapshot.catalog ?? null
24151
+ );
23915
24152
  controller.setProvenanceFilter(
23916
24153
  referenceProvenanceFilter?.snapshot.value ?? null
23917
24154
  );
@@ -23939,10 +24176,16 @@ function AgentComposer(props) {
23939
24176
  }
23940
24177
  }, [draftContent, draftPrompt, goalDraftObjective]);
23941
24178
  useEffect28(() => {
24179
+ mentionControllerRef.current?.setProvenanceCatalog(
24180
+ referenceProvenanceFilter?.snapshot.catalog ?? null
24181
+ );
23942
24182
  mentionControllerRef.current?.setProvenanceFilter(
23943
24183
  referenceProvenanceFilter?.snapshot.value ?? null
23944
24184
  );
23945
- }, [referenceProvenanceFilter?.snapshot.value]);
24185
+ }, [
24186
+ referenceProvenanceFilter?.snapshot.catalog,
24187
+ referenceProvenanceFilter?.snapshot.value
24188
+ ]);
23946
24189
  useEffect28(() => {
23947
24190
  if (previousSlashStatusAgentSessionIdRef.current === slashStatusAgentSessionId) {
23948
24191
  return;
@@ -24996,7 +25239,7 @@ function EmptyHeroTitle({
24996
25239
 
24997
25240
  // agent-gui/agentGuiNode/view/AgentGUIProviderManagerDialog.tsx
24998
25241
  import {
24999
- useRef as useRef30,
25242
+ useRef as useRef31,
25000
25243
  useState as useState22
25001
25244
  } from "react";
25002
25245
  import { CircleMinus, CirclePlus } from "lucide-react";
@@ -25038,12 +25281,12 @@ function AgentGUIProviderManagerDialog({
25038
25281
  null
25039
25282
  );
25040
25283
  const [dragPreview, setDragPreview] = useState22(null);
25041
- const dragStateRef = useRef30(null);
25042
- const dragPreviewRef = useRef30(null);
25284
+ const dragStateRef = useRef31(null);
25285
+ const dragPreviewRef = useRef31(null);
25043
25286
  const [longPressTargetId, setLongPressTargetId] = useState22(
25044
25287
  null
25045
25288
  );
25046
- const longPressOriginRef = useRef30(null);
25289
+ const longPressOriginRef = useRef31(null);
25047
25290
  const finalAvailableAgent = availableTargets.length === 1;
25048
25291
  const showRunningAgentBlocked = (targetId) => {
25049
25292
  const target = targets.find((candidate) => candidate.targetId === targetId);
@@ -25642,7 +25885,7 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
25642
25885
  preferences: providerRailPreferences
25643
25886
  } = useAgentGUIProviderRailPreferences();
25644
25887
  const [dragState, setDragState] = useState24(null);
25645
- const dragStateRef = useRef31(null);
25888
+ const dragStateRef = useRef32(null);
25646
25889
  const setProviderRailDragState = useCallback40(
25647
25890
  (nextDragState) => {
25648
25891
  dragStateRef.current = nextDragState;
@@ -26102,9 +26345,9 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
26102
26345
  if (previewMode) {
26103
26346
  return tile;
26104
26347
  }
26105
- return /* @__PURE__ */ jsxs30(Tooltip6, { children: [
26106
- /* @__PURE__ */ jsx41(TooltipTrigger6, { asChild: true, children: tile }),
26107
- /* @__PURE__ */ jsx41(TooltipContent6, { side: "right", sideOffset: -4, children: label })
26348
+ return /* @__PURE__ */ jsxs30(Tooltip5, { children: [
26349
+ /* @__PURE__ */ jsx41(TooltipTrigger5, { asChild: true, children: tile }),
26350
+ /* @__PURE__ */ jsx41(TooltipContent5, { side: "right", sideOffset: -4, children: label })
26108
26351
  ] }, `${target.provider}:${target.targetId}:tooltip`);
26109
26352
  })
26110
26353
  ]
@@ -26125,7 +26368,7 @@ import {
26125
26368
  useEffect as useEffect30,
26126
26369
  useLayoutEffect as useLayoutEffect6,
26127
26370
  useMemo as useMemo32,
26128
- useRef as useRef33,
26371
+ useRef as useRef34,
26129
26372
  useState as useState27
26130
26373
  } from "react";
26131
26374
  import {
@@ -26254,279 +26497,10 @@ function AgentConversationListSkeleton({
26254
26497
  );
26255
26498
  }
26256
26499
 
26257
- // agent-gui/agentGuiNode/agentGuiNodeViewConversation.tsx
26258
- import { Spinner as Spinner5 } from "@tutti-os/ui-system";
26259
- import { AskLinedIcon } from "@tutti-os/ui-system/icons";
26260
- import { jsx as jsx44 } from "react/jsx-runtime";
26261
- function ConversationMeta({
26262
- item,
26263
- nowMs,
26264
- labels
26265
- }) {
26266
- "use memo";
26267
- const kind = conversationMetaKind(item);
26268
- if (kind === "loading") {
26269
- return /* @__PURE__ */ jsx44(
26270
- "span",
26271
- {
26272
- className: AgentGUINode_styles_default.conversationMeta,
26273
- "data-kind": kind,
26274
- "data-testid": `agent-gui-conversation-meta-${item.id}`,
26275
- children: /* @__PURE__ */ jsx44(LoadingGlyph, {})
26276
- }
26277
- );
26278
- }
26279
- if (kind === "waiting") {
26280
- return /* @__PURE__ */ jsx44(
26281
- "span",
26282
- {
26283
- className: AgentGUINode_styles_default.conversationMeta,
26284
- "data-kind": kind,
26285
- "data-testid": `agent-gui-conversation-meta-${item.id}`,
26286
- children: /* @__PURE__ */ jsx44(
26287
- AskLinedIcon,
26288
- {
26289
- "aria-hidden": "true",
26290
- className: AgentGUINode_styles_default.conversationStatusGlyph
26291
- }
26292
- )
26293
- }
26294
- );
26295
- }
26296
- if (kind === "failed") {
26297
- return /* @__PURE__ */ jsx44(
26298
- "span",
26299
- {
26300
- className: AgentGUINode_styles_default.conversationMeta,
26301
- "data-kind": kind,
26302
- "data-testid": `agent-gui-conversation-meta-${item.id}`,
26303
- children: /* @__PURE__ */ jsx44(AttentionGlyph, {})
26304
- }
26305
- );
26306
- }
26307
- if (kind === "unread-complete") {
26308
- return /* @__PURE__ */ jsx44(
26309
- "span",
26310
- {
26311
- className: AgentGUINode_styles_default.conversationMeta,
26312
- "data-kind": kind,
26313
- "data-testid": `agent-gui-conversation-meta-${item.id}`,
26314
- children: /* @__PURE__ */ jsx44("span", { className: AgentGUINode_styles_default.conversationUnreadLamp, "aria-hidden": "true" })
26315
- }
26316
- );
26317
- }
26318
- return /* @__PURE__ */ jsx44(
26319
- "span",
26320
- {
26321
- className: AgentGUINode_styles_default.conversationMeta,
26322
- "data-kind": kind,
26323
- "data-testid": `agent-gui-conversation-meta-${item.id}`,
26324
- children: /* @__PURE__ */ jsx44("span", { className: AgentGUINode_styles_default.conversationTime, children: formatConversationRelativeTime(
26325
- resolveAgentGUIConversationSortTimeUnixMs(item),
26326
- nowMs,
26327
- labels
26328
- ) })
26329
- }
26330
- );
26331
- }
26332
- function groupConversations(conversations, labels, userProjects = [], options = {}) {
26333
- const groups = [];
26334
- const pinned = conversations.filter((conversation) => (conversation.pinnedAtUnixMs ?? 0) > 0).sort(
26335
- (left, right) => (right.pinnedAtUnixMs ?? 0) - (left.pinnedAtUnixMs ?? 0) || resolveAgentGUIConversationSortTimeUnixMs(right) - resolveAgentGUIConversationSortTimeUnixMs(left) || left.id.localeCompare(right.id)
26336
- );
26337
- if (pinned.length > 0) {
26338
- groups.push({
26339
- id: "pinned",
26340
- kind: "pinned",
26341
- label: labels.sectionPinned,
26342
- project: null,
26343
- items: pinned
26344
- });
26345
- }
26346
- const projectGroups = /* @__PURE__ */ new Map();
26347
- const normalizedProjectPathByPath = /* @__PURE__ */ new Map();
26348
- const normalizeProjectPath = (path) => normalizeConversationProjectPathCached(path, normalizedProjectPathByPath);
26349
- userProjects.forEach((project, projectOrder) => {
26350
- const normalizedPath = normalizeProjectPath(project.path);
26351
- const sectionId = conversationProjectSectionId(project, normalizedPath);
26352
- if (projectGroups.has(sectionId)) {
26353
- return;
26354
- }
26355
- projectGroups.set(sectionId, {
26356
- id: sectionId,
26357
- kind: "project",
26358
- label: project.label,
26359
- project,
26360
- items: [],
26361
- projectOrder,
26362
- sectionOrder: 0,
26363
- projectUpdatedAtUnixMs: resolveConversationProjectUpdatedAtUnixMs(project)
26364
- });
26365
- });
26366
- if (options.includeEmptyConversations) {
26367
- projectGroups.set("conversations", {
26368
- id: "conversations",
26369
- kind: "conversations",
26370
- label: labels.sectionConversations,
26371
- project: null,
26372
- items: [],
26373
- projectOrder: Number.MAX_SAFE_INTEGER,
26374
- sectionOrder: 1,
26375
- projectUpdatedAtUnixMs: 0
26376
- });
26377
- }
26378
- for (const conversation of conversations) {
26379
- if ((conversation.pinnedAtUnixMs ?? 0) > 0) {
26380
- continue;
26381
- }
26382
- if (!conversation.project) {
26383
- const existing2 = projectGroups.get("conversations");
26384
- if (existing2) {
26385
- existing2.items.push(conversation);
26386
- continue;
26387
- }
26388
- projectGroups.set("conversations", {
26389
- id: "conversations",
26390
- kind: "conversations",
26391
- label: labels.sectionConversations,
26392
- project: null,
26393
- items: [conversation],
26394
- projectOrder: Number.MAX_SAFE_INTEGER,
26395
- sectionOrder: 1,
26396
- projectUpdatedAtUnixMs: 0
26397
- });
26398
- continue;
26399
- }
26400
- const normalizedPath = normalizeProjectPath(conversation.project.path);
26401
- const sectionId = conversationProjectSectionId(
26402
- conversation.project,
26403
- normalizedPath
26404
- );
26405
- const existing = projectGroups.get(sectionId);
26406
- if (existing) {
26407
- existing.items.push(conversation);
26408
- continue;
26409
- }
26410
- projectGroups.set(sectionId, {
26411
- id: sectionId,
26412
- kind: "project",
26413
- label: conversation.project.label,
26414
- project: conversation.project,
26415
- items: [conversation],
26416
- projectOrder: Number.MAX_SAFE_INTEGER - 1,
26417
- sectionOrder: 0,
26418
- projectUpdatedAtUnixMs: resolveConversationProjectUpdatedAtUnixMs(
26419
- conversation.project
26420
- )
26421
- });
26422
- }
26423
- groups.push(
26424
- ...[...projectGroups.values()].filter(
26425
- (group) => options.includeEmptyConversations || group.items.length > 0
26426
- ).sort(
26427
- (left, right) => left.sectionOrder - right.sectionOrder || right.projectUpdatedAtUnixMs - left.projectUpdatedAtUnixMs || left.projectOrder - right.projectOrder || left.label.localeCompare(right.label) || left.id.localeCompare(right.id)
26428
- ).map(
26429
- ({
26430
- projectOrder: _projectOrder,
26431
- sectionOrder: _sectionOrder,
26432
- projectUpdatedAtUnixMs: _projectUpdatedAtUnixMs,
26433
- ...group
26434
- }) => group
26435
- )
26436
- );
26437
- return groups;
26438
- }
26439
- function resolveConversationProjectUpdatedAtUnixMs(project) {
26440
- if (!project) {
26441
- return 0;
26442
- }
26443
- return project.updatedAtUnixMs ?? project.lastUsedAtUnixMs ?? project.createdAtUnixMs ?? 0;
26444
- }
26445
- function normalizeConversationProjectPathCached(path, normalizedPathByPath) {
26446
- const cached = normalizedPathByPath.get(path);
26447
- if (cached !== void 0) {
26448
- return cached;
26449
- }
26450
- const normalized = normalizeAgentGUIProjectPath(path);
26451
- normalizedPathByPath.set(path, normalized);
26452
- return normalized;
26453
- }
26454
- function conversationProjectSectionId(project, normalizedPath) {
26455
- return project.sectionKey?.trim() || `project:${normalizedPath}`;
26456
- }
26457
- function conversationMetaKind(conversation) {
26458
- if (conversation.status === "working") {
26459
- return "loading";
26460
- }
26461
- if (conversation.status === "waiting") {
26462
- return "waiting";
26463
- }
26464
- if (conversation.status === "failed") {
26465
- return "failed";
26466
- }
26467
- if (conversation.hasUnreadCompletion) {
26468
- return "unread-complete";
26469
- }
26470
- return "time";
26471
- }
26472
- function formatConversationRelativeTime(updatedAtUnixMs, nowMs, labels) {
26473
- const elapsedMs = Math.max(0, nowMs - updatedAtUnixMs);
26474
- const elapsedMinutes = Math.floor(elapsedMs / (60 * 1e3));
26475
- if (elapsedMinutes < 1) {
26476
- return labels.relativeTimeJustNow;
26477
- }
26478
- if (elapsedMinutes < 60) {
26479
- return labels.relativeTimeMinutes(elapsedMinutes);
26480
- }
26481
- const elapsedHours = Math.floor(elapsedMinutes / 60);
26482
- if (elapsedHours < 24) {
26483
- return labels.relativeTimeHours(elapsedHours);
26484
- }
26485
- const elapsedDays = Math.floor(elapsedHours / 24);
26486
- if (elapsedDays < 30) {
26487
- return labels.relativeTimeDays(elapsedDays);
26488
- }
26489
- const elapsedMonths = Math.floor(elapsedDays / 30);
26490
- if (elapsedMonths < 12) {
26491
- return labels.relativeTimeMonths(elapsedMonths);
26492
- }
26493
- return labels.relativeTimeYears(Math.floor(elapsedDays / 365));
26494
- }
26495
- function LoadingGlyph() {
26496
- "use memo";
26497
- return /* @__PURE__ */ jsx44(
26498
- Spinner5,
26499
- {
26500
- className: AgentGUINode_styles_default.conversationStatusGlyph,
26501
- size: 14,
26502
- style: { color: "var(--text-secondary)" },
26503
- strokeWidth: 2.25,
26504
- trackColor: "color-mix(in srgb, currentColor 24%, transparent)",
26505
- testId: "agent-gui-conversation-spinner"
26506
- }
26507
- );
26508
- }
26509
- function AttentionGlyph() {
26510
- "use memo";
26511
- return /* @__PURE__ */ jsx44(
26512
- "svg",
26513
- {
26514
- viewBox: "0 0 24 24",
26515
- fill: "none",
26516
- "aria-hidden": "true",
26517
- className: AgentGUINode_styles_default.conversationStatusGlyph,
26518
- children: /* @__PURE__ */ jsx44(
26519
- "path",
26520
- {
26521
- d: "M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM12.5 15C12.7761 15 13 15.2239 13 15.5V16.5C13 16.7761 12.7761 17 12.5 17H11.5C11.2239 17 11 16.7761 11 16.5V15.5C11 15.2239 11.2239 15 11.5 15H12.5ZM12.5 7C12.7761 7 13 7.22386 13 7.5V13.5C13 13.7761 12.7761 14 12.5 14H11.5C11.2239 14 11 13.7761 11 13.5V7.5C11 7.22386 11.2239 7 11.5 7H12.5Z",
26522
- fill: "currentColor"
26523
- }
26524
- )
26525
- }
26526
- );
26527
- }
26528
-
26529
26500
  // agent-gui/agentGuiNode/model/agentGuiConversationRail.ts
26501
+ function isConversationRailInitialLoadPending(input) {
26502
+ return input.runtimeSectionsEnabled && input.pending && input.sections === null;
26503
+ }
26530
26504
  function canonicalConversationRailSummaries(conversations) {
26531
26505
  return conversations.filter(
26532
26506
  (conversation) => conversation.projectionSource !== "pending_activation"
@@ -26543,12 +26517,13 @@ function projectConversationRailSectionsWithTransientConversations(input) {
26543
26517
  const loadedIds = new Set(
26544
26518
  input.sections.flatMap((section) => section.items.map((item) => item.id))
26545
26519
  );
26546
- const transientSections = groupConversations(
26547
- transientConversations.filter(
26520
+ const transientSections = projectConversationsByExactRailSectionKey({
26521
+ conversations: transientConversations.filter(
26548
26522
  (conversation) => !loadedIds.has(conversation.id)
26549
26523
  ),
26550
- input.labels
26551
- );
26524
+ labels: input.labels,
26525
+ sections: input.sections
26526
+ });
26552
26527
  if (transientSections.length === 0) {
26553
26528
  return input.sections;
26554
26529
  }
@@ -26607,44 +26582,33 @@ function projectConversationRailSectionsWithActiveConversation(input) {
26607
26582
  if (!activeConversation || !activeConversationId) {
26608
26583
  return { activeOverlay: null, sections: input.sections };
26609
26584
  }
26610
- const loadedSection = input.sections.find(
26611
- (section) => section.items.some((item) => item.id === activeConversationId)
26585
+ const activeSectionId = conversationRailSectionId(activeConversation);
26586
+ if (!activeSectionId) {
26587
+ return { activeOverlay: null, sections: input.sections };
26588
+ }
26589
+ const matchingSection = input.sections.find(
26590
+ (section) => section.id === activeSectionId
26612
26591
  );
26613
- if (loadedSection) {
26592
+ if (matchingSection) {
26614
26593
  return {
26615
26594
  activeOverlay: {
26616
- conversation: loadedSection.kind === "project" ? conversationWithRailProject(
26595
+ conversation: matchingSection.kind === "project" ? conversationWithRailProject(
26617
26596
  activeConversation,
26618
- loadedSection.project
26597
+ matchingSection.project
26619
26598
  ) : activeConversation,
26620
- sectionId: loadedSection.id
26599
+ sectionId: matchingSection.id
26621
26600
  },
26622
26601
  sections: input.sections
26623
26602
  };
26624
26603
  }
26625
- const activeSection = groupConversations(
26626
- [activeConversation],
26604
+ const activeSection = createExactConversationRailSection(
26605
+ activeConversation,
26627
26606
  input.labels
26628
- )[0];
26607
+ );
26629
26608
  if (!activeSection) {
26630
26609
  return { activeOverlay: null, sections: input.sections };
26631
26610
  }
26632
- const matchingSectionIndex = input.sections.findIndex(
26633
- (section) => section.id === activeSection.id
26634
- );
26635
- if (matchingSectionIndex >= 0) {
26636
- const matchingSection = input.sections[matchingSectionIndex];
26637
- return {
26638
- activeOverlay: {
26639
- conversation: matchingSection?.kind === "project" ? conversationWithRailProject(
26640
- activeConversation,
26641
- matchingSection.project
26642
- ) : activeConversation,
26643
- sectionId: activeSection.id
26644
- },
26645
- sections: input.sections
26646
- };
26647
- }
26611
+ const projectedConversation = activeSection.items[0] ?? activeConversation;
26648
26612
  const transientSection = { ...activeSection, items: [] };
26649
26613
  let sections;
26650
26614
  if (activeSection.kind === "pinned") {
@@ -26667,7 +26631,7 @@ function projectConversationRailSectionsWithActiveConversation(input) {
26667
26631
  }
26668
26632
  return {
26669
26633
  activeOverlay: {
26670
- conversation: activeConversation,
26634
+ conversation: projectedConversation,
26671
26635
  sectionId: activeSection.id
26672
26636
  },
26673
26637
  sections
@@ -26676,6 +26640,139 @@ function projectConversationRailSectionsWithActiveConversation(input) {
26676
26640
  function conversationWithRailProject(conversation, project) {
26677
26641
  return conversationProjectsRenderEqual2(conversation.project, project) ? conversation : { ...conversation, project };
26678
26642
  }
26643
+ function conversationRailSectionId(conversation) {
26644
+ if ((conversation.pinnedAtUnixMs ?? 0) > 0) {
26645
+ return "pinned";
26646
+ }
26647
+ const sectionKey = conversation.railSectionKey?.trim() ?? "";
26648
+ return sectionKey || null;
26649
+ }
26650
+ function createExactConversationRailSection(conversation, labels) {
26651
+ const sectionId = conversationRailSectionId(conversation);
26652
+ if (!sectionId) {
26653
+ return null;
26654
+ }
26655
+ if (sectionId === "pinned") {
26656
+ return {
26657
+ id: sectionId,
26658
+ kind: "pinned",
26659
+ label: labels.sectionPinned,
26660
+ project: null,
26661
+ items: [{ ...conversation, project: null }]
26662
+ };
26663
+ }
26664
+ if (sectionId === "conversations") {
26665
+ return {
26666
+ id: sectionId,
26667
+ kind: "conversations",
26668
+ label: labels.sectionConversations,
26669
+ project: null,
26670
+ items: [{ ...conversation, project: null }]
26671
+ };
26672
+ }
26673
+ const project = conversation.project;
26674
+ if (project?.sectionKey?.trim() !== sectionId) {
26675
+ return null;
26676
+ }
26677
+ return {
26678
+ id: sectionId,
26679
+ kind: "project",
26680
+ label: project.label,
26681
+ project,
26682
+ items: [conversationWithRailProject(conversation, project)]
26683
+ };
26684
+ }
26685
+ function projectConversationsByExactRailSectionKey(input) {
26686
+ const sectionTemplates = new Map(
26687
+ input.sections.map((section) => [section.id, section])
26688
+ );
26689
+ const projected = /* @__PURE__ */ new Map();
26690
+ if (input.includeEmptySections) {
26691
+ for (const section of input.sections) {
26692
+ if (section.kind === "pinned") continue;
26693
+ projected.set(section.id, { ...section, items: [] });
26694
+ }
26695
+ }
26696
+ for (const conversation of input.conversations) {
26697
+ const sectionId = conversationRailSectionId(conversation);
26698
+ if (!sectionId) continue;
26699
+ const template = sectionTemplates.get(sectionId);
26700
+ const section = template ?? createExactConversationRailSection(conversation, input.labels);
26701
+ if (!section) continue;
26702
+ const projectedConversation = section.kind === "project" ? conversationWithRailProject(conversation, section.project) : conversation.project ? { ...conversation, project: null } : conversation;
26703
+ const existing = projected.get(sectionId);
26704
+ if (existing) {
26705
+ existing.items.push(projectedConversation);
26706
+ continue;
26707
+ }
26708
+ projected.set(sectionId, {
26709
+ ...section,
26710
+ items: [projectedConversation]
26711
+ });
26712
+ }
26713
+ const sorted = new Map(
26714
+ [...projected].map(([id, section]) => [
26715
+ id,
26716
+ {
26717
+ ...section,
26718
+ items: section.kind === "pinned" ? sortPinnedConversations(section.items) : sortConversations(section.items)
26719
+ }
26720
+ ])
26721
+ );
26722
+ const result = [];
26723
+ const append = (id) => {
26724
+ const section = sorted.get(id);
26725
+ if (!section) return;
26726
+ result.push(section);
26727
+ sorted.delete(id);
26728
+ };
26729
+ append("pinned");
26730
+ for (const section of input.sections) {
26731
+ if (section.kind === "pinned" || section.kind === "conversations") {
26732
+ continue;
26733
+ }
26734
+ append(section.id);
26735
+ }
26736
+ [...sorted.values()].filter((section) => section.kind === "project").sort((left, right) => left.id.localeCompare(right.id)).forEach((section) => append(section.id));
26737
+ for (const section of input.sections) {
26738
+ if (section.kind === "conversations") append(section.id);
26739
+ }
26740
+ append("conversations");
26741
+ [...sorted.keys()].sort().forEach(append);
26742
+ return result;
26743
+ }
26744
+ function projectConversationRailSectionsByExactKey(input) {
26745
+ const seen = /* @__PURE__ */ new Set();
26746
+ const sections = input.userProjects.flatMap(
26747
+ (project) => {
26748
+ const sectionKey = project.sectionKey?.trim() ?? "";
26749
+ if (!sectionKey || seen.has(sectionKey)) return [];
26750
+ seen.add(sectionKey);
26751
+ return [
26752
+ {
26753
+ id: sectionKey,
26754
+ kind: "project",
26755
+ label: project.label,
26756
+ project,
26757
+ items: []
26758
+ }
26759
+ ];
26760
+ }
26761
+ );
26762
+ sections.push({
26763
+ id: "conversations",
26764
+ kind: "conversations",
26765
+ label: input.labels.sectionConversations,
26766
+ project: null,
26767
+ items: []
26768
+ });
26769
+ return projectConversationsByExactRailSectionKey({
26770
+ conversations: input.conversations,
26771
+ labels: input.labels,
26772
+ sections,
26773
+ includeEmptySections: input.includeEmptySections
26774
+ });
26775
+ }
26679
26776
  function planRuntimeRailMembershipRefresh(input) {
26680
26777
  const previousPendingIds = new Set(
26681
26778
  input.previous.flatMap((conversation) => {
@@ -26794,12 +26891,17 @@ function projectConversationRailMemberships(input) {
26794
26891
  items: section.sessionIds.flatMap((id) => {
26795
26892
  const conversation = conversationsById.get(id);
26796
26893
  if (!conversation) return [];
26894
+ const exactSectionId = conversationRailSectionId(conversation);
26895
+ if (exactSectionId !== section.id) return [];
26797
26896
  return [
26798
26897
  section.kind === "project" ? { ...conversation, project: section.project } : { ...conversation, project: null }
26799
26898
  ];
26800
26899
  })
26801
26900
  }));
26802
26901
  }
26902
+ function projectConversationRailSearchSections(input) {
26903
+ return projectConversationsByExactRailSectionKey(input);
26904
+ }
26803
26905
  function stabilizeConversationSections(previous, next) {
26804
26906
  if (!previous) {
26805
26907
  return [...next];
@@ -26887,10 +26989,60 @@ function comparePinnedConversations(left, right) {
26887
26989
  return (right.pinnedAtUnixMs ?? 0) - (left.pinnedAtUnixMs ?? 0) || (right.sortTimeUnixMs ?? right.updatedAtUnixMs) - (left.sortTimeUnixMs ?? left.updatedAtUnixMs) || left.id.localeCompare(right.id);
26888
26990
  }
26889
26991
  function conversationSummariesRenderEqual2(left, right) {
26890
- return left.id === right.id && left.agentTargetId === right.agentTargetId && left.provider === right.provider && left.title === right.title && left.titleFallback === right.titleFallback && left.status === right.status && left.cwd === right.cwd && left.pinnedAtUnixMs === right.pinnedAtUnixMs && left.sortTimeUnixMs === right.sortTimeUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.projectionSource === right.projectionSource && left.isImported === right.isImported && left.hasUnreadCompletion === right.hasUnreadCompletion && left.unreadCompletionKey === right.unreadCompletionKey && conversationProjectsRenderEqual2(left.project, right.project);
26992
+ return left.id === right.id && left.agentTargetId === right.agentTargetId && left.provider === right.provider && left.title === right.title && left.titleLeadingMentionKind === right.titleLeadingMentionKind && left.titleFallback === right.titleFallback && left.status === right.status && left.cwd === right.cwd && left.railSectionKey === right.railSectionKey && left.pinnedAtUnixMs === right.pinnedAtUnixMs && left.sortTimeUnixMs === right.sortTimeUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.projectionSource === right.projectionSource && left.isImported === right.isImported && left.hasUnreadCompletion === right.hasUnreadCompletion && left.unreadCompletionKey === right.unreadCompletionKey && conversationProjectsRenderEqual2(left.project, right.project);
26891
26993
  }
26892
26994
  function conversationProjectsRenderEqual2(left, right) {
26893
- return left === right || (!left || !right ? !left && !right : left.id === right.id && left.path === right.path && left.label === right.label && left.createdAtUnixMs === right.createdAtUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.lastUsedAtUnixMs === right.lastUsedAtUnixMs && left.sectionKey === right.sectionKey);
26995
+ return left === right || (!left || !right ? !left && !right : left.id === right.id && left.path === right.path && left.sectionKey === right.sectionKey && left.label === right.label && left.createdAtUnixMs === right.createdAtUnixMs && left.updatedAtUnixMs === right.updatedAtUnixMs && left.lastUsedAtUnixMs === right.lastUsedAtUnixMs && left.sectionKey === right.sectionKey);
26996
+ }
26997
+
26998
+ // agent-gui/agentGuiNode/model/agentGuiConversationRailSectionTemplates.ts
26999
+ function preserveConversationRailSectionTemplates(input) {
27000
+ const existingById = new Map(
27001
+ input.sections.map((section) => [section.id, section])
27002
+ );
27003
+ const result = [];
27004
+ const pinned = existingById.get("pinned");
27005
+ if (pinned && pinned.items.length > 0) {
27006
+ result.push(pinned);
27007
+ }
27008
+ existingById.delete("pinned");
27009
+ const projectSectionKeys = /* @__PURE__ */ new Set();
27010
+ for (const project of input.userProjects) {
27011
+ const sectionKey = project.sectionKey?.trim() ?? "";
27012
+ if (!sectionKey || projectSectionKeys.has(sectionKey)) continue;
27013
+ projectSectionKeys.add(sectionKey);
27014
+ const existing = existingById.get(sectionKey);
27015
+ result.push({
27016
+ id: sectionKey,
27017
+ kind: "project",
27018
+ label: project.label,
27019
+ project,
27020
+ items: existing?.items ?? []
27021
+ });
27022
+ existingById.delete(sectionKey);
27023
+ }
27024
+ for (const section of input.sections) {
27025
+ if (section.kind !== "project" || !existingById.has(section.id)) continue;
27026
+ result.push(section);
27027
+ existingById.delete(section.id);
27028
+ }
27029
+ const conversations = existingById.get("conversations");
27030
+ result.push(
27031
+ conversations ?? {
27032
+ id: "conversations",
27033
+ kind: "conversations",
27034
+ label: input.labels.sectionConversations,
27035
+ project: null,
27036
+ items: []
27037
+ }
27038
+ );
27039
+ existingById.delete("conversations");
27040
+ for (const section of input.sections) {
27041
+ if (!existingById.has(section.id)) continue;
27042
+ result.push(section);
27043
+ existingById.delete(section.id);
27044
+ }
27045
+ return result;
26894
27046
  }
26895
27047
 
26896
27048
  // agent-gui/agentGuiNode/view/AgentGUIConversationRailSection.tsx
@@ -26901,9 +27053,9 @@ import {
26901
27053
  DropdownMenuContent as DropdownMenuContent4,
26902
27054
  DropdownMenuItem as DropdownMenuItem3,
26903
27055
  DropdownMenuTrigger as DropdownMenuTrigger4,
26904
- Tooltip as Tooltip7,
26905
- TooltipContent as TooltipContent7,
26906
- TooltipTrigger as TooltipTrigger7
27056
+ Tooltip as Tooltip6,
27057
+ TooltipContent as TooltipContent6,
27058
+ TooltipTrigger as TooltipTrigger6
26907
27059
  } from "@tutti-os/ui-system";
26908
27060
  import { BareIconButton as BareIconButton2 } from "@tutti-os/ui-system/components";
26909
27061
  import {
@@ -26918,7 +27070,7 @@ import {
26918
27070
  memo as memo5,
26919
27071
  useCallback as useCallback41,
26920
27072
  useMemo as useMemo31,
26921
- useRef as useRef32,
27073
+ useRef as useRef33,
26922
27074
  useState as useState25
26923
27075
  } from "react";
26924
27076
  import { ExternalLink as ExternalLink2 } from "lucide-react";
@@ -26927,6 +27079,11 @@ import {
26927
27079
  ContextMenuContent,
26928
27080
  ContextMenuItem,
26929
27081
  ContextMenuTrigger,
27082
+ AgentSessionsIcon,
27083
+ FileIcon,
27084
+ IssueIcon,
27085
+ NavAgentsIcon,
27086
+ NavApplicationsLinedIcon,
26930
27087
  NewWorkspaceLinedIcon as NewWorkspaceLinedIcon2,
26931
27088
  cn as cn5
26932
27089
  } from "@tutti-os/ui-system";
@@ -26934,10 +27091,10 @@ import { BareIconButton } from "@tutti-os/ui-system/components";
26934
27091
  import { WorkspaceUserProjectSelect as WorkspaceUserProjectSelect2 } from "@tutti-os/workspace-user-project/ui";
26935
27092
 
26936
27093
  // app/renderer/components/icons/PinFilledIcon.tsx
26937
- import { jsx as jsx45 } from "react/jsx-runtime";
27094
+ import { jsx as jsx44 } from "react/jsx-runtime";
26938
27095
  function PinFilledIcon(props) {
26939
27096
  "use memo";
26940
- return /* @__PURE__ */ jsx45(
27097
+ return /* @__PURE__ */ jsx44(
26941
27098
  "svg",
26942
27099
  {
26943
27100
  xmlns: "http://www.w3.org/2000/svg",
@@ -26945,16 +27102,16 @@ function PinFilledIcon(props) {
26945
27102
  fill: "currentColor",
26946
27103
  "aria-hidden": true,
26947
27104
  ...props,
26948
- children: /* @__PURE__ */ jsx45("path", { d: "M21.6066 8.05025C22.1692 8.61286 22.4849 9.37592 22.4849 10.1716C22.4849 10.9672 22.1692 11.7303 21.6066 12.2929C21.044 12.8555 20.2809 13.1713 19.4853 13.1713C18.6896 13.1713 17.9266 12.8555 17.3639 12.2929L14.7054 14.9514L14.6142 15.0564C14.531 15.1669 14.4714 15.2943 14.4395 15.43C14.3972 15.6109 14.406 15.8 14.4651 15.9762L14.4678 15.9831L15.0873 17.8717L15.1466 18.072C15.2691 18.5425 15.2761 19.037 15.1646 19.5124C15.0372 20.0557 14.7607 20.5526 14.3663 20.9474L13.8284 21.4853C13.4533 21.8604 12.9446 22.0709 12.4142 22.0709C11.8838 22.0709 11.3751 21.8604 11 21.4853L7.46445 17.9497L4.63603 20.7782C4.2455 21.1687 3.61234 21.1687 3.22181 20.7782C2.83129 20.3877 2.83129 19.7545 3.22181 19.364L6.05024 16.5355L2.51471 13C2.13963 12.6249 1.92913 12.1162 1.92913 11.5858C1.92913 11.0554 2.13963 10.5466 2.51471 10.1716L3.05263 9.63365L3.20524 9.49209C3.57235 9.17309 4.01205 8.94693 4.48756 8.83539C5.03093 8.70798 5.59924 8.73494 6.12827 8.91273L8.01688 9.53214L8.02379 9.5349C8.19995 9.59404 8.38907 9.60282 8.57 9.56045C8.7057 9.52863 8.83304 9.46898 8.94358 9.38575L9.04854 9.2946L11.7071 6.63604C11.1445 6.07343 10.8287 5.31037 10.8287 4.51472C10.8287 3.71907 11.1445 2.95601 11.7071 2.3934C12.2697 1.83079 13.0328 1.51504 13.8284 1.51504C14.6241 1.51504 15.3871 1.83079 15.9497 2.3934L21.6066 8.05025Z" })
27105
+ children: /* @__PURE__ */ jsx44("path", { d: "M21.6066 8.05025C22.1692 8.61286 22.4849 9.37592 22.4849 10.1716C22.4849 10.9672 22.1692 11.7303 21.6066 12.2929C21.044 12.8555 20.2809 13.1713 19.4853 13.1713C18.6896 13.1713 17.9266 12.8555 17.3639 12.2929L14.7054 14.9514L14.6142 15.0564C14.531 15.1669 14.4714 15.2943 14.4395 15.43C14.3972 15.6109 14.406 15.8 14.4651 15.9762L14.4678 15.9831L15.0873 17.8717L15.1466 18.072C15.2691 18.5425 15.2761 19.037 15.1646 19.5124C15.0372 20.0557 14.7607 20.5526 14.3663 20.9474L13.8284 21.4853C13.4533 21.8604 12.9446 22.0709 12.4142 22.0709C11.8838 22.0709 11.3751 21.8604 11 21.4853L7.46445 17.9497L4.63603 20.7782C4.2455 21.1687 3.61234 21.1687 3.22181 20.7782C2.83129 20.3877 2.83129 19.7545 3.22181 19.364L6.05024 16.5355L2.51471 13C2.13963 12.6249 1.92913 12.1162 1.92913 11.5858C1.92913 11.0554 2.13963 10.5466 2.51471 10.1716L3.05263 9.63365L3.20524 9.49209C3.57235 9.17309 4.01205 8.94693 4.48756 8.83539C5.03093 8.70798 5.59924 8.73494 6.12827 8.91273L8.01688 9.53214L8.02379 9.5349C8.19995 9.59404 8.38907 9.60282 8.57 9.56045C8.7057 9.52863 8.83304 9.46898 8.94358 9.38575L9.04854 9.2946L11.7071 6.63604C11.1445 6.07343 10.8287 5.31037 10.8287 4.51472C10.8287 3.71907 11.1445 2.95601 11.7071 2.3934C12.2697 1.83079 13.0328 1.51504 13.8284 1.51504C14.6241 1.51504 15.3871 1.83079 15.9497 2.3934L21.6066 8.05025Z" })
26949
27106
  }
26950
27107
  );
26951
27108
  }
26952
27109
 
26953
27110
  // app/renderer/components/icons/PinLinedIcon.tsx
26954
- import { jsx as jsx46 } from "react/jsx-runtime";
27111
+ import { jsx as jsx45 } from "react/jsx-runtime";
26955
27112
  function PinLinedIcon(props) {
26956
27113
  "use memo";
26957
- return /* @__PURE__ */ jsx46(
27114
+ return /* @__PURE__ */ jsx45(
26958
27115
  "svg",
26959
27116
  {
26960
27117
  xmlns: "http://www.w3.org/2000/svg",
@@ -26962,7 +27119,154 @@ function PinLinedIcon(props) {
26962
27119
  fill: "currentColor",
26963
27120
  "aria-hidden": true,
26964
27121
  ...props,
26965
- children: /* @__PURE__ */ jsx46("path", { d: "M21.6066 8.05025C22.1692 8.61286 22.4849 9.37592 22.4849 10.1716C22.4849 10.9672 22.1692 11.7303 21.6066 12.2929C21.044 12.8555 20.2809 13.1713 19.4853 13.1713C18.6896 13.1713 17.9266 12.8555 17.3639 12.2929L14.7054 14.9514L14.6142 15.0564C14.531 15.1669 14.4714 15.2943 14.4395 15.43C14.3972 15.6109 14.406 15.8 14.4651 15.9762L14.4678 15.9831L15.0873 17.8717L15.1466 18.072C15.2691 18.5425 15.2761 19.037 15.1646 19.5124C15.0372 20.0557 14.7607 20.5526 14.3663 20.9474L13.8284 21.4853C13.4533 21.8604 12.9446 22.0709 12.4142 22.0709C11.8838 22.0709 11.3751 21.8604 11 21.4853L7.46445 17.9497L4.63603 20.7782C4.2455 21.1687 3.61234 21.1687 3.22181 20.7782C2.83129 20.3877 2.83129 19.7545 3.22181 19.364L6.05024 16.5355L2.51471 13C2.13963 12.6249 1.92913 12.1162 1.92913 11.5858C1.92913 11.0554 2.13963 10.5466 2.51471 10.1716L3.05263 9.63365L3.20524 9.49209C3.57235 9.17309 4.01205 8.94693 4.48756 8.83539C5.03093 8.70798 5.59924 8.73494 6.12827 8.91273L8.01688 9.53214L8.02379 9.5349C8.19995 9.59404 8.38907 9.60282 8.57 9.56045C8.7057 9.52863 8.83304 9.46898 8.94358 9.38575L9.04854 9.2946L11.7071 6.63604C11.1445 6.07343 10.8287 5.31037 10.8287 4.51472C10.8287 3.71907 11.1445 2.95601 11.7071 2.3934C12.2697 1.83079 13.0328 1.51504 13.8284 1.51504C14.6241 1.51504 15.3871 1.83079 15.9497 2.3934L21.6066 8.05025ZM14.5355 3.80761C14.348 3.62008 14.0936 3.51483 13.8284 3.51483C13.5632 3.51483 13.3088 3.62008 13.1213 3.80761C12.9338 3.99515 12.8285 4.2495 12.8285 4.51472C12.8285 4.74685 12.9091 4.97066 13.055 5.14863L13.2539 5.36822C13.5457 5.72416 13.7069 6.17177 13.7069 6.63604C13.7069 7.16647 13.4964 7.67518 13.1213 8.05025L10.4621 10.7095C10.0673 11.1038 9.57037 11.3803 9.02713 11.5078C8.48575 11.6347 7.92002 11.6071 7.39264 11.4311V11.4325L5.49781 10.811L5.49091 10.8082C5.31475 10.7491 5.12562 10.7403 4.94469 10.7827C4.76366 10.8251 4.59774 10.9172 4.46615 11.0486L3.92892 11.5858L12.4142 20.0711L12.9514 19.5338C13.0828 19.4022 13.1748 19.2363 13.2173 19.0553C13.2597 18.8744 13.2509 18.6852 13.1917 18.5091L13.189 18.5022L12.5675 16.6073L12.5682 16.6067C12.3924 16.0795 12.3654 15.514 12.4922 14.9729C12.6197 14.4296 12.8962 13.9327 13.2905 13.5379L15.9497 10.8787C16.3248 10.5036 16.8335 10.2931 17.3639 10.2931C17.8282 10.2931 18.2758 10.4543 18.6318 10.7461L18.8514 10.945C19.0293 11.0909 19.2531 11.1715 19.4853 11.1715C19.7505 11.1715 20.0048 11.0662 20.1924 10.8787C20.3799 10.6911 20.4852 10.4368 20.4852 10.1716C20.4852 9.90636 20.3799 9.652 20.1924 9.46447L14.5355 3.80761Z" })
27122
+ children: /* @__PURE__ */ jsx45("path", { d: "M21.6066 8.05025C22.1692 8.61286 22.4849 9.37592 22.4849 10.1716C22.4849 10.9672 22.1692 11.7303 21.6066 12.2929C21.044 12.8555 20.2809 13.1713 19.4853 13.1713C18.6896 13.1713 17.9266 12.8555 17.3639 12.2929L14.7054 14.9514L14.6142 15.0564C14.531 15.1669 14.4714 15.2943 14.4395 15.43C14.3972 15.6109 14.406 15.8 14.4651 15.9762L14.4678 15.9831L15.0873 17.8717L15.1466 18.072C15.2691 18.5425 15.2761 19.037 15.1646 19.5124C15.0372 20.0557 14.7607 20.5526 14.3663 20.9474L13.8284 21.4853C13.4533 21.8604 12.9446 22.0709 12.4142 22.0709C11.8838 22.0709 11.3751 21.8604 11 21.4853L7.46445 17.9497L4.63603 20.7782C4.2455 21.1687 3.61234 21.1687 3.22181 20.7782C2.83129 20.3877 2.83129 19.7545 3.22181 19.364L6.05024 16.5355L2.51471 13C2.13963 12.6249 1.92913 12.1162 1.92913 11.5858C1.92913 11.0554 2.13963 10.5466 2.51471 10.1716L3.05263 9.63365L3.20524 9.49209C3.57235 9.17309 4.01205 8.94693 4.48756 8.83539C5.03093 8.70798 5.59924 8.73494 6.12827 8.91273L8.01688 9.53214L8.02379 9.5349C8.19995 9.59404 8.38907 9.60282 8.57 9.56045C8.7057 9.52863 8.83304 9.46898 8.94358 9.38575L9.04854 9.2946L11.7071 6.63604C11.1445 6.07343 10.8287 5.31037 10.8287 4.51472C10.8287 3.71907 11.1445 2.95601 11.7071 2.3934C12.2697 1.83079 13.0328 1.51504 13.8284 1.51504C14.6241 1.51504 15.3871 1.83079 15.9497 2.3934L21.6066 8.05025ZM14.5355 3.80761C14.348 3.62008 14.0936 3.51483 13.8284 3.51483C13.5632 3.51483 13.3088 3.62008 13.1213 3.80761C12.9338 3.99515 12.8285 4.2495 12.8285 4.51472C12.8285 4.74685 12.9091 4.97066 13.055 5.14863L13.2539 5.36822C13.5457 5.72416 13.7069 6.17177 13.7069 6.63604C13.7069 7.16647 13.4964 7.67518 13.1213 8.05025L10.4621 10.7095C10.0673 11.1038 9.57037 11.3803 9.02713 11.5078C8.48575 11.6347 7.92002 11.6071 7.39264 11.4311V11.4325L5.49781 10.811L5.49091 10.8082C5.31475 10.7491 5.12562 10.7403 4.94469 10.7827C4.76366 10.8251 4.59774 10.9172 4.46615 11.0486L3.92892 11.5858L12.4142 20.0711L12.9514 19.5338C13.0828 19.4022 13.1748 19.2363 13.2173 19.0553C13.2597 18.8744 13.2509 18.6852 13.1917 18.5091L13.189 18.5022L12.5675 16.6073L12.5682 16.6067C12.3924 16.0795 12.3654 15.514 12.4922 14.9729C12.6197 14.4296 12.8962 13.9327 13.2905 13.5379L15.9497 10.8787C16.3248 10.5036 16.8335 10.2931 17.3639 10.2931C17.8282 10.2931 18.2758 10.4543 18.6318 10.7461L18.8514 10.945C19.0293 11.0909 19.2531 11.1715 19.4853 11.1715C19.7505 11.1715 20.0048 11.0662 20.1924 10.8787C20.3799 10.6911 20.4852 10.4368 20.4852 10.1716C20.4852 9.90636 20.3799 9.652 20.1924 9.46447L14.5355 3.80761Z" })
27123
+ }
27124
+ );
27125
+ }
27126
+
27127
+ // agent-gui/agentGuiNode/agentGuiNodeViewConversation.tsx
27128
+ import { Spinner as Spinner5 } from "@tutti-os/ui-system";
27129
+ import { AskLinedIcon } from "@tutti-os/ui-system/icons";
27130
+ import { jsx as jsx46 } from "react/jsx-runtime";
27131
+ function ConversationMeta({
27132
+ item,
27133
+ nowMs,
27134
+ labels
27135
+ }) {
27136
+ "use memo";
27137
+ const kind = conversationMetaKind(item);
27138
+ if (kind === "loading") {
27139
+ return /* @__PURE__ */ jsx46(
27140
+ "span",
27141
+ {
27142
+ className: AgentGUINode_styles_default.conversationMeta,
27143
+ "data-kind": kind,
27144
+ "data-testid": `agent-gui-conversation-meta-${item.id}`,
27145
+ children: /* @__PURE__ */ jsx46(LoadingGlyph, {})
27146
+ }
27147
+ );
27148
+ }
27149
+ if (kind === "waiting") {
27150
+ return /* @__PURE__ */ jsx46(
27151
+ "span",
27152
+ {
27153
+ className: AgentGUINode_styles_default.conversationMeta,
27154
+ "data-kind": kind,
27155
+ "data-testid": `agent-gui-conversation-meta-${item.id}`,
27156
+ children: /* @__PURE__ */ jsx46(
27157
+ AskLinedIcon,
27158
+ {
27159
+ "aria-hidden": "true",
27160
+ className: AgentGUINode_styles_default.conversationStatusGlyph
27161
+ }
27162
+ )
27163
+ }
27164
+ );
27165
+ }
27166
+ if (kind === "failed") {
27167
+ return /* @__PURE__ */ jsx46(
27168
+ "span",
27169
+ {
27170
+ className: AgentGUINode_styles_default.conversationMeta,
27171
+ "data-kind": kind,
27172
+ "data-testid": `agent-gui-conversation-meta-${item.id}`,
27173
+ children: /* @__PURE__ */ jsx46(AttentionGlyph, {})
27174
+ }
27175
+ );
27176
+ }
27177
+ if (kind === "unread-complete") {
27178
+ return /* @__PURE__ */ jsx46(
27179
+ "span",
27180
+ {
27181
+ className: AgentGUINode_styles_default.conversationMeta,
27182
+ "data-kind": kind,
27183
+ "data-testid": `agent-gui-conversation-meta-${item.id}`,
27184
+ children: /* @__PURE__ */ jsx46("span", { className: AgentGUINode_styles_default.conversationUnreadLamp, "aria-hidden": "true" })
27185
+ }
27186
+ );
27187
+ }
27188
+ return /* @__PURE__ */ jsx46(
27189
+ "span",
27190
+ {
27191
+ className: AgentGUINode_styles_default.conversationMeta,
27192
+ "data-kind": kind,
27193
+ "data-testid": `agent-gui-conversation-meta-${item.id}`,
27194
+ children: /* @__PURE__ */ jsx46("span", { className: AgentGUINode_styles_default.conversationTime, children: formatConversationRelativeTime(
27195
+ resolveAgentGUIConversationSortTimeUnixMs(item),
27196
+ nowMs,
27197
+ labels
27198
+ ) })
27199
+ }
27200
+ );
27201
+ }
27202
+ function conversationMetaKind(conversation) {
27203
+ if (conversation.status === "working") {
27204
+ return "loading";
27205
+ }
27206
+ if (conversation.status === "waiting") {
27207
+ return "waiting";
27208
+ }
27209
+ if (conversation.status === "failed") {
27210
+ return "failed";
27211
+ }
27212
+ if (conversation.hasUnreadCompletion) {
27213
+ return "unread-complete";
27214
+ }
27215
+ return "time";
27216
+ }
27217
+ function formatConversationRelativeTime(updatedAtUnixMs, nowMs, labels) {
27218
+ const elapsedMs = Math.max(0, nowMs - updatedAtUnixMs);
27219
+ const elapsedMinutes = Math.floor(elapsedMs / (60 * 1e3));
27220
+ if (elapsedMinutes < 1) {
27221
+ return labels.relativeTimeJustNow;
27222
+ }
27223
+ if (elapsedMinutes < 60) {
27224
+ return labels.relativeTimeMinutes(elapsedMinutes);
27225
+ }
27226
+ const elapsedHours = Math.floor(elapsedMinutes / 60);
27227
+ if (elapsedHours < 24) {
27228
+ return labels.relativeTimeHours(elapsedHours);
27229
+ }
27230
+ const elapsedDays = Math.floor(elapsedHours / 24);
27231
+ if (elapsedDays < 30) {
27232
+ return labels.relativeTimeDays(elapsedDays);
27233
+ }
27234
+ const elapsedMonths = Math.floor(elapsedDays / 30);
27235
+ if (elapsedMonths < 12) {
27236
+ return labels.relativeTimeMonths(elapsedMonths);
27237
+ }
27238
+ return labels.relativeTimeYears(Math.floor(elapsedDays / 365));
27239
+ }
27240
+ function LoadingGlyph() {
27241
+ "use memo";
27242
+ return /* @__PURE__ */ jsx46(
27243
+ Spinner5,
27244
+ {
27245
+ className: AgentGUINode_styles_default.conversationStatusGlyph,
27246
+ size: 14,
27247
+ style: { color: "var(--text-secondary)" },
27248
+ strokeWidth: 2.25,
27249
+ trackColor: "color-mix(in srgb, currentColor 24%, transparent)",
27250
+ testId: "agent-gui-conversation-spinner"
27251
+ }
27252
+ );
27253
+ }
27254
+ function AttentionGlyph() {
27255
+ "use memo";
27256
+ return /* @__PURE__ */ jsx46(
27257
+ "svg",
27258
+ {
27259
+ viewBox: "0 0 24 24",
27260
+ fill: "none",
27261
+ "aria-hidden": "true",
27262
+ className: AgentGUINode_styles_default.conversationStatusGlyph,
27263
+ children: /* @__PURE__ */ jsx46(
27264
+ "path",
27265
+ {
27266
+ d: "M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM12.5 15C12.7761 15 13 15.2239 13 15.5V16.5C13 16.7761 12.7761 17 12.5 17H11.5C11.2239 17 11 16.7761 11 16.5V15.5C11 15.2239 11.2239 15 11.5 15H12.5ZM12.5 7C12.7761 7 13 7.22386 13 7.5V13.5C13 13.7761 12.7761 14 12.5 14H11.5C11.2239 14 11 13.7761 11 13.5V7.5C11 7.22386 11.2239 7 11.5 7H12.5Z",
27267
+ fill: "currentColor"
27268
+ }
27269
+ )
26966
27270
  }
26967
27271
  );
26968
27272
  }
@@ -26977,6 +27281,10 @@ function agentGUIConversationIconUrl(provider, agentTargetId, workspaceId, agent
26977
27281
  });
26978
27282
  return resolveAgentGuiSessionProviderFlatIconUrl(provider) || targetPresentation?.iconUrl?.trim() || null;
26979
27283
  }
27284
+ function agentGUIConversationRailTitle(item, labels, uiLanguage) {
27285
+ const title = conversationPlainTitle(item, labels, uiLanguage);
27286
+ return item.titleLeadingMentionKind ? title.replace(/^@\s*/, "") : title;
27287
+ }
26980
27288
  var AgentGUIConversationRailItem = memo5(
26981
27289
  function AgentGUIConversationRailItem2({
26982
27290
  item,
@@ -27015,9 +27323,9 @@ var AgentGUIConversationRailItem = memo5(
27015
27323
  [item.id, registerItemElement]
27016
27324
  );
27017
27325
  const [contextMenuResetKey, setContextMenuResetKey] = useState25(0);
27018
- const contextMenuRenameRequestedRef = useRef32(false);
27019
- const contextMenuOpenConversationWindowRequestedRef = useRef32(false);
27020
- const contextMenuCopySessionLinkRequestedRef = useRef32(false);
27326
+ const contextMenuRenameRequestedRef = useRef33(false);
27327
+ const contextMenuOpenConversationWindowRequestedRef = useRef33(false);
27328
+ const contextMenuCopySessionLinkRequestedRef = useRef33(false);
27021
27329
  const agentHostApi = useOptionalAgentHostApi();
27022
27330
  const handleMouseLeave = useCallback41(() => {
27023
27331
  if (isPendingDeleteConversation && !isRailInteractionLocked()) {
@@ -27166,7 +27474,21 @@ var AgentGUIConversationRailItem = memo5(
27166
27474
  }
27167
27475
  }
27168
27476
  ) : null,
27169
- /* @__PURE__ */ jsx47("span", { className: AgentGUINode_styles_default.conversationTitle, children: conversationPlainTitle(item, labels, uiLanguage) })
27477
+ item.titleLeadingMentionKind ? /* @__PURE__ */ jsx47(
27478
+ "span",
27479
+ {
27480
+ "aria-hidden": "true",
27481
+ className: AgentGUINode_styles_default.conversationTitleMentionIcon,
27482
+ "data-agent-gui-conversation-title-mention-icon": item.titleLeadingMentionKind,
27483
+ children: /* @__PURE__ */ jsx47(
27484
+ ConversationTitleMentionIcon,
27485
+ {
27486
+ kind: item.titleLeadingMentionKind
27487
+ }
27488
+ )
27489
+ }
27490
+ ) : null,
27491
+ /* @__PURE__ */ jsx47("span", { className: AgentGUINode_styles_default.conversationTitle, children: agentGUIConversationRailTitle(item, labels, uiLanguage) })
27170
27492
  ] }),
27171
27493
  /* @__PURE__ */ jsx47(ConversationMeta, { item, nowMs: currentTimeMs, labels })
27172
27494
  ]
@@ -27320,6 +27642,15 @@ var AgentGUIConversationRailItem = memo5(
27320
27642
  ] }, contextMenuResetKey);
27321
27643
  }
27322
27644
  );
27645
+ function ConversationTitleMentionIcon({
27646
+ kind
27647
+ }) {
27648
+ if (kind === "task") return /* @__PURE__ */ jsx47(IssueIcon, {});
27649
+ if (kind === "app") return /* @__PURE__ */ jsx47(NavApplicationsLinedIcon, {});
27650
+ if (kind === "file") return /* @__PURE__ */ jsx47(FileIcon, {});
27651
+ if (kind === "agent") return /* @__PURE__ */ jsx47(NavAgentsIcon, {});
27652
+ return /* @__PURE__ */ jsx47(AgentSessionsIcon, {});
27653
+ }
27323
27654
  function AgentGUIProjectRailHeader({
27324
27655
  disabled,
27325
27656
  labels,
@@ -27587,8 +27918,8 @@ var AgentGUIConversationRailSection = memo6(
27587
27918
  onClick: handleCreateConversation,
27588
27919
  children: /* @__PURE__ */ jsx48(CreateChatIcon, { "aria-hidden": "true" })
27589
27920
  }
27590
- ) }) : /* @__PURE__ */ jsxs34(Tooltip7, { children: [
27591
- /* @__PURE__ */ jsx48(TooltipTrigger7, { asChild: true, children: /* @__PURE__ */ jsx48(
27921
+ ) }) : /* @__PURE__ */ jsxs34(Tooltip6, { children: [
27922
+ /* @__PURE__ */ jsx48(TooltipTrigger6, { asChild: true, children: /* @__PURE__ */ jsx48(
27592
27923
  "span",
27593
27924
  {
27594
27925
  className: AgentGUINode_styles_default.conversationSectionActionTooltipWrap,
@@ -27606,7 +27937,7 @@ var AgentGUIConversationRailSection = memo6(
27606
27937
  }
27607
27938
  ) }),
27608
27939
  /* @__PURE__ */ jsx48(
27609
- TooltipContent7,
27940
+ TooltipContent6,
27610
27941
  {
27611
27942
  side: "top",
27612
27943
  sideOffset: 6,
@@ -27630,12 +27961,12 @@ var AgentGUIConversationRailSection = memo6(
27630
27961
  }
27631
27962
  )
27632
27963
  }
27633
- ) }) : /* @__PURE__ */ jsxs34(Tooltip7, { children: [
27634
- /* @__PURE__ */ jsx48(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx48(TooltipTrigger7, { asChild: true, children: /* @__PURE__ */ jsx48(
27964
+ ) }) : /* @__PURE__ */ jsxs34(Tooltip6, { children: [
27965
+ /* @__PURE__ */ jsx48(TooltipTrigger6, { asChild: true, children: /* @__PURE__ */ jsx48(
27635
27966
  "span",
27636
27967
  {
27637
27968
  className: AgentGUINode_styles_default.conversationSectionActionTooltipWrap,
27638
- children: /* @__PURE__ */ jsx48(
27969
+ children: /* @__PURE__ */ jsx48(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx48(
27639
27970
  BareIconButton2,
27640
27971
  {
27641
27972
  className: AgentGUINode_styles_default.conversationSectionMoreButton,
@@ -27643,11 +27974,11 @@ var AgentGUIConversationRailSection = memo6(
27643
27974
  size: "sm",
27644
27975
  children: /* @__PURE__ */ jsx48(MoreHorizontalIcon, { "aria-hidden": "true" })
27645
27976
  }
27646
- )
27977
+ ) })
27647
27978
  }
27648
- ) }) }),
27979
+ ) }),
27649
27980
  /* @__PURE__ */ jsx48(
27650
- TooltipContent7,
27981
+ TooltipContent6,
27651
27982
  {
27652
27983
  side: "right",
27653
27984
  sideOffset: 6,
@@ -27730,12 +28061,12 @@ var AgentGUIConversationRailSection = memo6(
27730
28061
  }
27731
28062
  )
27732
28063
  }
27733
- ) }) : /* @__PURE__ */ jsxs34(Tooltip7, { children: [
27734
- /* @__PURE__ */ jsx48(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx48(TooltipTrigger7, { asChild: true, children: /* @__PURE__ */ jsx48(
28064
+ ) }) : /* @__PURE__ */ jsxs34(Tooltip6, { children: [
28065
+ /* @__PURE__ */ jsx48(TooltipTrigger6, { asChild: true, children: /* @__PURE__ */ jsx48(
27735
28066
  "span",
27736
28067
  {
27737
28068
  className: AgentGUINode_styles_default.conversationSectionActionTooltipWrap,
27738
- children: /* @__PURE__ */ jsx48(
28069
+ children: /* @__PURE__ */ jsx48(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx48(
27739
28070
  BareIconButton2,
27740
28071
  {
27741
28072
  className: AgentGUINode_styles_default.conversationSectionMoreButton,
@@ -27743,11 +28074,11 @@ var AgentGUIConversationRailSection = memo6(
27743
28074
  size: "sm",
27744
28075
  children: /* @__PURE__ */ jsx48(MoreHorizontalIcon, { "aria-hidden": "true" })
27745
28076
  }
27746
- )
28077
+ ) })
27747
28078
  }
27748
- ) }) }),
28079
+ ) }),
27749
28080
  /* @__PURE__ */ jsx48(
27750
- TooltipContent7,
28081
+ TooltipContent6,
27751
28082
  {
27752
28083
  side: "right",
27753
28084
  sideOffset: 6,
@@ -27902,15 +28233,15 @@ var AgentGUIConversationRailPane = memo7(
27902
28233
  const [pendingProjectAction, setPendingProjectAction] = useState27(null);
27903
28234
  const [isRequestingBatchDeletion, setIsRequestingBatchDeletion] = useState27(false);
27904
28235
  const { railSearch } = railQuery;
27905
- const railElementRef = useRef33(null);
27906
- const conversationListRef = useRef33(null);
27907
- const conversationItemElementsRef = useRef33(
28236
+ const railElementRef = useRef34(null);
28237
+ const conversationListRef = useRef34(null);
28238
+ const conversationItemElementsRef = useRef34(
27908
28239
  /* @__PURE__ */ new Map()
27909
28240
  );
27910
- const activeConversationScrollCompletedRef = useRef33(null);
27911
- const previousActiveConversationIdRef = useRef33(null);
27912
- const railActiveConversationRef = useRef33([]);
27913
- const groupedConversationsRef = useRef33(null);
28241
+ const activeConversationScrollCompletedRef = useRef34(null);
28242
+ const previousActiveConversationIdRef = useRef34(null);
28243
+ const railActiveConversationRef = useRef34([]);
28244
+ const groupedConversationsRef = useRef34(null);
27914
28245
  const {
27915
28246
  loadMoreSectionConversations,
27916
28247
  isInteractionLocked,
@@ -27933,7 +28264,7 @@ var AgentGUIConversationRailPane = memo7(
27933
28264
  const railConversationEntities = [...railConversationEntitiesById.values()];
27934
28265
  const hasConversationQuery = conversationQuery.trim().length > 0;
27935
28266
  const backendSearchActive = hasConversationQuery && railSearch.enabled;
27936
- const railInteractionsLocked = runtimeRailSectionsPending && !backendSearchActive;
28267
+ const railInteractionsLocked = isInteractionLocked();
27937
28268
  const backendSearchConversations = backendSearchActive ? railSearch.sessionIds.flatMap((id) => {
27938
28269
  const conversation = railConversationEntitiesById.get(id);
27939
28270
  return conversation ? [conversation] : [];
@@ -27965,7 +28296,11 @@ var AgentGUIConversationRailPane = memo7(
27965
28296
  labels,
27966
28297
  sections: runtimeSectionsWithTransientConversations
27967
28298
  });
27968
- const runtimeDisplaySections = runtimeDisplayProjection.sections;
28299
+ const runtimeDisplaySections = preserveConversationRailSectionTemplates({
28300
+ labels,
28301
+ sections: runtimeDisplayProjection.sections,
28302
+ userProjects
28303
+ });
27969
28304
  const railActiveOverlay = runtimeDisplayProjection.activeOverlay;
27970
28305
  useEffect30(() => {
27971
28306
  const timer = window.setInterval(() => {
@@ -28017,8 +28352,10 @@ var AgentGUIConversationRailPane = memo7(
28017
28352
  const groupedConversationResult = useMemo32(() => {
28018
28353
  const startedAtMs = agentGuiPerfNowMs();
28019
28354
  const query = conversationQuery.trim();
28020
- const rawGroups = backendSearchActive ? groupConversations(filteredConversations, labels, userProjects, {
28021
- includeEmptyConversations: false
28355
+ const rawGroups = backendSearchActive ? projectConversationRailSearchSections({
28356
+ conversations: filteredConversations,
28357
+ labels,
28358
+ sections: runtimeDisplaySections
28022
28359
  }) : runtimeSectionsEnabled || runtimeRailSections ? runtimeDisplaySections.length > 0 ? !query ? runtimeDisplaySections : runtimeDisplaySections.map((section) => ({
28023
28360
  ...section,
28024
28361
  items: section.items.filter(
@@ -28030,8 +28367,11 @@ var AgentGUIConversationRailPane = memo7(
28030
28367
  (section) => section.items.length > 0 || section.id === railActiveOverlay?.sectionId && filteredConversations.some(
28031
28368
  (conversation) => conversation.id === railActiveOverlay.conversation.id
28032
28369
  )
28033
- ) : [] : groupConversations(filteredConversations, labels, userProjects, {
28034
- includeEmptyConversations: !query
28370
+ ) : [] : projectConversationRailSectionsByExactKey({
28371
+ conversations: filteredConversations,
28372
+ labels,
28373
+ userProjects,
28374
+ includeEmptySections: !query
28035
28375
  });
28036
28376
  const groups = stabilizeConversationSections(
28037
28377
  groupedConversationsRef.current,
@@ -28102,7 +28442,11 @@ var AgentGUIConversationRailPane = memo7(
28102
28442
  sectionAgentTargetId
28103
28443
  ]
28104
28444
  );
28105
- const isRuntimeRailLoading = runtimeSectionsEnabled && (runtimeRailSections === null || runtimeRailSectionsPending);
28445
+ const isRuntimeRailLoading = isConversationRailInitialLoadPending({
28446
+ pending: runtimeRailSectionsPending,
28447
+ runtimeSectionsEnabled,
28448
+ sections: runtimeRailMemberships
28449
+ });
28106
28450
  const isConversationRailListLoading = backendSearchActive ? railSearch.pending : isRuntimeRailLoading || isLoadingConversations && conversations.length === 0;
28107
28451
  const shouldShowConversationSkeleton = useDelayedBoolean(
28108
28452
  isConversationRailListLoading,
@@ -28198,96 +28542,89 @@ var AgentGUIConversationRailPane = memo7(
28198
28542
  children: labels.retrySearch
28199
28543
  }
28200
28544
  )
28201
- ] }) : shouldShowConversationEmptyState ? /* @__PURE__ */ jsx49("div", { className: AgentGUINode_styles_default.emptyState, children: /* @__PURE__ */ jsx49("span", { children: conversationQuery.trim() ? labels.searchNoConversations : conversations.length === 0 ? labels.noConversations : labels.conversationUnavailable }) }) : /* @__PURE__ */ jsx49(
28202
- "fieldset",
28203
- {
28204
- className: "contents",
28205
- disabled: runtimeRailSectionsPending && !backendSearchActive,
28206
- children: groupedConversations.map((section, sectionIndex) => {
28207
- const projectPath = section.kind === "project" ? section.project?.path ?? "" : "";
28208
- const projectLabel = section.kind === "project" ? section.label : "";
28209
- const isProjectSection = section.kind === "project";
28210
- const showProjectRailHeader = !conversationQuery.trim() && section.kind !== "pinned" && (sectionIndex === 0 || groupedConversations[sectionIndex - 1]?.kind === "pinned");
28211
- const isSectionCollapsed = isProjectSection && collapsedProjectSectionIds.has(section.id);
28212
- const sectionPageState = sectionPageStates.get(section.id);
28213
- const searchSectionHasMore = backendSearchActive && sectionIndex === groupedConversations.length - 1 && railSearch.hasMore;
28214
- const activeOverlayConversation = !backendSearchActive && railActiveOverlay?.sectionId === section.id && (!conversationQuery.trim() || filteredConversations.some(
28215
- (conversation) => conversation.id === railActiveOverlay.conversation.id
28216
- )) ? railActiveOverlay.conversation : null;
28217
- const activeOverlayIsCanonical = Boolean(
28218
- activeOverlayConversation && section.items.some(
28219
- (item) => item.projectionSource !== "pending_activation" && item.id === activeOverlayConversation.id
28220
- )
28221
- );
28222
- const activeOverlayCountsTowardTotal = Boolean(
28223
- activeOverlayConversation && activeOverlayConversation.projectionSource !== "pending_activation" && matchesAgentGUIConversationSummaryFilter(
28224
- activeOverlayConversation,
28225
- conversationFilter
28226
- )
28227
- );
28228
- const sectionTotalCount = backendSearchActive ? section.items.length + (searchSectionHasMore ? 1 : 0) : sectionPageState?.totalCount ?? section.items.filter(
28229
- (item) => item.projectionSource !== "pending_activation"
28230
- ).length + (activeOverlayCountsTowardTotal && !activeOverlayIsCanonical ? 1 : 0);
28231
- const sectionHasMore = searchSectionHasMore || !conversationQuery.trim() && sectionPageState?.hasMore === true;
28232
- return /* @__PURE__ */ jsxs35(Fragment13, { children: [
28233
- showProjectRailHeader ? /* @__PURE__ */ jsx49(
28234
- AgentGUIProjectRailHeader,
28235
- {
28236
- disabled: railInteractionsLocked,
28237
- labels,
28238
- selectProjectDirectory,
28239
- workspaceUserProjectI18n
28240
- }
28241
- ) : null,
28242
- /* @__PURE__ */ jsx49(
28243
- AgentGUIConversationRailSection,
28244
- {
28245
- activeConversation: activeOverlayConversation,
28246
- activeConversationCountsTowardTotal: activeOverlayCountsTowardTotal,
28247
- activeConversationId,
28248
- createConversationDisabled,
28249
- currentTimeMs,
28250
- isDeletingConversation,
28251
- isDeletingProjectConversations,
28252
- isRequestingBatchDeletion,
28253
- isConversationSearchActive: Boolean(
28254
- conversationQuery.trim()
28255
- ),
28256
- isLoadingMoreConversations: backendSearchActive ? railSearch.loadingMore : sectionPageState?.isLoading ?? false,
28257
- isRailInteractionLocked: isInteractionLocked,
28258
- isSectionCollapsed,
28259
- labels,
28260
- pendingDeleteConversationId,
28261
- paginationScopeKey: sectionPaginationScopeKey,
28262
- previewMode,
28263
- projectLabel,
28264
- projectPath,
28265
- registerItemElement: registerConversationItemElement,
28266
- section,
28267
- sectionHasMore,
28268
- sectionTotalCount,
28269
- uiLanguage,
28270
- workspaceId,
28271
- onCancelDeleteConversation,
28272
- onConfirmDeleteConversation,
28273
- onCreateConversation,
28274
- onLoadMoreConversations: backendSearchActive ? railSearch.loadMore : loadMoreSectionConversations,
28275
- onRequestDeleteConversation,
28276
- onRequestRenameConversation,
28277
- onSelectConversation,
28278
- onRequestSectionBatchDeletion: requestSectionBatchDeletion,
28279
- setPendingProjectAction,
28280
- onToggleConversationPinned,
28281
- onMarkConversationUnread,
28282
- onOpenProjectFiles,
28283
- onOpenConversationWindow,
28284
- onToggleProjectSectionCollapsed: toggleProjectSectionCollapsed
28285
- }
28286
- )
28287
- ] }, section.id);
28288
- })
28289
- }
28290
- )
28545
+ ] }) : shouldShowConversationEmptyState ? /* @__PURE__ */ jsx49("div", { className: AgentGUINode_styles_default.emptyState, children: /* @__PURE__ */ jsx49("span", { children: conversationQuery.trim() ? labels.searchNoConversations : conversations.length === 0 ? labels.noConversations : labels.conversationUnavailable }) }) : /* @__PURE__ */ jsx49("fieldset", { className: "contents", disabled: railInteractionsLocked, children: groupedConversations.map((section, sectionIndex) => {
28546
+ const projectPath = section.kind === "project" ? section.project?.path ?? "" : "";
28547
+ const projectLabel = section.kind === "project" ? section.label : "";
28548
+ const isProjectSection = section.kind === "project";
28549
+ const showProjectRailHeader = !conversationQuery.trim() && section.kind !== "pinned" && (sectionIndex === 0 || groupedConversations[sectionIndex - 1]?.kind === "pinned");
28550
+ const isSectionCollapsed = isProjectSection && collapsedProjectSectionIds.has(section.id);
28551
+ const sectionPageState = sectionPageStates.get(section.id);
28552
+ const searchSectionHasMore = backendSearchActive && sectionIndex === groupedConversations.length - 1 && railSearch.hasMore;
28553
+ const activeOverlayConversation = !backendSearchActive && railActiveOverlay?.sectionId === section.id && (!conversationQuery.trim() || filteredConversations.some(
28554
+ (conversation) => conversation.id === railActiveOverlay.conversation.id
28555
+ )) ? railActiveOverlay.conversation : null;
28556
+ const activeOverlayIsCanonical = Boolean(
28557
+ activeOverlayConversation && section.items.some(
28558
+ (item) => item.projectionSource !== "pending_activation" && item.id === activeOverlayConversation.id
28559
+ )
28560
+ );
28561
+ const activeOverlayCountsTowardTotal = Boolean(
28562
+ activeOverlayConversation && activeOverlayConversation.projectionSource !== "pending_activation" && matchesAgentGUIConversationSummaryFilter(
28563
+ activeOverlayConversation,
28564
+ conversationFilter
28565
+ )
28566
+ );
28567
+ const sectionTotalCount = backendSearchActive ? section.items.length + (searchSectionHasMore ? 1 : 0) : sectionPageState?.totalCount ?? section.items.filter(
28568
+ (item) => item.projectionSource !== "pending_activation"
28569
+ ).length + (activeOverlayCountsTowardTotal && !activeOverlayIsCanonical ? 1 : 0);
28570
+ const sectionHasMore = searchSectionHasMore || !conversationQuery.trim() && sectionPageState?.hasMore === true;
28571
+ return /* @__PURE__ */ jsxs35(Fragment13, { children: [
28572
+ showProjectRailHeader ? /* @__PURE__ */ jsx49(
28573
+ AgentGUIProjectRailHeader,
28574
+ {
28575
+ disabled: railInteractionsLocked,
28576
+ labels,
28577
+ selectProjectDirectory,
28578
+ workspaceUserProjectI18n
28579
+ }
28580
+ ) : null,
28581
+ /* @__PURE__ */ jsx49(
28582
+ AgentGUIConversationRailSection,
28583
+ {
28584
+ activeConversation: activeOverlayConversation,
28585
+ activeConversationCountsTowardTotal: activeOverlayCountsTowardTotal,
28586
+ activeConversationId,
28587
+ createConversationDisabled,
28588
+ currentTimeMs,
28589
+ isDeletingConversation,
28590
+ isDeletingProjectConversations,
28591
+ isRequestingBatchDeletion,
28592
+ isConversationSearchActive: Boolean(
28593
+ conversationQuery.trim()
28594
+ ),
28595
+ isLoadingMoreConversations: backendSearchActive ? railSearch.loadingMore : sectionPageState?.isLoading ?? false,
28596
+ isRailInteractionLocked: isInteractionLocked,
28597
+ isSectionCollapsed,
28598
+ labels,
28599
+ pendingDeleteConversationId,
28600
+ paginationScopeKey: sectionPaginationScopeKey,
28601
+ previewMode,
28602
+ projectLabel,
28603
+ projectPath,
28604
+ registerItemElement: registerConversationItemElement,
28605
+ section,
28606
+ sectionHasMore,
28607
+ sectionTotalCount,
28608
+ uiLanguage,
28609
+ workspaceId,
28610
+ onCancelDeleteConversation,
28611
+ onConfirmDeleteConversation,
28612
+ onCreateConversation,
28613
+ onLoadMoreConversations: backendSearchActive ? railSearch.loadMore : loadMoreSectionConversations,
28614
+ onRequestDeleteConversation,
28615
+ onRequestRenameConversation,
28616
+ onSelectConversation,
28617
+ onRequestSectionBatchDeletion: requestSectionBatchDeletion,
28618
+ setPendingProjectAction,
28619
+ onToggleConversationPinned,
28620
+ onMarkConversationUnread,
28621
+ onOpenProjectFiles,
28622
+ onOpenConversationWindow,
28623
+ onToggleProjectSectionCollapsed: toggleProjectSectionCollapsed
28624
+ }
28625
+ )
28626
+ ] }, section.id);
28627
+ }) })
28291
28628
  }
28292
28629
  ),
28293
28630
  footer ? /* @__PURE__ */ jsx49("div", { className: "shrink-0 pb-2", children: footer }) : null,
@@ -28346,13 +28683,73 @@ var AgentGUIConversationRailPane = memo7(
28346
28683
  import {
28347
28684
  selectWorkspaceAgentConsumerSessions as selectWorkspaceAgentConsumerSessions4
28348
28685
  } from "@tutti-os/agent-activity-core";
28349
- import { useEffect as useEffect31, useMemo as useMemo33, useRef as useRef34 } from "react";
28686
+ import { useEffect as useEffect31, useMemo as useMemo33, useRef as useRef35 } from "react";
28350
28687
 
28351
28688
  // agent-gui/agentGuiNode/controller/AgentGUIConversationRailQueryController.ts
28352
28689
  import {
28353
28690
  selectPendingActivations as selectPendingActivations3,
28354
28691
  selectWorkspaceAgentConsumerSessions as selectWorkspaceAgentConsumerSessions3
28355
28692
  } from "@tutti-os/agent-activity-core";
28693
+
28694
+ // agent-gui/agentGuiNode/controller/agentGuiConversationRailDiagnostics.ts
28695
+ var CONVERSATION_RAIL_SLOW_DIAGNOSTIC_THRESHOLD_MS = 250;
28696
+ function emitConversationRailFirstPagesDiagnostic(input) {
28697
+ if (input.status === "ready" && input.durationMs < input.diagnosticSlowThresholdMs) {
28698
+ return;
28699
+ }
28700
+ const payload = {
28701
+ agentTargetId: input.agentTargetId,
28702
+ controllerApplyMs: input.controllerApplyMs,
28703
+ durationMs: input.durationMs,
28704
+ ...input.status === "error" ? { errorKind: conversationRailErrorKind(input.error) } : {},
28705
+ event: input.status === "error" ? "agent_gui.conversation_rail.first_pages_failed" : "agent_gui.conversation_rail.first_pages_slow",
28706
+ requestId: input.requestId,
28707
+ requestMs: input.requestMs,
28708
+ refreshReason: input.refreshReason,
28709
+ returnedSessionCount: input.returnedSessionCount,
28710
+ sectionCount: input.sectionCount,
28711
+ status: input.status,
28712
+ workspaceId: input.workspaceId
28713
+ };
28714
+ try {
28715
+ input.diagnosticLogger(payload);
28716
+ } catch (error) {
28717
+ ignoreConversationRailDiagnosticFailure(error);
28718
+ }
28719
+ }
28720
+ function createConversationRailDiagnosticLogger(runtime) {
28721
+ return (payload) => {
28722
+ const reportDiagnostic = runtime.reportDiagnostic;
28723
+ if (!reportDiagnostic) return;
28724
+ try {
28725
+ void Promise.resolve(
28726
+ reportDiagnostic.call(runtime, {
28727
+ details: { ...payload },
28728
+ event: payload.event,
28729
+ level: payload.status === "error" ? "warn" : "info",
28730
+ source: "agent-gui",
28731
+ workspaceId: payload.workspaceId
28732
+ })
28733
+ ).catch(ignoreConversationRailDiagnosticFailure);
28734
+ } catch (error) {
28735
+ ignoreConversationRailDiagnosticFailure(error);
28736
+ }
28737
+ };
28738
+ }
28739
+ function ignoreConversationRailDiagnosticFailure(error) {
28740
+ void error;
28741
+ }
28742
+ function conversationRailErrorKind(error) {
28743
+ if (error instanceof Error) {
28744
+ return error.name || "Error";
28745
+ }
28746
+ if (typeof error === "string") {
28747
+ return "string";
28748
+ }
28749
+ return error === null ? "null" : typeof error;
28750
+ }
28751
+
28752
+ // agent-gui/agentGuiNode/controller/AgentGUIConversationRailQueryController.ts
28356
28753
  var SECTION_PAGE_SIZE = 5;
28357
28754
  var SEARCH_PAGE_SIZE = 100;
28358
28755
  var CONVERSATION_SEARCH_DEBOUNCE_MS = 300;
@@ -28375,12 +28772,15 @@ var EMPTY_QUERY_STATE = {
28375
28772
  };
28376
28773
  var AgentGUIConversationRailQueryController = class {
28377
28774
  getSnapshot = () => this.snapshot;
28378
- isInteractionLocked = () => this.snapshot.runtimeRailSectionsPending && !(this.searchQuery && this.snapshot.railSearch.enabled);
28775
+ isInteractionLocked = () => this.queryState.pending && this.queryState.resolvedScopeKey !== this.railSectionQueryKey && !(this.searchQuery && this.snapshot.railSearch.enabled);
28379
28776
  subscribe = (listener) => {
28380
28777
  this.listeners.add(listener);
28381
28778
  return () => this.listeners.delete(listener);
28382
28779
  };
28383
28780
  engine;
28781
+ diagnosticLogger;
28782
+ diagnosticNow;
28783
+ diagnosticSlowThresholdMs;
28384
28784
  getActiveConversationId;
28385
28785
  listeners = /* @__PURE__ */ new Set();
28386
28786
  runtime;
@@ -28404,6 +28804,9 @@ var AgentGUIConversationRailQueryController = class {
28404
28804
  previousMembershipRecords;
28405
28805
  unsubscribeEngine = null;
28406
28806
  constructor(input) {
28807
+ this.diagnosticLogger = input.diagnosticLogger ?? createConversationRailDiagnosticLogger(input.runtime);
28808
+ this.diagnosticNow = input.diagnosticNow ?? Date.now;
28809
+ this.diagnosticSlowThresholdMs = input.diagnosticSlowThresholdMs ?? CONVERSATION_RAIL_SLOW_DIAGNOSTIC_THRESHOLD_MS;
28407
28810
  this.engine = input.engine;
28408
28811
  this.getActiveConversationId = input.getActiveConversationId;
28409
28812
  this.runtime = input.runtime;
@@ -28421,7 +28824,7 @@ var AgentGUIConversationRailQueryController = class {
28421
28824
  this.unsubscribeEngine = this.engine.subscribe((state) => {
28422
28825
  this.handleEngineState(state);
28423
28826
  });
28424
- if (this.scope) this.refreshFirstPages();
28827
+ if (this.scope) this.refreshFirstPages("attach");
28425
28828
  if (this.searchQuery) this.requestSearch();
28426
28829
  return () => this.detach();
28427
28830
  }
@@ -28449,7 +28852,7 @@ var AgentGUIConversationRailQueryController = class {
28449
28852
  reconcilingSessionIds: []
28450
28853
  };
28451
28854
  this.emit();
28452
- if (this.attached) this.refreshFirstPages();
28855
+ if (this.attached) this.refreshFirstPages("scope_change");
28453
28856
  if (this.searchQuery) this.requestSearch();
28454
28857
  }
28455
28858
  setSearchQuery(value) {
@@ -28619,9 +29022,9 @@ var AgentGUIConversationRailQueryController = class {
28619
29022
  )
28620
29023
  };
28621
29024
  this.emit();
28622
- this.refreshFirstPages();
29025
+ this.refreshFirstPages("membership_change");
28623
29026
  }
28624
- refreshFirstPages() {
29027
+ refreshFirstPages(refreshReason) {
28625
29028
  const listSections = this.runtime.listSessionSections;
28626
29029
  const scopeKey = this.railSectionQueryKey;
28627
29030
  if (!this.runtimeSectionsEnabled() || !listSections || !scopeKey) {
@@ -28631,6 +29034,7 @@ var AgentGUIConversationRailQueryController = class {
28631
29034
  }
28632
29035
  this.pagingRequestSequence += 1;
28633
29036
  const requestSequence = this.pagingRequestSequence;
29037
+ const requestStartedAt = this.diagnosticNow();
28634
29038
  const wasResolvedForScope = this.queryState.resolvedScopeKey === scopeKey && this.queryState.sections !== null;
28635
29039
  this.cancelPagingRequests(false);
28636
29040
  const abortController = new AbortController();
@@ -28649,6 +29053,7 @@ var AgentGUIConversationRailQueryController = class {
28649
29053
  if (abortController.signal.aborted || requestSequence !== this.pagingRequestSequence || scopeKey !== this.railSectionQueryKey) {
28650
29054
  return;
28651
29055
  }
29056
+ const requestResolvedAt = this.diagnosticNow();
28652
29057
  const sections = projectRuntimeSectionsToConversationRailMemberships({
28653
29058
  pinned: page.pinned,
28654
29059
  sections: page.sections
@@ -28672,10 +29077,44 @@ var AgentGUIConversationRailQueryController = class {
28672
29077
  sections
28673
29078
  };
28674
29079
  this.emit();
28675
- }).catch(() => {
29080
+ const completedAt = this.diagnosticNow();
29081
+ emitConversationRailFirstPagesDiagnostic({
29082
+ agentTargetId: this.sectionAgentTargetId || null,
29083
+ controllerApplyMs: Math.max(0, completedAt - requestResolvedAt),
29084
+ diagnosticLogger: this.diagnosticLogger,
29085
+ diagnosticSlowThresholdMs: this.diagnosticSlowThresholdMs,
29086
+ durationMs: Math.max(0, completedAt - requestStartedAt),
29087
+ requestId: requestSequence,
29088
+ requestMs: Math.max(0, requestResolvedAt - requestStartedAt),
29089
+ refreshReason,
29090
+ returnedSessionCount: (page.pinned?.sessions.length ?? 0) + page.sections.reduce(
29091
+ (count, section) => count + section.sessions.length,
29092
+ 0
29093
+ ),
29094
+ sectionCount: page.sections.length + (page.pinned ? 1 : 0),
29095
+ status: "ready",
29096
+ workspaceId: this.workspaceId
29097
+ });
29098
+ }).catch((error) => {
28676
29099
  if (abortController.signal.aborted || requestSequence !== this.pagingRequestSequence || scopeKey !== this.railSectionQueryKey) {
28677
29100
  return;
28678
29101
  }
29102
+ const failedAt = this.diagnosticNow();
29103
+ emitConversationRailFirstPagesDiagnostic({
29104
+ agentTargetId: this.sectionAgentTargetId || null,
29105
+ controllerApplyMs: 0,
29106
+ diagnosticLogger: this.diagnosticLogger,
29107
+ diagnosticSlowThresholdMs: this.diagnosticSlowThresholdMs,
29108
+ durationMs: Math.max(0, failedAt - requestStartedAt),
29109
+ error,
29110
+ requestId: requestSequence,
29111
+ requestMs: Math.max(0, failedAt - requestStartedAt),
29112
+ refreshReason,
29113
+ returnedSessionCount: 0,
29114
+ sectionCount: 0,
29115
+ status: "error",
29116
+ workspaceId: this.workspaceId
29117
+ });
28679
29118
  this.queryState = wasResolvedForScope ? {
28680
29119
  ...this.queryState,
28681
29120
  pending: false,
@@ -28890,7 +29329,7 @@ function useAgentGUIConversationRailQuery({
28890
29329
  () => runtime.getSessionEngine(workspaceId),
28891
29330
  [runtime, workspaceId]
28892
29331
  );
28893
- const activeConversationIdRef = useRef34(activeConversationId);
29332
+ const activeConversationIdRef = useRef35(activeConversationId);
28894
29333
  activeConversationIdRef.current = activeConversationId;
28895
29334
  const controller = useMemo33(
28896
29335
  () => new AgentGUIConversationRailQueryController({
@@ -28923,6 +29362,12 @@ function useAgentGUIConversationRailQuery({
28923
29362
  identitySnapshot,
28924
29363
  Object.is
28925
29364
  );
29365
+ const selectRuntimeRailConversations = useMemo33(
29366
+ () => createRuntimeRailConversationsSelector(
29367
+ createAgentGUIConversationRailTitlePromptSelector()
29368
+ ),
29369
+ []
29370
+ );
28926
29371
  const runtimeRailConversations = useEngineSelector(
28927
29372
  engine,
28928
29373
  selectRuntimeRailConversations,
@@ -28943,9 +29388,10 @@ function useAgentGUIConversationRailQuery({
28943
29388
  [controller, querySnapshot, runtimeRailConversations]
28944
29389
  );
28945
29390
  }
28946
- function selectRuntimeRailConversations(state) {
28947
- return projectCanonicalAgentGUIConversationSummaries(
28948
- selectWorkspaceAgentConsumerSessions4(state)
29391
+ function createRuntimeRailConversationsSelector(selectTitlePrompts) {
29392
+ return (state) => projectCanonicalAgentGUIConversationSummaries(
29393
+ selectWorkspaceAgentConsumerSessions4(state),
29394
+ selectTitlePrompts(state)
28949
29395
  );
28950
29396
  }
28951
29397
  function conversationSummaryListsRenderEqual(left, right) {
@@ -28990,13 +29436,13 @@ import {
28990
29436
  useCallback as useCallback45,
28991
29437
  useEffect as useEffect34,
28992
29438
  useMemo as useMemo35,
28993
- useRef as useRef37,
29439
+ useRef as useRef38,
28994
29440
  useState as useState33
28995
29441
  } from "react";
28996
29442
  import { ScrollArea as ScrollArea2 } from "@tutti-os/ui-system/components";
28997
29443
 
28998
29444
  // agent-gui/agentGuiNode/view/agentGUIDetailModelHelpers.ts
28999
- import { useRef as useRef35 } from "react";
29445
+ import { useRef as useRef36 } from "react";
29000
29446
  function commandAppSource(command) {
29001
29447
  if (!command || typeof command !== "object" || !("source" in command)) {
29002
29448
  return null;
@@ -29076,7 +29522,7 @@ function slashStatusesEqual(left, right) {
29076
29522
  return (left.agentSessionId ?? null) === (right.agentSessionId ?? null) && (left.baseUrl ?? null) === (right.baseUrl ?? null) && (left.contextWindow?.usedTokens ?? null) === (right.contextWindow?.usedTokens ?? null) && (left.contextWindow?.totalTokens ?? null) === (right.contextWindow?.totalTokens ?? null) && slashStatusLimitsEqual(left.limits, right.limits) && Boolean(left.limitsLoading) === Boolean(right.limitsLoading) && Boolean(left.limitsUnavailable) === Boolean(right.limitsUnavailable);
29077
29523
  }
29078
29524
  function useStableSlashStatus(status) {
29079
- const statusRef = useRef35(null);
29525
+ const statusRef = useRef36(null);
29080
29526
  if (statusRef.current === null || !slashStatusesEqual(statusRef.current, status)) {
29081
29527
  statusRef.current = status;
29082
29528
  }
@@ -29521,7 +29967,7 @@ var AgentGUIBottomDockPane = memo9(function AgentGUIBottomDockPane2({
29521
29967
  // agent-gui/agentGuiNode/view/AgentGUIDetailHeader.tsx
29522
29968
  import { memo as memo10 } from "react";
29523
29969
  import { Info as Info2 } from "lucide-react";
29524
- import { Tooltip as Tooltip8, TooltipContent as TooltipContent8, TooltipTrigger as TooltipTrigger8 } from "@tutti-os/ui-system";
29970
+ import { Tooltip as Tooltip7, TooltipContent as TooltipContent7, TooltipTrigger as TooltipTrigger7 } from "@tutti-os/ui-system";
29525
29971
  import { jsx as jsx53, jsxs as jsxs38 } from "react/jsx-runtime";
29526
29972
  var AgentGUIDetailHeader = memo10(function AgentGUIDetailHeader2({
29527
29973
  activeConversation,
@@ -29557,10 +30003,10 @@ function AgentRunPathInfo({
29557
30003
  if (previewMode) {
29558
30004
  return trigger;
29559
30005
  }
29560
- return /* @__PURE__ */ jsxs38(Tooltip8, { children: [
29561
- /* @__PURE__ */ jsx53(TooltipTrigger8, { asChild: true, children: trigger }),
30006
+ return /* @__PURE__ */ jsxs38(Tooltip7, { children: [
30007
+ /* @__PURE__ */ jsx53(TooltipTrigger7, { asChild: true, children: trigger }),
29562
30008
  /* @__PURE__ */ jsx53(
29563
- TooltipContent8,
30009
+ TooltipContent7,
29564
30010
  {
29565
30011
  side: "top",
29566
30012
  align: "start",
@@ -29675,7 +30121,7 @@ import {
29675
30121
  useCallback as useCallback44,
29676
30122
  useEffect as useEffect33,
29677
30123
  useLayoutEffect as useLayoutEffect7,
29678
- useRef as useRef36,
30124
+ useRef as useRef37,
29679
30125
  useState as useState31
29680
30126
  } from "react";
29681
30127
  var AGENT_GUI_STICK_TO_BOTTOM_THRESHOLD_PX = 24;
@@ -29697,8 +30143,8 @@ function useAgentGUIDetailScroll(input) {
29697
30143
  } = input;
29698
30144
  const [isTimelineScrolledToTop, setIsTimelineScrolledToTop] = useState31(true);
29699
30145
  const [isTimelineScrolledToBottom, setIsTimelineScrolledToBottom] = useState31(true);
29700
- const bottomLockOwnerRef = useRef36(null);
29701
- const userScrollAwayIntentConversationRef = useRef36(null);
30146
+ const bottomLockOwnerRef = useRef37(null);
30147
+ const userScrollAwayIntentConversationRef = useRef37(null);
29702
30148
  useLayoutEffect7(() => {
29703
30149
  const timeline = timelineRef.current;
29704
30150
  if (!timeline) {
@@ -30671,11 +31117,11 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
30671
31117
  renderProviderUnavailableState
30672
31118
  }) {
30673
31119
  "use memo";
30674
- const timelineRef = useRef37(null);
30675
- const bottomDockRef = useRef37(null);
30676
- const timelineScrollAnchorRef = useRef37(null);
30677
- const submittedPromptScrollConversationRef = useRef37(null);
30678
- const pendingPrependScrollAnchorRef = useRef37(null);
31120
+ const timelineRef = useRef38(null);
31121
+ const bottomDockRef = useRef38(null);
31122
+ const timelineScrollAnchorRef = useRef38(null);
31123
+ const submittedPromptScrollConversationRef = useRef38(null);
31124
+ const pendingPrependScrollAnchorRef = useRef38(null);
30679
31125
  const [
30680
31126
  bottomDockDismissedPromptRequestId,
30681
31127
  setBottomDockDismissedPromptRequestId
@@ -31170,7 +31616,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
31170
31616
  });
31171
31617
 
31172
31618
  // agent-gui/agentGuiNode/view/AgentGUIRenameConversationDialog.tsx
31173
- import { memo as memo13, useCallback as useCallback46, useEffect as useEffect35, useRef as useRef38, useState as useState34 } from "react";
31619
+ import { memo as memo13, useCallback as useCallback46, useEffect as useEffect35, useRef as useRef39, useState as useState34 } from "react";
31174
31620
  import { ConfirmationDialog as ConfirmationDialog2 } from "@tutti-os/ui-system";
31175
31621
  import { jsx as jsx59, jsxs as jsxs43 } from "react/jsx-runtime";
31176
31622
  var AgentGUIRenameConversationDialog = memo13(
@@ -31184,9 +31630,9 @@ var AgentGUIRenameConversationDialog = memo13(
31184
31630
  "use memo";
31185
31631
  const [title, setTitle] = useState34("");
31186
31632
  const [isSaving, setIsSaving] = useState34(false);
31187
- const isSavingRef = useRef38(false);
31188
- const armedPointerActionRef = useRef38(null);
31189
- const inputRef = useRef38(null);
31633
+ const isSavingRef = useRef39(false);
31634
+ const armedPointerActionRef = useRef39(null);
31635
+ const inputRef = useRef39(null);
31190
31636
  const trimmedTitle = title.trim();
31191
31637
  useEffect35(() => {
31192
31638
  if (!open || !conversation) {
@@ -31414,7 +31860,7 @@ function AgentGUIReferencePickerSurface({
31414
31860
  }
31415
31861
 
31416
31862
  // agent-gui/agentGuiNode/view/useAgentGUIWorkspaceReferencePicker.ts
31417
- import { useCallback as useCallback47, useMemo as useMemo36, useRef as useRef39, useState as useState35 } from "react";
31863
+ import { useCallback as useCallback47, useMemo as useMemo36, useRef as useRef40, useState as useState35 } from "react";
31418
31864
  import { createRichTextMentionHref } from "@tutti-os/ui-rich-text/core";
31419
31865
  function useAgentGUIWorkspaceReferencePicker(input) {
31420
31866
  const {
@@ -31429,7 +31875,7 @@ function useAgentGUIWorkspaceReferencePicker(input) {
31429
31875
  } = input;
31430
31876
  const [workspaceReferencePickerOpen, setWorkspaceReferencePickerOpen] = useState35(false);
31431
31877
  const [workspaceReferencePickerTarget, setWorkspaceReferencePickerTarget] = useState35(null);
31432
- const workspaceReferencePickerResolverRef = useRef39(null);
31878
+ const workspaceReferencePickerResolverRef = useRef40(null);
31433
31879
  const emptyReferencePickResult = useMemo36(
31434
31880
  () => ({ files: [], mentionItems: [] }),
31435
31881
  []
@@ -31544,7 +31990,7 @@ function useAgentGUIWorkspaceReferencePicker(input) {
31544
31990
  }
31545
31991
 
31546
31992
  // agent-gui/agentGuiNode/engagement/useAgentGUINodeEngagement.ts
31547
- import { useRef as useRef41 } from "react";
31993
+ import { useRef as useRef42 } from "react";
31548
31994
 
31549
31995
  // agent-gui/agentGuiNode/engagement/projectAgentGUIEngagementContext.ts
31550
31996
  function projectAgentGUIEngagementContext(viewModel, composerReady) {
@@ -31576,7 +32022,7 @@ function createAgentGUIEngagementContextKey(input) {
31576
32022
  }
31577
32023
 
31578
32024
  // agent-gui/agentGuiNode/engagement/useAgentGUIPanelEngagement.ts
31579
- import { useEffect as useEffect36, useRef as useRef40 } from "react";
32025
+ import { useEffect as useEffect36, useRef as useRef41 } from "react";
31580
32026
 
31581
32027
  // agent-gui/agentGuiNode/engagement/AgentGUIPanelEngagementController.ts
31582
32028
  var AGENT_GUI_PANEL_EXPOSURE_DWELL_MS = 1e3;
@@ -31730,10 +32176,10 @@ function documentIsVisible() {
31730
32176
 
31731
32177
  // agent-gui/agentGuiNode/engagement/useAgentGUIPanelEngagement.ts
31732
32178
  function useAgentGUIPanelEngagement(input) {
31733
- const inputRef = useRef40(input);
31734
- const controllerRef = useRef40(null);
31735
- const intersectionRatioRef = useRef40(0);
31736
- const engagementRef = useRef40(null);
32179
+ const inputRef = useRef41(input);
32180
+ const controllerRef = useRef41(null);
32181
+ const intersectionRatioRef = useRef41(0);
32182
+ const engagementRef = useRef41(null);
31737
32183
  inputRef.current = input;
31738
32184
  if (!engagementRef.current) {
31739
32185
  engagementRef.current = {
@@ -31773,7 +32219,7 @@ function useAgentGUIPanelEngagement(input) {
31773
32219
 
31774
32220
  // agent-gui/agentGuiNode/engagement/useAgentGUINodeEngagement.ts
31775
32221
  function useAgentGUINodeEngagement(input) {
31776
- const layoutElementRef = useRef41(null);
32222
+ const layoutElementRef = useRef42(null);
31777
32223
  const projected = projectAgentGUIEngagementContext(
31778
32224
  input.viewModel,
31779
32225
  input.composerReady
@@ -31862,7 +32308,7 @@ function AgentGUINodeView({
31862
32308
  viewModel
31863
32309
  });
31864
32310
  const [providerManagerOpen, setProviderManagerOpen] = useState36(false);
31865
- const railResizeInteractionRef = useRef42(null);
32311
+ const railResizeInteractionRef = useRef43(null);
31866
32312
  const [isRailResizing, setIsRailResizing] = useState36(false);
31867
32313
  const [railResizeWidthPx, setRailResizeWidthPx] = useState36(
31868
32314
  null
@@ -31871,7 +32317,7 @@ function AgentGUINodeView({
31871
32317
  localComposerFocusRequestSequence,
31872
32318
  setLocalComposerFocusRequestSequence
31873
32319
  ] = useState36(0);
31874
- const handledNewConversationRequestSequenceRef = useRef42(
32320
+ const handledNewConversationRequestSequenceRef = useRef43(
31875
32321
  newConversationRequestSequence
31876
32322
  );
31877
32323
  const {
@@ -32438,7 +32884,7 @@ function AgentGUINodeView({
32438
32884
  }
32439
32885
  )
32440
32886
  ] });
32441
- return previewMode ? content : /* @__PURE__ */ jsx61(TooltipProvider5, { children: content });
32887
+ return previewMode ? content : /* @__PURE__ */ jsx61(TooltipProvider4, { children: content });
32442
32888
  }
32443
32889
 
32444
32890
  // agent-gui/workspaceDesktop/view/desktopDockAgentProbeTooltipModel.ts
@@ -32615,7 +33061,7 @@ import {
32615
33061
  useCallback as useCallback49,
32616
33062
  useEffect as useEffect38,
32617
33063
  useLayoutEffect as useLayoutEffect9,
32618
- useRef as useRef43,
33064
+ useRef as useRef44,
32619
33065
  useState as useState37
32620
33066
  } from "react";
32621
33067
  import { createPortal as createPortal5 } from "react-dom";
@@ -32653,8 +33099,8 @@ function AgentProbeInfoPopover({
32653
33099
  onOpen
32654
33100
  }) {
32655
33101
  "use memo";
32656
- const anchorRef = useRef43(null);
32657
- const popoverRef = useRef43(null);
33102
+ const anchorRef = useRef44(null);
33103
+ const popoverRef = useRef44(null);
32658
33104
  const [isOpen, setIsOpen] = useState37(false);
32659
33105
  const [popoverStyle, setPopoverStyle] = useState37(null);
32660
33106
  const openPopover = useCallback49(() => {
@@ -34267,7 +34713,7 @@ var AgentGUI = memo15(function AgentGUI2({
34267
34713
  children: /* @__PURE__ */ jsx64(AgentGUINode, { ...nodeProps })
34268
34714
  }
34269
34715
  ) });
34270
- return props.frame.previewMode ? content : /* @__PURE__ */ jsx64(TooltipProvider6, { delayDuration: 120, skipDelayDuration: 0, children: content });
34716
+ return props.frame.previewMode ? content : /* @__PURE__ */ jsx64(TooltipProvider5, { delayDuration: 120, skipDelayDuration: 0, children: content });
34271
34717
  });
34272
34718
 
34273
34719
  export {
@@ -34280,4 +34726,4 @@ export {
34280
34726
  resolveAgentGUIAgentTarget,
34281
34727
  AgentGUI
34282
34728
  };
34283
- //# sourceMappingURL=chunk-7N524ZK7.js.map
34729
+ //# sourceMappingURL=chunk-4HSLSSPJ.js.map