// This file is a re-export of the main type declarations // It's kept for backward compatibility import type { ToolCall, ToolResult } from "ai"; // Define the event types directly to avoid importing missing modules export type ToolCallEvent = ToolCall>; export type ToolResultEvent = ToolResult, unknown>; export type TextEvent = string; export type StepEvent = unknown; export type ErrorEvent = Error; export type DoneEvent = unknown; export type PlanEvent = string; export type HistoryUpdateEvent = unknown; export interface BeamEventTypes { "tool-call": ToolCallEvent; "tool-result": ToolResultEvent; text: TextEvent; step: StepEvent; error: ErrorEvent; done: DoneEvent; plan: PlanEvent; "history-update": HistoryUpdateEvent; } export type BeamEventName = keyof BeamEventTypes; // Augment the Beam class with typed event methods declare module "./dist/index.js" { interface Beam { on(event: K, listener: (arg: BeamEventTypes[K]) => void): Beam; once(event: K, listener: (arg: BeamEventTypes[K]) => void): Beam; off(event: K, listener: (arg: BeamEventTypes[K]) => void): Beam; emit(event: K, arg: BeamEventTypes[K]): boolean; } } // Re-export the main type declarations export type * from "./dist/index.d.ts";