openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
34 lines • 1.24 kB
TypeScript
//#region src/channels/location.d.ts
/** Normalized source kind for channel-provided geographic locations. */
type LocationSource = "pin" | "place" | "live";
/** Channel-neutral location payload passed from plugins into shared prompt rendering. */
type NormalizedLocation = {
latitude: number;
longitude: number;
accuracy?: number;
name?: string;
address?: string;
isLive?: boolean;
source?: LocationSource;
caption?: string;
};
/**
* Formats the safe inline location body shown to the model.
*
* Channel-provided labels, addresses, and captions are intentionally excluded
* here; `toLocationContext` carries them into the untrusted metadata block.
*/
declare function formatLocationText(location: NormalizedLocation): string;
/** Converts a normalized location into template context fields for prompt metadata. */
declare function toLocationContext(location: NormalizedLocation): {
LocationLat: number;
LocationLon: number;
LocationAccuracy?: number;
LocationName?: string;
LocationAddress?: string;
LocationSource: LocationSource;
LocationIsLive: boolean;
LocationCaption?: string;
};
//#endregion
export { toLocationContext as i, NormalizedLocation as n, formatLocationText as r, LocationSource as t };