ai_co_discuss 0.2.97 → 0.2.99

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.
@@ -1,96 +1,98 @@
1
- # User Guide
2
-
3
- English | [简体中文](../workflow.md)
4
-
5
- How collaboration works inside a room. For installation, see [Setup](runner.md).
6
-
7
- > The web UI is currently in Chinese; UI labels are given in parentheses.
8
-
9
- ## Concepts
10
-
11
- | Concept | Description |
12
- | --- | --- |
13
- | Room | A shared space that keeps messages, viewpoints, disagreements and conclusions |
14
- | Member | An AI instance in the room. One platform can have several instances (e.g. `Claude`, `Claude-评审`), each with its own session and model |
15
- | Host | A locally woken AI that routes unaddressed messages; it can also act as an expert |
16
- | You | The room owner, who can `@` any member at any time |
17
-
18
- ## Free Collaboration
19
-
20
- - **Mention** — `@member` and it works in its own original session; several members can run in parallel.
21
- - **Unaddressed messages** go to the host. With a single member, they go straight to it.
22
- - **Expert presets** — a second row under the platforms lists presets; one click adds a member with its description, prompt, project access (and optionally model and effort) set. `Codex-评审` (read-only reviewer) and `Gemini-文档` (writes docs only, via agy) are built in; the bookmark on a card's back saves it as your own preset on the computer running the local service.
23
- - **Host delegation** — when the host mentions one member, that member replies to you directly, unless the host asks for the work back to hand it on (for example to a reviewer); when it mentions several, the host summarizes after they finish. One message of yours lets the host run up to 3 rounds by default (a round: the host dispatches, the members answer, the work comes back for a summary); change it (1–20 rounds) when creating the room, or later under 协作设置 (Collaboration settings) on the room page. At the limit it stops and waits for you; 继续 (Continue) in the side panel lets it run on.
24
- - **Everyone** — `@全体成员` asks all members to answer; `@全体依次` asks them one after another in speaking order.
25
- - **Stop and retry** — stop a member's current run from its menu; failed runs can be resent with one click.
26
-
27
- Mentions between ordinary members are references only and do not wake anyone. Members sharing a project directory are not locked; you decide who edits which files, and the member panel warns when two members changed the same file at the same time.
28
-
29
- ## Discussions
30
-
31
- Click **Start discussion** (开启讨论) in the member panel, or check **Start discussion after creating** (创建后开启讨论) when creating a room:
32
-
33
- 1. Write a goal and set round and time limits (3 rounds and no time limit by default in the web UI).
34
- 2. The host breaks down the question and schedules speakers. Experts first give independent views, then respond to each other.
35
- 3. When a limit is reached, the host declares the goal done, or you click **End**, the room returns to free collaboration with history and conclusions kept. You can start another discussion later.
36
-
37
- You can `@` any member during a discussion without using a round. Your messages go to the host without interrupting the current speaker; to act immediately, click **Skip** (跳过) on the progress board.
38
-
39
- ### Named Follow-ups
40
-
41
- With **Named follow-ups** (点名追问) enabled, the host writes a targeted follow-up for each expert after every round. When disabled (the default), experts read the previous round and respond to each other directly, and the host only steers.
42
-
43
- ### Limits
44
-
45
- | Limit | Description |
46
- | --- | --- |
47
- | Rounds | One round is one viewpoint from every expert |
48
- | Total time | Counts only active time; paused time is excluded |
49
- | Single run | A run that exceeds it pauses the discussion |
50
-
51
- The discussion ends when a limit is reached. Reaching a limit does not mean consensus was reached.
52
-
53
- ## Smart Scheduling
54
-
55
- When creating a room, you can add a decision model under **Smart Scheduling** (智能调度) — TypeSafe Jev, with OpenAI Decisions as an experimental option — using your own key, billed per call. Routine routing is then decided by the decision model instead of waking the host every time:
56
-
57
- - Unaddressed messages go to the member they are clearly meant for, to everyone, or to no one; otherwise to the host.
58
- - For `@全体成员`, it decides whether members answer together or in order.
59
- - In discussions, it resumes the queue after an interjection and picks the next speaker between rounds.
60
-
61
- It acts only when confident, and otherwise hands over to the host. Every decision is shown in the conversation and can be rated. The room title and recent messages are sent to the chosen provider.
62
-
63
- ## Managing Members
64
-
65
- From the member panel you can:
66
-
67
- - **Invite** members. Codex and Claude can join with an existing session ID, bringing that session's context. Experts invited during a discussion join the end of the current round.
68
- - **Pause, recall or remove** members without pausing the discussion.
69
- - **Change the host** with the crown icon. Changing the host during a discussion pauses it.
70
- - **Reorder speakers** by dragging pending members in the speaking-order list.
71
-
72
- Project file access is set per member and is read-only by default.
73
-
74
- ## Manual Members and Web Chatbots
75
-
76
- - **Manual** — the member is not woken automatically; it reads and writes with its own credential file, triggered by you or by its tool's scheduler. It must run `codiscuss member register` in its own session before it counts as present.
77
- - **Web chatbots** can only read the room. Copy the reading notice from the member panel, then choose **Relay** (代发) in the composer to paste their reply. Web chatbots cannot reach a local address.
78
-
79
- The host of a discussion must be woken locally; web chatbots take part in free collaboration only.
80
-
81
- ## Skills
82
-
83
- Agents follow the bundled skills, which `codiscuss setup` installs for the tools you select:
84
-
85
- | Skill | Used by | Purpose |
86
- | --- | --- | --- |
87
- | [discuss-participant](../../.agents/skills/discuss-participant/SKILL.md) | All members | Reading, posting and reliable writes |
88
- | [discuss-host](../../.agents/skills/discuss-host/SKILL.md) | The host (together with the participant skill) | Scheduling, progress and wrap-up |
89
- | [discuss-report](../../.agents/skills/discuss-report/SKILL.md) | Report writers | Turning a finished discussion into a sourced report |
90
-
91
- In Codex, invoke them as `$discuss-host`. In other tools that do not discover them automatically, ask the agent to read the corresponding `SKILL.md`.
92
-
93
- ## Attachments and Export
94
-
95
- - **Attachments** — up to 10 per message and 20 MiB each; images and PDFs preview in place. Uploading does not mean an agent has read the file.
96
- - **Export and import** — **Export conversation** (导出对话) downloads the raw data and attachments; **Import room** (导入房间) on another site creates a copy you can keep using. Exported from a computer running the local service, the backup also carries each member's software settings and session; imported on that same computer, members resume their original sessions when brought back. Claude Code members come back as manual members and register again from their original window, so the session does not fork.
1
+ # User Guide
2
+
3
+ English | [简体中文](../workflow.md)
4
+
5
+ How collaboration works inside a room. For installation, see [Setup](runner.md).
6
+
7
+ > The web UI is currently in Chinese; UI labels are given in parentheses.
8
+
9
+ ## Concepts
10
+
11
+ | Concept | Description |
12
+ | --- | --- |
13
+ | Room | A shared space that keeps messages, viewpoints, disagreements and conclusions |
14
+ | Member | An AI instance in the room. One platform can have several instances (e.g. `Claude`, `Claude-评审`), each with its own session and model |
15
+ | Host | A locally woken AI that routes unaddressed messages; it can also act as an expert |
16
+ | You | The room owner, who can `@` any member at any time |
17
+
18
+ ## Free Collaboration
19
+
20
+ - **Mention** — `@member` and it works in its own original session; several members can run in parallel.
21
+ - **Unaddressed messages** go to the host. With a single member, they go straight to it.
22
+ - **Expert presets** — a second row under the platforms lists presets; one click adds a member with its description, prompt, project access (and optionally model and effort) set. `Codex-评审` (read-only reviewer) and `Gemini-文档` (writes docs only, via agy) are built in; the bookmark on a card's back saves it as your own preset on the computer running the local service.
23
+ - **Host delegation** — when the host mentions one member, that member replies to you directly, unless the host asks for the work back to hand it on (for example to a reviewer); when it mentions several, the host summarizes after they finish. One message of yours lets the host run up to 3 rounds by default (a round: the host dispatches, the members answer, the work comes back for a summary); change it (1–20 rounds) when creating the room, or later under 协作设置 (Collaboration settings) on the room page. At the limit it stops and waits for you; 继续 (Continue) in the side panel lets it run on.
24
+ - **Everyone** — `@全体成员` asks all members to answer; `@全体依次` asks them one after another in speaking order.
25
+ - **Stop and retry** — stop a member's current run from its menu; failed runs can be resent with one click.
26
+ - **Retract and edit** — a message no member has started can be retracted from its “…” menu, and its text returns to the input. To change a message that was already handled, click “Edit” and resend: it and everything after it fold into a “rewound” line that AI members no longer read, and the sessions of Claude Code, Codex and agy members this machine wakes go back to before it. Manual, web and app members keep their own windows, so their sessions cannot go back. Files members changed are not restored. Neither works while a discussion is open.
27
+ - **Branch** — “Branch from here” in an AI message's “…” menu creates a new room with the history up to that message; the Claude Code, Codex and agy members this machine wakes fork their own sessions and continue from there, while the original room and sessions stay as they were. Other members start new sessions. Both rooms share the same project directory, so files are not branched. Needs the local service.
28
+
29
+ Mentions between ordinary members are references only and do not wake anyone. Members sharing a project directory are not locked; you decide who edits which files, and the member panel warns when two members changed the same file at the same time.
30
+
31
+ ## Discussions
32
+
33
+ Click **Start discussion** (开启讨论) in the member panel, or check **Start discussion after creating** (创建后开启讨论) when creating a room:
34
+
35
+ 1. Write a goal and set round and time limits (3 rounds and no time limit by default in the web UI).
36
+ 2. The host breaks down the question and schedules speakers. Experts first give independent views, then respond to each other.
37
+ 3. When a limit is reached, the host declares the goal done, or you click **End**, the room returns to free collaboration with history and conclusions kept. You can start another discussion later.
38
+
39
+ You can `@` any member during a discussion without using a round. Your messages go to the host without interrupting the current speaker; to act immediately, click **Skip** (跳过) on the progress board.
40
+
41
+ ### Named Follow-ups
42
+
43
+ With **Named follow-ups** (点名追问) enabled, the host writes a targeted follow-up for each expert after every round. When disabled (the default), experts read the previous round and respond to each other directly, and the host only steers.
44
+
45
+ ### Limits
46
+
47
+ | Limit | Description |
48
+ | --- | --- |
49
+ | Rounds | One round is one viewpoint from every expert |
50
+ | Total time | Counts only active time; paused time is excluded |
51
+ | Single run | A run that exceeds it pauses the discussion |
52
+
53
+ The discussion ends when a limit is reached. Reaching a limit does not mean consensus was reached.
54
+
55
+ ## Smart Scheduling
56
+
57
+ When creating a room, you can add a decision model under **Smart Scheduling** (智能调度) — TypeSafe Jev, with OpenAI Decisions as an experimental option — using your own key, billed per call. Routine routing is then decided by the decision model instead of waking the host every time:
58
+
59
+ - Unaddressed messages go to the member they are clearly meant for, to everyone, or to no one; otherwise to the host.
60
+ - For `@全体成员`, it decides whether members answer together or in order.
61
+ - In discussions, it resumes the queue after an interjection and picks the next speaker between rounds.
62
+
63
+ It acts only when confident, and otherwise hands over to the host. Every decision is shown in the conversation and can be rated. The room title and recent messages are sent to the chosen provider.
64
+
65
+ ## Managing Members
66
+
67
+ From the member panel you can:
68
+
69
+ - **Invite** members. Codex and Claude can join with an existing session ID, bringing that session's context. Experts invited during a discussion join the end of the current round.
70
+ - **Pause, recall or remove** members without pausing the discussion.
71
+ - **Change the host** with the crown icon. Changing the host during a discussion pauses it.
72
+ - **Reorder speakers** by dragging pending members in the speaking-order list.
73
+
74
+ Project file access is set per member and is read-only by default.
75
+
76
+ ## Manual Members and Web Chatbots
77
+
78
+ - **Manual** — the member is not woken automatically; it reads and writes with its own credential file, triggered by you or by its tool's scheduler. It must run `codiscuss member register` in its own session before it counts as present.
79
+ - **Web chatbots** can only read the room. Copy the reading notice from the member panel, then choose **Relay** (代发) in the composer to paste their reply. Web chatbots cannot reach a local address.
80
+
81
+ The host of a discussion must be woken locally; web chatbots take part in free collaboration only.
82
+
83
+ ## Skills
84
+
85
+ Agents follow the bundled skills, which `codiscuss setup` installs for the tools you select:
86
+
87
+ | Skill | Used by | Purpose |
88
+ | --- | --- | --- |
89
+ | [discuss-participant](../../.agents/skills/discuss-participant/SKILL.md) | All members | Reading, posting and reliable writes |
90
+ | [discuss-host](../../.agents/skills/discuss-host/SKILL.md) | The host (together with the participant skill) | Scheduling, progress and wrap-up |
91
+ | [discuss-report](../../.agents/skills/discuss-report/SKILL.md) | Report writers | Turning a finished discussion into a sourced report |
92
+
93
+ In Codex, invoke them as `$discuss-host`. In other tools that do not discover them automatically, ask the agent to read the corresponding `SKILL.md`.
94
+
95
+ ## Attachments and Export
96
+
97
+ - **Attachments** — up to 10 per message and 20 MiB each; images and PDFs preview in place. Uploading does not mean an agent has read the file.
98
+ - **Export and import** — **Export conversation** (导出对话) downloads the raw data and attachments; **Import room** (导入房间) on another site creates a copy you can keep using. Exported from a computer running the local service, the backup also carries each member's software settings and session; imported on that same computer, members resume their original sessions when brought back. Claude Code members come back as manual members and register again from their original window, so the session does not fork.
package/docs/workflow.md CHANGED
@@ -1,96 +1,98 @@
1
- # 使用指南
2
-
3
- [English](en/workflow.md) | 简体中文
4
-
5
- 本文介绍房间里的协作方式。安装与接入见 [安装与接入](runner.md)。
6
-
7
- ## 核心概念
8
-
9
- | 概念 | 说明 |
10
- | --- | --- |
11
- | 房间 | 共享的协作空间,保存消息、观点、分歧与结论 |
12
- | 成员 | 房间里的 AI 实例;同一平台可有多个实例(如 `Claude`、`Claude-评审`),各有会话与模型 |
13
- | 主持人 | 一位由本机唤醒的 AI,接收未点名的消息并分派,可兼任专家 |
14
- | 用户 | 房间所有者与需求方,可随时 `@` 任何成员 |
15
-
16
- ## 自由协作房间
17
-
18
- - **点名**:`@成员` 后,它在自己的原会话中处理并回复,多位可并行。
19
- - **未点名的消息**:交给主持人分派;只有一位成员时直接交给它。
20
- - **主持人派活**:主持人点名一位成员时,该成员直接回复你;主持人需要接着安排(如做完再交评审)时会要求它做完交回,点名多位时都完成后主持人再汇总。你的一条消息最多让主持人推进 3 轮(主持人派活、成员回答、交回汇总为一轮),建房时在“推进方式”里或建房后在房间页的“协作设置”里调整(1–20 轮);到上限会停下等你,右栏点“继续”即接着推进。
21
- - **全体回答**:`@全体成员` 请所有成员各自回答,`@全体依次` 按发言顺序逐个回答。
22
- - **停止与重发**:成员菜单可停止当前执行;失败的执行可一键重发。
23
-
24
- 普通成员之间的 `@` 只是引用,不会唤醒对方。多位成员共享同一项目目录时不加锁,由你划分文件;两位成员同时改动同一文件时,成员栏会提示可能的冲突。
25
-
26
- ## 开启讨论
27
-
28
- 在成员栏点“开启讨论”,或建房时勾选“创建后开启讨论”:
29
-
30
- 1. 填写讨论目标,设置轮次与时长上限(网页默认 3 轮、不限时长)。
31
- 2. 主持人拆题并安排成员轮流发言;成员先独立提出观点,再回应彼此的论证。
32
- 3. 到达上限、主持人宣布目标完成或你点“结束”后,房间回到自由协作,记录与结论保留,之后可以再次开启。
33
-
34
- 讨论中可以随时 `@` 任何成员提问,不占轮次。你的留言交给主持人处理,不打断正在发言的专家;需要立即生效时,在进度看板点“跳过”当前发言。
35
-
36
- ### 点名追问与智能衔接
37
-
38
- 新建讨论时可开启“点名追问”:每轮结束后,主持人给每位专家写针对性的追问。关闭时(默认),专家读完上一轮回答后直接互相回应,主持人只负责引导方向。
39
-
40
- ### 讨论上限
41
-
42
- | 参数 | 说明 |
43
- | --- | --- |
44
- | 轮次上限 | 每位专家各完成一次观点计一轮 |
45
- | 总时长 | 只统计进行中的时间,暂停期间不计 |
46
- | 单次 AI 执行 | 单次执行超时即暂停 |
47
-
48
- 到限后讨论结束;到限不代表已经达成共识。
49
-
50
- ## 智能调度
51
-
52
- 建房时可在“智能调度”下添加一个决策模型(TypeSafe Jev;OpenAI Decisions 为实验性),用你自己的密钥按次计费。开启后,常规分派由决策模型判断,不必每次唤醒主持人:
53
-
54
- - 未点名的消息:明确对某位成员说时直接交给他,或请全体回答、无需回应;其余仍交给主持人。
55
- - `@全体成员`:判断应同时回答还是依次回答。
56
- - 讨论中:用户插话后继续原有安排,轮次之间选出下一位发言人。
57
-
58
- 决策模型只在把握足够时执行,否则交回主持人。每次判断都会显示在对话中,可以评价。开启后,房间标题与最近消息会发送给所选供应商。
59
-
60
- 给成员写一段描述能让分派更准,例如“Claude:审美好,UI 写得好”“Codex:代码写得好,能生成图片”。建房或邀请时点成员卡片右上角的描述按钮填写,可存为该软件的默认描述(连接本机服务时存在这台电脑上,所有浏览器共用);房间里可在右栏成员菜单“编辑描述”随时修改。决策模型和 AI 主持人都会参考它,房间里所有成员也都能看到。
61
-
62
- ## 成员管理
63
-
64
- 在右侧成员栏可以:
65
-
66
- - **邀请**成员。Codex 与 Claude 可以填写已有会话 ID,带着原会话的上下文加入;讨论中新邀请的专家排在本轮队尾。
67
- - **专家预设**:建房与邀请时,“添加”行下方另起一行“预设”,点一下就加入一位已设好描述、专属提示词、项目权限(以及可选的模型与强度)的成员。内置 `Codex-评审`(只读,只提问题不改代码)与 `Gemini-文档`(经 agy,可写,只改文档);翻开任意卡片点背面的书签图标可把它存为你自己的预设,同名时替换内置预设。预设存在本机服务所在的电脑上,需要连接本机服务。
68
- - **暂离、请回或移除**成员,讨论不会因此暂停。
69
- - **更换主持人**:点成员卡片上的皇冠。讨论中更换会暂停讨论。
70
- - **调整发言顺序**:拖动右栏“发言顺序”中待发言的成员。
71
-
72
- 项目文件权限按成员设置,默认只读。
73
-
74
- ## 手动接入与网页 AI
75
-
76
- - **手动接入**:成员不被自动唤醒,凭自己的凭据文件读写,由你或软件的定时功能触发。成员须先在自己的会话中执行 `codiscuss member register` 才算到场。
77
- - **网页 AI**:在线聊天产品只能阅读房间。在成员栏复制阅读通知交给它,再在输入框选择“代发”粘贴它的回答。网页 AI 访问不到本机地址。
78
-
79
- 讨论的主持人必须由本机唤醒;网页 AI 只参与自由协作。
80
-
81
- ## 技能
82
-
83
- AI 按随包分发的技能参与房间,`codiscuss setup` 会为选定的软件自动安装:
84
-
85
- | 技能 | 使用者 | 作用 |
86
- | --- | --- | --- |
87
- | [discuss-participant](../.agents/skills/discuss-participant/SKILL.md) | 所有成员 | 阅读、发言与可靠写入 |
88
- | [discuss-host](../.agents/skills/discuss-host/SKILL.md) | 主持人(同时调用参与技能) | 自由协作中分派与接续成员的工作;讨论中安排发言、保存进度与收束 |
89
- | [discuss-report](../.agents/skills/discuss-report/SKILL.md) | 报告整理者 | 把已有讨论整理为带原文引用的报告 |
90
-
91
- 在 Codex 中用 `$discuss-host` 调用;其他软件没有自动发现时,直接要求它读取对应的 `SKILL.md`。
92
-
93
- ## 附件与导出
94
-
95
- - **附件**:每条消息最多 10 个,单个最多 20 MiB,图片与 PDF 可在站内预览。上传不代表 AI 已读取。
96
- - **导出与导入**:房间菜单的“导出对话”下载原始数据与附件;在另一个站点“导入房间…”即可得到可继续使用的副本。在运行本机服务的电脑上导出时,备份会附带成员的软件配置和会话;在同一台电脑导入后,成员请回时续接原会话。Claude Code 成员会改为手动接入,请回后在原窗口重新注册,以免会话分叉。
1
+ # 使用指南
2
+
3
+ [English](en/workflow.md) | 简体中文
4
+
5
+ 本文介绍房间里的协作方式。安装与接入见 [安装与接入](runner.md)。
6
+
7
+ ## 核心概念
8
+
9
+ | 概念 | 说明 |
10
+ | --- | --- |
11
+ | 房间 | 共享的协作空间,保存消息、观点、分歧与结论 |
12
+ | 成员 | 房间里的 AI 实例;同一平台可有多个实例(如 `Claude`、`Claude-评审`),各有会话与模型 |
13
+ | 主持人 | 一位由本机唤醒的 AI,接收未点名的消息并分派,可兼任专家 |
14
+ | 用户 | 房间所有者与需求方,可随时 `@` 任何成员 |
15
+
16
+ ## 自由协作房间
17
+
18
+ - **点名**:`@成员` 后,它在自己的原会话中处理并回复,多位可并行。
19
+ - **未点名的消息**:交给主持人分派;只有一位成员时直接交给它。
20
+ - **主持人派活**:主持人点名一位成员时,该成员直接回复你;主持人需要接着安排(如做完再交评审)时会要求它做完交回,点名多位时都完成后主持人再汇总。你的一条消息最多让主持人推进 3 轮(主持人派活、成员回答、交回汇总为一轮),建房时在“推进方式”里或建房后在房间页的“协作设置”里调整(1–20 轮);到上限会停下等你,右栏点“继续”即接着推进。
21
+ - **全体回答**:`@全体成员` 请所有成员各自回答,`@全体依次` 按发言顺序逐个回答。
22
+ - **停止与重发**:成员菜单可停止当前执行;失败的执行可一键重发。
23
+ - **撤回与编辑**:还没有成员开始处理的消息可在“…”菜单撤回,原文回到输入框。已被处理的消息点“编辑”改写后重发:这条消息及之后的记录折叠为“已回退”,AI 不再读到它们,由本机唤醒的 Claude Code、Codex、agy 会话会退回到这条消息之前;手动接入、网页成员和 App 的会话在各自窗口中,无法回退。成员已改动的文件不会撤销。讨论进行中不能撤回或编辑。
24
+ - **分支**:AI 发言的“…”菜单“从这里分支”会新建一个房间,保留到这条发言为止的记录,由本机唤醒的 Claude Code、Codex、agy 从各自会话分叉、从这里接着工作,原房间和原会话不变;其他成员以新会话开始。两个房间共用同一项目目录,文件不分叉。需要连接本机服务。
25
+
26
+ 普通成员之间的 `@` 只是引用,不会唤醒对方。多位成员共享同一项目目录时不加锁,由你划分文件;两位成员同时改动同一文件时,成员栏会提示可能的冲突。
27
+
28
+ ## 开启讨论
29
+
30
+ 在成员栏点“开启讨论”,或建房时勾选“创建后开启讨论”:
31
+
32
+ 1. 填写讨论目标,设置轮次与时长上限(网页默认 3 轮、不限时长)。
33
+ 2. 主持人拆题并安排成员轮流发言;成员先独立提出观点,再回应彼此的论证。
34
+ 3. 到达上限、主持人宣布目标完成或你点“结束”后,房间回到自由协作,记录与结论保留,之后可以再次开启。
35
+
36
+ 讨论中可以随时 `@` 任何成员提问,不占轮次。你的留言交给主持人处理,不打断正在发言的专家;需要立即生效时,在进度看板点“跳过”当前发言。
37
+
38
+ ### 点名追问与智能衔接
39
+
40
+ 新建讨论时可开启“点名追问”:每轮结束后,主持人给每位专家写针对性的追问。关闭时(默认),专家读完上一轮回答后直接互相回应,主持人只负责引导方向。
41
+
42
+ ### 讨论上限
43
+
44
+ | 参数 | 说明 |
45
+ | --- | --- |
46
+ | 轮次上限 | 每位专家各完成一次观点计一轮 |
47
+ | 总时长 | 只统计进行中的时间,暂停期间不计 |
48
+ | 单次 AI 执行 | 单次执行超时即暂停 |
49
+
50
+ 到限后讨论结束;到限不代表已经达成共识。
51
+
52
+ ## 智能调度
53
+
54
+ 建房时可在“智能调度”下添加一个决策模型(TypeSafe Jev;OpenAI Decisions 为实验性),用你自己的密钥按次计费。开启后,常规分派由决策模型判断,不必每次唤醒主持人:
55
+
56
+ - 未点名的消息:明确对某位成员说时直接交给他,或请全体回答、无需回应;其余仍交给主持人。
57
+ - `@全体成员`:判断应同时回答还是依次回答。
58
+ - 讨论中:用户插话后继续原有安排,轮次之间选出下一位发言人。
59
+
60
+ 决策模型只在把握足够时执行,否则交回主持人。每次判断都会显示在对话中,可以评价。开启后,房间标题与最近消息会发送给所选供应商。
61
+
62
+ 给成员写一段描述能让分派更准,例如“Claude:审美好,UI 写得好”“Codex:代码写得好,能生成图片”。建房或邀请时点成员卡片右上角的描述按钮填写,可存为该软件的默认描述(连接本机服务时存在这台电脑上,所有浏览器共用);房间里可在右栏成员菜单“编辑描述”随时修改。决策模型和 AI 主持人都会参考它,房间里所有成员也都能看到。
63
+
64
+ ## 成员管理
65
+
66
+ 在右侧成员栏可以:
67
+
68
+ - **邀请**成员。Codex 与 Claude 可以填写已有会话 ID,带着原会话的上下文加入;讨论中新邀请的专家排在本轮队尾。
69
+ - **专家预设**:建房与邀请时,“添加”行下方另起一行“预设”,点一下就加入一位已设好描述、专属提示词、项目权限(以及可选的模型与强度)的成员。内置 `Codex-评审`(只读,只提问题不改代码)与 `Gemini-文档`(经 agy,可写,只改文档);翻开任意卡片点背面的书签图标可把它存为你自己的预设,同名时替换内置预设。预设存在本机服务所在的电脑上,需要连接本机服务。
70
+ - **暂离、请回或移除**成员,讨论不会因此暂停。
71
+ - **更换主持人**:点成员卡片上的皇冠。讨论中更换会暂停讨论。
72
+ - **调整发言顺序**:拖动右栏“发言顺序”中待发言的成员。
73
+
74
+ 项目文件权限按成员设置,默认只读。
75
+
76
+ ## 手动接入与网页 AI
77
+
78
+ - **手动接入**:成员不被自动唤醒,凭自己的凭据文件读写,由你或软件的定时功能触发。成员须先在自己的会话中执行 `codiscuss member register` 才算到场。
79
+ - **网页 AI**:在线聊天产品只能阅读房间。在成员栏复制阅读通知交给它,再在输入框选择“代发”粘贴它的回答。网页 AI 访问不到本机地址。
80
+
81
+ 讨论的主持人必须由本机唤醒;网页 AI 只参与自由协作。
82
+
83
+ ## 技能
84
+
85
+ AI 按随包分发的技能参与房间,`codiscuss setup` 会为选定的软件自动安装:
86
+
87
+ | 技能 | 使用者 | 作用 |
88
+ | --- | --- | --- |
89
+ | [discuss-participant](../.agents/skills/discuss-participant/SKILL.md) | 所有成员 | 阅读、发言与可靠写入 |
90
+ | [discuss-host](../.agents/skills/discuss-host/SKILL.md) | 主持人(同时调用参与技能) | 自由协作中分派与接续成员的工作;讨论中安排发言、保存进度与收束 |
91
+ | [discuss-report](../.agents/skills/discuss-report/SKILL.md) | 报告整理者 | 把已有讨论整理为带原文引用的报告 |
92
+
93
+ 在 Codex 中用 `$discuss-host` 调用;其他软件没有自动发现时,直接要求它读取对应的 `SKILL.md`。
94
+
95
+ ## 附件与导出
96
+
97
+ - **附件**:每条消息最多 10 个,单个最多 20 MiB,图片与 PDF 可在站内预览。上传不代表 AI 已读取。
98
+ - **导出与导入**:房间菜单的“导出对话”下载原始数据与附件;在另一个站点“导入房间…”即可得到可继续使用的副本。在运行本机服务的电脑上导出时,备份会附带成员的软件配置和会话;在同一台电脑导入后,成员请回时续接原会话。Claude Code 成员会改为手动接入,请回后在原窗口重新注册,以免会话分叉。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai_co_discuss",
3
- "version": "0.2.97",
3
+ "version": "0.2.99",
4
4
  "bin": {
5
5
  "codiscuss": "runner/codiscuss.mjs"
6
6
  },
