@tutti-os/agent-gui 0.0.95 → 0.0.96

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 (110) hide show
  1. package/README.md +38 -6
  2. package/dist/{AgentGUI-CwBLYtv-.d.ts → AgentGUI-DWdvUV4x.d.ts} +64 -18
  3. package/dist/agent-conversation/index.d.ts +3 -2
  4. package/dist/agent-conversation/index.js +10 -9
  5. package/dist/agent-conversation/index.js.map +1 -1
  6. package/dist/agent-env/index.js +1 -1
  7. package/dist/agent-gui.d.ts +5 -5
  8. package/dist/agent-gui.js +26 -26
  9. package/dist/agent-message-center/index.d.ts +14 -3
  10. package/dist/agent-message-center/index.js +182 -47
  11. package/dist/agent-message-center/index.js.map +1 -1
  12. package/dist/{agentFileMentionContracts-Czvz6YMI.d.ts → agentFileMentionContracts-58IjMU-u.d.ts} +1 -0
  13. package/dist/{agentGuiNodeTypes-DppADPHW.d.ts → agentGuiNodeTypes-B9X4aWfv.d.ts} +30 -18
  14. package/dist/agents.d.ts +1 -1
  15. package/dist/agents.js +1 -1
  16. package/dist/app/renderer/agentactivity.css +150 -3
  17. package/dist/{chunk-C5FV4UGI.js → chunk-2HJEOO7W.js} +14 -6
  18. package/dist/chunk-2HJEOO7W.js.map +1 -0
  19. package/dist/{chunk-BFNJKTDV.js → chunk-3XXBDYAI.js} +11 -16
  20. package/dist/chunk-3XXBDYAI.js.map +1 -0
  21. package/dist/{chunk-YE25HN6T.js → chunk-3Y3F7CS5.js} +17 -25
  22. package/dist/chunk-3Y3F7CS5.js.map +1 -0
  23. package/dist/{chunk-CRO2MV2Y.js → chunk-4PQPJ5OY.js} +21 -116
  24. package/dist/chunk-4PQPJ5OY.js.map +1 -0
  25. package/dist/{chunk-R2EWECUP.js → chunk-7BXWPI4F.js} +17 -2
  26. package/dist/{chunk-R2EWECUP.js.map → chunk-7BXWPI4F.js.map} +1 -1
  27. package/dist/{chunk-LQVXBT65.js → chunk-AGT7MUTV.js} +9 -9
  28. package/dist/{chunk-LQVXBT65.js.map → chunk-AGT7MUTV.js.map} +1 -1
  29. package/dist/{chunk-O6W72SEP.js → chunk-C35SNDVZ.js} +4 -1
  30. package/dist/chunk-C35SNDVZ.js.map +1 -0
  31. package/dist/{chunk-BIHBXWK5.js → chunk-E4HQUTM3.js} +2 -2
  32. package/dist/{chunk-NX3CZJXW.js → chunk-H5F3QSCF.js} +2 -2
  33. package/dist/{chunk-WEDMAVX2.js → chunk-IYEXLOUE.js} +3 -6
  34. package/dist/chunk-IYEXLOUE.js.map +1 -0
  35. package/dist/{chunk-3R2D4E57.js → chunk-JKIZA7EJ.js} +933 -844
  36. package/dist/chunk-JKIZA7EJ.js.map +1 -0
  37. package/dist/{chunk-UQJPV6HP.js → chunk-L3GMMGRS.js} +8 -6
  38. package/dist/chunk-L3GMMGRS.js.map +1 -0
  39. package/dist/{chunk-KAL4XZMA.js → chunk-MASXZENX.js} +1 -1
  40. package/dist/chunk-MASXZENX.js.map +1 -0
  41. package/dist/{chunk-7PFDA2HQ.js → chunk-O3Q5SIJH.js} +3 -3
  42. package/dist/{chunk-NITOD7WF.js → chunk-QVBF5BN5.js} +2 -2
  43. package/dist/{chunk-7RDD3EWP.js → chunk-RE4AXS27.js} +24 -15
  44. package/dist/chunk-RE4AXS27.js.map +1 -0
  45. package/dist/{chunk-NJAZ7LQM.js → chunk-TVIGLNNI.js} +3 -3
  46. package/dist/{chunk-VF22EG3F.js → chunk-UHBCM6RO.js} +1 -1
  47. package/dist/chunk-UHBCM6RO.js.map +1 -0
  48. package/dist/{chunk-AOS2VWU6.js → chunk-W6WAGPMD.js} +33 -3
  49. package/dist/chunk-W6WAGPMD.js.map +1 -0
  50. package/dist/{chunk-RY6GIO3K.js → chunk-WKSFPJHZ.js} +5010 -3656
  51. package/dist/chunk-WKSFPJHZ.js.map +1 -0
  52. package/dist/{chunk-JX2SIXNL.js → chunk-WMNS4MAQ.js} +8 -7
  53. package/dist/{chunk-JX2SIXNL.js.map → chunk-WMNS4MAQ.js.map} +1 -1
  54. package/dist/{chunk-XMO45GKA.js → chunk-XPFHJMZP.js} +14 -4
  55. package/dist/chunk-XPFHJMZP.js.map +1 -0
  56. package/dist/chunk-YMXYBG7U.js +12 -0
  57. package/dist/chunk-YMXYBG7U.js.map +1 -0
  58. package/dist/context-mention-palette/index.d.ts +1 -1
  59. package/dist/context-mention-palette/index.js +14 -14
  60. package/dist/custom-mention.d.ts +2 -4
  61. package/dist/dock-icons.d.ts +2 -4
  62. package/dist/i18n/index.d.ts +30 -0
  63. package/dist/i18n/index.js +2 -2
  64. package/dist/index.d.ts +14 -12
  65. package/dist/index.js +34 -30
  66. package/dist/index.js.map +1 -1
  67. package/dist/mention-search.d.ts +1 -1
  68. package/dist/mention-search.js +11 -11
  69. package/dist/pastedTextKinds-D-XuInaS.d.ts +4 -0
  70. package/dist/startup-shell.d.ts +8 -0
  71. package/dist/startup-shell.js +184 -0
  72. package/dist/startup-shell.js.map +1 -0
  73. package/dist/{types-DX2bxgB8.d.ts → types-CnT8rNUI.d.ts} +16 -5
  74. package/dist/workbench/contribution.d.ts +3 -2
  75. package/dist/workbench/contribution.js +6 -6
  76. package/dist/workbench/index.d.ts +4 -4
  77. package/dist/workbench/index.js +14 -16
  78. package/dist/workbench/launch.d.ts +2 -2
  79. package/dist/workbench/launch.js +3 -3
  80. package/dist/workbench/providerCatalog.d.ts +2 -2
  81. package/dist/workbench/providerCatalog.js +1 -1
  82. package/dist/workbench/sessionTitle.d.ts +8 -12
  83. package/dist/workbench/sessionTitle.js +5 -7
  84. package/dist/workbench/state.js +2 -2
  85. package/dist/workbench/types.d.ts +2 -1
  86. package/dist/workbench/types.js +1 -1
  87. package/dist/workspace-agent-generated-files.js +6 -6
  88. package/package.json +19 -12
  89. package/dist/chunk-3R2D4E57.js.map +0 -1
  90. package/dist/chunk-7J4K6WKB.js +0 -66
  91. package/dist/chunk-7J4K6WKB.js.map +0 -1
  92. package/dist/chunk-7RDD3EWP.js.map +0 -1
  93. package/dist/chunk-AOS2VWU6.js.map +0 -1
  94. package/dist/chunk-BFNJKTDV.js.map +0 -1
  95. package/dist/chunk-C5FV4UGI.js.map +0 -1
  96. package/dist/chunk-CRO2MV2Y.js.map +0 -1
  97. package/dist/chunk-KAL4XZMA.js.map +0 -1
  98. package/dist/chunk-O6W72SEP.js.map +0 -1
  99. package/dist/chunk-RY6GIO3K.js.map +0 -1
  100. package/dist/chunk-UQJPV6HP.js.map +0 -1
  101. package/dist/chunk-VF22EG3F.js.map +0 -1
  102. package/dist/chunk-WEDMAVX2.js.map +0 -1
  103. package/dist/chunk-XMO45GKA.js.map +0 -1
  104. package/dist/chunk-YE25HN6T.js.map +0 -1
  105. package/dist/uiSettings-BQS9r2eo.d.ts +0 -6
  106. /package/dist/{chunk-BIHBXWK5.js.map → chunk-E4HQUTM3.js.map} +0 -0
  107. /package/dist/{chunk-NX3CZJXW.js.map → chunk-H5F3QSCF.js.map} +0 -0
  108. /package/dist/{chunk-7PFDA2HQ.js.map → chunk-O3Q5SIJH.js.map} +0 -0
  109. /package/dist/{chunk-NITOD7WF.js.map → chunk-QVBF5BN5.js.map} +0 -0
  110. /package/dist/{chunk-NJAZ7LQM.js.map → chunk-TVIGLNNI.js.map} +0 -0
