What the seat did so far; read by the launch for its result. A launch's seat with a call still running once its
launch has stopped reads cut, with no error: the launch reports without that call's answer.
Streams a reply, returning a streaming result surface.
Single agents return a StreamTextResult with textStream, text,
usage, and toolCalls. Agencies return an AgencyStreamResult
with additional agentCalls, parsed, and finalTextStream fields.
Both are assignable to AgentStreamResult.
User prompt text.
Optional opts: Record<string, unknown>Optional per-call overrides.
A streaming result with at least textStream, fullStream,
text, and usage.
Optional listenStarts a loopback WebSocket listener on 127.0.0.1 that exchanges JSON text:
{ "text": "..." } in, { "text": "..." } out, one request at a time per
connection. It performs no speech recognition or synthesis; a binary frame
receives an audio_not_supported error and close code 1003. Present on
agency instances created with voice: { enabled: true }. Spoken calls use
VoiceSessionFactory.
Optional opts: { Listener options; port 0, the default, picks a free port.
Optional port?: numberResolves to the bound port, URL, and a close() teardown function.
Optional connectOptional exportExports the agent's full configuration as a portable object.
The returned AgentExportConfig (imported from ./agentExport.js)
can be serialized to JSON or YAML and re-imported via importAgent().
Optional metadata: Record<string, unknown>Optional human-readable metadata to attach.
Optional options: { Redaction options; secrets are redacted unless redactSecrets is false.
Optional redactA portable config object.
Optional exportJSONExports the agent's full configuration as a pretty-printed JSON string.
Optional metadata: Record<string, unknown>Optional human-readable metadata to attach.
Optional options: { Redaction options; secrets are redacted unless redactSecrets is false.
Optional redactJSON string with 2-space indentation.
Readonly seatThe seat's session id on its member.
Optional descriptionWhat a hierarchical manager reads about the seat; without it the manager sees "General purpose".
Optional dependsSeats this one waits for under the graph strategy. An agency that names no strategy and is not adaptive
runs graph when any seat's dependsOn lists a seat; an empty list lists none. agency() throws
AgencyConfigError, naming the seat, for a dependsOn that is set and is not an array of seat names.
A roster member that runs one session of its own; built by sessionSeat and by launch_agency. Its first call opens the session, and fails when the member already serves a session under the seat's id:
generate()rejects andstream()throws, with theTypeErrorthat names the id (a launch's seat, with that error's name alone).Of the per-call options an agency passes to its members, a seat applies the call's
abortSignal,budgetand tool-approval gate, and ongenerate()the per-send generation overrides a session's send takes (maxTokens,requestTimeout,toolChoice,cacheDiagnostics,cache); its session'sstream()takes none of those. Its member's own ledger records the seat's calls, so a call'susageLedgeris not applied. The seat warns once about each other per-call option it is given (temperature,model,providerand the rest), which its member's own settings replace.