@alexsun-top/opencode-chat-room 0.7.8 → 0.8.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.
- package/CHANGELOG.md +14 -1
- package/LICENSE +21 -0
- package/README.md +45 -36
- package/README.zh-CN.md +50 -41
- package/dist/cli.js +2629 -350
- package/package.json +13 -3
- package/packages/chat-room-channeld/README.md +242 -0
- package/packages/chat-room-channeld/dist/feishu-adapter.js +499 -0
- package/packages/chat-room-channeld/dist/mock-adapter.js +295 -0
- package/packages/chat-room-channeld/src/adapter.ts +475 -0
- package/packages/chat-room-channeld/src/cli.ts +124 -0
- package/packages/chat-room-channeld/src/config.ts +207 -0
- package/packages/chat-room-channeld/src/delivery.ts +158 -0
- package/packages/chat-room-channeld/src/feishu-adapter.ts +473 -0
- package/packages/chat-room-channeld/src/framing.ts +128 -0
- package/packages/chat-room-channeld/src/host-helpers.ts +41 -0
- package/packages/chat-room-channeld/src/host.ts +509 -0
- package/packages/chat-room-channeld/src/ingest-gate.ts +108 -0
- package/packages/chat-room-channeld/src/log.ts +26 -0
- package/packages/chat-room-channeld/src/mock-adapter.ts +206 -0
- package/packages/chat-room-channeld/src/protocol.ts +75 -0
- package/packages/chat-room-channeld/src/published.ts +37 -0
- package/packages/chat-room-channeld/src/rules.ts +127 -0
- package/packages/chat-room-channeld/src/state.ts +485 -0
- package/packages/chat-room-channeld/src/stats.ts +167 -0
- package/plugin.ts +22 -5
- package/server/addressing-routes.ts +130 -0
- package/server/assets/NOTICE.txt +2 -2
- package/server/assets/SHIKI-LICENSE +22 -0
- package/server/assets/base.css +9 -1
- package/server/assets/chat/doc-preview.js +3 -4
- package/server/assets/chat/forward.js +69 -0
- package/server/assets/chat/index.js +2 -0
- package/server/assets/chat/locales/de.js +5 -0
- package/server/assets/chat/locales/es.js +5 -0
- package/server/assets/chat/locales/fr.js +5 -0
- package/server/assets/chat/locales/it.js +5 -0
- package/server/assets/chat/locales/ja.js +5 -0
- package/server/assets/chat/locales/ko.js +5 -0
- package/server/assets/chat/markdown-footnotes.js +115 -0
- package/server/assets/chat/markdown.js +24 -35
- package/server/assets/chat/palette.js +1 -1
- package/server/assets/chat/replies.js +7 -1
- package/server/assets/chat/shiki.js +87 -0
- package/server/assets/chat/side-pane.js +8 -1
- package/server/assets/chat/state.js +14 -1
- package/server/assets/chat/system-messages.js +2 -0
- package/server/assets/code-highlight.css +20 -31
- package/server/assets/conversation.css +3 -2
- package/server/assets/doc-preview.css +2 -1
- package/server/assets/responsive.css +5 -0
- package/server/assets/shiki.bundle.js +152 -0
- package/server/channels.ts +314 -0
- package/server/chat-server.ts +27 -4
- package/server/chat.html +10 -3
- package/server/sw.js +1 -2
- package/skills/chatroom/SKILL.md +1 -1
- package/src/center/center-client.ts +79 -1
- package/src/config/file-config.ts +34 -0
- package/src/runtime/v2-plugin.ts +8 -2
- package/src/runtime/watch.ts +3 -2
- package/src/state/sqlite-state.ts +42 -11
- package/src/state/store.ts +9 -3
- package/src/tui/http.mjs +16 -2
- package/src/tui/main.mjs +1 -1
- package/server/assets/HIGHLIGHT-LICENSE +0 -29
- package/server/assets/highlight-10.7.3.min.js +0 -1358
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.0 — 2026-11-25
|
|
4
|
+
|
|
5
|
+
- Let agents address earlier messages directly. `get_message` returns author, sequence, parent, resources, and recall status; a recalled message returns an explicit tombstone without its text or attachments. `send` accepts `parentMessageId`, and `catch_up` reads persisted messages after a cursor with bounded pages, has-more, unread mentions, and open questions. Cross-room, cross-host, non-member, kicked, and pending identities get the same 404, and catch-up never marks messages read or calls the model.
|
|
6
|
+
- Add Channel D forwarding behind `server.channeld`, enabled when configured and off without a config. A room message can be forwarded to a configured target from the message actions; ordinary messages never produce a relay delivery or notification, only an explicit forward does. Channel deliveries and receipts live in a separate `channeld.sqlite`; a terminal delivery records one queryable `result.published` event without message content and then writes a localized system message back to the room; deleting that file with the feature disabled is a full rollback. The release ships an outbound Feishu adapter that sends interactive cards with `lark_md` inline formatting (block Markdown such as headings, lists, and fenced code awaits the card 2.0 upgrade in 0.8.x) and a mock adapter for tests; native Feishu reply and Feishu-to-room inbound relay remain planned for 0.8.x. A config path enables the feature automatically, while no config leaves it off. Queue health is counts-only: `GET /channeld/status` on the server reports queue depth, oldest backlog, delivery states, unknown/retry/rate-limit counts, and event/delivery/receipt gaps without message content.
|
|
7
|
+
- Highlight messages and text/code previews with a lazily loaded Shiki 4.6 bundle covering 16 languages, including TSX and JSX. Light and dark themes reuse the existing code tokens, and a failed or blocked bundle falls back to escaped plain text without losing wrap, copy, or language labels.
|
|
8
|
+
- Give file actions matching Fluent icons: message-card download and preview, the file menu's delete item, the preview header's download, and the already icon-only Files row actions. Icons are 16px, baseline-aligned, keep their accessible labels, and survive language changes.
|
|
9
|
+
- Make the palette search-first: any input that does not start with `/` searches messages as you type, while `/` lists commands only. Typing no longer requires Tab, and commands no longer appear among message results.
|
|
10
|
+
- Widen the task board on large screens while keeping at least 700px for the conversation, and keep the board open when switching rooms.
|
|
11
|
+
- Bound catch-up open-question references at 200 while still reporting the total count, so a room with hundreds of open questions cannot produce an unbounded response.
|
|
12
|
+
- Render Markdown footnotes as numbered internal anchors with a footnote list instead of letting the parser turn a definition into a relative link; only external links open a new tab, and relative or same-origin API links no longer navigate to an unauthenticated error page. A reference inside deeply nested list indentation may render as paragraph text rather than a code block because of Marked's indentation rules; no placeholder text leaks.
|
|
13
|
+
- Resolve the packaged `watch` command and TUI isolation regressions, and report a clear central-only error when a standalone client asks for message addressing.
|
|
14
|
+
- License the project under MIT and streamline the English and Chinese READMEs.
|
|
15
|
+
|
|
3
16
|
## 0.7.8 — 2026-11-24
|
|
4
17
|
|
|
5
18
|
- Make the web and terminal palettes search-first: anything that does not start with `/` is live message search as you type, and `/` lists commands only. Commands no longer mix into search results, and an idle palette shows a hint instead of a command list. Command filtering matches both the localized label and an English alias, and Chinese/Japanese/Korean IME commits filter on composition end instead of leaving the full list.
|
|
@@ -16,7 +29,7 @@
|
|
|
16
29
|
- Cache recently viewed room images in the service worker so repeated and offline loads are faster. The cache is bounded (80 entries, 64 MiB, 30-day prune), partitioned by browser identity, cleared when the identity or token changes, and keeps the same security headers on cache hits.
|
|
17
30
|
- Stop pinch zoom from resizing the app: the viewport height sync ignores non-1 visual viewport scales, so the layout no longer collapses under a zoom gesture.
|
|
18
31
|
- Tighten the mobile layout: a shorter header, a smaller composer with the input and buttons on one line, and a sliding room drawer with a fading backdrop. Keyboard-shortcut hints are hidden on real mobile devices (Android, iOS, and touch-capable iPadOS) but remain in narrow desktop windows.
|
|
19
|
-
- Preview plain-text and code room files in the reading pane with syntax highlighting, and open PDFs in the native viewer. Text-like files, Markdown included, gain a copy action
|
|
32
|
+
- Preview plain-text and code room files in the reading pane with syntax highlighting, and open PDFs in the native viewer. Text-like files, Markdown included, gain a copy action in the Files list and the preview header; text over 2 MiB shows a download notice instead of rendering.
|
|
20
33
|
- Fix the Codex plugin when Codex copies it into its plugin cache: YAML configuration loads only when needed, so a cached copy without `node_modules` still serves JSON/JSONC configs, and a plugin failure no longer blocks Codex session startup.
|
|
21
34
|
|
|
22
35
|
## 0.7.7 — 2026-11-23
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alex Sun
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# OC Chat
|
|
2
2
|
|
|
3
|
-
Chat in shared rooms with OpenCode agents and people.
|
|
3
|
+
Chat in shared rooms with OpenCode agents and people. Use the web or terminal client; one server connects multiple hosts.
|
|
4
4
|
|
|
5
|
-
[简体中文](README.zh-CN.md) · [Technical reference](
|
|
5
|
+
[简体中文](README.zh-CN.md) · [Technical reference](docs/reference.en.md) · [Changelog](CHANGELOG.md)
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
### 1. Add the plugin
|
|
8
10
|
|
|
9
11
|
Install [Bun](https://bun.sh), then add the plugin to `~/.config/opencode/opencode.json`:
|
|
10
12
|
|
|
@@ -15,21 +17,19 @@ Install [Bun](https://bun.sh), then add the plugin to `~/.config/opencode/openco
|
|
|
15
17
|
}
|
|
16
18
|
```
|
|
17
19
|
|
|
18
|
-
Restart OpenCode
|
|
20
|
+
Restart OpenCode and ask an agent to create a room, or enter `/room create dev`.
|
|
19
21
|
|
|
20
|
-
When upgrading
|
|
22
|
+
When upgrading, quit OpenCode first or run `opencode plugin add @alexsun-top/opencode-chat-room@<version>`. Editing the version while OpenCode is running can leave a broken package cache under `~/.cache/opencode/npm/`; delete that directory and add the plugin again to recover.
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
### 2. Start a server
|
|
23
25
|
|
|
24
|
-
On a machine reachable by the other devices
|
|
26
|
+
On a machine reachable by the other devices:
|
|
25
27
|
|
|
26
28
|
```bash
|
|
27
|
-
npx --yes --package=@alexsun-top/opencode-chat-room@0.
|
|
29
|
+
npx --yes --package=@alexsun-top/opencode-chat-room@0.8.0 -- opencode-chat-room --host 0.0.0.0 --port 4399 --token 'your-password'
|
|
28
30
|
```
|
|
29
31
|
|
|
30
|
-
The server runs on Node.js 24.2+, Deno 2, or Bun
|
|
31
|
-
|
|
32
|
-
On each machine running OpenCode, set the server address and the same password, then start OpenCode from that environment:
|
|
32
|
+
The server runs on Node.js 24.2+, Deno 2, or Bun. On each OpenCode machine, set the address and the same token, then start OpenCode:
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
35
|
export CHAT_ROOM_SERVER_URL="http://SERVER_IP:4399"
|
|
@@ -37,47 +37,56 @@ export CHAT_ROOM_SERVER_TOKEN="your-password"
|
|
|
37
37
|
opencode
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
Environment variables can be replaced by
|
|
41
|
-
|
|
42
|
-
Open `http://SERVER_IP:4399/chat` in a browser and enter the same password in Settings. The same dialog, available before joining and from the chat menu, groups language, theme, scrolling, and the access token under General, Appearance, and Connection. Create or join a room there, and ask each agent to join it too.
|
|
40
|
+
Open `http://SERVER_IP:4399/chat` and enter the token in Settings. Environment variables can be replaced by a `chatroom.json`, `chatroom.jsonc`, `chatroom.yaml`, or `chatroom.yml`; see the [configuration reference](docs/reference.en.md#configuration-file).
|
|
43
41
|
|
|
44
|
-
**Security:**
|
|
42
|
+
**Security:** anyone with the shared token can access and manage rooms, including direct chats. Join approval controls the normal join flow, not per-user authentication. Share the token only with trusted people and protect network access to the server.
|
|
45
43
|
|
|
46
44
|
### Docker
|
|
47
45
|
|
|
48
|
-
Every release also publishes a container image, so nothing needs to be built:
|
|
49
|
-
|
|
50
46
|
```bash
|
|
51
47
|
docker run --rm -p 4399:4399 -v chat-room-data:/data \
|
|
52
48
|
-e CHAT_ROOM_SERVER_TOKEN='your-password' \
|
|
53
49
|
ghcr.io/agentsyaml/opencode-chat-room:latest
|
|
54
50
|
```
|
|
55
51
|
|
|
56
|
-
Pin a release with `ghcr.io/agentsyaml/opencode-chat-room:v0.
|
|
52
|
+
Pin a release with `ghcr.io/agentsyaml/opencode-chat-room:v0.8.0`. Rooms and files live in the `/data` volume; keep it across upgrades. A host bind mount must be writable by uid `10001`.
|
|
53
|
+
|
|
54
|
+
## Channel D (Feishu outbound)
|
|
55
|
+
|
|
56
|
+
Channel D is an optional forwarding sidecar, not a second chat. It forwards selected room messages to external targets. This release includes an outbound Feishu adapter and a mock adapter for tests; enable it only in central mode with a config path:
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"server": {
|
|
61
|
+
"channeld": {
|
|
62
|
+
"config": "/etc/chatroom/channeld.yml"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
59
67
|
|
|
60
|
-
|
|
61
|
-
- When creating or editing a room, turn on **Require approval to join**. You and other human administrators approve people and Agents from the member panel; a designated management agent can also approve Agent requests. A pending applicant is not a member yet.
|
|
62
|
-
- The Edit room dialog groups room details, joining and approval, members and roles, and ownership. Only the owner sees the ownership tab.
|
|
63
|
-
- Use Reply to respond to a message. Mark a message as a question when you need an answer.
|
|
64
|
-
- Use the room's reminder button for one-time or recurring reminders. Times default to the server's time zone.
|
|
65
|
-
- Reminder text supports `{{time}}`, `{{initiator}}`, and `{{room}}`.
|
|
66
|
-
- A compact shortcut chip under the composer shows Alt+/ (Option+/ on Mac); click it or press the keys to open the sheet. Alt+1…9 switches to a joined room by its position in the rail, Alt+Home/Alt+End smoothly scroll to the oldest/latest loaded message, and PageUp/PageDown scrolls the conversation in one animated step while you type, and Settings sets that step with a slider as a percentage of the conversation height (default 90%).
|
|
67
|
-
- Press Alt+Space (Option+Space on Mac) or Ctrl+P anywhere, including the composer, to search messages. Search starts in the current room; Tab switches to all joined rooms and back. Type `/` to filter common commands instead. ↑/↓ and Enter open a result and highlight it in the conversation; Esc or a backdrop click closes and returns to the composer.
|
|
68
|
-
- Attach files, drag them in, or paste images. The default limit is 500 MiB per file. Room Options also opens Announcements, Files, and Tasks. Files can be filtered by uploader, preview supported media and Markdown documents, and downloaded or deleted. Tasks open in a fixed right pane on wide screens and a modal on small ones. A task tracks title, description, assignee, due date, participants, checklist steps, conclusion, and todo/doing/done status; members create tasks, creators and human administrators manage them, assignees update status or step completion, and completed tasks can be cleared from the pane header.
|
|
69
|
-
- In a terminal, run `bunx --package @alexsun-top/opencode-chat-room@0.7.8 opencode-chat-room cli` against the same server. The terminal client is built into the main package, renders Markdown with highlighted mentions, and supports room navigation, pending joins, sending, members, announcements, questions and asking, files, reminders, room settings, join approvals, recall/reveal/reply by message ID, settings, and Alt+Space (or Ctrl+P) search. Typing `/` at the start of the composer opens a filtered inline command popup without leaving the input; typing `@` suggests room members and `@all`, inserts a highlighted mention, and sends the canonical mention tag. Commands include quit. It uses OpenTUI: Bun 1.3.14+ is recommended, Node.js 26.4+ needs `--experimental-ffi`, and Deno is not supported for this client. If `bunx` starts the package with Node but a supported Bun is installed, the CLI relaunches itself with Bun. Only `cli` loads OpenTUI; the server and `watch` stay on Node.js 24.2+, Deno 2, and Bun.
|
|
70
|
-
- Fenced code blocks are syntax-highlighted locally. Hover or focus a block for icon-only wrap and copy controls.
|
|
71
|
-
- Agents can recall a message by ID; the original stays available to current members.
|
|
72
|
-
- Agents can use the `room` tool's `read_resource` action to save an attachment to a temporary file before opening it.
|
|
68
|
+
Or set `CHAT_ROOM_CHANNELD_CONFIG=/path/channeld.yml`. A config enables it; no config keeps it off, and `CHAT_ROOM_CHANNELD=0` or `"enabled": false` overrides the config. The YAML defines accounts and rules; see the [Channel D reference](docs/reference.en.md#channel-d-feishu-outbound). The Feishu adapter reads `FEISHU_APP_ID` and `FEISHU_APP_SECRET`, with optional `FEISHU_BASE_URL`; a rule target's `room` is the Feishu `chat_id`.
|
|
73
69
|
|
|
74
|
-
|
|
70
|
+
Forwarding is explicit: messages gain a Forward action when a rule matches, ordinary messages are never relayed automatically. Terminal deliveries record an ID/state-only `result.published` event and write a localized system message back to the room. State lives in `<stateDir>/channeld.sqlite`, separate from the room database; disable the feature, stop the server, and delete that file to roll back. Feishu uses card 1.0 `lark_md` inline formatting; block Markdown, native reply/quote, and inbound relay are planned for 0.8.x.
|
|
75
71
|
|
|
76
|
-
|
|
72
|
+
## What you can do
|
|
77
73
|
|
|
78
|
-
|
|
74
|
+
- **Rooms and people:** create or join rooms, invite devices, approve joins, manage members and owners, and open direct chats.
|
|
75
|
+
- **Messages:** reply, mark questions, recall with a recoverable original, and mention people or `@all`.
|
|
76
|
+
- **Files:** attach, drag, or paste up to 500 MiB; preview images, media, Markdown, text, code, and PDF; download or delete.
|
|
77
|
+
- **Tasks:** track title, assignee, due date, participants, steps, conclusion, and todo/doing/done state in a side pane or modal.
|
|
78
|
+
- **Reminders:** schedule one-time or cron reminders; text supports `{{time}}`, `{{initiator}}`, and `{{room}}`.
|
|
79
|
+
- **Search and shortcuts:** Alt+Space or Ctrl+P searches messages; `/` filters commands in the composer. Alt+1…9 switches rooms. More shortcuts are in Settings.
|
|
80
|
+
- **Terminal:** run `bunx --package @alexsun-top/opencode-chat-room@0.8.0 opencode-chat-room cli` against the same server. It supports rooms, messages, files, reminders, approval, and search. Bun 1.3.14+ is recommended; only the CLI loads OpenTUI.
|
|
81
|
+
- **Code:** fenced blocks are highlighted by a lazily loaded Shiki bundle with wrap and copy controls.
|
|
82
|
+
- **Web app:** the interface installs to a phone home screen and starts offline from cache; chat data is never cached.
|
|
79
83
|
|
|
80
84
|
## More help
|
|
81
85
|
|
|
82
|
-
- [Configuration, administrator features, and API reference](
|
|
86
|
+
- [Configuration, administrator features, and API reference](docs/reference.en.md)
|
|
83
87
|
- [Changelog](CHANGELOG.md)
|
|
88
|
+
- Ask an agent in a room; the bundled `chatroom` skill describes the full room workflow.
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
MIT
|
package/README.zh-CN.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# OC Chat
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
与 OpenCode Agent 和人在共享房间里聊天。用网页或终端客户端;一个服务端连接多台主机。
|
|
4
4
|
|
|
5
|
-
[English](README.md) · [
|
|
5
|
+
[English](README.md) · [技术参考](docs/reference.zh-CN.md) · [更新日志](CHANGELOG.md)
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 快速开始
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### 1. 安装插件
|
|
10
|
+
|
|
11
|
+
先安装 [Bun](https://bun.sh),再把插件加入 `~/.config/opencode/opencode.json`:
|
|
10
12
|
|
|
11
13
|
```json
|
|
12
14
|
{
|
|
@@ -15,69 +17,76 @@
|
|
|
15
17
|
}
|
|
16
18
|
```
|
|
17
19
|
|
|
18
|
-
重启 OpenCode
|
|
20
|
+
重启 OpenCode,让 Agent 创建一个房间,或输入 `/room create dev`。
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
升级时先退出 OpenCode,或运行 `opencode plugin add @alexsun-top/opencode-chat-room@<version>`。在 OpenCode 运行时改版本号可能在 `~/.cache/opencode/npm/` 留下损坏的包缓存;删除该目录后重新添加插件即可恢复。
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
### 2. 启动服务端
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
在一台其他设备可访问的机器上运行:
|
|
25
27
|
|
|
26
28
|
```bash
|
|
27
|
-
npx --yes --package=@alexsun-top/opencode-chat-room@0.
|
|
29
|
+
npx --yes --package=@alexsun-top/opencode-chat-room@0.8.0 -- opencode-chat-room --host 0.0.0.0 --port 4399 --token 'your-password'
|
|
28
30
|
```
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
在每台运行 OpenCode 的机器上设置服务器地址和相同密码,再从该环境启动 OpenCode:
|
|
32
|
+
服务端支持 Node.js 24.2+、Deno 2 或 Bun。每台运行 OpenCode 的机器设置地址和同一个令牌,然后启动 OpenCode:
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
export CHAT_ROOM_SERVER_URL="http
|
|
36
|
-
export CHAT_ROOM_SERVER_TOKEN="
|
|
35
|
+
export CHAT_ROOM_SERVER_URL="http://SERVER_IP:4399"
|
|
36
|
+
export CHAT_ROOM_SERVER_TOKEN="your-password"
|
|
37
37
|
opencode
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
在浏览器打开 `http://服务器IP:4399/chat`,在设置窗口中填入相同密码。同一个设置窗口在加入房间前和聊天菜单中都能打开,按通用、外观、连接三个类别组织语言、主题、滚动选项和访问令牌。然后创建或加入房间,每个 Agent 也需要加入同一个房间。
|
|
40
|
+
打开 `http://SERVER_IP:4399/chat`,在设置里填入同一个令牌。也可以用 `chatroom.json`、`chatroom.jsonc`、`chatroom.yaml` 或 `chatroom.yml` 代替环境变量;详见[配置参考](docs/reference.zh-CN.md#配置文件)。
|
|
43
41
|
|
|
44
|
-
|
|
42
|
+
**安全:** 持有共享令牌的人可以访问和管理所有房间,包括私聊。加入审核只控制正常加入流程,不是按用户认证。令牌只发给可信的人,并保护服务端的网络访问。
|
|
45
43
|
|
|
46
44
|
### Docker
|
|
47
45
|
|
|
48
|
-
每次发版同时发布容器镜像,不需要自己构建:
|
|
49
|
-
|
|
50
46
|
```bash
|
|
51
47
|
docker run --rm -p 4399:4399 -v chat-room-data:/data \
|
|
52
|
-
-e CHAT_ROOM_SERVER_TOKEN='
|
|
48
|
+
-e CHAT_ROOM_SERVER_TOKEN='your-password' \
|
|
53
49
|
ghcr.io/agentsyaml/opencode-chat-room:latest
|
|
54
50
|
```
|
|
55
51
|
|
|
56
|
-
用 `ghcr.io/agentsyaml/opencode-chat-room:v0.
|
|
52
|
+
用 `ghcr.io/agentsyaml/opencode-chat-room:v0.8.0` 固定版本。房间和文件保存在 `/data` 卷里,升级时不要删除。若改用宿主机目录绑定,目录需允许 uid `10001` 写入。
|
|
53
|
+
|
|
54
|
+
## Channel D(飞书出站)
|
|
55
|
+
|
|
56
|
+
Channel D 是可选的转发侧车,不是另一套聊天。它把选定的房间消息转发到外部目标。本版包含飞书出站 adapter 和用于测试的 mock adapter;只在中心模式用配置路径启用:
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"server": {
|
|
61
|
+
"channeld": {
|
|
62
|
+
"config": "/etc/chatroom/channeld.yml"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
59
67
|
|
|
60
|
-
-
|
|
61
|
-
- 创建或编辑房间时可开启「需审核加入」。你和其他人类管理员在成员面板审核人和 Agent;被指定的管理 Agent 也可以审核 Agent 的申请。待审核的申请人还不算成员。
|
|
62
|
-
- 编辑房间按房间资料、加入与审核、成员与角色、所有权分组;所有权仅房主可见。
|
|
63
|
-
- 回复消息时点击回复;需要对方回答的问题可标记为「问题」。
|
|
64
|
-
- 点击房间里的提醒按钮,可创建一次性或周期提醒。默认使用服务器时区。
|
|
65
|
-
- 提醒正文支持 `{{time}}`、`{{initiator}}`、`{{room}}` 模板变量。
|
|
66
|
-
- 输入框下方保留唯一快捷键入口,以紧凑标签显示 Alt+/(Mac 为 Option+/);点击或按快捷键都能打开面板。Alt+1…9 按房间在侧栏中的位置切换已加入房间,Alt+Home/Alt+End 平滑滚动到最早/最新的已加载消息,输入时用 PageUp/PageDown 按动画滚动一屏,步长可在设置中用滑动条按会话高度百分比调整(默认 90%)。
|
|
67
|
-
- 在任意位置(包括输入框)按 Alt+Space(Mac 为 Option+Space)或 Ctrl+P 打开搜索:默认搜索当前房间,按 Tab 切换到全部已加入房间;输入 `/` 可改为过滤常用命令。↑/↓ 加 Enter 打开结果并在会话中高亮;Esc 或点击遮罩关闭并回到输入框。
|
|
68
|
-
- 点击附件按钮、拖入文件或粘贴图片即可分享;默认单文件上限为 500 MiB。房间选项里还有“公告”“文件”和“任务”;文件可以按上传者筛选、预览支持的媒体和 Markdown 文档,并下载或删除。任务在宽屏固定显示于右侧,小屏使用弹窗。任务包含标题、描述、负责人、截止日期、参与人员、完成步骤、结论,以及待办/进行中/完成状态;成员可新建,创建者和人类管理员可管理,负责人可更新状态或勾选步骤,面板顶部可以清除已完成任务。
|
|
69
|
-
- 终端里可以运行 `bunx --package @alexsun-top/opencode-chat-room@0.7.8 opencode-chat-room cli` 连接同一个服务器。终端客户端已并入主包,会渲染 Markdown 并高亮提及,支持房间切换、待审批加入、发消息、成员、公告、提问与发起提问、文件、提醒、房间设置、加入审核、按消息 ID 撤回/揭示/回复、设置和 Alt+Space(或 Ctrl+P)搜索;在输入框开头输入 `/` 会在输入框上方展开可过滤的命令建议,不会离开输入框;输入 `@` 会出现房间成员和 `@all` 建议,选中后在输入框内高亮显示,发送时转换为标准提及标签 `<at>@名字</at>`。命令包含退出程序。它使用 OpenTUI:推荐 Bun 1.3.14+,Node.js 26.4+ 需要 `--experimental-ffi`,Deno 不支持该客户端。如果 `bunx` 使用 Node 启动但本机安装了受支持的 Bun,CLI 会自动改用 Bun 重新启动。只有 `cli` 会加载 OpenTUI;服务端和 `watch` 仍支持 Node.js 24.2+、Deno 2 和 Bun。
|
|
70
|
-
- 围栏代码块会在本地做语法高亮;鼠标悬停或键盘聚焦时显示纯图标的自动换行和复制按钮。
|
|
71
|
-
- Agent 可按消息 ID 撤回;当前成员仍可查看原文。
|
|
72
|
-
- Agent 收到附件后可通过 `room` 的 `read_resource` 操作保存到临时文件,再打开查看。
|
|
68
|
+
或设置 `CHAT_ROOM_CHANNELD_CONFIG=/path/channeld.yml`。有配置就启用,没有配置保持关闭,`CHAT_ROOM_CHANNELD=0` 或 `"enabled": false` 可以覆盖配置强制关闭。YAML 定义账号和规则;详见 [Channel D 参考](docs/reference.zh-CN.md#channel-d飞书出站)。飞书 adapter 读取 `FEISHU_APP_ID` 和 `FEISHU_APP_SECRET`,可选 `FEISHU_BASE_URL`;规则目标的 `room` 就是飞书 `chat_id`。
|
|
73
69
|
|
|
74
|
-
|
|
70
|
+
转发是显式动作:规则命中后消息上出现“转发”操作,普通消息不会被自动转发。终态投递会记录一条仅含 ID/状态的 `result.published` 事件,再向房间写一条本地化系统消息。状态保存在 `<stateDir>/channeld.sqlite`,与房间数据库分开;关闭功能、停止服务并删除该文件即可回滚。飞书使用 card 1.0 `lark_md` 行内格式;块级 Markdown、原生引用和回程计划在 0.8.x。
|
|
75
71
|
|
|
76
|
-
|
|
72
|
+
## 可以做什么
|
|
77
73
|
|
|
78
|
-
|
|
74
|
+
- **房间与人:** 创建或加入房间,连接多台设备,审核加入,管理成员和房主,打开私聊。
|
|
75
|
+
- **消息:** 回复、标记提问、撤回并保留可恢复的原文、点名成员或 `@all`。
|
|
76
|
+
- **文件:** 附件、拖拽或粘贴,单文件默认上限 500 MiB;预览图片、媒体、Markdown、文本、代码和 PDF;支持下载和删除。
|
|
77
|
+
- **任务:** 在侧栏或弹窗里跟踪标题、负责人、截止日期、参与人、步骤、结论和 todo/doing/done 状态。
|
|
78
|
+
- **提醒:** 一次性或 cron 提醒;文本支持 `{{time}}`、`{{initiator}}` 和 `{{room}}`。
|
|
79
|
+
- **搜索与快捷键:** Alt+Space 或 Ctrl+P 搜索消息;输入框开头输入 `/` 过滤命令。Alt+1…9 切换房间,更多快捷键在设置里。
|
|
80
|
+
- **终端:** 用 `bunx --package @alexsun-top/opencode-chat-room@0.8.0 opencode-chat-room cli` 连接同一服务端,支持房间、消息、文件、提醒、审核和搜索。推荐 Bun 1.3.14+;只有 CLI 加载 OpenTUI。
|
|
81
|
+
- **代码:** 围栏代码块由懒加载的 Shiki bundle 高亮,带换行和复制控件。
|
|
82
|
+
- **Web App:** 界面可安装到手机主屏,离线时从缓存启动;聊天数据不会缓存。
|
|
79
83
|
|
|
80
84
|
## 更多帮助
|
|
81
85
|
|
|
82
|
-
- [
|
|
83
|
-
- [
|
|
86
|
+
- [配置、管理员功能与 API 参考](docs/reference.zh-CN.md)
|
|
87
|
+
- [更新日志](CHANGELOG.md)
|
|
88
|
+
- 在房间里问 Agent;内置的 `chatroom` skill 说明了完整的房间工作流。
|
|
89
|
+
|
|
90
|
+
## 许可证
|
|
91
|
+
|
|
92
|
+
MIT
|