ai_co_discuss 0.4.85 → 0.4.86

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.
@@ -31,6 +31,6 @@ description: "AI CoDiscuss 的主持技能,仅主持人调用,且须同时
31
31
 
32
32
  怎么规划由你判断;只在会改变方向的关键歧义处向用户确认。派活写清谁做什么、做到什么程度,怎么拆、按什么步骤做交给成员——他们背后的软件自己会规划。执行性工作(读长文、写汇总、核对证据、跑测试)派给成员,你做判断、裁定与汇总,上下文与额度留给整个房间的推进。用户的倾向、成员意见一致都不等于已验证事实。
33
33
 
34
- 分派时参考 `room view` 的 `descriptions`(用户写的各成员擅长与分工)。成员带 `external` 字段的是外部成员,在另一台电脑上运行:点名后可能要等对方同意才开始,对方拒绝或超时时请求带 `external_outcome` 并被取消;它只能读 `external.directories` 里的目录、提交自己的回答,不能派活。出图、改图优先派给能看图的本机软件成员,它能下载附件自查效果;没有 `image` 字段时请用户在“协作设置”添加生图卡片。
34
+ 用户没指定人选、要你自己挑人或挑模型时(分派、换模型或强度、邀请成员、组织讨论),参考 `room view` 的 `descriptions`(用户写的各成员擅长与分工,优先)和 [成员分工参考](references/members.md)(用户偏好与各家模型的长短)。成员带 `external` 字段的是外部成员,在另一台电脑上运行:点名后可能要等对方同意才开始,对方拒绝或超时时请求带 `external_outcome` 并被取消;它只能读 `external.directories` 里的目录、提交自己的回答,不能派活。出图、改图优先派给能看图的本机软件成员,它能下载附件自查效果;没有 `image` 字段时请用户在“协作设置”添加生图卡片。
35
35
 
36
36
  任务带 `scheduler_suggestions` 时,那是智能调度说明某条消息或交接为何交给你(附置信度),不是用户指令,也未核实:按其中的 `request_id`、`message_id` 先读原文再决定是否采纳,需要依据时 `state decision ROOM DECISION_ID`。`applied:false` 表示未自动生效,`actual_action:unverified` 表示结果尚未核验;没有记录编号时不假定模型给过建议。
@@ -0,0 +1,53 @@
1
+ # 成员分工参考
2
+
3
+ > 更新:2026-11-19。社区口碑与公开跑分整理,只作参考。
4
+
5
+ **何时用**:用户没指定谁做什么、要你自己挑人或挑模型时(派活、换模型或强度、邀请成员、组织讨论)。大多数时候照用户的安排做。
6
+
7
+ **谁说了算**:用户这次的要求 > “协作设置”里的成员说明(`descriptions`)> 成员在本房间的实际表现 > 本页。
8
+
9
+ ## 挑人前先看
10
+
11
+ - **项目权限**:要改文件或跑命令的活,先在 `room view` 核对成员权限,只读成员只派审阅和核对。只读的 Antigravity 跑网站命令以外的命令会直接结束本轮。
12
+ - **软件不同,表现不同**:成员是“软件 + 模型 + 强度”的组合。API 成员强度只有 low / medium / high,能读网页和项目文件、可写时能跑命令,做不了主活的也可派搜集、核对、整理,不要晾着。
13
+ - **贵模型不默认派**:Claude Fable 这类最贵的模型,同样的活额度消耗是常用模型的数倍,用户要求或别的确实解决不了时再用。
14
+ - **讨论选人**:主持人之外每家厂商各派一位代表,不让同一家的两位同场:同一家的看法往往相近。
15
+
16
+ ## 各家一览
17
+
18
+ | 厂商(软件) | 模型 ID(强 → 快) | 适合 | 注意 |
19
+ |---|---|---|---|
20
+ | Claude(Claude Code) | `claude-fable-5-2`、`claude-opus-5-5`、`claude-sonnet-5-5`、`claude-haiku-5-5` | Opus 主刀长任务、前端设计与审美;Fable 审计、诊断、卡住的难题;Sonnet 常规代码初审 | Fable 额度消耗约为 Opus 的 3–4 倍 |
21
+ | GPT(Codex) | `gpt-6.2-astra`、`gpt-6.2-sol`、`gpt-6.1-terra`、`gpt-6-luna` | 推理、审查挑错、复杂排障;Astra 做前端版式与 3D;小修用 Sol | 易思考过度,强度从中档起步;中文常带防御腔,面向用户的中文让别家润色 |
22
+ | Gemini(Antigravity) | `gemini-4-carbon`、`gemini-4-neon`、`gemini-4-argon`、`gemini-4-hydrogen` | 写小说、长篇中文用 Argon 或 Carbon;其他日常活用 Neon;Hydrogen 便宜跑量;幻觉低、超长文本强 | 执行慢,显示掉登录或额度耗尽多半是假的,多重试;输出排版差;`/swarm` 很费额度 |
23
+ | DeepSeek | `deepseek-flash` | 便宜快速,多步执行稳,适合量大的简单活 | 复杂长链条任务容易原地打转;强度用 high 即可;`deepseek-v4-pro` 停在 8 月版本、比 Flash 旧,现阶段不用 |
24
+ | Kimi | — | 规划、前端还原、多步工具调用 | 慢、贵、常限流;跑分有人称有水分 |
25
+ | GLM | — | 后端逻辑少出错,中文古风文笔好 | 慢 |
26
+ | Qwen | `qwen4-max`、`qwen3.7-plus`、`qwen3.8-flash` | 本地部署首选 | 容易过度思考 |
27
+ | MiniMax | — | 便宜 | 写代码弱;工具调用要配好专用框架(有人称) |
28
+ | Grok | `grok-4.7` | 上下文长、单价低于 Opus | 4.7 口碑偏弱、修 bug 慢、烧 token;优先派简单活 |
29
+
30
+ ## 纸面能力(截至 2026-11-19)
31
+
32
+ 分差在各榜误差内算持平;榜上多是最高强度的成绩,日常中档会低一些。
33
+
34
+ | 维度(榜单) | 第一梯队(彼此持平) | 其余 / 备注 |
35
+ |---|---|---|
36
+ | 命令行端到端(Terminal-Bench 4.x,CLI 软件 + 模型;API 成员无成绩) | Claude Code + Opus 5.5 / Fable 5.2 / Sonnet 5.5,Antigravity + Carbon,Codex + 6.2 Astra / Sol(62–66%,误差约 ±3) | Grok Build + Grok 4.7 仅 38.8% |
37
+ | 代码能否被合并(FrontierCode 2.0) | Fable 5.2(49%) | Opus 5.5、6.2 Astra、6.2 Sol 在 44–46% |
38
+ | 综合(AA 智能指数,转述) | Fable 5.2、6.2 Astra、Neon、Carbon、Opus 5.5(59–65) | 6.2 Sol 57,Hydrogen 54 |
39
+ | 专项 | 行业推理:Fable 5.2、Neon、Sonnet 5.5;超长文本:Neon;3D 建模:6.2 Astra | 幻觉率:Hydrogen 8%,Sonnet 5.5 43% |
40
+
41
+ ## 生图模型
42
+
43
+ 房间生图卡片目前只接 OpenAI,其他家的模型要靠能调用它们的成员自己出图。两家都是连续多轮编辑会越改越偏,重要的图尽量一两轮内定稿。
44
+
45
+ | 模型 | 适合 | 注意 |
46
+ |---|---|---|
47
+ | `gpt-image-2.6-sunburst` | 求画质,文生图榜第一,改图细节稳;支持 GIF、SVG、圈图修改 | 有人称图常带噪点 |
48
+ | `gpt-image-2.6-flare` | 求快,人像与文字排版好 | 同上 |
49
+ | `gemini-nano-banana-2.1` | 又快又省,1K–4K,最多 14 张参考图,角色一致,排版准;出图干净,电商改图常用 | 画质要求更高用 `gemini-3-pro-image` |
50
+
51
+ ## 决策模型
52
+
53
+ 只做是非、选择、打分并给出概率,用于批量判断与分流。AA 决策指数:Drex Max v1.1、GLiDE v1.2 并列 73 分,Drex Max 成本最低;Jev 1.14、Gemini Decision 1 都是 66 分,Jev 更便宜,Gemini Decision 1 能处理音频和视频;OpenAI、微软的决策模型低于 66 分。
@@ -10,10 +10,10 @@
10
10
  - `workflow.missing` 是启用后才新增、还没有成员的卡片,要用时运行 `<cli> launch workflow-join --card 卡片ID …`(API 主持人请用户在右栏点工作流的“刷新”)。
