feat(plugins): support provider auth aliases

This commit is contained in:
Peter Steinberger
2026-04-08 19:01:42 +01:00
parent fd9f9b8586
commit 9e4f478f86
31 changed files with 382 additions and 197 deletions

View File

@@ -1,3 +1,5 @@
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import plugin from "./index.js";
@@ -32,4 +34,14 @@ describe("byteplus plugin", () => {
}),
);
});
it("declares its coding provider auth alias in the manifest", () => {
const pluginJson = JSON.parse(
readFileSync(resolve(import.meta.dirname, "openclaw.plugin.json"), "utf-8"),
);
expect(pluginJson.providerAuthAliases).toEqual({
"byteplus-plan": "byteplus",
});
});
});

View File

@@ -5,6 +5,9 @@
"providerAuthEnvVars": {
"byteplus": ["BYTEPLUS_API_KEY"]
},
"providerAuthAliases": {
"byteplus-plan": "byteplus"
},
"providerAuthChoices": [
{
"provider": "byteplus",

View File

@@ -1,3 +1,5 @@
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import plugin from "./index.js";
@@ -32,4 +34,14 @@ describe("volcengine plugin", () => {
}),
);
});
it("declares its coding provider auth alias in the manifest", () => {
const pluginJson = JSON.parse(
readFileSync(resolve(import.meta.dirname, "openclaw.plugin.json"), "utf-8"),
);
expect(pluginJson.providerAuthAliases).toEqual({
"volcengine-plan": "volcengine",
});
});
});

View File

@@ -5,6 +5,9 @@
"providerAuthEnvVars": {
"volcengine": ["VOLCANO_ENGINE_API_KEY"]
},
"providerAuthAliases": {
"volcengine-plan": "volcengine"
},
"providerAuthChoices": [
{
"provider": "volcengine",