@softr/sdk 1.11.0 → 1.11.1
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/CHANGELOG.md +6 -0
- package/dist/mcp.js +10 -12
- package/dist/package.js +1 -1
- package/package.json +1 -1
- package/skills/softr-sdk/SKILL.md +1 -1
- package/skills/softr-sdk/ai/SKILL.md +1 -1
- package/skills/softr-sdk/auth/SKILL.md +1 -1
- package/skills/softr-sdk/charts-and-metrics/SKILL.md +1 -1
- package/skills/softr-sdk/current-user/SKILL.md +1 -1
- package/skills/softr-sdk/email/SKILL.md +1 -1
- package/skills/softr-sdk/file-uploads/SKILL.md +1 -1
- package/skills/softr-sdk/formatting/SKILL.md +1 -1
- package/skills/softr-sdk/integrations/SKILL.md +1 -1
- package/skills/softr-sdk/mcp/SKILL.md +1 -1
- package/skills/softr-sdk/push-notifications/SKILL.md +1 -1
- package/skills/softr-sdk/pwa/SKILL.md +1 -1
- package/skills/softr-sdk/record-mutations/SKILL.md +1 -1
- package/skills/softr-sdk/record-queries/SKILL.md +1 -1
- package/skills/softr-sdk/region-visibility/SKILL.md +1 -1
- package/skills/softr-sdk/routes-and-visibility/SKILL.md +1 -1
- package/skills/softr-sdk/workflows/SKILL.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @softr/sdk
|
|
2
2
|
|
|
3
|
+
## 1.11.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- `softrMcpMiddleware` lets Softr choose the access for an assistant that asks for none, instead of choosing it itself. Such an assistant still gets read and write access. No action is needed.
|
|
8
|
+
|
|
3
9
|
## 1.11.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/mcp.js
CHANGED
|
@@ -18,14 +18,11 @@ const PROTECTED_RESOURCE_PATH = "/.well-known/oauth-protected-resource";
|
|
|
18
18
|
const AUTHORIZATION_SERVER_PATH = "/.well-known/oauth-authorization-server";
|
|
19
19
|
/** The scope that lets a caller run an action that is not a read. */
|
|
20
20
|
const WRITE_SCOPE = "mcp:write";
|
|
21
|
-
/** What the platform grants. Advertised here so a client asks for the same. */
|
|
22
|
-
const SCOPES = ["mcp:read", WRITE_SCOPE];
|
|
23
21
|
/**
|
|
24
|
-
* What
|
|
25
|
-
*
|
|
26
|
-
* asks for less.
|
|
22
|
+
* What the platform grants. Advertised here so a client asks for the same. A
|
|
23
|
+
* client that names none is the platform's to decide, so it is passed on as is.
|
|
27
24
|
*/
|
|
28
|
-
const
|
|
25
|
+
const SCOPES = ["mcp:read", WRITE_SCOPE];
|
|
29
26
|
const SUPPORTED_PROTOCOL_VERSIONS = ["2025-06-18", "2025-03-26"];
|
|
30
27
|
/**
|
|
31
28
|
* Serves the MCP endpoint and its OAuth flow from the app's own origin.
|
|
@@ -168,15 +165,16 @@ async function platformFetch(path, init) {
|
|
|
168
165
|
}
|
|
169
166
|
/** The name to show on the Allow page, or why there's nothing to approve. */
|
|
170
167
|
async function platformConsent(query) {
|
|
171
|
-
const
|
|
168
|
+
const params = new URLSearchParams({
|
|
172
169
|
client_id: query.client_id,
|
|
173
170
|
redirect_uri: query.redirect_uri,
|
|
174
171
|
response_type: query.response_type,
|
|
175
172
|
code_challenge: query.code_challenge,
|
|
176
173
|
code_challenge_method: query.code_challenge_method,
|
|
177
|
-
state: query.state ?? ""
|
|
178
|
-
|
|
179
|
-
|
|
174
|
+
state: query.state ?? ""
|
|
175
|
+
});
|
|
176
|
+
if (query.scope !== void 0) params.set("scope", query.scope);
|
|
177
|
+
const response = await platformFetch(`/v1/oauth/authorize?${params}`, { method: "GET" });
|
|
180
178
|
const body = await response.json().catch(() => null);
|
|
181
179
|
if (!response.ok) {
|
|
182
180
|
const refusal = z.object({ message: z.string() }).safeParse(body);
|
|
@@ -210,7 +208,7 @@ async function platformApprove(sessionToken, query, approved) {
|
|
|
210
208
|
state: query.state ?? "",
|
|
211
209
|
code_challenge: query.code_challenge,
|
|
212
210
|
code_challenge_method: query.code_challenge_method,
|
|
213
|
-
scope: query.scope
|
|
211
|
+
scope: query.scope,
|
|
214
212
|
approved
|
|
215
213
|
})
|
|
216
214
|
});
|
|
@@ -493,7 +491,7 @@ function unauthorized(origin) {
|
|
|
493
491
|
status: 401,
|
|
494
492
|
headers: {
|
|
495
493
|
"content-type": "application/json",
|
|
496
|
-
"www-authenticate": `Bearer resource_metadata="${origin}${PROTECTED_RESOURCE_PATH}", scope="${
|
|
494
|
+
"www-authenticate": `Bearer resource_metadata="${origin}${PROTECTED_RESOURCE_PATH}", scope="${SCOPES.join(" ")}"`
|
|
497
495
|
}
|
|
498
496
|
});
|
|
499
497
|
}
|
package/dist/package.js
CHANGED
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ description: >-
|
|
|
13
13
|
metadata:
|
|
14
14
|
type: sub-skill
|
|
15
15
|
library: softr-sdk
|
|
16
|
-
library_version: 1.11.
|
|
16
|
+
library_version: 1.11.1
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
**Boundary.** `ai` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineAiAction` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -10,7 +10,7 @@ description: >-
|
|
|
10
10
|
metadata:
|
|
11
11
|
type: sub-skill
|
|
12
12
|
library: softr-sdk
|
|
13
|
-
library_version: 1.11.
|
|
13
|
+
library_version: 1.11.1
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
**Boundary.** `auth` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build.
|
|
@@ -10,7 +10,7 @@ description: >-
|
|
|
10
10
|
metadata:
|
|
11
11
|
type: sub-skill
|
|
12
12
|
library: softr-sdk
|
|
13
|
-
library_version: 1.11.
|
|
13
|
+
library_version: 1.11.1
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
**Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. A helper that calls `ds` outside a handler goes in `createServerOnlyFn` from `@tanstack/react-start` (the `record-queries` boundary). `defineQuery` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -12,7 +12,7 @@ description: >-
|
|
|
12
12
|
metadata:
|
|
13
13
|
type: sub-skill
|
|
14
14
|
library: softr-sdk
|
|
15
|
-
library_version: 1.11.
|
|
15
|
+
library_version: 1.11.1
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
**Boundary.** `email` and `EmailError` live on `@softr/sdk/server` and run only inside a `createServerFn` handler — importing them into a component fails the build. `defineEmailAction` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -7,7 +7,7 @@ description: >-
|
|
|
7
7
|
metadata:
|
|
8
8
|
type: sub-skill
|
|
9
9
|
library: softr-sdk
|
|
10
|
-
library_version: 1.11.
|
|
10
|
+
library_version: 1.11.1
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
**Boundary.** `upload` lives on `@softr/sdk/server` and runs inside server functions. `useFileUpload` and `FileItem` live on `@softr/sdk` and run in components. `FileAttachment` comes from `@softr/sdk` and can be imported anywhere.
|
|
@@ -7,7 +7,7 @@ description: >-
|
|
|
7
7
|
metadata:
|
|
8
8
|
type: sub-skill
|
|
9
9
|
library: softr-sdk
|
|
10
|
-
library_version: 1.11.
|
|
10
|
+
library_version: 1.11.1
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
**Boundary.** `integration` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineIntegration` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -9,7 +9,7 @@ description: >-
|
|
|
9
9
|
metadata:
|
|
10
10
|
type: sub-skill
|
|
11
11
|
library: softr-sdk
|
|
12
|
-
library_version: 1.11.
|
|
12
|
+
library_version: 1.11.1
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
**Boundary.** `softrMcpMiddleware` lives on `@softr/sdk` and is registered once, in `src/start.ts`. The actions you hand it are the same `defineQuery` / `defineMutation` values the app's own pages use — declared wherever they already live, not duplicated for MCP.
|
|
@@ -10,7 +10,7 @@ description: >-
|
|
|
10
10
|
metadata:
|
|
11
11
|
type: sub-skill
|
|
12
12
|
library: softr-sdk
|
|
13
|
-
library_version: 1.11.
|
|
13
|
+
library_version: 1.11.1
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
**Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineMutation` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -11,7 +11,7 @@ description: >-
|
|
|
11
11
|
metadata:
|
|
12
12
|
type: sub-skill
|
|
13
13
|
library: softr-sdk
|
|
14
|
-
library_version: 1.11.
|
|
14
|
+
library_version: 1.11.1
|
|
15
15
|
---
|
|
16
16
|
|
|
17
17
|
**Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. A route `loader` also runs in the browser, so it calls a server function, never `ds`. A helper that calls `ds` outside a handler, in this file or in another one, goes in `createServerOnlyFn` from `@tanstack/react-start`, or inside the handler. An exported helper without it keeps the server-only import in the browser bundle, and every page stops loading until it moves. Do not make such a helper a server function when it takes an id: any visitor can call a server function with any id. `defineQuery` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -9,7 +9,7 @@ description: >-
|
|
|
9
9
|
metadata:
|
|
10
10
|
type: sub-skill
|
|
11
11
|
library: softr-sdk
|
|
12
|
-
library_version: 1.11.
|
|
12
|
+
library_version: 1.11.1
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
**Boundary.** `definePage`, `pageHead`, the access functions and the error predicates come from `@softr/sdk` and work anywhere.
|
|
@@ -9,7 +9,7 @@ description: >-
|
|
|
9
9
|
metadata:
|
|
10
10
|
type: sub-skill
|
|
11
11
|
library: softr-sdk
|
|
12
|
-
library_version: 1.11.
|
|
12
|
+
library_version: 1.11.1
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
**Boundary.** `workflow` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineWorkflow` and every type come from `@softr/sdk` and can be imported anywhere.
|