@protobase/cli 0.95.1 → 0.95.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.95.1";
2
+ var version = "0.95.3";
3
3
  //#endregion
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.95.1",
3
+ "version": "0.95.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.95.1",
47
- "@protobase/layout": "0.95.1",
48
- "@protobase/query": "0.95.1",
49
- "@protobase/schema": "0.95.1",
50
- "@protobase/server": "0.95.1",
51
- "@protobase/ui": "0.95.1",
52
- "@protobase/workflows": "0.95.1",
46
+ "@protobase/config": "0.95.3",
47
+ "@protobase/layout": "0.95.3",
48
+ "@protobase/query": "0.95.3",
49
+ "@protobase/schema": "0.95.3",
50
+ "@protobase/server": "0.95.3",
51
+ "@protobase/ui": "0.95.3",
52
+ "@protobase/workflows": "0.95.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",
@@ -239,7 +239,7 @@ Nothing refuses a tool result larger than an AI client takes yet, as below.
239
239
 
240
240
  `context` holds the caller's `session`, the `locale` they read, `approve(request)`, `resources()`, the resources they may read, and `records`, the app's records **as that person**: their role's access rules, tenant, hidden fields, `validate` and write hooks apply, as in the REST API and the built-in tools. Its methods are the assistant's, listed [there](assistant.md#the-apps-own-tools); a refusal rejects with an `HttpProblem`. `show` does nothing over MCP, and there is no `conversation`.
241
241
 
242
- A tool refuses by throwing an `HttpProblem` with a status below 500, such as `notFound(detail)` or `forbidden(slug, detail)`, or by letting through the one `records` rejects with: the client gets `{ "error": <slug>, "message": <detail> }` as an error result, as from the built-in tools, and nothing is reported. Anything else a tool throws is reported to the app's error handler and reaches the client as "The server failed to answer.", or, for a query the database stopped at its statement timeout, as `{ "error": "statement-timeout", "message": <a sentence naming the tool> }`. `refusalOf(error)` from `@protobase/server` gives that `{ error, message }` text for a refusal and `undefined` otherwise, and `refused(error)` gives it or throws the error again, for a tool that returns a refusal as its result rather than as an error.
242
+ A tool refuses by throwing an `HttpProblem` with a status below 500, such as `notFound(detail)` or `forbidden(slug, detail)`, or by letting through the one `records` rejects with: the client gets `{ "error": <slug>, "message": <detail> }` as an error result, as from the built-in tools, and nothing is reported. A write the database refuses as read-only while the app is being updated reaches the client as "The server failed to answer." and is not reported. Anything else a tool throws is reported to the app's error handler and reaches the client as "The server failed to answer.", or, for a query the database stopped at its statement timeout, as `{ "error": "statement-timeout", "message": <a sentence naming the tool> }`. `refusalOf(error)` from `@protobase/server` gives that `{ error, message }` text for a refusal and `undefined` otherwise, and `refused(error)` gives it or throws the error again, for a tool that returns a refusal as its result rather than as an error.
243
243
 
244
244
  Nothing cuts a tool's result, as nothing cuts the built-in tools': a tool that can return a lot takes a limit or the fields to return, as `list_records` takes `page_size` and `fields`. <gap>A tool result larger than an AI client takes cannot be refused with a message naming what to leave out because a size guard is not implemented.</gap>
245
245
 
@@ -307,7 +307,7 @@ The endpoint serves each request on its own, without an MCP session: a `GET` or
307
307
  `@protobase/server` exports the pieces the endpoint is made of, for an MCP server of your own with tools of your own:
308
308
 
309
309
  - `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.
310
- - `mcpServer({ info, instructions, 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, its `annotations`, MCP's tool hints, and its `title` and `_meta`, and each refusing as [the app's own tools](#the-apps-own-tools) do. `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`. It is a `ToolContext`, with the app's `records`, `resources()` and `show`, unless every tool is declared with a smaller one, such as `defineTool<BaseToolContext>(...)`, whose context is only `session`, `locale` and `approve`: a host without app records then passes `{ session }`. `report` gets what a tool throws other than a refusal. `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. `instructions` is what it tells clients when they connect, by default `mcpInstructions`, the advice on reading records above.
310
+ - `mcpServer({ info, instructions, 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, its `annotations`, MCP's tool hints, and its `title` and `_meta`, and each refusing as [the app's own tools](#the-apps-own-tools) do. `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`. It is a `ToolContext`, with the app's `records`, `resources()` and `show`, unless every tool is declared with a smaller one, such as `defineTool<BaseToolContext>(...)`, whose context is only `session`, `locale` and `approve`: a host without app records then passes `{ session }`. `report` gets what a tool throws other than a refusal or a read-only database's error. `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. `instructions` is what it tells clients when they connect, by default `mcpInstructions`, the advice on reading records above.
311
311
  - `mcpTools({ db, sql, writes, commented, workflows, own })`: the endpoint's tools for a session; `writes` is `true`, `false` or `{ resources, rolesWithoutApproval }`, `commented` names the resources with comments, `workflows` offers the [workflow tools](#workflows) with the app's types, and `own` are [the app's own tools](#the-apps-own-tools), offered after the rest.
312
312
  - `workflowTypes(plugins, models)`: the app's workflow types, a `WorkflowCatalog`, which `workflows` and `workflowReadTools` take. `plugins` are the app's own [workflow plugins](workflow-plugins.md), each `{ plugin, source }`, beside the built-in ones, and `models(name)` gives the model of the app's resource of that name, which a record trigger is checked against. An app with `workflows` needs none of this: its endpoint offers the tools with the app's types; these are for an MCP server of your own.
313
313
  - `workflowReadTools(catalog)` and `workflowWriteTools({ resources })`: the workflow tools alone, and `workflowInstructions`, what the endpoint tells clients about the language, to append to `mcpInstructions`.
@@ -231,6 +231,8 @@ Without them APNs is off and iOS devices are skipped. One or two of them set, a
231
231
 
232
232
  The topic of every notification is the mobile app's `appId`. Each device goes to the environment it was registered with: development builds to the APNs sandbox, App Store and TestFlight builds to production. A device whose token is not lowercase hex, whose environment is neither `sandbox` nor `production`, or that was registered for another app id is `refused`.
233
233
 
234
+ When iOS refuses to register the app for push, such as for a build without the push entitlement, push stays off and the app's [error reporting](config/api.md#errorreporting) receives the reason iOS gave. <gap>A push token that never arrives cannot leave push off and be reported because handling the token wait's timeout as a refusal is not implemented.</gap>
235
+
234
236
  The notification's title and body are its alert, with its `badge` and `sound`; the JSON also holds `url`, `data` and `user`, the id of the user the device is registered for. `urgency` sets the priority (`very-low` and `low` wait until the device saves power less), `ttl` how long APNs keeps it for a device that is offline, 28 days without one, and `tag` the collapse id. A message's `platform.apns` is merged into the JSON, such as `{ aps: { 'thread-id': 'chat' } }`, never into the request's headers; a `url` in it is checked as the message's is, and the JSON holds at most 4096 bytes. APNs answering that the device is unregistered, or that its token is bad, removes the device; any other refusal, such as a wrong topic or key, is retried and then fails the send, so a mistake in the configuration removes no device.
235
237
 
236
238
  ## Android