@truefoundry/trueforge-ui 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +26 -15
  2. package/README.md +38 -38
  3. package/dist/{ConnectorSettings-H37ZFC6Z.js → ConnectorSettings-4CYGRWPH.js} +6 -4
  4. package/dist/{ConnectorSettings-H37ZFC6Z.js.map → ConnectorSettings-4CYGRWPH.js.map} +1 -1
  5. package/dist/{DockLayout-KEMFRWIR.js → DockLayout-FEDQX2UT.js} +8 -6
  6. package/dist/{DockLayout-KEMFRWIR.js.map → DockLayout-FEDQX2UT.js.map} +1 -1
  7. package/dist/{DrawerLayout-ZVWCKEIS.js → DrawerLayout-NMA7P64K.js} +10 -7
  8. package/dist/{DrawerLayout-ZVWCKEIS.js.map → DrawerLayout-NMA7P64K.js.map} +1 -1
  9. package/dist/{ModelSettings-QJMYHCMD.js → ModelSettings-H5FKRZLK.js} +6 -4
  10. package/dist/{ModelSettings-QJMYHCMD.js.map → ModelSettings-H5FKRZLK.js.map} +1 -1
  11. package/dist/{SandboxSettings-BUBMLW7Q.js → SandboxSettings-CBSC3C3G.js} +6 -4
  12. package/dist/{SandboxSettings-BUBMLW7Q.js.map → SandboxSettings-CBSC3C3G.js.map} +1 -1
  13. package/dist/{SettingsBuilder-26XSGIHK.js → SettingsBuilder-EGSH7BUA.js} +9 -7
  14. package/dist/{SettingsBuilder-26XSGIHK.js.map → SettingsBuilder-EGSH7BUA.js.map} +1 -1
  15. package/dist/ShellRouteSync-53FTXNZZ.js +172 -0
  16. package/dist/ShellRouteSync-53FTXNZZ.js.map +1 -0
  17. package/dist/{SidebarLayout-F3XFXW7B.js → SidebarLayout-5WM2BHZG.js} +10 -7
  18. package/dist/{SidebarLayout-F3XFXW7B.js.map → SidebarLayout-5WM2BHZG.js.map} +1 -1
  19. package/dist/{SkillSettings-IRMGDFRG.js → SkillSettings-A2OQSQUT.js} +6 -4
  20. package/dist/{SkillSettings-IRMGDFRG.js.map → SkillSettings-A2OQSQUT.js.map} +1 -1
  21. package/dist/TrueForgeUIWithRouter-2AQ3HW6L.js +30 -0
  22. package/dist/TrueForgeUIWithRouter-2AQ3HW6L.js.map +1 -0
  23. package/dist/{WidgetLayout-SZMABKIR.js → WidgetLayout-IKGVAZFV.js} +8 -6
  24. package/dist/{WidgetLayout-SZMABKIR.js.map → WidgetLayout-IKGVAZFV.js.map} +1 -1
  25. package/dist/{chunk-7EEOWDLE.js → chunk-4STVL6W6.js} +9 -7
  26. package/dist/{chunk-7EEOWDLE.js.map → chunk-4STVL6W6.js.map} +1 -1
  27. package/dist/chunk-7LAVNBJC.js +477 -0
  28. package/dist/chunk-7LAVNBJC.js.map +1 -0
  29. package/dist/{chunk-LRQHHZDX.js → chunk-BMLCISMH.js} +6 -4
  30. package/dist/{chunk-LRQHHZDX.js.map → chunk-BMLCISMH.js.map} +1 -1
  31. package/dist/chunk-EK6OUU24.js +441 -0
  32. package/dist/chunk-EK6OUU24.js.map +1 -0
  33. package/dist/chunk-FXCYLEFB.js +64 -0
  34. package/dist/chunk-FXCYLEFB.js.map +1 -0
  35. package/dist/{chunk-H7DR64W3.js → chunk-GJ3SK4G3.js} +38 -93
  36. package/dist/chunk-GJ3SK4G3.js.map +1 -0
  37. package/dist/chunk-IDXUUOSM.js +436 -0
  38. package/dist/chunk-IDXUUOSM.js.map +1 -0
  39. package/dist/{chunk-QGNLP2EE.js → chunk-MIHHZQOQ.js} +6 -4
  40. package/dist/{chunk-QGNLP2EE.js.map → chunk-MIHHZQOQ.js.map} +1 -1
  41. package/dist/chunk-YIWUG6MC.js +101 -0
  42. package/dist/chunk-YIWUG6MC.js.map +1 -0
  43. package/dist/index.d.ts +54 -9
  44. package/dist/index.js +39 -426
  45. package/dist/index.js.map +1 -1
  46. package/dist/plugins/trueforge-agent-server-adapter/index.js.map +1 -1
  47. package/package.json +14 -6
  48. package/dist/chunk-H7DR64W3.js.map +0 -1
  49. package/dist/chunk-XAZ5HJXV.js +0 -862
  50. package/dist/chunk-XAZ5HJXV.js.map +0 -1
