vzcode 3.2.0 → 3.4.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/README.md +185 -40
- package/dist/assets/App-BSFvLn9Z.js +387 -0
- package/dist/assets/App-DbKY-mb6.css +1 -0
- package/dist/assets/bindings_wasm_bg-IWNG_AjZ.wasm +0 -0
- package/dist/assets/buildWorker-N5tFTOqM.js +794 -0
- package/dist/assets/index-Acvr-XWK.js +43 -0
- package/dist/assets/index-CZT-v4sH.css +1 -0
- package/dist/assets/rolldown-runtime-COiEfhsA.js +1 -0
- package/dist/assets/worker-BpV7Ustv.js +223 -0
- package/dist/assets/worker-CLeezw6h.js +458 -0
- package/dist/assets/worker-DaSIYBQX.js +327 -0
- package/dist/cli.js +170 -99
- package/dist/index.html +3 -2
- package/dist/server/accessControl.js +104 -0
- package/dist/server/computeInitialDocument.js +4 -1
- package/dist/server/createServer.js +356 -104
- package/dist/server/index.js +4 -3
- package/dist/server/workspaceSecurity.js +115 -0
- package/dist/server/workspaceSync.js +141 -0
- package/package.json +74 -72
- package/src/cli.ts +203 -182
- package/src/client/App/index.tsx +2 -0
- package/src/client/App/usePending.ts +3 -1
- package/src/client/RunCodeWidget/index.tsx +1 -0
- package/src/client/SplitPaneResizeContext.tsx +94 -11
- package/src/client/VZCodeContext/types.ts +6 -0
- package/src/client/VZCodeContext/useVZCodeState.ts +2 -0
- package/src/client/VZResizer/index.tsx +25 -0
- package/src/client/VZSidebar/AIChatWrapper.tsx +2 -0
- package/src/client/VZSidebar/VisualEditor/CheckboxWidget.tsx +22 -30
- package/src/client/VZSidebar/VisualEditor/ColorWidget.tsx +198 -126
- package/src/client/VZSidebar/VisualEditor/DropdownWidget.tsx +25 -67
- package/src/client/VZSidebar/VisualEditor/PropertySection.tsx +41 -0
- package/src/client/VZSidebar/VisualEditor/SegmentedWidget.tsx +34 -0
- package/src/client/VZSidebar/VisualEditor/SliderWidget.tsx +60 -12
- package/src/client/VZSidebar/VisualEditor/VisualEditor.tsx +31 -393
- package/src/client/VZSidebar/VisualEditor/VisualEditorControls.tsx +478 -0
- package/src/client/VZSidebar/VisualEditor/colorUtils.ts +12 -0
- package/src/client/VZSidebar/VisualEditor/status.ts +47 -0
- package/src/client/VZSidebar/VisualEditor/updateConfig.ts +51 -24
- package/src/client/VZSidebar/VisualEditor/utils.ts +1 -1
- package/src/client/VZSidebar/styles.scss +424 -0
- package/src/client/WorkspaceConflictBanner.tsx +120 -0
- package/src/client/index.ts +2 -0
- package/src/client/main.jsx +54 -12
- package/src/llm-streaming-server/README.md +4 -16
- package/src/llm-streaming-ui/README.md +41 -2
- package/src/llm-streaming-ui/components/ChatInput.tsx +65 -13
- package/src/llm-streaming-ui/components/index.tsx +2 -0
- package/src/llm-streaming-ui/components/styles.scss +14 -0
- package/src/llm-streaming-ui/hooks/useAutoScroll.ts +1 -1
- package/src/llm-streaming-ui/index.ts +1 -0
- package/src/llm-streaming-ui/props.ts +26 -2
- package/src/server/accessControl.ts +151 -0
- package/src/server/computeInitialDocument.ts +6 -2
- package/src/server/createServer.ts +487 -138
- package/src/server/index.ts +4 -5
- package/src/server/workspaceSecurity.ts +160 -0
- package/src/server/workspaceSync.ts +203 -0
- package/src/types.ts +29 -27
- package/dist/assets/bindings_wasm_bg-9w8E-TmY.wasm +0 -0
- package/dist/assets/buildWorker-BZlya278.js +0 -687
- package/dist/assets/index-B7NRhsN6.js +0 -356
- package/dist/assets/index-D1V1AKed.css +0 -1
- package/dist/assets/worker-1oQYaz-F.js +0 -342
- package/dist/assets/worker-BfgPD8zR.js +0 -125
- package/dist/assets/worker-CoJaqtpi.js +0 -436
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
.vz-sidebar {
|
|
2
|
+
min-width: 0;
|
|
3
|
+
box-sizing: border-box;
|
|
2
4
|
height: 100%;
|
|
3
5
|
color: var(--vz-color-neutral-04);
|
|
4
6
|
background: var(--vz-color-neutral-01);
|
|
@@ -19,6 +21,7 @@
|
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
.files {
|
|
24
|
+
min-width: 0;
|
|
22
25
|
margin-top: 6px;
|
|
23
26
|
display: flex;
|
|
24
27
|
flex-direction: row;
|
|
@@ -70,6 +73,7 @@
|
|
|
70
73
|
.sidebar-search,
|
|
71
74
|
.sidebar-ai-chat,
|
|
72
75
|
.sidebar-visual-editor {
|
|
76
|
+
min-width: 0;
|
|
73
77
|
width: 100%;
|
|
74
78
|
}
|
|
75
79
|
|
|
@@ -1212,4 +1216,424 @@
|
|
|
1212
1216
|
font-weight: 400;
|
|
1213
1217
|
}
|
|
1214
1218
|
}
|
|
1219
|
+
|
|
1220
|
+
// Shared Visual Properties panel. All widgets inherit a single, theme-aware
|
|
1221
|
+
// layout rather than drawing separate cards with hard-coded neon accents.
|
|
1222
|
+
.visual-editor {
|
|
1223
|
+
padding: 0;
|
|
1224
|
+
gap: 0;
|
|
1225
|
+
min-width: 0;
|
|
1226
|
+
font-family: var(--vzcode-font-family);
|
|
1227
|
+
color: var(--vz-color-neutral-04);
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
.visual-properties-header {
|
|
1231
|
+
padding: 16px 16px 12px;
|
|
1232
|
+
border-bottom: 1px solid var(--vz-color-neutral-02);
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
.visual-properties-title {
|
|
1236
|
+
font-size: 14px;
|
|
1237
|
+
font-weight: 650;
|
|
1238
|
+
line-height: 1.4;
|
|
1239
|
+
letter-spacing: -0.01em;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
.visual-properties-hint {
|
|
1243
|
+
margin: 4px 0 0;
|
|
1244
|
+
font-size: 11px;
|
|
1245
|
+
line-height: 1.45;
|
|
1246
|
+
opacity: 0.7;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
.visual-properties-section {
|
|
1250
|
+
min-width: 0;
|
|
1251
|
+
border-bottom: 1px solid var(--vz-color-neutral-02);
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
.visual-properties-section-toggle {
|
|
1255
|
+
display: flex;
|
|
1256
|
+
width: 100%;
|
|
1257
|
+
align-items: center;
|
|
1258
|
+
justify-content: space-between;
|
|
1259
|
+
padding: 13px 16px;
|
|
1260
|
+
border: 0;
|
|
1261
|
+
background: transparent;
|
|
1262
|
+
color: inherit;
|
|
1263
|
+
font: 600 12px var(--vzcode-font-family);
|
|
1264
|
+
letter-spacing: 0.015em;
|
|
1265
|
+
cursor: pointer;
|
|
1266
|
+
text-align: left;
|
|
1267
|
+
|
|
1268
|
+
&:hover {
|
|
1269
|
+
background: var(--vz-color-neutral-02);
|
|
1270
|
+
}
|
|
1271
|
+
&:focus-visible {
|
|
1272
|
+
outline: 2px solid currentColor;
|
|
1273
|
+
outline-offset: -2px;
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
.visual-properties-chevron {
|
|
1278
|
+
display: inline-block;
|
|
1279
|
+
opacity: 0.65;
|
|
1280
|
+
transition: transform 160ms ease;
|
|
1281
|
+
|
|
1282
|
+
&.collapsed {
|
|
1283
|
+
transform: rotate(-90deg);
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
.visual-properties-section-body {
|
|
1288
|
+
display: flex;
|
|
1289
|
+
flex-direction: column;
|
|
1290
|
+
gap: 14px;
|
|
1291
|
+
padding: 2px 16px 18px;
|
|
1292
|
+
min-width: 0;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
.visual-editor {
|
|
1296
|
+
.visual-editor-slider,
|
|
1297
|
+
.visual-editor-checkbox,
|
|
1298
|
+
.visual-editor-dropdown,
|
|
1299
|
+
.visual-editor-text-input,
|
|
1300
|
+
.visual-editor-color {
|
|
1301
|
+
background: transparent;
|
|
1302
|
+
border: 0;
|
|
1303
|
+
border-radius: 0;
|
|
1304
|
+
box-shadow: none;
|
|
1305
|
+
padding: 0;
|
|
1306
|
+
gap: 7px;
|
|
1307
|
+
transition: none;
|
|
1308
|
+
|
|
1309
|
+
&:hover {
|
|
1310
|
+
background: transparent;
|
|
1311
|
+
border-color: transparent;
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
.slider-header,
|
|
1316
|
+
.checkbox-header,
|
|
1317
|
+
.dropdown-header,
|
|
1318
|
+
.text-input-header,
|
|
1319
|
+
.color-header {
|
|
1320
|
+
margin: 0;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
.slider-label,
|
|
1324
|
+
.checkbox-label,
|
|
1325
|
+
.dropdown-label,
|
|
1326
|
+
.text-input-label,
|
|
1327
|
+
.color-label {
|
|
1328
|
+
font: 500 12px var(--vzcode-font-family);
|
|
1329
|
+
color: var(--vz-color-neutral-04);
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
.slider-value,
|
|
1333
|
+
.checkbox-value,
|
|
1334
|
+
.color-value {
|
|
1335
|
+
background: var(--vz-color-neutral-02);
|
|
1336
|
+
color: var(--vz-color-neutral-04);
|
|
1337
|
+
font: 500 12px var(--vzcode-font-family);
|
|
1338
|
+
border-radius: 5px;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
.slider-track-fill {
|
|
1342
|
+
background: var(--vz-color-neutral-04);
|
|
1343
|
+
opacity: 0.55;
|
|
1344
|
+
}
|
|
1345
|
+
.slider-input {
|
|
1346
|
+
&::-webkit-slider-thumb {
|
|
1347
|
+
background: var(--vz-color-neutral-04);
|
|
1348
|
+
border-color: var(--vz-color-neutral-01);
|
|
1349
|
+
box-shadow: 0 0 0 1px var(--vz-color-neutral-03);
|
|
1350
|
+
}
|
|
1351
|
+
&::-moz-range-thumb {
|
|
1352
|
+
background: var(--vz-color-neutral-04);
|
|
1353
|
+
border-color: var(--vz-color-neutral-01);
|
|
1354
|
+
box-shadow: 0 0 0 1px var(--vz-color-neutral-03);
|
|
1355
|
+
}
|
|
1356
|
+
&:focus-visible {
|
|
1357
|
+
outline: 2px solid currentColor;
|
|
1358
|
+
outline-offset: 3px;
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
.dropdown-button:focus-visible,
|
|
1362
|
+
.text-input-field:focus-visible {
|
|
1363
|
+
border-color: var(--vz-color-neutral-04);
|
|
1364
|
+
box-shadow: 0 0 0 2px var(--vz-color-neutral-03);
|
|
1365
|
+
}
|
|
1366
|
+
.dropdown-option.selected {
|
|
1367
|
+
background: var(--vz-color-neutral-04);
|
|
1368
|
+
color: var(--vz-color-neutral-01);
|
|
1369
|
+
}
|
|
1370
|
+
.checkbox-indicator.checked {
|
|
1371
|
+
background: var(--vz-color-neutral-04);
|
|
1372
|
+
box-shadow: none;
|
|
1373
|
+
}
|
|
1374
|
+
.checkbox-input:checked + .checkbox-visual {
|
|
1375
|
+
border-color: var(--vz-color-neutral-04);
|
|
1376
|
+
background: var(--vz-color-neutral-02);
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
// Compact, accessible color picker with optional advanced HCL controls.
|
|
1381
|
+
.visual-editor .visual-editor-color {
|
|
1382
|
+
position: relative;
|
|
1383
|
+
}
|
|
1384
|
+
.color-picker-trigger {
|
|
1385
|
+
display: inline-flex;
|
|
1386
|
+
align-items: center;
|
|
1387
|
+
gap: 8px;
|
|
1388
|
+
max-width: 100%;
|
|
1389
|
+
padding: 3px 7px 3px 3px;
|
|
1390
|
+
border: 1px solid var(--vz-color-neutral-03);
|
|
1391
|
+
border-radius: 6px;
|
|
1392
|
+
background: var(--vz-color-neutral-02);
|
|
1393
|
+
color: var(--vz-color-neutral-04);
|
|
1394
|
+
font: 500 11px var(--vzcode-font-family);
|
|
1395
|
+
cursor: pointer;
|
|
1396
|
+
&:focus-visible {
|
|
1397
|
+
outline: 2px solid currentColor;
|
|
1398
|
+
outline-offset: 2px;
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
.color-picker-swatch {
|
|
1402
|
+
width: 26px;
|
|
1403
|
+
height: 26px;
|
|
1404
|
+
flex: none;
|
|
1405
|
+
border-radius: 4px;
|
|
1406
|
+
border: 1px solid var(--vz-color-neutral-03);
|
|
1407
|
+
}
|
|
1408
|
+
.color-picker-hex {
|
|
1409
|
+
font-family: ui-monospace, SFMono-Regular, monospace;
|
|
1410
|
+
}
|
|
1411
|
+
.color-picker-popover {
|
|
1412
|
+
display: flex;
|
|
1413
|
+
flex-direction: column;
|
|
1414
|
+
gap: 12px;
|
|
1415
|
+
margin-top: 4px;
|
|
1416
|
+
padding: 12px;
|
|
1417
|
+
border: 1px solid var(--vz-color-neutral-03);
|
|
1418
|
+
border-radius: 9px;
|
|
1419
|
+
background: var(--vz-color-neutral-01);
|
|
1420
|
+
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
|
|
1421
|
+
min-width: 0;
|
|
1422
|
+
}
|
|
1423
|
+
.color-picker-field {
|
|
1424
|
+
display: flex;
|
|
1425
|
+
flex-direction: column;
|
|
1426
|
+
gap: 5px;
|
|
1427
|
+
font-size: 11px;
|
|
1428
|
+
}
|
|
1429
|
+
.color-picker-native {
|
|
1430
|
+
width: 100%;
|
|
1431
|
+
height: 42px;
|
|
1432
|
+
padding: 2px;
|
|
1433
|
+
cursor: pointer;
|
|
1434
|
+
border: 1px solid var(--vz-color-neutral-03);
|
|
1435
|
+
border-radius: 6px;
|
|
1436
|
+
background: transparent;
|
|
1437
|
+
}
|
|
1438
|
+
.color-picker-hex-input {
|
|
1439
|
+
width: 100%;
|
|
1440
|
+
min-width: 0;
|
|
1441
|
+
box-sizing: border-box;
|
|
1442
|
+
padding: 8px;
|
|
1443
|
+
border-radius: 6px;
|
|
1444
|
+
border: 1px solid var(--vz-color-neutral-03);
|
|
1445
|
+
background: var(--vz-color-neutral-02);
|
|
1446
|
+
color: var(--vz-color-neutral-04);
|
|
1447
|
+
font:
|
|
1448
|
+
12px ui-monospace,
|
|
1449
|
+
SFMono-Regular,
|
|
1450
|
+
monospace;
|
|
1451
|
+
&:focus-visible {
|
|
1452
|
+
outline: 2px solid currentColor;
|
|
1453
|
+
outline-offset: 1px;
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
.color-picker-preset-label {
|
|
1457
|
+
font-size: 11px;
|
|
1458
|
+
font-weight: 600;
|
|
1459
|
+
}
|
|
1460
|
+
.color-picker-presets {
|
|
1461
|
+
display: grid;
|
|
1462
|
+
grid-template-columns: repeat(8, minmax(0, 1fr));
|
|
1463
|
+
gap: 5px;
|
|
1464
|
+
}
|
|
1465
|
+
.color-picker-preset {
|
|
1466
|
+
aspect-ratio: 1;
|
|
1467
|
+
min-width: 0;
|
|
1468
|
+
padding: 0;
|
|
1469
|
+
border: 1px solid var(--vz-color-neutral-03);
|
|
1470
|
+
border-radius: 5px;
|
|
1471
|
+
cursor: pointer;
|
|
1472
|
+
&:hover,
|
|
1473
|
+
&:focus-visible {
|
|
1474
|
+
outline: 2px solid var(--vz-color-neutral-04);
|
|
1475
|
+
outline-offset: 1px;
|
|
1476
|
+
}
|
|
1477
|
+
&[aria-pressed='true'] {
|
|
1478
|
+
outline: 2px solid var(--vz-color-neutral-04);
|
|
1479
|
+
outline-offset: 2px;
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
.color-picker-advanced-toggle {
|
|
1483
|
+
align-self: flex-start;
|
|
1484
|
+
padding: 0;
|
|
1485
|
+
border: 0;
|
|
1486
|
+
background: none;
|
|
1487
|
+
color: var(--vz-color-neutral-04);
|
|
1488
|
+
text-align: left;
|
|
1489
|
+
font: 500 11px var(--vzcode-font-family);
|
|
1490
|
+
cursor: pointer;
|
|
1491
|
+
&:focus-visible {
|
|
1492
|
+
outline: 2px solid currentColor;
|
|
1493
|
+
outline-offset: 2px;
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
.visual-editor .slider-header {
|
|
1498
|
+
gap: 8px;
|
|
1499
|
+
}
|
|
1500
|
+
.visual-editor .slider-number-input {
|
|
1501
|
+
width: 70px;
|
|
1502
|
+
min-width: 0;
|
|
1503
|
+
padding: 5px 6px;
|
|
1504
|
+
box-sizing: border-box;
|
|
1505
|
+
text-align: right;
|
|
1506
|
+
font: 500 12px var(--vzcode-font-family);
|
|
1507
|
+
color: var(--vz-color-neutral-04);
|
|
1508
|
+
background: var(--vz-color-neutral-02);
|
|
1509
|
+
border: 1px solid var(--vz-color-neutral-03);
|
|
1510
|
+
border-radius: 5px;
|
|
1511
|
+
&:focus-visible {
|
|
1512
|
+
outline: 2px solid currentColor;
|
|
1513
|
+
outline-offset: 1px;
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
.visual-editor .visual-editor-checkbox {
|
|
1517
|
+
display: flex;
|
|
1518
|
+
flex-direction: row;
|
|
1519
|
+
align-items: center;
|
|
1520
|
+
justify-content: space-between;
|
|
1521
|
+
min-height: 28px;
|
|
1522
|
+
}
|
|
1523
|
+
.visual-editor .checkbox-container {
|
|
1524
|
+
width: 42px;
|
|
1525
|
+
height: 22px;
|
|
1526
|
+
flex: none;
|
|
1527
|
+
}
|
|
1528
|
+
.visual-editor .checkbox-input {
|
|
1529
|
+
height: 22px;
|
|
1530
|
+
}
|
|
1531
|
+
.visual-editor .visual-properties-select {
|
|
1532
|
+
width: 100%;
|
|
1533
|
+
min-width: 0;
|
|
1534
|
+
box-sizing: border-box;
|
|
1535
|
+
padding: 9px 10px;
|
|
1536
|
+
color: var(--vz-color-neutral-04);
|
|
1537
|
+
background: var(--vz-color-neutral-02);
|
|
1538
|
+
border: 1px solid var(--vz-color-neutral-03);
|
|
1539
|
+
border-radius: 6px;
|
|
1540
|
+
font: 500 12px var(--vzcode-font-family);
|
|
1541
|
+
&:focus-visible {
|
|
1542
|
+
outline: 2px solid currentColor;
|
|
1543
|
+
outline-offset: 2px;
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
.visual-editor-segmented {
|
|
1547
|
+
display: flex;
|
|
1548
|
+
flex-direction: column;
|
|
1549
|
+
gap: 8px;
|
|
1550
|
+
min-width: 0;
|
|
1551
|
+
}
|
|
1552
|
+
.segmented-label {
|
|
1553
|
+
font: 500 12px var(--vzcode-font-family);
|
|
1554
|
+
}
|
|
1555
|
+
.segmented-options {
|
|
1556
|
+
display: flex;
|
|
1557
|
+
min-width: 0;
|
|
1558
|
+
padding: 3px;
|
|
1559
|
+
gap: 2px;
|
|
1560
|
+
border: 1px solid var(--vz-color-neutral-03);
|
|
1561
|
+
border-radius: 7px;
|
|
1562
|
+
background: var(--vz-color-neutral-02);
|
|
1563
|
+
}
|
|
1564
|
+
.segmented-option {
|
|
1565
|
+
flex: 1;
|
|
1566
|
+
min-width: 0;
|
|
1567
|
+
padding: 7px 5px;
|
|
1568
|
+
border: 0;
|
|
1569
|
+
border-radius: 5px;
|
|
1570
|
+
font: 500 11px var(--vzcode-font-family);
|
|
1571
|
+
color: var(--vz-color-neutral-04);
|
|
1572
|
+
background: transparent;
|
|
1573
|
+
cursor: pointer;
|
|
1574
|
+
white-space: nowrap;
|
|
1575
|
+
overflow: hidden;
|
|
1576
|
+
text-overflow: ellipsis;
|
|
1577
|
+
&[aria-pressed='true'] {
|
|
1578
|
+
background: var(--vz-color-neutral-01);
|
|
1579
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
|
|
1580
|
+
font-weight: 650;
|
|
1581
|
+
}
|
|
1582
|
+
&:focus-visible {
|
|
1583
|
+
outline: 2px solid currentColor;
|
|
1584
|
+
outline-offset: -2px;
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
.visual-properties-section-body[hidden] {
|
|
1589
|
+
display: none;
|
|
1590
|
+
}
|
|
1591
|
+
.visual-properties-field {
|
|
1592
|
+
display: flex;
|
|
1593
|
+
flex-direction: column;
|
|
1594
|
+
gap: 5px;
|
|
1595
|
+
min-width: 0;
|
|
1596
|
+
}
|
|
1597
|
+
.visual-properties-field-footer {
|
|
1598
|
+
display: flex;
|
|
1599
|
+
align-items: flex-start;
|
|
1600
|
+
justify-content: space-between;
|
|
1601
|
+
gap: 8px;
|
|
1602
|
+
min-width: 0;
|
|
1603
|
+
}
|
|
1604
|
+
.visual-properties-description {
|
|
1605
|
+
flex: 1;
|
|
1606
|
+
color: var(--vz-color-neutral-04);
|
|
1607
|
+
opacity: 0.7;
|
|
1608
|
+
font: 400 11px/1.45 var(--vzcode-font-family);
|
|
1609
|
+
}
|
|
1610
|
+
.visual-properties-reset {
|
|
1611
|
+
flex: none;
|
|
1612
|
+
border: none;
|
|
1613
|
+
padding: 0;
|
|
1614
|
+
background: transparent;
|
|
1615
|
+
font: 500 11px var(--vzcode-font-family);
|
|
1616
|
+
color: var(--vz-color-neutral-04);
|
|
1617
|
+
text-decoration: underline;
|
|
1618
|
+
text-underline-offset: 2px;
|
|
1619
|
+
cursor: pointer;
|
|
1620
|
+
&:disabled {
|
|
1621
|
+
opacity: 0.35;
|
|
1622
|
+
cursor: default;
|
|
1623
|
+
text-decoration: none;
|
|
1624
|
+
}
|
|
1625
|
+
&:focus-visible {
|
|
1626
|
+
outline: 2px solid currentColor;
|
|
1627
|
+
outline-offset: 3px;
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
.slider-number-wrapper {
|
|
1631
|
+
display: flex;
|
|
1632
|
+
gap: 4px;
|
|
1633
|
+
align-items: center;
|
|
1634
|
+
}
|
|
1635
|
+
.slider-number-unit {
|
|
1636
|
+
font-size: 11px;
|
|
1637
|
+
opacity: 0.7;
|
|
1638
|
+
}
|
|
1215
1639
|
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { useContext, useState } from 'react';
|
|
2
|
+
import { VZCodeContext } from './VZCodeContext';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Standalone-only conflict resolution. Embedded hosts can provide their
|
|
6
|
+
* own affordance for external file conflicts.
|
|
7
|
+
*/
|
|
8
|
+
export const WorkspaceConflictBanner = () => {
|
|
9
|
+
const { content } = useContext(VZCodeContext);
|
|
10
|
+
const conflicts: string[] =
|
|
11
|
+
(
|
|
12
|
+
content as unknown as {
|
|
13
|
+
workspaceConflicts?: string[];
|
|
14
|
+
} | null
|
|
15
|
+
)?.workspaceConflicts ?? [];
|
|
16
|
+
const [busy, setBusy] = useState<string | null>(null);
|
|
17
|
+
const [error, setError] = useState<string | null>(null);
|
|
18
|
+
|
|
19
|
+
if (!conflicts.length) return null;
|
|
20
|
+
|
|
21
|
+
const resolve = async (
|
|
22
|
+
name: string,
|
|
23
|
+
choice: 'disk' | 'editor',
|
|
24
|
+
) => {
|
|
25
|
+
if (
|
|
26
|
+
choice === 'editor' &&
|
|
27
|
+
!window.confirm(
|
|
28
|
+
'Overwrite the external disk changes for "' +
|
|
29
|
+
name +
|
|
30
|
+
'" with the editor version?',
|
|
31
|
+
)
|
|
32
|
+
) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
setBusy(name);
|
|
36
|
+
setError(null);
|
|
37
|
+
try {
|
|
38
|
+
const response = await fetch(
|
|
39
|
+
'/workspace-conflicts/resolve',
|
|
40
|
+
{
|
|
41
|
+
method: 'POST',
|
|
42
|
+
credentials: 'same-origin',
|
|
43
|
+
headers: {
|
|
44
|
+
'Content-Type': 'application/json',
|
|
45
|
+
},
|
|
46
|
+
body: JSON.stringify({ name, choice }),
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
if (!response.ok) {
|
|
50
|
+
const body = await response
|
|
51
|
+
.json()
|
|
52
|
+
.catch(() => ({}));
|
|
53
|
+
throw new Error(
|
|
54
|
+
body.error || 'Unable to resolve conflict',
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
} catch (caught: any) {
|
|
58
|
+
setError(caught.message ?? String(caught));
|
|
59
|
+
} finally {
|
|
60
|
+
setBusy(null);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<aside
|
|
66
|
+
role="alert"
|
|
67
|
+
aria-live="polite"
|
|
68
|
+
style={{
|
|
69
|
+
position: 'fixed',
|
|
70
|
+
top: 8,
|
|
71
|
+
left: '50%',
|
|
72
|
+
transform: 'translateX(-50%)',
|
|
73
|
+
zIndex: 10000,
|
|
74
|
+
maxHeight: '45vh',
|
|
75
|
+
overflowY: 'auto',
|
|
76
|
+
maxWidth: 'min(600px, 95vw)',
|
|
77
|
+
padding: 14,
|
|
78
|
+
borderRadius: 8,
|
|
79
|
+
background: '#fff4dc',
|
|
80
|
+
color: '#3a2a12',
|
|
81
|
+
border: '1px solid #d6a341',
|
|
82
|
+
boxShadow: '0 4px 20px #0003',
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
<strong>External filesystem conflict</strong>
|
|
86
|
+
<p>
|
|
87
|
+
Changes were made to these files outside VZCode
|
|
88
|
+
while there were unsaved editor changes. Autosave is
|
|
89
|
+
paused to prevent data loss.
|
|
90
|
+
</p>
|
|
91
|
+
{conflicts.map((name) => (
|
|
92
|
+
<div
|
|
93
|
+
key={name}
|
|
94
|
+
style={{
|
|
95
|
+
display: 'flex',
|
|
96
|
+
flexWrap: 'wrap',
|
|
97
|
+
alignItems: 'center',
|
|
98
|
+
gap: 8,
|
|
99
|
+
marginBottom: 8,
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
<code>{name}</code>
|
|
103
|
+
<button
|
|
104
|
+
disabled={busy !== null}
|
|
105
|
+
onClick={() => void resolve(name, 'disk')}
|
|
106
|
+
>
|
|
107
|
+
Load disk version
|
|
108
|
+
</button>
|
|
109
|
+
<button
|
|
110
|
+
disabled={busy !== null}
|
|
111
|
+
onClick={() => void resolve(name, 'editor')}
|
|
112
|
+
>
|
|
113
|
+
Overwrite disk with editor
|
|
114
|
+
</button>
|
|
115
|
+
</div>
|
|
116
|
+
))}
|
|
117
|
+
{error ? <p>{error}</p> : null}
|
|
118
|
+
</aside>
|
|
119
|
+
);
|
|
120
|
+
};
|
package/src/client/index.ts
CHANGED
|
@@ -6,6 +6,8 @@ export {
|
|
|
6
6
|
VZCodeContext,
|
|
7
7
|
} from './VZCodeContext';
|
|
8
8
|
export { VZSidebar } from './VZSidebar';
|
|
9
|
+
export { VisualEditorControls } from './VZSidebar/VisualEditor/VisualEditorControls';
|
|
10
|
+
export type { VisualEditorControlsProps } from './VZSidebar/VisualEditor/VisualEditorControls';
|
|
9
11
|
export { VZSettings } from './VZSettings';
|
|
10
12
|
export { VZKeyboardShortcutsDoc } from './VZKeyboardShortcutsDoc';
|
|
11
13
|
export { VZResizer } from './VZResizer';
|
package/src/client/main.jsx
CHANGED
|
@@ -1,33 +1,75 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as ReactDOM from 'react-dom/client';
|
|
3
|
-
import App from './App';
|
|
4
3
|
import './standalone.scss';
|
|
5
4
|
import { BrowserRouter } from 'react-router-dom';
|
|
6
5
|
|
|
7
|
-
// Global error handler
|
|
8
|
-
// These can occur when CodeMirror instances are created but not yet
|
|
9
|
-
// attached to the DOM, or when presence indicators try to render
|
|
10
|
-
// on offscreen editor instances.
|
|
6
|
+
// Global error handler for a known, non-fatal CodeMirror DOM error.
|
|
11
7
|
window.addEventListener('error', (event) => {
|
|
12
|
-
// Check if this is the specific CodeMirror posFromDOM/posAtDOM error
|
|
13
8
|
if (
|
|
14
9
|
event.error instanceof RangeError &&
|
|
15
10
|
event.error.message.includes(
|
|
16
11
|
'Trying to find position for a DOM position outside of the document',
|
|
17
12
|
)
|
|
18
13
|
) {
|
|
19
|
-
// Log the error for debugging purposes
|
|
20
14
|
console.log(
|
|
21
15
|
'Suppressed CodeMirror DOM position error:',
|
|
22
16
|
event.error,
|
|
23
17
|
);
|
|
24
|
-
// Prevent the error from being logged to console by returning true
|
|
25
18
|
return true;
|
|
26
19
|
}
|
|
27
20
|
});
|
|
28
21
|
|
|
29
|
-
ReactDOM.createRoot(
|
|
30
|
-
|
|
31
|
-
<App />
|
|
32
|
-
</BrowserRouter>,
|
|
22
|
+
const root = ReactDOM.createRoot(
|
|
23
|
+
document.getElementById('root'),
|
|
33
24
|
);
|
|
25
|
+
|
|
26
|
+
async function start() {
|
|
27
|
+
// The capability token is in the URL fragment, never sent in HTTP
|
|
28
|
+
// requests or referrers. Exchange it for an HttpOnly session cookie.
|
|
29
|
+
const fragment = new URLSearchParams(
|
|
30
|
+
window.location.hash.slice(1),
|
|
31
|
+
);
|
|
32
|
+
const token = fragment.get('vzcode-token');
|
|
33
|
+
if (token) {
|
|
34
|
+
const response = await fetch('/auth/session', {
|
|
35
|
+
method: 'POST',
|
|
36
|
+
headers: { Authorization: 'Bearer ' + token },
|
|
37
|
+
credentials: 'same-origin',
|
|
38
|
+
});
|
|
39
|
+
if (!response.ok) {
|
|
40
|
+
throw new Error('Invalid VZCode access link.');
|
|
41
|
+
}
|
|
42
|
+
// Remove the sensitive fragment from browser history.
|
|
43
|
+
window.history.replaceState(
|
|
44
|
+
null,
|
|
45
|
+
'',
|
|
46
|
+
window.location.pathname + window.location.search,
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const status = await fetch('/auth/status', {
|
|
51
|
+
credentials: 'same-origin',
|
|
52
|
+
cache: 'no-store',
|
|
53
|
+
});
|
|
54
|
+
if (!status.ok) {
|
|
55
|
+
throw new Error(
|
|
56
|
+
'Authorization required. Open the private URL printed by the VZCode CLI.',
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
// App creates its WebSocket at module initialization; it must load
|
|
60
|
+
// only after the session cookie has been established.
|
|
61
|
+
const { default: App } = await import('./App');
|
|
62
|
+
root.render(
|
|
63
|
+
<BrowserRouter>
|
|
64
|
+
<App />
|
|
65
|
+
</BrowserRouter>,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
start().catch((error) => {
|
|
70
|
+
console.error('VZCode authentication failed:', error);
|
|
71
|
+
const message = document.createElement('p');
|
|
72
|
+
message.style.padding = '2rem';
|
|
73
|
+
message.textContent = error.message;
|
|
74
|
+
document.getElementById('root').replaceChildren(message);
|
|
75
|
+
});
|
|
@@ -4,7 +4,7 @@ Server-side library for streaming LLM responses with ShareDB integration.
|
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
This
|
|
7
|
+
This is an internal VZCode module that provides server-side functionality for:
|
|
8
8
|
|
|
9
9
|
- **LLM Streaming**: Creating and managing streaming LLM functions with OpenAI/OpenRouter
|
|
10
10
|
- **AI Code Editing**: Performing AI-assisted code transformations and edits
|
|
@@ -12,9 +12,10 @@ This module is being extracted from VZCode's AI chat functionality to become a s
|
|
|
12
12
|
- **Request Validation**: Validating incoming AI chat requests
|
|
13
13
|
- **Error Handling**: Handling errors gracefully in streaming contexts
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Status
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
The module is used by VZCode's AI chat handler. It still depends on VZCode
|
|
18
|
+
types and utilities, and is not published as a standalone package.
|
|
18
19
|
|
|
19
20
|
## Files
|
|
20
21
|
|
|
@@ -35,19 +36,6 @@ Declared in `package.json`:
|
|
|
35
36
|
- `editcodewithai` - Code editing utilities
|
|
36
37
|
- VZCode utilities: `../types.js`, `../ot.js`, `../randomId.js`, etc.
|
|
37
38
|
|
|
38
|
-
## Future Plans
|
|
39
|
-
|
|
40
|
-
This module will eventually be:
|
|
41
|
-
|
|
42
|
-
1. Decoupled from VZCode-specific types and utilities
|
|
43
|
-
2. Published as `@vizhub/llm-streaming-server` on npm
|
|
44
|
-
3. Made framework-agnostic (can work with Express, Fastify, etc.)
|
|
45
|
-
4. Fully documented with usage examples
|
|
46
|
-
|
|
47
|
-
This module is being extracted into a standalone package
|
|
48
|
-
(`@vizhub/llm-streaming-server`). Follow the conventions in
|
|
49
|
-
`../llm-streaming-ui/README.md` when contributing.
|
|
50
|
-
|
|
51
39
|
## Usage (Current)
|
|
52
40
|
|
|
53
41
|
Currently, this module is imported by `src/server/aiChatHandler/index.ts`:
|