ai_co_discuss 0.2.98 → 0.3.0

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 (44) hide show
  1. package/.agents/skills/discuss-host/SKILL.md +3 -3
  2. package/.agents/skills/discuss-host/references/discussion.md +16 -16
  3. package/.agents/skills/discuss-host/references/launch.md +1 -3
  4. package/.agents/skills/discuss-host/references/manual.md +14 -77
  5. package/.agents/skills/discuss-participant/SKILL.md +4 -4
  6. package/.agents/skills/discuss-participant/references/discussion.md +29 -27
  7. package/.agents/skills/discuss-participant/references/free.md +3 -3
  8. package/.agents/skills/discuss-participant/references/manual.md +8 -10
  9. package/.agents/skills/discuss-participant/references/writing.md +9 -9
  10. package/.github/SECURITY.md +1 -1
  11. package/README.md +3 -3
  12. package/README.zh-CN.md +3 -3
  13. package/backend/free_room.py +542 -69
  14. package/backend/room_import.py +77 -15
  15. package/backend/runtime.py +81 -169
  16. package/backend/schema.sql +167 -244
  17. package/backend/server.py +639 -175
  18. package/backend/session_room.py +919 -0
  19. package/docs/architecture.md +3 -2
  20. package/docs/en/architecture.md +4 -3
  21. package/docs/en/runner.md +3 -1
  22. package/docs/en/workflow.md +101 -96
  23. package/docs/runner.md +3 -1
  24. package/docs/workflow.md +101 -96
  25. package/package.json +2 -2
  26. package/runner/api_participant.mjs +47 -44
  27. package/runner/codex_app_client.mjs +13 -0
  28. package/runner/discuss.py +77 -58
  29. package/runner/discussion_adapters.mjs +210 -28
  30. package/runner/discussion_launch.mjs +234 -85
  31. package/runner/discussion_models.mjs +89 -1
  32. package/runner/discussion_runner.mjs +49 -504
  33. package/runner/discussion_service.mjs +119 -93
  34. package/runner/discussion_sidecar.mjs +4 -13
  35. package/runner/expert_prompts.mjs +100 -8
  36. package/runner/free_runner.mjs +118 -35
  37. package/runner/scheduler.mjs +4 -4
  38. package/runner/session_cut.mjs +167 -0
  39. package/runner/session_driver.mjs +175 -0
  40. package/web/app.js +421 -154
  41. package/web/backup.js +1 -1
  42. package/web/markdown.css +1 -1
  43. package/web/modern.css +1 -1
  44. package/web/modern.js +6544 -7299
@@ -7,7 +7,7 @@ AI CoDiscuss 把三件事分开:网站保存讨论事实并校验写入,本
7
7
  ```mermaid
8
8
  flowchart LR
9
9
  U[浏览器] --> S[(网站<br>Python + SQLite<br>或 Cloudflare + D1)]
10
- S -- 事件 --> R[本机服务<br>runner/]
10
+ S -- 成员请求与执行 --> R[本机服务<br>runner/]
11
11
  R -- 唤醒 / 续接 --> A[CLI / App]
12
12
  R -- 调用 --> M[模型 API]
13
13
  R -. 可选 .-> D[决策模型]
@@ -22,6 +22,7 @@ flowchart LR
22
22
  - **网站不运行模型**:网站不启动本机进程、不保存模型密钥、不调用模型;这些都由本机服务完成。
23
23
  - **先读取、再提交、服务端兜底**:依赖房间整体状态的写入(如整轮安排、收束)须携带读取时取得的版本凭据;凭据缺失返回 400,状态已变化返回 409,不依赖调用方自觉。
24
24
  - **结果以网站记录为准**:会话 ID 出现、进程退出或受理回执都不等于完成;已交付但结果不明的任务不自动重发。
25
+ - **统一执行**:讨论发言与普通协作共用请求、执行、租约、失败重试及进展报告;讨论会话只管理目标、发言顺序、阶段和上限。旧讨论安排及消息关联保留为只读历史。
25
26
 
26
27
  ## 组成
27
28
 
@@ -43,7 +44,7 @@ AI 平台(Codex、Claude、Gemini、DeepSeek、Qwen、Grok)是类型,房
43
44
  - 建房时由浏览器生成房间控制凭据与每位成员的凭证,服务端只保存哈希。
44
45
  - 用户写入需要房间控制凭据;成员只能以自己的身份发言;自动执行另需本次有效的执行凭据,执行失效后的迟到回答会被拒绝。
45
46
  - 在线 AI 与 CLI 通过纯文本页面 `/r/ROOM_ID` 按需读取,不一次性加载全部历史。
46
- - 网站目前没有读取权限隔离,能访问站点的人可以阅读房间、附件与备份;详见 [安全说明](../.github/SECURITY.md)。
47
+ - 网站目前没有按用户隔离房间数据。独立观点阶段会临时限制匿名及普通成员读取后续观点,并要求完整导出使用房主或主持凭据;这不是整站访问控制,详见 [安全说明](../.github/SECURITY.md)。
47
48
  - 本机路径、软件配置、会话绑定与 API 密钥只保存在本机服务目录。
48
49
 
49
50
  ## 技术栈
@@ -7,13 +7,13 @@ AI CoDiscuss keeps three concerns apart: the site stores the record and validate
7
7
  ```mermaid
