mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:20:43 +00:00
Adds a raw config pending-changes diff panel in Control UI raw mode, with JSON5 parsing, sensitive-value redaction until explicit reveal, bounded diff work, and tests for redaction/reveal and stale reveal-state reset. Also aligns provider manifest contract coverage for google-vertex and Qwen aliases to unblock the rebased CI matrix. Supersedes stale PRs #48621 and #46654. PR #48621 had gone stale without maintainer follow-up, so this maintainer-authored PR carries the implementation forward transparently while preserving changelog credit for the original contributor and @BunsDev.
78 lines
1.9 KiB
TypeScript
78 lines
1.9 KiB
TypeScript
import type { ProviderPlugin } from "openclaw/plugin-sdk/provider-model-shared";
|
|
|
|
const noopAuth = async () => ({ profiles: [] });
|
|
|
|
export function createGoogleProvider(): ProviderPlugin {
|
|
return {
|
|
id: "google",
|
|
label: "Google AI Studio",
|
|
docsPath: "/providers/models",
|
|
hookAliases: ["google-antigravity", "google-vertex"],
|
|
envVars: ["GEMINI_API_KEY", "GOOGLE_API_KEY"],
|
|
auth: [
|
|
{
|
|
id: "api-key",
|
|
kind: "api_key",
|
|
label: "Google Gemini API key",
|
|
hint: "AI Studio / Gemini API key",
|
|
run: noopAuth,
|
|
wizard: {
|
|
choiceId: "gemini-api-key",
|
|
choiceLabel: "Google Gemini API key",
|
|
groupId: "google",
|
|
groupLabel: "Google",
|
|
groupHint: "Gemini API key + OAuth",
|
|
},
|
|
},
|
|
],
|
|
};
|
|
}
|
|
|
|
export function createGoogleVertexProvider(): ProviderPlugin {
|
|
return {
|
|
id: "google-vertex",
|
|
label: "Google Vertex AI",
|
|
docsPath: "/providers/models",
|
|
envVars: [
|
|
"GOOGLE_CLOUD_API_KEY",
|
|
"GOOGLE_CLOUD_PROJECT",
|
|
"GCLOUD_PROJECT",
|
|
"GOOGLE_CLOUD_LOCATION",
|
|
"GOOGLE_APPLICATION_CREDENTIALS",
|
|
],
|
|
auth: [],
|
|
};
|
|
}
|
|
|
|
export function createGoogleGeminiCliProvider(): ProviderPlugin {
|
|
return {
|
|
id: "google-gemini-cli",
|
|
label: "Gemini CLI OAuth",
|
|
docsPath: "/providers/models",
|
|
aliases: ["gemini-cli"],
|
|
envVars: [
|
|
"OPENCLAW_GEMINI_OAUTH_CLIENT_ID",
|
|
"OPENCLAW_GEMINI_OAUTH_CLIENT_SECRET",
|
|
"GEMINI_CLI_OAUTH_CLIENT_ID",
|
|
"GEMINI_CLI_OAUTH_CLIENT_SECRET",
|
|
],
|
|
auth: [
|
|
{
|
|
id: "oauth",
|
|
kind: "oauth",
|
|
label: "Google OAuth",
|
|
hint: "PKCE + localhost callback",
|
|
run: noopAuth,
|
|
},
|
|
],
|
|
wizard: {
|
|
setup: {
|
|
choiceId: "google-gemini-cli",
|
|
choiceLabel: "Gemini CLI OAuth",
|
|
choiceHint: "Google OAuth with project-aware token payload",
|
|
methodId: "oauth",
|
|
},
|
|
},
|
|
};
|
|
}
|