import type { EntityId, Vec2 } from '../core/types';
export type BTStatus = 'success' | 'failure' | 'running';
export interface BTContext {
    entityId: EntityId;
    dt: number;
    blackboard: Map<string, unknown>;
}
export interface BTNode {
    name: string;
    tick(ctx: BTContext): BTStatus;
    reset(): void;
}
export declare class BTAction implements BTNode {
    name: string;
    private fn;
    constructor(name: string, fn: (ctx: BTContext) => BTStatus);
    tick(ctx: BTContext): BTStatus;
    reset(): void;
}
export declare class BTCondition implements BTNode {
    name: string;
    private condition;
    constructor(name: string, condition: (ctx: BTContext) => boolean);
    tick(ctx: BTContext): BTStatus;
    reset(): void;
}
export declare class BTSequence implements BTNode {
    name: string;
    children: BTNode[];
    private currentIndex;
    constructor(name: string, children: BTNode[]);
    tick(ctx: BTContext): BTStatus;
    reset(): void;
}
export declare class BTSelector implements BTNode {
    name: string;
    children: BTNode[];
    private currentIndex;
    constructor(name: string, children: BTNode[]);
    tick(ctx: BTContext): BTStatus;
    reset(): void;
}
export declare class BTParallel implements BTNode {
    name: string;
    children: BTNode[];
    private successThreshold;
    constructor(name: string, children: BTNode[], successThreshold?: number);
    tick(ctx: BTContext): BTStatus;
    reset(): void;
}
export declare class BTDecorator implements BTNode {
    name: string;
    child: BTNode;
    private decorator;
    constructor(name: string, child: BTNode, decorator: (result: BTStatus, ctx: BTContext) => BTStatus);
    tick(ctx: BTContext): BTStatus;
    reset(): void;
}
/** Inverter: success→failure, failure→success. */
export declare function btInvert(child: BTNode): BTDecorator;
/** Repeat N times or until failure. */
export declare class BTRepeat implements BTNode {
    name: string;
    child: BTNode;
    private maxRepeats;
    private count;
    constructor(name: string, child: BTNode, maxRepeats: number);
    tick(ctx: BTContext): BTStatus;
    reset(): void;
}
export interface SteeringAgent {
    position: Vec2;
    velocity: Vec2;
    maxSpeed: number;
    maxForce: number;
}
export declare function steerSeek(agent: SteeringAgent, target: Vec2): Vec2;
export declare function steerFlee(agent: SteeringAgent, target: Vec2): Vec2;
export declare function steerArrive(agent: SteeringAgent, target: Vec2, slowRadius: number): Vec2;
export declare function steerWander(agent: SteeringAgent, wanderDistance: number, wanderRadius: number, wanderAngle: number): {
    force: Vec2;
    newAngle: number;
};
export declare function steerSeparation(agent: SteeringAgent, neighbors: Vec2[], radius: number): Vec2;
export interface FSMState<T> {
    name: string;
    enter?(context: T): void;
    update?(context: T, dt: number): void;
    exit?(context: T): void;
}
export declare class FiniteStateMachine<T> {
    private states;
    private currentState;
    private context;
    constructor(context: T);
    addState(state: FSMState<T>): void;
    setState(name: string): void;
    update(dt: number): void;
    getCurrentState(): string | null;
}
export interface UtilityAction {
    name: string;
    score: (ctx: unknown) => number;
    execute: (ctx: unknown) => void;
}
export declare function selectBestAction(actions: UtilityAction[], ctx: unknown): UtilityAction | null;
export interface GOAPAction {
    name: string;
    cost: number;
    preconditions: Record<string, boolean>;
    effects: Record<string, boolean>;
}
export interface GOAPGoal {
    name: string;
    conditions: Record<string, boolean>;
    priority: number;
}
export declare function planGOAP(worldState: Record<string, boolean>, goal: GOAPGoal, actions: GOAPAction[], maxDepth?: number): GOAPAction[] | null;
export interface DialogNode {
    id: string;
    speakerId: string;
    text: string;
    responses: DialogResponse[];
    condition?: string;
    onEnter?: string;
}
export interface DialogResponse {
    text: string;
    nextNodeId: string;
    condition?: string;
    effect?: string;
}
export interface DialogTree {
    id: string;
    startNodeId: string;
    nodes: Map<string, DialogNode>;
}
export declare function createDialogTree(id: string, nodes: DialogNode[]): DialogTree;
/** Get available responses (filter by conditions using evaluator). */
export declare function getAvailableResponses(tree: DialogTree, nodeId: string, evaluateCondition?: (condition: string) => boolean): DialogResponse[];
