import { ClientAssembledToolCall } from "./tools.js"; import { StreamingMessageHandle } from "../messages.js"; import { AudioMedia, FileMedia, ImageMedia, VideoMedia } from "../media.js"; import { EventForChannel, EventForChannels, SubscribeOptions, YieldForChannel, YieldForChannels } from "../types.js"; import { SubagentHandle } from "./subagents.js"; import { SubscriptionHandle } from "../index.js"; import { Channel, Event, LifecycleCause, SubscribeParams, ToolsEvent } from "@langchain/protocol"; //#region src/client/stream/handles/subgraphs.d.ts /** * Minimal subscription surface that {@link SubgraphHandle} and * {@link SubagentHandle} delegate to. Typed to match the * `Session.subscribe` raw-channel overloads without importing the * full `Session` class (avoids circular dependency). */ interface Subscribable { subscribe(channel: TChannel, options?: SubscribeOptions): Promise, YieldForChannel>>; subscribe(channels: TChannels, options?: SubscribeOptions): Promise, YieldForChannels>>; subscribe(params: SubscribeParams): Promise>; } /** * Discovered subgraph within a streaming session. * * Mirrors the in-process `SubgraphRunStream` pattern: each subgraph * has `name`, `index`, `namespace`, and lazy getters for projections * scoped to this subgraph's namespace. * * ```ts * for await (const sub of session.subgraphs) { * for await (const msg of sub.messages) { ... } * const state = await sub.output; * } * ``` */ declare class SubgraphHandle { #private; readonly name: string; readonly index: number; readonly namespace: string[]; /** * Non-empty when upstream attached a `cause` to this subgraph's * `lifecycle.started` event. Population is product-specific and * performed by stream transformers on the runtime side (e.g. * deepagents' `SubagentTransformer` emits * `{ type: "toolCall", tool_call_id }`). Generic clients should * treat `cause.type` as an open enum — the protocol allows future * variants (`send`, `edge`, ...) to be forwarded verbatim without * a SDK bump. */ readonly cause?: LifecycleCause; readonly graphName?: string; /** * Raw `tool-started` event that triggered this subgraph, when * `cause.type === "toolCall"` and the matching event has been * observed on the `tools` channel. */ toolStartedEvent?: ToolsEvent; constructor(name: string, index: number, namespace: string[], session: Subscribable, options?: { cause?: LifecycleCause; graphName?: string; toolStartedEvent?: ToolsEvent; }); get messages(): AsyncIterable; get values(): AsyncIterable & PromiseLike; get toolCalls(): AsyncIterable; get subgraphs(): AsyncIterable; get subagents(): AsyncIterable; get audio(): AsyncIterable; get images(): AsyncIterable; get video(): AsyncIterable; get files(): AsyncIterable; get output(): Promise; /** * Create a raw channel subscription scoped to this subgraph's namespace. */ subscribe(channel: TChannel, options?: SubscribeOptions): Promise, YieldForChannel>>; subscribe(channels: TChannels, options?: SubscribeOptions): Promise, YieldForChannels>>; subscribe(params: SubscribeParams): Promise>; } //#endregion export { SubgraphHandle, Subscribable }; //# sourceMappingURL=subgraphs.d.ts.map