@celljs/ta-channels 4.7.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 +996 -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 -66
- package/web-src/views.tsx +0 -233
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) => {
|
|
@@ -1331,10 +1417,27 @@ var ChannelViews;
|
|
|
1331
1417
|
return error instanceof Error ? error.message : String(error);
|
|
1332
1418
|
}
|
|
1333
1419
|
ChannelViews.message = message;
|
|
1420
|
+
let latest;
|
|
1334
1421
|
async function openAgent(context, agentId) {
|
|
1335
|
-
|
|
1336
|
-
context.sessions.
|
|
1337
|
-
|
|
1422
|
+
latest = agentId;
|
|
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) {
|
|
1438
|
+
await context.pi.switchSession(sessionId);
|
|
1439
|
+
}
|
|
1440
|
+
await shown;
|
|
1338
1441
|
}
|
|
1339
1442
|
ChannelViews.openAgent = openAgent;
|
|
1340
1443
|
})(ChannelViews ||= {});
|
|
@@ -1408,10 +1511,6 @@ var SidebarUtil;
|
|
|
1408
1511
|
return date.toLocaleDateString(language, { year: "2-digit", month: "numeric", day: "numeric" });
|
|
1409
1512
|
}
|
|
1410
1513
|
SidebarUtil.time = time;
|
|
1411
|
-
function host(cwd) {
|
|
1412
|
-
return /^ssh:\/\/([^/]+)/.exec(cwd)?.[1];
|
|
1413
|
-
}
|
|
1414
|
-
SidebarUtil.host = host;
|
|
1415
1514
|
function folder(cwd) {
|
|
1416
1515
|
const parts = cwd.split(/[\\/]+/).filter(Boolean);
|
|
1417
1516
|
return parts[parts.length - 1] ?? cwd;
|
|
@@ -1422,6 +1521,23 @@ var SidebarUtil;
|
|
|
1422
1521
|
return !key || texts.some((text) => text?.toLowerCase().includes(key));
|
|
1423
1522
|
}
|
|
1424
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;
|
|
1425
1541
|
function byDirectory(agents, serverCwd) {
|
|
1426
1542
|
const groups = new Map;
|
|
1427
1543
|
for (const agent of agents) {
|
|
@@ -1665,11 +1781,14 @@ function NewChannelDialog({ context, onClose }) {
|
|
|
1665
1781
|
onChange: (event) => setQuery(event.target.value)
|
|
1666
1782
|
})), /* @__PURE__ */ React.createElement("div", {
|
|
1667
1783
|
className: "tac-pick-list"
|
|
1668
|
-
}, team.agents.length === 0 && /* @__PURE__ */ React.createElement(
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
},
|
|
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) => {
|
|
1673
1792
|
const on = picked.includes(agent.id);
|
|
1674
1793
|
return /* @__PURE__ */ React.createElement("button", {
|
|
1675
1794
|
key: agent.id,
|
|
@@ -1721,9 +1840,9 @@ function MembersView({ context }) {
|
|
|
1721
1840
|
if (!channel) {
|
|
1722
1841
|
return /* @__PURE__ */ React.createElement("div", {
|
|
1723
1842
|
className: "tac-view tac-members"
|
|
1724
|
-
}, /* @__PURE__ */ React.createElement(
|
|
1725
|
-
|
|
1726
|
-
}
|
|
1843
|
+
}, state.loaded && /* @__PURE__ */ React.createElement(pi.ui.Empty, {
|
|
1844
|
+
title: w.noChannel
|
|
1845
|
+
}));
|
|
1727
1846
|
}
|
|
1728
1847
|
return adding ? /* @__PURE__ */ React.createElement(MemberPicker, {
|
|
1729
1848
|
key: channel.id,
|
|
@@ -1822,11 +1941,23 @@ ${agent.role}`,
|
|
|
1822
1941
|
title: w.leadHint
|
|
1823
1942
|
}, /* @__PURE__ */ React.createElement(Crown, {
|
|
1824
1943
|
size: 11
|
|
1825
|
-
}), /* @__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", {
|
|
1826
1948
|
className: `tac-member-detail${answering ? " tac-live" : ""}`
|
|
1827
1949
|
}, detail))), /* @__PURE__ */ React.createElement("span", {
|
|
1828
1950
|
className: "tac-member-actions"
|
|
1829
|
-
},
|
|
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", {
|
|
1830
1961
|
type: "button",
|
|
1831
1962
|
className: "tac-action",
|
|
1832
1963
|
title: w.makeLead,
|
|
@@ -1924,11 +2055,13 @@ function MemberPicker({ context, team, channel, faces }) {
|
|
|
1924
2055
|
className: "tac-members-scroll"
|
|
1925
2056
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
1926
2057
|
className: "tac-members-label"
|
|
1927
|
-
}, ChannelWords.format(w.canAdd, { count: String(others.length) })), others.length === 0 && /* @__PURE__ */ React.createElement(
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
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) => {
|
|
1932
2065
|
const on = picked.includes(agent.id);
|
|
1933
2066
|
return /* @__PURE__ */ React.createElement("button", {
|
|
1934
2067
|
key: agent.id,
|
|
@@ -2045,10 +2178,41 @@ function ChannelHead({ context }) {
|
|
|
2045
2178
|
className: "tac-head-more"
|
|
2046
2179
|
}, "+", members.length - 5)));
|
|
2047
2180
|
}
|
|
2048
|
-
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 }) {
|
|
2049
2212
|
const { pi, service, ui } = context;
|
|
2050
2213
|
const state = useChannels(service);
|
|
2051
|
-
const
|
|
2214
|
+
const shown = useUi(ui).channelId;
|
|
2215
|
+
const channelId = fixed ?? shown;
|
|
2052
2216
|
const faces = useFaces(state.team);
|
|
2053
2217
|
const w = ChannelViews.words(pi);
|
|
2054
2218
|
const list = React.useRef(null);
|
|
@@ -2071,8 +2235,10 @@ function ChannelRoom({ context }) {
|
|
|
2071
2235
|
const Avatar = pi.ui.Avatar;
|
|
2072
2236
|
if (!channel) {
|
|
2073
2237
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2074
|
-
className: "tac-room-
|
|
2075
|
-
}, state.loaded
|
|
2238
|
+
className: "tac-room-page"
|
|
2239
|
+
}, state.loaded && /* @__PURE__ */ React.createElement(pi.ui.Empty, {
|
|
2240
|
+
title: w.pick
|
|
2241
|
+
}));
|
|
2076
2242
|
}
|
|
2077
2243
|
const members = membersOf(state.team, channel);
|
|
2078
2244
|
const agentOf = (id) => state.team.agents.find((agent) => agent.id === id);
|
|
@@ -2092,7 +2258,7 @@ function ChannelRoom({ context }) {
|
|
|
2092
2258
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2093
2259
|
className: "tac-room-page"
|
|
2094
2260
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
2095
|
-
className: "tac-chat",
|
|
2261
|
+
className: "tac-chat ta-conversation",
|
|
2096
2262
|
ref: list
|
|
2097
2263
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
2098
2264
|
className: "tac-chat-col"
|
|
@@ -2161,24 +2327,72 @@ function ChannelRoom({ context }) {
|
|
|
2161
2327
|
`)[0] })),
|
|
2162
2328
|
actions: [
|
|
2163
2329
|
members.map(mention),
|
|
2164
|
-
[
|
|
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
|
+
]
|
|
2165
2343
|
],
|
|
2166
2344
|
onSend: (text) => service.post(channel.id, text)
|
|
2167
2345
|
})));
|
|
2168
2346
|
}
|
|
2169
2347
|
|
|
2170
2348
|
// web-src/more-menu.tsx
|
|
2171
|
-
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
|
+
}
|
|
2172
2360
|
function MoreMenu({ pi, label, items }) {
|
|
2173
2361
|
const w = ChannelViews.words(pi);
|
|
2174
2362
|
const [open, setOpen] = React.useState(false);
|
|
2175
|
-
const
|
|
2363
|
+
const anchor = React.useRef({ right: 0, below: 0, above: 0, finger: undefined });
|
|
2176
2364
|
const root = React.useRef(null);
|
|
2365
|
+
const menu = React.useRef(null);
|
|
2177
2366
|
const Ellipsis = ChannelViews.icon(pi, "Ellipsis");
|
|
2178
|
-
const show = React.useCallback((button) => {
|
|
2179
|
-
|
|
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 };
|
|
2180
2371
|
setOpen(true);
|
|
2181
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]);
|
|
2182
2396
|
React.useEffect(() => {
|
|
2183
2397
|
const row = root.current?.parentElement;
|
|
2184
2398
|
const button = root.current?.querySelector(".tac-action");
|
|
@@ -2187,7 +2401,7 @@ function MoreMenu({ pi, label, items }) {
|
|
|
2187
2401
|
}
|
|
2188
2402
|
const onContextMenu = (event) => {
|
|
2189
2403
|
event.preventDefault();
|
|
2190
|
-
show(button);
|
|
2404
|
+
show(button, event.clientX || event.clientY ? { x: event.clientX, y: event.clientY } : undefined);
|
|
2191
2405
|
};
|
|
2192
2406
|
row.addEventListener("contextmenu", onContextMenu);
|
|
2193
2407
|
return () => row.removeEventListener("contextmenu", onContextMenu);
|
|
@@ -2234,10 +2448,11 @@ function MoreMenu({ pi, label, items }) {
|
|
|
2234
2448
|
}, /* @__PURE__ */ React.createElement(Ellipsis, {
|
|
2235
2449
|
size: 15
|
|
2236
2450
|
})), open && /* @__PURE__ */ React.createElement("div", {
|
|
2237
|
-
|
|
2451
|
+
ref: menu,
|
|
2452
|
+
className: "tac-menu tac-agent-menu",
|
|
2238
2453
|
role: "menu",
|
|
2239
2454
|
"aria-label": label
|
|
2240
|
-
}, items().map((section, index) => /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
2455
|
+
}, items().filter((section) => section.length > 0).map((section, index) => /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
2241
2456
|
key: section[0]?.key ?? index
|
|
2242
2457
|
}, index > 0 && /* @__PURE__ */ React.createElement("hr", {
|
|
2243
2458
|
className: "tac-menu-line"
|
|
@@ -2273,6 +2488,17 @@ function download(name, text) {
|
|
|
2273
2488
|
link.click();
|
|
2274
2489
|
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
2275
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
|
+
}
|
|
2276
2502
|
function AgentMenu({ context, agent, cwd, working }) {
|
|
2277
2503
|
const { pi, service } = context;
|
|
2278
2504
|
const w = ChannelViews.words(pi);
|
|
@@ -2315,11 +2541,10 @@ function AgentMenu({ context, agent, cwd, working }) {
|
|
|
2315
2541
|
}
|
|
2316
2542
|
download(`${agent.name}.md`, ChannelsUtil.markdown(agent, messages, { user: w.you }));
|
|
2317
2543
|
});
|
|
2318
|
-
const remove = act(
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
}
|
|
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");
|
|
2323
2548
|
});
|
|
2324
2549
|
const show = (next) => () => setDialog(next);
|
|
2325
2550
|
const item = (key, label, glyph, run, options = {}) => ({
|
|
@@ -2333,6 +2558,7 @@ function AgentMenu({ context, agent, cwd, working }) {
|
|
|
2333
2558
|
pi,
|
|
2334
2559
|
label: agent.name,
|
|
2335
2560
|
items: () => [
|
|
2561
|
+
...agent.temporary ? [[item("keep", w.keep, "UserPlus", keep)]] : [],
|
|
2336
2562
|
[item("stop", w.stop, "Square", stop, { disabled: !working && !agent.sessionFile }), item("restart", w.restart, "RotateCcw", restart)],
|
|
2337
2563
|
[
|
|
2338
2564
|
item("rename", w.rename, "Pencil", show("rename")),
|
|
@@ -2460,9 +2686,10 @@ function JoinDialog({ context, agent, onClose }) {
|
|
|
2460
2686
|
className: "tac-dialog"
|
|
2461
2687
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
2462
2688
|
className: "tac-pick-list"
|
|
2463
|
-
}, open.length === 0 && /* @__PURE__ */ React.createElement(
|
|
2464
|
-
|
|
2465
|
-
|
|
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", {
|
|
2466
2693
|
key: channel.id,
|
|
2467
2694
|
type: "button",
|
|
2468
2695
|
className: "tac-pick",
|
|
@@ -2481,6 +2708,207 @@ function JoinDialog({ context, agent, onClose }) {
|
|
|
2481
2708
|
}, error)));
|
|
2482
2709
|
}
|
|
2483
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
|
+
|
|
2484
2912
|
// web-src/channel-menu.tsx
|
|
2485
2913
|
function download2(name, text) {
|
|
2486
2914
|
const url = URL.createObjectURL(new Blob([text], { type: "text/markdown;charset=utf-8" }));
|
|
@@ -2490,6 +2918,16 @@ function download2(name, text) {
|
|
|
2490
2918
|
link.click();
|
|
2491
2919
|
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
2492
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
|
+
}
|
|
2493
2931
|
function ChannelMenu({ context, channel, working }) {
|
|
2494
2932
|
const { pi, service, ui } = context;
|
|
2495
2933
|
const { fresh } = useUi(ui);
|
|
@@ -2518,9 +2956,7 @@ function ChannelMenu({ context, channel, working }) {
|
|
|
2518
2956
|
context.showMembers();
|
|
2519
2957
|
});
|
|
2520
2958
|
const stop = act(async () => {
|
|
2521
|
-
|
|
2522
|
-
const sessions = (await pi.server.listSessions()).filter((session) => session.sessionFile && files.has(session.sessionFile));
|
|
2523
|
-
await Promise.all(sessions.map((session) => pi.server.abort(session.sessionId)));
|
|
2959
|
+
await TeamActions.stop(context, working);
|
|
2524
2960
|
pi.ui.notify(ChannelWords.format(w.stoppedChannel, { channel: channel.name }), "info");
|
|
2525
2961
|
});
|
|
2526
2962
|
const exportMarkdown = act(async () => {
|
|
@@ -2531,15 +2967,7 @@ function ChannelMenu({ context, channel, working }) {
|
|
|
2531
2967
|
}
|
|
2532
2968
|
download2(`${channel.name}.md`, ChannelsUtil.channelMarkdown(service.state.team, channel, messages, { user: w.you, ta: w.ta }));
|
|
2533
2969
|
});
|
|
2534
|
-
const remove = act(
|
|
2535
|
-
const sure = await pi.ui.confirm(ChannelWords.format(w.confirmDelete, { channel: channel.name }), undefined, {
|
|
2536
|
-
confirmLabel: w.delete,
|
|
2537
|
-
danger: true
|
|
2538
|
-
});
|
|
2539
|
-
if (sure) {
|
|
2540
|
-
await service.deleteChannel(channel.id);
|
|
2541
|
-
}
|
|
2542
|
-
});
|
|
2970
|
+
const remove = act(() => deleteChannel(context, channel));
|
|
2543
2971
|
const item = (key, label, glyph, run, options = {}) => ({
|
|
2544
2972
|
key,
|
|
2545
2973
|
label,
|
|
@@ -2563,7 +2991,7 @@ function ChannelMenu({ context, channel, working }) {
|
|
|
2563
2991
|
}
|
|
2564
2992
|
|
|
2565
2993
|
// web-src/sidebar.tsx
|
|
2566
|
-
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 }) {
|
|
2567
2995
|
const row = /* @__PURE__ */ React.createElement("button", {
|
|
2568
2996
|
type: "button",
|
|
2569
2997
|
className: `tac-item${selected ? " tac-selected" : ""}`,
|
|
@@ -2580,15 +3008,29 @@ function Row({ avatar, title, badge, preview, live, time, fresh, hint, selected,
|
|
|
2580
3008
|
className: "tac-item-time"
|
|
2581
3009
|
}, time)), /* @__PURE__ */ React.createElement("span", {
|
|
2582
3010
|
className: "tac-item-bottom"
|
|
2583
|
-
}, /* @__PURE__ */ React.createElement("span", {
|
|
2584
|
-
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" : ""}`
|
|
2585
3015
|
}, preview), fresh && /* @__PURE__ */ React.createElement("span", {
|
|
2586
3016
|
className: "tac-fresh"
|
|
2587
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
|
+
}
|
|
2588
3026
|
return more ? /* @__PURE__ */ React.createElement("div", {
|
|
2589
|
-
className
|
|
3027
|
+
className
|
|
2590
3028
|
}, row, more) : row;
|
|
2591
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
|
+
}
|
|
2592
3034
|
function SidebarHead({ context }) {
|
|
2593
3035
|
const { pi, ui } = context;
|
|
2594
3036
|
const { query, creating } = useUi(ui);
|
|
@@ -2672,6 +3114,160 @@ function SidebarHead({ context }) {
|
|
|
2672
3114
|
onClose: () => ui.set({ creating: false })
|
|
2673
3115
|
}));
|
|
2674
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
|
+
}
|
|
2675
3271
|
function AgentsSidebar({ context }) {
|
|
2676
3272
|
const { pi, service, ui } = context;
|
|
2677
3273
|
const state = useChannels(service);
|
|
@@ -2683,18 +3279,29 @@ function AgentsSidebar({ context }) {
|
|
|
2683
3279
|
const double = pi.ui.useView(DOUBLE_PAGE);
|
|
2684
3280
|
const channelPage = pi.ui.useView(CHANNEL_PAGE);
|
|
2685
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);
|
|
2686
3288
|
const [opening, setOpening] = React.useState();
|
|
2687
3289
|
const Folder = ChannelViews.icon(pi, "Folder");
|
|
2688
|
-
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");
|
|
2689
3293
|
const Avatar = pi.ui.Avatar;
|
|
3294
|
+
const Empty = pi.ui.Empty;
|
|
3295
|
+
const Skeleton = pi.ui.Skeleton;
|
|
2690
3296
|
const { team, working } = state;
|
|
3297
|
+
const own = React.useMemo(() => ChannelsUtil.ownChannels(team), [team]);
|
|
2691
3298
|
React.useEffect(() => {
|
|
2692
|
-
for (const channel of
|
|
3299
|
+
for (const channel of own) {
|
|
2693
3300
|
service.messages(channel.id).catch(() => {
|
|
2694
3301
|
return;
|
|
2695
3302
|
});
|
|
2696
3303
|
}
|
|
2697
|
-
}, [service,
|
|
3304
|
+
}, [service, own]);
|
|
2698
3305
|
const name = (id) => ChannelsUtil.authorName(team, id, { user: w.you, ta: w.ta });
|
|
2699
3306
|
const lastSaid = new Map;
|
|
2700
3307
|
for (const messages of Object.values(state.messages)) {
|
|
@@ -2702,8 +3309,12 @@ function AgentsSidebar({ context }) {
|
|
|
2702
3309
|
lastSaid.set(message.author, Math.max(lastSaid.get(message.author) ?? 0, message.at));
|
|
2703
3310
|
}
|
|
2704
3311
|
}
|
|
2705
|
-
const
|
|
2706
|
-
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());
|
|
2707
3318
|
const pageShown = !!double?.shown || !!channelPage?.shown || !!agentPage?.shown;
|
|
2708
3319
|
const openAgent = (agent) => {
|
|
2709
3320
|
setOpening(agent.id);
|
|
@@ -2713,6 +3324,15 @@ function AgentsSidebar({ context }) {
|
|
|
2713
3324
|
const sessionId = context.sessions.get(agent.id);
|
|
2714
3325
|
return opening === agent.id || !pageShown && !!sessionId && sessionId === shownSession;
|
|
2715
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(" · ");
|
|
2716
3336
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2717
3337
|
className: "tac-view"
|
|
2718
3338
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
@@ -2724,17 +3344,26 @@ function AgentsSidebar({ context }) {
|
|
|
2724
3344
|
className: `tac-double${double.shown ? " tac-selected" : ""}`,
|
|
2725
3345
|
"aria-current": double.shown || undefined,
|
|
2726
3346
|
onClick: () => pi.ui.showView(DOUBLE_PAGE)
|
|
3347
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
3348
|
+
className: "tac-double-face"
|
|
2727
3349
|
}, /* @__PURE__ */ React.createElement(Avatar, {
|
|
2728
3350
|
size: 44
|
|
2729
|
-
}), /* @__PURE__ */ React.createElement("span", {
|
|
3351
|
+
})), /* @__PURE__ */ React.createElement("span", {
|
|
3352
|
+
className: "tac-double-text"
|
|
3353
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
2730
3354
|
className: "tac-double-name"
|
|
2731
|
-
}, 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, {
|
|
2732
3360
|
pi,
|
|
2733
3361
|
label: double.title,
|
|
2734
3362
|
items: () => (double.menu?.() ?? []).map((section) => section.map(({ icon: Icon, ...item }) => ({ ...item, icon: Icon && /* @__PURE__ */ React.createElement(Icon, {
|
|
2735
3363
|
size: 15
|
|
2736
3364
|
}) })))
|
|
2737
3365
|
})), draft && /* @__PURE__ */ React.createElement(Row, {
|
|
3366
|
+
pi,
|
|
2738
3367
|
avatar: /* @__PURE__ */ React.createElement(Face, {
|
|
2739
3368
|
face: draft.face,
|
|
2740
3369
|
size: 36
|
|
@@ -2744,18 +3373,142 @@ function AgentsSidebar({ context }) {
|
|
|
2744
3373
|
time: "",
|
|
2745
3374
|
selected: !!agentPage?.shown,
|
|
2746
3375
|
onSelect: () => pi.ui.showView(AGENT_PAGE)
|
|
2747
|
-
}), state.loaded &&
|
|
2748
|
-
|
|
2749
|
-
}
|
|
2750
|
-
|
|
2751
|
-
}
|
|
2752
|
-
|
|
2753
|
-
|
|
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) => {
|
|
2754
3506
|
const members = membersOf(team, channel);
|
|
2755
3507
|
const busy = working[channel.id] ?? [];
|
|
2756
3508
|
const last = state.messages[channel.id]?.filter((message) => message.author !== SYSTEM).at(-1);
|
|
2757
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;
|
|
2758
3510
|
return /* @__PURE__ */ React.createElement(Row, {
|
|
3511
|
+
pi,
|
|
2759
3512
|
key: channel.id,
|
|
2760
3513
|
avatar: /* @__PURE__ */ React.createElement(RoomFace, {
|
|
2761
3514
|
members,
|
|
@@ -2784,111 +3537,77 @@ function AgentsSidebar({ context }) {
|
|
|
2784
3537
|
context,
|
|
2785
3538
|
channel,
|
|
2786
3539
|
working: busy
|
|
2787
|
-
})
|
|
2788
|
-
});
|
|
2789
|
-
}), SidebarUtil.byDirectory(agents, serverCwd).map((group) => /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
2790
|
-
key: group.cwd
|
|
2791
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
2792
|
-
className: "tac-folder",
|
|
2793
|
-
title: group.cwd
|
|
2794
|
-
}, SidebarUtil.host(group.cwd) ? /* @__PURE__ */ React.createElement(Server, {
|
|
2795
|
-
size: 12
|
|
2796
|
-
}) : /* @__PURE__ */ React.createElement(Folder, {
|
|
2797
|
-
size: 12
|
|
2798
|
-
}), /* @__PURE__ */ React.createElement("span", null, SidebarUtil.folder(group.cwd)), SidebarUtil.host(group.cwd) && /* @__PURE__ */ React.createElement("span", {
|
|
2799
|
-
className: "tac-host"
|
|
2800
|
-
}, SidebarUtil.host(group.cwd))), group.agents.map((agent) => {
|
|
2801
|
-
const where = team.channels.find((channel) => working[channel.id]?.includes(agent.id));
|
|
2802
|
-
return /* @__PURE__ */ React.createElement(Row, {
|
|
2803
|
-
key: agent.id,
|
|
2804
|
-
avatar: /* @__PURE__ */ React.createElement(AgentAvatar, {
|
|
2805
|
-
agent,
|
|
2806
|
-
faces,
|
|
2807
|
-
size: 36,
|
|
2808
|
-
working: !!where
|
|
2809
3540
|
}),
|
|
2810
|
-
|
|
2811
|
-
preview: where ? ChannelWords.format(w.answeringIn, { channel: where.name }) : w.idle,
|
|
2812
|
-
live: !!where,
|
|
2813
|
-
time: SidebarUtil.time(lastSaid.get(agent.id) ?? agent.createdAt, pi.ui.language),
|
|
2814
|
-
hint: `@${agent.name} · ${agent.role}`,
|
|
2815
|
-
selected: agentSelected(agent),
|
|
2816
|
-
onSelect: () => openAgent(agent),
|
|
2817
|
-
more: /* @__PURE__ */ React.createElement(AgentMenu, {
|
|
2818
|
-
context,
|
|
2819
|
-
agent,
|
|
2820
|
-
cwd: agent.cwd ?? serverCwd,
|
|
2821
|
-
working: !!where
|
|
2822
|
-
})
|
|
3541
|
+
swipe: swipeDelete(pi, () => deleteChannel(context, channel))
|
|
2823
3542
|
});
|
|
2824
|
-
}))))
|
|
3543
|
+
}))));
|
|
2825
3544
|
}
|
|
2826
3545
|
|
|
2827
3546
|
// web-src/style.ts
|
|
2828
3547
|
var STYLE = `
|
|
2829
|
-
.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)); }
|
|
2830
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; }
|
|
2831
3550
|
.tac-action:hover { background: var(--ta-hover); color: var(--ta-text); }
|
|
2832
3551
|
.tac-toolbar { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
|
|
2833
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; }
|
|
2834
3553
|
.tac-search:focus-within { border-color: var(--ta-border-field); background: var(--ta-input); }
|
|
2835
|
-
.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; }
|
|
2836
3555
|
.tac-search input::placeholder { color: var(--ta-muted); }
|
|
2837
3556
|
.tac-search .tac-action { width: 20px; height: 20px; }
|
|
2838
3557
|
.tac-menu-anchor { position: relative; flex: none; }
|
|
2839
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; }
|
|
2840
3559
|
.tac-add:hover, .tac-add[aria-expanded="true"] { background: var(--ta-hover); color: var(--ta-text); }
|
|
2841
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); }
|
|
2842
|
-
.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; }
|
|
2843
3562
|
.tac-menu button:hover { background: var(--ta-hover); color: var(--ta-text); }
|
|
2844
3563
|
.tac-menu button svg { color: var(--ta-muted); }
|
|
2845
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; }
|
|
2846
3566
|
.tac-list > .tac-view > .tac-form { margin: 2px 10px 8px; }
|
|
2847
|
-
.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; }
|
|
2848
3568
|
.tac-double:hover { background: var(--ta-hover); }
|
|
2849
|
-
.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; }
|
|
2850
3572
|
.tac-double-row { position: relative; }
|
|
2851
3573
|
.tac-pinned { display: inline-flex; flex: none; color: var(--ta-muted); }
|
|
2852
|
-
.tac-double-name {
|
|
2853
|
-
.tac-double-row > .tac-item-more { top: 14px; right: 16px; transform: none; }
|
|
2854
|
-
.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)); }
|
|
2855
3575
|
.tac-item-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
2856
3576
|
.tac-item-bottom .tac-item-preview { flex: 1; min-width: 0; }
|
|
2857
3577
|
.tac-fresh { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--ta-green); }
|
|
2858
3578
|
.tac-head { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding-left: 8px; }
|
|
2859
3579
|
.tac-head-title { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; white-space: nowrap; }
|
|
2860
|
-
.tac-head-title strong { overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; font-weight: 600; }
|
|
2861
|
-
.tac-head-count { flex: none; color: var(--ta-muted); font-size: 12px; }
|
|
2862
|
-
.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)); }
|
|
2863
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; }
|
|
2864
3584
|
.tac-head-members:hover, .tac-head-members.tac-on { background: var(--ta-hover); }
|
|
2865
3585
|
.tac-head-members:focus-visible { outline: 1px solid var(--ta-border-focus); outline-offset: -1px; }
|
|
2866
3586
|
.tac-head-face { display: inline-flex; margin-left: -4px; padding: 1px; border-radius: 50%; background: var(--ta-main); }
|
|
2867
3587
|
.tac-head-members:hover .tac-head-face, .tac-head-members.tac-on .tac-head-face { background: var(--ta-hover); }
|
|
2868
|
-
.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)); }
|
|
2869
3589
|
.tac-action.tac-on { background: var(--ta-hover-strong); color: var(--ta-text); }
|
|
2870
3590
|
.tac-room-page { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--ta-main); color: var(--ta-text); }
|
|
2871
|
-
.tac-room-none { display: grid; place-items: center; flex: 1; color: var(--ta-muted); font-size: 13px; }
|
|
2872
3591
|
.tac-chat { flex: 1; min-height: 0; overflow-y: auto; }
|
|
2873
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; }
|
|
2874
|
-
.tac-chat-time { align-self: center; margin: 14px 0 6px; color: var(--ta-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
|
|
2875
|
-
.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; }
|
|
2876
|
-
.tac-chat-empty strong { margin-top: 6px; color: var(--ta-text); font-size: 16px; }
|
|
2877
|
-
.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)); }
|
|
2878
3597
|
.tac-mine { margin: 6px 0 2px; }
|
|
2879
3598
|
.tac-msg { display: flex; align-items: flex-start; gap: 10px; }
|
|
2880
3599
|
.tac-msg.tac-first { margin-top: 10px; }
|
|
2881
3600
|
.tac-msg-face { display: flex; justify-content: center; width: 28px; flex: none; }
|
|
2882
3601
|
.tac-msg-col { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: min(84%, var(--ta-col)); }
|
|
2883
|
-
.tac-msg-name { display: flex; align-items: center; gap: 6px; margin: 0 2px 4px; color: var(--ta-muted); font-size: 12px; line-height: 16px; }
|
|
2884
|
-
.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)); }
|
|
2885
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; }
|
|
2886
3605
|
.tac-msg-bubble.tac-failed { border-color: color-mix(in srgb, var(--ta-red) 35%, transparent); }
|
|
2887
|
-
.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)); }
|
|
2888
3607
|
.tac-msg-bubble pre { max-width: 100%; overflow-x: auto; }
|
|
2889
3608
|
.tac-mention { color: var(--ta-link); }
|
|
2890
|
-
.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; }
|
|
2891
|
-
.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)); }
|
|
2892
3611
|
.tac-live-faces { display: inline-flex; }
|
|
2893
3612
|
.tac-live-faces > * + * { margin-left: -4px; }
|
|
2894
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; }
|
|
@@ -2900,13 +3619,13 @@ var STYLE = `
|
|
|
2900
3619
|
.tac-new-head { position: relative; display: flex; align-items: center; justify-content: center; flex: 1; min-width: 0; height: 100%; }
|
|
2901
3620
|
.tac-new-title { position: relative; display: flex; justify-content: center; min-width: 0; }
|
|
2902
3621
|
.tac-new-head > .tac-button { position: absolute; right: 0; }
|
|
2903
|
-
.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; }
|
|
2904
3623
|
.tac-new-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2905
3624
|
.tac-new-trigger:hover, .tac-new-trigger[aria-expanded="true"] { background: var(--ta-hover); }
|
|
2906
3625
|
.tac-new-trigger svg { flex: none; color: var(--ta-muted); }
|
|
2907
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; }
|
|
2908
|
-
.tac-identity-label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; color: var(--ta-muted); font-size: 12px; }
|
|
2909
|
-
.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)); }
|
|
2910
3629
|
.tac-faces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
|
|
2911
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; }
|
|
2912
3631
|
.tac-face-pick:hover { background: var(--ta-hover); }
|
|
@@ -2916,53 +3635,52 @@ var STYLE = `
|
|
|
2916
3635
|
.tac-button.tac-quiet:hover { background: var(--ta-hover); color: var(--ta-text); }
|
|
2917
3636
|
.tac-new-page { display: flex; flex: 1; min-height: 0; overflow-y: auto; background: var(--ta-main); color: var(--ta-text); }
|
|
2918
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; }
|
|
2919
|
-
.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; }
|
|
2920
3639
|
.tac-new-name .tac-action { color: var(--ta-muted); }
|
|
2921
|
-
.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; }
|
|
2922
3641
|
.tac-new-box { width: 100%; display: flex; flex-direction: column; gap: 8px; }
|
|
2923
3642
|
.tac-dialog { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
|
|
2924
|
-
.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)); }
|
|
2925
3644
|
div.tac-dialog-label { flex-direction: row; justify-content: space-between; margin-top: 6px; }
|
|
2926
3645
|
.tac-dialog-count { color: var(--ta-muted); font-variant-numeric: tabular-nums; }
|
|
2927
|
-
.tac-dialog-input { height: 40px; font-size: 14px; }
|
|
3646
|
+
.tac-dialog-input { height: 40px; font-size: calc(14px * var(--ta-font-scale)); }
|
|
2928
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; }
|
|
2929
3648
|
.tac-dialog-search:focus-within { border-color: var(--ta-border-focus); }
|
|
2930
|
-
.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; }
|
|
2931
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; }
|
|
2932
|
-
.tac-pick-list > .tac-empty { padding: 14px 10px; }
|
|
2933
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; }
|
|
2934
3652
|
.tac-pick:hover:not(:disabled) { background: var(--ta-hover); }
|
|
2935
3653
|
.tac-pick:disabled { opacity: 0.45; cursor: default; }
|
|
2936
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; }
|
|
2937
3655
|
.tac-pick.tac-on .tac-check { border-color: var(--ta-text); background: var(--ta-text); }
|
|
2938
3656
|
.tac-pick-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
|
|
2939
|
-
.tac-pick-name { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
|
|
2940
|
-
.tac-pick-role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: 12px; }
|
|
2941
|
-
.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)); }
|
|
2942
3660
|
.tac-dialog-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
|
|
2943
|
-
.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)); }
|
|
2944
3662
|
@media (max-width: 720px) {
|
|
2945
3663
|
.tac-new-head > .tac-button { position: static; margin-left: auto; }
|
|
2946
3664
|
.tac-new-head { justify-content: flex-start; }
|
|
2947
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; }
|
|
2948
3666
|
}
|
|
2949
3667
|
.tac-empty { padding: 8px 18px; }
|
|
2950
|
-
.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; }
|
|
2951
3669
|
.tac-item:hover { background: var(--ta-hover); }
|
|
2952
|
-
.tac-item.tac-selected { background: var(--ta-
|
|
2953
|
-
.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); }
|
|
2954
3671
|
.tac-item-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
|
|
2955
3672
|
.tac-item-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
2956
|
-
.tac-item-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 500; line-height: 18px; }
|
|
2957
|
-
.tac-item-time { flex: none; margin-left: auto; padding-left: 4px; color: var(--ta-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
|
|
2958
|
-
.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)); }
|
|
2959
3676
|
.tac-item-preview.tac-live { color: var(--ta-green); }
|
|
2960
|
-
.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; }
|
|
2961
3678
|
.tac-lead span { overflow: hidden; text-overflow: ellipsis; }
|
|
2962
3679
|
.tac-lead svg { flex: none; }
|
|
2963
|
-
.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)); }
|
|
2964
3681
|
.tac-folder span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2965
|
-
.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; }
|
|
2966
3684
|
.tac-face { display: inline-flex; flex: none; }
|
|
2967
3685
|
.tac-face svg { display: block; overflow: visible; }
|
|
2968
3686
|
.tac-face-eyes { transform-box: fill-box; transform-origin: center; animation: tac-blink 5.2s infinite; }
|
|
@@ -2978,34 +3696,34 @@ div.tac-dialog-label { flex-direction: row; justify-content: space-between; marg
|
|
|
2978
3696
|
.tac-room { position: relative; display: inline-flex; flex: none; }
|
|
2979
3697
|
.tac-room-back { position: absolute; right: 0; top: 0; }
|
|
2980
3698
|
.tac-room-front { position: absolute; left: 0; bottom: 0; z-index: 1; }
|
|
2981
|
-
.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; }
|
|
2982
3700
|
.tac-error { color: var(--ta-red); }
|
|
2983
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); }
|
|
2984
|
-
.tac-form label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--ta-secondary); }
|
|
2985
|
-
.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)); }
|
|
2986
3704
|
.tac-input:focus { outline: none; border-color: var(--ta-border-focus); }
|
|
2987
3705
|
textarea.tac-input { resize: vertical; min-height: 56px; line-height: 1.5; }
|
|
2988
3706
|
.tac-chips { display: flex; flex-wrap: wrap; gap: 4px; }
|
|
2989
|
-
.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; }
|
|
2990
3708
|
.tac-chip.tac-on { border-color: var(--ta-accent); color: var(--ta-text); background: var(--ta-selected); }
|
|
2991
3709
|
.tac-chip small { color: var(--ta-muted); }
|
|
2992
3710
|
.tac-buttons { display: flex; justify-content: flex-end; gap: 6px; }
|
|
2993
|
-
.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; }
|
|
2994
3712
|
.tac-button.tac-primary { border-color: transparent; background: var(--ta-text); color: var(--ta-main); }
|
|
2995
3713
|
.tac-button:disabled { opacity: 0.5; cursor: default; }
|
|
2996
3714
|
.tac-button.tac-danger { border-color: transparent; background: var(--ta-red); color: #fff; }
|
|
2997
|
-
.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; }
|
|
2998
3717
|
.tac-link:hover { background: var(--ta-hover); }
|
|
2999
3718
|
.tac-link.tac-danger { color: var(--ta-red); }
|
|
3000
3719
|
.tac-members { background: var(--ta-main); }
|
|
3001
|
-
.tac-members-none { display: grid; place-items: center; flex: 1; padding: 24px; color: var(--ta-muted); text-align: center; }
|
|
3002
3720
|
.tac-members-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 12px; }
|
|
3003
3721
|
.tac-members-top { display: flex; align-items: center; gap: 12px; padding: 14px 10px 12px; }
|
|
3004
3722
|
.tac-members-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
|
|
3005
|
-
.tac-members-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
|
|
3006
|
-
.tac-members-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: 12px; }
|
|
3007
|
-
.tac-members-label { padding: 10px 10px 6px; color: var(--ta-muted); font-size: 12px; }
|
|
3008
|
-
.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)); }
|
|
3009
3727
|
.tac-members-search { flex: none; margin: 6px 16px 2px; }
|
|
3010
3728
|
.tac-members-sep { height: 1px; margin: 6px 10px; background: var(--ta-border-muted); }
|
|
3011
3729
|
.tac-member { position: relative; display: flex; align-items: center; border-radius: 12px; transition: background 120ms; }
|
|
@@ -3013,11 +3731,11 @@ textarea.tac-input { resize: vertical; min-height: 56px; line-height: 1.5; }
|
|
|
3013
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; }
|
|
3014
3732
|
.tac-members-scroll > .tac-member-main:hover { background: var(--ta-hover); }
|
|
3015
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; }
|
|
3016
|
-
.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); }
|
|
3017
3735
|
.tac-member-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
|
|
3018
|
-
.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)); }
|
|
3019
3737
|
.tac-member-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
3020
|
-
.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)); }
|
|
3021
3739
|
.tac-member-detail.tac-live { color: var(--ta-green); }
|
|
3022
3740
|
.tac-member.tac-muted .tac-member-main > :first-child { opacity: 0.5; }
|
|
3023
3741
|
.tac-member-actions { display: flex; align-items: center; gap: 2px; flex: none; padding-right: 8px; opacity: 0; transition: opacity 120ms; }
|
|
@@ -3031,8 +3749,8 @@ textarea.tac-input { resize: vertical; min-height: 56px; line-height: 1.5; }
|
|
|
3031
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); }
|
|
3032
3750
|
.tac-pick.tac-on .tac-check { border-color: var(--ta-green); background: var(--ta-green); }
|
|
3033
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); }
|
|
3034
|
-
.tac-members-ask { flex: 1; min-width: 0; color: var(--ta-body); font-size: 12.5px; }
|
|
3035
|
-
.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)); }
|
|
3036
3754
|
@media (hover: none) {
|
|
3037
3755
|
.tac-member-actions { opacity: 1; }
|
|
3038
3756
|
.tac-member.tac-muted .tac-member-actions > :not(.tac-on) { visibility: visible; }
|
|
@@ -3042,27 +3760,91 @@ textarea.tac-input { resize: vertical; min-height: 56px; line-height: 1.5; }
|
|
|
3042
3760
|
@media (pointer: coarse) {
|
|
3043
3761
|
.tac-item { padding: 10px; }
|
|
3044
3762
|
.tac-action { width: 32px; height: 32px; }
|
|
3045
|
-
.tac-input { font-size: 16px; }
|
|
3763
|
+
.tac-input { font-size: max(16px, calc(16px * var(--ta-font-scale))); }
|
|
3046
3764
|
}
|
|
3047
3765
|
/* The … of an agent: over the time while its row is hovered, focused or its menu open */
|
|
3048
|
-
.tac-item-row { position: relative; }
|
|
3049
|
-
|
|
3050
|
-
.tac-item-more { position: absolute; right:
|
|
3051
|
-
.tac-item-more > .tac-action { width:
|
|
3052
|
-
.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; }
|
|
3053
3772
|
.tac-item-row:hover .tac-item-time, .tac-item-row:has(.tac-item-more [aria-expanded="true"]) .tac-item-time { visibility: hidden; }
|
|
3054
|
-
.tac-agent-menu {
|
|
3055
|
-
|
|
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; }
|
|
3056
3776
|
.tac-agent-menu button { gap: 10px; height: 32px; padding: 0 9px; border-radius: 7px; }
|
|
3057
3777
|
.tac-agent-menu button:disabled { opacity: 0.4; cursor: default; background: none; }
|
|
3058
3778
|
.tac-menu-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
3059
3779
|
.tac-menu-line { height: 1px; margin: 4px 2px; border: 0; background: var(--ta-border-muted); }
|
|
3060
3780
|
.tac-menu button.tac-danger, .tac-menu button.tac-danger svg { color: var(--ta-red); }
|
|
3061
|
-
textarea.tac-role-input { min-height: 200px; max-height: 50vh; font-size: 13px; line-height: 1.6; }
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
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; }
|
|
3066
3848
|
`;
|
|
3067
3849
|
function injectStyle() {
|
|
3068
3850
|
const element = document.createElement("style");
|
|
@@ -3092,6 +3874,15 @@ function activate(pi) {
|
|
|
3092
3874
|
pi.ui.showView(MEMBERS_VIEW);
|
|
3093
3875
|
}
|
|
3094
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);
|
|
3095
3886
|
pi.registerView("channels", {
|
|
3096
3887
|
title: () => ChannelWords.of(pi.ui.language).title,
|
|
3097
3888
|
icon: ChannelViews.icon(pi, "Bot"),
|