@tutti-os/agent-gui 0.0.5 → 0.0.6

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.
@@ -68,6 +68,7 @@ interface WorkspaceAgentMessageCenterItem {
68
68
  id: string;
69
69
  agentSessionId: string;
70
70
  provider: string;
71
+ userId: string | null;
71
72
  title: string;
72
73
  identity: WorkspaceAgentMessageCenterIdentity | null;
73
74
  cwd: string;
@@ -9,7 +9,7 @@ import {
9
9
  managedAgentRoundedIconUrl,
10
10
  user_avatar_placeholder_default,
11
11
  workspaceAgentActivityStatusLabel
12
- } from "../chunk-F55LU7IJ.js";
12
+ } from "../chunk-FKCXHCPO.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-BHCCGKOP.js";
23
+ } from "../chunk-JWVLIF5R.js";
24
24
  import "../chunk-PJP5BUU6.js";
25
25
  import "../chunk-ZU3FKYMG.js";
26
26
 
@@ -135,6 +135,7 @@ function buildWorkspaceAgentMessageCenterModel(snapshot, options = {}) {
135
135
  id: `message-center-${session.agentSessionId}`,
136
136
  agentSessionId: session.agentSessionId,
137
137
  provider: session.provider,
138
+ userId: session.userId?.trim() || null,
138
139
  title,
139
140
  identity: resolveMessageCenterIdentity(
140
141
  session.agentSessionId,
@@ -512,18 +513,29 @@ function positiveNumber(value) {
512
513
  }
513
514
 
514
515
  // agent-message-center/workspaceAgentMessageCenterViewModel.ts
515
- function partitionMessageCenterItemsByProvider(items) {
516
+ function partitionMessageCenterItemsByAgentUser(items) {
516
517
  const stacks = /* @__PURE__ */ new Map();
517
518
  for (const item of items) {
518
- const stack = stacks.get(item.provider);
519
+ const stackId = messageCenterAgentUserStackId(item);
520
+ const stack = stacks.get(stackId);
519
521
  if (stack) {
520
522
  stack.items.push(item);
521
523
  } else {
522
- stacks.set(item.provider, { provider: item.provider, items: [item] });
524
+ stacks.set(stackId, {
525
+ id: stackId,
526
+ provider: item.provider,
527
+ userId: item.userId,
528
+ items: [item]
529
+ });
523
530
  }
524
531
  }
525
532
  return [...stacks.values()];
526
533
  }
534
+ function messageCenterAgentUserStackId(item) {
535
+ const provider = item.provider.trim().toLowerCase() || "unknown-agent";
536
+ const userId = item.userId?.trim() || "unknown-user";
537
+ return `agent-user:${provider}:${userId}`;
538
+ }
527
539
  function buildMessageCenterStatusOptions(counts, t) {
528
540
  return [
529
541
  {
@@ -1143,6 +1155,7 @@ function MessageCenterStackSummary({
1143
1155
  ),
1144
1156
  "data-stack-summary-count": items.length,
1145
1157
  "data-stack-provider": firstItem.provider,
1158
+ "data-stack-user-id": firstItem.userId ?? "",
1146
1159
  "data-testid": `workspace-agent-message-stack-summary-${groupId}`,
1147
1160
  onClick: onExpand,
1148
1161
  children: /* @__PURE__ */ jsxs2(
@@ -1753,9 +1766,9 @@ function WorkspaceAgentMessageCenterPanelContent({
1753
1766
  return;
1754
1767
  }
1755
1768
  for (const group of itemGroups) {
1756
- for (const stack of partitionMessageCenterItemsByProvider(group.items)) {
1769
+ for (const stack of partitionMessageCenterItemsByAgentUser(group.items)) {
1757
1770
  if (stack.items.length > 1 && stack.items.some((item) => item.id === highlightedItemId)) {
1758
- expandStack(`${group.id}:${stack.provider}`);
1771
+ expandStack(`${group.id}:${stack.id}`);
1759
1772
  return;
1760
1773
  }
1761
1774
  }
@@ -1896,7 +1909,7 @@ function WorkspaceAgentMessageCenterPanelContent({
1896
1909
  item.agentSessionId
1897
1910
  );
1898
1911
  };
1899
- return partitionMessageCenterItemsByProvider(
1912
+ return partitionMessageCenterItemsByAgentUser(
1900
1913
  group.items
1901
1914
  ).map((stack) => {
1902
1915
  const firstItem = stack.items[0];
@@ -1906,7 +1919,7 @@ function WorkspaceAgentMessageCenterPanelContent({
1906
1919
  if (stack.items.length === 1) {
1907
1920
  return renderCard(firstItem);
1908
1921
  }
1909
- const stackId = `${group.id}:${stack.provider}`;
1922
+ const stackId = `${group.id}:${stack.id}`;
1910
1923
  return /* @__PURE__ */ jsx4(
1911
1924
  MessageCenterStack,
1912
1925
  {