@celljs/ta-channels 4.9.1 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +2 -2
- package/README.md +2 -2
- package/host/index.mjs +50 -0
- package/package.json +3 -3
- package/web/index.js +398 -243
package/README.en.md
CHANGED
|
@@ -12,8 +12,8 @@ A built-in Ta package (enabled by default but can be toggled in the Web client's
|
|
|
12
12
|
- **Channel**: members (agents, with the first being the lead) and messages. Messages are sent to members `@`-mentioned; agents' answers are posted back to the channel, and if they `@` someone in their answer, it is passed on to them. Each agent processes one message at a time. Users can mute members in a channel (`muted`): they do not answer anything in this channel, even if `@`-mentioned; when the lead is muted, messages with no one `@`-mentioned go to the next unmuted member.
|
|
13
13
|
- **Loop prevention** (`ChannelsUtil.limit`): relaying between agents is at most 3 hops; one message yields at most 8 answers, with at most 2 per agent. When cut off, after this round a light-colored note is appended to the channel ("reached relay limit, waiting for you to continue"), only once per round; the return from `post_to_channel` includes this note too.
|
|
14
14
|
- **Tools**: each session in Ta (web pages and other clients connected to ta serve) has `create_agent`, `create_channel`, `add_to_channel`, `post_to_channel`, and `list_channels`. When a user specifies a goal ("assemble a team to do the landing page"), Ta creates agents and channels, posts the goal, and waits for answers from each member before replying to the user. When a role is missing from a channel, Ta uses `add_to_channel` to add an existing agent (added after existing members; lead unchanged). The open page marks this channel with a green dot in the sidebar, which disappears when opened. Pausing Ta just stops waiting; agents continue to answer in the channel.
|
|
15
|
-
- **Tasks of the double** (see `docs/design/ta-double.md`): a channel Ta builds with its tools has `by: 'ta'` and the session that built it (`origin`), and is listed as a task of the double (`registerTasks`), not among the user's own channels; the agents it makes are `temporary`, shown with their team until the user keeps them in the members panel or the agent's menu, and one in no channel is listed among the members. This list of the navigation is called "Double": the double's card, the tasks
|
|
16
|
-
- **UI**: "Agents" at the top of the navigation bar (above "Conversations"; the first bottom tab on a phone) puts the double, channels, and agents together (the double is a built-in page from ta-web, and once enabled is listed at the top, no longer appears separately in the navigation bar); the search box and + are at the top of the sidebar. + → create agent opens a draft page in the main area: first assigns an unused name and avatar, clicking the name in the top bar can rename or pick from 16 avatars, the sidebar has one more line "not started"; the agent is truly created when the first message is sent from the input box (responsibility is generic, what to do is written in this message), then switches to its session and sends the message. + → create channel is a dialog: name, search and check agents (1–12, first checked is lead), create; channel row has lead first, next member in overlapping avatars, lead is labeled beside the name, second line is the most recent message or who's answering; agents are grouped by working directory, second line is "idle" or which channel they're answering in, right side is time of most recent message. Click agent to open its session: it is in front at once, under the agent's name, showing that it opens (`pi.switchSession` takes the promise of the `openAgent` request), and shows as the current conversation once the server opens or finds the session. Hovering over agent row (long-press on touch) shows …, menu has: stop (abort its current answer), restart (open new session), rename, responsibility (edit the role in the system prompt, takes effect in next session), move to… (switch working directory, open new session in that directory), copy working directory, export conversation (Markdown, strip channel context blocks), add to channel, delete (leave all channels it's in, delete channels that only have it, keep the session file); when near the bottom the menu expands upward. Channel is a page in the main area (not in the right workbench), displayed as a group chat: others' messages on the left with avatar and name, user's on the
|
|
15
|
+
- **Tasks of the double** (see `docs/design/ta-double.md`): a channel Ta builds with its tools has `by: 'ta'` and the session that built it (`origin`), and is listed as a task of the double (`registerTasks`), not among the user's own channels; the agents it makes are `temporary`, shown with their team until the user keeps them in the members panel or the agent's menu, and one in no channel is listed among the members. This list of the navigation is called "Double": the double's card, the tasks in one list (what waits for you first, then what goes on, then what ended), the members (as contacts, by directory if the user wants), the channels, each section folding (kept in the browser). A team opened from its task shows in the workbench on the right, with "Open in the main area" in its bar. While the double asks first, the team tools ask with `ctx.ui.confirm` before they build a team and before work goes to a channel the user did not let them use. Below, the channels and agents once listed flat are now under "Channels" and "Members".
|
|
16
|
+
- **UI**: "Agents" at the top of the navigation bar (above "Conversations"; the first bottom tab on a phone) puts the double, channels, and agents together (the double is a built-in page from ta-web, and once enabled is listed at the top, no longer appears separately in the navigation bar); the search box and + are at the top of the sidebar. + → create agent opens a draft page in the main area: first assigns an unused name and avatar, clicking the name in the top bar can rename or pick from 16 avatars, the sidebar has one more line "not started"; the agent is truly created when the first message is sent from the input box (responsibility is generic, what to do is written in this message), then switches to its session and sends the message. + → create channel is a dialog: name, search and check agents (1–12, first checked is lead), create; channel row has lead first, next member in overlapping avatars, lead is labeled beside the name, second line is the most recent message or who's answering; agents are grouped by working directory, second line is "idle" or which channel they're answering in, right side is time of most recent message. Click agent to open its session: it is in front at once, under the agent's name, showing that it opens (`pi.switchSession` takes the promise of the `openAgent` request), and shows as the current conversation once the server opens or finds the session. Hovering over agent row (long-press on touch) shows …, menu has: stop (abort its current answer), restart (open new session), rename, responsibility (edit the role in the system prompt, takes effect in next session), move to… (switch working directory, open new session in that directory), copy working directory, export conversation (Markdown, strip channel context blocks), add to channel, delete (leave all channels it's in, delete channels that only have it, keep the session file); when near the bottom the menu expands upward. Channel is a page in the main area (not in the right workbench), displayed as a group chat: others' messages on the left with avatar and name, user's on the right, consecutive messages are grouped, after a long pause insert a time line; top bar is channel name and member avatars, click avatar to open "Channel Members" (`members`, `location: 'panel'` view, follows the current channel) in the right workbench: lists members, lead has a marker, answering ones are marked green; each row opens that agent's session, hovering (long-press on touch) shows set as lead, mute, restart session (forget earlier conversation, open new session next time it answers, old session stays in conversation list), and remove from channel (at least one left); top has "Add Members" as a searchable agent list, check to add, bottom of list has "New Agent" to open the draft page for creating a new agent; bottom has delete channel (confirm once more, messages deleted too, ongoing answers no longer posted). Input box is the conversation input box (`pi.ui.Composer`), `@` lists members, + allows naming members or adding members (opens the member list for adding); messages use the conversation's Markdown rendering (`pi.ui.Markdown`), `@`-mentioned members are bold.
|
|
17
17
|
|
|
18
18
|
## Data and Forwarding
|
|
19
19
|
|
package/README.md
CHANGED
|
@@ -12,8 +12,8 @@ Ta 自带的 pi 包(默认开启,可在 Web 客户端的 设置 → 包 关
|
|
|
12
12
|
- **频道**:成员(智能体,第一个是负责人)和消息。消息发给其中 `@` 到的成员;智能体的回答贴回频道,它在回答里 `@` 谁就再交给谁。每个智能体一次只处理一条消息。用户可以把成员设为免打扰(`muted`):它在这个频道里什么都不回答,被 `@` 也不回答;负责人免打扰时,没人被 `@` 的消息交给下一位没有免打扰的成员。
|
|
13
13
|
- **防循环**(`ChannelsUtil.limit`):智能体之间接力最多 3 跳,一条消息引出的回答最多 8 条、每个智能体最多 2 条;被截断时,等这一轮结束后在频道里追加一行淡色说明("已到交接上限,等你继续"),每轮只追加一次,`post_to_channel` 的返回里也带上这句。
|
|
14
14
|
- **工具**:ta serve 里 Ta 的每个会话(Web 页面里的对话,以及连到 ta serve 的其他客户端)都有 `create_agent`、`create_channel`、`add_to_channel`、`post_to_channel`、`list_channels`。用户说一个目标("组个团队做落地页")时,Ta 建好智能体和频道、把目标贴进去,等各成员回答完再回复用户;频道缺某个角色时,Ta 用 `add_to_channel` 把已有的智能体加进来(加在已有成员之后,负责人不变);开着的页面在侧栏给这个频道标一个绿点,打开后消失。中途停止 Ta 只是不再等待,智能体会在频道里接着回答。
|
|
15
|
-
- **分身的任务**(见 `docs/design/ta-double.md`):Ta 用工具建的频道带 `by: 'ta'` 和建它的会话 `origin`,作为分身的任务(`registerTasks`)列出,不进用户自己的"频道"分组;它建的智能体带 `temporary`,只在团队里出现,在成员面板或智能体菜单里"留下"后才成为常驻成员,不在任何频道里的临时智能体也列在成员里。导航栏里这个列表叫"分身":分身卡片、"
|
|
16
|
-
- **界面**:导航栏最上面的"智能体"(在"对话"上面,手机上是第一个底部标签)把分身、频道和智能体放在一起(分身是 ta-web 内置的页面,开启后列在最上面,导航栏里不再单独出现):侧栏顶部是搜索框和 +。+ → 新建智能体在主区域打开一个草稿页:先给一个没人用的名字和头像,顶栏点名字可以改名、从 16 个头像里挑,侧栏顶部多一行"还没开工";输入框发出第一条消息时才真正建好智能体(职责是通用的,具体做什么写在这条消息里),随即切到它的会话并发出这条消息。+ → 新建频道是一个弹窗:名称、搜索并勾选智能体(1–12 个,先勾的是负责人)、创建;频道行是负责人在前、下一位成员在后的叠放头像,名称旁标出负责人,第二行是最近一条消息或谁正在回答;智能体按工作目录分组,第二行是"空闲"或正在哪个频道回答,右侧是最近一次发言的时间。点智能体打开它的会话:立即切过去,以智能体的名字显示"正在打开"(`pi.switchSession` 接收 `openAgent` 请求的 Promise),服务端打开或找到会话后显示为当前对话。智能体行悬停(触屏上常显)出现 …,菜单里是:停止(中止它正在进行的回答)、重新开始(开新会话)、重命名、职责(编辑系统提示词里的角色,下一个会话生效)、移至…(换工作目录,在新目录开新会话)、复制工作目录、导出对话(Markdown,去掉频道的上下文块)、加入频道、删除(退出所在频道,只剩它的频道一并删除,会话文件保留);靠近底部时菜单向上展开。频道是主区域的一个页面(不进右侧工作台),以群聊显示:别人的消息在左边带头像和名字,用户的在右边,连续发言合成一组,停顿久了插一行时间;顶栏是频道名和成员头像,点头像在右侧工作台打开"频道成员"(`members`,`location: 'panel'` 的视图,跟着当前频道):列出成员,负责人带标记,正在回答的标绿;每行点开是智能体的会话,悬停(触屏上常显)出现设为负责人、免打扰、重开会话(忘掉之前的对话,下次回答时开新会话,旧会话仍在对话列表里)和移出频道(至少留一位);顶部"添加成员"换成可搜索的智能体列表,勾选后添加,列表底部的"新建智能体"打开新建智能体的草稿页;底部是删除频道(再确认一次,消息一并删除,正在进行的回答不再贴出)。输入框就是对话的输入框(`pi.ui.Composer`),`@` 列出成员,+
|
|
15
|
+
- **分身的任务**(见 `docs/design/ta-double.md`):Ta 用工具建的频道带 `by: 'ta'` 和建它的会话 `origin`,作为分身的任务(`registerTasks`)列出,不进用户自己的"频道"分组;它建的智能体带 `temporary`,只在团队里出现,在成员面板或智能体菜单里"留下"后才成为常驻成员,不在任何频道里的临时智能体也列在成员里。导航栏里这个列表叫"分身":分身卡片、"任务"(一个列表,待你处理的在前,然后进行中、已结束)、"成员"(像通讯录,可选按目录分组)、"频道",各组可折叠(折叠状态存在浏览器本地)。从任务打开的团队显示在右侧工作台,顶栏可"在主区打开"。分身开启"开始任务前先问我"时,建团队前、以及第一次往用户放行过以外的频道派活前,用 `ctx.ui.confirm` 询问。下文的列表描述里,原先平铺的频道和智能体现在分别在"频道"和"成员"分组。
|
|
16
|
+
- **界面**:导航栏最上面的"智能体"(在"对话"上面,手机上是第一个底部标签)把分身、频道和智能体放在一起(分身是 ta-web 内置的页面,开启后列在最上面,导航栏里不再单独出现):侧栏顶部是搜索框和 +。+ → 新建智能体在主区域打开一个草稿页:先给一个没人用的名字和头像,顶栏点名字可以改名、从 16 个头像里挑,侧栏顶部多一行"还没开工";输入框发出第一条消息时才真正建好智能体(职责是通用的,具体做什么写在这条消息里),随即切到它的会话并发出这条消息。+ → 新建频道是一个弹窗:名称、搜索并勾选智能体(1–12 个,先勾的是负责人)、创建;频道行是负责人在前、下一位成员在后的叠放头像,名称旁标出负责人,第二行是最近一条消息或谁正在回答;智能体按工作目录分组,第二行是"空闲"或正在哪个频道回答,右侧是最近一次发言的时间。点智能体打开它的会话:立即切过去,以智能体的名字显示"正在打开"(`pi.switchSession` 接收 `openAgent` 请求的 Promise),服务端打开或找到会话后显示为当前对话。智能体行悬停(触屏上常显)出现 …,菜单里是:停止(中止它正在进行的回答)、重新开始(开新会话)、重命名、职责(编辑系统提示词里的角色,下一个会话生效)、移至…(换工作目录,在新目录开新会话)、复制工作目录、导出对话(Markdown,去掉频道的上下文块)、加入频道、删除(退出所在频道,只剩它的频道一并删除,会话文件保留);靠近底部时菜单向上展开。频道是主区域的一个页面(不进右侧工作台),以群聊显示:别人的消息在左边带头像和名字,用户的在右边,连续发言合成一组,停顿久了插一行时间;顶栏是频道名和成员头像,点头像在右侧工作台打开"频道成员"(`members`,`location: 'panel'` 的视图,跟着当前频道):列出成员,负责人带标记,正在回答的标绿;每行点开是智能体的会话,悬停(触屏上常显)出现设为负责人、免打扰、重开会话(忘掉之前的对话,下次回答时开新会话,旧会话仍在对话列表里)和移出频道(至少留一位);顶部"添加成员"换成可搜索的智能体列表,勾选后添加,列表底部的"新建智能体"打开新建智能体的草稿页;底部是删除频道(再确认一次,消息一并删除,正在进行的回答不再贴出)。输入框就是对话的输入框(`pi.ui.Composer`),`@` 列出成员,+ 里可以点名成员、添加成员(打开频道成员的添加列表),或"做成扩展"(在频道里请负责人用 ta-package 技能把这里商量和做成的事做成扩展);消息用对话的 Markdown 渲染(`pi.ui.Markdown`),点名的成员加粗。
|
|
17
17
|
|
|
18
18
|
## 数据与转发
|
|
19
19
|
|
package/host/index.mjs
CHANGED
|
@@ -135,6 +135,21 @@ var TaLocation;
|
|
|
135
135
|
return name || (remote === null || remote === undefined ? undefined : remote.host) || location;
|
|
136
136
|
}
|
|
137
137
|
TaLocation2.basename = basename;
|
|
138
|
+
function homeRelative(location) {
|
|
139
|
+
var _a;
|
|
140
|
+
const remote = parse(location);
|
|
141
|
+
const path2 = remote ? remote.path ? remote.path.slice(1) : "~" : location;
|
|
142
|
+
const match = /^~(?:[\\/]+(.*))?$/.exec(path2);
|
|
143
|
+
return match ? ((_a = match[1]) !== null && _a !== undefined ? _a : "").replace(/[\\/]+$/, "") : undefined;
|
|
144
|
+
}
|
|
145
|
+
TaLocation2.homeRelative = homeRelative;
|
|
146
|
+
function isAbsolute(location) {
|
|
147
|
+
if (homeRelative(location) !== undefined) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
return isRemote(location) || /^([\\/]|[A-Za-z]:)/.test(location);
|
|
151
|
+
}
|
|
152
|
+
TaLocation2.isAbsolute = isAbsolute;
|
|
138
153
|
function parentPath(path2) {
|
|
139
154
|
const trimmed = path2.replace(/[\\/]+$/, "");
|
|
140
155
|
const at = Math.max(trimmed.lastIndexOf("/"), trimmed.lastIndexOf("\\"));
|
|
@@ -183,6 +198,10 @@ var TaErrorCode = {
|
|
|
183
198
|
MODEL_NOT_FOUND: "CELL_TA_MODEL_NOT_FOUND",
|
|
184
199
|
INVALID_ARGUMENT: "CELL_TA_INVALID_ARGUMENT",
|
|
185
200
|
COMMAND_FAILED: "CELL_TA_COMMAND_FAILED",
|
|
201
|
+
NOTHING_TO_COMPACT: "CELL_TA_NOTHING_TO_COMPACT",
|
|
202
|
+
ALREADY_COMPACTED: "CELL_TA_ALREADY_COMPACTED",
|
|
203
|
+
SESSION_BUSY: "CELL_TA_SESSION_BUSY",
|
|
204
|
+
CANCELLED: "CELL_TA_CANCELLED",
|
|
186
205
|
NOT_SIGNED_IN: "CELL_TA_NOT_SIGNED_IN",
|
|
187
206
|
ENVIRONMENT_FAILED: "CELL_TA_ENVIRONMENT_FAILED",
|
|
188
207
|
CONNECTION_LOST: "CELL_TA_CONNECTION_LOST"
|
|
@@ -213,6 +232,37 @@ ${message}`;
|
|
|
213
232
|
}
|
|
214
233
|
TaMessageContext2.strip = strip;
|
|
215
234
|
})(TaMessageContext || (TaMessageContext = {}));
|
|
235
|
+
var TaImageNote;
|
|
236
|
+
(function(TaImageNote2) {
|
|
237
|
+
const NOTE = /^\[Image: original \d+x\d+, displayed at \d+x\d+\. Multiply coordinates by [\d.]+ to map to original image\.\]$|^\[Image converted from [^\]]+ to [^\]]+\.\]$/;
|
|
238
|
+
function strip(text) {
|
|
239
|
+
const lines = text.split(`
|
|
240
|
+
`);
|
|
241
|
+
const kept = lines.filter((line) => !NOTE.test(line.trim()));
|
|
242
|
+
if (kept.length === lines.length) {
|
|
243
|
+
return text;
|
|
244
|
+
}
|
|
245
|
+
return kept.join(`
|
|
246
|
+
`).replace(/\n+$/, "").replace(/^\n+/, "");
|
|
247
|
+
}
|
|
248
|
+
TaImageNote2.strip = strip;
|
|
249
|
+
})(TaImageNote || (TaImageNote = {}));
|
|
250
|
+
var TaAgentSummary;
|
|
251
|
+
(function(TaAgentSummary2) {
|
|
252
|
+
const START = /^\s*<conversation_history_summary>/;
|
|
253
|
+
const BLOCK = /^\s*<conversation_history_summary>[\s\S]*?(?:<\/conversation_history_summary>\s*|$)/;
|
|
254
|
+
function read(text) {
|
|
255
|
+
if (!START.test(text)) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
return text.replace(/<\/?(?:conversation_history_summary|summary)>/g, "").replace(/<\/?\w*$/, "").trim();
|
|
259
|
+
}
|
|
260
|
+
TaAgentSummary2.read = read;
|
|
261
|
+
function strip(text) {
|
|
262
|
+
return text.replace(BLOCK, "");
|
|
263
|
+
}
|
|
264
|
+
TaAgentSummary2.strip = strip;
|
|
265
|
+
})(TaAgentSummary || (TaAgentSummary = {}));
|
|
216
266
|
var TaSkillUse;
|
|
217
267
|
(function(TaSkillUse2) {
|
|
218
268
|
const BLOCK = /^<skill name="([^"]+)" location="([^"]+)">\n([\s\S]*?)\n<\/skill>(?:\n\n([\s\S]+))?$/;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-channels",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.10.0",
|
|
4
4
|
"description": "A pi package for Ta: agents with roles of their own and channels where the user, Ta and the agents talk; Ta builds the team for what the user wants",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@celljs/ta-protocol": "4.
|
|
31
|
-
"@celljs/ta-web": "4.
|
|
30
|
+
"@celljs/ta-protocol": "4.10.0",
|
|
31
|
+
"@celljs/ta-web": "4.10.0",
|
|
32
32
|
"@types/react": "^19.3.0"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
package/web/index.js
CHANGED
|
@@ -1060,7 +1060,7 @@ function RoomFace({ members, faces, size, working }) {
|
|
|
1060
1060
|
working: working.includes(lead.id)
|
|
1061
1061
|
});
|
|
1062
1062
|
}
|
|
1063
|
-
const small = Math.round(size * 0.
|
|
1063
|
+
const small = Math.round(size * 0.76);
|
|
1064
1064
|
return /* @__PURE__ */ React.createElement("span", {
|
|
1065
1065
|
className: "tac-room",
|
|
1066
1066
|
style: { width: size, height: size },
|
|
@@ -1093,6 +1093,9 @@ var EN = {
|
|
|
1093
1093
|
topic: "Topic",
|
|
1094
1094
|
members: "Members",
|
|
1095
1095
|
addMembers: "Add members",
|
|
1096
|
+
makeExtension: "Make an extension",
|
|
1097
|
+
makeExtensionDetail: "Of what was worked out here",
|
|
1098
|
+
makeExtensionAsk: "Make what this channel worked out an extension, with the ta-package skill, to do it again in a click",
|
|
1096
1099
|
add: "Add",
|
|
1097
1100
|
allMembers: "Every agent is in this channel already",
|
|
1098
1101
|
membersHint: "The first one you pick leads: it answers what names nobody.",
|
|
@@ -1117,12 +1120,10 @@ var EN = {
|
|
|
1117
1120
|
search: "Search",
|
|
1118
1121
|
clear: "Clear",
|
|
1119
1122
|
new: "New",
|
|
1120
|
-
idle: "Idle",
|
|
1121
1123
|
answeringIn: "Answering in #{channel}",
|
|
1122
1124
|
answeringNow: "{name} is answering…",
|
|
1123
1125
|
noMatch: "No matching agents or channels",
|
|
1124
1126
|
noMessages: "No messages yet",
|
|
1125
|
-
leadOf: "Lead: {name}",
|
|
1126
1127
|
noAgentsYet: "No agents yet",
|
|
1127
1128
|
noAgentsYetHint: "Create one with +, or ask Ta for a team",
|
|
1128
1129
|
myDouble: "My double",
|
|
@@ -1201,18 +1202,13 @@ var EN = {
|
|
|
1201
1202
|
membersSection: "Members",
|
|
1202
1203
|
byDirectory: "Group by directory",
|
|
1203
1204
|
channelsSection: "Channels",
|
|
1204
|
-
waitingSection: "Waiting for you",
|
|
1205
|
-
runningSection: "In progress",
|
|
1206
|
-
endedSection: "Ended",
|
|
1207
1205
|
showAll: "Show all {count}",
|
|
1208
1206
|
showFewer: "Show fewer",
|
|
1209
|
-
noTasksYet: "Nothing handed out yet",
|
|
1210
1207
|
waitingCount: "{count} need you",
|
|
1211
1208
|
runningCount: "{count} running",
|
|
1209
|
+
freshCount: "{count} new",
|
|
1212
1210
|
standingBy: "Standing by",
|
|
1213
|
-
noTasksYetHint: "Tell the double what you want done",
|
|
1214
1211
|
noTasksHere: "What the double hands out, tasks and teams, is listed here",
|
|
1215
|
-
tellDouble: "Talk to the double",
|
|
1216
1212
|
deleteTask: "Delete the team",
|
|
1217
1213
|
deleteTaskHint: "The messages of #{channel} go with it. Its agents stay, among your members.",
|
|
1218
1214
|
selectTasks: "Select"
|
|
@@ -1229,6 +1225,9 @@ var ZH = {
|
|
|
1229
1225
|
topic: "主题",
|
|
1230
1226
|
members: "成员",
|
|
1231
1227
|
addMembers: "添加成员",
|
|
1228
|
+
makeExtension: "做成扩展",
|
|
1229
|
+
makeExtensionDetail: "把这里商量出的事做成工具",
|
|
1230
|
+
makeExtensionAsk: "把这个频道里商量和做成的事做成扩展(用 ta-package 技能),以后一键就能再用",
|
|
1232
1231
|
add: "添加",
|
|
1233
1232
|
allMembers: "所有智能体都已在这个频道里",
|
|
1234
1233
|
membersHint: "先选的成员是负责人:没人被 @ 的消息由它回答。",
|
|
@@ -1253,12 +1252,10 @@ var ZH = {
|
|
|
1253
1252
|
search: "搜索",
|
|
1254
1253
|
clear: "清除",
|
|
1255
1254
|
new: "新建",
|
|
1256
|
-
idle: "空闲",
|
|
1257
1255
|
answeringIn: "正在 #{channel} 回答",
|
|
1258
1256
|
answeringNow: "{name} 正在回答…",
|
|
1259
1257
|
noMatch: "没有匹配的智能体或频道",
|
|
1260
1258
|
noMessages: "还没有消息",
|
|
1261
|
-
leadOf: "负责人:{name}",
|
|
1262
1259
|
noAgentsYet: "还没有智能体",
|
|
1263
1260
|
noAgentsYetHint: "点 + 新建,或让 Ta 组个团队",
|
|
1264
1261
|
myDouble: "我的分身",
|
|
@@ -1337,18 +1334,13 @@ var ZH = {
|
|
|
1337
1334
|
membersSection: "成员",
|
|
1338
1335
|
byDirectory: "按目录分组",
|
|
1339
1336
|
channelsSection: "频道",
|
|
1340
|
-
waitingSection: "待你处理",
|
|
1341
|
-
runningSection: "进行中",
|
|
1342
|
-
endedSection: "已结束",
|
|
1343
1337
|
showAll: "显示全部 {count} 个",
|
|
1344
1338
|
showFewer: "收起",
|
|
1345
|
-
noTasksYet: "还没有交出的事",
|
|
1346
1339
|
waitingCount: "{count} 个待你处理",
|
|
1347
1340
|
runningCount: "{count} 个进行中",
|
|
1341
|
+
freshCount: "{count} 个新结果",
|
|
1348
1342
|
standingBy: "待命",
|
|
1349
|
-
noTasksYetHint: "告诉分身你想做什么",
|
|
1350
1343
|
noTasksHere: "分身交出去的任务和团队会列在这里",
|
|
1351
|
-
tellDouble: "和分身说",
|
|
1352
1344
|
deleteTask: "删除这个团队",
|
|
1353
1345
|
deleteTaskHint: "#{channel} 的消息会一起删除,团队成员会留在你的成员里。",
|
|
1354
1346
|
selectTasks: "多选"
|
|
@@ -1429,7 +1421,7 @@ var ChannelViews;
|
|
|
1429
1421
|
});
|
|
1430
1422
|
if (!known) {
|
|
1431
1423
|
const agent = ChannelsUtil.findAgent(context.service.state.team, agentId);
|
|
1432
|
-
await context.pi.switchSession(opened, { title: agent?.name });
|
|
1424
|
+
await context.pi.switchSession(opened, { title: agent?.name, sessionFile: agent?.sessionFile });
|
|
1433
1425
|
return;
|
|
1434
1426
|
}
|
|
1435
1427
|
const shown = context.pi.switchSession(known).catch(() => {
|
|
@@ -1499,6 +1491,76 @@ function useServerCwd(pi) {
|
|
|
1499
1491
|
}
|
|
1500
1492
|
var SidebarUtil;
|
|
1501
1493
|
((SidebarUtil) => {
|
|
1494
|
+
function needsLook(task, seen) {
|
|
1495
|
+
if (task.status === "waiting") {
|
|
1496
|
+
return true;
|
|
1497
|
+
}
|
|
1498
|
+
if (task.status !== "done" && task.status !== "failed") {
|
|
1499
|
+
return false;
|
|
1500
|
+
}
|
|
1501
|
+
return !!task.endedAt && task.endedAt > (seen.at[task.key] ?? seen.since);
|
|
1502
|
+
}
|
|
1503
|
+
SidebarUtil.needsLook = needsLook;
|
|
1504
|
+
function answering(agents, sessions, opened) {
|
|
1505
|
+
const busy = new Set;
|
|
1506
|
+
for (const session of sessions) {
|
|
1507
|
+
if (!session.isStreaming) {
|
|
1508
|
+
continue;
|
|
1509
|
+
}
|
|
1510
|
+
const agent = agents.find((candidate) => !!session.sessionFile && candidate.sessionFile === session.sessionFile || opened.get(candidate.id) === session.sessionId);
|
|
1511
|
+
if (agent) {
|
|
1512
|
+
busy.add(agent.id);
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
return busy;
|
|
1516
|
+
}
|
|
1517
|
+
SidebarUtil.answering = answering;
|
|
1518
|
+
function watch(before, answering2, inChannel) {
|
|
1519
|
+
const channel = answering2.filter((id) => inChannel.includes(id) || before.channel.includes(id));
|
|
1520
|
+
return { own: answering2.filter((id) => !channel.includes(id)), channel };
|
|
1521
|
+
}
|
|
1522
|
+
SidebarUtil.watch = watch;
|
|
1523
|
+
function toLook(marks, before, now, shown, at, known) {
|
|
1524
|
+
const next = { ...marks };
|
|
1525
|
+
let changed = false;
|
|
1526
|
+
for (const id of before.own) {
|
|
1527
|
+
if (id !== shown && !now.own.includes(id) && !now.channel.includes(id)) {
|
|
1528
|
+
next[id] = at;
|
|
1529
|
+
changed = true;
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
for (const id of Object.keys(next)) {
|
|
1533
|
+
if (id === shown || known && !known.includes(id)) {
|
|
1534
|
+
delete next[id];
|
|
1535
|
+
changed = true;
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
return changed ? next : undefined;
|
|
1539
|
+
}
|
|
1540
|
+
SidebarUtil.toLook = toLook;
|
|
1541
|
+
function lastLines(agents, messages, sessions) {
|
|
1542
|
+
const lines = new Map;
|
|
1543
|
+
const keep = (id, text, at) => {
|
|
1544
|
+
const line = text?.replace(/\s+/g, " ").trim();
|
|
1545
|
+
if (line && at >= (lines.get(id)?.at ?? 0)) {
|
|
1546
|
+
lines.set(id, { text: line, at });
|
|
1547
|
+
}
|
|
1548
|
+
};
|
|
1549
|
+
for (const list of Object.values(messages)) {
|
|
1550
|
+
for (const message of list) {
|
|
1551
|
+
keep(message.author, message.text, message.at);
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
const byFile = new Map(agents.filter((agent) => agent.sessionFile).map((agent) => [agent.sessionFile, agent.id]));
|
|
1555
|
+
for (const session of sessions) {
|
|
1556
|
+
const id = session.sessionFile && byFile.get(session.sessionFile);
|
|
1557
|
+
if (id) {
|
|
1558
|
+
keep(id, session.lastMessage, session.updatedAt);
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
return lines;
|
|
1562
|
+
}
|
|
1563
|
+
SidebarUtil.lastLines = lastLines;
|
|
1502
1564
|
function time(at, language, now = new Date) {
|
|
1503
1565
|
if (!at) {
|
|
1504
1566
|
return "";
|
|
@@ -1513,6 +1575,11 @@ var SidebarUtil;
|
|
|
1513
1575
|
return date.toLocaleDateString(language, { year: "2-digit", month: "numeric", day: "numeric" });
|
|
1514
1576
|
}
|
|
1515
1577
|
SidebarUtil.time = time;
|
|
1578
|
+
function where(cwd) {
|
|
1579
|
+
const remote = /^ssh:\/\/([^/:]+)(?::\d+)?(\/.*)?$/.exec(cwd);
|
|
1580
|
+
return remote ? `${remote[1]}:${decodeURIComponent(remote[2] ?? "/")}` : cwd;
|
|
1581
|
+
}
|
|
1582
|
+
SidebarUtil.where = where;
|
|
1516
1583
|
function folder(cwd) {
|
|
1517
1584
|
const parts = cwd.split(/[\\/]+/).filter(Boolean);
|
|
1518
1585
|
return parts[parts.length - 1] ?? cwd;
|
|
@@ -1674,14 +1741,20 @@ function NewAgentHead({ context }) {
|
|
|
1674
1741
|
function NewAgentPage({ context }) {
|
|
1675
1742
|
const { pi, service, ui } = context;
|
|
1676
1743
|
const { draft } = useUi(ui);
|
|
1744
|
+
const { loaded } = useChannels(service);
|
|
1677
1745
|
const w = ChannelViews.words(pi);
|
|
1678
1746
|
const Pencil = ChannelViews.icon(pi, "Pencil");
|
|
1679
1747
|
const Composer = pi.ui.Composer;
|
|
1748
|
+
const first = React.useRef(true);
|
|
1680
1749
|
React.useEffect(() => {
|
|
1681
|
-
if (!
|
|
1750
|
+
if (!loaded || !first.current) {
|
|
1751
|
+
return;
|
|
1752
|
+
}
|
|
1753
|
+
first.current = false;
|
|
1754
|
+
if (!ui.state.draft) {
|
|
1682
1755
|
newAgent(context);
|
|
1683
1756
|
}
|
|
1684
|
-
}, [
|
|
1757
|
+
}, [loaded, ui, context]);
|
|
1685
1758
|
if (!draft) {
|
|
1686
1759
|
return null;
|
|
1687
1760
|
}
|
|
@@ -2217,7 +2290,6 @@ function ChannelRoom({ context, channelId: fixed }) {
|
|
|
2217
2290
|
const channelId = fixed ?? shown;
|
|
2218
2291
|
const faces = useFaces(state.team);
|
|
2219
2292
|
const w = ChannelViews.words(pi);
|
|
2220
|
-
const list = React.useRef(null);
|
|
2221
2293
|
const channel = state.team.channels.find((candidate) => candidate.id === channelId);
|
|
2222
2294
|
const messages = channel ? state.messages[channel.id] : undefined;
|
|
2223
2295
|
const working = channel ? state.working[channel.id] ?? [] : [];
|
|
@@ -2226,12 +2298,8 @@ function ChannelRoom({ context, channelId: fixed }) {
|
|
|
2226
2298
|
service.messages(channelId);
|
|
2227
2299
|
}
|
|
2228
2300
|
}, [service, channelId]);
|
|
2229
|
-
React.
|
|
2230
|
-
|
|
2231
|
-
if (element) {
|
|
2232
|
-
element.scrollTop = element.scrollHeight;
|
|
2233
|
-
}
|
|
2234
|
-
}, [channelId, messages?.length, working.length]);
|
|
2301
|
+
const sent = React.useMemo(() => messages?.filter((message) => message.author === USER).length ?? 0, [messages]);
|
|
2302
|
+
const list = pi.ui.useChatScroll(sent, channelId);
|
|
2235
2303
|
const Markdown = pi.ui.Markdown;
|
|
2236
2304
|
const Composer = pi.ui.Composer;
|
|
2237
2305
|
const Avatar = pi.ui.Avatar;
|
|
@@ -2341,6 +2409,15 @@ function ChannelRoom({ context, channelId: fixed }) {
|
|
|
2341
2409
|
context.showMembers(true);
|
|
2342
2410
|
}
|
|
2343
2411
|
}
|
|
2412
|
+
],
|
|
2413
|
+
[
|
|
2414
|
+
{
|
|
2415
|
+
key: "make-extension",
|
|
2416
|
+
label: w.makeExtension,
|
|
2417
|
+
detail: w.makeExtensionDetail,
|
|
2418
|
+
icon: ChannelViews.maybeIcon(pi, "Sparkles", null, 16),
|
|
2419
|
+
run: () => void service.post(channel.id, w.makeExtensionAsk).catch((error) => pi.ui.notify(ChannelViews.message(error), "error"))
|
|
2420
|
+
}
|
|
2344
2421
|
]
|
|
2345
2422
|
],
|
|
2346
2423
|
onSend: (text) => service.post(channel.id, text)
|
|
@@ -2349,27 +2426,28 @@ function ChannelRoom({ context, channelId: fixed }) {
|
|
|
2349
2426
|
|
|
2350
2427
|
// web-src/more-menu.tsx
|
|
2351
2428
|
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
|
-
}
|
|
2362
2429
|
function MoreMenu({ pi, label, items }) {
|
|
2363
2430
|
const w = ChannelViews.words(pi);
|
|
2364
2431
|
const [open, setOpen] = React.useState(false);
|
|
2365
|
-
const anchor = React.useRef({
|
|
2432
|
+
const anchor = React.useRef({
|
|
2433
|
+
right: 0,
|
|
2434
|
+
below: 0,
|
|
2435
|
+
above: 0,
|
|
2436
|
+
finger: undefined
|
|
2437
|
+
});
|
|
2366
2438
|
const root = React.useRef(null);
|
|
2367
2439
|
const menu = React.useRef(null);
|
|
2368
2440
|
const Ellipsis = ChannelViews.icon(pi, "Ellipsis");
|
|
2369
2441
|
const show = React.useCallback((button, at) => {
|
|
2370
2442
|
const box = button.getBoundingClientRect();
|
|
2371
2443
|
const touch = document.documentElement.hasAttribute("data-touch");
|
|
2372
|
-
|
|
2444
|
+
const row = root.current?.parentElement?.getBoundingClientRect() ?? box;
|
|
2445
|
+
anchor.current = {
|
|
2446
|
+
right: box.right,
|
|
2447
|
+
below: at?.y ?? box.bottom,
|
|
2448
|
+
above: at?.y ?? box.top,
|
|
2449
|
+
finger: touch && at ? { ...at, around: { top: row.top, bottom: row.bottom } } : undefined
|
|
2450
|
+
};
|
|
2373
2451
|
setOpen(true);
|
|
2374
2452
|
}, []);
|
|
2375
2453
|
React.useLayoutEffect(() => {
|
|
@@ -2378,23 +2456,15 @@ function MoreMenu({ pi, label, items }) {
|
|
|
2378
2456
|
return;
|
|
2379
2457
|
}
|
|
2380
2458
|
const { right, below, above, finger } = anchor.current;
|
|
2381
|
-
const width = element.offsetWidth;
|
|
2382
|
-
const height = element.offsetHeight;
|
|
2383
2459
|
if (finger) {
|
|
2384
|
-
|
|
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;
|
|
2460
|
+
return pi.ui.attachMenu(element, finger, () => setOpen(false));
|
|
2393
2461
|
}
|
|
2462
|
+
const width = element.offsetWidth;
|
|
2463
|
+
const height = element.offsetHeight;
|
|
2394
2464
|
const top = below + 4 + height <= window.innerHeight - MARGIN ? below + 4 : Math.max(MARGIN, above - 4 - height);
|
|
2395
2465
|
element.style.top = `${top}px`;
|
|
2396
2466
|
element.style.left = `${Math.max(MARGIN, right - width)}px`;
|
|
2397
|
-
}, [open]);
|
|
2467
|
+
}, [open, pi]);
|
|
2398
2468
|
React.useEffect(() => {
|
|
2399
2469
|
const row = root.current?.parentElement;
|
|
2400
2470
|
const button = root.current?.querySelector(".tac-action");
|
|
@@ -2797,7 +2867,7 @@ class ChannelTaskSource {
|
|
|
2797
2867
|
const last = messages?.at(-1);
|
|
2798
2868
|
if (!last) {
|
|
2799
2869
|
const building = Date.now() - channel.createdAt < BUILDING_MS;
|
|
2800
|
-
return building ? { status: "running", detail: w.building } : { status: "done", detail: channel.topic
|
|
2870
|
+
return building ? { status: "running", detail: w.building } : { status: "done", detail: channel.topic || w.noMessages, endedAt: channel.createdAt };
|
|
2801
2871
|
}
|
|
2802
2872
|
if (last.author === SYSTEM) {
|
|
2803
2873
|
return { status: "waiting", detail: w.yourTurn };
|
|
@@ -2828,7 +2898,7 @@ class ChannelTaskSource {
|
|
|
2828
2898
|
}
|
|
2829
2899
|
}
|
|
2830
2900
|
function taskTitle(channel) {
|
|
2831
|
-
return channel.
|
|
2901
|
+
return channel.name;
|
|
2832
2902
|
}
|
|
2833
2903
|
async function deleteTeam(context, channel) {
|
|
2834
2904
|
await context.service.deleteChannel(channel.id);
|
|
@@ -3000,30 +3070,34 @@ function ChannelMenu({ context, channel, working }) {
|
|
|
3000
3070
|
}
|
|
3001
3071
|
|
|
3002
3072
|
// web-src/sidebar.tsx
|
|
3003
|
-
function Row({ pi, avatar, title, badge, preview, live, dot, waiting,
|
|
3073
|
+
function Row({ pi, avatar, title, badge, preview, live, dot, waiting, fresh, time, hint, selected, onSelect, more, swipe, check, place }) {
|
|
3074
|
+
const single = !preview && !place;
|
|
3075
|
+
const spinner = dot === "running" && /* @__PURE__ */ React.createElement("span", {
|
|
3076
|
+
className: "tac-spinner ta-spinner"
|
|
3077
|
+
});
|
|
3004
3078
|
const row = /* @__PURE__ */ React.createElement("button", {
|
|
3005
3079
|
type: "button",
|
|
3006
|
-
className: `tac-item${selected ? " tac-selected" : ""}`,
|
|
3080
|
+
className: `tac-item${selected ? " tac-selected" : ""}${single ? " tac-item-single" : ""}`,
|
|
3007
3081
|
"aria-current": selected || undefined,
|
|
3008
3082
|
title: hint,
|
|
3009
3083
|
onClick: onSelect
|
|
3010
|
-
}, check,
|
|
3084
|
+
}, check, /* @__PURE__ */ React.createElement("span", {
|
|
3085
|
+
className: "tac-avatar"
|
|
3086
|
+
}, avatar, /* @__PURE__ */ React.createElement("span", {
|
|
3087
|
+
className: `tac-dot${dot ? ` tac-dot-${dot}` : ""}`
|
|
3088
|
+
})), /* @__PURE__ */ React.createElement("span", {
|
|
3011
3089
|
className: "tac-item-text"
|
|
3012
3090
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
3013
3091
|
className: "tac-item-top"
|
|
3014
3092
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
3015
3093
|
className: "tac-item-title"
|
|
3016
|
-
}, title), badge, /* @__PURE__ */ React.createElement("span", {
|
|
3094
|
+
}, title), badge, single && spinner, /* @__PURE__ */ React.createElement("span", {
|
|
3017
3095
|
className: "tac-item-time"
|
|
3018
|
-
}, time)), /* @__PURE__ */ React.createElement("span", {
|
|
3096
|
+
}, time)), !single && /* @__PURE__ */ React.createElement("span", {
|
|
3019
3097
|
className: "tac-item-bottom"
|
|
3020
|
-
},
|
|
3021
|
-
className: `
|
|
3022
|
-
}
|
|
3023
|
-
className: `tac-item-preview${live ? " tac-live" : ""}${waiting ? " tac-waiting" : ""}`
|
|
3024
|
-
}, preview), fresh && /* @__PURE__ */ React.createElement("span", {
|
|
3025
|
-
className: "tac-fresh"
|
|
3026
|
-
}))));
|
|
3098
|
+
}, place, /* @__PURE__ */ React.createElement("span", {
|
|
3099
|
+
className: `tac-item-preview${live ? " tac-now" : ""}${waiting ? " tac-waiting" : ""}${fresh ? " tac-fresh" : ""}`
|
|
3100
|
+
}, preview), spinner)));
|
|
3027
3101
|
const SwipeRow = pi.ui.SwipeRow;
|
|
3028
3102
|
const className = `tac-item-row${selected ? " tac-selected" : ""}`;
|
|
3029
3103
|
if (SwipeRow && (more || swipe)) {
|
|
@@ -3125,6 +3199,7 @@ function SidebarHead({ context }) {
|
|
|
3125
3199
|
}
|
|
3126
3200
|
var FOLDED_KEY = "ta-channels.folded";
|
|
3127
3201
|
var BY_DIRECTORY_KEY = "ui.membersByDirectory";
|
|
3202
|
+
var NO_SESSIONS = [];
|
|
3128
3203
|
var ENDED_SHOWN = 5;
|
|
3129
3204
|
function useFolded() {
|
|
3130
3205
|
const [folded, setFolded] = React.useState(() => {
|
|
@@ -3176,6 +3251,7 @@ function Section({
|
|
|
3176
3251
|
folded,
|
|
3177
3252
|
onFold,
|
|
3178
3253
|
action,
|
|
3254
|
+
alert,
|
|
3179
3255
|
children
|
|
3180
3256
|
}) {
|
|
3181
3257
|
const closed = folded.has(id);
|
|
@@ -3189,17 +3265,113 @@ function Section({
|
|
|
3189
3265
|
"aria-expanded": !closed,
|
|
3190
3266
|
onClick: () => onFold(id)
|
|
3191
3267
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
3192
|
-
className: "tac-section-chevron",
|
|
3193
|
-
"aria-hidden": "true"
|
|
3194
|
-
}), /* @__PURE__ */ React.createElement("span", {
|
|
3195
3268
|
className: "tac-section-title"
|
|
3196
|
-
}, title), /* @__PURE__ */ React.createElement("span", {
|
|
3269
|
+
}, title), closed && count > 0 && /* @__PURE__ */ React.createElement("span", {
|
|
3197
3270
|
className: "tac-section-count"
|
|
3198
|
-
}, count)
|
|
3271
|
+
}, count), closed && alert && /* @__PURE__ */ React.createElement("span", {
|
|
3272
|
+
className: "tac-section-alert"
|
|
3273
|
+
}), /* @__PURE__ */ React.createElement("span", {
|
|
3274
|
+
className: "tac-section-chevron",
|
|
3275
|
+
"aria-hidden": "true"
|
|
3276
|
+
})), !closed && action), !closed && /* @__PURE__ */ React.createElement("div", {
|
|
3199
3277
|
className: "tac-section-body"
|
|
3200
3278
|
}, children));
|
|
3201
3279
|
}
|
|
3202
|
-
var
|
|
3280
|
+
var SEEN_KEY = "ui.seenTasks";
|
|
3281
|
+
function useSeenTasks(storage, tasks) {
|
|
3282
|
+
const [seen, setSeen] = React.useState();
|
|
3283
|
+
React.useEffect(() => {
|
|
3284
|
+
let live = true;
|
|
3285
|
+
const read = () => storage.get(SEEN_KEY).then((kept) => {
|
|
3286
|
+
if (!live) {
|
|
3287
|
+
return;
|
|
3288
|
+
}
|
|
3289
|
+
const next = kept ?? { since: Date.now(), at: {} };
|
|
3290
|
+
setSeen(next);
|
|
3291
|
+
if (!kept) {
|
|
3292
|
+
storage.set(SEEN_KEY, next).catch(() => {
|
|
3293
|
+
return;
|
|
3294
|
+
});
|
|
3295
|
+
}
|
|
3296
|
+
}, () => {
|
|
3297
|
+
return;
|
|
3298
|
+
});
|
|
3299
|
+
read();
|
|
3300
|
+
const stop = storage.onChange((keys) => keys.includes(SEEN_KEY) && void read());
|
|
3301
|
+
return () => {
|
|
3302
|
+
live = false;
|
|
3303
|
+
stop();
|
|
3304
|
+
};
|
|
3305
|
+
}, [storage]);
|
|
3306
|
+
const needsLook = (task) => SidebarUtil.needsLook(task, seen ?? { since: Number.POSITIVE_INFINITY, at: {} });
|
|
3307
|
+
const open = (task) => {
|
|
3308
|
+
if (seen) {
|
|
3309
|
+
const keys = new Set(tasks.map((each) => each.key));
|
|
3310
|
+
const at = Object.fromEntries(Object.entries(seen.at).filter(([key]) => keys.has(key)));
|
|
3311
|
+
const next = { since: seen.since, at: { ...at, [task.key]: Date.now() } };
|
|
3312
|
+
setSeen(next);
|
|
3313
|
+
storage.set(SEEN_KEY, next).catch(() => {
|
|
3314
|
+
return;
|
|
3315
|
+
});
|
|
3316
|
+
}
|
|
3317
|
+
task.open();
|
|
3318
|
+
};
|
|
3319
|
+
return { needsLook, open };
|
|
3320
|
+
}
|
|
3321
|
+
var TO_LOOK_KEY = "ui.agentsToLook";
|
|
3322
|
+
var DOUBLE_LOOK = "double";
|
|
3323
|
+
var NO_MARKS = {};
|
|
3324
|
+
var NOBODY = { own: [], channel: [] };
|
|
3325
|
+
function useVisible() {
|
|
3326
|
+
const [visible, setVisible] = React.useState(() => document.visibilityState === "visible");
|
|
3327
|
+
React.useEffect(() => {
|
|
3328
|
+
const change = () => setVisible(document.visibilityState === "visible");
|
|
3329
|
+
document.addEventListener("visibilitychange", change);
|
|
3330
|
+
return () => document.removeEventListener("visibilitychange", change);
|
|
3331
|
+
}, []);
|
|
3332
|
+
return visible;
|
|
3333
|
+
}
|
|
3334
|
+
function useToLook(storage, answering, inChannel, shown, known) {
|
|
3335
|
+
const [marks, setMarks] = useStored(storage, TO_LOOK_KEY, NO_MARKS);
|
|
3336
|
+
const looking = useVisible() ? shown : undefined;
|
|
3337
|
+
const before = React.useRef(NOBODY);
|
|
3338
|
+
const latest = React.useRef(marks);
|
|
3339
|
+
latest.current = marks;
|
|
3340
|
+
const setRef = React.useRef(setMarks);
|
|
3341
|
+
setRef.current = setMarks;
|
|
3342
|
+
const key = JSON.stringify([answering, inChannel, looking ?? null, known ?? null]);
|
|
3343
|
+
React.useEffect(() => {
|
|
3344
|
+
const [answeringNow, inChannelNow, lookingNow, knownNow] = JSON.parse(key);
|
|
3345
|
+
const now = SidebarUtil.watch(before.current, answeringNow, inChannelNow);
|
|
3346
|
+
const next = SidebarUtil.toLook(latest.current, before.current, now, lookingNow ?? undefined, Date.now(), knownNow ?? undefined);
|
|
3347
|
+
before.current = now;
|
|
3348
|
+
if (next) {
|
|
3349
|
+
setRef.current(next);
|
|
3350
|
+
}
|
|
3351
|
+
}, [key]);
|
|
3352
|
+
return marks;
|
|
3353
|
+
}
|
|
3354
|
+
function useSessionLines(context, changed) {
|
|
3355
|
+
const { pi } = context;
|
|
3356
|
+
const [lines, setLines] = React.useState(context.sessionLines);
|
|
3357
|
+
React.useEffect(() => {
|
|
3358
|
+
let live = true;
|
|
3359
|
+
const read = () => Promise.all([pi.server.listSessions().catch(() => []), pi.server.listSavedSessions().catch(() => [])]).then(([open, saved]) => {
|
|
3360
|
+
context.sessionLines = [...saved, ...open];
|
|
3361
|
+
if (live) {
|
|
3362
|
+
setLines(context.sessionLines);
|
|
3363
|
+
}
|
|
3364
|
+
});
|
|
3365
|
+
read();
|
|
3366
|
+
const again = () => document.visibilityState === "visible" && void read();
|
|
3367
|
+
document.addEventListener("visibilitychange", again);
|
|
3368
|
+
return () => {
|
|
3369
|
+
live = false;
|
|
3370
|
+
document.removeEventListener("visibilitychange", again);
|
|
3371
|
+
};
|
|
3372
|
+
}, [context, pi, changed]);
|
|
3373
|
+
return lines;
|
|
3374
|
+
}
|
|
3203
3375
|
function useTaskSelection(pi, tasks) {
|
|
3204
3376
|
const [chosen, setChosen] = React.useState();
|
|
3205
3377
|
const removable = tasks.filter((task) => task.remove);
|
|
@@ -3232,7 +3404,7 @@ function useTaskSelection(pi, tasks) {
|
|
|
3232
3404
|
}
|
|
3233
3405
|
};
|
|
3234
3406
|
}
|
|
3235
|
-
function TaskItem({ context, task, selection }) {
|
|
3407
|
+
function TaskItem({ context, task, selection, seen }) {
|
|
3236
3408
|
const { pi } = context;
|
|
3237
3409
|
const w = ChannelViews.words(pi);
|
|
3238
3410
|
const Own = task.icon;
|
|
@@ -3255,20 +3427,20 @@ function TaskItem({ context, task, selection }) {
|
|
|
3255
3427
|
avatar: Own ? /* @__PURE__ */ React.createElement("span", {
|
|
3256
3428
|
className: "tac-task-face"
|
|
3257
3429
|
}, /* @__PURE__ */ React.createElement(Own, {
|
|
3258
|
-
size:
|
|
3430
|
+
size: 40
|
|
3259
3431
|
})) : /* @__PURE__ */ React.createElement("span", {
|
|
3260
3432
|
className: "tac-task-face tac-task-glyph"
|
|
3261
3433
|
}, /* @__PURE__ */ React.createElement(ListTodo, {
|
|
3262
3434
|
size: 17
|
|
3263
3435
|
})),
|
|
3264
3436
|
title: task.title,
|
|
3265
|
-
dot:
|
|
3437
|
+
dot: task.status === "running" ? "running" : seen.needsLook(task) ? "attention" : undefined,
|
|
3266
3438
|
preview: task.detail ?? "",
|
|
3267
3439
|
waiting: task.status === "waiting",
|
|
3268
3440
|
time: SidebarUtil.time(task.endedAt ?? task.startedAt, pi.ui.language),
|
|
3269
3441
|
hint: task.title,
|
|
3270
3442
|
selected: selecting && selection.isChosen(task),
|
|
3271
|
-
onSelect: selecting ? () => removable && selection.toggle(task) : () =>
|
|
3443
|
+
onSelect: selecting ? () => removable && selection.toggle(task) : () => seen.open(task),
|
|
3272
3444
|
more: !selecting && (task.menu || removable) && /* @__PURE__ */ React.createElement(MoreMenu, {
|
|
3273
3445
|
pi,
|
|
3274
3446
|
label: task.title,
|
|
@@ -3281,54 +3453,10 @@ function TaskItem({ context, task, selection }) {
|
|
|
3281
3453
|
})
|
|
3282
3454
|
});
|
|
3283
3455
|
}
|
|
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
|
-
}
|
|
3328
3456
|
function AgentsSidebar({ context }) {
|
|
3329
3457
|
const { pi, service, ui } = context;
|
|
3330
3458
|
const state = useChannels(service);
|
|
3331
|
-
const { query, draft, channelId, fresh } = useUi(ui);
|
|
3459
|
+
const { query, draft, channelId, fresh: unread } = useUi(ui);
|
|
3332
3460
|
const w = ChannelViews.words(pi);
|
|
3333
3461
|
const faces = useFaces(state.team);
|
|
3334
3462
|
const serverCwd = useServerCwd(pi) ?? "";
|
|
@@ -3347,11 +3475,25 @@ function AgentsSidebar({ context }) {
|
|
|
3347
3475
|
const FolderTree = pi.ui.icons.FolderTree ?? Folder;
|
|
3348
3476
|
const HostTag = pi.ui.HostTag;
|
|
3349
3477
|
const ListTodo = pi.ui.icons.ListTodo ?? ChannelViews.icon(pi, "List");
|
|
3478
|
+
const ChevronRight = ChannelViews.icon(pi, "ChevronRight");
|
|
3350
3479
|
const Avatar = pi.ui.Avatar;
|
|
3351
3480
|
const Empty = pi.ui.Empty;
|
|
3352
3481
|
const Skeleton = pi.ui.Skeleton;
|
|
3353
3482
|
const { team, working } = state;
|
|
3354
3483
|
const own = React.useMemo(() => ChannelsUtil.ownChannels(team), [team]);
|
|
3484
|
+
const seen = useSeenTasks(pi.storage, tasks);
|
|
3485
|
+
const said = Object.values(state.messages).reduce((count, list) => count + list.length, 0);
|
|
3486
|
+
const sessionLines = useSessionLines(context, `${said}:${Object.values(working).flat().join(",")}:${team.agents.length}`);
|
|
3487
|
+
const openSessions = pi.ui.useSessions?.() ?? NO_SESSIONS;
|
|
3488
|
+
const lastLines = React.useMemo(() => sessionLines && SidebarUtil.lastLines(team.agents, state.messages, [...sessionLines, ...openSessions]), [team.agents, state.messages, sessionLines, openSessions]);
|
|
3489
|
+
const answering = React.useMemo(() => SidebarUtil.answering(team.agents, openSessions, context.sessions), [team.agents, openSessions, context.sessions]);
|
|
3490
|
+
const doubleBusy = !!double?.busy;
|
|
3491
|
+
const inChannel = Object.values(working).flat();
|
|
3492
|
+
const pageShown = !!double?.shown || !!channelPage?.shown || !!agentPage?.shown;
|
|
3493
|
+
const shownFile = shownSession ? openSessions.find((session) => session.sessionId === shownSession)?.sessionFile : undefined;
|
|
3494
|
+
const shownAgent = pageShown ? undefined : team.agents.find((agent) => !!shownSession && context.sessions.get(agent.id) === shownSession || !!shownFile && agent.sessionFile === shownFile)?.id;
|
|
3495
|
+
const toLook = useToLook(pi.storage, [...answering, ...doubleBusy ? [DOUBLE_LOOK] : []], inChannel, double?.shown ? DOUBLE_LOOK : shownAgent, state.loaded ? [DOUBLE_LOOK, ...team.agents.map((agent) => agent.id)] : undefined);
|
|
3496
|
+
const doubleFresh = !doubleBusy && !!toLook[DOUBLE_LOOK];
|
|
3355
3497
|
React.useEffect(() => {
|
|
3356
3498
|
for (const channel of own) {
|
|
3357
3499
|
service.messages(channel.id).catch(() => {
|
|
@@ -3360,12 +3502,6 @@ function AgentsSidebar({ context }) {
|
|
|
3360
3502
|
}
|
|
3361
3503
|
}, [service, own]);
|
|
3362
3504
|
const name = (id) => ChannelsUtil.authorName(team, id, { user: w.you, ta: w.ta });
|
|
3363
|
-
const lastSaid = new Map;
|
|
3364
|
-
for (const messages of Object.values(state.messages)) {
|
|
3365
|
-
for (const message of messages) {
|
|
3366
|
-
lastSaid.set(message.author, Math.max(lastSaid.get(message.author) ?? 0, message.at));
|
|
3367
|
-
}
|
|
3368
|
-
}
|
|
3369
3505
|
const shownTasks = tasks.filter((task) => SidebarUtil.matches(query, task.title, task.detail));
|
|
3370
3506
|
const groups = SidebarUtil.taskGroups(shownTasks);
|
|
3371
3507
|
const selection = useTaskSelection(pi, shownTasks);
|
|
@@ -3374,7 +3510,6 @@ function AgentsSidebar({ context }) {
|
|
|
3374
3510
|
const agents = ChannelsUtil.standing(team).filter((agent) => SidebarUtil.matches(query, agent.name, agent.role));
|
|
3375
3511
|
const directories = SidebarUtil.directories(agents, serverCwd);
|
|
3376
3512
|
const memberGroups = SidebarUtil.memberGroups(agents, serverCwd, byDirectory && !query.trim());
|
|
3377
|
-
const pageShown = !!double?.shown || !!channelPage?.shown || !!agentPage?.shown;
|
|
3378
3513
|
const openAgent = (agent) => {
|
|
3379
3514
|
setOpening(agent.id);
|
|
3380
3515
|
ChannelViews.openAgent(context, agent.id).catch((error) => pi.ui.notify(ChannelViews.message(error), "error")).finally(() => setOpening(undefined));
|
|
@@ -3385,11 +3520,12 @@ function AgentsSidebar({ context }) {
|
|
|
3385
3520
|
};
|
|
3386
3521
|
const ended = allEnded || selection.selecting ? groups.ended : groups.ended.slice(0, ENDED_SHOWN);
|
|
3387
3522
|
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
3523
|
const running = tasks.filter((task) => task.status === "running").length;
|
|
3390
3524
|
const waiting = tasks.filter((task) => task.status === "waiting").length;
|
|
3525
|
+
const fresh = tasks.filter((task) => task.status !== "waiting" && seen.needsLook(task)).length;
|
|
3391
3526
|
const doubleLine = [
|
|
3392
3527
|
waiting > 0 ? ChannelWords.format(w.waitingCount, { count: String(waiting) }) : "",
|
|
3528
|
+
fresh > 0 ? ChannelWords.format(w.freshCount, { count: String(fresh) }) : "",
|
|
3393
3529
|
running > 0 ? ChannelWords.format(w.runningCount, { count: String(running) }) : ""
|
|
3394
3530
|
].filter(Boolean).join(" · ");
|
|
3395
3531
|
return /* @__PURE__ */ React.createElement("div", {
|
|
@@ -3406,16 +3542,28 @@ function AgentsSidebar({ context }) {
|
|
|
3406
3542
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
3407
3543
|
className: "tac-double-face"
|
|
3408
3544
|
}, /* @__PURE__ */ React.createElement(Avatar, {
|
|
3409
|
-
size:
|
|
3545
|
+
size: 42,
|
|
3546
|
+
mood: doubleBusy ? "working" : "idle"
|
|
3547
|
+
}), /* @__PURE__ */ React.createElement("span", {
|
|
3548
|
+
className: `tac-dot${waiting > 0 || fresh > 0 || doubleFresh ? " tac-dot-attention" : running > 0 || doubleBusy ? " tac-dot-running" : ""}`
|
|
3410
3549
|
})), /* @__PURE__ */ React.createElement("span", {
|
|
3411
3550
|
className: "tac-double-text"
|
|
3412
3551
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
3413
|
-
className: "tac-double-
|
|
3414
|
-
}, double.title), /* @__PURE__ */ React.createElement("span", {
|
|
3415
|
-
className: `tac-double-line${waiting > 0 ? " tac-waiting" : ""}`
|
|
3552
|
+
className: "tac-double-top"
|
|
3416
3553
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
3417
|
-
className:
|
|
3418
|
-
}
|
|
3554
|
+
className: "tac-double-name"
|
|
3555
|
+
}, double.title), !doubleLine && double.preview && /* @__PURE__ */ React.createElement("span", {
|
|
3556
|
+
className: "tac-item-time"
|
|
3557
|
+
}, SidebarUtil.time(double.preview.at, pi.ui.language))), /* @__PURE__ */ React.createElement("span", {
|
|
3558
|
+
className: `tac-double-line${waiting > 0 || fresh > 0 ? " tac-waiting" : doubleFresh && !doubleLine ? " tac-fresh" : ""}`
|
|
3559
|
+
}, /* @__PURE__ */ React.createElement("span", null, doubleLine || double.preview?.text || w.standingBy), (doubleBusy || running > 0) && /* @__PURE__ */ React.createElement("span", {
|
|
3560
|
+
className: "tac-spinner ta-spinner"
|
|
3561
|
+
}))), /* @__PURE__ */ React.createElement("span", {
|
|
3562
|
+
className: "tac-double-go",
|
|
3563
|
+
"aria-hidden": "true"
|
|
3564
|
+
}, /* @__PURE__ */ React.createElement(ChevronRight, {
|
|
3565
|
+
size: 18
|
|
3566
|
+
}))), double.menu && /* @__PURE__ */ React.createElement(MoreMenu, {
|
|
3419
3567
|
pi,
|
|
3420
3568
|
label: double.title,
|
|
3421
3569
|
items: () => (double.menu?.() ?? []).map((section) => section.map(({ icon: Icon, ...item }) => ({ ...item, icon: Icon && /* @__PURE__ */ React.createElement(Icon, {
|
|
@@ -3425,7 +3573,7 @@ function AgentsSidebar({ context }) {
|
|
|
3425
3573
|
pi,
|
|
3426
3574
|
avatar: /* @__PURE__ */ React.createElement(Face, {
|
|
3427
3575
|
face: draft.face,
|
|
3428
|
-
size:
|
|
3576
|
+
size: 40
|
|
3429
3577
|
}),
|
|
3430
3578
|
title: draft.name || w.newAgentName,
|
|
3431
3579
|
preview: w.notStarted,
|
|
@@ -3436,69 +3584,25 @@ function AgentsSidebar({ context }) {
|
|
|
3436
3584
|
rows: 4
|
|
3437
3585
|
}), nothing && /* @__PURE__ */ React.createElement(Empty, {
|
|
3438
3586
|
title: w.noMatch
|
|
3439
|
-
}),
|
|
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, {
|
|
3587
|
+
}), state.loaded && (shownTasks.length > 0 || !query && tasks.length === 0) && /* @__PURE__ */ React.createElement(Section, {
|
|
3450
3588
|
id: "tasks",
|
|
3451
3589
|
title: w.tasks,
|
|
3452
|
-
count:
|
|
3590
|
+
count: shownTasks.length,
|
|
3453
3591
|
folded,
|
|
3454
|
-
onFold: fold
|
|
3455
|
-
|
|
3592
|
+
onFold: fold,
|
|
3593
|
+
alert: shownTasks.some((task) => seen.needsLook(task))
|
|
3594
|
+
}, shownTasks.length === 0 && /* @__PURE__ */ React.createElement("button", {
|
|
3456
3595
|
type: "button",
|
|
3457
3596
|
className: "tac-tasks-empty",
|
|
3458
3597
|
onClick: () => pi.ui.showView(DOUBLE_PAGE)
|
|
3459
|
-
}, /* @__PURE__ */ React.createElement("span", {
|
|
3460
|
-
className: "tac-task-face tac-task-glyph"
|
|
3461
3598
|
}, /* @__PURE__ */ React.createElement(ListTodo, {
|
|
3462
|
-
size:
|
|
3463
|
-
})
|
|
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, {
|
|
3599
|
+
size: 14
|
|
3600
|
+
}), /* @__PURE__ */ React.createElement("span", null, w.noTasksHere)), [...groups.waiting, ...groups.running, ...ended].map((task) => /* @__PURE__ */ React.createElement(TaskItem, {
|
|
3498
3601
|
key: task.key,
|
|
3499
3602
|
context,
|
|
3500
3603
|
task,
|
|
3501
|
-
selection
|
|
3604
|
+
selection,
|
|
3605
|
+
seen
|
|
3502
3606
|
})), groups.ended.length > ENDED_SHOWN && !selection.selecting && /* @__PURE__ */ React.createElement("button", {
|
|
3503
3607
|
type: "button",
|
|
3504
3608
|
className: "tac-show-all",
|
|
@@ -3509,6 +3613,7 @@ function AgentsSidebar({ context }) {
|
|
|
3509
3613
|
count: agents.length,
|
|
3510
3614
|
folded,
|
|
3511
3615
|
onFold: fold,
|
|
3616
|
+
alert: agents.some((agent) => !!toLook[agent.id]),
|
|
3512
3617
|
action: directories > 1 && /* @__PURE__ */ React.createElement("button", {
|
|
3513
3618
|
type: "button",
|
|
3514
3619
|
className: "tac-section-action",
|
|
@@ -3530,30 +3635,36 @@ function AgentsSidebar({ context }) {
|
|
|
3530
3635
|
location: group.cwd
|
|
3531
3636
|
})), group.agents.map((agent) => {
|
|
3532
3637
|
const where = team.channels.find((channel) => working[channel.id]?.includes(agent.id));
|
|
3638
|
+
const cwd = agent.cwd ?? serverCwd;
|
|
3639
|
+
const last = lastLines?.get(agent.id);
|
|
3640
|
+
const line = lastLines ? last?.text ?? w.noMessages : "";
|
|
3641
|
+
const busy = !!where || answering.has(agent.id);
|
|
3642
|
+
const unseen = !busy && !!toLook[agent.id];
|
|
3533
3643
|
return /* @__PURE__ */ React.createElement(Row, {
|
|
3534
3644
|
pi,
|
|
3535
3645
|
key: agent.id,
|
|
3536
3646
|
avatar: /* @__PURE__ */ React.createElement(AgentAvatar, {
|
|
3537
3647
|
agent,
|
|
3538
3648
|
faces,
|
|
3539
|
-
size:
|
|
3540
|
-
working:
|
|
3649
|
+
size: 40,
|
|
3650
|
+
working: busy
|
|
3541
3651
|
}),
|
|
3542
3652
|
title: agent.name,
|
|
3543
|
-
|
|
3544
|
-
location:
|
|
3653
|
+
place: /* @__PURE__ */ React.createElement(HostTag, {
|
|
3654
|
+
location: cwd
|
|
3545
3655
|
}),
|
|
3546
|
-
preview: where ? ChannelWords.format(w.answeringIn, { channel: where.name }) :
|
|
3547
|
-
live:
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3656
|
+
preview: where ? ChannelWords.format(w.answeringIn, { channel: where.name }) : line,
|
|
3657
|
+
live: busy,
|
|
3658
|
+
fresh: unseen,
|
|
3659
|
+
dot: busy ? "running" : unseen ? "attention" : undefined,
|
|
3660
|
+
time: lastLines ? SidebarUtil.time(last?.at ?? agent.createdAt, pi.ui.language) : "",
|
|
3661
|
+
hint: SidebarUtil.where(cwd),
|
|
3551
3662
|
selected: agentSelected(agent),
|
|
3552
3663
|
onSelect: () => openAgent(agent),
|
|
3553
3664
|
more: /* @__PURE__ */ React.createElement(AgentMenu, {
|
|
3554
3665
|
context,
|
|
3555
3666
|
agent,
|
|
3556
|
-
cwd
|
|
3667
|
+
cwd,
|
|
3557
3668
|
working: !!where
|
|
3558
3669
|
}),
|
|
3559
3670
|
swipe: swipeDelete(pi, () => deleteAgent(context, agent))
|
|
@@ -3563,7 +3674,8 @@ ${agent.cwd ?? serverCwd}`,
|
|
|
3563
3674
|
title: w.channelsSection,
|
|
3564
3675
|
count: channels.length,
|
|
3565
3676
|
folded,
|
|
3566
|
-
onFold: fold
|
|
3677
|
+
onFold: fold,
|
|
3678
|
+
alert: channels.some((channel) => unread.includes(channel.id))
|
|
3567
3679
|
}, channels.map((channel) => {
|
|
3568
3680
|
const members = membersOf(team, channel);
|
|
3569
3681
|
const busy = working[channel.id] ?? [];
|
|
@@ -3575,23 +3687,20 @@ ${agent.cwd ?? serverCwd}`,
|
|
|
3575
3687
|
avatar: /* @__PURE__ */ React.createElement(RoomFace, {
|
|
3576
3688
|
members,
|
|
3577
3689
|
faces,
|
|
3578
|
-
size:
|
|
3690
|
+
size: 40,
|
|
3579
3691
|
working: busy
|
|
3580
3692
|
}),
|
|
3581
3693
|
title: channel.name,
|
|
3582
|
-
badge:
|
|
3583
|
-
className: "tac-lead",
|
|
3584
|
-
title: ChannelWords.format(w.leadOf, { name: members[0].name })
|
|
3585
|
-
}, ChannelViews.maybeIcon(pi, "Crown", null, 11), /* @__PURE__ */ React.createElement("span", null, w.lead)), channel.pinned && /* @__PURE__ */ React.createElement("span", {
|
|
3694
|
+
badge: channel.pinned && /* @__PURE__ */ React.createElement("span", {
|
|
3586
3695
|
className: "tac-pinned",
|
|
3587
3696
|
title: w.pinned,
|
|
3588
3697
|
role: "img",
|
|
3589
3698
|
"aria-label": w.pinned
|
|
3590
|
-
}, ChannelViews.maybeIcon(pi, "Pin", null, 12))
|
|
3699
|
+
}, ChannelViews.maybeIcon(pi, "Pin", null, 12)),
|
|
3591
3700
|
preview,
|
|
3592
3701
|
live: busy.length > 0,
|
|
3702
|
+
dot: busy.length > 0 ? "running" : unread.includes(channel.id) ? "attention" : undefined,
|
|
3593
3703
|
time: SidebarUtil.time(last?.at ?? channel.createdAt, pi.ui.language),
|
|
3594
|
-
fresh: fresh.includes(channel.id),
|
|
3595
3704
|
hint: channel.topic ? `#${channel.name} · ${channel.topic}` : `#${channel.name}`,
|
|
3596
3705
|
selected: !!channelPage?.shown && channelId === channel.id,
|
|
3597
3706
|
onSelect: () => context.showChannel(channel.id),
|
|
@@ -3632,17 +3741,22 @@ var STYLE = `
|
|
|
3632
3741
|
.tac-list { flex: 1; min-height: 0; overflow: auto; padding: 2px 0 12px; }
|
|
3633
3742
|
.tac-list:has(> .ta-empty:not(.ta-empty-compact)) { display: flex; flex-direction: column; }
|
|
3634
3743
|
.tac-list > .tac-view > .tac-form { margin: 2px 10px 8px; }
|
|
3635
|
-
|
|
3636
|
-
.tac-double
|
|
3637
|
-
.tac-double
|
|
3638
|
-
.tac-double
|
|
3639
|
-
.tac-double-
|
|
3744
|
+
/* The double first, a card of its own: the one the user talks to. --tac-double-bg and -edge change with hover and press. */
|
|
3745
|
+
.tac-double { --tac-double-bg: var(--ta-raised); --tac-double-edge: color-mix(in srgb, var(--ta-text) 7%, transparent); display: flex; align-items: center; gap: 14px; width: 100%; min-height: 80px; margin: 4px 0 14px; padding: 12px 44px 12px 12px; border: 1px solid var(--tac-double-edge); border-radius: 18px; background: var(--tac-double-bg); color: var(--ta-text); font: inherit; text-align: left; cursor: pointer; transition: background-color 120ms, border-color 160ms; box-sizing: border-box; }
|
|
3746
|
+
:root[data-theme='light'] .tac-double { --tac-double-bg: var(--ta-card); --tac-double-edge: var(--ta-border-muted); }
|
|
3747
|
+
.tac-double:hover { --tac-double-bg: var(--ta-hover); }
|
|
3748
|
+
.tac-double.tac-selected { --tac-double-edge: color-mix(in srgb, var(--ta-accent) 40%, transparent); }
|
|
3749
|
+
/* The dinosaur on a disc of its color, as a profile picture. */
|
|
3750
|
+
.tac-double-face { display: inline-grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--ta-accent) 13%, transparent); }
|
|
3751
|
+
.tac-double-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
|
|
3752
|
+
/* A finger has no … to hover: the card says it opens, as a profile card does. */
|
|
3753
|
+
.tac-double-go { display: none; flex: none; margin-right: -2px; color: var(--ta-muted); opacity: 0.7; }
|
|
3754
|
+
:root[data-touch] .tac-double-go { display: inline-flex; }
|
|
3640
3755
|
.tac-double-row { position: relative; }
|
|
3641
3756
|
.tac-pinned { display: inline-flex; flex: none; color: var(--ta-muted); }
|
|
3642
|
-
.tac-double-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(
|
|
3757
|
+
.tac-double-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(16px * var(--ta-font-scale)); font-weight: 600; line-height: calc(22px * var(--ta-font-scale)); letter-spacing: 0.01em; }
|
|
3643
3758
|
.tac-item-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
3644
3759
|
.tac-item-bottom .tac-item-preview { flex: 1; min-width: 0; }
|
|
3645
|
-
.tac-fresh { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--ta-green); }
|
|
3646
3760
|
.tac-head { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding-left: 8px; }
|
|
3647
3761
|
.tac-head-title { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; white-space: nowrap; }
|
|
3648
3762
|
.tac-head-title strong { overflow: hidden; text-overflow: ellipsis; font-size: calc(14.5px * var(--ta-font-scale)); font-weight: 600; }
|
|
@@ -3656,8 +3770,8 @@ var STYLE = `
|
|
|
3656
3770
|
.tac-head-more { margin-left: 4px; color: var(--ta-muted); font-size: calc(11.5px * var(--ta-font-scale)); }
|
|
3657
3771
|
.tac-action.tac-on { background: var(--ta-hover-strong); color: var(--ta-text); }
|
|
3658
3772
|
.tac-room-page { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--ta-main); color: var(--ta-text); }
|
|
3659
|
-
.tac-chat { flex: 1; min-height: 0; overflow-y: auto; }
|
|
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; }
|
|
3773
|
+
.tac-chat { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overflow-anchor: none; }
|
|
3774
|
+
.tac-chat-col { position: relative; 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; }
|
|
3661
3775
|
.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
3776
|
.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
3777
|
.tac-chat-empty strong { margin-top: 6px; color: var(--ta-text); font-size: calc(16px * var(--ta-font-scale)); }
|
|
@@ -3733,15 +3847,18 @@ div.tac-dialog-label { flex-direction: row; justify-content: space-between; marg
|
|
|
3733
3847
|
.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; }
|
|
3734
3848
|
}
|
|
3735
3849
|
.tac-empty { padding: 8px 18px; }
|
|
3736
|
-
.tac-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height:
|
|
3850
|
+
.tac-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; 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; }
|
|
3737
3851
|
.tac-item:hover { background: var(--ta-hover); }
|
|
3738
3852
|
.tac-item.tac-selected { background: var(--ta-selected); }
|
|
3739
|
-
|
|
3853
|
+
/* A row with nothing to say under its name, as a contact: one line, a little lower. */
|
|
3854
|
+
.tac-item.tac-item-single { min-height: 54px; padding-top: 7px; padding-bottom: 7px; }
|
|
3855
|
+
.tac-item-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
|
|
3740
3856
|
.tac-item-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
3741
|
-
.tac-item-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(
|
|
3857
|
+
.tac-item-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(14px * var(--ta-font-scale)); font-weight: 500; line-height: calc(19px * var(--ta-font-scale)); }
|
|
3742
3858
|
.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
3859
|
.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)); }
|
|
3744
|
-
|
|
3860
|
+
/* What goes on now is said plainly: the green dot on the face marks it. */
|
|
3861
|
+
.tac-item-preview.tac-now { color: var(--ta-secondary); }
|
|
3745
3862
|
.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; }
|
|
3746
3863
|
.tac-lead span { overflow: hidden; text-overflow: ellipsis; }
|
|
3747
3864
|
.tac-lead svg { flex: none; }
|
|
@@ -3749,6 +3866,13 @@ div.tac-dialog-label { flex-direction: row; justify-content: space-between; marg
|
|
|
3749
3866
|
.tac-folder span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
3750
3867
|
.tac-folder .ta-host-tag { margin: 0 0 0 1px; vertical-align: 0; }
|
|
3751
3868
|
.tac-item-top .ta-host-tag { margin: 0; vertical-align: 0; }
|
|
3869
|
+
/* A remote agent's host, on the line of where it works: as quiet as the line, its blue says it is elsewhere. */
|
|
3870
|
+
.tac-item-bottom .ta-host-tag { height: auto; margin: 0; padding: 0; background: none; color: color-mix(in srgb, var(--ta-blue) 70%, var(--ta-muted)); font-size: calc(12px * var(--ta-font-scale)); font-weight: 400; line-height: calc(17px * var(--ta-font-scale)); }
|
|
3871
|
+
.tac-item-bottom .ta-host-tag { gap: 4px; }
|
|
3872
|
+
.tac-item-bottom .ta-host-tag > svg { width: calc(12px * var(--ta-font-scale)); height: calc(12px * var(--ta-font-scale)); }
|
|
3873
|
+
.tac-item-bottom .ta-host-tag + .tac-item-preview::before { content: '·'; margin-right: 6px; }
|
|
3874
|
+
/* The panda's ears are ink, lost on a dark page: a lighter ink there. */
|
|
3875
|
+
:root:not([data-theme='light']) .tac-face[data-face="11"] .tac-face-body > g > circle { fill: #4a4a52; }
|
|
3752
3876
|
.tac-face { display: inline-flex; flex: none; }
|
|
3753
3877
|
.tac-face svg { display: block; overflow: visible; }
|
|
3754
3878
|
.tac-face-eyes { transform-box: fill-box; transform-origin: center; animation: tac-blink 5.2s infinite; }
|
|
@@ -3780,7 +3904,6 @@ textarea.tac-input { resize: vertical; min-height: 56px; line-height: 1.5; }
|
|
|
3780
3904
|
.tac-button.tac-primary { border-color: transparent; background: var(--ta-text); color: var(--ta-main); }
|
|
3781
3905
|
.tac-button:disabled { opacity: 0.5; cursor: default; }
|
|
3782
3906
|
.tac-button.tac-danger { border-color: transparent; background: var(--ta-red); color: #fff; }
|
|
3783
|
-
.tac-team-up { margin-top: 6px; padding: 6px 14px; }
|
|
3784
3907
|
.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; }
|
|
3785
3908
|
.tac-link:hover { background: var(--ta-hover); }
|
|
3786
3909
|
.tac-link.tac-danger { color: var(--ta-red); }
|
|
@@ -3854,43 +3977,73 @@ textarea.tac-role-input { min-height: 200px; max-height: 50vh; font-size: calc(1
|
|
|
3854
3977
|
:root[data-touch] .tac-item-more > .tac-action { visibility: hidden; }
|
|
3855
3978
|
:root[data-touch] .tac-item-row .tac-item-time { visibility: visible; }
|
|
3856
3979
|
:root[data-touch] .tac-double { padding-right: 10px; }
|
|
3857
|
-
:root[data-touch] .tac-item:not(.tac-selected):hover
|
|
3980
|
+
:root[data-touch] .tac-item:not(.tac-selected):hover { --tac-bg: var(--ta-side); background: none; }
|
|
3981
|
+
:root[data-touch] .tac-double:hover { --tac-double-bg: var(--ta-raised); }
|
|
3982
|
+
:root[data-theme='light'][data-touch] .tac-double:hover { --tac-double-bg: var(--ta-card); }
|
|
3858
3983
|
/* 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
|
|
3860
|
-
:root[data-
|
|
3984
|
+
:root[data-handheld] .tac-item.tac-selected { --tac-bg: var(--ta-side); background: none; }
|
|
3985
|
+
:root[data-handheld] .tac-double.tac-selected { --tac-double-edge: color-mix(in srgb, var(--ta-text) 7%, transparent); }
|
|
3986
|
+
:root[data-theme='light'][data-handheld] .tac-double.tac-selected { --tac-double-edge: var(--ta-border-muted); }
|
|
3987
|
+
:root[data-touch] .tac-item:active { --tac-bg: var(--ta-hover); background: var(--ta-hover); }
|
|
3988
|
+
:root[data-touch] .tac-double:active, :root[data-touch] .tac-double:has(~ .tac-item-more > [aria-expanded="true"]) { --tac-double-bg: var(--ta-hover); }
|
|
3861
3989
|
/* The side bar of the double: its sections, folding */
|
|
3862
|
-
.tac-double-
|
|
3863
|
-
.tac-double-
|
|
3864
|
-
.tac-double-line
|
|
3865
|
-
.tac-double-line > span:
|
|
3990
|
+
.tac-double-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
|
|
3991
|
+
.tac-double-top > .tac-double-name { flex: 1; min-width: 0; }
|
|
3992
|
+
.tac-double-line { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); line-height: calc(17px * var(--ta-font-scale)); }
|
|
3993
|
+
.tac-double-line > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
3994
|
+
/* Something goes on: a spinner ends its line, as in the list of conversations. */
|
|
3995
|
+
.tac-spinner.ta-spinner { width: 12px; height: 12px; }
|
|
3866
3996
|
.tac-double-line.tac-waiting { color: color-mix(in srgb, var(--ta-yellow) 85%, var(--ta-text)); }
|
|
3867
3997
|
.tac-section { display: flex; flex-direction: column; }
|
|
3868
|
-
|
|
3869
|
-
.tac-section
|
|
3870
|
-
.tac-section-head
|
|
3998
|
+
/* A section is named, not boxed: a quiet name and count, the chevron only while hovered or folded. */
|
|
3999
|
+
.tac-section + .tac-section { margin-top: 10px; }
|
|
4000
|
+
.tac-section-head { display: flex; align-items: center; gap: 6px; width: 100%; height: 30px; margin: 0; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--ta-muted); font: inherit; font-size: calc(12px * var(--ta-font-scale)); font-weight: 500; letter-spacing: 0.02em; text-align: left; cursor: pointer; transition: color 120ms; }
|
|
4001
|
+
.tac-section-head:hover { color: var(--ta-secondary); }
|
|
3871
4002
|
.tac-section-head-row { position: relative; }
|
|
3872
|
-
/* Left of the
|
|
3873
|
-
.tac-section-action { position: absolute; top:
|
|
4003
|
+
/* Left of the chevron; seen on hover, or while on. */
|
|
4004
|
+
.tac-section-action { position: absolute; top: 4px; 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
4005
|
.tac-section-head-row:hover .tac-section-action, .tac-section-action:focus-visible, .tac-section-action[aria-pressed="true"] { opacity: 1; }
|
|
3875
4006
|
.tac-section-action:hover { background: var(--ta-hover-strong); color: var(--ta-secondary); }
|
|
3876
4007
|
.tac-section-action[aria-pressed="true"] { color: var(--ta-accent); }
|
|
3877
4008
|
.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
|
|
4009
|
+
.tac-section-chevron { flex: none; width: 6px; height: 6px; margin: 0 3px 0 auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; opacity: 0; transform: translateY(-1px) rotate(45deg); transition: transform 160ms var(--ta-ease, ease), opacity 120ms; }
|
|
4010
|
+
.tac-section-head-row:hover .tac-section-chevron, .tac-section-head:focus-visible .tac-section-chevron, .tac-closed .tac-section-chevron { opacity: 1; }
|
|
3879
4011
|
.tac-closed .tac-section-chevron { transform: translateX(-1px) rotate(-45deg); }
|
|
3880
|
-
.tac-section-title {
|
|
3881
|
-
.tac-section-count { flex: none; color: var(--ta-muted); font-size: calc(
|
|
4012
|
+
.tac-section-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
4013
|
+
.tac-section-count { flex: none; color: var(--ta-muted); opacity: 0.7; font-size: calc(11.5px * var(--ta-font-scale)); font-variant-numeric: tabular-nums; }
|
|
3882
4014
|
.tac-section-body { display: flex; flex-direction: column; animation: tac-unfold 160ms ease-out; }
|
|
3883
4015
|
.tac-section-body > .tac-folder:first-child { margin-top: 4px; }
|
|
3884
4016
|
@keyframes tac-unfold { from { opacity: 0; transform: translateY(-3px); } }
|
|
3885
4017
|
@media (prefers-reduced-motion: reduce) { .tac-section-body, .tac-section-chevron { animation: none; transition: none; } }
|
|
3886
|
-
|
|
4018
|
+
/*
|
|
4019
|
+
* On the corner of the face, as the presence of a contact: green while it goes on, amber while it needs the user
|
|
4020
|
+
* (it waits, or ended or wrote since they last looked); nothing else. Cut out of the face by the row's color (--tac-bg).
|
|
4021
|
+
*/
|
|
4022
|
+
.tac-dot { position: absolute; right: -2px; bottom: -2px; z-index: 1; width: 12px; height: 12px; box-sizing: border-box; border: 2px solid var(--tac-bg, var(--ta-side)); border-radius: 50%; background: var(--tac-dot); }
|
|
4023
|
+
.tac-avatar { position: relative; display: inline-flex; flex: none; }
|
|
4024
|
+
.tac-double-face { position: relative; }
|
|
4025
|
+
.tac-item:hover { --tac-bg: var(--ta-hover); }
|
|
4026
|
+
.tac-item.tac-selected { --tac-bg: var(--ta-selected); }
|
|
4027
|
+
.tac-double-face > .tac-dot { right: 1px; bottom: 1px; width: 14px; height: 14px; border-width: 2.5px; --tac-bg: var(--tac-double-bg); }
|
|
4028
|
+
.tac-dot-running { --tac-dot: var(--ta-green); }
|
|
4029
|
+
.tac-dot-attention { --tac-dot: var(--ta-yellow); }
|
|
4030
|
+
/* The dot grows in, turns from green to amber when an answer ends unseen (a ripple or two says so), and shrinks away once looked at. */
|
|
4031
|
+
.tac-dot { transform: scale(0); opacity: 0; transition: transform 0.24s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.18s ease, background-color 0.5s ease; }
|
|
4032
|
+
.tac-dot-running, .tac-dot-attention { transform: none; opacity: 1; }
|
|
4033
|
+
.tac-dot-attention::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; animation: tac-ripple 1.5s ease-out 0.3s 2 both; }
|
|
4034
|
+
@keyframes tac-ripple { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ta-yellow) 55%, transparent); } to { box-shadow: 0 0 0 7px color-mix(in srgb, var(--ta-yellow) 0%, transparent); } }
|
|
4035
|
+
@media (prefers-reduced-motion: reduce) { .tac-dot { transition: opacity 0.18s ease; } .tac-dot-attention::after { animation: none; } }
|
|
4036
|
+
/* What came unseen reads as unread: in the color of the text, not muted. */
|
|
4037
|
+
.tac-item-preview.tac-fresh, .tac-double-line.tac-fresh { color: var(--ta-text); }
|
|
4038
|
+
.tac-section-alert { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ta-yellow); }
|
|
4039
|
+
|
|
3887
4040
|
.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:
|
|
4041
|
+
.tac-task-face { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; overflow: hidden; }
|
|
3889
4042
|
.tac-task-glyph { background: var(--ta-chip); color: var(--ta-secondary); }
|
|
3890
|
-
|
|
3891
|
-
.tac-tasks-empty
|
|
3892
|
-
.tac-tasks-empty
|
|
3893
|
-
.tac-tasks-empty
|
|
4043
|
+
/* No task yet: one quiet line where they will be, so the place is known before the first. */
|
|
4044
|
+
.tac-tasks-empty { display: flex; align-items: flex-start; gap: 8px; width: 100%; margin: 0; padding: 4px 10px 8px; border: 0; border-radius: 8px; background: none; color: var(--ta-muted); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); line-height: calc(18px * var(--ta-font-scale)); text-align: left; cursor: pointer; transition: color 120ms; }
|
|
4045
|
+
.tac-tasks-empty:hover { color: var(--ta-secondary); }
|
|
4046
|
+
.tac-tasks-empty svg { flex: none; margin-top: calc(2px * var(--ta-font-scale)); }
|
|
3894
4047
|
.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
4048
|
.tac-show-all:hover { background: var(--ta-hover); color: var(--ta-secondary); }
|
|
3896
4049
|
.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)); }
|
|
@@ -3909,10 +4062,12 @@ textarea.tac-role-input { min-height: 200px; max-height: 50vh; font-size: calc(1
|
|
|
3909
4062
|
:root[data-touch] .tac-agent-menu button { height: 44px; padding: 0 14px; border-radius: 10px; }
|
|
3910
4063
|
:root[data-touch] .tac-agent-menu button:active:not(:disabled) { background: var(--ta-hover); }
|
|
3911
4064
|
: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"])
|
|
4065
|
+
:root[data-touch] .tac-item:has(~ .tac-item-more > [aria-expanded="true"]) { background: var(--ta-hover); }
|
|
3913
4066
|
@keyframes tac-menu-in { from { opacity: 0; transform: scale(0.94); } }
|
|
3914
4067
|
@media (prefers-reduced-motion: reduce) { :root[data-touch] .tac-agent-menu { animation: none; } }
|
|
3915
|
-
:
|
|
4068
|
+
/* A finger: no hover to show it; while off it stays away from the list (the choice is the user's on every device), on it shows to turn it off. */
|
|
4069
|
+
:root[data-touch] .tac-section-action { right: 4px; }
|
|
4070
|
+
:root[data-touch] .tac-section-action:not([aria-pressed="true"]) { display: none; }
|
|
3916
4071
|
`;
|
|
3917
4072
|
function injectStyle() {
|
|
3918
4073
|
const element = document.createElement("style");
|