Co-Pilot
Updated 3 months ago

thread-list

Aassistant-ui
0.0k
assistant-ui/skills/assistant-ui/skills/thread-list
76
Agent Score

💡 Summary

This skill manages multiple chat threads with customizable UI components.

🎯 Target Audience

Frontend developersUI/UX designersProduct managersSoftware engineersTechnical team leads

🤖 AI Roast:Powerful, but the setup might scare off the impatient.

Security AnalysisMedium Risk

Risk: Medium. Review: outbound network access (SSRF, data egress). Run with least privilege and audit before enabling in production.


name: thread-list description: Guide for multi-thread management in assistant-ui. Use when implementing thread lists, switching threads, or managing conversation history. version: 0.0.1 license: MIT

assistant-ui Thread List

Always consult assistant-ui.com/llms.txt for latest API.

Manage multiple chat threads with built-in or custom UI.

References

Quick Start

Thread list is available with useChatRuntime + cloud:

import { AssistantCloud } from "assistant-cloud"; import { useChatRuntime, AssistantChatTransport } from "@assistant-ui/react-ai-sdk"; import { AssistantRuntimeProvider, Thread, ThreadList } from "@assistant-ui/react"; const cloud = new AssistantCloud({ baseUrl: process.env.NEXT_PUBLIC_ASSISTANT_BASE_URL, authToken: async () => getAuthToken(), }); function Chat() { const runtime = useChatRuntime({ transport: new AssistantChatTransport({ api: "/api/chat" }), cloud, }); return ( <AssistantRuntimeProvider runtime={runtime}> <div className="flex h-screen"> <ThreadList className="w-64 border-r" /> <Thread className="flex-1" /> </div> </AssistantRuntimeProvider> ); }

Thread Operations

import { useAssistantApi, useAssistantState } from "@assistant-ui/react"; const api = useAssistantApi(); const { threads, mainThreadId } = useAssistantState(s => s.threadList); // Switch to thread api.threads().switchToThread(threadId); // Create new thread api.threads().switchToNewThread(); // Thread item operations const item = api.threads().item({ id: threadId }); await item.rename("New Title"); await item.archive(); await item.delete();

Custom Thread List

import { ThreadListPrimitive, ThreadListItemPrimitive } from "@assistant-ui/react"; function CustomThreadList() { return ( <ThreadListPrimitive.Root className="w-64"> <ThreadListPrimitive.New className="w-full p-2 bg-blue-500 text-white"> + New Chat </ThreadListPrimitive.New> <ThreadListPrimitive.Items> <ThreadListItemPrimitive.Root className="flex p-2 hover:bg-gray-100"> <ThreadListItemPrimitive.Trigger className="flex-1"> <ThreadListItemPrimitive.Title /> </ThreadListItemPrimitive.Trigger> <ThreadListItemPrimitive.Archive>Archive</ThreadListItemPrimitive.Archive> <ThreadListItemPrimitive.Delete>Delete</ThreadListItemPrimitive.Delete> </ThreadListItemPrimitive.Root> </ThreadListPrimitive.Items> </ThreadListPrimitive.Root> ); }

Without Cloud (Local)

import { useRemoteThreadListRuntime, InMemoryThreadListAdapter } from "@assistant-ui/react"; const runtime = useRemoteThreadListRuntime({ adapter: new InMemoryThreadListAdapter(), runtimeHook: () => useLocalRuntime({ model: myModel }), });

Common Gotchas

ThreadList not showing

  • Pass cloud to runtime
  • Check authentication

Threads not persisting

  • Verify cloud connection
  • Check network requests
5-Dim Analysis
Clarity8/10
Novelty6/10
Utility9/10
Completeness8/10
Maintainability7/10
Pros & Cons

Pros

  • Supports multi-thread management.
  • Customizable UI components.
  • Easy integration with existing applications.

Cons

  • Requires cloud setup for full functionality.
  • Potential authentication issues.
  • Dependency on external libraries.

Related Skills

web-perf

A
toolCo-Pilot
88/ 100

“This skill is so thorough it might start charging consulting fees after the audit.”

tldraw

A
toolCode Lib
86/ 100

“A fantastic library for drawing, though its licensing model means your masterpiece will forever be signed 'Made with tldraw' unless you pay the ransom.”

vue-expert

A
toolCo-Pilot
86/ 100

“Powerful, but the setup might scare off the impatient.”

Disclaimer: This content is sourced from GitHub open source projects for display and rating purposes only.

Copyright belongs to the original author assistant-ui.