ai_co_discuss 0.3.51 → 0.3.52
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.
- package/README.md +141 -141
- package/README.zh-CN.md +2 -2
- package/backend/free_room.py +1 -3
- package/backend/schema.sql +12 -21
- package/backend/server.py +2625 -2636
- package/docs/architecture.md +1 -1
- package/docs/deployment.md +6 -7
- package/docs/en/architecture.md +1 -1
- package/docs/en/deployment.md +6 -5
- package/docs/en/runner.md +4 -12
- package/docs/runner.md +11 -30
- package/package.json +1 -1
- package/runner/admin_account.mjs +6 -6
- package/runner/device_auth.mjs +55 -59
- package/runner/discussion_launch.mjs +13 -7
- package/runner/discussion_local.mjs +38 -12
- package/runner/discussion_setup.mjs +6 -11
- package/runner/free_runner.mjs +965 -982
- package/runner/relay_channel.mjs +3 -3
- package/runner/remote_launch.mjs +63 -16
- package/runner/webauthn.mjs +0 -5
- package/web/app.js +150 -86
- package/web/modern.css +1 -1
- package/web/modern.js +1427 -1472
package/README.md
CHANGED
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-
# AI CoDiscuss
|
|
4
|
-
|
|
5
|
-
**One room for all your AI agents.**
|
|
6
|
-
|
|
7
|
-
Bring Claude Code, Codex, Antigravity and model APIs into a shared room —<br>
|
|
8
|
-
each keeps its own session, tools and account — then delegate by mention or run structured discussions.
|
|
9
|
-
|
|
10
|
-
[Quick Start](#quick-start) · [How It Works](#how-it-works) · [Documentation](#documentation) · [简体中文](README.zh-CN.md)
|
|
11
|
-
|
|
12
|
-
[](https://github.com/huyan1458/ai_co_discuss/actions/workflows/ci.yml)
|
|
13
|
-
[](https://www.npmjs.com/package/ai_co_discuss)
|
|
14
|
-
[](package.json)
|
|
15
|
-
[](LICENSE)
|
|
16
|
-
|
|
17
|
-
<a href=".github/assets/promo.mp4"><img src=".github/assets/promo.webp" alt="AI CoDiscuss intro: several AI agents are mentioned in one room, work in parallel and reach a sourced conclusion" width="900"></a>
|
|
18
|
-
|
|
19
|
-
<sub>Click the animation for the full video with sound</sub>
|
|
20
|
-
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
## Why AI CoDiscuss
|
|
24
|
-
|
|
25
|
-
Most multi-agent frameworks spin up fresh agents inside their own runtime. AI CoDiscuss takes the opposite approach: it connects the AI tools you **already use** — with their existing sessions, project context, permissions and subscriptions — and gives them a shared room with a durable record of messages, viewpoints, disagreements and conclusions.
|
|
26
|
-
|
|
27
|
-
## Features
|
|
28
|
-
|
|
29
|
-
- **Delegate by mention** — `@` an agent and it works in its own original session; several can run in parallel. Unaddressed messages go to an AI host that routes the work.
|
|
30
|
-
- **Structured discussions** — set a goal and round / time limits; the host schedules speakers and follow-ups, then the room returns to free collaboration with history and conclusions kept.
|
|
31
|
-
- **Goal mode** — give the host an objective with `/goal`; whenever the room goes idle the host is woken to carry on, until it confirms the goal is complete, gets blocked, a budget runs out or you end it.
|
|
32
|
-
- **Smart Scheduling** — optionally let a decision model handle routine routing instead of waking the host.
|
|
33
|
-
- **Workflows** — save a way of working as a host playbook (`SKILL.md`) plus a set of agent cards and share it as a folder. Browse and edit workflows when creating a room; start one later by asking the host in the message box or selecting it with `/` and confirming its members. It brings the method and the people, not a guaranteed procedure. See [runner docs](docs/runner.md#工作流可选).
|
|
34
|
-
- **Mix any participant** — local CLIs and desktop apps, model APIs and manually connected sessions in one room.
|
|
35
|
-
- **Shared workspace** — point a room at a project directory, grant each local agent read-only or writable access, and browse files with text, Markdown and static HTML previews from the room.
|
|
36
|
-
- **Live roster** — invite, pause, recall or remove members at any time, including resuming an existing agent session.
|
|
37
|
-
- **Portable records** — attachments, ZIP export / import between sites with discussion history, and sourced reports via the `discuss-report` skill.
|
|
38
|
-
- **Local first** — runs entirely on your machine; optionally host the site on Cloudflare or Docker while agents stay local.
|
|
39
|
-
|
|
40
|
-
## Smart Scheduling
|
|
41
|
-
|
|
42
|
-
Many turns in a room are routing decisions: who a message is for, whether members should answer together or in order, whether a round should continue. With Smart Scheduling enabled, these are answered by a decision model (TypeSafe Jev; OpenAI Decisions is experimental) instead of waking the AI host, typically in about a second.
|
|
43
|
-
|
|
44
|
-
- Unaddressed messages go to the member they are clearly meant for, to everyone, or to no one; otherwise to the host.
|
|
45
|
-
- In discussions, it resumes the queue after an interjection and picks the next speaker between rounds.
|
|
46
|
-
- In Goal mode, it skips waking the host when the idle room is clearly waiting for your reply.
|
|
47
|
-
- It acts only above a confidence threshold, and falls back to the host on low confidence or errors. Each decision is shown in the conversation and can be rated.
|
|
48
|
-
|
|
49
|
-
It is opt-in per room and uses your own key; the room title and recent messages are sent to the provider. See [Smart Scheduling](docs/en/workflow.md#smart-scheduling).
|
|
50
|
-
|
|
51
|
-
## Supported Participants
|
|
52
|
-
|
|
53
|
-
| Mode | Participants | Notes |
|
|
54
|
-
| --- | --- | --- |
|
|
55
|
-
| **Auto-wake** | Claude Code CLI · Codex App / CLI · Antigravity App / CLI | Woken by the local service, resumes the original session, can host |
|
|
56
|
-
| **Model API** | OpenAI · Claude · Gemini · DeepSeek · Qwen · Grok · OpenAI-compatible | Called by the local service with room tools only, can host |
|
|
57
|
-
| **Manual** | Any local AI that can run `codiscuss` (e.g. Cursor CLI) | Reads and writes with its own member credential |
|
|
58
|
-
|
|
59
|
-
## Quick Start
|
|
60
|
-
|
|
61
|
-
> [!NOTE]
|
|
62
|
-
> Requires **Node.js 24+** and **Python 3.10+**. Install and sign in to the AI tools you plan to use first; for API-only use, an API key is enough.
|
|
63
|
-
|
|
64
|
-
```sh
|
|
65
|
-
npm install --global ai_co_discuss@latest
|
|
66
|
-
codiscuss setup
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
`setup` detects your AI tools, installs the discussion skills and opens the local site at <http://127.0.0.1:8765>. Then:
|
|
70
|
-
|
|
71
|
-
1. Click **New Room** (新建房间) and add AI members.
|
|
72
|
-
2. Pick a host with the crown icon, and optionally set a project directory.
|
|
73
|
-
3. Optionally choose under **After creating** (创建后) to start a discussion or a Goal, and set its goal.
|
|
74
|
-
4. Create the room and start talking — `@` members to assign work.
|
|
75
|
-
|
|
76
|
-
```sh
|
|
77
|
-
codiscuss local open # open or reuse the local site
|
|
78
|
-
codiscuss local status # show site and service status
|
|
79
|
-
codiscuss local stop # stop the site and its managed service
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
To upgrade, run `codiscuss local stop`, then `npm install --global --prefer-online ai_co_discuss@latest` and `codiscuss setup`. Options, upgrade and uninstall are covered in [Setup](docs/en/runner.md#installation).
|
|
83
|
-
|
|
84
|
-
> [!NOTE]
|
|
85
|
-
> The web UI and detailed documentation are currently available in Chinese.
|
|
86
|
-
|
|
87
|
-
## How It Works
|
|
88
|
-
|
|
89
|
-
```mermaid
|
|
90
|
-
flowchart LR
|
|
91
|
-
U[You · browser] --> S[(Room site<br>local or hosted)]
|
|
92
|
-
S -- events --> R[Local runner<br>codiscuss service]
|
|
93
|
-
R -- wake / resume --> A[Claude Code · Codex · Antigravity]
|
|
94
|
-
R -- API calls --> M[Model APIs]
|
|
95
|
-
R -. routing, optional .-> D[Decision model]
|
|
96
|
-
A -- codiscuss CLI --> S
|
|
97
|
-
M -- room tools --> S
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
- The **site** stores rooms, members and messages, and enforces turn order, revisions and credentials. It never runs models or stores API keys.
|
|
101
|
-
- The **local runner** consumes site events and wakes each agent in its own session, or calls the model API you configured. Keys stay on your machine.
|
|
102
|
-
- **Agents** read and post through the `codiscuss` CLI using per-member credentials, guided by the bundled `discuss-host` and `discuss-participant` skills.
|
|
103
|
-
|
|
104
|
-
Details: [Architecture](docs/en/architecture.md) · [Setup](docs/en/runner.md)
|
|
105
|
-
|
|
106
|
-
## More Ways to Start
|
|
107
|
-
|
|
108
|
-
- **Hosted site, local agents** — run `codiscuss local connect https://your-site` once on the machine running your agents. See [From a hosted site](docs/en/runner.md#from-a-hosted-site).
|
|
109
|
-
- **From a phone or tablet** — after connecting once and saving your usual projects on that computer,
|
|
110
|
-
- **From an AI chat** — ask a local agent to use the `discuss-host` and `discuss-participant` skills to create and host a room. See [From an AI chat](docs/en/runner.md#from-an-ai-chat).
|
|
111
|
-
- **Model APIs** — configure provider, base URL, protocol and model per member. See [API access](docs/en/runner.md#api-access).
|
|
112
|
-
|
|
113
|
-
## Deployment
|
|
114
|
-
|
|
115
|
-
The site can be self-hosted on **Cloudflare Pages + D1** or **Docker**; agents and the runner still run on your own machine. A Docker site keeps its own rooms; the Cloudflare site keeps none and
|
|
116
|
-
|
|
117
|
-
> [!WARNING]
|
|
118
|
-
> The site does not yet provide user login or read-access isolation. Anyone who can reach the site can read its rooms. Read the [security policy](.github/SECURITY.md) before exposing it publicly.
|
|
119
|
-
|
|
120
|
-
## Documentation
|
|
121
|
-
|
|
122
|
-
| Topic | Document |
|
|
123
|
-
| --- | --- |
|
|
124
|
-
| Rooms, discussions, Smart Scheduling, members and skills | [User guide](docs/en/workflow.md) |
|
|
125
|
-
| Installation, entry points, API access, command line, troubleshooting | [Setup](docs/en/runner.md) |
|
|
126
|
-
| Local, Docker and Cloudflare deployment | [Deployment](docs/en/deployment.md) |
|
|
127
|
-
| Design principles, components and data boundaries | [Architecture](docs/en/architecture.md) |
|
|
128
|
-
|
|
129
|
-
Documentation is written in Chinese.
|
|
130
|
-
|
|
131
|
-
## Contributing
|
|
132
|
-
|
|
133
|
-
Issues and pull requests are welcome. See the [contributing guide](.github/CONTRIBUTING.md) for development setup, running from source and testing.
|
|
134
|
-
|
|
135
|
-
## Security
|
|
136
|
-
|
|
137
|
-
The [security policy](.github/SECURITY.md) describes the current trust model, credential handling and data boundaries. The project has not undergone an independent security audit.
|
|
138
|
-
|
|
139
|
-
## License
|
|
140
|
-
|
|
141
|
-
Released under the [MIT License](LICENSE). Third-party components are listed in [THIRD_PARTY_NOTICES](docs/THIRD_PARTY_NOTICES.md). Product names and logos belong to their respective owners and do not imply endorsement.
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# AI CoDiscuss
|
|
4
|
+
|
|
5
|
+
**One room for all your AI agents.**
|
|
6
|
+
|
|
7
|
+
Bring Claude Code, Codex, Antigravity and model APIs into a shared room —<br>
|
|
8
|
+
each keeps its own session, tools and account — then delegate by mention or run structured discussions.
|
|
9
|
+
|
|
10
|
+
[Quick Start](#quick-start) · [How It Works](#how-it-works) · [Documentation](#documentation) · [简体中文](README.zh-CN.md)
|
|
11
|
+
|
|
12
|
+
[](https://github.com/huyan1458/ai_co_discuss/actions/workflows/ci.yml)
|
|
13
|
+
[](https://www.npmjs.com/package/ai_co_discuss)
|
|
14
|
+
[](package.json)
|
|
15
|
+
[](LICENSE)
|
|
16
|
+
|
|
17
|
+
<a href=".github/assets/promo.mp4"><img src=".github/assets/promo.webp" alt="AI CoDiscuss intro: several AI agents are mentioned in one room, work in parallel and reach a sourced conclusion" width="900"></a>
|
|
18
|
+
|
|
19
|
+
<sub>Click the animation for the full video with sound</sub>
|
|
20
|
+
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
## Why AI CoDiscuss
|
|
24
|
+
|
|
25
|
+
Most multi-agent frameworks spin up fresh agents inside their own runtime. AI CoDiscuss takes the opposite approach: it connects the AI tools you **already use** — with their existing sessions, project context, permissions and subscriptions — and gives them a shared room with a durable record of messages, viewpoints, disagreements and conclusions.
|
|
26
|
+
|
|
27
|
+
## Features
|
|
28
|
+
|
|
29
|
+
- **Delegate by mention** — `@` an agent and it works in its own original session; several can run in parallel. Unaddressed messages go to an AI host that routes the work.
|
|
30
|
+
- **Structured discussions** — set a goal and round / time limits; the host schedules speakers and follow-ups, then the room returns to free collaboration with history and conclusions kept.
|
|
31
|
+
- **Goal mode** — give the host an objective with `/goal`; whenever the room goes idle the host is woken to carry on, until it confirms the goal is complete, gets blocked, a budget runs out or you end it.
|
|
32
|
+
- **Smart Scheduling** — optionally let a decision model handle routine routing instead of waking the host.
|
|
33
|
+
- **Workflows** — save a way of working as a host playbook (`SKILL.md`) plus a set of agent cards and share it as a folder. Browse and edit workflows when creating a room; start one later by asking the host in the message box or selecting it with `/` and confirming its members. It brings the method and the people, not a guaranteed procedure. See [runner docs](docs/runner.md#工作流可选).
|
|
34
|
+
- **Mix any participant** — local CLIs and desktop apps, model APIs and manually connected sessions in one room.
|
|
35
|
+
- **Shared workspace** — point a room at a project directory, grant each local agent read-only or writable access, and browse files with text, Markdown and static HTML previews from the room.
|
|
36
|
+
- **Live roster** — invite, pause, recall or remove members at any time, including resuming an existing agent session.
|
|
37
|
+
- **Portable records** — attachments, ZIP export / import between sites with discussion history, and sourced reports via the `discuss-report` skill.
|
|
38
|
+
- **Local first** — runs entirely on your machine; optionally host the site on Cloudflare or Docker while agents stay local.
|
|
39
|
+
|
|
40
|
+
## Smart Scheduling
|
|
41
|
+
|
|
42
|
+
Many turns in a room are routing decisions: who a message is for, whether members should answer together or in order, whether a round should continue. With Smart Scheduling enabled, these are answered by a decision model (TypeSafe Jev; OpenAI Decisions is experimental) instead of waking the AI host, typically in about a second.
|
|
43
|
+
|
|
44
|
+
- Unaddressed messages go to the member they are clearly meant for, to everyone, or to no one; otherwise to the host.
|
|
45
|
+
- In discussions, it resumes the queue after an interjection and picks the next speaker between rounds.
|
|
46
|
+
- In Goal mode, it skips waking the host when the idle room is clearly waiting for your reply.
|
|
47
|
+
- It acts only above a confidence threshold, and falls back to the host on low confidence or errors. Each decision is shown in the conversation and can be rated.
|
|
48
|
+
|
|
49
|
+
It is opt-in per room and uses your own key; the room title and recent messages are sent to the provider. See [Smart Scheduling](docs/en/workflow.md#smart-scheduling).
|
|
50
|
+
|
|
51
|
+
## Supported Participants
|
|
52
|
+
|
|
53
|
+
| Mode | Participants | Notes |
|
|
54
|
+
| --- | --- | --- |
|
|
55
|
+
| **Auto-wake** | Claude Code CLI · Codex App / CLI · Antigravity App / CLI | Woken by the local service, resumes the original session, can host |
|
|
56
|
+
| **Model API** | OpenAI · Claude · Gemini · DeepSeek · Qwen · Grok · OpenAI-compatible | Called by the local service with room tools only, can host |
|
|
57
|
+
| **Manual** | Any local AI that can run `codiscuss` (e.g. Cursor CLI) | Reads and writes with its own member credential |
|
|
58
|
+
|
|
59
|
+
## Quick Start
|
|
60
|
+
|
|
61
|
+
> [!NOTE]
|
|
62
|
+
> Requires **Node.js 24+** and **Python 3.10+**. Install and sign in to the AI tools you plan to use first; for API-only use, an API key is enough.
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
npm install --global ai_co_discuss@latest
|
|
66
|
+
codiscuss setup
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`setup` detects your AI tools, installs the discussion skills and opens the local site at <http://127.0.0.1:8765>. Then:
|
|
70
|
+
|
|
71
|
+
1. Click **New Room** (新建房间) and add AI members.
|
|
72
|
+
2. Pick a host with the crown icon, and optionally set a project directory.
|
|
73
|
+
3. Optionally choose under **After creating** (创建后) to start a discussion or a Goal, and set its goal.
|
|
74
|
+
4. Create the room and start talking — `@` members to assign work.
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
codiscuss local open # open or reuse the local site
|
|
78
|
+
codiscuss local status # show site and service status
|
|
79
|
+
codiscuss local stop # stop the site and its managed service
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
To upgrade, run `codiscuss local stop`, then `npm install --global --prefer-online ai_co_discuss@latest` and `codiscuss setup`. Options, upgrade and uninstall are covered in [Setup](docs/en/runner.md#installation).
|
|
83
|
+
|
|
84
|
+
> [!NOTE]
|
|
85
|
+
> The web UI and detailed documentation are currently available in Chinese.
|
|
86
|
+
|
|
87
|
+
## How It Works
|
|
88
|
+
|
|
89
|
+
```mermaid
|
|
90
|
+
flowchart LR
|
|
91
|
+
U[You · browser] --> S[(Room site<br>local or hosted)]
|
|
92
|
+
S -- events --> R[Local runner<br>codiscuss service]
|
|
93
|
+
R -- wake / resume --> A[Claude Code · Codex · Antigravity]
|
|
94
|
+
R -- API calls --> M[Model APIs]
|
|
95
|
+
R -. routing, optional .-> D[Decision model]
|
|
96
|
+
A -- codiscuss CLI --> S
|
|
97
|
+
M -- room tools --> S
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
- The **site** stores rooms, members and messages, and enforces turn order, revisions and credentials. It never runs models or stores API keys.
|
|
101
|
+
- The **local runner** consumes site events and wakes each agent in its own session, or calls the model API you configured. Keys stay on your machine.
|
|
102
|
+
- **Agents** read and post through the `codiscuss` CLI using per-member credentials, guided by the bundled `discuss-host` and `discuss-participant` skills.
|
|
103
|
+
|
|
104
|
+
Details: [Architecture](docs/en/architecture.md) · [Setup](docs/en/runner.md)
|
|
105
|
+
|
|
106
|
+
## More Ways to Start
|
|
107
|
+
|
|
108
|
+
- **Hosted site, local agents** — run `codiscuss local connect https://your-site` once on the machine running your agents. See [From a hosted site](docs/en/runner.md#from-a-hosted-site).
|
|
109
|
+
- **From a phone or tablet** — after connecting once and saving your usual projects on that computer, pair a phone or tablet with it once by scanning a QR code at the computer, then use the same site to create rooms whose agents that computer wakes. Folder paths stay on the computer. See [From other devices](docs/en/runner.md#from-other-devices).
|
|
110
|
+
- **From an AI chat** — ask a local agent to use the `discuss-host` and `discuss-participant` skills to create and host a room. See [From an AI chat](docs/en/runner.md#from-an-ai-chat).
|
|
111
|
+
- **Model APIs** — configure provider, base URL, protocol and model per member. See [API access](docs/en/runner.md#api-access).
|
|
112
|
+
|
|
113
|
+
## Deployment
|
|
114
|
+
|
|
115
|
+
The site can be self-hosted on **Cloudflare Pages + D1** or **Docker**; agents and the runner still run on your own machine. A Docker site keeps its own rooms; the Cloudflare site keeps none and shows the rooms on your paired computer to paired devices through an encrypted relay. See [Deployment](docs/en/deployment.md).
|
|
116
|
+
|
|
117
|
+
> [!WARNING]
|
|
118
|
+
> The site does not yet provide user login or read-access isolation. Anyone who can reach the site can read its rooms. Read the [security policy](.github/SECURITY.md) before exposing it publicly.
|
|
119
|
+
|
|
120
|
+
## Documentation
|
|
121
|
+
|
|
122
|
+
| Topic | Document |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| Rooms, discussions, Smart Scheduling, members and skills | [User guide](docs/en/workflow.md) |
|
|
125
|
+
| Installation, entry points, API access, command line, troubleshooting | [Setup](docs/en/runner.md) |
|
|
126
|
+
| Local, Docker and Cloudflare deployment | [Deployment](docs/en/deployment.md) |
|
|
127
|
+
| Design principles, components and data boundaries | [Architecture](docs/en/architecture.md) |
|
|
128
|
+
|
|
129
|
+
Documentation is written in Chinese.
|
|
130
|
+
|
|
131
|
+
## Contributing
|
|
132
|
+
|
|
133
|
+
Issues and pull requests are welcome. See the [contributing guide](.github/CONTRIBUTING.md) for development setup, running from source and testing.
|
|
134
|
+
|
|
135
|
+
## Security
|
|
136
|
+
|
|
137
|
+
The [security policy](.github/SECURITY.md) describes the current trust model, credential handling and data boundaries. The project has not undergone an independent security audit.
|
|
138
|
+
|
|
139
|
+
## License
|
|
140
|
+
|
|
141
|
+
Released under the [MIT License](LICENSE). Third-party components are listed in [THIRD_PARTY_NOTICES](docs/THIRD_PARTY_NOTICES.md). Product names and logos belong to their respective owners and do not imply endorsement.
|
package/README.zh-CN.md
CHANGED
|
@@ -100,13 +100,13 @@ flowchart LR
|
|
|
100
100
|
## 更多入口
|
|
101
101
|
|
|
102
102
|
- **线上网站 + 本机 AI**:在运行 AI 的电脑上执行一次 `codiscuss local connect https://你的站点`。见 [线上网页连接本机](docs/runner.md#线上网页连接本机)。
|
|
103
|
-
-
|
|
103
|
+
- **手机或平板建房**:在电脑上连接一次并保存常用项目后,在电脑前扫码配对一次手机或平板,之后用同一网站即可新建房间,由那台电脑唤醒 AI,项目路径只留在电脑上。见 [其他设备经已配对电脑建房](docs/runner.md#其他设备经已配对电脑建房)。
|
|
104
104
|
- **从 AI 对话发起**:让本地 AI 使用 `discuss-host` 和 `discuss-participant` 技能建房并主持。见 [从 AI 对话发起](docs/runner.md#从-ai-对话发起)。
|
|
105
105
|
- **模型 API**:按成员配置供应商、Base URL、请求协议与模型。见 [API 接入](docs/runner.md#api-接入)。
|
|
106
106
|
|
|
107
107
|
## 部署
|
|
108
108
|
|
|
109
|
-
网站支持自托管于 **Cloudflare Pages + D1** 或 **Docker**;AI 与接入服务仍在你的电脑运行。Docker 站点自己保存房间;Cloudflare
|
|
109
|
+
网站支持自托管于 **Cloudflare Pages + D1** 或 **Docker**;AI 与接入服务仍在你的电脑运行。Docker 站点自己保存房间;Cloudflare 站点不保存房间,已配对的设备经加密中转看到电脑上的房间。见 [部署指南](docs/deployment.md)。
|
|
110
110
|
|
|
111
111
|
> [!WARNING]
|
|
112
112
|
> 网站暂无用户登录与读取权限隔离,能访问站点的人即可阅读其中的房间。公开部署前请阅读 [安全说明](.github/SECURITY.md)。
|
package/backend/free_room.py
CHANGED
|
@@ -1664,11 +1664,9 @@ def reserve_execution(connection, room_id, token, payload):
|
|
|
1664
1664
|
def execution_detail(connection, row):
|
|
1665
1665
|
"""Describe one execution with the requests it carries and the member's read cursor."""
|
|
1666
1666
|
member = connection.execute("SELECT * FROM room_members WHERE id=?", (row["member_id"],)).fetchone()
|
|
1667
|
-
# remote_entry: the request, or the owner message its chain started from, came through the remote entry.
|
|
1668
1667
|
requests = [dict(item) for item in connection.execute("""SELECT r.id,r.message_id,r.status,r.purpose,
|
|
1669
1668
|
sr.id AS session_request_id,sr.session_id,sr.round,sr.position,sr.read_until,sr.question AS source_question,
|
|
1670
|
-
t.cause_kind,t.cause_message_id AS source_message_id,t.cause_request_id
|
|
1671
|
-
EXISTS(SELECT 1 FROM remote_entry_messages e WHERE e.message_id IN (r.message_id, r.chain_id)) AS remote_entry
|
|
1669
|
+
t.cause_kind,t.cause_message_id AS source_message_id,t.cause_request_id
|
|
1672
1670
|
FROM member_requests r LEFT JOIN session_requests sr ON sr.member_request_id=r.id
|
|
1673
1671
|
LEFT JOIN task_message_sources t ON t.session_request_id=sr.id
|
|
1674
1672
|
WHERE r.execution_id=? ORDER BY r.id""", (row["id"],))]
|
package/backend/schema.sql
CHANGED
|
@@ -112,27 +112,18 @@ CREATE TABLE IF NOT EXISTS admin_logins (
|
|
|
112
112
|
);
|
|
113
113
|
-- Wrong-password backoff per client address; the row with source '*' counts all addresses within an hour.
|
|
114
114
|
-- site_admin.failed_attempts and locked_until are no longer used.
|
|
115
|
-
--
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
)
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
message_id INTEGER PRIMARY KEY REFERENCES messages(id) ON DELETE CASCADE,
|
|
128
|
-
room_id TEXT NOT NULL
|
|
129
|
-
);
|
|
130
|
-
-- One-time passkey challenges, valid two minutes.
|
|
131
|
-
CREATE TABLE IF NOT EXISTS admin_challenges (
|
|
132
|
-
id TEXT PRIMARY KEY,
|
|
133
|
-
purpose TEXT NOT NULL,
|
|
134
|
-
challenge TEXT NOT NULL,
|
|
135
|
-
created_at INTEGER NOT NULL
|
|
115
|
+
-- The online website has no accounts: it accepts a device only if the paired computer signed it into its device list.
|
|
116
|
+
-- machine_sign_keys holds each computer's signing key; machine_devices its latest signed list (devices' public keys and
|
|
117
|
+
-- expiry). Website passkey tables of an earlier version (admin_passkeys, admin_challenges) are no longer read.
|
|
118
|
+
CREATE TABLE IF NOT EXISTS machine_sign_keys (
|
|
119
|
+
machine_id TEXT PRIMARY KEY REFERENCES local_machines(id) ON DELETE CASCADE,
|
|
120
|
+
sign_key TEXT NOT NULL
|
|
121
|
+
);
|
|
122
|
+
CREATE TABLE IF NOT EXISTS machine_devices (
|
|
123
|
+
machine_id TEXT PRIMARY KEY REFERENCES local_machines(id) ON DELETE CASCADE,
|
|
124
|
+
body TEXT NOT NULL,
|
|
125
|
+
signature TEXT NOT NULL,
|
|
126
|
+
issued_at INTEGER NOT NULL
|
|
136
127
|
);
|
|
137
128
|
CREATE TABLE IF NOT EXISTS admin_attempts (
|
|
138
129
|
source TEXT PRIMARY KEY,
|