@agents24/chat-react 0.5.34 → 0.5.35

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.
@@ -5,9 +5,9 @@
5
5
  "title": "Agents24 Chat",
6
6
  "description": "Complete editable Agents24 chat, inheriting your application's theme.",
7
7
  "dependencies": [
8
- "@agents24/chat-react@0.5.34",
8
+ "@agents24/chat-react@0.5.35",
9
9
  "@agents24/client@0.2.17",
10
- "@agents24/react@0.2.21",
10
+ "@agents24/react@0.2.22",
11
11
  "@shadcn/react@^0.2.1",
12
12
  "class-variance-authority@^0.7.1",
13
13
  "clsx@^2.1.1",
@@ -88,7 +88,7 @@
88
88
  "path": "scaffold/src/components/chat/thread-sidebar.tsx",
89
89
  "type": "registry:file",
90
90
  "target": "@components/agents24-chat/components/chat/thread-sidebar.tsx",
91
- "content": "import { getThreadActivity, type StoredChatThread } from \"@agents24/react\"\nimport { LoaderCircle, SquarePen, Trash2 } from \"lucide-react\"\nimport type { Agents24ChatIdentity } from \"../../identity\"\nimport { IdentityControl } from \"./identity-control\"\n\nimport { Button } from \"../ui/button\"\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupContent,\n SidebarHeader,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarRail,\n useSidebar,\n} from \"../ui/sidebar\"\n\ntype Props = {\n activeThreadId: string | null\n hasMore: boolean\n isLoading: boolean\n isLoadingMore: boolean\n onDelete: (threadId: string) => Promise<void>\n onLoadMore: () => Promise<void>\n onNew: () => void\n onOpen: (threadId: string) => Promise<void>\n threads: StoredChatThread[]\n identity: Agents24ChatIdentity\n}\n\nfunction ThreadStatus({ thread }: { thread: StoredChatThread }) {\n const activity = getThreadActivity(thread)\n if (!activity.isSpinning) return null\n const label = activity.status === \"cancelling\"\n ? \"Cancelling\"\n : activity.status === \"queued\"\n ? \"Queued\"\n : \"Running\"\n return (\n <span\n className=\"pointer-events-none absolute end-1 top-1/2 hidden size-5 -translate-y-1/2 items-center justify-center text-muted-foreground transition-opacity group-hover/menu-item:opacity-0 md:flex\"\n role=\"status\"\n aria-label={label}\n title={label}\n >\n <LoaderCircle className=\"size-3.5 animate-spin\" />\n </span>\n )\n}\n\nexport function ThreadSidebar({ activeThreadId, hasMore, identity, isLoading, isLoadingMore, onDelete, onLoadMore, onNew, onOpen, threads }: Props) {\n const { setOpenMobile } = useSidebar()\n return (\n <Sidebar\n aria-label=\"Conversations\"\n collapsible=\"offcanvas\"\n data-agents24-chat-sidebar=\"\"\n role=\"navigation\"\n >\n <SidebarHeader className=\"gap-1 p-2\">\n <div className=\"h-8 shrink-0\" aria-hidden=\"true\" />\n <Button className=\"w-full justify-start\" variant=\"ghost\" onClick={() => { onNew(); setOpenMobile(false) }}><SquarePen /> New chat</Button>\n </SidebarHeader>\n <SidebarContent>\n <SidebarGroup>\n <SidebarGroupContent>\n <SidebarMenu>\n {threads.map((thread) => (\n <SidebarMenuItem key={thread.id}>\n <SidebarMenuButton\n className=\"pr-8 pl-3\"\n isActive={thread.id === activeThreadId}\n title={String(thread.title || \"New conversation\")}\n onClick={() => { void onOpen(thread.id).catch(() => undefined); setOpenMobile(false) }}\n >\n <span className=\"min-w-0 truncate\">{String(thread.title || \"New conversation\")}</span>\n </SidebarMenuButton>\n <ThreadStatus thread={thread} />\n <SidebarMenuAction\n showOnHover\n className=\"group-focus-within/menu-item:opacity-0 group-hover/menu-item:opacity-100\"\n aria-label={`Delete ${String(thread.title || \"conversation\")}`}\n onClick={(event) => { event.stopPropagation(); if (window.confirm(\"Delete this conversation?\")) void onDelete(thread.id).catch(() => undefined) }}\n >\n <Trash2 />\n </SidebarMenuAction>\n </SidebarMenuItem>\n ))}\n </SidebarMenu>\n {!isLoading && threads.length === 0 && <p className=\"px-2 py-8 text-center text-xs text-muted-foreground\">No conversations</p>}\n {hasMore && (\n <Button\n className=\"mt-2 w-full\"\n disabled={isLoadingMore}\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => void onLoadMore().catch(() => undefined)}\n >\n {isLoadingMore && <LoaderCircle className=\"animate-spin\" />}\n Load more\n </Button>\n )}\n </SidebarGroupContent>\n </SidebarGroup>\n </SidebarContent>\n <SidebarFooter className=\"w-full min-w-0 p-2\"><IdentityControl identity={identity} /></SidebarFooter>\n <SidebarRail />\n </Sidebar>\n )\n}\n"
91
+ "content": "import { getThreadActivity, type StoredChatThread } from \"@agents24/react\"\nimport { LoaderCircle, Pause, SquarePen, Trash2 } from \"lucide-react\"\nimport type { Agents24ChatIdentity } from \"../../identity\"\nimport { IdentityControl } from \"./identity-control\"\n\nimport { Button } from \"../ui/button\"\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupContent,\n SidebarHeader,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarRail,\n useSidebar,\n} from \"../ui/sidebar\"\n\ntype Props = {\n activeThreadId: string | null\n hasMore: boolean\n isLoading: boolean\n isLoadingMore: boolean\n onDelete: (threadId: string) => Promise<void>\n onLoadMore: () => Promise<void>\n onNew: () => void\n onOpen: (threadId: string) => Promise<void>\n threads: StoredChatThread[]\n identity: Agents24ChatIdentity\n}\n\nfunction ThreadStatus({ thread }: { thread: StoredChatThread }) {\n const activity = getThreadActivity(thread)\n const waiting = [\"paused\", \"waiting\", \"interrupted\"].includes(activity.status || \"\")\n if (!activity.isSpinning && !waiting) return null\n const label = waiting ? \"Waiting\" : activity.status === \"cancelling\"\n ? \"Cancelling\"\n : activity.status === \"queued\"\n ? \"Queued\"\n : \"Running\"\n return (\n <span\n className=\"pointer-events-none absolute end-1 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center text-muted-foreground transition-opacity group-hover/menu-item:opacity-0\"\n role=\"status\"\n aria-label={label}\n title={label}\n >\n {waiting ? <Pause className=\"size-3.5 text-amber-600\" /> : <LoaderCircle className=\"size-3.5 animate-spin\" />}\n </span>\n )\n}\n\nexport function ThreadSidebar({ activeThreadId, hasMore, identity, isLoading, isLoadingMore, onDelete, onLoadMore, onNew, onOpen, threads }: Props) {\n const { setOpenMobile } = useSidebar()\n return (\n <Sidebar\n aria-label=\"Conversations\"\n collapsible=\"offcanvas\"\n data-agents24-chat-sidebar=\"\"\n role=\"navigation\"\n >\n <SidebarHeader className=\"gap-1 p-2\">\n <div className=\"h-8 shrink-0\" aria-hidden=\"true\" />\n <Button className=\"w-full justify-start\" variant=\"ghost\" onClick={() => { onNew(); setOpenMobile(false) }}><SquarePen /> New chat</Button>\n </SidebarHeader>\n <SidebarContent>\n <SidebarGroup>\n <SidebarGroupContent>\n <SidebarMenu>\n {threads.map((thread) => (\n <SidebarMenuItem key={thread.id}>\n <SidebarMenuButton\n className=\"pr-8 pl-3\"\n isActive={thread.id === activeThreadId}\n title={String(thread.title || \"New conversation\")}\n onClick={() => { void onOpen(thread.id).catch(() => undefined); setOpenMobile(false) }}\n >\n <span className=\"min-w-0 truncate\">{String(thread.title || \"New conversation\")}</span>\n </SidebarMenuButton>\n <ThreadStatus thread={thread} />\n <SidebarMenuAction\n showOnHover\n className=\"group-focus-within/menu-item:opacity-0 group-hover/menu-item:opacity-100\"\n aria-label={`Delete ${String(thread.title || \"conversation\")}`}\n onClick={(event) => { event.stopPropagation(); if (window.confirm(\"Delete this conversation?\")) void onDelete(thread.id).catch(() => undefined) }}\n >\n <Trash2 />\n </SidebarMenuAction>\n </SidebarMenuItem>\n ))}\n </SidebarMenu>\n {!isLoading && threads.length === 0 && <p className=\"px-2 py-8 text-center text-xs text-muted-foreground\">No conversations</p>}\n {hasMore && (\n <Button\n className=\"mt-2 w-full\"\n disabled={isLoadingMore}\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => void onLoadMore().catch(() => undefined)}\n >\n {isLoadingMore && <LoaderCircle className=\"animate-spin\" />}\n Load more\n </Button>\n )}\n </SidebarGroupContent>\n </SidebarGroup>\n </SidebarContent>\n <SidebarFooter className=\"w-full min-w-0 p-2\"><IdentityControl identity={identity} /></SidebarFooter>\n <SidebarRail />\n </Sidebar>\n )\n}\n"
92
92
  },
