ai_co_discuss 0.4.77 → 0.4.79

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.
Files changed (68) hide show
  1. package/.agents/skills/discuss-host/SKILL.md +2 -1
  2. package/.agents/skills/discuss-host/references/workflow.md +1 -1
  3. package/.agents/skills/discuss-participant/SKILL.md +1 -0
  4. package/.agents/skills/local-tts-setup/SKILL.md +3 -2
  5. package/backend/free_room.py +12 -1
  6. package/backend/message_queue.py +15 -5
  7. package/backend/server.py +21 -3
  8. package/docs/THIRD_PARTY_NOTICES.md +381 -1
  9. package/docs/deployment.md +1 -1
  10. package/docs/en/deployment.md +1 -1
  11. package/docs/en/runner.md +3 -1
  12. package/docs/en/workflow.md +1 -1
  13. package/docs/runner.md +4 -2
  14. package/docs/workflow.md +1 -1
  15. package/frontend/locales/en/admin.json +43 -15
  16. package/frontend/locales/en/app.json +8 -3
  17. package/frontend/locales/en/backend_worker.json +10 -5
  18. package/frontend/locales/en/discussion.json +3 -2
  19. package/frontend/locales/en/room.json +23 -0
  20. package/frontend/locales/en/settings.json +4 -1
  21. package/gateway/gateway.mjs +14 -13
  22. package/package.json +3 -2
  23. package/runner/adapters/api.mjs +10 -6
  24. package/runner/adapters/api_pi.mjs +1 -1
  25. package/runner/adapters/api_web.mjs +252 -0
  26. package/runner/adapters/claude.mjs +6 -1
  27. package/runner/adapters/cli.mjs +1 -1
  28. package/runner/adapters/codex_bridge.mjs +4 -3
  29. package/runner/adapters/codex_cli.mjs +65 -4
  30. package/runner/adapters/common.mjs +1 -1
  31. package/runner/adapters/profiles.mjs +16 -3
  32. package/runner/admin_cli.mjs +22 -6
  33. package/runner/admin_panel.mjs +113 -46
  34. package/runner/discuss.py +15 -3
  35. package/runner/discussion_launch.mjs +4 -3
  36. package/runner/execution_progress.mjs +7 -3
  37. package/runner/expert_prompts.mjs +13 -8
  38. package/runner/free_runner.mjs +2 -2
  39. package/runner/hosting_setup.mjs +1 -1
  40. package/runner/hosting_tunnel.mjs +1 -1
  41. package/runner/i18n_en.mjs +11 -6
  42. package/runner/os_users.mjs +39 -10
  43. package/runner/project_files.mjs +43 -6
  44. package/runner/relay_channel.mjs +2 -2
  45. package/runner/tts_providers.mjs +22 -2
  46. package/web/admin.css +1 -1
  47. package/web/admin.js +3 -3
  48. package/web/app.js +403 -77
  49. package/web/backup.js +1 -1
  50. package/web/i18n.js +4 -4
  51. package/web/icons/custom-api.svg +11 -0
  52. package/web/icons/external-expert.svg +12 -0
  53. package/web/index.html +11 -6
  54. package/web/markdown.css +1 -1
  55. package/web/modern.css +1 -1
  56. package/web/modern.js +68 -64
  57. package/web/office/docx.js +3 -3
  58. package/web/video-compress.js +12 -0
  59. package/workflows/story-serial/SKILL.md +26 -7
  60. package/workflows/story-serial/agents/recorder.md +3 -1
  61. package/workflows/story-serial/agents/writer.md +2 -0
  62. package/workflows/story-serial/flow.json +151 -119
  63. package/workflows/story-serial/workflows/aigc-reduce/SKILL.md +1 -1
  64. package/workflows/story-serial/workflows/character-play/SKILL.md +31 -0
  65. package/workflows/story-serial/workflows/character-play/agents/character_a.md +29 -0
  66. package/workflows/story-serial/workflows/character-play/agents/character_b.md +29 -0
  67. package/workflows/story-serial/workflows/character-play/agents/character_c.md +29 -0
  68. package/workflows/story-serial/workflows/character-play/flow.json +164 -0
@@ -24,7 +24,8 @@ description: "AI CoDiscuss 的主持技能,仅主持人调用,且须同时
24
24
  1. **用户是需求方和最终决策者**:先处理尚未处理的用户留言,再安排他人或收束;遵守用户设定的上限,不自行放宽。(主持人负责理解意图,不替用户做决定。)
25
25
  2. **收束前自查**:收束、宣告完成(含 Goal 完成)或关闭定时检查前,对照任务里的 `room_goal` 和用户最近的要求;还有遗留方向就继续安排,或告诉用户还差什么。(一次派活或一个 Goal 做完,不等于房间任务完成。)
26
26
  3. **权限由用户授予**:不邀请成员,不开启讨论或 Goal,不扩大工作目录、软件权限或执行额度,派活不超出用户给的范围。唯一例外是任务有 `host_workflows: true`(房主打开了“主持人完整权限”),边界见 [房间控制与恢复](references/control.md)。(扩权与刹车留在用户手里。)
27
- 4. **不用软件自带的定时、唤醒或后台等待**,也不手动通知已配置的本地成员;要隔一段时间再看进展用 `checkin`。(本轮结束即执行结束,之后回来的结果无法提交;自带唤醒还会和程序投递并发续接同一会话。)
27
+ 4. **有工作流先分流**:任务有 `workflow` 字段时,派活或改文件之前先读 `workflow.skill_path`,把请求对照主线和每个 `workflow.sub_workflows` 的 `description`;命中就读它的 SKILL.md 并照做,不问用户要不要用,回答开头写明走的哪条;写明只在用户要求时用的,用户没要求就不用。(靠临场想起来会漏掉,流程也就形同虚设。)
28
+ 5. **不用软件自带的定时、唤醒或后台等待**,也不手动通知已配置的本地成员;要隔一段时间再看进展用 `checkin`。(本轮结束即执行结束,之后回来的结果无法提交;自带唤醒还会和程序投递并发续接同一会话。)
28
29
 
29
30
  ## 主持判断
30
31
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## 按工作流做事
6
6
 
