@protobase/cli 0.121.6 → 0.121.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/package.js +1 -1
- package/package.json +8 -8
- package/skills/protobase/references/features/calls.md +1 -0
- package/skills/protobase/references/features/record-pages.md +1 -1
- package/skills/protobase/references/reference/calls.md +4 -0
- package/skills/protobase/references/reference/ui-config.md +22 -2
package/dist/cli/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.121.
|
|
3
|
+
"version": "0.121.7",
|
|
4
4
|
"description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@better-auth/core": "^1.7.12",
|
|
45
45
|
"@hono/node-server": "^2.1.3",
|
|
46
|
-
"@protobase/config": "0.121.
|
|
47
|
-
"@protobase/layout": "0.121.
|
|
48
|
-
"@protobase/query": "0.121.
|
|
49
|
-
"@protobase/schema": "0.121.
|
|
50
|
-
"@protobase/server": "0.121.
|
|
51
|
-
"@protobase/ui": "0.121.
|
|
52
|
-
"@protobase/workflows": "0.121.
|
|
46
|
+
"@protobase/config": "0.121.7",
|
|
47
|
+
"@protobase/layout": "0.121.7",
|
|
48
|
+
"@protobase/query": "0.121.7",
|
|
49
|
+
"@protobase/schema": "0.121.7",
|
|
50
|
+
"@protobase/server": "0.121.7",
|
|
51
|
+
"@protobase/ui": "0.121.7",
|
|
52
|
+
"@protobase/workflows": "0.121.7",
|
|
53
53
|
"@react-email/render": "^2.1.0",
|
|
54
54
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
55
55
|
"@sentry/vite-plugin": "^11.10.0",
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
Audio and video calls between an app's users, through LiveKit or peer to peer, with Protobase deciding who is in a call and who hears whom.
|
|
6
6
|
|
|
7
7
|
- [Calls](../reference/calls.md) (beta): Voice and video calls on any record, with screen sharing, a ready-made call view and ringing on any open page, and guest links that let someone from outside join one call.
|
|
8
|
+
- [Calls on conversation pages](../reference/ui-config.md#calls) (beta): A configured conversation starts and joins its record's call from its header, and shows the call beside the messages, or above them at mobile width, with no component of your own.
|
|
8
9
|
- [LiveKit](../reference/calls.md#livekit) (in development): The media goes through a LiveKit server, self-hosted or LiveKit Cloud, which Protobase speaks to for each member.
|
|
9
10
|
- [Peer to peer](../reference/calls.md#peer-to-peer) (in development): With no media server, the members' browsers send their media straight to each other, for small calls.
|
|
10
11
|
- [Admitting members](../reference/calls.md#admitting-members) (in development): A function of your own admits the caller to a call with what they may send and whose tracks they hear.
|
|
@@ -11,7 +11,7 @@ The page of one record, with its sections, related records, galleries, charts an
|
|
|
11
11
|
- [Record pages that open another](../reference/ui-config.md#a-record-page-that-opens-another): A record's page opens another address built from its fields in its place, such as a workflow run opening its workflow's page with the run shown.
|
|
12
12
|
- [Record page opens elsewhere](../reference/ui-config.md#open-elsewhere) (beta): A view can send its record's address to another page its fields name, such as a message opening in its conversation, so search results and links land where the record is read.
|
|
13
13
|
- [Full-area record pages](../reference/ui-config.md#full-area-record-pages) (beta): A view draws its record pages with a component of its own that fills the area beside the sidebar and under the top bar, such as a chat channel, and links to the standard page.
|
|
14
|
-
- [Conversation pages](../reference/ui-config.md#conversation-pages) (beta): A record's page is its conversation, configured with no component of your own: a header with its title, topic and details, its messages grouped by day and author with mentions and edits shown, and a box that sends one, opening on a New messages line at the reader's place, on the web and at mobile width. People react to its messages, edit and delete them and reply in threads beside the conversation, by pointer or touch.
|
|
14
|
+
- [Conversation pages](../reference/ui-config.md#conversation-pages) (beta): A record's page is its conversation, configured with no component of your own: a header with its title, topic and details, its messages grouped by day and author with mentions and edits shown, and a box that sends one, opening on a New messages line at the reader's place, on the web and at mobile width. People react to its messages, edit and delete them and reply in threads beside the conversation, by pointer or touch, and start or join the record's call from its header, shown beside the messages, or above them at mobile width.
|
|
15
15
|
- [Read view and edit](../reference/ui-config.md#read-view-and-edit): A record opens as a read-only fact sheet or a form, and Edit opens the form at its own address.
|
|
16
16
|
- [Unsaved edits](../reference/ui-config.md#editing-a-record): Unsaved changes to a record stay in the browser and can be resumed, and leaving a form, a dialog or a comment with changes asks first.
|
|
17
17
|
- [Record forms](../reference/ui-config.md#editing-a-record): Relations are picked from a list that narrows as you type, numbers are read as the browser's language writes them, and a refused save says under each field what is wrong.
|
|
@@ -125,6 +125,8 @@ await call.publish({ camera: media.getVideoTracks()[0], microphone: media.getAud
|
|
|
125
125
|
| `connections()` | How each of the member's connections fares now, to each other member peer-to-peer or to the media server with LiveKit: `{ member?, state, roundTripMs?, lostRatio? }`, the round trip and the share of received media lost once connected. |
|
|
126
126
|
| `leave()` | Leaves the call. |
|
|
127
127
|
|
|
128
|
+
`client.functionSocketUrl(name, query)` of `@protobase/client` gives the socket of your function beside the client's API, such as `wss://app.example/api/functions/meeting?meeting=7` for `('meeting', { meeting: '7' })`, to pass as `url`.
|
|
129
|
+
|
|
128
130
|
`call.id` is the call, as the record's calls list it and `calls.remove` takes it. `onSpeakers` gets who speaks how loudly, and `onUnpublished` a source the media server stopped, such as after the member lost the right to send.
|
|
129
131
|
|
|
130
132
|
A call that is left rejects the join, or ends a joined call, with its reason in `onState`: `ended`, `removed` (by `calls.remove`, or by a check that refused the member), `full`, `refused` (the function refused the caller), or `unavailable`, when the server failed to take the member in `maxRetries` times in a row.
|
|
@@ -159,6 +161,8 @@ The view checks the microphone and camera first, with a preview of the camera, a
|
|
|
159
161
|
| `url` | Your function's socket, which admits the member. |
|
|
160
162
|
| `nameOf` | A person's name by the member your function admits them as, such as a user id; the member itself by default. |
|
|
161
163
|
|
|
164
|
+
A [conversation page](ui-config.md#calls) with `call` places the call view and the call mark for you.
|
|
165
|
+
|
|
162
166
|
`CallView` is the view on its own, with `leave`, where Leave goes, in place of the record: for a call you place without the record's address.
|
|
163
167
|
|
|
164
168
|
### A record's call
|
|
@@ -775,7 +775,7 @@ The standard record page, with the layout's sections, the related records, Edit
|
|
|
775
775
|
### Conversation pages
|
|
776
776
|
|
|
777
777
|
:::caution[Beta]
|
|
778
|
-
A conversation page shows each message's text with its mentions and keeps line breaks, without markdown; it has no files
|
|
778
|
+
A conversation page shows each message's text with its mentions and keeps line breaks, without markdown; it has no files yet, and a deleted message leaves no trace in its place.
|
|
779
779
|
:::
|
|
780
780
|
|
|
781
781
|
`.record({ conversation })` makes the record page the record's conversation, for a record that holds one, such as a chat channel, a direct message or a support case, with no component of the app's own. It fills the content area as a [full-area record page](#full-area-record-pages) does, on the web and at mobile width: a header row, the messages that point at the record, and a box that sends one, which stays in view while the messages scroll above it.
|
|
@@ -803,6 +803,7 @@ view<typeof channels>('channels').record({
|
|
|
803
803
|
labels: { thumbs_up: { symbol: '👍', name: 'Thumbs up' }, heart: { symbol: '❤️', name: 'Heart' } },
|
|
804
804
|
},
|
|
805
805
|
thread: { field: 'thread_id', count: 'reply_count', last: 'last_reply_at' },
|
|
806
|
+
call: 'call',
|
|
806
807
|
},
|
|
807
808
|
})
|
|
808
809
|
```
|
|
@@ -825,8 +826,9 @@ view<typeof channels>('channels').record({
|
|
|
825
826
|
| `delete` | `true`: anyone the message resource's delete access allows deletes a message, after confirming; or `{ unless }`, a condition on the message's own fields that keeps it, such as `reply_count > 0`. |
|
|
826
827
|
| `reactions` | Emoji reactions under each message: `{ resource, field, user, emoji, labels }`. |
|
|
827
828
|
| `thread` | Replies in a thread under a message, in a panel beside the conversation: `{ field, count, last }`. |
|
|
829
|
+
| `call` | The record's [call](calls.md), by the name of the [API function](../guides/api-functions.md) that admits people to it. |
|
|
828
830
|
|
|
829
|
-
The header shows the record's title, which the top bar repeats at mobile width and so shows there only with `members`, the subtitle, and *Details*, a link to the record's standard page at `?standard=true`, with its sections, Edit and Delete. The latest 50 messages show oldest first, with *Load earlier messages* at the top for more. A day divider opens each day, and one person's messages sent within five minutes of each other show under their name once. A message resource with [`.live()`](live.md) shows new, changed and deleted messages as they happen. Every read goes through the reader's own access: a message they may not read never shows, and a reader who may not read the messages, a field each one needs or the fields of `thread` gets the standard page. The box shows for a reader who may create messages.
|
|
831
|
+
The header shows the record's title, which the top bar repeats at mobile width and so shows there only with `members`, the subtitle, the call with `call`, and *Details*, a link to the record's standard page at `?standard=true`, with its sections, Edit and Delete. The latest 50 messages show oldest first, with *Load earlier messages* at the top for more. A day divider opens each day, and one person's messages sent within five minutes of each other show under their name once. A message resource with [`.live()`](live.md) shows new, changed and deleted messages as they happen. Every read goes through the reader's own access: a message they may not read never shows, and a reader who may not read the messages, a field each one needs or the fields of `thread` gets the standard page. The box shows for a reader who may create messages.
|
|
830
832
|
|
|
831
833
|
With `readPosition`, the conversation opens on a *New messages* line above the first message someone else wrote since the reader's position, and moves the position to the newest message whenever they read to the end. The read position resource keeps one record per reader and record: its `.author()` is the reader, `field` is a relation to the record and `message` an integer field holding the key of the newest message read, so the message resource's key is one integer column that grows as messages arrive. The page reads and writes only the reader's own position. Without `readPosition`, there is no line and nothing is written.
|
|
832
834
|
|
|
@@ -839,6 +841,24 @@ With `reactions`, `edit`, `delete` or `thread`, people act on the messages where
|
|
|
839
841
|
- **Delete**: *Delete* asks before the message goes for everyone. A reader who may not read the fields `unless` reads gets no *Delete*.
|
|
840
842
|
- **Threads**: `field` is the filterable relation of the messages to themselves that holds a reply's first message, empty for a message of the conversation itself, `count` an integer field holding a first message's number of replies and `last` a date or timestamp field holding when its last reply came, both kept by the database, such as by a trigger. The conversation shows only messages outside threads; under a message with replies, a link names how many and when the last came. It and *Reply in thread* open the thread at `?thread=<key>`, so a link can open it too: in a panel beside the conversation, covering the screen at mobile width, with the first message, its replies and a box of its own that replies in the thread. An address naming a message of another conversation opens no thread there. A reply gets its first message's conversation from the box, so keep the two the same in the database, such as by a check in the trigger that counts the replies, as an API create can set them apart.
|
|
841
843
|
|
|
844
|
+
#### Calls
|
|
845
|
+
|
|
846
|
+
With `call`, people start or join the record's call from the conversation's header, and talk in it beside the messages, while what they write stays the conversation's own messages. `call` names the [API function](../guides/api-functions.md) that admits people to the call with `calls.join`, as in [Admitting members](calls.md#admitting-members); the page opens its socket with the record's key as `key`:
|
|
847
|
+
|
|
848
|
+
```ts
|
|
849
|
+
// functions/call.ts
|
|
850
|
+
import { defineFunction } from '@protobase/server'
|
|
851
|
+
|
|
852
|
+
export default defineFunction(async (request, { session, acceptWebSocket, calls }) => {
|
|
853
|
+
const key = new URL(request.url).searchParams.get('key')!
|
|
854
|
+
return acceptWebSocket(await calls.join({ record: { resource: 'channels', key }, member: String(session.user.id), publish: true }))
|
|
855
|
+
})
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
The header shows *Start call* while no call goes on, and "Call in progress · 3 · Join" while one does, live, as the [call mark](calls.md#a-records-call) does. *Start call* and *Join* are links to the record's page joining its call, `?call=join`, which shows the [call view](calls.md#the-call-view) beside the messages, or above them at mobile width, each taking half the space, so the box stays in view. People in the call are named after the organization's members. A thread opens after both, covering the screen at mobile width while the call goes on under it, and opening or closing a thread keeps the call. *Leave* goes back to the conversation alone.
|
|
859
|
+
|
|
860
|
+
<gap>Joining or leaving the call from a conversation page cannot keep an open thread because the call's links do not carry the page's other address values.</gap>
|
|
861
|
+
|
|
842
862
|
<gap>A conversation page cannot offer *Edit* when its `sender` is a relation because matching a related record to the reader is not implemented; a `sender` of user ids, such as the resource's `.author()`, gets it.</gap>
|
|
843
863
|
|
|
844
864
|
<gap>A conversation page cannot open at a given message, such as a search result, because opening a conversation at a message is not implemented.</gap> <gap>A conversation page cannot show a message's markdown because rendering markdown together with mentions is not implemented.</gap>
|