openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
30 lines (29 loc) • 1.19 kB
JavaScript
//#region src/commands/auth-choice-options.static.ts
const CORE_AUTH_CHOICE_OPTIONS = [{
value: "custom-api-key",
label: "Custom Provider",
hint: "Any OpenAI or Anthropic compatible endpoint",
groupId: "custom",
groupLabel: "Custom Provider",
groupHint: "Any OpenAI or Anthropic compatible endpoint"
}];
/**
* Provider-agnostic auth choices that `--token-provider` binds to a concrete
* provider method. They stay out of `CORE_AUTH_CHOICE_OPTIONS` because the
* interactive picker only offers self-contained choices, but every CLI surface
* must advertise and accept them even when no manifest contributes the same id.
*/
const GENERIC_PROVIDER_AUTH_CHOICES = [
"setup-token",
"token",
"apiKey"
];
/** Format static auth-choice values for Commander help/validation text. */
function formatStaticAuthChoiceChoicesForCli(params) {
const includeSkip = params?.includeSkip ?? true;
const values = [...CORE_AUTH_CHOICE_OPTIONS.map((opt) => opt.value), ...GENERIC_PROVIDER_AUTH_CHOICES];
if (includeSkip) values.push("skip");
return values.join("|");
}
//#endregion
export { GENERIC_PROVIDER_AUTH_CHOICES as n, formatStaticAuthChoiceChoicesForCli as r, CORE_AUTH_CHOICE_OPTIONS as t };