Skip to content

Interface: UseAgentChatOptions

agent: string

Agent name registered with the agents() plugin (e.g. "assistant", "helper"). Send-time payload includes this so the plugin routes the turn to the right AgentDefinition.


optional endpoint?: string

Override the chat endpoint. Default "/api/agents/chat" matches the route the agents plugin mounts under its prefix. Useful when the server mounts under a non-default base path or when proxying.


optional onEvent?: (event) => void

Called for every parsed SSE event before any state update. Use this to drive tool-call rows, approval cards, inspectors, or anything beyond the streaming text content. Errors thrown here are swallowed so a buggy handler can’t kill the stream.

AgentChatEvent

void


optional skills?: string[]

Known skill names for this agent — typically getPluginClientConfig("agents").skills?.[agent] mapped to s.name. A leading /token in a sent message is treated as skill sugar ONLY when token matches one of these names; anything else is sent verbatim, so ordinary messages that begin with / (paths, commands like /tmp is full or /usr/bin/python …) are never mangled. Omit or leave empty to disable /-prefix sugar entirely.