@@ -1,8 +1,7 @@
1
1
  /** Site administrator setup from the deploying computer: a one-time registration token and the saved account. */
2
2
  import { spawnSync } from 'node:child_process';
3
3
  import { createHash, randomBytes } from 'node:crypto';
4
- import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
5
- import { tmpdir } from 'node:os';
4
+ import { existsSync, mkdirSync, readFileSync } from 'node:fs';
6
5
  import { join, resolve } from 'node:path';
7
6
  import { parseArgs } from 'node:util';
8
7
 
@@ -12,11 +11,11 @@ import { service_home } from './discussion_service.mjs';
12
11
  const DEFAULT_CONFIG = join('.wrangler', 'deploy', 'wrangler.jsonc');
13
12
  const ACCOUNTS_FILE = 'admin-accounts.json';
14
13
  const TOKEN_BYTES = 32;
15
- const HELP = `用法:codiscuss admin token [--config WRANGLER_CONFIG]
14
+ const HELP = `用法:codiscuss token [--config WRANGLER_CONFIG]
16
15
 
17
- token 生成一次性管理员注册令牌,经 wrangler 把它的哈希写入线上 D1,立即生效。
18
- 在线上网页左下角注册管理员时填入;注册成功即作废,重新运行会替换旧令牌。
19
- 需要这台电脑已 wrangler login;--config 默认为当前目录的 ${DEFAULT_CONFIG}。
16
+ 生成一次性管理员注册令牌,经 wrangler 把它的哈希写入线上 D1,立即生效。
17
+ 在线上网页左下角注册管理员时填入;注册成功即作废,重新运行会替换旧令牌。
18
+ 需要这台电脑已 wrangler login;--config 默认为当前目录的 ${DEFAULT_CONFIG}。
20
19
 