8
8
  flowchart LR
9
9
  U[Browser] --> S[(Site<br>Python + SQLite<br>or Cloudflare + D1)]
10
- S -- events --> R[Local runner<br>runner/]
10
+ S -- requests and executions --> R[Local runner<br>runner/]
11
11
  R -- wake / resume --> A[CLI / App]
12
12
  R -- calls --> M[Model APIs]
13
13
  R -. optional .-> D[Decision model]
14
14
  A -- codiscuss CLI --> S
15
15
  M -- room tools --> S
16
- W[Web chatbots] -. read-only /r .-> S
16
+ W[Web chatbots] -. read-only room page, relayed replies .-> S
17
17
  ```
18
18
 
19
19
  ## Design Principles
@@ -22,6 +22,7 @@ flowchart LR
22
22
  - **The site never runs models** — it does not start local processes, store model keys or call models; the local runner does.
23
23
  - **Read, then write, enforced by the server** — writes that depend on the room's overall state (such as scheduling a full round or wrapping up) must carry the revision obtained when reading. A missing revision returns 400 and a stale one returns 409, regardless of what the caller intended.
24
24
  - **The site record is the source of truth** — a session ID, a process exit or a delivery receipt does not mean a task is done, and tasks with uncertain delivery are never resent automatically.
25
+ - **One execution flow** — discussion turns and free collaboration share requests, executions, leases, failure retries and progress reports. A discussion session only controls its goal, speaker order, phase and limits; legacy discussion plans remain read-only history.
25
26
 
26
27
  ## Components
27
28
 
@@ -43,7 +44,7 @@ An AI platform (Codex, Claude, Gemini, DeepSeek, Qwen, Grok) is a type; a partic
43
44
  - The browser generates the room control credential and a credential for each member at creation time; the server stores only hashes.
44
45
  - Your writes require the room control credential, members can only post as themselves, and automatic runs also need a valid run credential — late replies from an expired run are rejected.
45
46
  - Web chatbots and the CLI read through plain-text pages under `/r/ROOM_ID`, on demand rather than loading the full history.
46
- - There is no read-access isolation yet: anyone who can reach the site can read its rooms, attachments and backups. See the [security policy](../../.github/SECURITY.md).
47
+ - 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).
47
48
  - Local paths, tool configuration, session bindings and API keys stay in the local service directory.
48
49
 
49
50
  ## Tech Stack
package/docs/en/runner.md CHANGED
@@ -84,9 +84,11 @@ Project file access is set per member and is read-only by default. Agents can on
84
84
 
85
85
  Agents also use `codiscuss` to read and write rooms. `codiscuss --help` lists all commands and `codiscuss schema <command>` shows their fields; both work offline.
86
86
 
87
+ Discussion turns and everyday collaboration use the same request and execution flow. Automatic members are woken by the local service; manual members read and answer with their own credential. The discussion host reads the current roster before scheduling speakers.
88
+
87
89
  ## Troubleshooting
88
90
 
89
- - **A tool failed to start** — check the pause reason on the progress board, fix sign-in or permissions in that tool, then click **Restart** (重启); or **Skip** (跳过) this turn.
91
+ - **A delivery failed** — the room retries automatically up to three times. You can retry immediately or stop it from the failure card. After three failed attempts, the host receives the failure and decides whether to skip, reschedule or pause the discussion; the room does not pause automatically.
90
92
  - **Codex says the session is in use** — the chat is still held by Codex App; switch the member to the App from the progress board.
91
93
  - **Windows reports two data paths** — manage the service from a regular terminal, or set `DISCUSS_SERVICE_HOME`.
92
94
  - **Uncertain results** — tasks that were delivered but not confirmed are never resent automatically; check the original session and the room first.
@@ -1,96 +1,101 @@
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. If that member is already handling a discussion request, the new request waits for the same session. Unaddressed messages go to the host; to stop the current speaker, click **Skip** (跳过) on the progress board. Group mentions, retracting, editing and branching are unavailable during a discussion.
40
+
41
+ Discussions and free collaboration share the same execution and failure cards. A failed delivery retries up to three times; you can retry immediately or stop it. When retries run out, only that request fails and the host decides whether to skip, reschedule or pause the discussion. The room is not paused automatically. Scheduled online members can reply through the host's relay; the discussion host itself must be woken locally.
42
+
43
+ ### Named Follow-ups
44
+
45
+ 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.
46
+
47
+ ### Limits
48
+
49
+ | Limit | Description |
50
+ | --- | --- |
51
+ | Rounds | Counts completed expert discussion replies; host notes and direct questions do not count |
52
+ | Total time | Counts only active time; paused time is excluded |
53
+ | Single run | A run that exceeds it ends that execution; the request is handled as a delivery failure |
54
+
55
+ The discussion ends as soon as a limit is reached and returns to free collaboration without an extra host summary request. Reaching a limit does not mean consensus was reached. Pausing stops current discussion executions; when resumed, the host schedules the next request.
56
+
57
+ ## Smart Scheduling
58
+
59
+ 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:
60
+
61
+ - Unaddressed messages go to the member they are clearly meant for, to everyone, or to no one; otherwise to the host.
62
+ - For `@全体成员`, it decides whether members answer together or in order.
63
+ - In discussions, it resumes the queue after an interjection and picks the next speaker between rounds.
64
+
65
+ 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.
66
+
67
+ ## Managing Members
68
+
69
+ From the member panel you can:
70
+
71
+ - **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.
72
+ - **Pause, recall or remove** members without pausing the discussion.
73
+ - **Change the host** with the crown icon. Changing the host during a discussion pauses it.
74
+ - **Reorder speakers** by dragging pending members in the speaking-order list.
75
+
76
+ Project file access is set per member and is read-only by default.
77
+
78
+ ## Manual Members and Web Chatbots
79
+
80
+ - **Manual** — a local member is not woken automatically; it reads and writes with its own credential after you or the host triggers it, and must run `codiscuss member register` before it can be scheduled. Web members do not register or write directly; the host or user relays their original replies, including replies to discussion requests.
81
+ - **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.
82
+
83
+ The host of a discussion must be woken locally. Manual and web members can answer requests scheduled for them; web chatbots read the room and their replies are relayed by the host or user.
84
+
85
+ ## Skills
86
+
87
+ Agents follow the bundled skills, which `codiscuss setup` installs for the tools you select:
88
+
89
+ | Skill | Used by | Purpose |
90
+ | --- | --- | --- |
91
+ | [discuss-participant](../../.agents/skills/discuss-participant/SKILL.md) | All members | Reading, posting and reliable writes |
92
+ | [discuss-host](../../.agents/skills/discuss-host/SKILL.md) | The host (together with the participant skill) | Scheduling, progress and wrap-up |
93
+ | [discuss-report](../../.agents/skills/discuss-report/SKILL.md) | Report writers | Turning a finished discussion into a sourced report |
94
+
95
+ 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`.
96
+
97
+ ## Attachments and Export
98
+
99
+ - **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.
100
+ - **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.
101
+ - **Discussion history** — backups include past sessions, conclusions and speaker plans, and version 1 backups remain importable. Import restores them as history; it does not resume active work or wake members. Markdown exports retain the links between plans and answers.
package/docs/runner.md CHANGED
@@ -86,9 +86,11 @@ API 成员可以担任专家或主持人,只有房间读写工具,不访问
86
86
 
