@celljs/ta-channels 4.24.0 → 4.25.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/extension/index.mjs +1 -1
- package/host/index.mjs +15 -2
- package/package.json +4 -4
- package/web/index.js +1 -1
package/README.en.md
CHANGED
|
@@ -17,7 +17,7 @@ A built-in Ta package (enabled by default but can be toggled in the Web client's
|
|
|
17
17
|
- **Channel notices and agents' cards** (see `docs/design/ta-social.md`): a channel's notice (decisions, conventions, to-dos) is in the `<context>` of every member's message; the members keep it with the tool `update_channel_notice` as the talk settles things, the user reads and edits it in the bar above the chat, and each change is a line of the channel. Share card… in a member's menu makes the link and QR code of its card (`TeamService.shareAgent`, 30 days, also while the computer is off; its name, face and role, secrets taken out); a card's link opened in Ta adds the agent in the directory picked (`addFromCard`), which first looks at the project and fits its role with `update_my_role`.
|
|
18
18
|
- **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".
|
|
19
19
|
- **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 25 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.
|
|
20
|
-
- **About the group chat, and models**: the faces of the members in the bar of a channel open “About the group chat” on the right (once “Members”): “Model for all” beside the members has every agent of the group answer with one model (`setChannelModel`; “Each its own” while they differ), and the quick settings of each member's row (also in the agent's menu) change its name, model and role in one place; under the members are the group's name, topic and Pin the chat. An agent's `model` (`<provider>/<model id>`, pi's default without one) is what its session opens on, an open one switched at once (`TaExtensionHost.setModel`), and a model pi does not have is not kept; it answers in
|
|
20
|
+
- **About the group chat, and models**: the faces of the members in the bar of a channel open “About the group chat” on the right (once “Members”): “Model for all” beside the members has every agent of the group answer with one model (`setChannelModel`; “Each its own” while they differ), and the quick settings of each member's row (also in the agent's menu) change its name, model and role in one place; under the members are the group's name, topic and Pin the chat. An agent's `model` (`<provider>/<model id>`, pi's default without one) is what its session opens on, an open one switched at once (`TaExtensionHost.setModel`), and a model pi does not have is not kept; it answers in group chats (ta-rooms) with it too.
|
|
21
21
|
|
|
22
22
|
## Data and Forwarding
|
|
23
23
|
|
|
@@ -33,7 +33,7 @@ Data is stored on the server in `<agentDir>/extension-data/@celljs/ta-channels.j
|
|
|
33
33
|
|
|
34
34
|
The page learns of changes via `pi.storage.onChange` and rereads them. To change something (create agent, create channel, add channel member, set lead / mute / remove member, delete channel, restart agent session, modify or delete agent, post message as user, open agent session), a page calls `request` on the server side: this package's web extension with `pi.callHost('request', request)`, other extensions with `pi.packages.callPackageHost('@celljs/ta-channels', 'request', [request])` (the host of another package with `host.callPackageHost`). `request` is a `TeamRequest` (`web-src/channels-model.ts`); the call returns the result, or throws the reason. Each answer is first recorded as a job in `queue` and removed only after the answer is posted to the channel. After ta serve restarts, it continues processing remaining jobs: jobs that already have an answer (the channel has this agent's reply to that message) are not asked again, and messages already forwarded are not forwarded again, so processed messages do not duplicate. On restart, the one message that was being answered and not yet posted is asked again.
|
|
35
35
|
|
|
36
|
-
Another package that needs the agents (ta-rooms, for those to invite to a
|
|
36
|
+
Another package that needs the agents (ta-rooms, for those to invite to a group chat) calls `listAgents` of the server side (`callPackageHost('@celljs/ta-channels', 'listAgents')`) rather than reading `team`: it returns `TeamAgentInfo[]` (`web-src/channels-model.ts`), each agent's `id`, `name`, `role`, `mark`, `face` (the one given by its id to an agent made before faces) and `cwd`, `model` when it has one, `temporary` on those Ta made for a team of its own; it only reads, and holds no session files.
|
|
37
37
|
|
|
38
38
|
## Limitations
|
|
39
39
|
|
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Ta 自带的 pi 包(默认开启,可在 Web 客户端的 设置 → 包 关
|
|
|
16
16
|
- **频道公告与智能体名片**(见 `docs/design/ta-social.md`):频道的公告(决定 / 约定 / 待办)放进每个成员每条消息的 `<context>`,成员用工具 `update_channel_notice` 随讨论更新,用户在聊天上方的公告栏查看和编辑,每次改动在频道里留一行提示。成员菜单"分享名片…"生成名片链接和二维码(`TeamService.shareAgent`,30 天,电脑关机也能打开;只带名字、头像和隐去密钥的职责);在 Ta 里打开名片链接,选目录后"加为我的智能体"(`addFromCard`),它先看这个项目,用 `update_my_role` 把职责改得贴合这里。
|
|
17
17
|
- **分身的任务**(见 `docs/design/ta-double.md`):Ta 用工具建的频道带 `by: 'ta'` 和建它的会话 `origin`,作为分身的任务(`registerTasks`)列出,不进用户自己的"频道"分组;它建的智能体带 `temporary`,只在团队里出现,在成员面板或智能体菜单里"留下"后才成为常驻成员,不在任何频道里的临时智能体也列在成员里。导航栏里这个列表叫"分身":分身卡片、"任务"(一个列表,待你处理的在前,然后进行中、已结束)、"成员"(像通讯录,可选按目录分组)、"频道",各组可折叠(折叠状态存在浏览器本地)。从任务打开的团队显示在右侧工作台,顶栏可"在主区打开"。分身开启"开始任务前先问我"时,建团队前、以及第一次往用户放行过以外的频道派活前,用 `ctx.ui.confirm` 询问。下文的列表描述里,原先平铺的频道和智能体现在分别在"频道"和"成员"分组。
|
|
18
18
|
- **界面**:导航栏最上面的"智能体"(在"对话"上面,手机上是第一个底部标签)把分身、频道和智能体放在一起(分身是 ta-web 内置的页面,开启后列在最上面,导航栏里不再单独出现):侧栏顶部是搜索框和 +。+ → 新建智能体在主区域打开一个草稿页:先给一个没人用的名字和头像,顶栏点名字可以改名、从 25 个头像里挑,侧栏顶部多一行"还没开工";输入框发出第一条消息时才真正建好智能体(职责是通用的,具体做什么写在这条消息里),随即切到它的会话并发出这条消息。+ → 新建频道是一个弹窗:名称、搜索并勾选智能体(1–12 个,先勾的是负责人)、创建;频道行是负责人在前、下一位成员在后的叠放头像,名称旁标出负责人,第二行是最近一条消息或谁正在回答;智能体按工作目录分组,第二行是"空闲"或正在哪个频道回答,右侧是最近一次发言的时间。点智能体打开它的会话:立即切过去,以智能体的名字显示"正在打开"(`pi.switchSession` 接收 `openAgent` 请求的 Promise),服务端打开或找到会话后显示为当前对话。智能体行悬停(触屏上常显)出现 …,菜单里是:停止(中止它正在进行的回答)、重新开始(开新会话)、重命名、职责(编辑系统提示词里的角色,下一个会话生效)、移至…(换工作目录,在新目录开新会话)、复制工作目录、导出对话(Markdown,去掉频道的上下文块)、加入频道、删除(退出所在频道,只剩它的频道一并删除,会话文件保留);靠近底部时菜单向上展开。频道是主区域的一个页面(不进右侧工作台),以群聊显示:别人的消息在左边带头像和名字,用户的在右边,连续发言合成一组,停顿久了插一行时间;顶栏是频道名和成员头像,点头像在右侧工作台打开"频道成员"(`members`,`location: 'panel'` 的视图,跟着当前频道):列出成员,负责人带标记,正在回答的标绿;每行点开是智能体的会话,悬停(触屏上常显)出现设为负责人、免打扰、重开会话(忘掉之前的对话,下次回答时开新会话,旧会话仍在对话列表里)和移出频道(至少留一位);顶部"添加成员"换成可搜索的智能体列表,勾选后添加,列表底部的"新建智能体"打开新建智能体的草稿页;底部是删除频道(再确认一次,消息一并删除,正在进行的回答不再贴出)。输入框就是对话的输入框(`pi.ui.Composer`),`@` 列出成员,+ 里可以点名成员、添加成员(打开频道成员的添加列表),或"做成扩展"(在频道里请负责人用 ta-package 技能把这里商量和做成的事做成扩展);消息用对话的 Markdown 渲染(`pi.ui.Markdown`),点名的成员加粗。
|
|
19
|
-
- **群聊信息与模型**:频道顶栏的成员头像打开右侧“群聊信息”(原“频道成员”):成员列表旁的“统一模型”一次让群里所有智能体改用同一个模型(`setChannelModel`;成员各用各的时显示“各用各的”),每个成员行的快捷设置(智能体菜单里也有)一处改名字、模型和职责;成员下面是群聊名称、主题和置顶聊天。智能体的 `model`(`<provider>/<model id>`,不设就用 pi 的默认)在它打开会话时用上,已开着的会话当即切换(`TaExtensionHost.setModel`),pi
|
|
19
|
+
- **群聊信息与模型**:频道顶栏的成员头像打开右侧“群聊信息”(原“频道成员”):成员列表旁的“统一模型”一次让群里所有智能体改用同一个模型(`setChannelModel`;成员各用各的时显示“各用各的”),每个成员行的快捷设置(智能体菜单里也有)一处改名字、模型和职责;成员下面是群聊名称、主题和置顶聊天。智能体的 `model`(`<provider>/<model id>`,不设就用 pi 的默认)在它打开会话时用上,已开着的会话当即切换(`TaExtensionHost.setModel`),pi 没有的模型不会保存;它在群聊里回答时(ta-rooms)也用这个模型。
|
|
20
20
|
|
|
21
21
|
## 数据与转发
|
|
22
22
|
|
|
@@ -32,7 +32,7 @@ Ta 自带的 pi 包(默认开启,可在 Web 客户端的 设置 → 包 关
|
|
|
32
32
|
|
|
33
33
|
页面通过 `pi.storage.onChange` 得知变化后重新读取。页面要改什么(新建智能体、新建频道、添加频道成员、设负责人 / 免打扰 / 移出成员、删除频道、重开智能体的会话、修改或删除智能体、以用户身份发消息、打开智能体的会话),调用服务端的 `request`:本包的 Web 扩展用 `pi.callHost('request', request)`,其他扩展用 `pi.packages.callPackageHost('@celljs/ta-channels', 'request', [request])`(别的包的服务端用 `host.callPackageHost`);`request` 的类型是 `TeamRequest`(`web-src/channels-model.ts`),返回结果,出错时抛出原因。每个回答先作为 job 记进 `queue`,回答贴进频道后才移除。ta serve 重启后接着处理剩下的 job:已经有回答(频道里有该智能体对这条消息的回复)的 job 不会再问,已经交出去的消息也不会再交一次,所以已处理的消息不会重复转发。重启时正在回答、还没有贴出的那一条,会再问一次。
|
|
34
34
|
|
|
35
|
-
别的包要知道有哪些智能体(如 ta-rooms
|
|
35
|
+
别的包要知道有哪些智能体(如 ta-rooms 列出可以邀请进群聊的),调用服务端的 `listAgents`(`callPackageHost('@celljs/ta-channels', 'listAgents')`),不要读 `team`:它返回 `TeamAgentInfo[]`(`web-src/channels-model.ts`),每个智能体的 `id`、`name`、`role`、`mark`、`face`(早于头像的智能体按 id 分到的那个)、`cwd`,设了模型的带 `model`,Ta 为自己的团队临时建的带 `temporary`;只读,不含会话文件。
|
|
36
36
|
|
|
37
37
|
## 限制
|
|
38
38
|
|
package/extension/index.mjs
CHANGED
|
@@ -708,7 +708,7 @@ var ChannelsUtil;
|
|
|
708
708
|
}
|
|
709
709
|
if (input.shared !== undefined) {
|
|
710
710
|
if (typeof input.shared !== "string" || !input.shared) {
|
|
711
|
-
throw new Error("The group chat a channel became is the id of a
|
|
711
|
+
throw new Error("The group chat a channel became is the id of a shared group chat.");
|
|
712
712
|
}
|
|
713
713
|
channel.shared = input.shared;
|
|
714
714
|
}
|
package/host/index.mjs
CHANGED
|
@@ -1039,7 +1039,7 @@ var ChannelsUtil;
|
|
|
1039
1039
|
}
|
|
1040
1040
|
if (input.shared !== undefined) {
|
|
1041
1041
|
if (typeof input.shared !== "string" || !input.shared) {
|
|
1042
|
-
throw new Error("The group chat a channel became is the id of a
|
|
1042
|
+
throw new Error("The group chat a channel became is the id of a shared group chat.");
|
|
1043
1043
|
}
|
|
1044
1044
|
channel.shared = input.shared;
|
|
1045
1045
|
}
|
|
@@ -2447,6 +2447,12 @@ var TaDeploymentUtil;
|
|
|
2447
2447
|
}
|
|
2448
2448
|
result.inside = inside;
|
|
2449
2449
|
}
|
|
2450
|
+
if (given.publicTunnels !== undefined) {
|
|
2451
|
+
if (typeof given.publicTunnels !== "boolean") {
|
|
2452
|
+
throw new TaDeploymentError(`"publicTunnels" of ${TaDeploymentUtil2.DISTRIBUTION_FILE} is true or false.`);
|
|
2453
|
+
}
|
|
2454
|
+
result.publicTunnels = given.publicTunnels;
|
|
2455
|
+
}
|
|
2450
2456
|
return result;
|
|
2451
2457
|
}
|
|
2452
2458
|
TaDeploymentUtil2.distribution = distribution;
|
|
@@ -2476,12 +2482,19 @@ var TaDeploymentUtil;
|
|
|
2476
2482
|
}
|
|
2477
2483
|
TaDeploymentUtil2.reachIn = reachIn;
|
|
2478
2484
|
function apply(distribution2, env) {
|
|
2479
|
-
const defaults = {
|
|
2485
|
+
const defaults = {
|
|
2486
|
+
TA_DEPLOYMENT_NAME: distribution2.name,
|
|
2487
|
+
TA_RELAY_URL: distribution2.relay,
|
|
2488
|
+
TA_GATEWAY_URL: distribution2.gateway
|
|
2489
|
+
};
|
|
2480
2490
|
for (const [key, value] of Object.entries(defaults)) {
|
|
2481
2491
|
if (value && !env[key]) {
|
|
2482
2492
|
env[key] = value;
|
|
2483
2493
|
}
|
|
2484
2494
|
}
|
|
2495
|
+
if (distribution2.publicTunnels === false) {
|
|
2496
|
+
env.TA_PUBLIC_TUNNELS = "off";
|
|
2497
|
+
}
|
|
2485
2498
|
}
|
|
2486
2499
|
TaDeploymentUtil2.apply = apply;
|
|
2487
2500
|
})(TaDeploymentUtil || (TaDeploymentUtil = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-channels",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.25.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,9 +27,9 @@
|
|
|
27
27
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@celljs/ta-protocol": "4.
|
|
31
|
-
"@celljs/ta-relay": "4.
|
|
32
|
-
"@celljs/ta-web": "4.
|
|
30
|
+
"@celljs/ta-protocol": "4.25.0",
|
|
31
|
+
"@celljs/ta-relay": "4.25.0",
|
|
32
|
+
"@celljs/ta-web": "4.25.0",
|
|
33
33
|
"@types/react": "^19.3.0"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
package/web/index.js
CHANGED
|
@@ -1058,7 +1058,7 @@ var ChannelsUtil;
|
|
|
1058
1058
|
}
|
|
1059
1059
|
if (input.shared !== undefined) {
|
|
1060
1060
|
if (typeof input.shared !== "string" || !input.shared) {
|
|
1061
|
-
throw new Error("The group chat a channel became is the id of a
|
|
1061
|
+
throw new Error("The group chat a channel became is the id of a shared group chat.");
|
|
1062
1062
|
}
|
|
1063
1063
|
channel.shared = input.shared;
|
|
1064
1064
|
}
|