@tutti-os/agent-gui 0.0.5 → 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.
- package/dist/agent-message-center/index.d.ts +1 -0
- package/dist/agent-message-center/index.js +119 -32
- package/dist/agent-message-center/index.js.map +1 -1
- package/dist/app/renderer/agentactivity.css +28 -0
- package/dist/{chunk-C63Z2JWT.js → chunk-4RB33ETE.js} +81 -12
- package/dist/chunk-4RB33ETE.js.map +1 -0
- package/dist/{chunk-7ICAFTA2.js → chunk-DHOAJJ3K.js} +2 -2
- package/dist/{chunk-F55LU7IJ.js → chunk-VBNWIBNV.js} +15 -7
- package/dist/chunk-VBNWIBNV.js.map +1 -0
- package/dist/{chunk-BHCCGKOP.js → chunk-ZAVQMGAX.js} +5 -1
- package/dist/chunk-ZAVQMGAX.js.map +1 -0
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +306 -143
- package/dist/index.js.map +1 -1
- package/dist/workbench/contribution.d.ts +3 -1
- package/dist/workbench/contribution.js +3 -1
- package/dist/workbench/index.js +1 -1
- package/dist/workspace-agent-generated-files.js +2 -2
- package/package.json +10 -10
- package/dist/chunk-BHCCGKOP.js.map +0 -1
- package/dist/chunk-C63Z2JWT.js.map +0 -1
- package/dist/chunk-F55LU7IJ.js.map +0 -1
- /package/dist/{chunk-7ICAFTA2.js.map → chunk-DHOAJJ3K.js.map} +0 -0
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
managedAgentRoundedIconUrl,
|
|
10
10
|
user_avatar_placeholder_default,
|
|
11
11
|
workspaceAgentActivityStatusLabel
|
|
12
|
-
} from "../chunk-
|
|
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-
|
|
23
|
+
} from "../chunk-ZAVQMGAX.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
|
|
516
|
+
function partitionMessageCenterItemsByAgentUser(items) {
|
|
516
517
|
const stacks = /* @__PURE__ */ new Map();
|
|
517
518
|
for (const item of items) {
|
|
518
|
-
const
|
|
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(
|
|
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
|
{
|
|
@@ -611,8 +623,11 @@ function groupMessageCenterItems(items, groupBy, t) {
|
|
|
611
623
|
]);
|
|
612
624
|
case "agent":
|
|
613
625
|
return groupByDynamicKey(items, (item) => ({
|
|
614
|
-
id:
|
|
615
|
-
|
|
626
|
+
id: messageCenterAgentUserStackId(item),
|
|
627
|
+
identity: item.identity,
|
|
628
|
+
label: messageCenterAgentUserGroupLabel(item),
|
|
629
|
+
provider: item.provider,
|
|
630
|
+
userId: item.userId
|
|
616
631
|
}));
|
|
617
632
|
case "time":
|
|
618
633
|
return groupByFixedDefinitions(items, [
|
|
@@ -669,6 +684,12 @@ function groupMessageCenterItems(items, groupBy, t) {
|
|
|
669
684
|
}
|
|
670
685
|
}
|
|
671
686
|
}
|
|
687
|
+
function messageCenterAgentUserGroupLabel(item) {
|
|
688
|
+
if (item.identity) {
|
|
689
|
+
return `${item.identity.userName} & ${item.identity.agentName}`;
|
|
690
|
+
}
|
|
691
|
+
return workspaceAgentProviderLabel(item.provider);
|
|
692
|
+
}
|
|
672
693
|
var RECENTLY_COMPLETED_WINDOW_MS = 10 * 60 * 1e3;
|
|
673
694
|
function isRecentlyCompletedMessageCenterItem(item, nowUnixMs) {
|
|
674
695
|
if (messageCenterStatusFilterValue(item) !== "completed") {
|
|
@@ -713,6 +734,10 @@ function groupByDynamicKey(items, keyForItem) {
|
|
|
713
734
|
const group = groups.get(key.id);
|
|
714
735
|
if (group) {
|
|
715
736
|
group.items.push(item);
|
|
737
|
+
if (!group.identity && key.identity) {
|
|
738
|
+
group.identity = key.identity;
|
|
739
|
+
group.label = key.label;
|
|
740
|
+
}
|
|
716
741
|
} else {
|
|
717
742
|
groups.set(key.id, { ...key, items: [item] });
|
|
718
743
|
}
|
|
@@ -1075,15 +1100,11 @@ function WorkspaceAgentMessageCenterStack({
|
|
|
1075
1100
|
/* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 items-center justify-between gap-2 px-0.5 pb-1.5", children: [
|
|
1076
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: [
|
|
1077
1102
|
/* @__PURE__ */ jsx3(
|
|
1078
|
-
|
|
1103
|
+
MessageCenterIdentityAvatarMark,
|
|
1079
1104
|
{
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
decoding: "async",
|
|
1084
|
-
loading: "lazy",
|
|
1085
|
-
draggable: false,
|
|
1086
|
-
"aria-hidden": "true"
|
|
1105
|
+
identity: items[0]?.identity ?? null,
|
|
1106
|
+
provider: items[0]?.provider ?? "",
|
|
1107
|
+
userId: items[0]?.userId ?? null
|
|
1087
1108
|
}
|
|
1088
1109
|
),
|
|
1089
1110
|
/* @__PURE__ */ jsx3("span", { className: "min-w-0 truncate", children: t("agentHost.workspaceAgentMessageCenterStackSummaryCount", {
|
|
@@ -1143,6 +1164,7 @@ function MessageCenterStackSummary({
|
|
|
1143
1164
|
),
|
|
1144
1165
|
"data-stack-summary-count": items.length,
|
|
1145
1166
|
"data-stack-provider": firstItem.provider,
|
|
1167
|
+
"data-stack-user-id": firstItem.userId ?? "",
|
|
1146
1168
|
"data-testid": `workspace-agent-message-stack-summary-${groupId}`,
|
|
1147
1169
|
onClick: onExpand,
|
|
1148
1170
|
children: /* @__PURE__ */ jsxs2(
|
|
@@ -1157,15 +1179,11 @@ function MessageCenterStackSummary({
|
|
|
1157
1179
|
/* @__PURE__ */ jsxs2("span", { className: "flex min-w-0 items-center justify-between gap-2.5", children: [
|
|
1158
1180
|
/* @__PURE__ */ jsxs2("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
1159
1181
|
/* @__PURE__ */ jsx3(
|
|
1160
|
-
|
|
1182
|
+
MessageCenterIdentityAvatarMark,
|
|
1161
1183
|
{
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
decoding: "async",
|
|
1166
|
-
loading: "lazy",
|
|
1167
|
-
draggable: false,
|
|
1168
|
-
"aria-hidden": "true"
|
|
1184
|
+
identity: firstItem.identity,
|
|
1185
|
+
provider: firstItem.provider,
|
|
1186
|
+
userId: firstItem.userId
|
|
1169
1187
|
}
|
|
1170
1188
|
),
|
|
1171
1189
|
/* @__PURE__ */ jsx3("span", { className: "min-w-0 truncate text-[13px] font-bold leading-5 text-[var(--text-secondary)]", children: t("agentHost.workspaceAgentMessageCenterStackSummaryCount", {
|
|
@@ -1397,6 +1415,36 @@ function MessageCenterIdentityLabel({
|
|
|
1397
1415
|
}
|
|
1398
1416
|
);
|
|
1399
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
|
+
}
|
|
1400
1448
|
function MessageCenterIdentityAvatarStack({
|
|
1401
1449
|
agentAvatarUrl,
|
|
1402
1450
|
userAvatarUrl: rawUserAvatarUrl,
|
|
@@ -1753,9 +1801,9 @@ function WorkspaceAgentMessageCenterPanelContent({
|
|
|
1753
1801
|
return;
|
|
1754
1802
|
}
|
|
1755
1803
|
for (const group of itemGroups) {
|
|
1756
|
-
for (const stack of
|
|
1804
|
+
for (const stack of partitionMessageCenterItemsByAgentUser(group.items)) {
|
|
1757
1805
|
if (stack.items.length > 1 && stack.items.some((item) => item.id === highlightedItemId)) {
|
|
1758
|
-
expandStack(`${group.id}:${stack.
|
|
1806
|
+
expandStack(`${group.id}:${stack.id}`);
|
|
1759
1807
|
return;
|
|
1760
1808
|
}
|
|
1761
1809
|
}
|
|
@@ -1860,11 +1908,7 @@ function WorkspaceAgentMessageCenterPanelContent({
|
|
|
1860
1908
|
className: "flex min-w-0 flex-col gap-2.5",
|
|
1861
1909
|
"aria-label": `${group.label} ${group.items.length}`,
|
|
1862
1910
|
children: [
|
|
1863
|
-
/* @__PURE__ */ jsx4("div", { className: "flex min-w-0 items-center justify-between gap-3 px-0.5", children: /* @__PURE__ */
|
|
1864
|
-
group.label,
|
|
1865
|
-
" \xB7 ",
|
|
1866
|
-
group.items.length
|
|
1867
|
-
] }) }),
|
|
1911
|
+
/* @__PURE__ */ jsx4("div", { className: "flex min-w-0 items-center justify-between gap-3 px-0.5", children: /* @__PURE__ */ jsx4(MessageCenterGroupHeading, { group }) }),
|
|
1868
1912
|
(() => {
|
|
1869
1913
|
const renderCard = (item, options = {}) => {
|
|
1870
1914
|
const highlighted = item.id === highlightedItemId;
|
|
@@ -1896,7 +1940,7 @@ function WorkspaceAgentMessageCenterPanelContent({
|
|
|
1896
1940
|
item.agentSessionId
|
|
1897
1941
|
);
|
|
1898
1942
|
};
|
|
1899
|
-
return
|
|
1943
|
+
return partitionMessageCenterItemsByAgentUser(
|
|
1900
1944
|
group.items
|
|
1901
1945
|
).map((stack) => {
|
|
1902
1946
|
const firstItem = stack.items[0];
|
|
@@ -1906,7 +1950,7 @@ function WorkspaceAgentMessageCenterPanelContent({
|
|
|
1906
1950
|
if (stack.items.length === 1) {
|
|
1907
1951
|
return renderCard(firstItem);
|
|
1908
1952
|
}
|
|
1909
|
-
const stackId = `${group.id}:${stack.
|
|
1953
|
+
const stackId = group.id === stack.id ? stack.id : `${group.id}:${stack.id}`;
|
|
1910
1954
|
return /* @__PURE__ */ jsx4(
|
|
1911
1955
|
MessageCenterStack,
|
|
1912
1956
|
{
|
|
@@ -1948,6 +1992,49 @@ function WorkspaceAgentMessageCenterPanelContent({
|
|
|
1948
1992
|
}
|
|
1949
1993
|
var MessageCenterCard = WorkspaceAgentMessageCenterCard;
|
|
1950
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
|
+
}
|
|
1951
2038
|
export {
|
|
1952
2039
|
AgentInteractivePromptSurface,
|
|
1953
2040
|
WorkspaceAgentMessageCenterCard,
|