Framework-agnostic orchestrator for custom transport streams.
Encapsulates all business logic shared across React, Vue, Svelte, and Angular for custom transport (non-LGP) streaming.
class CustomStreamOrchestratorLive byte stream.
Lazy: not materialised unless accessed. On first access the
stream is seeded with every byte already accumulated
(partialBytes) and then wired to future chunks. For URL-sourced
blocks, first access triggers fetch() and pipes the response
body through.
Repeated access returns the same ReadableStream reference
— you can safely read it once, release the lock, and re-acquire a
reader later (e.g. React StrictMode effect re-invokes). The
standard ReadableStream.locked semantics prevent concurrent
readers; use stream.tee() when you truly need multiple live
consumers.
Currently active subagents (where status === "running").
Use this to track and display subagents that are actively executing. Completed or errored subagents are not included.
// Show loading indicators for active subagents
stream.activeSubagents.map(subagent => (
<SubagentCard
key={subagent.id}
type={subagent.toolCall.args.subagent_type}
isLoading={true}
/>
));The current branch of the thread. Used for navigating between different conversation branches.
Current interrupt, if the stream is interrupted.
Convenience alias for interrupts[0].
For workflows with multiple concurrent interrupts, use interrupts instead.
Interrupt payloads collected during the run, if any.
Mirrors the in-process run.interrupts.
Whether the stream is currently running.
true while streaming, false when idle or completed.
Tear everything down.
Detaches the bound thread (so no further bind() calls reopen
runtimes) and disposes every live runtime in parallel. Safe to
call multiple times — subsequent calls find an empty registry
and resolve immediately.
Retrieve stream-level metadata for a given message.
Look up a single subagent stream by its tool call ID.
Retrieve all subagent streams associated with a specific AI message.
Retrieve all subagent streams matching a given tool name / type.
Get tool calls (with results) that belong to a specific AI message.
Reconstruct subagent streams from history values when subagent filtering is enabled and the stream is not currently loading. This is a no-op if subagents are already populated.
Update the current branch and notify listeners.
Disconnect the client from the active run and mark the controller
idle. By default also cancels the run server-side; pass
{ cancel: false } or call disconnect to keep the agent
running (join/rejoin).
Submit input to the active thread.
To resume a pending interrupt, use respond instead.
Start a new stream run against the custom transport.
This is the low-level submit entry point that handles thread ID resolution, optimistic value merging, and transport invocation. Prefer submit unless you need to bypass higher-level wrappers.
Subscribe to raw wire channels and receive protocol events.
For assembled projections, use the lazy getters instead:
thread.messages, thread.values, thread.toolCalls,
thread.subgraphs, thread.subagents, thread.output.
Switch to a different thread. If the thread ID actually changed, the current stream is cleared and listeners are notified.
Synchronize the external thread ID with the orchestrator. If the ID has changed, the current stream is cleared and listeners are notified.
Custom transports do not negotiate stream modes with the server the way LangGraph Platform streams do, but framework adapters call this method on both orchestrator variants. Keep the API surface aligned as a no-op.