feat(model): add /model picker
This commit is contained in:
@@ -48,10 +48,7 @@ export async function promptAuthChoiceGrouped(params: {
|
||||
|
||||
const methodSelection = (await params.prompter.select({
|
||||
message: `${group.label} auth method`,
|
||||
options: [
|
||||
...group.options,
|
||||
{ value: BACK_VALUE, label: "Back" },
|
||||
],
|
||||
options: [...group.options, { value: BACK_VALUE, label: "Back" }],
|
||||
})) as string;
|
||||
|
||||
if (methodSelection === BACK_VALUE) {
|
||||
|
||||
@@ -85,6 +85,13 @@ describe("applyAuthChoice", () => {
|
||||
expect(text).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ message: "Enter MiniMax API key" }),
|
||||
);
|
||||
expect(result.config.models?.providers?.minimax).toMatchObject({
|
||||
baseUrl: "https://api.minimax.io/anthropic",
|
||||
api: "anthropic-messages",
|
||||
});
|
||||
expect(result.config.agents?.defaults?.model).toMatchObject({
|
||||
primary: "minimax/MiniMax-M2.1",
|
||||
});
|
||||
expect(result.config.auth?.profiles?.["minimax:default"]).toMatchObject({
|
||||
provider: "minimax",
|
||||
mode: "api_key",
|
||||
|
||||
@@ -31,12 +31,12 @@ import type {
|
||||
ResetScope,
|
||||
} from "./onboard-types.js";
|
||||
|
||||
export function guardCancel<T>(value: T, runtime: RuntimeEnv): T {
|
||||
export function guardCancel<T>(value: T | symbol, runtime: RuntimeEnv): T {
|
||||
if (isCancel(value)) {
|
||||
cancel(stylePromptTitle("Setup cancelled.") ?? "Setup cancelled.");
|
||||
runtime.exit(0);
|
||||
}
|
||||
return value;
|
||||
return value as T;
|
||||
}
|
||||
|
||||
export function summarizeExistingConfig(config: ClawdbotConfig): string {
|
||||
|
||||
Reference in New Issue
Block a user