@langchain/langgraph-sdk
Version:
Client library for interacting with the LangGraph API
37 lines (36 loc) • 1.54 kB
text/typescript
import { StreamStore } from "../store.cjs";
import { SubgraphDiscoverySnapshot } from "../types.cjs";
import { Event } from "@langchain/protocol";
//#region src/stream/discovery/subgraphs.d.ts
type SubgraphMap = ReadonlyMap<string, SubgraphDiscoverySnapshot>;
type SubgraphByNodeMap = ReadonlyMap<string, readonly SubgraphDiscoverySnapshot[]>;
declare class SubgraphDiscovery {
#private;
readonly store: StreamStore<SubgraphMap>;
readonly byNodeStore: StreamStore<SubgraphByNodeMap>;
/** Feed a single root event. Non-discovery events are ignored. */
push(event: Event): void;
/**
* Seed subgraph hosts from checkpoint history (see
* `namespace-from-history.collectSubgraphHostNamespaces`) so subgraph
* cards render on thread refresh without waiting for the depth-1 SSE
* replay. Supplies the host/promotion decision from history instead
* of the live strict-prefix heuristic, then reuses the same
* `#ensureShadow` / `#promoted` / `#commit` path. Idempotent: never
* downgrades an entry that already reached a terminal state.
*/
seedFromHistory(hosts: Array<{
namespace: string[];
status: "running" | "complete" | "error";
}>): void;
get snapshot(): SubgraphMap;
get byNodeSnapshot(): SubgraphByNodeMap;
/**
* Drop all discovery state. Called on thread rebind / dispose so a
* new thread's subgraphs cannot bleed into the previous UI.
*/
reset(): void;
}
//#endregion
export { SubgraphByNodeMap, SubgraphDiscovery, SubgraphMap };
//# sourceMappingURL=subgraphs.d.cts.map