Skip to content

Commit 12e962b

Browse files
committed
Bump opencode-gemini-auth and add MiniMax CN
Update vendored opencode-gemini-auth to v1.4.15: add compiled dist artifacts (index.js/.d.ts/.map), remove original TypeScript sources, and refresh upstream-plugins lock and package metadata. Add MiniMax Coding Plan (CN) documentation and provider-check notes in README. Introduce minimax-endpoints.ts and apply related updates across src libs, scripts (upstream-plugin sanitization/sync), and tests to align with the upstream plugin changes.
1 parent bc5c20e commit 12e962b

79 files changed

Lines changed: 17042 additions & 6686 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ Most providers work automatically. If a provider has a “Needs setup” link, o
200200
| Qwen Code | [Needs setup](#qwen-code) | Local estimation |
201201
| Alibaba Coding Plan | Automatic | Local estimation |
202202
| MiniMax Coding Plan | Automatic | Remote API |
203+
| MiniMax Coding Plan (CN) | Automatic | Remote API |
203204
| Kimi Code | Automatic | Remote API |
204205
| Chutes AI | Usually automatic | Remote API |
205206
| Crof.ai | Manual env/config | Remote API |
@@ -579,7 +580,8 @@ These providers use trusted env vars, trusted user/global OpenCode config, or na
579580

580581
| Provider | Useful checks |
581582
| --- | --- |
582-
| MiniMax Coding Plan | Use `MINIMAX_CODING_PLAN_API_KEY` or `MINIMAX_API_KEY`; repo-local provider secrets are ignored. |
583+
| MiniMax Coding Plan | Use `MINIMAX_CODING_PLAN_API_KEY` or `MINIMAX_API_KEY` for the international endpoint. Runtime/config ids like `minimax` and `minimax-coding-plan` use this provider. Repo-local provider secrets are ignored. |
584+
| MiniMax Coding Plan (CN) | Use `MINIMAX_CHINA_CODING_PLAN_API_KEY` or trusted user/global OpenCode config under `minimax-china-coding-plan`, `minimax-cn-coding-plan`, `minimax-cn`, or `minimax-china`. Runtime id `minimax-cn-coding-plan` uses this provider. |
583585
| Kimi Code | Use `KIMI_API_KEY` or `KIMI_CODE_API_KEY`; repo-local provider secrets are ignored. |
584586
| Chutes AI | Use `CHUTES_API_KEY` or trusted user/global config. |
585587
| Crof.ai | Use `CROF_API_KEY`, `CROFAI_API_KEY`, or trusted user/global config. |

references/upstream-plugins/lock.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
"version": "0.4.3"
1818
},
1919
"opencode-gemini-auth": {
20-
"npmUrl": "https://www.npmjs.com/package/opencode-gemini-auth/v/1.4.12",
20+
"npmUrl": "https://www.npmjs.com/package/opencode-gemini-auth/v/1.4.15",
2121
"packageName": "opencode-gemini-auth",
22-
"publishedAt": "2026-05-02T13:00:57.010Z",
22+
"publishedAt": "2026-05-10T11:40:30.805Z",
2323
"referenceDir": "references/upstream-plugins/opencode-gemini-auth",
2424
"repo": "jenslys/opencode-gemini-auth",
25-
"version": "1.4.12"
25+
"version": "1.4.15"
2626
},
2727
"opencode-qwencode-auth": {
2828
"npmUrl": "https://www.npmjs.com/package/opencode-qwencode-auth/v/1.3.0",
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
import { Config } from '@opencode-ai/sdk';
2+
import { ToolDefinition } from '@opencode-ai/plugin';
3+
4+
/**
5+
* Result returned to the caller after constructing an OAuth authorization URL.
6+
*/
7+
interface GeminiAuthorization {
8+
url: string;
9+
verifier: string;
10+
state: string;
11+
}
12+
interface GeminiTokenExchangeSuccess {
13+
type: "success";
14+
refresh: string;
15+
access: string;
16+
expires: number;
17+
email?: string;
18+
}
19+
interface GeminiTokenExchangeFailure {
20+
type: "failed";
21+
error: string;
22+
}
23+
type GeminiTokenExchangeResult = GeminiTokenExchangeSuccess | GeminiTokenExchangeFailure;
24+
/**
25+
* Build the Gemini OAuth authorization URL including PKCE.
26+
*/
27+
declare function authorizeGemini(): Promise<GeminiAuthorization>;
28+
/**
29+
* Exchange an authorization code using a known PKCE verifier.
30+
*/
31+
declare function exchangeGeminiWithVerifier(code: string, verifier: string): Promise<GeminiTokenExchangeResult>;
32+
33+
interface OAuthAuthDetails {
34+
type: "oauth";
35+
refresh: string;
36+
access?: string;
37+
expires?: number;
38+
}
39+
interface NonOAuthAuthDetails {
40+
type: string;
41+
[key: string]: unknown;
42+
}
43+
type AuthDetails = OAuthAuthDetails | NonOAuthAuthDetails;
44+
type GetAuth = () => Promise<AuthDetails>;
45+
interface ProviderModel {
46+
cost?: {
47+
input: number;
48+
output: number;
49+
cache?: {
50+
read: number;
51+
write: number;
52+
};
53+
};
54+
[key: string]: unknown;
55+
}
56+
interface Provider {
57+
models?: Record<string, ProviderModel>;
58+
options?: Record<string, unknown>;
59+
}
60+
interface LoaderResult {
61+
apiKey: string;
62+
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
63+
}
64+
interface AuthMethod {
65+
provider?: string;
66+
label: string;
67+
type: "oauth" | "api";
68+
authorize?: () => Promise<{
69+
url: string;
70+
instructions: string;
71+
method: string;
72+
callback: (() => Promise<GeminiTokenExchangeResult>) | ((callbackUrl: string) => Promise<GeminiTokenExchangeResult>);
73+
}>;
74+
}
75+
interface PluginClient {
76+
auth: {
77+
set(input: {
78+
path: {
79+
id: string;
80+
};
81+
body: OAuthAuthDetails;
82+
}): Promise<void>;
83+
};
84+
config?: {
85+
get(options?: unknown): Promise<{
86+
data?: Config;
87+
} | undefined>;
88+
};
89+
tui?: {
90+
showToast(input: {
91+
body: {
92+
title?: string;
93+
message: string;
94+
variant: "info" | "success" | "warning" | "error";
95+
duration?: number;
96+
};
97+
}): Promise<unknown>;
98+
};
99+
}
100+
interface PluginContext {
101+
client: PluginClient;
102+
}
103+
interface PluginResult {
104+
config?: (config: Config) => Promise<void>;
105+
tool?: Record<string, ToolDefinition>;
106+
auth: {
107+
provider: string;
108+
loader: (getAuth: GetAuth, provider: Provider) => Promise<LoaderResult | null>;
109+
methods: AuthMethod[];
110+
};
111+
}
112+
113+
/**
114+
* Registers the Gemini OAuth provider for Opencode, handling auth, request rewriting,
115+
* debug logging, and response normalization for Gemini Code Assist endpoints.
116+
*/
117+
declare const GeminiCLIOAuthPlugin: ({ client }: PluginContext) => Promise<PluginResult>;
118+
declare const GoogleOAuthPlugin: ({ client }: PluginContext) => Promise<PluginResult>;
119+
120+
export { type GeminiAuthorization, GeminiCLIOAuthPlugin, type GeminiTokenExchangeResult, GoogleOAuthPlugin, authorizeGemini, exchangeGeminiWithVerifier };

0 commit comments

Comments
 (0)