Scan your whole stack
Are you using @windmill-labs/chat-sdk?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.885.0
@windmill-labs/chat-sdk was last scanned on 25 Nov 2026 at version 1.885.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.885.0 LATEST | 25 Nov 2026 | No rules fired |
| 1.884.1 | 25 Nov 2026 | No rules fired |
| 1.884.0 | 24 Nov 2026 | No rules fired |
| 1.883.0 | 24 Nov 2026 | Not shown |
| 1.882.0 | 22 Nov 2026 | Not shown |
Findings for v1.885.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 1.885.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Build a chat interface on a Windmill flow deployed in chat mode, from any frontend or from a Windmill raw app. The library is headless: it runs the flow, follows the answer as it streams, keeps the conversation history, and hands you state to render.
npm install @windmill-labs/chat-sdk
No runtime dependencies. Optional peers: react for @windmill-labs/chat-sdk/react, ai for
@windmill-labs/chat-sdk/ai-sdk, @assistant-ui/react for @windmill-labs/chat-sdk/assistant-ui.
| You build the UI with | Import | You get |
|---|---|---|
Vercel AI SDK useChat, AI Elements |
@windmill-labs/chat-sdk/ai-sdk |
a ChatTransport: useChat({ transport }), nothing else changes |
| assistant-ui | @windmill-labs/chat-sdk/assistant-ui |
a runtime for AssistantRuntimeProvider, threads included |
| Your own components | @windmill-labs/chat-sdk/react or @windmill-labs/chat-sdk |
a hook / a store with messages, status and actions |
Any deployed flow with Chat mode enabled in its settings works. Windmill passes the
message as the user_message input and threads the conversation through memory_id,
so an AI agent step remembers earlier turns. The answer is:
windmill_chat_answer field when it has one, a
string as is, anything else as JSON.useChat, AI Elements)import { useChat } from '@ai-sdk/react'
import { createWindmillChatTransport } from '@windmill-labs/chat-sdk/ai-sdk'
const transport = createWindmillChatTransport({
baseUrl: 'https://app.windmill.dev',
workspace: 'acme',
flowPath: 'f/support/assistant',
token: () => fetch('/api/windmill-token').then((r) => r.text())
})
export function Support() {
const { messages, status, sendMessage, stop } = useChat({ id: conversationId, transport })
// render `messages[i].parts`: text, reasoning and dynamic-tool parts, as with any AI SDK backend
}
The chat id is the conversation: reuse it to continue one, and pass a UUID when you
also read server history, so it matches what flow_conversations stores (any other id
maps to a fixed UUID). sendMessage(msg, { body }) sends extra flow inputs. Tool calls
arrive as dynamic-tool parts (input-available → output-available | output-error),
which AI Elements' <Tool> renders as is. A failed flow surfaces as error.
regenerate() runs the flow again with the same message: a new turn on the server,
not a replacement of the previous answer.
The transport also carries the history helpers: transport.loadMessages(id) returns
UIMessages for useChat({ messages }) or setMessages, transport.listConversations()
and transport.deleteConversation(id). A loaded user message lists the files it carried
in metadata.attachments; WindmillChatApi.attachmentUrl gives each one's download URL.
Sending attachments is not supported: sendMessage with files is refused with an
explanatory error.
import { AssistantRuntimeProvider } from '@assistant-ui/react'
import { useWindmillRuntime } from '@windmill-labs/chat-sdk/assistant-ui'
export function Support() {
const runtime = useWindmillRuntime({ baseUrl, workspace, flowPath, token })
return (
<AssistantRuntimeProvider runtime={runtime}>
<Thread /> {/* your assistant-ui components, thread list included */}
</AssistantRuntimeProvider>
)
}
Conversations are threads: ThreadListPrimitive switches, creates and deletes them.
Tool calls render through your tools components (MessagePrimitive.Parts), reasoning
through Reasoning. It takes the same options as useWindmillChat below.
import { useWindmillChat } from '@windmill-labs/chat-sdk/react'
export function Support() {
const chat = useWindmillChat({
baseUrl: 'https://app.windmill.dev',
workspace: 'acme',
flowPath: 'f/support/assistant',
token: () => fetch('/api/windmill-token').then((r) => r.text())
})
const [draft, setDraft] = useState('')
return (
<div>
{chat.messages.map((m) => (
<p key={m.id} data-role={m.role} data-pending={m.pending}>
{m.content}
</p>
))}
<form
onSubmit={(e) => {
e.preventDefault()
chat.sendMessage(draft)
setDraft('')
}}
>
<input value={draft} onChange={(e) => setDraft(e.target.value)} />
<button disabled={chat.status !== 'idle' && chat.status !== 'error'}>Send</button>
{chat.status === 'streaming' && (
<button type="button" onClick={chat.stop}>
Stop
</button>
)}
</form>
</div>
)
}
The hook returns the state plus the chat's methods. It recreates the chat
(fresh state, old one destroyed) when flowPath, baseUrl, workspace, history,
storageKey or the credential change: a different token string, or a switch between
no token, a string and a function; and when a run callback appears or goes away.
A token function is called through a ref, so passing a new closure on every render
is fine and never resets the chat, and so are run and the callbacks; when users
sign in and out behind a token function, change storageKey (their id) so local
history and state start over with them.
Inside a Windmill raw app nothing needs configuring: the chat runs as the viewer, against the Windmill the app is served from.
const chat = useWindmillChat({ flowPath: 'f/support/assistant' })
jobs:run in the app's frontend SDK scopes, and
flow_conversations:write for server-side history. The viewer consents once and
the app receives a token restricted to those scopes.wmill app dev: there is no viewer session on the dev server, so pass
baseUrl, workspace and token explicitly during development.To chat with a saved AI agent (an ai_agent resource), give the app an agent
runnable: a path runnable of type agent naming the agent, picked under "AI agents"
in the editor, or in raw_app.yaml:
runnables:
chat:
type: agent
path: f/support/agent
Each call runs one turn of the agent's chat as the app, so a sandboxed app declares no
frontend SDK scope, viewers get no consent prompt and need no access to the agent.
Name the runnable and pass the app's generated wmill.ts, which the chat goes through:
import { useWindmillChat } from '@windmill-labs/chat-sdk/react'
import * as wmill from './wmill'
const chat = useWindmillChat({ wmill, runnable: 'chat' })
runnable is checked against the runnables wmill.ts declares, and names the local
history, so two agent runnables in one app keep separate conversations. Going through
wmill.ts is what makes the same code work in a deployed app and under wmill app dev.
createChat and the assistant-ui runtime take the same options; the AI SDK transport
does not. The runnable takes user_message, and the chat passes the conversation id as
backendAsync's memoryId option, which the agent's memory is keyed by, so it remembers
earlier turns (called from wmill.ts without it, it is a single run with no conversation). The agent needs managed
memory: one whose memory is off takes previous_messages instead, the history you keep. A signed-in viewer's turns
are filed under them, so nobody else can continue their conversations; an anonymous
visitor's are kept apart per app. The chat makes no request of its own: history is
'local' (the app's own storage), stop() stops following without cancelling the turn,
a message sent while it still runs is refused with TurnRunningError, and attachments
are refused.
createChat returns a store: subscribe calls the listener immediately and on every
change, and returns the unsubscribe function. That is the Svelte store contract, so
$chat works as is; other frameworks wrap it in a few lines.
import { createChat } from '@windmill-labs/chat-sdk'
const chat = createChat({ baseUrl, workspace, flowPath, token })
chat.subscribe((state) => render(state))
await chat.sendMessage('Hello')
<script>
import { createChat } from '@windmill-labs/chat-sdk'
const chat = createChat({ flowPath: 'f/support/assistant' })
</script>
{#each $chat.messages as m (m.id)}
<p>{m.content}</p>
{/each}
<button onclick={() => chat.sendMessage(draft)}>Send</button>
| Option | |
|---|---|
flowPath |
Path of the deployed flow, e.g. f/support/assistant. Required unless follow is set. |
baseUrl |
The Windmill origin. Detected inside a raw app. |
workspace |
Detected inside a raw app. |
token |
A token, or a function returning one (called before every request, so it can fetch a short-lived token from your backend). Omit it inside a raw app. |
history |
'server', 'local' or 'none', see History. Defaults to 'server' with a viewer session and 'local' with an explicit token. |
inputs |
Extra flow inputs sent with every message. sendMessage(text, { inputs }) adds per-message ones, and { attachments, attachmentsInput } files, see Attachments. |
storageKey |
Namespace for local history, e.g. the signed-in user's id. Local history is per browser and per flow; without it, users sharing a browser share it. |
fetch, storage |
Replacements for the globals, for tests and unusual runtimes. |
pageSize |
Messages and conversations per page of server history. Default 50. |
pollDelayMs |
How often, in ms, the server polls a running turn for the stream (Enterprise; 50 at the fastest, other servers ignore it). Unset, the server relaxes from 100 ms to 3 s over a long turn; set it when tokens must keep flowing at that pace. |
onFinish, onError |
Called when a turn has its answer, or could not run at all. |
run |
Runs the flow for a turn yourself and returns the job id, instead of the deployed flow at flowPath (Windmill's editor chats with an undeployed flow through a preview run this way). Pass memory_id = the conversation id. |
follow |
With run: follows the job through your own client, calling onStream with each chunk of its result stream and resolving with its result. The chat then makes no request of its own; runnable sets both for a raw app's agent runnable, see A saved agent. |
runnable, wmill |
In a raw app, chat through the agent runnable of that name, going through the app's generated module (import * as wmill from './wmill'). Replaces flowPath, run and follow. |
interface ChatState {
conversationId: string | undefined
messages: ChatMessage[]
status: 'idle' | 'submitted' | 'streaming' | 'error'
error: Error | undefined
conversations: Conversation[]
history: 'server' | 'local' | 'none'
loadingMessages: boolean
hasMoreMessages: boolean
runningJobId?: string // the flow job the running turn follows
waitingOnBackground?: boolean // the agent answered and waits on tools running in the background
}
interface ChatMessage {
id: string
role: 'user' | 'assistant' | 'tool' | 'system'
content: string
reasoning?: string // the model's reasoning summary, when streamed
tool?: { callId?: string; name: string; arguments?: string; result?: string; status: 'running' | 'success' | 'error' }
success: boolean // false for a failed flow or tool
pending: boolean // still streaming, or not yet confirmed by the server
createdAt: string
jobId?: string
stepName?: string
serverId?: string // the persisted row; `id` itself never changes, so list keys are stable
}
A turn goes submitted (the flow is queued) → streaming (the answer is arriving) →
idle. Tool calls appear as tool messages whose status moves from running to
success or error. A flow that fails still completes the turn: its error is the
answer, an assistant message with success: false. status: 'error' (with error
set) means the turn could not run or be followed at all, such as a refused request.
An agent that answered while some of its tools still run in the background keeps its turn
streaming with waitingOnBackground set until one of them finishes and wakes it: its answer
is given, and those tools' messages stay running until their results arrive.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.