@celljs/ta-team 4.13.0 → 4.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +3 -1
- package/README.md +3 -1
- package/extension/index.mjs +21 -0
- package/host/index.mjs +590 -47
- package/package.json +10 -6
- package/web/index.js +362 -139
package/README.en.md
CHANGED
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
A pi package that comes with Ta (on by default, Settings → Extensions turns it off): invite people into your Ta by a link to work with you, each with a role; the Ta service checks what each may do, call by call. Design record: [docs/design/ta-team.md](../../docs/design/ta-team.md).
|
|
4
4
|
|
|
5
5
|
- **Members** (Discover → Members): requests to come in and for more, members and who is online, links that invite, roles, the folders shared, the record. A member sees their role, what they may do and what they asked for.
|
|
6
|
-
- **Invite**: pick a role, how long the link works and whether you let each one in (on by default); you get a link and a QR code. They open it in their own Ta (phone or desktop) and ask with a name; once you let them in, their Ta adds "your Ta" and switches to it, connected to your Ta service through the relay, end to end.
|
|
6
|
+
- **Invite**: pick a role, how long the link works and whether you let each one in (on by default); you get a link and a QR code. They open it in their own Ta (phone or desktop) and ask with a name; once you let them in, their Ta adds "your Ta" and switches to it, connected to your Ta service through the relay, end to end. One without Ta opens the same link in a browser and asks on the page of joining of the relay (Members marks them Browser); let in, they go straight into Ta's web page the relay serves. As the relay serves that page, one who came in from a browser gets no role nor grant that manages members (inviting, letting in, roles): a link of an admin asks them to sign in with an account first.
|
|
7
|
+
- **Accounts**: when this Ta has a way to sign in (GitHub, Google, WeChat, an OpenID Connect provider; the `TA_*_CLIENT_ID` of ta-host, or `sign-in.json` of the agent directory), the page of joining offers "Sign in with X": Members shows their account, and the same person is the same member from another browser or link. Whether to sign in is theirs: who does not is anonymous, by the name they give (Members marks them Anonymous). Your Ta service checks the account with the provider, which the relay cannot make up, so one from a browser signed in with an account may be an admin. Register `<relay>/j` as a redirect URI with the provider. Set the ways to sign in up in **Settings → Access → Ways to sign in** (the callback URL is there too, to copy). In the Ta app a link that invites offers "Sign in with X" as well: Ta opens the system browser to sign in, and goes on by itself once it did.
|
|
7
8
|
- **Roles**: Ta has admin, collaborator, viewer and guest, which cannot be changed; make your own from them (the actions, the folders). A collaborator cannot let Ta run commands or open terminals until they ask.
|
|
8
9
|
- **Asking**: a refused call says so with an Ask button; a tool Ta was refused for them, Ta asks for with `request_permission`. You allow it for an hour, a day or for good, or refuse; a conversation that asked goes on by itself once allowed.
|
|
9
10
|
- **Who sees a conversation**: Who sees it, in the menu of a conversation, lets its author keep it to themselves (and those they give it). Your double's conversation is yours alone.
|
|
10
11
|
- **Sharing some agents or channels alone**: pick Only some agents or channels when inviting, or Share an agent or a channel in a member's page (see, use or change, and its folder for its tools if you like). They come in as a guest and see those alone; their own Ta lists them under Shared with you, a tap switching to yours to use them.
|
|
11
12
|
- **Outside the folders**: each role says never, ask me each folder (Ta asks for them, and goes on once you allow it), read but ask to change, or as inside.
|
|
12
13
|
- **Record and alerts**: Record lists every call of each and every tool Ta ran for them, risky ones alone if you like, by person, searched. Refusals again and again, reaching for the folders Ta keeps, commands that look like an attack and more calls than a person makes raise an alert you are told of; Ask Ta to look into it has Ta read the record and tell you who did what and what to do.
|
|
14
|
+
- **Seeing each other**: the top of a conversation shows the faces of the others looking at it, the line over its box who types and whom Ta answers; a collaborator's message is on the left with their face and name, and so is a waiting one (taken back by them or you alone); a row of the list has the small faces of those looking at it and "who · answering". Members says where each one online is, and Follow opens the same conversation. The Ta service tells it person by person (only to those who may see the conversation, nothing on disk), and it shows with this package off too, with nobody else there.
|
|
13
15
|
- **Limits**: members, people online at once, devices of one person and runs at once, in Roles.
|
|
14
16
|
|
|
15
17
|
## How it checks
|
package/README.md
CHANGED
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
Ta 自带的 pi 包(默认开启,可在 设置 → 扩展 关闭):用链接邀请别人进你的 Ta 一起干活,每人一个角色,能做什么由 Ta 服务逐项检查。设计记录见 [docs/design/ta-team.md](../../docs/design/ta-team.md)。
|
|
4
4
|
|
|
5
5
|
- **成员与权限**(发现 → 成员与权限):待处理的加入申请和权限申请、成员与在线状态、邀请链接、角色、共享的文件夹、记录。成员看到的是自己的角色、能做的事和自己的申请。
|
|
6
|
-
- **邀请**:选角色、有效期,以及每个人加入是否要你同意(默认要),得到链接和二维码。对方在自己的 Ta(手机或电脑)里打开链接,填上名字申请;你同意后,他的 Ta 加上一台“你的 Ta”并切换过去,经中继端到端加密连到你的 Ta
|
|
6
|
+
- **邀请**:选角色、有效期,以及每个人加入是否要你同意(默认要),得到链接和二维码。对方在自己的 Ta(手机或电脑)里打开链接,填上名字申请;你同意后,他的 Ta 加上一台“你的 Ta”并切换过去,经中继端到端加密连到你的 Ta 服务。没装 Ta 的人用浏览器打开同一条链接,在中继的加入页填名字申请(成员页标着“浏览器”),你同意后直接进入中继下发的 Ta 网页。网页由中继下发,所以从浏览器加入的人拿不到管理成员的角色和授权(邀请、同意加入、改角色):管理员邀请在浏览器里要先用账号登录。
|
|
7
|
+
- **账号登录**:这个 Ta 配了登录方式(GitHub、Google、微信、企业 OpenID Connect,见 ta-host 的 `TA_*_CLIENT_ID` 或智能体目录的 `sign-in.json`)时,浏览器加入页可以“用 X 登录”后申请:你在成员页看到对方的账号,同一个人换浏览器、换链接再来还是同一个成员。登不登录由对方决定:不登录就是匿名加入(你看到的是他填的名字,成员页标“匿名”)。账号由你的 Ta 服务向提供方核实,中继伪造不了,所以用账号登录的浏览器成员可以当管理员。提供方那边要把 `<中继>/j` 登记为回跳地址。登录方式在 **设置 → 访问 → 登录方式** 里配置(回调地址也在那里,一键复制)。在 Ta 应用里打开邀请链接同样能“用 X 登录”:Ta 打开系统浏览器去登录,登录好回到 Ta 自动继续。
|
|
7
8
|
- **角色**:Ta 自带管理员、协作者、只读、访客四个,不能改,可以照着新建自己的角色(勾选动作、限定文件夹)。协作者默认不能让 Ta 运行命令、打开终端,要申请。
|
|
8
9
|
- **申请**:成员被拦下时,提示里有“申请”按钮;他让 Ta 干活时被拦下的工具,Ta 会用 `request_permission` 替他申请。你可以允许 1 小时、1 天或一直,也可以拒绝;从对话里申请的,同意后那个对话自动接着做。
|
|
9
10
|
- **谁能看到对话**:对话菜单里的“谁能看到”,作者可以把对话设为只有自己(和被授权的人)能看到。你的分身对话只有你能看到。
|
|
10
11
|
- **只分享几个智能体或频道**:邀请时选“只分享几个智能体或频道”,或在成员详情里“分享智能体或频道”(查看 / 使用 / 修改,可选允许它在自己的目录里工作)。对方以访客身份加入,只看得到这些;在他自己的 Ta 首页“别人分享给你的”里也能看到,点一下就切过来用。
|
|
11
12
|
- **共享文件夹以外**:每个角色可选不允许、每个文件夹问我(Ta 自动替他申请,你同意后接着做)、可读改动要问我、和文件夹内一样。
|
|
12
13
|
- **记录与告警**:“记录”里能看到每个人的每次操作和 Ta 替他运行的每个工具,可只看有风险的、按人筛选、搜索。反复被拒、碰 Ta 保留的文件夹、运行像攻击的命令、调用频率超常时会告警并通知你;“让 Ta 分析”会让 Ta 读记录后告诉你谁做了什么、怎么处理。
|
|
14
|
+
- **彼此感知**:对话顶栏是同在看这个对话的人的头像,输入框上方写着谁正在输入、Ta 正在回复谁;协作者发的消息在左侧带他的头像和名字,排队的消息也写明是谁的(只有他自己和你能撤回);对话列表的行上是正在看它的人的小头像和“谁 · 正在回复”。成员页写着每个在线的人在看哪个对话,点“跟随”就打开同一个对话。这些由 Ta 服务按人推送(只推给能看那个对话的人,不写盘),关掉这个包也照样显示,只是没有别人。
|
|
13
15
|
- **上限**:成员数、同时在线、每人设备数、同时运行的任务数都可以在“角色与权限”里改。
|
|
14
16
|
|
|
15
17
|
## 怎么检查
|
package/extension/index.mjs
CHANGED
|
@@ -27,6 +27,27 @@ var TaHostUtil;
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
TaHostUtil2.reach = reach;
|
|
30
|
+
function marked(systemPrompt, mark) {
|
|
31
|
+
return role(systemPrompt).includes(mark);
|
|
32
|
+
}
|
|
33
|
+
TaHostUtil2.marked = marked;
|
|
34
|
+
function role(systemPrompt) {
|
|
35
|
+
if (!systemPrompt) {
|
|
36
|
+
return "";
|
|
37
|
+
}
|
|
38
|
+
const open = `<addendum>
|
|
39
|
+
`;
|
|
40
|
+
const start = systemPrompt.indexOf(open);
|
|
41
|
+
const context = systemPrompt.indexOf(`<project_context>
|
|
42
|
+
`);
|
|
43
|
+
if (start < 0 || context >= 0 && context < start) {
|
|
44
|
+
return "";
|
|
45
|
+
}
|
|
46
|
+
const end = systemPrompt.indexOf(`
|
|
47
|
+
</addendum>`, start);
|
|
48
|
+
return systemPrompt.slice(start + open.length, end < 0 ? undefined : end);
|
|
49
|
+
}
|
|
50
|
+
TaHostUtil2.role = role;
|
|
30
51
|
})(TaHostUtil || (TaHostUtil = {}));
|
|
31
52
|
var TA_ASK_ENTRY = "ta-ask";
|
|
32
53
|
var TaAskUtil;
|