@protobase/cli 0.123.4 → 0.123.6
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/history-comments-and-live-updates.md +1 -1
- package/skills/protobase/references/reference/realtime-relay.md +2 -2
- package/skills/protobase/references/reference/status.md +5 -4
- package/skills/protobase/references/reference/workflows.md +1 -0
package/dist/cli/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.123.
|
|
3
|
+
"version": "0.123.6",
|
|
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.123.
|
|
47
|
-
"@protobase/layout": "0.123.
|
|
48
|
-
"@protobase/query": "0.123.
|
|
49
|
-
"@protobase/schema": "0.123.
|
|
50
|
-
"@protobase/server": "0.123.
|
|
51
|
-
"@protobase/ui": "0.123.
|
|
52
|
-
"@protobase/workflows": "0.123.
|
|
46
|
+
"@protobase/config": "0.123.6",
|
|
47
|
+
"@protobase/layout": "0.123.6",
|
|
48
|
+
"@protobase/query": "0.123.6",
|
|
49
|
+
"@protobase/schema": "0.123.6",
|
|
50
|
+
"@protobase/server": "0.123.6",
|
|
51
|
+
"@protobase/ui": "0.123.6",
|
|
52
|
+
"@protobase/workflows": "0.123.6",
|
|
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",
|
|
@@ -18,7 +18,7 @@ The changes of each record, comments on it, and pages that refresh as records ch
|
|
|
18
18
|
- [Polling, then a socket](../reference/live.md#polling-then-a-socket): Apps and Node scripts poll for changes first and switch to a WebSocket after 30 seconds, or at once, falling back to polling while the socket is down.
|
|
19
19
|
- [Presence](../reference/channels.md#presence) (beta): Apps see who else has a record open and what each of them tracks, such as online or away, for whoever may read the record.
|
|
20
20
|
- [Realtime relay](../reference/realtime-relay.md) (in development): Apps hand their realtime connections to a relay, so they and their database can sleep while people stay connected: the app issues connect tickets for signed-in people and visitors, keeps the relay's channel members in step with its members records, tells each channel's members of every change, and closes a session's sockets when it signs out or expires. `protobase dev` runs a relay for the app by itself.
|
|
21
|
-
- [Relay presence](../reference/realtime-relay.md#presence) (in development): The relay reports who comes online, goes away and goes offline; the app keeps it in a resource of its own, raises that resource's events, so workflows can act when someone goes offline, and tells the people who share a conversation with them.
|
|
21
|
+
- [Relay presence](../reference/realtime-relay.md#presence) (in development): The relay reports who comes online, goes away and goes offline; the app keeps it in a resource of its own, raises that resource's events, so workflows can act when someone goes offline, and tells the people who share a conversation with them, whose sidebar and members page show them online, away or offline.
|
|
22
22
|
- [Relay in pages](../reference/realtime-relay.md#pages) (in development): Pages follow the relay on one socket: open views stay current from its notices and read again once after a reconnect, conversations show who types, sidebar groups say "typing…" and count unread messages without reading per message, also of a conversation the person was just added to, all by configuration; `client.relay` gives the same from code.
|
|
23
23
|
- [Relay client events](../reference/realtime-relay.md#client-events) (in development): Each channel resource declares in the config the events its clients may send each other, such as typing, with a schema, a size and a rate.
|
|
24
24
|
- [Broadcasts](../reference/channels.md#broadcasts) (beta): Apps on a record send each other short-lived events, such as typing, which are never stored, as JSON or as bytes, such as a chunk of audio or a drawing stroke; the app's own code sends them too, from an API function, over HTTP or [from SQL](../reference/channels.md#from-sql) with `channels.send()`.
|
|
@@ -113,7 +113,7 @@ Each change of a person's presence is also published on `people` as a `presence_
|
|
|
113
113
|
{ "user": "u1", "status": "offline", "at": "2026-11-21T10:00:00.000Z" }
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
-
A person who shares no channel is published to no one.
|
|
116
|
+
A person who shares no channel is published to no one. The admin app shows it in the sidebar and on the members page (see [Pages](#pages)).
|
|
117
117
|
|
|
118
118
|
## Client events
|
|
119
119
|
|
|
@@ -134,7 +134,7 @@ With `realtime.relay`, the admin app follows the relay for someone signed in, on
|
|
|
134
134
|
- **Live updates:** the lists, records and counts of those resources are read again as the relay notices their changes, new, edited and deleted records alike, instead of through [`/api/live`](live.md), which stays for the other `.live()` resources. While a [conversation page](ui-config.md#conversation-pages) is open, only its own channel's notices read it again; the notices of other channels only move the [unread marks](sidebar.md#typing-and-unread-from-the-relay). After the socket was down, everything shown is read again once.
|
|
135
135
|
- **Typing:** a conversation page with `typing` says who else types, above its box and in a thread's box, and tells the others while the reader types, as `typing` events on the record's relay channel. Without the relay, it goes over the record's own [channel](channels.md) instead. A sidebar group with [`typing`](sidebar.md#typing-and-unread-from-the-relay) says "typing…" beside a record someone types in, wherever the reader is.
|
|
136
136
|
- **Unread:** a sidebar group with [`unread`](sidebar.md#typing-and-unread-from-the-relay) counts each conversation's unread messages once, then adds the relay's notices without reading.
|
|
137
|
-
- **Presence:** the page tells the relay the person is away while it is hidden and online once it shows; a page that shows again, or a device back online, connects again at once.
|
|
137
|
+
- **Presence:** the page tells the relay the person is away while it is hidden and online once it shows; a page that shows again, or a device back online, connects again at once. With [presence](#presence), `/meta` names its resource and fields, never its key, and the sidebar's person marks, the members page and a conversation's members title show who is online, away or offline: the page reads the records of the people it shows, up to 100 in one request, those it shows later as they appear, everyone shown again after the socket was down, and applies each `presence_changed` as it comes, keeping a status only over one that began earlier. The `presence_changed` events reach everyone who shares a channel with the person, whatever their role reads, but the reads go through the reader's role: someone whose record it may not read shows no presence until their next change comes, so grant `presences.read` to the people who see each other. An app's own [`presence` hook](status.md#in-the-app) goes over it.
|
|
138
138
|
|
|
139
139
|
A conversation page with `typing` declares the event on its resource's channels: `protobase relay app` prints it in the apps file entry, and the relay `protobase dev` runs takes it too. A page sends `{ typing, thread }`, `thread` the key of the thread's first message or null, at most 256 bytes, 2 a second in bursts of 4. A `typing` the resource declares in its own `events` takes its place.
|
|
140
140
|
|
|
@@ -64,7 +64,7 @@ Your own server code asks the same question with `onDoNotDisturb(db, statusNames
|
|
|
64
64
|
|
|
65
65
|
## In the app
|
|
66
66
|
|
|
67
|
-
The members page and the sidebar can show who is online or
|
|
67
|
+
The members page and the sidebar can show who is online, away or offline beside each person's status. With the [realtime relay's presence](realtime-relay.md#presence), they show it with no code of yours. Otherwise who is online or away is your app's own, from its [presence](channels.md#presence), and you give it to Protobase once, as `presence` in `protobase.ui.tsx`: a React hook that answers each person's presence, `'online'` or `'away'`, by their user id, and leaves out someone with no page open. Protobase calls it once while the app shows, so it may use your own [channels](channels.md) and live updates, and the marks follow it without a reload; Protobase opens no connection of its own for it, and a channel shares the socket the page already has.
|
|
68
68
|
|
|
69
69
|
```tsx
|
|
70
70
|
// protobase.ui.tsx
|
|
@@ -102,15 +102,16 @@ const usePeoplePresence = () => {
|
|
|
102
102
|
export default defineUi({ presence: usePeoplePresence })
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
The organization's members page then shows each member as online or
|
|
105
|
+
The organization's members page then shows each member as online, away or offline beside their status, and a sidebar record whose mark names a person, such as a direct message, shows that person's presence and status beside its title, with the status text on hover and in the row's name (see [Marks per reader](sidebar.md#marks-per-reader)). Someone the hook and the relay leave out shows no presence, and without either nothing shows but the statuses. <gap>A sidebar row cannot show the presence of several people, such as a group conversation's, because a mark naming more than one person is not implemented.</gap>
|
|
106
106
|
|
|
107
|
-
`useMembers()` from `@protobase/ui` gives each member their `status` when they have one, beside their name and photo, `useStatuses()` the statuses alone, and `usePresence()` the presence your hook
|
|
107
|
+
`useMembers()` from `@protobase/ui` gives each member their `status` when they have one, beside their name and photo, `useStatuses()` the statuses alone, and `usePresence()` the presence, by user id: your hook's over the relay's. `useShownPeople(ids)` says your page shows those people, so the relay's presence is read for them. `StatusMark` draws them beside a name: the online, away or offline dot for `presence`, a mark for busy, one for do not disturb, and the text, in full or, with `textShown="hover"`, on hover:
|
|
108
108
|
|
|
109
109
|
```tsx
|
|
110
|
-
import { StatusMark, useMembers, usePresence } from '@protobase/ui'
|
|
110
|
+
import { StatusMark, useMembers, usePresence, useShownPeople } from '@protobase/ui'
|
|
111
111
|
|
|
112
112
|
export const Person = ({ id }: { id: string }) => {
|
|
113
113
|
const person = useMembers().member(id)
|
|
114
|
+
useShownPeople([id])
|
|
114
115
|
const presence = usePresence()?.[id]
|
|
115
116
|
if (!person) return null
|
|
116
117
|
return (
|
|
@@ -201,6 +201,7 @@ Starts one run for each record of `resource` that becomes ready, with `{ resourc
|
|
|
201
201
|
- **One run per ready key:** the record's key, plus the values of the `key` fields. A record that stays ready over later writes starts no second run; one whose `due_at` changes is ready again under a new key.
|
|
202
202
|
- **Who reads it:** the record is read through the API as the user who saved the enabled version, in the workflow's tenant, and `when` is checked on what they may read, so a record they cannot read, or a field they cannot see, never reaches a run. A saver who holds no role any more, or whom the API refuses, marks the trigger `failing`; the next write it reads a record on makes it active again, and it then passes over the records it missed. A key field the saver cannot read marks it `failing` too.
|
|
203
203
|
- **When it looks:** a write to the resource, through the API or the database, reaches the trigger through [events](events.md), so the resource must declare some; turning a workflow on also starts runs for the records ready already, 100 per job. No periodic sweep runs.
|
|
204
|
+
- **Tenants:** a tenant's workflow reaches only the records of its tenant, so its resource needs a tenant field, [`.tenant(...)`](data-config.md#resource). A save of a tenant's workflow on a resource without one is refused, naming the resource; a trigger saved before its resource lost its tenant field is marked `failing` with that message within a minute, or as soon as a write reaches the resource, and turns active again once a write reaches it with the tenant field back.
|
|
204
205
|
|
|
205
206
|
<gap>A workflow cannot start on every write of a record because an every-change trigger is not implemented; a record trigger starts once per ready key.</gap> <gap>An owner is not told when a trigger starts failing because trigger alerts are not implemented.</gap>
|
|
206
207
|
|