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