@ai2070/l0
Version:
L0: The Missing Reliability Substrate for AI
33 lines • 1.16 kB
TypeScript
export declare const RuntimeStates: {
readonly INIT: "init";
readonly WAITING_FOR_TOKEN: "waiting_for_token";
readonly STREAMING: "streaming";
readonly TOOL_CALL_DETECTED: "tool_call_detected";
readonly CONTINUATION_MATCHING: "continuation_matching";
readonly CHECKPOINT_VERIFYING: "checkpoint_verifying";
readonly RETRYING: "retrying";
readonly FALLBACK: "fallback";
readonly FINALIZING: "finalizing";
readonly COMPLETE: "complete";
readonly ERROR: "error";
};
export type RuntimeState = (typeof RuntimeStates)[keyof typeof RuntimeStates];
export declare class StateMachine {
private state;
private history;
private listeners;
transition(next: RuntimeState): void;
get(): RuntimeState;
is(...states: RuntimeState[]): boolean;
isTerminal(): boolean;
reset(): void;
getHistory(): ReadonlyArray<{
from: RuntimeState;
to: RuntimeState;
timestamp: number;
}>;
subscribe(listener: (state: RuntimeState) => void): () => void;
private notify;
}
export declare function createStateMachine(): StateMachine;
//# sourceMappingURL=state-machine.d.ts.map