@alexsun-top/opencode-chat-room 0.6.9 → 0.7.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 (49) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +5 -4
  3. package/README.zh-CN.md +5 -4
  4. package/package.json +1 -1
  5. package/plugin.ts +49 -27
  6. package/server/assets/HIGHLIGHT-LICENSE +29 -0
  7. package/server/assets/NOTICE.txt +2 -1
  8. package/server/assets/base.css +5 -50
  9. package/server/assets/chat/editor.js +97 -16
  10. package/server/assets/chat/events.js +39 -6
  11. package/server/assets/chat/index.js +4 -0
  12. package/server/assets/chat/join-requests.js +37 -17
  13. package/server/assets/chat/locales/de.js +115 -0
  14. package/server/assets/chat/locales/es.js +115 -0
  15. package/server/assets/chat/locales/fr.js +115 -0
  16. package/server/assets/chat/locales/index.js +8 -0
  17. package/server/assets/chat/locales/it.js +115 -0
  18. package/server/assets/chat/locales/ja.js +115 -0
  19. package/server/assets/chat/locales/ko.js +115 -0
  20. package/server/assets/chat/markdown.js +100 -0
  21. package/server/assets/chat/members.js +1 -1
  22. package/server/assets/chat/mentions.js +1 -0
  23. package/server/assets/chat/message-polling.js +28 -5
  24. package/server/assets/chat/messages.js +20 -2
  25. package/server/assets/chat/panels.js +0 -9
  26. package/server/assets/chat/questions.js +11 -3
  27. package/server/assets/chat/recall.js +3 -3
  28. package/server/assets/chat/replies.js +1 -1
  29. package/server/assets/chat/room-watcher.js +4 -0
  30. package/server/assets/chat/settings.js +72 -0
  31. package/server/assets/chat/shortcuts.js +30 -5
  32. package/server/assets/chat/state.js +43 -21
  33. package/server/assets/chat/viewport.js +23 -0
  34. package/server/assets/code-highlight.css +124 -0
  35. package/server/assets/conversation.css +21 -3
  36. package/server/assets/highlight-10.7.3.min.js +1358 -0
  37. package/server/assets/responsive.css +3 -5
  38. package/server/assets/settings.css +138 -0
  39. package/server/chat-server.ts +4 -1
  40. package/server/chat.html +96 -30
  41. package/server/join-requests.ts +11 -0
  42. package/server/sw.js +3 -0
  43. package/skills/chatroom/SKILL.md +2 -1
  44. package/src/agent/admin-client.ts +13 -5
  45. package/src/agent/announcement-tool.ts +6 -6
  46. package/src/center/center-client.ts +17 -17
  47. package/src/center/reminder-client.ts +5 -5
  48. package/src/rooms/resource-read.ts +16 -9
  49. package/src/rooms/resource-upload.ts +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0 — 2026-11-19
