@astralbeam/sdk 0.16.0 → 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 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.16.0/dist/client.js"
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
- Existing token props and the default chat endpoint keep working. 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).
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
 
@@ -111,7 +111,7 @@ Conversations are saved automatically and start private. The widget searches sav
111
111
 
112
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
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's unsent text per thread stays in local storage and never sends automatically. Selected attachments remain in memory. The host owns sidebar visibility and can persist it separately in session storage.
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
115
 
116
116
  ## Tools and widgets
117
117
 
@@ -161,7 +161,7 @@ widgets: {
161
161
 
162
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.
163
163
 
164
- There is no root export. Conversations are saved on the server and can be reopened across clients.
164
+ There is no root export.
165
165
 
166
166
  | Entry point | Contents | Peer dependency |
167
167
  | ------------------------ | -------------------------------------------- | -------------------- |
@@ -58,9 +58,6 @@ function astralBeamResourceFetch(path, options) {
58
58
  function astralBeamChatFetch(path, options) {
59
59
  return apiResponse(path, options);
60
60
  }
61
- function astralBeamFileFetch(path, options = {}) {
62
- return apiResponse(path, options);
63
- }
64
61
  //#endregion
65
62
  //#region src/api/generated/api.ts
66
63
  /**
@@ -107,6 +104,16 @@ const ChatThreadEncodedRole = {
107
104
  member: "member",
108
105
  manager: "manager"
109
106
  };
107
+ const ChatUsageUsageLimitsItemScope = {
108
+ global: "global",
109
+ tenant: "tenant",
110
+ tenant_user: "tenant_user",
111
+ thread: "thread"
112
+ };
113
+ const ChatUsageUsageLimitsItemMetric = {
114
+ tokens: "tokens",
115
+ spend: "spend"
116
+ };
110
117
  const ChatMessageEncodedRole = {
111
118
  user: "user",
112
119
  assistant: "assistant",
@@ -121,6 +128,11 @@ const ListUsersForTenantFilterAdmin = {
121
128
  true: "true",
122
129
  false: "false"
123
130
  };
131
+ const UploadChatFileBodyType = {
132
+ image: "image",
133
+ document: "document"
134
+ };
135
+ const UploadChatFileBodySourceType = { data: "data" };
124
136
  const getListTenantsUrl = (params) => {
125
137
  const normalizedParams = new URLSearchParams();
126
138
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -347,6 +359,50 @@ const getThreadAttachment = (tenantId, id, messageId, partId, options) => {
347
359
  method: "GET"
348
360
  });
349
361
  };
362
+ const getUploadChatFileUrl = () => {
363
+ return `/api/v1/chat/files`;
364
+ };
365
+ /**
366
+ * Upload a file before sending a message using a synchronized tenant user JWT. The returned fileId is private to the uploader until sending attaches it to a message. Send it as source: { type: 'file', value: fileId }. Uploads do not expire. Maximum request size: 32 MiB.
367
+ * @summary Upload a chat file
368
+ */
369
+ const uploadChatFile = (uploadChatFileBody, options) => {
370
+ const getHeaders = (h) => {
371
+ if (!h) return {};
372
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
373
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
374
+ const headers = {};
375
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
376
+ return headers;
377
+ };
378
+ return astralBeamJwtFetch(getUploadChatFileUrl(), {
379
+ ...options,
380
+ method: "POST",
381
+ headers: {
382
+ "Content-Type": "application/json",
383
+ ...getHeaders(options?.headers)
384
+ },
385
+ body: JSON.stringify(uploadChatFileBody)
386
+ });
387
+ };
388
+ const getGetChatFileUrl = (params) => {
389
+ const normalizedParams = new URLSearchParams();
390
+ Object.entries(params || {}).forEach(([key, value]) => {
391
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
392
+ });
393
+ const stringifiedParams = normalizedParams.toString();
394
+ return stringifiedParams.length > 0 ? `/api/v1/chat/files?${stringifiedParams}` : `/api/v1/chat/files`;
395
+ };
396
+ /**
397
+ * Download a stored file using a tenant JWT and current conversation membership. Pass its fileId, conversation threadId, and optional download filename. Published artifacts survive sandbox shutdown. The server verifies the stored size and hash before returning content-sniffed bytes.
398
+ * @summary Download a chat artifact
399
+ */
400
+ const getChatFile = (params, options) => {
401
+ return astralBeamChatFetch(getGetChatFileUrl(params), {
402
+ ...options,
403
+ method: "GET"
404
+ });
405
+ };
350
406
  const getRunChatUrl = () => {
351
407
  return `/api/v1/chat`;
352
408
  };
@@ -391,20 +447,20 @@ const getChatConfig = (params, options) => {
391
447
  method: "GET"
392
448
  });
393
449
  };
