Skip to content
Kitsy Docs Open CNOS

Namespaces

Namespaces

Primary namespaces:

  • value.*
  • secret.*
  • meta.*
  • process.* for server-only ambient runtime state
  • custom data namespaces such as flags.* or config.* 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 false or namespace-specific commands where supported
  • promoted to public.* when the namespace is shareable: true
  • exported through envMapping.explicit

process.* is built in and read-only. Typical keys include:

  • process.cwd
  • process.platform
  • process.arch
  • process.node.version
  • process.args.raw
  • process.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: true

Use 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;
});