@protobase/cli 0.40.9 → 0.41.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/build/deploy-bundle.js +2 -0
- package/dist/bundle/manifest.js +4 -1
- package/dist/cli/package.js +1 -1
- package/dist/mobile/api-origin-page.js +11 -0
- package/dist/mobile/fingerprint.js +13 -7
- package/dist/mobile/pinned-packages.js +7 -2
- package/dist/mobile/run.js +3 -7
- package/dist/mobile/web-part.js +17 -10
- package/dist/serve/app.js +3 -2
- package/dist/serve/bundle-site.js +2 -1
- package/dist/serve/env.js +4 -1
- package/dist/serve/lifecycle.js +14 -1
- package/dist/serve/mobile-release.js +41 -0
- package/dist/serve/serve-dir.js +5 -1
- package/dist/serve/site-files.js +21 -0
- package/dist/serve/static-site.js +6 -3
- package/package.json +6 -6
- package/skills/protobase/SKILL.md +1 -0
- package/skills/protobase/references/features/access.md +17 -0
- package/skills/protobase/references/features/actions.md +11 -0
- package/skills/protobase/references/features/ai.md +14 -0
- package/skills/protobase/references/features/api-functions.md +13 -0
- package/skills/protobase/references/features/build-and-run.md +22 -0
- package/skills/protobase/references/features/compatibility.md +14 -0
- package/skills/protobase/references/features/composed-pages.md +18 -0
- package/skills/protobase/references/features/data-model.md +22 -0
- package/skills/protobase/references/features/email-and-public-forms.md +12 -0
- package/skills/protobase/references/features/events-webhooks-and-jobs.md +18 -0
- package/skills/protobase/references/features/files-and-images.md +16 -0
- package/skills/protobase/references/features/history-comments-and-live-updates.md +14 -0
- package/skills/protobase/references/features/list-displays.md +18 -0
- package/skills/protobase/references/features/lists.md +28 -0
- package/skills/protobase/references/features/look-and-language.md +13 -0
- package/skills/protobase/references/features/navigation.md +14 -0
- package/skills/protobase/references/features/record-pages.md +20 -0
- package/skills/protobase/references/features/releases.md +12 -0
- package/skills/protobase/references/features/rest-api.md +24 -0
- package/skills/protobase/references/features/several-apps.md +8 -0
- package/skills/protobase/references/features/sign-in-and-accounts.md +27 -0
- package/skills/protobase/references/features/start-a-project.md +15 -0
- package/skills/protobase/references/features/your-own-code.md +19 -0
- package/skills/protobase/references/features.md +39 -0
- package/skills/protobase/references/getting-started.md +6 -2
- package/skills/protobase/references/guides/deploy.md +5 -1
- package/skills/protobase/references/guides/mobile-app.md +4 -0
- package/skills/protobase/references/reference/access.md +2 -0
- package/skills/protobase/references/reference/api.md +1 -1
- package/skills/protobase/references/reference/cli.md +16 -2
- package/skills/protobase/references/reference/data-config.md +12 -4
- package/skills/protobase/references/reference/files.md +4 -0
- package/skills/protobase/references/reference/mcp.md +10 -2
- package/skills/protobase/references/reference/versioning.md +5 -1
|
@@ -127,6 +127,10 @@ await storeFile({ provider: 'public', path: 'images/test.png', body: bytes, env:
|
|
|
127
127
|
|
|
128
128
|
### S3-compatible buckets
|
|
129
129
|
|
|
130
|
+
:::caution[Beta]
|
|
131
|
+
S3-compatible buckets work only when the app runs on Bun. On Node the first file operation fails.
|
|
132
|
+
:::
|
|
133
|
+
|
|
130
134
|
`s3Files` stores files in any bucket with the S3 API, such as Cloudflare R2, Scaleway Object Storage or AWS S3, under `prefix` when given, so one bucket can hold several providers or apps:
|
|
131
135
|
|
|
132
136
|
```ts
|
|
@@ -68,6 +68,14 @@ Each write goes through the REST API as the person: their role's access rules, `
|
|
|
68
68
|
|
|
69
69
|
Before each write the client asks the person to approve it, showing the resource and the data, through MCP's form elicitation. Nothing is written until they approve, and declining writes nothing. A client's own setting that always allows a tool is not this approval. A client that cannot ask, one without form elicitation or one on the 2025 protocol, gets each write refused with a message saying so.
|
|
70
70
|
|
|
71
|
+
To offer the writes on some resources only, list them:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
createAdmin({ ..., auth, options: { mcp: { writes: { resources: ['tasks'] } } } })
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The write tools then name those resources in their descriptions, and refuse a write to any other before asking, with `{ "error": "forbidden", "message": ... }` saying which resources they write; nothing is written. A name the app has no resource for stops the server at startup. The list only narrows the writes: the person's access rules still apply on the listed resources.
|
|
78
|
+
|
|
71
79
|
Nothing can be deleted over MCP, and there is no SQL that writes.
|
|
72
80
|
|
|
73
81
|
## Browsers and hosts
|
|
@@ -82,8 +90,8 @@ The endpoint serves each request on its own, without an MCP session: a `GET` or
|
|
|
82
90
|
|
|
83
91
|
- `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)` builds for its caller.
|
|
84
92
|
- `mcpServer({ info, tools, context, report })`: an MCP server 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`: each call gets its own, which asks the client's user.
|
|
85
|
-
- `mcpTools({ db, sql, writes })`: the default tools for a session
|
|
86
|
-
- `writeRecordTools()`, or `createRecordTool()` and `updateRecordTool()`: the write tools alone.
|
|
93
|
+
- `mcpTools({ db, sql, writes })`: the default tools for a session; `writes` is `true`, `false` or `{ resources }`.
|
|
94
|
+
- `writeRecordTools({ resources })`, or `createRecordTool(...)` and `updateRecordTool(...)`: the write tools alone, on the listed resources or, without `resources`, on any.
|
|
87
95
|
- `mcpGate({ authenticate, resource, scope })`: the token check alone, answering 401 or 403 with a challenge that names the resource's metadata.
|
|
88
96
|
- `mcpToolContext(...)`, `mcpRoutes(app, { path, handler })` and `sessionOf(authInfo)`: the tools' context as the app builds it, the routes with open CORS, and the session a request was admitted with.
|
|
89
97
|
|
|
@@ -88,4 +88,8 @@ The app sends the signed-in user's API token as `Authorization: Bearer <token>`
|
|
|
88
88
|
It may also send `updateStage` (`job` or `build`) and `updateStartedAt` while an update runs, and `lastUpdate`, `{ toVersion, outcome, errorCode, message, finishedAt }` with `outcome` one of `succeeded`, `unchanged` or `failed` and `message` plain text for the app's owner. A host that leaves them out gets the dialog without them.
|
|
89
89
|
- `POST {url}/update`: applies `latest` now, `202` with the same body; `409` when the app is on it already or an update is running. A refusal's message, as `{ error: { code, message } }` or a problem's `detail`, is shown as it is.
|
|
90
90
|
|
|
91
|
-
The app reads the status on load and every half hour, every 5 seconds while an update runs. It shows the button only while `updateAvailable` and `indicator` are both true; the button opens the two versions, when the policy updates or how far the running update is, how the last update ended, and **Update now**. When and whether to update is the host's setting.
|
|
91
|
+
The app reads the status on load and every half hour, every 5 seconds while an update runs. It shows the button only while `updateAvailable` and `indicator` are both true; the button opens the two versions, when the policy updates or how far the running update is, how the last update ended, and **Update now**. When and whether to update is the host's setting. `createRuntimeClient({ url, token })` of `@protobase/client` calls the same endpoint from code, with `status()` and `update()`.
|
|
92
|
+
|
|
93
|
+
## A new version under an open page
|
|
94
|
+
|
|
95
|
+
`/api/meta` names the Protobase version the server runs as `protobaseVersion`. When a page that is open finds that the server moved to another version, it keeps what it shows and stops reading `/api/meta`, so nothing changes under the user until they reload. The app then offers the reload: in a sidebar shown at full width, a banner above the profile with the app's name, that it was updated, and a click that reloads; otherwise a notice with **Reload**, which stays until it is closed, and a **Reload page** button in the top bar. The reload asks first while a form holds unsaved changes or a save is under way.
|