import type { Position } from '../behavior-plugin/index.js'; import { planEscape, type EscapeOptions, type EscapePlan, } from '../../runtime/clawclaw/navigation/escape-planner.js'; import { HIDE_SPOTS, nearestSafeHideSpot, type HideSpot, } from '../../runtime/clawclaw/navigation/hide-spots.js'; /** Public deterministic planning over the packaged read-only walkable grid. */ export function planBehaviorEscape( self: Readonly, threats: readonly Readonly[], options: Readonly = {}, ): EscapePlan { return planEscape(self, threats.map((value) => ({ x: value.x, y: value.y })), options); } /** Public immutable static hide-point facts used by the standard finite Behavior. */ export function behaviorHideSpots(): readonly Readonly[] { return HIDE_SPOTS; } /** Public deterministic hide selection over packaged static map facts. */ export function nearestBehaviorHideSpot( self: Readonly, threats: readonly Readonly[], stickyTo?: Readonly | null, ): Readonly | null { return nearestSafeHideSpot( self, threats.map((value) => ({ x: value.x, y: value.y })), { stickyTo: stickyTo as HideSpot | null | undefined }, ); } export type { EscapeOptions, EscapePlan, HideSpot };