vzcode 3.1.0 → 3.3.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.
Files changed (74) hide show
  1. package/README.md +185 -40
  2. package/dist/assets/App-C9mRI7eH.js +387 -0
  3. package/dist/assets/App-CxiKy3Rs.css +1 -0
  4. package/dist/assets/bindings_wasm_bg-IWNG_AjZ.wasm +0 -0
  5. package/dist/assets/buildWorker-N5tFTOqM.js +794 -0
  6. package/dist/assets/index-COLyIkCc.js +43 -0
  7. package/dist/assets/index-CZT-v4sH.css +1 -0
  8. package/dist/assets/rolldown-runtime-COiEfhsA.js +1 -0
  9. package/dist/assets/worker-BpV7Ustv.js +223 -0
  10. package/dist/assets/worker-CLeezw6h.js +458 -0
  11. package/dist/assets/worker-DaSIYBQX.js +327 -0
  12. package/dist/cli.js +170 -99
  13. package/dist/index.html +3 -2
  14. package/dist/server/accessControl.js +104 -0
  15. package/dist/server/computeInitialDocument.js +4 -1
  16. package/dist/server/createServer.js +356 -104
  17. package/dist/server/index.js +4 -3
  18. package/dist/server/workspaceSecurity.js +115 -0
  19. package/dist/server/workspaceSync.js +141 -0
  20. package/package.json +74 -72
  21. package/src/cli.ts +203 -182
  22. package/src/client/App/index.tsx +2 -0
  23. package/src/client/App/usePending.ts +3 -1
  24. package/src/client/CodeEditor/style.scss +18 -11
  25. package/src/client/RunCodeWidget/index.tsx +1 -0
  26. package/src/client/TabList/Tab.tsx +13 -5
  27. package/src/client/TabList/style.scss +32 -5
  28. package/src/client/VZCodeContext/types.ts +6 -0
  29. package/src/client/VZCodeContext/useVZCodeState.ts +2 -0
  30. package/src/client/VZResizer/styles.scss +1 -1
  31. package/src/client/VZSidebar/AIChatWrapper.tsx +2 -0
  32. package/src/client/VZSidebar/DeleteConfirmationModal.tsx +1 -1
  33. package/src/client/VZSidebar/Item.tsx +8 -4
  34. package/src/client/VZSidebar/VisualEditor/CheckboxWidget.tsx +22 -30
  35. package/src/client/VZSidebar/VisualEditor/ColorWidget.tsx +198 -126
  36. package/src/client/VZSidebar/VisualEditor/DropdownWidget.tsx +25 -67
  37. package/src/client/VZSidebar/VisualEditor/PropertySection.tsx +41 -0
  38. package/src/client/VZSidebar/VisualEditor/SegmentedWidget.tsx +34 -0
  39. package/src/client/VZSidebar/VisualEditor/SliderWidget.tsx +60 -12
  40. package/src/client/VZSidebar/VisualEditor/VisualEditor.tsx +31 -393
  41. package/src/client/VZSidebar/VisualEditor/VisualEditorControls.tsx +478 -0
  42. package/src/client/VZSidebar/VisualEditor/colorUtils.ts +12 -0
  43. package/src/client/VZSidebar/VisualEditor/status.ts +47 -0
  44. package/src/client/VZSidebar/VisualEditor/updateConfig.ts +51 -24
  45. package/src/client/VZSidebar/VisualEditor/utils.ts +1 -1
  46. package/src/client/VZSidebar/index.tsx +55 -23
  47. package/src/client/VZSidebar/styles.scss +426 -6
  48. package/src/client/WorkspaceConflictBanner.tsx +120 -0
  49. package/src/client/index.ts +2 -0
  50. package/src/client/main.jsx +54 -12
  51. package/src/client/ui.scss +156 -4
  52. package/src/client/ui.tsx +1 -1
  53. package/src/llm-streaming-server/README.md +4 -16
  54. package/src/llm-streaming-ui/README.md +41 -2
  55. package/src/llm-streaming-ui/components/ChatInput.tsx +65 -13
  56. package/src/llm-streaming-ui/components/index.tsx +2 -0
  57. package/src/llm-streaming-ui/components/styles.scss +46 -0
  58. package/src/llm-streaming-ui/hooks/useAutoScroll.ts +1 -1
  59. package/src/llm-streaming-ui/index.ts +1 -0
  60. package/src/llm-streaming-ui/props.ts +26 -2
  61. package/src/server/accessControl.ts +151 -0
  62. package/src/server/computeInitialDocument.ts +6 -2
  63. package/src/server/createServer.ts +487 -138
  64. package/src/server/index.ts +4 -5
  65. package/src/server/workspaceSecurity.ts +160 -0
  66. package/src/server/workspaceSync.ts +203 -0
  67. package/src/types.ts +29 -27
  68. package/dist/assets/bindings_wasm_bg-9w8E-TmY.wasm +0 -0
  69. package/dist/assets/buildWorker-BZlya278.js +0 -687
  70. package/dist/assets/index-5qf102c2.css +0 -1
  71. package/dist/assets/index-dSJDl5x9.js +0 -356
  72. package/dist/assets/worker-1oQYaz-F.js +0 -342
  73. package/dist/assets/worker-BfgPD8zR.js +0 -125
  74. package/dist/assets/worker-CoJaqtpi.js +0 -436