7
- `workflow` 字段表示本房间启用了用户的工作流。它像技能一样按需使用:请求与 `workflow.description` 相符或用户要求按它做时才用,其他请求照常处理。本会话还没读过、或 `workflow.revision` 变了,才读 `workflow.skill_path`(API 主持人读系统提示中的工作流正文)。工作流只带来做法和成员,不扩大你的权限。
7
+ `workflow` 字段表示本房间启用了用户的工作流。每次处理请求先分流(discuss-host 硬约束 4):请求与 `workflow.description` 或某个子工作流的 `description` 相符,或用户要求按它做时就用,其他请求照常处理。本会话还没读过、或 `workflow.revision` 变了,就先读 `workflow.skill_path`(API 主持人读系统提示中的工作流正文)。工作流只带来做法和成员,不扩大你的权限。
8
8
 
9
9
  - `workflow.members` 列出每张卡片由谁担任、是否在场、项目权限,只点名在场的成员。
10
10
  - `workflow.missing` 是启用后才新增、还没有成员的卡片,要用时运行 `<cli> launch workflow-join --card 卡片ID …`(API 主持人请用户在右栏点工作流的“刷新”)。
@@ -43,6 +43,7 @@ description: "AI CoDiscuss 的通用参与技能,所有参与者(包括主
43
43
 
44
44
  - `execution status`(省略编号即本次执行)回答“我现在该做什么、回答是否已落库”;主持人的累计判断存在 `state view`。
45
45
  - 增量读取用实际已读编号 `message list ROOM --after ID`,`latest_id` 不等于已读;可按 `--author`、`--query`、`--kind` 筛选。
46
+ - 同一站点的其他房间可以只读查看:读取命令写上对方的房间编号即可(如 `room view 房间`、`message list 房间`、`room events 房间`);写入仍限本房间,对方的私聊不可读。
46
47
  - 唤醒你的消息带附件时,任务提示末尾列出本机副本;其他附件用 `attachment download ROOM ID --dest 新文件路径` 取得。下载或看到文件名不等于读过,读不到就如实说明。
47
48
 
48
49
  ## 回答
@@ -38,11 +38,11 @@ description: "为 AI CoDiscuss 安装本机朗读语音:下载 yovoice CLI、
38
38
 
39
39
  1. **下载 CLI**:读 `https://api.github.com/repos/leemysw/yovoice/releases/latest`,取资产 `yovoice-<版本>-cli-<windows-x64 | macos-arm64 | linux-x64>.zip` 与 `SHA256SUMS.txt`,下载到空目录 `SERVICE_HOME/yovoice/download/`,核对 SHA-256 一致后解压到 `SERVICE_HOME/yovoice/cli/`(Windows 用 `tar -xf`),保留 `tools/` 目录。已装过时先结束正在运行的 yovoice 进程再覆盖。用 `yovoice.exe --version` 确认。
40
40
  2. **推理引擎**:`yovoice.exe setup --backend <后端> --data-dir SERVICE_HOME/yovoice/data`。
41
- 3. **模型**:`yovoice.exe models download qwen3-tts-customvoice-q8 --data-dir SERVICE_HOME/yovoice/data`(默认从 ModelScope 下载,失败时可加 `--source huggingface`)。
41
+ 3. **模型**:`yovoice.exe models download qwen3-tts-customvoice-q8 --data-dir SERVICE_HOME/yovoice/data`(默认从 ModelScope 下载,失败时可加 `--source huggingface`)。用户要用 4 个 VoxCPM2 音色(柔和女声、低声线女声、老年男声、中年男声)时,再下载 `voxcpm2-bf16`(约 4.5 GB 磁盘,运行时约 5 GB 显存,需要 8 GB 显存的显卡)。
42
42
  4. **令牌**:生成 64 位十六进制随机串,写入临时文件 `{"base_url": "http://127.0.0.1/yovoice", "api_key": "<令牌>"}`,运行 `codiscuss launch api-key --file <临时文件>`,记下返回的 `api_key_ref`,随即删除临时文件。
43
43
  5. **切换朗读服务**:把 `codiscuss launch tts-settings` 的输出存成临时文件,只改两处:`provider` 设为 `"local"`,`providers.local.api_key_ref` 设为上一步的引用;其余字段不动(读出的 `catalog` 等字段保存时会被忽略),用 `codiscuss launch tts-settings --file <临时文件>` 保存后删除临时文件。用户只要求安装、不想马上切换时,`provider` 保持原值,只写 `api_key_ref`。
44
44
  6. **验证**:先结束正在运行的 yovoice 进程(推理子进程 `audiocpp_server` 会随之退出),否则旧令牌启动的服务会拒绝新令牌。临时文件写入 `{"text": "你好,这是本机朗读测试。"}`,运行 `codiscuss launch tts --file <临时文件>`:返回 `format` 为 `"m4a"`、`audio` 非空即成功,`SERVICE_HOME/yovoice/serve.log` 会出现一行 `"url":"http://127.0.0.1:<端口>"`,端口与 `SERVICE_HOME/yovoice/port` 中的一致,说明服务是由 CoDiscuss 拉起的。1 分钟内再换一段约 100 字的新文本请求一次,测服务已启动时的速度(同一文本会命中本机缓存,测不出速度)。参考:RTX 5060 8 GB + `cuda13`,短句含启动服务与加载模型约 4 秒;服务已启动时,100 字约 6–7 秒合成约 27 秒音频。
45
- 7. **清理与汇报**:删除 `SERVICE_HOME/yovoice/download/` 与所有临时文件。向用户报告后端、模型、实测耗时,并说明:网页“设置 → 语音”选“本机”,可选 9 个音色并分别试听;本机服务不支持调语速,语气提示可用;切回云端服务只需在同一处点选。网页经已在运行的 CoDiscuss 本机服务朗读;刚更新过 CoDiscuss 时,先运行 `codiscuss service restart` 再刷新网页,才会出现“本机”。
45
+ 7. **清理与汇报**:删除 `SERVICE_HOME/yovoice/download/` 与所有临时文件。向用户报告后端、模型、实测耗时,并说明:网页“设置 → 语音”选“本机”,可选 9 个 Qwen3-TTS 音色并分别试听,装了 `voxcpm2-bf16` 时另有 4 个 VoxCPM2 音色;本机服务不支持调语速,语气提示只对 Qwen3-TTS 音色生效;切回云端服务只需在同一处点选。网页经已在运行的 CoDiscuss 本机服务朗读;刚更新过 CoDiscuss 时,先运行 `codiscuss service restart` 再刷新网页,才会出现“本机”。
46
46
 
