ai_co_discuss 0.4.97 → 0.4.98

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 (76) hide show
  1. package/.agents/skills/discuss-host/references/control.md +1 -1
  2. package/.agents/skills/discuss-host/references/launch.md +1 -1
  3. package/.agents/skills/discuss-host/references/room.md +2 -1
  4. package/README.md +24 -45
  5. package/README.zh-CN.md +24 -37
  6. package/backend/external_members.py +19 -7
  7. package/backend/free_room.py +118 -11
  8. package/backend/message_queue.py +179 -45
  9. package/backend/runtime.py +1 -1
  10. package/backend/server.py +17 -6
  11. package/docs/architecture.md +1 -1
  12. package/docs/deployment.md +12 -6
  13. package/docs/en/architecture.md +1 -1
  14. package/docs/en/deployment.md +11 -5
  15. package/docs/en/guide/README.md +26 -0
  16. package/docs/en/guide/admin.md +56 -0
  17. package/docs/en/guide/cli.md +80 -0
  18. package/docs/en/guide/concepts.md +25 -0
  19. package/docs/en/guide/discussion.md +58 -0
  20. package/docs/en/guide/external-members.md +53 -0
  21. package/docs/en/guide/faq.md +75 -0
  22. package/docs/en/guide/first-run.md +58 -0
  23. package/docs/en/guide/goal.md +47 -0
  24. package/docs/en/guide/members.md +76 -0
  25. package/docs/en/guide/remote.md +57 -0
  26. package/docs/en/guide/rooms.md +61 -0
  27. package/docs/en/guide/scheduling.md +47 -0
  28. package/docs/en/guide/voice.md +60 -0
  29. package/docs/en/guide/workflows.md +56 -0
  30. package/docs/en/guide/working.md +81 -0
  31. package/docs/en/runner.md +19 -135
  32. package/docs/en/workflow.md +12 -92
  33. package/docs/guide/README.md +28 -0
  34. package/docs/guide/admin.md +58 -0
  35. package/docs/guide/cli.md +80 -0
  36. package/docs/guide/concepts.md +29 -0
  37. package/docs/guide/discussion.md +58 -0
  38. package/docs/guide/external-members.md +54 -0
  39. package/docs/guide/faq.md +67 -0
  40. package/docs/guide/first-run.md +60 -0
  41. package/docs/guide/goal.md +47 -0
  42. package/docs/guide/members.md +76 -0
  43. package/docs/guide/remote.md +58 -0
  44. package/docs/guide/rooms.md +61 -0
  45. package/docs/guide/scheduling.md +47 -0
  46. package/docs/guide/voice.md +60 -0
  47. package/docs/guide/workflows.md +56 -0
  48. package/docs/guide/working.md +81 -0
  49. package/docs/runner.md +20 -172
  50. package/docs/workflow.md +12 -95
  51. package/frontend/locales/en/app.json +0 -2
  52. package/frontend/locales/en/backend.json +2 -0
  53. package/frontend/locales/en/core.json +0 -1
  54. package/frontend/locales/en/discussion.json +2 -0
  55. package/frontend/locales/en/room.json +26 -2
  56. package/frontend/locales/en/settings.json +44 -1
  57. package/package.json +1 -1
  58. package/runner/adapters/antigravity_cli.mjs +3 -11
  59. package/runner/adapters/claude.mjs +51 -13
  60. package/runner/adapters/profiles.mjs +6 -3
  61. package/runner/admin_cli.mjs +3 -1
  62. package/runner/admin_panel.mjs +6 -2
  63. package/runner/discussion_launch.mjs +133 -17
  64. package/runner/external_client.mjs +8 -1
  65. package/runner/free_runner.mjs +14 -5
  66. package/runner/i18n_en.mjs +2 -1
  67. package/runner/os_users.mjs +52 -0
  68. package/runner/project_files.mjs +7 -6
  69. package/runner/project_manage.mjs +362 -0
  70. package/web/admin.js +1 -1
  71. package/web/app.js +77 -12
  72. package/web/backup.js +1 -1
  73. package/web/i18n.js +2 -2
  74. package/web/markdown.css +1 -1
  75. package/web/modern.css +1 -1
  76. package/web/modern.js +51 -50
