@protobase/cli 0.81.1 → 0.81.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.
- package/dist/cli/package.js +1 -1
- package/package.json +8 -8
- package/skills/protobase/references/features/ai.md +1 -0
- package/skills/protobase/references/reference/config/api.md +2 -2
- package/skills/protobase/references/reference/mcp.md +13 -0
- package/skills/protobase/references/reference/notifications.md +1 -1
package/dist/cli/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.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": {
|
|
@@ -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.81.
|
|
47
|
-
"@protobase/layout": "0.81.
|
|
48
|
-
"@protobase/query": "0.81.
|
|
49
|
-
"@protobase/schema": "0.81.
|
|
50
|
-
"@protobase/server": "0.81.
|
|
51
|
-
"@protobase/ui": "0.81.
|
|
52
|
-
"@protobase/workflows": "0.81.
|
|
46
|
+
"@protobase/config": "0.81.3",
|
|
47
|
+
"@protobase/layout": "0.81.3",
|
|
48
|
+
"@protobase/query": "0.81.3",
|
|
49
|
+
"@protobase/schema": "0.81.3",
|
|
50
|
+
"@protobase/server": "0.81.3",
|
|
51
|
+
"@protobase/ui": "0.81.3",
|
|
52
|
+
"@protobase/workflows": "0.81.3",
|
|
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",
|
|
@@ -14,6 +14,7 @@ Fields and actions filled by a model, the assistant beside the admin, and MCP.
|
|
|
14
14
|
- [MCP server](../reference/mcp.md#the-tools) (beta): AI clients connect to the app over MCP as the signed-in person: they list the resources in a small first call, describe one resource's fields when they need them, and find and read records within that person's access, soft-deleted ones too when asked.
|
|
15
15
|
- [MCP read fields](../reference/mcp.md#reading-only-what-is-needed): AI clients read only the fields they name, a plain list returns the columns of the app's table, and the server tells clients how to keep reads small.
|
|
16
16
|
- [MCP counts](../reference/mcp.md#the-tools) (beta): AI clients count the records a filter finds, in all or per value of a field such as a status, without reading the records.
|
|
17
|
+
- [MCP instructions of your own](../reference/mcp.md#the-apps-instructions): Your own text tells AI clients how to use the app's MCP endpoint when they connect, after the framework's advice on reading records.
|
|
17
18
|
- [MCP app icon](../reference/mcp.md#the-apps-icon) (beta): AI clients show the app's own icon beside its name when someone adds its MCP endpoint.
|
|
18
19
|
- [MCP SQL for admins](../reference/mcp.md#sql-for-admins): People with the `admin` or `ai` role run read-only SQL over MCP when you turn it on.
|
|
19
20
|
- [MCP writes](../reference/mcp.md#writes) (beta): When turned on, for every resource or only those you list, AI clients create, update and delete records after the person approves each write.
|
|
@@ -114,10 +114,10 @@ export default defineConfig({ writeHooks: ['queue-sent-invoice'] })
|
|
|
114
114
|
|
|
115
115
|
## mcpEndpoint
|
|
116
116
|
|
|
117
|
-
- **Type:** `{ sql?: boolean; writes?: boolean | { resources?: string[]; rolesWithoutApproval?: string[] } } | false`
|
|
117
|
+
- **Type:** `{ sql?: boolean; writes?: boolean | { resources?: string[]; rolesWithoutApproval?: string[] }; instructions?: string } | false`
|
|
118
118
|
- **Default:** the read tools only: `list_resources`, `describe_resource`, `list_records`, `count_records` and `get_record`, then the tools of `mcp/tools.ts`
|
|
119
119
|
|
|
120
|
-
The MCP endpoint's tools; [`auth.mcp`](sign-in.md#authmcp) turns the endpoint on. `sql: true` also offers admins and the `ai` role `run_read_only_query`, which reads the whole database outside the access rules. `writes: true` offers `create_record`, `update_record`, `delete_record` and `batch_write` through the REST API's rules, each approved by the person in their client; `writes.resources` limits them to the resources named, and `writes.rolesWithoutApproval` lets holders of those roles, such as a service account, write without the approval. `false` is for a host that serves its own MCP endpoint at `auth.mcp.path`, in front of this app. See [MCP](../mcp.md#the-tools). The app's own tools are the default export of `mcp/tools.ts`, an array of `defineTool(...)`, offered after these; with [extensions](../config.md#extensions), the extensions' come first. See [The app's own tools](../mcp.md#the-apps-own-tools).
|
|
120
|
+
The MCP endpoint's tools; [`auth.mcp`](sign-in.md#authmcp) turns the endpoint on. `sql: true` also offers admins and the `ai` role `run_read_only_query`, which reads the whole database outside the access rules. `writes: true` offers `create_record`, `update_record`, `delete_record` and `batch_write` through the REST API's rules, each approved by the person in their client; `writes.resources` limits them to the resources named, and `writes.rolesWithoutApproval` lets holders of those roles, such as a service account, write without the approval. `instructions` is the app's own text clients read when they connect, after the framework's, within 2,691 characters: see [The app's instructions](../mcp.md#the-apps-instructions). `false` is for a host that serves its own MCP endpoint at `auth.mcp.path`, in front of this app. See [MCP](../mcp.md#the-tools). The app's own tools are the default export of `mcp/tools.ts`, an array of `defineTool(...)`, offered after these; with [extensions](../config.md#extensions), the extensions' come first. See [The app's own tools](../mcp.md#the-apps-own-tools).
|
|
121
121
|
|
|
122
122
|
```ts
|
|
123
123
|
export default defineConfig({ auth: { mcp: true }, mcpEndpoint: { writes: { resources: ['tasks'] } } })
|
|
@@ -216,6 +216,19 @@ The person approves the batch once, in their language, seeing each write in it n
|
|
|
216
216
|
|
|
217
217
|
A batch is checked before the person is asked: an operation other than a create, update or delete, a field an operation does not take, an update without an ETag or more than 500 operations come back as `{ "error": "invalid-argument", "message": ... }` naming the operation, and with writes limited to some resources an operation on any other refuses the whole batch. An update does not set the field a soft delete sets, as `update_record` does not: a delete goes through a delete operation. A refusal while it runs, such as an operation the person may not do or a stale ETag, comes back with the REST batch's `operation` (its index), `op` and `resource`. Either way nothing is written.
|
|
218
218
|
|
|
219
|
+
## The app's instructions
|
|
220
|
+
|
|
221
|
+
`mcpEndpoint.instructions` adds the app's own text to what the endpoint tells each client when it connects, its instructions, such as how the app's records fit together or what to ask the person before changing something:
|
|
222
|
+
|
|
223
|
+
```ts
|
|
224
|
+
export default defineConfig({
|
|
225
|
+
auth: { mcp: true },
|
|
226
|
+
mcpEndpoint: { instructions: 'A big ask becomes a research task first: ask the person its open questions, and build only once they approve its plan.' },
|
|
227
|
+
})
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
The client reads the framework's text on [reading records](#reading-only-what-is-needed) first, then the app's, then, in an app with [workflows](#workflows), the workflow guide. Some MCP clients keep only the first 4,096 characters of a server's instructions, so the framework's text and the app's together stay within 4,096: the app has 2,691 characters, and a longer text stops startup with an error naming `mcpEndpoint.instructions`. The workflow guide that follows is longer than that alone, so such a client cuts it. <gap>A client that keeps only 4,096 characters cannot read the whole workflow guide because a shorter guide is not implemented.</gap> The text is the same for every client and every connection, which lets clients cache it: what changes, such as the records themselves, reaches the client through the tools.
|
|
231
|
+
|
|
219
232
|
## The app's own tools
|
|
220
233
|
|
|
221
234
|
:::caution[Beta]
|
|
@@ -281,7 +281,7 @@ Each send is `POST <url>/send`, with the credential as a bearer token, never thr
|
|
|
281
281
|
{ "message": { "title": "Task assigned", "url": "https://app.example.com/tasks/42" }, "devices": [{ "handle": "…", "user": "user-1" }] }
|
|
282
282
|
```
|
|
283
283
|
|
|
284
|
-
The relay answers a `2xx` with a result for each handle, `ok`, `gone`, `retry` or `refused`, as [senders](#senders) answer: `{ "results": [{ "handle": "…", "result": "ok" }] }`. A handle the relay answers `gone` removes its device. A handle it does not answer, and every handle of any other answer, such as a wrong credential, a `429` or `5xx` (after its `Retry-After`) or no answer within ten seconds, is retried, so a mistake in the configuration removes no device. A device stored with a token that is not a relay handle, or whose user id is
|
|
284
|
+
The relay answers a `2xx` with a result for each handle, `ok`, `gone`, `retry` or `refused`, as [senders](#senders) answer: `{ "results": [{ "handle": "…", "result": "ok" }] }`. A handle the relay answers `gone` removes its device. A handle it does not answer, and every handle of any other answer, such as a wrong credential, a `429` or `5xx` (after its `Retry-After`) or no answer within ten seconds, is retried, so a mistake in the configuration removes no device. A device stored with a token that is not a relay handle, or whose user id is longer than the 256 characters a store takes, is `refused` with no request, and the other devices are sent as usual. <gap>A send cannot keep the notification's text from the relay because content-free or encrypted relay payloads are not implemented.</gap>
|
|
285
285
|
|
|
286
286
|
`relaySender(readRelaySettings(process.env)!)` from `@protobase/server` is the built-in sender, to list beside [your own senders](#senders). `relaySendRequest` and `relaySendAnswer` check the request and answer shapes.
|
|
287
287
|
|