@softr/sdk 0.0.46-alpha.0 → 0.0.46-alpha.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/package.js +1 -1
- package/package.json +1 -1
- package/skills/softr-sdk/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/file-uploads/SKILL.md +1 -1
- package/skills/softr-sdk/integrations/SKILL.md +1 -1
- package/skills/softr-sdk/mcp/SKILL.md +13 -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 +5 -6
- package/skills/softr-sdk/workflows/SKILL.md +1 -1
package/dist/package.js
CHANGED
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ description: >-
|
|
|
16
16
|
metadata:
|
|
17
17
|
type: sub-skill
|
|
18
18
|
library: softr-sdk
|
|
19
|
-
library_version: 0.0.46-alpha.
|
|
19
|
+
library_version: 0.0.46-alpha.2
|
|
20
20
|
---
|
|
21
21
|
|
|
22
22
|
**Boundary.** `auth` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build.
|
|
@@ -12,7 +12,7 @@ description: >-
|
|
|
12
12
|
metadata:
|
|
13
13
|
type: sub-skill
|
|
14
14
|
library: softr-sdk
|
|
15
|
-
library_version: 0.0.46-alpha.
|
|
15
|
+
library_version: 0.0.46-alpha.2
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
**Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler or a server-side route hook — importing it into a component fails the build. `defineQuery` 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: 0.0.46-alpha.
|
|
13
|
+
library_version: 0.0.46-alpha.2
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
**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.
|
|
@@ -9,7 +9,7 @@ description: >-
|
|
|
9
9
|
metadata:
|
|
10
10
|
type: sub-skill
|
|
11
11
|
library: softr-sdk
|
|
12
|
-
library_version: 0.0.46-alpha.
|
|
12
|
+
library_version: 0.0.46-alpha.2
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
**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: 0.0.46-alpha.
|
|
12
|
+
library_version: 0.0.46-alpha.2
|
|
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.
|
|
@@ -18,6 +18,16 @@ metadata:
|
|
|
18
18
|
|
|
19
19
|
An app can answer an AI assistant on its own origin. The assistant signs in as an ordinary app user, and the actions you list become the tools it may call. Not wired by default — a new app serves no MCP endpoint until you add the middleware.
|
|
20
20
|
|
|
21
|
+
## The URL
|
|
22
|
+
|
|
23
|
+
The app's own public origin, plus `/_softr/mcp`:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
https://myapp.mysoftr.app/_softr/mcp
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Custom domain, default subdomain, a staging host — whatever origin the app is published on, the path is the same. That whole string is the MCP URL. The origin on its own is the app's home page, and an assistant pointed at it gets HTML back.
|
|
30
|
+
|
|
21
31
|
## Setup
|
|
22
32
|
|
|
23
33
|
```ts
|
|
@@ -63,6 +73,8 @@ The blank template does this in `src/routes/_auth/login.tsx`, `src/routes/verify
|
|
|
63
73
|
|
|
64
74
|
**Registering after `softrAuthMiddleware`.** The assistant's token is never read. Put the MCP middleware first.
|
|
65
75
|
|
|
76
|
+
**Handing over the app's URL as the MCP URL.** The origin is where the app's pages are. Without `/_softr/mcp` on the end the assistant has nothing to talk to, and the owner is left comparing a URL that looks right against a connection that never works.
|
|
77
|
+
|
|
66
78
|
**A login that drops `redirect`.** Sign-in works, approval doesn't. The most common break, and silent — test the connect flow signed out, not only signed in.
|
|
67
79
|
|
|
68
80
|
**Following `redirect` unchecked.** Anything that is not a path on this app is someone else's page. Reject it, fall back to `/`.
|
|
@@ -11,7 +11,7 @@ description: >-
|
|
|
11
11
|
metadata:
|
|
12
12
|
type: sub-skill
|
|
13
13
|
library: softr-sdk
|
|
14
|
-
library_version: 0.0.46-alpha.
|
|
14
|
+
library_version: 0.0.46-alpha.2
|
|
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. `defineMutation` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -13,7 +13,7 @@ description: >-
|
|
|
13
13
|
metadata:
|
|
14
14
|
type: sub-skill
|
|
15
15
|
library: softr-sdk
|
|
16
|
-
library_version: 0.0.46-alpha.
|
|
16
|
+
library_version: 0.0.46-alpha.2
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
**Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler or a server-side route hook — importing it into a component fails the build. `defineQuery` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -5,15 +5,14 @@ description: >-
|
|
|
5
5
|
with ALL_USERS, LOGGED_IN_USERS or NON_LOGGED_IN_USERS, userGroupIds, and the
|
|
6
6
|
ways to apply a rule: guardRoute and assertRouteAccess in a route,
|
|
7
7
|
isAuthorized and checkAccess anywhere. Covers per-reason overrides, the
|
|
8
|
-
redirect and throw strategies, rendering an access error with
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
root-level one.
|
|
8
|
+
redirect and throw strategies, rendering an access error with isAccessError,
|
|
9
|
+
isUnauthenticatedError, isForbiddenError and isAlreadyAuthenticatedError,
|
|
10
|
+
guarding a layout, and the lint rule that requires a declaration alongside the
|
|
11
|
+
rules that reject a duplicate, computed or root-level one.
|
|
13
12
|
metadata:
|
|
14
13
|
type: sub-skill
|
|
15
14
|
library: softr-sdk
|
|
16
|
-
library_version: 0.0.46-alpha.
|
|
15
|
+
library_version: 0.0.46-alpha.2
|
|
17
16
|
---
|
|
18
17
|
|
|
19
18
|
**Boundary.** `defineVisibility`, 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: 0.0.46-alpha.
|
|
12
|
+
library_version: 0.0.46-alpha.2
|
|
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.
|