@protobase/cli 0.95.1 → 0.95.2
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
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.95.
|
|
3
|
+
"version": "0.95.2",
|
|
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.
|
|
47
|
-
"@protobase/layout": "0.95.
|
|
48
|
-
"@protobase/query": "0.95.
|
|
49
|
-
"@protobase/schema": "0.95.
|
|
50
|
-
"@protobase/server": "0.95.
|
|
51
|
-
"@protobase/ui": "0.95.
|
|
52
|
-
"@protobase/workflows": "0.95.
|
|
46
|
+
"@protobase/config": "0.95.2",
|
|
47
|
+
"@protobase/layout": "0.95.2",
|
|
48
|
+
"@protobase/query": "0.95.2",
|
|
49
|
+
"@protobase/schema": "0.95.2",
|
|
50
|
+
"@protobase/server": "0.95.2",
|
|
51
|
+
"@protobase/ui": "0.95.2",
|
|
52
|
+
"@protobase/workflows": "0.95.2",
|
|
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`.
|