{ "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." }, "revision": { "description": "The revision of the room's entry in the user's catalog, as listed, which a\nrequest to forget the room names; absent where the entry is not one the\ncatalog keeps revisions of.", "type": "string" }, "room": { "$ref": "#/$defs/ChatRoomLink", "asCell": [ "cell" ], "description": "The room." }, "since": { "description": "When this user's catalog admitted 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" }, "ChatManagerProfile": { "properties": { "avatar": { "description": "The person's avatar: a URL or a glyph, if they have set one.", "type": "string" }, "inbox": { "$ref": "#/$defs/ProfileInbox", "description": "Where the person's offers are delivered, as the profile types its pointer:\na link naming nothing of the inbox but its name. An inbox labels its\noffers confidential to its owner, and a run reading the pointer as a link\nto more of the inbox, or untyped, takes that label on, which then refuses\nits sends." }, "name": { "description": "The person's display name, if they have set one.", "type": "string" } }, "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": { "code": { "description": "Which refusal it is, for a client to act on, where a client has one to\ntake; absent for the others.", "enum": [ "space-own-chat" ], "type": "string" }, "reason": { "description": "Why, for a person to read.", "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." }, "messages": { "description": "Where the conversation stands: what of `messages` every member shares.", "properties": { "count": { "description": "How many messages the room holds, obliterated tombstones included.", "type": "number" }, "newestAt": { "description": "The newest message's `sentAt`; absent while there are none.", "type": "FabricEpochNsec" } }, "required": [ "count" ], "type": "object" }, "roster": { "description": "The profiles of those who joined the room, in the order they joined, as a\nmanager reads them: each a link, whose profile is read only through it.", "items": { "$ref": "#/$defs/ChatManagerProfile", "asCell": [ "cell" ] }, "type": "array" } }, "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" }, "ProfileInbox": { "properties": { "piece": { "$ref": "#/$defs/ShareInboxPiece", "asCell": [ "cell" ], "description": "The owner's share inbox piece." } }, "type": "object" }, "ShareInboxPiece": { "properties": { "$NAME": { "type": "string" } }, "type": "object" }, "SharedSpaceCatalogStorage": { "additionalProperties": true, "properties": {}, "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, for the rooms this manager\ncreated or accepted, the ones its user's host accepted for them included.", "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" }, "sharedSpaceCatalog": { "$ref": "#/$defs/SharedSpaceCatalogStorage", "asCell": [ "cell" ], "default": { "entries": {}, "offers": {} }, "description": "The user's shared-space catalog, which lists the rooms they belong to: in\na user's home space, Home's. A manager given none keeps one of its own." } }, "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." }, "revision": { "description": "The revision of the room's entry in the user's catalog, as listed, which a\nrequest to forget the room names; absent where the entry is not one the\ncatalog keeps revisions of.", "type": "string" }, "room": { "$ref": "#/$defs/ChatRoomLink", "description": "The room." }, "since": { "description": "When this user's catalog admitted 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" }, "ChatManagerProfile": { "properties": { "avatar": { "description": "The person's avatar: a URL or a glyph, if they have set one.", "type": "string" }, "inbox": { "$ref": "#/$defs/ProfileInbox", "description": "Where the person's offers are delivered, as the profile types its pointer:\na link naming nothing of the inbox but its name. An inbox labels its\noffers confidential to its owner, and a run reading the pointer as a link\nto more of the inbox, or untyped, takes that label on, which then refuses\nits sends." }, "name": { "description": "The person's display name, if they have set one.", "type": "string" } }, "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": { "code": { "description": "Which refusal it is, for a client to act on, where a client has one to\ntake; absent for the others.", "enum": [ "space-own-chat" ], "type": "string" }, "reason": { "description": "Why, for a person to read.", "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." }, "messages": { "description": "Where the conversation stands: what of `messages` every member shares.", "properties": { "count": { "description": "How many messages the room holds, obliterated tombstones included.", "type": "number" }, "newestAt": { "description": "The newest message's `sentAt`; absent while there are none.", "type": "FabricEpochNsec" } }, "required": [ "count" ], "type": "object" }, "roster": { "description": "The profiles of those who joined the room, in the order they joined, as a\nmanager reads them: each a link, whose profile is read only through it.", "items": { "$ref": "#/$defs/ChatManagerProfile" }, "type": "array" } }, "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" }, "people": { "additionalProperties": { "items": { "$ref": "#/$defs/ChatManagerProfile" }, "type": "array" }, "description": "The people this user's rooms list, other than this user: by the principal\neach one's profile attests, the profiles attesting it, each once, in the\norder the rooms, newest first, list them.", "properties": {}, "type": "object" }, "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" }, "sharedSpaceCatalog": { "$ref": "#/$defs/SharedSpaceCatalogStorage", "description": "The user's shared-space catalog, as stored, from which `rooms` is drawn. A\nreader in another piece finds a room's entry here by its space without\nthis manager's view having been computed." } }, "required": [ "openDirect", "createGroup", "accept", "forget", "delivered", "outgoingNotices", "direct", "requests", "rooms", "sharedSpaceCatalog", "people" ], "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" }, "keepArchived": { "description": "Whether accepting a room leaves its entry archived, when it is; absent,\naccepting the room restores it.", "type": "boolean" }, "members": { "description": "The DIDs of a new group room's other members.", "items": { "type": "string" }, "type": "array" }, "profile": { "$ref": "#/$defs/ChatManagerProfile", "description": "A direct room's other member's profile, through whose share inbox a new\nroom is offered to them." }, "profiles": { "description": "The profiles of more of a new group room's other members, each naming its\nmember with its `represents-principal` label, through whose share inbox\nthe room is offered to them.", "items": { "$ref": "#/$defs/ChatManagerProfile" }, "type": "array" }, "requestId": { "description": "Chosen by the sender; the outcome is recorded under it, except for a start\nthat would create a room without its reviewed `ChatStart`, which is\nrefused whole and records none.", "type": "string" }, "revision": { "description": "The revision of a room's entry, as the list the request was made from\nshowed it, for a room to forget.", "type": "string" }, "room": { "$ref": "#/$defs/ChatRoomLink", "description": "A room to accept or forget." }, "target": { "description": "A rendered control's text, or the profile it starts a direct room with.", "properties": { "dataset": { "description": "The principal an older room's chip names the person by.", "properties": { "counterpart": { "type": "string" } }, "type": "object" }, "name": { "$ref": "#/$defs/ChatManagerProfile", "description": "The profile of the person a participant's chip starts a chat with." }, "value": { "type": "string" } }, "type": "object" }, "title": { "description": "A new group room's title.", "type": "string" } }, "type": "object" }, "ProfileInbox": { "properties": { "piece": { "$ref": "#/$defs/ShareInboxPiece", "description": "The owner's share inbox piece." } }, "type": "object" }, "ShareInboxPiece": { "properties": { "$NAME": { "type": "string" } }, "type": "object" }, "SharedSpaceCatalogStorage": { "additionalProperties": true, "properties": {}, "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" }, "people": { "additionalProperties": { "items": { "$ref": "#/$defs/ChatManagerProfile" }, "type": "array" }, "description": "The people this user's rooms list, other than this user: by the principal\neach one's profile attests, the profiles attesting it, each once, in the\norder the rooms, newest first, list them.", "properties": {}, "type": "object" }, "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" }, "sharedSpaceCatalog": { "$ref": "#/$defs/SharedSpaceCatalogStorage", "description": "The user's shared-space catalog, as stored, from which `rooms` is drawn. A\nreader in another piece finds a room's entry here by its space without\nthis manager's view having been computed." } }, "required": [ "rooms", "sharedSpaceCatalog", "direct", "requests", "outgoingNotices", "people", "openDirect", "createGroup", "accept", "forget", "delivered", "$NAME", "$UI", "$VIEWS" ], "type": "object" } }