@protobase/cli 0.62.1 → 0.62.3

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.
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.62.1";
2
+ var version = "0.62.3";
3
3
  //#endregion
4
4
  export { version };
package/dist/dev/entry.js CHANGED
@@ -25,7 +25,7 @@ if (project.auth && !store.__protobaseAuthSchemaChecked) {
25
25
  if (project.auth) await checkResourcesOutsideAuthStore(db, resources.map((resource) => resource.toModel()), project.auth);
26
26
  await checkChanges(db, resources.map((resource) => resource.toModel()), project.events);
27
27
  await checkComments(db, resources.map((resource) => resource.toModel()));
28
- await checkCalls(db, project.calls);
28
+ await checkCalls(db, project.calls, project.events);
29
29
  await checkComputed(db, resources.map((resource) => resource.toModel()));
30
30
  if (assistantSettings(project.options?.assistant, process.env)?.kind === "built-in") await checkQueryRunner(db, project.auth ? authStoreTables(project.auth) : {
31
31
  tables: [],
@@ -53,8 +53,8 @@ const migrationParts = (project) => {
53
53
  }] : [],
54
54
  ...project.calls ? [{
55
55
  name: "calls",
56
- title: "The calls on records, who is in them, and the signals between the processes serving the app",
57
- sql: () => callsMigration(project.db)
56
+ title: "The calls on records, who is in them, whom they ring, and the signals between the processes serving the app",
57
+ sql: () => callsMigration(project.db, project.events)
58
58
  }] : [],
59
59
  ...relayed(project.realtime) ? [{
60
60
  name: "realtime_relay",
@@ -31,7 +31,7 @@ const startServe = async ({ config, env, openDb = (url) => openAppDatabase(pg, u
31
31
  if (env.startupChecks && project.auth) await checkResourcesOutsideAuthStore(db, resources.map((resource) => resource.toModel()), project.auth);
32
32
  if (env.startupChecks) await checkChanges(db, resources.map((resource) => resource.toModel()), project.events);
33
33
  if (env.startupChecks) await checkComments(db, resources.map((resource) => resource.toModel()));
34
- if (env.startupChecks) await checkCalls(db, project.calls);
34
+ if (env.startupChecks) await checkCalls(db, project.calls, project.events);
35
35
  if (env.startupChecks) await checkComputed(db, resources.map((resource) => resource.toModel()));
36
36
  if (env.startupChecks && assistantSettings(project.options?.assistant, process.env)?.kind === "built-in") await checkQueryRunner(db, project.auth ? authStoreTables(project.auth) : {
37
37
  tables: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.62.1",
3
+ "version": "0.62.3",
4
4
  "description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -42,12 +42,12 @@
42
42
  "dependencies": {
43
43
  "@better-auth/core": "^1.7.12",
44
44
  "@hono/node-server": "^2.1.3",
45
- "@protobase/config": "0.62.1",
46
- "@protobase/layout": "0.62.1",
47
- "@protobase/query": "0.62.1",
48
- "@protobase/schema": "0.62.1",
49
- "@protobase/server": "0.62.1",
50
- "@protobase/ui": "0.62.1",
45
+ "@protobase/config": "0.62.3",
46
+ "@protobase/layout": "0.62.3",
47
+ "@protobase/query": "0.62.3",
48
+ "@protobase/schema": "0.62.3",
49
+ "@protobase/server": "0.62.3",
50
+ "@protobase/ui": "0.62.3",
51
51
  "@react-email/render": "^2.1.0",
52
52
  "@scalar/hono-api-reference": "^0.12.10",
53
53
  "@tailwindcss/vite": "^4.3.3",
@@ -4,7 +4,7 @@
4
4
 
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
- - [Calls](../reference/calls.md) (beta): Voice and video calls on any record, with screen sharing. The record's readers see each call live, with who is in it, and you can remove someone from a call.
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.
8
8
  - [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
9
  - [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
10
  - [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.
@@ -5,7 +5,7 @@
5
5
  Audio and video calls on any record of an app, through a LiveKit server or straight between browsers, with Protobase deciding who is in a call, who may send and who hears whom.
6
6
 
7
7
  :::caution[Beta]
8
- Calls live on records, with who is in them, removal and their end. A lobby, stage mode, recording, guests and the call UI are not built yet, and calls have been tested in Chromium and Firefox only.
8
+ Calls live on records, with who is in them, removal and their end, a ready-made call view and ringing. The view is made for small peer-to-peer calls, and there are no host controls yet. A lobby, stage mode, recording and guests are not built yet, and calls have been tested in Chromium and Firefox only.
9
9
  :::
10
10
 
11
11
  ## Turning them on
@@ -126,6 +126,75 @@ await call.publish({ camera: media.getVideoTracks()[0], microphone: media.getAud
126
126
 
127
127
  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.
128
128
 
129
+ ## Call view and ringing
130
+
131
+ `@protobase/ui` draws a call for you: put a call view beside your own content, show a record's call with Join, and ring the people you name wherever they are in the app. A missed call stays in the bell.
132
+
133
+ ### The call view
134
+
135
+ `RecordCall` shows the record's call while the page joins it, and nothing otherwise, so you place it beside the record's own content, such as a conversation's messages on a [full-area record page](custom-components.md#full-area-record-pages). `url` is your function's socket, as `joinCall` takes it:
136
+
137
+ ```tsx
138
+ import { CallMark, RecordCall, useMembers } from '@protobase/ui'
139
+
140
+ export const Conversation = ({ id }: { id: string }) => {
141
+ const { member } = useMembers()
142
+ return (
143
+ <div className="flex h-full">
144
+ <Messages conversation={id} />
145
+ <RecordCall resource="conversations" recordKey={id} url={`/api/functions/call?conversation=${id}`} nameOf={(user) => member(user)?.name ?? user} className="w-1/2" />
146
+ </div>
147
+ )
148
+ }
149
+ ```
150
+
151
+ The view checks the microphone and camera first, with a preview of the camera, and joins after Join. In the call, everyone shows at the same size, the one speaking ringed, or a screen share large with the people beside it, or under it on a phone. Its controls turn the microphone, the camera and a screen share on and off, the share with the tab's sound where the browser offers it, and Leave goes back to the record. Each person's tile marks a muted microphone and a poor connection, and says when the browser cannot connect to them; the view says Reconnecting while its link to the server is restored, and says in plain words when the call is full, when a microphone or camera is blocked, or when the call ended. It fills its parent, at a desktop's width or a phone's.
152
+
153
+ | | |
154
+ | --- | --- |
155
+ | `resource`, `recordKey` | The record whose call it is. |
156
+ | `url` | Your function's socket, which admits the member. |
157
+ | `nameOf` | A person's name by the member your function admits them as, such as a user id; the member itself by default. |
158
+
159
+ `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.
160
+
161
+ ### A record's call
162
+
163
+ `CallMark` shows a record's call where you put it, such as a conversation's header: Start call while there is none, and "Call in progress · 3 · Join" while one goes on, live. Start call and Join open the record's page joining its call, `/{resource}/{key}?call=join`, which shows `RecordCall`.
164
+
165
+ ```tsx
166
+ <CallMark resource="conversations" recordKey={id} />
167
+ ```
168
+
169
+ The mark follows the record's calls over its [record channel](channels.md), on the one socket a page shares for all its channels, so a page that holds a channel already, such as for typing, opens no other connection for it. `useRecordCalls(resource, key)` gives you the same calls, live, for a mark of your own.
170
+
171
+ ### Ringing
172
+
173
+ Name the people a call rings in `calls.join`'s `ring`: when that join starts the record's call, each of them is rung on whatever page of the app they have open, with Accept and Decline, and a ring tone once the page may play sound.
174
+
175
+ ```ts
176
+ return acceptWebSocket(
177
+ await calls.join({
178
+ record: { resource: 'conversations', key: id },
179
+ member: String(session.user.id),
180
+ publish: true,
181
+ ring: { users: conversation.member_ids, title: `Call in ${conversation.title}` },
182
+ }),
183
+ )
184
+ ```
185
+
186
+ | | |
187
+ | --- | --- |
188
+ | `users` | The user ids rung, 50 at most; the caller is never rung. |
189
+ | `title`, `body` | What the ring and the bell say. |
190
+ | `url` | Where the bell's entry leads, an absolute URL; the record's page by default. |
191
+
192
+ A ring lasts 30 seconds. Accept opens the record's page joining the call, on that device only, after the click; joining the call from any device stops the ring on every page of that person, and so do Decline and the end of the call. The ring reaches open pages over the app's [live stream](live.md), which every page of an app with a live resource already holds, so it opens no connection of its own; in an app without one, each page opens that one stream for its rings.
193
+
194
+ With [notifications](notifications.md), each person rung also gets the call in their bell, where a missed call stays, and as a push on their devices, which reaches a closed app. With [status](status.md), someone on do not disturb is not rung on any page or device; the call waits in their bell. Busy rings as usual.
195
+
196
+ `client.rings.list()` and `client.rings.decline(call)` of `@protobase/client` read and decline the calls ringing the signed-in user, for a ring of your own.
197
+
129
198
  ## Reconnecting
130
199
 
131
200
  When the socket to Protobase closes, such as during a deploy, media keeps flowing and the browser opens a new socket that resumes the member from its own state, through the function again, so a member who can no longer read the record, or was removed, is refused. Any process serving the app can take it; when LiveKit no longer knows the member, the browser joins again and sends the same tracks. After `maxRetries` tries in a row, 8 by default, the call is left.
@@ -52,7 +52,7 @@ Every commit message follows [Conventional Commits](https://www.conventionalcomm
52
52
 
53
53
  When `main` moved on while the checks ran, the run of the newer push releases both. `bun run release --dry-run` prints the next version and its notes without tagging anything.
54
54
 
55
- Running the workflow by hand with a tag (`gh workflow run release.yml -f tag=v0.1.0`) only packs and publishes: the packages at that tag and its version, skipping every version npm already has, and the images, which repeats a missed or half-done publish. `node scripts/publish.mjs --dry-run` packs the packages and shows what `npm publish` would send, and `node scripts/publish.mjs --pack`, which CI runs, packs every package without asking npm or publishing. Each package on npm trusts `release.yml` of `PrototeamHQ/protobase` as its publisher; a new package has to be published once by hand before that can be set up. The workflow pushes the images with its own token; a new image on GitHub's registry starts out private and is made public once in its package settings.
55
+ Running the workflow by hand with a tag (`gh workflow run release.yml -f tag=v0.1.0`) only packs and publishes: the packages at that tag and its version, skipping every version npm already has, and the images, which repeats a missed or half-done publish. A publish that npm fails because it could not read the identity token, or because Sigstore's transparency log already holds its provenance (a 409 after npm's own retry), is tried again up to 3 times, and the 409 counts as published when npm has the version; any other failure fails the run. `node scripts/publish.mjs --dry-run` packs the packages and shows what `npm publish` would send, and `node scripts/publish.mjs --pack`, which CI runs, packs every package without asking npm or publishing. Each package on npm trusts `release.yml` of `PrototeamHQ/protobase` as its publisher; a new package has to be published once by hand before that can be set up. The workflow pushes the images with its own token; a new image on GitHub's registry starts out private and is made public once in its package settings.
56
56
 
57
57
  ## Bundled and locked projects
58
58