11
11
  - 离开或被移除的角色不要自行请回或另找人代替,在回答里说明缺谁。
12
12
 
13
- `workflow.sub_workflows` 是主线之外按需使用的子工作流(如检查、试演),各有 SKILL.md 和成员卡片:请求与它的 `description` 相符、用户点名或主线写明此处用它时才用,读法同上。它的角色只在用时加入:开工前 `<cli> launch workflow-join --sub 子工作流ID …`,用完 `<cli> launch workflow-leave --sub 子工作流ID …` 设为离开(会话保留);`workflow.members` 里带 `sub_workflow` 的成员就是它的角色。参数见 `<cli> launch workflow-join --help`。API 主持人没有命令行,请不进这些角色,在回答里说明缺谁。
13
+ `workflow.sub_workflows` 是主线之外按需使用的子工作流(如检查、试演),各有 SKILL.md 和成员卡片:请求与它的 `description` 相符、用户点名(任务的 `named_workflows.sub_workflows` 列出它)或主线写明此处用它时才用,读法同上。它的角色只在用时加入:开工前 `<cli> launch workflow-join --sub 子工作流ID …`,用完 `<cli> launch workflow-leave --sub 子工作流ID …` 设为离开(会话保留);`workflow.members` 里带 `sub_workflow` 的成员就是它的角色。参数见 `<cli> launch workflow-join --help`。API 主持人没有命令行,请不进这些角色,在回答里说明缺谁。
14
14
 
15
15
  ## 保存与启用
16
16
 
17
17
  用户请你把本房间的做法存成工作流(或要你按某种分工新建一套流程),或消息里写了 `$workflow-creator` 时,按 [workflow-creator](../../workflow-creator/SKILL.md) 技能做;是新建还是修改已有工作流,按用户写的内容判断。任务有 `host_workflows: true` 时,房主已允许你自行保存并启用,不必等用户导入。
18
18
 
19
- 用户请你启用工作流库里已有的工作流(如“启用工作流「连载」(`novel-serial`)”)时:任务有 `host_workflows: true` 就运行 `<cli> launch workflow-adopt --id <工作流 ID> …`,程序启用它、邀请缺少的卡片成员,返回 `members` 和 `skill_path`;本次要接着按它做时读 `skill_path`,下一次执行起任务里有 `workflow` 字段。用户只说了启用时,回答说明已启用和带来了谁即可。没有该字段或你是 API 主持人时不能启用,请用户在“成员与设置 → 协作设置”打开“主持人完整权限”。
19
+ 用户请你启用工作流库里已有的工作流(任务的 `named_workflows.workflows` 列出它,或用户用文字说明)时:任务有 `host_workflows: true` 就运行 `<cli> launch workflow-adopt --id <工作流 ID> …`,程序启用它、邀请缺少的卡片成员,返回 `members` 和 `skill_path`;本次要接着按它做时读 `skill_path`,下一次执行起任务里有 `workflow` 字段。用户只说了启用时,回答说明已启用和带来了谁即可。没有该字段或你是 API 主持人时不能启用,请用户在“成员与设置 → 协作设置”打开“主持人完整权限”。
@@ -9,7 +9,7 @@ description: "AI CoDiscuss 的通用参与技能,所有参与者(包括主
9
9
 
10
10
  ## 场景
11
11
 
12
- 房间是所有工作的底座,讨论和 Goal 是在房间里临时开启的模式;任务里的 `mode: "free"` 指房间本身。任务已列出 `skills` 时直接读它们(主持人同样适用)。
12
+ 房间是所有工作的底座,讨论和 Goal 是在房间里临时开启的模式;任务里的 `mode: "free"` 指房间本身。任务已列出 `skills` 时直接读它们(主持人同样适用)。用户点名你时写的 `/名称` 或 `$名称` 是你本机的技能,表示请你调用它。
13
13
 
14
14
  | 场景 | 读 |
15
15
  |---|---|
@@ -22,6 +22,8 @@ EXTERNAL_HEADER = "X-CoDiscuss-External"
22
22
  BRIDGE_HEADER = "X-CoDiscuss-Bridge"
23
23
  EXTERNAL_PREFIX = ["api", "external", "rooms"]
24
24
  SCOPES = ("discuss", "read")
25
+ # How many ended external members the roster still lists.
26
+ MAX_ENDED_SHOWN = 10
25
27
  QUOTA_KEYS = ("hourly_bytes", "total_bytes", "hourly_reads")
26
28
  DEFAULT_QUOTA = {"hourly_bytes": 4 * 1024 * 1024, "total_bytes": 64 * 1024 * 1024, "hourly_reads": 600}
27
29
  MAX_QUOTA = {"hourly_bytes": 1024 ** 3, "total_bytes": 100 * 1024 ** 3, "hourly_reads": 100000}
@@ -121,14 +123,24 @@ def owner_view(connection, row):
121
123
 
122
124
  def room_view_field(connection, member_id):
123
125
  """The `external` field of a member in the room view, or None for a local member; no local paths."""
124
- row = connection.execute("SELECT scope,expires_at,machine_label,platform,model,directories,claimed_at,invite_version FROM external_members WHERE member_id=?",
125
- (member_id,)).fetchone()
126
+ row = connection.execute("""SELECT scope,expires_at,machine_label,platform,model,directories,claimed_at,invite_version,ended_at,end_reason
127
+ FROM external_members WHERE member_id=?""", (member_id,)).fetchone()
126
128
  if not row:
127
129
  return None
128
130
  return {"scope": row["scope"], "expires_at": row["expires_at"], "machine_label": row["machine_label"],
129
131
  "platform": row["platform"], "model": row["model"],
130
132
  "directories": directory_names(json.loads(row["directories"])), "claimed_at": row["claimed_at"],
131
- "invite_version": row["invite_version"]}
133
+ "invite_version": row["invite_version"], "ended_at": row["ended_at"], "end_reason": row["end_reason"]}
134
+
135
+
136
+ def ended_view(connection, room_id):
137
+ """External members that checked in and have since ended (expired, left or revoked), newest first, so the roster
138
+ can still show who was here and why they went; they take no requests."""
139
+ rows = connection.execute("""SELECT m.id,m.name,m.adapter,m.role,m.status,m.access,m.session_mode,m.read_until
140
+ FROM room_members m JOIN external_members x ON x.member_id=m.id
141
+ WHERE m.room_id=? AND m.status='removed' AND x.claimed_at>0 AND x.ended_at>0 ORDER BY x.ended_at DESC LIMIT ?""",
142
+ (room_id, MAX_ENDED_SHOWN)).fetchall()
143
+ return [{**dict(row), "external": room_view_field(connection, row["id"])} for row in rows]
132
144
 
133
145
 
134
146
  def external_row(connection, room_id, member_id):
@@ -311,12 +323,14 @@ def update_external(connection, room_id, member_id, token, payload, now):
311
323
  action = payload.get("action")
312
324
  if action in ("invite", "bind", "activate"):
313
325
  return seat_action(connection, row, payload, now)
326
+ if action == "reopen":
327
+ return reopen_member(connection, row, now)
314
328
  if action == "revoke":
315
329
  if row["status"] == "active":
316
330
  end_member(connection, row, "revoked")
317
331
  return owner_view(connection, external_row(connection, room_id, member_id))
318
332
  if action != "update":
319
- raise ValueError(Text("action 须为 update 或 revoke"))
333
+ raise ValueError(Text("action 须为 update、revoke 或 reopen"))
320
334
  if row["status"] != "active":
321
335
  raise classified(FileExistsError, Text("外部成员已结束,不能再调整;需要时重新邀请"), "external_ended", reason=row["end_reason"])
322
336
  scope = payload.get("scope", row["scope"])
@@ -331,6 +345,25 @@ def update_external(connection, room_id, member_id, token, payload, now):
331
345
  return owner_view(connection, external_row(connection, room_id, member_id))
332
346
 
333
347
 