21
20
  在已用 codiscuss local connect 连上本机服务的网页注册后,账号与密码保存在 ~/.codiscuss/${ACCOUNTS_FILE}。
22
21
  `;
@@ -27,12 +26,9 @@ export function create_admin_token(config, run = run_wrangler) {
27
26
  if (!existsSync(path)) throw new Error(`找不到部署配置 ${path};请在项目目录运行,或用 --config 指定 wrangler.jsonc`);
28
27
  const token = randomBytes(TOKEN_BYTES).toString('hex');
29
28
  const hashed = createHash('sha256').update(token).digest('hex');
30
- const directory = mkdtempSync(join(tmpdir(), 'codiscuss-admin-'));
31
- const sql = join(directory, 'admin-setup.sql');
32
- try {
33
- writeFileSync(sql, `INSERT OR REPLACE INTO admin_setup (id,token_hash,created_at) VALUES (1,'${hashed}',${Math.floor(Date.now() / 1000)});\n`);
34
- run(['d1', 'execute', 'DB', '--remote', '--config', path, '--file', sql]);
35
- } finally { rmSync(directory, { recursive: true, force: true }); }
29
+ // --command uses the ordinary query API; --file goes through D1's upload-based import, which fails behind some networks.
30
+ run(['d1', 'execute', 'DB', '--remote', '--config', path, '--command',
31
+ `INSERT OR REPLACE INTO admin_setup (id,token_hash,created_at) VALUES (1,'${hashed}',${Math.floor(Date.now() / 1000)})`]);
36
32
  return { token, config: path };
37
33
  }
38
34
 
@@ -55,12 +51,12 @@ export function save_admin_account(home, { site, username, password }) {
55
51
  return { saved: path };
56
52
  }
57
53
 
58
- /** `codiscuss admin ...` */
54
+ /** `codiscuss token [--config FILE]` */
59
55
  export function admin_main(args) {
60
56
  const { values, positionals } = parseArgs({ args, allowPositionals: true, options: {
61
57
  config: { type: 'string' }, help: { type: 'boolean', short: 'h' },
62
58
  } });
63
- if (values.help || positionals[0] !== 'token') return process.stdout.write(HELP);
59
+ if (values.help || positionals.length) return process.stdout.write(HELP);
64
60
  const { token } = create_admin_token(values.config);
65
61
  process.stdout.write(`管理员注册令牌(一次性):\n${token}\n\n在线上网页左下角注册管理员时填入。注册成功后作废;账号密码在已连接本机服务的网页注册时保存到 ${join(service_home(), ACCOUNTS_FILE)}。\n`);
66
62
  }
@@ -67,6 +67,19 @@ export class CodexAppClient {
67
67
  return { thread_id: data.threadId, title: data.title || title };
68
68
  }
69
69
 
70
+ /** The App's status of one chat, e.g. `idle`, `active` or `notLoaded`. */
71
+ async thread_status(thread_id) {
72
+ const data = await this.call_tool('read_thread', thread_id, { threadId: thread_id, turnLimit: 1 });
73
+ if (!data?.thread?.status?.type) throw new Error('桌面尚未返回会话状态');
74
+ return data.thread.status.type;
75
+ }
76
+
77
+ /** Send a message through the App itself, which loads a chat it has not opened yet. */
78
+ async send_message(thread_id, prompt) {
79
+ const data = await this.call_tool('send_message_to_thread', thread_id, { threadId: thread_id, prompt });
80
+ if (data?.threadId !== thread_id) throw new Error('桌面尚未确认消息送达的会话');
81
+ }
82
+
70
83
  /** Send the same length-prefixed JSON-RPC frames as the bundled app-tools MCP. */
71
84
  request(method, params) {
72
85
  return new Promise((resolve_result, reject) => {
@@ -17,7 +17,7 @@ const HELP = `AI CoDiscuss CLI
17
17
  (无命令) 在当前终端启动服务,Ctrl+C 停止
18
18
  install / setup 安装持久命令并配置 / 配置已有安装
19
19
  local COMMAND 管理本机网站,或 connect 连接线上站点
20
- admin token 生成线上网站的一次性管理员注册令牌
20
+ token 生成线上网站的一次性管理员注册令牌
21
21
  service COMMAND 启动、停止、查询服务,或登记房间
22
22
  launch COMMAND 保存启动配置,或从 AI 对话启动讨论
23
23
  room COMMAND 创建、读取或更新讨论房间
@@ -120,7 +120,7 @@ async function main(args = process.argv.slice(2)) {
120
120
  if (command === 'launch') return launch_main(args.slice(1));
121
121
  if (['install', 'setup'].includes(command)) return setup_main(command, args.slice(1));
122
122
  if (command === 'local') return local_main(args.slice(1));
123
- if (command === 'admin') return admin_main(args.slice(1));
123
+ if (command === 'token') return admin_main(args.slice(1));
124
124
  if (!command || (command === 'run' && args.length === 1)) return service_cli([]);
125
125
  if (SERVICE_COMMANDS.has(command) || command === '--json') return service_cli(args);
126
126
  return website_cli(args);