@threadplane/langgraphTypeAliasv0.3.7

LangGraphSession

Backend-private capability; core sessions and borrowed observers stay minimal.

import type { LangGraphSession } from '@threadplane/langgraph';

Declaration

export type LangGraphSession<TTools extends {
    [K in keyof TTools]: ToolContract;
} = Record<string, ToolContract>, TState = unknown> = Omit<AgentSession<TTools, TState>, 'getSnapshot' | 'submit' | 'resume' | 'runWithoutMessage' | 'regenerate'> & {
    getSnapshot(): LangGraphSnapshot<TTools, TState>;
    regenerate?(messageId: string, options?: LangGraphRunOptions): Promise<CompleteOutcome>;
    runWithoutMessage(input?: {
        readonly state?: LangGraphSubmitState<TState>;
    }, options?: LangGraphRunOptions): Promise<CompleteOutcome>;
    readonly threadId: string | undefined;
    submit(input: LangGraphSubmitInput<TState> | null | undefined, options?: LangGraphRunOptions): Promise<CompleteOutcome>;
    cancelQueued(runId: string): Promise<boolean>;
    isDevelopmentRuntimeEnabled(): boolean;
    clearQueue(): Promise<void>;
    fork(checkpoint: CheckpointReference, input: LangGraphSubmitInput<TState>, options?: LangGraphRunOptions): Promise<CompleteOutcome>;
    reconnect(options?: {
        readonly signal?: AbortSignal;
    }): Promise<CompleteOutcome>;
    joinStream(runId: string, lastEventId?: string, options?: {
        readonly signal?: AbortSignal;
    }): Promise<CompleteOutcome>;
    resume(responses: readonly AgentInterruptResponse[], options?: LangGraphResumeOptions<TState>): Promise<CompleteOutcome>;
    load?(options?: {
        readonly signal?: AbortSignal;
    }): Promise<void>;
    setBranch(branch: string): Promise<void>;
    onCustomEvent(listener: (event: AgentSessionCustomEvent) => void): () => void;
    readonly lifecycle: LangGraphLifecycleSource;
};

Type parameters

TTools
{ [K in keyof TTools]: ToolContract; } Default: Record<string, ToolContract>
TState
Default: unknown