@@ -1,3 +1,7 @@
1
+ import {
2
+ ComposerBusyProvider,
3
+ useComposerBusyState
4
+ } from "./chunk-FXCYLEFB.js";
1
5
  import {
2
6
  useAui,
3
7
  useAuiState
@@ -19,16 +23,18 @@ import {
19
23
  useSlot,
20
24
  useSlotIsDefault,
21
25
  useToasterOptional
22
- } from "./chunk-QGNLP2EE.js";
26
+ } from "./chunk-MIHHZQOQ.js";
23
27
  import {
24
28
  DraftCatalogProvider,
25
29
  Icon,
26
30
  auiButtonClass,
31
+ useCompactLayout
32
+ } from "./chunk-EK6OUU24.js";
33
+ import {
27
34
  libraryAgentId,
28
- useCompactLayout,
29
35
  useOptionalServer,
30
36
  useOptionalShellMode
31
- } from "./chunk-XAZ5HJXV.js";
37
+ } from "./chunk-IDXUUOSM.js";
32
38
  import {
33
39
  cn
34
40
  } from "./chunk-DTF7ZMUJ.js";
@@ -1139,64 +1145,6 @@ function ComposerAttachmentPickerContainer() {
1139
1145
  return /* @__PURE__ */ jsx11(ComposerPrimitive.AddAttachment, { asChild: true, children: /* @__PURE__ */ jsx11(AttachmentPickerButton, {}) });
1140
1146
  }
1141
1147
 
1142
- // src/hooks/useComposerBusyState.ts
1143
- import { useThreadIsRunning as useThreadIsRunning3 } from "@assistant-ui/core/react";
1144
- import { createContext as createContext2, createElement, useCallback as useCallback6, useContext as useContext2, useEffect as useEffect6, useState as useState10 } from "react";
1145
- var ComposerBusyContext = createContext2(null);
1146
- var busyFailureListeners = /* @__PURE__ */ new Set();
1147
- function notifyComposerBusyFailure() {
1148
- for (const listener of busyFailureListeners) {
1149
- listener();
1150
- }
1151
- }
1152
- function useComposerBusyStateValue() {
1153
- const isRunning = useThreadIsRunning3();
1154
- const [isSubmitting, setIsSubmitting] = useState10(false);
1155
- useEffect6(() => {
1156
- if (!isRunning) {
1157
- setIsSubmitting(false);
1158
- }
1159
- }, [isRunning]);
1160
- useEffect6(() => {
1161
- const clearSubmitting = () => {
1162
- setIsSubmitting(false);
1163
- };
1164
- busyFailureListeners.add(clearSubmitting);
1165
- return () => {
1166
- busyFailureListeners.delete(clearSubmitting);
1167
- };
1168
- }, []);
1169
- const isBusy = isRunning || isSubmitting;
1170
- const resetBusy = useCallback6(() => {
1171
- setIsSubmitting(false);
1172
- }, []);
1173
- const send = useCallback6((sendFn) => {
1174
- setIsSubmitting(true);
1175
- try {
1176
- const result = sendFn();
1177
- if (result != null && typeof result.then === "function") {
1178
- void result.catch(() => {
1179
- setIsSubmitting(false);
1180
- });
1181
- }
1182
- } catch {
1183
- setIsSubmitting(false);
1184
- }
1185
- }, []);
1186
- return { isBusy, isRunning, isSubmitting, send, resetBusy };
1187
- }
1188
- function ComposerBusyProvider({ children }) {
1189
- const value = useComposerBusyStateValue();
1190
- return createElement(ComposerBusyContext.Provider, { value }, children);
1191
- }
1192
- function useComposerBusyState() {
1193
- const value = useContext2(ComposerBusyContext);
1194
- if (value == null) {
1195
- throw new Error("useComposerBusyState must be used within ComposerBusyProvider");
1196
- }
1197
- return value;
1198
- }
1199
-
1200
1148
  // src/hooks/useComposerPauseView.ts
