harn-stdlib 0.10.199

Embedded Harn standard library source catalog
Documentation
/** Generated by scripts/generate_cli_localization.mjs. Do not edit. */
import { MESSAGE_2 } from "std/cli/localization/messages/part_0"
import { MESSAGE_50 } from "std/cli/localization/messages/part_10"
import { MESSAGE_83 } from "std/cli/localization/messages/part_16"
import { MESSAGE_97, MESSAGE_99 } from "std/cli/localization/messages/part_19"
import { MESSAGE_103 } from "std/cli/localization/messages/part_20"
import { MESSAGE_110 } from "std/cli/localization/messages/part_22"
import { MESSAGE_118 } from "std/cli/localization/messages/part_23"
import { MESSAGE_148, MESSAGE_149 } from "std/cli/localization/messages/part_29"
import { MESSAGE_194 } from "std/cli/localization/messages/part_38"
import { MESSAGE_203 } from "std/cli/localization/messages/part_40"
import { MESSAGE_207 } from "std/cli/localization/messages/part_41"
import { MESSAGE_230 } from "std/cli/localization/messages/part_46"
import { MESSAGE_258 } from "std/cli/localization/messages/part_51"
import { MESSAGE_293 } from "std/cli/localization/messages/part_58"
import { MessageTemplate, render_message } from "std/cli/message_template"

const MESSAGES: dict<string, MessageTemplate> = {
  "  LoRA contract: {0}": MESSAGE_2,
  "  eval dataset: {0}": MESSAGE_50,
  "  minimum trials: {0}": MESSAGE_83,
  "  probe cases:": MESSAGE_97,
  "  probe root: {0}": MESSAGE_99,
  "  promotion id: {0}": MESSAGE_103,
  "  receipt: {0}": MESSAGE_110,
  "  result: {0}": MESSAGE_118,
  "  totals: adapter_passed={0} adapter_failed={1} base_present={2} missing={3} cost_usd={4}":
    MESSAGE_148,
  "  train receipt: {0}": MESSAGE_149,
  FAIL: MESSAGE_194,
  "LoRA promotion probe matrix": MESSAGE_203,
  PASS: MESSAGE_207,
  errors: MESSAGE_230,
  "probe {0} failures": MESSAGE_258,
  warnings: MESSAGE_293,
}

/**
 * Select a registered CLI template without interpreting argument text.
 * @effects: []
 * @errors: ["Unregistered CLI localization message", "CLI localization argument count does not match its registered template"]
 */
pub fn cli_message(locale: string, source: string, values: list<string>) -> string {
  const template = MESSAGES[source]
  guard template != nil else {
    throw "Unregistered CLI localization message"
  }
  return render_message(template, locale, values)
}