package/src/cli.ts CHANGED
@@ -1,205 +1,226 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { spawn } from 'child_process';
4
- import path from 'path';
5
- import { fileURLToPath } from 'url';
6
- import fs from 'fs';
7
-
8
- // Get the directory of the current module
9
- const __filename = fileURLToPath(import.meta.url);
10
- const __dirname = path.dirname(__filename);
11
-
12
- // Function to find the Tauri binary
13
- function findTauriApp(): string | null {
14
- // Look for the Tauri binary in common locations
15
- const possiblePaths = [
16
- // Development location (when running from source)
17
- path.join(
18
- __dirname,
19
- '..',
20
- 'src-tauri',
21
- 'target',
22
- 'debug',
23
- 'vzcode',
24
- ),
25
- path.join(
26
- __dirname,
27
- '..',
28
- 'src-tauri',
29
- 'target',
30
- 'debug',
31
- 'vzcode.exe',
32
- ),
33
- // Release location (when running from built package)
34
- path.join(
35
- __dirname,
36
- '..',
37
- 'src-tauri',
38
- 'target',
39
- 'release',
40
- 'vzcode',
41
- ),
42
- path.join(
43
- __dirname,
44
- '..',
45
- 'src-tauri',
46
- 'target',
47
- 'release',
48
- 'vzcode.exe',
49
- ),
50
- // MacOS app bundle
51
- path.join(
52
- __dirname,
53
- '..',
54
- 'src-tauri',
55
- 'target',
56
- 'debug',
57
- 'vzcode.app',
58
- 'Contents',
59
- 'MacOS',
60
- 'vzcode',
61
- ),
62
- path.join(
63
- __dirname,
64
- '..',
65
- 'src-tauri',
66
- 'target',
67
- 'release',
68
- 'vzcode.app',
69
- 'Contents',
70
- 'MacOS',
71
- 'vzcode',
72
- ),
73
- ];
3
+ import { spawn } from 'node:child_process';
4
+ import fs from 'node:fs';
5
+ import path from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+ import open from 'open';
8
+ import { createVZCodeServer } from './server/createServer.js';
9
+
10
+ const DEFAULT_PORT = 3030;
11
+ const HOST = '127.0.0.1';
12
+ const __dirname = path.dirname(
13
+ fileURLToPath(import.meta.url),
14
+ );
15
+
16
+ type CLIOptions = {
17
+ directory: string;
18
+ port: number;
19
+ openBrowser: boolean;
20
+ desktop: boolean;
21
+ help: boolean;
22
+ };
23
+
24
+ const usage = [
25
+ 'VZCode - Multiplayer Code Editor',
26
+ '',
27
+ 'Usage: vzcode [directory] [options]',
28
+ '',
29
+ 'Starts the browser editor for a local workspace (defaults to ".").',
30
+ '',
31
+ 'Options:',
32
+ ' --help, -h Show this help message',
33
+ ' --browser Use the browser editor (the default)',
34
+ ' --desktop Launch a locally built Tauri application (experimental)',
35
+ ' --no-open Start the server without opening a browser',
36
+ ' --port=<port> HTTP/WebSocket port (default: 3030)',
37
+ ' --port <port> Equivalent to --port=<port>',
38
+ '',
39
+ 'Examples:',
40
+ ' vzcode .',
41
+ ' vzcode ./my-project --port=4000',
42
+ ' vzcode --no-open',
43
+ '',
44
+ 'VZCode listens on 127.0.0.1 only. Do not expose its unauthenticated',
45
+ 'workspace editing server to untrusted networks.',
46
+ ].join('\n');
47
+
48
+ function parsePort(value: string): number {
49
+ if (!/^\d+$/.test(value)) {
50
+ throw new Error('Invalid port: ' + value);
51
+ }
52
+ const port = Number(value);
53
+ if (!Number.isSafeInteger(port) || port > 65535) {
54
+ throw new Error(
55
+ 'Port must be between 0 and 65535: ' + value,
56
+ );
57
+ }
58
+ return port;
59
+ }
74
60
 
75
- for (const binaryPath of possiblePaths) {
76
- if (fs.existsSync(binaryPath)) {
77
- return binaryPath;
61
+ function parseOptions(args: string[]): CLIOptions {
62
+ const options: CLIOptions = {
63
+ directory: '.',
64
+ port: DEFAULT_PORT,
65
+ openBrowser: true,
66
+ desktop: false,
67
+ help: false,
68
+ };
69
+
70
+ let hasDirectory = false;
71
+ for (let i = 0; i < args.length; i++) {
72
+ const arg = args[i];
73
+
74
+ if (arg === '--help' || arg === '-h') {
75
+ options.help = true;
76
+ continue;
77
+ }
78
+ if (arg === '--browser') {
79
+ continue;
78
80
  }
81
+ if (arg === '--desktop') {
82
+ options.desktop = true;
83
+ continue;
84
+ }
85
+ if (arg === '--no-open') {
86
+ options.openBrowser = false;
87
+ continue;
88
+ }
89
+ if (arg === '--port' || arg.startsWith('--port=')) {
90
+ const value =
91
+ arg === '--port'
92
+ ? args[++i]
93
+ : arg.slice('--port='.length);
94
+ if (value === undefined) {
95
+ throw new Error('Missing value for --port');
96
+ }
97
+ options.port = parsePort(value);
98
+ continue;
99
+ }
100
+ if (arg.startsWith('-')) {
101
+ throw new Error('Unknown option: ' + arg);
102
+ }
103
+ if (hasDirectory) {
104
+ throw new Error(
105
+ 'Provide at most one workspace directory',
106
+ );
107
+ }
108
+ options.directory = arg;
109
+ hasDirectory = true;
79
110
  }
80
111
 
81
- return null;
112
+ return options;
82
113
  }
83
114
 
84
- // Function to launch the Tauri app
85
- function launchTauriApp(workingDirectory: string): void {
86
- const tauriBinary = findTauriApp();
115
+ // The npm package intentionally does not include a desktop executable.
116
+ // This path is available only after building Tauri in a source checkout.
117
+ function findDesktopApp(): string | null {
118
+ const root = path.resolve(__dirname, '..');
119
+ const candidates = [
120
+ 'src-tauri/target/debug/vzcode',
121
+ 'src-tauri/target/debug/vzcode.exe',
122
+ 'src-tauri/target/release/vzcode',
123
+ 'src-tauri/target/release/vzcode.exe',
124
+ 'src-tauri/target/debug/vzcode.app/Contents/MacOS/vzcode',
125
+ 'src-tauri/target/release/vzcode.app/Contents/MacOS/vzcode',
126
+ ];
127
+ return (
128
+ candidates
129
+ .map((candidate) => path.join(root, candidate))
130
+ .find((candidate) => fs.existsSync(candidate)) ?? null
131
+ );
132
+ }
87
133
 
88
- if (!tauriBinary) {
89
- console.error(
90
- 'VZCode desktop app not found. Please build it first with: npm run tauri:build',
91
- );
92
- console.error(
93
- 'Falling back to launching browser version...',
94
- );
95
- launchBrowserVersion(workingDirectory);
134
+ async function main(): Promise<void> {
135
+ const options = parseOptions(process.argv.slice(2));
136
+ if (options.help) {
137
+ console.log(usage);
96
138
  return;
97
139
  }
98
140
 
99
- console.log(
100
- `Launching VZCode desktop app from: ${workingDirectory}`,
101
- );
102
-
103
- // First start the server in the background
104
- startServerInBackground(workingDirectory);
105
-
106
- // Give the server a moment to start, then launch Tauri
107
- setTimeout(() => {
108
- const child = spawn(tauriBinary, [], {
109
- cwd: workingDirectory,
110
- stdio: 'inherit',
111
- detached: true,
112
- });
113
-
114
- // Allow the parent process to exit while keeping the child running
115
- child.unref();
116
- }, 2000);
117
- }
141
+ const directory = path.resolve(options.directory);
142
+ if (
143
+ !fs.existsSync(directory) ||
144
+ !fs.statSync(directory).isDirectory()
145
+ ) {
146
+ throw new Error(
147
+ 'Workspace is not a directory: ' + directory,
148
+ );
149
+ }
118
150
 
119
- // Function to start the server in the background
120
- function startServerInBackground(
121
- workingDirectory: string,
122
- ): void {
123
- // Start the server process in the background
124
- const serverPath = path.join(
125
- __dirname,
126
- 'server',
127
- 'index.js',
128
- );
129
- const serverChild = spawn('node', [serverPath], {
130
- cwd: workingDirectory,
131
- stdio: ['ignore', 'pipe', 'pipe'],
132
- detached: true,
133
- });
134
-
135
- // Don't block on the server process
136
- serverChild.unref();
137
-
138
- // Log server output for debugging
139
- if (serverChild.stdout) {
140
- serverChild.stdout.on('data', (data) => {
141
- console.log('Server:', data.toString());
142
- });
151
+ const desktopBinary = options.desktop
152
+ ? findDesktopApp()
153
+ : null;
154
+ if (options.desktop && !desktopBinary) {
155
+ throw new Error(
156
+ 'Tauri application not found. Build it with npm run tauri:build, ' +
157
+ 'or omit --desktop to use the browser editor.',
158
+ );
143
159
  }
144
160
 
145
- if (serverChild.stderr) {
146
- serverChild.stderr.on('data', (data) => {
147
- console.error('Server error:', data.toString());
148
- });
161
+ const server = createVZCodeServer({ cwd: directory });
162
+ await server.ready;
163
+ let actualPort: number;
164
+ try {
165
+ // Local-only until authenticated remote collaboration exists.
166
+ actualPort = await server.listen(options.port, HOST);
167
+ } catch (error) {
168
+ await server.close();
169
+ throw error;
149
170
  }
150
- }
151
171
 
152
- // Fallback function to launch the browser version
153
- async function launchBrowserVersion(
154
- workingDirectory: string,
155
- ): Promise<void> {
156
- // Note: The server/index.js will use process.cwd() automatically
157
- // and we're already in the correct working directory
172
+ const url = 'http://' + HOST + ':' + actualPort;
173
+ console.log('Workspace: ' + directory);
174
+ const accessUrl =
175
+ url + '/#vzcode-token=' + server.accessToken;
176
+ console.log('Editor is live at ' + accessUrl);
158
177
  console.log(
159
- `Starting VZCode server from: ${workingDirectory}`,
178
+ 'Keep this private link secret; it grants workspace editing access.',
160
179
  );
161
- }
162
-
163
- // Main CLI function
164
- function main(): void {
165
- const workingDirectory = process.cwd();
166
-
167
- // Parse command line arguments
168
- const args = process.argv.slice(2);
169
-
170
- if (args.includes('--help') || args.includes('-h')) {
171
- console.log('VZCode - Multiplayer Code Editor');
172
- console.log('');
173
- console.log('Usage: vzcode [options]');
174
- console.log('');
175
- console.log('Options:');
176
- console.log(' --help, -h Show this help message');
177
- console.log(
178
- ' --browser Force browser version instead of desktop app',
179
- );
180
- console.log(
181
- ' --port=<port> Specify port for server (default: 3030)',
182
- );
183
- console.log('');
184
- console.log('Examples:');
185
- console.log(
186
- ' vzcode # Launch desktop app in current directory',
187
- );
188
- console.log(
189
- ' vzcode --browser # Launch browser version',
190
- );
191
- console.log(
192
- ' vzcode --port=4000 # Start server on port 4000',
193
- );
194
- return;
195
- }
180
+ console.log('Press Ctrl+C to stop VZCode.');
181
+
182
+ let closing = false;
183
+ const shutdown = async () => {
184
+ if (closing) return;
185
+ closing = true;
186
+ try {
187
+ await server.close();
188
+ } catch (error) {
189
+ console.error('Failed to stop VZCode:', error);
190
+ process.exitCode = 1;
191
+ }
192
+ };
193
+ process.once('SIGINT', () => void shutdown());
194
+ process.once('SIGTERM', () => void shutdown());
196
195
 
197
- if (args.includes('--browser')) {
198
- launchBrowserVersion(workingDirectory);
199
- } else {
200
- launchTauriApp(workingDirectory);
196
+ if (desktopBinary) {
197
+ const child = spawn(desktopBinary, [], {
198
+ cwd: directory,
199
+ stdio: 'inherit',
200
+ });
201
+ child.once('error', (error) => {
202
+ console.error(
203
+ 'Unable to launch the desktop app:',
204
+ error,
205
+ );
206
+ process.exitCode = 1;
207
+ void shutdown();
208
+ });
209
+ child.once('exit', () => void shutdown());
210
+ } else if (options.openBrowser) {
211
+ try {
212
+ await open(accessUrl);
213
+ } catch (error) {
214
+ console.warn(
215
+ 'Could not open a browser automatically. Visit ' +
216
+ url,
217
+ error,
218
+ );
219
+ }
201
220
  }
202
221
  }
203
222
 
204
- // Run the CLI
205
- main();
223
+ main().catch((error) => {
224
+ console.error('VZCode: ' + (error.message ?? error));
225
+ process.exitCode = 1;
226
+ });
@@ -19,6 +19,7 @@ import { VZLeft } from '../VZLeft';
19
19
  import { VZMiddle } from '../VZMiddle';
20
20
  import { VZResizer } from '../VZResizer';
21
21
  import { VZRight } from '../VZRight';
22
+ import { WorkspaceConflictBanner } from '../WorkspaceConflictBanner';
22
23
  import {
23
24
  useInitialUsername,
24
25
  usePersistUsername,
@@ -111,6 +112,7 @@ function App() {
111
112
  // only mounted when explicitly enabled.
112
113
  const appContent = (
113
114
  <>
115
+ <WorkspaceConflictBanner />
114
116
  <div className="app">
115
117
  <VZLeft />
116
118
  <VZMiddle
@@ -14,7 +14,9 @@ const runDelay = 1000;
14
14
  export const usePending = (
15
15
  shareDBDoc: ShareDBDoc<VizContent>,
16
16
  ) => {
17
- const lastOpTimerRef = useRef<NodeJS.Timeout>();
17
+ const lastOpTimerRef = useRef<NodeJS.Timeout | undefined>(
18
+ undefined,
19
+ );
18
20
 
19
21
  // TODO rename this to isPending,
20
22
  // and also rename connected to isConnected.
@@ -101,22 +101,22 @@
101
101
  border: 1px solid #193350;
102
102
  color: var(--vz-color-neutral-04);
103
103
  border: 1px solid var(--vz-color-neutral-04);
104
- border-radius: 5px;
104
+ border-radius: 6px;
105
105
  padding: 6px 12px;
106
106
  font-weight: bold;
107
107
  cursor: pointer;
108
- transition: all 0.3s ease-in-out;
108
+ transition:
109
+ background-color 0.15s ease,
110
+ color 0.15s ease;
109
111
  }
110
112
 
111
113
  .cm-button:hover {
112
- background-color: #50c878;
114
+ background-color: var(--vz-color-action-01);
113
115
  color: #ffffff;
114
- transform: scale(1.1);
115
116
  }
116
117
 
117
118
  .cm-button:active {
118
- background-color: #202e46;
119
- transform: scale(0.95);
119
+ background-color: var(--vz-color-action-02);
120
120
  }
121
121
 
122
122
  .cm-searchMatch {
@@ -141,16 +141,23 @@
141
141
  margin: 4px;
142
142
  border-radius: 4px;
143
143
  cursor: pointer;
144
- transition: all 0.3s ease-in-out;
144
+ transition:
145
+ background-color 0.15s ease,
146
+ color 0.15s ease;
145
147
  }
146
148
 
147
149
  .cm-panel.cm-search [name='close']:hover {
148
- background-color: var(--vz-color-caution-01);
149
- color: #ffffff;
150
+ background-color: var(--vz-color-hover-dark);
151
+ color: var(--vz-color-neutral-04);
150
152
  }
151
153
 
152
154
  .cm-panel.cm-search [name='close']:active {
153
- background-color: var(--vz-color-caution-02);
154
- transform: scale(0.95);
155
+ background-color: var(--vz-color-active-dark);
155
156
  }
156
157
  }
158
+
159
+ .cm-button:focus-visible,
160
+ .cm-panel.cm-search [name='close']:focus-visible {
161
+ outline: 2px solid var(--vz-color-action-01);
162
+ outline-offset: 2px;
163
+ }
@@ -3,6 +3,7 @@ import {
3
3
  useContext,
4
4
  useEffect,
5
5
  useState,
6
+ type JSX,
6
7
  } from 'react';
7
8
  import { PlaySVG } from '../Icons';
8
9
  import { SplitEditorSVG } from '../Icons/SplitEditorSVG';
@@ -58,16 +58,24 @@ export const Tab = ({
58
58
  className={`tab ${
59
59
  isActive ? 'active' : ''
60
60
  } ${isTransient ? 'transient' : ''}`}
61
- onClick={handleClick}
62
- onDoubleClick={handleDoubleClick}
63
61
  >
64
- {tabName}
65
- <i
62
+ <button
63
+ type="button"
64
+ className="tab-activate"
65
+ aria-current={isActive ? 'page' : undefined}
66
+ onClick={handleClick}
67
+ onDoubleClick={handleDoubleClick}
68
+ >
69
+ {tabName}
70
+ </button>
71
+ <button
72
+ type="button"
66
73
  className="vz-icon-button"
74
+ aria-label={`Close ${tabName}`}
67
75
  onClick={handleCloseClick}
68
76
  >
69
77
  <CloseSVG />
70
- </i>
78
+ </button>
71
79
  </div>
72
80
  );
73
81
  };
@@ -1,6 +1,6 @@
1
1
  .vz-tab-list {
2
2
  display: flex;
3
- background-color: #1f2022;
3
+ background-color: var(--vz-color-neutral-01);
4
4
  // When the tab list becomes too large, a horizontal scroll bar appears.
5
5
  overflow-x: auto;
6
6
 
@@ -14,8 +14,9 @@
14
14
  display: flex;
15
15
  gap: 6px;
16
16
  padding: 4px 4px 4px 14px;
17
- border-top-left-radius: 8px;
18
- border-top-right-radius: 8px;
17
+ border-top-left-radius: 6px;
18
+ border-top-right-radius: 6px;
19
+ transition: background-color 0.15s ease;
19
20
  margin-top: 6px;
20
21
  margin-left: 2px;
21
22
  margin-right: 2px;
@@ -31,12 +32,12 @@
31
32
  // on hover
32
33
  &:hover {
33
34
  // background-color: var(--vz-color-hover-dark);
34
- background-color: rgba(255, 255, 255, 0.075);
35
+ background-color: var(--vz-color-hover-dark);
35
36
  }
36
37
  }
37
38
 
38
39
  .tab.active {
39
- background-color: #202e46;
40
+ background-color: var(--vz-color-neutral-02);
40
41
  }
41
42
 
42
43
  .tab.transient {
@@ -50,3 +51,29 @@
50
51
  color: var(--vz-color-action-03);
51
52
  }
52
53
  }
54
+
55
+ .vz-tab-list .tab-activate {
56
+ appearance: none;
57
+ display: inline-flex;
58
+ align-items: center;
59
+ min-width: 0;
60
+ padding: 0;
61
+ border: 0;
62
+ background: transparent;
63
+ color: inherit;
64
+ font: inherit;
65
+ text-align: left;
66
+ cursor: pointer;
67
+ }
68
+ .vz-tab-list .tab-activate:focus-visible {
69
+ outline: 2px solid var(--vz-color-action-01);
70
+ outline-offset: 2px;
71
+ }
72
+ .vz-tab-list .tab.active:hover {
73
+ background: var(--vz-color-neutral-02);
74
+ }
75
+ @media (prefers-reduced-motion: reduce) {
76
+ .vz-tab-list .tab {
77
+ transition: none;
78
+ }
79
+ }
@@ -15,6 +15,7 @@ import {
15
15
  } from '../../types';
16
16
  import { VizFiles, VizContent } from '@vizhub/viz-types';
17
17
  import { ThemeLabel } from '../themes';
18
+ import type { ChatVoiceInputRenderer } from '../../llm-streaming-ui/props';
18
19
  import { EditorCache } from '../useEditorCache';
19
20
 
20
21
  // The type of the object provided by this context.
@@ -213,6 +214,9 @@ export type VZCodeContextValue = {
213
214
  ) => Promise<any>;
214
215
  }) => React.ReactNode;
215
216
 
217
+ /** Optional host-owned microphone beside the AI Chat Send button. */
218
+ renderChatVoiceInput?: ChatVoiceInputRenderer;
219
+
216
220
  // Feature flags
217
221
  enableMinimalEditFlow: boolean;
218
222
 
@@ -268,6 +272,8 @@ export interface VZCodeProviderProps {
268
272
  options?: Record<string, string>,
269
273
  ) => Promise<any>;
270
274
  }) => React.ReactNode;
275
+ /** Host-owned chat voice input, independent of the legacy VZCode voice flag. */
276
+ renderChatVoiceInput?: ChatVoiceInputRenderer;
271
277
  iframeRef?: React.MutableRefObject<HTMLIFrameElement>;
272
278
  handleChatError?: (
273
279
  error: string,
@@ -53,6 +53,7 @@ export const useVZCodeState = ({
53
53
  clearStoredAIPrompt,
54
54
  getStoredAIPrompt,
55
55
  additionalWidgets,
56
+ renderChatVoiceInput,
56
57
  iframeRef: externalIframeRef,
57
58
  handleChatError,
58
59
  onAIChatMessageSubmitted,
@@ -510,6 +511,7 @@ export const useVZCodeState = ({
510
511
 
511
512
  // Additional widgets that can be rendered in AI chat messages
512
513
  additionalWidgets,
514
+ renderChatVoiceInput,
513
515
 
514
516
  // Feature flags
515
517
  enableMinimalEditFlow,
@@ -29,5 +29,5 @@
29
29
  }
30
30
 
31
31
  .vz-resizer:hover .vz-resizer-thumb {
32
- background-color: #0078d4;
32
+ background-color: var(--vz-color-action-01);
33
33
  }
@@ -35,6 +35,7 @@ export const AIChatWrapper = () => {
35
35
  resetMessageHistoryNavigation,
36
36
  enableMinimalEditFlow,
37
37
  additionalWidgets,
38
+ renderChatVoiceInput,
38
39
  openTab,
39
40
  setIsAIChatOpen,
40
41
  } = useContext(VZCodeContext);
@@ -79,6 +80,7 @@ export const AIChatWrapper = () => {
79
80
  enableDiffView={enableDiffView}
80
81
  enableAskMode={enableAskMode}
81
82
  enableVoiceInput={enableVoiceInput}
83
+ renderChatVoiceInput={renderChatVoiceInput}
82
84
  enableMinimalEditFlow={enableMinimalEditFlow}
83
85
  />
84
86
  );
@@ -67,7 +67,7 @@ export const DeleteConfirmationModal = ({
67
67
  >
68
68
  Cancel
69
69
  </Button>
70
- <Button variant="primary" onClick={onConfirm}>
70
+ <Button variant="danger" onClick={onConfirm}>
71
71
  Delete
72
72
  </Button>
73
73
  </Modal.Footer>