@assistant-ui/react 0.5.72 → 0.5.74

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  toLanguageModelMessages,
11
11
  toLanguageModelTools,
12
12
  toolResultStream
13
- } from "./chunk-DC342I2Q.mjs";
13
+ } from "./chunk-SNNYBBO6.mjs";
14
14
  import {
15
15
  __export
16
16
  } from "./chunk-BJPOCE4O.mjs";
@@ -673,12 +673,7 @@ var useBranchPickerCount = () => {
673
673
  import { useCallback as useCallback10 } from "react";
674
674
  var useBranchPickerNext = () => {
675
675
  const messageRuntime = useMessageRuntime();
676
- const messageStore = useMessageStore();
677
- const editComposerStore = useEditComposerStore();
678
- const disabled = useCombinedStore(
679
- [messageStore, editComposerStore],
680
- (m, c) => c.isEditing || m.branchNumber >= m.branchCount
681
- );
676
+ const disabled = useMessage((m) => m.branchNumber >= m.branchCount);
682
677
  const callback = useCallback10(() => {
683
678
  messageRuntime.switchToBranch({ position: "next" });
684
679
  }, [messageRuntime]);
@@ -696,12 +691,7 @@ var useBranchPickerNumber = () => {
696
691
  import { useCallback as useCallback11 } from "react";
697
692
  var useBranchPickerPrevious = () => {
698
693
  const messageRuntime = useMessageRuntime();
699
- const messageStore = useMessageStore();
700
- const editComposerStore = useEditComposerStore();
701
- const disabled = useCombinedStore(
702
- [messageStore, editComposerStore],
703
- (m, c) => c.isEditing || m.branchNumber <= 1
704
- );
694
+ const disabled = useMessage((m) => m.branchNumber <= 1);
705
695
  const callback = useCallback11(() => {
706
696
  messageRuntime.switchToBranch({ position: "previous" });
707
697
  }, [messageRuntime]);
@@ -1239,6 +1229,119 @@ var AssistantModalPrimitiveAnchor = forwardRef9(
1239
1229
  );
1240
1230
  AssistantModalPrimitiveAnchor.displayName = "AssistantModalPrimitive.Anchor";
1241
1231
 
1232
+ // src/primitives/attachment/index.ts
1233
+ var attachment_exports = {};
1234
+ __export(attachment_exports, {
1235
+ Name: () => AttachmentPrimitiveName,
1236
+ Remove: () => AttachmentPrimitiveRemove,
1237
+ Root: () => AttachmentPrimitiveRoot,
1238
+ unstable_Thumb: () => AttachmentPrimitiveThumb
1239
+ });
1240
+
1241
+ // src/primitives/attachment/AttachmentRoot.tsx
1242
+ import { Primitive as Primitive7 } from "@radix-ui/react-primitive";
1243
+ import { forwardRef as forwardRef10 } from "react";
1244
+ import { jsx as jsx14 } from "react/jsx-runtime";
1245
+ var AttachmentPrimitiveRoot = forwardRef10((props, ref) => {
1246
+ return /* @__PURE__ */ jsx14(Primitive7.div, { ...props, ref });
1247
+ });
1248
+ AttachmentPrimitiveRoot.displayName = "AttachmentPrimitive.Root";
1249
+
1250
+ // src/primitives/attachment/AttachmentThumb.tsx
1251
+ import { forwardRef as forwardRef11 } from "react";
1252
+
1253
+ // src/context/react/AttachmentContext.ts
1254
+ import { createContext as createContext5, useContext as useContext2 } from "react";
1255
+ var AttachmentContext = createContext5(
1256
+ null
1257
+ );
1258
+ function useAttachmentContext(options) {
1259
+ const context = useContext2(AttachmentContext);
1260
+ if (!options?.optional && !context)
1261
+ throw new Error(
1262
+ "This component must be used within a ComposerPrimitive.Attachments or MessagePrimitive.Attachments component."
1263
+ );
1264
+ return context;
1265
+ }
1266
+ function useThreadComposerAttachmentContext(options) {
1267
+ const context = useAttachmentContext(options);
1268
+ if (!context) return null;
1269
+ if (context.source !== "thread-composer")
1270
+ throw new Error(
1271
+ "This component must be used within a thread's ComposerPrimitive.Attachments component."
1272
+ );
1273
+ return context;
1274
+ }
1275
+ function useEditComposerAttachmentContext(options) {
1276
+ const context = useAttachmentContext(options);
1277
+ if (!context) return null;
1278
+ if (context.source !== "edit-composer")
1279
+ throw new Error(
1280
+ "This component must be used within a messages's ComposerPrimitive.Attachments component."
1281
+ );
1282
+ return context;
1283
+ }
1284
+ function useMessageAttachmentContext(options) {
1285
+ const context = useAttachmentContext(options);
1286
+ if (!context) return null;
1287
+ if (context.source !== "message")
1288
+ throw new Error(
1289
+ "This component must be used within a MessagePrimitive.Attachments component."
1290
+ );
1291
+ return context;
1292
+ }
1293
+ function useAttachmentRuntime(options) {
1294
+ const attachmentRuntime = useAttachmentContext(options);
1295
+ if (!attachmentRuntime) return null;
1296
+ return attachmentRuntime.useAttachmentRuntime();
1297
+ }
1298
+ var { useAttachment } = createContextStoreHook(
1299
+ useAttachmentContext,
1300
+ "useAttachment"
1301
+ );
1302
+ var { useAttachment: useThreadComposerAttachment } = createContextStoreHook(useThreadComposerAttachmentContext, "useAttachment");
1303
+ var { useAttachment: useEditComposerAttachment } = createContextStoreHook(useEditComposerAttachmentContext, "useAttachment");
1304
+ var { useAttachment: useMessageAttachment } = createContextStoreHook(
1305
+ useMessageAttachmentContext,
1306
+ "useAttachment"
1307
+ );
1308
+
1309
+ // src/primitives/attachment/AttachmentThumb.tsx
1310
+ import { Primitive as Primitive8 } from "@radix-ui/react-primitive";
1311
+ import { jsxs } from "react/jsx-runtime";
1312
+ var AttachmentPrimitiveThumb = forwardRef11(() => {
1313
+ const ext = useAttachment((a) => a.name.split(".").pop());
1314
+ return /* @__PURE__ */ jsxs(Primitive8.div, { children: [
1315
+ ".",
1316
+ ext
1317
+ ] });
1318
+ });
1319
+ AttachmentPrimitiveThumb.displayName = "AttachmentPrimitive.Thumb";
1320
+
1321
+ // src/primitives/attachment/AttachmentName.tsx
1322
+ import { Fragment, jsx as jsx15 } from "react/jsx-runtime";
1323
+ var AttachmentPrimitiveName = () => {
1324
+ const name = useAttachment((a) => a.name);
1325
+ return /* @__PURE__ */ jsx15(Fragment, { children: name });
1326
+ };
1327
+ AttachmentPrimitiveName.displayName = "AttachmentPrimitive.Name";
1328
+
1329
+ // src/primitive-hooks/attachment/useAttachmentRemove.ts
1330
+ import { useCallback as useCallback17 } from "react";
1331
+ var useAttachmentRemove = () => {
1332
+ const attachmentRuntime = useAttachmentRuntime();
1333
+ const handleRemoveAttachment = useCallback17(() => {
1334
+ attachmentRuntime.remove();
1335
+ }, [attachmentRuntime]);
1336
+ return handleRemoveAttachment;
1337
+ };
1338
+
1339
+ // src/primitives/attachment/AttachmentRemove.tsx
1340
+ var AttachmentPrimitiveRemove = createActionButton(
1341
+ "AttachmentPrimitive.Remove",
1342
+ useAttachmentRemove
1343
+ );
1344
+
1242
1345
  // src/primitives/branchPicker/index.ts
1243
1346
  var branchPicker_exports = {};
1244
1347
  __export(branchPicker_exports, {
@@ -1262,24 +1365,24 @@ var BranchPickerPrevious = createActionButton(
1262
1365
  );
1263
1366
 
1264
1367
  // src/primitives/branchPicker/BranchPickerCount.tsx
1265
- import { Fragment, jsx as jsx14 } from "react/jsx-runtime";
1368
+ import { Fragment as Fragment2, jsx as jsx16 } from "react/jsx-runtime";
1266
1369
  var BranchPickerPrimitiveCount = () => {
1267
1370
  const branchCount = useBranchPickerCount();
1268
- return /* @__PURE__ */ jsx14(Fragment, { children: branchCount });
1371
+ return /* @__PURE__ */ jsx16(Fragment2, { children: branchCount });
1269
1372
  };
1270
1373
  BranchPickerPrimitiveCount.displayName = "BranchPickerPrimitive.Count";
1271
1374
 
1272
1375
  // src/primitives/branchPicker/BranchPickerNumber.tsx
1273
- import { Fragment as Fragment2, jsx as jsx15 } from "react/jsx-runtime";
1376
+ import { Fragment as Fragment3, jsx as jsx17 } from "react/jsx-runtime";
1274
1377
  var BranchPickerPrimitiveNumber = () => {
1275
1378
  const branchNumber = useBranchPickerNumber();
1276
- return /* @__PURE__ */ jsx15(Fragment2, { children: branchNumber });
1379
+ return /* @__PURE__ */ jsx17(Fragment3, { children: branchNumber });
1277
1380
  };
1278
1381
  BranchPickerPrimitiveNumber.displayName = "BranchPickerPrimitive.Number";
1279
1382
 
1280
1383
  // src/primitives/branchPicker/BranchPickerRoot.tsx
1281
- import { Primitive as Primitive9 } from "@radix-ui/react-primitive";
1282
- import { forwardRef as forwardRef14 } from "react";
1384
+ import { Primitive as Primitive11 } from "@radix-ui/react-primitive";
1385
+ import { forwardRef as forwardRef16 } from "react";
1283
1386
 
1284
1387
  // src/primitives/message/index.ts
1285
1388
  var message_exports = {};
@@ -1292,17 +1395,17 @@ __export(message_exports, {
1292
1395
  });
1293
1396
 
1294
1397
  // src/primitives/message/MessageRoot.tsx
1295
- import { Primitive as Primitive7 } from "@radix-ui/react-primitive";
1398
+ import { Primitive as Primitive9 } from "@radix-ui/react-primitive";
1296
1399
  import {
1297
- forwardRef as forwardRef10,
1298
- useCallback as useCallback18
1400
+ forwardRef as forwardRef12,
1401
+ useCallback as useCallback19
1299
1402
  } from "react";
1300
1403
 
1301
1404
  // src/utils/hooks/useManagedRef.ts
1302
- import { useCallback as useCallback17, useRef } from "react";
1405
+ import { useCallback as useCallback18, useRef } from "react";
1303
1406
  var useManagedRef = (callback) => {
1304
1407
  const cleanupRef = useRef();
1305
- const ref = useCallback17(
1408
+ const ref = useCallback18(
1306
1409
  (el) => {
1307
1410
  if (cleanupRef.current) {
1308
1411
  cleanupRef.current();
@@ -1318,10 +1421,10 @@ var useManagedRef = (callback) => {
1318
1421
 
1319
1422
  // src/primitives/message/MessageRoot.tsx
1320
1423
  import { useComposedRefs } from "@radix-ui/react-compose-refs";
1321
- import { jsx as jsx16 } from "react/jsx-runtime";
1424
+ import { jsx as jsx18 } from "react/jsx-runtime";
1322
1425
  var useIsHoveringRef = () => {
1323
1426
  const messageUtilsStore = useMessageUtilsStore();
1324
- const callbackRef = useCallback18(
1427
+ const callbackRef = useCallback19(
1325
1428
  (el) => {
1326
1429
  const setIsHovering = messageUtilsStore.getState().setIsHovering;
1327
1430
  const handleMouseEnter = () => {
@@ -1342,10 +1445,10 @@ var useIsHoveringRef = () => {
1342
1445
  );
1343
1446
  return useManagedRef(callbackRef);
1344
1447
  };
1345
- var MessagePrimitiveRoot = forwardRef10((props, forwardRef33) => {
1448
+ var MessagePrimitiveRoot = forwardRef12((props, forwardRef35) => {
1346
1449
  const isHoveringRef = useIsHoveringRef();
1347
- const ref = useComposedRefs(forwardRef33, isHoveringRef);
1348
- return /* @__PURE__ */ jsx16(Primitive7.div, { ...props, ref });
1450
+ const ref = useComposedRefs(forwardRef35, isHoveringRef);
1451
+ return /* @__PURE__ */ jsx18(Primitive9.div, { ...props, ref });
1349
1452
  });
1350
1453
  MessagePrimitiveRoot.displayName = "MessagePrimitive.Root";
1351
1454
 
@@ -1365,7 +1468,7 @@ import { memo as memo2, useMemo as useMemo6 } from "react";
1365
1468
  // src/context/providers/ContentPartRuntimeProvider.tsx
1366
1469
  import { useEffect as useEffect8, useState as useState5 } from "react";
1367
1470
  import { create as create6 } from "zustand";
1368
- import { jsx as jsx17 } from "react/jsx-runtime";
1471
+ import { jsx as jsx19 } from "react/jsx-runtime";
1369
1472
  var useContentPartRuntimeStore = (runtime) => {
1370
1473
  const [store] = useState5(() => create6(() => runtime));
1371
1474
  useEffect8(() => {
@@ -1391,12 +1494,12 @@ var ContentPartRuntimeProvider = ({
1391
1494
  const [context] = useState5(() => {
1392
1495
  return { useContentPartRuntime: useContentPartRuntime2, useContentPart: useContentPart2 };
1393
1496
  });
1394
- return /* @__PURE__ */ jsx17(ContentPartContext.Provider, { value: context, children });
1497
+ return /* @__PURE__ */ jsx19(ContentPartContext.Provider, { value: context, children });
1395
1498
  };
1396
1499
 
1397
1500
  // src/primitives/contentPart/ContentPartText.tsx
1398
1501
  import {
1399
- forwardRef as forwardRef12
1502
+ forwardRef as forwardRef14
1400
1503
  } from "react";
1401
1504
 
1402
1505
  // src/utils/smooth/useSmooth.tsx
@@ -1405,14 +1508,14 @@ import { useCallbackRef as useCallbackRef2 } from "@radix-ui/react-use-callback-
1405
1508
 
1406
1509
  // src/utils/smooth/SmoothContext.tsx
1407
1510
  import {
1408
- createContext as createContext5,
1409
- forwardRef as forwardRef11,
1410
- useContext as useContext2,
1511
+ createContext as createContext6,
1512
+ forwardRef as forwardRef13,
1513
+ useContext as useContext3,
1411
1514
  useState as useState6
1412
1515
  } from "react";
1413
1516
  import { create as create7 } from "zustand";
1414
- import { jsx as jsx18 } from "react/jsx-runtime";
1415
- var SmoothContext = createContext5(null);
1517
+ import { jsx as jsx20 } from "react/jsx-runtime";
1518
+ var SmoothContext = createContext6(null);
1416
1519
  var makeSmoothContext = (initialState) => {
1417
1520
  const useSmoothStatus2 = create7(() => initialState);
1418
1521
  return { useSmoothStatus: useSmoothStatus2 };
@@ -1424,17 +1527,17 @@ var SmoothContextProvider = ({ children }) => {
1424
1527
  () => makeSmoothContext(contentPartStore.getState().status)
1425
1528
  );
1426
1529
  if (outer) return children;
1427
- return /* @__PURE__ */ jsx18(SmoothContext.Provider, { value: context, children });
1530
+ return /* @__PURE__ */ jsx20(SmoothContext.Provider, { value: context, children });
1428
1531
  };
1429
1532
  var withSmoothContextProvider = (Component) => {
1430
- const Wrapped = forwardRef11((props, ref) => {
1431
- return /* @__PURE__ */ jsx18(SmoothContextProvider, { children: /* @__PURE__ */ jsx18(Component, { ...props, ref }) });
1533
+ const Wrapped = forwardRef13((props, ref) => {
1534
+ return /* @__PURE__ */ jsx20(SmoothContextProvider, { children: /* @__PURE__ */ jsx20(Component, { ...props, ref }) });
1432
1535
  });
1433
1536
  Wrapped.displayName = Component.displayName;
1434
1537
  return Wrapped;
1435
1538
  };
1436
1539
  function useSmoothContext(options) {
1437
- const context = useContext2(SmoothContext);
1540
+ const context = useContext3(SmoothContext);
1438
1541
  if (!options?.optional && !context)
1439
1542
  throw new Error(
1440
1543
  "This component must be used within a SmoothContextProvider."
@@ -1554,20 +1657,20 @@ var useSmooth = (state, smooth = false) => {
1554
1657
  };
1555
1658
 
1556
1659
  // src/primitives/contentPart/ContentPartText.tsx
1557
- import { jsx as jsx19 } from "react/jsx-runtime";
1558
- var ContentPartPrimitiveText = forwardRef12(({ smooth = true, component: Component = "span", ...rest }, forwardedRef) => {
1660
+ import { jsx as jsx21 } from "react/jsx-runtime";
1661
+ var ContentPartPrimitiveText = forwardRef14(({ smooth = true, component: Component = "span", ...rest }, forwardedRef) => {
1559
1662
  const { text, status } = useSmooth(useContentPartText(), smooth);
1560
- return /* @__PURE__ */ jsx19(Component, { "data-status": status.type, ...rest, ref: forwardedRef, children: text });
1663
+ return /* @__PURE__ */ jsx21(Component, { "data-status": status.type, ...rest, ref: forwardedRef, children: text });
1561
1664
  });
1562
1665
  ContentPartPrimitiveText.displayName = "ContentPartPrimitive.Text";
1563
1666
 
1564
1667
  // src/primitives/contentPart/ContentPartImage.tsx
1565
- import { Primitive as Primitive8 } from "@radix-ui/react-primitive";
1566
- import { forwardRef as forwardRef13 } from "react";
1567
- import { jsx as jsx20 } from "react/jsx-runtime";
1568
- var ContentPartPrimitiveImage = forwardRef13((props, forwardedRef) => {
1668
+ import { Primitive as Primitive10 } from "@radix-ui/react-primitive";
1669
+ import { forwardRef as forwardRef15 } from "react";
1670
+ import { jsx as jsx22 } from "react/jsx-runtime";
1671
+ var ContentPartPrimitiveImage = forwardRef15((props, forwardedRef) => {
1569
1672
  const { image } = useContentPartImage();
1570
- return /* @__PURE__ */ jsx20(Primitive8.img, { src: image, ...props, ref: forwardedRef });
1673
+ return /* @__PURE__ */ jsx22(Primitive10.img, { src: image, ...props, ref: forwardedRef });
1571
1674
  });
1572
1675
  ContentPartPrimitiveImage.displayName = "ContentPartPrimitive.Image";
1573
1676
 
@@ -2136,22 +2239,22 @@ var MessageRuntimeImpl = class {
2136
2239
  };
2137
2240
 
2138
2241
  // src/primitives/message/MessageContent.tsx
2139
- import { jsx as jsx21, jsxs } from "react/jsx-runtime";
2242
+ import { jsx as jsx23, jsxs as jsxs2 } from "react/jsx-runtime";
2140
2243
  var ToolUIDisplay = ({
2141
2244
  UI,
2142
2245
  ...props
2143
2246
  }) => {
2144
2247
  const Render = useToolUIs((s) => s.getToolUI(props.toolName)) ?? UI;
2145
2248
  if (!Render) return null;
2146
- return /* @__PURE__ */ jsx21(Render, { ...props });
2249
+ return /* @__PURE__ */ jsx23(Render, { ...props });
2147
2250
  };
2148
2251
  var defaultComponents = {
2149
- Text: () => /* @__PURE__ */ jsxs("p", { style: { whiteSpace: "pre-line" }, children: [
2150
- /* @__PURE__ */ jsx21(ContentPartPrimitiveText, {}),
2151
- /* @__PURE__ */ jsx21(ContentPartPrimitiveInProgress, { children: /* @__PURE__ */ jsx21("span", { style: { fontFamily: "revert" }, children: " \u25CF" }) })
2252
+ Text: () => /* @__PURE__ */ jsxs2("p", { style: { whiteSpace: "pre-line" }, children: [
2253
+ /* @__PURE__ */ jsx23(ContentPartPrimitiveText, {}),
2254
+ /* @__PURE__ */ jsx23(ContentPartPrimitiveInProgress, { children: /* @__PURE__ */ jsx23("span", { style: { fontFamily: "revert" }, children: " \u25CF" }) })
2152
2255
  ] }),
2153
- Image: () => /* @__PURE__ */ jsx21(ContentPartPrimitiveImage, {}),
2154
- UI: () => /* @__PURE__ */ jsx21(ContentPartPrimitiveDisplay, {})
2256
+ Image: () => /* @__PURE__ */ jsx23(ContentPartPrimitiveImage, {}),
2257
+ UI: () => /* @__PURE__ */ jsx23(ContentPartPrimitiveDisplay, {})
2155
2258
  };
2156
2259
  var MessageContentPartComponent = ({
2157
2260
  components: {
@@ -2171,17 +2274,17 @@ var MessageContentPartComponent = ({
2171
2274
  if (part.status.type === "requires-action")
2172
2275
  throw new Error("Encountered unexpected requires-action status");
2173
2276
  if (part.part === EMPTY_CONTENT && !!Empty) {
2174
- return /* @__PURE__ */ jsx21(Empty, { status: part.status });
2277
+ return /* @__PURE__ */ jsx23(Empty, { status: part.status });
2175
2278
  }
2176
- return /* @__PURE__ */ jsx21(Text2, { ...part, part });
2279
+ return /* @__PURE__ */ jsx23(Text2, { ...part, part });
2177
2280
  case "image":
2178
2281
  if (part.status.type === "requires-action")
2179
2282
  throw new Error("Encountered unexpected requires-action status");
2180
- return /* @__PURE__ */ jsx21(Image2, { ...part, part });
2283
+ return /* @__PURE__ */ jsx23(Image2, { ...part, part });
2181
2284
  case "ui":
2182
2285
  if (part.status.type === "requires-action")
2183
2286
  throw new Error("Encountered unexpected requires-action status");
2184
- return /* @__PURE__ */ jsx21(UI, { ...part, part });
2287
+ return /* @__PURE__ */ jsx23(UI, { ...part, part });
2185
2288
  case "tool-call": {
2186
2289
  const Tool = by_name[part.toolName] || Fallback2;
2187
2290
  const addResult = (result) => threadRuntime.addToolResult({
@@ -2190,7 +2293,7 @@ var MessageContentPartComponent = ({
2190
2293
  toolCallId: part.toolCallId,
2191
2294
  result
2192
2295
  });
2193
- return /* @__PURE__ */ jsx21(ToolUIDisplay, { ...part, part, UI: Tool, addResult });
2296
+ return /* @__PURE__ */ jsx23(ToolUIDisplay, { ...part, part, UI: Tool, addResult });
2194
2297
  }
2195
2298
  default:
2196
2299
  const unhandledType = type;
@@ -2206,7 +2309,7 @@ var MessageContentPartImpl = ({
2206
2309
  () => messageRuntime.getContentPartByIndex(partIndex),
2207
2310
  [messageRuntime, partIndex]
2208
2311
  );
2209
- return /* @__PURE__ */ jsx21(ContentPartRuntimeProvider, { runtime, children: /* @__PURE__ */ jsx21(MessageContentPartComponent, { components }) });
2312
+ return /* @__PURE__ */ jsx23(ContentPartRuntimeProvider, { runtime, children: /* @__PURE__ */ jsx23(MessageContentPartComponent, { components }) });
2210
2313
  };
2211
2314
  var MessageContentPart = memo2(
2212
2315
  MessageContentPartImpl,
@@ -2216,7 +2319,7 @@ var MessagePrimitiveContent = ({
2216
2319
  components
2217
2320
  }) => {
2218
2321
  const contentLength = useMessage((s) => s.content.length) || 1;
2219
- return Array.from({ length: contentLength }, (_, index) => /* @__PURE__ */ jsx21(MessageContentPart, { partIndex: index, components }, index));
2322
+ return Array.from({ length: contentLength }, (_, index) => /* @__PURE__ */ jsx23(MessageContentPart, { partIndex: index, components }, index));
2220
2323
  };
2221
2324
  MessagePrimitiveContent.displayName = "MessagePrimitive.Content";
2222
2325
 
@@ -2229,62 +2332,6 @@ MessagePrimitiveInProgress.displayName = "MessagePrimitive.InProgress";
2229
2332
  // src/primitives/message/MessageAttachments.tsx
2230
2333
  import { memo as memo3, useMemo as useMemo8 } from "react";
2231
2334
 
2232
- // src/context/react/AttachmentContext.ts
2233
- import { createContext as createContext6, useContext as useContext3 } from "react";
2234
- var AttachmentContext = createContext6(
2235
- null
2236
- );
2237
- function useAttachmentContext(options) {
2238
- const context = useContext3(AttachmentContext);
2239
- if (!options?.optional && !context)
2240
- throw new Error(
2241
- "This component must be used within a ComposerPrimitive.Attachments or MessagePrimitive.Attachments component."
2242
- );
2243
- return context;
2244
- }
2245
- function useThreadComposerAttachmentContext(options) {
2246
- const context = useAttachmentContext(options);
2247
- if (!context) return null;
2248
- if (context.source !== "thread-composer")
2249
- throw new Error(
2250
- "This component must be used within a thread's ComposerPrimitive.Attachments component."
2251
- );
2252
- return context;
2253
- }
2254
- function useEditComposerAttachmentContext(options) {
2255
- const context = useAttachmentContext(options);
2256
- if (!context) return null;
2257
- if (context.source !== "edit-composer")
2258
- throw new Error(
2259
- "This component must be used within a messages's ComposerPrimitive.Attachments component."
2260
- );
2261
- return context;
2262
- }
2263
- function useMessageAttachmentContext(options) {
2264
- const context = useAttachmentContext(options);
2265
- if (!context) return null;
2266
- if (context.source !== "message")
2267
- throw new Error(
2268
- "This component must be used within a MessagePrimitive.Attachments component."
2269
- );
2270
- return context;
2271
- }
2272
- function useAttachmentRuntime(options) {
2273
- const attachmentRuntime = useAttachmentContext(options);
2274
- if (!attachmentRuntime) return null;
2275
- return attachmentRuntime.useAttachmentRuntime();
2276
- }
2277
- var { useAttachment } = createContextStoreHook(
2278
- useAttachmentContext,
2279
- "useAttachment"
2280
- );
2281
- var { useAttachment: useThreadComposerAttachment } = createContextStoreHook(useThreadComposerAttachmentContext, "useAttachment");
2282
- var { useAttachment: useEditComposerAttachment } = createContextStoreHook(useEditComposerAttachmentContext, "useAttachment");
2283
- var { useAttachment: useMessageAttachment } = createContextStoreHook(
2284
- useMessageAttachmentContext,
2285
- "useAttachment"
2286
- );
2287
-
2288
2335
  // src/context/providers/AttachmentRuntimeProvider.tsx
2289
2336
  import {
2290
2337
  useEffect as useEffect10,
@@ -2292,7 +2339,7 @@ import {
2292
2339
  useState as useState8
2293
2340
  } from "react";
2294
2341
  import { create as create8 } from "zustand";
2295
- import { jsx as jsx22 } from "react/jsx-runtime";
2342
+ import { jsx as jsx24 } from "react/jsx-runtime";
2296
2343
  var useAttachmentRuntimeStore = (runtime) => {
2297
2344
  const [store] = useState8(() => create8(() => runtime));
2298
2345
  useEffect10(() => {
@@ -2323,11 +2370,11 @@ var AttachmentRuntimeProvider = ({
2323
2370
  useAttachment: useAttachment2
2324
2371
  };
2325
2372
  }, [useAttachmentRuntime2, useAttachment2]);
2326
- return /* @__PURE__ */ jsx22(AttachmentContext.Provider, { value: context, children });
2373
+ return /* @__PURE__ */ jsx24(AttachmentContext.Provider, { value: context, children });
2327
2374
  };
2328
2375
 
2329
2376
  // src/primitives/message/MessageAttachments.tsx
2330
- import { jsx as jsx23 } from "react/jsx-runtime";
2377
+ import { jsx as jsx25 } from "react/jsx-runtime";
2331
2378
  var getComponent = (components, attachment) => {
2332
2379
  const type = attachment.type;
2333
2380
  switch (type) {
@@ -2347,7 +2394,7 @@ var AttachmentComponent = ({ components }) => {
2347
2394
  (a) => getComponent(components, a.attachment)
2348
2395
  );
2349
2396
  if (!Component) return null;
2350
- return /* @__PURE__ */ jsx23(Component, {});
2397
+ return /* @__PURE__ */ jsx25(Component, {});
2351
2398
  };
2352
2399
  var MessageAttachmentImpl = ({ components, attachmentIndex }) => {
2353
2400
  const messageRuntime = useMessageRuntime();
@@ -2355,7 +2402,7 @@ var MessageAttachmentImpl = ({ components, attachmentIndex }) => {
2355
2402
  () => messageRuntime.getAttachmentByIndex(attachmentIndex),
2356
2403
  [messageRuntime, attachmentIndex]
2357
2404
  );
2358
- return /* @__PURE__ */ jsx23(AttachmentRuntimeProvider, { runtime, children: /* @__PURE__ */ jsx23(AttachmentComponent, { components }) });
2405
+ return /* @__PURE__ */ jsx25(AttachmentRuntimeProvider, { runtime, children: /* @__PURE__ */ jsx25(AttachmentComponent, { components }) });
2359
2406
  };
2360
2407
  var MessageAttachment = memo3(
2361
2408
  MessageAttachmentImpl,
@@ -2366,7 +2413,7 @@ var MessagePrimitiveAttachments = ({ components }) => {
2366
2413
  if (message.role !== "user") return 0;
2367
2414
  return message.attachments.length;
2368
2415
  });
2369
- return Array.from({ length: attachmentsCount }, (_, index) => /* @__PURE__ */ jsx23(
2416
+ return Array.from({ length: attachmentsCount }, (_, index) => /* @__PURE__ */ jsx25(
2370
2417
  MessageAttachment,
2371
2418
  {
2372
2419
  attachmentIndex: index,
@@ -2378,9 +2425,9 @@ var MessagePrimitiveAttachments = ({ components }) => {
2378
2425
  MessagePrimitiveAttachments.displayName = "MessagePrimitive.Attachments";
2379
2426
 
2380
2427
  // src/primitives/branchPicker/BranchPickerRoot.tsx
2381
- import { jsx as jsx24 } from "react/jsx-runtime";
2382
- var BranchPickerPrimitiveRoot = forwardRef14(({ hideWhenSingleBranch, ...rest }, ref) => {
2383
- return /* @__PURE__ */ jsx24(MessagePrimitiveIf, { hasBranches: hideWhenSingleBranch ? true : void 0, children: /* @__PURE__ */ jsx24(Primitive9.div, { ...rest, ref }) });
2428
+ import { jsx as jsx26 } from "react/jsx-runtime";
2429
+ var BranchPickerPrimitiveRoot = forwardRef16(({ hideWhenSingleBranch, ...rest }, ref) => {
2430
+ return /* @__PURE__ */ jsx26(MessagePrimitiveIf, { hasBranches: hideWhenSingleBranch ? true : void 0, children: /* @__PURE__ */ jsx26(Primitive11.div, { ...rest, ref }) });
2384
2431
  });
2385
2432
  BranchPickerPrimitiveRoot.displayName = "BranchPickerPrimitive.Root";
2386
2433
 
@@ -2398,20 +2445,20 @@ __export(composer_exports, {
2398
2445
 
2399
2446
  // src/primitives/composer/ComposerRoot.tsx
2400
2447
  import { composeEventHandlers as composeEventHandlers8 } from "@radix-ui/primitive";
2401
- import { Primitive as Primitive10 } from "@radix-ui/react-primitive";
2448
+ import { Primitive as Primitive12 } from "@radix-ui/react-primitive";
2402
2449
  import {
2403
- forwardRef as forwardRef15
2450
+ forwardRef as forwardRef17
2404
2451
  } from "react";
2405
- import { jsx as jsx25 } from "react/jsx-runtime";
2406
- var ComposerPrimitiveRoot = forwardRef15(({ onSubmit, ...rest }, forwardedRef) => {
2452
+ import { jsx as jsx27 } from "react/jsx-runtime";
2453
+ var ComposerPrimitiveRoot = forwardRef17(({ onSubmit, ...rest }, forwardedRef) => {
2407
2454
  const send = useComposerSend();
2408
2455
  const handleSubmit = (e) => {
2409
2456
  e.preventDefault();
2410
2457
  if (!send) return;
2411
2458
  send();
2412
2459
  };
2413
- return /* @__PURE__ */ jsx25(
2414
- Primitive10.form,
2460
+ return /* @__PURE__ */ jsx27(
2461
+ Primitive12.form,
2415
2462
  {
2416
2463
  ...rest,
2417
2464
  ref: forwardedRef,
@@ -2426,15 +2473,15 @@ import { composeEventHandlers as composeEventHandlers9 } from "@radix-ui/primiti
2426
2473
  import { useComposedRefs as useComposedRefs2 } from "@radix-ui/react-compose-refs";
2427
2474
  import { Slot } from "@radix-ui/react-slot";
2428
2475
  import {
2429
- forwardRef as forwardRef16,
2430
- useCallback as useCallback19,
2476
+ forwardRef as forwardRef18,
2477
+ useCallback as useCallback20,
2431
2478
  useEffect as useEffect11,
2432
2479
  useRef as useRef3
2433
2480
  } from "react";
2434
2481
  import TextareaAutosize from "react-textarea-autosize";
2435
2482
  import { useEscapeKeydown as useEscapeKeydown2 } from "@radix-ui/react-use-escape-keydown";
2436
- import { jsx as jsx26 } from "react/jsx-runtime";
2437
- var ComposerPrimitiveInput = forwardRef16(
2483
+ import { jsx as jsx28 } from "react/jsx-runtime";
2484
+ var ComposerPrimitiveInput = forwardRef18(
2438
2485
  ({
2439
2486
  autoFocus = false,
2440
2487
  asChild,
@@ -2475,7 +2522,7 @@ var ComposerPrimitiveInput = forwardRef16(
2475
2522
  }
2476
2523
  };
2477
2524
  const autoFocusEnabled = autoFocus && !isDisabled;
2478
- const focus = useCallback19(() => {
2525
+ const focus = useCallback20(() => {
2479
2526
  const textarea = textareaRef.current;
2480
2527
  if (!textarea || !autoFocusEnabled) return;
2481
2528
  textarea.focus({ preventScroll: true });
@@ -2490,7 +2537,7 @@ var ComposerPrimitiveInput = forwardRef16(
2490
2537
  focus();
2491
2538
  }
2492
2539
  });
2493
- return /* @__PURE__ */ jsx26(
2540
+ return /* @__PURE__ */ jsx28(
2494
2541
  Component,
2495
2542
  {
2496
2543
  name: "input",
@@ -2530,7 +2577,7 @@ var ComposerPrimitiveAddAttachment = createActionButton(
2530
2577
 
2531
2578
  // src/primitives/composer/ComposerAttachments.tsx
2532
2579
  import { memo as memo4, useMemo as useMemo9 } from "react";
2533
- import { jsx as jsx27 } from "react/jsx-runtime";
2580
+ import { jsx as jsx29 } from "react/jsx-runtime";
2534
2581
  var getComponent2 = (components, attachment) => {
2535
2582
  const type = attachment.type;
2536
2583
  switch (type) {
@@ -2550,7 +2597,7 @@ var AttachmentComponent2 = ({ components }) => {
2550
2597
  (a) => getComponent2(components, a)
2551
2598
  );
2552
2599
  if (!Component) return null;
2553
- return /* @__PURE__ */ jsx27(Component, {});
2600
+ return /* @__PURE__ */ jsx29(Component, {});
2554
2601
  };
2555
2602
  var ComposerAttachmentImpl = ({ components, attachmentIndex }) => {
2556
2603
  const composerRuntime = useComposerRuntime();
@@ -2558,7 +2605,7 @@ var ComposerAttachmentImpl = ({ components, attachmentIndex }) => {
2558
2605
  () => composerRuntime.getAttachmentByIndex(attachmentIndex),
2559
2606
  [composerRuntime, attachmentIndex]
2560
2607
  );
2561
- return /* @__PURE__ */ jsx27(AttachmentRuntimeProvider, { runtime, children: /* @__PURE__ */ jsx27(AttachmentComponent2, { components }) });
2608
+ return /* @__PURE__ */ jsx29(AttachmentRuntimeProvider, { runtime, children: /* @__PURE__ */ jsx29(AttachmentComponent2, { components }) });
2562
2609
  };
2563
2610
  var ComposerAttachment = memo4(
2564
2611
  ComposerAttachmentImpl,
@@ -2566,7 +2613,7 @@ var ComposerAttachment = memo4(
2566
2613
  );
2567
2614
  var ComposerPrimitiveAttachments = ({ components }) => {
2568
2615
  const attachmentsCount = useComposer((s) => s.attachments.length);
2569
- return Array.from({ length: attachmentsCount }, (_, index) => /* @__PURE__ */ jsx27(
2616
+ return Array.from({ length: attachmentsCount }, (_, index) => /* @__PURE__ */ jsx29(
2570
2617
  ComposerAttachment,
2571
2618
  {
2572
2619
  attachmentIndex: index,
@@ -2609,11 +2656,11 @@ __export(thread_exports, {
2609
2656
  });
2610
2657
 
2611
2658
  // src/primitives/thread/ThreadRoot.tsx
2612
- import { Primitive as Primitive11 } from "@radix-ui/react-primitive";
2613
- import { forwardRef as forwardRef17 } from "react";
2614
- import { jsx as jsx28 } from "react/jsx-runtime";
2615
- var ThreadPrimitiveRoot = forwardRef17((props, ref) => {
2616
- return /* @__PURE__ */ jsx28(Primitive11.div, { ...props, ref });
2659
+ import { Primitive as Primitive13 } from "@radix-ui/react-primitive";
2660
+ import { forwardRef as forwardRef19 } from "react";
2661
+ import { jsx as jsx30 } from "react/jsx-runtime";
2662
+ var ThreadPrimitiveRoot = forwardRef19((props, ref) => {
2663
+ return /* @__PURE__ */ jsx30(Primitive13.div, { ...props, ref });
2617
2664
  });
2618
2665
  ThreadPrimitiveRoot.displayName = "ThreadPrimitive.Root";
2619
2666
 
@@ -2638,8 +2685,8 @@ ThreadPrimitiveIf.displayName = "ThreadPrimitive.If";
2638
2685
 
2639
2686
  // src/primitives/thread/ThreadViewport.tsx
2640
2687
  import { useComposedRefs as useComposedRefs4 } from "@radix-ui/react-compose-refs";
2641
- import { Primitive as Primitive12 } from "@radix-ui/react-primitive";
2642
- import { forwardRef as forwardRef18 } from "react";
2688
+ import { Primitive as Primitive14 } from "@radix-ui/react-primitive";
2689
+ import { forwardRef as forwardRef20 } from "react";
2643
2690
 
2644
2691
  // src/primitive-hooks/thread/useThreadViewportAutoScroll.tsx
2645
2692
  import { useComposedRefs as useComposedRefs3 } from "@radix-ui/react-compose-refs";
@@ -2647,10 +2694,10 @@ import { useRef as useRef4 } from "react";
2647
2694
 
2648
2695
  // src/utils/hooks/useOnResizeContent.tsx
2649
2696
  import { useCallbackRef as useCallbackRef3 } from "@radix-ui/react-use-callback-ref";
2650
- import { useCallback as useCallback20 } from "react";
2697
+ import { useCallback as useCallback21 } from "react";
2651
2698
  var useOnResizeContent = (callback) => {
2652
2699
  const callbackRef = useCallbackRef3(callback);
2653
- const refCallback = useCallback20(
2700
+ const refCallback = useCallback21(
2654
2701
  (el) => {
2655
2702
  const resizeObserver = new ResizeObserver(() => {
2656
2703
  callbackRef();
@@ -2750,13 +2797,13 @@ var useThreadViewportAutoScroll = ({
2750
2797
  };
2751
2798
 
2752
2799
  // src/primitives/thread/ThreadViewport.tsx
2753
- import { jsx as jsx29 } from "react/jsx-runtime";
2754
- var ThreadPrimitiveViewport = forwardRef18(({ autoScroll, children, ...rest }, forwardedRef) => {
2800
+ import { jsx as jsx31 } from "react/jsx-runtime";
2801
+ var ThreadPrimitiveViewport = forwardRef20(({ autoScroll, children, ...rest }, forwardedRef) => {
2755
2802
  const autoScrollRef = useThreadViewportAutoScroll({
2756
2803
  autoScroll
2757
2804
  });
2758
2805
  const ref = useComposedRefs4(forwardedRef, autoScrollRef);
2759
- return /* @__PURE__ */ jsx29(Primitive12.div, { ...rest, ref, children });
2806
+ return /* @__PURE__ */ jsx31(Primitive14.div, { ...rest, ref, children });
2760
2807
  });
2761
2808
  ThreadPrimitiveViewport.displayName = "ThreadPrimitive.Viewport";
2762
2809
 
@@ -2799,7 +2846,7 @@ var makeMessageUtilsStore = () => create9((set) => {
2799
2846
  });
2800
2847
 
2801
2848
  // src/context/providers/MessageRuntimeProvider.tsx
2802
- import { jsx as jsx30 } from "react/jsx-runtime";
2849
+ import { jsx as jsx32 } from "react/jsx-runtime";
2803
2850
  var useMessageRuntimeStore = (runtime) => {
2804
2851
  const [store] = useState9(() => create10(() => runtime));
2805
2852
  useEffect13(() => {
@@ -2841,11 +2888,11 @@ var MessageRuntimeProvider = ({
2841
2888
  const [context] = useState9(() => {
2842
2889
  return { useMessageRuntime: useMessageRuntime2, useMessage: useMessage2, useMessageUtils: useMessageUtils2, useEditComposer: useEditComposer2 };
2843
2890
  });
2844
- return /* @__PURE__ */ jsx30(MessageContext.Provider, { value: context, children });
2891
+ return /* @__PURE__ */ jsx32(MessageContext.Provider, { value: context, children });
2845
2892
  };
2846
2893
 
2847
2894
  // src/primitives/thread/ThreadMessages.tsx
2848
- import { jsx as jsx31 } from "react/jsx-runtime";
2895
+ import { jsx as jsx33 } from "react/jsx-runtime";
2849
2896
  var isComponentsSame = (prev, next) => {
2850
2897
  return prev.Message === next.Message && prev.EditComposer === next.EditComposer && prev.UserEditComposer === next.UserEditComposer && prev.AssistantEditComposer === next.AssistantEditComposer && prev.SystemEditComposer === next.SystemEditComposer && prev.UserMessage === next.UserMessage && prev.AssistantMessage === next.AssistantMessage && prev.SystemMessage === next.SystemMessage;
2851
2898
  };
@@ -2881,7 +2928,7 @@ var ThreadMessageComponent = ({
2881
2928
  const role = useMessage((m) => m.role);
2882
2929
  const isEditing = useEditComposer((c) => c.isEditing);
2883
2930
  const Component = getComponent3(components, role, isEditing);
2884
- return /* @__PURE__ */ jsx31(Component, {});
2931
+ return /* @__PURE__ */ jsx33(Component, {});
2885
2932
  };
2886
2933
  var ThreadMessageImpl = ({
2887
2934
  messageIndex,
@@ -2892,7 +2939,7 @@ var ThreadMessageImpl = ({
2892
2939
  () => threadRuntime.getMesssageByIndex(messageIndex),
2893
2940
  [threadRuntime, messageIndex]
2894
2941
  );
2895
- return /* @__PURE__ */ jsx31(MessageRuntimeProvider, { runtime, children: /* @__PURE__ */ jsx31(ThreadMessageComponent, { components }) });
2942
+ return /* @__PURE__ */ jsx33(MessageRuntimeProvider, { runtime, children: /* @__PURE__ */ jsx33(ThreadMessageComponent, { components }) });
2896
2943
  };
2897
2944
  var ThreadMessage = memo5(
2898
2945
  ThreadMessageImpl,
@@ -2903,7 +2950,7 @@ var ThreadPrimitiveMessagesImpl = ({
2903
2950
  }) => {
2904
2951
  const messagesLength = useThread((t) => t.messages.length);
2905
2952
  if (messagesLength === 0) return null;
2906
- return Array.from({ length: messagesLength }, (_, index) => /* @__PURE__ */ jsx31(ThreadMessage, { messageIndex: index, components }, index));
2953
+ return Array.from({ length: messagesLength }, (_, index) => /* @__PURE__ */ jsx33(ThreadMessage, { messageIndex: index, components }, index));
2907
2954
  };
2908
2955
  ThreadPrimitiveMessagesImpl.displayName = "ThreadPrimitive.Messages";
2909
2956
  var ThreadPrimitiveMessages = memo5(
@@ -3370,17 +3417,17 @@ var MessageRepository = class {
3370
3417
  };
3371
3418
 
3372
3419
  // src/ui/base/tooltip-icon-button.tsx
3373
- import { forwardRef as forwardRef21 } from "react";
3420
+ import { forwardRef as forwardRef23 } from "react";
3374
3421
 
3375
3422
  // src/ui/base/tooltip.tsx
3376
3423
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
3377
3424
 
3378
3425
  // src/ui/utils/withDefaults.tsx
3379
3426
  import {
3380
- forwardRef as forwardRef19
3427
+ forwardRef as forwardRef21
3381
3428
  } from "react";
3382
3429
  import classNames from "classnames";
3383
- import { jsx as jsx32 } from "react/jsx-runtime";
3430
+ import { jsx as jsx34 } from "react/jsx-runtime";
3384
3431
  var withDefaultProps = ({
3385
3432
  className,
3386
3433
  ...defaultProps
@@ -3393,10 +3440,10 @@ var withDefaultProps = ({
3393
3440
  };
3394
3441
  var withDefaults = (Component, defaultProps) => {
3395
3442
  const getProps = withDefaultProps(defaultProps);
3396
- const WithDefaults = forwardRef19(
3443
+ const WithDefaults = forwardRef21(
3397
3444
  (props, ref) => {
3398
3445
  const ComponentAsAny = Component;
3399
- return /* @__PURE__ */ jsx32(ComponentAsAny, { ...getProps(props), ref });
3446
+ return /* @__PURE__ */ jsx34(ComponentAsAny, { ...getProps(props), ref });
3400
3447
  }
3401
3448
  );
3402
3449
  WithDefaults.displayName = "withDefaults(" + (typeof Component === "string" ? Component : Component.displayName) + ")";
@@ -3404,9 +3451,9 @@ var withDefaults = (Component, defaultProps) => {
3404
3451
  };
3405
3452
 
3406
3453
  // src/ui/base/tooltip.tsx
3407
- import { jsx as jsx33 } from "react/jsx-runtime";
3454
+ import { jsx as jsx35 } from "react/jsx-runtime";
3408
3455
  var Tooltip = (props) => {
3409
- return /* @__PURE__ */ jsx33(TooltipPrimitive.Provider, { children: /* @__PURE__ */ jsx33(TooltipPrimitive.Root, { ...props }) });
3456
+ return /* @__PURE__ */ jsx35(TooltipPrimitive.Provider, { children: /* @__PURE__ */ jsx35(TooltipPrimitive.Root, { ...props }) });
3410
3457
  };
3411
3458
  Tooltip.displayName = "Tooltip";
3412
3459
  var TooltipTrigger = TooltipPrimitive.Trigger;
@@ -3418,9 +3465,9 @@ TooltipContent.displayName = "TooltipContent";
3418
3465
 
3419
3466
  // src/ui/base/button.tsx
3420
3467
  import { cva } from "class-variance-authority";
3421
- import { Primitive as Primitive13 } from "@radix-ui/react-primitive";
3422
- import { forwardRef as forwardRef20 } from "react";
3423
- import { jsx as jsx34 } from "react/jsx-runtime";
3468
+ import { Primitive as Primitive15 } from "@radix-ui/react-primitive";
3469
+ import { forwardRef as forwardRef22 } from "react";
3470
+ import { jsx as jsx36 } from "react/jsx-runtime";
3424
3471
  var buttonVariants = cva("aui-button", {
3425
3472
  variants: {
3426
3473
  variant: {
@@ -3438,10 +3485,10 @@ var buttonVariants = cva("aui-button", {
3438
3485
  size: "default"
3439
3486
  }
3440
3487
  });
3441
- var Button = forwardRef20(
3488
+ var Button = forwardRef22(
3442
3489
  ({ className, variant, size, ...props }, ref) => {
3443
- return /* @__PURE__ */ jsx34(
3444
- Primitive13.button,
3490
+ return /* @__PURE__ */ jsx36(
3491
+ Primitive15.button,
3445
3492
  {
3446
3493
  className: buttonVariants({ variant, size, className }),
3447
3494
  ...props,
@@ -3453,14 +3500,14 @@ var Button = forwardRef20(
3453
3500
  Button.displayName = "Button";
3454
3501
 
3455
3502
  // src/ui/base/tooltip-icon-button.tsx
3456
- import { jsx as jsx35, jsxs as jsxs2 } from "react/jsx-runtime";
3457
- var TooltipIconButton = forwardRef21(({ children, tooltip, side = "bottom", ...rest }, ref) => {
3458
- return /* @__PURE__ */ jsxs2(Tooltip, { children: [
3459
- /* @__PURE__ */ jsx35(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs2(Button, { variant: "ghost", size: "icon", ...rest, ref, children: [
3503
+ import { jsx as jsx37, jsxs as jsxs3 } from "react/jsx-runtime";
3504
+ var TooltipIconButton = forwardRef23(({ children, tooltip, side = "bottom", ...rest }, ref) => {
3505
+ return /* @__PURE__ */ jsxs3(Tooltip, { children: [
3506
+ /* @__PURE__ */ jsx37(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs3(Button, { variant: "ghost", size: "icon", ...rest, ref, children: [
3460
3507
  children,
3461
- /* @__PURE__ */ jsx35("span", { className: "aui-sr-only", children: tooltip })
3508
+ /* @__PURE__ */ jsx37("span", { className: "aui-sr-only", children: tooltip })
3462
3509
  ] }) }),
3463
- /* @__PURE__ */ jsx35(TooltipContent, { side, children: tooltip })
3510
+ /* @__PURE__ */ jsx37(TooltipContent, { side, children: tooltip })
3464
3511
  ] });
3465
3512
  });
3466
3513
  TooltipIconButton.displayName = "TooltipIconButton";
@@ -3688,7 +3735,7 @@ var ThreadRuntimeImpl = class {
3688
3735
  };
3689
3736
 
3690
3737
  // src/runtimes/edge/converters/fromLanguageModelMessages.ts
3691
- var fromLanguageModelMessages = (lm, { mergeRoundtrips }) => {
3738
+ var fromLanguageModelMessages = (lm, { mergeSteps }) => {
3692
3739
  const messages2 = [];
3693
3740
  for (const lmMessage of lm) {
3694
3741
  const role = lmMessage.role;
@@ -3751,7 +3798,7 @@ var fromLanguageModelMessages = (lm, { mergeRoundtrips }) => {
3751
3798
  }
3752
3799
  return part;
3753
3800
  });
3754
- if (mergeRoundtrips) {
3801
+ if (mergeSteps) {
3755
3802
  const previousMessage = messages2[messages2.length - 1];
3756
3803
  if (previousMessage?.role === "assistant") {
3757
3804
  previousMessage.content.push(...newContent);
@@ -3862,7 +3909,7 @@ function assistantDecoderStream() {
3862
3909
  let currentToolCall;
3863
3910
  return new TransformStream({
3864
3911
  transform({ type, value }, controller) {
3865
- if (currentToolCall && type !== "2" /* ToolCallArgsTextDelta */ && type !== "E" /* Error */) {
3912
+ if (currentToolCall && type !== "c" /* ToolCallDelta */ && type !== "3" /* Error */) {
3866
3913
  controller.enqueue({
3867
3914
  type: "tool-call",
3868
3915
  toolCallType: "function",
@@ -3880,48 +3927,82 @@ function assistantDecoderStream() {
3880
3927
  });
3881
3928
  break;
3882
3929
  }
3883
- case "1" /* ToolCallBegin */: {
3884
- const { id, name } = value;
3930
+ case "b" /* ToolCallBegin */: {
3931
+ const { toolCallId: id, toolName: name } = value;
3885
3932
  toolCallNames.set(id, name);
3886
3933
  currentToolCall = { id, name, argsText: "" };
3887
3934
  break;
3888
3935
  }
3889
- case "2" /* ToolCallArgsTextDelta */: {
3890
- const delta = value;
3891
- currentToolCall.argsText += delta;
3936
+ case "c" /* ToolCallDelta */: {
3937
+ const { toolCallId, argsTextDelta } = value;
3938
+ if (currentToolCall?.id !== toolCallId) {
3939
+ throw new Error(
3940
+ `Received tool call delta for unknown tool call "${toolCallId}".`
3941
+ );
3942
+ }
3943
+ currentToolCall.argsText += argsTextDelta;
3892
3944
  controller.enqueue({
3893
3945
  type: "tool-call-delta",
3894
3946
  toolCallType: "function",
3895
3947
  toolCallId: currentToolCall.id,
3896
3948
  toolName: currentToolCall.name,
3897
- argsTextDelta: delta
3949
+ argsTextDelta
3898
3950
  });
3899
3951
  break;
3900
3952
  }
3901
- case "3" /* ToolCallResult */: {
3953
+ case "a" /* ToolCallResult */: {
3902
3954
  controller.enqueue({
3903
3955
  type: "tool-result",
3904
3956
  toolCallType: "function",
3905
- toolCallId: value.id,
3906
- toolName: toolCallNames.get(value.id),
3957
+ toolCallId: value.toolCallId,
3958
+ toolName: toolCallNames.get(value.toolCallId),
3907
3959
  result: value.result
3908
3960
  });
3909
3961
  break;
3910
3962
  }
3911
- case "F" /* Finish */: {
3963
+ case "d" /* Finish */: {
3912
3964
  controller.enqueue({
3913
3965
  type: "finish",
3914
3966
  ...value
3915
3967
  });
3916
3968
  break;
3917
3969
  }
3918
- case "E" /* Error */: {
3970
+ case "3" /* Error */: {
3919
3971
  controller.enqueue({
3920
3972
  type: "error",
3921
3973
  error: value
3922
3974
  });
3923
3975
  break;
3924
3976
  }
3977
+ case "9" /* ToolCall */: {
3978
+ const { toolCallId, toolName, args } = value;
3979
+ const argsText = JSON.stringify(args);
3980
+ controller.enqueue({
3981
+ type: "tool-call-delta",
3982
+ toolCallType: "function",
3983
+ toolCallId,
3984
+ toolName,
3985
+ argsTextDelta: argsText
3986
+ });
3987
+ controller.enqueue({
3988
+ type: "tool-call",
3989
+ toolCallType: "function",
3990
+ toolCallId,
3991
+ toolName,
3992
+ args: argsText
3993
+ });
3994
+ break;
3995
+ }
3996
+ case "e" /* StepFinish */: {
3997
+ controller.enqueue({
3998
+ type: "step-finish",
3999
+ ...value
4000
+ });
4001
+ break;
4002
+ }
4003
+ // TODO
4004
+ case "2" /* Data */:
4005
+ break;
3925
4006
  default: {
3926
4007
  const unhandledType = type;
3927
4008
  throw new Error(`Unhandled chunk type: ${unhandledType}`);
@@ -3981,9 +4062,14 @@ var EdgeChatAdapter = class {
3981
4062
 
3982
4063
  // src/runtimes/local/LocalRuntimeOptions.tsx
3983
4064
  var splitLocalRuntimeOptions = (options) => {
3984
- const { initialMessages, maxToolRoundtrips, adapters, ...rest } = options;
4065
+ const { initialMessages, maxToolRoundtrips, maxSteps, adapters, ...rest } = options;
3985
4066
  return {
3986
- localRuntimeOptions: { initialMessages, maxToolRoundtrips, adapters },
4067
+ localRuntimeOptions: {
4068
+ initialMessages,
4069
+ maxToolRoundtrips,
4070
+ maxSteps,
4071
+ adapters
4072
+ },
3987
4073
  otherOptions: rest
3988
4074
  };
3989
4075
  };
@@ -4157,29 +4243,21 @@ var LocalThreadRuntimeCore = class {
4157
4243
  this.abortController?.abort();
4158
4244
  this.abortController = new AbortController();
4159
4245
  const initialContent = message.content;
4160
- const initialRoundtrips = message.metadata?.roundtrips;
4246
+ const initialSteps = message.metadata?.steps;
4161
4247
  const initalCustom = message.metadata?.custom;
4162
4248
  const updateMessage = (m) => {
4249
+ const newSteps = m.metadata?.steps || m.metadata?.roundtrips;
4250
+ const steps2 = newSteps ? [...initialSteps ?? [], ...newSteps] : void 0;
4163
4251
  message = {
4164
4252
  ...message,
4165
4253
  ...m.content ? { content: [...initialContent, ...m.content ?? []] } : void 0,
4166
4254
  status: m.status ?? message.status,
4167
4255
  // TODO deprecated, remove in v0.6
4168
- ...m.metadata?.roundtrips ? {
4169
- roundtrips: [
4170
- ...initialRoundtrips ?? [],
4171
- ...m.metadata.roundtrips
4172
- ]
4173
- } : void 0,
4256
+ ...steps2 ? { roundtrips: steps2 } : void 0,
4174
4257
  ...m.metadata ? {
4175
4258
  metadata: {
4176
4259
  ...message.metadata,
4177
- ...m.metadata.roundtrips ? {
4178
- roundtrips: [
4179
- ...initialRoundtrips ?? [],
4180
- ...m.metadata.roundtrips
4181
- ]
4182
- } : void 0,
4260
+ ...steps2 ? { roundtrips: steps2, steps: steps2 } : void 0,
4183
4261
  ...m.metadata?.custom ? {
4184
4262
  custom: { ...initalCustom ?? {}, ...m.metadata.custom }
4185
4263
  } : void 0
@@ -4189,9 +4267,9 @@ var LocalThreadRuntimeCore = class {
4189
4267
  this.repository.addOrUpdateMessage(parentId, message);
4190
4268
  this.notifySubscribers();
4191
4269
  };
4192
- const maxToolRoundtrips = this.options.maxToolRoundtrips ?? 1;
4193
- const toolRoundtrips = message.metadata?.roundtrips?.length ?? 0;
4194
- if (toolRoundtrips > maxToolRoundtrips) {
4270
+ const maxSteps = this.options.maxSteps ? this.options.maxSteps : (this.options.maxToolRoundtrips ?? 1) + 1;
4271
+ const steps = message.metadata?.steps?.length ?? 0;
4272
+ if (steps >= maxSteps) {
4195
4273
  updateMessage({
4196
4274
  status: {
4197
4275
  type: "incomplete",
@@ -5123,7 +5201,7 @@ import {
5123
5201
  createContext as createContext7,
5124
5202
  useContext as useContext4
5125
5203
  } from "react";
5126
- import { Fragment as Fragment3, jsx as jsx36 } from "react/jsx-runtime";
5204
+ import { Fragment as Fragment4, jsx as jsx38 } from "react/jsx-runtime";
5127
5205
  var ThreadConfigContext = createContext7({});
5128
5206
  var useThreadConfig = () => {
5129
5207
  return useContext4(ThreadConfigContext);
@@ -5133,19 +5211,19 @@ var ThreadConfigProvider = ({
5133
5211
  config
5134
5212
  }) => {
5135
5213
  const hasAssistant = !!useAssistantRuntime({ optional: true });
5136
- const configProvider = config && Object.keys(config ?? {}).length > 0 ? /* @__PURE__ */ jsx36(ThreadConfigContext.Provider, { value: config, children }) : /* @__PURE__ */ jsx36(Fragment3, { children });
5214
+ const configProvider = config && Object.keys(config ?? {}).length > 0 ? /* @__PURE__ */ jsx38(ThreadConfigContext.Provider, { value: config, children }) : /* @__PURE__ */ jsx38(Fragment4, { children });
5137
5215
  if (!config?.runtime) return configProvider;
5138
5216
  if (hasAssistant) {
5139
5217
  throw new Error(
5140
5218
  "You provided a runtime to <Thread> while simulataneously using <AssistantRuntimeProvider>. This is not allowed."
5141
5219
  );
5142
5220
  }
5143
- return /* @__PURE__ */ jsx36(AssistantRuntimeProvider, { runtime: config.runtime, children: configProvider });
5221
+ return /* @__PURE__ */ jsx38(AssistantRuntimeProvider, { runtime: config.runtime, children: configProvider });
5144
5222
  };
5145
5223
  ThreadConfigProvider.displayName = "ThreadConfigProvider";
5146
5224
 
5147
5225
  // src/ui/assistant-action-bar.tsx
5148
- import { forwardRef as forwardRef22 } from "react";
5226
+ import { forwardRef as forwardRef24 } from "react";
5149
5227
  import {
5150
5228
  AudioLinesIcon,
5151
5229
  CheckIcon,
@@ -5155,7 +5233,7 @@ import {
5155
5233
  ThumbsDownIcon,
5156
5234
  ThumbsUpIcon
5157
5235
  } from "lucide-react";
5158
- import { Fragment as Fragment4, jsx as jsx37, jsxs as jsxs3 } from "react/jsx-runtime";
5236
+ import { Fragment as Fragment5, jsx as jsx39, jsxs as jsxs4 } from "react/jsx-runtime";
5159
5237
  var useAllowCopy = (ensureCapability = false) => {
5160
5238
  const { assistantMessage: { allowCopy = true } = {} } = useThreadConfig();
5161
5239
  const copySupported = useThread((t) => t.capabilities.unstable_copy);
@@ -5189,18 +5267,18 @@ var AssistantActionBar = () => {
5189
5267
  const allowFeedbackNegative = useAllowFeedbackNegative(true);
5190
5268
  if (!allowCopy && !allowReload && !allowSpeak && !allowFeedbackPositive && !allowFeedbackNegative)
5191
5269
  return null;
5192
- return /* @__PURE__ */ jsxs3(
5270
+ return /* @__PURE__ */ jsxs4(
5193
5271
  AssistantActionBarRoot,
5194
5272
  {
5195
5273
  hideWhenRunning: true,
5196
5274
  autohide: "not-last",
5197
5275
  autohideFloat: "single-branch",
5198
5276
  children: [
5199
- allowSpeak && /* @__PURE__ */ jsx37(AssistantActionBarSpeechControl, {}),
5200
- allowCopy && /* @__PURE__ */ jsx37(AssistantActionBarCopy, {}),
5201
- allowReload && /* @__PURE__ */ jsx37(AssistantActionBarReload, {}),
5202
- allowFeedbackPositive && /* @__PURE__ */ jsx37(AssistantActionBarFeedbackPositive, {}),
5203
- allowFeedbackNegative && /* @__PURE__ */ jsx37(AssistantActionBarFeedbackNegative, {})
5277
+ allowSpeak && /* @__PURE__ */ jsx39(AssistantActionBarSpeechControl, {}),
5278
+ allowCopy && /* @__PURE__ */ jsx39(AssistantActionBarCopy, {}),
5279
+ allowReload && /* @__PURE__ */ jsx39(AssistantActionBarReload, {}),
5280
+ allowFeedbackPositive && /* @__PURE__ */ jsx39(AssistantActionBarFeedbackPositive, {}),
5281
+ allowFeedbackNegative && /* @__PURE__ */ jsx39(AssistantActionBarFeedbackNegative, {})
5204
5282
  ]
5205
5283
  }
5206
5284
  );
@@ -5210,35 +5288,35 @@ var AssistantActionBarRoot = withDefaults(actionBar_exports.Root, {
5210
5288
  className: "aui-assistant-action-bar-root"
5211
5289
  });
5212
5290
  AssistantActionBarRoot.displayName = "AssistantActionBarRoot";
5213
- var AssistantActionBarCopy = forwardRef22((props, ref) => {
5291
+ var AssistantActionBarCopy = forwardRef24((props, ref) => {
5214
5292
  const {
5215
5293
  strings: {
5216
5294
  assistantMessage: { copy: { tooltip = "Copy" } = {} } = {}
5217
5295
  } = {}
5218
5296
  } = useThreadConfig();
5219
- return /* @__PURE__ */ jsx37(actionBar_exports.Copy, { asChild: true, children: /* @__PURE__ */ jsx37(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsxs3(Fragment4, { children: [
5220
- /* @__PURE__ */ jsx37(message_exports.If, { copied: true, children: /* @__PURE__ */ jsx37(CheckIcon, {}) }),
5221
- /* @__PURE__ */ jsx37(message_exports.If, { copied: false, children: /* @__PURE__ */ jsx37(CopyIcon, {}) })
5297
+ return /* @__PURE__ */ jsx39(actionBar_exports.Copy, { asChild: true, children: /* @__PURE__ */ jsx39(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsxs4(Fragment5, { children: [
5298
+ /* @__PURE__ */ jsx39(message_exports.If, { copied: true, children: /* @__PURE__ */ jsx39(CheckIcon, {}) }),
5299
+ /* @__PURE__ */ jsx39(message_exports.If, { copied: false, children: /* @__PURE__ */ jsx39(CopyIcon, {}) })
5222
5300
  ] }) }) });
5223
5301
  });
5224
5302
  AssistantActionBarCopy.displayName = "AssistantActionBarCopy";
5225
5303
  var AssistantActionBarSpeechControl = () => {
5226
- return /* @__PURE__ */ jsxs3(Fragment4, { children: [
5227
- /* @__PURE__ */ jsx37(message_exports.If, { speaking: false, children: /* @__PURE__ */ jsx37(AssistantActionBarSpeak, {}) }),
5228
- /* @__PURE__ */ jsx37(message_exports.If, { speaking: true, children: /* @__PURE__ */ jsx37(AssistantActionBarStopSpeaking, {}) })
5304
+ return /* @__PURE__ */ jsxs4(Fragment5, { children: [
5305
+ /* @__PURE__ */ jsx39(message_exports.If, { speaking: false, children: /* @__PURE__ */ jsx39(AssistantActionBarSpeak, {}) }),
5306
+ /* @__PURE__ */ jsx39(message_exports.If, { speaking: true, children: /* @__PURE__ */ jsx39(AssistantActionBarStopSpeaking, {}) })
5229
5307
  ] });
5230
5308
  };
5231
- var AssistantActionBarSpeak = forwardRef22((props, ref) => {
5309
+ var AssistantActionBarSpeak = forwardRef24((props, ref) => {
5232
5310
  const {
5233
5311
  strings: {
5234
5312
  assistantMessage: { speak: { tooltip = "Read aloud" } = {} } = {}
5235
5313
  } = {}
5236
5314
  } = useThreadConfig();
5237
5315
  const allowSpeak = useAllowSpeak();
5238
- return /* @__PURE__ */ jsx37(actionBar_exports.Speak, { disabled: !allowSpeak, asChild: true, children: /* @__PURE__ */ jsx37(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx37(AudioLinesIcon, {}) }) });
5316
+ return /* @__PURE__ */ jsx39(actionBar_exports.Speak, { disabled: !allowSpeak, asChild: true, children: /* @__PURE__ */ jsx39(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx39(AudioLinesIcon, {}) }) });
5239
5317
  });
5240
5318
  AssistantActionBarSpeak.displayName = "AssistantActionBarSpeak";
5241
- var AssistantActionBarStopSpeaking = forwardRef22((props, ref) => {
5319
+ var AssistantActionBarStopSpeaking = forwardRef24((props, ref) => {
5242
5320
  const {
5243
5321
  strings: {
5244
5322
  assistantMessage: {
@@ -5247,20 +5325,20 @@ var AssistantActionBarStopSpeaking = forwardRef22((props, ref) => {
5247
5325
  } = {}
5248
5326
  } = useThreadConfig();
5249
5327
  const allowSpeak = useAllowSpeak();
5250
- return /* @__PURE__ */ jsx37(actionBar_exports.StopSpeaking, { disabled: !allowSpeak, asChild: true, children: /* @__PURE__ */ jsx37(TooltipIconButton, { tooltip: stopTooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx37(StopCircleIcon, {}) }) });
5328
+ return /* @__PURE__ */ jsx39(actionBar_exports.StopSpeaking, { disabled: !allowSpeak, asChild: true, children: /* @__PURE__ */ jsx39(TooltipIconButton, { tooltip: stopTooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx39(StopCircleIcon, {}) }) });
5251
5329
  });
5252
5330
  AssistantActionBarStopSpeaking.displayName = "AssistantActionBarStopSpeaking";
5253
- var AssistantActionBarReload = forwardRef22((props, ref) => {
5331
+ var AssistantActionBarReload = forwardRef24((props, ref) => {
5254
5332
  const {
5255
5333
  strings: {
5256
5334
  assistantMessage: { reload: { tooltip = "Refresh" } = {} } = {}
5257
5335
  } = {}
5258
5336
  } = useThreadConfig();
5259
5337
  const allowReload = useAllowReload();
5260
- return /* @__PURE__ */ jsx37(actionBar_exports.Reload, { disabled: !allowReload, asChild: true, children: /* @__PURE__ */ jsx37(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx37(RefreshCwIcon, {}) }) });
5338
+ return /* @__PURE__ */ jsx39(actionBar_exports.Reload, { disabled: !allowReload, asChild: true, children: /* @__PURE__ */ jsx39(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx39(RefreshCwIcon, {}) }) });
5261
5339
  });
5262
5340
  AssistantActionBarReload.displayName = "AssistantActionBarReload";
5263
- var AssistantActionBarFeedbackPositive = forwardRef22((props, ref) => {
5341
+ var AssistantActionBarFeedbackPositive = forwardRef24((props, ref) => {
5264
5342
  const {
5265
5343
  strings: {
5266
5344
  assistantMessage: {
@@ -5269,18 +5347,18 @@ var AssistantActionBarFeedbackPositive = forwardRef22((props, ref) => {
5269
5347
  } = {}
5270
5348
  } = useThreadConfig();
5271
5349
  const allowFeedbackPositive = useAllowFeedbackPositive();
5272
- return /* @__PURE__ */ jsx37(
5350
+ return /* @__PURE__ */ jsx39(
5273
5351
  actionBar_exports.FeedbackPositive,
5274
5352
  {
5275
5353
  disabled: !allowFeedbackPositive,
5276
5354
  className: "aui-assistant-action-bar-feedback-positive",
5277
5355
  asChild: true,
5278
- children: /* @__PURE__ */ jsx37(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx37(ThumbsUpIcon, {}) })
5356
+ children: /* @__PURE__ */ jsx39(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx39(ThumbsUpIcon, {}) })
5279
5357
  }
5280
5358
  );
5281
5359
  });
5282
5360
  AssistantActionBarFeedbackPositive.displayName = "AssistantActionBarFeedbackPositive";
5283
- var AssistantActionBarFeedbackNegative = forwardRef22((props, ref) => {
5361
+ var AssistantActionBarFeedbackNegative = forwardRef24((props, ref) => {
5284
5362
  const {
5285
5363
  strings: {
5286
5364
  assistantMessage: {
@@ -5289,13 +5367,13 @@ var AssistantActionBarFeedbackNegative = forwardRef22((props, ref) => {
5289
5367
  } = {}
5290
5368
  } = useThreadConfig();
5291
5369
  const allowFeedbackNegative = useAllowFeedbackNegative();
5292
- return /* @__PURE__ */ jsx37(
5370
+ return /* @__PURE__ */ jsx39(
5293
5371
  actionBar_exports.FeedbackNegative,
5294
5372
  {
5295
5373
  disabled: !allowFeedbackNegative,
5296
5374
  className: "aui-assistant-action-bar-feedback-negative",
5297
5375
  asChild: true,
5298
- children: /* @__PURE__ */ jsx37(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx37(ThumbsDownIcon, {}) })
5376
+ children: /* @__PURE__ */ jsx39(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx39(ThumbsDownIcon, {}) })
5299
5377
  }
5300
5378
  );
5301
5379
  });
@@ -5316,12 +5394,12 @@ var assistant_action_bar_default = Object.assign(
5316
5394
  );
5317
5395
 
5318
5396
  // src/ui/assistant-message.tsx
5319
- import { forwardRef as forwardRef24, useMemo as useMemo14 } from "react";
5397
+ import { forwardRef as forwardRef26, useMemo as useMemo14 } from "react";
5320
5398
 
5321
5399
  // src/ui/branch-picker.tsx
5322
- import { forwardRef as forwardRef23 } from "react";
5400
+ import { forwardRef as forwardRef25 } from "react";
5323
5401
  import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
5324
- import { jsx as jsx38, jsxs as jsxs4 } from "react/jsx-runtime";
5402
+ import { jsx as jsx40, jsxs as jsxs5 } from "react/jsx-runtime";
5325
5403
  var useAllowBranchPicker = (ensureCapability = false) => {
5326
5404
  const { branchPicker: { allowBranchPicker = true } = {} } = useThreadConfig();
5327
5405
  const branchPickerSupported = useThread((t) => t.capabilities.edit);
@@ -5330,10 +5408,10 @@ var useAllowBranchPicker = (ensureCapability = false) => {
5330
5408
  var BranchPicker = () => {
5331
5409
  const allowBranchPicker = useAllowBranchPicker(true);
5332
5410
  if (!allowBranchPicker) return null;
5333
- return /* @__PURE__ */ jsxs4(BranchPickerRoot, { hideWhenSingleBranch: true, children: [
5334
- /* @__PURE__ */ jsx38(BranchPickerPrevious2, {}),
5335
- /* @__PURE__ */ jsx38(BranchPickerState, {}),
5336
- /* @__PURE__ */ jsx38(BranchPickerNext, {})
5411
+ return /* @__PURE__ */ jsxs5(BranchPickerRoot, { hideWhenSingleBranch: true, children: [
5412
+ /* @__PURE__ */ jsx40(BranchPickerPrevious2, {}),
5413
+ /* @__PURE__ */ jsx40(BranchPickerState, {}),
5414
+ /* @__PURE__ */ jsx40(BranchPickerNext, {})
5337
5415
  ] });
5338
5416
  };
5339
5417
  BranchPicker.displayName = "BranchPicker";
@@ -5341,33 +5419,33 @@ var BranchPickerRoot = withDefaults(branchPicker_exports.Root, {
5341
5419
  className: "aui-branch-picker-root"
5342
5420
  });
5343
5421
  BranchPickerRoot.displayName = "BranchPickerRoot";
5344
- var BranchPickerPrevious2 = forwardRef23((props, ref) => {
5422
+ var BranchPickerPrevious2 = forwardRef25((props, ref) => {
5345
5423
  const {
5346
5424
  strings: {
5347
5425
  branchPicker: { previous: { tooltip = "Previous" } = {} } = {}
5348
5426
  } = {}
5349
5427
  } = useThreadConfig();
5350
5428
  const allowBranchPicker = useAllowBranchPicker();
5351
- return /* @__PURE__ */ jsx38(branchPicker_exports.Previous, { disabled: !allowBranchPicker, asChild: true, children: /* @__PURE__ */ jsx38(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx38(ChevronLeftIcon, {}) }) });
5429
+ return /* @__PURE__ */ jsx40(branchPicker_exports.Previous, { disabled: !allowBranchPicker, asChild: true, children: /* @__PURE__ */ jsx40(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx40(ChevronLeftIcon, {}) }) });
5352
5430
  });
5353
5431
  BranchPickerPrevious2.displayName = "BranchPickerPrevious";
5354
5432
  var BranchPickerStateWrapper = withDefaults("span", {
5355
5433
  className: "aui-branch-picker-state"
5356
5434
  });
5357
- var BranchPickerState = forwardRef23((props, ref) => {
5358
- return /* @__PURE__ */ jsxs4(BranchPickerStateWrapper, { ...props, ref, children: [
5359
- /* @__PURE__ */ jsx38(branchPicker_exports.Number, {}),
5435
+ var BranchPickerState = forwardRef25((props, ref) => {
5436
+ return /* @__PURE__ */ jsxs5(BranchPickerStateWrapper, { ...props, ref, children: [
5437
+ /* @__PURE__ */ jsx40(branchPicker_exports.Number, {}),
5360
5438
  " / ",
5361
- /* @__PURE__ */ jsx38(branchPicker_exports.Count, {})
5439
+ /* @__PURE__ */ jsx40(branchPicker_exports.Count, {})
5362
5440
  ] });
5363
5441
  });
5364
5442
  BranchPickerState.displayName = "BranchPickerState";
5365
- var BranchPickerNext = forwardRef23((props, ref) => {
5443
+ var BranchPickerNext = forwardRef25((props, ref) => {
5366
5444
  const {
5367
5445
  strings: { branchPicker: { next: { tooltip = "Next" } = {} } = {} } = {}
5368
5446
  } = useThreadConfig();
5369
5447
  const allowBranchPicker = useAllowBranchPicker();
5370
- return /* @__PURE__ */ jsx38(branchPicker_exports.Next, { disabled: !allowBranchPicker, asChild: true, children: /* @__PURE__ */ jsx38(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx38(ChevronRightIcon, {}) }) });
5448
+ return /* @__PURE__ */ jsx40(branchPicker_exports.Next, { disabled: !allowBranchPicker, asChild: true, children: /* @__PURE__ */ jsx40(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx40(ChevronRightIcon, {}) }) });
5371
5449
  });
5372
5450
  BranchPickerNext.displayName = "BranchPickerNext";
5373
5451
  var exports2 = {
@@ -5379,12 +5457,12 @@ var branch_picker_default = Object.assign(BranchPicker, exports2);
5379
5457
 
5380
5458
  // src/ui/base/avatar.tsx
5381
5459
  import * as AvatarPrimitive from "@radix-ui/react-avatar";
5382
- import { jsx as jsx39, jsxs as jsxs5 } from "react/jsx-runtime";
5460
+ import { jsx as jsx41, jsxs as jsxs6 } from "react/jsx-runtime";
5383
5461
  var Avatar = ({ src, alt, fallback }) => {
5384
5462
  if (src == null && fallback == null) return null;
5385
- return /* @__PURE__ */ jsxs5(AvatarRoot, { children: [
5386
- src != null && /* @__PURE__ */ jsx39(AvatarImage, { src, alt }),
5387
- fallback != null && /* @__PURE__ */ jsx39(AvatarFallback, { children: fallback })
5463
+ return /* @__PURE__ */ jsxs6(AvatarRoot, { children: [
5464
+ src != null && /* @__PURE__ */ jsx41(AvatarImage, { src, alt }),
5465
+ fallback != null && /* @__PURE__ */ jsx41(AvatarFallback, { children: fallback })
5388
5466
  ] });
5389
5467
  };
5390
5468
  Avatar.displayName = "Avatar";
@@ -5403,10 +5481,10 @@ AvatarFallback.displayName = "AvatarFallback";
5403
5481
 
5404
5482
  // src/ui/content-part.tsx
5405
5483
  import classNames2 from "classnames";
5406
- import { jsx as jsx40 } from "react/jsx-runtime";
5484
+ import { jsx as jsx42 } from "react/jsx-runtime";
5407
5485
  var Text = () => {
5408
5486
  const status = useSmoothStatus();
5409
- return /* @__PURE__ */ jsx40(
5487
+ return /* @__PURE__ */ jsx42(
5410
5488
  contentPart_exports.Text,
5411
5489
  {
5412
5490
  className: classNames2(
@@ -5421,19 +5499,19 @@ var exports3 = { Text: withSmoothContextProvider(Text) };
5421
5499
  var content_part_default = exports3;
5422
5500
 
5423
5501
  // src/ui/assistant-message.tsx
5424
- import { jsx as jsx41, jsxs as jsxs6 } from "react/jsx-runtime";
5502
+ import { jsx as jsx43, jsxs as jsxs7 } from "react/jsx-runtime";
5425
5503
  var AssistantMessage = () => {
5426
- return /* @__PURE__ */ jsxs6(AssistantMessageRoot, { children: [
5427
- /* @__PURE__ */ jsx41(AssistantMessageAvatar, {}),
5428
- /* @__PURE__ */ jsx41(AssistantMessageContent, {}),
5429
- /* @__PURE__ */ jsx41(branch_picker_default, {}),
5430
- /* @__PURE__ */ jsx41(assistant_action_bar_default, {})
5504
+ return /* @__PURE__ */ jsxs7(AssistantMessageRoot, { children: [
5505
+ /* @__PURE__ */ jsx43(AssistantMessageAvatar, {}),
5506
+ /* @__PURE__ */ jsx43(AssistantMessageContent, {}),
5507
+ /* @__PURE__ */ jsx43(branch_picker_default, {}),
5508
+ /* @__PURE__ */ jsx43(assistant_action_bar_default, {})
5431
5509
  ] });
5432
5510
  };
5433
5511
  AssistantMessage.displayName = "AssistantMessage";
5434
5512
  var AssistantMessageAvatar = () => {
5435
5513
  const { assistantAvatar: avatar = { fallback: "A" } } = useThreadConfig();
5436
- return /* @__PURE__ */ jsx41(Avatar, { ...avatar });
5514
+ return /* @__PURE__ */ jsx43(Avatar, { ...avatar });
5437
5515
  };
5438
5516
  var AssistantMessageRoot = withDefaults(message_exports.Root, {
5439
5517
  className: "aui-assistant-message-root"
@@ -5442,7 +5520,7 @@ AssistantMessageRoot.displayName = "AssistantMessageRoot";
5442
5520
  var AssistantMessageContentWrapper = withDefaults("div", {
5443
5521
  className: "aui-assistant-message-content"
5444
5522
  });
5445
- var AssistantMessageContent = forwardRef24(({ components: componentsProp, ...rest }, ref) => {
5523
+ var AssistantMessageContent = forwardRef26(({ components: componentsProp, ...rest }, ref) => {
5446
5524
  const { tools, assistantMessage: { components = {} } = {} } = useThreadConfig();
5447
5525
  const toolsComponents = useMemo14(
5448
5526
  () => ({
@@ -5457,7 +5535,7 @@ var AssistantMessageContent = forwardRef24(({ components: componentsProp, ...res
5457
5535
  // eslint-disable-next-line react-hooks/exhaustive-deps
5458
5536
  [...tools ?? [], components.ToolFallback]
5459
5537
  );
5460
- return /* @__PURE__ */ jsx41(AssistantMessageContentWrapper, { ...rest, ref, children: /* @__PURE__ */ jsx41(
5538
+ return /* @__PURE__ */ jsx43(AssistantMessageContentWrapper, { ...rest, ref, children: /* @__PURE__ */ jsx43(
5461
5539
  message_exports.Content,
5462
5540
  {
5463
5541
  components: {
@@ -5480,21 +5558,21 @@ var assistant_message_default = Object.assign(
5480
5558
  );
5481
5559
 
5482
5560
  // src/ui/assistant-modal.tsx
5483
- import { forwardRef as forwardRef32 } from "react";
5561
+ import { forwardRef as forwardRef34 } from "react";
5484
5562
  import { BotIcon, ChevronDownIcon } from "lucide-react";
5485
5563
 
5486
5564
  // src/ui/thread.tsx
5487
- import { forwardRef as forwardRef31 } from "react";
5565
+ import { forwardRef as forwardRef33 } from "react";
5488
5566
  import { ArrowDownIcon } from "lucide-react";
5489
5567
 
5490
5568
  // src/ui/composer.tsx
5491
- import { forwardRef as forwardRef26 } from "react";
5569
+ import { forwardRef as forwardRef28 } from "react";
5492
5570
  import { PaperclipIcon, SendHorizontalIcon } from "lucide-react";
5493
5571
 
5494
5572
  // src/ui/base/CircleStopIcon.tsx
5495
- import { jsx as jsx42 } from "react/jsx-runtime";
5573
+ import { jsx as jsx44 } from "react/jsx-runtime";
5496
5574
  var CircleStopIcon = () => {
5497
- return /* @__PURE__ */ jsx42(
5575
+ return /* @__PURE__ */ jsx44(
5498
5576
  "svg",
5499
5577
  {
5500
5578
  xmlns: "http://www.w3.org/2000/svg",
@@ -5502,51 +5580,44 @@ var CircleStopIcon = () => {
5502
5580
  fill: "currentColor",
5503
5581
  width: "16",
5504
5582
  height: "16",
5505
- children: /* @__PURE__ */ jsx42("rect", { width: "10", height: "10", x: "3", y: "3", rx: "2" })
5583
+ children: /* @__PURE__ */ jsx44("rect", { width: "10", height: "10", x: "3", y: "3", rx: "2" })
5506
5584
  }
5507
5585
  );
5508
5586
  };
5509
5587
  CircleStopIcon.displayName = "CircleStopIcon";
5510
5588
 
5511
5589
  // src/ui/composer-attachment.tsx
5512
- import { forwardRef as forwardRef25 } from "react";
5590
+ import { forwardRef as forwardRef27 } from "react";
5513
5591
  import { CircleXIcon } from "lucide-react";
5514
- import { jsx as jsx43, jsxs as jsxs7 } from "react/jsx-runtime";
5515
- var ComposerAttachmentRoot = withDefaults("div", {
5592
+ import { jsx as jsx45, jsxs as jsxs8 } from "react/jsx-runtime";
5593
+ var ComposerAttachmentRoot = withDefaults(attachment_exports.Root, {
5516
5594
  className: "aui-composer-attachment-root"
5517
5595
  });
5518
5596
  ComposerAttachmentRoot.displayName = "ComposerAttachmentRoot";
5519
5597
  var ComposerAttachment2 = () => {
5520
- const attachment = useThreadComposerAttachment((a) => a.attachment);
5521
- return /* @__PURE__ */ jsxs7(ComposerAttachmentRoot, { children: [
5522
- ".",
5523
- attachment.name.split(".").pop(),
5524
- /* @__PURE__ */ jsx43(ComposerAttachmentRemove, {})
5598
+ return /* @__PURE__ */ jsxs8(ComposerAttachmentRoot, { children: [
5599
+ /* @__PURE__ */ jsx45(attachment_exports.unstable_Thumb, {}),
5600
+ /* @__PURE__ */ jsx45(ComposerAttachmentRemove, {})
5525
5601
  ] });
5526
5602
  };
5527
5603
  ComposerAttachment2.displayName = "ComposerAttachment";
5528
- var ComposerAttachmentRemove = forwardRef25((props, ref) => {
5604
+ var ComposerAttachmentRemove = forwardRef27((props, ref) => {
5529
5605
  const {
5530
5606
  strings: {
5531
5607
  composer: { removeAttachment: { tooltip = "Remove file" } = {} } = {}
5532
5608
  } = {}
5533
5609
  } = useThreadConfig();
5534
- const attachmentRuntime = useAttachmentRuntime();
5535
- const handleRemoveAttachment = () => {
5536
- attachmentRuntime.remove();
5537
- };
5538
- return /* @__PURE__ */ jsx43(
5610
+ return /* @__PURE__ */ jsx45(attachment_exports.Remove, { asChild: true, children: /* @__PURE__ */ jsx45(
5539
5611
  TooltipIconButton,
5540
5612
  {
5541
5613
  tooltip,
5542
5614
  className: "aui-composer-attachment-remove",
5543
5615
  side: "top",
5544
5616
  ...props,
5545
- onClick: handleRemoveAttachment,
5546
5617
  ref,
5547
- children: props.children ?? /* @__PURE__ */ jsx43(CircleXIcon, {})
5618
+ children: props.children ?? /* @__PURE__ */ jsx45(CircleXIcon, {})
5548
5619
  }
5549
- );
5620
+ ) });
5550
5621
  });
5551
5622
  ComposerAttachmentRemove.displayName = "ComposerAttachmentRemove";
5552
5623
  var exports5 = {
@@ -5559,7 +5630,7 @@ var composer_attachment_default = Object.assign(
5559
5630
  );
5560
5631
 
5561
5632
  // src/ui/composer.tsx
5562
- import { Fragment as Fragment5, jsx as jsx44, jsxs as jsxs8 } from "react/jsx-runtime";
5633
+ import { Fragment as Fragment6, jsx as jsx46, jsxs as jsxs9 } from "react/jsx-runtime";
5563
5634
  var useAllowAttachments = (ensureCapability = false) => {
5564
5635
  const { composer: { allowAttachments = true } = {} } = useThreadConfig();
5565
5636
  const attachmentsSupported = useThread((t) => t.capabilities.attachments);
@@ -5567,11 +5638,11 @@ var useAllowAttachments = (ensureCapability = false) => {
5567
5638
  };
5568
5639
  var Composer = () => {
5569
5640
  const allowAttachments = useAllowAttachments(true);
5570
- return /* @__PURE__ */ jsxs8(ComposerRoot, { children: [
5571
- allowAttachments && /* @__PURE__ */ jsx44(ComposerAttachments, {}),
5572
- allowAttachments && /* @__PURE__ */ jsx44(ComposerAddAttachment, {}),
5573
- /* @__PURE__ */ jsx44(ComposerInput, { autoFocus: true }),
5574
- /* @__PURE__ */ jsx44(ComposerAction, {})
5641
+ return /* @__PURE__ */ jsxs9(ComposerRoot, { children: [
5642
+ allowAttachments && /* @__PURE__ */ jsx46(ComposerAttachments, {}),
5643
+ allowAttachments && /* @__PURE__ */ jsx46(ComposerAddAttachment, {}),
5644
+ /* @__PURE__ */ jsx46(ComposerInput, { autoFocus: true }),
5645
+ /* @__PURE__ */ jsx46(ComposerAction, {})
5575
5646
  ] });
5576
5647
  };
5577
5648
  Composer.displayName = "Composer";
@@ -5584,14 +5655,14 @@ var ComposerInputStyled = withDefaults(composer_exports.Input, {
5584
5655
  autoFocus: true,
5585
5656
  className: "aui-composer-input"
5586
5657
  });
5587
- var ComposerInput = forwardRef26(
5658
+ var ComposerInput = forwardRef28(
5588
5659
  (props, ref) => {
5589
5660
  const {
5590
5661
  strings: {
5591
5662
  composer: { input: { placeholder = "Write a message..." } = {} } = {}
5592
5663
  } = {}
5593
5664
  } = useThreadConfig();
5594
- return /* @__PURE__ */ jsx44(ComposerInputStyled, { placeholder, ...props, ref });
5665
+ return /* @__PURE__ */ jsx46(ComposerInputStyled, { placeholder, ...props, ref });
5595
5666
  }
5596
5667
  );
5597
5668
  ComposerInput.displayName = "ComposerInput";
@@ -5599,7 +5670,7 @@ var ComposerAttachmentsContainer = withDefaults("div", {
5599
5670
  className: "aui-composer-attachments"
5600
5671
  });
5601
5672
  var ComposerAttachments = ({ components }) => {
5602
- return /* @__PURE__ */ jsx44(ComposerAttachmentsContainer, { children: /* @__PURE__ */ jsx44(
5673
+ return /* @__PURE__ */ jsx46(ComposerAttachmentsContainer, { children: /* @__PURE__ */ jsx46(
5603
5674
  composer_exports.Attachments,
5604
5675
  {
5605
5676
  components: {
@@ -5613,21 +5684,21 @@ var ComposerAttachButton = withDefaults(TooltipIconButton, {
5613
5684
  variant: "default",
5614
5685
  className: "aui-composer-attach"
5615
5686
  });
5616
- var ComposerAddAttachment = forwardRef26((props, ref) => {
5687
+ var ComposerAddAttachment = forwardRef28((props, ref) => {
5617
5688
  const {
5618
5689
  strings: {
5619
5690
  composer: { addAttachment: { tooltip = "Attach file" } = {} } = {}
5620
5691
  } = {}
5621
5692
  } = useThreadConfig();
5622
5693
  const allowAttachments = useAllowAttachments();
5623
- return /* @__PURE__ */ jsx44(composer_exports.AddAttachment, { disabled: !allowAttachments, asChild: true, children: /* @__PURE__ */ jsx44(
5694
+ return /* @__PURE__ */ jsx46(composer_exports.AddAttachment, { disabled: !allowAttachments, asChild: true, children: /* @__PURE__ */ jsx46(
5624
5695
  ComposerAttachButton,
5625
5696
  {
5626
5697
  tooltip,
5627
5698
  variant: "ghost",
5628
5699
  ...props,
5629
5700
  ref,
5630
- children: props.children ?? /* @__PURE__ */ jsx44(PaperclipIcon, {})
5701
+ children: props.children ?? /* @__PURE__ */ jsx46(PaperclipIcon, {})
5631
5702
  }
5632
5703
  ) });
5633
5704
  });
@@ -5638,10 +5709,10 @@ var useAllowCancel = () => {
5638
5709
  };
5639
5710
  var ComposerAction = () => {
5640
5711
  const allowCancel = useAllowCancel();
5641
- if (!allowCancel) return /* @__PURE__ */ jsx44(ComposerSend, {});
5642
- return /* @__PURE__ */ jsxs8(Fragment5, { children: [
5643
- /* @__PURE__ */ jsx44(thread_exports.If, { running: false, children: /* @__PURE__ */ jsx44(ComposerSend, {}) }),
5644
- /* @__PURE__ */ jsx44(thread_exports.If, { running: true, children: /* @__PURE__ */ jsx44(ComposerCancel, {}) })
5712
+ if (!allowCancel) return /* @__PURE__ */ jsx46(ComposerSend, {});
5713
+ return /* @__PURE__ */ jsxs9(Fragment6, { children: [
5714
+ /* @__PURE__ */ jsx46(thread_exports.If, { running: false, children: /* @__PURE__ */ jsx46(ComposerSend, {}) }),
5715
+ /* @__PURE__ */ jsx46(thread_exports.If, { running: true, children: /* @__PURE__ */ jsx46(ComposerCancel, {}) })
5645
5716
  ] });
5646
5717
  };
5647
5718
  ComposerAction.displayName = "ComposerAction";
@@ -5649,22 +5720,22 @@ var ComposerSendButton = withDefaults(TooltipIconButton, {
5649
5720
  variant: "default",
5650
5721
  className: "aui-composer-send"
5651
5722
  });
5652
- var ComposerSend = forwardRef26((props, ref) => {
5723
+ var ComposerSend = forwardRef28((props, ref) => {
5653
5724
  const {
5654
5725
  strings: { composer: { send: { tooltip = "Send" } = {} } = {} } = {}
5655
5726
  } = useThreadConfig();
5656
- return /* @__PURE__ */ jsx44(composer_exports.Send, { asChild: true, children: /* @__PURE__ */ jsx44(ComposerSendButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx44(SendHorizontalIcon, {}) }) });
5727
+ return /* @__PURE__ */ jsx46(composer_exports.Send, { asChild: true, children: /* @__PURE__ */ jsx46(ComposerSendButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx46(SendHorizontalIcon, {}) }) });
5657
5728
  });
5658
5729
  ComposerSend.displayName = "ComposerSend";
5659
5730
  var ComposerCancelButton = withDefaults(TooltipIconButton, {
5660
5731
  variant: "default",
5661
5732
  className: "aui-composer-cancel"
5662
5733
  });
5663
- var ComposerCancel = forwardRef26((props, ref) => {
5734
+ var ComposerCancel = forwardRef28((props, ref) => {
5664
5735
  const {
5665
5736
  strings: { composer: { cancel: { tooltip = "Cancel" } = {} } = {} } = {}
5666
5737
  } = useThreadConfig();
5667
- return /* @__PURE__ */ jsx44(composer_exports.Cancel, { asChild: true, children: /* @__PURE__ */ jsx44(ComposerCancelButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx44(CircleStopIcon, {}) }) });
5738
+ return /* @__PURE__ */ jsx46(composer_exports.Cancel, { asChild: true, children: /* @__PURE__ */ jsx46(ComposerCancelButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx46(CircleStopIcon, {}) }) });
5668
5739
  });
5669
5740
  ComposerCancel.displayName = "ComposerCancel";
5670
5741
  var exports6 = {
@@ -5679,15 +5750,15 @@ var exports6 = {
5679
5750
  var composer_default = Object.assign(Composer, exports6);
5680
5751
 
5681
5752
  // src/ui/thread-welcome.tsx
5682
- import { forwardRef as forwardRef27 } from "react";
5683
- import { jsx as jsx45, jsxs as jsxs9 } from "react/jsx-runtime";
5753
+ import { forwardRef as forwardRef29 } from "react";
5754
+ import { jsx as jsx47, jsxs as jsxs10 } from "react/jsx-runtime";
5684
5755
  var ThreadWelcome = () => {
5685
- return /* @__PURE__ */ jsxs9(ThreadWelcomeRoot, { children: [
5686
- /* @__PURE__ */ jsxs9(ThreadWelcomeCenter, { children: [
5687
- /* @__PURE__ */ jsx45(ThreadWelcomeAvatar, {}),
5688
- /* @__PURE__ */ jsx45(ThreadWelcomeMessage, {})
5756
+ return /* @__PURE__ */ jsxs10(ThreadWelcomeRoot, { children: [
5757
+ /* @__PURE__ */ jsxs10(ThreadWelcomeCenter, { children: [
5758
+ /* @__PURE__ */ jsx47(ThreadWelcomeAvatar, {}),
5759
+ /* @__PURE__ */ jsx47(ThreadWelcomeMessage, {})
5689
5760
  ] }),
5690
- /* @__PURE__ */ jsx45(ThreadWelcomeSuggestions, {})
5761
+ /* @__PURE__ */ jsx47(ThreadWelcomeSuggestions, {})
5691
5762
  ] });
5692
5763
  };
5693
5764
  ThreadWelcome.displayName = "ThreadWelcome";
@@ -5697,22 +5768,22 @@ var ThreadWelcomeRootStyled = withDefaults("div", {
5697
5768
  var ThreadWelcomeCenter = withDefaults("div", {
5698
5769
  className: "aui-thread-welcome-center"
5699
5770
  });
5700
- var ThreadWelcomeRoot = forwardRef27(
5771
+ var ThreadWelcomeRoot = forwardRef29(
5701
5772
  (props, ref) => {
5702
- return /* @__PURE__ */ jsx45(thread_exports.Empty, { children: /* @__PURE__ */ jsx45(ThreadWelcomeRootStyled, { ...props, ref }) });
5773
+ return /* @__PURE__ */ jsx47(thread_exports.Empty, { children: /* @__PURE__ */ jsx47(ThreadWelcomeRootStyled, { ...props, ref }) });
5703
5774
  }
5704
5775
  );
5705
5776
  ThreadWelcomeRoot.displayName = "ThreadWelcomeRoot";
5706
5777
  var ThreadWelcomeAvatar = () => {
5707
5778
  const { assistantAvatar: avatar = { fallback: "A" } } = useThreadConfig();
5708
- return /* @__PURE__ */ jsx45(Avatar, { ...avatar });
5779
+ return /* @__PURE__ */ jsx47(Avatar, { ...avatar });
5709
5780
  };
5710
5781
  var ThreadWelcomeMessageStyled = withDefaults("p", {
5711
5782
  className: "aui-thread-welcome-message"
5712
5783
  });
5713
- var ThreadWelcomeMessage = forwardRef27(({ message: messageProp, ...rest }, ref) => {
5784
+ var ThreadWelcomeMessage = forwardRef29(({ message: messageProp, ...rest }, ref) => {
5714
5785
  const { welcome: { message = "How can I help you today?" } = {} } = useThreadConfig();
5715
- return /* @__PURE__ */ jsx45(ThreadWelcomeMessageStyled, { ...rest, ref, children: messageProp ?? message });
5786
+ return /* @__PURE__ */ jsx47(ThreadWelcomeMessageStyled, { ...rest, ref, children: messageProp ?? message });
5716
5787
  });
5717
5788
  ThreadWelcomeMessage.displayName = "ThreadWelcomeMessage";
5718
5789
  var ThreadWelcomeSuggestionContainer = withDefaults("div", {
@@ -5724,15 +5795,15 @@ var ThreadWelcomeSuggestionStyled = withDefaults(thread_exports.Suggestion, {
5724
5795
  var ThreadWelcomeSuggestion = ({
5725
5796
  suggestion: { text, prompt }
5726
5797
  }) => {
5727
- return /* @__PURE__ */ jsx45(ThreadWelcomeSuggestionStyled, { prompt, method: "replace", autoSend: true, children: /* @__PURE__ */ jsx45("span", { className: "aui-thread-welcome-suggestion-text", children: text ?? prompt }) });
5798
+ return /* @__PURE__ */ jsx47(ThreadWelcomeSuggestionStyled, { prompt, method: "replace", autoSend: true, children: /* @__PURE__ */ jsx47("span", { className: "aui-thread-welcome-suggestion-text", children: text ?? prompt }) });
5728
5799
  };
5729
5800
  var ThreadWelcomeSuggestions = () => {
5730
5801
  const suggestions2 = useThread((t) => t.suggestions);
5731
5802
  const { welcome: { suggestions } = {} } = useThreadConfig();
5732
5803
  const finalSuggestions = suggestions2.length ? suggestions2 : suggestions;
5733
- return /* @__PURE__ */ jsx45(ThreadWelcomeSuggestionContainer, { children: finalSuggestions?.map((suggestion, idx) => {
5804
+ return /* @__PURE__ */ jsx47(ThreadWelcomeSuggestionContainer, { children: finalSuggestions?.map((suggestion, idx) => {
5734
5805
  const key = `${suggestion.prompt}-${idx}`;
5735
- return /* @__PURE__ */ jsx45(ThreadWelcomeSuggestion, { suggestion }, key);
5806
+ return /* @__PURE__ */ jsx47(ThreadWelcomeSuggestion, { suggestion }, key);
5736
5807
  }) });
5737
5808
  };
5738
5809
  ThreadWelcomeSuggestions.displayName = "ThreadWelcomeSuggestions";
@@ -5747,12 +5818,12 @@ var exports7 = {
5747
5818
  var thread_welcome_default = Object.assign(ThreadWelcome, exports7);
5748
5819
 
5749
5820
  // src/ui/user-message.tsx
5750
- import { forwardRef as forwardRef29 } from "react";
5821
+ import { forwardRef as forwardRef31 } from "react";
5751
5822
 
5752
5823
  // src/ui/user-action-bar.tsx
5753
- import { forwardRef as forwardRef28 } from "react";
5824
+ import { forwardRef as forwardRef30 } from "react";
5754
5825
  import { PencilIcon } from "lucide-react";
5755
- import { jsx as jsx46 } from "react/jsx-runtime";
5826
+ import { jsx as jsx48 } from "react/jsx-runtime";
5756
5827
  var useAllowEdit = (ensureCapability = false) => {
5757
5828
  const { userMessage: { allowEdit = true } = {} } = useThreadConfig();
5758
5829
  const editSupported = useThread((t) => t.capabilities.edit);
@@ -5761,19 +5832,19 @@ var useAllowEdit = (ensureCapability = false) => {
5761
5832
  var UserActionBar = () => {
5762
5833
  const allowEdit = useAllowEdit(true);
5763
5834
  if (!allowEdit) return null;
5764
- return /* @__PURE__ */ jsx46(UserActionBarRoot, { hideWhenRunning: true, autohide: "not-last", children: /* @__PURE__ */ jsx46(UserActionBarEdit, {}) });
5835
+ return /* @__PURE__ */ jsx48(UserActionBarRoot, { hideWhenRunning: true, autohide: "not-last", children: /* @__PURE__ */ jsx48(UserActionBarEdit, {}) });
5765
5836
  };
5766
5837
  UserActionBar.displayName = "UserActionBar";
5767
5838
  var UserActionBarRoot = withDefaults(actionBar_exports.Root, {
5768
5839
  className: "aui-user-action-bar-root"
5769
5840
  });
5770
5841
  UserActionBarRoot.displayName = "UserActionBarRoot";
5771
- var UserActionBarEdit = forwardRef28((props, ref) => {
5842
+ var UserActionBarEdit = forwardRef30((props, ref) => {
5772
5843
  const {
5773
5844
  strings: { userMessage: { edit: { tooltip = "Edit" } = {} } = {} } = {}
5774
5845
  } = useThreadConfig();
5775
5846
  const allowEdit = useAllowEdit();
5776
- return /* @__PURE__ */ jsx46(actionBar_exports.Edit, { disabled: !allowEdit, asChild: true, children: /* @__PURE__ */ jsx46(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx46(PencilIcon, {}) }) });
5847
+ return /* @__PURE__ */ jsx48(actionBar_exports.Edit, { disabled: !allowEdit, asChild: true, children: /* @__PURE__ */ jsx48(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx48(PencilIcon, {}) }) });
5777
5848
  });
5778
5849
  UserActionBarEdit.displayName = "UserActionBarEdit";
5779
5850
  var exports8 = {
@@ -5783,17 +5854,13 @@ var exports8 = {
5783
5854
  var user_action_bar_default = Object.assign(UserActionBar, exports8);
5784
5855
 
5785
5856
  // src/ui/user-message-attachment.tsx
5786
- import { jsxs as jsxs10 } from "react/jsx-runtime";
5787
- var UserMessageAttachmentRoot = withDefaults("div", {
5857
+ import { jsx as jsx49 } from "react/jsx-runtime";
5858
+ var UserMessageAttachmentRoot = withDefaults(attachment_exports.Root, {
5788
5859
  className: "aui-user-message-attachment-root"
5789
5860
  });
5790
5861
  UserMessageAttachmentRoot.displayName = "UserMessageAttachmentRoot";
5791
5862
  var UserMessageAttachment = () => {
5792
- const attachment = useAttachment((a) => a.attachment);
5793
- return /* @__PURE__ */ jsxs10(UserMessageAttachmentRoot, { children: [
5794
- ".",
5795
- attachment.name.split(".").pop()
5796
- ] });
5863
+ return /* @__PURE__ */ jsx49(UserMessageAttachmentRoot, { children: /* @__PURE__ */ jsx49(attachment_exports.unstable_Thumb, {}) });
5797
5864
  };
5798
5865
  UserMessageAttachment.displayName = "UserMessageAttachment";
5799
5866
  var exports9 = {
@@ -5805,13 +5872,13 @@ var user_message_attachment_default = Object.assign(
5805
5872
  );
5806
5873
 
5807
5874
  // src/ui/user-message.tsx
5808
- import { jsx as jsx47, jsxs as jsxs11 } from "react/jsx-runtime";
5875
+ import { jsx as jsx50, jsxs as jsxs11 } from "react/jsx-runtime";
5809
5876
  var UserMessage = () => {
5810
5877
  return /* @__PURE__ */ jsxs11(UserMessageRoot, { children: [
5811
- /* @__PURE__ */ jsx47(UserMessageAttachments, {}),
5812
- /* @__PURE__ */ jsx47(user_action_bar_default, {}),
5813
- /* @__PURE__ */ jsx47(UserMessageContent, {}),
5814
- /* @__PURE__ */ jsx47(branch_picker_default, {})
5878
+ /* @__PURE__ */ jsx50(UserMessageAttachments, {}),
5879
+ /* @__PURE__ */ jsx50(user_action_bar_default, {}),
5880
+ /* @__PURE__ */ jsx50(UserMessageContent, {}),
5881
+ /* @__PURE__ */ jsx50(branch_picker_default, {})
5815
5882
  ] });
5816
5883
  };
5817
5884
  UserMessage.displayName = "UserMessage";
@@ -5822,9 +5889,9 @@ UserMessageRoot.displayName = "UserMessageRoot";
5822
5889
  var UserMessageContentWrapper = withDefaults("div", {
5823
5890
  className: "aui-user-message-content"
5824
5891
  });
5825
- var UserMessageContent = forwardRef29(
5892
+ var UserMessageContent = forwardRef31(
5826
5893
  ({ components, ...props }, ref) => {
5827
- return /* @__PURE__ */ jsx47(UserMessageContentWrapper, { ...props, ref, children: /* @__PURE__ */ jsx47(
5894
+ return /* @__PURE__ */ jsx50(UserMessageContentWrapper, { ...props, ref, children: /* @__PURE__ */ jsx50(
5828
5895
  message_exports.Content,
5829
5896
  {
5830
5897
  components: {
@@ -5842,7 +5909,7 @@ var UserMessageAttachmentsContainer = withDefaults("div", {
5842
5909
  var UserMessageAttachments = ({
5843
5910
  components
5844
5911
  }) => {
5845
- return /* @__PURE__ */ jsx47(message_exports.If, { hasAttachments: true, children: /* @__PURE__ */ jsx47(UserMessageAttachmentsContainer, { children: /* @__PURE__ */ jsx47(
5912
+ return /* @__PURE__ */ jsx50(message_exports.If, { hasAttachments: true, children: /* @__PURE__ */ jsx50(UserMessageAttachmentsContainer, { children: /* @__PURE__ */ jsx50(
5846
5913
  message_exports.Attachments,
5847
5914
  {
5848
5915
  components: {
@@ -5860,14 +5927,14 @@ var exports10 = {
5860
5927
  var user_message_default = Object.assign(UserMessage, exports10);
5861
5928
 
5862
5929
  // src/ui/edit-composer.tsx
5863
- import { forwardRef as forwardRef30 } from "react";
5864
- import { jsx as jsx48, jsxs as jsxs12 } from "react/jsx-runtime";
5930
+ import { forwardRef as forwardRef32 } from "react";
5931
+ import { jsx as jsx51, jsxs as jsxs12 } from "react/jsx-runtime";
5865
5932
  var EditComposer = () => {
5866
5933
  return /* @__PURE__ */ jsxs12(EditComposerRoot, { children: [
5867
- /* @__PURE__ */ jsx48(EditComposerInput, {}),
5934
+ /* @__PURE__ */ jsx51(EditComposerInput, {}),
5868
5935
  /* @__PURE__ */ jsxs12(EditComposerFooter, { children: [
5869
- /* @__PURE__ */ jsx48(EditComposerCancel, {}),
5870
- /* @__PURE__ */ jsx48(EditComposerSend, {})
5936
+ /* @__PURE__ */ jsx51(EditComposerCancel, {}),
5937
+ /* @__PURE__ */ jsx51(EditComposerSend, {})
5871
5938
  ] })
5872
5939
  ] });
5873
5940
  };
@@ -5884,23 +5951,23 @@ var EditComposerFooter = withDefaults("div", {
5884
5951
  className: "aui-edit-composer-footer"
5885
5952
  });
5886
5953
  EditComposerFooter.displayName = "EditComposerFooter";
5887
- var EditComposerCancel = forwardRef30(
5954
+ var EditComposerCancel = forwardRef32(
5888
5955
  (props, ref) => {
5889
5956
  const {
5890
5957
  strings: {
5891
5958
  editComposer: { cancel: { label = "Cancel" } = {} } = {}
5892
5959
  } = {}
5893
5960
  } = useThreadConfig();
5894
- return /* @__PURE__ */ jsx48(composer_exports.Cancel, { asChild: true, children: /* @__PURE__ */ jsx48(Button, { variant: "ghost", ...props, ref, children: props.children ?? label }) });
5961
+ return /* @__PURE__ */ jsx51(composer_exports.Cancel, { asChild: true, children: /* @__PURE__ */ jsx51(Button, { variant: "ghost", ...props, ref, children: props.children ?? label }) });
5895
5962
  }
5896
5963
  );
5897
5964
  EditComposerCancel.displayName = "EditComposerCancel";
5898
- var EditComposerSend = forwardRef30(
5965
+ var EditComposerSend = forwardRef32(
5899
5966
  (props, ref) => {
5900
5967
  const {
5901
5968
  strings: { editComposer: { send: { label = "Send" } = {} } = {} } = {}
5902
5969
  } = useThreadConfig();
5903
- return /* @__PURE__ */ jsx48(composer_exports.Send, { asChild: true, children: /* @__PURE__ */ jsx48(Button, { ...props, ref, children: props.children ?? label }) });
5970
+ return /* @__PURE__ */ jsx51(composer_exports.Send, { asChild: true, children: /* @__PURE__ */ jsx51(Button, { ...props, ref, children: props.children ?? label }) });
5904
5971
  }
5905
5972
  );
5906
5973
  EditComposerSend.displayName = "EditComposerSend";
@@ -5914,25 +5981,30 @@ var exports11 = {
5914
5981
  var edit_composer_default = Object.assign(EditComposer, exports11);
5915
5982
 
5916
5983
  // src/ui/thread.tsx
5917
- import { Fragment as Fragment6, jsx as jsx49, jsxs as jsxs13 } from "react/jsx-runtime";
5984
+ import { Fragment as Fragment7, jsx as jsx52, jsxs as jsxs13 } from "react/jsx-runtime";
5918
5985
  var Thread = (config) => {
5919
- const { components: { Composer: ComposerComponent = composer_default } = {} } = config;
5920
- return /* @__PURE__ */ jsx49(ThreadRoot, { config, children: /* @__PURE__ */ jsxs13(ThreadViewport, { children: [
5921
- /* @__PURE__ */ jsx49(thread_welcome_default, {}),
5922
- /* @__PURE__ */ jsx49(ThreadMessages, {}),
5923
- /* @__PURE__ */ jsx49(ThreadFollowupSuggestions, {}),
5986
+ const {
5987
+ components: {
5988
+ Composer: ComposerComponent = composer_default,
5989
+ ThreadWelcome: ThreadWelcomeComponent = thread_welcome_default
5990
+ } = {}
5991
+ } = config;
5992
+ return /* @__PURE__ */ jsx52(ThreadRoot, { config, children: /* @__PURE__ */ jsxs13(ThreadViewport, { children: [
5993
+ /* @__PURE__ */ jsx52(ThreadWelcomeComponent, {}),
5994
+ /* @__PURE__ */ jsx52(ThreadMessages, {}),
5995
+ /* @__PURE__ */ jsx52(ThreadFollowupSuggestions, {}),
5924
5996
  /* @__PURE__ */ jsxs13(ThreadViewportFooter, { children: [
5925
- /* @__PURE__ */ jsx49(ThreadScrollToBottom, {}),
5926
- /* @__PURE__ */ jsx49(ComposerComponent, {})
5997
+ /* @__PURE__ */ jsx52(ThreadScrollToBottom, {}),
5998
+ /* @__PURE__ */ jsx52(ComposerComponent, {})
5927
5999
  ] })
5928
6000
  ] }) });
5929
6001
  };
5930
6002
  var ThreadRootStyled = withDefaults(thread_exports.Root, {
5931
6003
  className: "aui-root aui-thread-root"
5932
6004
  });
5933
- var ThreadRoot = forwardRef31(
6005
+ var ThreadRoot = forwardRef33(
5934
6006
  ({ config, ...props }, ref) => {
5935
- return /* @__PURE__ */ jsx49(ThreadConfigProvider, { config, children: /* @__PURE__ */ jsx49(ThreadRootStyled, { ...props, ref }) });
6007
+ return /* @__PURE__ */ jsx52(ThreadConfigProvider, { config, children: /* @__PURE__ */ jsx52(ThreadRootStyled, { ...props, ref }) });
5936
6008
  }
5937
6009
  );
5938
6010
  ThreadRoot.displayName = "ThreadRoot";
@@ -5946,8 +6018,8 @@ var ThreadViewportFooter = withDefaults("div", {
5946
6018
  ThreadViewportFooter.displayName = "ThreadViewportFooter";
5947
6019
  var SystemMessage = () => null;
5948
6020
  var ThreadMessages = ({ components, unstable_flexGrowDiv: flexGrowDiv = true, ...rest }) => {
5949
- return /* @__PURE__ */ jsxs13(Fragment6, { children: [
5950
- /* @__PURE__ */ jsx49(
6021
+ return /* @__PURE__ */ jsxs13(Fragment7, { children: [
6022
+ /* @__PURE__ */ jsx52(
5951
6023
  thread_exports.Messages,
5952
6024
  {
5953
6025
  components: {
@@ -5959,13 +6031,13 @@ var ThreadMessages = ({ components, unstable_flexGrowDiv: flexGrowDiv = true, ..
5959
6031
  ...rest
5960
6032
  }
5961
6033
  ),
5962
- flexGrowDiv && /* @__PURE__ */ jsx49(thread_exports.If, { empty: false, children: /* @__PURE__ */ jsx49("div", { style: { flexGrow: 1 } }) })
6034
+ flexGrowDiv && /* @__PURE__ */ jsx52(thread_exports.If, { empty: false, children: /* @__PURE__ */ jsx52("div", { style: { flexGrow: 1 } }) })
5963
6035
  ] });
5964
6036
  };
5965
6037
  ThreadMessages.displayName = "ThreadMessages";
5966
6038
  var ThreadFollowupSuggestions = () => {
5967
6039
  const suggestions = useThread((t) => t.suggestions);
5968
- return /* @__PURE__ */ jsx49(thread_exports.If, { empty: false, running: false, children: /* @__PURE__ */ jsx49("div", { className: "aui-thread-followup-suggestions", children: suggestions?.map((suggestion, idx) => /* @__PURE__ */ jsx49(
6040
+ return /* @__PURE__ */ jsx52(thread_exports.If, { empty: false, running: false, children: /* @__PURE__ */ jsx52("div", { className: "aui-thread-followup-suggestions", children: suggestions?.map((suggestion, idx) => /* @__PURE__ */ jsx52(
5969
6041
  thread_exports.Suggestion,
5970
6042
  {
5971
6043
  className: "aui-thread-followup-suggestion",
@@ -5981,13 +6053,13 @@ var ThreadScrollToBottomIconButton = withDefaults(TooltipIconButton, {
5981
6053
  variant: "outline",
5982
6054
  className: "aui-thread-scroll-to-bottom"
5983
6055
  });
5984
- var ThreadScrollToBottom = forwardRef31((props, ref) => {
6056
+ var ThreadScrollToBottom = forwardRef33((props, ref) => {
5985
6057
  const {
5986
6058
  strings: {
5987
6059
  thread: { scrollToBottom: { tooltip = "Scroll to bottom" } = {} } = {}
5988
6060
  } = {}
5989
6061
  } = useThreadConfig();
5990
- return /* @__PURE__ */ jsx49(thread_exports.ScrollToBottom, { asChild: true, children: /* @__PURE__ */ jsx49(ThreadScrollToBottomIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx49(ArrowDownIcon, {}) }) });
6062
+ return /* @__PURE__ */ jsx52(thread_exports.ScrollToBottom, { asChild: true, children: /* @__PURE__ */ jsx52(ThreadScrollToBottomIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx52(ArrowDownIcon, {}) }) });
5991
6063
  });
5992
6064
  ThreadScrollToBottom.displayName = "ThreadScrollToBottom";
5993
6065
  var exports12 = {
@@ -6001,20 +6073,20 @@ var exports12 = {
6001
6073
  var thread_default = Object.assign(Thread, exports12);
6002
6074
 
6003
6075
  // src/ui/assistant-modal.tsx
6004
- import { Fragment as Fragment7, jsx as jsx50, jsxs as jsxs14 } from "react/jsx-runtime";
6076
+ import { Fragment as Fragment8, jsx as jsx53, jsxs as jsxs14 } from "react/jsx-runtime";
6005
6077
  var AssistantModal = (config) => {
6006
6078
  return /* @__PURE__ */ jsxs14(AssistantModalRoot, { config, children: [
6007
- /* @__PURE__ */ jsx50(AssistantModalTrigger, {}),
6008
- /* @__PURE__ */ jsx50(AssistantModalContent, { children: /* @__PURE__ */ jsx50(thread_default, {}) })
6079
+ /* @__PURE__ */ jsx53(AssistantModalTrigger, {}),
6080
+ /* @__PURE__ */ jsx53(AssistantModalContent, { children: /* @__PURE__ */ jsx53(thread_default, {}) })
6009
6081
  ] });
6010
6082
  };
6011
6083
  AssistantModal.displayName = "AssistantModal";
6012
6084
  var AssistantModalRoot = ({ config, ...props }) => {
6013
- return /* @__PURE__ */ jsx50(ThreadConfigProvider, { config, children: /* @__PURE__ */ jsx50(assistantModal_exports.Root, { ...props }) });
6085
+ return /* @__PURE__ */ jsx53(ThreadConfigProvider, { config, children: /* @__PURE__ */ jsx53(assistantModal_exports.Root, { ...props }) });
6014
6086
  };
6015
6087
  AssistantModalRoot.displayName = "AssistantModalRoot";
6016
- var AssistantModalTrigger = forwardRef32((props, ref) => {
6017
- return /* @__PURE__ */ jsx50(AssistantModalAnchor, { children: /* @__PURE__ */ jsx50(assistantModal_exports.Trigger, { asChild: true, children: /* @__PURE__ */ jsx50(AssistantModalButton, { ...props, ref }) }) });
6088
+ var AssistantModalTrigger = forwardRef34((props, ref) => {
6089
+ return /* @__PURE__ */ jsx53(AssistantModalAnchor, { children: /* @__PURE__ */ jsx53(assistantModal_exports.Trigger, { asChild: true, children: /* @__PURE__ */ jsx53(AssistantModalButton, { ...props, ref }) }) });
6018
6090
  });
6019
6091
  AssistantModalTrigger.displayName = "AssistantModalTrigger";
6020
6092
  var AssistantModalAnchor = withDefaults(assistantModal_exports.Anchor, {
@@ -6025,7 +6097,7 @@ var ModalButtonStyled = withDefaults(TooltipIconButton, {
6025
6097
  variant: "default",
6026
6098
  className: "aui-modal-button"
6027
6099
  });
6028
- var AssistantModalButton = forwardRef32(({ "data-state": state, ...rest }, ref) => {
6100
+ var AssistantModalButton = forwardRef34(({ "data-state": state, ...rest }, ref) => {
6029
6101
  const {
6030
6102
  strings: {
6031
6103
  assistantModal: {
@@ -6039,7 +6111,7 @@ var AssistantModalButton = forwardRef32(({ "data-state": state, ...rest }, ref)
6039
6111
  } = {}
6040
6112
  } = useThreadConfig();
6041
6113
  const tooltip = state === "open" ? openTooltip : closedTooltip;
6042
- return /* @__PURE__ */ jsx50(
6114
+ return /* @__PURE__ */ jsx53(
6043
6115
  ModalButtonStyled,
6044
6116
  {
6045
6117
  side: "left",
@@ -6047,15 +6119,15 @@ var AssistantModalButton = forwardRef32(({ "data-state": state, ...rest }, ref)
6047
6119
  "data-state": state,
6048
6120
  ...rest,
6049
6121
  ref,
6050
- children: rest.children ?? /* @__PURE__ */ jsxs14(Fragment7, { children: [
6051
- /* @__PURE__ */ jsx50(
6122
+ children: rest.children ?? /* @__PURE__ */ jsxs14(Fragment8, { children: [
6123
+ /* @__PURE__ */ jsx53(
6052
6124
  BotIcon,
6053
6125
  {
6054
6126
  "data-state": state,
6055
6127
  className: "aui-modal-button-closed-icon"
6056
6128
  }
6057
6129
  ),
6058
- /* @__PURE__ */ jsx50(
6130
+ /* @__PURE__ */ jsx53(
6059
6131
  ChevronDownIcon,
6060
6132
  {
6061
6133
  "data-state": state,
@@ -6087,6 +6159,7 @@ export {
6087
6159
  assistant_modal_default as AssistantModal,
6088
6160
  assistantModal_exports as AssistantModalPrimitive,
6089
6161
  AssistantRuntimeProvider,
6162
+ attachment_exports as AttachmentPrimitive,
6090
6163
  branch_picker_default as BranchPicker,
6091
6164
  branchPicker_exports as BranchPickerPrimitive,
6092
6165
  composer_default as Composer,