4
+
5
+ - Keep one compact shortcut entry under the composer. It shows `Alt + /` (`Option + /` on Mac) and opens the full shortcut sheet; all other per-control hints stay removed.
6
+ - Animate Alt+Arrow room switching separately from conversation jumps (Alt+Home/End and PageUp/PageDown), with reduced-motion preferences respected.
7
+ - Treat Alt+PageUp and Alt+PageDown exactly like PageUp and PageDown in the composer, including the conversation-jump transition.
8
+ - Keep mention tokens when copying selected text from rendered messages, so pasting it back restores the mention chips.
9
+ - Syntax-highlight fenced code blocks locally; hover or focus reveals icon-only wrap and copy controls.
10
+ - Keep pasted composer text plain except for mention chips. Multi-line paste no longer leaves browser block markup, a selected mention replaces its trigger `@` cleanly, and Backspace deletes one character at a time.
11
+ - Show the composer placeholder only when the editor is truly empty, so a draft ending in a newline no longer overlaps with the placeholder text.
12
+ - Make tool parameter errors actionable: resource reads require both `roomId` and `resourceId`, missing IDs explain where to get them, and unknown rooms point to `room` action `list`.
13
+ - Keep Home and End caret moves visible around mention chips; Home at a line starting with a mention lands on the first editable character after the chip instead of inside or before it.
14
+ - Scroll the mention picker automatically so the keyboard-selected member stays visible in large rooms.
15
+ - Update the Questions count and the room question marker as soon as a question arrives or is answered, without opening the panel first.
16
+ - Place the caret after a tapped or clicked mention chip so Backspace and Delete can remove it on touch keyboards.
17
+ - Show a sent message immediately while the server confirms it; a failed send removes the pending copy and uses the existing retry panel.
18
+ - Recover the connection bar and clear a stale network send warning after the network returns; timed-out inbox requests retry instead of staying stuck.
19
+ - Show pending join requests as a single numeric badge on Members, and return an explicit HTTP 202 message explaining that the requester is not a member yet and needs human administrator approval.
20
+ - Let a pending applicant cancel their own join request from the join card or chat notice with a red **Cancel request** button; the request is withdrawn on the server, not merely hidden.
21
+ - Let one Agent session join several rooms at once; membership, delivery, and leaving are tracked per room, so leaving one room does not stop delivery for the others.
22
+ - Add a unified Settings dialog for language, theme, and the access token. It opens before joining and from the chat menu; English, 简体中文, 日本語, 한국어, Français, Deutsch, Español, and Italiano are available, with System, Light, Dark, Forest, and Sand themes; language and theme persist per browser without signing in.
23
+ - Keep the mobile composer inside the visible area when the soft keyboard opens, move the conversation to its latest message as the keyboard resizes the view, insert a newline for Enter on touch devices while keeping the Send button, and apply safe-area spacing at the top.
24
+
3
25
  ## 0.6.9 — 2026-11-18
4
26
 
5
27
  - Remove the automatic keyboard-hint tags on controls, the rail shortcut hint, and the `?` shortcut. Press Alt+/ to open the shortcut sheet, which lists only shortcuts that exist. Alt+Home and Alt+End jump to the oldest or latest loaded message without requesting older history.
package/README.md CHANGED
@@ -24,7 +24,7 @@ When upgrading an existing install, quit OpenCode first or use `opencode plugin
24
24
  On a machine reachable by the other devices, start the server. Replace `your-password` with a shared password:
25
25
 
26
26
  ```bash
27
- bunx @alexsun-top/opencode-chat-room@0.6.9 --host 0.0.0.0 --port 4399 --token 'your-password'
27
+ bunx @alexsun-top/opencode-chat-room@0.7.0 --host 0.0.0.0 --port 4399 --token 'your-password'
28
28
  ```
29
29
 
30
30
  On each machine running OpenCode, set the server address and the same password, then start OpenCode from that environment:
@@ -35,7 +35,7 @@ export CHAT_ROOM_SERVER_TOKEN="your-password"
35
35
  opencode
36
36
  ```
37
37
 
38
- Open `http://SERVER_IP:4399/chat` in a browser and enter the same password in settings. Create or join a room there, and ask each agent to join it too.
38
+ 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, also selects the language and theme. Create or join a room there, and ask each agent to join it too.
39
39
 
40
40
  **Security:** Anyone with the shared password can access and manage rooms, including direct chats. Share it only with trusted people and protect network access to the server. Join approval controls the normal join flow; it is not per-user authentication, so it does not stop a password holder from misrepresenting itself.
41
41
 
@@ -49,7 +49,7 @@ docker run --rm -p 4399:4399 -v chat-room-data:/data \
49
49
  ghcr.io/agentsyaml/opencode-chat-room:latest
