Skip to main content

Ouro AX

ax-settings

One setting as the manifest declares it: a name, what it does, the values it takes and the one it starts at. The manifest is plain JSON, so a Node CLI and an engine CLI in another language read the same file.

npx shadcn@latest add ourostack/ouro-ui/ax-settings#v1.3.823

It installs lib/ouro/ax/settings.ts, with ax-problem. Its tests are ax-settings-tests. Every item runs on Node 22.18 or later as it is copied: the files import each other as ./<file>.ts. The Ouro AX guide shows how they fit together.

Exports

defineSettings

One declaration of a tool's settings that its CLIs read, so help, status and a refusal come from the same place. Pass the parsed manifest; a malformed one throws when the tool starts, not in an agent's run.

function defineSettings(manifest: SettingsManifest): SettingsTable

Example:

const settings = defineSettings(JSON.parse(readFileSync("settings.json", "utf8")));
settings.check("sending", "on");

SettingDeclaration

One setting as the manifest declares it: a name, what it does, the values it takes and the one it starts at. The manifest is plain JSON, so a Node CLI and an engine CLI in another language read the same file.

interface SettingDeclaration {
  name: string;
  about: string;
  values: readonly string[];
  default: string;
}

SettingsManifest

The JSON a tool ships once: { "settings": [ { "name", "about", "values", "default" } ] }.

interface SettingsManifest {
  settings: readonly SettingDeclaration[];
}

SettingsTable

interface SettingsTable {
  readonly settings: readonly SettingDeclaration[];
  get(name: string): SettingDeclaration;
  check(name: string, value: string): string;
  lines(current?: Readonly<Record<string, string>>): string[];
}