{ "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": "A group room's title.", "type": "string" } }, "required": [ "kind" ], "type": "object" }, "ChatIndexEntry": { "properties": { "counterpart": { "description": "A direct room's other member, by principal.", "type": "string" }, "kind": { "$ref": "#/$defs/ChatRoomKind", "description": "The room's kind, as its `about.kind` says." }, "room": { "$ref": "#/$defs/ChatRoomLink", "asCell": [ "cell" ], "description": "The room." }, "since": { "description": "When this user created or accepted it.", "type": "FabricEpochNsec" } }, "required": [ "room", "kind", "since" ], "type": "object" }, "ChatManagerNotice": { "properties": { "id": { "description": "The notice's id, unique in the manager.", "type": "string" }, "recipient": { "description": "The DID of the person admitted.", "type": "string" }, "room": { "$ref": "#/$defs/ChatRoomLink", "asCell": [ "cell" ], "description": "The room the recipient was admitted to." } }, "required": [ "id", "room", "recipient" ], "type": "object" }, "ChatRequestOutcome": { "anyOf": [ { "properties": { "status": { "description": "The request has not finished.", "enum": [ "pending" ], "type": "string" } }, "required": [ "status" ], "type": "object" }, { "properties": { "entry": { "$ref": "#/$defs/ChatIndexEntry", "description": "The entry it produced; absent for `forget`." }, "status": { "description": "The request finished.", "enum": [ "done" ], "type": "string" } }, "required": [ "status" ], "type": "object" }, { "properties": { "reason": { "description": "Why.", "type": "string" }, "status": { "description": "The request was refused.", "enum": [ "refused" ], "type": "string" } }, "required": [ "status", "reason" ], "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": "A group room's title. A direct room, and a space's own chat, have none.", "type": "string" } }, "required": [ "kind", "policy" ], "type": "object" }, "ChatRoomKind": { "enum": [ "direct", "group" ] }, "ChatRoomLink": { "properties": { "about": { "$ref": "#/$defs/ChatRoomAbout", "description": "What the room says about itself." } }, "type": "object" }, "ChatRoomPolicy": { "properties": { "deletionIsObliteration": { "description": "Whether a sender's deletion of their own message obliterates it.", "type": "boolean" }, "keepsHistory": { "description": "Whether an edit or a plain deletion keeps the version it replaces.", "type": "boolean" }, "maxOpenWindows": { "description": "The most message windows a session can have open.", "type": "number" }, "maxWindowCount": { "description": "The most messages a message window holds.", "type": "number" }, "ownersMayObliterate": { "description": "Whether an OWNER may obliterate messages.", "type": "boolean" }, "proposedTimeMaxAgeNsec": { "description": "How far before the room's clock a proposed time is accepted, in ns.", "type": "FabricDurationNsec" }, "proposedTimeMaxLeadNsec": { "description": "How far after the room's clock a proposed time is accepted, in ns.", "type": "FabricDurationNsec" }, "recentActivityWindowNsec": { "description": "How long an entry stays in `recentActivity`, in ns.", "type": "FabricDurationNsec" } }, "required": [ "ownersMayObliterate", "keepsHistory", "deletionIsObliteration", "proposedTimeMaxAgeNsec", "proposedTimeMaxLeadNsec", "recentActivityWindowNsec", "maxWindowCount", "maxOpenWindows" ], "type": "object" } }, "description": "What a manager stores. Every field has a default.", "properties": { "direct": { "additionalProperties": { "$ref": "#/$defs/ChatIndexEntry" }, "asCell": [ "cell" ], "default": {}, "description": "The direct room shared with each counterpart.", "properties": {}, "type": "object" }, "outgoingNotices": { "asCell": [ "cell" ], "default": [], "description": "Notices waiting for a client to deliver them.", "items": { "$ref": "#/$defs/ChatManagerNotice" }, "type": "array" }, "requests": { "additionalProperties": { "$ref": "#/$defs/ChatRequestOutcome" }, "asCell": [ "cell" ], "default": {}, "description": "Each request's outcome.", "properties": {}, "type": "object" }, "rooms": { "asCell": [ "cell" ], "default": [], "description": "The rooms this user belongs to.", "items": { "$ref": "#/$defs/ChatIndexEntry" }, "type": "array" } }, "type": "object" }, "pattern": "fabrichat/manager.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": "A group room's title.", "type": "string" } }, "required": [ "kind" ], "type": "object" }, "ChatIndexEntry": { "properties": { "counterpart": { "description": "A direct room's other member, by principal.", "type": "string" }, "kind": { "$ref": "#/$defs/ChatRoomKind", "description": "The room's kind, as its `about.kind` says." }, "room": { "$ref": "#/$defs/ChatRoomLink", "description": "The room." }, "since": { "description": "When this user created or accepted it.", "type": "FabricEpochNsec" } }, "required": [ "room", "kind", "since" ], "type": "object" }, "ChatManagerNotice": { "properties": { "id": { "description": "The notice's id, unique in the manager.", "type": "string" }, "recipient": { "description": "The DID of the person admitted.", "type": "string" }, "room": { "$ref": "#/$defs/ChatRoomLink", "description": "The room the recipient was admitted to." } }, "required": [ "id", "room", "recipient" ], "type": "object" }, "ChatRequestOutcome": { "anyOf": [ { "properties": { "status": { "description": "The request has not finished.", "enum": [ "pending" ], "type": "string" } }, "required": [ "status" ], "type": "object" }, { "properties": { "entry": { "$ref": "#/$defs/ChatIndexEntry", "description": "The entry it produced; absent for `forget`." }, "status": { "description": "The request finished.", "enum": [ "done" ], "type": "string" } }, "required": [ "status" ], "type": "object" }, { "properties": { "reason": { "description": "Why.", "type": "string" }, "status": { "description": "The request was refused.", "enum": [ "refused" ], "type": "string" } }, "required": [ "status", "reason" ], "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": "A group room's title. A direct room, and a space's own chat, have none.", "type": "string" } }, "required": [ "kind", "policy" ], "type": "object" }, "ChatRoomKind": { "enum": [ "direct", "group" ] }, "ChatRoomLink": { "properties": { "about": { "$ref": "#/$defs/ChatRoomAbout", "description": "What the room says about itself." } }, "type": "object" }, "ChatRoomPolicy": { "properties": { "deletionIsObliteration": { "description": "Whether a sender's deletion of their own message obliterates it.", "type": "boolean" }, "keepsHistory": { "description": "Whether an edit or a plain deletion keeps the version it replaces.", "type": "boolean" }, "maxOpenWindows": { "description": "The most message windows a session can have open.", "type": "number" }, "maxWindowCount": { "description": "The most messages a message window holds.", "type": "number" }, "ownersMayObliterate": { "description": "Whether an OWNER may obliterate messages.", "type": "boolean" }, "proposedTimeMaxAgeNsec": { "description": "How far before the room's clock a proposed time is accepted, in ns.", "type": "FabricDurationNsec" }, "proposedTimeMaxLeadNsec": { "description": "How far after the room's clock a proposed time is accepted, in ns.", "type": "FabricDurationNsec" }, "recentActivityWindowNsec": { "description": "How long an entry stays in `recentActivity`, in ns.", "type": "FabricDurationNsec" } }, "required": [ "ownersMayObliterate", "keepsHistory", "deletionIsObliteration", "proposedTimeMaxAgeNsec", "proposedTimeMaxLeadNsec", "recentActivityWindowNsec", "maxWindowCount", "maxOpenWindows" ], "type": "object" }, "FabriChatManagerView": { "properties": { "accept": { "$ref": "#/$defs/ManagerStreamEvent", "asCell": [ "stream" ], "description": "Records a room this user has been admitted to." }, "createGroup": { "$ref": "#/$defs/ManagerStreamEvent", "asCell": [ "stream" ], "description": "Creates a group room." }, "delivered": { "$ref": "#/$defs/ManagerStreamEvent", "asCell": [ "stream" ], "description": "Reports a notice delivered." }, "direct": { "additionalProperties": { "$ref": "#/$defs/ChatIndexEntry" }, "description": "The direct room this user shares with each counterpart, by principal.", "properties": {}, "type": "object" }, "forget": { "$ref": "#/$defs/ManagerStreamEvent", "asCell": [ "stream" ], "description": "Removes a room from this user's list." }, "openDirect": { "$ref": "#/$defs/ManagerStreamEvent", "asCell": [ "stream" ], "description": "Finds or creates the direct room with a person." }, "outgoingNotices": { "description": "Notices this user's requests have produced that no one has delivered.", "items": { "$ref": "#/$defs/ChatManagerNotice" }, "type": "array" }, "requests": { "additionalProperties": { "$ref": "#/$defs/ChatRequestOutcome" }, "description": "The outcome of each request, by the `requestId` its caller chose.", "properties": {}, "type": "object" }, "rooms": { "description": "Every room this user belongs to and hasn't forgotten, newest first.", "items": { "$ref": "#/$defs/ChatIndexEntry" }, "type": "array" } }, "required": [ "openDirect", "createGroup", "accept", "forget", "delivered", "direct", "rooms", "requests", "outgoingNotices" ], "type": "object" }, "ManagerStreamEvent": { "properties": { "counterpart": { "description": "The DID of a direct room's other member.", "type": "string" }, "id": { "description": "The id of a notice delivered.", "type": "string" }, "joinableByLink": { "description": "Whether a new group room admits anyone who has its link; absent for a room\nadmitting its members alone.", "type": "boolean" }, "members": { "description": "The DIDs of a new group room's other members.", "items": { "type": "string" }, "type": "array" }, "requestId": { "description": "Chosen by the sender; the outcome is recorded under it.", "type": "string" }, "room": { "$ref": "#/$defs/ChatRoomLink", "description": "A room to accept or forget." }, "target": { "description": "A rendered control's text.", "properties": { "value": { "type": "string" } }, "type": "object" }, "title": { "description": "A new group room's title.", "type": "string" } }, "type": "object" } }, "description": "What a manager offers: `ChatManagerOutput`.", "properties": { "$NAME": { "description": "The manager's name, for lists of pieces.", "type": "string" }, "$UI": { "$ref": "https://commonfabric.org/schemas/vnode.json", "description": "The manager's rendering." }, "$VIEWS": { "description": "The manager's data face, as one group.", "properties": { "chats": { "$ref": "#/$defs/FabriChatManagerView" } }, "required": [ "chats" ], "type": "object" }, "accept": { "$ref": "#/$defs/ManagerStreamEvent", "asCell": [ "stream" ], "description": "Records a room this user has been admitted to." }, "createGroup": { "$ref": "#/$defs/ManagerStreamEvent", "asCell": [ "stream" ], "description": "Creates a group room." }, "delivered": { "$ref": "#/$defs/ManagerStreamEvent", "asCell": [ "stream" ], "description": "Reports a notice delivered." }, "direct": { "additionalProperties": { "$ref": "#/$defs/ChatIndexEntry" }, "description": "The direct room this user shares with each counterpart, by principal.", "properties": {}, "type": "object" }, "forget": { "$ref": "#/$defs/ManagerStreamEvent", "asCell": [ "stream" ], "description": "Removes a room from this user's list." }, "openDirect": { "$ref": "#/$defs/ManagerStreamEvent", "asCell": [ "stream" ], "description": "Finds or creates the direct room with a person." }, "outgoingNotices": { "description": "Notices this user's requests have produced that no one has delivered.", "items": { "$ref": "#/$defs/ChatManagerNotice" }, "type": "array" }, "requests": { "additionalProperties": { "$ref": "#/$defs/ChatRequestOutcome" }, "description": "The outcome of each request, by the `requestId` its caller chose.", "properties": {}, "type": "object" }, "rooms": { "description": "Every room this user belongs to and hasn't forgotten, newest first.", "items": { "$ref": "#/$defs/ChatIndexEntry" }, "type": "array" } }, "required": [ "rooms", "direct", "requests", "outgoingNotices", "openDirect", "createGroup", "accept", "forget", "delivered", "$NAME", "$UI", "$VIEWS" ], "type": "object" } }