@astralbeam/sdk 0.30.7 → 0.31.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 +3 -1
- package/dist/api.d.ts +1 -1
- package/dist/{badge-C5nSyoPM.js → badge-DrJv2XMn.js} +1 -1
- package/dist/client.d.ts +69 -30
- package/dist/client.js +3 -3
- package/dist/combobox--XXFCkz0.js +48 -0
- package/dist/{core-DJGoi0HX.js → core-zgbwpK1W.js} +6390 -6001
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/{index-b-MbK0XS.d.ts → index-B9CuoT8L.d.ts} +70 -25
- package/dist/{index-BVfd2Jll.d.ts → index-dhSY4OTf.d.ts} +2 -12
- package/dist/{item-D7P71wsB.js → item-YPdxEUkq.js} +1 -1
- package/dist/listings-DP55rR35.js +1 -0
- package/dist/mcp-servers-BqbIoH2g.js +1 -0
- package/dist/react.d.ts +1 -1
- package/dist/react.js +1 -1
- package/dist/server.js +9 -8
- package/dist/{styles.generated-BrC_vo9p.js → styles.generated-CWQjRXG3.js} +5 -5
- package/dist/{validate-DB08s2p8.js → validate-hedvHnsO.js} +4 -4
- package/dist/widget-W6QORKDe.js +21 -0
- package/package.json +9 -10
- package/dist/combobox-DXIOk4hb.js +0 -42
- package/dist/listings-CwKMku_E.js +0 -1
- package/dist/mcp-servers-CQTKrhfj.js +0 -1
- package/dist/widget-DoNGl4gQ.js +0 -27
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ Without npm or a bundler, import the same entry from jsDelivr in a module script
|
|
|
34
34
|
```html
|
|
35
35
|
<div id="sidebar" style="height:100dvh"></div>
|
|
36
36
|
<script type="module">
|
|
37
|
-
import { mountAstralBeamChat } from "https://cdn.jsdelivr.net/npm/@astralbeam/sdk@0.
|
|
37
|
+
import { mountAstralBeamChat } from "https://cdn.jsdelivr.net/npm/@astralbeam/sdk@0.31.0/dist/client.js"
|
|
38
38
|
|
|
39
39
|
mountAstralBeamChat(document.getElementById("sidebar"), {})
|
|
40
40
|
</script>
|
|
@@ -105,6 +105,8 @@ Download an attachment with `chat.getThreadAttachment({ threadId, fileId })`, wh
|
|
|
105
105
|
|
|
106
106
|
By default, `threadId: "auto"` restores this tab's selection after reload using session storage, scoped to the current account, API, and `placementKey ?? agentId ?? "default"`. Use distinct placement keys for independent chats with the same agent. 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 placement, 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.
|
|
107
107
|
|
|
108
|
+
Same-tab reloads and remounts can recover an unacknowledged text or uploaded-file submission for an explicit Retry. Retry reuses the original admission key within its 24-hour window. If browser session storage was unavailable or the replay window expired, check saved history before sending that input again.
|
|
109
|
+
|
|
108
110
|
## Tools and widgets
|
|
109
111
|
|
|
110
112
|
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).
|
package/dist/api.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as GetThreadAttachmentParams, $n as personalMcpAuthorizeConnection, $t as getChatConfig, A as ChatToolResultReceiptEncoded, An as getPersonalMcpSetHeadersUrl, At as TenantPage, B as CreateTenantUserInputMetadata, Bn as getTenantUserUsage, Bt as UpdateTenantInputMetadata, C as ChatRunInputForwardedProps, Cn as getOrganization, Ct as ResolveChatToolResultInputEncoded, D as ChatThreadEncoded, Dn as getPersonalMcpCreateConnectionUrl, Dt as SearchDocumentationParams, E as ChatTenantUserPage, En as getPersonalMcpCompleteAuthorizationUrl, Et as SearchChatTenantUsersParams, F as ChatUsageUsageLimitsItemScope, Fn as getSearchChatTenantUsersUrl, Ft as TenantUserRecordEncodedMetadata, G as DirectoryThreadHistoryPage, Gn as getUploadChatFileUrl, Gt as UploadChatFileBodySource, H as DeleteChatThreadParams, Hn as getUpdateChatThreadUrl, Ht as UpdateTenantUserInputMetadata, I as CreateChatThreadInputEncoded, In as getSearchDocumentationUrl, It as TenantUserUsage, J as DocumentationSearchResultsItem, Jn as listChatThreads, Jt as UploadedChatFile, K as DirectoryThreadPage, Kn as listChatMessages, Kt as UploadChatFileBodySourceType, L as CreateTenantInput, Ln as getSetChatParticipantUrl, Lt as TenantUserUsageItemsItem, M as ChatUsage, Mn as getRemoveChatParticipantUrl, Mt as TenantRecordEncodedMetadata, N as ChatUsageUsageLimitsItem, Nn as getResolveChatToolResultUrl, Nt as TenantUserPage, O as ChatThreadEncodedRole, On as getPersonalMcpDisconnectConnectionUrl, Ot as SetChatParticipantInputEncoded, P as ChatUsageUsageLimitsItemMetric, Pn as getRunChatUrl, Pt as TenantUserRecordEncoded, Q as GetThreadAttachmentDelivery, Qn as listUsersForTenant, Qt as deleteChatThread, R as CreateTenantInputMetadata, Rn as getTenant, Rt as UpdateChatThreadInputEncoded, S as ChatRunInput, Sn as getListUsersForTenantUrl, Sr as isAstralBeamApiError, St as RemoveChatParticipantParams, T as ChatTenantUserEncoded, Tn as getPersonalMcpBindBrowserUrl, Tt as ResolveChatToolResultInputEncodedResultsItemOutcome, U as DirectoryThreadEncoded, Un as getUpdateTenantUrl, Ut as UploadChatFileBody, V as CurrentUser, Vn as getThreadAttachment, Vt as UpdateTenantUserInput, W as DirectoryThreadEncodedParticipantsItem, Wn as getUpdateTenantUserUrl, Wt as UploadChatFileBodyMetadata, X as GetChatUsageParams, Xn as listThreadMessages, Xt as createTenant, Y as GetChatConfigParams, Yn as listTenants, Yt as createChatThread, Z as GetTenantUserUsageParams, Zn as listThreads, Zt as createTenantUser, _ as ChatMessageEncodedRole, _n as getListChatParticipantsUrl, _r as ApiKeyOptions, _t as PersonalMcpCreateConnectionBody, a as ChatConfigurationCapabilities, an as getCurrentUser, ar as personalMcpSetHeaders, at as ListThreadsParams, b as ChatParticipantEncodedRole, bn as getListThreadMessagesUrl, br as AstralBeamApiError, bt as PersonalMcpSetHeadersBodyHeaders, c as ChatHistoryPageEncodedMessagesItemPartsItem, cn as getGetChatThreadUrl, cr as resolveChatToolResult, ct as McpConnectionEncoded, d as ChatHistoryPageEncodedPendingInteractionsItem, dn as getGetOrganizationUrl, dr as searchDocumentation, dt as McpServerEncodedAuthKind, en as getChatThread, er as personalMcpBindBrowser, et as ListChatMessagesParams, f as ChatHistoryPageEncodedPendingInteractionsItemExecutionLocation, fn as getGetTenantUrl, fr as setChatParticipant, ft as Organization, g as ChatMessageEncodedPartsItem, gn as getListChatMessagesUrl, gr as uploadChatFile, gt as PersonalMcpCompleteAuthorizationBody, h as ChatMessageEncoded, hn as getGetThreadAttachmentUrl, hr as updateTenantUser, ht as PersonalMcpBindBrowserBody, i as ChatConfiguration, in as getCreateTenantUserUrl, ir as personalMcpGetCatalog, it as ListThreadMessagesParams, j as ChatToolResultReceiptEncodedUsageLimit, jn as getPersonalMcpTestConnectionUrl, jt as TenantRecordEncoded, k as ChatThreadPage, kn as getPersonalMcpGetCatalogUrl, kt as SetChatParticipantInputEncodedRole, l as ChatHistoryPageEncodedMessagesItemRole, ln as getGetChatUsageUrl, lr as runChat, lt as McpConnectionEncodedAuthState, m as ChatHistoryPageEncodedThreadRole, mn as getGetTenantUserUsageUrl, mr as updateTenant, mt as PersonalMcpAuthorizeConnection200Attempt, n as AstralBeamApiErrorIssuesItem, nn as getCreateChatThreadUrl, nr as personalMcpCreateConnection, nt as ListChatThreadsParams, o as ChatHistoryPageEncoded, on as getDeleteChatThreadUrl, or as personalMcpTestConnection, ot as ListUsersForTenantFilterAdmin, p as ChatHistoryPageEncodedThread, pn as getGetTenantUserUrl, pr as updateChatThread, pt as PersonalMcpAuthorizeConnection200, q as DocumentationSearch, qn as listChatParticipants, qt as UploadChatFileBodyType, r as AstralBeamApiErrorUsageLimit, rn as getCreateTenantUrl, rr as personalMcpDisconnectConnection, rt as ListTenantsParams, s as ChatHistoryPageEncodedMessagesItem, sn as getGetChatConfigUrl, sr as removeChatParticipant, st as ListUsersForTenantParams, t as AstralBeamApiError$1, tn as getChatUsage, tr as personalMcpCompleteAuthorization, tt as ListChatParticipantsParams, u as ChatHistoryPageEncodedMessagesItemState, un as getGetCurrentUserUrl, ur as searchChatTenantUsers, ut as McpServerEncoded, v as ChatMessageEncodedState, vn as getListChatThreadsUrl, vr as ApiOptions, vt as PersonalMcpGetCatalog200, w as ChatSubmissionReceiptEncoded, wn as getPersonalMcpAuthorizeConnectionUrl, wt as ResolveChatToolResultInputEncodedResultsItem, x as ChatParticipantPage, xn as getListThreadsUrl, xr as JwtOptions, xt as PersonalMcpTestConnection200, y as ChatParticipantEncoded, yn as getListTenantsUrl, yr as ApiRequestOptions, yt as PersonalMcpSetHeadersBody, z as CreateTenantUserInput, zn as getTenantUser, zt as UpdateTenantInput } from "./index-
|
|
1
|
+
import { $ as GetThreadAttachmentParams, $n as personalMcpAuthorizeConnection, $t as getChatConfig, A as ChatToolResultReceiptEncoded, An as getPersonalMcpSetHeadersUrl, At as TenantPage, B as CreateTenantUserInputMetadata, Bn as getTenantUserUsage, Bt as UpdateTenantInputMetadata, C as ChatRunInputForwardedProps, Cn as getOrganization, Ct as ResolveChatToolResultInputEncoded, D as ChatThreadEncoded, Dn as getPersonalMcpCreateConnectionUrl, Dt as SearchDocumentationParams, E as ChatTenantUserPage, En as getPersonalMcpCompleteAuthorizationUrl, Et as SearchChatTenantUsersParams, F as ChatUsageUsageLimitsItemScope, Fn as getSearchChatTenantUsersUrl, Ft as TenantUserRecordEncodedMetadata, G as DirectoryThreadHistoryPage, Gn as getUploadChatFileUrl, Gt as UploadChatFileBodySource, H as DeleteChatThreadParams, Hn as getUpdateChatThreadUrl, Ht as UpdateTenantUserInputMetadata, I as CreateChatThreadInputEncoded, In as getSearchDocumentationUrl, It as TenantUserUsage, J as DocumentationSearchResultsItem, Jn as listChatThreads, Jt as UploadedChatFile, K as DirectoryThreadPage, Kn as listChatMessages, Kt as UploadChatFileBodySourceType, L as CreateTenantInput, Ln as getSetChatParticipantUrl, Lt as TenantUserUsageItemsItem, M as ChatUsage, Mn as getRemoveChatParticipantUrl, Mt as TenantRecordEncodedMetadata, N as ChatUsageUsageLimitsItem, Nn as getResolveChatToolResultUrl, Nt as TenantUserPage, O as ChatThreadEncodedRole, On as getPersonalMcpDisconnectConnectionUrl, Ot as SetChatParticipantInputEncoded, P as ChatUsageUsageLimitsItemMetric, Pn as getRunChatUrl, Pt as TenantUserRecordEncoded, Q as GetThreadAttachmentDelivery, Qn as listUsersForTenant, Qt as deleteChatThread, R as CreateTenantInputMetadata, Rn as getTenant, Rt as UpdateChatThreadInputEncoded, S as ChatRunInput, Sn as getListUsersForTenantUrl, Sr as isAstralBeamApiError, St as RemoveChatParticipantParams, T as ChatTenantUserEncoded, Tn as getPersonalMcpBindBrowserUrl, Tt as ResolveChatToolResultInputEncodedResultsItemOutcome, U as DirectoryThreadEncoded, Un as getUpdateTenantUrl, Ut as UploadChatFileBody, V as CurrentUser, Vn as getThreadAttachment, Vt as UpdateTenantUserInput, W as DirectoryThreadEncodedParticipantsItem, Wn as getUpdateTenantUserUrl, Wt as UploadChatFileBodyMetadata, X as GetChatUsageParams, Xn as listThreadMessages, Xt as createTenant, Y as GetChatConfigParams, Yn as listTenants, Yt as createChatThread, Z as GetTenantUserUsageParams, Zn as listThreads, Zt as createTenantUser, _ as ChatMessageEncodedRole, _n as getListChatParticipantsUrl, _r as ApiKeyOptions, _t as PersonalMcpCreateConnectionBody, a as ChatConfigurationCapabilities, an as getCurrentUser, ar as personalMcpSetHeaders, at as ListThreadsParams, b as ChatParticipantEncodedRole, bn as getListThreadMessagesUrl, br as AstralBeamApiError, bt as PersonalMcpSetHeadersBodyHeaders, c as ChatHistoryPageEncodedMessagesItemPartsItem, cn as getGetChatThreadUrl, cr as resolveChatToolResult, ct as McpConnectionEncoded, d as ChatHistoryPageEncodedPendingInteractionsItem, dn as getGetOrganizationUrl, dr as searchDocumentation, dt as McpServerEncodedAuthKind, en as getChatThread, er as personalMcpBindBrowser, et as ListChatMessagesParams, f as ChatHistoryPageEncodedPendingInteractionsItemExecutionLocation, fn as getGetTenantUrl, fr as setChatParticipant, ft as Organization, g as ChatMessageEncodedPartsItem, gn as getListChatMessagesUrl, gr as uploadChatFile, gt as PersonalMcpCompleteAuthorizationBody, h as ChatMessageEncoded, hn as getGetThreadAttachmentUrl, hr as updateTenantUser, ht as PersonalMcpBindBrowserBody, i as ChatConfiguration, in as getCreateTenantUserUrl, ir as personalMcpGetCatalog, it as ListThreadMessagesParams, j as ChatToolResultReceiptEncodedUsageLimit, jn as getPersonalMcpTestConnectionUrl, jt as TenantRecordEncoded, k as ChatThreadPage, kn as getPersonalMcpGetCatalogUrl, kt as SetChatParticipantInputEncodedRole, l as ChatHistoryPageEncodedMessagesItemRole, ln as getGetChatUsageUrl, lr as runChat, lt as McpConnectionEncodedAuthState, m as ChatHistoryPageEncodedThreadRole, mn as getGetTenantUserUsageUrl, mr as updateTenant, mt as PersonalMcpAuthorizeConnection200Attempt, n as AstralBeamApiErrorIssuesItem, nn as getCreateChatThreadUrl, nr as personalMcpCreateConnection, nt as ListChatThreadsParams, o as ChatHistoryPageEncoded, on as getDeleteChatThreadUrl, or as personalMcpTestConnection, ot as ListUsersForTenantFilterAdmin, p as ChatHistoryPageEncodedThread, pn as getGetTenantUserUrl, pr as updateChatThread, pt as PersonalMcpAuthorizeConnection200, q as DocumentationSearch, qn as listChatParticipants, qt as UploadChatFileBodyType, r as AstralBeamApiErrorUsageLimit, rn as getCreateTenantUrl, rr as personalMcpDisconnectConnection, rt as ListTenantsParams, s as ChatHistoryPageEncodedMessagesItem, sn as getGetChatConfigUrl, sr as removeChatParticipant, st as ListUsersForTenantParams, t as AstralBeamApiError$1, tn as getChatUsage, tr as personalMcpCompleteAuthorization, tt as ListChatParticipantsParams, u as ChatHistoryPageEncodedMessagesItemState, un as getGetCurrentUserUrl, ur as searchChatTenantUsers, ut as McpServerEncoded, v as ChatMessageEncodedState, vn as getListChatThreadsUrl, vr as ApiOptions, vt as PersonalMcpGetCatalog200, w as ChatSubmissionReceiptEncoded, wn as getPersonalMcpAuthorizeConnectionUrl, wt as ResolveChatToolResultInputEncodedResultsItem, x as ChatParticipantPage, xn as getListThreadsUrl, xr as JwtOptions, xt as PersonalMcpTestConnection200, y as ChatParticipantEncoded, yn as getListTenantsUrl, yr as ApiRequestOptions, yt as PersonalMcpSetHeadersBody, z as CreateTenantUserInput, zn as getTenantUser, zt as UpdateTenantInput } from "./index-dhSY4OTf.js";
|
|
2
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, ChatRunInputForwardedProps, ChatSubmissionReceiptEncoded, ChatTenantUserEncoded, ChatTenantUserPage, ChatThreadEncoded, ChatThreadEncodedRole, ChatThreadPage, ChatToolResultReceiptEncoded, ChatToolResultReceiptEncodedUsageLimit, ChatUsage, ChatUsageUsageLimitsItem, ChatUsageUsageLimitsItemMetric, ChatUsageUsageLimitsItemScope, CreateChatThreadInputEncoded, CreateTenantInput, CreateTenantInputMetadata, CreateTenantUserInput, CreateTenantUserInputMetadata, CurrentUser, DeleteChatThreadParams, DirectoryThreadEncoded, DirectoryThreadEncodedParticipantsItem, DirectoryThreadHistoryPage, DirectoryThreadPage, DocumentationSearch, DocumentationSearchResultsItem, GetChatConfigParams, GetChatUsageParams, GetTenantUserUsageParams, GetThreadAttachmentDelivery, GetThreadAttachmentParams, type JwtOptions, ListChatMessagesParams, ListChatParticipantsParams, ListChatThreadsParams, ListTenantsParams, ListThreadMessagesParams, ListThreadsParams, ListUsersForTenantFilterAdmin, ListUsersForTenantParams, McpConnectionEncoded, McpConnectionEncodedAuthState, McpServerEncoded, McpServerEncodedAuthKind, Organization, PersonalMcpAuthorizeConnection200, PersonalMcpAuthorizeConnection200Attempt, PersonalMcpBindBrowserBody, PersonalMcpCompleteAuthorizationBody, PersonalMcpCreateConnectionBody, PersonalMcpGetCatalog200, PersonalMcpSetHeadersBody, PersonalMcpSetHeadersBodyHeaders, PersonalMcpTestConnection200, RemoveChatParticipantParams, ResolveChatToolResultInputEncoded, ResolveChatToolResultInputEncodedResultsItem, ResolveChatToolResultInputEncodedResultsItemOutcome, SearchChatTenantUsersParams, SearchDocumentationParams, SetChatParticipantInputEncoded, SetChatParticipantInputEncodedRole, TenantPage, TenantRecordEncoded, TenantRecordEncodedMetadata, TenantUserPage, TenantUserRecordEncoded, TenantUserRecordEncodedMetadata, TenantUserUsage, TenantUserUsageItemsItem, UpdateChatThreadInputEncoded, UpdateTenantInput, UpdateTenantInputMetadata, UpdateTenantUserInput, UpdateTenantUserInputMetadata, UploadChatFileBody, UploadChatFileBodyMetadata, UploadChatFileBodySource, UploadChatFileBodySourceType, UploadChatFileBodyType, UploadedChatFile, createChatThread, createTenant, createTenantUser, deleteChatThread, getChatConfig, getChatThread, getChatUsage, getCreateChatThreadUrl, getCreateTenantUrl, getCreateTenantUserUrl, getCurrentUser, getDeleteChatThreadUrl, getGetChatConfigUrl, getGetChatThreadUrl, getGetChatUsageUrl, getGetCurrentUserUrl, getGetOrganizationUrl, getGetTenantUrl, getGetTenantUserUrl, getGetTenantUserUsageUrl, getGetThreadAttachmentUrl, getListChatMessagesUrl, getListChatParticipantsUrl, getListChatThreadsUrl, getListTenantsUrl, getListThreadMessagesUrl, getListThreadsUrl, getListUsersForTenantUrl, getOrganization, getPersonalMcpAuthorizeConnectionUrl, getPersonalMcpBindBrowserUrl, getPersonalMcpCompleteAuthorizationUrl, getPersonalMcpCreateConnectionUrl, getPersonalMcpDisconnectConnectionUrl, getPersonalMcpGetCatalogUrl, getPersonalMcpSetHeadersUrl, getPersonalMcpTestConnectionUrl, getRemoveChatParticipantUrl, getResolveChatToolResultUrl, getRunChatUrl, getSearchChatTenantUsersUrl, getSearchDocumentationUrl, getSetChatParticipantUrl, getTenant, getTenantUser, getTenantUserUsage, getThreadAttachment, getUpdateChatThreadUrl, getUpdateTenantUrl, getUpdateTenantUserUrl, getUploadChatFileUrl, isAstralBeamApiError, listChatMessages, listChatParticipants, listChatThreads, listTenants, listThreadMessages, listThreads, listUsersForTenant, personalMcpAuthorizeConnection, personalMcpBindBrowser, personalMcpCompleteAuthorization, personalMcpCreateConnection, personalMcpDisconnectConnection, personalMcpGetCatalog, personalMcpSetHeaders, personalMcpTestConnection, removeChatParticipant, resolveChatToolResult, runChat, searchChatTenantUsers, searchDocumentation, setChatParticipant, updateChatThread, updateTenant, updateTenantUser, uploadChatFile };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Jn as e,Or as t,Yn as n,qn as r,tt as i,ur as a,wr as o}from"./styles.generated-
|
|
1
|
+
import{Jn as e,Or as t,Yn as n,qn as r,tt as i,ur as a,wr as o}from"./styles.generated-CWQjRXG3.js";t();var s=r();function c({className:t,size:n=`default`,...r}){return/* @__PURE__ */ (0,s.jsxs)(`div`,{className:e(`group/native-select relative w-fit has-[select:disabled]:opacity-50`,t),"data-slot":`native-select-wrapper`,"data-size":n,children:[/* @__PURE__ */ (0,s.jsx)(`select`,{"data-slot":`native-select`,"data-size":n,className:`h-8 w-full min-w-0 appearance-none rounded-lg border border-input bg-transparent py-1 pe-8 ps-2.5 text-sm transition-colors outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,...r}),/* @__PURE__ */ (0,s.jsx)(o,{className:`pointer-events-none absolute top-1/2 end-2.5 size-4 -translate-y-1/2 text-muted-foreground select-none`,"aria-hidden":`true`,"data-slot":`native-select-icon`})]})}function l({className:t,...n}){return/* @__PURE__ */ (0,s.jsx)(`option`,{"data-slot":`native-select-option`,className:e(`bg-[Canvas] text-[CanvasText]`,t),...n})}const u=n(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function d({className:t,variant:n=`default`,render:r,...o}){return i({defaultTagName:`span`,props:a({className:e(u({variant:n}),t)},o),render:r,state:{slot:`badge`,variant:n}})}export{c as n,l as r,d as t};
|
package/dist/client.d.ts
CHANGED
|
@@ -243,6 +243,27 @@ type InterruptBinding = (ResponseSchemaInterruptBindingBase & {
|
|
|
243
243
|
declare global {
|
|
244
244
|
var __TANSTACK_EVENT_TARGET__: EventTarget | null;
|
|
245
245
|
}
|
|
246
|
+
type AIDevtoolsEventSource = 'client' | 'server' | 'devtools';
|
|
247
|
+
type AIDevtoolsEventVisibility = 'user-visible' | 'client-state' | 'server-internal' | 'devtools-action';
|
|
248
|
+
interface AIDevtoolsEventEnvelope {
|
|
249
|
+
eventId: string;
|
|
250
|
+
eventType: string;
|
|
251
|
+
timestamp: number;
|
|
252
|
+
source: AIDevtoolsEventSource;
|
|
253
|
+
visibility: AIDevtoolsEventVisibility;
|
|
254
|
+
runtimeId?: string;
|
|
255
|
+
clientId?: string;
|
|
256
|
+
requestId?: string;
|
|
257
|
+
streamId?: string;
|
|
258
|
+
hookId?: string;
|
|
259
|
+
threadId?: string;
|
|
260
|
+
runId?: string;
|
|
261
|
+
messageId?: string;
|
|
262
|
+
toolCallId?: string;
|
|
263
|
+
sequence?: number;
|
|
264
|
+
correlationId?: string;
|
|
265
|
+
relatedEventId?: string;
|
|
266
|
+
}
|
|
246
267
|
declare global {
|
|
247
268
|
var __TANSTACK_AI_DEVTOOLS_RUNTIME_ID__: string | undefined;
|
|
248
269
|
}
|
|
@@ -3238,6 +3259,8 @@ interface TanStackMessageMetadata {
|
|
|
3238
3259
|
* stopped at the output limit, so its tool calls are not complete.
|
|
3239
3260
|
*/
|
|
3240
3261
|
finishReason?: TanStackRunMetadata['finishReason'];
|
|
3262
|
+
/** See `TanStackRunMetadata.loopStopped`. Set on the last assistant message of the run. */
|
|
3263
|
+
loopStopped?: boolean;
|
|
3241
3264
|
/**
|
|
3242
3265
|
* The provider's answer items of this assistant message, in order, for a
|
|
3243
3266
|
* same-model replay. The OpenAI Responses adapter keeps each output
|
|
@@ -3246,6 +3269,8 @@ interface TanStackMessageMetadata {
|
|
|
3246
3269
|
responseItems?: Array<{
|
|
3247
3270
|
id: string;
|
|
3248
3271
|
phase?: string;
|
|
3272
|
+
/** UTF-16 text length, retaining item boundaries when adjacent text is merged. */
|
|
3273
|
+
textLength?: number;
|
|
3249
3274
|
}>;
|
|
3250
3275
|
/**
|
|
3251
3276
|
* The model call of this assistant message sent a reasoning item. The
|
|
@@ -3307,6 +3332,14 @@ interface TanStackRunMetadata {
|
|
|
3307
3332
|
/** See `TanStackMessageMetadata.reasoningItem`. */
|
|
3308
3333
|
reasoningItem?: boolean;
|
|
3309
3334
|
finishReason?: 'stop' | 'length' | 'content_filter' | 'tool_calls' | null;
|
|
3335
|
+
/**
|
|
3336
|
+
* `true` on the last `RUN_FINISHED` of a run that the agent loop stopped
|
|
3337
|
+
* before the model was done: `agentLoopStrategy` (for example
|
|
3338
|
+
* `maxIterations`) or a middleware `onShouldContinue` returned `false`
|
|
3339
|
+
* while tool results waited for the next model call. `finishReason` stays
|
|
3340
|
+
* the reason of the last model call.
|
|
3341
|
+
*/
|
|
3342
|
+
loopStopped?: boolean;
|
|
3310
3343
|
/** TokenUsage fields that have no AG-UI `usage[]` equivalent. */
|
|
3311
3344
|
usage?: TokenUsageLeftover;
|
|
3312
3345
|
interruptErrors?: ReadonlyArray<InterruptSubmissionError>;
|
|
@@ -4096,30 +4129,6 @@ declare class ByokClient {
|
|
|
4096
4129
|
clear(provider?: ProviderId): Promise<void>;
|
|
4097
4130
|
unlock(): Promise<void>;
|
|
4098
4131
|
}
|
|
4099
|
-
type AIDevtoolsEventSource = 'client' | 'server' | 'devtools';
|
|
4100
|
-
type AIDevtoolsEventVisibility = 'user-visible' | 'client-state' | 'server-internal' | 'devtools-action';
|
|
4101
|
-
interface AIDevtoolsEventEnvelope {
|
|
4102
|
-
eventId: string;
|
|
4103
|
-
eventType: string;
|
|
4104
|
-
timestamp: number;
|
|
4105
|
-
source: AIDevtoolsEventSource;
|
|
4106
|
-
visibility: AIDevtoolsEventVisibility;
|
|
4107
|
-
runtimeId?: string;
|
|
4108
|
-
clientId?: string;
|
|
4109
|
-
requestId?: string;
|
|
4110
|
-
streamId?: string;
|
|
4111
|
-
hookId?: string;
|
|
4112
|
-
threadId?: string;
|
|
4113
|
-
runId?: string;
|
|
4114
|
-
messageId?: string;
|
|
4115
|
-
toolCallId?: string;
|
|
4116
|
-
sequence?: number;
|
|
4117
|
-
correlationId?: string;
|
|
4118
|
-
relatedEventId?: string;
|
|
4119
|
-
}
|
|
4120
|
-
declare global {
|
|
4121
|
-
var __TANSTACK_AI_DEVTOOLS_RUNTIME_ID__: string | undefined;
|
|
4122
|
-
}
|
|
4123
4132
|
interface ChatClientRunEventContext {
|
|
4124
4133
|
threadId: string;
|
|
4125
4134
|
runId: string;
|
|
@@ -5221,6 +5230,17 @@ interface ConnectConnectionAdapter {
|
|
|
5221
5230
|
* Connect and return an async iterable of StreamChunks.
|
|
5222
5231
|
*/
|
|
5223
5232
|
connect: (messages: Array<UIMessage$1> | Array<ModelMessage>, data: Record<string, any> | undefined, abortSignal: AbortSignal | undefined, runContext: RunAgentInputContext) => AsyncIterable<StreamChunk>;
|
|
5233
|
+
/**
|
|
5234
|
+
* Optional. Ask the server to cancel a run. `ChatClient.stop()` calls it
|
|
5235
|
+
* (best effort, not awaited) for the run that it stops. Other aborts, such
|
|
5236
|
+
* as an unmount, do not call it, so a durable run keeps going for them.
|
|
5237
|
+
* `fetchServerSentEvents` and `fetchHttpStream` provide it when you set
|
|
5238
|
+
* `cancelUrl`.
|
|
5239
|
+
*/
|
|
5240
|
+
cancelRun?: (run: {
|
|
5241
|
+
runId: string;
|
|
5242
|
+
threadId: string;
|
|
5243
|
+
}) => Promise<void>;
|
|
5224
5244
|
/**
|
|
5225
5245
|
* Fetch server-driven hydration for a generation `threadId`: the last
|
|
5226
5246
|
* generation's resume snapshot, plus a cursor to a run still generating if
|
|
@@ -5342,6 +5362,11 @@ interface SubscribeConnectionAdapter {
|
|
|
5342
5362
|
* Send a request; chunks arrive through subscribe().
|
|
5343
5363
|
*/
|
|
5344
5364
|
send: (messages: Array<UIMessage$1> | Array<ModelMessage>, data: Record<string, any> | undefined, abortSignal: AbortSignal | undefined, runContext: RunAgentInputContext) => Promise<void>;
|
|
5365
|
+
/** See {@link ConnectConnectionAdapter.cancelRun}. */
|
|
5366
|
+
cancelRun?: (run: {
|
|
5367
|
+
runId: string;
|
|
5368
|
+
threadId: string;
|
|
5369
|
+
}) => Promise<void>;
|
|
5345
5370
|
/**
|
|
5346
5371
|
* Re-attach to an existing run by id, replaying its stream from the start off
|
|
5347
5372
|
* the server's delivery-durability sink. Present only when the underlying
|
|
@@ -5475,10 +5500,14 @@ declare class ChatClient<TTools extends ReadonlyArray<AnyClientTool> = any, TCon
|
|
|
5475
5500
|
private readonly postStreamActions;
|
|
5476
5501
|
private readonly pendingToolExecutions;
|
|
5477
5502
|
private handingOverPendingToolCalls;
|
|
5503
|
+
private pendingLocalApprovals;
|
|
5504
|
+
private localApprovals;
|
|
5478
5505
|
private activeClientTools;
|
|
5479
5506
|
private activeContext;
|
|
5480
5507
|
private continuationPending;
|
|
5481
5508
|
private subscriptionAbortController;
|
|
5509
|
+
/** Aborts the `abortSignal` of running client tools on `stop()`. */
|
|
5510
|
+
private clientToolAbortController;
|
|
5482
5511
|
private processingResolve;
|
|
5483
5512
|
/**
|
|
5484
5513
|
* `connect()` adapters push the full HTTP body into the subscribe queue, then
|
|
@@ -5720,6 +5749,14 @@ declare class ChatClient<TTools extends ReadonlyArray<AnyClientTool> = any, TCon
|
|
|
5720
5749
|
*/
|
|
5721
5750
|
private dropTrailingInFlightAssistant;
|
|
5722
5751
|
private processIncomingChunk;
|
|
5752
|
+
/**
|
|
5753
|
+
* Show the handed-over calls that need approval as tool-approval
|
|
5754
|
+
* interrupts. Runs after observeInterruptState(), which clears the
|
|
5755
|
+
* interrupts on the RUN_FINISHED that handed the calls over.
|
|
5756
|
+
*/
|
|
5757
|
+
private raiseLocalApprovals;
|
|
5758
|
+
/** Run an approved local call, or add a denied result. */
|
|
5759
|
+
private answerLocalApproval;
|
|
5723
5760
|
private isActiveInterruptSubmissionFailure;
|
|
5724
5761
|
private resolveJoinedRun;
|
|
5725
5762
|
/**
|
|
@@ -5846,6 +5883,8 @@ declare class ChatClient<TTools extends ReadonlyArray<AnyClientTool> = any, TCon
|
|
|
5846
5883
|
* Add the result of a client-side tool execution
|
|
5847
5884
|
*/
|
|
5848
5885
|
addToolResult(result: ClientToolResult): Promise<void>;
|
|
5886
|
+
/** Run a client tool, then add its result and continue the loop. */
|
|
5887
|
+
private runClientTool;
|
|
5849
5888
|
private addToolResultForClientTool;
|
|
5850
5889
|
private validateClientToolOutput;
|
|
5851
5890
|
/**
|
|
@@ -5900,6 +5939,7 @@ declare class ChatClient<TTools extends ReadonlyArray<AnyClientTool> = any, TCon
|
|
|
5900
5939
|
* by control-flow analysis.
|
|
5901
5940
|
*/
|
|
5902
5941
|
private shouldAbortMessageQueueDrain;
|
|
5942
|
+
private hasOpenInterrupts;
|
|
5903
5943
|
/**
|
|
5904
5944
|
* Deliver queued messages after a successful settle.
|
|
5905
5945
|
* - `batch`: merge everything currently queued into one send, looping so
|
|
@@ -5992,13 +6032,9 @@ declare const McpConnectionEncodedAuthState: {
|
|
|
5992
6032
|
readonly reauthorization_required: "reauthorization_required";
|
|
5993
6033
|
};
|
|
5994
6034
|
interface McpConnectionEncoded {
|
|
5995
|
-
/** @pattern ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$ */
|
|
5996
6035
|
organization_id: string;
|
|
5997
|
-
/** @pattern ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$ */
|
|
5998
6036
|
tenant_id: string;
|
|
5999
|
-
/** @pattern ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$ */
|
|
6000
6037
|
id: string;
|
|
6001
|
-
/** @pattern ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$ */
|
|
6002
6038
|
mcp_server_id: string;
|
|
6003
6039
|
/**
|
|
6004
6040
|
* @minimum 0
|
|
@@ -6014,9 +6050,7 @@ declare const McpServerEncodedAuthKind: {
|
|
|
6014
6050
|
readonly oauth: "oauth";
|
|
6015
6051
|
};
|
|
6016
6052
|
interface McpServerEncoded {
|
|
6017
|
-
/** @pattern ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$ */
|
|
6018
6053
|
organization_id: string;
|
|
6019
|
-
/** @pattern ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$ */
|
|
6020
6054
|
id: string;
|
|
6021
6055
|
endpoint_url: string;
|
|
6022
6056
|
auth_kind: McpServerEncodedAuthKind;
|
|
@@ -6224,6 +6258,8 @@ interface ChatSubmissionCallbacks {
|
|
|
6224
6258
|
onThreadReady?: ((threadId: string) => void) | undefined;
|
|
6225
6259
|
/** Called once after the server acknowledges input, before generation finishes. */
|
|
6226
6260
|
onAccepted?: (() => void) | undefined;
|
|
6261
|
+
/** @internal Identifies only the widget's submitted draft attachments during reload recovery. */
|
|
6262
|
+
draftFileIds?: readonly string[] | undefined;
|
|
6227
6263
|
}
|
|
6228
6264
|
/**
|
|
6229
6265
|
* The transport and tool options of the drop-in widget, minus everything about its UI, plus this
|
|
@@ -6256,6 +6292,8 @@ interface ChatSubmission {
|
|
|
6256
6292
|
content: string | MultimodalContent;
|
|
6257
6293
|
phase: "submitting" | "accepted" | "failed" | "refused";
|
|
6258
6294
|
error?: Error | undefined;
|
|
6295
|
+
/** The server's replay window has closed and this delivery cannot be safely retried. */
|
|
6296
|
+
retryExpired?: true;
|
|
6259
6297
|
}
|
|
6260
6298
|
interface AstralBeamChatState {
|
|
6261
6299
|
messages: ChatClientSnapshot["messages"];
|
|
@@ -6272,6 +6310,7 @@ interface AstralBeamChatState {
|
|
|
6272
6310
|
serverToolTitles?: Readonly<Record<string, string>>;
|
|
6273
6311
|
unavailableMcpConnections?: readonly string[];
|
|
6274
6312
|
agentTools: readonly AgentToolInfo[];
|
|
6313
|
+
preparingContext: boolean;
|
|
6275
6314
|
sandboxStatus: SandboxStatus | undefined;
|
|
6276
6315
|
/** The usage limit that ended the last run, by display name, until another run starts. */
|
|
6277
6316
|
usageLimitReached: {
|
package/dist/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as e}from"./constants-C-Yp0Vhg.js";import{t}from"./debug-DLDY8CZb.js";import{t as n}from"./abort-_ZeHSwUG.js";function r(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 i(e){return e}function a(e){return e}function o(e,t){return l(e,t,`tenants`)}function s(e,t){return l(e,t,`users`)}function c(e,t){return l(e,t,`threads`)}function l(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:/* @__PURE__ */ new Set,disposed:!1},c=()=>u(s);return c(),o.addEventListener(`change`,c),d(s).catch(()=>{}),{update:e=>m(s,e),refresh:()=>p(s,!1),reset:()=>p(s,!0),unmount:()=>h(s,c)}}function u({options:e,media:t,container:n,variables:i}){r(n,i,e,t.matches)}function d(e){return e.loading??=f(e)}async function f(e){e.retryLoad?.remove();try{if(e.runtime=await import(`./listings-
|
|
1
|
+
import{s as e}from"./constants-C-Yp0Vhg.js";import{t}from"./debug-DLDY8CZb.js";import{t as n}from"./abort-_ZeHSwUG.js";function r(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 i(e){return e}function a(e){return e}function o(e,t){return l(e,t,`tenants`)}function s(e,t){return l(e,t,`users`)}function c(e,t){return l(e,t,`threads`)}function l(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:/* @__PURE__ */ new Set,disposed:!1},c=()=>u(s);return c(),o.addEventListener(`change`,c),d(s).catch(()=>{}),{update:e=>m(s,e),refresh:()=>p(s,!1),reset:()=>p(s,!0),unmount:()=>h(s,c)}}function u({options:e,media:t,container:n,variables:i}){r(n,i,e,t.matches)}function d(e){return e.loading??=f(e)}async function f(e){e.retryLoad?.remove();try{if(e.runtime=await import(`./listings-DP55rR35.js`),e.disposed)return;e.renderer=e.runtime.renderListing(e.shadow,e.container,e.options,e.kind,()=>p(e,!1))}catch(t){throw e.loading=void 0,e.disposed||(e.retryLoad=document.createElement(`button`),e.retryLoad.textContent=`Could not load directory. Retry`,e.retryLoad.onclick=()=>void d(e).catch(()=>{}),e.container.append(e.retryLoad)),t}}async function p(e,t){if(e.disposed)throw new DOMException(`Directory unmounted`,`AbortError`);e.action?.abort();let r=new AbortController;e.action=r;try{e.renderer||await n(d(e),r.signal),r.signal.throwIfAborted(),await e.runtime.refreshListing(e.renderer,r.signal,t)}finally{e.action===r&&(e.action=void 0)}}function m(e,t){if(e.disposed)return;let n={...e.options,...t};(n.apiUrl!==e.options.apiUrl||n.cacheKey!==e.options.cacheKey||n.scope!==e.options.scope||n.tenantId!==e.options.tenantId||n.tenantExternalId!==e.options.tenantExternalId)&&e.action?.abort(),e.options=n,u(e),e.renderer&&e.runtime.updateListing(e.renderer,e.options)}function h(e,t){e.disposed||(e.disposed=!0,e.action?.abort(),e.media.removeEventListener(`change`,t),e.renderer&&e.runtime.disposeListing(e.renderer),e.container.remove())}function g(t,n){let i=t.shadowRoot??t.attachShadow({mode:`open`}),a=document.createElement(`div`);a.className=e,i.append(a);let o=matchMedia(`(prefers-color-scheme: dark)`),s=/* @__PURE__ */ new Set,c=n,l=!1,u,d=()=>r(a,s,c,o.matches);d(),o.addEventListener(`change`,d);let f=async()=>{a.replaceChildren();try{let{renderMcpServers:e}=await import(`./mcp-servers-BqbIoH2g.js`);l||(u=e(a,c))}catch{if(l)return;let e=document.createElement(`button`);e.textContent=`Could not load MCP servers. Retry`,e.onclick=()=>void f(),a.replaceChildren(e)}};return f(),{update(e){l||(c={...c,...e},d(),u?.update(c))},unmount(){l=!0,o.removeEventListener(`change`,d),u?.unmount(),a.remove()}}}function _(e){if(e.chat){for(let t of[`agentId`,`threadId`,`placementKey`,`apiUrl`,`fetchAstralBeamToken`,`tools`,`debug`])if(e[t]!==void 0)throw Error(`Configure ${t} on the supplied chat session`)}}function v(n,i){_(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??`Ask a question or describe what you want to do in this app.`,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=n.shadowRoot??n.attachShadow({mode:`open`}),c=document.createElement(`div`);c.className=e,c.style.height=`100%`,s.append(c);let l=document.createElement(`div`);l.dataset.slot=`chat-loading`,l.innerHTML=`
|
|
2
2
|
<style>
|
|
3
3
|
[data-slot="chat-loading"] {
|
|
4
4
|
position: relative; display: flex; flex-direction: column; height: 100%; color-scheme: light;
|
|
@@ -39,7 +39,7 @@ import{s as e}from"./constants-C-Yp0Vhg.js";import{t}from"./debug-DLDY8CZb.js";i
|
|
|
39
39
|
}
|
|
40
40
|
@keyframes astralbeam-loading-spin { to { transform: rotate(360deg); } }
|
|
41
41
|
@media (any-pointer: coarse) {
|
|
42
|
-
[data-slot="chat-loading"] button { inset-block-start:
|
|
42
|
+
[data-slot="chat-loading"] button { inset-block-start: 12px; width: 32px; height: 32px; }
|
|
43
43
|
}
|
|
44
44
|
@media (prefers-reduced-motion: reduce) {
|
|
45
45
|
[data-slot="chat-loading-status"][data-loading]::before { animation: none; }
|
|
@@ -48,4 +48,4 @@ import{s as e}from"./constants-C-Yp0Vhg.js";import{t}from"./debug-DLDY8CZb.js";i
|
|
|
48
48
|
<header><span data-slot="chat-loading-title"></span></header>
|
|
49
49
|
<button type="button" aria-label="Close chat">×</button>
|
|
50
50
|
<div data-slot="chat-loading-status" role="status" data-loading>Loading chat…</div>
|
|
51
|
-
`,c.append(l);let u=l.querySelector(`header`),d=l.querySelector(`[data-slot="chat-loading-title"]`),f=l.querySelector(`button`),p=l.querySelector(`[role="status"]`),m=()=>{d.textContent=a.title??`AstralBeam`,u.hidden=a.showHeader===!1,f.hidden=!a.onClose};m(),f.onclick=e=>{e.detail<2&&a.onClose?.()};let h=matchMedia(`(prefers-color-scheme: dark)`),g=/* @__PURE__ */ new Set,v=()=>{let{colorScheme:e,dark:t}=r(c,g,a,h.matches);o?.(`theme`,`color scheme "${e}" resolved to ${t?`dark`:`light`}`,{themeVariables:[...g]})};v(),h.addEventListener(`change`,v);let y=!1,b;return import(`./widget-
|
|
51
|
+
`,c.append(l);let u=l.querySelector(`header`),d=l.querySelector(`[data-slot="chat-loading-title"]`),f=l.querySelector(`button`),p=l.querySelector(`[role="status"]`),m=()=>{d.textContent=a.title??`AstralBeam`,u.hidden=a.showHeader===!1,f.hidden=!a.onClose};m(),f.onclick=e=>{e.detail<2&&a.onClose?.()};let h=matchMedia(`(prefers-color-scheme: dark)`),g=/* @__PURE__ */ new Set,v=()=>{let{colorScheme:e,dark:t}=r(c,g,a,h.matches);o?.(`theme`,`color scheme "${e}" resolved to ${t?`dark`:`light`}`,{themeVariables:[...g]})};v(),h.addEventListener(`change`,v);let y=!1,b;return import(`./widget-W6QORKDe.js`).then(({renderChat:e})=>{o?.(`mount`,`chat chunk loaded`),y||(b=e(s,c,a))}).catch(()=>{y||(delete p.dataset.loading,p.textContent=`Could not load chat. Reload this page to try again.`)}),{update:e=>{let n={...a,...e};if(_(n),!!n.chat!=!!a.chat)throw Error(`Remount chat to change session ownership`);a=n,o=t(a.debug),o?.(`mount`,`options updated`,{changed:Object.keys(e)}),v(),m(),b?.update(a)},unmount:()=>{o?.(`mount`,`unmounting chat widget`),y=!0,h.removeEventListener(`change`,v),b?.dispose(),b=void 0,c.remove()}}}export{i as defineTool,a as defineWidget,v as mountAstralBeamChat,g as mountAstralBeamMcpServers,o as mountAstralBeamTenantList,s as mountAstralBeamTenantUserList,c as mountAstralBeamThreadList};
|