// SPDX-License-Identifier: MIT
package greentic:runtime-config@1.0.0;
/// Read-only non-secret runtime config exposed by Greentic hosts.
///
/// Components import this interface to read `pack-config.v1.non_secret`
/// values resolved at deploy time. Sensitive material stays on
/// `greentic:secrets-store`. C5's `runtime_refs` (`runtime://`) resolution
/// will land via a `@1.1.0` compat upgrade, mirroring the
/// `secrets-store@1.0.0` → `@1.1.0` path.
interface runtime-config {
/// Canonical error payload for non-secret config lookups.
enum config-error {
/// Key was not found.
not-found,
/// Access to the key was denied by host policy.
denied,
/// The provided key was invalid or malformed.
invalid-key,
/// An internal host error occurred.
internal,
}
/// Reads a non-secret config value by key. Returns the value as a UTF-8
/// string, conventionally JSON-encoded (mirrors `PackConfig.non_secret`).
get: func(key: string) -> result<option<string>, config-error>;
}
world reader {
import runtime-config;
}