87
87
  `codiscuss` 同时供 AI 读写房间。`codiscuss --help` 列出全部命令,`codiscuss schema <命令>` 显示字段,都可离线使用。
88
88
 
89
+ 讨论与普通协作统一读取请求并提交回答。成员回答使用 `message post --kind chat`,自动任务绑定 `--execution`,手动回答绑定 `--request`;主持人先读 `turn roster`,再带返回的 revision 创建或继续安排。讨论开关先用 `run view` 读取 revision,再执行开始、暂停、继续或结束;具体字段以命令帮助和房间协议为准。
90
+
89
91
  ## 常见问题
90
92
 
91
- - **软件启动失败**:在进度看板查看暂停原因,在对应软件中处理登录或权限后点“重启”;也可以点“跳过”本次发言。
93
+ - **软件送达失败**:查看成员状态与原位失败卡,在对应软件中处理登录或权限;倒计时期间可以立即重试或停止。三次重试用尽后,讨论专家的失败交给主持人处理;也可跳过本次发言。
92
94
  - **Codex 提示会话被占用**:原聊天仍被 Codex App 占用,可在进度看板切换到 App 接入。
93
95
  - **Windows 报告两处数据路径**:从普通终端管理服务,或设置环境变量 `DISCUSS_SERVICE_HOME`。