47
47
  ## 修复、升级与卸载
48
48
 
@@ -57,3 +57,4 @@ description: "为 AI CoDiscuss 安装本机朗读语音:下载 yovoice CLI、
57
57
  | 服务启动超时 | 看 `serve.log`;端口被其他程序占用时请用户释放该端口 |
58
58
  | 合成失败(HTTP 500) | 看 `data/logs/`:CUDA 报错时检查驱动,或换后端重做第 2 步;显存不足时关闭占显存的程序 |
59
59
  | 转码失败 | `cli/tools/` 缺失或损坏:重做第 1 步 |
60
+ | 这个音色的模型尚未安装 | 选了 VoxCPM2 音色但没有模型:下载 `voxcpm2-bf16`(第 3 步) |
@@ -794,6 +794,13 @@ def step_count(connection, execution_id):
794
794
  AND phase IN ('command','tool','editing')""", (execution_id,)).fetchone()[0]
795
795
 
796
796
 
797
+ def tool_counts(connection, execution_id):
798
+ """How many times an execution called each tool, in the order it first used them."""
799
+ rows = connection.execute("""SELECT tool,phase,COUNT(*) AS count FROM execution_segments WHERE source='free' AND execution_id=?
800
+ AND phase IN ('command','tool','editing') GROUP BY tool,phase ORDER BY MIN(seq)""", (execution_id,))
801
+ return [dict(row) for row in rows]
802
+
803
+
797
804
  def execution_notes(connection, room_id, execution_id, token=""):
798
805
  """Read one execution's progress notes in order, with the same access as the room view."""
799
806
  execution = connection.execute("SELECT member_id FROM member_executions WHERE room_id=? AND id=?", (room_id, execution_id)).fetchone()
@@ -968,6 +975,9 @@ def recent_executions(connection, room_id, span=None):
968
975
  EXISTS(SELECT 1 FROM retried_requests WHERE execution_id=e.id) AS retried,
969
976
  (SELECT MIN({LAYOUT_AT_SQL}) FROM member_requests r WHERE r.execution_id=e.id) AS layout_at,
970
977
  (SELECT COUNT(*) FROM execution_notes WHERE execution_id=e.id) AS note_count,
978
+ (SELECT COUNT(*) FROM execution_segments WHERE source='free' AND execution_id=e.id
979
+ AND phase IN ('command','tool','editing')) AS step_count,
980
+ (SELECT COUNT(*) FROM execution_segments WHERE source='free' AND execution_id=e.id AND phase='command') AS command_count,
971
981
  (SELECT denials FROM execution_denials WHERE execution_id=e.id) AS denials,{CAPABILITY_COLUMNS},
972
982
  (SELECT failure_class FROM execution_failures WHERE execution_id=e.id) AS failure_class,
973
983
  (SELECT json_object('created_at',created_at) FROM late_answers WHERE execution_id=e.id) AS late_answer,
@@ -989,7 +999,7 @@ def recent_executions(connection, room_id, span=None):
989
999
  "edited": json.loads(row["edited"]) if row["edited"] else None, "diff_stats": diff_stats(row["diffs"]),
990
1000
  "answer_id": row["answer_id"], "request_message_id": row["request_message_id"],
991
1001
  "layout_after": row["layout_after"], "layout_at": row["layout_at"] or row["created_at"], "requests": requests,
992
- "notes": row["note_count"], "denials": json.loads(row["denials"] or "[]"), "failure_class": row["failure_class"] or "",
1002
+ "notes": row["note_count"], "steps": row["step_count"], "commands": row["command_count"], "denials": json.loads(row["denials"] or "[]"), "failure_class": row["failure_class"] or "",
993
1003
  "capabilities": reported_capabilities(row), "stop_result": row["stop_result"] or "",
994
1004
  "late_answer": json.loads(row["late_answer"]) if row["late_answer"] else None, "background": bool(row["background"]),
995
1005
  "retried": bool(row["retried"]),
@@ -1096,6 +1106,7 @@ def free_view(connection, room_id):
1096
1106
  member["execution"]["stale"] = latest["lease_until"] <= now
1097
1107
  member["execution"]["notes"] = note_count(connection, latest["id"])
1098
1108
  member["execution"]["steps"] = step_count(connection, latest["id"])
1109
+ member["execution"]["tools"] = tool_counts(connection, latest["id"])
1099
1110
  member["execution"]["retry"] = execution_retry(connection, latest["id"])
1100
1111
  member["pending"] = connection.execute("SELECT COUNT(*) FROM member_requests WHERE member_id=? AND status='pending'",
1101
1112
  (row["id"],)).fetchone()[0]
@@ -1,8 +1,9 @@
1
1
  """Owner messages queued while members work, posted one by one once the room is idle.
2
2
 
3
3
  The owner's composer sends with `queue: true`; when the room is busy (or earlier messages still wait) the message is kept
4
- here instead of being posted. A message naming only the host is never queued: it is a side question the host answers
5
- next, beside members still at work, so the owner can always ask how the work stands. Each idle moment posts the head through the normal message path with its own submission_id,
4
+ here instead of being posted. A message naming only a host with no open request is not queued: it is a side question the host
5
+ answers beside members still at work, so the owner can ask how the work stands. A host that is itself busy could not answer any
6
+ sooner, so that message keeps its place in the queue. Each idle moment posts the head through the normal message path with its own submission_id,
6
7
  so a repeated drain finds the posted message and only removes the row. A failed post keeps the row with its reason and holds
7
8
  the queue; the owner's stop pauses it. The owner may send one at once, edit, delete, reorder or resume the queue.
8
9
  """
@@ -49,19 +50,21 @@ def queue_view(connection, room_id):
49
50
  "created_at": row["created_at"]})
50
51
  paused = connection.execute("SELECT 1 FROM queued_message_pauses WHERE room_id=?", (room_id,)).fetchone() is not None
51
52
  return {"items": items, "paused": paused and bool(items), "busy": room_busy(connection, room_id),
52
- "queueing": queueing_enabled(connection)}
53
+ "host_busy": host_busy(connection, room_id), "queueing": queueing_enabled(connection)}
53
54
 
54
55
 
55
56
  def should_queue(connection, room_id, payload):
56
57
  """Queue an owner message that asked for it while the room is busy or earlier messages still wait."""
