UNPKG

@agent-graph/core

Version:

A lightweight AI Agent orchestration solution

22 lines 862 B
import { GraphRuntime } from './runtime'; export type VertexId = Lowercase<string>; export type VertexStatus = 'active' | 'inactive' | 'waiting'; export declare class Vertex<V extends VertexId, C, S = undefined, I = unknown, O = unknown> { readonly id: V; state: Readonly<S>; private status; readonly compute: (props: Readonly<I>, runtime: GraphRuntime<C>) => Readonly<O> | Promise<Readonly<O>>; constructor({ id, compute, state, }: { id: V; state?: S; compute: (this: Vertex<V, C, S, any, any>, props: Readonly<I>, runtime: GraphRuntime<C>) => O | Promise<O>; }); get isActive(): boolean; get isInactive(): boolean; get isWaiting(): boolean; active(): void; halt(): void; wait(): void; setState<K extends keyof S>(newState: Pick<S, K> | S): void; } //# sourceMappingURL=vertex.d.ts.map