348
+ def reopen_member(connection, row, now):
349
+ """Turn an ended external member back into a seat awaiting check-in, so a new link brings the same member back: its
350
+ name, label and history in the room stay. The old credential and binding are cleared; a seat already waiting is left."""
351
+ if row["status"] == "active":
352
+ return owner_view(connection, row)
353
+ if not row["ended_at"]:
354
+ raise FileExistsError(Text("外部成员不存在"))
355
+ if connection.execute("SELECT 1 FROM room_members WHERE room_id=? AND name=? AND status<>'removed' AND id<>?",
356
+ (row["room_id"], row["name"], row["id"])).fetchone():
357
+ raise FileExistsError(Text("{name} 已是本房间成员", name=row["name"]))
358
+ if connection.execute("SELECT COUNT(*) FROM room_members WHERE room_id=? AND status<>'removed'", (row["room_id"],)).fetchone()[0] >= MAX_ROOM_AGENTS:
359
+ raise FileExistsError(Text("房间成员已满"))
360
+ connection.execute("UPDATE room_members SET status='active',role='member',token_hash='' WHERE id=?", (row["id"],))
361
+ connection.execute("""UPDATE external_members SET ended_at=0,end_reason='',claimed_at=0,machine='',token_hash='',
362
+ expires_at=?,created_at=?,updated_at=? WHERE member_id=?""", (now + PENDING_SEAT_SECONDS, now, now, row["id"]))
363
+ free_room.sync_participants(connection, row["room_id"])
364
+ return owner_view(connection, external_row(connection, row["room_id"], row["id"]))
365
+
366
+
334
367
  def seat_action(connection, row, payload, now):
335
368
  """Version an invitation or bind and activate its fixed seat under the owner transaction."""
336
369
  if row["status"] != "active":
@@ -1144,7 +1144,8 @@ def free_view(connection, room_id):
1144
1144
  WHERE w.room_id=? AND w.key LIKE 'checkin:%' AND NOT EXISTS (SELECT 1 FROM member_requests d WHERE d.message_id=r.answer_id)
1145
1145
  ORDER BY w.message_id DESC LIMIT ?""", (room_id, RECENT_EXECUTIONS))]
1146
1146
  return {"failure_wakes": failure_wakes, "quiet_checkins": quiet_checkins, "host_checkin": {"minutes": checkin["interval_seconds"] // 60, "due_at": checkin["due_at"]} if checkin else None,
1147
- "members": members, "requests": requests[::-1], "executions": recent_executions(connection, room_id),
1147
+ "members": members, "ended_externals": external_members.ended_view(connection, room_id),
1148
+ "requests": requests[::-1], "executions": recent_executions(connection, room_id),
1148
1149
  "conflicts": possible_conflicts(connection, room_id, names), "halted_chains": chains, "max_rounds": max_rounds,
1149
1150
  "chain_rounds": progress, "recommendations": recent_recommendations(connection, room_id, now)[::-1],
1150
1151
  "queued_messages": queue_view(connection, room_id), "questions": questions.room_questions_view(connection, room_id)}
@@ -1411,8 +1412,9 @@ def check_answer(connection, room_id, member, payload):
1411
1412
  raise PermissionError(Text("执行编号不属于本成员"))
1412
1413
  if row["status"] == "completed":
1413
1414
  # The host dispatched with keep_working and went on in the same turn: its answer belongs to where that turn went.
1414
- row = live_continuation(connection, row) or row
1415
- payload["execution_id"] = row["id"]
1415
+ # A continuation stopped or failed since takes the answer as that one's late answer, which ends its hold.
1416
+ row = continuation_end(connection, row)
1417
+ execution_id = payload["execution_id"] = row["id"]
1416
1418
  revived = revive_failed(connection, room_id, row) if row["status"] == "failed" else None
1417
1419
  if revived:
1418
1420
  row = revived
@@ -1450,12 +1452,15 @@ def check_keep_working(member, payload):
1450
1452
  raise ValueError(Text("keep_working 只能由本机接入的主持人在派活(to)时使用,值为 true,不能与 continue、sequential 或 next_review 同用"))
1451
1453
 
1452
1454
 
1453
- def live_continuation(connection, row):
1454
- """The live execution that a host's `keep_working` moved this answered execution's turn onto, or None."""
1455
- while row and row["status"] == "completed":
1455
+ def continuation_end(connection, row):
1456
+ """The last execution a host's `keep_working` moved this answered execution's turn onto, in whatever state it is now;
1457
+ the row itself when its turn did not move."""
1458
+ while row["status"] == "completed":
1456
1459
  link = connection.execute("SELECT next_id FROM execution_continuations WHERE execution_id=?", (row["id"],)).fetchone()
1457
- row = link and connection.execute("SELECT * FROM member_executions WHERE id=?", (link[0],)).fetchone()
1458
- return row if row and row["status"] in ACTIVE else None
1460
+ if not link:
1461
+ break
1462
+ row = connection.execute("SELECT * FROM member_executions WHERE id=?", (link[0],)).fetchone()
1463
+ return row
1459
1464
 
1460
1465
 
1461
1466
  def keep_working(connection, room_id, host, message_id, chain_id, execution_id):
@@ -3373,12 +3378,15 @@ def late_answer(connection, room_id, execution_id, token):
3373
3378
 
3374
3379
 
3375
3380
  def record_stop_result(connection, room_id, execution_id, result):
3376
- """Record a stop idempotently; an unconfirmed stop may later gain a confirmed outcome."""
3381
+ """Record a stop idempotently; an unconfirmed stop may later gain a confirmed outcome, and an unstoppable one the
3382
+ runner kept following may later be seen to end (`stopped`), in its window or App or on its own."""
3377
3383
  if result not in STOP_RESULTS:
3378
3384
  raise ValueError(Text("result 须为 {value1}", value1='、'.join(STOP_RESULTS)))
3379
3385
  saved = connection.execute("""INSERT INTO execution_capabilities (execution_id,room_id,stop_result) VALUES (?,?,?)
3380
3386
  ON CONFLICT(execution_id) DO UPDATE SET stop_result=excluded.stop_result
3381
- WHERE stop_result IN ('','unconfirmed') AND stop_result<>excluded.stop_result""", (execution_id, room_id, result))
3387
+ WHERE stop_result<>excluded.stop_result
3388
+ AND (stop_result IN ('','unconfirmed') OR (stop_result='unstoppable' AND excluded.stop_result='stopped'))""",
3389
+ (execution_id, room_id, result))
3382
3390
  if saved.rowcount:
3383
3391
  return False
3384
3392
  previous = connection.execute("SELECT stop_result FROM execution_capabilities WHERE execution_id=?", (execution_id,)).fetchone()[0]
package/docs/en/runner.md CHANGED
@@ -92,7 +92,7 @@ Invite an AI on another computer into your room: it reads only the project files
92
92
  1. In the new-room panel or Invite members, click "External expert +" on the External row (once per expert), then on the card's back select what they can see (Room messages / Messages and project) and the membership duration after check-in. "Messages and project" opens all of the room's project folders.
93
93
  2. Choose Add a seat awaiting check-in (automatic when creating the room). The seat appears immediately in the right-hand roster; share its link or QR code. The link lasts 10 minutes and binds one member; regenerating it invalidates the previous link. Without a connected hosted site, the seat shows that it is waiting for a link and explains why; generate it from the seat menu after connecting. Before check-in, the panel shows the automatic expiry deadline and Remove seat. Usage, read logs and access adjustments appear after check-in.
94
94
  3. Redemption completes check-in and starts the membership duration, with **no extra approval step**. Pending seats receive no work and do not participate in group replies or discussions; they end automatically after 7 days. An expired link leaves the seat intact.
95
- 4. `@` it in the room; its answers appear in the conversation as usual. "Read log and access" in the member menu lists every file it read (recorded by your computer) and lets you extend, switch to messages only, or revoke; revoking takes effect immediately.
95
+ 4. `@` it in the room; its answers appear in the conversation as usual. "Read log and access" in the member menu lists every file it read (recorded by your computer) and lets you extend, switch to messages only, or revoke; revoking takes effect immediately. Once a member has ended (expired, left or revoked) it stays dimmed below the roster with the reason; Invite back makes a new link that brings the same member back, keeping its name and history in the room. If the other side still keeps its invited-room record, that record and its settings carry on; if it was deleted, a new one starts.
96
96
  5. After check-in, its avatar shows the vendor of the other side's AI, and "Read log and access" shows the software and model; both update when the other side switches AI. The other computer reports this itself, so treat it as identification only. A custom endpoint shows the external expert icon.
97
97
 
98
98
  **Join (the other computer)**:
