@astralbeam/sdk 0.29.5 → 0.30.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 +1 -1
- package/dist/client.d.ts +38 -33
- package/dist/client.js +2 -2
- package/dist/{combobox-DP4y27_X.js → combobox-xio4DRYl.js} +1 -1
- package/dist/{core-iDw0grkb.js → core-DIrcPvaf.js} +37 -29
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/{index-Coxrpa2o.d.ts → index-COWV2LM7.d.ts} +38 -33
- package/dist/listings-C1-zJbVB.js +1 -0
- package/dist/react.d.ts +1 -1
- package/dist/react.js +1 -1
- package/dist/{widget-G_WaD28k.js → widget-Dv4lVfPt.js} +13 -13
- package/package.json +1 -1
- package/dist/listings-Vd3lhoY9.js +0 -1
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ Without npm or a bundler, import the same entry from jsDelivr in a module script
|
|
|
34
34
|
```html
|
|
35
35
|
<div id="sidebar" style="height:100dvh"></div>
|
|
36
36
|
<script type="module">
|
|
37
|
-
import { mountAstralBeamChat } from "https://cdn.jsdelivr.net/npm/@astralbeam/sdk@0.
|
|
37
|
+
import { mountAstralBeamChat } from "https://cdn.jsdelivr.net/npm/@astralbeam/sdk@0.30.0/dist/client.js"
|
|
38
38
|
|
|
39
39
|
mountAstralBeamChat(document.getElementById("sidebar"), {})
|
|
40
40
|
</script>
|
package/dist/client.d.ts
CHANGED
|
@@ -115,7 +115,7 @@ declare namespace StandardJSONSchemaV1 {
|
|
|
115
115
|
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
116
116
|
}
|
|
117
117
|
//#endregion
|
|
118
|
-
//#region ../node_modules/.bun/@tanstack+ai@1.0
|
|
118
|
+
//#region ../node_modules/.bun/@tanstack+ai@1.2.0+ac75b968c23456b3/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/capabilities.d.ts
|
|
119
119
|
/**
|
|
120
120
|
* The minimal context shape a capability accessor needs. The full
|
|
121
121
|
* `ChatMiddlewareContext` satisfies this (it has `capabilities`), so accessors
|
|
@@ -168,7 +168,7 @@ declare class CapabilityRegistry {
|
|
|
168
168
|
has(handle: CapabilityHandle): boolean;
|
|
169
169
|
}
|
|
170
170
|
//#endregion
|
|
171
|
-
//#region ../node_modules/.bun/@tanstack+ai@1.0
|
|
171
|
+
//#region ../node_modules/.bun/@tanstack+ai@1.2.0+ac75b968c23456b3/node_modules/@tanstack/ai/dist/esm/interrupts.d.ts
|
|
172
172
|
interface InterruptCorrelation {
|
|
173
173
|
threadId: string;
|
|
174
174
|
interruptedRunId: string;
|
|
@@ -251,33 +251,12 @@ declare global {
|
|
|
251
251
|
var __TANSTACK_EVENT_TARGET__: EventTarget | null;
|
|
252
252
|
}
|
|
253
253
|
//#endregion
|
|
254
|
-
//#region ../node_modules/.bun/@tanstack+ai-event-client@1.0.
|
|
255
|
-
type AIDevtoolsEventSource = 'client' | 'server' | 'devtools';
|
|
256
|
-
type AIDevtoolsEventVisibility = 'user-visible' | 'client-state' | 'server-internal' | 'devtools-action';
|
|
257
|
-
interface AIDevtoolsEventEnvelope {
|
|
258
|
-
eventId: string;
|
|
259
|
-
eventType: string;
|
|
260
|
-
timestamp: number;
|
|
261
|
-
source: AIDevtoolsEventSource;
|
|
262
|
-
visibility: AIDevtoolsEventVisibility;
|
|
263
|
-
runtimeId?: string;
|
|
264
|
-
clientId?: string;
|
|
265
|
-
requestId?: string;
|
|
266
|
-
streamId?: string;
|
|
267
|
-
hookId?: string;
|
|
268
|
-
threadId?: string;
|
|
269
|
-
runId?: string;
|
|
270
|
-
messageId?: string;
|
|
271
|
-
toolCallId?: string;
|
|
272
|
-
sequence?: number;
|
|
273
|
-
correlationId?: string;
|
|
274
|
-
relatedEventId?: string;
|
|
275
|
-
}
|
|
254
|
+
//#region ../node_modules/.bun/@tanstack+ai-event-client@1.0.1/node_modules/@tanstack/ai-event-client/dist/esm/envelope.d.ts
|
|
276
255
|
declare global {
|
|
277
256
|
var __TANSTACK_AI_DEVTOOLS_RUNTIME_ID__: string | undefined;
|
|
278
257
|
}
|
|
279
258
|
//#endregion
|
|
280
|
-
//#region ../node_modules/.bun/@tanstack+ai-event-client@1.0.
|
|
259
|
+
//#region ../node_modules/.bun/@tanstack+ai-event-client@1.0.1/node_modules/@tanstack/ai-event-client/dist/esm/index.d.ts
|
|
281
260
|
/**
|
|
282
261
|
* Detailed breakdown of prompt/input token usage.
|
|
283
262
|
* Fields are populated based on provider support.
|
|
@@ -2872,11 +2851,11 @@ type SubagentInfo = {
|
|
|
2872
2851
|
description?: string;
|
|
2873
2852
|
};
|
|
2874
2853
|
//#endregion
|
|
2875
|
-
//#region ../node_modules/.bun/@tanstack+ai@1.0
|
|
2854
|
+
//#region ../node_modules/.bun/@tanstack+ai@1.2.0+ac75b968c23456b3/node_modules/@tanstack/ai/dist/esm/utilities/ag-ui-usage.d.ts
|
|
2876
2855
|
/** TokenUsage fields that have no AG-UI `usage[]` equivalent. */
|
|
2877
2856
|
type TokenUsageLeftover = Omit<TokenUsage$1, 'promptTokens' | 'completionTokens' | 'totalTokens'>;
|
|
2878
2857
|
//#endregion
|
|
2879
|
-
//#region ../node_modules/.bun/@tanstack+ai@1.0
|
|
2858
|
+
//#region ../node_modules/.bun/@tanstack+ai@1.2.0+ac75b968c23456b3/node_modules/@tanstack/ai/dist/esm/utilities/subagent-wire.d.ts
|
|
2880
2859
|
/**
|
|
2881
2860
|
* Card data that travels on each child wire message, in
|
|
2882
2861
|
* `metadata.tanstack.subagent`. The messages carry the AG-UI `subagentRunId`.
|
|
@@ -2886,7 +2865,7 @@ interface SubagentWireInfo extends SubagentInfo, Pick<SubagentHandleData, 'statu
|
|
|
2886
2865
|
placeholder?: true;
|
|
2887
2866
|
}
|
|
2888
2867
|
//#endregion
|
|
2889
|
-
//#region ../node_modules/.bun/@tanstack+ai@1.0
|
|
2868
|
+
//#region ../node_modules/.bun/@tanstack+ai@1.2.0+ac75b968c23456b3/node_modules/@tanstack/ai/dist/esm/types.d.ts
|
|
2890
2869
|
/**
|
|
2891
2870
|
* Tool call states - track the lifecycle of a tool call
|
|
2892
2871
|
*/
|
|
@@ -3912,7 +3891,7 @@ interface SubagentErrorEvent extends SubagentErrorEvent$1 {}
|
|
|
3912
3891
|
*/
|
|
3913
3892
|
type StreamChunk = AGUIEvent;
|
|
3914
3893
|
//#endregion
|
|
3915
|
-
//#region ../node_modules/.bun/@tanstack+ai@1.0
|
|
3894
|
+
//#region ../node_modules/.bun/@tanstack+ai@1.2.0+ac75b968c23456b3/node_modules/@tanstack/ai/dist/esm/interrupt-definition.d.ts
|
|
3916
3895
|
type PortableSchema = StandardJSONSchemaV1<any, any> | StandardSchemaV1$1<any, any>;
|
|
3917
3896
|
type InterruptInput<TPayloadSchema extends PortableSchema | undefined, TPayload = unknown> = {
|
|
3918
3897
|
key: string;
|
|
@@ -3954,7 +3933,7 @@ interface InterruptDefinition<TId extends string, TPayloadSchema extends Portabl
|
|
|
3954
3933
|
interrupt: InterruptRequestMethod<TId, TPayloadSchema, TResponseSchema, TPayload, TPayloadInput>;
|
|
3955
3934
|
}
|
|
3956
3935
|
//#endregion
|
|
3957
|
-
//#region ../node_modules/.bun/@tanstack+ai@1.0
|
|
3936
|
+
//#region ../node_modules/.bun/@tanstack+ai@1.2.0+ac75b968c23456b3/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/tool-definition.d.ts
|
|
3958
3937
|
/**
|
|
3959
3938
|
* Type-level brand key for {@link ToolApprovalCapabilityMarker}. Only ever used
|
|
3960
3939
|
* in type positions, but it must stay exported: a `unique symbol` referenced by
|
|
@@ -4036,7 +4015,7 @@ type InferToolOutput<T> = T extends {
|
|
|
4036
4015
|
outputSchema?: infer TOutput;
|
|
4037
4016
|
} ? TOutput extends StandardJSONSchemaV1<any, any> ? InferSchemaType<TOutput> : TOutput extends StandardSchemaV1$1<any, any> ? InferSchemaType<TOutput> : TOutput extends JSONSchema ? unknown : InferSchemaType<TOutput> : unknown;
|
|
4038
4017
|
//#endregion
|
|
4039
|
-
//#region ../node_modules/.bun/@tanstack+ai@1.0
|
|
4018
|
+
//#region ../node_modules/.bun/@tanstack+ai@1.2.0+ac75b968c23456b3/node_modules/@tanstack/ai/dist/esm/byok/define-provider.d.ts
|
|
4040
4019
|
/**
|
|
4041
4020
|
* A BYOK provider declared by an adapter. `id` is the `x-byok-<id>` slug and
|
|
4042
4021
|
* is required — `{ id?: string }` is not a {@link ByokProvider}.
|
|
@@ -4056,14 +4035,14 @@ interface ByokProvider<TId extends string = string> {
|
|
|
4056
4035
|
readonly with?: ReadonlyArray<ByokProvider>;
|
|
4057
4036
|
}
|
|
4058
4037
|
//#endregion
|
|
4059
|
-
//#region ../node_modules/.bun/@tanstack+ai@1.0
|
|
4038
|
+
//#region ../node_modules/.bun/@tanstack+ai@1.2.0+ac75b968c23456b3/node_modules/@tanstack/ai/dist/esm/byok/providers.d.ts
|
|
4060
4039
|
/**
|
|
4061
4040
|
* Provider ids are open slugs, not a closed catalog. `@tanstack/ai` does not
|
|
4062
4041
|
* list adapters. Any matching string is a valid id and becomes `x-byok-<id>`.
|
|
4063
4042
|
*/
|
|
4064
4043
|
type ProviderId = string;
|
|
4065
4044
|
//#endregion
|
|
4066
|
-
//#region ../node_modules/.bun/@tanstack+ai@1.0
|
|
4045
|
+
//#region ../node_modules/.bun/@tanstack+ai@1.2.0+ac75b968c23456b3/node_modules/@tanstack/ai/dist/esm/activities/chat/stream/types.d.ts
|
|
4067
4046
|
/**
|
|
4068
4047
|
* Strategy for determining when to emit text updates
|
|
4069
4048
|
*/
|
|
@@ -4151,6 +4130,32 @@ declare class ByokClient {
|
|
|
4151
4130
|
unlock(): Promise<void>;
|
|
4152
4131
|
}
|
|
4153
4132
|
//#endregion
|
|
4133
|
+
//#region ../node_modules/.bun/@tanstack+ai-event-client@1.0.0/node_modules/@tanstack/ai-event-client/dist/esm/envelope.d.ts
|
|
4134
|
+
type AIDevtoolsEventSource = 'client' | 'server' | 'devtools';
|
|
4135
|
+
type AIDevtoolsEventVisibility = 'user-visible' | 'client-state' | 'server-internal' | 'devtools-action';
|
|
4136
|
+
interface AIDevtoolsEventEnvelope {
|
|
4137
|
+
eventId: string;
|
|
4138
|
+
eventType: string;
|
|
4139
|
+
timestamp: number;
|
|
4140
|
+
source: AIDevtoolsEventSource;
|
|
4141
|
+
visibility: AIDevtoolsEventVisibility;
|
|
4142
|
+
runtimeId?: string;
|
|
4143
|
+
clientId?: string;
|
|
4144
|
+
requestId?: string;
|
|
4145
|
+
streamId?: string;
|
|
4146
|
+
hookId?: string;
|
|
4147
|
+
threadId?: string;
|
|
4148
|
+
runId?: string;
|
|
4149
|
+
messageId?: string;
|
|
4150
|
+
toolCallId?: string;
|
|
4151
|
+
sequence?: number;
|
|
4152
|
+
correlationId?: string;
|
|
4153
|
+
relatedEventId?: string;
|
|
4154
|
+
}
|
|
4155
|
+
declare global {
|
|
4156
|
+
var __TANSTACK_AI_DEVTOOLS_RUNTIME_ID__: string | undefined;
|
|
4157
|
+
}
|
|
4158
|
+
//#endregion
|
|
4154
4159
|
//#region ../node_modules/.bun/@tanstack+ai-client@1.0.0+ac75b968c23456b3/node_modules/@tanstack/ai-client/dist/esm/events.d.ts
|
|
4155
4160
|
interface ChatClientRunEventContext {
|
|
4156
4161
|
threadId: string;
|
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-C1-zJbVB.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-B4IbhRo_.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;
|
|
@@ -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-Dv4lVfPt.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};
|