import assert from "node:assert/strict"; import { describe, it } from "node:test"; import { isClineFreeGatewayModelId } from "../src/models.ts"; import { oauthCredentialToApiKey } from "../src/runtime-auth.ts"; describe("oauthCredentialToApiKey", () => { it("reads api_key credentials", () => { assert.equal(oauthCredentialToApiKey({ type: "api_key", key: "abc" }), "abc"); }); it("reads oauth access tokens", () => { assert.equal( oauthCredentialToApiKey({ type: "oauth", access: "workos:token", refresh: "r" }), "workos:token", ); }); }); describe("gateway model filter", () => { it("includes glm-5.3-flash", () => { assert.equal(isClineFreeGatewayModelId("z-ai/glm-5.3-flash"), true); }); });