1201
1149
  import { useAuiState as useAuiState8 } from "@assistant-ui/react";
1202
1150
  import { useTrueFoundryToolResponses as useTrueFoundryToolResponses2 } from "@truefoundry/assistant-ui-runtime";
@@ -1220,13 +1168,13 @@ function useComposerPauseView() {
1220
1168
  }
1221
1169
 
1222
1170
  // src/containers/McpAuthContainer.tsx
1223
- import { useThreadIsRunning as useThreadIsRunning4 } from "@assistant-ui/core/react";
1171
+ import { useThreadIsRunning as useThreadIsRunning3 } from "@assistant-ui/core/react";
1224
1172
  import { useTrueFoundryMcpAuth } from "@truefoundry/assistant-ui-runtime";
1225
1173
  import { jsx as jsx12 } from "react/jsx-runtime";
1226
1174
  function McpAuthContainer() {
1227
1175
  const McpAuthPrompt = useSlot("McpAuthPrompt");
1228
1176
  const { pending, resume } = useTrueFoundryMcpAuth();
1229
- const isRunning = useThreadIsRunning4();
1177
+ const isRunning = useThreadIsRunning3();
1230
1178
  if (!pending) return null;
1231
1179
  const handleConnect = (serverId) => {
1232
1180
  const server = pending.mcpServers.find((s) => s.id === serverId);
@@ -1367,16 +1315,16 @@ function ComposerContainer({
1367
1315
 
1368
1316
  // src/containers/HistoryLoaderContainer.tsx
1369
1317
  import { useTrueFoundryHistoryPagination } from "@truefoundry/assistant-ui-runtime";
1370
- import { useCallback as useCallback7, useEffect as useEffect7, useRef as useRef7, useState as useState11 } from "react";
1318
+ import { useCallback as useCallback6, useEffect as useEffect6, useRef as useRef7, useState as useState10 } from "react";
1371
1319
  import { jsx as jsx14 } from "react/jsx-runtime";
1372
1320
  var TOP_THRESHOLD_PX = 200;
1373
1321
  var VIEWPORT_SELECTOR = '[data-slot="aui_thread-viewport"]';
1374
1322
  function HistoryLoaderContainer() {
1375
1323
  const HistoryLoader = useSlot("HistoryLoader");
1376
1324
  const { hasOlderHistory, isLoadingOlderHistory, loadOlderHistory } = useTrueFoundryHistoryPagination();
1377
- const [sentinel, setSentinel] = useState11(null);
1325
+ const [sentinel, setSentinel] = useState10(null);
1378
1326
  const inflightRef = useRef7(false);
1379
- const maybeLoadOlder = useCallback7(async () => {
1327
+ const maybeLoadOlder = useCallback6(async () => {
1380
1328
  if (inflightRef.current) return;
1381
1329
  inflightRef.current = true;
1382
1330
  const viewport = sentinel?.closest(VIEWPORT_SELECTOR) ?? null;
@@ -1396,7 +1344,7 @@ function HistoryLoaderContainer() {
1396
1344
  inflightRef.current = false;
1397
1345
  }
1398
1346
  }, [sentinel, loadOlderHistory]);
1399
- useEffect7(() => {
1347
+ useEffect6(() => {
1400
1348
  if (sentinel == null || !hasOlderHistory) return;
1401
1349
  const viewport = sentinel.closest(VIEWPORT_SELECTOR);
1402
1350
  const observer = new IntersectionObserver(
@@ -1425,7 +1373,7 @@ function ResumeUnavailableContainer() {
1425
1373
  }
1426
1374
 
1427
1375
  // src/containers/UserEditComposerContainer.tsx
1428
- import { useComposerCancel, useComposerSend, useThreadIsRunning as useThreadIsRunning5 } from "@assistant-ui/core/react";
1376
+ import { useComposerCancel, useComposerSend, useThreadIsRunning as useThreadIsRunning4 } from "@assistant-ui/core/react";
1429
1377
  import { ComposerPrimitive as ComposerPrimitive3, MessagePrimitive as MessagePrimitive4, useAuiState as useAuiState10 } from "@assistant-ui/react";
1430
1378
  import { jsx as jsx16, jsxs as jsxs2 } from "react/jsx-runtime";
1431
1379
  function ReadOnlyMessageAttachments() {
@@ -1438,7 +1386,7 @@ function ReadOnlyMessageAttachments() {
1438
1386
  function UserEditComposerContainer() {
1439
1387
  const UserMessageEdit = useSlot("UserMessageEdit");
1440
1388
  const MessageTimestamp = useSlot("MessageTimestamp");
1441
- const isRunning = useThreadIsRunning5();
1389
+ const isRunning = useThreadIsRunning4();
1442
1390
  const createdAt = useAuiState10((s) => s.message.createdAt);
1443
1391
  const { cancel, disabled: cancelDisabled } = useComposerCancel();
1444
1392
  const { disabled: sendDisabled } = useComposerSend();
@@ -1473,13 +1421,13 @@ function UserEditComposerContainer() {
1473
1421
  }
1474
1422
 
1475
1423
  // src/containers/UserMessageContainer.tsx
1476
- import { useActionBarCopy as useActionBarCopy2, useActionBarEdit, useThreadIsRunning as useThreadIsRunning6 } from "@assistant-ui/core/react";
1424
+ import { useActionBarCopy as useActionBarCopy2, useActionBarEdit, useThreadIsRunning as useThreadIsRunning5 } from "@assistant-ui/core/react";
1477
1425
  import { MessagePrimitive as MessagePrimitive5, useAui as useAui4, useAuiState as useAuiState11 } from "@assistant-ui/react";
1478
1426
  import { jsx as jsx17 } from "react/jsx-runtime";
1479
1427
  function UserMessageContainer() {
1480
1428
  const UserMessageBubble = useSlot("UserMessageBubble");
1481
1429
  const UserMessageActionBar = useSlot("UserMessageActionBar");
1482
- const isRunning = useThreadIsRunning6();
1430
+ const isRunning = useThreadIsRunning5();
1483
1431
  const aui = useAui4();
1484
1432
  const createdAt = useAuiState11((s) => s.message.createdAt);
1485
1433
  const text = useAuiState11(
@@ -1514,23 +1462,23 @@ function UserMessageContainer() {
1514
1462
 
1515
1463
  // src/containers/ThreadContainer.tsx
1516
1464
  import { ThreadPrimitive, useAuiState as useAuiState12 } from "@assistant-ui/react";
1517
- import { useEffect as useEffect9 } from "react";
1465
+ import { useEffect as useEffect8 } from "react";
1518
1466
 
1519
1467
  // src/hooks/useSyncSessionTitle.ts
1520
- import { useThreadIsRunning as useThreadIsRunning7 } from "@assistant-ui/core/react";
1521
- import { useEffect as useEffect8, useRef as useRef8 } from "react";
1468
+ import { useThreadIsRunning as useThreadIsRunning6 } from "@assistant-ui/core/react";
1469
+ import { useEffect as useEffect7, useRef as useRef8 } from "react";
1522
1470
  function useSyncSessionTitle() {
1523
1471
  const server = useOptionalServer();
1524
1472
  const aui = useAui();
1525
1473
  const remoteId = useAuiState((s) => s.threadListItem.remoteId);
1526
1474
  const title = useAuiState((s) => s.threadListItem.title);
1527
- const isRunning = useThreadIsRunning7();
1475
+ const isRunning = useThreadIsRunning6();
1528
1476
  const wasRunningRef = useRef8(false);
1529
1477
  const syncedRemoteIdRef = useRef8(void 0);
1530
- useEffect8(() => {
1478
+ useEffect7(() => {
1531
1479
  syncedRemoteIdRef.current = void 0;
1532
1480
  }, [remoteId]);
1533
- useEffect8(() => {
1481
+ useEffect7(() => {
1534
1482
  const finishedTurn = wasRunningRef.current && !isRunning;
1535
1483
  wasRunningRef.current = isRunning;
1536
1484
  if (!finishedTurn || server == null || remoteId == null) {
@@ -1576,7 +1524,7 @@ function ThreadMessage({ isEditing }) {
1576
1524
  return /* @__PURE__ */ jsx18(AssistantMessageContainer, {});
1577
1525
  }
1578
1526
  function ThreadContainer({ composer }) {
1579
- useEffect9(() => {
1527
+ useEffect8(() => {
1580
1528
  void preloadMarkdownOpenUI();
1581
1529
  }, []);
1582
1530
  useSyncSessionTitle();
@@ -1625,14 +1573,14 @@ import {
1625
1573
  useAui as useAui5,
1626
1574
  useAuiState as useAuiState13
1627
1575
  } from "@assistant-ui/react";
1628
- import { useEffect as useEffect12, useMemo as useMemo5, useRef as useRef11, useState as useState14 } from "react";
1576
+ import { useEffect as useEffect11, useMemo as useMemo5, useRef as useRef11, useState as useState13 } from "react";
1629
1577
 
1630
1578
  // src/atoms/AgentHistoryFilterButton.tsx
1631
- import { useEffect as useEffect11, useId as useId2, useLayoutEffect, useRef as useRef10, useState as useState13 } from "react";
1579
+ import { useEffect as useEffect10, useId as useId2, useLayoutEffect, useRef as useRef10, useState as useState12 } from "react";
1632
1580
  import { createPortal } from "react-dom";
1633
1581
 
1634
1582
  // src/atoms/primitives/DropdownMenu.tsx
1635
- import React, { useEffect as useEffect10, useId, useRef as useRef9, useState as useState12 } from "react";
1583
+ import React, { useEffect as useEffect9, useId, useRef as useRef9, useState as useState11 } from "react";
1636
1584
  import { jsx as jsx20, jsxs as jsxs4 } from "react/jsx-runtime";
1637
1585
  function DropdownMenuItem({ className, ...props }) {
1638
1586
  return /* @__PURE__ */ jsx20(
@@ -1664,15 +1612,15 @@ function AgentHistoryFilterButton() {
1664
1612
  const isMobile = useIsMobile();
1665
1613
  const compact = useCompactLayout();
1666
1614
  const useSheet = isMobile || compact;
1667
- const [open, setOpen] = useState13(false);
1668
- const [query, setQuery] = useState13("");
1669
- const [menuPos, setMenuPos] = useState13(null);
1615
+ const [open, setOpen] = useState12(false);
1616
+ const [query, setQuery] = useState12("");
1617
+ const [menuPos, setMenuPos] = useState12(null);
1670
1618
  const buttonRef = useRef10(null);
1671
1619
  const menuRef = useRef10(null);
1672
1620
  const menuId = useId2();
1673
1621
  const enabled = shell?.isLibraryEnabled === true && server != null;
1674
1622
  const selected = shell?.historyAgentFilter ?? null;
1675
- useEffect11(() => {
1623
+ useEffect10(() => {
1676
1624
  if (!open) setQuery("");
1677
1625
  }, [open]);
1678
1626
  const { agents, isInitialLoading, isSearching, loadingMore, hasMore, listRef, sentinelRef } = useSearchAgentsList({
@@ -1697,7 +1645,7 @@ function AgentHistoryFilterButton() {
1697
1645
  window.removeEventListener("scroll", update, true);
1698
1646
  };
1699
1647
  }, [open, useSheet]);
1700
- useEffect11(() => {
1648
+ useEffect10(() => {
1701
1649
  if (!open || useSheet) return;
1702
1650
  const handler = (e) => {
1703
1651
  const target = e.target;
@@ -1821,7 +1769,7 @@ var deleteItemClass = "flex w-full cursor-pointer select-none items-center gap-2
1821
1769
  function ThreadListItemDeleteMenu() {
1822
1770
  const compact = useCompactLayout();
1823
1771
  const isMobile = useIsMobile();
1824
- const [sheetOpen, setSheetOpen] = useState14(false);
1772
+ const [sheetOpen, setSheetOpen] = useState13(false);
1825
1773
  const useSheet = isMobile || compact;
1826
1774
  const moreButtonClass = auiButtonClass({
1827
1775
  variant: "ghost",
@@ -1944,7 +1892,7 @@ function ThreadListItemsByRecency({
1944
1892
  var THREAD_LIST_VIEWPORT_SLOT = "aui_thread-list-viewport";
1945
1893
  var LOAD_MORE_BOTTOM_PX = 80;
1946
1894
  function ChatHistorySection({ children, viewportRef }) {
1947
- const [expanded, setExpanded] = useState14(true);
1895
+ const [expanded, setExpanded] = useState13(true);
1948
1896
  const shell = useOptionalShellMode();
1949
1897
  const showFilter = shell?.isLibraryEnabled === true;
1950
1898
  return /* @__PURE__ */ jsxs6("div", { className: "flex min-h-0 flex-1 flex-col", children: [
@@ -2002,7 +1950,7 @@ function ThreadListContainer({ onThreadOpen } = {}) {
2002
1950
  const showNewChat = shell?.isNewChatEnabled !== false;
2003
1951
  const isIdle = shell?.mode.status === "idle";
2004
1952
  const canDeleteSession = typeof server?.deleteSession === "function";
2005
- useEffect12(() => {
1953
+ useEffect11(() => {
2006
1954
  if (isIdle || isLoading || isLoadingMore) return;
2007
1955
  const viewport = viewportRef.current;
2008
1956
  if (!viewport) return;
@@ -2085,9 +2033,6 @@ export {
2085
2033
  ComposerAttachmentsContainer,
2086
2034
  MessageAttachmentsContainer,
2087
2035
  ComposerAttachmentPickerContainer,
2088
- notifyComposerBusyFailure,
2089
- ComposerBusyProvider,
2090
- useComposerBusyState,
2091
2036
  threadHasPendingMcpAuth,
2092
2037
  useComposerPauseView,
2093
2038
  McpAuthContainer,
@@ -2100,4 +2045,4 @@ export {
2100
2045
  Thread,
2101
2046
  ThreadListContainer
2102
2047
  };
2103
- //# sourceMappingURL=chunk-H7DR64W3.js.map
2048
+ //# sourceMappingURL=chunk-GJ3SK4G3.js.map