@@ -1,12 +1,14 @@
1
- """Owner messages queued while members work, posted one by one once the room is idle.
2
-
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 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 waits until the host is free, and then goes ahead of the messages waiting for the whole room. Each idle
7
- moment posts the next message through the normal message path with its own submission_id,
8
- so a repeated drain finds the posted message and only removes the row. A failed post keeps the row with its reason and holds
9
- the queue; the owner's stop pauses it. The owner may send one at once, edit, delete, reorder or resume the queue.
1
+ """Owner messages queued while members work, released as their recipients come free.
2
+
3
+ The owner's composer sends with `queue: true`. A message that names members (`@成员`, not everyone and not in turn) is a
4
+ side question: it takes no place in the speaking order and goes to each named member as soon as that member has no open
5
+ request and nothing queued for it earlier. A named member still busy keeps its share here, so a message naming a free and a
6
+ busy member goes to the free one at once and to the busy one once it is free (the share of the posted message: its
7
+ `message_id`, `to` the members still waited for). Any other message (unnamed, everyone, everyone in turn) waits for the
8
+ whole room: no open request, turn waiting or running discussion. Each release of a new message goes through the normal
9
+ message path with its own submission_id, so a repeated drain finds the posted message and only moves on. A failed post
10
+ keeps the row with its reason and holds the queue; the owner's stop pauses it. The owner may send one at once, edit,
11
+ delete, reorder or resume the queue.
10
12
  """
11
13
 
12
14
  import json
@@ -15,7 +17,8 @@ import time
15
17
  from .runtime import begin_write, require_owner
16
18
  from .texts import Text, load_texts, save_text
17
19
 
18
- QUEUED_FIELDS = ("author", "text", "reply_to", "kind", "submitted_by", "to", "sequential", "order", "attachment_ids", "attachment_start", "submission_id")
20
+ QUEUED_FIELDS = ("author", "text", "reply_to", "kind", "submitted_by", "to", "sequential", "order", "attachment_ids", "attachment_start",
21
+ "submission_id", "message_id")
19
22
  QUEUE_ACTIONS = ("send", "edit", "delete", "reorder", "resume", "queueing")
20
23
  QUEUE_ERRORS = (ValueError, TypeError, LookupError, PermissionError, FileExistsError)
21
24
 
@@ -40,37 +43,94 @@ def room_busy(connection, room_id):
40
43
 
41
44
 
42
45
  def queue_view(connection, room_id):
43
- """The room's queued owner messages in order, whether the queue is paused, and the site's queueing switch."""
46
+ """The room's queued owner messages in order, whether the queue is paused, and the site's queueing switch.
47
+
48
+ The share of a message already posted carries `message_id` and `waiting_for` (the members it still waits for); its
49
+ files went out with that message, so it lists none."""
44
50
  items = []
45
51
  for row in connection.execute("SELECT * FROM queued_messages WHERE room_id=? ORDER BY position,id", (room_id,)):
46
52
  payload = json.loads(row["payload"])
47
53
  files = [dict(item) for item in connection.execute(
48
54
  "SELECT id,file_name,content_type FROM attachments WHERE room_id=? AND id IN (SELECT value FROM json_each(?))",
49
55
  (room_id, json.dumps(payload.get("attachment_ids", []))))]
50
- items.append({"id": row["id"], "text": payload.get("text", ""), "attachments": files, "failure": row["failure"], "texts": load_texts(connection, "queued_message", row["id"]),
51
- "created_at": row["created_at"]})
56
+ item = {"id": row["id"], "text": payload.get("text", ""), "attachments": files, "failure": row["failure"],
57
+ "texts": load_texts(connection, "queued_message", row["id"]), "created_at": row["created_at"]}
58
+ if named_members(connection, room_id, payload) is not None:
59
+ item["to"] = payload["to"]
60
+ if payload.get("message_id"):
61
+ item.update(message_id=payload["message_id"], waiting_for=payload.get("to", []))
62
+ items.append(item)
52
63
  paused = connection.execute("SELECT 1 FROM queued_message_pauses WHERE room_id=?", (room_id,)).fetchone() is not None
64
+ busy_members = [row["name"] for row in connection.execute("SELECT id,name FROM room_members WHERE room_id=? AND status='active'", (room_id,))
65
+ if member_busy(connection, row["id"])]
53
66
  return {"items": items, "paused": paused and bool(items), "busy": room_busy(connection, room_id),
54
- "host_busy": host_busy(connection, room_id), "queueing": queueing_enabled(connection)}
67
+ "host_busy": host_busy(connection, room_id), "busy_members": busy_members, "queueing": queueing_enabled(connection)}
55
68
 
56
69
 
57
- def should_queue(connection, room_id, payload):
58
- """Queue an owner message that asked for it while the room is busy or earlier messages still wait."""
59
- if payload.get("queue") is not True:
60
- return False
61
- if names_only_host(connection, room_id, payload) and not host_busy(connection, room_id):
62
- return False
63
- return room_busy(connection, room_id) or connection.execute(
64
- "SELECT 1 FROM queued_messages WHERE room_id=? LIMIT 1", (room_id,)).fetchone() is not None
70
+ def named_members(connection, room_id, payload):
71
+ """The present members a side question names, as {name: id}; None for a message the whole room waits for."""
72
+ named = payload.get("to")
73
+ if not isinstance(named, list) or not named or payload.get("sequential") is True or payload.get("order") == "auto":
74
+ return None
75
+ present = {row["name"]: row["id"] for row in connection.execute(
76
+ "SELECT id,name FROM room_members WHERE room_id=? AND status='active'", (room_id,))}
77
+ found = {name: present[name] for name in named if name in present}
78
+ return found or None
65
79
 
66
80
 
67
- def names_only_host(connection, room_id, payload):
68
- """The owner's message names the active host alone."""
81
+ def addressed(payload):
82
+ """The message names members one by one (not everyone, not in turn), present or not."""
69
83
  named = payload.get("to")
70
- if not isinstance(named, list) or len(set(named)) != 1:
71
- return False
72
- return connection.execute("SELECT 1 FROM room_members WHERE room_id=? AND name=? AND role='host' AND status='active'",
73
- (room_id, named[0])).fetchone() is not None
84
+ return isinstance(named, list) and bool(named) and payload.get("sequential") is not True and payload.get("order") != "auto"
85
+
86
+
87
+ def drop_taken_back(connection, room_id):
88
+ """Drop the shares of messages since retracted or rewound: nothing is left for their members to answer."""
89
+ for row in connection.execute("SELECT id,payload FROM queued_messages WHERE room_id=?", (room_id,)).fetchall():
90
+ message_id = json.loads(row["payload"]).get("message_id")
91
+ if message_id and connection.execute("SELECT 1 FROM message_withdrawals WHERE message_id=?", (message_id,)).fetchone():
92
+ connection.execute("DELETE FROM queued_messages WHERE id=?", (row["id"],))
93
+
94
+
95
+ def member_busy(connection, member_id):
96
+ """The member has a request waiting or being worked on, or a turn still running."""
97
+ return connection.execute("""SELECT 1 FROM member_requests WHERE member_id=? AND status IN ('pending','delivering')
98
+ UNION ALL SELECT 1 FROM member_executions WHERE member_id=? AND status IN ('dispatched','started') LIMIT 1""",
99
+ (member_id, member_id)).fetchone() is not None
100
+
101
+
102
+ def waiting_names(connection, room_id, named, before=None):
103
+ """Named members that cannot take a side question now: busy, or a message queued earlier still waits for them.
104
+
105
+ `before` is the queued row being released, so only the rows ahead of it count; None counts the whole queue."""
106
+ earlier = set()
107
+ for row in connection.execute("SELECT id,payload FROM queued_messages WHERE room_id=? ORDER BY position,id", (room_id,)):
108
+ if row["id"] == before:
109
+ break
110
+ queued = json.loads(row["payload"])
111
+ if named_members(connection, room_id, queued) is not None:
112
+ earlier.update(queued.get("to") or [])
113
+ return [name for name, member_id in named.items() if name in earlier or member_busy(connection, member_id)]
114
+
115
+
116
+ def queue_split(connection, room_id, payload):
117
+ """What of an owner message that asked for queueing must wait.
118
+
119
+ Returns:
120
+ None to post it whole now; "all" to queue it whole; otherwise the names of the named members whose share waits,
121
+ the message going now to the others.
122
+ """
123
+ if payload.get("queue") is not True:
124
+ return None
125
+ named = named_members(connection, room_id, payload)
126
+ if named is None:
127
+ waits = room_busy(connection, room_id) or connection.execute(
128
+ "SELECT 1 FROM queued_messages WHERE room_id=? LIMIT 1", (room_id,)).fetchone() is not None
129
+ return "all" if waits else None
130
+ waiting = waiting_names(connection, room_id, named)
131
+ if not waiting:
132
+ return None
133
+ return "all" if len(waiting) == len(named) else waiting
74
134
 