50
50
  ```
51
51
 
52
- Pin a release with `ghcr.io/agentsyaml/opencode-chat-room:v0.6.9`. Rooms, messages and receipts live in the `/data` volume; keep it mounted across upgrades. If you bind-mount a host directory instead of a named volume, make it writable by uid `10001`.
52
+ Pin a release with `ghcr.io/agentsyaml/opencode-chat-room:v0.7.0`. Rooms, messages and receipts live in the `/data` volume; keep it mounted across upgrades. If you bind-mount a host directory instead of a named volume, make it writable by uid `10001`.
53
53
 
54
54
  ## 3. Start chatting
55
55
 
@@ -58,8 +58,9 @@ Pin a release with `ghcr.io/agentsyaml/opencode-chat-room:v0.6.9`. Rooms, messag
58
58
  - Use Reply to respond to a message. Mark a message as a question when you need an answer.
59
59
  - Use the room's reminder button for one-time or recurring reminders. Times default to the server's time zone.
60
60
  - Reminder text supports `{{time}}`, `{{initiator}}`, and `{{room}}`.
61
- - Press Alt+/ for the keyboard shortcut sheet. Alt+Home/Alt+End jump to the oldest/latest message, and PageUp/PageDown scrolls the conversation while you type.
61
+ - A compact shortcut chip under the composer shows Alt+/ (Option+/ on Mac); click it or press the keys to open the sheet. Alt+Home/Alt+End animate to the oldest/latest message, and PageUp/PageDown scrolls the conversation while you type.
62
62
  - Attach files, drag them in, or paste images. The default limit is 500 MiB per file.
63
+ - Fenced code blocks are syntax-highlighted locally. Hover or focus a block for icon-only wrap and copy controls.
63
64
  - Agents can recall a message by ID; the original stays available to current members.
64
65
  - Agents can use the `room` tool's `read_resource` action to save an attachment to a temporary file before opening it.
65
66
 
package/README.zh-CN.md CHANGED
@@ -24,7 +24,7 @@
24
24
  在一台可被其他设备访问的机器上启动服务器,把 `换成自己的密码` 换成共享密码:
25
25
 
26
26
  ```bash
27
- bunx @alexsun-top/opencode-chat-room@0.6.9 --host 0.0.0.0 --port 4399 --token '换成自己的密码'
27
+ bunx @alexsun-top/opencode-chat-room@0.7.0 --host 0.0.0.0 --port 4399 --token '换成自己的密码'
28
28
  ```
29
29
 
30
30
  在每台运行 OpenCode 的机器上设置服务器地址和相同密码,再从该环境启动 OpenCode:
@@ -35,7 +35,7 @@ export CHAT_ROOM_SERVER_TOKEN="换成自己的密码"
35
35
  opencode
36
36
  ```
37
37
 
38
- 在浏览器打开 `http://服务器IP:4399/chat`,在页面设置中填入相同密码,即可创建或加入房间。每个 Agent 也需要加入同一个房间。
38
+ 在浏览器打开 `http://服务器IP:4399/chat`,在设置窗口中填入相同密码。同一个设置窗口在加入房间前和聊天菜单中都能打开,也可以选择语言和主题。然后创建或加入房间,每个 Agent 也需要加入同一个房间。
39
39
 
40
40
  **安全提示:**共享密码的持有人可以访问和管理房间,包括私聊;请只分享给可信任的人,并保护服务器网络访问。加入审核只约束正常加入流程,不是按用户认证,无法阻止密码持有人伪装身份。
41
41
 
@@ -49,7 +49,7 @@ docker run --rm -p 4399:4399 -v chat-room-data:/data \
49
49
  ghcr.io/agentsyaml/opencode-chat-room:latest
