@astralbeam/sdk 0.30.7 → 0.30.8
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-C-0oJPBL.js} +1 -1
- package/dist/client.d.ts +4 -0
- package/dist/client.js +3 -3
- package/dist/combobox-Dv3RPBJS.js +48 -0
- package/dist/{core-DJGoi0HX.js → core-sNbWKLab.js} +182 -46
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/{index-b-MbK0XS.d.ts → index-C9_dLp_O.d.ts} +5 -1
- package/dist/{index-BVfd2Jll.d.ts → index-Cf_9MRpM.d.ts} +2 -0
- package/dist/{item-D7P71wsB.js → item-CEtiY2lf.js} +1 -1
- package/dist/listings-BOpTUVaq.js +1 -0
- package/dist/mcp-servers-DXA0NF6Y.js +1 -0
- package/dist/react.d.ts +1 -1
- package/dist/react.js +1 -1
- package/dist/{styles.generated-BrC_vo9p.js → styles.generated-D0caROd2.js} +2 -2
- package/dist/widget-CpwYlGfb.js +21 -0
- package/package.json +1 -1
- 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.30.
|
|
37
|
+
import { mountAstralBeamChat } from "https://cdn.jsdelivr.net/npm/@astralbeam/sdk@0.30.8/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-Cf_9MRpM.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-D0caROd2.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
|
@@ -6224,6 +6224,8 @@ interface ChatSubmissionCallbacks {
|
|
|
6224
6224
|
onThreadReady?: ((threadId: string) => void) | undefined;
|
|
6225
6225
|
/** Called once after the server acknowledges input, before generation finishes. */
|
|
6226
6226
|
onAccepted?: (() => void) | undefined;
|
|
6227
|
+
/** @internal Identifies only the widget's submitted draft attachments during reload recovery. */
|
|
6228
|
+
draftFileIds?: readonly string[] | undefined;
|
|
6227
6229
|
}
|
|
6228
6230
|
/**
|
|
6229
6231
|
* The transport and tool options of the drop-in widget, minus everything about its UI, plus this
|
|
@@ -6256,6 +6258,8 @@ interface ChatSubmission {
|
|
|
6256
6258
|
content: string | MultimodalContent;
|
|
6257
6259
|
phase: "submitting" | "accepted" | "failed" | "refused";
|
|
6258
6260
|
error?: Error | undefined;
|
|
6261
|
+
/** The server's replay window has closed and this delivery cannot be safely retried. */
|
|
6262
|
+
retryExpired?: true;
|
|
6259
6263
|
}
|
|
6260
6264
|
interface AstralBeamChatState {
|
|
6261
6265
|
messages: ChatClientSnapshot["messages"];
|
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-BOpTUVaq.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-DXA0NF6Y.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-CpwYlGfb.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};
|