@astralbeam/sdk 0.15.2 → 0.16.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astralbeam/sdk",
3
- "version": "0.15.2",
3
+ "version": "0.16.0",
4
4
  "description": "Frontend SDK for AstralBeam: drop-in agent UI, chat streaming, and server helpers",
5
5
  "homepage": "https://astralbeam.ai",
6
6
  "bugs": "https://github.com/AstralBeamAI/astralbeam/issues",
@@ -85,8 +85,8 @@
85
85
  "@phosphor-icons/react": "^2.1.10",
86
86
  "@shadcn/react": "^0.3.0",
87
87
  "@tailwindcss/cli": "^4.3.3",
88
- "@tanstack/ai": "^0.63.0",
89
- "@tanstack/ai-client": "^0.36.0",
88
+ "@tanstack/ai": "^0.64.0",
89
+ "@tanstack/ai-client": "^0.36.1",
90
90
  "@tanstack/eslint-plugin-query": "^5.103.2",
91
91
  "@tanstack/markdown": "^1.0.0",
92
92
  "@tanstack/react-pacer": "^0.23.0",
@@ -1,372 +0,0 @@
1
- //#region src/api/api.d.ts
2
- interface ApiRequestOptions extends RequestInit {
3
- apiUrl?: string | undefined;
4
- fetchClient?: typeof globalThis.fetch;
5
- }
6
- type ApiKeyOptions = ApiRequestOptions & {
7
- apiKey: string;
8
- astralBeamToken?: never;
9
- };
10
- type JwtOptions = ApiRequestOptions & {
11
- astralBeamToken: string;
12
- apiKey?: never;
13
- };
14
- type ApiOptions = ApiKeyOptions | JwtOptions;
15
- type FileOptions = ApiRequestOptions & {
16
- apiKey?: never;
17
- astralBeamToken?: never;
18
- };
19
- interface AstralBeamApiError$1 extends Error {
20
- name: "AstralBeamApiError";
21
- status: number;
22
- headers: Headers;
23
- body?: AstralBeamApiError;
24
- }
25
- declare function isAstralBeamApiError(error: unknown): error is AstralBeamApiError$1;
26
- declare function astralBeamApiFetch<T>(path: string, options: ApiOptions): Promise<T>;
27
- declare function astralBeamJwtFetch<T>(path: string, options: JwtOptions): Promise<T>;
28
- declare function astralBeamChatFetch<_T>(path: string, options: JwtOptions): Promise<Response>;
29
- declare function astralBeamFileFetch<_T>(path: string, options?: FileOptions): Promise<Response>;
30
- //#endregion
31
- //#region src/api/generated/api.d.ts
32
- type AstralBeamApiErrorIssuesItem = {
33
- path: string;
34
- message: string;
35
- };
36
- interface AstralBeamApiError {
37
- type: string;
38
- title: string;
39
- status: number;
40
- detail: string;
41
- issues?: AstralBeamApiErrorIssuesItem[];
42
- /** Identifies the server log entry of an internal error. Quote it for support. */
43
- reference?: string;
44
- }
45
- /**
46
- * Customer-defined JSON object; keys are preserved.
47
- */
48
- type TenantRecordEncodedMetadata = {
49
- [key: string]: unknown;
50
- };
51
- /**
52
- * Persisted Tenant; id is internal, external_id is the customer's exact identity.
53
- */
54
- interface TenantRecordEncoded {
55
- id: string;
56
- external_id: string;
57
- name: string | null;
58
- /** Customer-defined JSON object; keys are preserved. */
59
- metadata: TenantRecordEncodedMetadata;
60
- created_at: string;
61
- updated_at: string;
62
- }
63
- /**
64
- * Customer-defined JSON object; keys are preserved.
65
- */
66
- type TenantUserRecordEncodedMetadata = {
67
- [key: string]: unknown;
68
- };
69
- /**
70
- * Persisted TenantUser. Stored admin does not grant or revoke signed JWT authority.
71
- */
72
- interface TenantUserRecordEncoded {
73
- id: string;
74
- external_id: string;
75
- name: string | null;
76
- /** Customer-defined JSON object; keys are preserved. */
77
- metadata: TenantUserRecordEncodedMetadata;
78
- created_at: string;
79
- updated_at: string;
80
- tenant_id: string;
81
- admin: boolean;
82
- }
83
- type CurrentUser = {
84
- scope: "tenant";
85
- organization: {
86
- id: string;
87
- };
88
- tenant: TenantRecordEncoded;
89
- user: TenantUserRecordEncoded;
90
- } | {
91
- scope: "organization";
92
- organization: {
93
- id: string;
94
- };
95
- user: {
96
- id: string;
97
- name: string;
98
- email: string;
99
- role: string;
100
- };
101
- };
102
- type ChatConfigurationCapabilities = {
103
- attachments: boolean;
104
- };
105
- interface ChatConfiguration {
106
- capabilities: ChatConfigurationCapabilities;
107
- }
108
- type ChatRunInputForwardedProps = {
109
- [key: string]: unknown;
110
- };
111
- /**
112
- * Legacy mirror of forwardedProps sent by TanStack AI clients.
113
- */
114
- type ChatRunInputData = {
115
- [key: string]: unknown;
116
- };
117
- /**
118
- * AG-UI RunAgentInput, validated by TanStack AI. Messages, tools, context, and resume entries follow AG-UI. forwardedProps accepts agentId and development-only debug. systemPrompt is rejected. Maximum request size: 32 MiB.
119
- */
120
- interface ChatRunInput {
121
- threadId: string;
122
- runId: string;
123
- messages: unknown[];
124
- tools: unknown[];
125
- context: unknown[];
126
- forwardedProps?: ChatRunInputForwardedProps;
127
- /** Legacy mirror of forwardedProps sent by TanStack AI clients. */
128
- data?: ChatRunInputData;
129
- state?: unknown;
130
- parentRunId?: string;
131
- resume?: unknown[];
132
- }
133
- interface Organization {
134
- id: string;
135
- name: string;
136
- /** Editable dashboard URL segment. Use id, not slug, as the stable identity. */
137
- slug: string;
138
- }
139
- /**
140
- * Customer-defined JSON object; keys are preserved. Defaults to {} on creation. Updates replace the entire object.
141
- */
142
- type UpdateTenantUserInputMetadata = {
143
- [key: string]: unknown;
144
- };
145
- interface UpdateTenantUserInput {
146
- /** Defaults to null on creation. Send null to clear the name. */
147
- name?: string | null;
148
- /** Customer-defined JSON object; keys are preserved. Defaults to {} on creation. Updates replace the entire object. */
149
- metadata?: UpdateTenantUserInputMetadata;
150
- /** Defaults to false on creation. Stored admin does not change signed JWT authority. */
151
- admin?: boolean;
152
- }
153
- /**
154
- * Customer-defined JSON object; keys are preserved. Defaults to {} on creation. Updates replace the entire object.
155
- */
156
- type CreateTenantUserInputMetadata = {
157
- [key: string]: unknown;
158
- };
159
- interface CreateTenantUserInput {
160
- /**
161
- * Your stable external identity. Exact and case-sensitive; whitespace is preserved. Immutable after creation.
162
- * @minLength 1
163
- * @maxLength 255
164
- */
165
- external_id: string;
166
- /** Defaults to null on creation. Send null to clear the name. */
167
- name?: string | null;
168
- /** Customer-defined JSON object; keys are preserved. Defaults to {} on creation. Updates replace the entire object. */
169
- metadata?: CreateTenantUserInputMetadata;
170
- /** Defaults to false on creation. Stored admin does not change signed JWT authority. */
171
- admin?: boolean;
172
- }
173
- /**
174
- * Live keyset page in ascending ID order within one Tenant. Pass either non-null continuation value as the same-named request parameter.
175
- */
176
- interface TenantUserPage {
177
- items: TenantUserRecordEncoded[];
178
- /** Pass as page_after to fetch the next page; null means no next page. */
179
- page_after: string | null;
180
- /** Pass as page_before to fetch the previous page; null means no previous page. */
181
- page_before: string | null;
182
- }
183
- /**
184
- * Customer-defined JSON object; keys are preserved. Defaults to {} on creation. Updates replace the entire object.
185
- */
186
- type UpdateTenantInputMetadata = {
187
- [key: string]: unknown;
188
- };
189
- interface UpdateTenantInput {
190
- /** Defaults to null on creation. Send null to clear the name. */
191
- name?: string | null;
192
- /** Customer-defined JSON object; keys are preserved. Defaults to {} on creation. Updates replace the entire object. */
193
- metadata?: UpdateTenantInputMetadata;
194
- }
195
- /**
196
- * Customer-defined JSON object; keys are preserved. Defaults to {} on creation. Updates replace the entire object.
197
- */
198
- type CreateTenantInputMetadata = {
199
- [key: string]: unknown;
200
- };
201
- interface CreateTenantInput {
202
- /**
203
- * Your stable external identity. Exact and case-sensitive; whitespace is preserved. Immutable after creation.
204
- * @minLength 1
205
- * @maxLength 255
206
- */
207
- external_id: string;
208
- /** Defaults to null on creation. Send null to clear the name. */
209
- name?: string | null;
210
- /** Customer-defined JSON object; keys are preserved. Defaults to {} on creation. Updates replace the entire object. */
211
- metadata?: CreateTenantInputMetadata;
212
- }
213
- /**
214
- * Live keyset page. Pass either non-null continuation value as the same-named request parameter.
215
- */
216
- interface TenantPage {
217
- items: TenantRecordEncoded[];
218
- /** Pass as page_after to fetch the next page; null means no next page. */
219
- page_after: string | null;
220
- /** Pass as page_before to fetch the previous page; null means no previous page. */
221
- page_before: string | null;
222
- }
223
- type ListTenantsParams = {
224
- /**
225
- * Case-insensitive literal substring of name or external_id. Trimmed, blank means no search.
226
- * @maxLength 255
227
- * @pattern ^[^\u0000]*$
228
- */
229
- q?: string;
230
- /**
231
- * Exact, case-sensitive external ID; whitespace is preserved. Returns zero or one item.
232
- * @minLength 1
233
- * @maxLength 255
234
- */
235
- "filter[external_id]"?: string;
236
- /**
237
- * Positive integer, default 20. Values above 100 are accepted and capped. page_after and page_before are mutually exclusive.
238
- * @minimum 1
239
- */
240
- page_size?: number;
241
- /**
242
- * @minLength 1
243
- * @maxLength 2048
244
- */
245
- page_after?: string;
246
- /**
247
- * @minLength 1
248
- * @maxLength 2048
249
- */
250
- page_before?: string;
251
- };
252
- type ListUsersForTenantParams = {
253
- /**
254
- * Case-insensitive literal substring of name or external_id. Trimmed, blank means no search.
255
- * @maxLength 255
256
- * @pattern ^[^\u0000]*$
257
- */
258
- q?: string;
259
- /**
260
- * Exact, case-sensitive external ID; whitespace is preserved. Returns zero or one item.
261
- * @minLength 1
262
- * @maxLength 255
263
- */
264
- "filter[external_id]"?: string;
265
- /**
266
- * Positive integer, default 20. Values above 100 are accepted and capped. page_after and page_before are mutually exclusive.
267
- * @minimum 1
268
- */
269
- page_size?: number;
270
- /**
271
- * @minLength 1
272
- * @maxLength 2048
273
- */
274
- page_after?: string;
275
- /**
276
- * @minLength 1
277
- * @maxLength 2048
278
- */
279
- page_before?: string;
280
- "filter[admin]"?: ListUsersForTenantFilterAdmin;
281
- };
282
- type ListUsersForTenantFilterAdmin = (typeof ListUsersForTenantFilterAdmin)[keyof typeof ListUsersForTenantFilterAdmin];
283
- declare const ListUsersForTenantFilterAdmin: {
284
- readonly true: "true";
285
- readonly false: "false";
286
- };
287
- type GetChatConfigParams = {
288
- agentId?: string;
289
- };
290
- type GetChatFileParams = {
291
- ticket: string;
292
- };
293
- declare const getListTenantsUrl: (params: ListTenantsParams) => string;
294
- /**
295
- * List Tenants in internal ID order. q searches name or external ID as a case-insensitive literal substring. filter[external_id] adds an exact match. Organization keys and organization-management JWTs see their organization; admin tenant JWTs see only their signed Tenant. Keep filters unchanged when reusing cursors. Live listing, not a snapshot.
296
- * @summary List Tenants
297
- */
298
- declare const listTenants: (params: ListTenantsParams, options: Parameters<typeof astralBeamApiFetch>[1]) => Promise<TenantPage>;
299
- declare const getCreateTenantUrl: () => string;
300
- /**
301
- * Create a Tenant with an exact customer-provided external_id. Requires an organization API key or organization-management JWT with a current owner/developer role. An external_id already used in this organization returns 409; creation never upserts.
302
- * @summary Create a Tenant
303
- */
304
- declare const createTenant: (createTenantInput: CreateTenantInput, options: Parameters<typeof astralBeamApiFetch>[1]) => Promise<TenantRecordEncoded>;
305
- declare const getGetTenantUrl: (id: string) => string;
306
- /**
307
- * Get a Tenant by internal UUID, not external_id.
308
- * @summary Get a Tenant
309
- */
310
- declare const getTenant: (id: string, options: Parameters<typeof astralBeamApiFetch>[1]) => Promise<TenantRecordEncoded>;
311
- declare const getUpdateTenantUrl: (id: string) => string;
312
- /**
313
- * Update supplied name/metadata fields only. Requires an organization API key or organization-management JWT with a current owner/developer role. name:null clears the name; metadata replaces the object. Last-write-wins; no upsert.
314
- * @summary Update a Tenant
315
- */
316
- declare const updateTenant: (id: string, updateTenantInput: UpdateTenantInput, options: Parameters<typeof astralBeamApiFetch>[1]) => Promise<TenantRecordEncoded>;
317
- declare const getListUsersForTenantUrl: (tenantId: string, params: ListUsersForTenantParams) => string;
318
- /**
319
- * List users of one Tenant in internal ID order. q searches name or external ID as a case-insensitive literal substring. Exact filter[external_id] and filter[admin] combine with AND. No matching user returns an empty page; missing and out-of-scope Tenants return 404. Cursors cannot be reused for another Tenant or filter. Live listing, not a snapshot.
320
- * @summary List TenantUsers
321
- */
322
- declare const listUsersForTenant: (tenantId: string, params: ListUsersForTenantParams, options: Parameters<typeof astralBeamApiFetch>[1]) => Promise<TenantUserPage>;
323
- declare const getCreateTenantUserUrl: (tenantId: string) => string;
324
- /**
325
- * Create a TenantUser under the internal tenant_id path identifier, with a customer-provided tenant-local external_id. An external_id already used in this Tenant returns 409; the same external_id in another Tenant is allowed. Stored admin does not change signed JWT authority.
326
- * @summary Create a TenantUser
327
- */
328
- declare const createTenantUser: (tenantId: string, createTenantUserInput: CreateTenantUserInput, options: Parameters<typeof astralBeamApiFetch>[1]) => Promise<TenantUserRecordEncoded>;
329
- declare const getGetTenantUserUrl: (tenantId: string, id: string) => string;
330
- /**
331
- * Get a TenantUser by the internal tenant_id and id pair within the authorized scope. No identity upsert.
332
- * @summary Get a TenantUser
333
- */
334
- declare const getTenantUser: (tenantId: string, id: string, options: Parameters<typeof astralBeamApiFetch>[1]) => Promise<TenantUserRecordEncoded>;
335
- declare const getUpdateTenantUserUrl: (tenantId: string, id: string) => string;
336
- /**
337
- * Update supplied name/metadata/admin fields only. Stored admin does not grant or revoke JWT authority. name:null clears the name; metadata replaces the object.
338
- * @summary Update a TenantUser
339
- */
340
- declare const updateTenantUser: (tenantId: string, id: string, updateTenantUserInput: UpdateTenantUserInput, options: Parameters<typeof astralBeamApiFetch>[1]) => Promise<TenantUserRecordEncoded>;
341
- declare const getGetOrganizationUrl: () => string;
342
- /**
343
- * Return the id, name, and slug of the Organization that owns the credential. Accepts an organization API key or organization-management JWT, including a viewer's. Tenant JWTs are forbidden.
344
- * @summary Get the current Organization
345
- */
346
- declare const getOrganization: (options: Parameters<typeof astralBeamApiFetch>[1]) => Promise<Organization>;
347
- declare const getRunChatUrl: () => string;
348
- /**
349
- * Stream an AG-UI agent run using a tenant user JWT. No admin claim required. HTTP failures before streaming use AstralBeamApiError. Once streaming starts, failures use RUN_ERROR events. Tool results continue in a subsequent request. Disconnecting cancels the run. Limited to 20 new turns and 200 tool-result continuations per minute per organization, tenant, and user.
350
- * @summary Run chat
351
- */
352
- declare const runChat: (chatRunInput: ChatRunInput, options: Parameters<typeof astralBeamChatFetch>[1]) => Promise<Response>;
353
- declare const getGetChatConfigUrl: (params: GetChatConfigParams) => string;
354
- /**
355
- * Read the selected agent's attachment grant using a tenant user JWT. Omit agentId to use the organization's default agent. Client settings may narrow this grant, never widen it.
356
- * @summary Get chat capabilities
357
- */
358
- declare const getChatConfig: (params: GetChatConfigParams, options: Parameters<typeof astralBeamJwtFetch>[1]) => Promise<ChatConfiguration>;
359
- declare const getGetChatFileUrl: (params: GetChatFileParams) => string;
360
- /**
361
- * Use the signed ticket returned when chat publishes an artifact. No bearer token is required. Returns the original bytes with a content-sniffed Content-Type and Content-Disposition filename. Invalid or expired tickets, a missing sandbox, and rejected artifact checks return 404. Provider or file-read failures return 500.
362
- * @summary Download a chat artifact
363
- */
364
- declare const getChatFile: (params: GetChatFileParams, options?: Parameters<typeof astralBeamFileFetch>[1]) => Promise<Response>;
365
- declare const getGetCurrentUserUrl: () => string;
366
- /**
367
- * Use a tenant JWT to upsert its own Tenant and TenantUser atomically, without requiring admin authority. Supplied names and metadata replace stored values, omitted profile fields and admin are preserved, and an explicit admin claim updates stored admin. An organization JWT returns existing user membership and the current database role without provisioning identities. API keys and cookies are not accepted. Limited to 100 requests per five minutes per identity.
368
- * @summary Get the current user
369
- */
370
- declare const getCurrentUser: (options: Parameters<typeof astralBeamJwtFetch>[1]) => Promise<CurrentUser>;
371
- //#endregion
372
- export { updateTenant as $, createTenantUser as A, getGetTenantUrl as B, TenantUserRecordEncoded as C, UpdateTenantUserInput as D, UpdateTenantInputMetadata as E, getCurrentUser as F, getRunChatUrl as G, getListTenantsUrl as H, getGetChatConfigUrl as I, getUpdateTenantUrl as J, getTenant as K, getGetChatFileUrl as L, getChatFile as M, getCreateTenantUrl as N, UpdateTenantUserInputMetadata as O, getCreateTenantUserUrl as P, runChat as Q, getGetCurrentUserUrl as R, TenantUserPage as S, UpdateTenantInput as T, getListUsersForTenantUrl as U, getGetTenantUserUrl as V, getOrganization as W, listTenants as X, getUpdateTenantUserUrl as Y, listUsersForTenant as Z, ListUsersForTenantParams as _, ChatRunInput as a, FileOptions as at, TenantRecordEncoded as b, CreateTenantInput as c, CreateTenantUserInputMetadata as d, updateTenantUser as et, CurrentUser as f, ListUsersForTenantFilterAdmin as g, ListTenantsParams as h, ChatConfigurationCapabilities as i, AstralBeamApiError$1 as it, getChatConfig as j, createTenant as k, CreateTenantInputMetadata as l, GetChatFileParams as m, AstralBeamApiErrorIssuesItem as n, ApiOptions as nt, ChatRunInputData as o, JwtOptions as ot, GetChatConfigParams as p, getTenantUser as q, ChatConfiguration as r, ApiRequestOptions as rt, ChatRunInputForwardedProps as s, isAstralBeamApiError as st, AstralBeamApiError as t, ApiKeyOptions as tt, CreateTenantUserInput as u, Organization as v, TenantUserRecordEncodedMetadata as w, TenantRecordEncodedMetadata as x, TenantPage as y, getGetOrganizationUrl as z };