/**
 * English locale — tool descriptions & parameter descriptions
 * Default locale for cesium-mcp-runtime
 */

export const toolDescriptions: Record<string, string> = {
  // — view
  flyTo: 'Fly to a specific longitude/latitude position (with animation transition)',
  setView: 'Instantly switch to specified longitude/latitude view (no animation)',
  getView: 'Get current camera view info (longitude, latitude, height, angles)',
  zoomToExtent: 'Zoom to specified geographic extent',
  saveViewpoint: 'Save current view as bookmark (name → view state), restore via loadViewpoint',
  loadViewpoint: 'Restore a saved viewpoint bookmark (with fly animation), returns saved view state',
  listViewpoints: 'List all saved viewpoint bookmarks',

  // — entity
  addMarker: 'Add a marker point at specified coordinates, returns layerId for later operations',
  addLabel: 'Add text labels to GeoJSON features (display attribute values)',
  addModel: 'Place a 3D model (glTF/GLB) at specified coordinates, returns entityId',
  addPolygon: 'Add a polygon area on the map (area/boundary), returns entityId',
  addPolyline: 'Add a polyline on the map (path/line segment), returns entityId',
  updateEntity: 'Update properties of an existing entity (position, color, label, scale, visibility)',
  removeEntity: 'Remove a single entity by entityId',
  batchAddEntities: 'Batch add multiple entities (create multiple markers/polylines/polygons/models in one call), returns all entityIds',
  queryEntities: 'Query existing entities — filter by name, type, spatial extent, returns entityId/name/type/position list',

  // — layer
  addGeoJsonLayer: 'Add GeoJSON layer to map (supports Point/Line/Polygon, configurable color/choropleth/category rendering). data and url are mutually exclusive',
  addGeoJsonPrimitive: 'High-performance GeoJSON loading for massive datasets (100k+ features). Bypasses Entity system, renders directly via Primitives. data and url are mutually exclusive',
  listLayers: 'Get current layer list (with ID, name, type, visibility)',
  getLayerSchema: 'Get layer field schema — returns field names, types, sample values. Works with GeoJSON/CZML/KML/3D Tiles layers',
  removeLayer: 'Remove a layer from map by layer ID',
  setLayerVisibility: 'Set layer visibility',
  updateLayerStyle: 'Update layer style (color, opacity, label style, 3D Tiles style, etc.)',
  setBasemap: 'Switch basemap style (dark/satellite/standard/osm/arcgis/light/tianditu/amap)',

  // — camera
  lookAtTransform: 'Look at a specific position from a given heading/pitch/range (orbit-style camera)',
  startOrbit: 'Start orbiting the camera around the current view center',
  stopOrbit: 'Stop the camera orbit animation',
  setCameraOptions: 'Configure camera controller options (enable/disable rotation, zoom, tilt, etc.)',

  // — entity-ext
  addBillboard: 'Add a billboard (image icon) at a position on the globe',
  addBox: 'Add a 3D box entity at a position',
  addCorridor: 'Add a corridor (path with width) entity',
  addCylinder: 'Add a cylinder or cone entity at a position',
  addEllipse: 'Add an ellipse (oval) entity at a position',
  addRectangle: 'Add a rectangle entity defined by geographic bounds',
  addWall: 'Add a wall entity along a series of positions',

  // — animation
  createAnimation: 'Create a time-based animation with waypoints (moving entity along a path)',
  controlAnimation: 'Play or pause the current animation',
  removeAnimation: 'Remove an animation entity',
  listAnimations: 'List all active animations',
  updateAnimationPath: 'Update the visual properties of an animation path',
  trackEntity: 'Track (follow) an entity with the camera, or stop tracking',
  controlClock: 'Configure the Cesium clock (time range, speed, animation state)',
  setGlobeLighting: 'Enable/disable globe lighting and atmospheric effects',

  // — scene
  setSceneOptions: 'Configure scene environment (fog, atmosphere, shadows, sun, moon, background color, depth testing)',
  setPostProcess: 'Configure post-processing effects (bloom glow, ambient occlusion SSAO, anti-aliasing FXAA)',

  // — tiles
  load3dTiles: 'Load 3D Tiles dataset (e.g. building white models, city models)',
  loadTerrain: 'Load or switch terrain (flat/ArcGIS/CesiumIon/custom URL)',
  loadImageryService: 'Load imagery service layer (WMS/WMTS/XYZ/ArcGIS MapServer)',
  loadCzml: 'Load CZML time-dynamic data source (CesiumJS native format, supports time-varying position/style/animation). data and url are mutually exclusive',
  loadKml: 'Load KML/KMZ data source (Google Earth format). data and url are mutually exclusive',

  // — interaction
  screenshot: 'Capture current map view (returns base64 PNG)',
  highlight: 'Highlight features in a layer',
  measure: 'Measure distance or area (coordinate-based calculation, optionally displayed on map)',

  // — clear
  clearAll: 'Clear all layers, entities, animations, and trajectories from the map (reset scene)',

  // — entity inspection
  getEntityProperties: 'Get detailed properties of a specific entity — type, position, custom properties, and graphic properties',

  // — scene export
  exportScene: 'Export current scene snapshot — includes camera view, layer list, entity list, and timestamp',

  // — trajectory
  playTrajectory: 'Play a moving trajectory animation',

  // — heatmap
  addHeatmap: 'Add heatmap layer (generate heat visualization from GeoJSON point data)',

  // — geolocation
  geocode: 'Convert address, landmark, or place name to geographic coordinates (longitude/latitude). Uses OpenStreetMap Nominatim free service, no API key required.',
}

