@tutti-os/agent-gui 0.0.6 → 0.0.7

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.
@@ -9,7 +9,7 @@ import {
9
9
  managedAgentRoundedIconUrl,
10
10
  user_avatar_placeholder_default,
11
11
  workspaceAgentActivityStatusLabel
12
- } from "../chunk-FKCXHCPO.js";
12
+ } from "../chunk-VBNWIBNV.js";
13
13
  import {
14
14
  resolveWorkspaceAgentSessionSortTimeUnixMs,
15
15
  workspaceAgentProviderLabel
@@ -20,7 +20,7 @@ import {
20
20
  import {
21
21
  AgentGuiI18nProvider,
22
22
  useTranslation
23
- } from "../chunk-JWVLIF5R.js";
23
+ } from "../chunk-ZAVQMGAX.js";
24
24
  import "../chunk-PJP5BUU6.js";
25
25
  import "../chunk-ZU3FKYMG.js";
26
26
 
@@ -623,8 +623,11 @@ function groupMessageCenterItems(items, groupBy, t) {
623
623
  ]);
624
624
  case "agent":
625
625
  return groupByDynamicKey(items, (item) => ({
626
- id: `agent:${item.provider}`,
627
- label: workspaceAgentProviderLabel(item.provider)
626
+ id: messageCenterAgentUserStackId(item),
627
+ identity: item.identity,
628
+ label: messageCenterAgentUserGroupLabel(item),
629
+ provider: item.provider,
630
+ userId: item.userId
628
631
  }));
629
632
  case "time":
630
633
  return groupByFixedDefinitions(items, [
@@ -681,6 +684,12 @@ function groupMessageCenterItems(items, groupBy, t) {
681
684
  }
682
685
  }
683
686
  }
687
+ function messageCenterAgentUserGroupLabel(item) {
688
+ if (item.identity) {
689
+ return `${item.identity.userName} & ${item.identity.agentName}`;
690
+ }
691
+ return workspaceAgentProviderLabel(item.provider);
692
+ }
684
693
  var RECENTLY_COMPLETED_WINDOW_MS = 10 * 60 * 1e3;
