feat: refine providers onboarding and cli

This commit is contained in:
Peter Steinberger
2026-01-08 06:25:01 +01:00
parent f2557d5390
commit b50ea3ec59
14 changed files with 705 additions and 261 deletions

View File

@@ -0,0 +1,29 @@
import { describe, expect, it } from "vitest";
import {
formatProviderSelectionLine,
listChatProviders,
normalizeChatProviderId,
} from "./registry.js";
describe("provider registry", () => {
it("normalizes aliases", () => {
expect(normalizeChatProviderId("imsg")).toBe("imessage");
});
it("keeps Telegram first in the default order", () => {
const providers = listChatProviders();
expect(providers[0]?.id).toBe("telegram");
});
it("formats selection lines with docs labels", () => {
const providers = listChatProviders();
const first = providers[0];
if (!first) throw new Error("Missing provider metadata.");
const line = formatProviderSelectionLine(first, (path, label) =>
[label, path].filter(Boolean).join(":"),
);
expect(line).toContain("Docs:");
expect(line).toContain("telegram");
});
});