@@ -131,15 +131,15 @@ Choose a provider and enter a key under **Smart Scheduling** (智能调度) when
131
131
 
132
132
  ## Workflows (Optional)
133
133
 
134
- A workflow saves one way of working together so other rooms can reuse it: a SKILL.md for the host to read, plus a set of agent cards (each card is one expert preset). Workflows are managed in the **Workflows** list below **Channel tools** in the left sidebar; click one to open it in the middle of the page, with or without a room open. To use one in a room, ask the host to start it (typing `/` in the input box and picking a workflow writes the request for you; see the permission below). The host then organises the work as the SKILL.md says. A workflow only brings a method and members; when no flow is drawn it does not guarantee the order of steps, and the host decides the details. You can @ any member at any time.
134
+ A workflow saves one way of working together so other rooms can reuse it: a SKILL.md for the host to read, plus a set of agent cards (each card is one expert preset). Workflows are managed in the **Workflows** list below **Channel tools** in the left sidebar; click one to open it in the middle of the page, with or without a room open. To use one in a room, ask the host to start it (typing `/` in the input box and picking a workflow writes `/<workflow-id>` for you; see the permission below). The host then organises the work as the SKILL.md says. A workflow only brings a method and members; when no flow is drawn it does not guarantee the order of steps, and the host decides the details. You can @ any member at any time.
135
135
 