57
- if payload.get("queue") is not True or names_only_host(connection, room_id, payload):
58
+ if payload.get("queue") is not True:
59
+ return False
60
+ if names_only_host(connection, room_id, payload) and not host_busy(connection, room_id):
58
61
  return False
59
62
  return room_busy(connection, room_id) or connection.execute(
60
63
  "SELECT 1 FROM queued_messages WHERE room_id=? LIMIT 1", (room_id,)).fetchone() is not None
61
64
 
62
65
 
63
66
  def names_only_host(connection, room_id, payload):
64
- """The owner's message names the active host alone: a side question, answered next and kept out of the queue."""
67
+ """The owner's message names the active host alone."""
65
68
  named = payload.get("to")
66
69
  if not isinstance(named, list) or len(set(named)) != 1:
67
70
  return False
@@ -69,6 +72,13 @@ def names_only_host(connection, room_id, payload):
69
72
  (room_id, named[0])).fetchone() is not None
70
73
 
71
74
 
75
+ def host_busy(connection, room_id):
76
+ """The active host still has a request waiting or being worked on."""
77
+ return connection.execute("""SELECT 1 FROM member_requests r JOIN room_members m ON m.id=r.member_id
78
+ WHERE r.room_id=? AND r.status IN ('pending','delivering') AND m.role='host' AND m.status='active' LIMIT 1""",
79
+ (room_id,)).fetchone() is not None
80
+
81
+
72
82
  def enqueue(connection, room_id, payload):
73
83
  """Keep a validated owner message at the end of the queue; a retry with the same submission_id returns the same row."""
74
84
  stored = {key: payload[key] for key in QUEUED_FIELDS if key in payload}
package/backend/server.py CHANGED
@@ -43,7 +43,7 @@ from .private_chat import chat_action, member_chat
43
43
  from .external_members import external_api, guard_route as guard_external_route, is_external_path, owner_api as external_owner_api
44
44
  from .free_room import describe_members, execution_notes, label_members, set_host_checkin, withdraw_dispatch, member_descriptions, member_display_names, member_handles, member_labels, reorder_speakers, resolve_member_fields, set_chain_rounds, speaking_order, stop_room, stop_room_work
45
45
  from .free_room import (ADAPTER_VALUE, LAYOUT_AFTER_SQL, LAYOUT_AT_SQL, continue_chain, execution_timeline, group_route_plan, retract_message, rewind_plan, rewind_room,
46
- room_event_log, withdrawals)
46
+ host_event, host_hidden_event, room_event_log, withdrawals)
47
47
  from .free_room import review_capability, review_roster, checked_review_plan, save_review_plan, check_review_retry
48
48
  from .free_room import review_ready, advance_review, late_answer, execution_diffs
49
49
  from .free_room import checked_sequence, continue_sequence, sequence_view
@@ -116,6 +116,7 @@ ASSETS = {"/": ("index.html", "text/html"),
116
116
  "/markdown.js": ("markdown.js", "text/javascript"),
117
117
  "/backup.js": ("backup.js", "text/javascript"),
118
118
  "/i18n.js": ("i18n.js", "text/javascript"),
119
+ "/video-compress.js": ("video-compress.js", "text/javascript"),
119
120
  "/markdown.css": ("markdown.css", "text/css"),
120
121
  "/icons/LICENSE.txt": ("icons/LICENSE.txt", "text/plain")}
121
122
  # Serve bundled images without maintaining a second list of brand names.
@@ -1809,6 +1810,9 @@ def answers_direct_question(payload):
1809
1810
 
1810
1811
  # The header `launch host-control` adds: the acting host's own member credential, beside the owner's it writes with.
1811
1812
  ACTING_MEMBER_HEADER = "X-Acting-Member-Token"
1813
+ READ_ONLY_HEADER = "X-Discussion-Read-Only"
1814
+ # Reads that change the room: the runner's inbox fires timers and expiries, the external list ends expired members.
1815
+ READ_ONLY_CLOSED = (["inbox"], ["external-members"])
1812
1816
 
1813
1817
  # How much of a summary a receipt keeps; the full summary stays one `message view` away.
1814
1818
  RECEIPT_SUMMARY_CHARS = 200
@@ -3028,6 +3032,15 @@ class DiscussionHandler(BaseHTTPRequestHandler):
3028
3032
  if row and row[0]:
3029
3033
  self.headers["X-Discussion-Token"] = owner_proxy_token(row[0])
3030
3034
 
3035
+ def read_only_request(self):
3036
+ """Whether a task of another room is reading this one: it may read, and nothing it does may change the room."""
3037
+ return bool(self.headers.get(READ_ONLY_HEADER))
3038
+
3039
+ def refuse_read_only(self, parts, method):
3040
+ """Keep a cross-room reader to plain reads: no writes, no reads that change state, no private chats."""
3041
+ if self.read_only_request() and (method != "GET" or parts[3:4] in READ_ONLY_CLOSED or parts[5:6] == ["chat"]):
3042
+ raise PermissionError(Text('需要本房间的控制凭据'))
3043
+
3031
3044
  def handle_admin_api(self, connection, parts, method):
3032
3045
  """Serve administrator registration, login sessions and profile."""
3033
3046
  token = self.admin_token()
@@ -3172,6 +3185,7 @@ class DiscussionHandler(BaseHTTPRequestHandler):
3172
3185
  room_id = parts[2]
3173
3186
  if parts[3:] == ["progress"] and method == "GET":
3174
3187
  return self.respond(room_progress(connection, room_id))
3188
+ self.refuse_read_only(parts, method)
3175
3189
  self.admin_as_owner(connection, room_id)
3176
3190
  token = self.headers.get("X-Discussion-Token", "")
3177
3191
  if self.headers.get("X-Discussion-Session"):
@@ -3244,7 +3258,10 @@ class DiscussionHandler(BaseHTTPRequestHandler):
3244
3258
  if parts[3:4] == ["questions"]:
3245
3259
  return self.handle_questions(connection, parts, params, method, token)
3246
3260
  if parts[3:] == ["events"] and method == "GET":
3247
- return self.respond(room_event_log(connection, room_id, token, params.get("after", 0), params.get("before", 0)))
3261
+ log = room_event_log(connection, room_id, token, params.get("after", 0), params.get("before", 0))
3262
+ if self.read_only_request():
3263
+ log["events"] = [host_event(event) for event in log["events"] if not host_hidden_event(event)]
3264
+ return self.respond(log)
3248
3265
  if parts[3:] == ["register"] and method == "POST":
