ai_co_discuss 0.5.58 → 0.5.59
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/.agents/skills/discuss-host/references/control.md +2 -2
- package/docs/en/guide/members.md +1 -1
- package/docs/en/guide/rooms.md +1 -1
- package/docs/en/guide/workflows.md +1 -1
- package/docs/guide/members.md +1 -1
- package/docs/guide/rooms.md +1 -1
- package/docs/guide/workflows.md +1 -1
- package/frontend/locales/en/app.json +7 -1
- package/frontend/locales/en/room.json +1 -1
- package/package.json +1 -1
- package/runner/adapters/profiles.mjs +15 -3
- package/runner/discussion_launch.mjs +79 -25
- package/runner/i18n_en.mjs +8 -0
- package/runner/workflows.mjs +3 -2
- package/web/app.js +83 -10
- package/web/guest.css +1 -1
- package/web/i18n.js +2 -2
- package/web/markdown.css +1 -1
- package/web/modern.css +1 -1
- package/web/modern.js +59 -59
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
|
|
37
37
|
### 按需配置权限
|
|
38
38
|
|
|
39
|
-
成员的项目权限按它这次的任务给,够用即可:只读(读项目、回答)→ 可写(改项目文件、跑命令)→ 自动(软件自带分类器逐次放行项目外读写、联网等)→
|
|
39
|
+
成员的项目权限按它这次的任务给,够用即可:只读(读项目、回答)→ 可写(改项目文件、跑命令)→ 自动(软件自带分类器逐次放行项目外读写、联网等)→ 全放开(跳过全部检查)。**授权上限**:任何成员权限都不能设得高于你自己的项目权限(主持人权限不由本机四档管理时,最多授予 `write`);超出上限须请房主手动调整。普通房间里 `invite` 和 `create-room` 显式指定高于 `read` 的 `--access` 时,除了 `roster` / `create_rooms` 外,房间还须勾选 `project_access` 权限项;请回离开成员时不要传 `--access`;`adapter` 切换接入方式同样受此上限约束(切向不受本机四档约束的 App 须上限为 `full`);`workflow-adopt` 的草稿不得新增或调高超出上限的卡片权限,启用库中已有工作流时待加入卡片也不得超限。邀请、新建房间时按分工定档;真出现权限问题(执行详情里有被拒操作)再调高到能解决的那一档,不预先给最高档。软件不支持的档位会被拒绝(如 Antigravity CLI 没有自动档,后台跑命令只能靠全放开)。开到全放开时在回答里写明给了谁、为什么。(成员会读外部内容、可能被注入,档位越高出事的范围越大。)
|
|
40
40
|
|
|
41
41
|
## 新建房间
|
|
42
42
|
|
|
43
|
-
勾选了 `create_rooms` 时,一部分工作需要独立的成员、会话与记录(用户要求另开房间,或一条支线会长期占住本房间)时,可以 `create-room` 拆出去:`--title`(必填)、`--goal`、`--members 平台,平台`、`--host 平台`(用户指定了主持人才填,不填即与你同款的专家)、`--cwd`(只能是本房间项目目录或其子目录)、`--access read|write
|
|
43
|
+
勾选了 `create_rooms` 时,一部分工作需要独立的成员、会话与记录(用户要求另开房间,或一条支线会长期占住本房间)时,可以 `create-room` 拆出去:`--title`(必填)、`--goal`、`--members 平台,平台`、`--host 平台`(用户指定了主持人才填,不填即与你同款的专家)、`--cwd`(只能是本房间项目目录或其子目录)、`--access read|write|auto|full`(默认只读,不得高于自身上限,显式高于 `read` 须同时勾选 `project_access`)、`--host-model` 与 `--host-effort` 可指定主持人模型和档位;同一平台可在成员名单中重复出现,每位独立编号。`--text` 或 `--body-file UTF-8文件`(主持人项目或草稿目录内)提供首条消息(写清要它做什么、做完怎样算完成)。返回新房间编号;失败或不确定是否建成时沿用同一 `--submission-id` 重试,不会重复建房。本房间可新建的数量有上限,新房间直接复制本房间的智能调度、生图、API 上限、连续派活上限与主持人权限(不含 `create_rooms`,不能再新建房间)。
|
|
44
44
|
|
|
45
45
|
先用 `room list --query 标题片段` 或用户给的房间编号找到同一站点上的目标房间,同名时查看房间确认。直接用下面的 `room-post` 发给对方主持人。`launch host-control rooms` 只列本房的父房间和子房间。
|
|
46
46
|
|
package/docs/en/guide/members.md
CHANGED
|
@@ -58,7 +58,7 @@ The Room tab lists present members first. Members who have stepped away appear i
|
|
|
58
58
|
|
|
59
59
|
To change the default speaking order, drag a present member’s handle on the left of the card (along the left edge on desktop, or before the avatar in the card header on phones) and release it at the insertion line. With the handle focused, press Up or Down to move the member one place. Press Esc during a drag to cancel.
|
|
60
60
|
|
|
61
|
-
- **Choose the host.** When creating a room, select the crown on a member card. In an existing room, open the member menu and select “Make host”. Changing the host during a discussion pauses it. The new host's project access is raised to match the previous host: it gets the highest level its own software supports that does not exceed the previous host's (for example, if the previous host had “Automatic” and the new host's software has no such level, it gets “Can write”). Access is only ever raised, a notice in the lower right says what changed, and the previous host keeps its own.
|
|
61
|
+
- **Choose the host.** When creating a room, select the crown on a member card. In an existing room, open the member menu and select “Make host”. Changing the host during a discussion pauses it. The new host's project access is raised to match the previous host: it gets the highest level its own software supports that does not exceed the previous host's (for example, if the previous host had “Automatic” and the new host's software has no such level, it gets “Can write”). Access is only ever raised, a notice in the lower right says what changed, and the previous host keeps its own. If the previous host uses a borrowed session that keeps its own permissions, a desktop app, or a manual connection, its permissions are managed outside CoDiscuss and are not guessed; when the new host’s access is managed by CoDiscuss and can still be raised, a notice in the lower right lets you know it stayed at its current level. Adjust it in the member table if needed.
|
|
62
62
|
- **“Leave”.** In the right sidebar, open the member menu and select “Leave”. The member becomes “Away”, stops receiving work, and its pending requests are canceled. Its session is kept.
|
|
63
63
|
- **Invite an away member back.** Select “Invite” from that member’s menu, or open “Invite AI”, select the away member, and select “Invite”. The member returns with its existing session.
|
|
64
64
|
- **“Remove”.** In the right sidebar, open the member menu and select “Remove” to take the member out of the room. During a discussion, the current host cannot leave or be removed.
|
package/docs/en/guide/rooms.md
CHANGED
|
@@ -75,7 +75,7 @@ When viewing a project image through the relay on another device, supported imag
|
|
|
75
75
|
### 4. Send and view attachments
|
|
76
76
|
|
|
77
77
|
- **Attach files.** Paste or drag files into the composer, or use the paperclip button at the bottom-left. Each message can contain up to 10 files (the administrator’s “local page” streams straight to disk without the default 50 MiB per-file cap, while still counting toward `.codiscuss`’s 10 GiB local data cap—upload very large files under “Project files” instead, or free space via “Manage attachments” in the room menu; other entries default to 50 MiB, configurable in the management panel). Thumbnails appear above the composer. A placeholder such as `[Image #1]` or `[File #2]` is inserted at the cursor. Removing the thumbnail or deleting its placeholder with Backspace removes both. After sending, images first referenced in a paragraph or list item appear right below it in a two-column half-width grid (full width for a single image on phones, two columns for multiple, with `#n` badges when a message carries more than one image) and are not listed again below; other attachments stay listed under the message. Windows sites automatically generate smaller previews for eligible PNG uploads. Open the image to view the original. The site automatically clears uploads left unsent for more than 24 hours. Attachments in sent or queued messages are kept.
|
|
78
|
-
- **Large files are sent as temporary files.** On the administrator’s “local page” of a computer-hosted install (`127.0.0.1` or `localhost`), attachments stream straight onto this computer without using the cloud space or the default 50 MiB per-file cap (they still count toward `.codiscuss`’s 10 GiB local data cap; upload very large files under “Project files” instead), and videos are not force-compressed (local AI members sending or downloading attachments on the local site likewise stream directly without using the cloud space). When viewing ordinary local attachments in the same room from a paired phone or another device, audio, video, and images without thumbnails above the threshold (20 MiB by default) load on click rather than auto-fetching; when downloading or previewing, if the computer has cloud space configured and the file is within 2 GiB, it prefers an on-demand 24-hour transfer copy via cloud storage (without using permanent cloud drive space), and without cloud space (or when cloud transfer fails) files within the relay limit still load over the relay as before (ranged PDF preview stays available), prompting to download on the computer’s local page only above the relay limit. On other devices, hosted accounts, or the online website, when an administrator has set up the cloud space (see [Management panel](admin.md)), files larger than the threshold (20 MiB by default, up to 2 GiB each) upload straight to the account's cloud space. Upload progress shows under the thumbnail; removing the thumbnail cancels the upload. They are temporary files, kept 7 days by default (an administrator can set 1–90 days): their cards say “Temporary file · size · Expires in N days” with a clock, “Expires today” in the warning colour under a day, and the card greys out with “Expired” afterwards. To keep one, choose “Keep in cloud drive” before it expires. Messages do not load their thumbnails or players; selecting the card downloads the file, and the “⋯” at its right offers “Preview” (images, audio, video and PDF), “Keep in cloud drive” and “Download”. A preview reads straight from the cloud space: video can be dragged to any point, and when the link expires during a long stop it renews itself and carries on from the same place; a PDF opens in a new tab. When the cloud space cannot be reached or the file was deleted, the card shows “Object storage is unavailable right now” or “Deleted”. Once the cloud space is full, new large uploads fail; delete old files under “Cloud space” on the Files page. Editing, taking back, or taking a queued message back into the composer leaves these files out; add them again. Share pages and exported backups do not include these files. Without the cloud space, files over the attachment limit cannot be added.
|
|
78
|
+
- **Large files are sent as temporary files.** On the administrator’s “local page” of a computer-hosted install (`127.0.0.1` or `localhost`), attachments stream straight onto this computer without using the cloud space or the default 50 MiB per-file cap (they still count toward `.codiscuss`’s 10 GiB local data cap; upload very large files under “Project files” instead), and videos are not force-compressed (local AI members sending or downloading attachments on the local site likewise stream directly without using the cloud space). When viewing ordinary local attachments in the same room from a paired phone or another device, audio, video, and images without thumbnails above the threshold (20 MiB by default) load on click rather than auto-fetching; when downloading or previewing, if the computer has cloud space configured and the file is within 2 GiB, it prefers an on-demand 24-hour transfer copy via cloud storage (without using permanent cloud drive space), and without cloud space (or when cloud transfer fails) files within the relay limit still load over the relay as before (ranged PDF preview stays available), prompting to download on the computer’s local page only above the relay limit. Smaller local attachments stay on the relay by default so they do not use cloud transfer automatically; when the network is poor, the image viewer, file preview (except ZIP archives) loading/error screens, and failed media error blocks offer “Load via cloud drive” to use the same 24-hour temporary cloud route on demand. On other devices, hosted accounts, or the online website, when an administrator has set up the cloud space (see [Management panel](admin.md)), files larger than the threshold (20 MiB by default, up to 2 GiB each) upload straight to the account's cloud space. Upload progress shows under the thumbnail; removing the thumbnail cancels the upload. They are temporary files, kept 7 days by default (an administrator can set 1–90 days): their cards say “Temporary file · size · Expires in N days” with a clock, “Expires today” in the warning colour under a day, and the card greys out with “Expired” afterwards. To keep one, choose “Keep in cloud drive” before it expires. Messages do not load their thumbnails or players; selecting the card downloads the file, and the “⋯” at its right offers “Preview” (images, audio, video and PDF), “Keep in cloud drive” and “Download”. A preview reads straight from the cloud space: video can be dragged to any point, and when the link expires during a long stop it renews itself and carries on from the same place; a PDF opens in a new tab. When the cloud space cannot be reached or the file was deleted, the card shows “Object storage is unavailable right now” or “Deleted”. Once the cloud space is full, new large uploads fail; delete old files under “Cloud space” on the Files page. Editing, taking back, or taking a queued message back into the composer leaves these files out; add them again. Share pages and exported backups do not include these files. Without the cloud space, files over the attachment limit cannot be added.
|
|
79
79
|
- **Read cloud attachments as a member.** Before waking a local member, CoDiscuss caches the attachment on that computer and gives the member its path. Read-only members can read that copy, and other members reuse it. The cache holds up to 20 GiB and evicts the least recently used files that no active task needs. If the automatic download fails, or to retrieve an earlier attachment, use `codiscuss attachment download ROOM ID` to save it to the same cache. To keep working on it in a project, have a member copy it from the cache into the project, or download it and upload it to the project.
|
|
80
80
|
- **View attachments.** After sending a message, select its placeholder or attachment card. Images can be enlarged full-screen, zoomed, rotated, and saved; when the room has several images, the side buttons, the left and right arrow keys, or a sideways swipe on a phone step between them (the side buttons hide when idle and return when you move the mouse or tap the image). Audio and video play in the message. Documents and code open in the file preview. An attachment card has at most one button: images have none, and “Keep in cloud drive” and “Download” (save the image) are in the image viewer's bottom toolbar; file, audio and video cards have a “⋯” at their right (beside the file name for audio and video) offering “Keep in cloud drive” (with the cloud space set up) and “Download”. Files that open in the file preview also have “Keep in cloud drive” and “Download” in its top toolbar, and a temporary file shows “Expires in N days” at the end of it. Wherever both appear, “Keep in cloud drive” is on the left (on top in a menu) and “Download” on the right. “Keep in cloud drive” copies the attachment into a long-term cloud drive file of the account, leaving the original on the computer or the temporary file as it is; its progress shows in the Files page's transfer list, with one notice at the bottom right when it is done. For one this page has already kept, the viewer's button is greyed out and says “Kept in the cloud drive”.
|
|
81
81
|
- **Interactive visualizations.** A member can place a small web page you can operate (drag a slider, press a button, watch the result change) inside the answer text. It appears at that point in the answer, follows the room theme and light or dark mode, and also appears in place on a phone. It starts running when you scroll near it. On a computer, tool buttons appear in its top-right corner when you point at it: view the “Source”, “Open larger preview” in the file preview, open it in a “New tab”, “Download” it as an `.html` file, or “Collapse” it (your choice is remembered). On a phone the corner always shows a “…” menu and the collapse button. A collapsed visualization shows as one “Interactive visualization” line; select “Expand” to bring it back. Members add these on their own when you ask for an illustrated answer, or when they explain a structure, process, or data. When a long answer is folded, its visualizations still appear, and one the fold cuts through shows only its top; select “Show full text” to see all of it. Read-only share pages and read-aloud show a single “Interactive visualization” line instead, so rely on the member's written conclusion. `.html` attachments do not run inside messages; select the file card to open them in the preview or a new tab. Some visualizations are question panels: after you rank, allocate, or adjust and press the panel's submit button, the result is added above the message box as a quote rather than sent. You can edit or remove it, and it counts as your reply only when you send it. Submitting the same panel again replaces its earlier result.
|
|
@@ -55,7 +55,7 @@ Select a card on the Workflows page. The canvas opens in the center, and its SKI
|
|
|
55
55
|
|
|
56
56
|
### 5. “Full host control” and workflows
|
|
57
57
|
|
|
58
|
-
- With “Full host control,” the host can create, edit, and enable workflows, invite required members, interrupt or retry members, change models, adjust a member’s project access as needed (
|
|
58
|
+
- With “Full host control,” the host can create, edit, and enable workflows, invite required members, interrupt or retry members, change models, adjust a member’s project access as needed (within the host’s own project access level, or up to “Can write” when the host’s access is managed outside CoDiscuss), reorder speakers, withdraw its own assignments, start discussions or Goals, and schedule its own check-ins.
|
|
59
59
|
- Each of these host actions leaves a dashed line with a crown icon in the message flow where it happened (for example, “Host Claude withdrew the work assigned in #11150”); expand it when it does not fit on one line. Model changes keep their existing system record. Actions you take yourself in the web page are not recorded.
|
|
60
60
|
- Without this setting, workflow items in the composer’s / menu are disabled. The host cannot invite members or enable a workflow. You can invite the members yourself and explain the process to the host.
|
|
61
61
|
- Enabling a new workflow through the composer requires a host that the local service can wake. An API host can read the description and role list for an enabled workflow.
|
package/docs/guide/members.md
CHANGED
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
|
|
59
59
|
调整默认发言顺序时,可拖动在场成员卡片左侧的手柄(电脑端在卡片左边缘,手机端在卡片头部头像左侧),看到落点指示线后松手。键盘聚焦手柄后可用上下方向键移动一位,拖动时按 Esc 可取消。
|
|
60
60
|
|
|
61
|
-
- **设为主持人**:建房时点成员卡上的皇冠;已有房间在右栏 → 成员菜单 →
|
|
61
|
+
- **设为主持人**:建房时点成员卡上的皇冠;已有房间在右栏 → 成员菜单 → “设为主持人”。讨论进行中更换主持人会暂停讨论。新主持人的项目权限会随原主持人提高:取它的软件支持的、不高于原主持人的最高一档(例如原主持人是“自动”而新主持人的软件没有这一档,就是“可写”),只升不降,改动时右下角会提示;原主持人的权限不变。若原主持人使用沿用原权限的借用会话、桌面 App 或手动接入,其权限由原软件自行管理、程序无法判断,因此不会自动猜测继承;当新主持人的权限由本机管理且仍可提高时,右下角会提示它仍留在原档位。不想要这个结果时,在成员表里手动调整。
|
|
62
62
|
- **“离开”**:右栏 → 成员菜单 → “离开”。状态变为“已离开”,不再被唤醒,待处理请求会取消,会话保留。
|
|
63
63
|
- **“请回”**:右栏 → 成员菜单 → “请回”(或在“邀请 AI 加入”里选中已离开的成员,再点“邀请”),续接原会话回到房间。
|
|
64
64
|
- **“移除”**:右栏 → 成员菜单 → “移除”,将该成员移出房间名单。讨论进行中不能让当前主持人离开或移除。
|
package/docs/guide/rooms.md
CHANGED
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
### 4. 发送与查看附件
|
|
74
74
|
|
|
75
75
|
- **添加附件**:在输入框粘贴、拖入文件,或点左下角回形针按钮选择文件(每条消息最多 10 个;管理员“本地网页”直接流式保存不受默认 50 MiB 单个上限限制,但仍计入 `.codiscuss` 的 10 GiB 本机数据上限,超大素材建议改传“项目文件”或在房间菜单“管理附件”清理旧附件;其他入口默认上限 50 MiB,可在管理面板调整)。添加后输入框上方出现缩略图,正文光标处插入 `[图片 #1]`、`[文件 #2]` 等房间内连续编号的占位标签;删掉缩略图或按退格删掉占位,两边同步移除。发出后,正文里首次写到 `[图片 #n]` 的图片会紧跟在所在段落或列表项下方以半宽两列排布显示(手机上单张占满整宽、多张两列并排,多图消息附带 `#n` 角标),附件列表不再重复列出;其他附件仍列在消息下方。 Windows 站点会为上传的 PNG 自动生成较小的预览,点击图片可读原图。 已上传但一直未发送的附件超过 24 小时后会自动清理;已发送或仍在排队消息里的附件会保留。
|
|
76
|
-
- **大文件作为临时文件发送**:在本机部署的管理员“本地网页”(`127.0.0.1` 或 `localhost`)里发附件时,文件直接流式保存在这台电脑上,不经过云空间、不受默认 50 MiB 单个上限限制(计入 `.codiscuss` 10 GiB 本机数据上限,超大素材建议改传“项目文件”),视频也不会强制压缩(同机 AI 成员在本地站点收发附件同样流式直传、不经过云空间)。在配对手机等其他设备上查看同一房间里的本地普通附件时,超过门槛(默认 20 MiB)的音视频和无缩略图的大图改为点击后再加载而不自动预拉;点击下载或预览时,若电脑已配置云空间且文件不超过 2 GiB,会优先按需生成 24 小时临时副本经云端传输(不占用永久云盘),未配置云空间或上云不可用时,中转上限以内照常经中转读取(PDF
|
|
76
|
+
- **大文件作为临时文件发送**:在本机部署的管理员“本地网页”(`127.0.0.1` 或 `localhost`)里发附件时,文件直接流式保存在这台电脑上,不经过云空间、不受默认 50 MiB 单个上限限制(计入 `.codiscuss` 10 GiB 本机数据上限,超大素材建议改传“项目文件”),视频也不会强制压缩(同机 AI 成员在本地站点收发附件同样流式直传、不经过云空间)。在配对手机等其他设备上查看同一房间里的本地普通附件时,超过门槛(默认 20 MiB)的音视频和无缩略图的大图改为点击后再加载而不自动预拉;点击下载或预览时,若电脑已配置云空间且文件不超过 2 GiB,会优先按需生成 24 小时临时副本经云端传输(不占用永久云盘),未配置云空间或上云不可用时,中转上限以内照常经中转读取(PDF 分段预览不受影响),超过中转上限才提示在电脑本地网页下载。未超过门槛的普通本地附件默认仍走中转,不自动消耗云盘中转;网络不佳时,图片查看器、文件预览(非压缩包)的加载或失败界面,以及加载失败的音视频提示块会提供“通过云盘加载”,手动走同一条 24 小时临时云盘路线。在其他设备、托管账号或线上网站上,管理员配置了云空间(见[管理面板](admin.md))时,大于门槛(默认 20 MiB)的文件(单个最大 2 GiB)会直接上传到本账号的云空间,缩略图下方显示上传进度,删掉缩略图即取消上传。这类附件是临时文件,默认保留 7 天(管理员可设 1–90 天):卡片标“临时文件 · 大小 · N 天后过期”(时钟图标),不足 1 天显示“今天过期”并变成警示色,过期后卡片变灰并显示“已过期”。想长期保留,在到期前选“转存到云盘”。消息里不自动显示缩略图或播放器;点卡片下载;卡片右侧的“⋯”里有“预览”(图片、音视频、PDF)、“转存到云盘”和“下载”。预览直接从云空间读取,视频可拖动进度,放久了链接过期会自动续上、从原位置接着播放;PDF 在新标签页打开。云空间暂时连不上或文件已被删除时,卡片显示“对象存储暂不可用”或“已删除”。云空间用满后新的大文件会上传失败,请到文件页的“云空间”删除旧文件。编辑、撤回或取回排队消息时,这类附件不会放回输入框,需要重新添加。分享页和导出备份不带这类附件的原文件。没有配置云空间时,超过单个附件上限的文件不能添加。
|
|
77
77
|
- **成员读取云空间附件**:共议在唤醒本机成员前把附件放进账号的本机附件缓存,并给成员本机路径。只读成员也可读取,同一附件不用为每位成员重复下载。缓存上限 20 GiB,空间不足时优先清理最久没用且没有任务在用的文件。自动下载失败或查看历史附件时,可用 `codiscuss attachment download ROOM ID` 下载到同一缓存。要放进项目继续加工,由成员从缓存里复制进项目,或你下载后上传到项目。
|
|
78
78
|
- **查看附件**:消息发出后点正文占位或附件卡片即可打开;图片支持全屏缩放、旋转与保存,房间里有多张图片时可用两侧按钮、键盘左右方向键或手机上左右滑动切换(两侧按钮无操作时自动隐藏,移动鼠标或轻点图片即重新出现),音视频直接在消息里播放,文档与代码在文件预览窗口打开。附件卡片上最多只有一个按钮:图片上没有按钮,“转存到云盘”和“下载”(保存图片)在图片查看器底部的工具栏里;文件和音视频卡片右侧(音视频在文件名右侧)有一个“⋯”,点开是“转存到云盘”(配置了云空间才有)和“下载”。能预览的文件在预览窗口顶部的工具栏里也有“转存到云盘”和“下载”,临时文件还在工具栏末尾显示“N 天后过期”。两者同时出现时,“转存到云盘”总在左边(菜单里在上面),“下载”在右边。“转存到云盘”把附件复制一份成本账号的云盘文件长期保留,电脑上的原件或原来的临时文件不变;进度显示在文件页的传输列表里,完成时右下角提示一次。本页已转存过的,查看器里的这个按钮置灰并提示“已转存到云盘”。
|
|
79
79
|
- **交互式可视化**:成员可以在回答正文里放一段可以操作的网页(拖动滑块、点按钮看结果变化),它显示在正文中的原位置,跟随房间主题和深浅色,手机上同样直接显示。滚到它附近才开始运行。右上角的工具按钮在电脑上悬停时出现,可看“源码”、“放大”到文件预览窗口、在“新标签页”打开、“下载”为 `.html` 文件或“收起”(会记住选择);手机上右上角常显“…”菜单与收起按钮。收起后显示为一行“交互式可视化”,点“展开”恢复。成员在你要求“图文并茂”、或讲结构、流程、数据时会主动配图。长回答折叠时,可视化照常显示,被折叠线截到的只露出顶部,点“展开全文”看完整的。只读分享页和朗读只显示“交互式可视化”一行,结论以成员写在正文里的文字为准。`.html` 附件不在消息内显示,点文件卡片在预览窗口或新标签页打开。有的可视化是提问面板:你在里面排序、分配或调整后点它的提交按钮,结果会作为引用放到输入框上方,不会直接发出;你可以删改,点发送才算回答。同一面板再次提交会替换上一次的结果。
|
package/docs/guide/workflows.md
CHANGED
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
|
|
56
56
|
### 5. “主持人完整权限”与工作流的关系
|
|
57
57
|
|
|
58
|
-
-
|
|
58
|
+
- 打开“主持人完整权限”后,主持人不仅能自己保存、修改和启用工作流、邀请工作流所需成员,还能在推进中自行插话、打断或重试成员、换模型、按需调整成员的项目权限(不超过主持人自身的项目权限;若主持人权限不由本机四档管理,最多授予“可写”)、调发言顺序、撤回自己派出的活、开启讨论或 Goal,以及给自己设定时检查。
|
|
59
59
|
- 主持人做的这些操作会在消息页当时的位置留一行带皇冠图标的虚线记录(例如“主持人 Claude 撤回了 #11150 派出的活”),超出一行可展开;换模型沿用原有的系统记录。你自己在网页上的操作不记。
|
|
60
60
|
- 没有打开该开关时,输入框 `/` 菜单里的工作流项灰显,主持人不能自行邀请成员或启用工作流;你只能自己把成员请进房间,再把做法告诉主持人。
|
|
61
61
|
- 通过输入框启用新工作流,需要一位由本机服务唤醒的主持人。API 主持人能够读取已启用工作流的说明和角色名单。
|
|
@@ -336,6 +336,7 @@
|
|
|
336
336
|
"可写": "Can write",
|
|
337
337
|
"自动": "Automatic",
|
|
338
338
|
"全放开": "Full access",
|
|
339
|
+
"{name} 已设为主持人,但原主持人 {previous} 的权限由其原会话或应用自行管理,无法自动继承,当前仍为“{level}”": "{name} is now the host and still has {level} access. The previous host, {previous}, gets access from their own session or app, so it can’t be inherited automatically.",
|
|
339
340
|
"托管账号的后台环境无法启用这个软件的沙箱,只能使用全放开": "This software's sandbox can't run in a hosted account's background environment, so only Full access is available",
|
|
340
341
|
"{value1} · 工作目录:{value2}({value3}) · 项目:{value4}": "{value1} · Working directory: {value2} ({value3}) · Project: {value4}",
|
|
341
342
|
"已保存本机软件配置,后续讨论可复用": "Local software settings saved for future discussions",
|
|
@@ -870,5 +871,10 @@
|
|
|
870
871
|
"包含": "Contains",
|
|
871
872
|
"{files} 个文件,{folders} 个文件夹": "{files} files, {folders} folders",
|
|
872
873
|
"过期时间": "Expires",
|
|
873
|
-
"来源": "Source"
|
|
874
|
+
"来源": "Source",
|
|
875
|
+
"通过云盘加载": "Load via cloud drive",
|
|
876
|
+
"正在通过云盘加载…": "Loading via cloud drive…",
|
|
877
|
+
"正在载入原图…": "Loading original image…",
|
|
878
|
+
"正在通过云盘加载原图…": "Loading original via cloud drive…",
|
|
879
|
+
"图片保存失败,请重试": "Could not save image. Please try again"
|
|
874
880
|
}
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"调整成员配置": "Adjust member settings",
|
|
113
113
|
"改成员的模型、强度、接入方式、名称与描述": "Change a member's model, effort, client, name and description",
|
|
114
114
|
"改项目权限": "Change project access",
|
|
115
|
-
"
|
|
115
|
+
"按需调整成员的项目权限,不超过主持人的授权上限": "Adjust members’ project access as needed, within the host’s grant limit",
|
|
116
116
|
"管理成员名单": "Manage the member list",
|
|
117
117
|
"邀请本机已配置的软件,暂离、移除、请回成员": "Invite software configured on this computer, and send away, remove or bring back members",
|
|
118
118
|
"推进方式": "How work proceeds",
|
package/package.json
CHANGED
|
@@ -248,6 +248,18 @@ export function same_session_family(left, right) {
|
|
|
248
248
|
return Boolean(a && b && left !== right && a.session_family === b.session_family);
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
+
/** Rank a project access level, or return -1 when it is not a runner level. */
|
|
252
|
+
export function project_access_rank(level) {
|
|
253
|
+
return ALL_ACCESS.indexOf(level);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/** Return the runner-managed project access level, or null for a member whose access is managed elsewhere. */
|
|
257
|
+
export function managed_project_access(profile, fallback = 'read') {
|
|
258
|
+
const facts = adapter_profile(profile?.adapter);
|
|
259
|
+
const level = profile?.project_access || fallback;
|
|
260
|
+
return facts?.access_levels?.length && !(facts.own_project_when_bound && profile.session_id) && project_access_rank(level) >= 0 ? level : null;
|
|
261
|
+
}
|
|
262
|
+
|
|
251
263
|
/**
|
|
252
264
|
* The project access a member takes over from another, as when it becomes the host in its place: the highest level its
|
|
253
265
|
* own software offers that does not exceed the other's, and never below what it has now. Levels rank in ALL_ACCESS
|
|
@@ -259,10 +271,10 @@ export function same_session_family(left, right) {
|
|
|
259
271
|
* @returns {string} the member's access afterwards; its present one when nothing changes.
|
|
260
272
|
*/
|
|
261
273
|
export function inherited_access(member, source) {
|
|
262
|
-
const rank =
|
|
274
|
+
const rank = project_access_rank;
|
|
263
275
|
const offered = ADAPTER_PROFILES[member.adapter]?.access_levels;
|
|
264
|
-
const limit =
|
|
265
|
-
if (!
|
|
276
|
+
const limit = rank(managed_project_access(source, null));
|
|
277
|
+
if (!managed_project_access(member, null) || limit < 0) return member.project_access;
|
|
266
278
|
const reachable = offered.filter(level => rank(level) <= limit && rank(level) > rank(member.project_access));
|
|
267
279
|
return reachable.sort((left, right) => rank(right) - rank(left))[0] || member.project_access;
|
|
268
280
|
}
|
|
@@ -25,7 +25,7 @@ import { guard_remote_request, list_remote_directories, remote_allows, remote_ro
|
|
|
25
25
|
import { pairing_origins, list_devices, machine_fingerprint, revoke_device, start_pairing } from './device_auth.mjs';
|
|
26
26
|
import { setup_sidecar } from './adapters/antigravity_app.mjs';
|
|
27
27
|
import { adapter_of, adoption_adapter, BRANCHABLE_ADAPTERS, branch_session, execution_details, session_preview, session_settings, software_defaults, software_defaults_stamp, software_effort, software_models, software_sessions, software_skills, wipe_software_histories } from './adapters/index.mjs';
|
|
28
|
-
import { ADAPTER_IDS, ADAPTER_PROFILES, adapter_capabilities, adapter_profile, DEFAULT_API_MAX_REQUESTS, inherited_access, lockdown_support, MAX_API_MAX_REQUESTS, platform_adapters, same_session_family } from './adapters/profiles.mjs';
|
|
28
|
+
import { ADAPTER_IDS, ADAPTER_PROFILES, adapter_capabilities, adapter_profile, DEFAULT_API_MAX_REQUESTS, inherited_access, lockdown_support, managed_project_access, MAX_API_MAX_REQUESTS, platform_adapters, project_access_rank, same_session_family } from './adapters/profiles.mjs';
|
|
29
29
|
import { API_PROVIDERS, api_check, api_models, managed_api_keys, save_api_key, saved_api_keys, validate_api_profile } from './discussion_api.mjs';
|
|
30
30
|
import { account_object_storage } from './attachment_policy.mjs';
|
|
31
31
|
import { SCHEDULER_PROVIDERS, scheduler_check } from './scheduler.mjs';
|
|
@@ -197,14 +197,16 @@ room-profiles 导出房间的本机成员软件配置与实际会话 ID(不含
|
|
|
197
197
|
room-restore 把导入房间的本机成员配置登记到本机并核对原会话存在,Claude Code 成员保持手动;须提供 site、room_id、token、local_members。
|
|
198
198
|
room-fork 把从原房间分支出的新房间登记到本机,各本机成员从原会话分叉、不含分支点之后的执行,原会话不变;须提供 site、room_id、token、source_room_id、source_token、executions({成员名: [排除的执行编号]})。
|
|
199
199
|
workflow-promote 将本房间的项目工作流移到全局,房主须允许主持人管理工作流。
|
|
200
|
-
workflow-adopt 主持人在本房间启用工作流:--draft
|
|
200
|
+
${t('workflow-adopt 主持人在本房间启用工作流:--draft 保存草稿(一段,分段头 1/1)后启用,不得新增或调高超出主持人上限的卡片权限;--id 启用库中已有的工作流,待加入卡片的权限不得超过主持人上限。须房主授予“工作流”权限。凭据为本次任务的 access_file(或 DISCUSS_ACCESS_FILE)。')}
|
|
201
201
|
workflow-join 主持人为本房间在用工作流里还没有成员的卡片(启用后才新增的)邀请成员,不填 --card 即全部主线卡片;无需额外授权,离开或移除的成员由用户请回。--sub 改为请进该子工作流的卡片成员(离开的请回原会话)。凭据同上。 --card 一张卡片加 --label 显示名:按这个显示名请一位扮演该卡片的成员(同一张卡可请多位,各有自己的会话;显示名只在本房间、不能和别的成员重复;该卡片已有同名的离开成员就请回它的原会话)。
|
|
202
202
|
workflow-leave 主持人用完子工作流后,把 --sub 子工作流卡片的成员设为离开(会话保留,下次 workflow-join --sub 请回);主线成员不能这样请离。凭据同上。 --member 成员(成员 ID 或显示名)只请离子工作流卡片的这一位成员。
|
|
203
203
|
${t("host-control 主持人代房主控制房间,须房主已为本房间勾选对应的主持人权限(任务的 host_permissions 列出已勾选的项),凭据同上;成员用 --member(成员 ID 或显示名),除 retry、model、label 外不能是主持人自己:")}
|
|
204
|
+
${t('授权不得超过主持人自身的项目权限;主持人权限不由本机管理时,最多授予 write。普通房间的 invite 和 create-room 显式指定高于 read 的档位时,还须勾选“改项目权限”;请回离开成员时不要传 --access。')}
|
|
204
205
|
${t("诊断:details --execution N 读取该执行的本机过程日志(服务端详情与事件记录用 execution / room events 读取);")}
|
|
205
206
|
${t("恢复:stop --member 打断;stop-all 停止全部执行、请求与接力;steer --member --text 话 [--submission-id ID] 向它进行中的执行插话;")}
|
|
206
207
|
${t("retry --execution N 重试失败的执行(含你自己的);model --member [--model M] [--effort E] 改 CLI 或 API 成员的模型与强度(续接原会话;空值恢复默认;API 成员不填模型则保留原模型;换后房间留一条系统记录,成员下次任务带 model_change);model --member M --list 列出该成员软件的可用模型;")}
|
|
207
208
|
${t("adapter --member --adapter ID 在同一软件的 App 与 CLI 间切换;access --member --access read|write|auto|full 调整项目权限(按任务需要给,软件不支持的档位会被拒绝);")}
|
|
209
|
+
${t('切换到受本机管理的接入方式时,所得权限不得超过主持人上限;从受管理的接入切到不受管理的接入时,主持人上限须为 full。')}
|
|
208
210
|
${t("model 和 invite 支持 --service-tier T,支持时可填 default、priority、ultrafast;空值跟随软件。")}
|
|
209
211
|
${t("成员:invite --name 平台 [--access read|write|auto|full] [--model M] [--effort E] 用本机已配置的软件邀请,项目权限默认只读,离开中的同名成员改为请回,活跃同名自动编号新增;")}
|
|
210
212
|
${t("away / remove / back --member 暂离、移除、请回(暂离与移除会取消仍在等它的请求,返回 cancelled_pending 条数);label --member [--label 显示名] [--description 描述];")}
|
|
@@ -1877,17 +1879,18 @@ async function moss_room_settings(home, input, path, config, window) {
|
|
|
1877
1879
|
}
|
|
1878
1880
|
|
|
1879
1881
|
/**
|
|
1880
|
-
*
|
|
1881
|
-
* is not the runner's to set, or 可写 would have no project to write.
|
|
1882
|
+
* Resolve access inheritance and distinguish an unmanaged source from an ordinary no-op.
|
|
1882
1883
|
*/
|
|
1883
|
-
function inherited_project_access(config,
|
|
1884
|
-
const
|
|
1885
|
-
const
|
|
1886
|
-
if (!
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1884
|
+
function inherited_project_access(config, profile, source) {
|
|
1885
|
+
const fallback = config.project_access || 'read';
|
|
1886
|
+
const current = managed_project_access(profile, fallback);
|
|
1887
|
+
if (!current) return { changed: false };
|
|
1888
|
+
if (!adapter_profile(profile.adapter).access_levels.some(level => project_access_rank(level) > project_access_rank(current))) return { changed: false };
|
|
1889
|
+
const previous = managed_project_access(source, fallback);
|
|
1890
|
+
if (!previous) return { changed: false, reason: 'unmanaged_source', project_access: current };
|
|
1891
|
+
const next = inherited_access({ ...profile, project_access: current }, { ...source, project_access: previous });
|
|
1892
|
+
if (next === current || (next === 'write' && !(profile.cwd || config.cwd))) return { changed: false };
|
|
1893
|
+
return { changed: true, project_access: next };
|
|
1891
1894
|
}
|
|
1892
1895
|
|
|
1893
1896
|
/**
|
|
@@ -1902,10 +1905,10 @@ export async function room_member_access(home, raw) {
|
|
|
1902
1905
|
try {
|
|
1903
1906
|
const config = configuration_snapshot(path).config;
|
|
1904
1907
|
const profile = config.participants?.[name];
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1908
|
+
const result = { room_id: input.room_id, member: name };
|
|
1909
|
+
const inheritance = input.inherit_from === undefined ? null : inherited_project_access(config, profile, config.participants?.[input.inherit_from]);
|
|
1910
|
+
if (inheritance?.changed === false) return { ...result, ...inheritance };
|
|
1911
|
+
const project_access = inheritance?.project_access ?? input.project_access;
|
|
1909
1912
|
if (!profile) throw new Error(`${name} 不由本机唤醒,项目权限由它自己的会话决定`);
|
|
1910
1913
|
if (window) moss_project_access(window, profile.adapter, project_access);
|
|
1911
1914
|
if (profile.project_access === 'own') throw new Error(`${name} 是手动接入的成员,权限沿用它自己会话的软件设置`);
|
|
@@ -1922,7 +1925,7 @@ export async function room_member_access(home, raw) {
|
|
|
1922
1925
|
validate_config(next, dirname(path));
|
|
1923
1926
|
if (window === 'private') save_moss_room_preferences(home, window, { project_access });
|
|
1924
1927
|
atomic_json(path, next);
|
|
1925
|
-
return {
|
|
1928
|
+
return { ...result, project_access, ...inheritance };
|
|
1926
1929
|
} finally { release(); }
|
|
1927
1930
|
}
|
|
1928
1931
|
|
|
@@ -2052,7 +2055,7 @@ async function record_model_change(input, name, from, to, headers = {}) {
|
|
|
2052
2055
|
* bound chat by its session, and the CLI resumes it only after the App has released it. Model and effort are chosen
|
|
2053
2056
|
* in the App, so switching to it drops them.
|
|
2054
2057
|
*/
|
|
2055
|
-
export async function room_member_adapter(home, raw) {
|
|
2058
|
+
export async function room_member_adapter(home, raw, { host } = {}) {
|
|
2056
2059
|
const { input, path, window } = await member_room_context(home, raw);
|
|
2057
2060
|
const { name, adapter } = input;
|
|
2058
2061
|
if (window?.includes(':') && !lockdown_support(adapter, { project_access: 'read' }).supported)
|
|
@@ -2070,6 +2073,7 @@ export async function room_member_adapter(home, raw) {
|
|
|
2070
2073
|
const context = { config, path };
|
|
2071
2074
|
const next = { ...profile };
|
|
2072
2075
|
switch_codex_adapter(context, name, next, adapter);
|
|
2076
|
+
if (host) assert_host_adapter_access(config, host, profile, next);
|
|
2073
2077
|
// An App chooses its own model and effort.
|
|
2074
2078
|
if (!adapter_profile(adapter).models) delete next.model;
|
|
2075
2079
|
if (!adapter_profile(adapter).efforts) delete next.effort;
|
|
@@ -3526,6 +3530,33 @@ export async function leave_sub_workflow(home, { access_file, sub, member: wante
|
|
|
3526
3530
|
const HOST_GOAL_BUDGET = { max_continues: 8, max_minutes: 90 };
|
|
3527
3531
|
const LIVE_EXECUTION = ['dispatched', 'started'];
|
|
3528
3532
|
|
|
3533
|
+
/** Check an explicit access request made through a host control. */
|
|
3534
|
+
function assert_host_project_access({ config, host }, access, require_grant = false) {
|
|
3535
|
+
if (!PROJECT_ACCESS.includes(access)) throw new Error(t('项目权限须为 read、write、auto 或 full'));
|
|
3536
|
+
if (require_grant && project_access_rank(access) > project_access_rank('read') && !host_allowed(config, 'project_access')) {
|
|
3537
|
+
throw new Error(host_refusal('project_access'));
|
|
3538
|
+
}
|
|
3539
|
+
const limit = host_project_access_limit(config, host);
|
|
3540
|
+
if (project_access_rank(access) > project_access_rank(limit)) {
|
|
3541
|
+
throw new Error(t('主持人可授予的项目权限上限为 {limit},不能授予 {access}。请由房主手动调整。', { limit, access }));
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3544
|
+
|
|
3545
|
+
/** Use the host's managed level, or cap an unmanaged host at write. */
|
|
3546
|
+
function host_project_access_limit(config, host) {
|
|
3547
|
+
return managed_project_access(config.participants?.[host], config.project_access || 'read') || 'write';
|
|
3548
|
+
}
|
|
3549
|
+
|
|
3550
|
+
/** Check the effective access of a host-initiated adapter change before saving the new profile. */
|
|
3551
|
+
function assert_host_adapter_access(config, host, profile, next) {
|
|
3552
|
+
const fallback = config.project_access || 'read';
|
|
3553
|
+
const after = managed_project_access(next, fallback);
|
|
3554
|
+
if (after) assert_host_project_access({ config, host }, after);
|
|
3555
|
+
else if (managed_project_access(profile, fallback) && host_project_access_limit(config, host) !== 'full') {
|
|
3556
|
+
throw new Error(t('切换后,该成员将不再受本机项目权限档位约束。请由房主手动切换。'));
|
|
3557
|
+
}
|
|
3558
|
+
}
|
|
3559
|
+
|
|
3529
3560
|
/**
|
|
3530
3561
|
* The active-or-away member a host names by member ID or display name. The host itself only with `self`: changes that
|
|
3531
3562
|
* apply from its next delivery (model, label) let it recover, e.g. from one model's quota; stopping, access and
|
|
@@ -3616,9 +3647,11 @@ async function host_label(ctx, { member: wanted, label, description }) {
|
|
|
3616
3647
|
/** Invite a member from this computer's configured software, read-only unless the host asks. */
|
|
3617
3648
|
async function host_invite(ctx, options) {
|
|
3618
3649
|
if (!options.name) throw new Error('须用 --name 指定要邀请的平台(如 Claude、Codex)');
|
|
3650
|
+
if (options.access !== undefined) assert_host_project_access(ctx, options.access, true);
|
|
3619
3651
|
// Inviting a member that is only away brings it back under its own name and settings instead of adding a new one.
|
|
3620
3652
|
const away = ctx.roster.find(member => member.status === 'away' && (member.name === options.name || ctx.labels[member.name] === options.name));
|
|
3621
3653
|
if (away) {
|
|
3654
|
+
if (options.access !== undefined) throw new Error(t('请回离开的成员会保留原权限,请去掉 --access;如需调整权限,请用 host-control access。'));
|
|
3622
3655
|
await room_member(ctx.home, { ...ctx.owner, action: 'rejoin', name: away.name }, false, ctx.headers);
|
|
3623
3656
|
return { member: away.name, rejoined: true };
|
|
3624
3657
|
}
|
|
@@ -3712,7 +3745,7 @@ function edit_room_config(path, change) {
|
|
|
3712
3745
|
* `room-post`. A retry passes the same --submission-id and returns the same room.
|
|
3713
3746
|
*/
|
|
3714
3747
|
function host_spawn_members({ home, config, host }, o) {
|
|
3715
|
-
if (o.access
|
|
3748
|
+
if (o.access !== undefined) assert_host_project_access({ config, host }, o.access, true);
|
|
3716
3749
|
const access = o.access || 'read';
|
|
3717
3750
|
const host_name = o.host || platform_of(host);
|
|
3718
3751
|
const listed = (o.members || '').split(',').map(name => name.trim()).filter(Boolean);
|
|
@@ -4213,10 +4246,10 @@ const HOST_CONTROLS = {
|
|
|
4213
4246
|
model: (ctx, o) => o.list ? host_model_list(ctx, o)
|
|
4214
4247
|
: room_member_model(ctx.home, { ...ctx.owner, name: host_target(ctx, o.member, { self: true }).name, model: o.model || '', effort: o.effort || '', ...(o.service_tier !== undefined ? { service_tier: o.service_tier } : {}) }, ctx.headers),
|
|
4215
4248
|
access: (ctx, o) => {
|
|
4216
|
-
|
|
4249
|
+
assert_host_project_access(ctx, o.access);
|
|
4217
4250
|
return room_member_access(ctx.home, { ...ctx.owner, name: host_target(ctx, o.member).name, project_access: o.access });
|
|
4218
4251
|
},
|
|
4219
|
-
adapter: (ctx, o) => room_member_adapter(ctx.home, { ...ctx.owner, name: host_target(ctx, o.member).name, adapter: o.adapter }),
|
|
4252
|
+
adapter: (ctx, o) => room_member_adapter(ctx.home, { ...ctx.owner, name: host_target(ctx, o.member).name, adapter: o.adapter }, { host: ctx.host }),
|
|
4220
4253
|
label: host_label,
|
|
4221
4254
|
discussion: host_discussion,
|
|
4222
4255
|
goal: host_goal,
|
|
@@ -4340,7 +4373,7 @@ async function record_host_action(ctx, action, options, result) {
|
|
|
4340
4373
|
*/
|
|
4341
4374
|
export async function adopt_workflow(home, { access_file, draft_file, workflow_id, scope, project_id }) {
|
|
4342
4375
|
if (!draft_file === !workflow_id) throw new Error('须提供 --draft 草稿文件或 --id 工作流库中的工作流 ID 之一;凭据用 --access-file 或 DISCUSS_ACCESS_FILE');
|
|
4343
|
-
const { config, roster, protection } = await host_room(home, access_file);
|
|
4376
|
+
const { config, roster, host, protection } = await host_room(home, access_file);
|
|
4344
4377
|
if (protection) throw new Error(guest_refusal('workflow-adopt'));
|
|
4345
4378
|
if (!host_allowed(config, 'workflows')) throw new Error(host_refusal('workflows'));
|
|
4346
4379
|
if (scope && !['global', 'project'].includes(scope)) throw new Error('工作流作用域无效');
|
|
@@ -4351,14 +4384,18 @@ export async function adopt_workflow(home, { access_file, draft_file, workflow_i
|
|
|
4351
4384
|
const binding = store.project_id ? { scope: 'project', project_id: store.project_id } : { scope: 'global' };
|
|
4352
4385
|
if (draft_file && store.project_id && root.readonly) throw new Error('项目目录只读');
|
|
4353
4386
|
const bound = (config.workflow?.scope || 'global') === binding.scope && config.workflow?.project_id === binding.project_id ? config.workflow?.id : null;
|
|
4354
|
-
let workflow;
|
|
4387
|
+
let workflow, original;
|
|
4355
4388
|
if (workflow_id) workflow = bound_workflow(home, { ...config, workflow: { ...binding, id: workflow_id } });
|
|
4356
4389
|
else {
|
|
4357
4390
|
const draft = parse_workflow_draft([readFileSync(resolve(draft_file), 'utf8')]);
|
|
4358
4391
|
if (bound !== draft.id && list_workflows(store).some(item => item.id === draft.id)) throw new Error(`工作流库已有 ${draft.id},主持人不能覆盖其他工作流;要启用它请用 --id ${draft.id},新建请换一个 ID`);
|
|
4392
|
+
if (bound === draft.id && existsSync(workflow_directory(store, draft.id))) original = get_workflow(store, draft.id);
|
|
4359
4393
|
workflow = draft;
|
|
4360
4394
|
}
|
|
4361
4395
|
assert_workflow_enabled(store, workflow.id);
|
|
4396
|
+
const members_by_card = bound === workflow.id ? config.workflow.members || {} : {};
|
|
4397
|
+
const present = new Set(roster.filter(member => member.status === 'active').map(member => member.name));
|
|
4398
|
+
assert_host_workflow_access(workflow, config, host, draft_file ? { original } : { members_by_card, present });
|
|
4362
4399
|
const missing = workflow.agents.filter(agent => !card_platform_ready(home, agent.name)).map(agent => agent.name || agent.card);
|
|
4363
4400
|
if (missing.length) {
|
|
4364
4401
|
const ready = configured_platforms(home);
|
|
@@ -4366,13 +4403,30 @@ export async function adopt_workflow(home, { access_file, draft_file, workflow_i
|
|
|
4366
4403
|
}
|
|
4367
4404
|
// The host's draft replaces the room's own workflow on purpose (another one is refused above); a draft carries no
|
|
4368
4405
|
// sub-workflows or other files, so those are kept as saved.
|
|
4369
|
-
if (!workflow_id) workflow = save_workflow(store, workflow, validate_preset,
|
|
4406
|
+
if (!workflow_id) workflow = save_workflow(store, workflow, validate_preset,
|
|
4407
|
+
original ? { base_revision: original.revision, replace: true } : {});
|
|
4370
4408
|
const owner = { site: config.site, room_id: config.room, token: config.token };
|
|
4371
|
-
const members = await join_workflow_cards(home, config, roster, workflow,
|
|
4409
|
+
const members = await join_workflow_cards(home, config, roster, workflow, members_by_card);
|
|
4372
4410
|
const enabled = await room_workflow(home, { ...owner, action: 'enable', workflow: { ...binding, id: workflow.id, members } });
|
|
4373
4411
|
return { ...enabled, members, skill_path: join(workflow_directory(store, workflow.id), 'SKILL.md'), ...(workflow.warnings ? { warnings: workflow.warnings } : {}) };
|
|
4374
4412
|
}
|
|
4375
4413
|
|
|
4414
|
+
/** Drafts cannot introduce higher declarations, even on active cards. Library activation checks incoming cards. */
|
|
4415
|
+
function assert_host_workflow_access(workflow, config, host, { original, members_by_card, present }) {
|
|
4416
|
+
const limit = host_project_access_limit(config, host);
|
|
4417
|
+
const fallback = config.project_access || 'read';
|
|
4418
|
+
const previous = new Map(workflow_cards(original || {}).map(agent => [agent.card, agent.project_access || fallback]));
|
|
4419
|
+
const excessive = workflow_cards(workflow).flatMap(agent => {
|
|
4420
|
+
const access = agent.project_access || fallback;
|
|
4421
|
+
const rank = project_access_rank(access);
|
|
4422
|
+
if (rank <= project_access_rank(limit)) return [];
|
|
4423
|
+
if (present ? present.has(members_by_card[agent.card]) : rank <= project_access_rank(previous.get(agent.card))) return [];
|
|
4424
|
+
return [`${agent.name && agent.name !== agent.card ? `${agent.card} / ${agent.name}` : agent.card} (${access})`];
|
|
4425
|
+
});
|
|
4426
|
+
if (excessive.length) throw new Error(t('主持人可授予的项目权限上限为 {limit},以下工作流卡片超出上限:{cards}。请由房主手动调整。',
|
|
4427
|
+
{ limit, cards: excessive.join(', ') }));
|
|
4428
|
+
}
|
|
4429
|
+
|
|
4376
4430
|
/**
|
|
4377
4431
|
* Check a workflow folder or one-part draft as an import would, and optionally save it. A local AI uses this outside
|
|
4378
4432
|
* rooms with its user present, so the cards keep the project access they declare.
|
package/runner/i18n_en.mjs
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
/** English CLI strings. */
|
|
2
2
|
export default {
|
|
3
|
+
'项目权限须为 read、write、auto 或 full': 'Project access must be read, write, auto or full.',
|
|
4
|
+
'主持人可授予的项目权限上限为 {limit},不能授予 {access}。请由房主手动调整。': 'The host can grant project access up to {limit} and cannot grant {access}. Ask the room owner to adjust access manually.',
|
|
5
|
+
'主持人可授予的项目权限上限为 {limit},以下工作流卡片超出上限:{cards}。请由房主手动调整。': 'The host can grant project access up to {limit}. These workflow cards require more access: {cards}. Ask the room owner to adjust access manually.',
|
|
6
|
+
'切换后,该成员将不再受本机项目权限档位约束。请由房主手动切换。': 'Switching would remove the runner’s project access limits for this member. Ask the room owner to switch the adapter manually.',
|
|
7
|
+
'切换到受本机管理的接入方式时,所得权限不得超过主持人上限;从受管理的接入切到不受管理的接入时,主持人上限须为 full。': 'Switching to a managed adapter cannot grant more access than the host can grant. Switching from a managed to an unmanaged adapter requires a host limit of full.',
|
|
8
|
+
'请回离开的成员会保留原权限,请去掉 --access;如需调整权限,请用 host-control access。': 'An away member returns with their existing access. Omit --access and use host-control access to change their level.',
|
|
9
|
+
'workflow-adopt 主持人在本房间启用工作流:--draft 保存草稿(一段,分段头 1/1)后启用,不得新增或调高超出主持人上限的卡片权限;--id 启用库中已有的工作流,待加入卡片的权限不得超过主持人上限。须房主授予“工作流”权限。凭据为本次任务的 access_file(或 DISCUSS_ACCESS_FILE)。': 'workflow-adopt enables a workflow in this room. Use --draft to save and enable a one-part draft (header 1/1). A draft cannot add or raise a card’s access above the host’s limit. Use --id to enable a library workflow. Incoming cards cannot require access above the host’s limit. The room owner must grant the Workflows permission. Use the current task’s access_file or DISCUSS_ACCESS_FILE.',
|
|
10
|
+
'授权不得超过主持人自身的项目权限;主持人权限不由本机管理时,最多授予 write。普通房间的 invite 和 create-room 显式指定高于 read 的档位时,还须勾选“改项目权限”;请回离开成员时不要传 --access。': 'Hosts cannot grant more project access than they have. Hosts whose access is managed outside the runner can grant at most write. In ordinary rooms, invite and create-room also require Change project access when explicitly requesting a level above read. Omit --access when bringing back an away member.',
|
|
3
11
|
"标准速度": "Standard",
|
|
4
12
|
"所选软件不支持该速度档位": "The selected software does not support this speed tier",
|
|
5
13
|
"所选模型不支持该速度档位": "The selected model does not support this speed tier",
|
package/runner/workflows.mjs
CHANGED
|
@@ -980,6 +980,7 @@ export function install_workflow_folder(home, id, source) {
|
|
|
980
980
|
/**
|
|
981
981
|
* Write a checked workflow as files, publishing a complete directory with crash recovery. Replacing an existing entry
|
|
982
982
|
* needs `base.base_revision` (the revision it was read at, refused when the folder changed since) or `base.overwrite`.
|
|
983
|
+
* `base.replace` allows supplied card skills to replace saved ones without bypassing the revision check.
|
|
983
984
|
*/
|
|
984
985
|
export function save_workflow(home, input, validate_card, base = {}) {
|
|
985
986
|
const workflow = validate_workflow(input, validate_card);
|
|
@@ -987,9 +988,9 @@ export function save_workflow(home, input, validate_card, base = {}) {
|
|
|
987
988
|
check_save_base(workflow_directory(home, workflow.id), workflow.id, base);
|
|
988
989
|
const backups = [];
|
|
989
990
|
publish_directory(home, workflow.id, (staging, directory) => {
|
|
990
|
-
// Folder cards keep their skills
|
|
991
|
+
// Folder cards keep their skills unless the save explicitly replaces them or creates a new entry.
|
|
991
992
|
// A folder card whose skills are replaced or that the save drops is backed up first.
|
|
992
|
-
const carry = { folders: card_folders(directory), replace: base.overwrite === true || !existsSync(directory),
|
|
993
|
+
const carry = { folders: card_folders(directory), replace: base.overwrite === true || base.replace === true || !existsSync(directory),
|
|
993
994
|
backup: (card, folder) => backups.push(backup_card(home, workflow.id, card, folder)) };
|
|
994
995
|
mkdirSync(join(staging, 'experts'), { recursive: true });
|
|
995
996
|
writeFileSync(join(staging, 'SKILL.md'), serialize_markdown(skill_fields(workflow.id, workflow.label, workflow.description, [], workflow), workflow.skill));
|