75
135
 
76
136
  def host_busy(connection, room_id):
@@ -98,15 +158,63 @@ def enqueue(connection, room_id, payload):
98
158
  return {"queued": cursor.lastrowid, "duplicate": False}
99
159
 
100
160
 
101
- def post_item(connection, room_id, row, post):
102
- """Post one queued message through the normal path and drop its row; a refused post keeps the row with the reason.
161
+ def share_payload(payload, waiting, message_id):
162
+ """The part of a posted message the busy named members still wait for; its files went out with the message."""
163
+ return {**payload, "to": list(waiting), "message_id": message_id, "attachment_ids": []}
164
+
165
+
166
+ def enqueue_share(connection, room_id, payload, message_id, waiting):
167
+ """Queue the share of a just-posted message that its busy named members wait for."""
168
+ share = share_payload(payload, waiting, message_id)
169
+ share["submission_id"] = f"{payload['submission_id']}:later"
170
+ return enqueue(connection, room_id, share)
171
+
172
+
173
+ def give_share(connection, room_id, payload, names):
174
+ """Ask the named members to answer a message already posted.
175
+
176
+ Returns:
177
+ The message's id, or None when it is gone or taken back (the share is then dropped).
178
+ """
179
+ message_id = payload["message_id"]
180
+ if not connection.execute("SELECT 1 FROM messages WHERE room_id=? AND id=?", (room_id, message_id)).fetchone() or \
181
+ connection.execute("SELECT 1 FROM message_withdrawals WHERE message_id=?", (message_id,)).fetchone():
182
+ return None
183
+ for member_id in (named_members(connection, room_id, {"to": names}) or {}).values():
184
+ connection.execute("""INSERT OR IGNORE INTO member_requests (room_id,member_id,message_id,chain_id,batch_id,purpose,created_by,created_at)
185
+ VALUES (?,?,?,?,0,'ask','user',?)""", (room_id, member_id, message_id, message_id, int(time.time())))
186
+ return message_id
187
+
188
+
189
+ def keep_rest(connection, row, payload, waiting, message_id):
190
+ """Release done: drop the row, or keep it as the share the members still busy wait for."""
191
+ if waiting and message_id:
192
+ connection.execute("UPDATE queued_messages SET payload=? WHERE id=?",
193
+ (json.dumps(share_payload(payload, waiting, message_id), ensure_ascii=False), row["id"]))
194
+ else:
195
+ connection.execute("DELETE FROM queued_messages WHERE id=?", (row["id"],))
196
+
197
+
198
+ def post_item(connection, room_id, row, post, names=None):
199
+ """Release one queued row to `names` (everyone it waits for by default); the members left keep their share queued.
200
+
201
+ A row not yet posted goes through the normal path; the share of a posted message asks its members for it. A refused
202
+ post keeps the row with the reason.
103
203
 
104
204
  Returns:
105
- The post's result (with the saved `message`), or None when it was refused.
205
+ The post's result (with the saved `message`; `message_id` for a share), or None when it was refused.
106
206
  """
207
+ payload = json.loads(row["payload"])
208
+ present = list(named_members(connection, room_id, payload) or {})
209
+ names = list(payload.get("to") or []) if names is None else names
210
+ waiting = [name for name in present if name not in names]
211
+ if payload.get("message_id"):
212
+ message_id = give_share(connection, room_id, payload, names)
213
+ keep_rest(connection, row, payload, waiting, message_id)
214
+ return {"message_id": message_id}
107
215
  connection.execute("SAVEPOINT queued_post")
108
216
  try:
109
- result = post(connection, room_id, json.loads(row["payload"]), "用户")
217
+ result = post(connection, room_id, {**payload, "to": names} if waiting else payload, "用户")
110
218
  except QUEUE_ERRORS as error:
111
219
  connection.execute("ROLLBACK TO queued_post")
112
220
  connection.execute("RELEASE queued_post")
@@ -115,31 +223,54 @@ def post_item(connection, room_id, row, post):
115
223
  save_text(connection, "queued_message", row["id"], "failure", failure)
116
224
  return None
117
225
  connection.execute("RELEASE queued_post")
118
- connection.execute("DELETE FROM queued_messages WHERE id=?", (row["id"],))
226
+ keep_rest(connection, row, payload, waiting, result["message"]["id"])
119
227
  return result
120
228
 
121
229
 
122
230
  def next_queued(connection, room_id):
123
- """The queued message that may go now: the head of an idle room; while members work, the first naming only a free host."""
124
- rows = connection.execute("SELECT * FROM queued_messages WHERE room_id=? ORDER BY position,id", (room_id,)).fetchall()
125
- if not room_busy(connection, room_id):
126
- return rows[0] if rows else None
127
- if host_busy(connection, room_id):
128
- return None
129
- return next((row for row in rows if names_only_host(connection, room_id, json.loads(row["payload"]))), None)
231
+ """The first queued row, in queue order, that may go now, and to whom.
232
+
233
+ A side question goes to its named members that are free (no open request, nothing queued for them earlier); any
234
+ other message goes only in an idle room.
235
+
236
+ Returns:
237
+ (row, names): the members to release it to, None for the whole message; (None, None) when nothing may go.
238
+ """
239
+ idle = not room_busy(connection, room_id)
240
+ for row in connection.execute("SELECT * FROM queued_messages WHERE room_id=? ORDER BY position,id", (room_id,)).fetchall():
241
+ payload = json.loads(row["payload"])
242
+ named = named_members(connection, room_id, payload)
243
+ if named is None:
244
+ if payload.get("message_id"):
245
+ # Its members have all left: drop the share.
246
+ return row, []
247
+ if idle and not addressed(payload):
248
+ return row, None
249
+ if addressed(payload) and not row["failure"]:
250
+ # Its members have all left: it stays, marked, for the owner to edit or delete, without holding the rest.
251
+ failure = Text("点名的成员已不在房间")
252
+ connection.execute("UPDATE queued_messages SET failure=? WHERE id=?", (str(failure), row["id"]))
253
+ save_text(connection, "queued_message", row["id"], "failure", failure)
254
+ continue
255
+ waiting = waiting_names(connection, room_id, named, before=row["id"])
256
+ free = [name for name in named if name not in waiting]
257
+ if free:
258
+ return row, free if waiting or payload.get("message_id") else None
259
+ return None, None
130
260
 
131
261
 
132
262
  def drain(connection, room_id, post):
133
- """Post what may go now, one message at a time, unless the queue is paused; stops at a failed message or when nothing may go."""
263
+ """Release what may go now, one row at a time, unless the queue is paused; stops at a failed message or when nothing may go."""
134
264
  if not connection.execute("SELECT 1 FROM queued_messages WHERE room_id=? LIMIT 1", (room_id,)).fetchone():
135
265
  return
136
266
  begin_write(connection)
267
+ drop_taken_back(connection, room_id)
137
268
  archived = connection.execute("SELECT archived FROM room_directory WHERE room_id=?", (room_id,)).fetchone()
138
269
  if archived is None or archived[0] or connection.execute("SELECT 1 FROM queued_message_pauses WHERE room_id=?", (room_id,)).fetchone():
139
270
  return
140
271
  while True:
141
- row = next_queued(connection, room_id)
142
- if row is None or row["failure"] or not post_item(connection, room_id, row, post):
272
+ row, names = next_queued(connection, room_id)
273
+ if row is None or row["failure"] or post_item(connection, room_id, row, post, names) is None:
143
274
  return
144
275
 
145
276
 
@@ -160,6 +291,8 @@ def queued_row(connection, room_id, item_id):
160
291
  def edit_item(connection, row, text, check):
161
292
  """Replace a queued message's text; `check` validates the edited payload as a message would be."""
