Skip to main content

lifeloop/telemetry/
host.rs

1//! Host-adapter dispatch and shared env aliases for telemetry readers.
2//!
3//! Lifeloop owns: the env-var alias table (`LIFELOOP_*` over `CCD_*`)
4//! used to locate harness telemetry artifacts.
5//!
6//! This file does **not** own role/primary-worker/supervisor selection
7//! semantics — that lives in the manifest registry (issue #6).
8
9use super::EnvAlias;
10
11/// `CCD_HOST_ADAPTER` / `LIFELOOP_HOST_ADAPTER` — names the adapter id
12/// the caller wants telemetry resolved against. Per-adapter routing is
13/// the manifest registry's job; this alias is exposed so clients
14/// migrating from CCD's host-adapter env conventions can do so.
15pub const HOST_ADAPTER_ALIASES: &[EnvAlias] = &[EnvAlias {
16    lifeloop: "LIFELOOP_HOST_ADAPTER",
17    ccd_compat: "CCD_HOST_ADAPTER",
18}];
19
20/// Resolve the explicit host-adapter selection, if set.
21pub fn explicit_host_adapter() -> Option<String> {
22    super::resolve_env_string(HOST_ADAPTER_ALIASES)
23}