Discriminant: one of "chat_started", "workflow_started",
"message", "ping", "thinking_started", "thinking_finished",
"node_tool_use_started", "node_tool_use_finished",
"subagent_started", "subagent_progress", "subagent_finished",
"agent_tool_started", "agent_tool_progress",
"agent_tool_finished", "human_interaction_required",
"query_masked", "plan_changed", "context_compress_started",
"context_compress_finished", "chat_finished",
"workflow_finished", "chat_title_updated", or "other"
OptionalchatSet when kind is "chat_started"
OptionalworkflowSet when kind is "workflow_started"
OptionalmessageSet when kind is "message"
OptionalthinkingSet when kind is "thinking_started"
OptionalthinkingSet when kind is "thinking_finished"
OptionalnodeSet when kind is "node_tool_use_started"
OptionalnodeSet when kind is "node_tool_use_finished"
OptionalsubagentSet when kind is "subagent_started"
OptionalsubagentSet when kind is "subagent_progress"
OptionalsubagentSet when kind is "subagent_finished"
OptionalagentSet when kind is "agent_tool_started"
OptionalagentSet when kind is "agent_tool_progress"
OptionalagentSet when kind is "agent_tool_finished"
OptionalhumanSet when kind is "human_interaction_required", carrying the run's
outcome for an interrupted run — the same ConversationResponse shape
workflowFinished carries for the other outcomes. Unlike
workflowFinished, this is set instead of (never alongside)
workflowFinished for the same run.
OptionalquerySet when kind is "query_masked"
OptionalplanSet when kind is "plan_changed"
OptionalcontextSet when kind is "context_compress_started"
OptionalcontextSet when kind is "context_compress_finished"
OptionalchatSet when kind is "chat_finished"
OptionalworkflowSet when kind is "workflow_finished", carrying the run's outcome
— not necessarily the last event of the stream, since the server may
still emit a few more housekeeping events (kind "other") before
actually closing the connection
OptionalchatSet when kind is "chat_title_updated"
OptionalotherSet when kind is "other" — the SSE envelope's event field (the
event type name)
OptionalotherSet when kind is "other" — raw JSON of an event type not
recognized by this SDK version
One event observed while streaming
AgentContext.conversationStreamedorAgentContext.continueConversationStreamed.Design note: the Rust core models this as an enum with a per-variant payload (
longbridge::agent::ConversationStreamEvent), but napi-rs has no ergonomic equivalent of a Rust/Serde "enum with data" for a plain#[napi(object)]value, and there's no existing precedent for reifying one as a single JS value in this codebase (the closest analogue,trade::PushEvent, is dispatched to separate per-variant JS callbacks instead). We instead mirror the common "discriminant + optional per-kind fields" shape used for tagged unions in plain JS/JSON:kindis one of"chat_started" | "workflow_started" | "message" | "ping" | "thinking_started" | "thinking_finished" | "node_tool_use_started" | "node_tool_use_finished" | "subagent_started" | "subagent_progress" | "subagent_finished" | "agent_tool_started" | "agent_tool_progress" | "agent_tool_finished" | "human_interaction_required" | "query_masked" | "plan_changed" | "context_compress_started" | "context_compress_finished" | "chat_finished" | "workflow_finished" | "chat_title_updated" | "other", and exactly one ofchatStarted/workflowStarted/message/thinkingStarted/thinkingFinished/nodeToolUseStarted/nodeToolUseFinished/subagentStarted/subagentProgress/subagentFinished/agentToolStarted/agentToolProgress/agentToolFinished/humanInteractionRequired/queryMasked/planChanged/contextCompressStarted/contextCompressFinished/chatFinished/workflowFinished/chatTitleUpdated/otheris set, matchingkind— except"ping", a heartbeat with no payload, for which every payload field isNone. Whenkindis"other",otherEventadditionally carries the SSE envelope'seventfield (the event type name).