{ "argumentSchema": { "$defs": { "AboutRecord": { "properties": { "createdAt": { "description": "When the room was created.", "type": "FabricEpochNsec" }, "kind": { "$ref": "#/$defs/ChatRoomKind", "description": "How the room was created." }, "title": { "description": "The title a group room was created with.", "type": "string" } }, "required": [ "kind" ], "type": "object" }, "AdaptedPlacement": { "properties": { "$VIEWS": { "description": "The placement's data face.", "properties": { "chat": { "$ref": "#/$defs/FabriChatPlacementView" } }, "required": [ "chat" ], "type": "object" }, "room": { "$ref": "#/$defs/PlacedRoom", "asCell": [ "cell" ], "description": "The placed room." } }, "required": [ "room", "$VIEWS" ], "type": "object" }, "ChatProfile": { "properties": { "avatar": { "description": "The person's avatar: a URL or a glyph, if they have set one.", "type": "string" }, "name": { "description": "The person's display name, if they have set one.", "type": "string" } }, "type": "object" }, "ChatReaction": { "properties": { "emoji": { "description": "A single emoji.", "type": "string" }, "reactorProfile": { "$ref": "#/$defs/ChatProfile", "asCell": [ "cell" ], "description": "The profile the reactor reacted under." }, "sentAt": { "description": "The room's handler clock when it recorded the reaction.", "type": "FabricEpochNsec" } }, "required": [ "reactorProfile", "emoji", "sentAt" ], "type": "object" }, "ChatReactionTally": { "properties": { "count": { "description": "How many people reacted with it.", "type": "number" }, "emoji": { "description": "The emoji.", "type": "string" }, "mine": { "description": "Whether the viewer is one of them.", "type": "boolean" }, "reactors": { "description": "Their profiles, in the order they reacted.", "items": { "$ref": "#/$defs/ChatProfile", "asCell": [ "cell" ] }, "type": "array" } }, "required": [ "emoji", "count", "mine", "reactors" ], "type": "object" }, "ChatRoomAbout": { "properties": { "createdAt": { "description": "When the room was created; absent for a space's own chat.", "type": "FabricEpochNsec" }, "kind": { "$ref": "#/$defs/ChatRoomKind", "description": "`\"direct\"` if created as a direct room; `\"group\"` otherwise." }, "policy": { "$ref": "#/$defs/ChatRoomPolicy", "asCell": [ "cell" ], "description": "The room's policy, stated correctly, in a document of its own." }, "record": { "$ref": "#/$defs/AboutRecord", "asCell": [ "cell" ], "description": "The record the room's creator wrote, whose label names them; absent for a\nspace's own chat, which no one created as a room." }, "title": { "description": "The room's title, which every member shares: the one a member last set,\nor else the one the room was created with. A direct room has none until a\nmember sets one, and a space's own chat has none.", "type": "string" } }, "required": [ "kind", "policy" ], "type": "object" }, "ChatRoomKind": { "enum": [ "direct", "group" ] }, "ChatRoomPolicy": { "properties": { "deletionIsObliteration": { "description": "Whether a sender's deletion of their own message obliterates it.", "type": "boolean" }, "keepsHistory": { "description": "Stated for the policy's shape, and read by nothing: a message keeps no history.", "type": "boolean" }, "maxOpenWindows": { "description": "Stated for the policy's shape, and read by nothing: the room offers no windows.", "type": "number" }, "maxWindowCount": { "description": "How many of the newest messages `messages.latest` holds.", "type": "number" }, "ownersMayObliterate": { "description": "Whether an OWNER may obliterate messages.", "type": "boolean" }, "proposedTimeMaxAgeNsec": { "description": "Stated for the policy's shape, and read by nothing: a sender proposes no time.", "type": "FabricDurationNsec" }, "proposedTimeMaxLeadNsec": { "description": "Stated for the policy's shape, and read by nothing: a sender proposes no time.", "type": "FabricDurationNsec" }, "recentActivityWindowNsec": { "description": "Stated for the policy's shape, and read by nothing: the room keeps no activity log.", "type": "FabricDurationNsec" } }, "required": [ "ownersMayObliterate", "keepsHistory", "deletionIsObliteration", "proposedTimeMaxAgeNsec", "proposedTimeMaxLeadNsec", "recentActivityWindowNsec", "maxWindowCount", "maxOpenWindows" ], "type": "object" }, "FabriChatPlacementView": { "properties": { "about": { "$ref": "#/$defs/ChatRoomAbout", "description": "What the room says about itself; absent unless `state` is `\"member\"`." }, "canSend": { "description": "Whether the viewer can send.", "type": "boolean" }, "messages": { "$ref": "#/$defs/PlacedMessageList", "description": "The room's messages; absent unless `state` is `\"member\"`." }, "participants": { "description": "The room's participants.", "items": { "$ref": "#/$defs/ChatProfile", "asCell": [ "cell" ] }, "type": "array" }, "reactionTallies": { "description": "Reactions on the newest messages.", "items": { "$ref": "#/$defs/PlacedTallies" }, "type": "array" }, "state": { "$ref": "#/$defs/PlacementState", "description": "Whether the viewer can read the room." } }, "required": [ "state", "canSend", "participants", "reactionTallies" ], "type": "object" }, "PlacedMessage": { "properties": { "reactions": { "description": "Everyone's reactions to the message.", "items": { "$ref": "#/$defs/ChatReaction" }, "type": "array" } }, "type": "object" }, "PlacedMessageList": { "properties": { "count": { "description": "How many messages the room holds.", "type": "number" }, "latest": { "description": "The newest messages of the main conversation.", "properties": { "hasOlder": { "type": "boolean" }, "messages": { "items": { "$ref": "#/$defs/PlacedMessage", "asCell": [ "cell" ] }, "type": "array" } }, "type": "object" } }, "type": "object" }, "PlacedRoom": { "properties": { "about": { "$ref": "#/$defs/ChatRoomAbout", "description": "What the room says about itself." }, "canSend": { "description": "Whether the reader can send.", "type": "boolean" }, "messages": { "$ref": "#/$defs/PlacedMessageList", "description": "The room's messages." }, "participants": { "description": "The room's participants.", "items": { "$ref": "#/$defs/ChatProfile", "asCell": [ "cell" ] }, "type": "array" } }, "type": "object" }, "PlacedTallies": { "properties": { "message": { "asCell": [ "cell" ], "description": "The message.", "type": "unknown" }, "tallies": { "description": "Its reactions, by emoji, in the order each was first used.", "items": { "$ref": "#/$defs/ChatReactionTally" }, "type": "array" } }, "required": [ "message", "tallies" ], "type": "object" }, "PlacementState": { "enum": [ "member", "not-member", "unavailable" ] } }, "description": "What an adapter holds.", "properties": { "placement": { "$ref": "#/$defs/AdaptedPlacement", "description": "The placement, set when the adapter is created." } }, "required": [ "placement" ], "type": "object" }, "pattern": "fabrichat/adapter.tsx", "resultSchema": { "$defs": { "AboutRecord": { "properties": { "createdAt": { "description": "When the room was created.", "type": "FabricEpochNsec" }, "kind": { "$ref": "#/$defs/ChatRoomKind", "description": "How the room was created." }, "title": { "description": "The title a group room was created with.", "type": "string" } }, "required": [ "kind" ], "type": "object" }, "AdaptedPlacement": { "properties": { "$VIEWS": { "description": "The placement's data face.", "properties": { "chat": { "$ref": "#/$defs/FabriChatPlacementView" } }, "required": [ "chat" ], "type": "object" }, "room": { "$ref": "#/$defs/PlacedRoom", "description": "The placed room." } }, "required": [ "room", "$VIEWS" ], "type": "object" }, "ChatProfile": { "properties": { "avatar": { "description": "The person's avatar: a URL or a glyph, if they have set one.", "type": "string" }, "name": { "description": "The person's display name, if they have set one.", "type": "string" } }, "type": "object" }, "ChatReaction": { "properties": { "emoji": { "description": "A single emoji.", "type": "string" }, "reactorProfile": { "$ref": "#/$defs/ChatProfile", "description": "The profile the reactor reacted under." }, "sentAt": { "description": "The room's handler clock when it recorded the reaction.", "type": "FabricEpochNsec" } }, "required": [ "reactorProfile", "emoji", "sentAt" ], "type": "object" }, "ChatReactionTally": { "properties": { "count": { "description": "How many people reacted with it.", "type": "number" }, "emoji": { "description": "The emoji.", "type": "string" }, "mine": { "description": "Whether the viewer is one of them.", "type": "boolean" }, "reactors": { "description": "Their profiles, in the order they reacted.", "items": { "$ref": "#/$defs/ChatProfile" }, "type": "array" } }, "required": [ "emoji", "count", "mine", "reactors" ], "type": "object" }, "ChatRoomAbout": { "properties": { "createdAt": { "description": "When the room was created; absent for a space's own chat.", "type": "FabricEpochNsec" }, "kind": { "$ref": "#/$defs/ChatRoomKind", "description": "`\"direct\"` if created as a direct room; `\"group\"` otherwise." }, "policy": { "$ref": "#/$defs/ChatRoomPolicy", "description": "The room's policy, stated correctly, in a document of its own." }, "record": { "$ref": "#/$defs/AboutRecord", "description": "The record the room's creator wrote, whose label names them; absent for a\nspace's own chat, which no one created as a room." }, "title": { "description": "The room's title, which every member shares: the one a member last set,\nor else the one the room was created with. A direct room has none until a\nmember sets one, and a space's own chat has none.", "type": "string" } }, "required": [ "kind", "policy" ], "type": "object" }, "ChatRoomKind": { "enum": [ "direct", "group" ] }, "ChatRoomPolicy": { "properties": { "deletionIsObliteration": { "description": "Whether a sender's deletion of their own message obliterates it.", "type": "boolean" }, "keepsHistory": { "description": "Stated for the policy's shape, and read by nothing: a message keeps no history.", "type": "boolean" }, "maxOpenWindows": { "description": "Stated for the policy's shape, and read by nothing: the room offers no windows.", "type": "number" }, "maxWindowCount": { "description": "How many of the newest messages `messages.latest` holds.", "type": "number" }, "ownersMayObliterate": { "description": "Whether an OWNER may obliterate messages.", "type": "boolean" }, "proposedTimeMaxAgeNsec": { "description": "Stated for the policy's shape, and read by nothing: a sender proposes no time.", "type": "FabricDurationNsec" }, "proposedTimeMaxLeadNsec": { "description": "Stated for the policy's shape, and read by nothing: a sender proposes no time.", "type": "FabricDurationNsec" }, "recentActivityWindowNsec": { "description": "Stated for the policy's shape, and read by nothing: the room keeps no activity log.", "type": "FabricDurationNsec" } }, "required": [ "ownersMayObliterate", "keepsHistory", "deletionIsObliteration", "proposedTimeMaxAgeNsec", "proposedTimeMaxLeadNsec", "recentActivityWindowNsec", "maxWindowCount", "maxOpenWindows" ], "type": "object" }, "FabriChatPlacementView": { "properties": { "about": { "$ref": "#/$defs/ChatRoomAbout", "description": "What the room says about itself; absent unless `state` is `\"member\"`." }, "canSend": { "description": "Whether the viewer can send.", "type": "boolean" }, "messages": { "$ref": "#/$defs/PlacedMessageList", "description": "The room's messages; absent unless `state` is `\"member\"`." }, "participants": { "description": "The room's participants.", "items": { "$ref": "#/$defs/ChatProfile" }, "type": "array" }, "reactionTallies": { "description": "Reactions on the newest messages.", "items": { "$ref": "#/$defs/PlacedTallies" }, "type": "array" }, "state": { "$ref": "#/$defs/PlacementState", "description": "Whether the viewer can read the room." } }, "required": [ "state", "canSend", "participants", "reactionTallies" ], "type": "object" }, "PlacedMessage": { "properties": { "reactions": { "description": "Everyone's reactions to the message.", "items": { "$ref": "#/$defs/ChatReaction" }, "type": "array" } }, "type": "object" }, "PlacedMessageList": { "properties": { "count": { "description": "How many messages the room holds.", "type": "number" }, "latest": { "description": "The newest messages of the main conversation.", "properties": { "hasOlder": { "type": "boolean" }, "messages": { "items": { "$ref": "#/$defs/PlacedMessage" }, "type": "array" } }, "type": "object" } }, "type": "object" }, "PlacedRoom": { "properties": { "about": { "$ref": "#/$defs/ChatRoomAbout", "description": "What the room says about itself." }, "canSend": { "description": "Whether the reader can send.", "type": "boolean" }, "messages": { "$ref": "#/$defs/PlacedMessageList", "description": "The room's messages." }, "participants": { "description": "The room's participants.", "items": { "$ref": "#/$defs/ChatProfile" }, "type": "array" } }, "type": "object" }, "PlacedTallies": { "properties": { "message": { "description": "The message.", "type": "unknown" }, "tallies": { "description": "Its reactions, by emoji, in the order each was first used.", "items": { "$ref": "#/$defs/ChatReactionTally" }, "type": "array" } }, "required": [ "message", "tallies" ], "type": "object" }, "PlacementState": { "enum": [ "member", "not-member", "unavailable" ] } }, "description": "What an adapter offers.", "properties": { "$NAME": { "description": "The placed room's title, for lists of pieces: `\"Chat\"` for a room with no\ntitle, and `\"Chat (unavailable)\"` for a room the viewer can't read.", "type": "string" }, "$UI": { "$ref": "https://commonfabric.org/schemas/vnode.json", "description": "The room's own rendering, or why there is none." }, "$VIEWS": { "description": "The placement's data face, re-exported by link.", "properties": { "chat": { "$ref": "#/$defs/FabriChatPlacementView" } }, "required": [ "chat" ], "type": "object" }, "placement": { "$ref": "#/$defs/AdaptedPlacement", "description": "The placement." } }, "required": [ "placement", "$NAME", "$UI", "$VIEWS" ], "type": "object" } }