@astralbeam/sdk 0.15.2 → 0.17.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/README.md +16 -8
- package/dist/api-BaIPbj-Q.js +709 -0
- package/dist/api.d.ts +2 -2
- package/dist/api.js +2 -2
- package/dist/client.d.ts +21 -7
- package/dist/client.js +1 -1
- package/dist/{core-BGDo_tQ4.js → core-DeMY6_wQ.js} +2276 -203
- package/dist/core.d.ts +2 -2
- package/dist/core.js +1 -1
- package/dist/index-CfGnT6Od.d.ts +938 -0
- package/dist/{index-DUznpmNz.d.ts → index-NT05_Yw_.d.ts} +245 -69
- package/dist/listings-BH_hPkxx.js +1 -0
- package/dist/react.d.ts +14 -6
- package/dist/react.js +22 -7
- package/dist/rolldown-runtime-QTnfLwEv.js +1 -0
- package/dist/server.d.ts +6 -0
- package/dist/server.js +6 -2
- package/dist/styles.generated-D8sDOLu3.js +98 -0
- package/dist/widget-BdiuWvPf.js +24 -0
- package/package.json +6 -6
- package/dist/api-DUe8JSVU.d.ts +0 -372
- package/dist/api-r11gRy91.js +0 -323
- package/dist/index-BVVgDSdq.d.ts +0 -1
- package/dist/listings-6eaCXB6G.js +0 -21
- package/dist/styles.generated-Bub4csY_.js +0 -60
- package/dist/widget-Bjm0sUjE.js +0 -26
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ Without npm or a bundler, import the same entry from jsDelivr in a module script
|
|
|
29
29
|
|
|
30
30
|
```html
|
|
31
31
|
<script type="module">
|
|
32
|
-
import { mountAstralBeamChat } from "https://cdn.jsdelivr.net/npm/@astralbeam/sdk@0.
|
|
32
|
+
import { mountAstralBeamChat } from "https://cdn.jsdelivr.net/npm/@astralbeam/sdk@0.17.0/dist/client.js"
|
|
33
33
|
|
|
34
34
|
mountAstralBeamChat(document.getElementById("sidebar"), {})
|
|
35
35
|
</script>
|
|
@@ -82,7 +82,7 @@ export async function POST(request: Request) {
|
|
|
82
82
|
- Directory access additionally requires signed `user.admin: true`, derived from trusted tenant permissions, and persisted records. Follow [Tenant directories](https://astralbeam.ai/docs/sdk/listings).
|
|
83
83
|
- For employee-facing Tenant management, use `createAstralBeamOrganizationToken`. The [API client guide](https://astralbeam.ai/docs/sdk/api) covers database-backed roles and browser integration.
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
After acquiring a token, components call `POST /api/v1/me` and renew before expiry. See [authentication and refresh behavior](https://astralbeam.ai/docs/sdk/authentication).
|
|
86
86
|
|
|
87
87
|
## Options
|
|
88
88
|
|
|
@@ -91,20 +91,28 @@ Every option is also a prop on `<AstralBeamChat>`. `handle.update(options)` appl
|
|
|
91
91
|
| Option | Default | Meaning |
|
|
92
92
|
| --- | --- | --- |
|
|
93
93
|
| `agentId` | organization's default | `agent_<orgId>_<id>`, copied from the dashboard |
|
|
94
|
+
| `threadId` | `"auto"` | Restore this tab's selection, use `"new"` for a fresh chat, or pass a saved thread UUID |
|
|
94
95
|
| `apiUrl` | `https://astralbeam.ai/api` | Base URL of the AstralBeam API. The widget calls `/v1/chat` there |
|
|
95
96
|
| `fetchAstralBeamToken` | `{ url: "/api/astralbeam/token" }` | Chat auth token endpoint as `{ url, ...RequestInit }`, or a minter |
|
|
96
|
-
| `title`, `showHeader` | `"AstralBeam"`, `true` | Header text, and whether the header and
|
|
97
|
-
| `
|
|
97
|
+
| `title`, `showHeader` | `"AstralBeam"`, `true` | Header text, and whether the header with its chat history and new chat buttons shows |
|
|
98
|
+
| `showConversationTitle` | `false` | Bar with a titled conversation's title and a rename, delete, and Copy Markdown menu |
|
|
99
|
+
| `emptyHeadline`, `emptyDescription` | generic copy | Headline and subtitle of the empty transcript |
|
|
98
100
|
| `colorScheme`, `theme` | `"system"`, built-in palette | Light/dark/system, and shadcn token overrides |
|
|
99
101
|
| `customCss` | None | Trusted CSS inside the widget's Shadow DOM |
|
|
100
102
|
| `attachments` | `true` | `false` hides the feature, or pass limits |
|
|
101
103
|
| `tools`, `widgets` | none | What the agent can do and draw in your app |
|
|
102
104
|
| `sandboxPanel` | `false` | Collected sandbox panel: files with downloads, command log |
|
|
103
|
-
| `header`, `empty`, `composerActions` | widget's own chrome | Host-rendered replacements (React props. `slots` on the handle) |
|
|
105
|
+
| `header`, `headerActions`, `empty`, `composerActions` | widget's own chrome | Host-rendered replacements (React props. `slots` on the handle) |
|
|
104
106
|
| `debug` | `false` | Log SDK actions in the browser, with server logs in development only |
|
|
105
107
|
|
|
106
108
|
A `ref` on `<AstralBeamChat>` (and the vanilla handle) exposes `reset()` and `stop()` for hosts that draw their own controls.
|
|
107
109
|
|
|
110
|
+
Conversations are saved automatically and start private. The widget searches saved conversation titles. Reopening history does not execute earlier tool calls. Disconnecting can interrupt the current response.
|
|
111
|
+
|
|
112
|
+
The headless session exposes conversation navigation, search, and pagination. With `useAstralBeamChat`, access these through `chat.core`, for example `chat.core.openThread(threadId)`. History loads a page at a time. `reset()` starts a new chat and keeps the saved one.
|
|
113
|
+
|
|
114
|
+
By default, `threadId: "auto"` restores this tab's selection after reload using session storage, scoped to the current account and API. A fresh, independently opened tab starts a new chat. Use `threadId: "new"` to bypass restoration, or pass a saved thread UUID. The widget keeps unsent text and uploaded file references in local storage per account, API, and conversation. Reopening restores the draft without sending it automatically. The host owns sidebar visibility and can persist it separately in session storage.
|
|
115
|
+
|
|
108
116
|
## Tools and widgets
|
|
109
117
|
|
|
110
118
|
A tool does something: its `execute` runs in your page. A widget shows something: its `render` draws your UI into the conversation. Both are declared with a `description` and a `parameters` schema. See [Tools and widgets](https://astralbeam.ai/docs/sdk/tools-and-widgets).
|
|
@@ -139,7 +147,7 @@ widgets: {
|
|
|
139
147
|
| [Getting started](https://astralbeam.ai/docs/sdk/getting-started) | install, mount, layout requirements. |
|
|
140
148
|
| [Script tag](https://astralbeam.ai/docs/sdk/script-tag) | loading from jsDelivr without a bundler, and Ruby on Rails. |
|
|
141
149
|
| [Authentication](https://astralbeam.ai/docs/sdk/authentication) | the token endpoint, its security rules, and minting in other languages. |
|
|
142
|
-
| [Tenant directories](https://astralbeam.ai/docs/sdk/listings) | provisioning,
|
|
150
|
+
| [Tenant directories](https://astralbeam.ai/docs/sdk/listings) | provisioning, Tenant and user listings, saved conversation browsing, lifecycle, and options. |
|
|
143
151
|
| [Configuration](https://astralbeam.ai/docs/sdk/configuration) | every option, and what `update` can change. |
|
|
144
152
|
| [Theming](https://astralbeam.ai/docs/sdk/theming) | color schemes, CSS tokens, the shadow-root boundary. |
|
|
145
153
|
| [Tools and widgets](https://astralbeam.ai/docs/sdk/tools-and-widgets) | schemas, live state, rendering into the transcript. |
|
|
@@ -151,9 +159,9 @@ widgets: {
|
|
|
151
159
|
|
|
152
160
|
## Entry points
|
|
153
161
|
|
|
154
|
-
Read-only Tenant and
|
|
162
|
+
Read-only Tenant, TenantUser and conversation widgets are available from `/client` and `/react`. See [Tenant directories](https://astralbeam.ai/docs/sdk/listings) for setup and embedding examples.
|
|
155
163
|
|
|
156
|
-
There is no root export.
|
|
164
|
+
There is no root export.
|
|
157
165
|
|
|
158
166
|
| Entry point | Contents | Peer dependency |
|
|
159
167
|
| ------------------------ | -------------------------------------------- | -------------------- |
|