ai_co_discuss 0.5.58 → 0.5.60
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/backend/analytics.py +40 -23
- package/backend/analytics_issues.py +6 -3
- package/backend/schema.sql +8 -0
- 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/analytics.json +3 -3
- package/frontend/locales/en/app.json +9 -2
- 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 +10 -1
- package/runner/site_deploy.mjs +86 -30
- package/runner/workflows.mjs +3 -2
- package/web/app.js +83 -10
- package/web/guest.css +1 -1
- package/web/i18n.js +3 -3
- package/web/markdown.css +1 -1
- package/web/modern.css +1 -1
- package/web/modern.js +66 -66
|
@@ -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/backend/analytics.py
CHANGED
|
@@ -152,18 +152,12 @@ def distribution(values, histogram=None):
|
|
|
152
152
|
REQUESTS = """
|
|
153
153
|
WITH prior AS (SELECT rr.request_id,min(e.created_at) AS dispatched
|
|
154
154
|
FROM retried_requests rr JOIN member_executions e ON e.id=rr.execution_id GROUP BY rr.request_id)
|
|
155
|
-
SELECT r.room_id,r.message_id,r.chain_id,r.created_at,r.status,mbr.name,mbr.adapter,
|
|
155
|
+
SELECT r.id,r.room_id,r.message_id,r.chain_id,r.created_at,r.status,mbr.name,mbr.adapter,
|
|
156
156
|
coalesce(l.label,mbr.name) AS label,coalesce(e.model,'') AS model,coalesce(e.effort,'') AS effort,
|
|
157
157
|
(m.author='用户' AND NOT EXISTS(SELECT 1 FROM message_relays l WHERE l.message_id=m.id)
|
|
158
158
|
AND NOT EXISTS(SELECT 1 FROM internal_task_messages i WHERE i.message_id=m.id)) AS initiated,
|
|
159
159
|
CAST(strftime('%s',m.created_at) AS INTEGER) AS sent,CAST(strftime('%s',a.created_at) AS INTEGER) AS answered,
|
|
160
|
-
coalesce(w.kind,aw.kind) AS withdrawal,e.result,c.reason,coalesce(prior.dispatched,e.created_at) AS dispatched
|
|
161
|
-
CASE WHEN c.reason='user_stop' AND e.id IS NULL THEN EXISTS(
|
|
162
|
-
SELECT 1 FROM room_events stop JOIN room_events cancelled ON cancelled.room_id=stop.room_id
|
|
163
|
-
AND cancelled.kind='request.cancel_reason'
|
|
164
|
-
AND cancelled.at BETWEEN stop.at AND stop.at+json_extract(stop.data,'$.elapsed_ms')+1
|
|
165
|
-
WHERE stop.room_id=r.room_id AND stop.kind='api.write' AND json_extract(stop.data,'$.path')='/stop'
|
|
166
|
-
AND json_extract(cancelled.data,'$.request_id')=r.id) END AS stopped_pending
|
|
160
|
+
coalesce(w.kind,aw.kind) AS withdrawal,e.result,c.reason,coalesce(prior.dispatched,e.created_at) AS dispatched
|
|
167
161
|
FROM member_requests r LEFT JOIN prior ON prior.request_id=r.id JOIN messages m ON m.id=r.message_id
|
|
168
162
|
JOIN room_directory d ON d.room_id=r.room_id AND d.system_kind=''
|
|
169
163
|
JOIN room_members mbr ON mbr.id=r.member_id LEFT JOIN member_labels l ON l.room_id=r.room_id AND l.name=mbr.name
|
|
@@ -173,12 +167,30 @@ LEFT JOIN message_withdrawals w ON w.message_id=m.id LEFT JOIN message_withdrawa
|
|
|
173
167
|
"""
|
|
174
168
|
|
|
175
169
|
|
|
176
|
-
def
|
|
170
|
+
def stopped_pending(connection, room_id=None):
|
|
171
|
+
"""Match owner stop calls to pending requests by the cancellation event's time."""
|
|
172
|
+
query = """SELECT DISTINCT r.id FROM room_events stop INDEXED BY room_events_owner_stop
|
|
173
|
+
CROSS JOIN room_events cancelled ON cancelled.room_id=stop.room_id
|
|
174
|
+
AND cancelled.kind='request.cancel_reason'
|
|
175
|
+
AND cancelled.at BETWEEN stop.at AND stop.at+CASE WHEN json_valid(stop.data)
|
|
176
|
+
THEN json_extract(stop.data,'$.elapsed_ms') END+1
|
|
177
|
+
JOIN member_requests r ON r.id=CASE WHEN json_valid(cancelled.data)
|
|
178
|
+
THEN json_extract(cancelled.data,'$.request_id') END AND r.room_id=stop.room_id
|
|
179
|
+
JOIN request_cancel_reasons c ON c.request_id=r.id AND c.reason='user_stop'
|
|
180
|
+
LEFT JOIN member_executions e ON e.id=r.execution_id
|
|
181
|
+
WHERE stop.kind='api.write' AND CASE WHEN json_valid(stop.data)
|
|
182
|
+
THEN json_extract(stop.data,'$.path') END='/stop' AND e.id IS NULL"""
|
|
183
|
+
if room_id is not None:
|
|
184
|
+
query += " AND stop.room_id=?"
|
|
185
|
+
return {row[0] for row in connection.execute(query, () if room_id is None else (room_id,))}
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def user_stopped(row, pending):
|
|
177
189
|
"""Separate owner interventions from host cancellations and send-now follow-ups."""
|
|
178
|
-
return row["reason"] == "user_stop" and (row["
|
|
190
|
+
return row["reason"] == "user_stop" and (row["id"] in pending or row["result"] in ("用户打断", "用户停止全部", "用户回退了对话"))
|
|
179
191
|
|
|
180
192
|
|
|
181
|
-
def overview_facts(rows):
|
|
193
|
+
def overview_facts(rows, pending):
|
|
182
194
|
"""Yield additive facts with their original message or chain cohort timestamp."""
|
|
183
195
|
messages, chains = defaultdict(list), defaultdict(list)
|
|
184
196
|
for row in rows:
|
|
@@ -195,7 +207,7 @@ def overview_facts(rows):
|
|
|
195
207
|
continue
|
|
196
208
|
first = min(row["created_at"] for row in group)
|
|
197
209
|
yield first, "ended", 1
|
|
198
|
-
if not any(r["withdrawal"] or user_stopped(r) for r in group):
|
|
210
|
+
if not any(r["withdrawal"] or user_stopped(r, pending) for r in group):
|
|
199
211
|
yield first, "unassisted", 1
|
|
200
212
|
answers = [r["answered"] for r in group if r["answered"] is not None]
|
|
201
213
|
if answers and all(r["status"] == "completed" for r in group):
|
|
@@ -431,12 +443,14 @@ def actions(connection, start, end):
|
|
|
431
443
|
retract = count("""SELECT count(*) FROM message_withdrawals w JOIN messages m ON m.id=w.message_id
|
|
432
444
|
JOIN room_directory d ON d.room_id=m.room_id AND d.system_kind=''
|
|
433
445
|
WHERE w.kind='retracted' AND w.created_at>=? AND w.created_at<?""")
|
|
434
|
-
stops = count("""SELECT count(*) FROM room_events e
|
|
446
|
+
stops = count("""SELECT count(*) FROM room_events e INDEXED BY room_events_owner_stop
|
|
447
|
+
JOIN room_directory d ON d.room_id=e.room_id AND d.system_kind=''
|
|
435
448
|
WHERE at>=?*1000 AND at<?*1000 AND kind='api.write'
|
|
436
|
-
AND json_extract(data,'$.path')='/stop'""")
|
|
449
|
+
AND CASE WHEN json_valid(e.data) THEN json_extract(e.data,'$.path') END='/stop'""")
|
|
437
450
|
stops += count("""SELECT count(*) FROM room_events e JOIN room_directory d ON d.room_id=e.room_id AND d.system_kind=''
|
|
438
451
|
WHERE at>=?*1000 AND at<?*1000 AND kind='execution.changed'
|
|
439
|
-
AND
|
|
452
|
+
AND CASE WHEN json_valid(e.data) THEN
|
|
453
|
+
json_extract(e.data,'$.status')='cancelled' AND json_extract(e.data,'$.result')='用户打断' END""")
|
|
440
454
|
extra = count("""SELECT count(*) FROM execution_interjections i LEFT JOIN interjection_authors a ON a.interjection_id=i.id
|
|
441
455
|
JOIN room_directory d ON d.room_id=i.room_id AND d.system_kind=''
|
|
442
456
|
WHERE a.interjection_id IS NULL AND i.created_at>=? AND i.created_at<?""")
|
|
@@ -481,8 +495,9 @@ UNION ALL SELECT w.created_at,'withdrawals',1 FROM message_withdrawals w JOIN me
|
|
|
481
495
|
UNION ALL SELECT i.created_at,'interjections',1 FROM execution_interjections i
|
|
482
496
|
LEFT JOIN interjection_authors a ON a.interjection_id=i.id WHERE i.room_id=:room AND a.interjection_id IS NULL
|
|
483
497
|
UNION ALL SELECT at/1000,'stops',1 FROM room_events WHERE room_id=:room AND
|
|
484
|
-
|
|
485
|
-
|
|
498
|
+
CASE WHEN json_valid(data) THEN
|
|
499
|
+
(kind='api.write' AND json_extract(data,'$.path')='/stop') OR (kind='execution.changed'
|
|
500
|
+
AND json_extract(data,'$.status')='cancelled' AND json_extract(data,'$.result')='用户打断') END
|
|
486
501
|
"""
|
|
487
502
|
|
|
488
503
|
|
|
@@ -493,7 +508,7 @@ def seal_room(connection, room_id, now):
|
|
|
493
508
|
key = archive_key(room_id, secret)
|
|
494
509
|
rows = connection.execute(REQUESTS + " WHERE r.room_id=?", (room_id,)).fetchall()
|
|
495
510
|
days = defaultdict(lambda: (Counter(), defaultdict(Counter)))
|
|
496
|
-
for facts in (overview_facts(rows), room_time_facts(connection, room_id, rows, now),
|
|
511
|
+
for facts in (overview_facts(rows, stopped_pending(connection, room_id)), room_time_facts(connection, room_id, rows, now),
|
|
497
512
|
connection.execute(ARCHIVE_ACTIONS, {"room": room_id})):
|
|
498
513
|
for stamp, metric, value in facts:
|
|
499
514
|
if stamp is None:
|
|
@@ -672,22 +687,24 @@ def snapshot(connection, params, cache, now):
|
|
|
672
687
|
connection.execute("BEGIN")
|
|
673
688
|
rooms = tuple(r[0] for r in connection.execute("SELECT room_id FROM room_directory WHERE system_kind='' ORDER BY room_id"))
|
|
674
689
|
revision = connection.execute("SELECT value FROM site_preferences WHERE key='analytics_revision'").fetchone()
|
|
690
|
+
compact = params.get("compact") == "1"
|
|
675
691
|
date_key = ("24h", dates["tz"], int(now) // CACHE_SECONDS) if "start_at" in dates else tuple(dates.values())
|
|
676
|
-
key = (date_key, rooms, mode, revision[0] if revision else None)
|
|
692
|
+
key = (date_key, rooms, mode, compact, revision[0] if revision else None)
|
|
677
693
|
hit = cache.get(key)
|
|
678
694
|
if hit and monotonic() < hit[0]:
|
|
679
695
|
return hit[1]
|
|
680
696
|
requests = connection.execute(REQUESTS).fetchall()
|
|
681
697
|
executions = connection.execute(EXECUTIONS, (end, start, start)).fetchall()
|
|
682
698
|
revived = {r[0] for r in connection.execute("""SELECT DISTINCT json_extract(data,'$.execution_id') FROM room_events
|
|
683
|
-
WHERE kind='execution.changed' AND
|
|
699
|
+
WHERE kind='execution.changed' AND CASE WHEN json_valid(data) THEN
|
|
700
|
+
json_extract(data,'$.from_status')='failed' AND json_extract(data,'$.status')='started' END""")}
|
|
684
701
|
attempts = [r for r in executions if r["created_at"] >= start]
|
|
685
702
|
earlier_attempts = [r for r in connection.execute(EXECUTIONS, (start, previous, previous)) if r["created_at"] >= previous]
|
|
686
703
|
assigned = [r for r in requests if start <= r["created_at"] < end]
|
|
687
|
-
members = member_stats(attempts, assigned, revived)
|
|
704
|
+
members = [] if compact else member_stats(attempts, assigned, revived)
|
|
688
705
|
models = member_stats(attempts, assigned, revived, by_model=True)
|
|
689
706
|
(prior, sealed), retained, sealed_days = sealed_periods(connection, mode, rooms, dates)
|
|
690
|
-
facts = list(overview_facts(requests))
|
|
707
|
+
facts = list(overview_facts(requests, stopped_pending(connection)))
|
|
691
708
|
activity = actions(connection, start, end)
|
|
692
709
|
for group in activity.values():
|
|
693
710
|
for name in group:
|
|
@@ -703,7 +720,7 @@ def snapshot(connection, params, cache, now):
|
|
|
703
720
|
members=members, models=models, workflows=workflow_stats(connection, attempts),
|
|
704
721
|
scheduler=scheduler,
|
|
705
722
|
issues=attention_issues(connection, attempts, earlier_attempts, revived, (previous, start, end, now), scheduler["summary"]),
|
|
706
|
-
insights=insights(connection, members, start, end))
|
|
723
|
+
insights=[] if compact else insights(connection, members, start, end))
|
|
707
724
|
result["overview"]["daily"] = daily_overview(dates, facts, executions, sealed_days, now, (start, end))
|
|
708
725
|
result["time"]["concurrency"]["unfinished"] = unfinished_series(attempts, start, end)
|
|
709
726
|
result["previous"].update(previous_work(earlier_attempts, previous, start, now))
|
|
@@ -70,9 +70,12 @@ SUSPECTED_STALLS = """
|
|
|
70
70
|
WHERE q.room_id=g.room_id AND q.created_at<g.end AND (
|
|
71
71
|
q.created_at>g.start OR q.status IN ('pending','delivering') OR
|
|
72
72
|
coalesce(CAST(strftime('%s',a.created_at) AS INTEGER),
|
|
73
|
-
(SELECT
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
(SELECT v.at/1000 FROM room_events v
|
|
74
|
+
WHERE v.room_id=q.room_id AND v.kind='request.changed'
|
|
75
|
+
AND CAST(CASE WHEN json_valid(v.data) THEN json_extract(v.data,'$.request_id') END AS NUMERIC)=q.id
|
|
76
|
+
AND CASE WHEN json_valid(v.data) THEN json_extract(v.data,'$.request_id') END=q.id
|
|
77
|
+
AND CASE WHEN json_valid(v.data) THEN json_extract(v.data,'$.status') END IN
|
|
78
|
+
('completed','failed','cancelled') ORDER BY v.at DESC LIMIT 1),nullif(e.finished_at,0),g.end)>g.start))
|
|
76
79
|
"""
|
|
77
80
|
|
|
78
81
|
|
package/backend/schema.sql
CHANGED
|
@@ -1994,6 +1994,14 @@ CREATE TABLE IF NOT EXISTS stored_texts (
|
|
|
1994
1994
|
PRIMARY KEY (owner, owner_id, field)
|
|
1995
1995
|
);
|
|
1996
1996
|
CREATE INDEX IF NOT EXISTS room_events_room ON room_events(room_id,id);
|
|
1997
|
+
CREATE INDEX IF NOT EXISTS room_events_kind_at ON room_events(kind,at);
|
|
1998
|
+
-- Stop analytics names this index so it does not scan every api.write event.
|
|
1999
|
+
CREATE INDEX IF NOT EXISTS room_events_owner_stop ON room_events(at,room_id)
|
|
2000
|
+
WHERE kind='api.write' AND CASE WHEN json_valid(data) THEN json_extract(data,'$.path') END='/stop';
|
|
2001
|
+
CREATE INDEX IF NOT EXISTS room_events_request_terminal ON room_events(
|
|
2002
|
+
room_id,CAST(CASE WHEN json_valid(data) THEN json_extract(data,'$.request_id') END AS NUMERIC),at)
|
|
2003
|
+
WHERE kind='request.changed' AND CASE WHEN json_valid(data) THEN json_extract(data,'$.status') END
|
|
2004
|
+
IN ('completed','failed','cancelled');
|
|
1997
2005
|
-- Anonymous UTC-day contributions; the key is site-private and never returned by an API.
|
|
1998
2006
|
CREATE TABLE IF NOT EXISTS analytics_sealed_days (
|
|
1999
2007
|
archive_key TEXT NOT NULL, day TEXT NOT NULL, counts TEXT NOT NULL, histograms TEXT NOT NULL,
|
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 主持人能够读取已启用工作流的说明和角色名单。
|
|
@@ -141,14 +141,14 @@
|
|
|
141
141
|
"没有留下说明": "no note left",
|
|
142
142
|
"涉及 {members}": "Affects {members}",
|
|
143
143
|
"占相关 {total} 次运行的 {share}": "{share} of {total} related runs",
|
|
144
|
-
"同时在跑的专家": "Experts
|
|
144
|
+
"同时在跑的专家": "Experts at once",
|
|
145
145
|
"峰值 {count} 位": "Peak {count}",
|
|
146
146
|
"同时推进": "Rooms at once",
|
|
147
147
|
"涉及 {members} 等 {count} 组": "Affects {members} and others ({count} groups)",
|
|
148
148
|
"「{reason}」:{count} 次运行出错": "“{reason}”: {count} runs errored",
|
|
149
|
-
"出错的运行": "
|
|
149
|
+
"出错的运行": "Errored runs",
|
|
150
150
|
"{when}:{experts} 位专家在 {rooms} 个房间里跑,{count} 次出错": "{when}: {experts} experts running in {rooms} rooms, {count} runs errored",
|
|
151
|
-
"同时在跑的房间": "Rooms
|
|
151
|
+
"同时在跑的房间": "Rooms at once",
|
|
152
152
|
"点击固定,可打开房间": "Click to pin and open a room",
|
|
153
153
|
"已固定,点击图表外或按 Esc 取消": "Pinned. Click outside the chart or press Esc to release",
|
|
154
154
|
"按固定规则从这段时间的运行里挑出:出错的运行(失败,或被系统中途取消;你或主持人主动停止的不算)按原因合并,同一原因影响几个模型也只算一条。占相关运行 5% 以上或比上期翻倍才列出,占 10% 以上或翻倍的标红。只写发生了什么,不判断哪个模型更好。点开可以看到具体是哪几次,并跳到房间里对应的消息。": "Picked from this period's runs by fixed rules. Runs that errored (failed, or cancelled by the system part-way; stops by you or the host do not count) are grouped by reason, so one cause across several models is one item. An item is listed at 5% or more of the related runs or when it doubled, and marked red at 10% or more or when it doubled. Items state what happened and do not judge which model is better. Expand one to see the runs and jump to the message in its room.",
|
|
@@ -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",
|
|
@@ -611,7 +612,8 @@
|
|
|
611
612
|
"单文件 HTML": "Single-file HTML",
|
|
612
613
|
"多文件 HTML": "Multi-file HTML",
|
|
613
614
|
"线上预览可能缺少部分资源。请在电脑本机打开或部署为网站。": "The online preview may be missing resources. Open it on the host computer or deploy it as a website.",
|
|
614
|
-
"
|
|
615
|
+
"原网页不在项目目录内,无法预览,但可点右侧火箭部署为网站": "This page is outside the project folders and cannot be previewed. Use the rocket button to deploy it.",
|
|
616
|
+
"{reason}。请重新登记后再试。": "{reason}. Stage it again and retry.",
|
|
615
617
|
"多文件网页含外部资源,请在“文件”页下载整个文件夹": "This page uses external files. Download the whole folder from the Files tab.",
|
|
616
618
|
"此待部署记录没有可预览的项目入口": "This staged site has no project entry to preview.",
|
|
617
619
|
"请把多文件 HTML 和资源放在独立子目录,再部署为网站": "Move the multi-file HTML and its resources into a dedicated subfolder before deploying.",
|
|
@@ -870,5 +872,10 @@
|
|
|
870
872
|
"包含": "Contains",
|
|
871
873
|
"{files} 个文件,{folders} 个文件夹": "{files} files, {folders} folders",
|
|
872
874
|
"过期时间": "Expires",
|
|
873
|
-
"来源": "Source"
|
|
875
|
+
"来源": "Source",
|
|
876
|
+
"通过云盘加载": "Load via cloud drive",
|
|
877
|
+
"正在通过云盘加载…": "Loading via cloud drive…",
|
|
878
|
+
"正在载入原图…": "Loading original image…",
|
|
879
|
+
"正在通过云盘加载原图…": "Loading original via cloud drive…",
|
|
880
|
+
"图片保存失败,请重试": "Could not save image. Please try again"
|
|
874
881
|
}
|
|
@@ -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
|
}
|