import type { TransactionLog } from "./transaction_log"; import type { TaskManager } from "./task_manager"; import type { GraphAI } from "./graphai"; export declare enum NodeState { Waiting = "waiting", Queued = "queued", Executing = "executing", ExecutingServer = "executing-server", Failed = "failed", TimedOut = "timed-out", Abort = "abort", Completed = "completed", Injected = "injected", Skipped = "skipped" } export type DefaultResultData = Record | string | number | boolean | Array; export type DefaultInputData = Record; export type DefaultConfigData = Record; export type ResultData = ResultType | undefined; export type ResultDataDictionary = Record>; export type ConfigData = ConfigType; export type ConfigDataDictionary = Record; export type DefaultParamsType = Record; export type NodeDataParams = ParamsType; export type PassThrough = Record; export type DataSource = { nodeId?: string; value?: any; propIds?: string[]; }; type ConsoleAttribute = boolean | string | Record; export type ConsoleElement = boolean | { before?: ConsoleAttribute; after?: ConsoleAttribute; }; export type StaticNodeData = { value?: ResultData; update?: string; isResult?: boolean; console?: ConsoleElement; }; export type AgentAnonymousFunction = (...params: any[]) => unknown; export type AgentFilterParams = Record; export type GraphDataLoaderOption = { fileName: string; option?: any; }; export type RepeatUntil = { exists?: string; }; export type ComputedNodeData = { agent: string | AgentAnonymousFunction; inputs?: Record; output?: Record; anyInput?: boolean; params?: NodeDataParams; filterParams?: AgentFilterParams; retry?: number; repeatUntil?: RepeatUntil; timeout?: number; if?: string; unless?: string; defaultValue?: ResultData; graph?: GraphData | string; graphLoader?: GraphDataLoaderOption; isResult?: boolean; priority?: number; passThrough?: PassThrough; console?: ConsoleElement; }; export type NodeData = StaticNodeData | ComputedNodeData; export type LoopData = { count?: number; while?: string | boolean; }; export type GraphData = { version?: number; nodes: Record; concurrency?: number; loop?: LoopData; verbose?: boolean; retry?: number; metadata?: any; }; export type GraphDataLoader = (loaderOption: GraphDataLoaderOption) => GraphData; export type GraphOptions = { agentFilters?: AgentFilterInfo[] | undefined; taskManager?: TaskManager | undefined; bypassAgentIds?: string[] | undefined; config?: ConfigDataDictionary; graphLoader?: GraphDataLoader; forceLoop?: boolean; mapIndex?: number; }; export type CacheTypes = "pureAgent" | "impureAgent"; export type AgentFunctionContextDebugInfo = { verbose: boolean; nodeId: string; state: string; subGraphs: Map; retry: number; agentId?: string; version?: number; isResult?: boolean; }; export type AgentFunctionContext = { params: NodeDataParams; inputSchema?: any; namedInputs: NamedInputDataType; debugInfo: AgentFunctionContextDebugInfo; forNestedGraph?: { graphData?: GraphData; agents: AgentFunctionInfoDictionary; graphOptions: GraphOptions; onLogCallback?: (log: TransactionLog, isUpdate: boolean) => void; callbacks?: CallbackFunction[]; }; cacheType?: CacheTypes; filterParams: AgentFilterParams; log?: TransactionLog[]; config?: ConfigType; }; export type AgentFunction = (context: AgentFunctionContext) => Promise>; export type AgentFilterFunction = (context: AgentFunctionContext, agent: AgentFunction) => Promise>; export type AgentFilterInfo = { name: string; agent: AgentFilterFunction; agentIds?: string[]; nodeIds?: string[]; filterParams?: AgentFilterParams; }; export type AgentFunctionInfoSample = { inputs: any; params: DefaultParamsType; result: any; graph?: GraphData; description?: string; }; export type AgentFunctionInfo = { name: string; agent: AgentFunction; mock: AgentFunction; inputs?: any; output?: any; params?: any; config?: any; outputFormat?: any; tools?: Record[]; samples: AgentFunctionInfoSample[]; description: string; category: string[]; author: string; repository: string; source?: string; package?: string; license: string; cacheType?: CacheTypes; environmentVariables?: string[]; hasGraphData?: boolean; stream?: boolean; apiKeys?: string[]; npms?: string[]; }; export type AgentFunctionInfoDictionary = Record; export type PropFunction = (result: ResultData, propId: string) => ResultData; export type CallbackFunction = (log: TransactionLog, isUpdate: boolean) => void; export type LogLevel = "debug" | "info" | "log" | "warn" | "error"; export type LoggerFunction = (level: LogLevel, ...args: any[]) => void; export {};