@@ -1,6 +1,3 @@
1
- import {
2
- formatAgentGuiConversationPlainTitle
3
- } from "../chunk-YE25HN6T.js";
4
1
  import {
5
2
  AgentInteractivePromptSurface,
6
3
  PLAN_IMPLEMENTATION_ACTION_IMPLEMENT,
@@ -10,18 +7,7 @@ import {
10
7
  getPromptToolDetails,
11
8
  isPromptRequestIdTitle,
12
9
  useEngineSelector
13
- } from "../chunk-XMO45GKA.js";
14
- import {
15
- formatAgentSessionMentionText
16
- } from "../chunk-CRO2MV2Y.js";
17
- import {
18
- userAvatarPlaceholderUrl,
19
- workspaceAgentActivityStatusLabel
20
- } from "../chunk-NITOD7WF.js";
21
- import {
22
- resolveWorkspaceAgentSessionSortTimeUnixMs
23
- } from "../chunk-7J4K6WKB.js";
24
- import "../chunk-GCBDIQDX.js";
10
+ } from "../chunk-XPFHJMZP.js";
25
11
  import {
26
12
  AgentMessageMarkdown,
27
13
  CustomScrollArea,
@@ -31,21 +17,31 @@ import {
31
17
  extractExitPlanModeOptions,
32
18
  isExitPlanSwitchModeInput,
33
19
  normalizeAskUserQuestions
34
- } from "../chunk-C5FV4UGI.js";
20
+ } from "../chunk-2HJEOO7W.js";
21
+ import {
22
+ userAvatarPlaceholderUrl,
23
+ workspaceAgentActivityStatusLabel
24
+ } from "../chunk-QVBF5BN5.js";
25
+ import {
26
+ resolveWorkspaceAgentSessionSortTimeUnixMs
27
+ } from "../chunk-YMXYBG7U.js";
35
28
  import {
36
29
  managedAgentRoundedIconUrl
37
- } from "../chunk-KAL4XZMA.js";
38
- import "../chunk-H6IQ63DQ.js";
30
+ } from "../chunk-MASXZENX.js";
39
31
  import {
40
32
  workspaceAgentProviderLabel
41
- } from "../chunk-NX3CZJXW.js";
33
+ } from "../chunk-H5F3QSCF.js";
34
+ import "../chunk-PJP5BUU6.js";
35
+ import "../chunk-H6IQ63DQ.js";
36
+ import {
37
+ normalizeAgentTitleText
38
+ } from "../chunk-GCBDIQDX.js";
42
39
  import {
43
40
  AgentGuiI18nProvider,
44
41
  getActiveUiLanguage,
45
42
  useTranslation
46
- } from "../chunk-BIHBXWK5.js";
47
- import "../chunk-AOS2VWU6.js";
48
- import "../chunk-PJP5BUU6.js";
43
+ } from "../chunk-E4HQUTM3.js";
44
+ import "../chunk-W6WAGPMD.js";
49
45
  import "../chunk-5X7YDOC6.js";
