vzcode 2.25.0 → 2.26.0

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.
@@ -22,13 +22,15 @@ export const createLLMFunction = ({ shareDBDoc, chatId,
22
22
  enableReasoningTokens = false, model, aiRequestOptions, }) => {
23
23
  return async (fullPrompt) => {
24
24
  // Create OpenRouter client for reasoning token support
25
- const apiKey = process.env.VZCODE_EDIT_WITH_AI_API_KEY;
25
+ const apiKey = aiRequestOptions?.apiKey ||
26
+ process.env.VZCODE_EDIT_WITH_AI_API_KEY;
26
27
  if (!apiKey) {
27
- console.warn('[LLMStreaming] OpenRouter API Key (VZCODE_EDIT_WITH_AI_API_KEY) not found');
28
+ console.warn('[LLMStreaming] OpenAI API Key not found');
28
29
  }
29
30
  const openRouterClient = new OpenAI({
30
31
  apiKey: apiKey,
31
- baseURL: process.env.VZCODE_EDIT_WITH_AI_BASE_URL ||
32
+ baseURL: aiRequestOptions?.baseURL ||
33
+ process.env.VZCODE_EDIT_WITH_AI_BASE_URL ||
32
34
  'https://openrouter.ai/api/v1',
33
35
  defaultHeaders: {
34
36
  'HTTP-Referer': 'https://vizhub.com',
@@ -70,7 +70,8 @@ const processAIRequestAsync = async ({ shareDBDoc, chatId, content, model, aiReq
70
70
  if (onCreditDeduction && editResult.generationId) {
71
71
  try {
72
72
  await onCreditDeduction(await getGenerationMetadata({
73
- apiKey: process.env.VZCODE_EDIT_WITH_AI_API_KEY,
73
+ apiKey: aiRequestOptions?.apiKey ||
74
+ process.env.VZCODE_EDIT_WITH_AI_API_KEY,
74
75
  generationId: editResult.generationId,
75
76
  }));
76
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vzcode",
3
- "version": "2.25.0",
3
+ "version": "2.26.0",
4
4
  "description": "Multiplayer code editor system",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -120,8 +120,8 @@
120
120
  "@codemirror/state": "^6.5.2",
121
121
  "@codemirror/theme-one-dark": "^6.1.3",
122
122
  "@codemirror/view": "^6.38.8",
123
- "@langchain/core": "^1.0.6",
124
- "@langchain/openai": "^1.1.2",
123
+ "@langchain/core": "^1.1.0",
124
+ "@langchain/openai": "^1.1.3",
125
125
  "@lezer/highlight": "^1.2.3",
126
126
  "@livekit/components-react": "^2.9.16",
127
127
  "@replit/codemirror-indentation-markers": "^6.5.3",
@@ -143,7 +143,7 @@
143
143
  "@vizhub/runtime": "^4.5.0",
144
144
  "@vizhub/viz-types": "^0.5.0",
145
145
  "@vizhub/viz-utils": "^1.5.0",
146
- "body-parser": "^2.2.0",
146
+ "body-parser": "^2.2.1",
147
147
  "bootstrap-icons": "^1.13.1",
148
148
  "codemirror": "^6.0.2",
149
149
  "codemirror-copilot": "^0.0.7",
@@ -164,8 +164,8 @@
164
164
  "jszip": "^3.10.1",
165
165
  "livekit-server-sdk": "^2.14.2",
166
166
  "llm-code-format": "^3.1.0",
167
- "lucide-react": "^0.554.0",
168
- "npm": "^11.6.3",
167
+ "lucide-react": "^0.555.0",
168
+ "npm": "^11.6.4",
169
169
  "open": "^11.0.0",
170
170
  "prettier-plugin-svelte": "^3.4.0",
171
171
  "react": "^18",
@@ -186,8 +186,8 @@
186
186
  "@types/d3-color": "^3.1.3",
187
187
  "@types/react": "^18",
188
188
  "@types/react-dom": "^18",
189
- "@typescript-eslint/eslint-plugin": "^8.47.0",
190
- "@typescript-eslint/parser": "^8.47.0",
189
+ "@typescript-eslint/eslint-plugin": "^8.48.0",
190
+ "@typescript-eslint/parser": "^8.48.0",
191
191
  "@vitejs/plugin-react": "^5.1.1",
192
192
  "concurrently": "^9.2.1",
193
193
  "cross-env": "^10.1.0",
@@ -203,7 +203,7 @@
203
203
  "tsx": "^4.20.6",
204
204
  "typescript": "^5.9.3",
205
205
  "vite": "^7.2.4",
206
- "vitest": "^4.0.13"
206
+ "vitest": "^4.0.14"
207
207
  },
208
208
  "optionalDependencies": {
209
209
  "@rollup/rollup-darwin-arm64": "^4.53.3",
@@ -57,16 +57,19 @@ export const createLLMFunction = ({
57
57
  }) => {
58
58
  return async (fullPrompt: string) => {
59
59
  // Create OpenRouter client for reasoning token support
60
- const apiKey = process.env.VZCODE_EDIT_WITH_AI_API_KEY;
60
+ const apiKey =
61
+ aiRequestOptions?.apiKey ||
62
+ process.env.VZCODE_EDIT_WITH_AI_API_KEY;
61
63
  if (!apiKey) {
62
64
  console.warn(
63
- '[LLMStreaming] OpenRouter API Key (VZCODE_EDIT_WITH_AI_API_KEY) not found',
65
+ '[LLMStreaming] OpenAI API Key not found',
64
66
  );
65
67
  }
66
68
 
67
69
  const openRouterClient = new OpenAI({
68
70
  apiKey: apiKey,
69
71
  baseURL:
72
+ aiRequestOptions?.baseURL ||
70
73
  process.env.VZCODE_EDIT_WITH_AI_BASE_URL ||
71
74
  'https://openrouter.ai/api/v1',
72
75
  defaultHeaders: {
@@ -133,7 +133,9 @@ const processAIRequestAsync = async ({
133
133
  try {
134
134
  await onCreditDeduction(
135
135
  await getGenerationMetadata({
136
- apiKey: process.env.VZCODE_EDIT_WITH_AI_API_KEY,
136
+ apiKey:
137
+ aiRequestOptions?.apiKey ||
138
+ process.env.VZCODE_EDIT_WITH_AI_API_KEY,
137
139
  generationId: editResult.generationId,
138
140
  }),
139
141
  );