Add /w whispers delivered to one player at any distance#17
Merged
Conversation
Whispers ride the existing chat path: the server parses "/w <name>
<message>" (alias /whisper) in send_chat_message like /who, so the web
client and the agent-client both get the feature through the plain say
action with no new client message.
A new WhisperMessage carries names instead of ids: whisper ignores
distance, so either end may be outside the other's AOI where an id
resolves to nobody client-side. It goes only to the target plus an
echo to the sender; parse failures answer with a usage line instead of
leaking the attempt into local chat. An exact spelling always wins —
names are UNIQUE only case-sensitively, so case-insensitive matching
is a convenience that applies only while it is unambiguous; otherwise
the sender is asked to spell the name exactly. Like regular chat, the
content stays out of logs (F-012), and so does the recipient — who
talks to whom is metadata worth the same protection.
Adding a ServerMessage variant changes the wire shape, so
PROTOCOL_VERSION bumps to 3.
- Web client renders whispers in purple ("From X" / "To X"), with no
overhead bubble — a whisper is private
- /w and /whisper join the tab-completion list
- agent-client classifies an incoming whisper as Urgent and feeds it
to the LLM as a [Whisper] event; the system prompt explains how to
answer one
Closes the "귓속말(DM) 기능" TODO item.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
treestar84
force-pushed
the
whisper-command
branch
from
July 23, 2026 12:53
684697f to
f5a1acc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add /w whispers delivered to one player at any distance
Implements the TODO item: "귓속말(DM) 기능" (doc/TODO.md)
Demo
Three clients side by side. Miru's normal chat reaches everyone nearby; her
/w Ricawhisper reaches only Rica — Nami, standing right next to them, sees nothing. Rica replies with/wand the exchange stays private.Design
Whispers ride the existing chat path end to end:
/w <name> <message>(alias/whisper) is parsed insend_chat_messagenext to/whoand/escape, with the syntax defined once inparse_whisper_commandfollowing theparse_notice_commandpattern. Because it's plain chat text, the agent-client gets whispers for free through its existingsayaction — no new client message, same protocol for humans and agents.ServerMessage::WhisperMessage { from, to, message }carries names instead of ids: whisper ignores distance, so either end may be outside the other's AOI where an id resolves to nobody client-side. It is delivered only to the target plus an echo to the sender.UNIQUEonly case-sensitively ("Rica" and "rica" can coexist), so case-insensitive matching (/w rica) is a convenience that applies only while it is unambiguous — with several case variants online, the sender is asked to spell the name exactly rather than risk a private message reaching a near-miss. Names never contain spaces, so/w <name> <rest>parses unambiguously.ServerMessagevariant changes the wire shape, soPROTOCOL_VERSIONbumps to 3 (per the bump-on-shape-change rule inshared/src/lib.rs).Client: whispers render in purple as
From Miru:/To Rica:, with no overhead bubble — a whisper is private./wand/whisperjoin tab completion.Agent-client: an incoming whisper classifies as
Urgent(the echo of your own isNoise), reaches the LLM as a[Whisper] name: messageevent, and the system prompt explains how to answer one. This is groundwork for the "전언 시스템" idea — players can already whisper the resident NPCs.Testing
/w,/whisper,/whonon-collision, missing parts), delivery to a target 500m away with echo + no bystander + no broadcast leak (mixed-case name, canonicalto), coexisting case-variant names (exact spelling wins, ambiguous spelling is refused and delivered to no one), and each error path replying only to the sender.cargo fmt/cargo clippy(0 warnings) /npm run check/npm run lint/npm run test(279 client tests) all clean./w ricalowercase, unknown-name and missing-message replies,/whoregression, and tab completion cycling/w→/whisper.