graview-chat
graview-chat is one of Graview's 33 authoring skills: instructions an AI coding assistant such as Claude Code or Codex reads before it changes a Graview app. What it teaches: Let the people in a Graview app talk to each other inside it — a room for the whole app, a thread on each record of a kind, mentions that tell the person named, unread counts on the bell — declared as rooms and checked by graview check; and let a host offer “Chat with …” its own staff through a support transport, each message carrying where the person was.
Installed into a project by graview skills install ., and read by whichever assistant is working beside you.
The skill
Let people talk inside the app
People who share an app talk about it somewhere else — a group chat, an email thread — and lose the record they were talking about. A room puts that talk in the app: declared once, beside kinds, so the checker reads it, every face draws it, and what is said is a record the app's sight, roles, history and undo already hold.
"rooms": {
"household": { "title": "Household" }, // one room for the whole app
"task-talk": { "title": "Comments", "about": "task", // a thread on each task
"moderate": ["keeper"] },
"keepers": { "title": "Keepers", "read": ["keeper"] } // only some roles read it
}The same shape in defineApp({ rooms }). A room's address word is lowercase and hyphenated; title is what people see. read, post and moderate name roles: unsaid, whoever may see the app (or the record, for a thread) reads it, whoever reads it posts, and only each message's author removes it. mentions: false reads @Name as plain words. Every key is in @graview/core/dist/document.schema.json under rooms.
What you get without writing it
- The
messagekind and three acts, folded in bydefineAppand a compiled document:post-message,edit-message(its author's) andremove-message(its author's, or anybody's for amoderaterole). They are ordinary acts: an agent's seat has them as tools and posts as itself, and undo takes a message back. Do not declare amessagekind or acts of those names yourself. - Sight. A room that
reads only some roles is kept from everybody else — the room, its messages and their history. A thread follows its record: a seat that may not see a task sees none of what was said about it. Hand a pagestore.seenBy(principal)and it is already so. - The face. Each app-wide room is a page at
/~rooms/<word>("Talk in …" in the person's menu); a record with a thread shows it under its page, in the page's column, whoever designed the page. A log a screen reader hears grow, a composer ("Message Household", "Write a comment…") — Enter sends, Shift+Enter is a new line — and Edit and Remove on what is yours. - Replies. Reply on any message answers it (
replyTo); replies fold under it as "3 replies", one level deep — a reply to a reply goes under the same first message. What is new is counted by thread too (unreadFor(...).byThread), and the bell still counts all of it. An agent's seat replies withpost-messageandreplyTo. - Conversations. "Conversations" in the person's menu (
/~conversations) lists every room and record thread the reader may see, newest first, what is new marked (conversationsOf). A record something is said about has a count on its building at Nearby and on the Map that opens its thread (talkAbout). - Talk, beside every face. Talk on the bar opens one panel docked beside the Page, Nearby or the Map (a sheet on a phone): every conversation the reader may see, narrowed to theirs, the AI's, people's or requests, and to the record they are on. Its one composer guesses where the words go — the AI, the owners, a room — and offers the others in a tap; a conversation chosen lights the records it touched on the Map, and a record's page lists the threads elsewhere that named it.
- Mentions and unread.
@Noratells Nora through the subscriptions' hook (onSubscriptionMatch,when.on: "mentioned"), where a host sends an email or a push. What a person has not read is counted on the bell ("2 new in Household"; "Sam mentioned you" needs them), from a read-up-to marker kept like any per-viewer value (viewerState, viewgraview:rooms). - Kept out of lists, counts, the Map's districts, the home, Activity and a static export; an export of the app's data carries them. For a template or a remix, pass the snapshot through
withoutTalkfrom@graview/core/rooms.
What people say to the app's AI is kept the same way, in every app, declared rooms or not: a quick ask, the seat's turns and a "Better UI" conversation are message records in the framework's own rooms, ~asks ("Questions to the AI") and ~design ("Design changes"; frameworkRoomTitle from @graview/core/rooms). The person's words are theirs, the answer the AI's, a follow-up a reply to the first. Each is seen only by whoever asked it — the app's owner included — until its asker runs share-conversation (with the app's editors, or everybody). Do not name a room of your own with ~ (room-id-reserved).
The worked example is apps/todo/src/domain/app.ts (a room and a thread on each task); apps/gauntlet/src/domain/app.ts has one only some roles read and a thread on a kind a visitor cannot see.
Chat with the host's staff
A host — Graview Cloud, your own product — offers its people a way to ask it for help from inside any app. Give PagesApp's context, or mount, support:
import { memorySupport } from "@graview/core/rooms";
support: { title: "Graview", transport: myStaffTransport ?? memorySupport() }The person's menu then says "Chat with Graview" and opens a panel that says replies come later. The transport is { send(message, context), subscribe(onReply), history?() }; the thread is the person's and the staff's, never in the app's graph. Each message carries context: the app, the place and record, the person and their roles, what they last could not do (the friction digest) and the version — so staff never ask. Without support, nothing shows.
Rooms a host supplies, with one switch
A host turns talk on for an app that declares no room: talk: true where it opens the store (StoreOptions.talk, openStore's and openRemote's storeOptions, createStoreHandler, mount, <Embed>, toolDefinitions) — the server's and the page's alike. The standard set (STANDARD_ROOMS) is everyone (only where the app has no room for the whole app), comments (about: "*": a thread on any record of a kind with no thread of its own) and owners (to: "owners": each conversation seen by whoever began it and the app's editors, a request or a report). { rooms: {...} } brings the host's own instead; the app's rooms keep a word they share, and the declaration stays yours. visitors: "limited" lets a visitor send the owners a request or a report, never a room; unsaid, visitors say nothing. chat: false still wins.
Each message carries intent (INTENTS: answer, act, change, request, report, discussion; INTENT_LABELS says them), guessed with no model when it is said (guessIntent; intentFor asks a host's guess first) and switched in one tap by its author or the host; and touches, the records it names by @ or a link. touchpointsOf(message, store, seat), threadTouchpoints(store, key, seat) and threadsTouching(store, recordId, seat) on @graview/core/rooms say what was touched, the AI's batch changes included, never a record the seat may not see. A host tells its owners of requests and reports with a subscription, when: { on: "requested" }.
Turning chat off
A host turns chat off where it opens the store: chat: false on a Store, in openStore's and openRemote's storeOptions, on createStoreHandler, or on mount and <Embed> when they make the store from the app. Open both the server's store and the page's with it. The store then has no message act, and the face routes and offers no room, no thread, no Conversations and no talk on the city or the bell (chatOn(store)). What was said stays in the graph, drawn again once chat is back. The conversations kept with the AI are not chat: they are kept whenever the AI answers. support is separate: given, it shows.
Then find out whether it worked
npx graview check # room-* findings, each with its fix
npx graview describe . # "Where its people talk": each room, who reads and postsgraview check names a thread on a kind the app lacks (room-about-unknown), a role the policy does not know (room-role-unknown), two rooms of one title or a room titled as a place (room-title-taken), a room with no title (room-title-missing), an address word that is not one (room-id), a role that may post but not read (room-post-not-read), and a message kind or a room act of your own (room-kind-taken, room-act-taken). Each says the edit.
Then open it as two people. Two browsers on one served store (graview serve, and the example's server parameter) each see the other's message as it is said; sit down as a seat a room does not admit and it says "No room here"; open the record page of a record that seat cannot see and there is nothing to read. pnpm verify rooms in the framework does all of it, at a desk, on a phone and from the keyboard.
What the check cannot see
- Whether people will use it. A room nobody opens is noise on the bar; start with one, and threads where talk is already about a record.
- Delivery. A mention is a subscription match; whether it reaches a phone is the host's hook. A page alone tells only its own bell.
- The staff behind a transport.
memorySupportanswers in the page for development; a real inbox, its replies and its limits are the host's. - Moderation as policy.
moderatelets roles remove; deciding what should be removed is people's.