94
96
  - **结果不明**:已交付但无法确认的任务不会自动重发,请先在原会话与房间中核对。
package/docs/workflow.md CHANGED
@@ -1,96 +1,101 @@
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
+ 讨论与普通协作共用处理中卡和失败卡。送达失败会倒计时重试,最多 3 次,也可立即重试或停止;用尽后只结束该次请求,由主持人决定跳过、重排或暂停,不自动暂停整场。系统安排仍显示为安排卡,不冒充用户或 AI 发言。
39
+
40
+ ### 点名追问与智能衔接
41
+
42
+ 新建讨论时可开启“点名追问”:每轮结束后,主持人给每位专家写针对性的追问。关闭时(默认),专家读完上一轮回答后直接互相回应,主持人只负责引导方向。
43
+
44
+ ### 讨论上限
45
+
46
+ | 参数 | 说明 |
47
+ | --- | --- |
48
+ | 轮次上限 | 按讨论专家的已完成回答统计;主持说明与直接提问不计 |
49
+ | 总时长 | 只统计进行中的时间,暂停期间不计 |
50
+ | 单次 AI 执行 | 超时结束该次执行,专家失败交回主持人处理 |
51
+
52
+ 到限后立即结束讨论,回到自由协作,不额外唤醒主持人总结;到限不代表已经达成共识。暂停会停止本次讨论中的执行,继续后由主持人重新安排。
53
+
54
+ ## 智能调度
55
+
56
+ 建房时可在“智能调度”下添加一个决策模型(TypeSafe Jev;OpenAI Decisions 为实验性),用你自己的密钥按次计费。开启后,常规分派由决策模型判断,不必每次唤醒主持人:
57
+
58
+ - 未点名的消息:明确对某位成员说时直接交给他,或请全体回答、无需回应;其余仍交给主持人。
59
+ - `@全体成员`:判断应同时回答还是依次回答。
60
+ - 讨论中:用户插话后继续原有安排,轮次之间选出下一位发言人。
61
+
62
+ 决策模型只在把握足够时执行,否则交回主持人。每次判断都会显示在对话中,可以评价。开启后,房间标题与最近消息会发送给所选供应商。
63
+
64
+ 给成员写一段描述能让分派更准,例如“Claude:审美好,UI 写得好”“Codex:代码写得好,能生成图片”。建房或邀请时点成员卡片右上角的描述按钮填写,可存为该软件的默认描述(连接本机服务时存在这台电脑上,所有浏览器共用);房间里可在右栏成员菜单“编辑描述”随时修改。决策模型和 AI 主持人都会参考它,房间里所有成员也都能看到。
65
+
66
+ ## 成员管理
67
+
68
+ 在右侧成员栏可以:
69
+
70
+ - **邀请**成员。程序启动的成员由本机新建会话;想让一个已有对话带着上下文加入,选“手动启动”,在那个对话里执行启动指令注册,之后房间的任务会尽量送进那个窗口。讨论中新邀请的专家排在本轮队尾。
71
+ - **专家预设**:建房与邀请时,“添加”行下方另起一行“预设”,点一下就加入一位已设好描述、专属提示词、项目权限(以及可选的模型与强度)的成员。内置 `Codex-评审`(只读,只提问题不改代码)与 `Gemini-文档`(经 agy,可写,只改文档);翻开任意卡片点背面的书签图标可把它存为你自己的预设,同名时替换内置预设。预设存在本机服务所在的电脑上,需要连接本机服务。
72
+ - **暂离、请回或移除**成员,讨论不会因此暂停。
73
+ - **更换主持人**:点成员卡片上的皇冠。讨论中更换会暂停讨论。
74
+ - **调整发言顺序**:拖动右栏“发言顺序”中待发言的成员。
75
+
76
+ 项目文件权限按成员设置,默认只读。
77
+
78
+ ## 手动接入与网页 AI
79
+
80
+ - **手动接入**:本地成员须先在自己的会话中执行 `codiscuss member register`。支持接管的软件随后由本机服务尽量向原会话投递;其余成员由你触发,凭自己的凭据文件读取请求并回答。
81
+ - **网页 AI**:在线聊天产品只能阅读房间。在成员栏复制阅读通知交给它,再在输入框选择“代发”粘贴它的回答。网页 AI 访问不到本机地址。
82
+
83
+ 讨论的主持人必须由本机唤醒;手动及网页成员按安排回答,等待代发期间不会伪造“正在处理”状态。
84
+
85
+ ## 技能
86
+
87
+ AI 按随包分发的技能参与房间,`codiscuss setup` 会为选定的软件自动安装:
88
+
89
+ | 技能 | 使用者 | 作用 |
90
+ | --- | --- | --- |
91
+ | [discuss-participant](../.agents/skills/discuss-participant/SKILL.md) | 所有成员 | 阅读、发言与可靠写入 |
92
+ | [discuss-host](../.agents/skills/discuss-host/SKILL.md) | 主持人(同时调用参与技能) | 自由协作中分派与接续成员的工作;讨论中安排发言、保存进度与收束 |
93
+ | [discuss-report](../.agents/skills/discuss-report/SKILL.md) | 报告整理者 | 把已有讨论整理为带原文引用的报告 |
94
+
95
+ 在 Codex 中用 `$discuss-host` 调用;其他软件没有自动发现时,直接要求它读取对应的 `SKILL.md`。
96
+
97
+ ## 附件与导出
98
+
99
+ - **附件**:每条消息最多 10 个,单个最多 20 MiB,图片与 PDF 可在站内预览。上传不代表 AI 已读取。
100
+ - **导出与导入**:房间菜单的“导出对话”下载原始数据与附件;在另一个站点“导入房间…”即可得到可继续使用的副本。在运行本机服务的电脑上导出时,备份会附带成员的软件配置和会话;在同一台电脑导入后,成员请回时续接原会话。Claude Code 成员会改为手动接入,请回后在原窗口重新注册,以免会话分叉。
101
+ - **讨论历史**:备份包含历次讨论、结论和安排,仍支持旧版备份。导入或分支恢复为历史,不继续原讨论,也不重新唤醒成员;Markdown 导出保留安排与回答关联。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai_co_discuss",
3
- "version": "0.2.98",
3
+ "version": "0.3.0",
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/discussion_runner.mjs && node --check runner/discussion_adapters.mjs && node --check runner/discussion_sidecar.mjs && node --check runner/codex_app_client.mjs && node --check runner/discussion_service.mjs && node --check runner/codiscuss.mjs && node --check runner/discussion_launch.mjs && node --check runner/discussion_models.mjs && node --check runner/discussion_setup.mjs && node --check runner/discussion_skills.mjs && node --check runner/discussion_tui.mjs && node --check runner/discussion_local.mjs && node --check runner/free_runner.mjs && node --check runner/discussion_api.mjs && node --check runner/api_participant.mjs && node --check runner/scheduler.mjs && node --check runner/remote_launch.mjs && node --check runner/admin_account.mjs",
11
+ "check": "node --check backend/worker.mjs && node --check web/app.js && node --check runner/discussion_runner.mjs && node --check runner/discussion_adapters.mjs && node --check runner/discussion_sidecar.mjs && node --check runner/codex_app_client.mjs && node --check runner/discussion_service.mjs && node --check runner/codiscuss.mjs && node --check runner/discussion_launch.mjs && node --check runner/discussion_models.mjs && node --check runner/discussion_setup.mjs && node --check runner/discussion_skills.mjs && node --check runner/discussion_tui.mjs && node --check runner/discussion_local.mjs && node --check runner/free_runner.mjs && node --check runner/session_driver.mjs && node --check runner/discussion_api.mjs && node --check runner/api_participant.mjs && node --check runner/scheduler.mjs && node --check runner/remote_launch.mjs && node --check runner/admin_account.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 markdown && vite build --config frontend/vite.config.mjs --mode backup && vite build --config frontend/vite.config.mjs",