UNPKG

@langgraph-js/sdk

Version:

The UI SDK for LangGraph - seamlessly integrate your AI agents with frontend interfaces

30 lines (29 loc) 1.02 kB
import { PreinitializedWritableAtom } from "nanostores"; export * from "./types.js"; import { LangGraphClient, RenderMessage } from "../LangGraphClient.js"; export interface ComposedArtifact { id: string; filename: string; filetype: string; versions: Artifact[]; } export interface Artifact { group_id: string; id: string; code: string; filename: string; filetype: string; version: number; is_done: boolean; } export declare const useArtifacts: (renderMessages: PreinitializedWritableAtom<RenderMessage[]>, client: PreinitializedWritableAtom<LangGraphClient<unknown> | null>) => { data: { artifacts: PreinitializedWritableAtom<ComposedArtifact[]> & object; currentArtifactId: PreinitializedWritableAtom<[string, string] | null> & object; showArtifact: PreinitializedWritableAtom<boolean> & object; }; mutation: { setCurrentArtifactById: (id: string, tool_id: string) => void; setShowArtifact: (show: boolean) => void; }; };