394
- const getGetChatFileUrl = (params) => {
450
+ const getGetChatUsageUrl = (params) => {
395
451
  const normalizedParams = new URLSearchParams();
396
452
  Object.entries(params || {}).forEach(([key, value]) => {
397
453
  if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
398
454
  });
399
455
  const stringifiedParams = normalizedParams.toString();
400
- return stringifiedParams.length > 0 ? `/api/v1/chat/files?${stringifiedParams}` : `/api/v1/chat/files`;
456
+ return stringifiedParams.length > 0 ? `/api/v1/chat/usage?${stringifiedParams}` : `/api/v1/chat/usage`;
401
457
  };
402
458
  /**
403
- * 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.
404
- * @summary Download a chat artifact
459
+ * Read the usage limits that apply to the current tenant user and how much of each is used, using a tenant user JWT. Amounts and usage are decimal strings, in tokens or US dollars. resetsAt is null until usage opens a window. Pass the threadId of a conversation you participate in to include per-conversation limits.
460
+ * @summary Get usage limits
405
461
  */
406
- const getChatFile = (params, options) => {
407
- return astralBeamFileFetch(getGetChatFileUrl(params), {
462
+ const getChatUsage = (params, options) => {
463
+ return astralBeamApiFetch(getGetChatUsageUrl(params), {
408
464
  ...options,
409
465
  method: "GET"
410
466
  });
@@ -650,4 +706,4 @@ const getCurrentUser = (options) => {
650
706
  });
651
707
  };
652
708
  //#endregion
653
- export { listChatMessages as $, getGetOrganizationUrl as A, getListUsersForTenantUrl as B, getCurrentUser as C, getGetChatFileUrl as D, getGetChatConfigUrl as E, getListChatParticipantsUrl as F, getSearchChatTenantUsersUrl as G, getRemoveChatParticipantUrl as H, getListChatThreadsUrl as I, getTenantUser as J, getSetChatParticipantUrl as K, getListTenantsUrl as L, getGetTenantUserUrl as M, getGetThreadAttachmentUrl as N, getGetChatThreadUrl as O, getListChatMessagesUrl as P, getUpdateTenantUserUrl as Q, getListThreadMessagesUrl as R, getCreateTenantUserUrl as S, getGetChatAttachmentUrl as T, getResolveChatToolResultUrl as U, getOrganization as V, getRunChatUrl as W, getUpdateChatThreadUrl as X, getThreadAttachment as Y, getUpdateTenantUrl as Z, getChatConfig as _, DEFAULT_API_URL as _t, ChatMessageEncodedRole as a, listUsersForTenant as at, getCreateChatThreadUrl as b, ChatThreadEncodedRole as c, runChat as ct, SetChatParticipantInputEncodedRole as d, updateChatThread as dt, listChatParticipants as et, createChatThread as f, updateTenant as ft, getChatAttachment as g, resolveApiUrl as gt, deleteChatThread as h, isAstralBeamApiError as ht, ChatHistoryPageEncodedThreadRole as i, listThreads as it, getGetTenantUrl as j, getGetCurrentUserUrl as k, ListUsersForTenantFilterAdmin as l, searchChatTenantUsers as lt, createTenantUser as m, astralBeamChatFetch as mt, ChatHistoryPageEncodedMessagesItemState as n, listTenants as nt, ChatMessageEncodedState as o, removeChatParticipant as ot, createTenant as p, updateTenantUser as pt, getTenant as q, ChatHistoryPageEncodedPendingInteractionsItemExecutionLocation as r, listThreadMessages as rt, ChatParticipantEncodedRole as s, resolveChatToolResult as st, ChatHistoryPageEncodedMessagesItemRole as t, listChatThreads as tt, ResolveChatToolResultInputEncodedResultsItemOutcome as u, setChatParticipant as ut, getChatFile as v, DEFAULT_CHAT_AUTH_TOKEN_URL as vt, getDeleteChatThreadUrl as w, getCreateTenantUrl as x, getChatThread as y, DEFAULT_COLOR_SCHEME as yt, getListThreadsUrl as z };
709
+ export { getTenant as $, getGetChatAttachmentUrl as A, getListChatMessagesUrl as B, getChatThread as C, isAstralBeamApiError as Ct, getCreateTenantUserUrl as D, DEFAULT_COLOR_SCHEME as Dt, getCreateTenantUrl as E, DEFAULT_CHAT_AUTH_TOKEN_URL as Et, getGetCurrentUserUrl as F, getListThreadsUrl as G, getListChatThreadsUrl as H, getGetOrganizationUrl as I, getRemoveChatParticipantUrl as J, getListUsersForTenantUrl as K, getGetTenantUrl as L, getGetChatFileUrl as M, getGetChatThreadUrl as N, getCurrentUser as O, getGetChatUsageUrl as P, getSetChatParticipantUrl as Q, getGetTenantUserUrl as R, getChatFile as S, astralBeamChatFetch as St, getCreateChatThreadUrl as T, DEFAULT_API_URL as Tt, getListTenantsUrl as U, getListChatParticipantsUrl as V, getListThreadMessagesUrl as W, getRunChatUrl as X, getResolveChatToolResultUrl as Y, getSearchChatTenantUsersUrl as Z, createTenant as _, setChatParticipant as _t, ChatMessageEncodedRole as a, getUploadChatFileUrl as at, getChatAttachment as b, updateTenantUser as bt, ChatThreadEncodedRole as c, listChatThreads as ct, ListUsersForTenantFilterAdmin as d, listThreads as dt, getTenantUser as et, ResolveChatToolResultInputEncodedResultsItemOutcome as f, listUsersForTenant as ft, createChatThread as g, searchChatTenantUsers as gt, UploadChatFileBodyType as h, runChat as ht, ChatHistoryPageEncodedThreadRole as i, getUpdateTenantUserUrl as it, getGetChatConfigUrl as j, getDeleteChatThreadUrl as k, ChatUsageUsageLimitsItemMetric as l, listTenants as lt, UploadChatFileBodySourceType as m, resolveChatToolResult as mt, ChatHistoryPageEncodedMessagesItemState as n, getUpdateChatThreadUrl as nt, ChatMessageEncodedState as o, listChatMessages as ot, SetChatParticipantInputEncodedRole as p, removeChatParticipant as pt, getOrganization as q, ChatHistoryPageEncodedPendingInteractionsItemExecutionLocation as r, getUpdateTenantUrl as rt, ChatParticipantEncodedRole as s, listChatParticipants as st, ChatHistoryPageEncodedMessagesItemRole as t, getThreadAttachment as tt, ChatUsageUsageLimitsItemScope as u, listThreadMessages as ut, createTenantUser as v, updateChatThread as vt, getChatUsage as w, resolveApiUrl as wt, getChatConfig as x, uploadChatFile as xt, deleteChatThread as y, updateTenant as yt, getGetThreadAttachmentUrl as z };
package/dist/api.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as ResolveChatToolResultInputEncoded, $t as getThreadAttachment, A as CreateChatThreadInputEncoded, At as getGetChatConfigUrl, B as DirectoryThreadPage, Bt as getListChatThreadsUrl, C as ChatRunInputForwardedProps, Cn as JwtOptions, Ct as getChatThread, D as ChatThreadEncoded, Dt as getCurrentUser, E as ChatTenantUserPage, Et as getCreateTenantUserUrl, F as CurrentUser, Ft as getGetTenantUrl, G as ListChatThreadsParams, Gt as getOrganization, H as GetChatFileParams, Ht as getListThreadMessagesUrl, I as DeleteChatThreadParams, It as getGetTenantUserUrl, J as ListThreadsParams, Jt as getRunChatUrl, K as ListTenantsParams, Kt as getRemoveChatParticipantUrl, L as DirectoryThreadEncoded, Lt as getGetThreadAttachmentUrl, M as CreateTenantInputMetadata, Mt as getGetChatThreadUrl, N as CreateTenantUserInput, Nt as getGetCurrentUserUrl, O as ChatThreadEncodedRole, Ot as getDeleteChatThreadUrl, P as CreateTenantUserInputMetadata, Pt as getGetOrganizationUrl, Q as RemoveChatParticipantParams, Qt as getTenantUser, R as DirectoryThreadEncodedParticipantsItem, Rt as getListChatMessagesUrl, S as ChatRunInputData, Sn as FileOptions, St as getChatFile, T as ChatTenantUserEncoded, Tt as getCreateTenantUrl, U as ListChatMessagesParams, Ut as getListThreadsUrl, V as GetChatConfigParams, Vt as getListTenantsUrl, W as ListChatParticipantsParams, Wt as getListUsersForTenantUrl, X as ListUsersForTenantParams, Xt as getSetChatParticipantUrl, Y as ListUsersForTenantFilterAdmin, Yt as getSearchChatTenantUsersUrl, Z as Organization, Zt as getTenant, _ as ChatMessageEncodedState, _n as updateTenantUser, _t as createTenant, a as ChatHistoryPageEncoded, an as listChatThreads, at as TenantPage, b as ChatParticipantPage, bn as ApiRequestOptions, bt as getChatAttachment, c as ChatHistoryPageEncodedMessagesItemRole, cn as listThreads, ct as TenantUserPage, d as ChatHistoryPageEncodedPendingInteractionsItemExecutionLocation, dn as resolveChatToolResult, dt as UpdateChatThreadInputEncoded, en as getUpdateChatThreadUrl, et as ResolveChatToolResultInputEncodedResultsItem, f as ChatHistoryPageEncodedThread, fn as runChat, ft as UpdateTenantInput, g as ChatMessageEncodedRole, gn as updateTenant, gt as createChatThread, h as ChatMessageEncodedPartsItem, hn as updateChatThread, ht as UpdateTenantUserInputMetadata, i as ChatConfigurationCapabilities, in as listChatParticipants, it as SetChatParticipantInputEncodedRole, j as CreateTenantInput, jt as getGetChatFileUrl, k as ChatThreadPage, kt as getGetChatAttachmentUrl, l as ChatHistoryPageEncodedMessagesItemState, ln as listUsersForTenant, lt as TenantUserRecordEncoded, m as ChatMessageEncoded, mn as setChatParticipant, mt as UpdateTenantUserInput, n as AstralBeamApiErrorIssuesItem, nn as getUpdateTenantUserUrl, nt as SearchChatTenantUsersParams, o as ChatHistoryPageEncodedMessagesItem, on as listTenants, ot as TenantRecordEncoded, p as ChatHistoryPageEncodedThreadRole, pn as searchChatTenantUsers, pt as UpdateTenantInputMetadata, q as ListThreadMessagesParams, qt as getResolveChatToolResultUrl, r as ChatConfiguration, rn as listChatMessages, rt as SetChatParticipantInputEncoded, s as ChatHistoryPageEncodedMessagesItemPartsItem, sn as listThreadMessages, st as TenantRecordEncodedMetadata, t as AstralBeamApiError$1, tn as getUpdateTenantUrl, tt as ResolveChatToolResultInputEncodedResultsItemOutcome, u as ChatHistoryPageEncodedPendingInteractionsItem, un as removeChatParticipant, ut as TenantUserRecordEncodedMetadata, v as ChatParticipantEncoded, vn as ApiKeyOptions, vt as createTenantUser, w as ChatSubmissionReceiptEncoded, wn as isAstralBeamApiError, wt as getCreateChatThreadUrl, x as ChatRunInput, xn as AstralBeamApiError, xt as getChatConfig, y as ChatParticipantEncodedRole, yn as ApiOptions, yt as deleteChatThread, z as DirectoryThreadHistoryPage, zt as getListChatParticipantsUrl } from "./index-CH3RVjha.js";
2
- export { type ApiKeyOptions, type ApiOptions, type ApiRequestOptions, AstralBeamApiError, type AstralBeamApiError$1 as AstralBeamApiErrorBody, AstralBeamApiErrorIssuesItem, ChatConfiguration, ChatConfigurationCapabilities, ChatHistoryPageEncoded, ChatHistoryPageEncodedMessagesItem, ChatHistoryPageEncodedMessagesItemPartsItem, ChatHistoryPageEncodedMessagesItemRole, ChatHistoryPageEncodedMessagesItemState, ChatHistoryPageEncodedPendingInteractionsItem, ChatHistoryPageEncodedPendingInteractionsItemExecutionLocation, ChatHistoryPageEncodedThread, ChatHistoryPageEncodedThreadRole, ChatMessageEncoded, ChatMessageEncodedPartsItem, ChatMessageEncodedRole, ChatMessageEncodedState, ChatParticipantEncoded, ChatParticipantEncodedRole, ChatParticipantPage, ChatRunInput, ChatRunInputData, ChatRunInputForwardedProps, ChatSubmissionReceiptEncoded, ChatTenantUserEncoded, ChatTenantUserPage, ChatThreadEncoded, ChatThreadEncodedRole, ChatThreadPage, CreateChatThreadInputEncoded, CreateTenantInput, CreateTenantInputMetadata, CreateTenantUserInput, CreateTenantUserInputMetadata, CurrentUser, DeleteChatThreadParams, DirectoryThreadEncoded, DirectoryThreadEncodedParticipantsItem, DirectoryThreadHistoryPage, DirectoryThreadPage, type FileOptions, GetChatConfigParams, GetChatFileParams, type JwtOptions, ListChatMessagesParams, ListChatParticipantsParams, ListChatThreadsParams, ListTenantsParams, ListThreadMessagesParams, ListThreadsParams, ListUsersForTenantFilterAdmin, ListUsersForTenantParams, Organization, RemoveChatParticipantParams, ResolveChatToolResultInputEncoded, ResolveChatToolResultInputEncodedResultsItem, ResolveChatToolResultInputEncodedResultsItemOutcome, SearchChatTenantUsersParams, SetChatParticipantInputEncoded, SetChatParticipantInputEncodedRole, TenantPage, TenantRecordEncoded, TenantRecordEncodedMetadata, TenantUserPage, TenantUserRecordEncoded, TenantUserRecordEncodedMetadata, UpdateChatThreadInputEncoded, UpdateTenantInput, UpdateTenantInputMetadata, UpdateTenantUserInput, UpdateTenantUserInputMetadata, createChatThread, createTenant, createTenantUser, deleteChatThread, getChatAttachment, getChatConfig, getChatFile, getChatThread, getCreateChatThreadUrl, getCreateTenantUrl, getCreateTenantUserUrl, getCurrentUser, getDeleteChatThreadUrl, getGetChatAttachmentUrl, getGetChatConfigUrl, getGetChatFileUrl, getGetChatThreadUrl, getGetCurrentUserUrl, getGetOrganizationUrl, getGetTenantUrl, getGetTenantUserUrl, getGetThreadAttachmentUrl, getListChatMessagesUrl, getListChatParticipantsUrl, getListChatThreadsUrl, getListTenantsUrl, getListThreadMessagesUrl, getListThreadsUrl, getListUsersForTenantUrl, getOrganization, getRemoveChatParticipantUrl, getResolveChatToolResultUrl, getRunChatUrl, getSearchChatTenantUsersUrl, getSetChatParticipantUrl, getTenant, getTenantUser, getThreadAttachment, getUpdateChatThreadUrl, getUpdateTenantUrl, getUpdateTenantUserUrl, isAstralBeamApiError, listChatMessages, listChatParticipants, listChatThreads, listTenants, listThreadMessages, listThreads, listUsersForTenant, removeChatParticipant, resolveChatToolResult, runChat, searchChatTenantUsers, setChatParticipant, updateChatThread, updateTenant, updateTenantUser };
1
+ import { $ as ListChatThreadsParams, $t as getGetThreadAttachmentUrl, A as ChatThreadPage, An as searchChatTenantUsers, At as createChatThread, B as CreateTenantUserInput, Bn as JwtOptions, Bt as getCreateTenantUrl, C as ChatRunInputData, Cn as listTenants, Ct as UpdateTenantUserInputMetadata, D as ChatTenantUserPage, Dn as removeChatParticipant, Dt as UploadChatFileBodySourceType, E as ChatTenantUserEncoded, En as listUsersForTenant, Et as UploadChatFileBodySource, F as ChatUsageUsageLimitsItemMetric, Fn as uploadChatFile, Ft as getChatConfig, G as DirectoryThreadEncodedParticipantsItem, Gt as getGetChatConfigUrl, H as CurrentUser, Ht as getCurrentUser, I as ChatUsageUsageLimitsItemScope, In as ApiKeyOptions, It as getChatFile, J as GetChatConfigParams, Jt as getGetChatUsageUrl, K as DirectoryThreadHistoryPage, Kt as getGetChatFileUrl, L as CreateChatThreadInputEncoded, Ln as ApiOptions, Lt as getChatThread, M as ChatToolResultReceiptEncodedUsageLimit, Mn as updateChatThread, Mt as createTenantUser, N as ChatUsage, Nn as updateTenant, Nt as deleteChatThread, O as ChatThreadEncoded, On as resolveChatToolResult, Ot as UploadChatFileBodyType, P as ChatUsageUsageLimitsItem, Pn as updateTenantUser, Pt as getChatAttachment, Q as ListChatParticipantsParams, Qt as getGetTenantUserUrl, R as CreateTenantInput, Rn as ApiRequestOptions, Rt as getChatUsage, S as ChatRunInput, Sn as listChatThreads, St as UpdateTenantUserInput, T as ChatSubmissionReceiptEncoded, Tn as listThreads, Tt as UploadChatFileBodyMetadata, U as DeleteChatThreadParams, Ut as getDeleteChatThreadUrl, V as CreateTenantUserInputMetadata, Vn as isAstralBeamApiError, Vt as getCreateTenantUserUrl, W as DirectoryThreadEncoded, Wt as getGetChatAttachmentUrl, X as GetChatUsageParams, Xt as getGetOrganizationUrl, Y as GetChatFileParams, Yt as getGetCurrentUserUrl, Z as ListChatMessagesParams, Zt as getGetTenantUrl, _ as ChatMessageEncodedRole, _n as getUpdateTenantUrl, _t as TenantUserRecordEncoded, a as ChatConfigurationCapabilities, an as getListThreadsUrl, at as Organization, b as ChatParticipantEncodedRole, bn as listChatMessages, bt as UpdateTenantInput, c as ChatHistoryPageEncodedMessagesItemPartsItem, cn as getRemoveChatParticipantUrl, ct as ResolveChatToolResultInputEncodedResultsItem, d as ChatHistoryPageEncodedPendingInteractionsItem, dn as getSearchChatTenantUsersUrl, dt as SetChatParticipantInputEncoded, en as getListChatMessagesUrl, et as ListTenantsParams, f as ChatHistoryPageEncodedPendingInteractionsItemExecutionLocation, fn as getSetChatParticipantUrl, ft as SetChatParticipantInputEncodedRole, g as ChatMessageEncodedPartsItem, gn as getUpdateChatThreadUrl, gt as TenantUserPage, h as ChatMessageEncoded, hn as getThreadAttachment, ht as TenantRecordEncodedMetadata, i as ChatConfiguration, in as getListThreadMessagesUrl, it as ListUsersForTenantParams, j as ChatToolResultReceiptEncoded, jn as setChatParticipant, jt as createTenant, k as ChatThreadEncodedRole, kn as runChat, kt as UploadedChatFile, l as ChatHistoryPageEncodedMessagesItemRole, ln as getResolveChatToolResultUrl, lt as ResolveChatToolResultInputEncodedResultsItemOutcome, m as ChatHistoryPageEncodedThreadRole, mn as getTenantUser, mt as TenantRecordEncoded, n as AstralBeamApiErrorIssuesItem, nn as getListChatThreadsUrl, nt as ListThreadsParams, o as ChatHistoryPageEncoded, on as getListUsersForTenantUrl, ot as RemoveChatParticipantParams, p as ChatHistoryPageEncodedThread, pn as getTenant, pt as TenantPage, q as DirectoryThreadPage, qt as getGetChatThreadUrl, r as AstralBeamApiErrorUsageLimit, rn as getListTenantsUrl, rt as ListUsersForTenantFilterAdmin, s as ChatHistoryPageEncodedMessagesItem, sn as getOrganization, st as ResolveChatToolResultInputEncoded, t as AstralBeamApiError$1, tn as getListChatParticipantsUrl, tt as ListThreadMessagesParams, u as ChatHistoryPageEncodedMessagesItemState, un as getRunChatUrl, ut as SearchChatTenantUsersParams, v as ChatMessageEncodedState, vn as getUpdateTenantUserUrl, vt as TenantUserRecordEncodedMetadata, w as ChatRunInputForwardedProps, wn as listThreadMessages, wt as UploadChatFileBody, x as ChatParticipantPage, xn as listChatParticipants, xt as UpdateTenantInputMetadata, y as ChatParticipantEncoded, yn as getUploadChatFileUrl, yt as UpdateChatThreadInputEncoded, z as CreateTenantInputMetadata, zn as AstralBeamApiError, zt as getCreateChatThreadUrl } from "./index-CfGnT6Od.js";
2
+ export { type ApiKeyOptions, type ApiOptions, type ApiRequestOptions, AstralBeamApiError, type AstralBeamApiError$1 as AstralBeamApiErrorBody, AstralBeamApiErrorIssuesItem, AstralBeamApiErrorUsageLimit, ChatConfiguration, ChatConfigurationCapabilities, ChatHistoryPageEncoded, ChatHistoryPageEncodedMessagesItem, ChatHistoryPageEncodedMessagesItemPartsItem, ChatHistoryPageEncodedMessagesItemRole, ChatHistoryPageEncodedMessagesItemState, ChatHistoryPageEncodedPendingInteractionsItem, ChatHistoryPageEncodedPendingInteractionsItemExecutionLocation, ChatHistoryPageEncodedThread, ChatHistoryPageEncodedThreadRole, ChatMessageEncoded, ChatMessageEncodedPartsItem, ChatMessageEncodedRole, ChatMessageEncodedState, ChatParticipantEncoded, ChatParticipantEncodedRole, ChatParticipantPage, ChatRunInput, ChatRunInputData, ChatRunInputForwardedProps, ChatSubmissionReceiptEncoded, ChatTenantUserEncoded, ChatTenantUserPage, ChatThreadEncoded, ChatThreadEncodedRole, ChatThreadPage, ChatToolResultReceiptEncoded, ChatToolResultReceiptEncodedUsageLimit, ChatUsage, ChatUsageUsageLimitsItem, ChatUsageUsageLimitsItemMetric, ChatUsageUsageLimitsItemScope, CreateChatThreadInputEncoded, CreateTenantInput, CreateTenantInputMetadata, CreateTenantUserInput, CreateTenantUserInputMetadata, CurrentUser, DeleteChatThreadParams, DirectoryThreadEncoded, DirectoryThreadEncodedParticipantsItem, DirectoryThreadHistoryPage, DirectoryThreadPage, GetChatConfigParams, GetChatFileParams, GetChatUsageParams, type JwtOptions, ListChatMessagesParams, ListChatParticipantsParams, ListChatThreadsParams, ListTenantsParams, ListThreadMessagesParams, ListThreadsParams, ListUsersForTenantFilterAdmin, ListUsersForTenantParams, Organization, RemoveChatParticipantParams, ResolveChatToolResultInputEncoded, ResolveChatToolResultInputEncodedResultsItem, ResolveChatToolResultInputEncodedResultsItemOutcome, SearchChatTenantUsersParams, SetChatParticipantInputEncoded, SetChatParticipantInputEncodedRole, TenantPage, TenantRecordEncoded, TenantRecordEncodedMetadata, TenantUserPage, TenantUserRecordEncoded, TenantUserRecordEncodedMetadata, UpdateChatThreadInputEncoded, UpdateTenantInput, UpdateTenantInputMetadata, UpdateTenantUserInput, UpdateTenantUserInputMetadata, UploadChatFileBody, UploadChatFileBodyMetadata, UploadChatFileBodySource, UploadChatFileBodySourceType, UploadChatFileBodyType, UploadedChatFile, createChatThread, createTenant, createTenantUser, deleteChatThread, getChatAttachment, getChatConfig, getChatFile, getChatThread, getChatUsage, getCreateChatThreadUrl, getCreateTenantUrl, getCreateTenantUserUrl, getCurrentUser, getDeleteChatThreadUrl, getGetChatAttachmentUrl, getGetChatConfigUrl, getGetChatFileUrl, getGetChatThreadUrl, getGetChatUsageUrl, getGetCurrentUserUrl, getGetOrganizationUrl, getGetTenantUrl, getGetTenantUserUrl, getGetThreadAttachmentUrl, getListChatMessagesUrl, getListChatParticipantsUrl, getListChatThreadsUrl, getListTenantsUrl, getListThreadMessagesUrl, getListThreadsUrl, getListUsersForTenantUrl, getOrganization, getRemoveChatParticipantUrl, getResolveChatToolResultUrl, getRunChatUrl, getSearchChatTenantUsersUrl, getSetChatParticipantUrl, getTenant, getTenantUser, getThreadAttachment, getUpdateChatThreadUrl, getUpdateTenantUrl, getUpdateTenantUserUrl, getUploadChatFileUrl, isAstralBeamApiError, listChatMessages, listChatParticipants, listChatThreads, listTenants, listThreadMessages, listThreads, listUsersForTenant, removeChatParticipant, resolveChatToolResult, runChat, searchChatTenantUsers, setChatParticipant, updateChatThread, updateTenant, updateTenantUser, uploadChatFile };
package/dist/api.js CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as listChatMessages, A as getGetOrganizationUrl, B as getListUsersForTenantUrl, C as getCurrentUser, D as getGetChatFileUrl, E as getGetChatConfigUrl, F as getListChatParticipantsUrl, G as getSearchChatTenantUsersUrl, H as getRemoveChatParticipantUrl, I as getListChatThreadsUrl, J as getTenantUser, K as getSetChatParticipantUrl, L as getListTenantsUrl, M as getGetTenantUserUrl, N as getGetThreadAttachmentUrl, O as getGetChatThreadUrl, P as getListChatMessagesUrl, Q as getUpdateTenantUserUrl, R as getListThreadMessagesUrl, S as getCreateTenantUserUrl, T as getGetChatAttachmentUrl, U as getResolveChatToolResultUrl, V as getOrganization, W as getRunChatUrl, X as getUpdateChatThreadUrl, Y as getThreadAttachment, Z as getUpdateTenantUrl, _ as getChatConfig, a as ChatMessageEncodedRole, at as listUsersForTenant, b as getCreateChatThreadUrl, c as ChatThreadEncodedRole, ct as runChat, d as SetChatParticipantInputEncodedRole, dt as updateChatThread, et as listChatParticipants, f as createChatThread, ft as updateTenant, g as getChatAttachment, h as deleteChatThread, ht as isAstralBeamApiError, i as ChatHistoryPageEncodedThreadRole, it as listThreads, j as getGetTenantUrl, k as getGetCurrentUserUrl, l as ListUsersForTenantFilterAdmin, lt as searchChatTenantUsers, m as createTenantUser, n as ChatHistoryPageEncodedMessagesItemState, nt as listTenants, o as ChatMessageEncodedState, ot as removeChatParticipant, p as createTenant, pt as updateTenantUser, q as getTenant, r as ChatHistoryPageEncodedPendingInteractionsItemExecutionLocation, rt as listThreadMessages, s as ChatParticipantEncodedRole, st as resolveChatToolResult, t as ChatHistoryPageEncodedMessagesItemRole, tt as listChatThreads, u as ResolveChatToolResultInputEncodedResultsItemOutcome, ut as setChatParticipant, v as getChatFile, w as getDeleteChatThreadUrl, x as getCreateTenantUrl, y as getChatThread, z as getListThreadsUrl } from "./api-DzeMhfHU.js";
2
- export { ChatHistoryPageEncodedMessagesItemRole, ChatHistoryPageEncodedMessagesItemState, ChatHistoryPageEncodedPendingInteractionsItemExecutionLocation, ChatHistoryPageEncodedThreadRole, ChatMessageEncodedRole, ChatMessageEncodedState, ChatParticipantEncodedRole, ChatThreadEncodedRole, ListUsersForTenantFilterAdmin, ResolveChatToolResultInputEncodedResultsItemOutcome, SetChatParticipantInputEncodedRole, createChatThread, createTenant, createTenantUser, deleteChatThread, getChatAttachment, getChatConfig, getChatFile, getChatThread, getCreateChatThreadUrl, getCreateTenantUrl, getCreateTenantUserUrl, getCurrentUser, getDeleteChatThreadUrl, getGetChatAttachmentUrl, getGetChatConfigUrl, getGetChatFileUrl, getGetChatThreadUrl, getGetCurrentUserUrl, getGetOrganizationUrl, getGetTenantUrl, getGetTenantUserUrl, getGetThreadAttachmentUrl, getListChatMessagesUrl, getListChatParticipantsUrl, getListChatThreadsUrl, getListTenantsUrl, getListThreadMessagesUrl, getListThreadsUrl, getListUsersForTenantUrl, getOrganization, getRemoveChatParticipantUrl, getResolveChatToolResultUrl, getRunChatUrl, getSearchChatTenantUsersUrl, getSetChatParticipantUrl, getTenant, getTenantUser, getThreadAttachment, getUpdateChatThreadUrl, getUpdateTenantUrl, getUpdateTenantUserUrl, isAstralBeamApiError, listChatMessages, listChatParticipants, listChatThreads, listTenants, listThreadMessages, listThreads, listUsersForTenant, removeChatParticipant, resolveChatToolResult, runChat, searchChatTenantUsers, setChatParticipant, updateChatThread, updateTenant, updateTenantUser };
1
+ import { $ as getTenant, A as getGetChatAttachmentUrl, B as getListChatMessagesUrl, C as getChatThread, Ct as isAstralBeamApiError, D as getCreateTenantUserUrl, E as getCreateTenantUrl, F as getGetCurrentUserUrl, G as getListThreadsUrl, H as getListChatThreadsUrl, I as getGetOrganizationUrl, J as getRemoveChatParticipantUrl, K as getListUsersForTenantUrl, L as getGetTenantUrl, M as getGetChatFileUrl, N as getGetChatThreadUrl, O as getCurrentUser, P as getGetChatUsageUrl, Q as getSetChatParticipantUrl, R as getGetTenantUserUrl, S as getChatFile, T as getCreateChatThreadUrl, U as getListTenantsUrl, V as getListChatParticipantsUrl, W as getListThreadMessagesUrl, X as getRunChatUrl, Y as getResolveChatToolResultUrl, Z as getSearchChatTenantUsersUrl, _ as createTenant, _t as setChatParticipant, a as ChatMessageEncodedRole, at as getUploadChatFileUrl, b as getChatAttachment, bt as updateTenantUser, c as ChatThreadEncodedRole, ct as listChatThreads, d as ListUsersForTenantFilterAdmin, dt as listThreads, et as getTenantUser, f as ResolveChatToolResultInputEncodedResultsItemOutcome, ft as listUsersForTenant, g as createChatThread, gt as searchChatTenantUsers, h as UploadChatFileBodyType, ht as runChat, i as ChatHistoryPageEncodedThreadRole, it as getUpdateTenantUserUrl, j as getGetChatConfigUrl, k as getDeleteChatThreadUrl, l as ChatUsageUsageLimitsItemMetric, lt as listTenants, m as UploadChatFileBodySourceType, mt as resolveChatToolResult, n as ChatHistoryPageEncodedMessagesItemState, nt as getUpdateChatThreadUrl, o as ChatMessageEncodedState, ot as listChatMessages, p as SetChatParticipantInputEncodedRole, pt as removeChatParticipant, q as getOrganization, r as ChatHistoryPageEncodedPendingInteractionsItemExecutionLocation, rt as getUpdateTenantUrl, s as ChatParticipantEncodedRole, st as listChatParticipants, t as ChatHistoryPageEncodedMessagesItemRole, tt as getThreadAttachment, u as ChatUsageUsageLimitsItemScope, ut as listThreadMessages, v as createTenantUser, vt as updateChatThread, w as getChatUsage, x as getChatConfig, xt as uploadChatFile, y as deleteChatThread, yt as updateTenant, z as getGetThreadAttachmentUrl } from "./api-BaIPbj-Q.js";
2
+ export { ChatHistoryPageEncodedMessagesItemRole, ChatHistoryPageEncodedMessagesItemState, ChatHistoryPageEncodedPendingInteractionsItemExecutionLocation, ChatHistoryPageEncodedThreadRole, ChatMessageEncodedRole, ChatMessageEncodedState, ChatParticipantEncodedRole, ChatThreadEncodedRole, ChatUsageUsageLimitsItemMetric, ChatUsageUsageLimitsItemScope, ListUsersForTenantFilterAdmin, ResolveChatToolResultInputEncodedResultsItemOutcome, SetChatParticipantInputEncodedRole, UploadChatFileBodySourceType, UploadChatFileBodyType, createChatThread, createTenant, createTenantUser, deleteChatThread, getChatAttachment, getChatConfig, getChatFile, getChatThread, getChatUsage, getCreateChatThreadUrl, getCreateTenantUrl, getCreateTenantUserUrl, getCurrentUser, getDeleteChatThreadUrl, getGetChatAttachmentUrl, getGetChatConfigUrl, getGetChatFileUrl, getGetChatThreadUrl, getGetChatUsageUrl, getGetCurrentUserUrl, getGetOrganizationUrl, getGetTenantUrl, getGetTenantUserUrl, getGetThreadAttachmentUrl, getListChatMessagesUrl, getListChatParticipantsUrl, getListChatThreadsUrl, getListTenantsUrl, getListThreadMessagesUrl, getListThreadsUrl, getListUsersForTenantUrl, getOrganization, getRemoveChatParticipantUrl, getResolveChatToolResultUrl, getRunChatUrl, getSearchChatTenantUsersUrl, getSetChatParticipantUrl, getTenant, getTenantUser, getThreadAttachment, getUpdateChatThreadUrl, getUpdateTenantUrl, getUpdateTenantUserUrl, getUploadChatFileUrl, isAstralBeamApiError, listChatMessages, listChatParticipants, listChatThreads, listTenants, listThreadMessages, listThreads, listUsersForTenant, removeChatParticipant, resolveChatToolResult, runChat, searchChatTenantUsers, setChatParticipant, updateChatThread, updateTenant, updateTenantUser, uploadChatFile };
package/dist/client.js CHANGED
@@ -1 +1 @@
1
- import{s as e}from"./constants-enyqxaJi.js";import{t}from"./debug-qLts7gEt.js";function n(e,t,n,r){let i=n.colorScheme??`system`,a=i===`dark`||i===`system`&&r;e.classList.toggle(`dark`,a);for(let n of t)e.style.removeProperty(n);t.clear();let o={...n.theme?.light,...a?n.theme?.dark:void 0};for(let[n,r]of Object.entries(o))n.startsWith(`--`)&&(e.style.setProperty(n,r),t.add(n));return{colorScheme:i,dark:a}}function r(e){return e}function i(e){return e}function a(e,t){return c(e,t,`tenants`)}function o(e,t){return c(e,t,`users`)}function s(e,t){return c(e,t,`threads`)}function c(t,n,r){let i=t.shadowRoot??t.attachShadow({mode:`open`}),a=document.createElement(`div`);a.className=`${e} bg-transparent`,a.style.height=`100%`,i.append(a);let o=matchMedia(`(prefers-color-scheme: dark)`),s={options:{...n},kind:r,shadow:i,container:a,media:o,variables:new Set,disposed:!1},c=()=>l(s);return c(),o.addEventListener(`change`,c),u(s),{update:e=>d(s,e),refresh:()=>{!s.disposed&&s.renderer&&s.runtime.refreshListing(s.renderer)},reset:()=>{!s.disposed&&s.renderer&&s.runtime.resetListing(s.renderer)},unmount:()=>f(s,c)}}function l({options:e,media:t,container:r,variables:i}){n(r,i,e,t.matches)}async function u(e){e.retryLoad?.remove();try{if(e.runtime=await import(`./listings-dAoOEUGK.js`),e.disposed)return;e.renderer=e.runtime.renderListing(e.shadow,e.container,e.options,e.kind)}catch{if(e.disposed)return;e.retryLoad=document.createElement(`button`),e.retryLoad.textContent=`Could not load directory. Retry`,e.retryLoad.onclick=()=>void u(e),e.container.append(e.retryLoad)}}function d(e,t){e.disposed||(e.options={...e.options,...t},l(e),e.renderer&&e.runtime.updateListing(e.renderer,e.options))}function f(e,t){e.disposed||(e.disposed=!0,e.media.removeEventListener(`change`,t),e.renderer&&e.runtime.disposeListing(e.renderer),e.container.remove())}function p(r,i){let a={...i},o=t(a.debug);o?.(`mount`,`mounting chat widget`,{agentId:a.agentId??`(organization default)`,title:a.title??`AstralBeam`,showHeader:a.showHeader??!0,emptyHeadline:a.emptyHeadline??`Ask the assistant`,emptyDescription:a.emptyDescription??`It can answer questions and act through this app's own tools and widgets.`,apiUrl:a.apiUrl??`https://astralbeam.ai/api`,authentication:`configured`,colorScheme:a.colorScheme??`system`,theme:a.theme,tools:Object.keys(a.tools??{}),widgets:Object.keys(a.widgets??{}),attachments:a.attachments??!0});let s=r.shadowRoot??r.attachShadow({mode:`open`}),c=document.createElement(`div`);c.className=e,c.style.height=`100%`,s.append(c);let l=matchMedia(`(prefers-color-scheme: dark)`),u=new Set,d=()=>{let{colorScheme:e,dark:t}=n(c,u,a,l.matches);o?.(`theme`,`color scheme "${e}" resolved to ${t?`dark`:`light`}`,{themeVariables:[...u]})};d(),l.addEventListener(`change`,d);let f=!1,p;return import(`./widget-h5LX5aq8.js`).then(({renderChat:e})=>{o?.(`mount`,`chat chunk loaded`),f||(p=e(s,c,a))}),{update:e=>{a={...a,...e},o=t(a.debug),o?.(`mount`,`options updated`,{changed:Object.keys(e)}),d(),p?.update(a)},reset:()=>p?.reset(),stop:()=>p?.stop(),unmount:()=>{o?.(`mount`,`unmounting chat widget`),f=!0,l.removeEventListener(`change`,d),p?.dispose(),p=void 0,c.remove()}}}export{r as defineTool,i as defineWidget,p as mountAstralBeamChat,a as mountAstralBeamTenantList,o as mountAstralBeamTenantUserList,s as mountAstralBeamThreadList};
1
+ import{s as e}from"./constants-enyqxaJi.js";import{t}from"./debug-qLts7gEt.js";function n(e,t,n,r){let i=n.colorScheme??`system`,a=i===`dark`||i===`system`&&r;e.classList.toggle(`dark`,a);for(let n of t)e.style.removeProperty(n);t.clear();let o={...n.theme?.light,...a?n.theme?.dark:void 0};for(let[n,r]of Object.entries(o))n.startsWith(`--`)&&(e.style.setProperty(n,r),t.add(n));return{colorScheme:i,dark:a}}function r(e){return e}function i(e){return e}function a(e,t){return c(e,t,`tenants`)}function o(e,t){return c(e,t,`users`)}function s(e,t){return c(e,t,`threads`)}function c(t,n,r){let i=t.shadowRoot??t.attachShadow({mode:`open`}),a=document.createElement(`div`);a.className=`${e} bg-transparent`,a.style.height=`100%`,i.append(a);let o=matchMedia(`(prefers-color-scheme: dark)`),s={options:{...n},kind:r,shadow:i,container:a,media:o,variables:new Set,disposed:!1},c=()=>l(s);return c(),o.addEventListener(`change`,c),u(s),{update:e=>d(s,e),refresh:()=>{!s.disposed&&s.renderer&&s.runtime.refreshListing(s.renderer)},reset:()=>{!s.disposed&&s.renderer&&s.runtime.resetListing(s.renderer)},unmount:()=>f(s,c)}}function l({options:e,media:t,container:r,variables:i}){n(r,i,e,t.matches)}async function u(e){e.retryLoad?.remove();try{if(e.runtime=await import(`./listings-BH_hPkxx.js`),e.disposed)return;e.renderer=e.runtime.renderListing(e.shadow,e.container,e.options,e.kind)}catch{if(e.disposed)return;e.retryLoad=document.createElement(`button`),e.retryLoad.textContent=`Could not load directory. Retry`,e.retryLoad.onclick=()=>void u(e),e.container.append(e.retryLoad)}}function d(e,t){e.disposed||(e.options={...e.options,...t},l(e),e.renderer&&e.runtime.updateListing(e.renderer,e.options))}function f(e,t){e.disposed||(e.disposed=!0,e.media.removeEventListener(`change`,t),e.renderer&&e.runtime.disposeListing(e.renderer),e.container.remove())}function p(r,i){let a={...i},o=t(a.debug);o?.(`mount`,`mounting chat widget`,{agentId:a.agentId??`(organization default)`,title:a.title??`AstralBeam`,showHeader:a.showHeader??!0,emptyHeadline:a.emptyHeadline??`Ask the assistant`,emptyDescription:a.emptyDescription??`It can answer questions and act through this app's own tools and widgets.`,apiUrl:a.apiUrl??`https://astralbeam.ai/api`,authentication:`configured`,colorScheme:a.colorScheme??`system`,theme:a.theme,tools:Object.keys(a.tools??{}),widgets:Object.keys(a.widgets??{}),attachments:a.attachments??!0});let s=r.shadowRoot??r.attachShadow({mode:`open`}),c=document.createElement(`div`);c.className=e,c.style.height=`100%`,s.append(c);let l=matchMedia(`(prefers-color-scheme: dark)`),u=new Set,d=()=>{let{colorScheme:e,dark:t}=n(c,u,a,l.matches);o?.(`theme`,`color scheme "${e}" resolved to ${t?`dark`:`light`}`,{themeVariables:[...u]})};d(),l.addEventListener(`change`,d);let f=!1,p;return import(`./widget-BdiuWvPf.js`).then(({renderChat:e})=>{o?.(`mount`,`chat chunk loaded`),f||(p=e(s,c,a))}),{update:e=>{a={...a,...e},o=t(a.debug),o?.(`mount`,`options updated`,{changed:Object.keys(e)}),d(),p?.update(a)},reset:()=>p?.reset(),stop:()=>p?.stop(),unmount:()=>{o?.(`mount`,`unmounting chat widget`),f=!0,l.removeEventListener(`change`,d),p?.dispose(),p=void 0,c.remove()}}}export{r as defineTool,i as defineWidget,p as mountAstralBeamChat,a as mountAstralBeamTenantList,o as mountAstralBeamTenantUserList,s as mountAstralBeamThreadList};