@softr/sdk 0.0.98 → 0.0.99-se22717.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.
@@ -1,7 +1,7 @@
1
1
  import { User } from "./user.js";
2
2
  import { Formatting } from "../formatting.js";
3
3
  import { SoftrContext } from "./context.js";
4
- import * as react0 from "react";
4
+ import * as react3 from "react";
5
5
  import { ReactNode } from "react";
6
6
  import * as _tanstack_react_start0 from "@tanstack/react-start";
7
7
 
@@ -105,7 +105,7 @@ declare function AuthSettingsProvider({
105
105
  }: {
106
106
  value: AuthOptions;
107
107
  children?: ReactNode;
108
- }): react0.JSX.Element;
108
+ }): react3.JSX.Element;
109
109
  /**
110
110
  * Which ways in this app offers. Requires an {@link AuthSettingsProvider}
111
111
  * above it.
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.0.98";
2
+ var version = "0.0.99-se22717.0";
3
3
 
4
4
  //#endregion
5
5
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softr/sdk",
3
- "version": "0.0.98",
3
+ "version": "0.0.99-se22717.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: core
11
11
  library: softr-sdk
12
- library_version: 0.0.98
12
+ library_version: 0.0.99-se22717.0
13
13
  ---
14
14
 
15
15
  # Softr SDK core
@@ -20,11 +20,11 @@ metadata:
20
20
  >
21
21
  > **CRITICAL**: Every route file must declare its settings with `definePage`, guard itself with them in `beforeLoad` and render them in `head`. There is no default and nothing is inherited from a sibling.
22
22
  >
23
- > **CRITICAL**: The app is already wired. `src/start.ts`, `src/router.tsx` and `src/routes/__root.tsx` register `softrAuthMiddleware` and resolve the session. Do not add a second registration of it. `softrMcpMiddleware` is the one thing an app adds to `src/start.ts` itself — load the `softr-sdk/mcp` sub-skill before doing so.
23
+ > **CRITICAL**: The app is already wired. `src/start.ts`, `src/router.tsx` and `src/routes/__root.tsx` register `softrAuthMiddleware` and resolve the session. Do not add a second registration of it. `softrMcpMiddleware` is the one thing an app adds to `src/start.ts` itself — load the `mcp` sub-skill before doing so.
24
24
  >
25
- > **CRITICAL**: `ai.generate` and `ai.stream` live on `@softr/sdk/server` and only run inside a `createServerFn` handler. Use `defineAiAction` from `@softr/sdk` to declare the action with the model it runs on, an id copied from the `ai_list_models` tool. Softr runs the model on its own keys; never ask the user for an API key for the app's own AI feature. Load the `softr-sdk/ai` sub-skill for the full pattern.
25
+ > **CRITICAL**: `ai.generate` and `ai.stream` live on `@softr/sdk/server` and only run inside a `createServerFn` handler. Use `defineAiAction` from `@softr/sdk` to declare the action with the model it runs on, an id copied from the `ai_list_models` tool. Softr runs the model on its own keys; never ask the user for an API key for the app's own AI feature. Load the `ai` sub-skill for the full pattern.
26
26
  >
27
- > **CRITICAL**: `workflow.trigger` lives on `@softr/sdk/server` and only runs inside a `createServerFn` handler. Use `defineWorkflow` from `@softr/sdk` to declare the action, then pass it to `workflow.trigger`. Load the `softr-sdk/workflows` sub-skill for the full pattern.
27
+ > **CRITICAL**: `workflow.trigger` lives on `@softr/sdk/server` and only runs inside a `createServerFn` handler. Use `defineWorkflow` from `@softr/sdk` to declare the action, then pass it to `workflow.trigger`. Load the `workflows` sub-skill for the full pattern.
28
28
 
29
29
  Each sub-skill stands alone for its task and repeats the boundary above, so most work needs **one** sub-skill and not this file. Load this one when you are unsure which sub-skill applies, or when the wiring below is what you are touching. Add a second sub-skill only when the work genuinely crosses that boundary: a page that lists records behind a group restriction needs `record-queries` plus `routes-and-visibility`.
30
30
 
@@ -59,46 +59,46 @@ Each sub-skill stands alone for its task and repeats the boundary above, so most
59
59
 
60
60
  ```text
61
61
  Adding a page, or changing who may see one?
62
- load softr-sdk/routes-and-visibility
62
+ load the `routes-and-visibility` sub-skill
63
63
 
64
64
  Hiding a region of a page from some visitors?
65
- load softr-sdk/region-visibility
65
+ load the `region-visibility` sub-skill
66
66
 
67
67
  Showing the visitor's name, email or groups?
68
- load softr-sdk/current-user
68
+ load the `current-user` sub-skill
69
69
 
70
70
  Putting records on a page, in a table, a list or a detail view?
71
- load softr-sdk/record-queries
71
+ load the `record-queries` sub-skill
72
72
 
73
73
  Drawing a chart, a stat tile, or any aggregated number?
74
- load softr-sdk/charts-and-metrics
74
+ load the `charts-and-metrics` sub-skill
75
75
 
76
76
  Submitting a form, editing a record, or deleting one?
77
- load softr-sdk/record-mutations
77
+ load the `record-mutations` sub-skill
78
78
 
79
79
  Triggering a Softr workflow from a button or form?
80
- load softr-sdk/workflows
80
+ load the `workflows` sub-skill
81
81
 
82
82
  Wiring a login, signup, or sign-out?
83
- load softr-sdk/auth
83
+ load the `auth` sub-skill
84
84
 
85
85
  Asking an AI model for anything: a summary, fields out of a document, a classification, a draft, a chat?
86
- load softr-sdk/ai — Softr runs the model on its own keys, nothing to connect; pick the model from ai_list_models
86
+ load the `ai` sub-skill — Softr runs the model on its own keys, nothing to connect; pick the model from ai_list_models
87
87
 
88
88
  Calling a connected third-party API (Slack, Stripe, Gmail, Google Calendar, …)?
89
- load softr-sdk/integrations
89
+ load the `integrations` sub-skill
90
90
 
91
91
  Running a model on the user's OWN provider account, because they chose that for the feature?
92
- load softr-sdk/integrations: its "Calling an AI model" section
92
+ load the `integrations` sub-skill: its "Calling an AI model" section
93
93
 
94
94
  Opening the app to an AI assistant over MCP?
95
- load softr-sdk/mcp
95
+ load the `mcp` sub-skill
96
96
 
97
97
  Adding an install button, or making the app installable?
98
- load softr-sdk/pwa
98
+ load the `pwa` sub-skill
99
99
 
100
100
  Showing a date, a time or a number on a page?
101
- load softr-sdk/formatting
101
+ load the `formatting` sub-skill
102
102
 
103
103
  Writing a server function, loader, or middleware in general?
104
104
  not a Softr concern. Use the TanStack Start skills.
@@ -13,7 +13,7 @@ description: >-
13
13
  metadata:
14
14
  type: sub-skill
15
15
  library: softr-sdk
16
- library_version: 0.0.98
16
+ library_version: 0.0.99-se22717.0
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.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.98
12
+ library_version: 0.0.99-se22717.0
13
13
  ---
14
14
 
15
15
  **Boundary.** `auth` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.98
12
+ library_version: 0.0.99-se22717.0
13
13
  ---
14
14
 
15
15
  **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.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.98
12
+ library_version: 0.0.99-se22717.0
13
13
  ---
14
14
 
15
15
  # The current user
@@ -7,7 +7,7 @@ description: >-
7
7
  metadata:
8
8
  type: sub-skill
9
9
  library: softr-sdk
10
- library_version: 0.0.98
10
+ library_version: 0.0.99-se22717.0
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.
@@ -8,7 +8,7 @@ description: >-
8
8
  metadata:
9
9
  type: sub-skill
10
10
  library: softr-sdk
11
- library_version: 0.0.98
11
+ library_version: 0.0.99-se22717.0
12
12
  ---
13
13
 
14
14
  # Dates, times and numbers
@@ -7,7 +7,7 @@ description: >-
7
7
  metadata:
8
8
  type: sub-skill
9
9
  library: softr-sdk
10
- library_version: 0.0.98
10
+ library_version: 0.0.99-se22717.0
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: 0.0.98
12
+ library_version: 0.0.99-se22717.0
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.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.98
12
+ library_version: 0.0.99-se22717.0
13
13
  ---
14
14
 
15
15
  # Installing the app
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.98
12
+ library_version: 0.0.99-se22717.0
13
13
  ---
14
14
 
15
15
  **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.
@@ -10,7 +10,7 @@ description: >-
10
10
  metadata:
11
11
  type: sub-skill
12
12
  library: softr-sdk
13
- library_version: 0.0.98
13
+ library_version: 0.0.99-se22717.0
14
14
  ---
15
15
 
16
16
  **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. The same holds for any helper that calls `ds`: declare it inside the handler. A function at module level that calls `ds` keeps the server-only import in the browser bundle, and every page stops loading until it moves. `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: 0.0.98
12
+ library_version: 0.0.99-se22717.0
13
13
  ---
14
14
 
15
15
  **Boundary.** `Audience` and `defineVisibility` 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.98
12
+ library_version: 0.0.99-se22717.0
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: 0.0.98
12
+ library_version: 0.0.99-se22717.0
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.