btca-server 1.0.90 → 1.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "btca-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.91",
|
|
4
4
|
"description": "BTCA server for answering questions about your codebase using OpenCode AI",
|
|
5
5
|
"author": "Ben Davis",
|
|
6
6
|
"license": "MIT",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"hono": "^4.7.11",
|
|
62
62
|
"just-bash": "^2.7.0",
|
|
63
63
|
"opencode-ai": "^1.1.36",
|
|
64
|
+
"vercel-minimax-ai-provider": "^0.0.2",
|
|
64
65
|
"zod": "^3.25.76"
|
|
65
66
|
}
|
|
66
67
|
}
|
package/src/providers/auth.ts
CHANGED
|
@@ -27,7 +27,8 @@ export namespace Auth {
|
|
|
27
27
|
openai: ['oauth'],
|
|
28
28
|
'openai-compat': ['api'],
|
|
29
29
|
anthropic: ['api'],
|
|
30
|
-
google: ['api', 'oauth']
|
|
30
|
+
google: ['api', 'oauth'],
|
|
31
|
+
minimax: ['api']
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
const readEnv = (key: string) => {
|
|
@@ -38,6 +39,7 @@ export namespace Auth {
|
|
|
38
39
|
const getEnvApiKey = (providerId: string) => {
|
|
39
40
|
if (providerId === 'openrouter') return readEnv('OPENROUTER_API_KEY');
|
|
40
41
|
if (providerId === 'opencode') return readEnv('OPENCODE_API_KEY');
|
|
42
|
+
if (providerId === 'minimax') return readEnv('MINIMAX_API_KEY');
|
|
41
43
|
return undefined;
|
|
42
44
|
};
|
|
43
45
|
|
|
@@ -175,9 +177,11 @@ export namespace Auth {
|
|
|
175
177
|
return 'Set OPENROUTER_API_KEY or run "opencode auth --provider openrouter".';
|
|
176
178
|
case 'opencode':
|
|
177
179
|
return 'Set OPENCODE_API_KEY or run "opencode auth --provider opencode".';
|
|
180
|
+
case 'minimax':
|
|
181
|
+
return 'Run "btca connect -p minimax" and enter your API key. Get your API key at https://platform.minimax.io/user-center/basic-information.';
|
|
178
182
|
default:
|
|
179
|
-
return 'Run "
|
|
180
|
-
|
|
183
|
+
return 'Run "btca connect" and configure credentials for this provider.';
|
|
184
|
+
}
|
|
181
185
|
};
|
|
182
186
|
|
|
183
187
|
/**
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createMinimax } from 'vercel-minimax-ai-provider';
|
|
2
|
+
|
|
3
|
+
const DEFAULT_BASE_URL = 'https://api.minimax.io/anthropic/v1';
|
|
4
|
+
|
|
5
|
+
const readEnv = (key: string) => {
|
|
6
|
+
const value = process.env[key];
|
|
7
|
+
return value && value.trim().length > 0 ? value.trim() : undefined;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const MINIMAX_MODELS = ['MiniMax-M2.1'] as const;
|
|
11
|
+
|
|
12
|
+
export type MinimaxModel = (typeof MINIMAX_MODELS)[number];
|
|
13
|
+
|
|
14
|
+
export function createMinimaxProvider(
|
|
15
|
+
options: {
|
|
16
|
+
apiKey?: string;
|
|
17
|
+
baseURL?: string;
|
|
18
|
+
headers?: Record<string, string>;
|
|
19
|
+
} = {}
|
|
20
|
+
) {
|
|
21
|
+
const provider = createMinimax({
|
|
22
|
+
apiKey: options.apiKey ?? readEnv('MINIMAX_API_KEY'),
|
|
23
|
+
baseURL: options.baseURL ?? DEFAULT_BASE_URL,
|
|
24
|
+
headers: options.headers
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
return (modelId: string) => provider(modelId);
|
|
28
|
+
}
|
|
@@ -10,6 +10,7 @@ import { createOpenCodeZen } from './opencode.ts';
|
|
|
10
10
|
import { createOpenAICodex } from './openai.ts';
|
|
11
11
|
import { createOpenAICompat } from './openai-compat.ts';
|
|
12
12
|
import { createOpenRouter } from './openrouter.ts';
|
|
13
|
+
import { createMinimaxProvider } from './minimax.ts';
|
|
13
14
|
|
|
14
15
|
// Type for provider factory options
|
|
15
16
|
export type ProviderOptions = {
|
|
@@ -46,7 +47,10 @@ export const PROVIDER_REGISTRY: Record<string, ProviderFactory> = {
|
|
|
46
47
|
google: createGoogleGenerativeAI as ProviderFactory,
|
|
47
48
|
|
|
48
49
|
// OpenRouter (OpenAI-compatible gateway)
|
|
49
|
-
openrouter: createOpenRouter as ProviderFactory
|
|
50
|
+
openrouter: createOpenRouter as ProviderFactory,
|
|
51
|
+
|
|
52
|
+
// MiniMax (Anthropic-compatible gateway)
|
|
53
|
+
minimax: createMinimaxProvider as ProviderFactory
|
|
50
54
|
};
|
|
51
55
|
|
|
52
56
|
/**
|