50
46
  import "../chunk-KJQERFKX.js";
51
47
  import "../chunk-UGVI47X6.js";
@@ -532,6 +528,7 @@ function compareItems(left, right) {
532
528
  // agent-message-center/workspaceAgentMessageCenterModel.ts
533
529
  function buildWorkspaceAgentMessageCenterItem({
534
530
  session,
531
+ latestTurn,
535
532
  messages,
536
533
  status,
537
534
  needsAttention,
@@ -556,10 +553,16 @@ function buildWorkspaceAgentMessageCenterItem({
556
553
  pendingPrompt,
557
554
  status
558
555
  });
556
+ const agentPresentation = resolveMessageCenterAgentPresentation(
557
+ session.agentTargetId,
558
+ options.agentPresentations
559
+ );
559
560
  return {
560
561
  id: `message-center-${session.agentSessionId}`,
561
562
  agentSessionId: session.agentSessionId,
562
563
  agentTargetId: session.agentTargetId?.trim() || null,
564
+ agentName: agentPresentation?.name ?? null,
565
+ agentAvatarUrl: agentPresentation?.iconUrl ?? null,
563
566
  provider: session.provider,
564
567
  userId: session.userId?.trim() || null,
565
568
  title,
@@ -577,11 +580,29 @@ function buildWorkspaceAgentMessageCenterItem({
577
580
  needsAttentionKind: needsAttention?.kind ?? null,
578
581
  needsAttentionSummary: needsAttention?.summary ?? null,
579
582
  latestTurnOutcome,
580
- sortTimeUnixMs: resolveWorkspaceAgentSessionSortTimeUnixMs(session, {
581
- messages
583
+ sortTimeUnixMs: resolveWorkspaceAgentSessionSortTimeUnixMs({
584
+ ...session,
585
+ latestTurn
582
586
  })
583
587
  };
584
588
  }
589
+ function resolveMessageCenterAgentPresentation(agentTargetId, presentations) {
590
+ const targetId = agentTargetId?.trim() ?? "";
591
+ if (!targetId) {
592
+ return null;
593
+ }
594
+ const presentation = presentations?.find(
595
+ (candidate) => candidate.agentTargetId.trim() === targetId
596
+ );
597
+ const name = presentation?.name.trim() ?? "";
598
+ if (!presentation || !name) {
599
+ return null;
600
+ }
601
+ return {
602
+ iconUrl: presentation.iconUrl?.trim() || null,
603
+ name
604
+ };
605
+ }
585
606
  function resolveMessageCenterIdentity(agentSessionId, identityBySessionId) {
586
607
  const identity = identityBySessionId?.[agentSessionId];
587
608
  if (!identity) {
@@ -605,14 +626,14 @@ function isImportedMessageCenterSession(session) {
605
626
  return "imported" in session && session.imported === true;
606
627
  }
607
628
  function resolveSessionTitle(session, latestUserMessageSummary, firstUserMessageSummary) {
608
- const latest = latestUserMessageSummary.trim();
609
- if (latest) {
610
- return latest;
611
- }
612
629
  const title = session.title.trim();
613
630
  if (title) {
614
631
  return title;
615
632
  }
633
+ const latest = latestUserMessageSummary.trim();
634
+ if (latest) {
635
+ return latest;
636
+ }
616
637
  return firstUserMessageSummary || session.provider || session.agentSessionId;
617
638
  }
618
639
  function resolveDigestFallbackTitle(session) {
@@ -958,6 +979,8 @@ function MessageCenterOpenChatButton({
958
979
  /* @__PURE__ */ jsx2(
959
980
  MessageCenterIdentityLabel,
960
981
  {
982
+ agentAvatarUrl: item.agentAvatarUrl,
983
+ agentName: item.agentName,
961
984
  identity: item.identity,
962
985
  provider
963
986
  }
@@ -995,14 +1018,23 @@ function MessageCenterOpenChatButton({
995
1018
  ] });
996
1019
  }
997
1020
  function MessageCenterIdentityLabel({
1021
+ agentAvatarUrl,
1022
+ agentName,
998
1023
  identity,
999
1024
  provider
1000
1025
  }) {
1001
1026
  "use memo";
1002
1027
  if (!identity) {
1003
- return /* @__PURE__ */ jsx2(AgentProviderLabel, { provider });
1028
+ return /* @__PURE__ */ jsx2(
1029
+ AgentProviderLabel,
1030
+ {
1031
+ agentAvatarUrl,
1032
+ agentName,
1033
+ provider
1034
+ }
1035
+ );
1004
1036
  }
1005
- const agentAvatarUrl = identity.agentAvatarUrl?.trim() || managedAgentRoundedIconUrl(provider);
1037
+ const resolvedAgentAvatarUrl = identity.agentAvatarUrl?.trim() || agentAvatarUrl?.trim() || managedAgentRoundedIconUrl(provider);
1006
1038
  const title = `${identity.userName} & ${identity.agentName}`;
1007
1039
  return /* @__PURE__ */ jsxs(
1008
1040
  "span",
@@ -1015,7 +1047,7 @@ function MessageCenterIdentityLabel({
1015
1047
  {
1016
1048
  userAvatarUrl: identity.userAvatarUrl,
1017
1049
  userName: identity.userName,
1018
- agentAvatarUrl
1050
+ agentAvatarUrl: resolvedAgentAvatarUrl
1019
1051
  }
1020
1052
  ),
1021
1053
  /* @__PURE__ */ jsxs("span", { className: "workspace-agent-message-center__identity-names flex min-w-0 items-center gap-1 truncate text-[13px] leading-5 text-[var(--text-secondary)]", children: [
@@ -1028,6 +1060,7 @@ function MessageCenterIdentityLabel({
1028
1060
  );
1029
1061
  }
1030
1062
  function MessageCenterIdentityAvatarMark({
1063
+ agentAvatarUrl,
1031
1064
  identity,
1032
1065
  provider,
1033
1066
  userId
@@ -1038,7 +1071,7 @@ function MessageCenterIdentityAvatarMark({
1038
1071
  return /* @__PURE__ */ jsx2(
1039
1072
  "img",
1040
1073
  {
1041
- src: managedAgentRoundedIconUrl(provider),
1074
+ src: agentAvatarUrl?.trim() || managedAgentRoundedIconUrl(provider),
1042
1075
  alt: "",
1043
1076
  className: "size-5 shrink-0 rounded-full",
1044
1077
  decoding: "async",
@@ -1053,7 +1086,7 @@ function MessageCenterIdentityAvatarMark({
1053
1086
  {
1054
1087
  userAvatarUrl: identity?.userAvatarUrl,
1055
1088
  userName,
1056
- agentAvatarUrl: identity?.agentAvatarUrl?.trim() || managedAgentRoundedIconUrl(provider)
1089
+ agentAvatarUrl: identity?.agentAvatarUrl?.trim() || agentAvatarUrl?.trim() || managedAgentRoundedIconUrl(provider)
1057
1090
  }
1058
1091
  );
1059
1092
  }
@@ -1169,14 +1202,18 @@ function LazyMessageCenterTooltip({
1169
1202
  /* @__PURE__ */ jsx2(TooltipContent, { side, align, className, children: content })
1170
1203
  ] });
1171
1204
  }
1172
- function AgentProviderLabel({ provider }) {
1205
+ function AgentProviderLabel({
1206
+ agentAvatarUrl,
1207
+ agentName,
1208
+ provider
1209
+ }) {
1173
1210
  "use memo";
1174
- const label = workspaceAgentProviderLabel(provider);
1211
+ const label = agentName?.trim() || workspaceAgentProviderLabel(provider);
1175
1212
  return /* @__PURE__ */ jsxs("span", { className: "workspace-agent-message-center__provider inline-flex min-w-0 max-w-full items-center gap-1.5", children: [
1176
1213
  /* @__PURE__ */ jsx2(
1177
1214
  "img",
1178
1215
  {
1179
- src: managedAgentRoundedIconUrl(provider),
1216
+ src: agentAvatarUrl?.trim() || managedAgentRoundedIconUrl(provider),
1180
1217
  alt: "",
1181
1218
  className: "workspace-agent-message-center__provider-icon size-5 shrink-0 rounded-full",
1182
1219
  decoding: "async",
@@ -1232,10 +1269,99 @@ function messageCenterStatusToneClass(tone) {
1232
1269
 
1233
1270
  // agent-message-center/workspaceAgentMessageCenterPreview.tsx
1234
1271
  import { AppWindow } from "lucide-react";
1272
+ import {
1273
+ isRichTextMentionHref as isRichTextMentionHref2,
1274
+ parseRichTextMentionHref as parseRichTextMentionHref2
1275
+ } from "@tutti-os/ui-rich-text/core";
1276
+
1277
+ // shared/utils/agentSessionMentionText.ts
1235
1278
  import {
1236
1279
  isRichTextMentionHref,
1237
1280
  parseRichTextMentionHref
1238
1281
  } from "@tutti-os/ui-rich-text/core";
1282
+ var MARKDOWN_LINK_PATTERN = /\[((?:\\.|[^\]\\])*)\]\(([^)\s]+)\)/g;
1283
+ var MARKDOWN_LABEL_ESCAPE_PATTERN = /\\([\\[\]()])/g;
1284
+ var SESSION_MENTION_DISPLAY_PREFIX_BY_LANGUAGE = {
1285
+ "zh-CN": "@\u4F1A\u8BDD \xB7 ",
1286
+ en: "@session \xB7 "
1287
+ };
1288
+ var PLAIN_SESSION_AGENT_LABELS = [
1289
+ "Claude Code",
1290
+ "Hermes Agent",
1291
+ "OpenClaw",
1292
+ "Nexight",
1293
+ "Hermes",
1294
+ "Codex"
1295
+ ];
1296
+ function formatAgentSessionMentionText(value, options = {}) {
1297
+ const trimmed = value?.trim() ?? "";
1298
+ if (!trimmed) {
1299
+ return "";
1300
+ }
1301
+ const sessionMentionDisplayPrefix = sessionMentionDisplayPrefixForLanguage(
1302
+ options.language
1303
+ );
1304
+ const withSessionMentionsNormalized = trimmed.replace(
1305
+ MARKDOWN_LINK_PATTERN,
1306
+ (fullMatch, rawLabel, href) => {
1307
+ const label = unescapeMarkdownLabel(rawLabel);
1308
+ const mention = parseRichTextMentionHref(href, label);
1309
+ if (!mention) {
1310
+ return isRichTextMentionHref(href) ? label : fullMatch;
1311
+ }
1312
+ const providerId = mention.providerId.trim().toLowerCase();
1313
+ const displayLabel = label || mention.label;
1314
+ if (providerId === "agent-session") {
1315
+ return formatSessionLabel(displayLabel, sessionMentionDisplayPrefix);
1316
+ }
1317
+ if (providerId === "workspace-issue") {
1318
+ return formatIssueLabel(displayLabel);
1319
+ }
1320
+ return displayLabel;
1321
+ }
1322
+ );
1323
+ const normalized = normalizeAgentTitleText(withSessionMentionsNormalized);
1324
+ if (isPlainSessionMentionText(normalized, sessionMentionDisplayPrefix)) {
1325
+ return formatSessionLabel(normalized, sessionMentionDisplayPrefix);
1326
+ }
1327
+ return normalized;
1328
+ }
1329
+ function isPlainSessionMentionText(value, sessionMentionDisplayPrefix) {
1330
+ const trimmed = value.trim();
1331
+ if (!trimmed.startsWith("@") || trimmed.startsWith(sessionMentionDisplayPrefix)) {
1332
+ return false;
1333
+ }
1334
+ return PLAIN_SESSION_AGENT_LABELS.some((agentLabel) => {
1335
+ const ampersandSeparator = ` & ${agentLabel}`;
1336
+ const ampersandIndex = trimmed.indexOf(ampersandSeparator);
1337
+ if (ampersandIndex > 1) {
1338
+ const trailing = trimmed.slice(
1339
+ ampersandIndex + ampersandSeparator.length
1340
+ );
1341
+ if (trailing === "" || trailing.startsWith(" ")) {
1342
+ return true;
1343
+ }
1344
+ }
1345
+ const dottedSeparator = ` \xB7 ${agentLabel} \xB7 `;
1346
+ return trimmed.indexOf(dottedSeparator) > 1;
1347
+ });
1348
+ }
1349
+ function sessionMentionDisplayPrefixForLanguage(language) {
1350
+ return SESSION_MENTION_DISPLAY_PREFIX_BY_LANGUAGE[language ?? "en"];
1351
+ }
1352
+ function formatSessionLabel(label, sessionMentionDisplayPrefix) {
1353
+ const normalizedLabel = label.trim().replace(/^@+/, "").trim();
1354
+ return normalizedLabel ? `${sessionMentionDisplayPrefix}${normalizedLabel}` : label.trim();
1355
+ }
1356
+ function formatIssueLabel(label) {
1357
+ const normalizedLabel = label.trim().replace(/^@+/, "").trim();
1358
+ return normalizedLabel ? `@Task \xB7 ${normalizedLabel}` : label.trim();
1359
+ }
1360
+ function unescapeMarkdownLabel(label) {
1361
+ return label.replace(MARKDOWN_LABEL_ESCAPE_PATTERN, "$1");
1362
+ }
1363
+
1364
+ // agent-message-center/workspaceAgentMessageCenterPreview.tsx
1239
1365
  import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
1240
1366
  function messageCenterStackRawPreviewText(item) {
1241
1367
  return item.digest.primary.summary.trim() || item.lastAgentMessageSummary.trim() || item.title;
@@ -1264,9 +1390,9 @@ function messageCenterStackPreviewNodes(item) {
1264
1390
  MESSAGE_CENTER_PREVIEW_LABEL_ESCAPE_PATTERN,
1265
1391
  "$1"
1266
1392
  );
1267
- const mention = parseRichTextMentionHref(href, label);
1393
+ const mention = parseRichTextMentionHref2(href, label);
1268
1394
  if (!mention) {
1269
- nodes.push(isRichTextMentionHref(href) ? label : fullMatch);
1395
+ nodes.push(isRichTextMentionHref2(href) ? label : fullMatch);
1270
1396
  } else {
1271
1397
  const kind = messageCenterPreviewMentionKind(mention.providerId);
1272
1398
  const displayLabel = label || mention.label;
@@ -1423,9 +1549,7 @@ var WorkspaceAgentMessageCenterCard = memo(
1423
1549
  "use memo";
1424
1550
  const { t } = useTranslation();
1425
1551
  const prompt = item.pendingPrompt;
1426
- const displayTitle = formatAgentGuiConversationPlainTitle(item, {
1427
- language: getActiveUiLanguage()
1428
- });
1552
+ const displayTitle = item.title.trim();
1429
1553
  const summary = messageCenterVisibleSummary(item);
1430
1554
  const displayStatus = statusClass(item);
1431
1555
  const statusTone = messageCenterStatusTone(item);
@@ -1655,6 +1779,7 @@ var WorkspaceAgentMessageCenterStack = memo(
1655
1779
  /* @__PURE__ */ jsx4(
1656
1780
  MessageCenterIdentityAvatarMark,
1657
1781
  {
1782
+ agentAvatarUrl: items[0]?.agentAvatarUrl,
1658
1783
  identity: items[0]?.identity ?? null,
1659
1784
  provider: items[0]?.provider ?? "",
1660
1785
  userId: items[0]?.userId ?? null
@@ -1807,6 +1932,7 @@ function MessageCenterStackSummary({
1807
1932
  /* @__PURE__ */ jsx4(
1808
1933
  MessageCenterIdentityAvatarMark,
1809
1934
  {
1935
+ agentAvatarUrl: firstItem.agentAvatarUrl,
1810
1936
  identity: firstItem.identity,
1811
1937
  provider: firstItem.provider,
1812
1938
  userId: firstItem.userId
@@ -2278,11 +2404,15 @@ function buildMessageCenterStatusOptions(counts, t) {
2278
2404
  function buildMessageCenterProviderOptions(items) {
2279
2405
  const counts = /* @__PURE__ */ new Map();
2280
2406
  for (const item of items) {
2281
- counts.set(item.provider, (counts.get(item.provider) ?? 0) + 1);
2407
+ const current = counts.get(item.provider);
2408
+ counts.set(item.provider, {
2409
+ count: (current?.count ?? 0) + 1,
2410
+ label: current?.label || item.agentName?.trim() || workspaceAgentProviderLabel(item.provider)
2411
+ });
2282
2412
  }
2283
- return [...counts.entries()].map(([value, count]) => ({
2284
- count,
2285
- label: workspaceAgentProviderLabel(value),
2413
+ return [...counts.entries()].map(([value, option]) => ({
2414
+ count: option.count,
2415
+ label: option.label,
2286
2416
  value
2287
2417
  })).sort((left, right) => left.label.localeCompare(right.label));
2288
2418
  }
@@ -2408,7 +2538,7 @@ function messageCenterAgentUserGroupLabel(item) {
2408
2538
  if (item.identity) {
2409
2539
  return `${item.identity.userName} & ${item.identity.agentName}`;
2410
2540
  }
2411
- return workspaceAgentProviderLabel(item.provider);
2541
+ return item.agentName?.trim() || workspaceAgentProviderLabel(item.provider);
2412
2542
  }
2413
2543
  var RECENTLY_COMPLETED_WINDOW_MS = 10 * 60 * 1e3;
2414
2544
  function isRecentlyCompletedMessageCenterItem(item, nowUnixMs) {
@@ -2629,6 +2759,7 @@ function MessageCenterGroupHeading({
2629
2759
  }) {
2630
2760
  "use memo";
2631
2761
  const statusSignal = messageCenterGroupStatusSignal(group.id);
2762
+ const firstItem = group.items[0];
2632
2763
  if (group.provider) {
2633
2764
  return /* @__PURE__ */ jsxs6(
2634
2765
  "h3",
@@ -2640,6 +2771,8 @@ function MessageCenterGroupHeading({
2640
2771
  group.identity ? /* @__PURE__ */ jsx7(
2641
2772
  MessageCenterIdentityLabel,
2642
2773
  {
2774
+ agentAvatarUrl: firstItem?.agentAvatarUrl,
2775
+ agentName: firstItem?.agentName,
2643
2776
  identity: group.identity,
2644
2777
  provider: group.provider
2645
2778
  }
@@ -2647,6 +2780,7 @@ function MessageCenterGroupHeading({
2647
2780
  /* @__PURE__ */ jsx7(
2648
2781
  MessageCenterIdentityAvatarMark,
2649
2782
  {
2783
+ agentAvatarUrl: firstItem?.agentAvatarUrl,
2650
2784
  identity: null,
2651
2785
  provider: group.provider,
2652
2786
  userId: group.userId ?? null
@@ -3364,6 +3498,7 @@ function buildWorkspaceAgentMessageCenterModelFromEngine(presentation, snapshot,
3364
3498
  const needsAttention = interaction ? needsAttentionFromInteraction(consumer, interaction) : null;
3365
3499
  return buildWorkspaceAgentMessageCenterItem({
3366
3500
  session: consumer.session,
3501
+ latestTurn: consumer.latestTurn,
3367
3502
  messages: sessionMessages(snapshot.sessionMessagesById, consumer),
3368
3503
  status: consumer.displayStatus,
3369
3504
  needsAttention,
@@ -3570,7 +3705,7 @@ function stabilizeWorkspaceAgentMessageCenterModel(previous, next) {
3570
3705
  };
3571
3706
  }
3572
3707
  function messageCenterItemsEqual(left, right) {
3573
- return left.id === right.id && left.agentSessionId === right.agentSessionId && left.provider === right.provider && left.userId === right.userId && left.title === right.title && left.imported === right.imported && left.cwd === right.cwd && left.status === right.status && left.lastAgentMessageSummary === right.lastAgentMessageSummary && left.lastAgentMessageAtUnixMs === right.lastAgentMessageAtUnixMs && left.needsAttentionKind === right.needsAttentionKind && left.needsAttentionSummary === right.needsAttentionSummary && left.sortTimeUnixMs === right.sortTimeUnixMs && messageCenterIdentityEqual(left.identity, right.identity) && messageCenterDigestEqual(left.digest, right.digest) && messageCenterPromptEqual(left.pendingPrompt, right.pendingPrompt) && messageCenterTurnOutcomeEqual(
3708
+ return left.id === right.id && left.agentSessionId === right.agentSessionId && left.agentTargetId === right.agentTargetId && left.agentName === right.agentName && left.agentAvatarUrl === right.agentAvatarUrl && left.provider === right.provider && left.userId === right.userId && left.title === right.title && left.imported === right.imported && left.cwd === right.cwd && left.status === right.status && left.lastAgentMessageSummary === right.lastAgentMessageSummary && left.lastAgentMessageAtUnixMs === right.lastAgentMessageAtUnixMs && left.needsAttentionKind === right.needsAttentionKind && left.needsAttentionSummary === right.needsAttentionSummary && left.sortTimeUnixMs === right.sortTimeUnixMs && messageCenterIdentityEqual(left.identity, right.identity) && messageCenterDigestEqual(left.digest, right.digest) && messageCenterPromptEqual(left.pendingPrompt, right.pendingPrompt) && messageCenterTurnOutcomeEqual(
3574
3709
  left.latestTurnOutcome ?? null,
3575
3710
  right.latestTurnOutcome ?? null
3576
3711
  );