vzcode 2.27.0 → 2.28.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-CHCIQbYC.js → index-CTdYkAQU.js} +137 -137
- package/dist/assets/{worker-BMR_X2Ea.js → worker-D8p1JlHW.js} +263 -267
- package/dist/index.html +1 -1
- package/package.json +12 -12
- package/src/client/VZCodeContext/useVZCodeState.ts +33 -2
- package/src/client/VZSidebar/aiCopyPaste.ts +18 -21
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-CTdYkAQU.js"></script>
|
|
24
24
|
<link rel="stylesheet" crossorigin href="/assets/index-Dyt9tpmu.css">
|
|
25
25
|
</head>
|
|
26
26
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vzcode",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.28.0",
|
|
4
4
|
"description": "Multiplayer code editor system",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -120,10 +120,10 @@
|
|
|
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.1.
|
|
123
|
+
"@langchain/core": "^1.1.4",
|
|
124
124
|
"@langchain/openai": "^1.1.3",
|
|
125
125
|
"@lezer/highlight": "^1.2.3",
|
|
126
|
-
"@livekit/components-react": "^2.9.
|
|
126
|
+
"@livekit/components-react": "^2.9.17",
|
|
127
127
|
"@replit/codemirror-indentation-markers": "^6.5.3",
|
|
128
128
|
"@replit/codemirror-interact": "^6.3.1",
|
|
129
129
|
"@replit/codemirror-lang-svelte": "^6.0.0",
|
|
@@ -158,13 +158,13 @@
|
|
|
158
158
|
"dotenv": "^17.2.3",
|
|
159
159
|
"editcodewithai": "^2.4.0",
|
|
160
160
|
"eslint-linter-browserify": "^9.39.1",
|
|
161
|
-
"express": "^5.1
|
|
161
|
+
"express": "^5.2.1",
|
|
162
162
|
"ignore": "^7.0.5",
|
|
163
163
|
"json0-ot-diff": "^1.1.2",
|
|
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.
|
|
167
|
+
"lucide-react": "^0.556.0",
|
|
168
168
|
"npm": "^11.6.4",
|
|
169
169
|
"open": "^11.0.0",
|
|
170
170
|
"prettier-plugin-svelte": "^3.4.0",
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
"react-bootstrap": "^2.10.10",
|
|
173
173
|
"react-dom": "^18",
|
|
174
174
|
"react-markdown": "^10.1.0",
|
|
175
|
-
"react-router-dom": "^7.
|
|
175
|
+
"react-router-dom": "^7.10.1",
|
|
176
176
|
"remark-gfm": "^4.0.1",
|
|
177
177
|
"sharedb": "^5.2.2",
|
|
178
178
|
"sharedb-client-browser": "^5.2.2",
|
|
@@ -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.48.
|
|
190
|
-
"@typescript-eslint/parser": "^8.48.
|
|
189
|
+
"@typescript-eslint/eslint-plugin": "^8.48.1",
|
|
190
|
+
"@typescript-eslint/parser": "^8.48.1",
|
|
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.7.
|
|
200
|
+
"prettier": "^3.7.4",
|
|
201
201
|
"sass": "^1.94.2",
|
|
202
202
|
"ts-node": "^10.9.2",
|
|
203
|
-
"tsx": "^4.
|
|
203
|
+
"tsx": "^4.21.0",
|
|
204
204
|
"typescript": "^5.9.3",
|
|
205
|
-
"vite": "^7.2.
|
|
206
|
-
"vitest": "^4.0.
|
|
205
|
+
"vite": "^7.2.6",
|
|
206
|
+
"vitest": "^4.0.15"
|
|
207
207
|
},
|
|
208
208
|
"optionalDependencies": {
|
|
209
209
|
"@rollup/rollup-darwin-arm64": "^4.53.3",
|
|
@@ -273,7 +273,10 @@ export const useVZCodeState = ({
|
|
|
273
273
|
const DEBUG = false;
|
|
274
274
|
|
|
275
275
|
// Compute isLoading based on the current chat's aiStatus
|
|
276
|
-
|
|
276
|
+
// Chat ID changes with each new user message (but not for retry/undo)
|
|
277
|
+
const [currentChatId, setCurrentChatId] = useState(() =>
|
|
278
|
+
uuidv4(),
|
|
279
|
+
);
|
|
277
280
|
const [selectedChatId, setSelectedChatId] = useState<
|
|
278
281
|
string | null
|
|
279
282
|
>(null);
|
|
@@ -385,6 +388,34 @@ export const useVZCodeState = ({
|
|
|
385
388
|
|
|
386
389
|
setAIErrorMessage(null); // Clear any previous errors
|
|
387
390
|
|
|
391
|
+
// Generate new chat ID only for fresh user messages
|
|
392
|
+
// Keep existing chat ID for retries (Try Harder) and undos
|
|
393
|
+
const isRetryOrUndo =
|
|
394
|
+
options?.isRetry === 'true' ||
|
|
395
|
+
options?.isUndo === 'true';
|
|
396
|
+
|
|
397
|
+
let chatIdForRequest: string;
|
|
398
|
+
if (isRetryOrUndo) {
|
|
399
|
+
// Use existing chat ID for retry/undo operations
|
|
400
|
+
chatIdForRequest = activeChatId;
|
|
401
|
+
DEBUG &&
|
|
402
|
+
console.log(
|
|
403
|
+
'Using existing chatId for retry/undo:',
|
|
404
|
+
chatIdForRequest,
|
|
405
|
+
);
|
|
406
|
+
} else {
|
|
407
|
+
// Generate NEW chat ID for fresh user message
|
|
408
|
+
const newChatId = uuidv4();
|
|
409
|
+
setCurrentChatId(newChatId);
|
|
410
|
+
setSelectedChatId(newChatId);
|
|
411
|
+
chatIdForRequest = newChatId;
|
|
412
|
+
DEBUG &&
|
|
413
|
+
console.log(
|
|
414
|
+
'Generated new chatId for fresh message:',
|
|
415
|
+
chatIdForRequest,
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
|
|
388
419
|
// Call backend endpoint for AI response
|
|
389
420
|
try {
|
|
390
421
|
const response = await fetch(aiChatEndpoint, {
|
|
@@ -395,7 +426,7 @@ export const useVZCodeState = ({
|
|
|
395
426
|
body: JSON.stringify({
|
|
396
427
|
...aiChatOptions,
|
|
397
428
|
content: messageContent.trim(),
|
|
398
|
-
chatId:
|
|
429
|
+
chatId: chatIdForRequest,
|
|
399
430
|
mode: aiChatMode,
|
|
400
431
|
...options,
|
|
401
432
|
}),
|
|
@@ -3,14 +3,11 @@ import {
|
|
|
3
3
|
parseMarkdownFiles,
|
|
4
4
|
} from 'llm-code-format';
|
|
5
5
|
import {
|
|
6
|
-
FORMAT_INSTRUCTIONS,
|
|
7
6
|
mergeFileChanges,
|
|
7
|
+
prepareFilesForPrompt,
|
|
8
8
|
} from 'editcodewithai';
|
|
9
9
|
import { VizFiles } from '@vizhub/viz-types';
|
|
10
|
-
import {
|
|
11
|
-
generateRunId,
|
|
12
|
-
vizFilesToFileCollection,
|
|
13
|
-
} from '@vizhub/viz-utils';
|
|
10
|
+
import { generateRunId } from '@vizhub/viz-utils';
|
|
14
11
|
import JSZip from 'jszip';
|
|
15
12
|
|
|
16
13
|
export const createAICopyPasteHandlers = (
|
|
@@ -32,17 +29,25 @@ export const createAICopyPasteHandlers = (
|
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
try {
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
// Apply truncation logic to reduce token usage
|
|
33
|
+
const { files: truncatedFiles, imageFiles } =
|
|
34
|
+
prepareFilesForPrompt(files);
|
|
37
35
|
|
|
38
|
-
// Format files for
|
|
36
|
+
// Format truncated files for markdown
|
|
39
37
|
const formattedFiles =
|
|
40
|
-
formatMarkdownFiles(
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
formatMarkdownFiles(truncatedFiles);
|
|
39
|
+
|
|
40
|
+
// Add metadata about skipped image files
|
|
41
|
+
let finalContent = formattedFiles;
|
|
42
|
+
if (imageFiles.length > 0) {
|
|
43
|
+
finalContent +=
|
|
44
|
+
'\n\n<!-- Image files (not included): ' +
|
|
45
|
+
imageFiles.join(', ') +
|
|
46
|
+
' -->';
|
|
47
|
+
}
|
|
43
48
|
|
|
44
49
|
// Copy to clipboard
|
|
45
|
-
await navigator.clipboard.writeText(
|
|
50
|
+
await navigator.clipboard.writeText(finalContent);
|
|
46
51
|
|
|
47
52
|
// Show success feedback
|
|
48
53
|
setCopyButtonText('Copied!');
|
|
@@ -84,16 +89,8 @@ export const createAICopyPasteHandlers = (
|
|
|
84
89
|
return;
|
|
85
90
|
}
|
|
86
91
|
|
|
87
|
-
// Preprocess to remove formatting instructions section to avoid creating extra files
|
|
88
|
-
const preprocessed = normalized
|
|
89
|
-
.split('## Formatting Instructions')[0]
|
|
90
|
-
.trim();
|
|
91
|
-
|
|
92
92
|
// Parse the markdown files format
|
|
93
|
-
const parsed = parseMarkdownFiles(
|
|
94
|
-
preprocessed,
|
|
95
|
-
'bold',
|
|
96
|
-
);
|
|
93
|
+
const parsed = parseMarkdownFiles(normalized, 'bold');
|
|
97
94
|
|
|
98
95
|
if (
|
|
99
96
|
parsed.files &&
|