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