@protobase/cli 0.52.0 → 0.53.0
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 +7 -7
- package/skills/protobase/references/features/ai.md +2 -1
- package/skills/protobase/references/reference/blocks.md +1 -1
- package/skills/protobase/references/reference/config/api.md +1 -1
- package/skills/protobase/references/reference/mcp.md +5 -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.
|
|
3
|
+
"version": "0.53.0",
|
|
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.
|
|
46
|
-
"@protobase/layout": "0.
|
|
47
|
-
"@protobase/query": "0.
|
|
48
|
-
"@protobase/schema": "0.
|
|
49
|
-
"@protobase/server": "0.
|
|
50
|
-
"@protobase/ui": "0.
|
|
45
|
+
"@protobase/config": "0.53.0",
|
|
46
|
+
"@protobase/layout": "0.53.0",
|
|
47
|
+
"@protobase/query": "0.53.0",
|
|
48
|
+
"@protobase/schema": "0.53.0",
|
|
49
|
+
"@protobase/server": "0.53.0",
|
|
50
|
+
"@protobase/ui": "0.53.0",
|
|
51
51
|
"@react-email/render": "^2.1.0",
|
|
52
52
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
53
53
|
"@tailwindcss/vite": "^4.3.3",
|
|
@@ -9,7 +9,7 @@ Fields and actions filled by a model, the assistant beside the admin, and MCP.
|
|
|
9
9
|
- [Assistant](../reference/assistant.md): A chat beside the admin that answers questions about the app, reads its data and proposes changes for approval.
|
|
10
10
|
- [Choice of model](../reference/assistant.md#which-backend): The assistant runs on OpenRouter or any OpenAI-compatible endpoint, also a local one.
|
|
11
11
|
- [Assistant tools](../reference/assistant.md#the-apps-own-tools): Your own tools for the assistant, acting on records as the user.
|
|
12
|
-
- [MCP server](../reference/mcp.md#the-tools): AI clients connect to the app over MCP as the signed-in person
|
|
12
|
+
- [MCP server](../reference/mcp.md#the-tools): 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.
|
|
13
13
|
- [MCP counts](../reference/mcp.md#the-tools): AI clients count the records a filter finds, in all or per value of a field such as a status, without reading the records.
|
|
14
14
|
- [MCP result size](../reference/mcp.md#result-size): Every tool result fits what AI clients take, as valid JSON: long values are cut and named, a page holds fewer records, and the client reads the rest in pieces.
|
|
15
15
|
- [MCP app icon](../reference/mcp.md#the-apps-icon): AI clients show the app's own icon beside its name when someone adds its MCP endpoint.
|
|
@@ -19,3 +19,4 @@ Fields and actions filled by a model, the assistant beside the admin, and MCP.
|
|
|
19
19
|
- [MCP comments](../reference/mcp.md#comments): AI clients read a record's comments, and with MCP writes on add one after the person approves it.
|
|
20
20
|
- [MCP batch writes](../reference/mcp.md#batch-writes): When MCP writes are on, AI clients make many creates, updates and deletes across resources in one transaction, after the person approves the batch.
|
|
21
21
|
- [Connected apps](../reference/auth.md#oauth-for-mcp-clients): People allow an AI client to sign in, and disconnect it later.
|
|
22
|
+
- [MCP address](../reference/mcp.md#connecting-a-client): Signed-in people find the app's MCP address on their account page, copy it or add it to Claude in one click.
|
|
@@ -390,7 +390,7 @@ Everyone who can sign in, for admins: find them by address, tick their roles, bl
|
|
|
390
390
|
|
|
391
391
|
### Account blocks
|
|
392
392
|
|
|
393
|
-
`Profile`, `Password`, `Passkeys`, `TwoFactor`, `ConnectedAccounts`, `Devices` and `ConnectedApps` are the parts of the signed-in person's own account: their name and address (which they can change, the address with an [emailed code](auth.md#changing-the-address)), their [password](auth.md#name-password-and-devices) (changed, or set for the first time), their [passkeys](auth.md#passkeys), [two-factor authentication](auth.md#two-factor-authentication), the sign-in providers they linked, the devices signed in as them (each one but this one to [sign out](auth.md#name-password-and-devices)), and the apps such as MCP clients they allowed to act as them. Each takes no props or children, reads its own data, and leaves itself out where it does not apply: `ConnectedAccounts` without an OAuth sign-in provider, `ConnectedApps` without MCP. They act on whoever is signed in, so they are allowed on the page named `account` alone; anywhere else stops the config. That page is the [account page](auth.md#account-page) at `/-/account`, which `accountTabs` helps build from the standard tabs.
|
|
393
|
+
`Profile`, `Password`, `Passkeys`, `TwoFactor`, `ConnectedAccounts`, `Devices` and `ConnectedApps` are the parts of the signed-in person's own account: their name and address (which they can change, the address with an [emailed code](auth.md#changing-the-address)), their [password](auth.md#name-password-and-devices) (changed, or set for the first time), their [passkeys](auth.md#passkeys), [two-factor authentication](auth.md#two-factor-authentication), the sign-in providers they linked, the devices signed in as them (each one but this one to [sign out](auth.md#name-password-and-devices)), and the apps such as MCP clients they allowed to act as them, below the app's MCP address to connect one. Each takes no props or children, reads its own data, and leaves itself out where it does not apply: `ConnectedAccounts` without an OAuth sign-in provider, `ConnectedApps` without MCP. They act on whoever is signed in, so they are allowed on the page named `account` alone; anywhere else stops the config. That page is the [account page](auth.md#account-page) at `/-/account`, which `accountTabs` helps build from the standard tabs.
|
|
394
394
|
|
|
395
395
|
```tsx
|
|
396
396
|
export const account = page('account',
|
|
@@ -115,7 +115,7 @@ export default defineConfig({ writeHooks: ['queue-sent-invoice'] })
|
|
|
115
115
|
## mcpEndpoint
|
|
116
116
|
|
|
117
117
|
- **Type:** `{ sql?: boolean; writes?: boolean | { resources?: string[]; rolesWithoutApproval?: string[] } } | false`
|
|
118
|
-
- **Default:** the read tools only: `list_resources`, `list_records`, `count_records` and `get_record`
|
|
118
|
+
- **Default:** the read tools only: `list_resources`, `describe_resource`, `list_records`, `count_records` and `get_record`
|
|
119
119
|
|
|
120
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).
|
|
121
121
|
|
|
@@ -18,6 +18,8 @@ Every auth store has the OAuth tables, so turning it on needs no migration. The
|
|
|
18
18
|
|
|
19
19
|
## Connecting a client
|
|
20
20
|
|
|
21
|
+
Signed-in people find the endpoint's address in the app: "Account" in the user menu, then Connected apps (`/-/account/apps`), shows it with a button that copies it and an "Add to Claude" link that opens Claude's dialog for a custom connector with the app's name and the address filled in. The tab shows only when MCP is on, and only on an account page that keeps the [`ConnectedApps` block](auth.md#account-page).
|
|
22
|
+
|
|
21
23
|
Give the client the endpoint's address. It finds the app's sign-in from there, opens it in the browser, and the person signs in and allows it on the app's connect page.
|
|
22
24
|
|
|
23
25
|
- A chat assistant usually takes a remote MCP server, or custom connector, in its settings: add one with the address.
|
|
@@ -39,7 +41,8 @@ Each tool reads as the signed-in person: their role's access rules, row filters,
|
|
|
39
41
|
|
|
40
42
|
| Tool | What it does |
|
|
41
43
|
| --- | --- |
|
|
42
|
-
| `list_resources` | The resources the person may read,
|
|
44
|
+
| `list_resources` | The resources the person may read, kept small for a client's first call: each one's name, label, the first line of its help, key and whether it soft deletes (`soft_delete`), without its fields. |
|
|
45
|
+
| `describe_resource` | One resource the person may read, with its fields: each field's type, label, help, enum values, the resource a relation links to, and whether it is optional, read-only and taken by filters and sorts. |
|
|
43
46
|
| `list_records` | A page of a resource's records: `filter` in the API's [filter syntax](api.md#filters), `order_by`, `page_size` (20 by default, at most 100) and `page_token`, with `next_page_token` for the next page. `show_deleted: true` also returns soft-deleted records. |
|
|
44
47
|
| `count_records` | How many records a `filter` finds, without returning them: `{ count }` as the API's `count=exact` counts, or `{ more_than: 10000, estimate }` when more match. With `group_by`, a filterable field, the count per value instead, as [`:aggregate`](api.md#routes) gives it: `{ group_by, groups: [{ value, count }] }`, largest first, adding up to what the filter finds, the first `limit` (100 by default, at most 1,000), with `label` naming a relation's values by a field of the records they link to. A date or timestamp `group_by` counts per day over the last 30 days. `show_deleted: true` also counts soft-deleted records. |
|
|
45
48
|
| `get_record` | One record by its key, with its ETag. A composite key is passed as the values of its fields, in order. `show_deleted: true` also finds a soft-deleted record. With `field`, it reads that one field alone, `max_chars` characters (20,000 by default, at most 30,000) from `offset`, and gives its whole `length` and the `next_offset` to read on from. |
|
|
@@ -160,7 +163,7 @@ The endpoint serves each request on its own, without an MCP session: a `GET` or
|
|
|
160
163
|
- `mcpHandler({ authenticate, resource, scope, server })`: the endpoint as a fetch handler. It checks the host, admits a valid token (`mcpGate`) and serves the request with the server that `server(session, request)` builds for its caller; `request` is the HTTP request, such as for the language the person reads.
|
|
161
164
|
- `mcpServer({ info, tools, context, report, rolesWithoutApproval, approvals })`: an MCP server named by `info`, its `name`, `version` and `icons`, such as `mcpIcons(origin, icons)`, the app's icons on `origin`, and offering [assistant tools](assistant.md#the-apps-own-tools), each with its JSON Schema and its `annotations`, MCP's tool hints. `context` is the tools' context without `approve`, with the `locale` its approvals are asked in (English when absent): each call gets its own, which asks the client's user, or approves at once when the session's user holds one of `rolesWithoutApproval`. `approvals` is `mcpApprovals()`, built once and passed to every server the endpoint builds: it keeps the approvals asked for until they are answered or expire.
|
|
162
165
|
- `mcpTools({ db, sql, writes, commented })`: the default tools for a session; `writes` is `true`, `false` or `{ resources, rolesWithoutApproval }`, and `commented` names the resources with comments.
|
|
163
|
-
- `readRecordTools()`, or `listResourcesTool()`, `listRecordsTool()` and `getRecordTool()`: the read tools alone; `readOnlyQueryTool(db)` is `run_read_only_query`, and `readWriteQueryTool(db)` proposes one write statement that the user approves before it runs.
|
|
166
|
+
- `readRecordTools()`, or `listResourcesTool()`, `describeResourceTool()`, `listRecordsTool()` and `getRecordTool()`: the read tools alone; `readOnlyQueryTool(db)` is `run_read_only_query`, and `readWriteQueryTool(db)` proposes one write statement that the user approves before it runs.
|
|
164
167
|
- `commentTools({ commented }, writes)`, or `listCommentsTool({ commented })` and `addCommentTool({ commented, resources })`: the comment tools on the resources named in `commented`, which call the context's `comments`, and `add_comment` only when `writes` is not `false`.
|
|
165
168
|
- `writeRecordTools({ resources })`, or `createRecordTool(...)`, `updateRecordTool(...)` and `deleteRecordTool(...)`: the single write tools alone, on the listed resources or, without `resources`, on any; `batchWriteTool({ resources })` is `batch_write` alone.
|
|
166
169
|
- `mcpGate({ authenticate, resource, scope })`: the token check alone, answering 401 or 403 with a challenge that names the resource's metadata.
|