From 6e8dbb5d4948d9bb2d59c58739e8d9d901d979b1 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Sun, 2 Aug 2026 01:32:28 -0300 Subject: [PATCH] feat: add wave 2 free-tier provider registries --- .../providers/registry/cloudcode-one/index.ts | 20 +++++++ .../config/providers/registry/dxnt/index.ts | 17 ++++++ .../providers/registry/yolo-auto/index.ts | 17 ++++++ .../unit/free-tier-providers-wave2-c.test.ts | 58 +++++++++++++++++++ 4 files changed, 112 insertions(+) create mode 100644 open-sse/config/providers/registry/cloudcode-one/index.ts create mode 100644 open-sse/config/providers/registry/dxnt/index.ts create mode 100644 open-sse/config/providers/registry/yolo-auto/index.ts create mode 100644 tests/unit/free-tier-providers-wave2-c.test.ts diff --git a/open-sse/config/providers/registry/cloudcode-one/index.ts b/open-sse/config/providers/registry/cloudcode-one/index.ts new file mode 100644 index 0000000000..e9f8bc211d --- /dev/null +++ b/open-sse/config/providers/registry/cloudcode-one/index.ts @@ -0,0 +1,20 @@ +import type { RegistryEntry } from "../../shared.ts"; +import { buildOpenAiCompatibleRegistryEntry } from "../../shared.ts"; + +/** + * CloudCode.ONE - OpenAI-compatible API with published free model aliases. + * + * The Anthropic-compatible endpoint is documented separately; this registry + * covers the OpenAI-compatible API surface audited for this migration. + */ +export const cloudcodeOneProvider: RegistryEntry = buildOpenAiCompatibleRegistryEntry({ + id: "cloudcode-one", + alias: "cloudcode-one", + baseUrl: "https://api.cloudcode.one/v1/chat/completions", + modelsUrl: "https://api.cloudcode.one/v1/models", + models: [ + { id: "glm-4.7-flash", name: "GLM 4.7 Flash" }, + { id: "glm-4.6v-flash", name: "GLM 4.6V Flash" }, + ], + passthroughModels: true, +}); diff --git a/open-sse/config/providers/registry/dxnt/index.ts b/open-sse/config/providers/registry/dxnt/index.ts new file mode 100644 index 0000000000..2a70c339c3 --- /dev/null +++ b/open-sse/config/providers/registry/dxnt/index.ts @@ -0,0 +1,17 @@ +import type { RegistryEntry } from "../../shared.ts"; +import { buildOpenAiCompatibleRegistryEntry } from "../../shared.ts"; + +/** + * DXNT - OpenAI-compatible API with a free account quota. + * + * Models are discovered from the provider's authenticated catalog rather than + * copied into a static list, so account-specific availability remains intact. + */ +export const dxntProvider: RegistryEntry = buildOpenAiCompatibleRegistryEntry({ + id: "dxnt", + alias: "dxnt", + baseUrl: "https://www.dxnt.com/v1/chat/completions", + modelsUrl: "https://www.dxnt.com/v1/models", + models: [], + passthroughModels: true, +}); diff --git a/open-sse/config/providers/registry/yolo-auto/index.ts b/open-sse/config/providers/registry/yolo-auto/index.ts new file mode 100644 index 0000000000..6b90dc1a75 --- /dev/null +++ b/open-sse/config/providers/registry/yolo-auto/index.ts @@ -0,0 +1,17 @@ +import type { RegistryEntry } from "../../shared.ts"; +import { buildOpenAiCompatibleRegistryEntry } from "../../shared.ts"; + +/** + * Yolo-Auto - OpenAI-compatible API with a request-limited free tier. + * + * The catalog is kept intentionally small: the documented free-tier model is + * seeded while passthrough discovery allows the service to publish updates. + */ +export const yoloAutoProvider: RegistryEntry = buildOpenAiCompatibleRegistryEntry({ + id: "yolo-auto", + alias: "yolo-auto", + baseUrl: "https://yolo-auto.com/v1/chat/completions", + modelsUrl: "https://yolo-auto.com/v1/models", + models: [{ id: "qwen3.6-35b-a3b", name: "Qwen 3.6 35B A3B" }], + passthroughModels: true, +}); diff --git a/tests/unit/free-tier-providers-wave2-c.test.ts b/tests/unit/free-tier-providers-wave2-c.test.ts new file mode 100644 index 0000000000..75b42242ea --- /dev/null +++ b/tests/unit/free-tier-providers-wave2-c.test.ts @@ -0,0 +1,58 @@ +import assert from "node:assert/strict"; +import test from "node:test"; + +import { cloudcodeOneProvider } from "../../open-sse/config/providers/registry/cloudcode-one/index.ts"; +import { dxntProvider } from "../../open-sse/config/providers/registry/dxnt/index.ts"; +import { yoloAutoProvider } from "../../open-sse/config/providers/registry/yolo-auto/index.ts"; +import type { RegistryEntry } from "../../open-sse/config/providers/shared.ts"; + +const providers: Array<{ + entry: RegistryEntry; + id: string; + chatUrl: string; + modelsUrl: string; + modelIds: string[]; +}> = [ + { + entry: yoloAutoProvider, + id: "yolo-auto", + chatUrl: "https://yolo-auto.com/v1/chat/completions", + modelsUrl: "https://yolo-auto.com/v1/models", + modelIds: ["qwen3.6-35b-a3b"], + }, + { + entry: dxntProvider, + id: "dxnt", + chatUrl: "https://www.dxnt.com/v1/chat/completions", + modelsUrl: "https://www.dxnt.com/v1/models", + modelIds: [], + }, + { + entry: cloudcodeOneProvider, + id: "cloudcode-one", + chatUrl: "https://api.cloudcode.one/v1/chat/completions", + modelsUrl: "https://api.cloudcode.one/v1/models", + modelIds: ["glm-4.7-flash", "glm-4.6v-flash"], + }, +]; + +for (const { entry, id, chatUrl, modelsUrl, modelIds } of providers) { + test(`${id} uses the standard OpenAI-compatible API-key registry shape`, () => { + assert.equal(entry.id, id); + assert.equal(entry.alias, id); + assert.equal(entry.format, "openai"); + assert.equal(entry.executor, "default"); + assert.equal(entry.authType, "apikey"); + assert.equal(entry.authHeader, "bearer"); + assert.equal(entry.baseUrl, chatUrl); + assert.equal(entry.modelsUrl, modelsUrl); + assert.equal(entry.passthroughModels, true); + }); + + test(`${id} seeds only the audited model identifiers`, () => { + assert.deepEqual( + (entry.models ?? []).map((model) => model.id), + modelIds + ); + }); +}