@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/dist/api.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { type ApiKeyOptions, type ApiOptions, type ApiRequestOptions, AstralBeamApiError, type AstralBeamApiError$1 as AstralBeamApiErrorBody, AstralBeamApiErrorIssuesItem, ChatConfiguration, ChatConfigurationCapabilities, ChatRunInput, ChatRunInputData, ChatRunInputForwardedProps, CreateTenantInput, CreateTenantInputMetadata, CreateTenantUserInput, CreateTenantUserInputMetadata, CurrentUser,
|
|
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 { C as
|
|
2
|
-
export { ListUsersForTenantFilterAdmin, createTenant, createTenantUser, getChatConfig, getChatFile, getCreateTenantUrl, getCreateTenantUserUrl, getCurrentUser, getGetChatConfigUrl, getGetChatFileUrl, getGetCurrentUserUrl, getGetOrganizationUrl, getGetTenantUrl, getGetTenantUserUrl, getListTenantsUrl, getListUsersForTenantUrl, getOrganization, getRunChatUrl, getTenant, getTenantUser, getUpdateTenantUrl, getUpdateTenantUserUrl, isAstralBeamApiError, listTenants, listUsersForTenant, runChat, 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.d.ts
CHANGED
|
@@ -87,8 +87,10 @@ interface AstralBeamChatAttachmentOptions {
|
|
|
87
87
|
type AstralBeamChatSlotRenderer = (container: HTMLElement) => (() => void) | void;
|
|
88
88
|
/** Host-rendered replacements for the widget's own chrome; each renders in the host page's style. */
|
|
89
89
|
interface AstralBeamChatSlots {
|
|
90
|
-
/** Replaces the header's
|
|
90
|
+
/** Replaces the header's title; `showHeader: false` still hides the row. */
|
|
91
91
|
header?: AstralBeamChatSlotRenderer | undefined;
|
|
92
|
+
/** Extra controls at the end of the header, after the history and new chat buttons. */
|
|
93
|
+
headerActions?: AstralBeamChatSlotRenderer | undefined;
|
|
92
94
|
/** Replaces the empty-transcript state (icon, headline, and subtitle). */
|
|
93
95
|
empty?: AstralBeamChatSlotRenderer | undefined;
|
|
94
96
|
/** Extra controls at the end of the composer's button row, next to send. */
|
|
@@ -138,19 +140,26 @@ interface AstralBeamChatTheme {
|
|
|
138
140
|
interface MountAstralBeamChatOptions {
|
|
139
141
|
/**
|
|
140
142
|
* Public ID of the organization-owned agent. Omit it to use the organization's default agent,
|
|
141
|
-
* which the dashboard's agents page selects.
|
|
142
|
-
* and
|
|
143
|
+
* which the dashboard's agents page selects. Saved conversations keep their agent,
|
|
144
|
+
* and an update applies to new threads.
|
|
143
145
|
*/
|
|
144
146
|
agentId?: string | undefined;
|
|
147
|
+
/** Defaults to `"auto"`, restoring this tab's selection. Use `"new"` for a fresh chat, or a saved thread UUID. */
|
|
148
|
+
threadId?: string | undefined;
|
|
145
149
|
/** Name shown in the widget's header. Default `"AstralBeam"`. */
|
|
146
150
|
title?: string | undefined;
|
|
147
151
|
/**
|
|
148
|
-
* Shows the widget's header, which carries the title and the
|
|
149
|
-
* and gives the transcript the full height. Default `true`.
|
|
152
|
+
* Shows the widget's header, which carries the title and the chat history and new chat buttons.
|
|
153
|
+
* `false` hides it and gives the transcript the full height. Default `true`.
|
|
150
154
|
*/
|
|
151
155
|
showHeader?: boolean | undefined;
|
|
156
|
+
/**
|
|
157
|
+
* Shows a bar under the header with the open conversation's title, once it has one, and a menu
|
|
158
|
+
* to rename, delete, or copy it as Markdown. Default `false`.
|
|
159
|
+
*/
|
|
160
|
+
showConversationTitle?: boolean | undefined;
|
|
152
161
|
/** Headline shown on the empty transcript. Default `"Ask the assistant"`. */
|
|
153
|
-
|
|
162
|
+
emptyHeadline?: string | undefined;
|
|
154
163
|
/** Subtitle shown under the empty transcript's headline. Default describes the app's tools and widgets. */
|
|
155
164
|
emptyDescription?: string | undefined;
|
|
156
165
|
/**
|
|
@@ -306,6 +315,10 @@ interface MountAstralBeamTenantUserListOptions extends AstralBeamListingOptions
|
|
|
306
315
|
showAdmin?: boolean | undefined;
|
|
307
316
|
onTenantUserSelect?: ((user: TenantUserRecordEncoded) => void) | undefined;
|
|
308
317
|
}
|
|
318
|
+
interface MountAstralBeamThreadListOptions extends AstralBeamListingOptions {
|
|
319
|
+
onTenantChange?: ((tenant: TenantRecordEncoded | null) => void) | undefined;
|
|
320
|
+
}
|
|
321
|
+
type AstralBeamThreadListHandle = AstralBeamListingHandle<MountAstralBeamThreadListOptions>;
|
|
309
322
|
interface AstralBeamListingHandle<T extends AstralBeamListingOptions = AstralBeamListingOptions> {
|
|
310
323
|
update(options: Partial<T>): void;
|
|
311
324
|
refresh(): void;
|
|
@@ -317,8 +330,9 @@ type AstralBeamTenantListHandle = AstralBeamListingHandle<MountAstralBeamTenantL
|
|
|
317
330
|
type AstralBeamTenantUserListHandle = AstralBeamListingHandle<MountAstralBeamTenantUserListOptions>;
|
|
318
331
|
declare function mountAstralBeamTenantList(target: HTMLElement, options: MountAstralBeamTenantListOptions): AstralBeamTenantListHandle;
|
|
319
332
|
declare function mountAstralBeamTenantUserList(target: HTMLElement, options: MountAstralBeamTenantUserListOptions): AstralBeamTenantUserListHandle;
|
|
333
|
+
declare function mountAstralBeamThreadList(target: HTMLElement, options: MountAstralBeamThreadListOptions): AstralBeamThreadListHandle;
|
|
320
334
|
//#endregion
|
|
321
335
|
//#region src/client/index.d.ts
|
|
322
336
|
declare function mountAstralBeamChat(target: HTMLElement, options: MountAstralBeamChatOptions): AstralBeamChatHandle;
|
|
323
337
|
//#endregion
|
|
324
|
-
export { type AstralBeamChatAttachmentOptions, type AstralBeamChatColorScheme, type AstralBeamChatHandle, type AstralBeamChatSlotRenderer, type AstralBeamChatSlots, type AstralBeamChatTheme, type AstralBeamChatThemeVariables, type AstralBeamChatUpdate, type AstralBeamListingHandle, type AstralBeamListingOptions, type AstralBeamTenantListHandle, type AstralBeamTenantUserListHandle, type AstralBeamTokenRequest, type AstralBeamTokenSource, type InferParameters, type JsonSchemaObject, type MountAstralBeamChatOptions, type MountAstralBeamTenantListOptions, type MountAstralBeamTenantUserListOptions, type ParametersSchema, type StandardSchemaV1, type ToolDefinition, type TypedToolDefinition, type TypedWidgetDefinition, type WidgetDefinition, defineTool, defineWidget, mountAstralBeamChat, mountAstralBeamTenantList, mountAstralBeamTenantUserList };
|
|
338
|
+
export { type AstralBeamChatAttachmentOptions, type AstralBeamChatColorScheme, type AstralBeamChatHandle, type AstralBeamChatSlotRenderer, type AstralBeamChatSlots, type AstralBeamChatTheme, type AstralBeamChatThemeVariables, type AstralBeamChatUpdate, type AstralBeamListingHandle, type AstralBeamListingOptions, type AstralBeamTenantListHandle, type AstralBeamTenantUserListHandle, type AstralBeamThreadListHandle, type AstralBeamTokenRequest, type AstralBeamTokenSource, type InferParameters, type JsonSchemaObject, type MountAstralBeamChatOptions, type MountAstralBeamTenantListOptions, type MountAstralBeamTenantUserListOptions, type MountAstralBeamThreadListOptions, type ParametersSchema, type StandardSchemaV1, type ToolDefinition, type TypedToolDefinition, type TypedWidgetDefinition, type WidgetDefinition, defineTool, defineWidget, mountAstralBeamChat, mountAstralBeamTenantList, mountAstralBeamTenantUserList, mountAstralBeamThreadList };
|
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
|
|
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};
|