@softr/sdk 0.0.90-alpha.0 → 0.0.90-alpha.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/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.0.90-alpha.0";
2
+ var version = "0.0.90-alpha.1";
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.90-alpha.0",
3
+ "version": "0.0.90-alpha.1",
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.90-alpha.0
12
+ library_version: 0.0.90-alpha.1
13
13
  ---
14
14
 
15
15
  # Softr SDK core
@@ -12,7 +12,7 @@ description: >-
12
12
  metadata:
13
13
  type: sub-skill
14
14
  library: softr-sdk
15
- library_version: 0.0.90-alpha.0
15
+ library_version: 0.0.90-alpha.1
16
16
  ---
17
17
 
18
18
  **Boundary.** `listAgents` and `useAgentChat` live on `@softr/sdk`. `listAgents` runs in a route loader, `useAgentChat` in a component. Neither needs a route, server function or registration of its own. It chats as the signed-in visitor, or anonymously when no one is signed in.
@@ -87,7 +87,8 @@ A `tool` with status `awaiting-connection` needs the visitor's own `integration`
87
87
 
88
88
  Classic Softr apps ship a chat panel. Visitors expect the same from yours:
89
89
 
90
- - A round button in a corner opens it. A right-side panel on desktop, full screen on mobile.
90
+ - A round `primary` button in a corner opens it: about 56px, a soft shadow, the agent's avatar or a chat icon. It hides while the panel is open.
91
+ - The panel opens on the right on desktop, about 420px wide with a left border and a large shadow, and full screen on mobile.
91
92
  - The header shows the agent's avatar and name, a picker when there are several agents, new chat, past chats and close.
92
93
  - An empty chat greets the visitor with the agent's avatar.
93
94
  - The list scrolls to the newest message as the reply streams, until the visitor scrolls up. Then a button takes them back down.
@@ -98,6 +99,25 @@ Classic Softr apps ship a chat panel. Visitors expect the same from yours:
98
99
  - A tool's `input` is JSON. Show it readable: one `Label: value` line per field, with line breaks kept, never the raw JSON. Leave out `thought`, `input`, `error` or the duration when it's empty.
99
100
  - A tool that needs the visitor's account shows a Connect button.
100
101
 
102
+ ## How it looks
103
+
104
+ The chat is the visitor's first impression of the agent. These are defaults for the first build. When the builder asks for a different look, follow them instead.
105
+
106
+ - **The app's own look.** Build it from the app's own primitives and match its pages, so it never reads as a third-party widget.
107
+ - **One loud thing at a time.** The answer is the content. Tool lines stay quiet. Only a block that waits for the visitor (approve, connect, question) stands out.
108
+ - **Layout.** Three zones: a fixed header, the scrolling messages, a fixed composer. Use `text-sm` throughout.
109
+ - **Header.** A small round avatar, the agent's name, and a muted line under it (the agent picker, when there are several). Actions are ghost icon buttons with tooltips.
110
+ - **Visitor messages.** Right-aligned bubbles in `primary`, generously rounded, at most 85% wide.
111
+ - **Agent replies.** No bubble. Full width on the background, with a small avatar at the start of each reply, so long answers and tables read like a page.
112
+ - **Markdown.** Comfortable paragraph and list spacing. Inline code on `muted`. Tables bordered, in a horizontal scroll wrapper, never wider than the panel. Links in `primary`.
113
+ - **Tools.** One `text-xs` muted line with a status icon: a spinner while running, a check when done, an alert on error. Click to expand.
114
+ - **Blocks that wait for the visitor.** A `card` with a border, a rounded corner and padding: a one-line title, a short explanation, buttons on the right. The main action is `primary`, the other `outline`.
115
+ - **Thinking.** Where the reply will appear, a muted "Thinking…" with a gentle pulse or shimmer.
116
+ - **Empty chat.** Centred: a large avatar, "Hi, I'm {agent title}", one muted line inviting a question. Add two to four suggestion chips only when the builder said what the agent does; they send on click.
117
+ - **Composer.** One rounded, bordered box that holds the textarea and an icon send button in its corner, with the focus ring on the box. The textarea grows to about six lines, then scrolls. The disclaimer sits under it in `text-xs` muted, centred.
118
+ - **Spacing.** Clear space between turns, tight space inside a turn.
119
+ - **Motion.** The panel slides in and new messages fade in, both short, and they respect reduced motion. Nothing bounces.
120
+
101
121
  ## Context
102
122
 
103
123
  `record` is the one record the visitor is looking at, so they can say "close this one". Pass it where a page shows one record, and `null` elsewhere. Use readable field names as keys. The agent reads them as they are.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.90-alpha.0
12
+ library_version: 0.0.90-alpha.1
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.90-alpha.0
12
+ library_version: 0.0.90-alpha.1
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.90-alpha.0
12
+ library_version: 0.0.90-alpha.1
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.90-alpha.0
10
+ library_version: 0.0.90-alpha.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.
@@ -8,7 +8,7 @@ description: >-
8
8
  metadata:
9
9
  type: sub-skill
10
10
  library: softr-sdk
11
- library_version: 0.0.90-alpha.0
11
+ library_version: 0.0.90-alpha.1
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.90-alpha.0
10
+ library_version: 0.0.90-alpha.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: 0.0.90-alpha.0
12
+ library_version: 0.0.90-alpha.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.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.90-alpha.0
12
+ library_version: 0.0.90-alpha.1
13
13
  ---
14
14
 
15
15
  # Installing the app
@@ -8,7 +8,7 @@ description: >-
8
8
  metadata:
9
9
  type: sub-skill
10
10
  library: softr-sdk
11
- library_version: 0.0.90-alpha.0
11
+ library_version: 0.0.90-alpha.1
12
12
  ---
13
13
 
14
14
  **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.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.90-alpha.0
12
+ library_version: 0.0.90-alpha.1
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. 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.90-alpha.0
12
+ library_version: 0.0.90-alpha.1
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.90-alpha.0
12
+ library_version: 0.0.90-alpha.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: 0.0.90-alpha.0
12
+ library_version: 0.0.90-alpha.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.