Skip to content

AGENTS.md

98 lines · 2.7 KB · Markdown
Raw

@kody/environment — agent notes

Human setup and intent live in README.md. This file is for agents: imports, smoke checks, and edge cases. No user secrets. Do not disable live webhooks or jobs.

Secrets

None. Uses public Open-Meteo, Nominatim, and sunrise-sunset.org. Durable caches: weatherCache, forecastHistory in packageStorage.

Import paths

ExportImport
overview + AQI helperskody:@kody/environment
air-qualitykody:@kody/environment/air-quality
elevationkody:@kody/environment/elevation
forecast-historykody:@kody/environment/forecast-history
moonkody:@kody/environment/moon
snapshotkody:@kody/environment/snapshot
sunkody:@kody/environment/sun
weatherkody:@kody/environment/weather
weather-geocodekody:@kody/environment/weather-geocode

Prefer static kody:@kody/environment/... imports from execute. Do not lead with packages.invoke.

Named root helpers: getAirQuality, summarizeAirQuality. There is no default home location — always pass location or latitude + longitude.

Smoke test (read-only)

import { summarizeAirQuality } from 'kody:@kody/environment'

export default async function main() {
	return await summarizeAirQuality({ location: 'Reykjavík' })
}

Combined outdoor snapshot:

import environmentSnapshot from 'kody:@kody/environment/snapshot'

export default async function main() {
	return await environmentSnapshot({ location: 'Tokyo' })
}

Moon (no external API):

import moon from 'kody:@kody/environment/moon'

export default async function main() {
	return await moon({})
}

Geocode then weather:

import weatherGeocode from 'kody:@kody/environment/weather-geocode'
import weather from 'kody:@kody/environment/weather'

export default async function main() {
	const place = await weatherGeocode({ location: 'Denver, CO' })
	return await weather({
		latitude: place.latitude,
		longitude: place.longitude,
	})
}

By coordinates with a label:

import { summarizeAirQuality } from 'kody:@kody/environment'

export default async function main() {
	return await summarizeAirQuality({
		latitude: 40.7128,
		longitude: -74.006,
		label: 'New York City',
	})
}

Edge cases

  • Snapshot sections fail independently — a bad upstream yields { error } for that section, not a thrown whole-call failure.
  • Weather uses packageStorage cache when live Open-Meteo is degraded.
  • Named ESM exports work via static import { ... }. For keyless packages.invoke, use a subpath whose default export is the function (for example exportName: "weather"), or call the root overview.