vzcode 2.25.0 → 2.27.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.
- package/dist/assets/{index-CkFweu5-.js → index-CHCIQbYC.js} +126 -126
- package/dist/assets/worker-BMR_X2Ea.js +346 -0
- package/dist/index.html +1 -1
- package/dist/llm-streaming-server/llmStreaming.js +5 -3
- package/dist/ot.js +6 -1
- package/dist/server/aiChatHandler/index.js +2 -1
- package/package.json +12 -12
- package/src/client/CodeEditor/getOrCreateEditor.tsx +1 -2
- package/src/llm-streaming-server/llmStreaming.ts +5 -2
- package/src/ot.ts +13 -1
- package/src/server/aiChatHandler/index.ts +3 -1
- package/src/types.ts +5 -4
- package/dist/assets/worker-VPLhQVba.js +0 -330
package/dist/index.html
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"
|
|
21
21
|
rel="stylesheet"
|
|
22
22
|
/>
|
|
23
|
-
<script type="module" crossorigin src="/assets/index-
|
|
23
|
+
<script type="module" crossorigin src="/assets/index-CHCIQbYC.js"></script>
|
|
24
24
|
<link rel="stylesheet" crossorigin href="/assets/index-Dyt9tpmu.css">
|
|
25
25
|
</head>
|
|
26
26
|
<body>
|
|
@@ -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 =
|
|
25
|
+
const apiKey = aiRequestOptions?.apiKey ||
|
|
26
|
+
process.env.VZCODE_EDIT_WITH_AI_API_KEY;
|
|
26
27
|
if (!apiKey) {
|
|
27
|
-
console.warn('[LLMStreaming]
|
|
28
|
+
console.warn('[LLMStreaming] OpenAI API Key not found');
|
|
28
29
|
}
|
|
29
30
|
const openRouterClient = new OpenAI({
|
|
30
31
|
apiKey: apiKey,
|
|
31
|
-
baseURL:
|
|
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',
|
package/dist/ot.js
CHANGED
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
// Localized to one file so it's easy to change it in future.
|
|
4
4
|
import OTJSON1Presence from 'sharedb-client-browser/dist/ot-json1-presence-umd.cjs';
|
|
5
5
|
import jsondiff from 'json0-ot-diff';
|
|
6
|
-
import
|
|
6
|
+
import { diff_match_patch as DiffMatchPatch, DIFF_DELETE, DIFF_INSERT, DIFF_EQUAL, } from '@dmsnell/diff-match-patch';
|
|
7
|
+
// Attach the constants to the class as static properties for compatibility with json0-ot-diff
|
|
8
|
+
DiffMatchPatch.DIFF_DELETE = DIFF_DELETE;
|
|
9
|
+
DiffMatchPatch.DIFF_INSERT = DIFF_INSERT;
|
|
10
|
+
DiffMatchPatch.DIFF_EQUAL = DIFF_EQUAL;
|
|
11
|
+
const diffMatchPatch = DiffMatchPatch;
|
|
7
12
|
export const { json1Presence, textUnicode } = OTJSON1Presence;
|
|
8
13
|
// The OT type used throughout the codebase.
|
|
9
14
|
export const otType = json1Presence.type;
|
|
@@ -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:
|
|
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.
|
|
3
|
+
"version": "2.27.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
|
|
124
|
-
"@langchain/openai": "^1.1.
|
|
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.
|
|
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",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"d3-array": "^3.2.4",
|
|
154
154
|
"d3-color": "^3.1.0",
|
|
155
155
|
"diff": "^8.0.2",
|
|
156
|
-
"diff-match-patch": "^1.0
|
|
156
|
+
"@dmsnell/diff-match-patch": "^1.1.0",
|
|
157
157
|
"diff2html": "^3.4.52",
|
|
158
158
|
"dotenv": "^17.2.3",
|
|
159
159
|
"editcodewithai": "^2.4.0",
|
|
@@ -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.
|
|
168
|
-
"npm": "^11.6.
|
|
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",
|
|
@@ -182,12 +182,12 @@
|
|
|
182
182
|
},
|
|
183
183
|
"devDependencies": {
|
|
184
184
|
"@eslint/js": "^9.39.1",
|
|
185
|
-
"@tauri-apps/cli": "^2.9.
|
|
185
|
+
"@tauri-apps/cli": "^2.9.5",
|
|
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.
|
|
190
|
-
"@typescript-eslint/parser": "^8.
|
|
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",
|
|
@@ -197,13 +197,13 @@
|
|
|
197
197
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
198
198
|
"globals": "^16.5.0",
|
|
199
199
|
"npm-check-updates": "^19.1.2",
|
|
200
|
-
"prettier": "^3.
|
|
200
|
+
"prettier": "^3.7.3",
|
|
201
201
|
"sass": "^1.94.2",
|
|
202
202
|
"ts-node": "^10.9.2",
|
|
203
203
|
"tsx": "^4.20.6",
|
|
204
204
|
"typescript": "^5.9.3",
|
|
205
205
|
"vite": "^7.2.4",
|
|
206
|
-
"vitest": "^4.0.
|
|
206
|
+
"vitest": "^4.0.14"
|
|
207
207
|
},
|
|
208
208
|
"optionalDependencies": {
|
|
209
209
|
"@rollup/rollup-darwin-arm64": "^4.53.3",
|
|
@@ -162,8 +162,7 @@ const getAtPath = (obj, path) => {
|
|
|
162
162
|
};
|
|
163
163
|
|
|
164
164
|
// Extend the EditorCacheValue type to include the compartments and the updateRainbowBrackets method
|
|
165
|
-
interface ExtendedEditorCacheValue
|
|
166
|
-
extends EditorCacheValue {
|
|
165
|
+
interface ExtendedEditorCacheValue extends EditorCacheValue {
|
|
167
166
|
themeCompartment: Compartment;
|
|
168
167
|
languageCompartment: Compartment;
|
|
169
168
|
rainbowBracketsCompartment: Compartment;
|
|
@@ -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 =
|
|
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]
|
|
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: {
|
package/src/ot.ts
CHANGED
|
@@ -3,7 +3,19 @@
|
|
|
3
3
|
// Localized to one file so it's easy to change it in future.
|
|
4
4
|
import OTJSON1Presence from 'sharedb-client-browser/dist/ot-json1-presence-umd.cjs';
|
|
5
5
|
import jsondiff from 'json0-ot-diff';
|
|
6
|
-
import
|
|
6
|
+
import {
|
|
7
|
+
diff_match_patch as DiffMatchPatch,
|
|
8
|
+
DIFF_DELETE,
|
|
9
|
+
DIFF_INSERT,
|
|
10
|
+
DIFF_EQUAL,
|
|
11
|
+
} from '@dmsnell/diff-match-patch';
|
|
12
|
+
|
|
13
|
+
// Attach the constants to the class as static properties for compatibility with json0-ot-diff
|
|
14
|
+
DiffMatchPatch.DIFF_DELETE = DIFF_DELETE;
|
|
15
|
+
DiffMatchPatch.DIFF_INSERT = DIFF_INSERT;
|
|
16
|
+
DiffMatchPatch.DIFF_EQUAL = DIFF_EQUAL;
|
|
17
|
+
|
|
18
|
+
const diffMatchPatch = DiffMatchPatch;
|
|
7
19
|
|
|
8
20
|
export const { json1Presence, textUnicode } =
|
|
9
21
|
OTJSON1Presence;
|
|
@@ -133,7 +133,9 @@ const processAIRequestAsync = async ({
|
|
|
133
133
|
try {
|
|
134
134
|
await onCreditDeduction(
|
|
135
135
|
await getGenerationMetadata({
|
|
136
|
-
apiKey:
|
|
136
|
+
apiKey:
|
|
137
|
+
aiRequestOptions?.apiKey ||
|
|
138
|
+
process.env.VZCODE_EDIT_WITH_AI_API_KEY,
|
|
137
139
|
generationId: editResult.generationId,
|
|
138
140
|
}),
|
|
139
141
|
);
|
package/src/types.ts
CHANGED
|
@@ -265,16 +265,17 @@ export interface ExtendedVizChat extends VizChat {
|
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
// Extended VizChatMessage with progressive rendering support
|
|
268
|
-
export interface ExtendedVizChatMessage
|
|
269
|
-
extends VizChatMessage {
|
|
268
|
+
export interface ExtendedVizChatMessage extends VizChatMessage {
|
|
270
269
|
streamingEvents?: StreamingEvent[];
|
|
271
270
|
isProgressive?: boolean; // Flag to indicate this message uses progressive rendering
|
|
272
271
|
isComplete?: boolean; // Flag to indicate if streaming is complete
|
|
273
272
|
}
|
|
274
273
|
|
|
275
274
|
// Extended VizContent that uses our extended chat types
|
|
276
|
-
export interface ExtendedVizContent
|
|
277
|
-
|
|
275
|
+
export interface ExtendedVizContent extends Omit<
|
|
276
|
+
VizContent,
|
|
277
|
+
'chats'
|
|
278
|
+
> {
|
|
278
279
|
chats?: { [chatId: VizChatId]: ExtendedVizChat };
|
|
279
280
|
}
|
|
280
281
|
|