diff --git a/CLAUDE.md b/CLAUDE.md
index b1e4397..6ef94c2 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -1048,7 +1048,7 @@ without checking it is the request that was built (`roomsKeysAct` does).
## A portal page uses rooms through the wallet's own methods (P7b)
`window.vtaWallet.rooms.{list, choose, forget, info, browse, read, conversation,
-putNote, getFile, putFile}` is how a community's member portal shows a member their rooms
+putNote, putMessage, getFile, putFile}` is how a community's member portal shows a member their rooms
(VTI `data-rooms-files.md` §8.5). It does **not** loosen "a page is not a
member": `requestTask` and `signTrustTask` still refuse the whole `rooms/`
family. The methods fix the verb, run the flow in the extension, and return
@@ -1098,6 +1098,15 @@ page's `putNote` on an open room writes `rooms/records/put/0.4` with
like every host request) — there is no group to seal under — after the same
confirmation, which says the note will be readable by the room's host.
+**A page sends a chat message with `putMessage`, never a note without a
+title.** `writeMessageAsMember` writes the text with no `title`, plus
+`kind: "message"` and `writtenAt` where the room's profile lists them — so
+every reader shows it as a message, and a room listing neither still shows the
+untitled record as one (*Untitled records*, `shownKind`). It is confirmed in the
+wallet's window like a note, worded as a message. Keep `putNote`'s title
+required: a note and a message are different records, and a page choosing
+between them says which.
+
**An open room's file carries its own key.** With no storage key to derive from, `putRoomFile` mints
32 random bytes for the file, seals the blob exactly as on a sealed tier, and
writes `rooms/records/put/0.4` with the manifest — `fileKey` included — in
diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md
index 4fb846b..23332cf 100644
--- a/packages/core/CHANGELOG.md
+++ b/packages/core/CHANGELOG.md
@@ -8,6 +8,14 @@ For history before this file, see `git log` on `packages/core`.
## [Unreleased]
+### Added
+
+- **`writeMessageAsMember`** writes a chat message to a room as the member:
+ the text with no `title`, plus `kind: "message"` and `writtenAt` where the
+ room's profile lists them (`MESSAGE_KIND`). A room listing neither takes it
+ as an untitled record, which readers show as a message. Sealed on
+ `attributed` / `private`, in the clear on `open`; create-only.
+
### Changed
- **BREAKING: a relying-party session step-up no longer takes the session's
diff --git a/packages/core/src/rooms/act.ts b/packages/core/src/rooms/act.ts
index 895df8e..dea02a1 100644
--- a/packages/core/src/rooms/act.ts
+++ b/packages/core/src/rooms/act.ts
@@ -591,6 +591,41 @@ export async function writeMemberNameAsMember(
return { principal, key, version };
}
+/**
+ * Write a chat message, as the member: a new record whose text is `body`, and
+ * no `title`.
+ *
+ * Where the room's profile lists `kind`, the record says `kind: "message"`, which
+ * every reader shows as a message; where it lists `writtenAt`, the record carries
+ * when it was written. A room listing neither still takes the message as an
+ * untitled record, which a reader keeping a conversation shows as one
+ * (*Untitled records*, `shownKind`) — never as a note with a made-up title.
+ * Sealed and signed by the VTA as the member on `attributed` and `private`, in the
+ * clear on `open` — as the room says, never assumed. Create-only.
+ */
+export async function writeMessageAsMember(
+ room: PersonaRoom,
+ params: { body: string; now?: () => Date },
+): Promise<{ principal: string; key: string; version: number }> {
+ if (params.body.trim() === "") throw new RecordWriteRefused("Not written: a message needs some text.");
+ const listed = (await roomRecordMembersAsMember(room)) ?? [];
+ const now = (params.now ?? (() => new Date()))().toISOString().replace(/\.\d{3}Z$/, "Z");
+ const shape = {
+ ...(listed.includes("kind") ? { kind: MESSAGE_KIND } : {}),
+ ...(listed.includes("writtenAt") ? { writtenAt: now } : {}),
+ };
+ const { principal, info } = await roomInfoAsMember(room);
+ const key = opaqueRecordKey();
+ const version =
+ info.visibility === "open"
+ ? await putCleartextAsMember(room, { key, body: params.body, ...shape })
+ : await writeSealedAsMember(room, { roomId: room.roomId, key, author: principal, body: params.body, ...shape });
+ return { principal, key, version };
+}
+
+/** `RecordKind` for a chat message. */
+export const MESSAGE_KIND = "message";
+
/** The member's own name record, as rule 2 gives it from the records its client holds: what a rewrite near the head writes again. */
export interface OwnMemberName {
key: string;
diff --git a/packages/core/tests/rooms.member-name.mjs b/packages/core/tests/rooms.member-name.mjs
index 68df006..f41278c 100644
--- a/packages/core/tests/rooms.member-name.mjs
+++ b/packages/core/tests/rooms.member-name.mjs
@@ -22,6 +22,8 @@ import {
RecordWriteRefused,
rewriteMemberNameAsMember,
writeMemberNameAsMember,
+ writeMessageAsMember,
+ shownKind,
} from "../dist/rooms/index.js";
const ALICE = "did:webvh:QmAlice:people.example:alice-room";
@@ -456,3 +458,42 @@ test("near the head: nothing is written when the write is within 500, the name i
assert.deepEqual(puts(closed.sent), [], "the writer's gate holds for a rewrite too");
});
+
+// ── A chat message (writeMessageAsMember) ──────────────────────────────────
+
+test("message writer: on a sealed tier the body is kind message, the text and writtenAt, no title, signed as the member", async () => {
+ const r = room({ recordMembers: ["kind", "writtenAt"] });
+ const out = await writeMessageAsMember(r.room, { body: "Lunch at one?", now: () => new Date("2026-11-25T12:00:00.456Z") });
+ assert.equal(out.principal, ALICE);
+ const [body] = r.sealed;
+ assert.deepEqual(Object.keys(body).sort(), ["author", "body", "key", "kind", "roomId", "version", "writtenAt"]);
+ assert.equal(body.kind, "message");
+ assert.equal(body.body, "Lunch at one?");
+ assert.equal(body.writtenAt, "2026-11-25T12:00:00Z");
+ assert.equal(body.author, ALICE);
+ assert.equal(puts(r.sent)[0].payload.expectedVersion, 0, "create-only");
+ assert.equal(shownKind(body), "message");
+});
+
+test("message writer: a room whose profile lists neither still takes it, untitled, which readers show as a message", async () => {
+ const r = room({ recordMembers: undefined });
+ await writeMessageAsMember(r.room, { body: "hi" });
+ const [body] = r.sealed;
+ assert.deepEqual(Object.keys(body).sort(), ["author", "body", "key", "roomId", "version"]);
+ assert.equal(shownKind(body), "message");
+});
+
+test("message writer: on an open room the cleartext is the message, in the clear, never sealed", async () => {
+ const r = room({ recordMembers: ["kind"], visibility: "open" });
+ await writeMessageAsMember(r.room, { body: "hi" });
+ const [put] = puts(r.sent);
+ assert.deepEqual(put.payload.cleartext, { kind: "message", body: "hi" });
+ assert.deepEqual(r.sealed, []);
+});
+
+test("message writer: an empty message is refused before anything is asked", async () => {
+ const r = room({ recordMembers: ["kind"] });
+ await assert.rejects(writeMessageAsMember(r.room, { body: " \n" }), RecordWriteRefused);
+ assert.deepEqual(r.vtaAsked, []);
+ assert.deepEqual(r.sent, []);
+});
diff --git a/packages/extension/src/bridge-protocol.ts b/packages/extension/src/bridge-protocol.ts
index fcc0bb7..bfeeed4 100644
--- a/packages/extension/src/bridge-protocol.ts
+++ b/packages/extension/src/bridge-protocol.ts
@@ -2501,7 +2501,9 @@ export type RoomsPageOp =
body?: string;
description?: string;
tags?: string[];
- };
+ }
+ /** A chat message: text and no title (`writeMessageAsMember`). Confirmed like a note. */
+ | { op: "putMessage"; hostDid: string; roomId: string; body: string };
export interface RuntimeRoomsPageRequest {
type: typeof RUNTIME_ROOMS_PAGE;
@@ -3661,7 +3663,8 @@ export type OffscreenRoomsPageOp =
body?: string;
description?: string;
tags?: string[];
- };
+ }
+ | { op: "putMessage"; hostDid: string; roomId: string; member: string; body: string };
export interface OffscreenRoomsPageRequest {
target: typeof OFFSCREEN_TARGET;
diff --git a/packages/extension/src/provider.ts b/packages/extension/src/provider.ts
index 946aad8..6d131cc 100644
--- a/packages/extension/src/provider.ts
+++ b/packages/extension/src/provider.ts
@@ -370,6 +370,10 @@ export interface VtaWalletRooms {
description?: string;
tags?: string[];
}): Promise<{ key: string; version: number }>;
+ /** Write a chat message as the member — text, no title — after they confirm it.
+ * It reads as a message in every reader (`kind: "message"` where the room
+ * takes it, else an untitled record). */
+ putMessage(params: { hostDid: string; roomId: string; body: string }): Promise<{ key: string; version: number }>;
/** A record's file, once the whole of it has verified against its author's digest. */
getFile(params: {
hostDid: string;
@@ -675,6 +679,7 @@ if (!window.vtaWallet) {
read: (p) => call("rooms", { op: "read", hostDid: p.hostDid, roomId: p.roomId, key: p.key }),
conversation: (p) => call("rooms", { op: "conversation", hostDid: p.hostDid, roomId: p.roomId }),
putNote: (p) => call("rooms", { ...p, op: "putNote" }),
+ putMessage: (p) => call("rooms", { op: "putMessage", hostDid: p.hostDid, roomId: p.roomId, body: p.body }),
offers: (p) => call("rooms", { op: "offers", hostDid: p.hostDid }),
acceptOffer: (p) =>
call("rooms", {
diff --git a/packages/extension/src/room-consent.tsx b/packages/extension/src/room-consent.tsx
index 9f0cafd..7a0b8b5 100644
--- a/packages/extension/src/room-consent.tsx
+++ b/packages/extension/src/room-consent.tsx
@@ -219,10 +219,12 @@ function Share({
function Write({ view, decide }: { view: RoomWriteConsentView; decide: (approved: boolean) => void }) {
const isFile = "file" in view.what;
+ const isMessage = "message" in view.what;
+ const thing = isFile ? "file" : isMessage ? "message" : "note";
return (
<>
- Add {isFile ? "a file" : "a note"} to this room as you?
+ {isMessage ? "Send this message to the room as you?" : `Add a ${thing} to this room as you?`}
{originHost(view.origin)} asks to write to a room, signed as you. Every member of the room will read it as
@@ -230,7 +232,7 @@ function Write({ view, decide }: { view: RoomWriteConsentView; decide: (approved
{view.visibility === "open" && (
- This room is open: {isFile ? "the file's record, and the key that opens it, are" : "the note is"}{" "}
+ This room is open: {isFile ? "the file's record, and the key that opens it, are" : `the ${thing} is`}{" "}
stored in the clear, so the room's host can read {isFile ? "the file" : "it"} as well as its members.