/** * Spatiotemporal Trait Handlers * * Runtime trait handler implementations for the three spatiotemporal * constraint extensions: * - spatial_temporal_adjacent: adjacency that must hold for N seconds * - spatial_temporal_reachable: reachability with moving obstacle velocity prediction * - spatial_trajectory: path-based constraints over predicted entity motion * * These traits complement the base spatial constraints (spatial_adjacent, * spatial_contains, spatial_reachable) with temporal reasoning. * * @version 1.0.0 * @module traits/SpatiotemporalTraits */ import type { TraitHandler } from '@holoscript/core'; import type { SpatialTemporalAdjacentConfig, SpatialTemporalReachableConfig, SpatialTrajectoryConfig } from '@holoscript/engine/spatial'; import type { Vector3 } from '@holoscript/core'; /** * Predict a position at time t given current position, velocity, and optional acceleration. */ declare function predictPosition(position: Vector3 | [number, number, number], velocity: Vector3 | [number, number, number], t: number, acceleration?: Vector3 | [number, number, number]): [number, number, number]; /** * Find the closest point on a line segment AB to point P. */ declare function closestPointOnSegment(p: Vector3 | [number, number, number], a: Vector3 | [number, number, number], b: Vector3 | [number, number, number]): [number, number, number]; /** * Compute minimum distance from point P to a polyline path. */ declare function distanceToPath(p: Vector3 | [number, number, number], path: Array): number; /** * Runtime handler for the spatial_temporal_adjacent constraint. * * Extends spatial_adjacent with duration semantics: the adjacency condition * must hold continuously for at least `minDuration` seconds. A configurable * `gracePeriod` provides hysteresis to prevent rapid violation/resolution * flickering. * * HoloScript usage: * ```holoscript * orb#guard { * @spatial_temporal_adjacent( * target: "prisoner", * maxDistance: 3m, * minDuration: 5s, * gracePeriod: 1s * ) * } * ``` */ export declare const spatialTemporalAdjacentHandler: TraitHandler; /** * Runtime handler for the spatial_temporal_reachable constraint. * * Extends spatial_reachable with velocity-based obstacle prediction. * Moving obstacles are extrapolated forward in time to determine whether * the path will remain clear over the prediction horizon. * * HoloScript usage: * ```holoscript * orb#drone { * @spatial_temporal_reachable( * target: "landing_pad", * maxPathLength: 100m, * predictionHorizon: 3s, * movingObstacles: ["vehicle", "drone"], * safetyMargin: 1.5m * ) * } * ``` */ export declare const spatialTemporalReachableHandler: TraitHandler; /** * Runtime handler for the spatial_trajectory constraint. * * Predicts the entity's future trajectory based on position, velocity, * and optional acceleration, then validates it against spatial constraints: * - keep_in: all sample points must remain inside a region * - keep_out: all sample points must remain outside a region * - follow: all sample points must stay within maxDeviation of a reference path * - waypoint: the trajectory must pass through specified waypoints * * HoloScript usage: * ```holoscript * orb#missile { * @spatial_trajectory( * mode: "keep_in", * regionId: "safe_corridor", * horizon: 5s, * sampleCount: 20 * ) * } * ``` */ export declare const spatialTrajectoryHandler: TraitHandler; export { predictPosition, closestPointOnSegment, distanceToPath }; //# sourceMappingURL=SpatiotemporalTraits.d.ts.map