93
93
  {
94
94
  "path": "scaffold/src/components/chat/timeline-loading.ts",
@@ -254,13 +254,13 @@
254
254
  }
255
255
  ],
256
256
  "meta": {
257
- "version": "0.5.34",
257
+ "version": "0.5.35",
258
258
  "source": "packages/agents24-chat-react/scaffold",
259
- "source_sha256": "9947c6eb88ebdea4ae6213cdd21002e3b1feb13111bcde7388deb5452fa0786d",
259
+ "source_sha256": "0c7529800d5f8f626edf85d41f1d355ede0dbec6ca184b344ac3085335ce03f3",
260
260
  "agents24": {
261
261
  "@agents24/client": "0.2.17",
262
- "@agents24/react": "0.2.21",
263
- "@agents24/chat-react": "0.5.34"
262
+ "@agents24/react": "0.2.22",
263
+ "@agents24/chat-react": "0.5.35"
264
264
  }
265
265
  },
266
266
  "docs": "Import the installed styles.css from your application stylesheet. Pass your configured AgentClient to Agents24ChatScaffold. Authentication and URLs remain host-owned. Installed UI is editable; review changes before reinstalling and do not use --overwrite on customized files."
@@ -2006,16 +2006,17 @@ function IdentityControl({ identity }) {
2006
2006
  var import_jsx_runtime23 = require("react/jsx-runtime");
2007
2007
  function ThreadStatus({ thread }) {
2008
2008
  const activity = (0, import_react2.getThreadActivity)(thread);
2009
- if (!activity.isSpinning) return null;
2010
- const label = activity.status === "cancelling" ? "Cancelling" : activity.status === "queued" ? "Queued" : "Running";
2009
+ const waiting = ["paused", "waiting", "interrupted"].includes(activity.status || "");
2010
+ if (!activity.isSpinning && !waiting) return null;
2011
+ const label = waiting ? "Waiting" : activity.status === "cancelling" ? "Cancelling" : activity.status === "queued" ? "Queued" : "Running";
2011
2012
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2012
2013
  "span",
2013
2014
  {
2014
- className: "pointer-events-none absolute end-1 top-1/2 hidden size-5 -translate-y-1/2 items-center justify-center text-muted-foreground transition-opacity group-hover/menu-item:opacity-0 md:flex",
2015
+ className: "pointer-events-none absolute end-1 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center text-muted-foreground transition-opacity group-hover/menu-item:opacity-0",
2015
2016
  role: "status",
2016
2017
  "aria-label": label,
2017
2018
  title: label,
2018
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.LoaderCircle, { className: "size-3.5 animate-spin" })
2019
+ children: waiting ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Pause, { className: "size-3.5 text-amber-600" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.LoaderCircle, { className: "size-3.5 animate-spin" })
2019
2020
  }
2020
2021
  );
2021
2022
  }