@astralbeam/sdk 0.0.3 → 0.0.4

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/dist/client.d.ts CHANGED
@@ -32,6 +32,11 @@ interface WidgetDefinition {
32
32
  interface ToolDefinition {
33
33
  /** Tells the agent what the tool does so it can decide when to call it. */
34
34
  description: string;
35
+ /**
36
+ * Forwarded verbatim as the tool definition's metadata. A string `title` labels the tool's
37
+ * transcript entry instead of its registry name (`refresh_invoices` reads as "Refresh invoices").
38
+ */
39
+ metadata?: Record<string, unknown> | undefined;
35
40
  /**
36
41
  * Forwarded to the agent as JSON Schema. Only a Standard Schema also validates the
37
42
  * input before `execute` runs; with a plain JSON Schema, treat the input as untrusted.
package/dist/client.js CHANGED
@@ -1 +1 @@
1
- import{a as e,t}from"./client-utils-DyEcBInP.js";function n(n,r={}){let i={...r},a=t(i.debug);a?.(`mount`,`mounting chat widget`,{title:i.title??`AstralBeam`,showHeader:i.showHeader??!0,chatEndpoint:i.chatEndpoint??`/api/chat`,authentication:i.authEndpoint?`configured`:`guest`,colorScheme:i.colorScheme??`system`,theme:i.theme,systemPrompt:i.systemPrompt,tools:Object.keys(i.tools??{}),widgets:Object.keys(i.widgets??{}),attachments:i.attachments??!0});let o=n.shadowRoot??n.attachShadow({mode:`open`}),s=document.createElement(`div`);s.className=e,s.style.height=`100%`,o.append(s);let c=matchMedia(`(prefers-color-scheme: dark)`),l=new Set,u=e=>{for(let e of l)s.style.removeProperty(e);l.clear();let t={...i.theme?.light,...e?i.theme?.dark:void 0};for(let[e,n]of Object.entries(t))e.startsWith(`--`)&&(s.style.setProperty(e,n),l.add(e))},d=()=>{let e=i.colorScheme??`system`,t=e===`dark`||e===`system`&&c.matches;s.classList.toggle(`dark`,t),u(t),a?.(`theme`,`color scheme "${e}" resolved to ${t?`dark`:`light`}`,{themeVariables:[...l]})};d(),c.addEventListener(`change`,d);let f=!1,p;return import(`./chat-CPvI9tET.js`).then(({renderChat:e})=>{a?.(`mount`,`chat chunk loaded`),f||(p=e(o,s,i))}),{update:e=>{i={...i,...e},a=t(i.debug),a?.(`mount`,`options updated`,{changed:Object.keys(e)}),d(),p?.update(i)},unmount:()=>{a?.(`mount`,`unmounting chat widget`),f=!0,c.removeEventListener(`change`,d),p?.dispose(),p=void 0,s.remove()}}}export{n as mountAstralBeamChat};
1
+ import{a as e,t}from"./client-utils-DyEcBInP.js";function n(n,r={}){let i={...r},a=t(i.debug);a?.(`mount`,`mounting chat widget`,{title:i.title??`AstralBeam`,showHeader:i.showHeader??!0,chatEndpoint:i.chatEndpoint??`/api/chat`,authentication:i.authEndpoint?`configured`:`guest`,colorScheme:i.colorScheme??`system`,theme:i.theme,systemPrompt:i.systemPrompt,tools:Object.keys(i.tools??{}),widgets:Object.keys(i.widgets??{}),attachments:i.attachments??!0});let o=n.shadowRoot??n.attachShadow({mode:`open`}),s=document.createElement(`div`);s.className=e,s.style.height=`100%`,o.append(s);let c=matchMedia(`(prefers-color-scheme: dark)`),l=new Set,u=e=>{for(let e of l)s.style.removeProperty(e);l.clear();let t={...i.theme?.light,...e?i.theme?.dark:void 0};for(let[e,n]of Object.entries(t))e.startsWith(`--`)&&(s.style.setProperty(e,n),l.add(e))},d=()=>{let e=i.colorScheme??`system`,t=e===`dark`||e===`system`&&c.matches;s.classList.toggle(`dark`,t),u(t),a?.(`theme`,`color scheme "${e}" resolved to ${t?`dark`:`light`}`,{themeVariables:[...l]})};d(),c.addEventListener(`change`,d);let f=!1,p;return import(`./chat-DPX4FOaL.js`).then(({renderChat:e})=>{a?.(`mount`,`chat chunk loaded`),f||(p=e(o,s,i))}),{update:e=>{i={...i,...e},a=t(i.debug),a?.(`mount`,`options updated`,{changed:Object.keys(e)}),d(),p?.update(i)},unmount:()=>{a?.(`mount`,`unmounting chat widget`),f=!0,c.removeEventListener(`change`,d),p?.dispose(),p=void 0,s.remove()}}}export{n as mountAstralBeamChat};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astralbeam/sdk",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Frontend SDK for AstralBeam: drop-in agent UI, chat streaming, and server helpers",
5
5
  "license": "MIT",
6
6
  "type": "module",