vzcode 2.16.0 → 2.17.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/{bindings_wasm_bg-9w8E-TmY.wasm → bindings_wasm_bg-D9vNLG9F.wasm} +0 -0
- package/dist/assets/buildWorker-DL4wXpRr.js +695 -0
- package/dist/assets/{index-C2BLPyQP.js → index-BiPmUreW.js} +147 -147
- package/dist/assets/{index-DVR90LwF.css → index-BvGPtSrr.css} +1 -1
- package/dist/assets/worker-RJ-cjbld.js +327 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/src/client/VZSidebar/AIChat/FileEditingIndicator.tsx +12 -4
- package/src/client/VZSidebar/AIChat/Message.tsx +71 -18
- package/src/client/VZSidebar/AIChat/MessageList.tsx +57 -37
- package/src/client/VZSidebar/AIChat/index.tsx +0 -3
- package/src/client/VZSidebar/AIChat/styles.scss +33 -29
- package/src/client/hooks/useAutoScroll.ts +0 -1
- package/dist/assets/buildWorker-Bi6wsfQk.js +0 -695
- package/dist/assets/worker-BSzbM0Uo.js +0 -330
- package/src/client/VZSidebar/AIChat/StreamingMessage.tsx +0 -77
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import { timestampToDate } from '@vizhub/viz-utils';
|
|
3
|
-
import Markdown from 'react-markdown';
|
|
4
|
-
import remarkGfm from 'remark-gfm';
|
|
5
|
-
import { StreamingEvent } from '../../../types.js';
|
|
6
|
-
import { IndividualFileDiff } from './IndividualFileDiff';
|
|
7
|
-
|
|
8
|
-
const DEBUG = false;
|
|
9
|
-
|
|
10
|
-
interface StreamingMessageProps {
|
|
11
|
-
timestamp: number;
|
|
12
|
-
events: StreamingEvent[];
|
|
13
|
-
isActive?: boolean; // Is this the currently streaming message?
|
|
14
|
-
children?: React.ReactNode;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const StreamingMessage: React.FC<
|
|
18
|
-
StreamingMessageProps
|
|
19
|
-
> = ({ timestamp, events, isActive, children }) => {
|
|
20
|
-
DEBUG &&
|
|
21
|
-
console.log(
|
|
22
|
-
'StreamingMessage: Rendered with events:',
|
|
23
|
-
events,
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
// Memoize date formatting to avoid repeated computation
|
|
27
|
-
const formattedTime = useMemo(() => {
|
|
28
|
-
return timestampToDate(timestamp).toLocaleTimeString(
|
|
29
|
-
[],
|
|
30
|
-
{
|
|
31
|
-
hour: '2-digit',
|
|
32
|
-
minute: '2-digit',
|
|
33
|
-
},
|
|
34
|
-
);
|
|
35
|
-
}, [timestamp]);
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<div className="ai-chat-message assistant streaming">
|
|
39
|
-
<div className="ai-chat-message-content">
|
|
40
|
-
{/* Render events in order */}
|
|
41
|
-
{events.map((event, index) => {
|
|
42
|
-
switch (event.type) {
|
|
43
|
-
case 'text_chunk':
|
|
44
|
-
return (
|
|
45
|
-
<div
|
|
46
|
-
key={`text-${index}`}
|
|
47
|
-
className="text-chunk"
|
|
48
|
-
>
|
|
49
|
-
<Markdown remarkPlugins={[remarkGfm]}>
|
|
50
|
-
{event.content}
|
|
51
|
-
</Markdown>
|
|
52
|
-
</div>
|
|
53
|
-
);
|
|
54
|
-
case 'file_complete':
|
|
55
|
-
return (
|
|
56
|
-
<IndividualFileDiff
|
|
57
|
-
key={`file-${event.fileName}-${index}`}
|
|
58
|
-
fileName={event.fileName}
|
|
59
|
-
beforeContent={event.beforeContent || ''}
|
|
60
|
-
afterContent={event.afterContent || ''}
|
|
61
|
-
/>
|
|
62
|
-
);
|
|
63
|
-
case 'file_start':
|
|
64
|
-
// File start events are now handled by centralized status logic in MessageList
|
|
65
|
-
return null;
|
|
66
|
-
default:
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
})}
|
|
70
|
-
{isActive && children}
|
|
71
|
-
</div>
|
|
72
|
-
<div className="ai-chat-message-time">
|
|
73
|
-
{formattedTime}
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
);
|
|
77
|
-
};
|