@astralbeam/sdk 0.0.2 → 0.0.3

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
@@ -83,6 +83,11 @@ interface AstralBeamChatTheme {
83
83
  interface MountAstralBeamChatOptions {
84
84
  /** Name shown in the widget's header. Default `"AstralBeam"`. */
85
85
  title?: string | undefined;
86
+ /**
87
+ * Shows the widget's header, which carries the title and the reset button. `false` hides both
88
+ * and gives the transcript the full height. Default `true`.
89
+ */
90
+ showHeader?: boolean | undefined;
86
91
  /** URL of the AstralBeam chat endpoint the widget streams from. Fixed at mount. Default `"/api/chat"`. */
87
92
  chatEndpoint?: string | undefined;
88
93
  /** Application endpoint that mints a short-lived chat JWT. Fixed at mount; omit for guest chat. */
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`,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-DdU0uj9s.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-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};
package/dist/react.d.ts CHANGED
@@ -9,6 +9,11 @@ interface WidgetDefinition extends Omit<WidgetDefinition$1, "render"> {
9
9
  interface AstralBeamChatProps {
10
10
  /** Name shown in the widget's header; prop changes apply immediately. Default `"AstralBeam"`. */
11
11
  title?: string;
12
+ /**
13
+ * Shows the widget's header with the title and the reset button; `false` hides both and gives
14
+ * the transcript the full height. Prop changes apply immediately. Default `true`.
15
+ */
16
+ showHeader?: boolean;
12
17
  /** URL of the AstralBeam chat endpoint the widget streams from. Default `"/api/chat"`. */
13
18
  chatEndpoint?: string;
14
19
  /** Application endpoint that mints a short-lived chat JWT; omit for guest chat. */
@@ -33,6 +38,7 @@ interface AstralBeamChatProps {
33
38
  }
34
39
  declare function AstralBeamChat({
35
40
  title,
41
+ showHeader,
36
42
  chatEndpoint,
37
43
  authEndpoint,
38
44
  systemPrompt,
package/dist/react.js CHANGED
@@ -7,7 +7,7 @@ import { jsx } from "react/jsx-runtime";
7
7
  const DEFAULT_COLOR_SCHEME = "system";
8
8
  //#endregion
9
9
  //#region src/react.tsx
10
- function AstralBeamChat({ title, chatEndpoint, authEndpoint, systemPrompt, tools, widgets = {}, colorScheme = DEFAULT_COLOR_SCHEME, theme, attachments, debug }) {
10
+ function AstralBeamChat({ title, showHeader, chatEndpoint, authEndpoint, systemPrompt, tools, widgets = {}, colorScheme = DEFAULT_COLOR_SCHEME, theme, attachments, debug }) {
11
11
  const targetRef = useRef(null);
12
12
  const handleRef = useRef(null);
13
13
  const [activeRenders, setActiveRenders] = useState(/* @__PURE__ */ new Map());
@@ -44,6 +44,7 @@ function AstralBeamChat({ title, chatEndpoint, authEndpoint, systemPrompt, tools
44
44
  }])), [widgets]);
45
45
  const live = useMemo(() => ({
46
46
  title,
47
+ showHeader,
47
48
  systemPrompt,
48
49
  colorScheme,
49
50
  theme,
@@ -53,6 +54,7 @@ function AstralBeamChat({ title, chatEndpoint, authEndpoint, systemPrompt, tools
53
54
  widgets: hostWidgets
54
55
  }), [
55
56
  title,
57
+ showHeader,
56
58
  systemPrompt,
57
59
  colorScheme,
58
60
  theme,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astralbeam/sdk",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Frontend SDK for AstralBeam: drop-in agent UI, chat streaming, and server helpers",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -74,6 +74,7 @@
74
74
  "@tanstack/ai": "^0.49.1",
75
75
  "@tanstack/ai-client": "^0.28.0",
76
76
  "@tanstack/ai-react": "^0.22.1",
77
+ "@tanstack/markdown": "^0.0.13",
77
78
  "@types/react": "^19.2.13",
78
79
  "@types/react-dom": "^19.2.3",
79
80
  "class-variance-authority": "^0.7.1",