ai_co_discuss 0.5.50 → 0.5.52
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-participant/SKILL.md +1 -1
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/backend/analytics.py +1 -0
- package/backend/analytics_live.py +3 -1
- package/backend/cloud_drive.py +6 -3
- package/backend/free_room.py +8 -1
- package/backend/server.py +110 -129
- package/docs/en/guide/admin.md +11 -5
- package/docs/en/guide/analytics.md +2 -2
- package/docs/en/guide/faq.md +2 -1
- package/docs/en/guide/members.md +4 -4
- package/docs/en/guide/rooms.md +6 -7
- package/docs/en/guide/steward.md +10 -9
- package/docs/en/guide/working.md +2 -2
- package/docs/guide/admin.md +15 -9
- package/docs/guide/analytics.md +2 -2
- package/docs/guide/faq.md +2 -1
- package/docs/guide/members.md +4 -4
- package/docs/guide/rooms.md +7 -8
- package/docs/guide/steward.md +10 -9
- package/docs/guide/working.md +2 -2
- package/frontend/locales/en/admin.json +14 -1
- package/frontend/locales/en/analytics.json +12 -6
- package/frontend/locales/en/app.json +9 -9
- package/frontend/locales/en/backend.json +1 -0
- package/frontend/locales/en/core.json +4 -0
- package/frontend/locales/en/discussion.json +1 -0
- package/frontend/locales/en/room.json +38 -1
- package/frontend/locales/en/settings.json +1 -2
- package/frontend/locales/en/steward.json +3 -1
- package/package.json +1 -1
- package/runner/adapters/claude.mjs +20 -0
- package/runner/adapters/common.mjs +21 -8
- package/runner/admin_cli.mjs +5 -0
- package/runner/admin_panel.mjs +67 -14
- package/runner/attachment_cache.mjs +12 -6
- package/runner/codiscuss.mjs +2 -2
- package/runner/discussion_launch.mjs +8 -16
- package/runner/discussion_setup.mjs +21 -22
- package/runner/hosting_setup.mjs +7 -6
- package/runner/i18n_en.mjs +14 -6
- package/runner/os_users.mjs +6 -0
- package/runner/project_cloud.mjs +10 -41
- package/runner/relay_channel.mjs +1 -1
- package/web/admin.css +1 -1
- package/web/admin.js +3 -3
- package/web/app.js +84 -53
- package/web/guest.js +1 -1
- package/web/i18n.js +3 -3
- package/web/modern.css +1 -1
- package/web/modern.js +72 -71
|
@@ -48,7 +48,7 @@ description: "AI CoDiscuss 的通用参与技能,所有参与者(包括主
|
|
|
48
48
|
- `execution status`(省略编号即本次执行)回答“我现在该做什么、回答是否已落库”;主持人的累计判断存在 `state view`。
|
|
49
49
|
- 增量读取用实际已读编号 `message list ROOM --after ID`,`latest_id` 不等于已读;可按 `--author`、`--query`、`--kind` 筛选。
|
|
50
50
|
- 同一站点的其他房间可以只读查看:读取命令写上对方的房间编号即可(如 `room view 房间`、`message list 房间`、`room events 房间`);写入仍限本房间,对方的私聊不可读。
|
|
51
|
-
- 唤醒你的消息带附件时,任务提示末尾列出本机副本;存在云空间的大附件也由程序下载到项目之外的附件缓存,只读成员同样直接用任务里的本机路径。其他附件,或自动下载失败时,用 `attachment download ROOM ID` 取得(不带 `--dest`
|
|
51
|
+
- 唤醒你的消息带附件时,任务提示末尾列出本机副本;存在云空间的大附件也由程序下载到项目之外的附件缓存,只读成员同样直接用任务里的本机路径。其他附件,或自动下载失败时,用 `attachment download ROOM ID` 取得(不带 `--dest` 时存进同一缓存);需要长期留在项目里时,由你从附件缓存复制到项目目录,项目只读时请有写权限的成员来做。下载或看到文件名不等于读过,读不到就如实说明。
|
|
52
52
|
|
|
53
53
|
## 回答
|
|
54
54
|
|
package/README.md
CHANGED
|
@@ -98,7 +98,7 @@ flowchart LR
|
|
|
98
98
|
- **Local site**: rooms, members, messages and files are stored here; open <http://127.0.0.1:8765> in a browser on the computer. It stores and checks (whose turn it is, whether a revision is current, whether a credential is valid). It never runs models or stores API keys.
|
|
99
99
|
- **Runner**: when a room needs an agent, it wakes that agent in its own Claude Code, Codex or other session, or calls the model API you configured; requests from your phone through the self-hosted relay are passed on to the local site by it too. Keys stay on your machine.
|
|
100
100
|
- **Agents** read and post through the `codiscuss` CLI using per-member credentials, guided by the bundled `discuss-host` and `discuss-participant` skills.
|
|
101
|
-
- **Feedback to the developers**: only when you click "Save and send to developers" or "Send feedback" does the browser send it to the official service `share.codiscuss.com`, with the version, system and names of the software you set up. A correction to a host dispatch or a smart-scheduling decision also carries the original text of the messages that decision saw at the time; you can unfold it before sending. No copy stays on this computer.
|
|
101
|
+
- **Feedback to the developers**: only when you click "Save and send to developers" or "Send feedback" does the browser send it to the official service `share.codiscuss.com`, with the version, system and names of the software you set up. A correction to a host dispatch or a smart-scheduling decision also carries the original text of the messages that decision saw at the time; you can unfold it before sending. Images and videos added to "Send feedback" are uploaded too. No copy stays on this computer.
|
|
102
102
|
|
|
103
103
|
To use it from your phone away from the computer, see [Deployment](#deployment) below.
|
|
104
104
|
|
package/README.zh-CN.md
CHANGED
|
@@ -98,7 +98,7 @@ flowchart LR
|
|
|
98
98
|
- **本机网站**:房间、成员、消息和附件都存在这里,在电脑上用浏览器打开 <http://127.0.0.1:8765>。它负责保存和校验(谁该发言、版本是否最新、凭据是否有效),不运行模型,也不保存 API 密钥。
|
|
99
99
|
- **接入服务**:房间里有新消息要 AI 处理时,它在 Claude Code、Codex 等软件的原会话里叫醒对应的 AI,或调用你配置的模型 API;手机经自建中转发来的请求,也由它转交给本机网站。密钥只留在本机。
|
|
100
100
|
- **AI 成员**按随包技能 `discuss-host`、`discuss-participant`,凭各自的成员凭证通过 `codiscuss` CLI 读写房间。
|
|
101
|
-
- **发给开发者的反馈**:只有你点“保存并发给开发者”或“反馈问题”时,浏览器才把内容发到官方服务 `share.codiscuss.com
|
|
101
|
+
- **发给开发者的反馈**:只有你点“保存并发给开发者”或“反馈问题”时,浏览器才把内容发到官方服务 `share.codiscuss.com`,附带版本、系统和已配置的软件名称;纠正派活或智能调度时还会带上这次决策当时看到的消息原文,发送前可展开查看;“反馈问题”里添加的图片和视频也一并上传。本机不留副本。
|
|
102
102
|
|
|
103
103
|
在外面用手机访问,见下面的[部署](#部署)。
|
|
104
104
|
|
package/backend/analytics.py
CHANGED
|
@@ -388,6 +388,7 @@ def time_stats(connection, requests, executions, bounds, now, sealed):
|
|
|
388
388
|
members, members_at = peak_concurrent(member_spans)
|
|
389
389
|
peak = {"rooms": rooms, "at": rooms_at, "members": members, "members_at": members_at}
|
|
390
390
|
concurrency = concurrency_series(member_spans, start, end)
|
|
391
|
+
concurrency["room_points"] = concurrency_series(spans, start, end, concurrency["step"])["points"]
|
|
391
392
|
concurrency["rooms"] = bucket_rooms(shown_spans, start, end, concurrency["step"])
|
|
392
393
|
active_rooms = [room for room in room_rows.values() if room["initiated"] or room["execution_seconds"]]
|
|
393
394
|
return {"folders": list(folders.values()), "rooms": active_rooms, "peak": peak, "concurrency": concurrency, "sealed_execution_seconds": counts["execution_seconds"],
|
|
@@ -132,13 +132,15 @@ def live_snapshot(connection, now):
|
|
|
132
132
|
connection.execute("BEGIN")
|
|
133
133
|
start = now - WINDOW
|
|
134
134
|
rows = connection.execute(RECENT, (now, start)).fetchall()
|
|
135
|
-
spans, shown = defaultdict(list), defaultdict(list)
|
|
135
|
+
spans, shown, room_spans = defaultdict(list), defaultdict(list), defaultdict(list)
|
|
136
136
|
for row in rows:
|
|
137
137
|
left, right = max(start, row["created_at"]), min(now, row["finished_at"] or now)
|
|
138
138
|
if left < right:
|
|
139
139
|
spans[(row["room_id"], row["name"])].append((left, right))
|
|
140
140
|
shown[(row["room_id"], row["label"] or row["name"])].append((left, right))
|
|
141
|
+
room_spans[row["room_id"]].append((left, right))
|
|
141
142
|
timeline = concurrency_series(spans, start, now, MINUTE)
|
|
143
|
+
timeline["room_points"] = concurrency_series(room_spans, start, now, MINUTE)["points"]
|
|
142
144
|
timeline["rooms"] = bucket_rooms(shown, start, now, MINUTE)
|
|
143
145
|
timeline["unfinished"] = unfinished_series(rows, start, now, MINUTE)
|
|
144
146
|
timeline["start"] = start
|
package/backend/cloud_drive.py
CHANGED
|
@@ -266,8 +266,8 @@ def temporary_rooms(connection, language):
|
|
|
266
266
|
UNION
|
|
267
267
|
SELECT room_id FROM cloud_files WHERE purpose!='keep' AND stored_at IS NOT NULL AND cleared_at IS NULL
|
|
268
268
|
) AS source LEFT JOIN rooms ON rooms.id=source.room_id ORDER BY rooms.title, source.room_id""")
|
|
269
|
-
return [{"id": TEMPORARY_ROOM_PREFIX + (row["room_id"] or ORPHANED),
|
|
270
|
-
"name": row["title"] or read_text(Text("
|
|
269
|
+
return [{"id": TEMPORARY_ROOM_PREFIX + (row["room_id"] or ORPHANED), "destroyed": row["title"] is None,
|
|
270
|
+
"name": row["title"] or read_text(Text("已销毁的房间"), language), "room_id": row["room_id"], "kind": "folder",
|
|
271
271
|
"parent_id": TEMPORARY, "readonly": True} for row in rows]
|
|
272
272
|
|
|
273
273
|
|
|
@@ -334,7 +334,7 @@ def usage(connection, database):
|
|
|
334
334
|
|
|
335
335
|
def list_entries(connection, database, params, language="zh"):
|
|
336
336
|
"""Keep the legacy flat API while offering folder views, global search and trash accounting."""
|
|
337
|
-
from .server import attachment_view, cloud_file_view
|
|
337
|
+
from .server import attachment_view, cloud_file_view, read_text
|
|
338
338
|
|
|
339
339
|
connection.execute("BEGIN")
|
|
340
340
|
folder = params.get("folder")
|
|
@@ -350,6 +350,9 @@ def list_entries(connection, database, params, language="zh"):
|
|
|
350
350
|
chain = [] if folder is None or folder in SYSTEM_FOLDERS else folder_chain(connection, folder)
|
|
351
351
|
cloud, attachments = cloud_rows(connection, folder, search, virtual_room)
|
|
352
352
|
files = [cloud_file_view(connection, row) for row in cloud if search in row["file_name"].casefold()]
|
|
353
|
+
for file in files:
|
|
354
|
+
if file.get("room_destroyed"):
|
|
355
|
+
file["room_title"] = read_text(Text("已销毁的房间"), language)
|
|
353
356
|
files += [{**attachment_view(connection, row), "kind": "attachment", "source_kind": "attachment",
|
|
354
357
|
"source_ref": row["id"]} for row in attachments if search in row["file_name"].casefold()]
|
|
355
358
|
files.sort(key=lambda item: item["id"])
|
package/backend/free_room.py
CHANGED
|
@@ -741,9 +741,16 @@ def checked_quota(value):
|
|
|
741
741
|
def save_account_quota(connection, account, quota, now):
|
|
742
742
|
"""Keep the latest quota one account showed; every room on this site reads the same row."""
|
|
743
743
|
quota = checked_quota(quota)
|
|
744
|
+
reported_windows = quota["windows"]
|
|
744
745
|
previous = connection.execute("SELECT quota FROM account_quotas WHERE account=?", (account,)).fetchone()
|
|
745
746
|
if previous:
|
|
746
747
|
saved = json.loads(previous["quota"])
|
|
748
|
+
reported = {(window["group"], window["kind"]) for window in reported_windows}
|
|
749
|
+
quota["windows"] = reported_windows + [
|
|
750
|
+
window for window in saved["windows"]
|
|
751
|
+
if window.get("group") and window["used"] >= 1 and window["resets_at"] > now
|
|
752
|
+
and (window["group"], window["kind"]) not in reported
|
|
753
|
+
]
|
|
747
754
|
for key in ("plan", "reset_credits"):
|
|
748
755
|
if key in saved:
|
|
749
756
|
quota.setdefault(key, saved[key])
|
|
@@ -751,7 +758,7 @@ def save_account_quota(connection, account, quota, now):
|
|
|
751
758
|
ON CONFLICT(account) DO UPDATE SET quota=excluded.quota,updated_at=excluded.updated_at""",
|
|
752
759
|
(account, json.dumps(quota, ensure_ascii=False), now))
|
|
753
760
|
connection.execute("DELETE FROM account_quota_history WHERE read_at < ?", (now - QUOTA_HISTORY_SECONDS,))
|
|
754
|
-
for window in
|
|
761
|
+
for window in reported_windows:
|
|
755
762
|
key = (account, window["group"], window["kind"], window["minutes"])
|
|
756
763
|
latest = connection.execute("""SELECT used, resets_at FROM account_quota_history
|
|
757
764
|
WHERE account=? AND group_name=? AND kind=? AND minutes=? ORDER BY id DESC LIMIT 1""", key).fetchone()
|
package/backend/server.py
CHANGED
|
@@ -123,7 +123,6 @@ BYTES_PER_MIB = 1024 * 1024
|
|
|
123
123
|
ORPHAN_ATTACHMENT_GRACE_SECONDS = 60 * 60
|
|
124
124
|
CLOUD_COPY_CHUNK_BYTES = 1024 * 1024
|
|
125
125
|
CLOUD_COPY_TIMEOUT_SECONDS = 30
|
|
126
|
-
CLOUD_LAND_GRANT_SECONDS = 60
|
|
127
126
|
CLOUD_COPY_WORKERS = 4
|
|
128
127
|
CLOUD_COPY_FAILED_RESULTS = 128
|
|
129
128
|
MAX_CLOUD_SOURCE_REF = 4096
|
|
@@ -1251,6 +1250,7 @@ def list_rooms(connection, params=None, *, include_group_windows=False, exclude_
|
|
|
1251
1250
|
COALESCE(reads.owner_read_until,stats.latest_id,0) AS owner_read_until,
|
|
1252
1251
|
COALESCE(reads.failure_dismissed_at,0) AS failure_dismissed_at,
|
|
1253
1252
|
CASE WHEN EXISTS(SELECT 1 FROM moss_task_rooms t WHERE t.room_id=rooms.id) THEN 'task' ELSE '' END AS preset,
|
|
1253
|
+
(SELECT COUNT(*) FROM room_members rm WHERE rm.room_id=rooms.id AND rm.status IN ('active','away')) AS member_count,
|
|
1254
1254
|
{ROOM_WAITING_SINCE_SQL} AS waiting_user_since
|
|
1255
1255
|
FROM rooms LEFT JOIN room_message_stats stats ON stats.room_id=rooms.id
|
|
1256
1256
|
LEFT JOIN room_owner_reads reads ON reads.room_id=rooms.id {where}
|
|
@@ -1983,6 +1983,8 @@ def manage_room(connection, room_id, action, payload, *, automatic_archive=False
|
|
|
1983
1983
|
counts.append({"kind": "feedback_cases", "state": "kept", "count": feedback})
|
|
1984
1984
|
if not room["system_kind"]:
|
|
1985
1985
|
seal_room(connection, room_id, int(time.time()))
|
|
1986
|
+
# The receipt owns these temporary keys once their room is gone. Do not detach them as drive files.
|
|
1987
|
+
connection.execute("DELETE FROM cloud_files WHERE room_id=? AND purpose!='keep'", (room_id,))
|
|
1986
1988
|
delete_room_records(connection, room_id, keep_feedback=keep_feedback)
|
|
1987
1989
|
connection.execute("""INSERT OR REPLACE INTO room_destructions (room_id,title,control_hash,status,expect_runner,automatic,items,sessions,created_at)
|
|
1988
1990
|
VALUES (?,?,?,'cleaning',?,?,?,?,?)""", (room_id, room["title"], control[0] if control else "", int(expect_runner),
|
|
@@ -2059,20 +2061,42 @@ RUNNER_DESTRUCTION_KINDS = ("sessions", "runtime_files", "kept_sessions", "softw
|
|
|
2059
2061
|
DESTRUCTION_LIST_LIMIT = 20
|
|
2060
2062
|
|
|
2061
2063
|
|
|
2064
|
+
def destruction_cloud_objects(connection, room_id):
|
|
2065
|
+
"""Snapshot the room's object keys before cascades remove their records."""
|
|
2066
|
+
# Older manual attachment cleanup could set cleared_at even if the provider failed.
|
|
2067
|
+
rows = connection.execute(f"""SELECT id,object_name,size,stored_at FROM attachments
|
|
2068
|
+
WHERE room_id=? AND storage='object' AND object_name IS NOT NULL
|
|
2069
|
+
UNION ALL
|
|
2070
|
+
SELECT id,object_name,size,stored_at FROM cloud_files
|
|
2071
|
+
WHERE room_id=? AND purpose!='keep' AND cleared_at IS NULL""", (room_id, room_id))
|
|
2072
|
+
objects = []
|
|
2073
|
+
for row in rows:
|
|
2074
|
+
item = {key: row[key] for key in ("id", "object_name", "size")}
|
|
2075
|
+
item["room_id"] = room_id
|
|
2076
|
+
if row["stored_at"] is None:
|
|
2077
|
+
# An issued upload form can arrive late. Keep its reservation through the ordinary draft window.
|
|
2078
|
+
item["ready_at"] = (datetime.now(timezone.utc) + UNSENT_ATTACHMENT_TTL).isoformat()
|
|
2079
|
+
objects.append(item)
|
|
2080
|
+
return objects
|
|
2081
|
+
|
|
2082
|
+
|
|
2062
2083
|
def destruction_counts(connection, room_id):
|
|
2063
|
-
"""
|
|
2084
|
+
"""Snapshot receipt counts, local attachment IDs and the durable cloud cleanup queue."""
|
|
2064
2085
|
count = lambda query: connection.execute(query, (room_id,)).fetchone()[0]
|
|
2065
|
-
files = connection.execute("SELECT id,size
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
"
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2086
|
+
files = connection.execute("""SELECT id,size FROM attachments
|
|
2087
|
+
WHERE room_id=? AND storage IS NOT 'object'""", (room_id,)).fetchall()
|
|
2088
|
+
objects = destruction_cloud_objects(connection, room_id)
|
|
2089
|
+
items = [{"kind": "messages", "state": "pending", "count": count("SELECT COUNT(*) FROM messages WHERE room_id=?")},
|
|
2090
|
+
{"kind": "private_chats", "state": "pending", "count": count("SELECT COUNT(*) FROM private_chats WHERE room_id=?")},
|
|
2091
|
+
{"kind": "attachments", "state": "pending", "count": len(files), "bytes": sum(row["size"] for row in files),
|
|
2092
|
+
"ids": [row["id"] for row in files]},
|
|
2093
|
+
{"kind": "database", "state": "pending"},
|
|
2094
|
+
{"kind": "project_files", "state": "kept"},
|
|
2095
|
+
{"kind": "providers", "state": "elsewhere"}]
|
|
2096
|
+
if objects:
|
|
2097
|
+
items.append({"kind": "cloud_temporary", "state": "pending", "count": len(objects),
|
|
2098
|
+
"deleted_count": 0, "pending_count": len(objects), "objects": objects})
|
|
2099
|
+
return items
|
|
2076
2100
|
|
|
2077
2101
|
|
|
2078
2102
|
def destruction_view(connection, room_id):
|
|
@@ -2186,7 +2210,6 @@ def finish_destruction_files(database, room_id):
|
|
|
2186
2210
|
return
|
|
2187
2211
|
items = {item["kind"]: item for item in json.loads(row["items"])}
|
|
2188
2212
|
files = items["attachments"]
|
|
2189
|
-
failures = files.get("object_delete_failures", 0) + delete_remote_attachments(database, files.get("objects", []))
|
|
2190
2213
|
left = []
|
|
2191
2214
|
for file_id in files.get("ids", []):
|
|
2192
2215
|
path = attachment_path(database, {"id": file_id})
|
|
@@ -2206,12 +2229,52 @@ def finish_destruction_files(database, room_id):
|
|
|
2206
2229
|
with connection:
|
|
2207
2230
|
begin_write(connection)
|
|
2208
2231
|
updates = [{**items["messages"], "state": "deleted"}, {**items["private_chats"], "state": "deleted"},
|
|
2209
|
-
{**files, "ids": left, "
|
|
2232
|
+
{**files, "ids": left, "state": "failed" if left or files.get("objects") else "deleted"},
|
|
2210
2233
|
{"kind": "database", "state": "failed" if busy else "deleted"}]
|
|
2211
2234
|
update_destruction(connection, room_id, updates)
|
|
2212
2235
|
sweep_attachments(database, expire_objects=False)
|
|
2213
2236
|
|
|
2214
2237
|
|
|
2238
|
+
def cloud_destruction_item(connection, room_id):
|
|
2239
|
+
"""Read the current cloud queue, including pending keys written by older versions."""
|
|
2240
|
+
row = connection.execute("SELECT items FROM room_destructions WHERE room_id=? AND status='cleaning'", (room_id,)).fetchone()
|
|
2241
|
+
if row:
|
|
2242
|
+
items = {item["kind"]: item for item in json.loads(row["items"])}
|
|
2243
|
+
return items.get("cloud_temporary") or items.get("attachments", {})
|
|
2244
|
+
return {}
|
|
2245
|
+
|
|
2246
|
+
|
|
2247
|
+
def finish_destruction_cloud(database, room_id):
|
|
2248
|
+
"""Retry due keys without holding a write lock, then remove only keys confirmed gone."""
|
|
2249
|
+
with closing(connect_db(database)) as connection:
|
|
2250
|
+
item = cloud_destruction_item(connection, room_id)
|
|
2251
|
+
now = datetime.now(timezone.utc).isoformat()
|
|
2252
|
+
due = [row for row in item.get("objects", []) if not row.get("initial_delete_done") or row.get("ready_at", "") <= now]
|
|
2253
|
+
if not due:
|
|
2254
|
+
return False
|
|
2255
|
+
client = configured_storage(database)
|
|
2256
|
+
removed = {row["id"] for row in due if delete_remote_attachment(database, row, client)}
|
|
2257
|
+
confirmed = {row["id"] for row in due if row["id"] in removed and row.get("ready_at", "") <= now}
|
|
2258
|
+
with connection:
|
|
2259
|
+
begin_write(connection)
|
|
2260
|
+
current = cloud_destruction_item(connection, room_id)
|
|
2261
|
+
if not current:
|
|
2262
|
+
return False
|
|
2263
|
+
pending = [{**row, "initial_delete_done": True} if row["id"] in removed else row
|
|
2264
|
+
for row in current.get("objects", []) if row["id"] not in confirmed]
|
|
2265
|
+
failed = any(row["id"] not in removed for row in due)
|
|
2266
|
+
update = {**current, "objects": pending}
|
|
2267
|
+
if current["kind"] == "cloud_temporary":
|
|
2268
|
+
update.update(deleted_count=current["count"] - len(pending), pending_count=len(pending),
|
|
2269
|
+
state="failed" if failed and pending else "pending" if pending else "deleted")
|
|
2270
|
+
else:
|
|
2271
|
+
update["state"] = "failed" if pending or current.get("ids") else "deleted"
|
|
2272
|
+
if update == current:
|
|
2273
|
+
return False
|
|
2274
|
+
update_destruction(connection, room_id, [update])
|
|
2275
|
+
return True
|
|
2276
|
+
|
|
2277
|
+
|
|
2215
2278
|
def destroy_from(connection, room, directory):
|
|
2216
2279
|
"""Return the starting time of a room's auto-destroy countdown."""
|
|
2217
2280
|
return idle_from(connection, room, directory["destroy_set_at"])
|
|
@@ -2314,6 +2377,7 @@ def watch_expired_rooms(server):
|
|
|
2314
2377
|
"""Check for rooms to destroy or archive automatically for as long as the website runs."""
|
|
2315
2378
|
next_sweep = 0
|
|
2316
2379
|
while True:
|
|
2380
|
+
server.destruction_wake.clear()
|
|
2317
2381
|
if time.monotonic() >= next_sweep:
|
|
2318
2382
|
for room_id in sweep_attachments(server.database):
|
|
2319
2383
|
server.hub.notify_update(room_id)
|
|
@@ -2326,15 +2390,28 @@ def watch_expired_rooms(server):
|
|
|
2326
2390
|
archive_expired_rooms(server)
|
|
2327
2391
|
except Exception:
|
|
2328
2392
|
logging.exception("Checking rooms to archive automatically failed")
|
|
2329
|
-
|
|
2393
|
+
try:
|
|
2394
|
+
retry_destruction(server.database, server.hub.notify_update)
|
|
2395
|
+
except Exception:
|
|
2396
|
+
logging.exception("Retrying room destructions failed")
|
|
2397
|
+
server.destruction_wake.wait(AUTO_DESTROY_CHECK_SECONDS)
|
|
2330
2398
|
|
|
2331
2399
|
|
|
2332
|
-
def retry_destruction(database):
|
|
2333
|
-
"""Retry
|
|
2400
|
+
def retry_destruction(database, notify=None):
|
|
2401
|
+
"""Retry local files and cloud objects for every unfinished receipt."""
|
|
2334
2402
|
with closing(connect_db(database)) as connection:
|
|
2335
|
-
rows = connection.execute("SELECT room_id
|
|
2403
|
+
rows = connection.execute("""SELECT d.room_id, EXISTS (
|
|
2404
|
+
SELECT 1 FROM json_each(d.items) AS item WHERE json_extract(item.value,'$.kind') IN
|
|
2405
|
+
('messages','private_chats','attachments','database')
|
|
2406
|
+
AND json_extract(item.value,'$.state') IN ('pending','failed')
|
|
2407
|
+
) AS local_pending FROM room_destructions AS d WHERE d.status='cleaning'""").fetchall()
|
|
2336
2408
|
for row in rows:
|
|
2337
|
-
|
|
2409
|
+
room_id = row["room_id"]
|
|
2410
|
+
if row["local_pending"]:
|
|
2411
|
+
finish_destruction_files(database, room_id)
|
|
2412
|
+
cloud_updated = finish_destruction_cloud(database, room_id)
|
|
2413
|
+
if notify and (row["local_pending"] or cloud_updated):
|
|
2414
|
+
notify(None)
|
|
2338
2415
|
|
|
2339
2416
|
|
|
2340
2417
|
def redact_payload(value, texts=None, path="payload"):
|
|
@@ -3152,7 +3229,9 @@ def object_storage_used_bytes(connection):
|
|
|
3152
3229
|
"""Count all live objects and upload reservations in this account's database."""
|
|
3153
3230
|
return connection.execute(f"""SELECT
|
|
3154
3231
|
(SELECT COALESCE(SUM(size),0) FROM attachments WHERE {LIVE_CLOUD_ATTACHMENTS}) +
|
|
3155
|
-
(SELECT COALESCE(SUM(size),0) FROM cloud_files WHERE cleared_at IS NULL)
|
|
3232
|
+
(SELECT COALESCE(SUM(size),0) FROM cloud_files WHERE cleared_at IS NULL) +
|
|
3233
|
+
(SELECT COALESCE(SUM(json_extract(object.value,'$.size')),0) FROM room_destructions AS d,
|
|
3234
|
+
json_each(d.items) AS item, json_each(item.value,'$.objects') AS object WHERE d.status='cleaning')""").fetchone()[0]
|
|
3156
3235
|
|
|
3157
3236
|
|
|
3158
3237
|
def require_cloud_quota(connection, database, size):
|
|
@@ -3236,6 +3315,7 @@ def cloud_file_view(connection, row):
|
|
|
3236
3315
|
if result.get("thumbnail_type") and not result.get("trashed_at"):
|
|
3237
3316
|
result["thumbnail_url"] = f"{cloud_drive.PREFIX}/{result['id']}/thumbnail"
|
|
3238
3317
|
identifier, room_id = result["id"], result["room_id"]
|
|
3318
|
+
result["room_destroyed"] = room_id is None and result["purpose"] == "keep" and result["source_kind"] != "upload"
|
|
3239
3319
|
base = (f"/api/rooms/{room_id}/cloud-files/{identifier}" if room_id is not None
|
|
3240
3320
|
else f"/api/rooms/cloud-attachments/{identifier}")
|
|
3241
3321
|
result.update(url=base + "/content", download_url=base + "/content?download=1")
|
|
@@ -3406,43 +3486,6 @@ def get_object_attachment(connection, room_id, identifier):
|
|
|
3406
3486
|
return row
|
|
3407
3487
|
|
|
3408
3488
|
|
|
3409
|
-
def cloud_land_target(payload):
|
|
3410
|
-
"""Validate a cross-room request's immutable permit binding."""
|
|
3411
|
-
room, source, attachment, cloud_file = (payload.get(key) for key in ("room", "attachment_room", "attachment_id", "cloud_file_id"))
|
|
3412
|
-
if not isinstance(room, str) or not re.fullmatch(r"[A-Za-z0-9_-]{1,64}", room):
|
|
3413
|
-
raise ValueError(Text("房间编号无效"))
|
|
3414
|
-
if cloud_file is not None:
|
|
3415
|
-
if source is not None or attachment is not None:
|
|
3416
|
-
raise ValueError(Text("附件编号无效"))
|
|
3417
|
-
identifier = cloud_file
|
|
3418
|
-
else:
|
|
3419
|
-
if not isinstance(source, str) or not re.fullmatch(r"[A-Za-z0-9_-]{1,64}", source) or room == source:
|
|
3420
|
-
raise ValueError(Text("房间编号无效"))
|
|
3421
|
-
identifier = attachment
|
|
3422
|
-
if not isinstance(identifier, str) or not re.fullmatch(r"[0-9a-f]{32}", identifier):
|
|
3423
|
-
raise ValueError(Text("附件编号无效"))
|
|
3424
|
-
return room, source, identifier
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
def cloud_land_source(connection, target):
|
|
3428
|
-
"""Locate an available cloud file or a sent cloud attachment in this account."""
|
|
3429
|
-
_, source, identifier = target
|
|
3430
|
-
row = (get_cloud_file(connection, identifier) if source is None
|
|
3431
|
-
else get_object_attachment(connection, source, identifier))
|
|
3432
|
-
if (source is not None and not row["message_id"]) or not row["stored_at"] or not row["object_name"]:
|
|
3433
|
-
raise LookupError(Text("附件不存在"))
|
|
3434
|
-
if source is None:
|
|
3435
|
-
cloud_drive.require_available(row)
|
|
3436
|
-
if row["purpose"] != "keep":
|
|
3437
|
-
raise LookupError(Text("附件不存在"))
|
|
3438
|
-
else:
|
|
3439
|
-
database = connection.execute("PRAGMA database_list").fetchone()["file"]
|
|
3440
|
-
require_object_attachment_fresh(database, row)
|
|
3441
|
-
if row["cleared_at"]:
|
|
3442
|
-
raise LookupError(Text("附件不存在"))
|
|
3443
|
-
return row
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
3489
|
def object_download_result(connection, database, attachment, download=False):
|
|
3447
3490
|
"""Sign a stored object only after its attachment has passed room read permissions."""
|
|
3448
3491
|
row = get_object_attachment(connection, attachment["room_id"], attachment["id"])
|
|
@@ -5421,35 +5464,6 @@ class CloudCopyJobs:
|
|
|
5421
5464
|
self.failed.popitem(last=False)
|
|
5422
5465
|
|
|
5423
5466
|
|
|
5424
|
-
class CloudLandGrants:
|
|
5425
|
-
"""Account-local, short-lived, single-use permits to land an exact source attachment."""
|
|
5426
|
-
|
|
5427
|
-
def __init__(self):
|
|
5428
|
-
self.lock = threading.Lock()
|
|
5429
|
-
self.pending = {}
|
|
5430
|
-
|
|
5431
|
-
def issue(self, target):
|
|
5432
|
-
"""Bind a random permit to the destination room, source room and attachment."""
|
|
5433
|
-
secret = secrets.token_hex(32)
|
|
5434
|
-
now = time.monotonic()
|
|
5435
|
-
with self.lock:
|
|
5436
|
-
self.pending = {key: value for key, value in self.pending.items() if value[0] > now}
|
|
5437
|
-
self.pending[token_hash(secret)] = (now + CLOUD_LAND_GRANT_SECONDS, target)
|
|
5438
|
-
return secret
|
|
5439
|
-
|
|
5440
|
-
def consume(self, secret, target):
|
|
5441
|
-
"""Claim a matching permit before contacting storage; a second claim always fails."""
|
|
5442
|
-
if not isinstance(secret, str) or not re.fullmatch(r"[0-9a-f]{64}", secret):
|
|
5443
|
-
return False
|
|
5444
|
-
key = token_hash(secret)
|
|
5445
|
-
with self.lock:
|
|
5446
|
-
entry = self.pending.get(key)
|
|
5447
|
-
if entry is None or entry[0] <= time.monotonic() or entry[1] != target:
|
|
5448
|
-
return False
|
|
5449
|
-
del self.pending[key]
|
|
5450
|
-
return True
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
5467
|
class DiscussionServer(ThreadingHTTPServer):
|
|
5454
5468
|
"""HTTP server carrying the configured SQLite path."""
|
|
5455
5469
|
|
|
@@ -5470,7 +5484,7 @@ class DiscussionServer(ThreadingHTTPServer):
|
|
|
5470
5484
|
# The server whose update stream this one shares; a site's local and remote entries see the same changes.
|
|
5471
5485
|
self.hub = hub or self
|
|
5472
5486
|
self.cloud_copies = hub.cloud_copies if hub else CloudCopyJobs(self.database)
|
|
5473
|
-
self.
|
|
5487
|
+
self.destruction_wake = hub.destruction_wake if hub else threading.Event()
|
|
5474
5488
|
self.updates = threading.Condition()
|
|
5475
5489
|
self.update_version = 0
|
|
5476
5490
|
# Recent (version, room id or None) pairs, so a stream names the rooms that changed; None means the whole site.
|
|
@@ -6315,10 +6329,10 @@ class DiscussionHandler(BaseHTTPRequestHandler):
|
|
|
6315
6329
|
room = payload.get("room")
|
|
6316
6330
|
if not isinstance(room, str) or not re.fullmatch(r"[A-Za-z0-9_-]{1,64}", room):
|
|
6317
6331
|
raise ValueError(Text('房间编号无效'))
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6332
|
+
if command == "project-cloud-land":
|
|
6333
|
+
task_id = payload.get("task_id")
|
|
6334
|
+
if not isinstance(task_id, str) or not re.fullmatch(r"[a-f0-9]{32}", task_id):
|
|
6335
|
+
raise ValueError(Text("上传任务编号无效"))
|
|
6322
6336
|
token = self.headers.get("X-Discussion-Token") or payload.get("token")
|
|
6323
6337
|
if not token and not self.bridge_origin:
|
|
6324
6338
|
with closing(connect_db(self.server.database)) as connection:
|
|
@@ -6327,42 +6341,11 @@ class DiscussionHandler(BaseHTTPRequestHandler):
|
|
|
6327
6341
|
fields = {
|
|
6328
6342
|
"project-cloud": ("room", "path", "root", "kind", "purpose"),
|
|
6329
6343
|
"project-cloud-upload": ("room", "root", "path", "name", "size", "content_type", "submission_id"),
|
|
6330
|
-
"project-cloud-land": ("room", "task_id", "
|
|
6344
|
+
"project-cloud-land": ("room", "task_id", "conflict"),
|
|
6331
6345
|
}[command]
|
|
6332
6346
|
request = {key: payload[key] for key in fields if key in payload}
|
|
6333
|
-
if grant is not None:
|
|
6334
|
-
request["attachment_grant"] = grant
|
|
6335
6347
|
return self.run_local_command(command, {**request, "site": site, "token": token}, remote=bool(self.bridged or self.bridge_origin))
|
|
6336
6348
|
|
|
6337
|
-
def authorize_cross_room_landing(self, payload):
|
|
6338
|
-
"""Use account authority to issue a permit; the supplied room token is for the target only."""
|
|
6339
|
-
target = cloud_land_target(payload)
|
|
6340
|
-
if payload.get("task_id") is not None:
|
|
6341
|
-
raise ValueError(Text("附件编号无效"))
|
|
6342
|
-
with closing(connect_db(self.server.database)) as connection:
|
|
6343
|
-
self.require_cloud_account(connection)
|
|
6344
|
-
if not connection.execute("SELECT 1 FROM rooms WHERE id=?", (target[0],)).fetchone():
|
|
6345
|
-
raise LookupError(Text('房间不存在'))
|
|
6346
|
-
cloud_land_source(connection, target)
|
|
6347
|
-
return self.server.cloud_land_grants.issue(target)
|
|
6348
|
-
|
|
6349
|
-
def claim_local_cloud_landing(self, connection, room_id, method):
|
|
6350
|
-
"""Redeem a permit from this computer and return only its authorized attachment and short link."""
|
|
6351
|
-
if method != "POST" or self.headers.get_content_type() != "application/json":
|
|
6352
|
-
raise LookupError(Text('地址不存在'))
|
|
6353
|
-
if (not self.server.local_launch or self.client_address[0] != "127.0.0.1" or not self.local_visitor()
|
|
6354
|
-
or self.bridged or self.read_only_request() or self.headers.get(ACTING_MEMBER_HEADER)
|
|
6355
|
-
or self.headers.get("X-Discussion-Token") is not None):
|
|
6356
|
-
raise PermissionError(Text('需要管理员登录'))
|
|
6357
|
-
payload = self.read_payload()
|
|
6358
|
-
target = cloud_land_target({**payload, "room": room_id})
|
|
6359
|
-
if not self.server.cloud_land_grants.consume(payload.get("grant"), target):
|
|
6360
|
-
raise PermissionError(Text('需要管理员登录'))
|
|
6361
|
-
row = cloud_land_source(connection, target)
|
|
6362
|
-
view = ({"cloud_file": cloud_file_view(connection, row)} if target[1] is None
|
|
6363
|
-
else {"attachment": attachment_view(connection, row)})
|
|
6364
|
-
return self.respond({**view, "link": stored_object_download(self.server.database, row)})
|
|
6365
|
-
|
|
6366
6349
|
def local_command_result(self, command, payload, configuration_locked=False, remote=False):
|
|
6367
6350
|
"""Run the fixed local Node entrypoint; returns `(status, result)`, 400 with its error when it fails."""
|
|
6368
6351
|
arguments = ["node", str(ROOT / "runner" / "discussion_launch.mjs"), command]
|
|
@@ -6728,9 +6711,6 @@ class DiscussionHandler(BaseHTTPRequestHandler):
|
|
|
6728
6711
|
result = self.steward_member_write(connection, parts)
|
|
6729
6712
|
if result is not None:
|
|
6730
6713
|
return self.respond(result)
|
|
6731
|
-
if len(parts) == 5 and parts[:2] == ["api", "rooms"] and parts[3:] == ["cloud-land", "redeem"]:
|
|
6732
|
-
# Interpret the permit before implicit local ownership can add a room credential.
|
|
6733
|
-
return self.claim_local_cloud_landing(connection, parts[2], method)
|
|
6734
6714
|
if parts == ["api", "attachment-limit"] and method == "GET":
|
|
6735
6715
|
limit = attachment_limit_mib(self.server.database)
|
|
6736
6716
|
return self.respond({"limit_mib": limit, **object_storage_limits(connection, self.server.database, limit)})
|
|
@@ -6869,6 +6849,7 @@ class DiscussionHandler(BaseHTTPRequestHandler):
|
|
|
6869
6849
|
if not (self.bridged or self.admin_session(connection)):
|
|
6870
6850
|
raise PermissionError(Text('需要管理员身份'))
|
|
6871
6851
|
finish_destruction_files(self.server.database, room_id)
|
|
6852
|
+
self.server.destruction_wake.set()
|
|
6872
6853
|
return self.respond(destruction_view(connection, room_id) or {})
|
|
6873
6854
|
result = report_destruction(connection, room_id, self.headers.get("X-Discussion-Token", ""), payload)
|
|
6874
6855
|
connection.commit()
|
|
@@ -7146,6 +7127,7 @@ class DiscussionHandler(BaseHTTPRequestHandler):
|
|
|
7146
7127
|
connection.commit()
|
|
7147
7128
|
if parts[3] == "delete":
|
|
7148
7129
|
finish_destruction_files(self.server.database, room_id)
|
|
7130
|
+
self.server.destruction_wake.set()
|
|
7149
7131
|
result["destruction"] = destruction_view(connection, room_id)
|
|
7150
7132
|
return self.respond(result)
|
|
7151
7133
|
if len(parts) == 3 and method == "GET":
|
|
@@ -7219,7 +7201,7 @@ class DiscussionHandler(BaseHTTPRequestHandler):
|
|
|
7219
7201
|
raise LookupError(Text('地址不存在'))
|
|
7220
7202
|
|
|
7221
7203
|
def require_cloud_account(self, connection):
|
|
7222
|
-
"""
|
|
7204
|
+
"""Require an account administrator for account-wide cloud files."""
|
|
7223
7205
|
if (self.bridge_origin or self.read_only_request() or self.headers.get("X-Discussion-Token") is not None
|
|
7224
7206
|
or self.headers.get(ACTING_MEMBER_HEADER) or not self.admin_session(connection)):
|
|
7225
7207
|
raise PermissionError(Text('需要管理员登录'))
|
|
@@ -7934,7 +7916,6 @@ def main():
|
|
|
7934
7916
|
backfill_thumbnails(args.database, args.backfill_thumbnails)
|
|
7935
7917
|
return
|
|
7936
7918
|
init_database(args.database, seed=not args.no_demo)
|
|
7937
|
-
retry_destruction(args.database)
|
|
7938
7919
|
if args.reset_admin:
|
|
7939
7920
|
with closing(connect_db(args.database)) as connection, connection:
|
|
7940
7921
|
connection.execute("DELETE FROM admin_logins")
|
package/docs/en/guide/admin.md
CHANGED
|
@@ -16,7 +16,7 @@ Use the local management panel or the corresponding codiscuss admin commands to
|
|
|
16
16
|
|
|
17
17
|
On the right of Overview → This computer → Self-hosted relay, pick the region in the Relay region dropdown. The default is Asia Pacific. This setting applies to administrator access, hosted account sign-in through the relay, and external expert invitations. Automatic creates the object near the first party to connect, usually the computer’s network exit. Its location stays fixed after creation. Other values are location hints. After the service syncs the change, the computer and paired devices reconnect automatically. Run `codiscuss admin site region` to inspect the setting or `codiscuss admin site region weur` to select Western Europe.
|
|
18
18
|
- **Hosted account entry** (shown when hosting is enabled): Start or stop the **Sign-in entry**, enable **Self-hosted relay**, or configure the **Cloudflare Tunnel**.
|
|
19
|
-
- **Settings:** View the installed version, select **Check for updates** or **Update and restart** (which also updates room skills and isolated accounts), enable **Start when signing in to Windows
|
|
19
|
+
- **Settings:** View the installed version, select **Check for updates** or **Update and restart** (which also updates room skills and isolated accounts), enable **Start when signing in to Windows** and **Hosting** (see step 1 of “Set it up” below), and change the panel language.
|
|
20
20
|
- **Storage:**
|
|
21
21
|
- View local `.codiscuss` data usage against the 10 GiB limit (excluding speech models), total drafts against 3 GiB (1 GiB per room), **Room records & attachments (`local/`)**, disk free space and safety reserve, per-room and per-member breakdowns, and any unreadable entries. Local TTS and STT models are listed separately and excluded from the 10 GiB cap (covering both legacy and custom model paths, including when the service home itself is a symlink or junction).
|
|
22
22
|
- When `.codiscuss` data reaches the 8 GiB warning threshold, the **Storage** tab shows a warning dot and displays a notice; exceeding a limit or dropping below the disk safety reserve pauses new runs. The total is split into five named directories and Other. **Safe cleanup** removes registered failed scratch, speech cache entries, empty orphan directories, stale launches containing only setup records, and local execution files more than 24 hours after completion. After clearing the speech cache, replaying old content with cloud speech synthesizes it again and incurs a new charge. **Deep repair** estimates space before you select and confirm deletion of finished logs, including the last day.
|
|
@@ -94,13 +94,19 @@ On Windows, open the panel from the tray. On macOS and Linux, use the command-li
|
|
|
94
94
|
|
|
95
95
|
### Set it up
|
|
96
96
|
|
|
97
|
-
1. **
|
|
97
|
+
1. **Install the components and turn on hosting:**
|
|
98
|
+
- First run `codiscuss setup --hosting`, or select **Install hosting components** under **Installation settings** in `codiscuss setup`. This only installs the components; it does not turn hosting on.
|
|
99
|
+
- Then turn on the **Hosting** switch under **Overview → Settings** in the admin panel, or run `codiscuss admin hosting on`. A confirmation appears first: the local site restarts, active runs are interrupted and resume automatically after the restart.
|
|
100
|
+
- Once on, the **Account** page lists hosted accounts and **New account**, and Overview shows **Hosted account entry** and **Program copies**.
|
|
101
|
+
- Turn it off in the same place, or run `codiscuss admin hosting off`. It cannot be turned off while hosted accounts exist: the switch is disabled with a note to delete the hosted accounts first, and the command is refused. Hosting is only available on Windows; on other systems the switch is disabled.
|
|
102
|
+
- Computers that already turned hosting on through `setup` stay on; nothing needs to be redone.
|
|
98
103
|
2. **Create an account and isolate it:** In the panel, go to **Accounts** → **New account** and enter an account name. On Windows, **Isolation** is selected by default. This creates a separate Windows user and prompts for administrator approval. The setup installs a program copy, room skills, system prompt, and bundled workflows, then starts the account’s site. The password is shown once, so save it before closing.
|
|
99
104
|
- **Why isolate:** Without isolation, the hosted account runs as your Windows user. Its AI can read your personal files, and the account shares your sign-ins and skills. Isolation gives it a separate Windows user, sign-ins, and folders.
|
|
105
|
+
- If the automatic attachment download before wake-up cannot start Python, install or sync Python under **Overview → Program copies** in the admin panel. Automatic downloads and `codiscuss attachment download` use the same Python configured for the isolated account.
|
|
100
106
|
- **Entry protection:** This is enabled by default on the hosted account details page and is available on Windows only. It restricts site access to users authenticated by the sign-in entry and that account’s own AI, blocking direct access by other local programs.
|
|
101
107
|
3. **Configure remote access** using either or both options:
|
|
102
108
|
- **Self-hosted relay, without your own domain:** Follow the [deployment guide](../deployment.md#entry-for-hosted-accounts-optional) to deploy the entry Worker. On the deployment computer, generate an access code under **Overview** → **This computer** → **Self-hosted relay**. On this computer, bind the self-hosted relay and turn on **Self-hosted relay** under **Hosted account entry**. You can also run codiscuss admin entry join <access-code>.
|
|
103
|
-
- **Cloudflare Tunnel:** Under **Hosted account entry** → **Cloudflare Tunnel**, authorize a Cloudflare tunnel and connect a domain hosted on Cloudflare. The CLI equivalent is `codiscuss admin entry tunnel <domain>`. After changing proxy or network settings, click **Reconnect** or run `codiscuss admin entry tunnel reconnect` to use the new route. Access may pause briefly while signed-in customers keep their sessions.
|
|
109
|
+
- **Cloudflare Tunnel:** Under **Hosted account entry** → **Cloudflare Tunnel**, authorize a Cloudflare tunnel and connect a domain hosted on Cloudflare. The CLI equivalent is `codiscuss admin entry tunnel <domain>`. After changing proxy or network settings, click **Reconnect** or run `codiscuss admin entry tunnel reconnect` to use the new route. If the tunnel stays disconnected from Cloudflare for 3 minutes, the admin panel restarts it automatically. Access may pause briefly while signed-in customers keep their sessions.
|
|
104
110
|
4. **Manage the account:** Start or stop its instance, enable, disable or remove the account, reset its password, and provide API keys. Users see **Provided by admin** for administrator-provided keys and cannot view or change them. To invite external experts, the account needs an online relay. The panel checks instances requested to run every minute and restarts them if their port refuses connections, up to 3 times in 10 minutes. After repeated failures, the account row shows the last error. Check `codiscuss admin status` for the latest attempt and start the instance manually after fixing the cause to resume recovery.
|
|
105
111
|
|
|
106
112
|
### Move an existing account’s project data to another drive
|
|
@@ -113,7 +119,7 @@ Backups still use space on the original volume, outside the directories counted
|
|
|
113
119
|
|
|
114
120
|
### macOS and Linux
|
|
115
121
|
|
|
116
|
-
|
|
122
|
+
The hosting service can currently be turned on only on Windows. On macOS and Linux, the panel's "Hosting" switch is grayed out and `codiscuss admin hosting on` is refused. For the panel's other features, start the background panel with `codiscuss panel start`, then manage it with `codiscuss admin` commands.
|
|
117
123
|
|
|
118
124
|
## Manage over SSH with codiscuss admin
|
|
119
125
|
|
|
@@ -125,7 +131,7 @@ Every command in the table is prefixed by codiscuss admin and returns JSON. Thes
|
|
|
125
131
|
| --- | --- |
|
|
126
132
|
| View subscription utilization (8 weeks by default) | `codiscuss admin quota-usage [--weeks N]` |
|
|
127
133
|
| Start, exit, restart, or update (panel need not be running) | `codiscuss admin start`, `stop`, `restart`, `update [check]` |
|
|
128
|
-
| Check status, control service, configure sign-in startup | `status [--full]`, `service start\|stop\|restart`, `autostart on\|off` |
|
|
134
|
+
| Check status, control service, configure sign-in startup and hosting | `status [--full]`, `service start\|stop\|restart`, `autostart on\|off`, `hosting on\|off` |
|
|
129
135
|
| Inspect storage usage and clear temporary run files | `storage`, `storage clean`, `storage repair` (preview), `storage repair logs --confirm` |
|
|
130
136
|
| Ask the platform steward to analyze storage | `codiscuss admin storage analyze` |
|
|
131
137
|
| View and clear attachments by room | `codiscuss admin storage attachments` (usage per room), `storage attachments ROOM` (list files), `storage attachments ROOM clear ID... --confirm` |
|
|
@@ -10,7 +10,7 @@ See how your work is going across all rooms: how many tasks needed no further in
|
|
|
10
10
|
|
|
11
11
|
## What the page shows
|
|
12
12
|
|
|
13
|
-
This page is for you alone and is meant to surface what needs attention; use the share image to show your work to others. At the top, switch between "Today", "Last 7 days", "Last 30 days" and "All time" (split by your device's time zone, always including today; the first three are compared with the same length of time just before). The refresh icon reloads the data. When the page opens, the sections slide in one after another and the numbers count up from 0. If your system asks for reduced motion, or effects are turned off in CoDiscuss, the results appear at once.
|
|
13
|
+
This page is for you alone and is meant to surface what needs attention; use the share image to show your work to others. At the top, switch between "Today", "Last 7 days", "Last 30 days" and "All time" (split by your device's time zone, always including today; the first three are compared with the same length of time just before). The refresh icon reloads the data. When you open the page again, this device first shows its last results, with the time they were computed under the title; a spinner beside it means newer figures are being computed, and they replace the old ones when ready. When the page opens, the sections slide in one after another and the numbers count up from 0. If your system asks for reduced motion, or effects are turned off in CoDiscuss, the results appear at once.
|
|
14
14
|
|
|
15
15
|
"Live", on the far left, shows the present rather than a period: one sentence says how many experts are working in how many rooms and how many things are waiting for you; four figures show running (with rooms and queued work), waiting for you, completed in the last hour and errors in the last hour; below is a timeline of the last 60 minutes, one bar per minute. "Waiting for you" lists what stays stuck until you act: a Goal waiting for your confirmation, a member's question for you, a task chain at its round limit or a host asking for more rounds (within a day, and only until you write in that room again). Failed runs and permission blocks have already ended and do not hold up work, so they are not listed here; see "Needs a look" for a period. Repeats by the same member in one room are one item with a count. "Active rooms" lists the rooms with activity in the last hour, rooms with running members first, each with how many members run now, this hour's runs and errors, message count and last activity; click one to open the room. "In progress" and "Runs that errored in the last hour" (errors only, hidden when there are none) show one member per row with its model, folder and room, the start of the message it worked on, and how long it has run or when it ended and how long it took. Click any row to jump to its message in the room. "Live" refreshes every 10 seconds and pauses while the tab is in the background; it has no comparison with a previous period, no share image and none of the details below.
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ When a member explicitly pauses for your reply, the room name in the sidebar bri
|
|
|
18
18
|
|
|
19
19
|
Replying to the host in a private chat or through an interjection does not end the wait immediately. It ends when the host next posts in the room.
|
|
20
20
|
|
|
21
|
-
1. **Overview**: a short line under the title sums up the period. Four figures follow: total AI work time, tasks moved forward, the most experts running at once (with rooms), and the share that needed no follow-up (with how often you stepped in), each with its change from the previous period ("Today" is not compared). Below is a timeline: blue is how many experts were running, and red marks under the same time axis are runs that errored (failed, or were cancelled by the system part-way; stops by you or the host do not count)
|
|
21
|
+
1. **Overview**: a short line under the title sums up the period. Four figures follow: total AI work time, tasks moved forward, the most experts running at once (with rooms), and the share that needed no follow-up (with how often you stepped in), each with its change from the previous period ("Today" is not compared). Below is a timeline: blue is how many experts were running, the dashed orange line is how many rooms were running, and red marks under the same time axis are runs that errored (failed, or were cancelled by the system part-way; stops by you or the host do not count). Hover to read a time step, and a small panel lists the rooms and members running then (up to 8); the panel does not block the pointer, so you can keep moving across the chart. To open a room, click the time step to pin the panel, then click the room name; click outside the chart or press Esc to release it. The "Live" timeline works the same way. Where failures bunched up is visible at a glance.
|
|
22
22
|
2. **Needs a look**: issues picked from this period's runs by fixed rules; the first 3 show by default. Runs that errored are grouped by reason, so one cause such as an expired lease is one item even when it hit several models. With two or more reasons they share one row, "N runs errored", with each reason's count underneath; open it to see, per reason, the groups it touched, when it happened, its share of the related runs and the latest 5 runs. Stops by you, permission blocks, runs marked failed that later answered, runs with no recorded model and negative smart-scheduling feedback are listed per member or room. An item is listed at 5% or more of the related runs or when it doubled from last period; it is red at 10% or more or when it doubled, grey otherwise. Items state what happened and do not judge which model is better.
|
|
23
23
|
- Expand an item to see its latest 30 runs with time, room, member and result. Click a run to open its room at the message that asked for it.
|
|
24
24
|
- "Waits for a reply: N" counts recorded waits only. Suspected waits are counted separately. Open the item to see five waits by default, with an option to see more, up to 30 in total, with recorded waits listed first. Click a message to open it in the room. Recorded waits show their actual start and end and whether a reminder is on record. Immediate replacements by the same member count as one wait. The message preview uses its summary when available. A reply is shown only when a message from you in the room ended the wait. Other closed waits show "Ended". A wait is marked as suspected when the room stayed idle for more than 30 minutes and at most 24 hours after a host question, and the host assigned work within five minutes of your reply. Suspected waits have no reminder status.
|