Namespaces
Namespaces
Primary namespaces:
value.*secret.*meta.*process.*for server-only ambient runtime state- custom data namespaces such as
flags.*orconfig.*when declared in.cnos/cnos.yml - custom runtime namespaces declared under
namespaces.runtime
Derived surfaces:
public.*for promoted browser-safe values- explicit env exports through
envMapping.explicit
Custom data namespaces can be:
- read at runtime with
cnos('flags.upi_enabled') - written through the CLI with
cnos define value flags.upi_enabled falseor namespace-specific commands where supported - promoted to
public.*when the namespace isshareable: true - exported through
envMapping.explicit
process.* is built in and read-only. Typical keys include:
process.cwdprocess.platformprocess.archprocess.node.versionprocess.args.rawprocess.env.PATH
process.* cannot be promoted or exported.
Runtime Namespaces
Runtime namespaces are not populated from config files. They are declared in the manifest and populated by the host runtime.
namespaces: runtime: request: description: HTTP request context server_only: trueUse them from derived values:
app: current_host: $derive: expr: "coalesce(request.headers.host, value.app.default_host)"And register providers in server code:
cnos.registerRuntimeProvider('request', (key) => { if (key === 'headers.host') { return currentRequest?.headers.host; }
return undefined;});