162
293
  payload = json.loads(row["payload"])
294
+ if payload.get("message_id"):
295
+ raise FileExistsError(Text('这条消息已发出,只是还在等忙碌的成员;可以删除后重新发送'))
163
296
  payload["text"] = str(text if text is not None else "").strip()
164
297
  check(payload)
165
298
  connection.execute("UPDATE queued_messages SET payload=?,failure='' WHERE id=?", (json.dumps(payload, ensure_ascii=False), row["id"]))
@@ -192,8 +325,9 @@ def queue_action(connection, room_id, token, payload, post, check, interrupt):
192
325
  result = post_item(connection, room_id, row, post)
193
326
  if not result:
194
327
  raise ValueError(connection.execute("SELECT failure FROM queued_messages WHERE id=?", (row["id"],)).fetchone()[0])
195
- if result.get("message"):
196
- interrupt(connection, room_id, result["message"]["id"])
328
+ message_id = result["message"]["id"] if result.get("message") else result.get("message_id")
329
+ if message_id:
330
+ interrupt(connection, room_id, message_id)
197
331
  elif action == "edit":
198
332
  edit_item(connection, queued_row(connection, room_id, payload.get("id")), payload.get("text"), check)
199
333
  elif action == "delete":
@@ -13,7 +13,7 @@ OWNER_PROXY_PREFIX = secrets.token_hex(16) + ":"
13
13
  LIMIT_DEFAULTS = {"max_rounds": 0, "max_minutes": 0, "execution_minutes": 0}
14
14
  # Phase segments the runner reports for the execution timeline: the phases, how many one execution keeps and one report
15
15
  # carries, a tool name's length, and how long after its end an execution still takes its last report.
16
- SEGMENT_PHASES = ("thinking", "command", "tool", "editing", "writing")
16
+ SEGMENT_PHASES = ("thinking", "command", "tool", "editing", "writing", "waiting")
17
17
  MAX_EXECUTION_SEGMENTS = 400
18
18
  MAX_SEGMENTS_PER_REPORT = 40
19
19
  MAX_SEGMENT_TOOL = 60
package/backend/server.py CHANGED
@@ -49,7 +49,7 @@ from .free_room import review_ready, advance_review, late_answer, execution_diff
49
49
  from .free_room import checked_sequence, continue_sequence, sequence_view
50
50
  from . import questions
51
51
  from .identity import MAX_ROOM_AGENTS, PARTICIPANTS, default_label_text, is_ai, is_participant
52
- from .message_queue import drain as drain_queue, enqueue, queue_action, queue_view, should_queue
52
+ from .message_queue import drain as drain_queue, enqueue, enqueue_share, queue_action, queue_split, queue_view
53
53
  from .room_import import import_room, imported_attachment
54
54
  from .runtime import (begin_write, limit_values, owner_proxy_token, require_owner, token_hash,
55
55
  enforce_session_limits, room_limits_view, session_limits_view)
@@ -67,6 +67,8 @@ UPDATE_HEARTBEAT_SECONDS = 15
67
67
  # Changes remembered for streams that fall behind; one further back is reported as a change to the whole site.
68
68
  UPDATE_LOG_SIZE = 256
69
69
  MAX_BODY_BYTES = 512 * 1024
70
+ # The file page uploads to a project in parts of up to 3 MiB on the computer itself (base64 in JSON).
71
+ MAX_FILE_PART_BODY_BYTES = 5 * 1024 * 1024
70
72
  MAX_IMPORT_BYTES = 32 * 1024 * 1024
71
73
  MAX_ATTACHMENT_BYTES = 20 * 1024 * 1024
72
74
  # Files uploaded while the message is still being written are dropped if never sent within this time.
@@ -1715,8 +1717,12 @@ def append_free_message(connection, room, payload, actor):
1715
1717
  check_message_attachments(connection, room_id, submitted_by, identifiers)
1716
1718
  # `/goal` and `/discuss` are commands: checked before saving, never queued, and not routed to members.
1717
1719
  mode_command = check_mode_command(connection, room_id, payload) if actor == "用户" else None