export const paramDescriptions: Record<string, Record<string, string>> = {
  flyTo: {
    longitude: 'Longitude (-180 to 180)',
    latitude: 'Latitude (-90 to 90)',
    height: 'Camera height (meters), default 50000',
    heading: 'Heading angle (degrees), 0 = North',
    pitch: 'Pitch angle (degrees), -90 = straight down',
    duration: 'Flight animation duration (seconds)',
  },
  setView: {
    longitude: 'Longitude (-180 to 180)',
    latitude: 'Latitude (-90 to 90)',
    height: 'Height (meters)',
    heading: 'Heading angle (degrees)',
    pitch: 'Pitch angle (degrees)',
    roll: 'Roll angle (degrees)',
  },
  zoomToExtent: {
    west: 'West boundary longitude (degrees)',
    south: 'South boundary latitude (degrees)',
    east: 'East boundary longitude (degrees)',
    north: 'North boundary latitude (degrees)',
    duration: 'Animation duration (seconds)',
  },
  saveViewpoint: {
    name: 'Bookmark name (unique identifier, overwrites if duplicate)',
  },
  loadViewpoint: {
    name: 'Bookmark name',
    duration: 'Fly animation duration (seconds), 0 = instant',
  },
  addMarker: {
    longitude: 'Longitude (-180 to 180)',
    latitude: 'Latitude (-90 to 90)',
    label: 'Label text',
    color: 'Marker color (CSS format)',
    size: 'Point size (pixels)',
    id: 'Custom layer ID (auto-generated if omitted)',
  },
  addLabel: {
    data: 'GeoJSON FeatureCollection object',
    field: 'Attribute field name for label text (e.g. "name", "population")',
    style: 'Label style (font, fillColor, outlineColor, scale, etc.)',
  },
  addModel: {
    longitude: 'Longitude (-180 to 180)',
    latitude: 'Latitude (-90 to 90)',
    height: 'Placement height (meters)',
    url: 'glTF/GLB model file URL',
    scale: 'Model scale factor',
    heading: 'Heading angle (degrees), 0=North',
    pitch: 'Pitch angle (degrees)',
    roll: 'Roll angle (degrees)',
    label: 'Model label text',
  },
  addPolygon: {
    coordinates: 'Polygon outer ring coordinates [[lon, lat, height?], ...]',
    color: 'Fill color (CSS format)',
    outlineColor: 'Outline color',
    opacity: 'Fill opacity (0-1)',
    extrudedHeight: 'Extruded height (meters), for 3D effect',
    clampToGround: 'Whether to clamp to ground',
    label: 'Polygon label text',
  },
  addPolyline: {
    coordinates: 'Polyline coordinates array [[lon, lat, height?], ...]',
    color: 'Line color (CSS format)',
    width: 'Line width (pixels)',
    clampToGround: 'Whether to clamp to ground',
    label: 'Polyline label text',
  },
  updateEntity: {
    entityId: 'Entity ID (returned by addMarker/addPolyline etc.)',
    position: 'New position coordinates',
    label: 'New label text',
    color: 'New color (CSS format)',
    scale: 'New scale factor',
    show: 'Whether to show',
  },
  removeEntity: {
    entityId: 'Entity ID to remove',
  },
  batchAddEntities: {
    entities: 'Array of entity definitions, each containing a type field and parameters for that type',
  },
  queryEntities: {
    name: 'Name fuzzy match (case-insensitive)',
    type: 'Filter by entity type',
    bbox: 'Spatial extent filter [west, south, east, north] (degrees)',
  },
  addGeoJsonLayer: {
    id: 'Layer ID (auto-generated if omitted)',
    name: 'Layer display name',
    data: 'GeoJSON FeatureCollection object (mutually exclusive with url)',
    url: 'GeoJSON file URL (mutually exclusive with data, fetched in browser)',
    style: 'Style config (color, opacity, pointSize, choropleth, category)',
  },
  addGeoJsonPrimitive: {
    id: 'Layer ID (auto-generated if omitted)',
    name: 'Layer display name',
    data: 'GeoJSON object (mutually exclusive with url)',
    url: 'GeoJSON file URL (mutually exclusive with data)',
    allowPicking: 'Allow picking (default true, disable for better performance)',
    show: 'Whether to show (default true)',
  },
  listLayers: {},
  getLayerSchema: {
    layerId: 'Layer ID (get via listLayers)',
  },
  removeLayer: {
    id: 'Layer ID to remove (get via listLayers)',
  },
  setLayerVisibility: {
    id: 'Layer ID',
    visible: 'Whether visible',
  },
  updateLayerStyle: {
    layerId: 'Layer ID',
    labelStyle: 'Label style (font, fillColor, outlineColor, outlineWidth, scale, etc.)',
    layerStyle: 'Entity layer style (color, opacity, strokeWidth, pointSize; GeoJSON thematic styles choropleth/category/randomColor/gradient are mutually exclusive)',
    imageryStyle: 'Imagery visual style (alpha, brightness, contrast, hue, saturation, gamma); use setLayerVisibility for show/hide',
    primitiveStyle: 'GeoJSON Primitive material style (color, opacity, outlineColor, outlineWidth, pointSize, lineWidth); use setLayerVisibility for show/hide',
    tileStyle: '3D Tiles style (Cesium3DTileStyle expressions: color, show, pointSize, meta)',
  },
  setBasemap: {
    basemap: 'Basemap type: dark=dark theme, satellite=satellite imagery, standard=standard, osm=OpenStreetMap, arcgis=ArcGIS streets, light=light theme, tianditu_vec=Tianditu vector, tianditu_img=Tianditu imagery, amap=Amap roads, amap_satellite=Amap satellite',
    token: 'Token for providers requiring authentication (e.g. Tianditu)',
    url: 'Custom URL template with {x},{y},{z} placeholders. When provided, basemap param is ignored.',
  },
  highlight: {
    layerId: 'Layer ID',
    featureIndex: 'Feature index (highlights all if omitted)',
    color: 'Highlight color (CSS format)',
  },
  measure: {
    mode: 'Measurement mode: distance or area',
    positions: 'Coordinate array [[lon, lat, alt?], ...]',
    showOnMap: 'Whether to display measurement result on map',
    id: 'Custom measurement entity ID',
  },
  getEntityProperties: {
    entityId: 'Entity ID (obtainable via queryEntities)',
  },
  lookAtTransform: {
    longitude: 'Target longitude (degrees)',
    latitude: 'Target latitude (degrees)',
    height: 'Target height (meters)',
    heading: 'Camera heading (degrees), 0=North',
    pitch: 'Camera pitch (degrees), -90=straight down',
    range: 'Distance from target (meters)',
  },
  startOrbit: {
    speed: 'Rotation speed (radians per tick)',
    clockwise: 'Orbit direction',
  },
  setCameraOptions: {
    enableRotate: 'Enable camera rotation',
    enableTranslate: 'Enable camera translation',
    enableZoom: 'Enable camera zoom',
    enableTilt: 'Enable camera tilt',
    enableLook: 'Enable camera look',
    minimumZoomDistance: 'Minimum zoom distance (meters)',
    maximumZoomDistance: 'Maximum zoom distance (meters)',
    enableInputs: 'Enable/disable all camera inputs',
  },
  addBillboard: {
    longitude: 'Longitude (degrees)',
    latitude: 'Latitude (degrees)',
    height: 'Height (meters)',
    name: 'Billboard name',
    image: 'Image URL for the billboard',
    scale: 'Scale factor',
    color: 'Tint color',
    pixelOffset: 'Pixel offset from position',
    horizontalOrigin: 'Horizontal origin',
    verticalOrigin: 'Vertical origin',
    heightReference: 'Height reference',
  },
  addBox: {
    longitude: 'Longitude (degrees)',
    latitude: 'Latitude (degrees)',
    height: 'Height (meters)',
    name: 'Box name',
    dimensions: 'Box dimensions',
    material: 'Material (color string, RGBA object, or material spec)',
    outline: 'Show outline',
    outlineColor: 'Outline color',
    fill: 'Show fill',
    orientation: 'Orientation (heading/pitch/roll in degrees)',
    heightReference: 'Height reference',
  },
  addCorridor: {
    name: 'Corridor name',
    positions: 'Array of positions along the corridor',
    width: 'Corridor width in meters',
    material: 'Material',
    cornerType: 'Corner type',
    height: 'Height above ground (meters)',
    extrudedHeight: 'Extruded height (meters)',
    outline: 'Show outline',
    outlineColor: 'Outline color',
  },
  addCylinder: {
    longitude: 'Longitude (degrees)',
    latitude: 'Latitude (degrees)',
    height: 'Height (meters)',
    name: 'Cylinder name',
    length: 'Cylinder length/height in meters',
    topRadius: 'Top radius in meters',
    bottomRadius: 'Bottom radius in meters',
    material: 'Material',
    outline: 'Show outline',
    outlineColor: 'Outline color',
    fill: 'Show fill',
    orientation: 'Orientation (heading/pitch/roll in degrees)',
    numberOfVerticalLines: 'Number of vertical lines',
    slices: 'Number of slices',
  },
  addEllipse: {
    longitude: 'Center longitude (degrees)',
    latitude: 'Center latitude (degrees)',
    height: 'Height (meters)',
    name: 'Ellipse name',
    semiMajorAxis: 'Semi-major axis in meters',
    semiMinorAxis: 'Semi-minor axis in meters',
    material: 'Material',
    extrudedHeight: 'Extruded height (meters)',
    rotation: 'Rotation (radians)',
    outline: 'Show outline',
    outlineColor: 'Outline color',
    fill: 'Show fill',
    stRotation: 'Texture rotation (radians)',
    numberOfVerticalLines: 'Number of vertical lines',
  },
  addRectangle: {
    name: 'Rectangle name',
    west: 'West longitude (degrees)',
    south: 'South latitude (degrees)',
    east: 'East longitude (degrees)',
    north: 'North latitude (degrees)',
    material: 'Material',
    height: 'Height (meters)',
    extrudedHeight: 'Extruded height (meters)',
    rotation: 'Rotation (radians)',
    outline: 'Show outline',
    outlineColor: 'Outline color',
    fill: 'Show fill',
    stRotation: 'Texture rotation (radians)',
  },
  addWall: {
    name: 'Wall name',
    positions: 'Array of positions along the wall',
    minimumHeights: 'Minimum heights at each position',
    maximumHeights: 'Maximum heights at each position',
    material: 'Material',
    outline: 'Show outline',
    outlineColor: 'Outline color',
    fill: 'Show fill',
  },
  createAnimation: {
    name: 'Animation name',
    waypoints: 'Array of waypoints with positions and timestamps',
    modelUri: 'glTF/GLB model URL, or preset: cesium_man, cesium_air, ground_vehicle, cesium_drone',
    showPath: 'Show trail path',
    pathWidth: 'Path width (pixels)',
    pathColor: 'Path color (CSS)',
    pathLeadTime: 'Path lead time (seconds)',
    pathTrailTime: 'Path trail time (seconds)',
    multiplier: 'Clock speed multiplier',
    shouldAnimate: 'Auto-start animation',
  },
  controlAnimation: {
    action: 'Play or pause',
  },
  removeAnimation: {
    entityId: 'Entity ID of the animation to remove',
  },
  updateAnimationPath: {
    entityId: 'Entity ID of the animation',
    width: 'New path width (pixels)',
    color: 'New path color (CSS)',
    leadTime: 'New lead time (seconds)',
    trailTime: 'New trail time (seconds)',
    show: 'Show/hide path',
  },
  trackEntity: {
    entityId: 'Entity ID to track (omit to stop tracking)',
    heading: 'Camera heading (degrees)',
    pitch: 'Camera pitch (degrees)',
    range: 'Camera distance from entity (meters)',
  },
  controlClock: {
    action: 'Clock action',
    startTime: 'ISO 8601 start time (for configure)',
    stopTime: 'ISO 8601 stop time (for configure)',
    currentTime: 'ISO 8601 current time (for configure)',
    time: 'ISO 8601 time to jump to (for setTime)',
    multiplier: 'Clock speed multiplier (for configure/setMultiplier)',
    shouldAnimate: 'Whether clock should animate (for configure)',
    clockRange: 'Clock range mode (for configure)',
  },
  setGlobeLighting: {
    enableLighting: 'Enable globe lighting',
    dynamicAtmosphereLighting: 'Enable dynamic atmosphere lighting',
    dynamicAtmosphereLightingFromSun: 'Use sun position for atmosphere lighting',
  },
  setSceneOptions: {
    fogEnabled: 'Enable/disable fog',
    fogDensity: 'Fog density (0.0~1.0, default ~0.0002)',
    fogMinimumBrightness: 'Minimum fog brightness (0.0~1.0)',
    skyAtmosphereShow: 'Show sky atmosphere',
    skyAtmosphereHueShift: 'Sky hue shift (-1.0~1.0)',
    skyAtmosphereSaturationShift: 'Sky saturation shift (-1.0~1.0)',
    skyAtmosphereBrightnessShift: 'Sky brightness shift (-1.0~1.0)',
    groundAtmosphereShow: 'Show ground atmosphere',
    shadowsEnabled: 'Enable shadows',
    shadowsSoftShadows: 'Use soft shadows',
    shadowsDarkness: 'Shadow darkness (0.0=no shadow, 1.0=fully dark)',
    sunShow: 'Show the sun',
    sunGlowFactor: 'Sun glow factor (default 1.0)',
    moonShow: 'Show the moon',
    depthTestAgainstTerrain: 'Enable depth test against terrain (entities behind terrain are hidden)',
    backgroundColor: 'Scene background color (CSS format, e.g. "#000000")',
  },
  setPostProcess: {
    bloom: 'Enable bloom glow effect',
    bloomContrast: 'Bloom contrast (default 128)',
    bloomBrightness: 'Bloom brightness (default -0.3)',
    bloomDelta: 'Bloom delta (default 1.0)',
    bloomSigma: 'Bloom sigma (default 3.78)',
    bloomStepSize: 'Bloom step size (default 5.0)',
    bloomGlowOnly: 'Show only the glow (no base scene)',
    ambientOcclusion: 'Enable ambient occlusion (SSAO)',
    aoIntensity: 'AO intensity (default 3.0)',
    aoBias: 'AO bias (default 0.1)',
    aoLengthCap: 'AO length cap (default 0.26)',
    aoStepSize: 'AO step size (default 1.95)',
    fxaa: 'Enable FXAA anti-aliasing',
  },
  load3dTiles: {
    id: 'Layer ID',
    name: 'Layer name',
    url: 'tileset.json URL',
    maximumScreenSpaceError: 'Maximum screen space error (lower = more detailed)',
    heightOffset: 'Height offset (meters)',
  },
  loadTerrain: {
    provider: 'Terrain provider type',
    url: 'Custom terrain service URL',
    cesiumIonAssetId: 'Cesium Ion asset ID (required when provider=cesiumion)',
  },
  loadImageryService: {
    id: 'Layer ID',
    name: 'Layer name',
    url: 'Imagery service URL',
    serviceType: 'Service type',
    layerName: 'WMS/WMTS layer name',
    opacity: 'Opacity (0-1)',
  },
  loadCzml: {
    id: 'Layer ID (auto-generated if omitted)',
    name: 'Data source display name',
    data: 'CZML packet array (mutually exclusive with url)',
    url: 'CZML file URL (mutually exclusive with data, browser-side fetch)',
    sourceUri: 'Base URI for resolving relative references in CZML',
    clampToGround: 'Clamp entities to ground surface',
    flyTo: 'Fly to data extent after loading (default true)',
  },
  loadKml: {
    id: 'Layer ID (auto-generated if omitted)',
    name: 'Data source display name',
    url: 'KML/KMZ file URL (mutually exclusive with data, browser-side fetch)',
    data: 'KML XML string (mutually exclusive with url)',
    sourceUri: 'Base URI for resolving relative references in KML',
    clampToGround: 'Clamp entities to ground surface',
    flyTo: 'Fly to data extent after loading (default true)',
  },
  playTrajectory: {
    id: 'Trajectory layer ID',
    name: 'Trajectory name',
    coordinates: 'Trajectory coordinates array [[lon, lat, alt?], ...]',
    durationSeconds: 'Animation duration (seconds)',
    trailSeconds: 'Trail length (seconds)',
    label: 'Moving object label',
  },
  addHeatmap: {
    data: 'GeoJSON Point FeatureCollection',
    radius: 'Heat influence radius (pixels)',
  },
  geocode: {
    address: 'Address, landmark, or place name, e.g. "故宫", "Eiffel Tower", "東京タワー"',
    countryCode: 'Two-letter ISO country code to restrict search scope (e.g. "CN", "US", "JP")',
  },
}
