harn-stdlib 0.10.201

Embedded Harn standard library source catalog
Documentation
/** Generated by make gen-cli-localization. Do not edit. */
import { MESSAGE_0, MESSAGE_1 } from "std/cli/localization/messages/part_0"
import { MESSAGE_51, MESSAGE_53 } from "std/cli/localization/messages/part_10"
import { MESSAGE_55, MESSAGE_57 } from "std/cli/localization/messages/part_11"
import { MESSAGE_71, MESSAGE_73 } from "std/cli/localization/messages/part_14"
import { MESSAGE_79 } from "std/cli/localization/messages/part_15"
import { MESSAGE_81, MESSAGE_82, MESSAGE_84 } from "std/cli/localization/messages/part_16"
import { MESSAGE_100 } from "std/cli/localization/messages/part_20"
import { MESSAGE_111 } from "std/cli/localization/messages/part_22"
import { MESSAGE_115, MESSAGE_116, MESSAGE_118 } from "std/cli/localization/messages/part_23"
import { MESSAGE_134 } from "std/cli/localization/messages/part_26"
import { MESSAGE_135 } from "std/cli/localization/messages/part_27"
import { MESSAGE_140 } from "std/cli/localization/messages/part_28"
import { MESSAGE_145 } from "std/cli/localization/messages/part_29"
import { MESSAGE_194 } from "std/cli/localization/messages/part_38"
import { MESSAGE_20, MESSAGE_21 } from "std/cli/localization/messages/part_4"
import { MESSAGE_202 } from "std/cli/localization/messages/part_40"
import { MESSAGE_205, MESSAGE_207 } from "std/cli/localization/messages/part_41"
import { MESSAGE_230 } from "std/cli/localization/messages/part_46"
import { MESSAGE_290, MESSAGE_293 } from "std/cli/localization/messages/part_58"
import { MESSAGE_30 } from "std/cli/localization/messages/part_6"
import { MESSAGE_40 } from "std/cli/localization/messages/part_8"
import { MESSAGE_46 } from "std/cli/localization/messages/part_9"
import { MessageTemplate, render_message } from "std/cli/message_template"

const MESSAGES: dict<string, MessageTemplate> = {
  "    - {0} line={1} approx_tokens={2} {3}/{4}": MESSAGE_0,
  "    - {0} line={1} {2}: {3}": MESSAGE_1,
  "  behavior strata policy: {0} status={1}": MESSAGE_20,
  "  behavior strata: source={0} emitted={1}": MESSAGE_21,
  "  config: {0}": MESSAGE_30,
  "  corpus: {0}": MESSAGE_40,
  "  declared tool formats: {0}": MESSAGE_46,
  "  expected source tool format: {0}": MESSAGE_51,
  "  export-required source tool format: {0}": MESSAGE_53,
  "  fit: {0}/{1} ({2})": MESSAGE_55,
  "  hard token estimate limit: {0}": MESSAGE_57,
  "  languages: {0}": MESSAGE_71,
  "  longest examples:": MESSAGE_73,
  "  max_seq_length: {0}": MESSAGE_79,
  "  minimum records: {0}": MESSAGE_81,
  "  minimum tool-call share: {0}": MESSAGE_82,
  "  missing behavior strata: {0}": MESSAGE_84,
  "  problem examples:": MESSAGE_100,
  "  records: raw={0} trainable={1} skipped={2}": MESSAGE_111,
  "  required done marker: {0}": MESSAGE_115,
  "  required fit ratio: {0}": MESSAGE_116,
  "  result: {0}": MESSAGE_118,
  "  target tool format: {0} (requested {1})": MESSAGE_134,
  "  task types: {0}": MESSAGE_135,
  "  tool calls: json={0} text={1} unknown={2} malformed_json={3}": MESSAGE_140,
  "  tool format correction: {0}": MESSAGE_145,
  FAIL: MESSAGE_194,
  "LoRA preflight for {0} via {1}": MESSAGE_202,
  "MIGRATION REVIEW": MESSAGE_205,
  PASS: MESSAGE_207,
  errors: MESSAGE_230,
  "unclassified record ids": MESSAGE_290,
  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)
}