@serii84/vertex-partner-provider 1.0.1 → 1.0.2

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.
Files changed (2) hide show
  1. package/index.js +6 -19
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -20,8 +20,7 @@ async function getAuthToken(googleAuthOptions) {
20
20
  return token.token;
21
21
  }
22
22
 
23
- function createProvider(options = {}) {
24
- // Debug: log what options we receive
23
+ function createVertexPartner(options = {}) {
25
24
  console.error('[vertex-partner] Received options:', JSON.stringify(options, null, 2));
26
25
 
27
26
  const {
@@ -34,21 +33,14 @@ function createProvider(options = {}) {
34
33
 
35
34
  console.error('[vertex-partner] Parsed:', { project, location, publisher });
36
35
 
37
- if (!project) {
38
- console.error('[vertex-partner] ERROR: project is required');
39
- throw new Error('project is required. Set GOOGLE_VERTEX_PROJECT env var or pass project option.');
40
- }
41
- if (!publisher) {
42
- console.error('[vertex-partner] ERROR: publisher is required');
43
- throw new Error('publisher is required (e.g., "moonshotai", "zai-org", "deepseek-ai")');
44
- }
36
+ if (!project) throw new Error('project is required');
37
+ if (!publisher) throw new Error('publisher is required');
45
38
 
46
39
  const baseHost = location === 'global'
47
40
  ? 'aiplatform.googleapis.com'
48
41
  : `${location}-aiplatform.googleapis.com`;
49
42
 
50
43
  const baseURL = `https://${baseHost}/v1/projects/${project}/locations/${location}/endpoints/openapi`;
51
-
52
44
  console.error(`[vertex-partner] baseURL: ${baseURL}`);
53
45
 
54
46
  const authFetch = async (url, init) => {
@@ -83,11 +75,6 @@ function createProvider(options = {}) {
83
75
  return wrappedProvider;
84
76
  }
85
77
 
86
- module.exports = createProvider;
87
- module.exports.createProvider = createProvider;
88
- module.exports.createVertexPartner = createProvider;
89
- module.exports.createGLM = (opts) => createProvider({ ...opts, publisher: 'zai-org' });
90
- module.exports.createKimi = (opts) => createProvider({ ...opts, publisher: 'moonshotai' });
91
- module.exports.createDeepSeek = (opts) => createProvider({ ...opts, publisher: 'deepseek-ai' });
92
- module.exports.createMiniMax = (opts) => createProvider({ ...opts, publisher: 'minimaxai' });
93
- module.exports.createQwen = (opts) => createProvider({ ...opts, publisher: 'qwen' });
78
+ // ONLY export the main function - no convenience exports!
79
+ // OpenCode picks the first "create*" alphabetically
80
+ module.exports = { createVertexPartner };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serii84/vertex-partner-provider",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Vertex AI partner models (GLM, Kimi, DeepSeek) for OpenCode",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -13,4 +13,4 @@
13
13
  "@ai-sdk/openai-compatible": "^2.0.4",
14
14
  "google-auth-library": "^10.5.0"
15
15
  }
16
- }
16
+ }