50
50
  ```
51
51
 
52
- 用 `ghcr.io/agentsyaml/opencode-chat-room:v0.6.9` 可以固定到具体版本。房间、消息和回执都保存在 `/data` 卷里,升级时保留该卷即可。如果改用宿主目录做挂载,需要让该目录对 uid `10001` 可写。
52
+ 用 `ghcr.io/agentsyaml/opencode-chat-room:v0.7.0` 可以固定到具体版本。房间、消息和回执都保存在 `/data` 卷里,升级时保留该卷即可。如果改用宿主目录做挂载,需要让该目录对 uid `10001` 可写。
53
53
 
54
54
  ## 3. 开始聊天
55
55
 
@@ -58,8 +58,9 @@ docker run --rm -p 4399:4399 -v chat-room-data:/data \
58
58
  - 回复消息时点击回复;需要对方回答的问题可标记为「问题」。
59
59
  - 点击房间里的提醒按钮,可创建一次性或周期提醒。默认使用服务器时区。
60
60
  - 提醒正文支持 `{{time}}`、`{{initiator}}`、`{{room}}` 模板变量。
61
- - 按 Alt+/ 打开快捷键面板,Alt+Home/Alt+End 跳到最早/最新消息,输入时用 PageUp/PageDown 滚动会话。
61
+ - 输入框下方保留唯一快捷键入口,以紧凑标签显示 Alt+/(Mac 为 Option+/);点击或按快捷键都能打开面板。Alt+Home/Alt+End 平滑跳到最早/最新消息,输入时用 PageUp/PageDown 滚动会话。
62
62
  - 点击附件按钮、拖入文件或粘贴图片即可分享;默认单文件上限为 500 MiB。
63
+ - 围栏代码块会在本地做语法高亮;鼠标悬停或键盘聚焦时显示纯图标的自动换行和复制按钮。
63
64
  - Agent 可按消息 ID 撤回;当前成员仍可查看原文。
64
65
  - Agent 收到附件后可通过 `room` 的 `read_resource` 操作保存到临时文件,再打开查看。
65
66
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexsun-top/opencode-chat-room",
3
- "version": "0.6.9",
3
+ "version": "0.7.0",
4
4
  "description": "A chat-room plugin and central server for OpenCode.",
5
5
  "repository": {
6
6
  "type": "git",
package/plugin.ts CHANGED
@@ -61,7 +61,7 @@ async function withRooms<T>(
61
61
  return fn(svc, registry);
62
62
  } catch (err) {
63
63
  if (err instanceof RoomError) {
64
- return `error: ${err.message}` as unknown as T;
64
+ return `error: ${actionableError(err)}` as unknown as T;
65
65
  }
66
66
  throw err;
67
67
  }
@@ -246,24 +246,44 @@ export async function pollKnownSessions(
246
246
 
247
247
  const READ_ONLY_ACTIONS = new Set(["list", "members", "poll", "join_status", "announcement_list", "announcement_read"]);
248
248
 
249
+ function actionableError(error: unknown): string {
250
+ const message = error instanceof Error ? error.message : String(error);
251
+ const status = (error as { status?: unknown })?.status;
252
+ if (/^room not found/i.test(message)) return `${message}; run room action list to get a valid room UUID`;
253
+ if (/^not joined/i.test(message)) return `${message}; call join for this room first, and wait for approval if required`;
254
+ if (message === "EMPTY_MESSAGE" || /message text is empty/i.test(message)) return "message text is empty; pass a non-empty text body";
255
+ if (message === "NOT_OWNER") return "only the room owner can do this; ask the room owner or a room administrator";
256
+ if (message === "DIRECT_ROOM_FULL") return "this direct room is limited to its two participants; create or join another room";
257
+ if (status === 401 || message === "unauthorized") return `${message === "unauthorized" ? "unauthorized" : message}; set CHAT_ROOM_SERVER_TOKEN to the server access token, then retry`;
258
+ if (status === 403 || message === "forbidden") return `${message === "forbidden" ? "forbidden" : message}; check that you joined this room and have permission for this action`;
259
+ if (typeof status === "number" && status >= 500) return `${message}; the center failed to handle the request, retry later and report the server log`;
260
+ if ((error as { name?: unknown })?.name === "TimeoutError" || /timed? ?out|aborted/i.test(message)) {
261
+ return "center request timed out; check CHAT_ROOM_SERVER_URL and network, then retry";
262
+ }
263
+ if (/fetch failed|ECONNREFUSED|ENOTFOUND|EAI_AGAIN/i.test(message)) {
264
+ return "could not reach the center; check CHAT_ROOM_SERVER_URL and that the server is running";
265
+ }
266
+ return message;
267
+ }
268
+
249
269
  export const roomArgs = z.object({
250
270
  action: z.enum(["create", "join", "join_status", "leave", "list", "send", "poll", "recall", "members", "upload_resource", "read_resource", "delete_resource", "announcement_list", "announcement_read", "announcement_write", "announcement_delete", "reminder_list", "reminder_create", "reminder_update", "reminder_delete"]),
251
271
  name: z.string().max(64).optional().describe("For join: your own participant display name, NOT the room name (required). For create: the new room name."),
252
- roomId: z.string().optional(),
253
- messageId: z.string().optional().describe("For recall: the full message ID to withdraw; agents recall their own messages, admins any message."),
254
- resourceId: z.string().optional(),
255
- filePath: z.string().optional().describe("Local regular file to upload; central mode only; requires host read permission."),
256
- text: z.string().max(5000).optional(),
257
- isQuestion: z.boolean().optional(),
258
- announcementName: z.string().optional().describe("Name of a room announcement; distinct from participant or room name."),
259
- content: z.string().optional().describe("Announcement content, at most 5000 Unicode characters."),
260
- reminderId: z.string().optional(),
272
+ roomId: z.string().optional().describe("Room UUID, not the room name. Required for resource actions and every room-scoped action."),
273
+ messageId: z.string().optional().describe("For recall: the full message ID returned by send or poll; required for recall."),
274
+ resourceId: z.string().optional().describe("Resource UUID returned by upload_resource. read_resource and delete_resource also require roomId."),
275
+ filePath: z.string().optional().describe("Absolute path to a regular local file to upload; central mode only; requires host read permission."),
276
+ text: z.string().max(5000).optional().describe("Message text, at most 5000 characters; required for send."),
277
+ isQuestion: z.boolean().optional().describe("For send: mark the message as a question awaiting an answer."),
278
+ announcementName: z.string().optional().describe("Exact announcement name from announcement_list; distinct from participant or room name."),
279
+ content: z.string().optional().describe("Announcement content, at most 5000 Unicode characters; required for announcement_write."),
280
+ reminderId: z.string().optional().describe("Reminder UUID from reminder_list; required for reminder_update and reminder_delete."),
261
281
  schedule: z.discriminatedUnion("type", [z.object({ type: z.literal("once"), at: z.string(), timezone: z.string().refine((value) => { try { new Intl.DateTimeFormat("en", { timeZone: value }); return true; } catch { return false; } }, "timezone must be an IANA timezone").optional() }), z.object({ type: z.literal("cron"), expression: z.string().regex(/^\S+\s+\S+\s+\S+\s+\S+\s+\S+$/), timezone: z.string().refine((value) => { try { new Intl.DateTimeFormat("en", { timeZone: value }); return true; } catch { return false; } }, "timezone must be an IANA timezone").optional() })]).optional(),
262
282
  paused: z.boolean().optional(),
263
283
  joinPolicy: z.enum(["open", "approval"]).optional().describe("For create: \"approval\" holds new identities as pending until a human administrator approves them; central mode only."),
264
284
  }).superRefine((args, ctx) => {
265
285
  if (args.action === "join" && !args.name?.trim()) {
266
- ctx.addIssue({ code: "custom", path: ["name"], message: "name is required to join a room" });
286
+ ctx.addIssue({ code: "custom", path: ["name"], message: "name is required to join a room; pass your participant display name" });
267
287
  }
268
288
  });
269
289
  type RoomArguments = z.infer<typeof roomArgs>;
@@ -272,7 +292,7 @@ const roomExecute = async (
272
292
  args: RoomArguments,
273
293
  context: V1ToolContext & { signal?: AbortSignal },
274
294
  ) => {
275
- if (args.action === "join" && !args.name?.trim()) return "error: name is required to join a room";
295
+ if (args.action === "join" && !args.name?.trim()) return "error: name is required to join a room; pass your participant display name";
276
296
  const runtime = currentRuntime();
277
297
  if (args.action === "reminder_list" || args.action === "reminder_create" || args.action === "reminder_update" || args.action === "reminder_delete") {
278
298
  return await runReminderTool(runtime.center, args, context.sessionID);
@@ -280,6 +300,8 @@ const roomExecute = async (
280
300
  if (args.action === "upload_resource") return uploadAgentResource(runtime.center, args.roomId ?? "", args.filePath ?? "", context.sessionID, context);
281
301
  if (args.action === "delete_resource") return deleteAgentResource(runtime.center, args.roomId ?? "", args.resourceId ?? "", context.sessionID);
282
302
  if (args.action === "read_resource") {
303
+ if (!args.roomId) return "error: roomId is required for read_resource; use the room UUID, not the room name";
304
+ if (!args.resourceId) return "error: resourceId is required for read_resource; use the resource UUID returned by upload_resource";
283
305
  try {
284
306
  if (!context.ask) return "error: host webfetch permission is unavailable";
285
307
  return await readAgentResource(runtime.center, args.roomId ?? "", args.resourceId ?? "", context, context.abort ?? context.signal);
@@ -302,14 +324,14 @@ const roomExecute = async (
302
324
  }, context.sessionID);
303
325
  }
304
326
  if (args.action === "recall") {
305
- if (!args.roomId) return "error: roomId is required";
306
- if (!args.messageId) return "error: messageId is required";
327
+ if (!args.roomId) return "error: roomId is required; use a room UUID from the room list, not the room name";
328
+ if (!args.messageId) return "error: messageId is required; use the full message ID returned by send or poll";
307
329
  try {
308
330
  const recalled = await recallMessage(args.roomId, args.messageId, context.sessionID);
309
331
  switch (recalled.status) {
310
332
  case "ok": return `recalled message ${recalled.messageID}`;
311
333
  case "missing": return `error: message not found: ${args.messageId}`;
312
- case "member": return "error: not joined";
334
+ case "member": return "error: not joined; call join for this room first, and wait for approval if required";
313
335
  case "forbidden": return "error: only the sender or a room admin can recall this message";
314
336
  }
315
337
  } catch (err) {
@@ -351,7 +373,7 @@ const roomExecute = async (
351
373
  switch (args.action) {
352
374
  case "create": {
353
375
  if (!args.name?.trim()) {
354
- return "error: name is required";
376
+ return "error: name is required for create; pass the new room name";
355
377
  }
356
378
  if (args.joinPolicy === "approval") {
357
379
  return "error: joinPolicy \"approval\" requires central mode (set CHAT_ROOM_SERVER_URL); local rooms are always open";
@@ -362,7 +384,7 @@ const roomExecute = async (
362
384
  }
363
385
  case "join": {
364
386
  if (!args.roomId) {
365
- return "error: roomId is required";
387
+ return "error: roomId is required; use a room UUID from the room list, not the room name";
366
388
  }
367
389
  const me = identity(args.name!.trim());
368
390
  // ponytail: F5 — re-join under a new name retires the old
@@ -390,7 +412,7 @@ const roomExecute = async (
390
412
  }
391
413
  case "leave": {
392
414
  if (!args.roomId) {
393
- return "error: roomId is required";
415
+ return "error: roomId is required; use a room UUID from the room list, not the room name";
394
416
  }
395
417
  // ponytail: ora-2 M2 — mirror the join guard: if another session
396
418
  // still holds this name, remove only the registry entry, not the
@@ -419,7 +441,7 @@ const roomExecute = async (
419
441
  }
420
442
  case "members": {
421
443
  if (!args.roomId) {
422
- return "error: roomId is required";
444
+ return "error: roomId is required; use a room UUID from the room list, not the room name";
423
445
  }
424
446
  const members = svc.getParticipants(args.roomId);
425
447
  return members.length > 0
@@ -428,7 +450,7 @@ const roomExecute = async (
428
450
  }
429
451
  case "join_status": {
430
452
  if (!args.roomId) {
431
- return "error: roomId is required";
453
+ return "error: roomId is required; use a room UUID from the room list, not the room name";
432
454
  }
433
455
  return registry[args.roomId]?.[context.sessionID]
434
456
  ? `joined room ${args.roomId}`
@@ -436,10 +458,10 @@ const roomExecute = async (
436
458
  }
437
459
  case "send": {
438
460
  if (!args.roomId) {
439
- return "error: roomId is required";
461
+ return "error: roomId is required; use a room UUID from the room list, not the room name";
440
462
  }
441
463
  if (!args.text?.trim()) {
442
- return "error: text is required";
464
+ return "error: text is required; pass a non-empty message body";
443
465
  }
444
466
  const msg = svc.sendMessage(
445
467
  args.roomId,
@@ -454,16 +476,16 @@ const roomExecute = async (
454
476
  }
455
477
  case "poll": {
456
478
  if (!args.roomId) {
457
- return "error: roomId is required";
479
+ return "error: roomId is required; use a room UUID from the room list, not the room name";
458
480
  }
459
481
  // ponytail: gate on registry entry (session granularity) — a
460
482
  // participant-id check would pass for any session sharing the
461
483
  // same host identity
462
484
  if (!pollEntry) {
463
- return "error: not joined";
485
+ return "error: not joined; call join for this room first, and wait for approval if required";
464
486
  }
465
487
  if (!svc.containsParticipant(args.roomId, selfName)) {
466
- return "error: not joined";
488
+ return "error: not joined; call join for this room first, and wait for approval if required";
467
489
  }
468
490
  // ponytail: only messages newer than this session's last read (or
469
491
  // last successful push) — queue-notified messages don't repeat
@@ -496,11 +518,11 @@ const roomExecute = async (
496
518
  }
497
519
  return result;
498
520
  } catch (err) {
499
- return `error: ${err instanceof Error ? err.message : String(err)}`;
521
+ return `error: ${actionableError(err)}`;
500
522
  }
501
523
  };
502
524
  const room = tool({
503
- description: "Chat room operations: create, join, leave and list rooms; send, poll and recall messages; list members and announcements; manage reminders. Sent and polled messages carry full message IDs; recall takes roomId plus messageId and withdraws the message for everyone (agents their own, room admins any). Reminder schedules use the server timezone unless an IANA timezone is provided; once schedules require an ISO datetime. Upload files and media; upload_resource returns a [[resource:UUID]] marker, and the attachment renders only when that exact marker is included in a send message. read_resource saves files to a private temporary path and leaves them there until removed or system cleanup. delete_resource removes an uploaded file; servers allow human room administrators any resource and agents only their own uploads. Room joinPolicy \"approval\" makes join a pending request: you are not a member while pending, never claim otherwise, and use join_status to check whether a human administrator approved it.",
525
+ description: "Chat room operations: create, join, leave and list rooms; send, poll and recall messages; list members and announcements; manage reminders. Sent and polled messages carry full message IDs; recall takes roomId plus messageId and withdraws the message for everyone (agents their own, room admins any). Reminder schedules use the server timezone unless an IANA timezone is provided; once schedules require an ISO datetime. Upload files and media; upload_resource returns a [[resource:UUID]] marker, and the attachment renders only when that exact marker is included in a send message. Resource actions need both roomId (the room UUID) and resourceId (the UUID in the marker); the marker alone does not identify the room. read_resource saves files to a private temporary path and leaves them there until removed or system cleanup. delete_resource removes an uploaded file; servers allow human room administrators any resource and agents only their own uploads. Room joinPolicy \"approval\" makes join a pending request: you are not a member while pending, never claim otherwise, and use join_status to check whether a human administrator approved it.",
504
526
  args: roomArgs.shape,
505
527
  execute: roomExecute,
506
528
  });
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2006, Ivan Sagalaev.
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ * Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ * Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ * Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -3,5 +3,6 @@ Browser vendors bundled locally; no external requests are made at runtime.
3
3
  marked 18.0.4 — MIT License, see MARKED-LICENSE.
4
4
  DOMPurify 3.4.7 — MPL 2.0 or Apache License 2.0, see DOMPURIFY-LICENSE.
5
5
  Mermaid 11.12.2 — MIT License, see MERMAID-LICENSE.
6
+ highlight.js 10.7.3 — BSD 3-Clause License, see HIGHLIGHT-LICENSE.
6
7
 
7
- Sources: https://www.npmjs.com/package/marked, https://www.npmjs.com/package/dompurify and https://www.npmjs.com/package/mermaid
8
+ Sources: https://www.npmjs.com/package/marked, https://www.npmjs.com/package/dompurify, https://www.npmjs.com/package/mermaid and https://www.npmjs.com/package/highlight.js
@@ -24,27 +24,6 @@
24
24
  --shadow: 0 2px 5px rgb(34 53 47 / .05), 0 18px 44px rgb(34 53 47 / .09);
25
25
  }
26
26
 
27
- @media (prefers-color-scheme: dark) {
28
- :root {
29
- --bg: #111b19;
30
- --surface: #182522;
31
- --surface-2: #202f2b;
32
- --ink: #edf2e9;
33
- --ink-2: #c6d1c9;
34
- --ink-3: #a6b3aa;
35
- --line: #344640;
36
- --accent: #8ac9aa;
37
- --accent-ink: #14251e;
38
- --accent-soft: #263d34;
39
- --danger: #ef9580;
40
- --danger-soft: #3a2924;
41
- --warning: #d9a441;
42
- --warning-ink: #241a09;
43
- --mention-blue: #8bc8c2;
44
- --shadow: 0 2px 6px rgb(0 0 0 / .22), 0 18px 44px rgb(0 0 0 / .32);
45
- }
46
- }
47
-
48
27
  html, body { height: 100%; }
49
28
  body {
50
29
  margin: 0;
@@ -63,7 +42,7 @@
63
42
  #app {
64
43
  max-width: 760px;
65
44
  height: 100vh;
66
- height: 100dvh;
45
+ height: var(--app-height, 100dvh);
67
46
  margin: 0 auto;
68
47
  display: flex;
69
48
  flex-direction: column;
@@ -93,7 +72,6 @@
93
72
  .join-shell { display: grid; gap: 22px; width: min(1080px, 100%); margin: auto; align-content: start; }
94
73
  .join-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: start; padding-bottom: 20px; border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent); }
95
74
  .join-head .wordmark-row { grid-column: 1; grid-row: 1; align-self: center; }
96
- .join-head .locale-control { grid-column: 2; grid-row: 1; margin: 0; }
97
75
  .join-head .tagline { grid-column: 1 / -1; grid-row: 2; max-width: 62ch; margin: 0; }
98
76
  .join-entries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
99
77
  #createForm { grid-column: 1 / -1; }
@@ -138,9 +116,6 @@
138
116
  background-repeat: no-repeat;
139
117
  background-size: 12px 8px;
140
118
  }
141
- @media (prefers-color-scheme: dark) {
142
- select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.2 1.6 6 6.4l4.8-4.8' fill='none' stroke='%23a6b3aa' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
143
- }
144
119
  @media (forced-colors: active) {
145
120
  select { appearance: auto; padding-right: var(--select-pad); background-image: none; }
146
121
  }
@@ -257,6 +232,8 @@
257
232
  #announcementDialog .admin-dialog-head h2 { font-size: 21px; }
258
233
  }
259
234
  .danger-text { color: var(--danger) !important; }
235
+ .btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
236
+ .btn.danger:hover { filter: brightness(.94); }
260
237
  .announcement-content { white-space: pre-wrap; overflow-wrap: anywhere; }
261
238
 
262
239
  .panel.reminder-panel { width: min(410px, calc(100vw - 32px)); max-height: min(72dvh, 640px); overflow: auto; }
@@ -281,27 +258,7 @@
281
258
  .key-dialog .hint { margin: 0 0 14px; }
282
259
  .key-actions { display: flex; align-items: center; gap: 8px; }
283
260
 
284
- /* Keyboard help: a quiet keycap trigger, a cheat sheet, and inline hints. */
285
- .keys-hint {
286
- display: inline-flex;
287
- align-items: center;
288
- align-self: center;
289
- gap: 6px;
290
- min-height: 28px;
291
- padding: 2px 8px 2px 4px;
292
- border: 1px solid transparent;
293
- border-radius: 999px;
294
- color: var(--ink-3);
295
- background: transparent;
296
- font: inherit;
297
- font-size: 11.5px;
298
- font-weight: 600;
299
- line-height: 1;
300
- cursor: pointer;
301
- transition: color .14s, border-color .14s, background .14s;
302
- }
303
- .keys-hint:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--accent-soft); }
304
- .keys-hint:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
261
+ /* Keyboard help: a cheat sheet opened with Alt+/. */
305
262
  .keys-key {
306
263
  display: inline-grid;
307
264
  place-items: center;
@@ -319,7 +276,7 @@
319
276
  }
320
277
  .keys-combo { display: inline-flex; align-items: center; gap: 3px; flex: none; }
321
278
  .keys-sep { color: var(--ink-3); font-size: 10px; }
322
- .composer-keys { margin-right: auto; }
279
+
323
280
 
324
281
  .keys-dialog {
325
282
  width: min(520px, calc(100vw - 28px));
@@ -345,8 +302,6 @@
345
302
  .keys-list li:first-child { border-top: 0; }
346
303
  .keys-list li > span:last-child { color: var(--ink-2); text-align: right; }
347
304
  @media (max-width: 560px) {
348
- .keys-hint .keys-label { display: none; }
349
- .keys-hint { padding: 2px; }
350
305
  .keys-dialog { padding: 18px; }
351
306
  .keys-dialog-head h2 { font-size: 21px; }
352
307
  }