685
694
  function isRecentlyCompletedMessageCenterItem(item, nowUnixMs) {
686
695
  if (messageCenterStatusFilterValue(item) !== "completed") {
@@ -725,6 +734,10 @@ function groupByDynamicKey(items, keyForItem) {
725
734
  const group = groups.get(key.id);
726
735
  if (group) {
727
736
  group.items.push(item);
737
+ if (!group.identity && key.identity) {
738
+ group.identity = key.identity;
739
+ group.label = key.label;
740
+ }
728
741
  } else {
729
742
  groups.set(key.id, { ...key, items: [item] });
730
743
  }
@@ -1087,15 +1100,11 @@ function WorkspaceAgentMessageCenterStack({
1087
1100
  /* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 items-center justify-between gap-2 px-0.5 pb-1.5", children: [
1088
1101
  /* @__PURE__ */ jsxs2("span", { className: "flex min-w-0 items-center gap-1.5 text-[13px] font-semibold leading-4 text-[var(--text-tertiary)]", children: [
1089
1102
  /* @__PURE__ */ jsx3(
1090
- "img",
1103
+ MessageCenterIdentityAvatarMark,
1091
1104
  {
1092
- src: managedAgentRoundedIconUrl(items[0]?.provider ?? ""),
1093
- alt: "",
1094
- className: "size-4 shrink-0 rounded-full",
1095
- decoding: "async",
1096
- loading: "lazy",
1097
- draggable: false,
1098
- "aria-hidden": "true"
1105
+ identity: items[0]?.identity ?? null,
1106
+ provider: items[0]?.provider ?? "",
1107
+ userId: items[0]?.userId ?? null
1099
1108
  }
1100
1109
  ),
1101
1110
  /* @__PURE__ */ jsx3("span", { className: "min-w-0 truncate", children: t("agentHost.workspaceAgentMessageCenterStackSummaryCount", {
@@ -1170,15 +1179,11 @@ function MessageCenterStackSummary({
1170
1179
  /* @__PURE__ */ jsxs2("span", { className: "flex min-w-0 items-center justify-between gap-2.5", children: [
1171
1180
  /* @__PURE__ */ jsxs2("span", { className: "flex min-w-0 items-center gap-2", children: [
1172
1181
  /* @__PURE__ */ jsx3(
1173
- "img",
1182
+ MessageCenterIdentityAvatarMark,
1174
1183
  {
1175
- src: managedAgentRoundedIconUrl(firstItem.provider),
1176
- alt: "",
1177
- className: "size-5 shrink-0 rounded-full",
1178
- decoding: "async",
1179
- loading: "lazy",
1180
- draggable: false,
1181
- "aria-hidden": "true"
1184
+ identity: firstItem.identity,
1185
+ provider: firstItem.provider,
1186
+ userId: firstItem.userId
1182
1187
  }
1183
1188
  ),
1184
1189
  /* @__PURE__ */ jsx3("span", { className: "min-w-0 truncate text-[13px] font-bold leading-5 text-[var(--text-secondary)]", children: t("agentHost.workspaceAgentMessageCenterStackSummaryCount", {
@@ -1410,6 +1415,36 @@ function MessageCenterIdentityLabel({
1410
1415
  }
1411
1416
  );
1412
1417
  }
1418
+ function MessageCenterIdentityAvatarMark({
1419
+ identity,
1420
+ provider,
1421
+ userId
1422
+ }) {
1423
+ "use memo";
1424
+ const userName = identity?.userName.trim() || userId?.trim() || "";
1425
+ if (!userName) {
1426
+ return /* @__PURE__ */ jsx3(
1427
+ "img",
1428
+ {
1429
+ src: managedAgentRoundedIconUrl(provider),
1430
+ alt: "",
1431
+ className: "size-5 shrink-0 rounded-full",
1432
+ decoding: "async",
1433
+ loading: "lazy",
1434
+ draggable: false,
1435
+ "aria-hidden": "true"
1436
+ }
1437
+ );
1438
+ }
1439
+ return /* @__PURE__ */ jsx3(
1440
+ MessageCenterIdentityAvatarStack,
1441
+ {
1442
+ userAvatarUrl: identity?.userAvatarUrl,
1443
+ userName,
1444
+ agentAvatarUrl: identity?.agentAvatarUrl?.trim() || managedAgentRoundedIconUrl(provider)
1445
+ }
1446
+ );
1447
+ }
1413
1448
  function MessageCenterIdentityAvatarStack({
1414
1449
  agentAvatarUrl,
1415
1450
  userAvatarUrl: rawUserAvatarUrl,
@@ -1873,11 +1908,7 @@ function WorkspaceAgentMessageCenterPanelContent({
1873
1908
  className: "flex min-w-0 flex-col gap-2.5",
1874
1909
  "aria-label": `${group.label} ${group.items.length}`,
1875
1910
  children: [
1876
- /* @__PURE__ */ jsx4("div", { className: "flex min-w-0 items-center justify-between gap-3 px-0.5", children: /* @__PURE__ */ jsxs3("h3", { className: "truncate text-[11px] font-normal leading-4 text-[var(--text-tertiary)]", children: [
1877
- group.label,
1878
- " \xB7 ",
1879
- group.items.length
1880
- ] }) }),
1911
+ /* @__PURE__ */ jsx4("div", { className: "flex min-w-0 items-center justify-between gap-3 px-0.5", children: /* @__PURE__ */ jsx4(MessageCenterGroupHeading, { group }) }),
1881
1912
  (() => {
1882
1913
  const renderCard = (item, options = {}) => {
1883
1914
  const highlighted = item.id === highlightedItemId;
@@ -1919,7 +1950,7 @@ function WorkspaceAgentMessageCenterPanelContent({
1919
1950
  if (stack.items.length === 1) {
1920
1951
  return renderCard(firstItem);
1921
1952
  }
1922
- const stackId = `${group.id}:${stack.id}`;
1953
+ const stackId = group.id === stack.id ? stack.id : `${group.id}:${stack.id}`;
1923
1954
  return /* @__PURE__ */ jsx4(
1924
1955
  MessageCenterStack,
1925
1956
  {
@@ -1961,6 +1992,49 @@ function WorkspaceAgentMessageCenterPanelContent({
1961
1992
  }
1962
1993
  var MessageCenterCard = WorkspaceAgentMessageCenterCard;
1963
1994
  var MessageCenterStack = WorkspaceAgentMessageCenterStack;
1995
+ function MessageCenterGroupHeading({
1996
+ group
1997
+ }) {
1998
+ "use memo";
1999
+ if (group.provider) {
2000
+ return /* @__PURE__ */ jsxs3(
2001
+ "h3",
2002
+ {
2003
+ "aria-label": `${group.label} \xB7 ${group.items.length}`,
2004
+ className: "flex min-w-0 items-center gap-1.5 text-[11px] font-normal leading-4 text-[var(--text-tertiary)]",
2005
+ title: `${group.label} \xB7 ${group.items.length}`,
2006
+ children: [
2007
+ group.identity ? /* @__PURE__ */ jsx4(
2008
+ MessageCenterIdentityLabel,
2009
+ {
2010
+ identity: group.identity,
2011
+ provider: group.provider
2012
+ }
2013
+ ) : /* @__PURE__ */ jsxs3("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
2014
+ /* @__PURE__ */ jsx4(
2015
+ MessageCenterIdentityAvatarMark,
2016
+ {
2017
+ identity: null,
2018
+ provider: group.provider,
2019
+ userId: group.userId ?? null
2020
+ }
2021
+ ),
2022
+ /* @__PURE__ */ jsx4("span", { className: "min-w-0 truncate", children: group.label })
2023
+ ] }),
2024
+ /* @__PURE__ */ jsxs3("span", { className: "shrink-0", children: [
2025
+ "\xB7 ",
2026
+ group.items.length
2027
+ ] })
2028
+ ]
2029
+ }
2030
+ );
2031
+ }
2032
+ return /* @__PURE__ */ jsxs3("h3", { className: "truncate text-[11px] font-normal leading-4 text-[var(--text-tertiary)]", children: [
2033
+ group.label,
2034
+ " \xB7 ",
2035
+ group.items.length
2036
+ ] });
2037
+ }
1964
2038
  export {
1965
2039
  AgentInteractivePromptSurface,
1966
2040
  WorkspaceAgentMessageCenterCard,