136
136
  - **Bundled workflows**: the package ships three. "Serial fiction" (`story-serial`: a screenwriter, a writer, two critics and a recorder take turns episode by episode, with a reader who reads the text on request; it comes with project templates and a state-check script that needs Python's PyYAML). "Decision council" (`decision-council`: a contrarian, an outsider, an alternatives role and an executor each answer on their own, then argue over the real disagreements, and the host sums up a recommendation). "Classic tabletop RPG" (`trpg-classic`: a dungeon master and three AI players, with an optional seat for you; it comes with a rules summary, an original adventure and a dice script that needs Python). None is installed by default. When you run `codiscuss setup` in a terminal, an **Install settings** step follows the tool selection: it opens with an overview, → expands a group, Space ticks the workflows to install, and Enter continues; nothing ticked means nothing installed. You can also add `--workflows` to install all of them (`install` accepts it too, and non-interactive runs only honour this option). An existing workflow with the same name is replaced by the packaged version, and the old copy is first backed up to `backups/workflows/` in the service folder. The choice applies to this run only and is not remembered.
137
137
  - **Saving**: click **+** to the right of the **Workflows** heading in the left sidebar (on a phone, open the sidebar from the top-left corner first) and choose **New**, or import a zip or folder someone shared. Imported content is previewed on the canvas and is written only when you click **Save**. Copying the folder path and deleting are under **…** on each list item. The edit page can import cards from the current room's members, keeping their prompts as written. To have the host draft one, turn on **Full host control** (below).
138
138
  - **Flow canvas**: clicking a workflow shows its canvas in the middle and its SKILL.md on the right; on phones and upright tablets, switch between the two at the top. Each member is an expert card: drag its title bar to move it, click it to flip and edit, × to delete. **Members** at the top left adds cards and **Host** adds a host node; you can also drag from the dot on a card's right side to empty space to add a member already connected. Lines show who hands over to whom: a line back to an earlier card is drawn as a gold dashed loop, and a host node means the work returns to the host. Select a line or a host node to add a short note. Save with the **Save** button or Ctrl+S; undo and redo with Ctrl+Z and Ctrl+Shift+Z. **…** on a list item renames, disables, copies the folder path or deletes; a disabled workflow stays in the library but rooms cannot enable it. The lines only help you read the workflow: the program does not execute them and the host does not see them. The host assigns work by the SKILL.md, so order, parallel steps, hand-backs and rework all belong there.
139
- - **Letting the host build one**: tick **Full host control** when creating a room or under **Members and settings → Collaboration settings**, then tell the host what division of work you want (or "save how this room works as a workflow"). It saves the workflow, enables it in the room, invites its members and starts assigning work; you do not need to import anything or add members. With the switch on, typing `/` and picking a saved workflow writes the request to enable it; add what you want done and send it. Members the host brings in get at most writable project access. Only a host running in a local tool can do this; an API host cannot.
139
+ - **Letting the host build one**: tick **Full host control** when creating a room or under **Members and settings → Collaboration settings**, then tell the host what division of work you want (or "save how this room works as a workflow"). It saves the workflow, enables it in the room, invites its members and starts assigning work; you do not need to import anything or add members. With the switch on, typing `/` and picking a saved workflow writes `/<workflow-id>`, which asks the host to enable it; add what you want done and send it. Members the host brings in get at most writable project access. Only a host running in a local tool can do this; an API host cannot.
140
140
  - **What else Full host control covers**: the host handles problems in the room and keeps the work moving on its own: it interjects when a member drifts, interrupts or retries a stuck member (including its own failed run), switches models, and replaces members that cannot recover. You can also just say "stop the writer", "stop everything", "let the critic speak next", "invite a read-only Codex reviewer", "start a Goal to finish the remaining episodes" or "pause the discussion". It only invites tools configured on this computer, read-only by default and writable at most. When a member produces no new output for 10 minutes, the system reminds the host to check; the host can also set itself a recurring check every 5–120 minutes during long tasks. These stay with you: other actions on the host itself (interrupting it, changing its project access, setting it away, removing it) or replacing the host, approving rounds beyond the limit, access above writable or allowing tools, changing the project folder, withdrawing your messages, and private chats.
141
141
  - **Sharing**: workflows live in the `workflows` folder of the local service folder, one folder per workflow. Copy the path from the edit page and send the whole folder (or a zip of it). An import lists each card's prompt and project access; cards that ask to write files are imported as read-only until you tick them one by one.
142
- - **Sub-workflows**: a method used only when needed, outside the main line, can be a sub-workflow with its own SKILL.md, cards and canvas, stored under `workflows/<sub-workflow ID>/` inside the workflow folder. Switch, create or delete them in the **Main workflow and sub-workflows** list at the top left of the canvas; they are saved together with the main workflow. While a workflow is running, typing `/` also lists its sub-workflows, and the host may use them on its own. The host invites the members a sub-workflow needs and sets them away afterwards; their sessions are kept for next time. The whole folder is still a standard skill, so other AI tools can read it as one.
142
+ - **Sub-workflows**: a method used only when needed, outside the main line, can be a sub-workflow with its own SKILL.md, cards and canvas, stored under `workflows/<sub-workflow ID>/` inside the workflow folder. Switch, create or delete them in the **Main workflow and sub-workflows** list at the top left of the canvas; they are saved together with the main workflow. While a workflow is running, typing `/` also lists its sub-workflows (picking one writes `/<sub-workflow-id>` for the host), and the host may use them on its own. The host invites the members a sub-workflow needs and sets them away afterwards; their sessions are kept for next time. The whole folder is still a standard skill, so other AI tools can read it as one.
143
143
  - **Commands for API members**: read-only API members have no command line (writable ones use Pi's own). Put a `commands.json` in the workflow folder (see the `workflow-creator` skill) to register commands they may run, such as a check script kept in the same folder. Once enabled, API members can only run these commands by name and cannot change the command line; read-only members can only run commands marked read-only. Commands run on this computer as you, so when you import someone else's workflow the edit page lists every full command and brings them along only if you tick **Allow these commands to run on this computer**. The host cannot add or remove commands when drafting or changing a workflow.
144
144
  - **Changing and ending**: changes to a workflow apply to every room that has it enabled, from each member's next run. New cards do not enter a room automatically; the host adds them when needed, or click the refresh icon on the workflow row in the right column. Card prompts are read-only in the room and are edited on the workflow's canvas. While a workflow is running, the host uses it only for requests that match its purpose (or when you say to follow the workflow) and handles other requests as usual. To end it, click the dismiss-members icon on the workflow row under **Members and settings → Collaboration settings**: the members it brought leave (the host stays), their work in progress stops and the workflow ends. Their sessions are kept, so picking the workflow again with `/` brings the same members back with their earlier context. To switch workflows, just pick another one; the previous members stay as ordinary members.
145
145
 
@@ -92,7 +92,7 @@ From the member panel you can:
92
92
 
93
93
  - **Invite** members. A member card offers three ways to start:
94
94
  - **Automatic start**: this computer starts a new, empty session.
95
- - **History** (Claude Code, Codex, Antigravity CLI): opens a window listing that software's past sessions by time, like `claude -r` or Codex's `/resume`. Search it, show this project's sessions or all of them, and preview the latest messages of the selected one. The program then resumes the picked session in the background, so it joins with the context it already has. While it is working, do not keep using it in its original window. An Antigravity CLI session keeps its own project and agy permissions; the room's project access does not apply to it.
95
+ - **History** (Claude Code, Codex, Antigravity CLI): opens a window listing that software's past sessions by time, like `claude -r` or Codex's `/resume`. Search it, show this project's sessions or all of them, and preview the latest messages of the selected one. On its first wake-up the program copies the picked session into a new one and resumes that copy in the background, so the member joins with the context it already has. The original stays unchanged, even with its window still open, but opening it later in the original software (for example with `claude -r`) will not show the room's turns. Through the Codex App nothing is copied: tasks go straight into that session in the App. An Antigravity CLI session keeps its own project and agy permissions; the room's project access does not apply to it.
96
96
  - **Manual start**: run the start instruction in a conversation you already have open; room tasks are then delivered into that window where possible.
97
97
 
98
98
  Experts invited during a discussion join the end of the current round.
package/docs/runner.md CHANGED
@@ -123,7 +123,7 @@ codiscuss local connect https://你的站点
123
123
  1. 建房面板或右栏“邀请成员”里点“外部”一行的“外部专家 +”(可加多位),翻到卡片背面设置“对方能看到”(房间消息 / 消息和项目)和签到后的有效期。选“消息和项目”时开放本房间的全部项目目录。
124
124
  2. 点“添加待签到席位”(建房时自动添加),右栏名单立即显示待签到成员;把席位的链接或二维码发给对方。链接 10 分钟有效,只能绑定一位成员;重新生成会立即作废旧链接。未绑定线上站点时显示“待生成链接”及原因,绑定站点后从席位菜单生成。待签到面板显示自动结束期限,可“移除席位”;签到后才显示用量、读取记录和授权调整。
125
125
  3. 对方兑换即完成签到,成员有效期从兑换时开始,**没有额外批准步骤**。未签到不收任务、不参与全体回应或讨论,7 天后自动结束;链接过期不会删除席位。
126
- 4. 在房间里 `@` 它,回答照常出现在对话中。成员菜单的“读取记录与权限”列出它读过的每个文件(由你的电脑记录),可延长、改为只看消息或撤销授权,撤销立即生效。
126
+ 4. 在房间里 `@` 它,回答照常出现在对话中。成员菜单的“读取记录与权限”列出它读过的每个文件(由你的电脑记录),可延长、改为只看消息或撤销授权,撤销立即生效。成员结束后(到期、对方退出或撤销)仍灰显在名单下方并写明原因,点“重新邀请”可生成新链接把原成员请回:名字和房间里的历史不变;对方若还保留那条被邀请记录,记录与设置也接着用,删了则新建。
127
127
  5. 签到后头像显示对方 AI 的厂家,“读取记录与权限”里可看到软件和模型;对方换 AI 后自动更新。这些信息由对方电脑自报,仅供辨认。自定义接口显示外部专家图标。
128
128
 
129
129
  **加入(对方电脑)**:
@@ -168,15 +168,15 @@ API 成员可以担任专家或主持人。房间指定了项目目录时,只
168
168
 
169
169
  ## 工作流(可选)
170
170
 
171
- 工作流把一种多人协作的做法存下来,供别的房间复用:一份给主持人读的 SKILL.md,加一组 Agent 卡片(每张就是一个专家预设)。工作流在左侧栏“频道工具”下方的“工作流”列表里管理,点一项就在中间打开它(没打开房间时也能用):查看 SKILL.md、成员卡片和示意图,新建、导入、编辑、删除都在这里。要在房间里用时,在输入框要求主持人启动(打 `/` 选工作流可以直接写好这句请求,权限见下文);主持人此后按说明组织工作。它只带来做法和成员;没画流程时不保证工序,具体怎么做由主持人判断。你随时可以 @ 任何成员。
171
+ 工作流把一种多人协作的做法存下来,供别的房间复用:一份给主持人读的 SKILL.md,加一组 Agent 卡片(每张就是一个专家预设)。工作流在左侧栏“频道工具”下方的“工作流”列表里管理,点一项就在中间打开它(没打开房间时也能用):查看 SKILL.md、成员卡片和示意图,新建、导入、编辑、删除都在这里。要在房间里用时,在输入框要求主持人启动(打 `/` 选工作流会写好 `/工作流ID`,权限见下文);主持人此后按说明组织工作。它只带来做法和成员;没画流程时不保证工序,具体怎么做由主持人判断。你随时可以 @ 任何成员。
172
172
 
173
173
  - **内置工作流**:安装包自带三套。“小说剧本连载”(`story-serial`:编剧、写手、两位批评家与记录员逐集接力,另有一位读者按需读正文,附项目模板与状态检查脚本,脚本需要 Python 的 PyYAML);“决策会审”(`decision-council`:反方、局外人、另辟选项、执行者四个角色先各自独立作答,再围绕分歧交锋,由主持人综合出建议);“经典跑团”(`trpg-classic`:一位地下城主加三位 AI 玩家,用户可选亲自上场,附规则速查、一个原创冒险和掷骰脚本,脚本需要 Python)。默认不安装。在终端里运行 `codiscuss setup` 时,选完软件后有一步“安装配置”:先显示概览,按 → 展开,用空格勾选要装的工作流,回车继续;不勾就不装。也可以直接加 `--workflows` 安装全部(`install` 同样适用,非交互运行只认这个选项)。装的时候,已有同名的会覆盖为包里的最新版,原来那份先备份到服务目录的 `backups/workflows/`。选择只对这一次有效,不会记住,不选就不动工作流库。
174
174
  - **保存**:点左侧栏“工作流”标题右侧的“+”(手机上先点左上角打开侧栏),选“新建”,或导入别人分享的 zip 或文件夹(手机、平板上同样可用)。导入的内容先放上画布预览,点“保存”才写入。复制文件夹路径和删除工作流在列表项的“…”里。编辑页可以“从当前房间成员导入”卡片,提示词保持原文。想让主持人起草,打开下面的“主持人完整权限”。
175
175
  - **流程画布**:在左侧栏“工作流”列表里点一项,中间换成它的画布,右边是它的 SKILL.md;点任一房间或频道工具回到房间。手机和竖着拿的平板上,顶部在“画布”和“工作流”(即 SKILL.md)之间切换。每位成员就是一张专家卡片,拖卡片上方的标题栏移动,点卡片翻面设置,× 删除。左上“成员”添加卡片(平台、预设,或当前房间的成员),“主持人”添加主持人节点;也可以从卡片右侧的圆点拖线到空白处,就地选要加的成员并自动连上。名称在页面顶部标题处直接改,左上按钮组最后的“保存”或 Ctrl+S 保存,右上角是放大、缩小和适配;列表里每项右边的“…”可以重命名、停用、复制文件夹路径或删除(停用的工作流留在库里,但房间里不能再启用,已启用它的房间改用房间里的设置,随时可以再启用);左上有撤销、重做(Ctrl+Z、Ctrl+Shift+Z),双击空白处或鼠标中键双击复位视图。连线用来示意谁接谁:从「开始」右侧的圆点拖线连到卡片,连回前面的卡片画成金色虚线表示循环,主持人节点表示交回主持人判断。选中一条连线或一个主持人节点,可以写一句说明,如“同时审”“返工”“不等交回”“验收”。同一角色出场两次时,在“成员”菜单底部“已有成员再放一次”里点它。打开时按看得清卡片的大小从“开始”那端显示,双击空白处看全图。用 `workflow-creator` 新建或修改工作流时,AI 会照 SKILL.md 一起画好这张图。连线只帮你看懂工作流,程序不执行它,主持人也看不到;主持人派活按的是 SKILL.md(就在画布右侧,默认显示排好版的内容,点“编辑”修改;面板可以拖宽或收起),顺序、同时做、什么时候交回、要不要返工都写在那里。
176
- - **让主持人自己建**:建房时(第 3 节“协作方式”)或在“成员与设置 → 协作设置”勾选“主持人完整权限”后,直接对主持人说要什么分工(或“把这个房间的做法存成工作流”),它会自己保存、在本房间启用,并邀请工作流里的成员,接着就按流程派活,不需要你导入或添加成员。之后让它改流程,改动从成员下一次执行起生效。打开这个开关后,也可以在输入框输入 `/` 选一个已保存的工作流,输入框里会写好“启用工作流「名称」(ID),”,补上要做的事发给主持人,它就启用这个工作流并带来成员(没打开时该项灰显)。主持人带来的成员项目权限最高为可写;只有本地软件担任的主持人能这样做,API 主持人不行。
176
+ - **让主持人自己建**:建房时(第 3 节“协作方式”)或在“成员与设置 → 协作设置”勾选“主持人完整权限”后,直接对主持人说要什么分工(或“把这个房间的做法存成工作流”),它会自己保存、在本房间启用,并邀请工作流里的成员,接着就按流程派活,不需要你导入或添加成员。之后让它改流程,改动从成员下一次执行起生效。打开这个开关后,也可以在输入框输入 `/` 选一个已保存的工作流,输入框里会写好 `/工作流ID`,补上要做的事发给主持人,它就启用这个工作流并带来成员(没打开时该项灰显)。主持人带来的成员项目权限最高为可写;只有本地软件担任的主持人能这样做,API 主持人不行。
177
177
  - **主持人完整权限的其他控制**:同一个开关打开后,主持人会自己处理房间里的问题、持续推进:成员跑偏时插话、卡住时打断或重试(它自己的执行失败时程序会提醒它一次,它可以重试自己、补交结果,或给自己换模型)、模型不可用时换模型、无法恢复时换人;你也可以直接说“停下写手”“全部停下”“下一个让批评家先说”“请一位 Codex 进来只读评审”“把记录员请出去”“开个 Goal 把剩下几集写完”“暂停讨论”。邀请只用本机已配置的软件,项目权限默认只读、最高可写,邀请暂离中的成员会把它按原名请回;它自己开的 Goal 用你的默认预算(不限时为 8 次续跑、90 分钟)。成员连续 10 分钟没有新输出时,系统会提醒主持人检查;主持人派出长任务时还可以给自己设定时检查(每 5–120 分钟一次;房间空闲时再提醒它最后一次,确认做完了还是还有下一步,之后结束)。它也能撤回自己派出的活,正在循环的接力会立即停下。以下仍由你决定:对主持人自己的其他操作(打断、改项目权限、暂离、移除)或更换主持人、批准超出上限的轮数、高于可写的权限或放行工具、改项目目录、撤回你的消息、私聊。API 主持人没有命令行,不能这样做。
178
178
  - **分享**:工作流存在本机服务目录的 `workflows` 文件夹,一个工作流一个文件夹;编辑页可复制路径,把整个文件夹(或打成 zip)发给对方即可分享。导入时会列出每张卡片的提示词和项目权限;要求写文件的卡片默认按只读导入,逐张勾选后才放开。
179
- - **子工作流**:主线之外按需用的一套做法(比如检查成稿的 AI 率、请几位专家代入主角试演一场戏)可以做成子工作流:它有自己的 SKILL.md、成员卡片和画布,放在工作流文件夹的 `workflows/<子工作流ID>/` 下。在工作流页画布左上角工具条下方的“主线与子工作流”列表里切换、新建或删除,切过去后画布和右侧(手机上为“子工作流”页签)显示它自己的内容,和主线一起保存;手机上这个列表默认收起,显示当前在看哪一个。工作流进行中,在输入框打 `/` 会多出“工作流「名称」的子工作流”一组,选一项就写好请求交给主持人;主持人也会在合适的时候自己用。用到它的成员时,主持人把这些成员请进来,用完设为离开,会话保留,下次接着用。整个工作流文件夹仍是标准的技能格式,拷到别的 AI 软件里也能当技能读。
179
+ - **子工作流**:主线之外按需用的一套做法(比如检查成稿的 AI 率、请几位专家代入主角试演一场戏)可以做成子工作流:它有自己的 SKILL.md、成员卡片和画布,放在工作流文件夹的 `workflows/<子工作流ID>/` 下。在工作流页画布左上角工具条下方的“主线与子工作流”列表里切换、新建或删除,切过去后画布和右侧(手机上为“子工作流”页签)显示它自己的内容,和主线一起保存;手机上这个列表默认收起,显示当前在看哪一个。工作流进行中,在输入框打 `/` 会多出“工作流「名称」的子工作流”一组,选一项就写好 `/子工作流ID`,发给主持人即按它做;主持人也会在合适的时候自己用。用到它的成员时,主持人把这些成员请进来,用完设为离开,会话保留,下次接着用。整个工作流文件夹仍是标准的技能格式,拷到别的 AI 软件里也能当技能读。
180
180
  - **给 API 成员登记命令**:只读的 API 成员没有命令行(可写的直接用 Pi 自带的命令行,不需要登记)。工作流文件夹里放一个 `commands.json`(写法见 `workflow-creator` 技能),登记它们能运行的命令(例如检查脚本,脚本也放在工作流文件夹里),随工作流一起分享;启用后 API 成员只能按名字运行这些命令,改不了命令行,只读成员只能运行标为只读的命令。命令以你的身份在本机运行,所以导入别人的工作流时,编辑页会列出每条完整命令,勾选“允许这些命令在本机运行”才会带上;主持人起草或修改工作流时不能增删命令。
181
181
  - **修改与结束**:修改工作流会作用于所有启用它的房间,成员下一次执行就按新内容;新增的卡片不会自动进入房间,主持人用到时会自己补上,也可以在右栏工作流一行点刷新图标立即补齐(删掉的卡片,其成员留作普通成员;与库一致时不显示该图标);工作流卡片的提示词只读,在工作流页的画布上修改。工作流进行中时,主持人只在请求和它的用途相符(或你说按工作流做)时才用,其他请求照常处理。用完在“成员与设置 → 协作设置”的工作流一行点请离成员图标(或逐个让成员离开):工作流带来的成员离开(主持人保留),正在进行的工作随之停止,工作流结束,右栏这一块消失;成员会话保留,下次在输入框打 `/` 选它就把原成员请回来,接着原来的上下文。换工作流时直接选另一个,原来的成员留作普通成员。
182
182
 
package/docs/workflow.md CHANGED
@@ -94,7 +94,7 @@ Goal 不扩大权限:主持人仍受成员项目权限和连续派活轮数限
94
94
 
95
95
  - **邀请**成员。成员卡上有三种启动方式:
96
96
  - **程序启动**:由本机新建一个空白会话。
97
- - **历史会话**(Claude Code、Codex、Antigravity CLI):弹出该软件的历史会话窗口,像 `claude -r`、Codex 的 `/resume` 那样按时间列出会话,可搜索、只看本项目或全部,右侧预览选中会话最近的对话;选定后由程序在后台续接这个会话,它带着已有上下文加入。它工作时不要在原窗口继续操作。Antigravity CLI 的会话沿用它原来的项目与 agy 权限,房间的项目权限对它不生效。
97
+ - **历史会话**(Claude Code、Codex、Antigravity CLI):弹出该软件的历史会话窗口,像 `claude -r`、Codex 的 `/resume` 那样按时间列出会话,可搜索、只看本项目或全部,右侧预览选中会话最近的对话;选定后,程序在第一次唤醒时把它复制成一个新会话并在后台续接,成员带着已有上下文加入。原会话保持不变,原窗口开着也不受影响;但之后在原软件里打开原会话(如 `claude -r`),看不到房间里的记录。经 Codex App 接入时不复制,任务直接送进 App 里的这个会话。Antigravity CLI 的会话沿用它原来的项目与 agy 权限,房间的项目权限对它不生效。
98
98
  - **手动启动**:在你已打开的对话里执行启动指令注册,之后房间的任务会尽量送进那个窗口。
99
99
 
100
100
  讨论中新邀请的专家排在本轮队尾。
@@ -97,6 +97,7 @@
97
97
  "{value1} 已请回,续接原会话。": "{value1} brought back, resuming the original session.",
98
98
  "发言顺序刚有变化,已更新为最新顺序,请重新调整": "The speaking order changed and has been refreshed; please reorder again",
99
99
  "{value1} 已接入原会话;它工作时请不要在原窗口继续操作。": "{value1} connected to the original session. Avoid using its original window while it works.",
100
+ "{value1} 已加入,在原会话的分叉上工作;原会话里看不到房间里的后续记录。": "{value1} joined and works in a fork of the original session; the original will not show what happens in the room.",
100
101
  "{value1} 已加入,之后点名它即会由本机服务唤醒。": "{value1} joined. Mention it to have the local service wake it.",
101
102
  "留言已保存 · #{value1}": "Message saved · #{value1}",
102
103
  "留言已保存,但页面刷新失败:{value1}": "Message saved, but page refresh failed: {value1}",
@@ -213,6 +214,7 @@
213
214
  "续接你已有的 App 会话:任务直接送进 App 里的这个会话,可在其中查看": "Resume your existing App session. Tasks go directly to that session and can be viewed there.",
214
215
  "续接你自己的会话:原窗口开着时任务直接送进该窗口;窗口关闭时改在后台续接,期间不要重新打开该会话": "Resume your own session. Tasks go to the original window while it is open, or resume in the background when closed. Avoid reopening it during background work.",
215
216
  "续接你已有的会话;它工作时请不要在原窗口继续操作": "Resume your existing session. Avoid using its original window while it works.",
217
+ "从你已有的会话分叉而来;原会话里看不到房间里的后续记录": "Forked from your existing session; the original will not show what happens in the room.",
216
218
  "手动启动": "Manual start",
217
219
  "来自 Codex CLI 模型列表": "From the Codex CLI model list",
218
220
  "来自 Claude CLI 模型列表": "From the Claude CLI model list",
@@ -307,7 +309,7 @@
307
309
  "已作废": "Invalidated",
308
310
  "正在停止": "Stopping",
309
311
  "正在停止 {value1}": "Stopping {value1}",
310
- "{value1} 在自己的窗口或 App 里本机无法停止,可能仍在生成,之后的回答会被拒收": "{value1} cannot be stopped locally in their own window or App and may still be generating. Later answers will be rejected.",
312
+ "{value1} 在自己的窗口或 App 里,本机停不了,仍会继续生成;要立即中断,请到它的窗口或 App 里手动停止": "{value1} runs in its own window or App and cannot be stopped from here; it keeps generating. To interrupt it now, stop it by hand in that window or App.",
311
313
  "{value1} 的本次工作已作废": "{value1}'s current work was invalidated",
312
314
  "已撤回;{value1}": "Withdrawn. {value1}",
313
315
  ";{value1} 的会话未回退,仍记得这条消息": ". The sessions of {value1} were not rolled back and still remember this message",
@@ -779,7 +779,7 @@
779
779
  "answers 的 selected 须为选项列表": "selected in answers must be a list of options",
780
780
  "第 {item} 题不接受自由回答": "Question {item} does not take a free answer",
781
781
  "第 {item} 题是单选:选一个选项,或填写自由回答": "Question {item} takes one choice: choose an option or write a free answer",
782
- "action 须为 update 或 revoke": "action must be update or revoke",
782
+ "action 须为 update、revoke 或 reopen": "action must be update, revoke or reopen",
783
783
  "bytes 须为 0–{limit} 的整数": "bytes must be an integer from 0 to {limit}",
784
784
  "client_id 已被使用": "This client_id is already in use",
785
785
  "directories 须为最多 {count} 个目录,每个不超过 {length} 字": "directories must list at most {count} directories of up to {length} characters each",
@@ -35,7 +35,7 @@
35
35
  "引用文件:{value1}": "File references: {value1}",
36
36
  "{value1} 之后仍交来了回答,未采纳:不进入记录,其他 AI 读不到。": "{value1} later submitted a reply, which was not accepted. It is excluded from the record and hidden from other AI members.",
37
37
  "本机尚未确认进程结束,可能仍在生成;网站不再接受本次回答。": "The computer has not confirmed the process stopped; it may still be generating. Replies from this run are no longer accepted.",
38
- "{value1} 在自己的窗口或 App 里,本机无法停止,可能仍在生成;网站不再接受本次回答。": "{value1} is in its own window or app and cannot be stopped locally. It may still be generating; replies from this run are no longer accepted.",
38
+ "{value1} 在自己的窗口或 App 里,本机停不了,可能仍在生成;要立即中断,请到它的窗口或 App 里手动停止。": "{value1} runs in its own window or App and cannot be stopped from here; it may still be generating. To interrupt it now, stop it by hand in that window or App.",
39
39
  "正在停止": "Stopping",
40
40
  "等待本机服务结束进程。": "Waiting for the local service to stop the process.",
41
41
  "待投递": "Waiting to deliver",
@@ -1,6 +1,13 @@
1
1
  {
2
2
  "对方未同意": "Not accepted by the other side",
3
3
  "被邀请的房间": "Invited rooms",
4
+ "已离开的外部专家": "External experts who left",
5
+ "重新邀请": "Invite back",
6
+ "重新邀请 {name}": "Invite {name} back",
7
+ "这位外部成员已结束。": "This external member has ended.",
8
+ "对方已退出": "They left",
9
+ "已撤销": "Revoked",
10
+ "已离开:{reason}": "Left: {reason}",
4
11
  "房间消息": "Room messages",
5
12
  "只看点名给它的消息": "Sees only the messages naming it",
6
13
  "消息和项目": "Messages and project",
@@ -177,7 +184,6 @@
177
184
  "链接可能被截断或改动过。请让对方重新复制完整链接发给你。": "The link may have been cut off or changed. Ask them to copy the complete link and send it again.",
178
185
  "对方电脑上的 AI,只读本房间开放的内容": "An AI on their computer; reads only what this room opens",
179
186
  "用量": "Usage",
180
- "这位外部成员已结束,不能再调整;需要时重新邀请。": "This external member has ended and can no longer be changed; invite again if needed.",
181
187
  "正在读取读取记录": "Loading the read log",
182
188
  "对方电脑在时限内没有确认唤醒": "Their computer did not confirm the run in time",
183
189
  "对方电脑拒绝了这次唤醒": "Their computer declined this run",
@@ -739,6 +739,7 @@
739
739
  "会话": "Session",
740
740
  "为 {name} 选择历史会话": "Pick a past session for {name}",
741
741
  "选中的会话由程序在后台续接,带着它已有的上下文加入房间;它工作时请不要在原窗口继续操作。": "The program resumes the picked session in the background, so it joins the room with the context it already has. While it is working, do not keep using it in its original window.",
742
+ "将从选中的会话分叉出新会话加入房间,保留已有上下文;原会话不变,在原软件里打开它看不到房间里的后续记录。": "A new session forked from the picked one joins the room with its existing context. The original is unchanged; opening it in the original software will not show what happens in the room.",
742
743
  "搜索标题、目录或会话 ID": "Search by title, folder or session ID",
743
744
  "搜索历史会话": "Search past sessions",
744
745
  "会话范围": "Session scope",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai_co_discuss",
3
- "version": "0.4.85",
3
+ "version": "0.4.86",
4
4
  "bin": {
5
5
  "codiscuss": "runner/codiscuss.mjs"
6
6
  },
@@ -8,7 +8,7 @@
8
8
  "dev": "npm run build && wrangler pages dev --ip 127.0.0.1 --port 8787",
9
9
  "db:local": "wrangler d1 execute DB --local --file backend/schema.sql",
10
10
  "db:remote": "wrangler d1 execute DB --remote --file backend/schema.sql",
11
- "check": "node --check backend/worker.mjs && node --check web/app.js && node --check runner/account_space.mjs && node --check runner/admin_account.mjs && node --check runner/admin_panel.mjs && node --check runner/admin_cli.mjs && node --check runner/os_users.mjs && node --check runner/tray.mjs && node --check runner/launcher.mjs && node --check runner/codiscuss.mjs && node --check runner/discussion_api.mjs && node --check runner/discussion_launch.mjs && node --check runner/discussion_local.mjs && node --check runner/discussion_runner.mjs && node --check runner/discussion_service.mjs && node --check runner/discussion_setup.mjs && node --check runner/discussion_sidecar.mjs && node --check runner/discussion_skills.mjs && node --check runner/discussion_tui.mjs && node --check runner/execution_progress.mjs && node --check runner/expert_prompts.mjs && node --check runner/files.mjs && node --check runner/free_runner.mjs && node --check runner/remote_launch.mjs && node --check runner/external_client.mjs && node --check runner/external_gateway.mjs && node --check runner/repo_read.mjs && node --check runner/remote_policy.mjs && node --check runner/device_auth.mjs && node --check runner/webauthn.mjs && node --check runner/scheduler.mjs && node --check runner/session_driver.mjs && node --check runner/workflows.mjs && node --check runner/workflow_flow.mjs && node --check runner/weixin.mjs && node --check runner/adapters/antigravity_app.mjs && node --check runner/adapters/antigravity_cli.mjs && node --check runner/adapters/antigravity_sidecar.mjs && node --check runner/adapters/api.mjs && node --check runner/adapters/claude.mjs && node --check runner/adapters/cli.mjs && node --check runner/adapters/codex_app.mjs && node --check runner/adapters/codex_app_client.mjs && node --check runner/adapters/codex_cli.mjs && node --check runner/adapters/common.mjs && node --check runner/adapters/index.mjs && node --check runner/adapters/profiles.mjs",
11
+ "check": "node --check backend/worker.mjs && node --check web/app.js && node --check runner/account_space.mjs && node --check runner/admin_account.mjs && node --check runner/admin_panel.mjs && node --check runner/admin_cli.mjs && node --check runner/os_users.mjs && node --check runner/tray.mjs && node --check runner/launcher.mjs && node --check runner/codiscuss.mjs && node --check runner/discussion_api.mjs && node --check runner/discussion_launch.mjs && node --check runner/discussion_local.mjs && node --check runner/discussion_runner.mjs && node --check runner/discussion_service.mjs && node --check runner/discussion_setup.mjs && node --check runner/discussion_sidecar.mjs && node --check runner/discussion_skills.mjs && node --check runner/discussion_tui.mjs && node --check runner/execution_progress.mjs && node --check runner/expert_prompts.mjs && node --check runner/files.mjs && node --check runner/free_runner.mjs && node --check runner/remote_launch.mjs && node --check runner/external_client.mjs && node --check runner/external_gateway.mjs && node --check runner/repo_read.mjs && node --check runner/remote_policy.mjs && node --check runner/device_auth.mjs && node --check runner/webauthn.mjs && node --check runner/scheduler.mjs && node --check runner/session_driver.mjs && node --check runner/workflows.mjs && node --check runner/workflow_flow.mjs && node --check runner/slash_names.mjs && node --check runner/weixin.mjs && node --check runner/adapters/antigravity_app.mjs && node --check runner/adapters/antigravity_cli.mjs && node --check runner/adapters/antigravity_sidecar.mjs && node --check runner/adapters/api.mjs && node --check runner/adapters/claude.mjs && node --check runner/adapters/cli.mjs && node --check runner/adapters/codex_app.mjs && node --check runner/adapters/codex_app_client.mjs && node --check runner/adapters/codex_cli.mjs && node --check runner/adapters/common.mjs && node --check runner/adapters/index.mjs && node --check runner/adapters/profiles.mjs",
12
12
  "runner": "node runner/discussion_runner.mjs",
13
13
  "service": "node runner/discussion_service.mjs",
14
14
  "build:ui": "vite build --config frontend/vite.config.mjs --mode i18n && vite build --config frontend/vite.config.mjs --mode markdown &&vite build --config frontend/vite.config.mjs --mode backup && vite build --config frontend/vite.config.mjs --mode office && vite build --config frontend/vite.config.mjs --mode video && vite build --config frontend/vite.config.mjs --mode admin && vite build --config frontend/vite.config.mjs",
@@ -49,10 +49,49 @@ function queue_request(config, request) {
49
49
 
50
50
  /** Queue one immutable request for the official App-managed Sidecar. */
51
51
  async function deliver(config, binding, task) {
52
- ready_sidecar(config, binding, task);
52
+ const ready = ready_sidecar(config, binding, task);
53
+ const server = language_server(ready);
54
+ // Steps already in the conversation belong to earlier turns; an unreadable one is simply not watched.
55
+ let start = server ? 0 : null;
56
+ if (server && binding.session_id) start = await read_conversation(server, binding.session_id).then(item => item.steps.length, () => null);
53
57
  queue_request(config, { id: task.id, event_id: Number(task.id.replace(/^free-/, '')), prompt: task.prompt,
54
58
  session_id: binding.session_id || '', access_path: task.access_path });
55
- return { session_id: binding.session_id || '', status: 'sidecar_pending', capabilities: IN_APP };
59
+ if (start === null) return { session_id: binding.session_id || '', status: 'sidecar_pending', capabilities: IN_APP };
60
+ watch_room_turn(config, server, { session_id: binding.session_id || '', start }, task).catch(() => {});
61
+ return { session_id: binding.session_id || '', status: 'sidecar_pending', capabilities: { ...IN_APP, ends: true } };
62
+ }
63
+
64
+ /** The App's language server the Sidecar handed over, or null (an older Sidecar, or an App that no longer passes it). */
65
+ function language_server(ready) {
66
+ return ready.language_server?.address && ready.language_server?.csrf_token ? ready.language_server : null;
67
+ }
68
+
69
+ // A room turn runs in the App and is not stopped from here; it is only watched for its end, so a stop the owner makes in
70
+ // the App lets the room deliver again at once. Tests shorten these.
71
+ export const ROOM_TIMING = { poll_ms: 2000, wait_ms: 2 * 60 * 60 * 1000, read_failures: 10 };
72
+
73
+ /**
74
+ * Wait for the Sidecar's receipt (a new conversation's id), then read the conversation until it goes idle with new steps
75
+ * and nothing pending, and report `on_turn_end`. Gives up quietly on a refused delivery, an unreadable App or the
76
+ * ceiling; the room then falls back to the site's hold.
77
+ */
78
+ export async function watch_room_turn(config, server, { session_id, start }, task) {
79
+ const finished = new Map(), until = Date.now() + ROOM_TIMING.wait_ms;
80
+ let failures = 0;
81
+ while (Date.now() < until) {
82
+ await sleep(ROOM_TIMING.poll_ms);
83
+ if (!session_id) {
84
+ const result = receipt(config, task.id);
85
+ if (result && result.status !== 'accepted') return;
86
+ session_id = result?.session_id || '';
87
+ if (!session_id) continue;
88
+ }
89
+ let conversation;
90
+ try { conversation = await read_conversation(server, session_id); failures = 0; }
91
+ catch { if (++failures >= ROOM_TIMING.read_failures) return; continue; }
92
+ const steps = conversation.steps.slice(start);
93
+ if (steps.length && conversation.idle && !turn_pending(steps, finished)) return task.on_turn_end?.();
94
+ }
56
95
  }
57
96
 
58
97
  /** Queue a chat message and wait for the Sidecar to pass it to the App; the conversation ID it went into. */
@@ -190,7 +229,7 @@ async function stop_turn(server, session_id) {
190
229
  */
191
230
  async function chat(config, binding, task) {
192
231
  const ready = ready_sidecar(config, binding, task);
193
- const server = ready.language_server?.address && ready.language_server?.csrf_token ? ready.language_server : null;
232
+ const server = language_server(ready);
194
233
  let start = 0;
195
234
  if (server && binding.session_id) {
196
235
  let conversation;
@@ -110,7 +110,7 @@ function skill_file(path) {
110
110
  return value.startsWith("'") && value.endsWith("'") ? value.slice(1, -1).replaceAll("''", "'") : value;
111
111
  };
112
112
  const id = field('name'), description = field('description');
113
- return id && description ? { id, label: id, description, prompt: `请调用技能「${id}」:` } : null;
113
+ return id && description ? { id, label: id, description, prompt: `/${id} ` } : null;
114
114
  } catch { return null; }
115
115
  finally { if (descriptor !== undefined) closeSync(descriptor); }
116
116
  }
@@ -605,7 +605,7 @@ ${project_text(context.project, context.commands, context.image_input, context.n
605
605
  // Nor can an API host open the host's occasional pages: a room host gets them all, a discussion host its own three
606
606
  // (opening, roster, closing) and the two its page links to.
607
607
  ...(host && discussion ? ['host-opening.md', 'host-roster.md', 'host-closing.md'].map(file => skill_text('discuss-session', `references/${file}`)) : []),
608
- ...(host ? (discussion ? ['control.md', 'workflow.md'] : ['relay.md', 'control.md', 'workflow.md', 'dev-flow.md'])
608
+ ...(host ? (discussion ? ['control.md', 'workflow.md'] : ['members.md', 'relay.md', 'control.md', 'workflow.md', 'dev-flow.md'])
609
609
  .map(file => skill_text('discuss-host', `references/${file}`)) : []),
610
610
  ...(goal_host(context) ? [skill_text('discuss-goal'), skill_text('discuss-goal', 'references/start.md'), skill_text('discuss-goal', 'references/finish.md')] : []),
611
611
  ...(host && context.workflow ? [workflow_text(context.workflow)] : []),