@celljs/ta-channels 4.8.0 → 4.9.0
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/README.en.md +3 -2
- package/README.md +3 -2
- package/extension/index.mjs +109 -8
- package/host/index.mjs +281 -5
- package/package.json +13 -4
- package/web/index.js +992 -205
- package/web-src/agent-menu.tsx +0 -236
- package/web-src/channel-menu.tsx +0 -98
- package/web-src/channels-model.ts +0 -156
- package/web-src/channels-util.spec.ts +0 -312
- package/web-src/channels-util.ts +0 -556
- package/web-src/channels.ts +0 -235
- package/web-src/create.tsx +0 -273
- package/web-src/extension.ts +0 -91
- package/web-src/faces.tsx +0 -247
- package/web-src/host.ts +0 -12
- package/web-src/i18n.ts +0 -221
- package/web-src/index.tsx +0 -82
- package/web-src/members.tsx +0 -258
- package/web-src/more-menu.tsx +0 -113
- package/web-src/react.ts +0 -11
- package/web-src/room.tsx +0 -212
- package/web-src/sidebar.tsx +0 -295
- package/web-src/style.ts +0 -249
- package/web-src/team-tools.ts +0 -103
- package/web-src/team.spec.ts +0 -370
- package/web-src/team.ts +0 -560
- package/web-src/views.spec.ts +0 -89
- package/web-src/views.tsx +0 -239
package/web/index.js
CHANGED
|
@@ -154,7 +154,7 @@ var ChannelsUtil;
|
|
|
154
154
|
const cwd = directory(input.cwd);
|
|
155
155
|
const id = newId("agent");
|
|
156
156
|
const face = isFace(input.face) ? input.face : freeFace(hash(id), new Set(faces(team.agents).values()));
|
|
157
|
-
const agent = { id, name, role, mark: mark(name), face, cwd, createdAt: Date.now() };
|
|
157
|
+
const agent = { id, name, role, mark: mark(name), face, cwd, ...input.temporary ? { temporary: true } : {}, createdAt: Date.now() };
|
|
158
158
|
return { team: { ...team, agents: [...team.agents, agent] }, agent };
|
|
159
159
|
}
|
|
160
160
|
ChannelsUtil.addAgent = addAgent;
|
|
@@ -171,7 +171,15 @@ var ChannelsUtil;
|
|
|
171
171
|
throw new Error(`A channel holds at most ${MAX_MEMBERS} agents.`);
|
|
172
172
|
}
|
|
173
173
|
const topic = typeof input.topic === "string" && input.topic.trim() ? input.topic.trim() : undefined;
|
|
174
|
-
const channel = {
|
|
174
|
+
const channel = {
|
|
175
|
+
id: newId("channel"),
|
|
176
|
+
name,
|
|
177
|
+
topic,
|
|
178
|
+
members,
|
|
179
|
+
...input.by ? { by: input.by } : {},
|
|
180
|
+
...input.origin ? { origin: input.origin } : {},
|
|
181
|
+
createdAt: Date.now()
|
|
182
|
+
};
|
|
175
183
|
return { team: { ...team, channels: [...team.channels, channel] }, channel };
|
|
176
184
|
}
|
|
177
185
|
ChannelsUtil.addChannel = addChannel;
|
|
@@ -262,6 +270,19 @@ var ChannelsUtil;
|
|
|
262
270
|
return { team: { ...team, channels: team.channels.map((other) => other.id === channel.id ? channel : other) }, channel, before };
|
|
263
271
|
}
|
|
264
272
|
ChannelsUtil.updateChannel = updateChannel;
|
|
273
|
+
function standing(team) {
|
|
274
|
+
const inChannel = new Set(team.channels.flatMap((channel) => channel.members));
|
|
275
|
+
return team.agents.filter((agent) => !agent.temporary || !inChannel.has(agent.id));
|
|
276
|
+
}
|
|
277
|
+
ChannelsUtil.standing = standing;
|
|
278
|
+
function taskChannels(team) {
|
|
279
|
+
return team.channels.filter((channel) => channel.by === "ta");
|
|
280
|
+
}
|
|
281
|
+
ChannelsUtil.taskChannels = taskChannels;
|
|
282
|
+
function ownChannels(team) {
|
|
283
|
+
return team.channels.filter((channel) => channel.by !== "ta");
|
|
284
|
+
}
|
|
285
|
+
ChannelsUtil.ownChannels = ownChannels;
|
|
265
286
|
function pinnedFirst(channels) {
|
|
266
287
|
return [...channels.filter((channel) => channel.pinned), ...channels.filter((channel) => !channel.pinned)];
|
|
267
288
|
}
|
|
@@ -308,6 +329,9 @@ var ChannelsUtil;
|
|
|
308
329
|
}
|
|
309
330
|
agent.face = input.face;
|
|
310
331
|
}
|
|
332
|
+
if (input.keep === true) {
|
|
333
|
+
delete agent.temporary;
|
|
334
|
+
}
|
|
311
335
|
if (input.cwd !== undefined) {
|
|
312
336
|
const cwd = typeof input.cwd === "string" && input.cwd.trim() ? input.cwd.trim() : undefined;
|
|
313
337
|
if (cwd !== before.cwd) {
|
|
@@ -1058,7 +1082,7 @@ function RoomFace({ members, faces, size, working }) {
|
|
|
1058
1082
|
|
|
1059
1083
|
// web-src/i18n.ts
|
|
1060
1084
|
var EN = {
|
|
1061
|
-
title: "
|
|
1085
|
+
title: "Double",
|
|
1062
1086
|
channels: "Channels",
|
|
1063
1087
|
agents: "Agents",
|
|
1064
1088
|
newChannel: "New channel",
|
|
@@ -1070,7 +1094,7 @@ var EN = {
|
|
|
1070
1094
|
members: "Members",
|
|
1071
1095
|
addMembers: "Add members",
|
|
1072
1096
|
add: "Add",
|
|
1073
|
-
allMembers: "Every agent is in this channel already
|
|
1097
|
+
allMembers: "Every agent is in this channel already",
|
|
1074
1098
|
membersHint: "The first one you pick leads: it answers what names nobody.",
|
|
1075
1099
|
create: "Create",
|
|
1076
1100
|
cancel: "Cancel",
|
|
@@ -1079,9 +1103,11 @@ var EN = {
|
|
|
1079
1103
|
you: "You",
|
|
1080
1104
|
ta: "Ta",
|
|
1081
1105
|
lead: "Lead",
|
|
1082
|
-
empty:
|
|
1083
|
-
|
|
1084
|
-
|
|
1106
|
+
empty: "No channels yet",
|
|
1107
|
+
emptyHint: "Ask Ta for a team, or create one with +",
|
|
1108
|
+
noAgents: "No agents yet",
|
|
1109
|
+
noAgentsHint: "A channel is made of agents: create one first",
|
|
1110
|
+
pick: "Pick a channel",
|
|
1085
1111
|
quiet: "Nothing said yet. Mention a member with @, or the lead answers.",
|
|
1086
1112
|
placeholder: "Message {channel}; @ names a member",
|
|
1087
1113
|
answering: "{name} is answering",
|
|
@@ -1094,10 +1120,11 @@ var EN = {
|
|
|
1094
1120
|
idle: "Idle",
|
|
1095
1121
|
answeringIn: "Answering in #{channel}",
|
|
1096
1122
|
answeringNow: "{name} is answering…",
|
|
1097
|
-
noMatch: "No
|
|
1123
|
+
noMatch: "No matching agents or channels",
|
|
1098
1124
|
noMessages: "No messages yet",
|
|
1099
1125
|
leadOf: "Lead: {name}",
|
|
1100
|
-
noAgentsYet: "No agents yet
|
|
1126
|
+
noAgentsYet: "No agents yet",
|
|
1127
|
+
noAgentsYetHint: "Create one with +, or ask Ta for a team",
|
|
1101
1128
|
myDouble: "My double",
|
|
1102
1129
|
memberCount: "{count} members",
|
|
1103
1130
|
channel: "Channel",
|
|
@@ -1128,7 +1155,7 @@ var EN = {
|
|
|
1128
1155
|
deleteChannel: "Delete channel",
|
|
1129
1156
|
confirmDelete: "Delete #{channel} and its messages?",
|
|
1130
1157
|
delete: "Delete",
|
|
1131
|
-
noChannel: "Open a channel to see its members
|
|
1158
|
+
noChannel: "Open a channel to see its members",
|
|
1132
1159
|
more: "More",
|
|
1133
1160
|
stop: "Stop",
|
|
1134
1161
|
stoppedAgent: "Stopped {name}.",
|
|
@@ -1145,7 +1172,7 @@ var EN = {
|
|
|
1145
1172
|
exportChat: "Export conversation (Markdown)",
|
|
1146
1173
|
nothingToExport: "{name} has said nothing yet.",
|
|
1147
1174
|
joinChannel: "Add to channel",
|
|
1148
|
-
noChannelToJoin: "It is in every channel already
|
|
1175
|
+
noChannelToJoin: "It is in every channel already",
|
|
1149
1176
|
joined: "{name} joined #{channel}.",
|
|
1150
1177
|
deleteAgent: "Delete",
|
|
1151
1178
|
confirmDeleteAgent: "Delete {name}? It leaves its channels, and channels with no one else go too; its session file stays.",
|
|
@@ -1159,10 +1186,38 @@ var EN = {
|
|
|
1159
1186
|
renameChannel: "Rename #{channel}",
|
|
1160
1187
|
stopAnswering: "Stop answering",
|
|
1161
1188
|
stoppedChannel: "Stopped the members answering in #{channel}.",
|
|
1162
|
-
noMessagesToExport: "#{channel} has no messages yet."
|
|
1189
|
+
noMessagesToExport: "#{channel} has no messages yet.",
|
|
1190
|
+
yourTurn: "Your turn",
|
|
1191
|
+
building: "Building the team…",
|
|
1192
|
+
openInMain: "Open in the main area",
|
|
1193
|
+
openInMainHint: "Talk to the team yourself",
|
|
1194
|
+
keepMembers: "Keep its agents",
|
|
1195
|
+
keptMembers: "{names} are among your members now.",
|
|
1196
|
+
keep: "Keep as a member",
|
|
1197
|
+
kept: "{name} is among your members now.",
|
|
1198
|
+
temporary: "Made by Ta for this team; keep it to have it among your members",
|
|
1199
|
+
temporaryTag: "Temporary",
|
|
1200
|
+
tasks: "Tasks",
|
|
1201
|
+
membersSection: "Members",
|
|
1202
|
+
byDirectory: "Group by directory",
|
|
1203
|
+
channelsSection: "Channels",
|
|
1204
|
+
waitingSection: "Waiting for you",
|
|
1205
|
+
runningSection: "In progress",
|
|
1206
|
+
endedSection: "Ended",
|
|
1207
|
+
showAll: "Show all {count}",
|
|
1208
|
+
showFewer: "Show fewer",
|
|
1209
|
+
noTasksYet: "Nothing handed out yet",
|
|
1210
|
+
waitingCount: "{count} need you",
|
|
1211
|
+
runningCount: "{count} running",
|
|
1212
|
+
standingBy: "Standing by",
|
|
1213
|
+
noTasksYetHint: "Tell the double what you want done",
|
|
1214
|
+
noTasksHere: "What the double hands out, tasks and teams, is listed here",
|
|
1215
|
+
tellDouble: "Talk to the double",
|
|
1216
|
+
deleteTask: "Delete the team",
|
|
1217
|
+
confirmDeleteTask: "Delete #{channel} and its messages? Its agents stay, among your members."
|
|
1163
1218
|
};
|
|
1164
1219
|
var ZH = {
|
|
1165
|
-
title: "
|
|
1220
|
+
title: "分身",
|
|
1166
1221
|
channels: "频道",
|
|
1167
1222
|
agents: "智能体",
|
|
1168
1223
|
newChannel: "新建频道",
|
|
@@ -1174,7 +1229,7 @@ var ZH = {
|
|
|
1174
1229
|
members: "成员",
|
|
1175
1230
|
addMembers: "添加成员",
|
|
1176
1231
|
add: "添加",
|
|
1177
|
-
allMembers: "
|
|
1232
|
+
allMembers: "所有智能体都已在这个频道里",
|
|
1178
1233
|
membersHint: "先选的成员是负责人:没人被 @ 的消息由它回答。",
|
|
1179
1234
|
create: "创建",
|
|
1180
1235
|
cancel: "取消",
|
|
@@ -1183,25 +1238,28 @@ var ZH = {
|
|
|
1183
1238
|
you: "你",
|
|
1184
1239
|
ta: "Ta",
|
|
1185
1240
|
lead: "负责人",
|
|
1186
|
-
empty: "
|
|
1187
|
-
|
|
1188
|
-
|
|
1241
|
+
empty: "还没有频道",
|
|
1242
|
+
emptyHint: "让 Ta 组个团队,或点 + 新建",
|
|
1243
|
+
noAgents: "还没有智能体",
|
|
1244
|
+
noAgentsHint: "频道由智能体组成,先新建一个",
|
|
1245
|
+
pick: "选一个频道",
|
|
1189
1246
|
quiet: "还没有消息。用 @ 点名成员,不点名就由负责人回答。",
|
|
1190
1247
|
placeholder: "发到 {channel};@ 点名成员",
|
|
1191
1248
|
answering: "{name} 正在回答",
|
|
1192
1249
|
failed: "没有回答",
|
|
1193
1250
|
mention: "@{name}",
|
|
1194
1251
|
stopped: "已到交接上限,等你继续。",
|
|
1195
|
-
search: "
|
|
1252
|
+
search: "搜索",
|
|
1196
1253
|
clear: "清除",
|
|
1197
1254
|
new: "新建",
|
|
1198
1255
|
idle: "空闲",
|
|
1199
1256
|
answeringIn: "正在 #{channel} 回答",
|
|
1200
1257
|
answeringNow: "{name} 正在回答…",
|
|
1201
|
-
noMatch: "
|
|
1258
|
+
noMatch: "没有匹配的智能体或频道",
|
|
1202
1259
|
noMessages: "还没有消息",
|
|
1203
1260
|
leadOf: "负责人:{name}",
|
|
1204
|
-
noAgentsYet: "
|
|
1261
|
+
noAgentsYet: "还没有智能体",
|
|
1262
|
+
noAgentsYetHint: "点 + 新建,或让 Ta 组个团队",
|
|
1205
1263
|
myDouble: "我的分身",
|
|
1206
1264
|
memberCount: "{count} 位成员",
|
|
1207
1265
|
channel: "频道",
|
|
@@ -1232,7 +1290,7 @@ var ZH = {
|
|
|
1232
1290
|
deleteChannel: "删除频道",
|
|
1233
1291
|
confirmDelete: "删除 #{channel} 和它的全部消息?",
|
|
1234
1292
|
delete: "删除",
|
|
1235
|
-
noChannel: "
|
|
1293
|
+
noChannel: "打开频道后,这里显示它的成员",
|
|
1236
1294
|
more: "更多",
|
|
1237
1295
|
stop: "停止",
|
|
1238
1296
|
stoppedAgent: "已停止 {name}。",
|
|
@@ -1249,7 +1307,7 @@ var ZH = {
|
|
|
1249
1307
|
exportChat: "导出对话(Markdown)",
|
|
1250
1308
|
nothingToExport: "{name} 还没有说过话。",
|
|
1251
1309
|
joinChannel: "加入频道",
|
|
1252
|
-
noChannelToJoin: "
|
|
1310
|
+
noChannelToJoin: "它已经在所有频道里了",
|
|
1253
1311
|
joined: "{name} 已加入 #{channel}。",
|
|
1254
1312
|
deleteAgent: "删除",
|
|
1255
1313
|
confirmDeleteAgent: "删除 {name}?它会退出所在的频道,只剩它一个成员的频道也会一起删除;会话文件会保留。",
|
|
@@ -1263,7 +1321,35 @@ var ZH = {
|
|
|
1263
1321
|
renameChannel: "重命名 #{channel}",
|
|
1264
1322
|
stopAnswering: "停止回答",
|
|
1265
1323
|
stoppedChannel: "已让 #{channel} 里正在回答的成员停下。",
|
|
1266
|
-
noMessagesToExport: "#{channel} 还没有消息。"
|
|
1324
|
+
noMessagesToExport: "#{channel} 还没有消息。",
|
|
1325
|
+
yourTurn: "轮到你了",
|
|
1326
|
+
building: "正在组建团队…",
|
|
1327
|
+
openInMain: "在主区打开",
|
|
1328
|
+
openInMainHint: "亲自和团队对话",
|
|
1329
|
+
keepMembers: "留下团队成员",
|
|
1330
|
+
keptMembers: "{names} 已成为你的常驻成员。",
|
|
1331
|
+
keep: "留为常驻成员",
|
|
1332
|
+
kept: "{name} 已成为你的常驻成员。",
|
|
1333
|
+
temporary: "Ta 为这个团队临时创建;留下后成为你的常驻成员",
|
|
1334
|
+
temporaryTag: "临时",
|
|
1335
|
+
tasks: "任务",
|
|
1336
|
+
membersSection: "成员",
|
|
1337
|
+
byDirectory: "按目录分组",
|
|
1338
|
+
channelsSection: "频道",
|
|
1339
|
+
waitingSection: "待你处理",
|
|
1340
|
+
runningSection: "进行中",
|
|
1341
|
+
endedSection: "已结束",
|
|
1342
|
+
showAll: "显示全部 {count} 个",
|
|
1343
|
+
showFewer: "收起",
|
|
1344
|
+
noTasksYet: "还没有交出的事",
|
|
1345
|
+
waitingCount: "{count} 个待你处理",
|
|
1346
|
+
runningCount: "{count} 个进行中",
|
|
1347
|
+
standingBy: "待命",
|
|
1348
|
+
noTasksYetHint: "告诉分身你想做什么",
|
|
1349
|
+
noTasksHere: "分身交出去的任务和团队会列在这里",
|
|
1350
|
+
tellDouble: "和分身说",
|
|
1351
|
+
deleteTask: "删除这个团队",
|
|
1352
|
+
confirmDeleteTask: "删除 #{channel} 及其消息?团队成员会留在你的成员里。"
|
|
1267
1353
|
};
|
|
1268
1354
|
var ChannelWords;
|
|
1269
1355
|
((ChannelWords) => {
|
|
@@ -1334,11 +1420,24 @@ var ChannelViews;
|
|
|
1334
1420
|
let latest;
|
|
1335
1421
|
async function openAgent(context, agentId) {
|
|
1336
1422
|
latest = agentId;
|
|
1337
|
-
const
|
|
1338
|
-
context.
|
|
1339
|
-
|
|
1423
|
+
const known = context.sessions.get(agentId);
|
|
1424
|
+
const opened = context.service.openAgent(agentId).then((sessionId2) => {
|
|
1425
|
+
context.sessions.set(agentId, sessionId2);
|
|
1426
|
+
return sessionId2;
|
|
1427
|
+
});
|
|
1428
|
+
if (!known) {
|
|
1429
|
+
const agent = ChannelsUtil.findAgent(context.service.state.team, agentId);
|
|
1430
|
+
await context.pi.switchSession(opened, { title: agent?.name });
|
|
1431
|
+
return;
|
|
1432
|
+
}
|
|
1433
|
+
const shown = context.pi.switchSession(known).catch(() => {
|
|
1434
|
+
return;
|
|
1435
|
+
});
|
|
1436
|
+
const sessionId = await opened;
|
|
1437
|
+
if (latest === agentId && sessionId !== known) {
|
|
1340
1438
|
await context.pi.switchSession(sessionId);
|
|
1341
1439
|
}
|
|
1440
|
+
await shown;
|
|
1342
1441
|
}
|
|
1343
1442
|
ChannelViews.openAgent = openAgent;
|
|
1344
1443
|
})(ChannelViews ||= {});
|
|
@@ -1412,10 +1511,6 @@ var SidebarUtil;
|
|
|
1412
1511
|
return date.toLocaleDateString(language, { year: "2-digit", month: "numeric", day: "numeric" });
|
|
1413
1512
|
}
|
|
1414
1513
|
SidebarUtil.time = time;
|
|
1415
|
-
function host(cwd) {
|
|
1416
|
-
return /^ssh:\/\/([^/]+)/.exec(cwd)?.[1];
|
|
1417
|
-
}
|
|
1418
|
-
SidebarUtil.host = host;
|
|
1419
1514
|
function folder(cwd) {
|
|
1420
1515
|
const parts = cwd.split(/[\\/]+/).filter(Boolean);
|
|
1421
1516
|
return parts[parts.length - 1] ?? cwd;
|
|
@@ -1426,6 +1521,23 @@ var SidebarUtil;
|
|
|
1426
1521
|
return !key || texts.some((text) => text?.toLowerCase().includes(key));
|
|
1427
1522
|
}
|
|
1428
1523
|
SidebarUtil.matches = matches;
|
|
1524
|
+
function taskGroups(tasks) {
|
|
1525
|
+
const latest = (a, b) => b.startedAt - a.startedAt;
|
|
1526
|
+
return {
|
|
1527
|
+
waiting: tasks.filter((task) => task.status === "waiting").sort(latest),
|
|
1528
|
+
running: tasks.filter((task) => task.status === "running").sort(latest),
|
|
1529
|
+
ended: tasks.filter((task) => task.status !== "waiting" && task.status !== "running").sort((a, b) => (b.endedAt ?? b.startedAt) - (a.endedAt ?? a.startedAt))
|
|
1530
|
+
};
|
|
1531
|
+
}
|
|
1532
|
+
SidebarUtil.taskGroups = taskGroups;
|
|
1533
|
+
function memberGroups(agents, serverCwd, grouped) {
|
|
1534
|
+
return grouped && directories(agents, serverCwd) > 1 ? byDirectory(agents, serverCwd) : [{ agents }];
|
|
1535
|
+
}
|
|
1536
|
+
SidebarUtil.memberGroups = memberGroups;
|
|
1537
|
+
function directories(agents, serverCwd) {
|
|
1538
|
+
return new Set(agents.map((agent) => agent.cwd ?? serverCwd)).size;
|
|
1539
|
+
}
|
|
1540
|
+
SidebarUtil.directories = directories;
|
|
1429
1541
|
function byDirectory(agents, serverCwd) {
|
|
1430
1542
|
const groups = new Map;
|
|
1431
1543
|
for (const agent of agents) {
|
|
@@ -1669,11 +1781,14 @@ function NewChannelDialog({ context, onClose }) {
|
|
|
1669
1781
|
onChange: (event) => setQuery(event.target.value)
|
|
1670
1782
|
})), /* @__PURE__ */ React.createElement("div", {
|
|
1671
1783
|
className: "tac-pick-list"
|
|
1672
|
-
}, team.agents.length === 0 && /* @__PURE__ */ React.createElement(
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
},
|
|
1784
|
+
}, team.agents.length === 0 && /* @__PURE__ */ React.createElement(pi.ui.Empty, {
|
|
1785
|
+
compact: true,
|
|
1786
|
+
title: w.noAgents,
|
|
1787
|
+
hint: w.noAgentsHint
|
|
1788
|
+
}), team.agents.length > 0 && shown.length === 0 && /* @__PURE__ */ React.createElement(pi.ui.Empty, {
|
|
1789
|
+
compact: true,
|
|
1790
|
+
title: w.noMatch
|
|
1791
|
+
}), shown.map((agent) => {
|
|
1677
1792
|
const on = picked.includes(agent.id);
|
|
1678
1793
|
return /* @__PURE__ */ React.createElement("button", {
|
|
1679
1794
|
key: agent.id,
|
|
@@ -1725,9 +1840,9 @@ function MembersView({ context }) {
|
|
|
1725
1840
|
if (!channel) {
|
|
1726
1841
|
return /* @__PURE__ */ React.createElement("div", {
|
|
1727
1842
|
className: "tac-view tac-members"
|
|
1728
|
-
}, /* @__PURE__ */ React.createElement(
|
|
1729
|
-
|
|
1730
|
-
}
|
|
1843
|
+
}, state.loaded && /* @__PURE__ */ React.createElement(pi.ui.Empty, {
|
|
1844
|
+
title: w.noChannel
|
|
1845
|
+
}));
|
|
1731
1846
|
}
|
|
1732
1847
|
return adding ? /* @__PURE__ */ React.createElement(MemberPicker, {
|
|
1733
1848
|
key: channel.id,
|
|
@@ -1826,11 +1941,23 @@ ${agent.role}`,
|
|
|
1826
1941
|
title: w.leadHint
|
|
1827
1942
|
}, /* @__PURE__ */ React.createElement(Crown, {
|
|
1828
1943
|
size: 11
|
|
1829
|
-
}), /* @__PURE__ */ React.createElement("span", null, w.lead))
|
|
1944
|
+
}), /* @__PURE__ */ React.createElement("span", null, w.lead)), agent.temporary && /* @__PURE__ */ React.createElement("span", {
|
|
1945
|
+
className: "tac-temporary",
|
|
1946
|
+
title: w.temporary
|
|
1947
|
+
}, w.temporaryTag)), /* @__PURE__ */ React.createElement("span", {
|
|
1830
1948
|
className: `tac-member-detail${answering ? " tac-live" : ""}`
|
|
1831
1949
|
}, detail))), /* @__PURE__ */ React.createElement("span", {
|
|
1832
1950
|
className: "tac-member-actions"
|
|
1833
|
-
},
|
|
1951
|
+
}, agent.temporary && /* @__PURE__ */ React.createElement("button", {
|
|
1952
|
+
type: "button",
|
|
1953
|
+
className: "tac-action",
|
|
1954
|
+
title: w.keep,
|
|
1955
|
+
"aria-label": w.keep,
|
|
1956
|
+
disabled: !!busy,
|
|
1957
|
+
onClick: () => service.updateAgent(agent.id, { keep: true }).then(() => pi.ui.notify(ChannelWords.format(w.kept, { name: agent.name }), "info")).catch((error) => pi.ui.notify(ChannelViews.message(error), "error"))
|
|
1958
|
+
}, /* @__PURE__ */ React.createElement(UserPlus, {
|
|
1959
|
+
size: 15
|
|
1960
|
+
})), !lead && /* @__PURE__ */ React.createElement("button", {
|
|
1834
1961
|
type: "button",
|
|
1835
1962
|
className: "tac-action",
|
|
1836
1963
|
title: w.makeLead,
|
|
@@ -1928,11 +2055,13 @@ function MemberPicker({ context, team, channel, faces }) {
|
|
|
1928
2055
|
className: "tac-members-scroll"
|
|
1929
2056
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
1930
2057
|
className: "tac-members-label"
|
|
1931
|
-
}, ChannelWords.format(w.canAdd, { count: String(others.length) })), others.length === 0 && /* @__PURE__ */ React.createElement(
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
2058
|
+
}, ChannelWords.format(w.canAdd, { count: String(others.length) })), others.length === 0 && /* @__PURE__ */ React.createElement(pi.ui.Empty, {
|
|
2059
|
+
compact: true,
|
|
2060
|
+
title: w.allMembers
|
|
2061
|
+
}), others.length > 0 && shown.length === 0 && /* @__PURE__ */ React.createElement(pi.ui.Empty, {
|
|
2062
|
+
compact: true,
|
|
2063
|
+
title: w.noMatch
|
|
2064
|
+
}), shown.map((agent) => {
|
|
1936
2065
|
const on = picked.includes(agent.id);
|
|
1937
2066
|
return /* @__PURE__ */ React.createElement("button", {
|
|
1938
2067
|
key: agent.id,
|
|
@@ -2049,10 +2178,41 @@ function ChannelHead({ context }) {
|
|
|
2049
2178
|
className: "tac-head-more"
|
|
2050
2179
|
}, "+", members.length - 5)));
|
|
2051
2180
|
}
|
|
2052
|
-
function
|
|
2181
|
+
function ChannelSceneHead({ context, channelId }) {
|
|
2182
|
+
const { pi, service } = context;
|
|
2183
|
+
const state = useChannels(service);
|
|
2184
|
+
const faces = useFaces(state.team);
|
|
2185
|
+
const w = ChannelViews.words(pi);
|
|
2186
|
+
const channel = state.team.channels.find((candidate) => candidate.id === channelId);
|
|
2187
|
+
if (!channel) {
|
|
2188
|
+
return null;
|
|
2189
|
+
}
|
|
2190
|
+
const members = membersOf(state.team, channel);
|
|
2191
|
+
const working = state.working[channel.id] ?? [];
|
|
2192
|
+
const External = ChannelViews.icon(pi, "ExternalLink");
|
|
2193
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
2194
|
+
className: "tac-scene-head"
|
|
2195
|
+
}, /* @__PURE__ */ React.createElement(RoomFace, {
|
|
2196
|
+
members,
|
|
2197
|
+
faces,
|
|
2198
|
+
size: 26,
|
|
2199
|
+
working
|
|
2200
|
+
}), /* @__PURE__ */ React.createElement("div", {
|
|
2201
|
+
className: "tac-scene-title"
|
|
2202
|
+
}, /* @__PURE__ */ React.createElement("strong", null, channel.name), /* @__PURE__ */ React.createElement("span", null, channel.topic ?? ChannelWords.format(w.memberCount, { count: String(members.length) }))), /* @__PURE__ */ React.createElement("button", {
|
|
2203
|
+
type: "button",
|
|
2204
|
+
className: "tac-button tac-scene-main",
|
|
2205
|
+
title: w.openInMainHint,
|
|
2206
|
+
onClick: () => context.showChannel(channel.id)
|
|
2207
|
+
}, /* @__PURE__ */ React.createElement(External, {
|
|
2208
|
+
size: 13
|
|
2209
|
+
}), w.openInMain));
|
|
2210
|
+
}
|
|
2211
|
+
function ChannelRoom({ context, channelId: fixed }) {
|
|
2053
2212
|
const { pi, service, ui } = context;
|
|
2054
2213
|
const state = useChannels(service);
|
|
2055
|
-
const
|
|
2214
|
+
const shown = useUi(ui).channelId;
|
|
2215
|
+
const channelId = fixed ?? shown;
|
|
2056
2216
|
const faces = useFaces(state.team);
|
|
2057
2217
|
const w = ChannelViews.words(pi);
|
|
2058
2218
|
const list = React.useRef(null);
|
|
@@ -2075,8 +2235,10 @@ function ChannelRoom({ context }) {
|
|
|
2075
2235
|
const Avatar = pi.ui.Avatar;
|
|
2076
2236
|
if (!channel) {
|
|
2077
2237
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2078
|
-
className: "tac-room-
|
|
2079
|
-
}, state.loaded
|
|
2238
|
+
className: "tac-room-page"
|
|
2239
|
+
}, state.loaded && /* @__PURE__ */ React.createElement(pi.ui.Empty, {
|
|
2240
|
+
title: w.pick
|
|
2241
|
+
}));
|
|
2080
2242
|
}
|
|
2081
2243
|
const members = membersOf(state.team, channel);
|
|
2082
2244
|
const agentOf = (id) => state.team.agents.find((agent) => agent.id === id);
|
|
@@ -2096,7 +2258,7 @@ function ChannelRoom({ context }) {
|
|
|
2096
2258
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2097
2259
|
className: "tac-room-page"
|
|
2098
2260
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
2099
|
-
className: "tac-chat",
|
|
2261
|
+
className: "tac-chat ta-conversation",
|
|
2100
2262
|
ref: list
|
|
2101
2263
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
2102
2264
|
className: "tac-chat-col"
|
|
@@ -2165,24 +2327,72 @@ function ChannelRoom({ context }) {
|
|
|
2165
2327
|
`)[0] })),
|
|
2166
2328
|
actions: [
|
|
2167
2329
|
members.map(mention),
|
|
2168
|
-
[
|
|
2330
|
+
[
|
|
2331
|
+
{
|
|
2332
|
+
key: "add",
|
|
2333
|
+
label: w.addMembers,
|
|
2334
|
+
icon: ChannelViews.maybeIcon(pi, "UserPlus", null, 16),
|
|
2335
|
+
run: () => {
|
|
2336
|
+
if (fixed) {
|
|
2337
|
+
ui.set({ channelId: fixed });
|
|
2338
|
+
}
|
|
2339
|
+
context.showMembers(true);
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
]
|
|
2169
2343
|
],
|
|
2170
2344
|
onSend: (text) => service.post(channel.id, text)
|
|
2171
2345
|
})));
|
|
2172
2346
|
}
|
|
2173
2347
|
|
|
2174
2348
|
// web-src/more-menu.tsx
|
|
2175
|
-
var
|
|
2349
|
+
var MARGIN = 8;
|
|
2350
|
+
var FINGER_GAP = 14;
|
|
2351
|
+
function safeArea() {
|
|
2352
|
+
const probe = document.createElement("div");
|
|
2353
|
+
probe.style.cssText = "position:fixed;visibility:hidden;pointer-events:none;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)";
|
|
2354
|
+
document.body.appendChild(probe);
|
|
2355
|
+
const style = getComputedStyle(probe);
|
|
2356
|
+
const area = { top: Number.parseFloat(style.paddingTop) || 0, bottom: Number.parseFloat(style.paddingBottom) || 0 };
|
|
2357
|
+
probe.remove();
|
|
2358
|
+
return area;
|
|
2359
|
+
}
|
|
2176
2360
|
function MoreMenu({ pi, label, items }) {
|
|
2177
2361
|
const w = ChannelViews.words(pi);
|
|
2178
2362
|
const [open, setOpen] = React.useState(false);
|
|
2179
|
-
const
|
|
2363
|
+
const anchor = React.useRef({ right: 0, below: 0, above: 0, finger: undefined });
|
|
2180
2364
|
const root = React.useRef(null);
|
|
2365
|
+
const menu = React.useRef(null);
|
|
2181
2366
|
const Ellipsis = ChannelViews.icon(pi, "Ellipsis");
|
|
2182
|
-
const show = React.useCallback((button) => {
|
|
2183
|
-
|
|
2367
|
+
const show = React.useCallback((button, at) => {
|
|
2368
|
+
const box = button.getBoundingClientRect();
|
|
2369
|
+
const touch = document.documentElement.hasAttribute("data-touch");
|
|
2370
|
+
anchor.current = { right: box.right, below: at?.y ?? box.bottom, above: at?.y ?? box.top, finger: touch ? at : undefined };
|
|
2184
2371
|
setOpen(true);
|
|
2185
2372
|
}, []);
|
|
2373
|
+
React.useLayoutEffect(() => {
|
|
2374
|
+
const element = menu.current;
|
|
2375
|
+
if (!open || !element) {
|
|
2376
|
+
return;
|
|
2377
|
+
}
|
|
2378
|
+
const { right, below, above, finger } = anchor.current;
|
|
2379
|
+
const width = element.offsetWidth;
|
|
2380
|
+
const height = element.offsetHeight;
|
|
2381
|
+
if (finger) {
|
|
2382
|
+
const safe = safeArea();
|
|
2383
|
+
const highest = safe.top + MARGIN;
|
|
2384
|
+
const lowest = window.innerHeight - safe.bottom - MARGIN - height;
|
|
2385
|
+
const over = finger.y - FINGER_GAP - height;
|
|
2386
|
+
const top2 = over >= highest ? over : Math.max(highest, Math.min(finger.y + FINGER_GAP, lowest));
|
|
2387
|
+
element.style.top = `${top2}px`;
|
|
2388
|
+
element.style.left = `${Math.max(MARGIN, Math.min(finger.x - width / 2, window.innerWidth - MARGIN - width))}px`;
|
|
2389
|
+
element.style.transformOrigin = top2 < finger.y ? "center bottom" : "center top";
|
|
2390
|
+
return;
|
|
2391
|
+
}
|
|
2392
|
+
const top = below + 4 + height <= window.innerHeight - MARGIN ? below + 4 : Math.max(MARGIN, above - 4 - height);
|
|
2393
|
+
element.style.top = `${top}px`;
|
|
2394
|
+
element.style.left = `${Math.max(MARGIN, right - width)}px`;
|
|
2395
|
+
}, [open]);
|
|
2186
2396
|
React.useEffect(() => {
|
|
2187
2397
|
const row = root.current?.parentElement;
|
|
2188
2398
|
const button = root.current?.querySelector(".tac-action");
|
|
@@ -2191,7 +2401,7 @@ function MoreMenu({ pi, label, items }) {
|
|
|
2191
2401
|
}
|
|
2192
2402
|
const onContextMenu = (event) => {
|
|
2193
2403
|
event.preventDefault();
|
|
2194
|
-
show(button);
|
|
2404
|
+
show(button, event.clientX || event.clientY ? { x: event.clientX, y: event.clientY } : undefined);
|
|
2195
2405
|
};
|
|
2196
2406
|
row.addEventListener("contextmenu", onContextMenu);
|
|
2197
2407
|
return () => row.removeEventListener("contextmenu", onContextMenu);
|
|
@@ -2238,10 +2448,11 @@ function MoreMenu({ pi, label, items }) {
|
|
|
2238
2448
|
}, /* @__PURE__ */ React.createElement(Ellipsis, {
|
|
2239
2449
|
size: 15
|
|
2240
2450
|
})), open && /* @__PURE__ */ React.createElement("div", {
|
|
2241
|
-
|
|
2451
|
+
ref: menu,
|
|
2452
|
+
className: "tac-menu tac-agent-menu",
|
|
2242
2453
|
role: "menu",
|
|
2243
2454
|
"aria-label": label
|
|
2244
|
-
}, items().map((section, index) => /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
2455
|
+
}, items().filter((section) => section.length > 0).map((section, index) => /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
2245
2456
|
key: section[0]?.key ?? index
|
|
2246
2457
|
}, index > 0 && /* @__PURE__ */ React.createElement("hr", {
|
|
2247
2458
|
className: "tac-menu-line"
|
|
@@ -2277,6 +2488,17 @@ function download(name, text) {
|
|
|
2277
2488
|
link.click();
|
|
2278
2489
|
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
2279
2490
|
}
|
|
2491
|
+
async function deleteAgent(context, agent) {
|
|
2492
|
+
const w = ChannelViews.words(context.pi);
|
|
2493
|
+
const sure = await context.pi.ui.confirm(ChannelWords.format(w.confirmDeleteAgent, { name: agent.name }), undefined, {
|
|
2494
|
+
confirmLabel: w.delete,
|
|
2495
|
+
danger: true
|
|
2496
|
+
});
|
|
2497
|
+
if (sure) {
|
|
2498
|
+
await context.service.deleteAgent(agent.id);
|
|
2499
|
+
context.sessions.delete(agent.id);
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2280
2502
|
function AgentMenu({ context, agent, cwd, working }) {
|
|
2281
2503
|
const { pi, service } = context;
|
|
2282
2504
|
const w = ChannelViews.words(pi);
|
|
@@ -2319,11 +2541,10 @@ function AgentMenu({ context, agent, cwd, working }) {
|
|
|
2319
2541
|
}
|
|
2320
2542
|
download(`${agent.name}.md`, ChannelsUtil.markdown(agent, messages, { user: w.you }));
|
|
2321
2543
|
});
|
|
2322
|
-
const remove = act(
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
}
|
|
2544
|
+
const remove = act(() => deleteAgent(context, agent));
|
|
2545
|
+
const keep = act(async () => {
|
|
2546
|
+
await service.updateAgent(agent.id, { keep: true });
|
|
2547
|
+
pi.ui.notify(ChannelWords.format(w.kept, { name: agent.name }), "info");
|
|
2327
2548
|
});
|
|
2328
2549
|
const show = (next) => () => setDialog(next);
|
|
2329
2550
|
const item = (key, label, glyph, run, options = {}) => ({
|
|
@@ -2337,6 +2558,7 @@ function AgentMenu({ context, agent, cwd, working }) {
|
|
|
2337
2558
|
pi,
|
|
2338
2559
|
label: agent.name,
|
|
2339
2560
|
items: () => [
|
|
2561
|
+
...agent.temporary ? [[item("keep", w.keep, "UserPlus", keep)]] : [],
|
|
2340
2562
|
[item("stop", w.stop, "Square", stop, { disabled: !working && !agent.sessionFile }), item("restart", w.restart, "RotateCcw", restart)],
|
|
2341
2563
|
[
|
|
2342
2564
|
item("rename", w.rename, "Pencil", show("rename")),
|
|
@@ -2464,9 +2686,10 @@ function JoinDialog({ context, agent, onClose }) {
|
|
|
2464
2686
|
className: "tac-dialog"
|
|
2465
2687
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
2466
2688
|
className: "tac-pick-list"
|
|
2467
|
-
}, open.length === 0 && /* @__PURE__ */ React.createElement(
|
|
2468
|
-
|
|
2469
|
-
|
|
2689
|
+
}, open.length === 0 && /* @__PURE__ */ React.createElement(pi.ui.Empty, {
|
|
2690
|
+
compact: true,
|
|
2691
|
+
title: w.noChannelToJoin
|
|
2692
|
+
}), open.map((channel) => /* @__PURE__ */ React.createElement("button", {
|
|
2470
2693
|
key: channel.id,
|
|
2471
2694
|
type: "button",
|
|
2472
2695
|
className: "tac-pick",
|
|
@@ -2485,6 +2708,207 @@ function JoinDialog({ context, agent, onClose }) {
|
|
|
2485
2708
|
}, error)));
|
|
2486
2709
|
}
|
|
2487
2710
|
|
|
2711
|
+
// web-src/tasks.tsx
|
|
2712
|
+
var BUILDING_MS = 60 * 1000;
|
|
2713
|
+
|
|
2714
|
+
class ChannelTaskSource {
|
|
2715
|
+
context;
|
|
2716
|
+
shown = new Map;
|
|
2717
|
+
list = [];
|
|
2718
|
+
listeners = new Set;
|
|
2719
|
+
reading = new Set;
|
|
2720
|
+
stop;
|
|
2721
|
+
constructor(context) {
|
|
2722
|
+
this.context = context;
|
|
2723
|
+
}
|
|
2724
|
+
tasks() {
|
|
2725
|
+
return this.list;
|
|
2726
|
+
}
|
|
2727
|
+
subscribe(listener) {
|
|
2728
|
+
if (this.listeners.size === 0) {
|
|
2729
|
+
this.stop = this.context.service.subscribe((state) => this.build(state));
|
|
2730
|
+
this.build(this.context.service.state);
|
|
2731
|
+
}
|
|
2732
|
+
this.listeners.add(listener);
|
|
2733
|
+
return () => {
|
|
2734
|
+
this.listeners.delete(listener);
|
|
2735
|
+
if (this.listeners.size === 0) {
|
|
2736
|
+
this.stop?.();
|
|
2737
|
+
this.stop = undefined;
|
|
2738
|
+
}
|
|
2739
|
+
};
|
|
2740
|
+
}
|
|
2741
|
+
refresh() {
|
|
2742
|
+
this.shown.clear();
|
|
2743
|
+
this.build(this.context.service.state);
|
|
2744
|
+
}
|
|
2745
|
+
build(state) {
|
|
2746
|
+
const { team } = state;
|
|
2747
|
+
const faces = ChannelsUtil.faces(team.agents);
|
|
2748
|
+
const next = new Map;
|
|
2749
|
+
const channels = ChannelsUtil.taskChannels(team);
|
|
2750
|
+
let changed = channels.length !== this.list.length;
|
|
2751
|
+
const list = channels.map((channel, index) => {
|
|
2752
|
+
const messages = state.messages[channel.id];
|
|
2753
|
+
if (!messages) {
|
|
2754
|
+
this.read(channel.id);
|
|
2755
|
+
}
|
|
2756
|
+
const members = membersOf(team, channel);
|
|
2757
|
+
const working = state.working[channel.id] ?? [];
|
|
2758
|
+
const { status, detail, endedAt } = this.status(state, channel, messages, working);
|
|
2759
|
+
const signature = members.map((agent) => `${agent.id}:${faces.get(agent.id)}:${working.includes(agent.id) ? 1 : 0}`).join(",");
|
|
2760
|
+
const before = this.shown.get(channel.id);
|
|
2761
|
+
const shown = before && before.channel === channel && before.faces === signature && before.status === status && before.detail === detail && before.endedAt === endedAt ? before : {
|
|
2762
|
+
channel,
|
|
2763
|
+
members,
|
|
2764
|
+
faces: signature,
|
|
2765
|
+
status,
|
|
2766
|
+
detail,
|
|
2767
|
+
endedAt,
|
|
2768
|
+
entry: this.entry(channel, members, faces, working, status, detail, endedAt)
|
|
2769
|
+
};
|
|
2770
|
+
next.set(channel.id, shown);
|
|
2771
|
+
changed ||= shown.entry !== this.list[index];
|
|
2772
|
+
return shown.entry;
|
|
2773
|
+
});
|
|
2774
|
+
this.shown = next;
|
|
2775
|
+
if (!changed) {
|
|
2776
|
+
return;
|
|
2777
|
+
}
|
|
2778
|
+
this.list = list;
|
|
2779
|
+
for (const listener of this.listeners) {
|
|
2780
|
+
listener();
|
|
2781
|
+
}
|
|
2782
|
+
}
|
|
2783
|
+
read(channelId) {
|
|
2784
|
+
if (!this.reading.has(channelId)) {
|
|
2785
|
+
this.reading.add(channelId);
|
|
2786
|
+
this.context.service.messages(channelId).catch(() => this.reading.delete(channelId));
|
|
2787
|
+
}
|
|
2788
|
+
}
|
|
2789
|
+
status(state, channel, messages, working) {
|
|
2790
|
+
const w = ChannelViews.words(this.context.pi);
|
|
2791
|
+
const name = (id) => ChannelsUtil.authorName(state.team, id, { user: w.you, ta: w.ta });
|
|
2792
|
+
if (working.length > 0) {
|
|
2793
|
+
return { status: "running", detail: ChannelWords.format(w.answeringNow, { name: working.map(name).join("、") }) };
|
|
2794
|
+
}
|
|
2795
|
+
const last = messages?.at(-1);
|
|
2796
|
+
if (!last) {
|
|
2797
|
+
const building = Date.now() - channel.createdAt < BUILDING_MS;
|
|
2798
|
+
return building ? { status: "running", detail: w.building } : { status: "done", detail: channel.topic ?? w.noMessages, endedAt: channel.createdAt };
|
|
2799
|
+
}
|
|
2800
|
+
if (last.author === SYSTEM) {
|
|
2801
|
+
return { status: "waiting", detail: w.yourTurn };
|
|
2802
|
+
}
|
|
2803
|
+
const said = `${name(last.author)}:${last.text.replace(/\s+/g, " ").slice(0, 120)}`;
|
|
2804
|
+
return { status: last.failed ? "failed" : "done", detail: said, endedAt: last.at };
|
|
2805
|
+
}
|
|
2806
|
+
entry(channel, members, faces, working, status, detail, endedAt) {
|
|
2807
|
+
return {
|
|
2808
|
+
id: channel.id,
|
|
2809
|
+
title: channel.topic ? `${channel.name} · ${channel.topic}` : channel.name,
|
|
2810
|
+
status,
|
|
2811
|
+
detail,
|
|
2812
|
+
startedAt: channel.createdAt,
|
|
2813
|
+
endedAt: status === "running" || status === "waiting" ? undefined : endedAt,
|
|
2814
|
+
origin: channel.origin,
|
|
2815
|
+
icon: ({ size }) => /* @__PURE__ */ React.createElement(RoomFace, {
|
|
2816
|
+
members,
|
|
2817
|
+
faces,
|
|
2818
|
+
size,
|
|
2819
|
+
working
|
|
2820
|
+
}),
|
|
2821
|
+
open: () => openScene(this.context, channel),
|
|
2822
|
+
menu: () => taskMenu(this.context, channel, working)
|
|
2823
|
+
};
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
function openScene(context, channel) {
|
|
2827
|
+
context.pi.ui.openEditor({
|
|
2828
|
+
id: `channel:${channel.id}`,
|
|
2829
|
+
title: channel.name,
|
|
2830
|
+
icon: ChannelViews.icon(context.pi, "Hash"),
|
|
2831
|
+
render: () => /* @__PURE__ */ React.createElement("div", {
|
|
2832
|
+
className: "tac-scene"
|
|
2833
|
+
}, /* @__PURE__ */ React.createElement(ChannelSceneHead, {
|
|
2834
|
+
context,
|
|
2835
|
+
channelId: channel.id
|
|
2836
|
+
}), /* @__PURE__ */ React.createElement(ChannelRoom, {
|
|
2837
|
+
context,
|
|
2838
|
+
channelId: channel.id
|
|
2839
|
+
}))
|
|
2840
|
+
});
|
|
2841
|
+
}
|
|
2842
|
+
function taskMenu(context, channel, working) {
|
|
2843
|
+
const { pi, service } = context;
|
|
2844
|
+
const w = ChannelViews.words(pi);
|
|
2845
|
+
const icon = (name) => ChannelViews.icon(pi, name);
|
|
2846
|
+
const act = (action) => () => {
|
|
2847
|
+
Promise.resolve().then(action).catch((error) => pi.ui.notify(ChannelViews.message(error), "error"));
|
|
2848
|
+
};
|
|
2849
|
+
const temporary = membersOf(service.state.team, channel).filter((agent) => agent.temporary);
|
|
2850
|
+
return [
|
|
2851
|
+
working.length > 0 ? [
|
|
2852
|
+
{
|
|
2853
|
+
key: "stop",
|
|
2854
|
+
label: w.stopAnswering,
|
|
2855
|
+
icon: icon("Square"),
|
|
2856
|
+
run: act(async () => {
|
|
2857
|
+
await TeamActions.stop(context, working);
|
|
2858
|
+
pi.ui.notify(ChannelWords.format(w.stoppedChannel, { channel: channel.name }), "info");
|
|
2859
|
+
})
|
|
2860
|
+
}
|
|
2861
|
+
] : [],
|
|
2862
|
+
[
|
|
2863
|
+
{ key: "main", label: w.openInMain, icon: icon("ExternalLink"), run: () => context.showChannel(channel.id) },
|
|
2864
|
+
...temporary.length > 0 ? [
|
|
2865
|
+
{
|
|
2866
|
+
key: "keep",
|
|
2867
|
+
label: w.keepMembers,
|
|
2868
|
+
icon: icon("UserPlus"),
|
|
2869
|
+
run: act(async () => {
|
|
2870
|
+
await TeamActions.keep(context, temporary);
|
|
2871
|
+
pi.ui.notify(ChannelWords.format(w.keptMembers, { names: temporary.map((agent) => `@${agent.name}`).join("、") }), "info");
|
|
2872
|
+
})
|
|
2873
|
+
}
|
|
2874
|
+
] : []
|
|
2875
|
+
],
|
|
2876
|
+
[
|
|
2877
|
+
{
|
|
2878
|
+
key: "delete",
|
|
2879
|
+
label: w.deleteTask,
|
|
2880
|
+
icon: icon("Trash2"),
|
|
2881
|
+
danger: true,
|
|
2882
|
+
run: act(async () => {
|
|
2883
|
+
if (await pi.ui.confirm(w.deleteTask, ChannelWords.format(w.confirmDeleteTask, { channel: channel.name }), {
|
|
2884
|
+
danger: true,
|
|
2885
|
+
confirmLabel: w.delete
|
|
2886
|
+
})) {
|
|
2887
|
+
await service.deleteChannel(channel.id);
|
|
2888
|
+
pi.ui.closeEditor(`channel:${channel.id}`);
|
|
2889
|
+
}
|
|
2890
|
+
})
|
|
2891
|
+
}
|
|
2892
|
+
]
|
|
2893
|
+
];
|
|
2894
|
+
}
|
|
2895
|
+
var TeamActions;
|
|
2896
|
+
((TeamActions) => {
|
|
2897
|
+
async function stop(context, agentIds) {
|
|
2898
|
+
const { pi, service } = context;
|
|
2899
|
+
const files = new Set(service.state.team.agents.filter((agent) => agentIds.includes(agent.id) && agent.sessionFile).map((agent) => agent.sessionFile));
|
|
2900
|
+
const sessions = (await pi.server.listSessions()).filter((session) => session.sessionFile && files.has(session.sessionFile));
|
|
2901
|
+
await Promise.all(sessions.map((session) => pi.server.abort(session.sessionId)));
|
|
2902
|
+
}
|
|
2903
|
+
TeamActions.stop = stop;
|
|
2904
|
+
async function keep(context, agents) {
|
|
2905
|
+
for (const agent of agents) {
|
|
2906
|
+
await context.service.updateAgent(agent.id, { keep: true });
|
|
2907
|
+
}
|
|
2908
|
+
}
|
|
2909
|
+
TeamActions.keep = keep;
|
|
2910
|
+
})(TeamActions ||= {});
|
|
2911
|
+
|
|
2488
2912
|
// web-src/channel-menu.tsx
|
|
2489
2913
|
function download2(name, text) {
|
|
2490
2914
|
const url = URL.createObjectURL(new Blob([text], { type: "text/markdown;charset=utf-8" }));
|
|
@@ -2494,6 +2918,16 @@ function download2(name, text) {
|
|
|
2494
2918
|
link.click();
|
|
2495
2919
|
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
2496
2920
|
}
|
|
2921
|
+
async function deleteChannel(context, channel) {
|
|
2922
|
+
const w = ChannelViews.words(context.pi);
|
|
2923
|
+
const sure = await context.pi.ui.confirm(ChannelWords.format(w.confirmDelete, { channel: channel.name }), undefined, {
|
|
2924
|
+
confirmLabel: w.delete,
|
|
2925
|
+
danger: true
|
|
2926
|
+
});
|
|
2927
|
+
if (sure) {
|
|
2928
|
+
await context.service.deleteChannel(channel.id);
|
|
2929
|
+
}
|
|
2930
|
+
}
|
|
2497
2931
|
function ChannelMenu({ context, channel, working }) {
|
|
2498
2932
|
const { pi, service, ui } = context;
|
|
2499
2933
|
const { fresh } = useUi(ui);
|
|
@@ -2522,9 +2956,7 @@ function ChannelMenu({ context, channel, working }) {
|
|
|
2522
2956
|
context.showMembers();
|
|
2523
2957
|
});
|
|
2524
2958
|
const stop = act(async () => {
|
|
2525
|
-
|
|
2526
|
-
const sessions = (await pi.server.listSessions()).filter((session) => session.sessionFile && files.has(session.sessionFile));
|
|
2527
|
-
await Promise.all(sessions.map((session) => pi.server.abort(session.sessionId)));
|
|
2959
|
+
await TeamActions.stop(context, working);
|
|
2528
2960
|
pi.ui.notify(ChannelWords.format(w.stoppedChannel, { channel: channel.name }), "info");
|
|
2529
2961
|
});
|
|
2530
2962
|
const exportMarkdown = act(async () => {
|
|
@@ -2535,15 +2967,7 @@ function ChannelMenu({ context, channel, working }) {
|
|
|
2535
2967
|
}
|
|
2536
2968
|
download2(`${channel.name}.md`, ChannelsUtil.channelMarkdown(service.state.team, channel, messages, { user: w.you, ta: w.ta }));
|
|
2537
2969
|
});
|
|
2538
|
-
const remove = act(
|
|
2539
|
-
const sure = await pi.ui.confirm(ChannelWords.format(w.confirmDelete, { channel: channel.name }), undefined, {
|
|
2540
|
-
confirmLabel: w.delete,
|
|
2541
|
-
danger: true
|
|
2542
|
-
});
|
|
2543
|
-
if (sure) {
|
|
2544
|
-
await service.deleteChannel(channel.id);
|
|
2545
|
-
}
|
|
2546
|
-
});
|
|
2970
|
+
const remove = act(() => deleteChannel(context, channel));
|
|
2547
2971
|
const item = (key, label, glyph, run, options = {}) => ({
|
|
2548
2972
|
key,
|
|
2549
2973
|
label,
|
|
@@ -2567,7 +2991,7 @@ function ChannelMenu({ context, channel, working }) {
|
|
|
2567
2991
|
}
|
|
2568
2992
|
|
|
2569
2993
|
// web-src/sidebar.tsx
|
|
2570
|
-
function Row({ avatar, title, badge, preview, live, time, fresh, hint, selected, onSelect, more }) {
|
|
2994
|
+
function Row({ pi, avatar, title, badge, preview, live, dot, waiting, time, fresh, hint, selected, onSelect, more, swipe }) {
|
|
2571
2995
|
const row = /* @__PURE__ */ React.createElement("button", {
|
|
2572
2996
|
type: "button",
|
|
2573
2997
|
className: `tac-item${selected ? " tac-selected" : ""}`,
|
|
@@ -2584,15 +3008,29 @@ function Row({ avatar, title, badge, preview, live, time, fresh, hint, selected,
|
|
|
2584
3008
|
className: "tac-item-time"
|
|
2585
3009
|
}, time)), /* @__PURE__ */ React.createElement("span", {
|
|
2586
3010
|
className: "tac-item-bottom"
|
|
2587
|
-
}, /* @__PURE__ */ React.createElement("span", {
|
|
2588
|
-
className: `
|
|
3011
|
+
}, dot && /* @__PURE__ */ React.createElement("span", {
|
|
3012
|
+
className: `ta-status ta-status-${dot}`
|
|
3013
|
+
}), /* @__PURE__ */ React.createElement("span", {
|
|
3014
|
+
className: `tac-item-preview${live ? " tac-live" : ""}${waiting ? " tac-waiting" : ""}`
|
|
2589
3015
|
}, preview), fresh && /* @__PURE__ */ React.createElement("span", {
|
|
2590
3016
|
className: "tac-fresh"
|
|
2591
3017
|
}))));
|
|
3018
|
+
const SwipeRow = pi.ui.SwipeRow;
|
|
3019
|
+
const className = `tac-item-row${selected ? " tac-selected" : ""}`;
|
|
3020
|
+
if (SwipeRow && (more || swipe)) {
|
|
3021
|
+
return /* @__PURE__ */ React.createElement(SwipeRow, {
|
|
3022
|
+
className,
|
|
3023
|
+
actions: swipe
|
|
3024
|
+
}, row, more);
|
|
3025
|
+
}
|
|
2592
3026
|
return more ? /* @__PURE__ */ React.createElement("div", {
|
|
2593
|
-
className
|
|
3027
|
+
className
|
|
2594
3028
|
}, row, more) : row;
|
|
2595
3029
|
}
|
|
3030
|
+
function swipeDelete(pi, remove) {
|
|
3031
|
+
const w = ChannelViews.words(pi);
|
|
3032
|
+
return [{ key: "delete", label: w.delete, danger: true, run: () => void remove().catch((error) => pi.ui.notify(ChannelViews.message(error), "error")) }];
|
|
3033
|
+
}
|
|
2596
3034
|
function SidebarHead({ context }) {
|
|
2597
3035
|
const { pi, ui } = context;
|
|
2598
3036
|
const { query, creating } = useUi(ui);
|
|
@@ -2676,6 +3114,160 @@ function SidebarHead({ context }) {
|
|
|
2676
3114
|
onClose: () => ui.set({ creating: false })
|
|
2677
3115
|
}));
|
|
2678
3116
|
}
|
|
3117
|
+
var FOLDED_KEY = "ta-channels.folded";
|
|
3118
|
+
var BY_DIRECTORY_KEY = "ui.membersByDirectory";
|
|
3119
|
+
var ENDED_SHOWN = 5;
|
|
3120
|
+
function useFolded() {
|
|
3121
|
+
const [folded, setFolded] = React.useState(() => {
|
|
3122
|
+
try {
|
|
3123
|
+
const kept = JSON.parse(localStorage.getItem(FOLDED_KEY) ?? "[]");
|
|
3124
|
+
return new Set(Array.isArray(kept) ? kept.filter((id) => typeof id === "string") : []);
|
|
3125
|
+
} catch {
|
|
3126
|
+
return new Set;
|
|
3127
|
+
}
|
|
3128
|
+
});
|
|
3129
|
+
const toggle = (id) => setFolded((before) => {
|
|
3130
|
+
const next = new Set(before);
|
|
3131
|
+
if (!next.delete(id)) {
|
|
3132
|
+
next.add(id);
|
|
3133
|
+
}
|
|
3134
|
+
try {
|
|
3135
|
+
localStorage.setItem(FOLDED_KEY, JSON.stringify([...next]));
|
|
3136
|
+
} catch {}
|
|
3137
|
+
return next;
|
|
3138
|
+
});
|
|
3139
|
+
return [folded, toggle];
|
|
3140
|
+
}
|
|
3141
|
+
function useStored(storage, key, initial) {
|
|
3142
|
+
const [value, setValue] = React.useState(initial);
|
|
3143
|
+
React.useEffect(() => {
|
|
3144
|
+
let live = true;
|
|
3145
|
+
const read = () => storage.get(key).then((kept) => live && kept !== undefined && kept !== null && setValue(kept), () => {
|
|
3146
|
+
return;
|
|
3147
|
+
});
|
|
3148
|
+
read();
|
|
3149
|
+
const stop = storage.onChange((keys) => keys.includes(key) && void read());
|
|
3150
|
+
return () => {
|
|
3151
|
+
live = false;
|
|
3152
|
+
stop();
|
|
3153
|
+
};
|
|
3154
|
+
}, [storage, key]);
|
|
3155
|
+
const set = (next) => {
|
|
3156
|
+
setValue(next);
|
|
3157
|
+
storage.set(key, next).catch(() => {
|
|
3158
|
+
return;
|
|
3159
|
+
});
|
|
3160
|
+
};
|
|
3161
|
+
return [value, set];
|
|
3162
|
+
}
|
|
3163
|
+
function Section({
|
|
3164
|
+
id,
|
|
3165
|
+
title,
|
|
3166
|
+
count,
|
|
3167
|
+
folded,
|
|
3168
|
+
onFold,
|
|
3169
|
+
action,
|
|
3170
|
+
children
|
|
3171
|
+
}) {
|
|
3172
|
+
const closed = folded.has(id);
|
|
3173
|
+
return /* @__PURE__ */ React.createElement("section", {
|
|
3174
|
+
className: `tac-section${closed ? " tac-closed" : ""}`
|
|
3175
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
3176
|
+
className: "tac-section-head-row"
|
|
3177
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
3178
|
+
type: "button",
|
|
3179
|
+
className: "tac-section-head",
|
|
3180
|
+
"aria-expanded": !closed,
|
|
3181
|
+
onClick: () => onFold(id)
|
|
3182
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
3183
|
+
className: "tac-section-chevron",
|
|
3184
|
+
"aria-hidden": "true"
|
|
3185
|
+
}), /* @__PURE__ */ React.createElement("span", {
|
|
3186
|
+
className: "tac-section-title"
|
|
3187
|
+
}, title), /* @__PURE__ */ React.createElement("span", {
|
|
3188
|
+
className: "tac-section-count"
|
|
3189
|
+
}, count)), !closed && action), !closed && /* @__PURE__ */ React.createElement("div", {
|
|
3190
|
+
className: "tac-section-body"
|
|
3191
|
+
}, children));
|
|
3192
|
+
}
|
|
3193
|
+
var DOTS = { running: "running", waiting: "waiting", done: "done", failed: "error", stopped: "cancelled" };
|
|
3194
|
+
function TaskItem({ context, task }) {
|
|
3195
|
+
const { pi } = context;
|
|
3196
|
+
const Own = task.icon;
|
|
3197
|
+
const ListTodo = pi.ui.icons.ListTodo ?? ChannelViews.icon(pi, "List");
|
|
3198
|
+
const items = () => (task.menu?.() ?? []).map((section) => section.map(({ icon: Icon, ...item }) => ({ ...item, icon: Icon && /* @__PURE__ */ React.createElement(Icon, {
|
|
3199
|
+
size: 15
|
|
3200
|
+
}) })));
|
|
3201
|
+
return /* @__PURE__ */ React.createElement(Row, {
|
|
3202
|
+
pi,
|
|
3203
|
+
avatar: Own ? /* @__PURE__ */ React.createElement("span", {
|
|
3204
|
+
className: "tac-task-face"
|
|
3205
|
+
}, /* @__PURE__ */ React.createElement(Own, {
|
|
3206
|
+
size: 36
|
|
3207
|
+
})) : /* @__PURE__ */ React.createElement("span", {
|
|
3208
|
+
className: "tac-task-face tac-task-glyph"
|
|
3209
|
+
}, /* @__PURE__ */ React.createElement(ListTodo, {
|
|
3210
|
+
size: 17
|
|
3211
|
+
})),
|
|
3212
|
+
title: task.title,
|
|
3213
|
+
dot: DOTS[task.status],
|
|
3214
|
+
preview: task.detail ?? "",
|
|
3215
|
+
waiting: task.status === "waiting",
|
|
3216
|
+
time: SidebarUtil.time(task.endedAt ?? task.startedAt, pi.ui.language),
|
|
3217
|
+
hint: task.title,
|
|
3218
|
+
selected: false,
|
|
3219
|
+
onSelect: () => task.open(),
|
|
3220
|
+
more: task.menu && /* @__PURE__ */ React.createElement(MoreMenu, {
|
|
3221
|
+
pi,
|
|
3222
|
+
label: task.title,
|
|
3223
|
+
items
|
|
3224
|
+
})
|
|
3225
|
+
});
|
|
3226
|
+
}
|
|
3227
|
+
function TeamPicture({ pi }) {
|
|
3228
|
+
const Picture = pi.ui.Picture;
|
|
3229
|
+
const rows = [
|
|
3230
|
+
["ta-pic-mark", 70, "ta-pic-accent"],
|
|
3231
|
+
["ta-pic-plus", 52, "ta-pic-pane"],
|
|
3232
|
+
["ta-pic-dot", 84, "ta-pic-pane"]
|
|
3233
|
+
];
|
|
3234
|
+
return /* @__PURE__ */ React.createElement(Picture, null, /* @__PURE__ */ React.createElement("rect", {
|
|
3235
|
+
className: "ta-pic-pane",
|
|
3236
|
+
x: "1",
|
|
3237
|
+
y: "1",
|
|
3238
|
+
width: "158",
|
|
3239
|
+
height: "17",
|
|
3240
|
+
rx: "9"
|
|
3241
|
+
}), /* @__PURE__ */ React.createElement("text", {
|
|
3242
|
+
className: "ta-pic-text",
|
|
3243
|
+
x: "11",
|
|
3244
|
+
y: "12.5"
|
|
3245
|
+
}, "# team"), rows.map(([face, width, bubble], index) => {
|
|
3246
|
+
const y = 26 + index * 22;
|
|
3247
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
3248
|
+
key: y
|
|
3249
|
+
}, /* @__PURE__ */ React.createElement("circle", {
|
|
3250
|
+
className: face,
|
|
3251
|
+
cx: "20",
|
|
3252
|
+
cy: y + 7,
|
|
3253
|
+
r: "6.5"
|
|
3254
|
+
}), /* @__PURE__ */ React.createElement("rect", {
|
|
3255
|
+
className: bubble,
|
|
3256
|
+
x: "33",
|
|
3257
|
+
y,
|
|
3258
|
+
width,
|
|
3259
|
+
height: "14",
|
|
3260
|
+
rx: "7"
|
|
3261
|
+
}), /* @__PURE__ */ React.createElement("rect", {
|
|
3262
|
+
className: index === 0 ? "ta-pic-mark ta-pic-soft" : "ta-pic-line",
|
|
3263
|
+
x: "40",
|
|
3264
|
+
y: y + 4.5,
|
|
3265
|
+
width: width - 22,
|
|
3266
|
+
height: "5",
|
|
3267
|
+
rx: "2.5"
|
|
3268
|
+
}));
|
|
3269
|
+
}));
|
|
3270
|
+
}
|
|
2679
3271
|
function AgentsSidebar({ context }) {
|
|
2680
3272
|
const { pi, service, ui } = context;
|
|
2681
3273
|
const state = useChannels(service);
|
|
@@ -2687,18 +3279,29 @@ function AgentsSidebar({ context }) {
|
|
|
2687
3279
|
const double = pi.ui.useView(DOUBLE_PAGE);
|
|
2688
3280
|
const channelPage = pi.ui.useView(CHANNEL_PAGE);
|
|
2689
3281
|
const agentPage = pi.ui.useView(AGENT_PAGE);
|
|
3282
|
+
const tasks = pi.ui.useTasks();
|
|
3283
|
+
const [folded, fold] = useFolded();
|
|
3284
|
+
const [byDirectory, setByDirectory] = useStored(pi.storage, BY_DIRECTORY_KEY, false);
|
|
3285
|
+
const language = pi.ui.language;
|
|
3286
|
+
React.useEffect(() => context.refreshTasks?.(language), [context, language]);
|
|
3287
|
+
const [allEnded, setAllEnded] = React.useState(false);
|
|
2690
3288
|
const [opening, setOpening] = React.useState();
|
|
2691
3289
|
const Folder = ChannelViews.icon(pi, "Folder");
|
|
2692
|
-
const
|
|
3290
|
+
const FolderTree = pi.ui.icons.FolderTree ?? Folder;
|
|
3291
|
+
const HostTag = pi.ui.HostTag;
|
|
3292
|
+
const ListTodo = pi.ui.icons.ListTodo ?? ChannelViews.icon(pi, "List");
|
|
2693
3293
|
const Avatar = pi.ui.Avatar;
|
|
3294
|
+
const Empty = pi.ui.Empty;
|
|
3295
|
+
const Skeleton = pi.ui.Skeleton;
|
|
2694
3296
|
const { team, working } = state;
|
|
3297
|
+
const own = React.useMemo(() => ChannelsUtil.ownChannels(team), [team]);
|
|
2695
3298
|
React.useEffect(() => {
|
|
2696
|
-
for (const channel of
|
|
3299
|
+
for (const channel of own) {
|
|
2697
3300
|
service.messages(channel.id).catch(() => {
|
|
2698
3301
|
return;
|
|
2699
3302
|
});
|
|
2700
3303
|
}
|
|
2701
|
-
}, [service,
|
|
3304
|
+
}, [service, own]);
|
|
2702
3305
|
const name = (id) => ChannelsUtil.authorName(team, id, { user: w.you, ta: w.ta });
|
|
2703
3306
|
const lastSaid = new Map;
|
|
2704
3307
|
for (const messages of Object.values(state.messages)) {
|
|
@@ -2706,8 +3309,12 @@ function AgentsSidebar({ context }) {
|
|
|
2706
3309
|
lastSaid.set(message.author, Math.max(lastSaid.get(message.author) ?? 0, message.at));
|
|
2707
3310
|
}
|
|
2708
3311
|
}
|
|
2709
|
-
const
|
|
2710
|
-
const
|
|
3312
|
+
const shownTasks = tasks.filter((task) => SidebarUtil.matches(query, task.title, task.detail));
|
|
3313
|
+
const groups = SidebarUtil.taskGroups(shownTasks);
|
|
3314
|
+
const channels = ChannelsUtil.pinnedFirst(own).filter((channel) => SidebarUtil.matches(query, channel.name, channel.topic, ...membersOf(team, channel).map((agent) => agent.name)));
|
|
3315
|
+
const agents = ChannelsUtil.standing(team).filter((agent) => SidebarUtil.matches(query, agent.name, agent.role));
|
|
3316
|
+
const directories = SidebarUtil.directories(agents, serverCwd);
|
|
3317
|
+
const memberGroups = SidebarUtil.memberGroups(agents, serverCwd, byDirectory && !query.trim());
|
|
2711
3318
|
const pageShown = !!double?.shown || !!channelPage?.shown || !!agentPage?.shown;
|
|
2712
3319
|
const openAgent = (agent) => {
|
|
2713
3320
|
setOpening(agent.id);
|
|
@@ -2717,6 +3324,15 @@ function AgentsSidebar({ context }) {
|
|
|
2717
3324
|
const sessionId = context.sessions.get(agent.id);
|
|
2718
3325
|
return opening === agent.id || !pageShown && !!sessionId && sessionId === shownSession;
|
|
2719
3326
|
};
|
|
3327
|
+
const ended = allEnded ? groups.ended : groups.ended.slice(0, ENDED_SHOWN);
|
|
3328
|
+
const nothing = query && shownTasks.length === 0 && channels.length === 0 && agents.length === 0;
|
|
3329
|
+
const blank = state.loaded && !query && !draft && tasks.length === 0 && own.length === 0 && ChannelsUtil.standing(team).length === 0;
|
|
3330
|
+
const running = tasks.filter((task) => task.status === "running").length;
|
|
3331
|
+
const waiting = tasks.filter((task) => task.status === "waiting").length;
|
|
3332
|
+
const doubleLine = [
|
|
3333
|
+
waiting > 0 ? ChannelWords.format(w.waitingCount, { count: String(waiting) }) : "",
|
|
3334
|
+
running > 0 ? ChannelWords.format(w.runningCount, { count: String(running) }) : ""
|
|
3335
|
+
].filter(Boolean).join(" · ");
|
|
2720
3336
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2721
3337
|
className: "tac-view"
|
|
2722
3338
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
@@ -2728,17 +3344,26 @@ function AgentsSidebar({ context }) {
|
|
|
2728
3344
|
className: `tac-double${double.shown ? " tac-selected" : ""}`,
|
|
2729
3345
|
"aria-current": double.shown || undefined,
|
|
2730
3346
|
onClick: () => pi.ui.showView(DOUBLE_PAGE)
|
|
3347
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
3348
|
+
className: "tac-double-face"
|
|
2731
3349
|
}, /* @__PURE__ */ React.createElement(Avatar, {
|
|
2732
3350
|
size: 44
|
|
2733
|
-
}), /* @__PURE__ */ React.createElement("span", {
|
|
3351
|
+
})), /* @__PURE__ */ React.createElement("span", {
|
|
3352
|
+
className: "tac-double-text"
|
|
3353
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
2734
3354
|
className: "tac-double-name"
|
|
2735
|
-
}, double.title)
|
|
3355
|
+
}, double.title), /* @__PURE__ */ React.createElement("span", {
|
|
3356
|
+
className: `tac-double-line${waiting > 0 ? " tac-waiting" : ""}`
|
|
3357
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
3358
|
+
className: `ta-status ${waiting > 0 ? "ta-status-waiting" : running > 0 ? "ta-status-running" : "tac-ready"}`
|
|
3359
|
+
}), /* @__PURE__ */ React.createElement("span", null, doubleLine || w.standingBy)))), double.menu && /* @__PURE__ */ React.createElement(MoreMenu, {
|
|
2736
3360
|
pi,
|
|
2737
3361
|
label: double.title,
|
|
2738
3362
|
items: () => (double.menu?.() ?? []).map((section) => section.map(({ icon: Icon, ...item }) => ({ ...item, icon: Icon && /* @__PURE__ */ React.createElement(Icon, {
|
|
2739
3363
|
size: 15
|
|
2740
3364
|
}) })))
|
|
2741
3365
|
})), draft && /* @__PURE__ */ React.createElement(Row, {
|
|
3366
|
+
pi,
|
|
2742
3367
|
avatar: /* @__PURE__ */ React.createElement(Face, {
|
|
2743
3368
|
face: draft.face,
|
|
2744
3369
|
size: 36
|
|
@@ -2748,18 +3373,142 @@ function AgentsSidebar({ context }) {
|
|
|
2748
3373
|
time: "",
|
|
2749
3374
|
selected: !!agentPage?.shown,
|
|
2750
3375
|
onSelect: () => pi.ui.showView(AGENT_PAGE)
|
|
2751
|
-
}), state.loaded &&
|
|
2752
|
-
|
|
2753
|
-
}
|
|
2754
|
-
|
|
2755
|
-
}
|
|
2756
|
-
|
|
2757
|
-
|
|
3376
|
+
}), !state.loaded && !query && Skeleton && /* @__PURE__ */ React.createElement(Skeleton, {
|
|
3377
|
+
rows: 4
|
|
3378
|
+
}), nothing && /* @__PURE__ */ React.createElement(Empty, {
|
|
3379
|
+
title: w.noMatch
|
|
3380
|
+
}), blank && /* @__PURE__ */ React.createElement(Empty, {
|
|
3381
|
+
picture: /* @__PURE__ */ React.createElement(TeamPicture, {
|
|
3382
|
+
pi
|
|
3383
|
+
}),
|
|
3384
|
+
title: w.noTasksYet,
|
|
3385
|
+
hint: w.noTasksYetHint
|
|
3386
|
+
}, double && /* @__PURE__ */ React.createElement("button", {
|
|
3387
|
+
type: "button",
|
|
3388
|
+
className: "tac-button tac-team-up",
|
|
3389
|
+
onClick: () => pi.ui.showView(DOUBLE_PAGE)
|
|
3390
|
+
}, w.tellDouble)), state.loaded && !blank && !query && tasks.length === 0 && /* @__PURE__ */ React.createElement(Section, {
|
|
3391
|
+
id: "tasks",
|
|
3392
|
+
title: w.tasks,
|
|
3393
|
+
count: 0,
|
|
3394
|
+
folded,
|
|
3395
|
+
onFold: fold
|
|
3396
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
3397
|
+
type: "button",
|
|
3398
|
+
className: "tac-tasks-empty",
|
|
3399
|
+
onClick: () => pi.ui.showView(DOUBLE_PAGE)
|
|
3400
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
3401
|
+
className: "tac-task-face tac-task-glyph"
|
|
3402
|
+
}, /* @__PURE__ */ React.createElement(ListTodo, {
|
|
3403
|
+
size: 17
|
|
3404
|
+
})), /* @__PURE__ */ React.createElement("span", {
|
|
3405
|
+
className: "tac-item-text"
|
|
3406
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
3407
|
+
className: "tac-item-title"
|
|
3408
|
+
}, w.noTasksYet), /* @__PURE__ */ React.createElement("span", {
|
|
3409
|
+
className: "tac-item-preview"
|
|
3410
|
+
}, w.noTasksHere)))), groups.waiting.length > 0 && /* @__PURE__ */ React.createElement(Section, {
|
|
3411
|
+
id: "waiting",
|
|
3412
|
+
title: w.waitingSection,
|
|
3413
|
+
count: groups.waiting.length,
|
|
3414
|
+
folded,
|
|
3415
|
+
onFold: fold
|
|
3416
|
+
}, groups.waiting.map((task) => /* @__PURE__ */ React.createElement(TaskItem, {
|
|
3417
|
+
key: task.key,
|
|
3418
|
+
context,
|
|
3419
|
+
task
|
|
3420
|
+
}))), groups.running.length > 0 && /* @__PURE__ */ React.createElement(Section, {
|
|
3421
|
+
id: "running",
|
|
3422
|
+
title: w.runningSection,
|
|
3423
|
+
count: groups.running.length,
|
|
3424
|
+
folded,
|
|
3425
|
+
onFold: fold
|
|
3426
|
+
}, groups.running.map((task) => /* @__PURE__ */ React.createElement(TaskItem, {
|
|
3427
|
+
key: task.key,
|
|
3428
|
+
context,
|
|
3429
|
+
task
|
|
3430
|
+
}))), groups.ended.length > 0 && /* @__PURE__ */ React.createElement(Section, {
|
|
3431
|
+
id: "ended",
|
|
3432
|
+
title: w.endedSection,
|
|
3433
|
+
count: groups.ended.length,
|
|
3434
|
+
folded,
|
|
3435
|
+
onFold: fold
|
|
3436
|
+
}, ended.map((task) => /* @__PURE__ */ React.createElement(TaskItem, {
|
|
3437
|
+
key: task.key,
|
|
3438
|
+
context,
|
|
3439
|
+
task
|
|
3440
|
+
})), groups.ended.length > ENDED_SHOWN && /* @__PURE__ */ React.createElement("button", {
|
|
3441
|
+
type: "button",
|
|
3442
|
+
className: "tac-show-all",
|
|
3443
|
+
onClick: () => setAllEnded(!allEnded)
|
|
3444
|
+
}, allEnded ? w.showFewer : ChannelWords.format(w.showAll, { count: String(groups.ended.length) }))), agents.length > 0 && /* @__PURE__ */ React.createElement(Section, {
|
|
3445
|
+
id: "members",
|
|
3446
|
+
title: w.membersSection,
|
|
3447
|
+
count: agents.length,
|
|
3448
|
+
folded,
|
|
3449
|
+
onFold: fold,
|
|
3450
|
+
action: directories > 1 && /* @__PURE__ */ React.createElement("button", {
|
|
3451
|
+
type: "button",
|
|
3452
|
+
className: "tac-section-action",
|
|
3453
|
+
title: w.byDirectory,
|
|
3454
|
+
"aria-label": w.byDirectory,
|
|
3455
|
+
"aria-pressed": byDirectory,
|
|
3456
|
+
onClick: () => setByDirectory(!byDirectory)
|
|
3457
|
+
}, /* @__PURE__ */ React.createElement(FolderTree, {
|
|
3458
|
+
size: 14
|
|
3459
|
+
}))
|
|
3460
|
+
}, memberGroups.map((group) => /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
3461
|
+
key: group.cwd ?? ""
|
|
3462
|
+
}, group.cwd !== undefined && /* @__PURE__ */ React.createElement("div", {
|
|
3463
|
+
className: "tac-folder",
|
|
3464
|
+
title: group.cwd
|
|
3465
|
+
}, /* @__PURE__ */ React.createElement(Folder, {
|
|
3466
|
+
size: 12
|
|
3467
|
+
}), /* @__PURE__ */ React.createElement("span", null, SidebarUtil.folder(group.cwd)), /* @__PURE__ */ React.createElement(HostTag, {
|
|
3468
|
+
location: group.cwd
|
|
3469
|
+
})), group.agents.map((agent) => {
|
|
3470
|
+
const where = team.channels.find((channel) => working[channel.id]?.includes(agent.id));
|
|
3471
|
+
return /* @__PURE__ */ React.createElement(Row, {
|
|
3472
|
+
pi,
|
|
3473
|
+
key: agent.id,
|
|
3474
|
+
avatar: /* @__PURE__ */ React.createElement(AgentAvatar, {
|
|
3475
|
+
agent,
|
|
3476
|
+
faces,
|
|
3477
|
+
size: 36,
|
|
3478
|
+
working: !!where
|
|
3479
|
+
}),
|
|
3480
|
+
title: agent.name,
|
|
3481
|
+
badge: group.cwd === undefined && /* @__PURE__ */ React.createElement(HostTag, {
|
|
3482
|
+
location: agent.cwd ?? serverCwd
|
|
3483
|
+
}),
|
|
3484
|
+
preview: where ? ChannelWords.format(w.answeringIn, { channel: where.name }) : w.idle,
|
|
3485
|
+
live: !!where,
|
|
3486
|
+
time: SidebarUtil.time(lastSaid.get(agent.id) ?? agent.createdAt, pi.ui.language),
|
|
3487
|
+
hint: `@${agent.name} · ${agent.role}
|
|
3488
|
+
${agent.cwd ?? serverCwd}`,
|
|
3489
|
+
selected: agentSelected(agent),
|
|
3490
|
+
onSelect: () => openAgent(agent),
|
|
3491
|
+
more: /* @__PURE__ */ React.createElement(AgentMenu, {
|
|
3492
|
+
context,
|
|
3493
|
+
agent,
|
|
3494
|
+
cwd: agent.cwd ?? serverCwd,
|
|
3495
|
+
working: !!where
|
|
3496
|
+
}),
|
|
3497
|
+
swipe: swipeDelete(pi, () => deleteAgent(context, agent))
|
|
3498
|
+
});
|
|
3499
|
+
})))), channels.length > 0 && /* @__PURE__ */ React.createElement(Section, {
|
|
3500
|
+
id: "channels",
|
|
3501
|
+
title: w.channelsSection,
|
|
3502
|
+
count: channels.length,
|
|
3503
|
+
folded,
|
|
3504
|
+
onFold: fold
|
|
3505
|
+
}, channels.map((channel) => {
|
|
2758
3506
|
const members = membersOf(team, channel);
|
|
2759
3507
|
const busy = working[channel.id] ?? [];
|
|
2760
3508
|
const last = state.messages[channel.id]?.filter((message) => message.author !== SYSTEM).at(-1);
|
|
2761
3509
|
const preview = busy.length > 0 ? ChannelWords.format(w.answeringNow, { name: busy.map(name).join("、") }) : last ? `${name(last.author)}:${last.text.replace(/\s+/g, " ")}` : channel.topic ?? w.noMessages;
|
|
2762
3510
|
return /* @__PURE__ */ React.createElement(Row, {
|
|
3511
|
+
pi,
|
|
2763
3512
|
key: channel.id,
|
|
2764
3513
|
avatar: /* @__PURE__ */ React.createElement(RoomFace, {
|
|
2765
3514
|
members,
|
|
@@ -2788,111 +3537,77 @@ function AgentsSidebar({ context }) {
|
|
|
2788
3537
|
context,
|
|
2789
3538
|
channel,
|
|
2790
3539
|
working: busy
|
|
2791
|
-
})
|
|
2792
|
-
});
|
|
2793
|
-
}), SidebarUtil.byDirectory(agents, serverCwd).map((group) => /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
2794
|
-
key: group.cwd
|
|
2795
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
2796
|
-
className: "tac-folder",
|
|
2797
|
-
title: group.cwd
|
|
2798
|
-
}, SidebarUtil.host(group.cwd) ? /* @__PURE__ */ React.createElement(Server, {
|
|
2799
|
-
size: 12
|
|
2800
|
-
}) : /* @__PURE__ */ React.createElement(Folder, {
|
|
2801
|
-
size: 12
|
|
2802
|
-
}), /* @__PURE__ */ React.createElement("span", null, SidebarUtil.folder(group.cwd)), SidebarUtil.host(group.cwd) && /* @__PURE__ */ React.createElement("span", {
|
|
2803
|
-
className: "tac-host"
|
|
2804
|
-
}, SidebarUtil.host(group.cwd))), group.agents.map((agent) => {
|
|
2805
|
-
const where = team.channels.find((channel) => working[channel.id]?.includes(agent.id));
|
|
2806
|
-
return /* @__PURE__ */ React.createElement(Row, {
|
|
2807
|
-
key: agent.id,
|
|
2808
|
-
avatar: /* @__PURE__ */ React.createElement(AgentAvatar, {
|
|
2809
|
-
agent,
|
|
2810
|
-
faces,
|
|
2811
|
-
size: 36,
|
|
2812
|
-
working: !!where
|
|
2813
3540
|
}),
|
|
2814
|
-
|
|
2815
|
-
preview: where ? ChannelWords.format(w.answeringIn, { channel: where.name }) : w.idle,
|
|
2816
|
-
live: !!where,
|
|
2817
|
-
time: SidebarUtil.time(lastSaid.get(agent.id) ?? agent.createdAt, pi.ui.language),
|
|
2818
|
-
hint: `@${agent.name} · ${agent.role}`,
|
|
2819
|
-
selected: agentSelected(agent),
|
|
2820
|
-
onSelect: () => openAgent(agent),
|
|
2821
|
-
more: /* @__PURE__ */ React.createElement(AgentMenu, {
|
|
2822
|
-
context,
|
|
2823
|
-
agent,
|
|
2824
|
-
cwd: agent.cwd ?? serverCwd,
|
|
2825
|
-
working: !!where
|
|
2826
|
-
})
|
|
3541
|
+
swipe: swipeDelete(pi, () => deleteChannel(context, channel))
|
|
2827
3542
|
});
|
|
2828
|
-
}))))
|
|
3543
|
+
}))));
|
|
2829
3544
|
}
|
|
2830
3545
|
|
|
2831
3546
|
// web-src/style.ts
|
|
2832
3547
|
var STYLE = `
|
|
2833
|
-
.tac-view { display: flex; flex-direction: column; height: 100%; min-height: 0; color: var(--ta-text); font-size: 13px; }
|
|
3548
|
+
.tac-view { display: flex; flex-direction: column; height: 100%; min-height: 0; color: var(--ta-text); font-size: calc(13px * var(--ta-font-scale)); }
|
|
2834
3549
|
.tac-action { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: none; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--ta-muted); cursor: pointer; }
|
|
2835
3550
|
.tac-action:hover { background: var(--ta-hover); color: var(--ta-text); }
|
|
2836
3551
|
.tac-toolbar { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
|
|
2837
3552
|
.tac-search { position: relative; display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 36px; padding: 0 6px 0 11px; border: 1px solid transparent; border-radius: 10px; background: var(--ta-raised); color: var(--ta-muted); transition: border-color 120ms, background 120ms; box-sizing: border-box; }
|
|
2838
3553
|
.tac-search:focus-within { border-color: var(--ta-border-field); background: var(--ta-input); }
|
|
2839
|
-
.tac-search input { flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: var(--ta-text); font: inherit; font-size: 13.5px; outline: none; }
|
|
3554
|
+
.tac-search input { flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: var(--ta-text); font: inherit; font-size: calc(13.5px * var(--ta-font-scale)); outline: none; }
|
|
2840
3555
|
.tac-search input::placeholder { color: var(--ta-muted); }
|
|
2841
3556
|
.tac-search .tac-action { width: 20px; height: 20px; }
|
|
2842
3557
|
.tac-menu-anchor { position: relative; flex: none; }
|
|
2843
3558
|
.tac-add { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: var(--ta-raised); color: var(--ta-secondary); cursor: pointer; transition: background 120ms, color 120ms; }
|
|
2844
3559
|
.tac-add:hover, .tac-add[aria-expanded="true"] { background: var(--ta-hover); color: var(--ta-text); }
|
|
2845
3560
|
.tac-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 160px; padding: 4px; border: 1px solid var(--ta-border-muted); border-radius: 10px; background: var(--ta-raised); box-shadow: var(--ta-shadow-pop); }
|
|
2846
|
-
.tac-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: none; color: var(--ta-body); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
|
|
3561
|
+
.tac-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: none; color: var(--ta-body); font: inherit; font-size: calc(13px * var(--ta-font-scale)); text-align: left; cursor: pointer; }
|
|
2847
3562
|
.tac-menu button:hover { background: var(--ta-hover); color: var(--ta-text); }
|
|
2848
3563
|
.tac-menu button svg { color: var(--ta-muted); }
|
|
2849
3564
|
.tac-list { flex: 1; min-height: 0; overflow: auto; padding: 2px 0 12px; }
|
|
3565
|
+
.tac-list:has(> .ta-empty:not(.ta-empty-compact)) { display: flex; flex-direction: column; }
|
|
2850
3566
|
.tac-list > .tac-view > .tac-form { margin: 2px 10px 8px; }
|
|
2851
|
-
.tac-double { display: flex;
|
|
3567
|
+
.tac-double { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px; margin: 2px 0 8px; padding: 10px 44px 10px 10px; border: 0; border-radius: 14px; background: none; color: var(--ta-text); font: inherit; text-align: left; cursor: pointer; transition: background 120ms; box-sizing: border-box; }
|
|
2852
3568
|
.tac-double:hover { background: var(--ta-hover); }
|
|
2853
|
-
.tac-double.tac-selected { background: var(--ta-
|
|
3569
|
+
.tac-double.tac-selected { background: var(--ta-selected); }
|
|
3570
|
+
.tac-double-face { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; }
|
|
3571
|
+
.tac-double-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
|
|
2854
3572
|
.tac-double-row { position: relative; }
|
|
2855
3573
|
.tac-pinned { display: inline-flex; flex: none; color: var(--ta-muted); }
|
|
2856
|
-
.tac-double-name {
|
|
2857
|
-
.tac-double-row > .tac-item-more { top: 14px; right: 16px; transform: none; }
|
|
2858
|
-
.tac-double-row:hover .tac-item-more > .tac-action { opacity: 1; }
|
|
3574
|
+
.tac-double-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(14.5px * var(--ta-font-scale)); font-weight: 600; line-height: calc(20px * var(--ta-font-scale)); }
|
|
2859
3575
|
.tac-item-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
2860
3576
|
.tac-item-bottom .tac-item-preview { flex: 1; min-width: 0; }
|
|
2861
3577
|
.tac-fresh { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--ta-green); }
|
|
2862
3578
|
.tac-head { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding-left: 8px; }
|
|
2863
3579
|
.tac-head-title { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; white-space: nowrap; }
|
|
2864
|
-
.tac-head-title strong { overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; font-weight: 600; }
|
|
2865
|
-
.tac-head-count { flex: none; color: var(--ta-muted); font-size: 12px; }
|
|
2866
|
-
.tac-head-topic { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ta-muted); font-size: 12.5px; }
|
|
3580
|
+
.tac-head-title strong { overflow: hidden; text-overflow: ellipsis; font-size: calc(14.5px * var(--ta-font-scale)); font-weight: 600; }
|
|
3581
|
+
.tac-head-count { flex: none; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
3582
|
+
.tac-head-topic { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); }
|
|
2867
3583
|
.tac-head-members { display: flex; align-items: center; flex: none; height: 32px; padding: 0 6px 0 10px; border: 0; border-radius: 999px; background: none; color: inherit; font: inherit; cursor: pointer; transition: background 120ms; }
|
|
2868
3584
|
.tac-head-members:hover, .tac-head-members.tac-on { background: var(--ta-hover); }
|
|
2869
3585
|
.tac-head-members:focus-visible { outline: 1px solid var(--ta-border-focus); outline-offset: -1px; }
|
|
2870
3586
|
.tac-head-face { display: inline-flex; margin-left: -4px; padding: 1px; border-radius: 50%; background: var(--ta-main); }
|
|
2871
3587
|
.tac-head-members:hover .tac-head-face, .tac-head-members.tac-on .tac-head-face { background: var(--ta-hover); }
|
|
2872
|
-
.tac-head-more { margin-left: 4px; color: var(--ta-muted); font-size: 11.5px; }
|
|
3588
|
+
.tac-head-more { margin-left: 4px; color: var(--ta-muted); font-size: calc(11.5px * var(--ta-font-scale)); }
|
|
2873
3589
|
.tac-action.tac-on { background: var(--ta-hover-strong); color: var(--ta-text); }
|
|
2874
3590
|
.tac-room-page { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--ta-main); color: var(--ta-text); }
|
|
2875
|
-
.tac-room-none { display: grid; place-items: center; flex: 1; color: var(--ta-muted); font-size: 13px; }
|
|
2876
3591
|
.tac-chat { flex: 1; min-height: 0; overflow-y: auto; }
|
|
2877
3592
|
.tac-chat-col { display: flex; flex-direction: column; gap: 4px; max-width: calc(var(--ta-col) + 48px); margin: 0 auto; padding: 20px 24px 12px; box-sizing: border-box; }
|
|
2878
|
-
.tac-chat-time { align-self: center; margin: 14px 0 6px; color: var(--ta-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
|
|
2879
|
-
.tac-chat-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 12vh auto 0; max-width: 360px; color: var(--ta-muted); font-size: 13px; text-align: center; }
|
|
2880
|
-
.tac-chat-empty strong { margin-top: 6px; color: var(--ta-text); font-size: 16px; }
|
|
2881
|
-
.tac-chat-hint { margin-top: 4px; font-size: 12px; }
|
|
3593
|
+
.tac-chat-time { align-self: center; margin: 14px 0 6px; color: var(--ta-muted); font-size: calc(11.5px * var(--ta-font-scale)); font-variant-numeric: tabular-nums; }
|
|
3594
|
+
.tac-chat-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 12vh auto 0; max-width: 360px; color: var(--ta-muted); font-size: calc(13px * var(--ta-font-scale)); text-align: center; }
|
|
3595
|
+
.tac-chat-empty strong { margin-top: 6px; color: var(--ta-text); font-size: calc(16px * var(--ta-font-scale)); }
|
|
3596
|
+
.tac-chat-hint { margin-top: 4px; font-size: calc(12px * var(--ta-font-scale)); }
|
|
2882
3597
|
.tac-mine { margin: 6px 0 2px; }
|
|
2883
3598
|
.tac-msg { display: flex; align-items: flex-start; gap: 10px; }
|
|
2884
3599
|
.tac-msg.tac-first { margin-top: 10px; }
|
|
2885
3600
|
.tac-msg-face { display: flex; justify-content: center; width: 28px; flex: none; }
|
|
2886
3601
|
.tac-msg-col { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: min(84%, var(--ta-col)); }
|
|
2887
|
-
.tac-msg-name { display: flex; align-items: center; gap: 6px; margin: 0 2px 4px; color: var(--ta-muted); font-size: 12px; line-height: 16px; }
|
|
2888
|
-
.tac-msg-lead { padding: 0 5px; border-radius: 999px; background: color-mix(in srgb, var(--ta-green) 12%, transparent); color: var(--ta-green); font-size: 10.5px; font-weight: 600; line-height: 15px; }
|
|
3602
|
+
.tac-msg-name { display: flex; align-items: center; gap: 6px; margin: 0 2px 4px; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); line-height: calc(16px * var(--ta-font-scale)); }
|
|
3603
|
+
.tac-msg-lead { padding: 0 5px; border-radius: 999px; background: color-mix(in srgb, var(--ta-green) 12%, transparent); color: var(--ta-green); font-size: calc(10.5px * var(--ta-font-scale)); font-weight: 600; line-height: calc(15px * var(--ta-font-scale)); }
|
|
2889
3604
|
.tac-msg-bubble { min-width: 0; max-width: 100%; padding: 9px 14px; border: 1px solid var(--ta-border-muted); border-radius: 5px 16px 16px 16px; background: var(--ta-side); color: var(--ta-body); line-height: 1.6; overflow-wrap: anywhere; }
|
|
2890
3605
|
.tac-msg-bubble.tac-failed { border-color: color-mix(in srgb, var(--ta-red) 35%, transparent); }
|
|
2891
|
-
.tac-msg-failed { margin-bottom: 4px; color: var(--ta-red); font-size: 12px; }
|
|
3606
|
+
.tac-msg-failed { margin-bottom: 4px; color: var(--ta-red); font-size: calc(12px * var(--ta-font-scale)); }
|
|
2892
3607
|
.tac-msg-bubble pre { max-width: 100%; overflow-x: auto; }
|
|
2893
3608
|
.tac-mention { color: var(--ta-link); }
|
|
2894
|
-
.tac-notice { align-self: center; margin: 10px 0; padding: 3px 10px; border-radius: 999px; background: var(--ta-hover); color: var(--ta-muted); font-size: 12px; }
|
|
2895
|
-
.tac-live { display: flex; align-items: center; gap: 8px; align-self: flex-start; margin: 10px 0 0 38px; padding: 5px 12px 5px 8px; border-radius: 999px; background: var(--ta-hover); color: var(--ta-secondary); font-size: 12.5px; }
|
|
3609
|
+
.tac-notice { align-self: center; margin: 10px 0; padding: 3px 10px; border-radius: 999px; background: var(--ta-hover); color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
3610
|
+
.tac-live { display: flex; align-items: center; gap: 8px; align-self: flex-start; margin: 10px 0 0 38px; padding: 5px 12px 5px 8px; border-radius: 999px; background: var(--ta-hover); color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); }
|
|
2896
3611
|
.tac-live-faces { display: inline-flex; }
|
|
2897
3612
|
.tac-live-faces > * + * { margin-left: -4px; }
|
|
2898
3613
|
.tac-chat-bottom { width: 100%; max-width: calc(var(--ta-col) + 48px); margin: 0 auto; padding: 8px 24px calc(16px + env(safe-area-inset-bottom)); box-sizing: border-box; flex: none; display: flex; flex-direction: column; gap: 8px; }
|
|
@@ -2904,13 +3619,13 @@ var STYLE = `
|
|
|
2904
3619
|
.tac-new-head { position: relative; display: flex; align-items: center; justify-content: center; flex: 1; min-width: 0; height: 100%; }
|
|
2905
3620
|
.tac-new-title { position: relative; display: flex; justify-content: center; min-width: 0; }
|
|
2906
3621
|
.tac-new-head > .tac-button { position: absolute; right: 0; }
|
|
2907
|
-
.tac-new-trigger { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--ta-text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
|
|
3622
|
+
.tac-new-trigger { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--ta-text); font: inherit; font-size: calc(14px * var(--ta-font-scale)); font-weight: 600; cursor: pointer; }
|
|
2908
3623
|
.tac-new-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2909
3624
|
.tac-new-trigger:hover, .tac-new-trigger[aria-expanded="true"] { background: var(--ta-hover); }
|
|
2910
3625
|
.tac-new-trigger svg { flex: none; color: var(--ta-muted); }
|
|
2911
3626
|
.tac-identity { position: absolute; top: calc(100% + 8px); left: 50%; z-index: 30; width: 300px; max-width: calc(100vw - 24px); padding: 12px; border: 1px solid var(--ta-border); border-radius: 14px; background: var(--ta-side); box-shadow: var(--ta-shadow-pop); transform: translateX(-50%); animation: tac-pop 140ms ease-out; box-sizing: border-box; }
|
|
2912
|
-
.tac-identity-label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; color: var(--ta-muted); font-size: 12px; }
|
|
2913
|
-
.tac-identity-label .tac-input { height: 36px; font-size: 13.5px; }
|
|
3627
|
+
.tac-identity-label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
3628
|
+
.tac-identity-label .tac-input { height: 36px; font-size: calc(13.5px * var(--ta-font-scale)); }
|
|
2914
3629
|
.tac-faces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
|
|
2915
3630
|
.tac-face-pick { display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 2px solid transparent; border-radius: 12px; background: none; cursor: pointer; transition: background 120ms, border-color 120ms; }
|
|
2916
3631
|
.tac-face-pick:hover { background: var(--ta-hover); }
|
|
@@ -2920,53 +3635,52 @@ var STYLE = `
|
|
|
2920
3635
|
.tac-button.tac-quiet:hover { background: var(--ta-hover); color: var(--ta-text); }
|
|
2921
3636
|
.tac-new-page { display: flex; flex: 1; min-height: 0; overflow-y: auto; background: var(--ta-main); color: var(--ta-text); }
|
|
2922
3637
|
.tac-new-col { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: calc(var(--ta-col) + 48px); margin: auto; padding: 24px 24px calc(28px + env(safe-area-inset-bottom)); box-sizing: border-box; }
|
|
2923
|
-
.tac-new-name { display: flex; align-items: center; gap: 4px; margin: 16px 0 6px; font-size: 22px; font-weight: 700; }
|
|
3638
|
+
.tac-new-name { display: flex; align-items: center; gap: 4px; margin: 16px 0 6px; font-size: calc(22px * var(--ta-font-scale)); font-weight: 700; }
|
|
2924
3639
|
.tac-new-name .tac-action { color: var(--ta-muted); }
|
|
2925
|
-
.tac-new-hint { margin: 0 0 22px; max-width: 460px; color: var(--ta-muted); font-size: 13px; line-height: 1.6; text-align: center; }
|
|
3640
|
+
.tac-new-hint { margin: 0 0 22px; max-width: 460px; color: var(--ta-muted); font-size: calc(13px * var(--ta-font-scale)); line-height: 1.6; text-align: center; }
|
|
2926
3641
|
.tac-new-box { width: 100%; display: flex; flex-direction: column; gap: 8px; }
|
|
2927
3642
|
.tac-dialog { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
|
|
2928
|
-
.tac-dialog-label { display: flex; flex-direction: column; gap: 8px; color: var(--ta-secondary); font-size: 13px; }
|
|
3643
|
+
.tac-dialog-label { display: flex; flex-direction: column; gap: 8px; color: var(--ta-secondary); font-size: calc(13px * var(--ta-font-scale)); }
|
|
2929
3644
|
div.tac-dialog-label { flex-direction: row; justify-content: space-between; margin-top: 6px; }
|
|
2930
3645
|
.tac-dialog-count { color: var(--ta-muted); font-variant-numeric: tabular-nums; }
|
|
2931
|
-
.tac-dialog-input { height: 40px; font-size: 14px; }
|
|
3646
|
+
.tac-dialog-input { height: 40px; font-size: calc(14px * var(--ta-font-scale)); }
|
|
2932
3647
|
.tac-dialog-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--ta-border-field); border-radius: 10px; background: var(--ta-input); color: var(--ta-muted); box-sizing: border-box; }
|
|
2933
3648
|
.tac-dialog-search:focus-within { border-color: var(--ta-border-focus); }
|
|
2934
|
-
.tac-dialog-search input { flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: var(--ta-text); font: inherit; font-size: 13.5px; outline: none; }
|
|
3649
|
+
.tac-dialog-search input { flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: var(--ta-text); font: inherit; font-size: calc(13.5px * var(--ta-font-scale)); outline: none; }
|
|
2935
3650
|
.tac-pick-list { display: flex; flex-direction: column; max-height: min(320px, 40vh); overflow-y: auto; padding: 4px; border: 1px solid var(--ta-border-muted); border-radius: 12px; }
|
|
2936
|
-
.tac-pick-list > .tac-empty { padding: 14px 10px; }
|
|
2937
3651
|
.tac-pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: none; color: var(--ta-text); font: inherit; text-align: left; cursor: pointer; }
|
|
2938
3652
|
.tac-pick:hover:not(:disabled) { background: var(--ta-hover); }
|
|
2939
3653
|
.tac-pick:disabled { opacity: 0.45; cursor: default; }
|
|
2940
3654
|
.tac-check { display: grid; place-items: center; width: 18px; height: 18px; flex: none; border: 1.5px solid var(--ta-border-field); border-radius: 5px; color: var(--ta-main); box-sizing: border-box; }
|
|
2941
3655
|
.tac-pick.tac-on .tac-check { border-color: var(--ta-text); background: var(--ta-text); }
|
|
2942
3656
|
.tac-pick-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
|
|
2943
|
-
.tac-pick-name { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
|
|
2944
|
-
.tac-pick-role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: 12px; }
|
|
2945
|
-
.tac-dialog-note { color: var(--ta-muted); font-size: 12px; }
|
|
3657
|
+
.tac-pick-name { display: flex; align-items: center; gap: 6px; font-size: calc(14px * var(--ta-font-scale)); font-weight: 500; }
|
|
3658
|
+
.tac-pick-role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
3659
|
+
.tac-dialog-note { color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
2946
3660
|
.tac-dialog-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
|
|
2947
|
-
.tac-dialog-actions .tac-button { height: 36px; padding: 0 18px; font-size: 13.5px; }
|
|
3661
|
+
.tac-dialog-actions .tac-button { height: 36px; padding: 0 18px; font-size: calc(13.5px * var(--ta-font-scale)); }
|
|
2948
3662
|
@media (max-width: 720px) {
|
|
2949
3663
|
.tac-new-head > .tac-button { position: static; margin-left: auto; }
|
|
2950
3664
|
.tac-new-head { justify-content: flex-start; }
|
|
2951
3665
|
.tac-identity { position: fixed; top: calc(60px + env(safe-area-inset-top) + var(--ta-titlebar, 0px)); left: 12px; right: 12px; width: auto; max-width: none; transform: none; animation: none; }
|
|
2952
3666
|
}
|
|
2953
3667
|
.tac-empty { padding: 8px 18px; }
|
|
2954
|
-
.tac-item { position: relative; display: flex; align-items: center; gap:
|
|
3668
|
+
.tac-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; margin: 1px 0; padding: 9px 10px; border: 0; border-radius: 12px; background: none; color: var(--ta-text); font: inherit; text-align: left; cursor: pointer; transition: background 120ms; }
|
|
2955
3669
|
.tac-item:hover { background: var(--ta-hover); }
|
|
2956
|
-
.tac-item.tac-selected { background: var(--ta-
|
|
2957
|
-
.tac-item.tac-selected::before { content: ''; position: absolute; left: 2px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--ta-green); }
|
|
3670
|
+
.tac-item.tac-selected { background: var(--ta-selected); }
|
|
2958
3671
|
.tac-item-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
|
|
2959
3672
|
.tac-item-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
2960
|
-
.tac-item-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 500; line-height: 18px; }
|
|
2961
|
-
.tac-item-time { flex: none; margin-left: auto; padding-left: 4px; color: var(--ta-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
|
|
2962
|
-
.tac-item-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: 12px; line-height: 17px; }
|
|
3673
|
+
.tac-item-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(13.5px * var(--ta-font-scale)); font-weight: 500; line-height: calc(18px * var(--ta-font-scale)); }
|
|
3674
|
+
.tac-item-time { flex: none; margin-left: auto; padding-left: 4px; color: var(--ta-muted); font-size: calc(11px * var(--ta-font-scale)); font-variant-numeric: tabular-nums; }
|
|
3675
|
+
.tac-item-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); line-height: calc(17px * var(--ta-font-scale)); }
|
|
2963
3676
|
.tac-item-preview.tac-live { color: var(--ta-green); }
|
|
2964
|
-
.tac-lead { display: inline-flex; align-items: center; gap: 3px; flex: none; max-width: 96px; overflow: hidden; padding: 0 6px; border: 1px solid color-mix(in srgb, var(--ta-green) 35%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--ta-green) 10%, transparent); color: var(--ta-green); font-size: 10.5px; font-weight: 600; line-height: 16px; white-space: nowrap; }
|
|
3677
|
+
.tac-lead { display: inline-flex; align-items: center; gap: 3px; flex: none; max-width: 96px; overflow: hidden; padding: 0 6px; border: 1px solid color-mix(in srgb, var(--ta-green) 35%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--ta-green) 10%, transparent); color: var(--ta-green); font-size: calc(10.5px * var(--ta-font-scale)); font-weight: 600; line-height: calc(16px * var(--ta-font-scale)); white-space: nowrap; }
|
|
2965
3678
|
.tac-lead span { overflow: hidden; text-overflow: ellipsis; }
|
|
2966
3679
|
.tac-lead svg { flex: none; }
|
|
2967
|
-
.tac-folder { display: flex; align-items: center; gap: 5px; margin: 12px
|
|
3680
|
+
.tac-folder { display: flex; align-items: center; gap: 5px; margin: 12px 10px 4px; color: var(--ta-muted); font-size: calc(11.5px * var(--ta-font-scale)); line-height: calc(16px * var(--ta-font-scale)); }
|
|
2968
3681
|
.tac-folder span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2969
|
-
.tac-folder .
|
|
3682
|
+
.tac-folder .ta-host-tag { margin: 0 0 0 1px; vertical-align: 0; }
|
|
3683
|
+
.tac-item-top .ta-host-tag { margin: 0; vertical-align: 0; }
|
|
2970
3684
|
.tac-face { display: inline-flex; flex: none; }
|
|
2971
3685
|
.tac-face svg { display: block; overflow: visible; }
|
|
2972
3686
|
.tac-face-eyes { transform-box: fill-box; transform-origin: center; animation: tac-blink 5.2s infinite; }
|
|
@@ -2982,34 +3696,34 @@ div.tac-dialog-label { flex-direction: row; justify-content: space-between; marg
|
|
|
2982
3696
|
.tac-room { position: relative; display: inline-flex; flex: none; }
|
|
2983
3697
|
.tac-room-back { position: absolute; right: 0; top: 0; }
|
|
2984
3698
|
.tac-room-front { position: absolute; left: 0; bottom: 0; z-index: 1; }
|
|
2985
|
-
.tac-empty { padding: 8px; color: var(--ta-muted); font-size: 12px; line-height: 1.6; }
|
|
3699
|
+
.tac-empty { padding: 8px; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); line-height: 1.6; }
|
|
2986
3700
|
.tac-error { color: var(--ta-red); }
|
|
2987
3701
|
.tac-form { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; padding: 8px; border: 1px solid var(--ta-border-muted); border-radius: 8px; background: var(--ta-card); }
|
|
2988
|
-
.tac-form label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--ta-secondary); }
|
|
2989
|
-
.tac-input { width: 100%; box-sizing: border-box; padding: 5px 8px; border: 1px solid var(--ta-border-field); border-radius: 8px; background: var(--ta-input); color: var(--ta-text); font: inherit; font-size: 13px; }
|
|
3702
|
+
.tac-form label { display: flex; flex-direction: column; gap: 3px; font-size: calc(11.5px * var(--ta-font-scale)); color: var(--ta-secondary); }
|
|
3703
|
+
.tac-input { width: 100%; box-sizing: border-box; padding: 5px 8px; border: 1px solid var(--ta-border-field); border-radius: 8px; background: var(--ta-input); color: var(--ta-text); font: inherit; font-size: calc(13px * var(--ta-font-scale)); }
|
|
2990
3704
|
.tac-input:focus { outline: none; border-color: var(--ta-border-focus); }
|
|
2991
3705
|
textarea.tac-input { resize: vertical; min-height: 56px; line-height: 1.5; }
|
|
2992
3706
|
.tac-chips { display: flex; flex-wrap: wrap; gap: 4px; }
|
|
2993
|
-
.tac-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--ta-border-muted); border-radius: 12px; background: none; color: var(--ta-body); font: inherit; font-size: 12px; cursor: pointer; }
|
|
3707
|
+
.tac-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--ta-border-muted); border-radius: 12px; background: none; color: var(--ta-body); font: inherit; font-size: calc(12px * var(--ta-font-scale)); cursor: pointer; }
|
|
2994
3708
|
.tac-chip.tac-on { border-color: var(--ta-accent); color: var(--ta-text); background: var(--ta-selected); }
|
|
2995
3709
|
.tac-chip small { color: var(--ta-muted); }
|
|
2996
3710
|
.tac-buttons { display: flex; justify-content: flex-end; gap: 6px; }
|
|
2997
|
-
.tac-button { padding: 4px 12px; border: 1px solid var(--ta-border); border-radius: 8px; background: var(--ta-raised); color: var(--ta-text); font: inherit; font-size: 12.5px; cursor: pointer; }
|
|
3711
|
+
.tac-button { padding: 4px 12px; border: 1px solid var(--ta-border); border-radius: 8px; background: var(--ta-raised); color: var(--ta-text); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; }
|
|
2998
3712
|
.tac-button.tac-primary { border-color: transparent; background: var(--ta-text); color: var(--ta-main); }
|
|
2999
3713
|
.tac-button:disabled { opacity: 0.5; cursor: default; }
|
|
3000
3714
|
.tac-button.tac-danger { border-color: transparent; background: var(--ta-red); color: #fff; }
|
|
3001
|
-
.tac-
|
|
3715
|
+
.tac-team-up { margin-top: 6px; padding: 6px 14px; }
|
|
3716
|
+
.tac-link { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; border: 0; border-radius: 6px; background: none; color: var(--ta-secondary); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; }
|
|
3002
3717
|
.tac-link:hover { background: var(--ta-hover); }
|
|
3003
3718
|
.tac-link.tac-danger { color: var(--ta-red); }
|
|
3004
3719
|
.tac-members { background: var(--ta-main); }
|
|
3005
|
-
.tac-members-none { display: grid; place-items: center; flex: 1; padding: 24px; color: var(--ta-muted); text-align: center; }
|
|
3006
3720
|
.tac-members-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 12px; }
|
|
3007
3721
|
.tac-members-top { display: flex; align-items: center; gap: 12px; padding: 14px 10px 12px; }
|
|
3008
3722
|
.tac-members-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
|
|
3009
|
-
.tac-members-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
|
|
3010
|
-
.tac-members-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: 12px; }
|
|
3011
|
-
.tac-members-label { padding: 10px 10px 6px; color: var(--ta-muted); font-size: 12px; }
|
|
3012
|
-
.tac-members-head { display: flex; align-items: center; gap: 6px; flex: none; padding: 10px 12px 4px 8px; font-size: 13.5px; }
|
|
3723
|
+
.tac-members-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(15px * var(--ta-font-scale)); font-weight: 600; }
|
|
3724
|
+
.tac-members-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
3725
|
+
.tac-members-label { padding: 10px 10px 6px; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
3726
|
+
.tac-members-head { display: flex; align-items: center; gap: 6px; flex: none; padding: 10px 12px 4px 8px; font-size: calc(13.5px * var(--ta-font-scale)); }
|
|
3013
3727
|
.tac-members-search { flex: none; margin: 6px 16px 2px; }
|
|
3014
3728
|
.tac-members-sep { height: 1px; margin: 6px 10px; background: var(--ta-border-muted); }
|
|
3015
3729
|
.tac-member { position: relative; display: flex; align-items: center; border-radius: 12px; transition: background 120ms; }
|
|
@@ -3017,11 +3731,11 @@ textarea.tac-input { resize: vertical; min-height: 56px; line-height: 1.5; }
|
|
|
3017
3731
|
.tac-member-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px; background: none; color: var(--ta-text); font: inherit; text-align: left; cursor: pointer; }
|
|
3018
3732
|
.tac-members-scroll > .tac-member-main:hover { background: var(--ta-hover); }
|
|
3019
3733
|
.tac-member .tac-member-main:focus-visible, .tac-members-scroll > .tac-member-main:focus-visible { outline: 1px solid var(--ta-border-focus); outline-offset: -1px; }
|
|
3020
|
-
.tac-member-plus { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--ta-hover); color: var(--ta-secondary); }
|
|
3734
|
+
.tac-member-plus { display: grid; place-items: center; padding: 0; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--ta-hover); color: var(--ta-secondary); }
|
|
3021
3735
|
.tac-member-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
|
|
3022
|
-
.tac-member-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; font-weight: 500; line-height: 18px; }
|
|
3736
|
+
.tac-member-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: calc(13.5px * var(--ta-font-scale)); font-weight: 500; line-height: calc(18px * var(--ta-font-scale)); }
|
|
3023
3737
|
.tac-member-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
3024
|
-
.tac-member-detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: 12px; line-height: 17px; }
|
|
3738
|
+
.tac-member-detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); line-height: calc(17px * var(--ta-font-scale)); }
|
|
3025
3739
|
.tac-member-detail.tac-live { color: var(--ta-green); }
|
|
3026
3740
|
.tac-member.tac-muted .tac-member-main > :first-child { opacity: 0.5; }
|
|
3027
3741
|
.tac-member-actions { display: flex; align-items: center; gap: 2px; flex: none; padding-right: 8px; opacity: 0; transition: opacity 120ms; }
|
|
@@ -3035,8 +3749,8 @@ textarea.tac-input { resize: vertical; min-height: 56px; line-height: 1.5; }
|
|
|
3035
3749
|
.tac-check { display: grid; place-items: center; width: 18px; height: 18px; flex: none; box-sizing: border-box; border: 1.5px solid var(--ta-border-field); border-radius: 50%; color: var(--ta-main); }
|
|
3036
3750
|
.tac-pick.tac-on .tac-check { border-color: var(--ta-green); background: var(--ta-green); }
|
|
3037
3751
|
.tac-members-foot { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex: none; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--ta-border-muted); }
|
|
3038
|
-
.tac-members-ask { flex: 1; min-width: 0; color: var(--ta-body); font-size: 12.5px; }
|
|
3039
|
-
.tac-button.tac-wide { flex: 1; height: 36px; border-radius: 10px; font-size: 13.5px; }
|
|
3752
|
+
.tac-members-ask { flex: 1; min-width: 0; color: var(--ta-body); font-size: calc(12.5px * var(--ta-font-scale)); }
|
|
3753
|
+
.tac-button.tac-wide { flex: 1; height: 36px; border-radius: 10px; font-size: calc(13.5px * var(--ta-font-scale)); }
|
|
3040
3754
|
@media (hover: none) {
|
|
3041
3755
|
.tac-member-actions { opacity: 1; }
|
|
3042
3756
|
.tac-member.tac-muted .tac-member-actions > :not(.tac-on) { visibility: visible; }
|
|
@@ -3046,27 +3760,91 @@ textarea.tac-input { resize: vertical; min-height: 56px; line-height: 1.5; }
|
|
|
3046
3760
|
@media (pointer: coarse) {
|
|
3047
3761
|
.tac-item { padding: 10px; }
|
|
3048
3762
|
.tac-action { width: 32px; height: 32px; }
|
|
3049
|
-
.tac-input { font-size: 16px; }
|
|
3763
|
+
.tac-input { font-size: max(16px, calc(16px * var(--ta-font-scale))); }
|
|
3050
3764
|
}
|
|
3051
3765
|
/* The … of an agent: over the time while its row is hovered, focused or its menu open */
|
|
3052
|
-
.tac-item-row { position: relative; }
|
|
3053
|
-
|
|
3054
|
-
.tac-item-more { position: absolute; right:
|
|
3055
|
-
.tac-item-more > .tac-action { width:
|
|
3056
|
-
.tac-item-
|
|
3766
|
+
.tac-item-row { position: relative; border-radius: 12px; }
|
|
3767
|
+
/* Centred without a transform: a transform would hold its menu, fixed to the screen. */
|
|
3768
|
+
.tac-item-more { position: absolute; right: 8px; top: 0; bottom: 0; z-index: 2; display: flex; align-items: center; }
|
|
3769
|
+
.tac-item-more > .tac-action { width: 28px; height: 28px; border-radius: 8px; color: var(--ta-secondary); opacity: 0; transition: opacity 120ms, background 120ms; }
|
|
3770
|
+
.tac-item-more > .tac-action:hover, .tac-item-more > .tac-action[aria-expanded="true"] { background: var(--ta-hover-strong); color: var(--ta-text); }
|
|
3771
|
+
.tac-item-row:hover .tac-item-more > .tac-action, .tac-double-row:hover .tac-item-more > .tac-action, .tac-item-more > .tac-action:focus-visible, .tac-item-more > .tac-action[aria-expanded="true"] { opacity: 1; }
|
|
3057
3772
|
.tac-item-row:hover .tac-item-time, .tac-item-row:has(.tac-item-more [aria-expanded="true"]) .tac-item-time { visibility: hidden; }
|
|
3058
|
-
.tac-agent-menu {
|
|
3059
|
-
|
|
3773
|
+
.tac-agent-menu { position: fixed; right: auto; width: max-content; min-width: 210px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; padding: 5px; border-color: var(--ta-border); background: var(--ta-side); }
|
|
3774
|
+
/* A row whose menu is open is over the rows after it: a row that swipes (ui.SwipeRow) is a layer of its own, which would draw the next rows over its menu. */
|
|
3775
|
+
.ta-swipe-content:has(> .tac-item-more > [aria-expanded="true"]), .tac-item-row:has(> .tac-item-more > [aria-expanded="true"]), .tac-double-row:has(.tac-item-more > [aria-expanded="true"]) { z-index: 5; }
|
|
3060
3776
|
.tac-agent-menu button { gap: 10px; height: 32px; padding: 0 9px; border-radius: 7px; }
|
|
3061
3777
|
.tac-agent-menu button:disabled { opacity: 0.4; cursor: default; background: none; }
|
|
3062
3778
|
.tac-menu-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
3063
3779
|
.tac-menu-line { height: 1px; margin: 4px 2px; border: 0; background: var(--ta-border-muted); }
|
|
3064
3780
|
.tac-menu button.tac-danger, .tac-menu button.tac-danger svg { color: var(--ta-red); }
|
|
3065
|
-
textarea.tac-role-input { min-height: 200px; max-height: 50vh; font-size: 13px; line-height: 1.6; }
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3781
|
+
textarea.tac-role-input { min-height: 200px; max-height: 50vh; font-size: calc(13px * var(--ta-font-scale)); line-height: 1.6; }
|
|
3782
|
+
/*
|
|
3783
|
+
* A finger (the page's data-touch) has no hover: no …, a long press opens its menu (MoreMenu listens for the
|
|
3784
|
+
* contextmenu of the row), and the time stays. A row is marked while pressed, not after (iOS keeps :hover on what was tapped).
|
|
3785
|
+
*/
|
|
3786
|
+
:root[data-touch] .tac-item-more > .tac-action { visibility: hidden; }
|
|
3787
|
+
:root[data-touch] .tac-item-row .tac-item-time { visibility: visible; }
|
|
3788
|
+
:root[data-touch] .tac-double { padding-right: 10px; }
|
|
3789
|
+
:root[data-touch] .tac-item:not(.tac-selected):hover, :root[data-touch] .tac-double:not(.tac-selected):hover { background: none; }
|
|
3790
|
+
/* A phone, as its messaging apps: the row picked is not marked; its conversation covers the list, and back on the list nothing is picked. */
|
|
3791
|
+
:root[data-handheld] .tac-item.tac-selected, :root[data-handheld] .tac-double.tac-selected { background: none; }
|
|
3792
|
+
:root[data-touch] .tac-item:active, :root[data-touch] .tac-double:active { background: var(--ta-hover); }
|
|
3793
|
+
/* The side bar of the double: its sections, folding */
|
|
3794
|
+
.tac-double-line { display: flex; align-items: center; gap: 3px; min-width: 0; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); line-height: calc(16px * var(--ta-font-scale)); }
|
|
3795
|
+
.tac-double-line > .ta-status { margin-left: -3px; }
|
|
3796
|
+
.tac-double-line > .tac-ready::before { background: var(--ta-green); }
|
|
3797
|
+
.tac-double-line > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
3798
|
+
.tac-double-line.tac-waiting { color: color-mix(in srgb, var(--ta-yellow) 85%, var(--ta-text)); }
|
|
3799
|
+
.tac-section { display: flex; flex-direction: column; }
|
|
3800
|
+
.tac-section + .tac-section { margin-top: 6px; }
|
|
3801
|
+
.tac-section-head { display: flex; align-items: center; gap: 6px; width: 100%; height: 28px; margin: 0; padding: 0 10px 0 8px; border: 0; border-radius: 8px; background: none; color: var(--ta-muted); font: inherit; font-size: calc(12px * var(--ta-font-scale)); font-weight: 500; text-align: left; cursor: pointer; transition: background 120ms, color 120ms; }
|
|
3802
|
+
.tac-section-head:hover { background: var(--ta-hover); color: var(--ta-secondary); }
|
|
3803
|
+
.tac-section-head-row { position: relative; }
|
|
3804
|
+
/* Left of the count, so that the counts of every section stay in one column; seen on hover, or while on. */
|
|
3805
|
+
.tac-section-action { position: absolute; top: 3px; right: 26px; display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--ta-muted); cursor: pointer; opacity: 0; transition: opacity 120ms, background 120ms, color 120ms; }
|
|
3806
|
+
.tac-section-head-row:hover .tac-section-action, .tac-section-action:focus-visible, .tac-section-action[aria-pressed="true"] { opacity: 1; }
|
|
3807
|
+
.tac-section-action:hover { background: var(--ta-hover-strong); color: var(--ta-secondary); }
|
|
3808
|
+
.tac-section-action[aria-pressed="true"] { color: var(--ta-accent); }
|
|
3809
|
+
.tac-section-head:focus-visible { outline: 1px solid var(--ta-border-focus); outline-offset: -1px; }
|
|
3810
|
+
.tac-section-chevron { width: 6px; height: 6px; margin: 0 3px 0 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-1px) rotate(45deg); transition: transform 160ms var(--ta-ease, ease); }
|
|
3811
|
+
.tac-closed .tac-section-chevron { transform: translateX(-1px) rotate(-45deg); }
|
|
3812
|
+
.tac-section-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
3813
|
+
.tac-section-count { flex: none; color: var(--ta-muted); font-size: calc(11px * var(--ta-font-scale)); font-variant-numeric: tabular-nums; }
|
|
3814
|
+
.tac-section-body { display: flex; flex-direction: column; animation: tac-unfold 160ms ease-out; }
|
|
3815
|
+
.tac-section-body > .tac-folder:first-child { margin-top: 4px; }
|
|
3816
|
+
@keyframes tac-unfold { from { opacity: 0; transform: translateY(-3px); } }
|
|
3817
|
+
@media (prefers-reduced-motion: reduce) { .tac-section-body, .tac-section-chevron { animation: none; transition: none; } }
|
|
3818
|
+
.tac-item-bottom > .ta-status { margin: 0 -3px 0 -3px; }
|
|
3819
|
+
.tac-item-preview.tac-waiting { color: color-mix(in srgb, var(--ta-yellow) 85%, var(--ta-text)); }
|
|
3820
|
+
.tac-task-face { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 11px; overflow: hidden; }
|
|
3821
|
+
.tac-task-glyph { background: var(--ta-chip); color: var(--ta-secondary); }
|
|
3822
|
+
.tac-tasks-empty { display: flex; align-items: center; gap: 10px; width: calc(100% - 16px); margin: 0 8px; padding: 8px 10px; border: 1px dashed var(--ta-border); border-radius: 12px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background 120ms, border-color 120ms; }
|
|
3823
|
+
.tac-tasks-empty:hover { background: var(--ta-hover); border-color: var(--ta-border-field); }
|
|
3824
|
+
.tac-tasks-empty .tac-item-title { color: var(--ta-secondary); }
|
|
3825
|
+
.tac-tasks-empty .tac-item-preview { white-space: normal; }
|
|
3826
|
+
.tac-show-all { align-self: flex-start; height: 26px; margin: 0 4px 4px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--ta-muted); font: inherit; font-size: calc(12px * var(--ta-font-scale)); cursor: pointer; }
|
|
3827
|
+
.tac-show-all:hover { background: var(--ta-hover); color: var(--ta-secondary); }
|
|
3828
|
+
.tac-temporary { flex: none; padding: 0 5px; border-radius: 999px; background: var(--ta-hover-strong); color: var(--ta-secondary); font-size: calc(10.5px * var(--ta-font-scale)); font-weight: 500; line-height: calc(16px * var(--ta-font-scale)); }
|
|
3829
|
+
/* A task's channel in the workbench */
|
|
3830
|
+
.tac-scene { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--ta-main); }
|
|
3831
|
+
.tac-scene-head { display: flex; align-items: center; gap: 10px; flex: none; min-height: 48px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--ta-border-muted); }
|
|
3832
|
+
.tac-scene-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
|
|
3833
|
+
.tac-scene-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(13.5px * var(--ta-font-scale)); font-weight: 600; line-height: calc(18px * var(--ta-font-scale)); }
|
|
3834
|
+
.tac-scene-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); line-height: calc(16px * var(--ta-font-scale)); }
|
|
3835
|
+
.tac-scene-main { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 28px; }
|
|
3836
|
+
.tac-scene .tac-chat-col { padding: 14px 16px 10px; }
|
|
3837
|
+
.tac-scene .tac-chat-bottom { padding: 6px 12px calc(12px + env(safe-area-inset-bottom)); }
|
|
3838
|
+
/* A finger (the page's data-touch): rows of the menu of a finger's height */
|
|
3839
|
+
:root[data-touch] .tac-menu button { min-height: 44px; font-size: calc(15px * var(--ta-font-scale)); }
|
|
3840
|
+
:root[data-touch] .tac-agent-menu { min-width: 220px; padding: 6px; border-radius: 14px; animation: tac-menu-in 140ms var(--ta-ease, ease-out); }
|
|
3841
|
+
:root[data-touch] .tac-agent-menu button { height: 44px; padding: 0 14px; border-radius: 10px; }
|
|
3842
|
+
:root[data-touch] .tac-agent-menu button:active:not(:disabled) { background: var(--ta-hover); }
|
|
3843
|
+
:root[data-touch] .tac-agent-menu .tac-menu-line { margin: 4px 10px; }
|
|
3844
|
+
:root[data-touch] .tac-item:has(~ .tac-item-more > [aria-expanded="true"]), :root[data-touch] .tac-double:has(~ .tac-item-more > [aria-expanded="true"]) { background: var(--ta-hover); }
|
|
3845
|
+
@keyframes tac-menu-in { from { opacity: 0; transform: scale(0.94); } }
|
|
3846
|
+
@media (prefers-reduced-motion: reduce) { :root[data-touch] .tac-agent-menu { animation: none; } }
|
|
3847
|
+
:root[data-touch] .tac-section-action { opacity: 1; }
|
|
3070
3848
|
`;
|
|
3071
3849
|
function injectStyle() {
|
|
3072
3850
|
const element = document.createElement("style");
|
|
@@ -3096,6 +3874,15 @@ function activate(pi) {
|
|
|
3096
3874
|
pi.ui.showView(MEMBERS_VIEW);
|
|
3097
3875
|
}
|
|
3098
3876
|
};
|
|
3877
|
+
const tasks = new ChannelTaskSource(context);
|
|
3878
|
+
let language = pi.ui.language;
|
|
3879
|
+
context.refreshTasks = (now) => {
|
|
3880
|
+
if (now !== language) {
|
|
3881
|
+
language = now;
|
|
3882
|
+
tasks.refresh();
|
|
3883
|
+
}
|
|
3884
|
+
};
|
|
3885
|
+
pi.registerTasks(tasks);
|
|
3099
3886
|
pi.registerView("channels", {
|
|
3100
3887
|
title: () => ChannelWords.of(pi.ui.language).title,
|
|
3101
3888
|
icon: ChannelViews.icon(pi, "Bot"),
|