3249
3266
  result = register_member(connection, room_id, token, utc_now())
3250
3267
  connection.commit()
@@ -3621,7 +3638,8 @@ class DiscussionHandler(BaseHTTPRequestHandler):
3621
3638
  result = set_host_checkin(connection, room_id, token, self.read_payload())
3622
3639
  else:
3623
3640
  raise LookupError(Text('地址不存在'))
3624
- drain_room_queue(connection, room_id)
3641
+ if not self.read_only_request():
3642
+ drain_room_queue(connection, room_id)
3625
3643
  connection.commit()
3626
3644
  return self.respond(result)
3627
3645
 
@@ -12,7 +12,7 @@
12
12
 
13
13
  PDF 站内预览使用 [Mozilla PDF.js](https://github.com/mozilla/pdf.js) 的 `pdfjs-dist 6.4.299`,遵循 Apache-2.0;完整许可证随 [web/pdfjs/LICENSE](../web/pdfjs/LICENSE) 分发。CMap、标准字体、ICC 与 WASM 解码器的独立许可证保留在 `web/pdfjs/cmaps/`、`standard_fonts/`、`iccs/`、`wasm/` 中。构建只复制所需运行文件及这些许可证,不使用远程 CDN。
14
14
 
15
- `package.json` 声明直接依赖,`package-lock.json` 记录实际版本、来源及包许可元数据。Vue、Nuxt UI、Markdown-it、KaTeX、Motion、Iconify / Lucide、fflate、uqr、jsQR 等第三方代码用于前端渲染、本地备份、配对二维码的显示与扫描;文件预览的图片查看器 Viewer.js、音视频播放器 Video.js 10(@videojs/*)与 CSV 解析 PapaParse 打包进 `web/modern.js`;Office 预览的 docx-preview(含 JSZip)、SheetJS 社区版(xlsx,从 SheetJS 官方 CDN 安装)与 @silurus/ooxml(含其 WebAssembly 解析器)单独打包在 `web/office/`,只在打开对应文件时加载;Vite、Tailwind CSS 与 Wrangler 用于构建和部署。[Pi](https://github.com/earendil-works/pi)(`@earendil-works/pi-coding-agent 1.5.2`,MIT)运行模型 API 成员的房间执行:`codiscuss setup` 从 npm 把 `package.json` 开发依赖固定的版本(现为 1.5.2,测试同样用它)安装到本机服务目录,它保留自身的 MIT 许可;它不进入 codiscuss 的 npm 包,代码不复制进本仓库。
15
+ `package.json` 声明直接依赖,`package-lock.json` 记录实际版本、来源及包许可元数据。Vue、Nuxt UI、Markdown-it、KaTeX、Motion、Iconify / Lucide、fflate、uqr、jsQR 等第三方代码用于前端渲染、本地备份、配对二维码的显示与扫描;文件预览的图片查看器 Viewer.js、音视频播放器 Video.js 10(@videojs/*)与 CSV 解析 PapaParse 打包进 `web/modern.js`;Office 预览的 docx-preview(含 JSZip)、SheetJS 社区版(xlsx,从 SheetJS 官方 CDN 安装)与 @silurus/ooxml(含其 WebAssembly 解析器)单独打包在 `web/office/`,只在打开对应文件时加载;上传前压缩视频的 [Mediabunny](https://github.com/Vanilagy/mediabunny)(`mediabunny 1.65.1`,MPL-2.0,未修改,源代码见其仓库)单独打包为 `web/video-compress.js`,只在附加视频时加载;Vite、Tailwind CSS 与 Wrangler 用于构建和部署。[Pi](https://github.com/earendil-works/pi)(`@earendil-works/pi-coding-agent 1.5.2`,MIT)运行模型 API 成员的房间执行:`codiscuss setup` 从 npm 把 `package.json` 开发依赖固定的版本(现为 1.5.2,测试同样用它)安装到本机服务目录,它保留自身的 MIT 许可;它不进入 codiscuss 的 npm 包,代码不复制进本仓库。
16
16
 
17
17
  发布带依赖的程序或重新打包前端时,应保留所使用包中的 LICENSE / NOTICE 文件和生成产物中的许可注释。KaTeX 的样式表与公式字体随前端复制到 `web/katex/`(附其 LICENSE),其包内许可同样适用;Lucide 图标遵循该图标集自身许可。依赖安装后的原始许可位于各 `node_modules/<package>/`,下方附录保存直接依赖及当前前端实际打包模块的许可文本,便于源码与静态产物一同分发。
18
18
 
@@ -2015,3 +2015,383 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2015
2015
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2016
2016
  SOFTWARE.
2017
2017
  ```
2018
+
2019
+ ## mediabunny 1.65.1
2020
+
2021
+ 来源:[Mediabunny 仓库](https://github.com/Vanilagy/mediabunny),未修改。
2022
+
2023
+ ```text
2024
+ Mozilla Public License Version 2.0
2025
+ ==================================
2026
+
2027
+ 1. Definitions
2028
+ --------------
2029
+
2030
+ 1.1. "Contributor"
2031
+ means each individual or legal entity that creates, contributes to
2032
+ the creation of, or owns Covered Software.
2033
+
2034
+ 1.2. "Contributor Version"
2035
+ means the combination of the Contributions of others (if any) used
2036
+ by a Contributor and that particular Contributor's Contribution.
2037
+
2038
+ 1.3. "Contribution"
2039
+ means Covered Software of a particular Contributor.
2040
+
2041
+ 1.4. "Covered Software"
2042
+ means Source Code Form to which the initial Contributor has attached
2043
+ the notice in Exhibit A, the Executable Form of such Source Code
2044
+ Form, and Modifications of such Source Code Form, in each case
2045
+ including portions thereof.
2046
+
2047
+ 1.5. "Incompatible With Secondary Licenses"
2048
+ means
2049
+
2050
+ (a) that the initial Contributor has attached the notice described
2051
+ in Exhibit B to the Covered Software; or
2052
+
2053
+ (b) that the Covered Software was made available under the terms of
2054
+ version 1.1 or earlier of the License, but not also under the
2055
+ terms of a Secondary License.
2056
+
2057
+ 1.6. "Executable Form"
2058
+ means any form of the work other than Source Code Form.
2059
+
2060
+ 1.7. "Larger Work"
2061
+ means a work that combines Covered Software with other material, in
2062
+ a separate file or files, that is not Covered Software.
2063
+
2064
+ 1.8. "License"
2065
+ means this document.
2066
+
2067
+ 1.9. "Licensable"
2068
+ means having the right to grant, to the maximum extent possible,
2069
+ whether at the time of the initial grant or subsequently, any and
2070
+ all of the rights conveyed by this License.
2071
+
2072
+ 1.10. "Modifications"
2073
+ means any of the following:
2074
+
2075
+ (a) any file in Source Code Form that results from an addition to,
2076
+ deletion from, or modification of the contents of Covered
2077
+ Software; or
2078
+
2079
+ (b) any new file in Source Code Form that contains any Covered
2080
+ Software.
2081
+
2082
+ 1.11. "Patent Claims" of a Contributor
2083
+ means any patent claim(s), including without limitation, method,
2084
+ process, and apparatus claims, in any patent Licensable by such
2085
+ Contributor that would be infringed, but for the grant of the
2086
+ License, by the making, using, selling, offering for sale, having
2087
+ made, import, or transfer of either its Contributions or its
2088
+ Contributor Version.
2089
+
2090
+ 1.12. "Secondary License"
2091
+ means either the GNU General Public License, Version 2.0, the GNU
2092
+ Lesser General Public License, Version 2.1, the GNU Affero General
2093
+ Public License, Version 3.0, or any later versions of those
2094
+ licenses.
2095
+
2096
+ 1.13. "Source Code Form"
2097
+ means the form of the work preferred for making modifications.
2098
+
2099
+ 1.14. "You" (or "Your")
2100
+ means an individual or a legal entity exercising rights under this
2101
+ License. For legal entities, "You" includes any entity that
2102
+ controls, is controlled by, or is under common control with You. For
2103
+ purposes of this definition, "control" means (a) the power, direct
2104
+ or indirect, to cause the direction or management of such entity,
2105
+ whether by contract or otherwise, or (b) ownership of more than
2106
+ fifty percent (50%) of the outstanding shares or beneficial
2107
+ ownership of such entity.
2108
+
2109
+ 2. License Grants and Conditions
2110
+ --------------------------------
2111
+
2112
+ 2.1. Grants
2113
+
2114
+ Each Contributor hereby grants You a world-wide, royalty-free,
2115
+ non-exclusive license:
2116
+
2117
+ (a) under intellectual property rights (other than patent or trademark)
2118
+ Licensable by such Contributor to use, reproduce, make available,
2119
+ modify, display, perform, distribute, and otherwise exploit its
2120
+ Contributions, either on an unmodified basis, with Modifications, or
2121
+ as part of a Larger Work; and
2122
+
2123
+ (b) under Patent Claims of such Contributor to make, use, sell, offer
2124
+ for sale, have made, import, and otherwise transfer either its
2125
+ Contributions or its Contributor Version.
2126
+
2127
+ 2.2. Effective Date
2128
+
2129
+ The licenses granted in Section 2.1 with respect to any Contribution
2130
+ become effective for each Contribution on the date the Contributor first
2131
+ distributes such Contribution.
2132
+
2133
+ 2.3. Limitations on Grant Scope
2134
+
2135
+ The licenses granted in this Section 2 are the only rights granted under
2136
+ this License. No additional rights or licenses will be implied from the
2137
+ distribution or licensing of Covered Software under this License.
2138
+ Notwithstanding Section 2.1(b) above, no patent license is granted by a
2139
+ Contributor:
2140
+
2141
+ (a) for any code that a Contributor has removed from Covered Software;
2142
+ or
2143
+
2144
+ (b) for infringements caused by: (i) Your and any other third party's
2145
+ modifications of Covered Software, or (ii) the combination of its
2146
+ Contributions with other software (except as part of its Contributor
2147
+ Version); or
2148
+
2149
+ (c) under Patent Claims infringed by Covered Software in the absence of
2150
+ its Contributions.
2151
+
2152
+ This License does not grant any rights in the trademarks, service marks,
2153
+ or logos of any Contributor (except as may be necessary to comply with
2154
+ the notice requirements in Section 3.4).
2155
+
2156
+ 2.4. Subsequent Licenses
2157
+
2158
+ No Contributor makes additional grants as a result of Your choice to
2159
+ distribute the Covered Software under a subsequent version of this
2160
+ License (see Section 10.2) or under the terms of a Secondary License (if
2161
+ permitted under the terms of Section 3.3).
2162
+
2163
+ 2.5. Representation
2164
+
2165
+ Each Contributor represents that the Contributor believes its
2166
+ Contributions are its original creation(s) or it has sufficient rights
2167
+ to grant the rights to its Contributions conveyed by this License.
2168
+
2169
+ 2.6. Fair Use
2170
+
2171
+ This License is not intended to limit any rights You have under
2172
+ applicable copyright doctrines of fair use, fair dealing, or other
2173
+ equivalents.
2174
+
2175
+ 2.7. Conditions
2176
+
2177
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
2178
+ in Section 2.1.
2179
+
2180
+ 3. Responsibilities
2181
+ -------------------
2182
+
2183
+ 3.1. Distribution of Source Form
2184
+
2185
+ All distribution of Covered Software in Source Code Form, including any
2186
+ Modifications that You create or to which You contribute, must be under
2187
+ the terms of this License. You must inform recipients that the Source
2188
+ Code Form of the Covered Software is governed by the terms of this
2189
+ License, and how they can obtain a copy of this License. You may not
2190
+ attempt to alter or restrict the recipients' rights in the Source Code
2191
+ Form.
2192
+
2193
+ 3.2. Distribution of Executable Form
2194
+
2195
+ If You distribute Covered Software in Executable Form then:
2196
+
2197
+ (a) such Covered Software must also be made available in Source Code
2198
+ Form, as described in Section 3.1, and You must inform recipients of
2199
+ the Executable Form how they can obtain a copy of such Source Code
2200
+ Form by reasonable means in a timely manner, at a charge no more
2201
+ than the cost of distribution to the recipient; and
2202
+
2203
+ (b) You may distribute such Executable Form under the terms of this
2204
+ License, or sublicense it under different terms, provided that the
2205
+ license for the Executable Form does not attempt to limit or alter
2206
+ the recipients' rights in the Source Code Form under this License.
2207
+
2208
+ 3.3. Distribution of a Larger Work
2209
+
2210
+ You may create and distribute a Larger Work under terms of Your choice,
2211
+ provided that You also comply with the requirements of this License for
2212
+ the Covered Software. If the Larger Work is a combination of Covered
2213
+ Software with a work governed by one or more Secondary Licenses, and the
2214
+ Covered Software is not Incompatible With Secondary Licenses, this
2215
+ License permits You to additionally distribute such Covered Software
2216
+ under the terms of such Secondary License(s), so that the recipient of
2217
+ the Larger Work may, at their option, further distribute the Covered
2218
+ Software under the terms of either this License or such Secondary
2219
+ License(s).
2220
+
2221
+ 3.4. Notices
2222
+
2223
+ You may not remove or alter the substance of any license notices
2224
+ (including copyright notices, patent notices, disclaimers of warranty,
2225
+ or limitations of liability) contained within the Source Code Form of
2226
+ the Covered Software, except that You may alter any license notices to
2227
+ the extent required to remedy known factual inaccuracies.
2228
+
2229
+ 3.5. Application of Additional Terms
2230
+
2231
+ You may choose to offer, and to charge a fee for, warranty, support,
2232
+ indemnity or liability obligations to one or more recipients of Covered
2233
+ Software. However, You may do so only on Your own behalf, and not on
2234
+ behalf of any Contributor. You must make it absolutely clear that any
2235
+ such warranty, support, indemnity, or liability obligation is offered by
2236
+ You alone, and You hereby agree to indemnify every Contributor for any
2237
+ liability incurred by such Contributor as a result of warranty, support,
2238
+ indemnity or liability terms You offer. You may include additional
2239
+ disclaimers of warranty and limitations of liability specific to any
2240
+ jurisdiction.
2241
+
2242
+ 4. Inability to Comply Due to Statute or Regulation
2243
+ ---------------------------------------------------
2244
+
2245
+ If it is impossible for You to comply with any of the terms of this
2246
+ License with respect to some or all of the Covered Software due to
2247
+ statute, judicial order, or regulation then You must: (a) comply with
2248
+ the terms of this License to the maximum extent possible; and (b)
2249
+ describe the limitations and the code they affect. Such description must
2250
+ be placed in a text file included with all distributions of the Covered
2251
+ Software under this License. Except to the extent prohibited by statute
2252
+ or regulation, such description must be sufficiently detailed for a
2253
+ recipient of ordinary skill to be able to understand it.
2254
+
2255
+ 5. Termination
2256
+ --------------
2257
+
2258
+ 5.1. The rights granted under this License will terminate automatically
2259
+ if You fail to comply with any of its terms. However, if You become
2260
+ compliant, then the rights granted under this License from a particular
2261
+ Contributor are reinstated (a) provisionally, unless and until such
2262
+ Contributor explicitly and finally terminates Your grants, and (b) on an
2263
+ ongoing basis, if such Contributor fails to notify You of the
2264
+ non-compliance by some reasonable means prior to 60 days after You have
2265
+ come back into compliance. Moreover, Your grants from a particular
2266
+ Contributor are reinstated on an ongoing basis if such Contributor
2267
+ notifies You of the non-compliance by some reasonable means, this is the
2268
+ first time You have received notice of non-compliance with this License
2269
+ from such Contributor, and You become compliant prior to 30 days after
2270
+ Your receipt of the notice.
2271
+
2272
+ 5.2. If You initiate litigation against any entity by asserting a patent
2273
+ infringement claim (excluding declaratory judgment actions,
2274
+ counter-claims, and cross-claims) alleging that a Contributor Version
2275
+ directly or indirectly infringes any patent, then the rights granted to
2276
+ You by any and all Contributors for the Covered Software under Section
2277
+ 2.1 of this License shall terminate.
2278
+
2279
+ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
2280
+ end user license agreements (excluding distributors and resellers) which
2281
+ have been validly granted by You or Your distributors under this License
2282
+ prior to termination shall survive termination.
2283
+
2284
+ ************************************************************************
2285
+ * *
2286
+ * 6. Disclaimer of Warranty *
2287
+ * ------------------------- *
2288
+ * *
2289
+ * Covered Software is provided under this License on an "as is" *
2290
+ * basis, without warranty of any kind, either expressed, implied, or *
2291
+ * statutory, including, without limitation, warranties that the *
2292
+ * Covered Software is free of defects, merchantable, fit for a *
2293
+ * particular purpose or non-infringing. The entire risk as to the *
2294
+ * quality and performance of the Covered Software is with You. *
2295
+ * Should any Covered Software prove defective in any respect, You *
2296
+ * (not any Contributor) assume the cost of any necessary servicing, *
2297
+ * repair, or correction. This disclaimer of warranty constitutes an *
2298
+ * essential part of this License. No use of any Covered Software is *
2299
+ * authorized under this License except under this disclaimer. *
2300
+ * *
2301
+ ************************************************************************
2302
+
2303
+ ************************************************************************
2304
+ * *
2305
+ * 7. Limitation of Liability *
2306
+ * -------------------------- *
2307
+ * *
2308
+ * Under no circumstances and under no legal theory, whether tort *
2309
+ * (including negligence), contract, or otherwise, shall any *
2310
+ * Contributor, or anyone who distributes Covered Software as *
2311
+ * permitted above, be liable to You for any direct, indirect, *
2312
+ * special, incidental, or consequential damages of any character *
2313
+ * including, without limitation, damages for lost profits, loss of *
2314
+ * goodwill, work stoppage, computer failure or malfunction, or any *
2315
+ * and all other commercial damages or losses, even if such party *
2316
+ * shall have been informed of the possibility of such damages. This *
2317
+ * limitation of liability shall not apply to liability for death or *
2318
+ * personal injury resulting from such party's negligence to the *
2319
+ * extent applicable law prohibits such limitation. Some *
2320
+ * jurisdictions do not allow the exclusion or limitation of *
2321
+ * incidental or consequential damages, so this exclusion and *
2322
+ * limitation may not apply to You. *
2323
+ * *
2324
+ ************************************************************************
2325
+
2326
+ 8. Litigation
2327
+ -------------
2328
+
2329
+ Any litigation relating to this License may be brought only in the
2330
+ courts of a jurisdiction where the defendant maintains its principal
2331
+ place of business and such litigation shall be governed by laws of that
2332
+ jurisdiction, without reference to its conflict-of-law provisions.
2333
+ Nothing in this Section shall prevent a party's ability to bring
2334
+ cross-claims or counter-claims.
2335
+
2336
+ 9. Miscellaneous
2337
+ ----------------
2338
+
2339
+ This License represents the complete agreement concerning the subject
2340
+ matter hereof. If any provision of this License is held to be
2341
+ unenforceable, such provision shall be reformed only to the extent
2342
+ necessary to make it enforceable. Any law or regulation which provides
2343
+ that the language of a contract shall be construed against the drafter
2344
+ shall not be used to construe this License against a Contributor.
2345
+
2346
+ 10. Versions of the License
2347
+ ---------------------------
2348
+
2349
+ 10.1. New Versions
2350
+
2351
+ Mozilla Foundation is the license steward. Except as provided in Section
2352
+ 10.3, no one other than the license steward has the right to modify or
2353
+ publish new versions of this License. Each version will be given a
2354
+ distinguishing version number.
2355
+
2356
+ 10.2. Effect of New Versions
2357
+
2358
+ You may distribute the Covered Software under the terms of the version
2359
+ of the License under which You originally received the Covered Software,
2360
+ or under the terms of any subsequent version published by the license
2361
+ steward.
2362
+
2363
+ 10.3. Modified Versions
2364
+
2365
+ If you create software not governed by this License, and you want to
2366
+ create a new license for such software, you may create and use a
2367
+ modified version of this License if you rename the license and remove
2368
+ any references to the name of the license steward (except to note that
2369
+ such modified license differs from this License).
2370
+
2371
+ 10.4. Distributing Source Code Form that is Incompatible With Secondary
2372
+ Licenses
2373
+
2374
+ If You choose to distribute Source Code Form that is Incompatible With
2375
+ Secondary Licenses under the terms of this version of the License, the
2376
+ notice described in Exhibit B of this License must be attached.
2377
+
2378
+ Exhibit A - Source Code Form License Notice
2379
+ -------------------------------------------
2380
+
2381
+ This Source Code Form is subject to the terms of the Mozilla Public
2382
+ License, v. 2.0. If a copy of the MPL was not distributed with this
2383
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
2384
+
2385
+ If it is not possible or desirable to put the notice in a particular
2386
+ file, then You may include the notice in a location (such as a LICENSE
2387
+ file in a relevant directory) where a recipient would be likely to look
2388
+ for such a notice.
2389
+
2390
+ You may add additional accurate notices of copyright ownership.
2391
+
2392
+ Exhibit B - "Incompatible With Secondary Licenses" Notice
2393
+ ---------------------------------------------------------
2394
+
2395
+ This Source Code Form is "Incompatible With Secondary Licenses", as
2396
+ defined by the Mozilla Public License, v. 2.0.
2397
+ ```
@@ -175,7 +175,7 @@ npx wrangler deploy --config deploy/entry.wrangler.jsonc
175
175
  "vars": { "ENTRY_URL": "https://codiscuss-entry.<账号子域>.workers.dev" }
176
176
  ```
177
177
 
178
- 接入一台托管电脑:在你(部署线上站点的电脑)的管理面板“概览 → 托管 → 登录入口”选“线上中转”,展开“生成接入码”,填部署配置路径与站点地址后生成(需已登录 wrangler;一次性,再生成会让未用过的作废);把接入码发给托管电脑,粘贴到它的同一个窗口点“接入并切换”,它会绑定站点、取得入口地址、启动所需服务并切换。面板给出的链接带电脑编号(`?m=…`),发给使用者即可。使用者的请求经入口 Worker 和中转到达这台电脑的登录入口,登录、会话与入口保护都在电脑上;Cloudflare 能看到这些往来内容(与自有域名隧道相同),每个页面的请求都计入 Workers 免费额度。
178
+ 接入一台托管电脑:在你(部署线上站点的电脑)的管理面板“概览 → 登录入口 → 托管账号入口”选“线上网站”,展开“生成接入码”,填部署配置路径与站点地址后生成(需已登录 wrangler;一次性,再生成会让未用过的作废);把接入码发给托管电脑,粘贴到它的同一个窗口点“接入并开启”,它会绑定站点、取得入口地址、启动所需服务并开启线上网站(已开启的自有域名不受影响,两者可同时使用)。面板给出的链接带电脑编号(`?m=…`),发给使用者即可。使用者的请求经入口 Worker 和中转到达这台电脑的登录入口,登录、会话与入口保护都在电脑上;Cloudflare 能看到这些往来内容(与自有域名隧道相同),每个页面的请求都计入 Workers 免费额度。
179
179
 
180
180
  ## 常见问题
181
181
 
@@ -173,7 +173,7 @@ It gets its own `workers.dev` address (such as `https://codiscuss-entry.<account
173
173
  "vars": { "ENTRY_URL": "https://codiscuss-entry.<account-subdomain>.workers.dev" }
174
174
  ```
175
175
 
176
- To connect a hosted computer: in the admin panel of your computer (the one that deployed the online site), go to **Overview → Hosting → Sign-in entry**, choose **Online relay**, expand **Generate connect code**, fill in the deployment config path and site address, and generate it (wrangler must be signed in; the code is single-use, and generating a new one voids unused ones). Send the code to the hosted computer and paste it into the same window there, then click **Connect and switch**: it binds the site, gets the entry address, starts the needed services and switches over. The link the panel shows carries the computer's ID (`?m=…`); send it to the users. Their requests reach this computer's sign-in entry through the entry Worker and the relay, while sign-in, sessions and entry protection all stay on the computer. Cloudflare can see this traffic (as with a tunnel on your own domain), and every page request counts against the free Workers quota.
176
+ To connect a hosted computer: in the admin panel of your computer (the one that deployed the online site), go to **Overview → Sign-in entry → Hosted account entry**, choose **Online site**, expand **Generate connect code**, fill in the deployment config path and site address, and generate it (wrangler must be signed in; the code is single-use, and generating a new one voids unused ones). Send the code to the hosted computer and paste it into the same window there, then click **Connect and turn on**: it binds the site, gets the entry address, starts the needed services and turns on the online site (your own domain, if on, stays on; both can be used together). The link the panel shows carries the computer's ID (`?m=…`); send it to the users. Their requests reach this computer's sign-in entry through the entry Worker and the relay, while sign-in, sessions and entry protection all stay on the computer. Cloudflare can see this traffic (as with a tunnel on your own domain), and every page request counts against the free Workers quota.
177
177
 
178
178
  ## Troubleshooting
179
179