1718
- if actor == "用户" and not mode_command and should_queue(connection, room_id, payload):
1720
+ waiting = queue_split(connection, room_id, payload) if actor == "用户" and not mode_command else None
1721
+ if waiting == "all":
1719
1722
  return {**enqueue(connection, room_id, payload), "queue": queue_view(connection, room_id)}
1723
+ if waiting:
1724
+ # A side question naming free and busy members: the free ones answer now, the busy ones' share waits in the queue.
1725
+ queued_share, payload = payload, {**payload, "to": [name for name in payload["to"] if name not in waiting]}
1720
1726
  if actor != "用户":
1721
1727
  check_answer(connection, room_id, actor, payload)
1722
1728
  review_plan = checked_review_plan(connection, room_id, actor, payload)
@@ -1742,6 +1748,9 @@ def append_free_message(connection, room, payload, actor):
1742
1748
  if payload.get("proactive") is not True:
1743
1749
  complete_session_requests(connection, room_id, payload, actor, cursor.lastrowid)
1744
1750
  saved_message = connection.execute(f"{MESSAGE_QUERY} WHERE messages.id=?", (cursor.lastrowid,)).fetchone()
1751
+ if waiting:
1752
+ enqueue_share(connection, room_id, queued_share, cursor.lastrowid, waiting)
1753
+ return {"message": message_with_attachments(connection, saved_message), "duplicate": False, "queue": queue_view(connection, room_id)}
1745
1754
  return {"message": message_with_attachments(connection, saved_message), "duplicate": False}
1746
1755
 
1747
1756
 
@@ -2858,7 +2867,7 @@ class DiscussionHandler(BaseHTTPRequestHandler):
2858
2867
  if method == "POST":
2859
2868
  if self.headers.get_content_type() != "application/json":
2860
2869
  raise ValueError(Text('本机操作须使用 application/json'))
2861
- payload = self.read_payload()
2870
+ payload = self.read_payload(MAX_FILE_PART_BODY_BYTES if command == "room-files" else MAX_BODY_BYTES)
2862
2871
  if command in ("start", "room-config", "room-models", "room-skills", "room-files", "room-page", "room-media", "execution-details", "room-member", "room-member-access", "room-member-allow", "room-member-adapter", "room-member-model", "room-profiles", "room-restore", "room-fork", "room-workflow", "room-settings", "workflows"):
2863
2872
  payload.pop("access_file", None)
2864
2873
  payload.update(site=site, entry="web")
@@ -2903,7 +2912,9 @@ class DiscussionHandler(BaseHTTPRequestHandler):
2903
2912
  del tickets[key]
2904
2913
  while len(tickets) >= MAX_MEDIA_TICKETS:
2905
2914
  del tickets[next(iter(tickets))]
2906
- tickets[ticket] = (path, info.st_size, info.st_mtime_ns, result["content_type"], path.name, now + MEDIA_TICKET_SECONDS)
2915
+ # A download is saved by the browser instead of shown.
2916
+ disposition = "attachment" if payload.get("download") is True else "inline"
2917
+ tickets[ticket] = (path, info.st_size, info.st_mtime_ns, result["content_type"], path.name, now + MEDIA_TICKET_SECONDS, disposition)
2907
2918
  return self.respond({**result, "url": f"/api/local/media/{ticket}"})
2908
2919
 
2909
2920
  def serve_media_ticket(self, ticket):
@@ -2912,14 +2923,14 @@ class DiscussionHandler(BaseHTTPRequestHandler):
2912
2923
  item = self.server.media_tickets.get(ticket)
2913
2924
  if not item or item[5] <= time.time():
2914
2925
  raise LookupError(Text('播放地址已过期,请重新打开文件'))
2915
- path, size, mtime_ns, content_type, name, _ = item
2926
+ path, size, mtime_ns, content_type, name, _, disposition = item
2916
2927
  try:
2917
2928
  info = path.stat()
2918
2929
  except OSError:
2919
2930
  raise LookupError(Text('文件已不存在')) from None
2920
2931
  if (info.st_size, info.st_mtime_ns) != (size, mtime_ns):
2921
2932
  raise FileExistsError(Text('文件已变化,请重新打开'))
2922
- self.send_file(path, content_type, name, "inline")
2933
+ self.send_file(path, content_type, name, disposition)
2923
2934
 
2924
2935
  def save_local_room_configuration(self, command, payload):
2925
2936
  """Keep session pause/revision validation and local file replacement in one boundary."""
