harn-stdlib 0.10.196

Embedded Harn standard library source catalog
Documentation
/** Generated by scripts/generate_cli_localization.mjs. Do not edit. */
import { MESSAGE_3 } from "std/cli/localization/messages/part_0"
import { MESSAGE_5, MESSAGE_8 } from "std/cli/localization/messages/part_1"
import { MESSAGE_79 } from "std/cli/localization/messages/part_15"
import { MESSAGE_92 } from "std/cli/localization/messages/part_18"
import { MESSAGE_13, MESSAGE_14 } from "std/cli/localization/messages/part_2"
import { MESSAGE_101, MESSAGE_103 } from "std/cli/localization/messages/part_20"
import { MESSAGE_113 } from "std/cli/localization/messages/part_22"
import { MESSAGE_136, MESSAGE_138 } from "std/cli/localization/messages/part_27"
import { MESSAGE_147 } from "std/cli/localization/messages/part_29"
import { MESSAGE_15, MESSAGE_16, MESSAGE_17 } from "std/cli/localization/messages/part_3"
import { MESSAGE_153, MESSAGE_154 } from "std/cli/localization/messages/part_30"
import { MESSAGE_156, MESSAGE_158 } from "std/cli/localization/messages/part_31"
import { MESSAGE_168, MESSAGE_169 } from "std/cli/localization/messages/part_33"
import { MESSAGE_204 } from "std/cli/localization/messages/part_40"
import { MESSAGE_212, MESSAGE_213 } from "std/cli/localization/messages/part_42"
import { MESSAGE_238 } from "std/cli/localization/messages/part_47"
import { MESSAGE_254 } from "std/cli/localization/messages/part_50"
import { MESSAGE_255 } from "std/cli/localization/messages/part_51"
import { MESSAGE_263 } from "std/cli/localization/messages/part_52"
import { MESSAGE_286 } from "std/cli/localization/messages/part_57"
import { MESSAGE_293 } from "std/cli/localization/messages/part_58"
import { MESSAGE_38 } from "std/cli/localization/messages/part_7"
import { MESSAGE_42, MESSAGE_43, MESSAGE_44 } from "std/cli/localization/messages/part_8"
import { MESSAGE_45 } from "std/cli/localization/messages/part_9"
import { MessageTemplate, render_message } from "std/cli/message_template"

const MESSAGES: dict<string, MessageTemplate> = {
  "  LoRA hparams: rank={0} alpha={1} dropout={2}": MESSAGE_3,
  "  adapter binding: {0}": MESSAGE_5,
  "  adapter precision: {0}": MESSAGE_8,
  "  backend argv: required": MESSAGE_13,
  "  backend exit code: {0}": MESSAGE_14,
  "  backend realized rows: rendered={0} trainable={1} retention={2}": MESSAGE_15,
  "  backend result: {0}": MESSAGE_16,
  "  backend status: {0}": MESSAGE_17,
  "  contract: {0}": MESSAGE_38,
  "  dataset audit: status={0} rows={1} invalid_tool_blocks={2} parse_errors={3}": MESSAGE_42,
  "  dataset coverage: text_tool_rows={0} native_tool_rows={1} no_tool_rows={2} parallel_rows={3} multi_turn_rows={4}":
    MESSAGE_43,
  "  dataset format: {0}": MESSAGE_44,
  "  dataset repairs: schema_repaired={0} unavailable_tool={1} tool_result_rows={2}": MESSAGE_45,
  "  max_seq_length: {0}": MESSAGE_79,
  "  output dir: {0}": MESSAGE_92,
  "  producer: {0}": MESSAGE_101,
  "  promotion id: {0}": MESSAGE_103,
  "  request model: {0}": MESSAGE_113,
  "  teacher: {0} via {1}": MESSAGE_136,
  "  template: {0}": MESSAGE_138,
  "  tool format: {0} (requested {1})": MESSAGE_147,
  "  trainer: {0}": MESSAGE_153,
  "  training base precision: {0}": MESSAGE_154,
  "  training compute precision: {0}": MESSAGE_156,
  "  training: {0} + {1}": MESSAGE_158,
  "  {0}: {1} ({2}, exists={3}){4}": MESSAGE_168,
  " sha256={0}": MESSAGE_169,
  "LoRA train {0} for {1} on {2} via {3}": MESSAGE_204,
  backend: MESSAGE_212,
  "backend warnings": MESSAGE_213,
  "inspect adapter": MESSAGE_238,
  "post-training manifest": MESSAGE_254,
  "precision gates": MESSAGE_255,
  "promotion receipts": MESSAGE_263,
  "trainer contract": MESSAGE_286,
  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)
}