Runtime Hooks

ThreadListItemRuntime

Runtime for managing individual thread list items.

useAui (Thread List Item Actions)

Access thread list item actions via useAui:

import { useAui } from "@assistant-ui/react";

const aui = useAui();

// Navigation
await aui.threadListItem().switchTo();

// Rename
await aui.threadListItem().rename("New Title");

// Archive / unarchive
await aui.threadListItem().archive();
await aui.threadListItem().unarchive();

// Delete
await aui.threadListItem().delete();

// Initialize a new thread (returns remoteId and externalId)
const { remoteId, externalId } = await aui.threadListItem().initialize();

// Auto-generate a title from thread content
await aui.threadListItem().generateTitle();

// Detach the thread list item from its thread
aui.threadListItem().detach();

// Get current state
const state = aui.threadListItem().getState();
const { id, title, status } = state;
ThreadListItemRuntime
path: ThreadListItemRuntimePath

getState: () => ThreadListItemState

initialize: () => Promise<{ remoteId: string; externalId: string | undefined; }>

generateTitle: () => Promise<void>

switchTo: () => Promise<void>

rename: (newTitle: string) => Promise<void>

archive: () => Promise<void>

unarchive: () => Promise<void>

delete: () => Promise<void>

detach: () => void

subscribe: (callback: () => void) => Unsubscribe

unstable_onunstable: (event: ThreadListItemEventType, callback: () => void) => Unsubscribe

__internal_getRuntime: () => ThreadListItemRuntime

useAuiState (Thread List Item State)

Access the state for a specific thread list item:

import { useAuiState } from "@assistant-ui/react";

const title = useAuiState((s) => s.threadListItem.title);
const status = useAuiState((s) => s.threadListItem.status);
const id = useAuiState((s) => s.threadListItem.id);
ThreadListItemState
isMain: boolean

id: string

remoteId: string | undefined

externalId: string | undefined

status: ThreadListItemStatus

title?: string | undefined