@@ -49,7 +49,7 @@ AI 平台(Codex、Claude、Antigravity(界面显示为 Gemini)、DeepSeek
49
49
  - CLI 通过纯文本页面 `/r/ROOM_ID` 按需读取,不一次性加载全部历史。
50
50
  - 网站目前没有按用户隔离房间数据。独立观点阶段会临时限制匿名及普通成员读取后续观点,并要求完整导出使用房主或主持凭据;这不是整站访问控制,详见 [安全说明](../.github/SECURITY.md)。
51
51
  - 本机路径、软件配置、会话绑定与 API 密钥只保存在本机服务目录。
52
- - 外部成员(另一台电脑上的 AI)有自己的成员凭证和密钥,每条请求都带签名、经中转端到端加密;房间后端只允许它读本房间、领取点名给它的请求、提交自己的回答,读项目由本机服务的只读引擎按开放目录与固定排除执行,每次读取先记录再返回。见 [外部成员](runner.md#外部成员借用另一台电脑上的-ai)。
52
+ - 外部成员(另一台电脑上的 AI)有自己的成员凭证和密钥,每条请求都带签名、经中转端到端加密;房间后端只允许它读本房间、领取点名给它的请求、提交自己的回答,读项目由本机服务的只读引擎按开放目录与固定排除执行,每次读取先记录再返回。见 [跨电脑协作](guide/external-members.md)。
53
53
 
54
54
  ## 技术栈
55
55
 
@@ -2,10 +2,10 @@
2
2
 
3
3
  [English](en/deployment.md) | 简体中文
4
4
 
5
- 网站可以运行在本机(Python + SQLite),也可以自托管到 Docker 或 Cloudflare Pages + D1。Python 与 Docker 部署各自保存房间,互不同步;Cloudflare 线上站点不保存房间,也没有账号和密码,只保存绑定的电脑与电脑签名的设备名单;已配对的设备经中转读写电脑上的房间。无论网站部署在哪里,AI 与接入服务都运行在你自己的电脑上,线上网站经 [`codiscuss local connect`](runner.md#线上网页连接本机) 连接本机。
5
+ 网站可以运行在本机(Python + SQLite),也可以自托管到 Docker 或 Cloudflare Pages + D1。Python 与 Docker 部署各自保存房间,互不同步;Cloudflare 线上站点不保存房间,也没有账号和密码,只保存绑定的电脑与电脑签名的设备名单;已配对的设备经中转读写电脑上的房间。无论网站部署在哪里,AI 与接入服务都运行在你自己的电脑上,线上网站经 [`codiscuss local connect`](guide/remote.md) 连接本机。
6
6
 
7
7
  > [!WARNING]
8
- > 网站暂无用户登录与读取权限隔离,能访问站点的人即可阅读其中的房间。公开部署前请阅读 [安全说明](../.github/SECURITY.md),并在服务外配置访问控制。
8
+ > 自托管 Python 站点支持管理员登录。房间没有逐房间的读取权限隔离,能访问房间站点的人即可阅读其中的房间。公开部署前请阅读 [安全说明](../.github/SECURITY.md),并在服务外配置访问控制。
9
9
 
10
10
  ## Python 服务
11
11
 
@@ -31,13 +31,19 @@ Python 3.10+,无第三方依赖。长期部署请自行配置进程管理与 H
31
31
 
32
32
  ## Docker
33
33
 
34
+ 在仓库根目录构建镜像。首次启动前,在当前终端设置一段自己生成、妥善保存的随机安装令牌。PowerShell 用 `$env:DISCUSS_ADMIN_SETUP_KEY = Read-Host "安装令牌"`,Bash 用 `read -rs -p "Setup token: " DISCUSS_ADMIN_SETUP_KEY`,再执行 `export DISCUSS_ADMIN_SETUP_KEY`。下面的 `-e` 将该变量传入容器。
35
+
34
36
  ```sh
35
37
  docker build -f deploy/Dockerfile -t ai-co-discuss .
36
38
  docker volume create ai-co-discuss-data
37
- docker run --name ai-co-discuss -p 127.0.0.1:8765:8765 -v ai-co-discuss-data:/data ai-co-discuss
39
+ docker run -d --name ai-co-discuss -p 127.0.0.1:8875:8765 -e DISCUSS_ADMIN_SETUP_KEY -v ai-co-discuss-data:/data ai-co-discuss
38
40
  ```
39
41
 
40
- 镜像以非 root 用户运行,数据保存在命名卷 `/data`。示例只绑定本机端口,远程访问请自行配置反向代理与访问边界。
42
+ 容器以非 root 用户运行,将房间和附件保存在挂载到 `/data` 的命名卷。示例把 Docker 网站映射到宿主机 8875 端口,为本机 AI 服务保留默认的 8765 端口。
43
+
44
+ 1. **注册管理员。** 在 Docker 宿主机打开 `http://127.0.0.1:8875`,在左下角的账号入口打开“设置管理员账号”,填入安装令牌,设置自己的登录名和密码。容器内监听 `0.0.0.0`,即使从宿主机回环地址访问也需注册。若没设置环境变量,首次启动会生成令牌,可在宿主机私下用 `docker logs ai-co-discuss` 查看。注册后使用账号密码登录。
45
+ 2. **连接本机 AI。** 在已安装 CoDiscuss、配置了 AI 的电脑上运行 `codiscuss local connect http://127.0.0.1:8875`(Docker 与 AI 在同一台电脑时)。该命令启动本机服务,并打开 Docker 站点的专用连接链接。在这台 AI 电脑的浏览器里完成连接并登录 Docker 站点,再从该站点建房、邀请本机 AI。若未自动打开,可用 `--no-open` 获取链接后手动打开。链接包含连接凭据,请勿转发。
46
+ 3. **局域网访问。** 上面的端口映射只允许宿主机访问。要让局域网浏览器直连,建容器时将映射改为 `-p <宿主机局域网IP>:8875:8765`,仅向受信任的局域网放行该端口,其他电脑打开 `http://<宿主机局域网IP>:8875`。请留意本站没有逐房间的读取隔离。若另一台电脑要**连接自己的 AI**,为 Docker 网站配置 HTTPS 反向代理,在 AI 电脑上运行 `codiscuss local connect https://你的站点域名`。只有 `127.0.0.1` 或 `localhost` 可用 HTTP 执行连接命令;其他设备应使用普通站点地址访问。
41
47
 
42
48
  ## Cloudflare Pages + Functions + D1
43
49
 
@@ -119,7 +125,7 @@ npx wrangler d1 execute DB --remote --config .wrangler/deploy/wrangler.jsonc --f
119
125
 
120
126
  本机 Python 站点启动时检测旧表,自动在单个事务内迁移,再应用 schema;迁移失败会整体回滚并终止启动。升级前仍应备份 SQLite 和附件,不必手工执行删表脚本。
121
127
 
122
- 线上网站不再有管理员账号:网站和电脑上的 codiscuss 需要同时升级,升级后在电脑上运行一次 `codiscuss local connect https://你的站点`,用新的绑定令牌重新绑定,再把每台外出用的设备按 [远程控制](runner.md#在其他设备上远程控制) 在电脑前重新配对。新增的 `machine_sign_keys`、`machine_devices` 表由同一份 schema 创建;线上网站不再读取管理员密码与登录记录。本机网站的 `--remote-port` 远程入口已停用。
128
+ 线上网站不再有管理员账号:网站和电脑上的 codiscuss 需要同时升级,升级后在电脑上运行一次 `codiscuss local connect https://你的站点`,用新的绑定令牌重新绑定,再把每台外出用的设备按 [手机与外出](guide/remote.md) 在电脑前重新配对。新增的 `machine_sign_keys`、`machine_devices` 表由同一份 schema 创建;线上网站不再读取管理员密码与登录记录。本机网站的 `--remote-port` 远程入口已停用。
123
129
 
124
130
  自托管 Python 站点仍用管理员账号登录,房间不经过设备签名:本机按那个站点的请求干活,等于把那个站点的管理员视同本人。只在你能保证该站点账号安全时使用;需要防护时请改用默认的线上网站加中转。
125
131
 
@@ -175,7 +181,7 @@ npx wrangler deploy --config deploy/entry.wrangler.jsonc
175
181
  "vars": { "ENTRY_URL": "https://codiscuss-entry.<账号子域>.workers.dev" }
176
182
  ```
177
183
 
178
- 接入一台托管电脑:在你(部署线上站点的电脑)的管理面板“概览 → 本机 → 线上网站”点“生成接入码”,填部署配置路径与站点地址后生成(需已登录 wrangler;一次性,再生成会让未用过的作废);把接入码发给托管电脑,在它的“本机 → 线上网站”点“绑定”粘贴,再到“登录入口 → 托管账号入口”打开“经线上网站中转”的开关,它会取得入口地址并启动所需服务(已开启的自有域名不受影响,两者可同时使用;命令行 `codiscuss admin entry join 接入码` 一步完成这些)。托管账号默认就能邀请外部专家:开着自有域名时经你的域名直连,否则由面板自动替账号绑定线上网站,都不需要接入码。面板给出的链接带电脑编号(`?m=…`),发给使用者即可。使用者的请求经入口 Worker 和中转到达这台电脑的登录入口,登录、会话与入口保护都在电脑上;Cloudflare 能看到这些往来内容(与自有域名隧道相同),每个页面的请求都计入 Workers 免费额度。
184
+ 接入一台托管电脑:在你(部署线上站点的电脑)的管理面板“概览 → 登录入口 → 管理员入口 → 线上网站”点“生成接入码”,填部署配置路径与站点地址后生成(需已登录 wrangler;一次性,再生成会让未用过的作废);把接入码发给托管电脑,在它的“概览 → 登录入口 → 管理员入口 → 线上网站”点“绑定”粘贴,再到“登录入口 → 托管账号入口”打开“经线上网站中转”的开关,它会取得入口地址并启动所需服务(已开启的自有域名不受影响,两者可同时使用;命令行 `codiscuss admin entry join 接入码` 一步完成这些)。托管账号默认就能邀请外部专家:开着自有域名时经你的域名直连,否则由面板自动替账号绑定线上网站,都不需要接入码。面板给出的链接带电脑编号(`?m=…`),发给使用者即可。使用者的请求经入口 Worker 和中转到达这台电脑的登录入口,登录、会话与入口保护都在电脑上;Cloudflare 能看到这些往来内容(与自有域名隧道相同),每个页面的请求都计入 Workers 免费额度。
179
185
 
180
186
  ## 常见问题
181
187
 
@@ -47,7 +47,7 @@ An AI platform (Codex, Claude, Antigravity (shown as Gemini), DeepSeek, Qwen, Gr
47
47
  - The CLI reads through plain-text pages under `/r/ROOM_ID`, on demand rather than loading the full history.
48
48
  - Room data is not isolated by user. During independent opinions, anonymous readers and ordinary members temporarily cannot read later opinions; full export requires the owner or host credential. This is not site-wide access control. See the [security policy](../../.github/SECURITY.md).
49
49
  - Local paths, tool configuration, session bindings and API keys stay in the local service directory.
50
- - An external member (an AI on another computer) has its own member credential and key; every request is signed and end-to-end encrypted through the relay. The room backend lets it only read its room, claim requests addressed to it and post its own answers; project reads go through the local service's read-only engine, limited to the opened folders minus fixed exclusions, and each read is recorded before anything is returned. See [External members](runner.md#external-members-borrowing-an-ai-from-another-computer).
50
+ - An external member (an AI on another computer) has its own member credential and key; every request is signed and end-to-end encrypted through the relay. The room backend lets it only read its room, claim requests addressed to it and post its own answers; project reads go through the local service's read-only engine, limited to the opened folders minus fixed exclusions, and each read is recorded before anything is returned. See [External members](guide/external-members.md).
51
51
 
52
52
  ## Tech Stack
53
53
 
@@ -2,10 +2,10 @@
2
2
 
3
3
  English | [简体中文](../deployment.md)
4
4
 
5
- The site can run locally (Python + SQLite) or be self-hosted on Docker or Cloudflare Pages + D1. Python and Docker deployments each keep their own rooms, not synced between them; the Cloudflare site keeps no rooms and no accounts, only the bound computer and the device list it signs, and paired devices read and write the computer's rooms through the relay. Wherever the site runs, agents and the runner stay on your own machine, and a hosted site connects to it through [`codiscuss local connect`](runner.md#from-a-hosted-site).
5
+ The site can run locally (Python + SQLite) or be self-hosted on Docker or Cloudflare Pages + D1. Python and Docker deployments each keep their own rooms, not synced between them; the Cloudflare site keeps no rooms and no accounts, only the bound computer and the device list it signs, and paired devices read and write the computer's rooms through the relay. Wherever the site runs, agents and the runner stay on your own machine, and a hosted site connects to it through [`codiscuss local connect`](guide/remote.md).
6
6
 
7
7
  > [!WARNING]
8
- > The site has no user login or read-access isolation yet — anyone who can reach it can read its rooms. Read the [security policy](../../.github/SECURITY.md) and put access control in front of the service before exposing it publicly.
8
+ > Self-hosted Python sites support administrator sign-in. Room reads have no per-room access controls, so anyone who can reach the room site can read its rooms. Read the [security policy](../../.github/SECURITY.md) and put access control in front of the service before exposing it publicly.
9
9
 
10
10
  ## Python
11
11
 
@@ -31,13 +31,19 @@ Python 3.10+ with no third-party dependencies. For long-running deployments, add
31
31
 
32
32
  ## Docker
33
33
 
34
+ Build the image from the repository root. Before the first start, set a random setup token in your shell and keep it private. In PowerShell, use `$env:DISCUSS_ADMIN_SETUP_KEY = Read-Host "Setup token"`. In Bash, use `read -rs -p "Setup token: " DISCUSS_ADMIN_SETUP_KEY` followed by `export DISCUSS_ADMIN_SETUP_KEY`. The `-e` option below passes that variable into the container.
35
+
34
36
  ```sh
35
37
  docker build -f deploy/Dockerfile -t ai-co-discuss .
36
38
  docker volume create ai-co-discuss-data
37
- docker run --name ai-co-discuss -p 127.0.0.1:8765:8765 -v ai-co-discuss-data:/data ai-co-discuss
39
+ docker run -d --name ai-co-discuss -p 127.0.0.1:8875:8765 -e DISCUSS_ADMIN_SETUP_KEY -v ai-co-discuss-data:/data ai-co-discuss
38
40
  ```
39
41
 
40
- The image runs as a non-root user and keeps data in the `/data` volume. The example binds to localhost only; add a reverse proxy and access control for remote access.
42
+ The image runs as a non-root user. Its named volume at `/data` stores rooms and attachments. Host port 8875 serves the Docker site, leaving the default port 8765 free for the AI computer's local service.
43
+
44
+ 1. **Register an administrator.** On the Docker host, open `http://127.0.0.1:8875`. Use the account control at the bottom left and choose **Set up admin account**. Enter the setup token and choose a login name and password. The server inside the container listens on `0.0.0.0`, so registration is required even when you open it from the host's loopback address. If you omitted the environment variable, the server generates a token on first start. Read it privately on the host with `docker logs ai-co-discuss`. After registration, sign in with the account password.
45
+ 2. **Connect your AI tools.** If Docker and your configured AI tools run on the same computer, run `codiscuss local connect http://127.0.0.1:8875` there. It starts the local service and opens a private connection link to the Docker site. Open that link in a browser on the AI computer, sign in to the Docker site, and create a room there with your local AI. If a browser does not open automatically, use `--no-open` and open the printed link yourself. Keep the link private because it contains the service credential.
46
+ 3. **Access from your LAN.** The example port mapping accepts connections only from the host. For direct LAN browsing, publish `-p <host-LAN-IP>:8875:8765` when creating the container and allow that port only from your trusted LAN. Other computers can visit `http://<host-LAN-IP>:8875`. The site has no per-room read isolation. To **connect AI tools on another computer**, put the Docker site behind an HTTPS reverse proxy and run `codiscuss local connect https://your-site.example` on the AI computer. The connection command accepts HTTP only for `127.0.0.1` or `localhost`. Other devices should visit the ordinary site address.
41
47
 
42
48
  ## Cloudflare Pages + D1
43
49
 
@@ -173,7 +179,7 @@ It gets its own `workers.dev` address (such as `https://codiscuss-entry.<account
173
179
  "vars": { "ENTRY_URL": "https://codiscuss-entry.<account-subdomain>.workers.dev" }
174
180
  ```
175
181
 
176
- To connect a hosted computer: in the admin panel of your computer (the one that deployed the online site), go to **Overview → This computer → Online site**, choose **Generate access 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 it to the hosted computer, paste it under **This computer → Online site → Bind** there, then turn on **Through the online site** under **Sign-in entry → Hosted account entry**; it fetches the entry address and starts what it needs (an enabled own domain is unaffected and both can be on; `codiscuss admin entry join <code>` does all of this in one step). Hosted accounts can invite external experts by default: through your own domain when it is on, otherwise the panel binds each account to the online site for you; no access code is needed. 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.
182
+ 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 → Administrator entry → Online site**, choose **Generate access 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 it to the hosted computer, paste it under **Overview → Sign-in entry → Administrator entry → Online site → Bind** there, then turn on **Through the online site** under **Sign-in entry → Hosted account entry**; it fetches the entry address and starts what it needs (an enabled own domain is unaffected and both can be on; `codiscuss admin entry join <code>` does all of this in one step). Hosted accounts can invite external experts by default: through your own domain when it is on, otherwise the panel binds each account to the online site for you; no access code is needed. 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
183
 
178
184
  ## Troubleshooting
179
185
 
@@ -0,0 +1,26 @@
1
+ # AI CoDiscuss user guide
2
+
3
+ Start with [Concepts and terminology](concepts.md), then follow [Your first room](first-run.md) until you receive a reply. After that, choose a page for the task at hand.
4
+
5
+ | Page | What you'll find |
6
+ | --- | --- |
7
+ | [Concepts and terminology](concepts.md) | Learn what a room, member, host, local service, local site, and online site do, and recognize older names for them. |
8
+ | [Your first room](first-run.md) | Check costs, system requirements, data storage, and what happens when the computer goes offline. Install CoDiscuss and create a room from the website or an existing AI conversation. |
9
+ | [Creating and organizing rooms](rooms.md) | Configure a room, organize folders, browse the **Files** view, send attachments, and export, import, or branch a room. |
10
+ | [Working in a room](working.md) | Assign work, follow main and side tasks, manage queued messages, guide a member privately, stop or rewind work, and answer questions. |
11
+ | [Discussions](discussion.md) | Start a structured discussion, set limits, pause or skip a turn, and use `discuss-report` to produce a report linked to the original messages. |
12
+ | [Goal](goal.md) | Keep the host working toward a goal, set budgets and idle time, and receive WeChat reminders when a decision needs your input. |
13
+ | [Workflows](workflows.md) | Install bundled workflows, activate one in a room, release its members, and use `workflow-creator` with **Full host control**. |
14
+ | [Members](members.md) | Invite local AI tools or model APIs, resume sessions, change models and prompts, set project permissions, and connect an existing conversation manually. |
15
+ | [Members on other computers](external-members.md) | Lend or borrow an AI, set access and loan duration, and renew or revoke access. |
16
+ | [Using your phone away from home](remote.md) | Bind your computer to an online site, pair a phone or tablet, renew access with a passkey, and see what you can control remotely. |
17
+ | [Smart scheduling](scheduling.md) | Configure a decision model to route routine requests and manage transitions, then rate its decisions. |
18
+ | [Speech and notifications](voice.md) | Use local or cloud services for read-aloud and dictation, install local speech models, and link WeChat to receive and answer notifications. |
19
+ | [Admin panel and hosted accounts](admin.md) | Start, stop, and update services, manage sign-ins and keys, and give others isolated hosted accounts using the panel or `codiscuss admin`. |
20
+ | [Command line](cli.md) | Find everyday `codiscuss` commands by task and look up their options. |
21
+ | [FAQ and settings index](faq.md) | Get answers to ten first-time questions, troubleshoot failed runs, and look up **Settings** controls. |
22
+
23
+ ## Deployment and architecture
24
+
25
+ - [Deployment](../deployment.md) covers Python, Docker, and a Cloudflare Pages site with D1 and a relay, including upgrades.
26
+ - [Architecture](../architecture.md) explains the design, source layout, identities, and where data is stored.