@astralbeam/sdk 0.20.2 → 0.21.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 +9 -2
- package/dist/{api-B3UxSTtl.js → api-qmAF_i2J.js} +6 -30
- package/dist/api.d.ts +2 -2
- package/dist/api.js +1 -1
- package/dist/{badge-CCWjBUs7.js → badge-DEqUq7lR.js} +1 -1
- package/dist/client.d.ts +8 -0
- package/dist/client.js +1 -1
- package/dist/{core-D53b-MKt.js → core-BkceDZxh.js} +12 -20
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/{highlighter-Dr600J9R.js → highlighter-DofmUpLd.js} +1 -1
- package/dist/{index-DFxtXIXy.d.ts → index-Bc8nJgEh.d.ts} +8 -17
- package/dist/{index-Bgv7DalS.d.ts → index-DaTte7o4.d.ts} +10 -3
- package/dist/{item-BzAQVqAa.js → item-CtaQ4LyP.js} +1 -1
- package/dist/listings-Ce0aH6yf.js +1 -0
- package/dist/{mcp-servers-2HRu80la.js → mcp-servers-Bl0jxCiZ.js} +1 -1
- package/dist/react.d.ts +6 -2
- package/dist/react.js +14 -5
- package/dist/{styles.generated-DUb9y6Qp.js → styles.generated-3vAmuPc7.js} +1 -1
- package/dist/threads-BMixqjfd.js +25 -0
- package/dist/widget-Cvh8BS9U.js +26 -0
- package/package.json +2 -2
- package/dist/listings-BV-mV7FI.js +0 -1
- package/dist/threads-3IgJTJaY.js +0 -25
- package/dist/widget-CqoKBBPU.js +0 -26
package/README.md
CHANGED
|
@@ -29,13 +29,13 @@ Without npm or a bundler, import the same entry from jsDelivr in a module script
|
|
|
29
29
|
|
|
30
30
|
```html
|
|
31
31
|
<script type="module">
|
|
32
|
-
import { mountAstralBeamChat } from "https://cdn.jsdelivr.net/npm/@astralbeam/sdk@0.
|
|
32
|
+
import { mountAstralBeamChat } from "https://cdn.jsdelivr.net/npm/@astralbeam/sdk@0.21.0/dist/client.js"
|
|
33
33
|
|
|
34
34
|
mountAstralBeamChat(document.getElementById("sidebar"), {})
|
|
35
35
|
</script>
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
-
|
|
38
|
+
- Chat resizes horizontally and fills its parent's height. Give it a definite height (`min-h-0` in a flex column) and flexible width.
|
|
39
39
|
- Chat uses the hosted cloud by default. Tokens come from your application. For self-hosting, set `apiUrl` to your deployment’s `/api` base.
|
|
40
40
|
- `@astralbeam/sdk/client` ships no React. The chat loads as a lazy chunk with its own bundled copy.
|
|
41
41
|
- No runtime dependencies. `react` and `react-dom` are optional peers used only by `@astralbeam/sdk/react`.
|
|
@@ -96,6 +96,9 @@ Every option is also a prop on `<AstralBeamChat>`. `handle.update(options)` appl
|
|
|
96
96
|
| `fetchAstralBeamToken` | `{ url: "/api/astralbeam/token" }` | Chat auth token endpoint as `{ url, ...RequestInit }`, or a minter |
|
|
97
97
|
| `title`, `showHeader` | `"AstralBeam"`, `true` | Header text, and whether the header with its chat history and new chat buttons shows |
|
|
98
98
|
| `onClose` | none | Adds an X button and fullscreen chat at widths up to 900px. The host hides or unmounts chat in this callback |
|
|
99
|
+
| `resizable` | `true` | Enables the resize edge and keyboard resizing |
|
|
100
|
+
| `defaultWidth` | host's initial width | Width in pixels, or `"100%"` for available width, when no saved override exists |
|
|
101
|
+
| `resizeContainer` | mount's parent | `() => HTMLElement \| null` returning the stable container that limits available width |
|
|
99
102
|
| `showConversationTitle` | `false` | Bar with a titled conversation's title and a rename, delete, and Copy Markdown menu |
|
|
100
103
|
| `emptyHeadline`, `emptyDescription` | generic copy | Headline and subtitle of the empty transcript |
|
|
101
104
|
| `colorScheme`, `theme` | `"system"`, built-in palette | Light/dark/system, and shadcn token overrides |
|
|
@@ -112,6 +115,8 @@ Conversations are saved automatically and start private. The widget searches sav
|
|
|
112
115
|
|
|
113
116
|
The headless session exposes conversation navigation, search, and pagination. With `useAstralBeamChat`, access these through `chat.core`, for example `chat.core.openThread(threadId)`. History loads a page at a time. `reset()` starts a new chat and keeps the saved one.
|
|
114
117
|
|
|
118
|
+
Download an attachment with `chat.core.getThreadAttachment({ threadId, fileId })`, which returns a `Blob`. Organization and participant tenant scope come from your credentials. Administrative downloads also pass `tenantId`. Use `{ preview: true }` as the second argument for a thumbnail. Only previews of your unsent uploads may omit `threadId`.
|
|
119
|
+
|
|
115
120
|
By default, `threadId: "auto"` restores this tab's selection after reload using session storage, scoped to the current account and API. A fresh, independently opened tab starts a new chat. Use `threadId: "new"` to bypass restoration, or pass a saved thread UUID. The widget keeps unsent text and uploaded file references in local storage per account, API, and conversation. Reopening restores the draft without sending it automatically. The host owns sidebar visibility and can persist it separately in session storage.
|
|
116
121
|
|
|
117
122
|
## Tools and widgets
|
|
@@ -168,6 +173,8 @@ Reuse the dashboard's server list and form with `AstralBeamMcpServers` from `/re
|
|
|
168
173
|
|
|
169
174
|
Read-only Tenant, TenantUser and conversation widgets are available from `/client` and `/react`. See [Tenant directories](https://astralbeam.ai/docs/sdk/listings) for setup and embedding examples.
|
|
170
175
|
|
|
176
|
+
Directory results stay fresh for 30 seconds, then refresh in the background when the tab becomes visible or the network reconnects. Unused queries expire after five minutes. For reuse across mounts, keep a stable session `cacheKey`, replacing it on sign-out or account changes. Each mount still authenticates. Use `refresh()` after writes.
|
|
177
|
+
|
|
171
178
|
There is no root export.
|
|
172
179
|
|
|
173
180
|
| Entry point | Contents | Peer dependency |
|
|
@@ -357,18 +357,6 @@ const listThreadMessages = (tenantId, id, params, options) => {
|
|
|
357
357
|
method: "GET"
|
|
358
358
|
});
|
|
359
359
|
};
|
|
360
|
-
const getGetThreadAttachmentUrl = (tenantId, id, messageId, partId) => {
|
|
361
|
-
return `/api/v1/tenants/${encodeURIComponent(String(tenantId))}/threads/${encodeURIComponent(String(id))}/messages/${encodeURIComponent(String(messageId))}/attachments/${encodeURIComponent(String(partId))}`;
|
|
362
|
-
};
|
|
363
|
-
/**
|
|
364
|
-
* @summary Download a saved conversation upload for administration
|
|
365
|
-
*/
|
|
366
|
-
const getThreadAttachment = (tenantId, id, messageId, partId, options) => {
|
|
367
|
-
return astralBeamResourceFetch(getGetThreadAttachmentUrl(tenantId, id, messageId, partId), {
|
|
368
|
-
...options,
|
|
369
|
-
method: "GET"
|
|
370
|
-
});
|
|
371
|
-
};
|
|
372
360
|
const getUploadChatFileUrl = () => {
|
|
373
361
|
return `/api/v1/chat/files`;
|
|
374
362
|
};
|
|
@@ -395,7 +383,7 @@ const uploadChatFile = (uploadChatFileBody, options) => {
|
|
|
395
383
|
body: JSON.stringify(uploadChatFileBody)
|
|
396
384
|
});
|
|
397
385
|
};
|
|
398
|
-
const
|
|
386
|
+
const getGetThreadAttachmentUrl = (params) => {
|
|
399
387
|
const normalizedParams = new URLSearchParams();
|
|
400
388
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
401
389
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
@@ -404,11 +392,11 @@ const getGetChatFileUrl = (params) => {
|
|
|
404
392
|
return stringifiedParams.length > 0 ? `/api/v1/chat/files?${stringifiedParams}` : `/api/v1/chat/files`;
|
|
405
393
|
};
|
|
406
394
|
/**
|
|
407
|
-
*
|
|
408
|
-
* @summary Download a chat
|
|
395
|
+
* Pass the fileId from a saved message, its threadId, and an optional download filename. Tenant JWTs require current conversation membership. Administrative reads also pass tenantId and require directory-read permission through an Organization API key, Organization-management JWT, or signed Tenant admin JWT. Send X-File-Preview: true for a cached thumbnail, or 204 when unavailable. Only the uploader's unsent previews may omit threadId. Original downloads verify stored bytes.
|
|
396
|
+
* @summary Download a chat file
|
|
409
397
|
*/
|
|
410
|
-
const
|
|
411
|
-
return
|
|
398
|
+
const getThreadAttachment = (params, options) => {
|
|
399
|
+
return astralBeamResourceFetch(getGetThreadAttachmentUrl(params), {
|
|
412
400
|
...options,
|
|
413
401
|
method: "GET"
|
|
414
402
|
});
|
|
@@ -690,18 +678,6 @@ const resolveChatToolResult = (id, resolveChatToolResultInputEncoded, options) =
|
|
|
690
678
|
body: JSON.stringify(resolveChatToolResultInputEncoded)
|
|
691
679
|
});
|
|
692
680
|
};
|
|
693
|
-
const getGetChatAttachmentUrl = (id, messageId, partId) => {
|
|
694
|
-
return `/api/v1/chat/threads/${encodeURIComponent(String(id))}/messages/${encodeURIComponent(String(messageId))}/attachments/${encodeURIComponent(String(partId))}`;
|
|
695
|
-
};
|
|
696
|
-
/**
|
|
697
|
-
* @summary Download a saved attachment
|
|
698
|
-
*/
|
|
699
|
-
const getChatAttachment = (id, messageId, partId, options) => {
|
|
700
|
-
return astralBeamChatFetch(getGetChatAttachmentUrl(id, messageId, partId), {
|
|
701
|
-
...options,
|
|
702
|
-
method: "GET"
|
|
703
|
-
});
|
|
704
|
-
};
|
|
705
681
|
const getGetCurrentUserUrl = () => {
|
|
706
682
|
return `/api/v1/me`;
|
|
707
683
|
};
|
|
@@ -840,4 +816,4 @@ const personalMcpCompleteAuthorization = (id, personalMcpCompleteAuthorizationBo
|
|
|
840
816
|
});
|
|
841
817
|
};
|
|
842
818
|
//#endregion
|
|
843
|
-
export {
|
|
819
|
+
export { getPersonalMcpTestConnectionUrl as $, getGetChatConfigUrl as A, searchChatTenantUsers as At, getListChatThreadsUrl as B, DEFAULT_CHAT_AUTH_TOKEN_URL as Bt, getChatThread as C, personalMcpDisconnectConnection as Ct, getCreateTenantUserUrl as D, removeChatParticipant as Dt, getCreateTenantUrl as E, personalMcpTestConnection as Et, getGetTenantUrl as F, uploadChatFile as Ft, getOrganization as G, getListThreadMessagesUrl as H, getGetTenantUserUrl as I, astralBeamChatFetch as It, getPersonalMcpCompleteAuthorizationUrl as J, getPersonalMcpAuthorizeConnectionUrl as K, getGetThreadAttachmentUrl as L, isAstralBeamApiError as Lt, getGetChatUsageUrl as M, updateChatThread as Mt, getGetCurrentUserUrl as N, updateTenant as Nt, getCurrentUser as O, resolveChatToolResult as Ot, getGetOrganizationUrl as P, updateTenantUser as Pt, getPersonalMcpSetHeadersUrl as Q, getListChatMessagesUrl as R, resolveApiUrl as Rt, getChatConfig as S, personalMcpCreateConnection as St, getCreateChatThreadUrl as T, personalMcpSetHeaders as Tt, getListThreadsUrl as U, getListTenantsUrl as V, DEFAULT_COLOR_SCHEME as Vt, getListUsersForTenantUrl as W, getPersonalMcpDisconnectConnectionUrl as X, getPersonalMcpCreateConnectionUrl as Y, getPersonalMcpGetCatalogUrl as Z, UploadChatFileBodyType as _, listThreads as _t, ChatMessageEncodedRole as a, getTenant as at, createTenantUser as b, personalMcpBindBrowser as bt, ChatThreadEncodedRole as c, getUpdateChatThreadUrl as ct, ListUsersForTenantFilterAdmin as d, getUploadChatFileUrl as dt, getRemoveChatParticipantUrl as et, McpConnectionEncodedAuthState as f, listChatMessages as ft, UploadChatFileBodySourceType as g, listThreadMessages as gt, SetChatParticipantInputEncodedRole as h, listTenants as ht, ChatHistoryPageEncodedThreadRole as i, getSetChatParticipantUrl as it, getGetChatThreadUrl as j, setChatParticipant as jt, getDeleteChatThreadUrl as k, runChat as kt, ChatUsageUsageLimitsItemMetric as l, getUpdateTenantUrl as lt, ResolveChatToolResultInputEncodedResultsItemOutcome as m, listChatThreads as mt, ChatHistoryPageEncodedMessagesItemState as n, getRunChatUrl as nt, ChatMessageEncodedState as o, getTenantUser as ot, McpServerEncodedAuthKind as p, listChatParticipants as pt, getPersonalMcpBindBrowserUrl as q, ChatHistoryPageEncodedPendingInteractionsItemExecutionLocation as r, getSearchChatTenantUsersUrl as rt, ChatParticipantEncodedRole as s, getThreadAttachment as st, ChatHistoryPageEncodedMessagesItemRole as t, getResolveChatToolResultUrl as tt, ChatUsageUsageLimitsItemScope as u, getUpdateTenantUserUrl as ut, createChatThread as v, listUsersForTenant as vt, getChatUsage as w, personalMcpGetCatalog as wt, deleteChatThread as x, personalMcpCompleteAuthorization as xt, createTenant as y, personalMcpAuthorizeConnection as yt, getListChatParticipantsUrl as z, DEFAULT_API_URL as zt };
|
package/dist/api.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as ListChatThreadsParams, $n as
|
|
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,
|
|
1
|
+
import { $ as ListChatThreadsParams, $n as resolveChatToolResult, $t as getCurrentUser, A as ChatThreadPage, An as getTenant, At as TenantUserRecordEncoded, B as CreateTenantUserInput, Bn as listTenants, Bt as UploadChatFileBodySourceType, C as ChatRunInputData, Cn as getPersonalMcpSetHeadersUrl, Ct as SearchChatTenantUsersParams, D as ChatTenantUserPage, Dn as getRunChatUrl, Dt as TenantRecordEncoded, E as ChatTenantUserEncoded, En as getResolveChatToolResultUrl, Et as TenantPage, F as ChatUsageUsageLimitsItemMetric, Fn as getUpdateTenantUserUrl, Ft as UpdateTenantUserInput, G as DirectoryThreadEncodedParticipantsItem, Gn as personalMcpBindBrowser, Gt as createTenantUser, H as CurrentUser, Hn as listThreads, Ht as UploadedChatFile, I as ChatUsageUsageLimitsItemScope, In as getUploadChatFileUrl, It as UpdateTenantUserInputMetadata, J as GetChatConfigParams, Jn as personalMcpDisconnectConnection, Jt as getChatThread, K as DirectoryThreadHistoryPage, Kn as personalMcpCompleteAuthorization, Kt as deleteChatThread, L as CreateChatThreadInputEncoded, Ln as listChatMessages, Lt as UploadChatFileBody, M as ChatToolResultReceiptEncodedUsageLimit, Mn as getThreadAttachment, Mt as UpdateChatThreadInputEncoded, N as ChatUsage, Nn as getUpdateChatThreadUrl, Nt as UpdateTenantInput, O as ChatThreadEncoded, On as getSearchChatTenantUsersUrl, Ot as TenantRecordEncodedMetadata, P as ChatUsageUsageLimitsItem, Pn as getUpdateTenantUrl, Pt as UpdateTenantInputMetadata, Q as ListChatParticipantsParams, Qn as removeChatParticipant, Qt as getCreateTenantUserUrl, R as CreateTenantInput, Rn as listChatParticipants, Rt as UploadChatFileBodyMetadata, S as ChatRunInput, Sn as getPersonalMcpGetCatalogUrl, St as ResolveChatToolResultInputEncodedResultsItemOutcome, T as ChatSubmissionReceiptEncoded, Tn as getRemoveChatParticipantUrl, Tt as SetChatParticipantInputEncodedRole, U as DeleteChatThreadParams, Un as listUsersForTenant, Ut as createChatThread, V as CreateTenantUserInputMetadata, Vn as listThreadMessages, Vt as UploadChatFileBodyType, W as DirectoryThreadEncoded, Wn as personalMcpAuthorizeConnection, Wt as createTenant, X as GetThreadAttachmentParams, Xn as personalMcpSetHeaders, Xt as getCreateChatThreadUrl, Y as GetChatUsageParams, Yn as personalMcpGetCatalog, Yt as getChatUsage, Z as ListChatMessagesParams, Zn as personalMcpTestConnection, Zt as getCreateTenantUrl, _ as ChatMessageEncodedRole, _n as getPersonalMcpAuthorizeConnectionUrl, _t as PersonalMcpSetHeadersBodyHeaders, a as ChatConfigurationCapabilities, an as getGetOrganizationUrl, ar as updateTenantUser, at as McpConnectionEncoded, b as ChatParticipantEncodedRole, bn as getPersonalMcpCreateConnectionUrl, bt as ResolveChatToolResultInputEncoded, c as ChatHistoryPageEncodedMessagesItemPartsItem, cn as getGetThreadAttachmentUrl, cr as ApiOptions, ct as McpServerEncodedAuthKind, d as ChatHistoryPageEncodedPendingInteractionsItem, dn as getListChatThreadsUrl, dr as JwtOptions, dt as PersonalMcpAuthorizeConnection200Attempt, en as getDeleteChatThreadUrl, er as runChat, et as ListTenantsParams, f as ChatHistoryPageEncodedPendingInteractionsItemExecutionLocation, fn as getListTenantsUrl, fr as isAstralBeamApiError, ft as PersonalMcpBindBrowserBody, g as ChatMessageEncodedPartsItem, gn as getOrganization, gt as PersonalMcpSetHeadersBody, h as ChatMessageEncoded, hn as getListUsersForTenantUrl, ht as PersonalMcpGetCatalog200, i as ChatConfiguration, in as getGetCurrentUserUrl, ir as updateTenant, it as ListUsersForTenantParams, j as ChatToolResultReceiptEncoded, jn as getTenantUser, jt as TenantUserRecordEncodedMetadata, k as ChatThreadEncodedRole, kn as getSetChatParticipantUrl, kt as TenantUserPage, l as ChatHistoryPageEncodedMessagesItemRole, ln as getListChatMessagesUrl, lr as ApiRequestOptions, lt as Organization, m as ChatHistoryPageEncodedThreadRole, mn as getListThreadsUrl, mt as PersonalMcpCreateConnectionBody, n as AstralBeamApiErrorIssuesItem, nn as getGetChatThreadUrl, nr as setChatParticipant, nt as ListThreadsParams, o as ChatHistoryPageEncoded, on as getGetTenantUrl, or as uploadChatFile, ot as McpConnectionEncodedAuthState, p as ChatHistoryPageEncodedThread, pn as getListThreadMessagesUrl, pt as PersonalMcpCompleteAuthorizationBody, q as DirectoryThreadPage, qn as personalMcpCreateConnection, qt as getChatConfig, r as AstralBeamApiErrorUsageLimit, rn as getGetChatUsageUrl, rr as updateChatThread, rt as ListUsersForTenantFilterAdmin, s as ChatHistoryPageEncodedMessagesItem, sn as getGetTenantUserUrl, sr as ApiKeyOptions, st as McpServerEncoded, t as AstralBeamApiError$1, tn as getGetChatConfigUrl, tr as searchChatTenantUsers, tt as ListThreadMessagesParams, u as ChatHistoryPageEncodedMessagesItemState, un as getListChatParticipantsUrl, ur as AstralBeamApiError, ut as PersonalMcpAuthorizeConnection200, v as ChatMessageEncodedState, vn as getPersonalMcpBindBrowserUrl, vt as PersonalMcpTestConnection200, w as ChatRunInputForwardedProps, wn as getPersonalMcpTestConnectionUrl, wt as SetChatParticipantInputEncoded, x as ChatParticipantPage, xn as getPersonalMcpDisconnectConnectionUrl, xt as ResolveChatToolResultInputEncodedResultsItem, y as ChatParticipantEncoded, yn as getPersonalMcpCompleteAuthorizationUrl, yt as RemoveChatParticipantParams, z as CreateTenantInputMetadata, zn as listChatThreads, zt as UploadChatFileBodySource } from "./index-Bc8nJgEh.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, GetChatUsageParams, 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, SetChatParticipantInputEncoded, SetChatParticipantInputEncodedRole, TenantPage, TenantRecordEncoded, TenantRecordEncodedMetadata, TenantUserPage, TenantUserRecordEncoded, TenantUserRecordEncodedMetadata, 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, getGetThreadAttachmentUrl, getListChatMessagesUrl, getListChatParticipantsUrl, getListChatThreadsUrl, getListTenantsUrl, getListThreadMessagesUrl, getListThreadsUrl, getListUsersForTenantUrl, getOrganization, getPersonalMcpAuthorizeConnectionUrl, getPersonalMcpBindBrowserUrl, getPersonalMcpCompleteAuthorizationUrl, getPersonalMcpCreateConnectionUrl, getPersonalMcpDisconnectConnectionUrl, getPersonalMcpGetCatalogUrl, getPersonalMcpSetHeadersUrl, getPersonalMcpTestConnectionUrl, getRemoveChatParticipantUrl, getResolveChatToolResultUrl, getRunChatUrl, getSearchChatTenantUsersUrl, getSetChatParticipantUrl, getTenant, getTenantUser, 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, setChatParticipant, updateChatThread, updateTenant, updateTenantUser, uploadChatFile };
|
package/dist/api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as ChatHistoryPageEncodedMessagesItemRole, n as ChatHistoryPageEncodedMessagesItemState, r as ChatHistoryPageEncodedPendingInteractionsItemExecutionLocation, i as ChatHistoryPageEncodedThreadRole, a as ChatMessageEncodedRole, o as ChatMessageEncodedState, s as ChatParticipantEncodedRole, c as ChatThreadEncodedRole, l as ChatUsageUsageLimitsItemMetric, u as ChatUsageUsageLimitsItemScope, d as ListUsersForTenantFilterAdmin, f as McpConnectionEncodedAuthState, p as McpServerEncodedAuthKind, m as ResolveChatToolResultInputEncodedResultsItemOutcome, h as SetChatParticipantInputEncodedRole, g as UploadChatFileBodySourceType, _ as UploadChatFileBodyType, v as createChatThread, y as createTenant, b as createTenantUser, x as deleteChatThread, S as
|
|
1
|
+
export { t as ChatHistoryPageEncodedMessagesItemRole, n as ChatHistoryPageEncodedMessagesItemState, r as ChatHistoryPageEncodedPendingInteractionsItemExecutionLocation, i as ChatHistoryPageEncodedThreadRole, a as ChatMessageEncodedRole, o as ChatMessageEncodedState, s as ChatParticipantEncodedRole, c as ChatThreadEncodedRole, l as ChatUsageUsageLimitsItemMetric, u as ChatUsageUsageLimitsItemScope, d as ListUsersForTenantFilterAdmin, f as McpConnectionEncodedAuthState, p as McpServerEncodedAuthKind, m as ResolveChatToolResultInputEncodedResultsItemOutcome, h as SetChatParticipantInputEncodedRole, g as UploadChatFileBodySourceType, _ as UploadChatFileBodyType, v as createChatThread, y as createTenant, b as createTenantUser, x as deleteChatThread, S as getChatConfig, C as getChatThread, w as getChatUsage, T as getCreateChatThreadUrl, E as getCreateTenantUrl, D as getCreateTenantUserUrl, O as getCurrentUser, k as getDeleteChatThreadUrl, A as getGetChatConfigUrl, j as getGetChatThreadUrl, M as getGetChatUsageUrl, N as getGetCurrentUserUrl, P as getGetOrganizationUrl, F as getGetTenantUrl, I as getGetTenantUserUrl, L as getGetThreadAttachmentUrl, R as getListChatMessagesUrl, z as getListChatParticipantsUrl, B as getListChatThreadsUrl, V as getListTenantsUrl, H as getListThreadMessagesUrl, U as getListThreadsUrl, W as getListUsersForTenantUrl, G as getOrganization, K as getPersonalMcpAuthorizeConnectionUrl, q as getPersonalMcpBindBrowserUrl, J as getPersonalMcpCompleteAuthorizationUrl, Y as getPersonalMcpCreateConnectionUrl, X as getPersonalMcpDisconnectConnectionUrl, Z as getPersonalMcpGetCatalogUrl, Q as getPersonalMcpSetHeadersUrl, $ as getPersonalMcpTestConnectionUrl, et as getRemoveChatParticipantUrl, tt as getResolveChatToolResultUrl, nt as getRunChatUrl, rt as getSearchChatTenantUsersUrl, it as getSetChatParticipantUrl, at as getTenant, ot as getTenantUser, st as getThreadAttachment, ct as getUpdateChatThreadUrl, lt as getUpdateTenantUrl, ut as getUpdateTenantUserUrl, dt as getUploadChatFileUrl, Lt as isAstralBeamApiError, ft as listChatMessages, pt as listChatParticipants, mt as listChatThreads, ht as listTenants, gt as listThreadMessages, _t as listThreads, vt as listUsersForTenant, yt as personalMcpAuthorizeConnection, bt as personalMcpBindBrowser, xt as personalMcpCompleteAuthorization, St as personalMcpCreateConnection, Ct as personalMcpDisconnectConnection, wt as personalMcpGetCatalog, Tt as personalMcpSetHeaders, Et as personalMcpTestConnection, Dt as removeChatParticipant, Ot as resolveChatToolResult, kt as runChat, At as searchChatTenantUsers, jt as setChatParticipant, Mt as updateChatThread, Nt as updateTenant, Pt as updateTenantUser, Ft as uploadChatFile } from "./api-qmAF_i2J.js";
|
|
@@ -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-3vAmuPc7.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
|
@@ -154,6 +154,12 @@ interface MountAstralBeamChatOptions {
|
|
|
154
154
|
* `false` hides it and gives the transcript the full height. Default `true`.
|
|
155
155
|
*/
|
|
156
156
|
showHeader?: boolean | undefined;
|
|
157
|
+
/** Enables horizontal resizing. Height always fills the host. Default `true`. */
|
|
158
|
+
resizable?: boolean | undefined;
|
|
159
|
+
/** Default width in CSS pixels, or `"100%"` for available width. Saved widths take precedence. */
|
|
160
|
+
defaultWidth?: number | "100%" | undefined;
|
|
161
|
+
/** Stable available-width container for nested layouts. Defaults to the mount target's parent. */
|
|
162
|
+
resizeContainer?: (() => HTMLElement | null) | undefined;
|
|
157
163
|
/** Adds an X button and fullscreen chat at widths up to 900px. The host hides or unmounts chat in this callback. */
|
|
158
164
|
onClose?: (() => void) | undefined;
|
|
159
165
|
/**
|
|
@@ -300,6 +306,8 @@ interface AstralBeamListingCoreOptions {
|
|
|
300
306
|
//#region src/client/listings.d.ts
|
|
301
307
|
interface AstralBeamListingOptions extends AstralBeamListingCoreOptions {
|
|
302
308
|
fetchAstralBeamToken: NonNullable<AstralBeamListingCoreOptions["fetchAstralBeamToken"]>;
|
|
309
|
+
/** Stable host-session object to reuse directory data across mounts. Replace it on sign-out. */
|
|
310
|
+
cacheKey?: object | undefined;
|
|
303
311
|
pageSize?: 20 | 50 | 100 | undefined;
|
|
304
312
|
title?: string | undefined;
|
|
305
313
|
showHeader?: boolean | undefined;
|
package/dist/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./constants-C-Yp0Vhg.js";import{t}from"./debug-DLDY8CZb.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:/* @__PURE__ */ 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-
|
|
1
|
+
import{s as e}from"./constants-C-Yp0Vhg.js";import{t}from"./debug-DLDY8CZb.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:/* @__PURE__ */ 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-Ce0aH6yf.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(t,r){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=r,l=!1,u,d=()=>n(a,s,c,o.matches);d(),o.addEventListener(`change`,d);let f=async()=>{a.replaceChildren();try{let{renderMcpServers:e}=await import(`./mcp-servers-Bl0jxCiZ.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 m(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??`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=r.shadowRoot??r.attachShadow({mode:`open`}),c=document.createElement(`div`);c.className=e,c.style.height=`100%`,s.append(c);let l=document.createElement(`div`);l.style.cssText=`display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px;font:14px system-ui`;let u=document.createElement(`span`);u.setAttribute(`role`,`status`),u.textContent=`Loading chat…`;let d=document.createElement(`button`);d.type=`button`,d.textContent=`Close chat`,d.style.cssText=`min-width:44px;min-height:44px;padding:8px;font:inherit;cursor:pointer`,d.hidden=!a.onClose,d.onclick=e=>{e.detail<2&&a.onClose?.()},l.append(u,d),c.append(l);let f=matchMedia(`(prefers-color-scheme: dark)`),p=/* @__PURE__ */ new Set,m=()=>{let{colorScheme:e,dark:t}=n(c,p,a,f.matches);o?.(`theme`,`color scheme "${e}" resolved to ${t?`dark`:`light`}`,{themeVariables:[...p]})};m(),f.addEventListener(`change`,m);let h=!1,g;return import(`./widget-Cvh8BS9U.js`).then(({renderChat:e})=>{o?.(`mount`,`chat chunk loaded`),h||(g=e(s,c,a))}).catch(()=>{h||(u.textContent=`Could not load chat. Reload this page to try again.`)}),{update:e=>{a={...a,...e},o=t(a.debug),o?.(`mount`,`options updated`,{changed:Object.keys(e)}),m(),d.hidden=!a.onClose,g?.update(a)},reset:()=>g?.reset(),stop:()=>g?.stop(),unmount:()=>{o?.(`mount`,`unmounting chat widget`),h=!0,f.removeEventListener(`change`,m),g?.dispose(),g=void 0,c.remove()}}}export{r as defineTool,i as defineWidget,m as mountAstralBeamChat,p as mountAstralBeamMcpServers,a as mountAstralBeamTenantList,o as mountAstralBeamTenantUserList,s as mountAstralBeamThreadList};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ct as personalMcpDisconnectConnection, Et as personalMcpTestConnection, Ft as uploadChatFile, It as astralBeamChatFetch, Lt as isAstralBeamApiError, Mt as updateChatThread, O as getCurrentUser, Rt as resolveApiUrl, S as getChatConfig, St as personalMcpCreateConnection, Tt as personalMcpSetHeaders, bt as personalMcpBindBrowser, ft as listChatMessages, mt as listChatThreads, nt as getRunChatUrl, st as getThreadAttachment, tt as getResolveChatToolResultUrl, v as createChatThread, wt as personalMcpGetCatalog, x as deleteChatThread, xt as personalMcpCompleteAuthorization, yt as personalMcpAuthorizeConnection } from "./api-qmAF_i2J.js";
|
|
2
2
|
import { _ as strictDecoder, i as isObject, l as decode, p as JWTInvalid } from "./validate-BOw-BAyv.js";
|
|
3
3
|
//#region \0rolldown/runtime.js
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -10923,10 +10923,6 @@ function projectThreadMessages(records, pendingInteractions = [], liveToolMessag
|
|
|
10923
10923
|
const call = calls.get(savedToolCallId(message.source_assistant_message_id, message.source_tool_part_id, message.response_target_id));
|
|
10924
10924
|
if (!call) continue;
|
|
10925
10925
|
call.output = part.output ?? null;
|
|
10926
|
-
if (call.name === "sandbox_publish_artifact") {
|
|
10927
|
-
call.artifactMessageId = message.id;
|
|
10928
|
-
call.artifactPartId = String(part.id);
|
|
10929
|
-
}
|
|
10930
10926
|
Object.assign(call, { resultOutcome: part.outcome });
|
|
10931
10927
|
call.state = part.outcome === "succeeded" ? "complete" : "error";
|
|
10932
10928
|
}
|
|
@@ -10946,7 +10942,7 @@ function projectThreadMessages(records, pendingInteractions = [], liveToolMessag
|
|
|
10946
10942
|
type: "url",
|
|
10947
10943
|
value: ""
|
|
10948
10944
|
},
|
|
10949
|
-
|
|
10945
|
+
fileId: "id" in source && typeof source.id === "string" ? source.id : void 0
|
|
10950
10946
|
}];
|
|
10951
10947
|
if (part.type !== "tool-call") return [part];
|
|
10952
10948
|
if (part.executionLocation === "provider") return [part];
|
|
@@ -11520,10 +11516,11 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
11520
11516
|
onMessagesChange: (messages) => {
|
|
11521
11517
|
if (client !== next) return;
|
|
11522
11518
|
restoreCompletedWidgets(messages);
|
|
11519
|
+
const savedMessages = new Map(state.messages.map((message) => [message.id, message]));
|
|
11523
11520
|
for (const message of messages) {
|
|
11524
11521
|
if (message.role !== "user") continue;
|
|
11525
|
-
const saved =
|
|
11526
|
-
if (saved?.parts.some((part) => "
|
|
11522
|
+
const saved = savedMessages.get(message.id);
|
|
11523
|
+
if (saved?.parts.some((part) => "fileId" in part)) message.parts = saved.parts;
|
|
11527
11524
|
}
|
|
11528
11525
|
update({
|
|
11529
11526
|
messages,
|
|
@@ -12015,18 +12012,13 @@ function createAstralBeamChat(options, deferStart = false) {
|
|
|
12015
12012
|
metadata: { filename }
|
|
12016
12013
|
}, options);
|
|
12017
12014
|
},
|
|
12018
|
-
|
|
12019
|
-
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
}
|
|
12025
|
-
},
|
|
12026
|
-
getAttachment: async (messageId, partId) => {
|
|
12027
|
-
const thread = state.thread;
|
|
12028
|
-
if (!thread) throw new Error("Open a conversation before downloading attachments.");
|
|
12029
|
-
return (await getChatAttachment(thread.id, messageId, partId, await requestOptions())).blob();
|
|
12015
|
+
getThreadAttachment: async (params, options) => {
|
|
12016
|
+
if (!params.threadId && !options?.preview) throw new Error("A conversation ID is required to download files.");
|
|
12017
|
+
return (await getThreadAttachment(params, {
|
|
12018
|
+
...await requestOptions(!!params.threadId || !options?.preview),
|
|
12019
|
+
cache: "default",
|
|
12020
|
+
headers: options?.preview ? { "X-File-Preview": "true" } : {}
|
|
12021
|
+
})).blob();
|
|
12030
12022
|
},
|
|
12031
12023
|
getMcpCatalog: async () => personalMcpGetCatalog(await requestOptions(false)),
|
|
12032
12024
|
manageMcpConnection: async (operation) => {
|
package/dist/core.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as ToolDefinition, A as ChatSubmissionCallbacks, B as RenderWidgetInput, C as lastPartInProgress, D as AstralBeamChatState, E as AstralBeamChatCoreOptions, F as McpCatalog, G as SandboxStatus, H as SandboxArtifact, I as McpConnectionOperation, L as ChatAuthenticationState, M as createAstralBeamChat, N as ChatPendingInteraction, O as ChatStreamCallbacks, P as ChatThread, Q as StandardSchemaV1, R as WidgetDeclaration, S as isSettledToolCall, T as AstralBeamChatCore, U as SandboxCommandRun, V as SandboxActivity, W as SandboxFileWrite, X as JsonSchemaObject, Y as InferParameters, Z as ParametersSchema, _ as readSandboxArtifact, a as defineTool, b as sandboxRefusal, c as SANDBOX_LIST_FILES_TOOL, d as SANDBOX_RUN_COMMAND_TOOL, f as SANDBOX_STATUS_EVENT, g as isSandboxTool, h as describeSandboxCommandRun, i as WebSource, j as WidgetRenderRequest, k as ChatSubmission, l as SANDBOX_PUBLISH_ARTIFACT_TOOL, m as collectSandboxActivity, n as WebEvidence, o as ASK_QUESTIONNAIRE_TOOL, p as SANDBOX_WRITE_FILE_TOOL, r as WebPartMetadata, s as RENDER_WIDGET_TOOL, t as WebCitation, u as SANDBOX_READ_FILE_TOOL, v as readSandboxCommandRun, w as AgentToolInfo, x as hasPendingToolRun, y as readSandboxFileWrite, z as buildAgentTools } from "./index-
|
|
1
|
+
import { $ as ToolDefinition, A as ChatSubmissionCallbacks, B as RenderWidgetInput, C as lastPartInProgress, D as AstralBeamChatState, E as AstralBeamChatCoreOptions, F as McpCatalog, G as SandboxStatus, H as SandboxArtifact, I as McpConnectionOperation, L as ChatAuthenticationState, M as createAstralBeamChat, N as ChatPendingInteraction, O as ChatStreamCallbacks, P as ChatThread, Q as StandardSchemaV1, R as WidgetDeclaration, S as isSettledToolCall, T as AstralBeamChatCore, U as SandboxCommandRun, V as SandboxActivity, W as SandboxFileWrite, X as JsonSchemaObject, Y as InferParameters, Z as ParametersSchema, _ as readSandboxArtifact, a as defineTool, b as sandboxRefusal, c as SANDBOX_LIST_FILES_TOOL, d as SANDBOX_RUN_COMMAND_TOOL, f as SANDBOX_STATUS_EVENT, g as isSandboxTool, h as describeSandboxCommandRun, i as WebSource, j as WidgetRenderRequest, k as ChatSubmission, l as SANDBOX_PUBLISH_ARTIFACT_TOOL, m as collectSandboxActivity, n as WebEvidence, o as ASK_QUESTIONNAIRE_TOOL, p as SANDBOX_WRITE_FILE_TOOL, r as WebPartMetadata, s as RENDER_WIDGET_TOOL, t as WebCitation, u as SANDBOX_READ_FILE_TOOL, v as readSandboxCommandRun, w as AgentToolInfo, x as hasPendingToolRun, y as readSandboxFileWrite, z as buildAgentTools } from "./index-DaTte7o4.js";
|
|
2
2
|
export { ASK_QUESTIONNAIRE_TOOL, type AgentToolInfo, type AstralBeamChatCore, type AstralBeamChatCoreOptions, type AstralBeamChatState, type ChatAuthenticationState, type ChatPendingInteraction, type ChatStreamCallbacks, type ChatSubmission, type ChatSubmissionCallbacks, type ChatThread, type InferParameters, type JsonSchemaObject, type McpCatalog, type McpConnectionOperation, type ParametersSchema, RENDER_WIDGET_TOOL, type RenderWidgetInput, SANDBOX_LIST_FILES_TOOL, SANDBOX_PUBLISH_ARTIFACT_TOOL, SANDBOX_READ_FILE_TOOL, SANDBOX_RUN_COMMAND_TOOL, SANDBOX_STATUS_EVENT, SANDBOX_WRITE_FILE_TOOL, type SandboxActivity, type SandboxArtifact, type SandboxCommandRun, type SandboxFileWrite, type SandboxStatus, type StandardSchemaV1, type ToolDefinition, type WebCitation, type WebEvidence, type WebPartMetadata, type WebSource, type WidgetDeclaration, type WidgetRenderRequest, buildAgentTools, collectSandboxActivity, createAstralBeamChat, defineTool, describeSandboxCommandRun, hasPendingToolRun, isSandboxTool, isSettledToolCall, lastPartInProgress, readSandboxArtifact, readSandboxCommandRun, readSandboxFileWrite, sandboxRefusal };
|
package/dist/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { h as ASK_QUESTIONNAIRE_TOOL, g as RENDER_WIDGET_TOOL, _ as SANDBOX_LIST_FILES_TOOL, v as SANDBOX_PUBLISH_ARTIFACT_TOOL, y as SANDBOX_READ_FILE_TOOL, b as SANDBOX_RUN_COMMAND_TOOL, x as SANDBOX_STATUS_EVENT, S as SANDBOX_WRITE_FILE_TOOL, m as buildAgentTools, i as collectSandboxActivity, r as createAstralBeamChat, t as defineTool, a as describeSandboxCommandRun, d as hasPendingToolRun, o as isSandboxTool, f as isSettledToolCall, p as lastPartInProgress, s as readSandboxArtifact, c as readSandboxCommandRun, l as readSandboxFileWrite, u as sandboxRefusal } from "./core-
|
|
1
|
+
export { h as ASK_QUESTIONNAIRE_TOOL, g as RENDER_WIDGET_TOOL, _ as SANDBOX_LIST_FILES_TOOL, v as SANDBOX_PUBLISH_ARTIFACT_TOOL, y as SANDBOX_READ_FILE_TOOL, b as SANDBOX_RUN_COMMAND_TOOL, x as SANDBOX_STATUS_EVENT, S as SANDBOX_WRITE_FILE_TOOL, m as buildAgentTools, i as collectSandboxActivity, r as createAstralBeamChat, t as defineTool, a as describeSandboxCommandRun, d as hasPendingToolRun, o as isSandboxTool, f as isSettledToolCall, p as lastPartInProgress, s as readSandboxArtifact, c as readSandboxCommandRun, l as readSandboxFileWrite, u as sandboxRefusal } from "./core-BkceDZxh.js";
|