@lvce-editor/chat-debug-view 7.4.0 → 7.5.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/chatDebugViewWorkerMain.js +992 -506
- package/package.json +1 -1
|
@@ -1128,6 +1128,7 @@ const Text = 12;
|
|
|
1128
1128
|
const Th = 13;
|
|
1129
1129
|
const THead = 14;
|
|
1130
1130
|
const Tr = 15;
|
|
1131
|
+
const H2 = 22;
|
|
1131
1132
|
const Section = 41;
|
|
1132
1133
|
const Search = 42;
|
|
1133
1134
|
const Label = 66;
|
|
@@ -1139,7 +1140,7 @@ const ClientY = 'event.clientY';
|
|
|
1139
1140
|
const TargetName = 'event.target.name';
|
|
1140
1141
|
const TargetValue = 'event.target.value';
|
|
1141
1142
|
|
|
1142
|
-
const None = 0;
|
|
1143
|
+
const None$1 = 0;
|
|
1143
1144
|
const Checked = 2;
|
|
1144
1145
|
const Unchecked = 3;
|
|
1145
1146
|
|
|
@@ -1170,6 +1171,9 @@ const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
|
1170
1171
|
const sendMessagePortToChatStorageWorker$1 = async port => {
|
|
1171
1172
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatStorageWorker', port, 'HandleMessagePort.handleMessagePort');
|
|
1172
1173
|
};
|
|
1174
|
+
const writeClipBoardText = async text => {
|
|
1175
|
+
await invoke('ClipBoard.writeText', /* text */text);
|
|
1176
|
+
};
|
|
1173
1177
|
|
|
1174
1178
|
const toCommandId = key => {
|
|
1175
1179
|
const dotIndex = key.indexOf('.');
|
|
@@ -1301,11 +1305,8 @@ const loadSelectedEvent$1 = async (sessionId, eventId, type) => {
|
|
|
1301
1305
|
return invoke$1('ChatStorage.loadSelectedEvent', sessionId, eventId, type);
|
|
1302
1306
|
};
|
|
1303
1307
|
|
|
1304
|
-
const appendStoredEventForTestDependencies = {
|
|
1305
|
-
appendEvent: appendEvent
|
|
1306
|
-
};
|
|
1307
1308
|
const appendStoredEventForTest = async (state, event) => {
|
|
1308
|
-
await
|
|
1309
|
+
await appendEvent(event);
|
|
1309
1310
|
return state;
|
|
1310
1311
|
};
|
|
1311
1312
|
|
|
@@ -1340,6 +1341,7 @@ const NoChatSessionFound = 'No chat session found for sessionId "{PH1}".';
|
|
|
1340
1341
|
const NoEventsFound = 'No events have been found';
|
|
1341
1342
|
const NoEventsFoundMatching = 'No events found matching {PH1}';
|
|
1342
1343
|
const NoToolCallEvents = 'No tool call events.';
|
|
1344
|
+
const Payload$1 = 'Payload';
|
|
1343
1345
|
const Preview$1 = 'Preview';
|
|
1344
1346
|
const Refresh$1 = 'Refresh';
|
|
1345
1347
|
const RefreshEvents = 'Refresh events';
|
|
@@ -1432,6 +1434,9 @@ const noToolCallEvents = () => {
|
|
|
1432
1434
|
const preview = () => {
|
|
1433
1435
|
return i18nString(Preview$1);
|
|
1434
1436
|
};
|
|
1437
|
+
const payload = () => {
|
|
1438
|
+
return i18nString(Payload$1);
|
|
1439
|
+
};
|
|
1435
1440
|
const refresh$1 = () => {
|
|
1436
1441
|
return i18nString(Refresh$1);
|
|
1437
1442
|
};
|
|
@@ -1489,39 +1494,77 @@ const windowSummary = (start, end, duration) => {
|
|
|
1489
1494
|
});
|
|
1490
1495
|
};
|
|
1491
1496
|
|
|
1497
|
+
const Filter = 'filter';
|
|
1498
|
+
const EventCategoryFilter = 'eventCategoryFilter';
|
|
1499
|
+
const ShowEventStreamFinishedEvents = 'showEventStreamFinishedEvents';
|
|
1500
|
+
const ShowInputEvents = 'showInputEvents';
|
|
1501
|
+
const ShowResponsePartEvents = 'showResponsePartEvents';
|
|
1502
|
+
const UseDevtoolsLayout = 'useDevtoolsLayout';
|
|
1503
|
+
const SelectedEventIndex = 'selectedEventIndex';
|
|
1504
|
+
const CloseDetails = 'closeDetails';
|
|
1505
|
+
const DetailTab = 'detailTab';
|
|
1506
|
+
const TimelineStartSeconds = 'timelineStartSeconds';
|
|
1507
|
+
const TimelineEndSeconds = 'timelineEndSeconds';
|
|
1508
|
+
const TimelineRangePreset = 'timelineRangePreset';
|
|
1509
|
+
const Refresh = 'refresh';
|
|
1510
|
+
const All = 'all';
|
|
1511
|
+
const Tools = 'tools';
|
|
1512
|
+
const Network = 'network';
|
|
1513
|
+
const Ui = 'ui';
|
|
1514
|
+
const Stream = 'stream';
|
|
1492
1515
|
const Response = 'response';
|
|
1493
1516
|
const Preview = 'preview';
|
|
1517
|
+
const Payload = 'payload';
|
|
1494
1518
|
const Timing = 'timing';
|
|
1495
|
-
|
|
1519
|
+
|
|
1520
|
+
const createDetailTabs = () => {
|
|
1521
|
+
return [{
|
|
1522
|
+
label: preview(),
|
|
1523
|
+
name: Preview
|
|
1524
|
+
}, {
|
|
1525
|
+
label: payload(),
|
|
1526
|
+
name: Payload
|
|
1527
|
+
}, {
|
|
1528
|
+
label: response(),
|
|
1529
|
+
name: Response
|
|
1530
|
+
}, {
|
|
1531
|
+
label: timing(),
|
|
1532
|
+
name: Timing
|
|
1533
|
+
}];
|
|
1534
|
+
};
|
|
1496
1535
|
const isDetailTab = value => {
|
|
1497
|
-
return value === Response || value === Preview || value === Timing;
|
|
1536
|
+
return value === Response || value === Preview || value === Payload || value === Timing;
|
|
1498
1537
|
};
|
|
1499
|
-
const
|
|
1500
|
-
|
|
1501
|
-
|
|
1538
|
+
const hasDetailTab = (detailTabs, value) => {
|
|
1539
|
+
return detailTabs.some(detailTab => detailTab.name === value);
|
|
1540
|
+
};
|
|
1541
|
+
const getSelectedDetailTab = (detailTabs, selectedDetailTab) => {
|
|
1542
|
+
if (hasDetailTab(detailTabs, selectedDetailTab)) {
|
|
1543
|
+
return selectedDetailTab;
|
|
1502
1544
|
}
|
|
1503
|
-
|
|
1504
|
-
|
|
1545
|
+
const responseTab = detailTabs.find(detailTab => detailTab.name === Response);
|
|
1546
|
+
if (responseTab) {
|
|
1547
|
+
return responseTab.name;
|
|
1505
1548
|
}
|
|
1506
|
-
return
|
|
1549
|
+
return detailTabs[0]?.name ?? selectedDetailTab;
|
|
1507
1550
|
};
|
|
1508
1551
|
|
|
1509
|
-
const
|
|
1552
|
+
const createCategoryFilters = () => {
|
|
1510
1553
|
return [{
|
|
1511
1554
|
label: all(),
|
|
1512
|
-
|
|
1555
|
+
name: All
|
|
1513
1556
|
}, {
|
|
1514
1557
|
label: tools(),
|
|
1515
|
-
|
|
1558
|
+
name: Tools
|
|
1516
1559
|
}, {
|
|
1517
1560
|
label: network(),
|
|
1518
|
-
|
|
1561
|
+
name: Network
|
|
1519
1562
|
}, {
|
|
1520
1563
|
label: ui(),
|
|
1521
|
-
|
|
1564
|
+
name: Ui
|
|
1522
1565
|
}, {
|
|
1523
1566
|
label: stream(),
|
|
1524
|
-
|
|
1567
|
+
name: Stream
|
|
1525
1568
|
}];
|
|
1526
1569
|
};
|
|
1527
1570
|
|
|
@@ -1540,12 +1583,6 @@ const getEventCategoryFilterLabel = eventCategoryFilter => {
|
|
|
1540
1583
|
}
|
|
1541
1584
|
};
|
|
1542
1585
|
|
|
1543
|
-
const All = 'all';
|
|
1544
|
-
const Tools = 'tools';
|
|
1545
|
-
const Network = 'network';
|
|
1546
|
-
const Ui = 'ui';
|
|
1547
|
-
const Stream = 'stream';
|
|
1548
|
-
|
|
1549
1586
|
const RE_SPACE = /\s+/;
|
|
1550
1587
|
const tokenToEventCategoryFilter = new Map([['@tools', Tools], ['@network', Network], ['@ui', Ui], ['@stream', Stream]]);
|
|
1551
1588
|
const parseFilterValue = filterValue => {
|
|
@@ -1581,11 +1618,121 @@ const isVisibleTableColumn = (visibleTableColumns, column) => {
|
|
|
1581
1618
|
return visibleTableColumns.includes(column);
|
|
1582
1619
|
};
|
|
1583
1620
|
|
|
1621
|
+
const defaultTableColumnWidths = {
|
|
1622
|
+
duration: 110,
|
|
1623
|
+
status: 110,
|
|
1624
|
+
type: 260
|
|
1625
|
+
};
|
|
1626
|
+
|
|
1627
|
+
const defaultTableWidth = 480;
|
|
1628
|
+
const minTableWidth = 240;
|
|
1629
|
+
const minDetailsWidth = 280;
|
|
1630
|
+
const sashWidth = 8;
|
|
1631
|
+
const viewPadding = 8;
|
|
1632
|
+
const timelineHorizontalPadding = 10;
|
|
1633
|
+
const horizontalPadding = viewPadding * 2;
|
|
1634
|
+
const leftPadding = viewPadding;
|
|
1635
|
+
const getMainWidth = width => {
|
|
1636
|
+
return Math.max(0, width - horizontalPadding);
|
|
1637
|
+
};
|
|
1638
|
+
const clampTableWidth = (width, tableWidth) => {
|
|
1639
|
+
const mainWidth = getMainWidth(width);
|
|
1640
|
+
const maxTableWidth = Math.max(0, mainWidth - minDetailsWidth - sashWidth);
|
|
1641
|
+
const minClampedTableWidth = Math.min(minTableWidth, maxTableWidth);
|
|
1642
|
+
return Math.max(minClampedTableWidth, Math.min(tableWidth, maxTableWidth));
|
|
1643
|
+
};
|
|
1644
|
+
const getDetailsWidth = (width, tableWidth) => {
|
|
1645
|
+
const mainWidth = getMainWidth(width);
|
|
1646
|
+
const clampedTableWidth = clampTableWidth(width, tableWidth);
|
|
1647
|
+
return Math.max(0, mainWidth - clampedTableWidth - sashWidth);
|
|
1648
|
+
};
|
|
1649
|
+
const getTableWidthFromClientX = (viewX, width, clientX) => {
|
|
1650
|
+
const nextTableWidth = clientX - viewX - leftPadding;
|
|
1651
|
+
return clampTableWidth(width, nextTableWidth);
|
|
1652
|
+
};
|
|
1653
|
+
|
|
1654
|
+
const minimumTableColumnWidth = 80;
|
|
1655
|
+
|
|
1656
|
+
const getTableColumnLayout = (tableWidth, visibleTableColumns, tableColumnWidths) => {
|
|
1657
|
+
const visibleColumns = getOrderedVisibleTableColumns(visibleTableColumns);
|
|
1658
|
+
if (visibleColumns.length === 0) {
|
|
1659
|
+
return {
|
|
1660
|
+
fixedColumns: [],
|
|
1661
|
+
resizerLefts: [],
|
|
1662
|
+
visibleColumns,
|
|
1663
|
+
visibleColumnWidths: []
|
|
1664
|
+
};
|
|
1665
|
+
}
|
|
1666
|
+
const visibleColumnWidths = [];
|
|
1667
|
+
let remainingWidth = tableWidth;
|
|
1668
|
+
let remainingColumnCount = visibleColumns.length;
|
|
1669
|
+
for (let index = 0; index < visibleColumns.length; index++) {
|
|
1670
|
+
const column = visibleColumns[index];
|
|
1671
|
+
if (index === visibleColumns.length - 1) {
|
|
1672
|
+
visibleColumnWidths.push(Math.max(0, remainingWidth));
|
|
1673
|
+
continue;
|
|
1674
|
+
}
|
|
1675
|
+
const maxWidth = Math.max(minimumTableColumnWidth, remainingWidth - minimumTableColumnWidth * (remainingColumnCount - 1));
|
|
1676
|
+
const preferredWidth = tableColumnWidths[column];
|
|
1677
|
+
const clampedWidth = Math.max(minimumTableColumnWidth, Math.min(preferredWidth, maxWidth));
|
|
1678
|
+
visibleColumnWidths.push(clampedWidth);
|
|
1679
|
+
remainingWidth -= clampedWidth;
|
|
1680
|
+
remainingColumnCount -= 1;
|
|
1681
|
+
}
|
|
1682
|
+
const resizerLefts = [];
|
|
1683
|
+
let cumulativeWidth = 0;
|
|
1684
|
+
for (let index = 0; index < visibleColumnWidths.length - 1; index++) {
|
|
1685
|
+
cumulativeWidth += visibleColumnWidths[index];
|
|
1686
|
+
resizerLefts.push(cumulativeWidth);
|
|
1687
|
+
}
|
|
1688
|
+
return {
|
|
1689
|
+
fixedColumns: visibleColumns.slice(0, -1),
|
|
1690
|
+
resizerLefts,
|
|
1691
|
+
visibleColumns,
|
|
1692
|
+
visibleColumnWidths
|
|
1693
|
+
};
|
|
1694
|
+
};
|
|
1695
|
+
|
|
1696
|
+
const getResizedTableColumnWidths = (width, tableWidth, visibleTableColumns, tableColumnWidths, viewX, clientX, resizerDownId) => {
|
|
1697
|
+
const clampedTableWidth = clampTableWidth(width, tableWidth);
|
|
1698
|
+
const layout = getTableColumnLayout(clampedTableWidth, visibleTableColumns, tableColumnWidths);
|
|
1699
|
+
if (resizerDownId < 1 || resizerDownId >= layout.visibleColumns.length) {
|
|
1700
|
+
return tableColumnWidths;
|
|
1701
|
+
}
|
|
1702
|
+
const boundaryIndex = resizerDownId - 1;
|
|
1703
|
+
const precedingWidth = layout.visibleColumnWidths.slice(0, boundaryIndex).reduce((total, current) => total + current, 0);
|
|
1704
|
+
const remainingVisibleColumnCount = layout.visibleColumns.length - boundaryIndex - 1;
|
|
1705
|
+
const maxWidth = Math.max(minimumTableColumnWidth, clampedTableWidth - precedingWidth - minimumTableColumnWidth * remainingVisibleColumnCount);
|
|
1706
|
+
const nextWidth = clientX - viewX - leftPadding - precedingWidth;
|
|
1707
|
+
const clampedWidth = Math.max(minimumTableColumnWidth, Math.min(nextWidth, maxWidth));
|
|
1708
|
+
const resizedColumn = layout.visibleColumns[boundaryIndex];
|
|
1709
|
+
return {
|
|
1710
|
+
...tableColumnWidths,
|
|
1711
|
+
[resizedColumn]: clampedWidth
|
|
1712
|
+
};
|
|
1713
|
+
};
|
|
1714
|
+
|
|
1715
|
+
const isSameTableColumnWidths = (first, second) => {
|
|
1716
|
+
return first.type === second.type && first.duration === second.duration && first.status === second.status;
|
|
1717
|
+
};
|
|
1718
|
+
|
|
1719
|
+
const isFiniteNumber = value => {
|
|
1720
|
+
return typeof value === 'number' && Number.isFinite(value);
|
|
1721
|
+
};
|
|
1722
|
+
|
|
1723
|
+
const isTableColumnWidths = value => {
|
|
1724
|
+
if (typeof value !== 'object' || value === null) {
|
|
1725
|
+
return false;
|
|
1726
|
+
}
|
|
1727
|
+
const record = value;
|
|
1728
|
+
return isFiniteNumber(record.type) && isFiniteNumber(record.duration) && isFiniteNumber(record.status);
|
|
1729
|
+
};
|
|
1730
|
+
|
|
1584
1731
|
const validEventCategoryFilters = new Set([All, Network, Stream, Tools, Ui]);
|
|
1585
1732
|
const isSavedState = value => {
|
|
1586
1733
|
return typeof value === 'object' && value !== null;
|
|
1587
1734
|
};
|
|
1588
|
-
const
|
|
1735
|
+
const restoreEventCategoryFilter = (savedState, currentEventCategoryFilter) => {
|
|
1589
1736
|
if (typeof savedState.eventCategoryFilter === 'string' && validEventCategoryFilters.has(savedState.eventCategoryFilter)) {
|
|
1590
1737
|
return savedState.eventCategoryFilter;
|
|
1591
1738
|
}
|
|
@@ -1594,20 +1741,45 @@ const getRestoredEventCategoryFilter = (savedState, currentEventCategoryFilter)
|
|
|
1594
1741
|
}
|
|
1595
1742
|
return currentEventCategoryFilter;
|
|
1596
1743
|
};
|
|
1744
|
+
const restoreFilterValue = (savedState, currentFilterValue) => {
|
|
1745
|
+
return typeof savedState.filterValue === 'string' ? savedState.filterValue : currentFilterValue;
|
|
1746
|
+
};
|
|
1747
|
+
const restoreSelectedDetailTab = (savedState, currentSelectedDetailTab) => {
|
|
1748
|
+
return typeof savedState.selectedDetailTab === 'string' && isDetailTab(savedState.selectedDetailTab) ? savedState.selectedDetailTab : currentSelectedDetailTab;
|
|
1749
|
+
};
|
|
1750
|
+
const restoreSelectedEventId = (savedState, currentSelectedEventId) => {
|
|
1751
|
+
return typeof savedState.selectedEventId === 'number' || savedState.selectedEventId === null ? savedState.selectedEventId : currentSelectedEventId;
|
|
1752
|
+
};
|
|
1753
|
+
const restoreTimelineEndSeconds = (savedState, currentTimelineEndSeconds) => {
|
|
1754
|
+
return typeof savedState.timelineEndSeconds === 'string' ? savedState.timelineEndSeconds : currentTimelineEndSeconds;
|
|
1755
|
+
};
|
|
1756
|
+
const restoreTimelineStartSeconds = (savedState, currentTimelineStartSeconds) => {
|
|
1757
|
+
return typeof savedState.timelineStartSeconds === 'string' ? savedState.timelineStartSeconds : currentTimelineStartSeconds;
|
|
1758
|
+
};
|
|
1759
|
+
const restoreVisibleTableColumns = (savedState, currentVisibleTableColumns) => {
|
|
1760
|
+
if (!Array.isArray(savedState.visibleTableColumns)) {
|
|
1761
|
+
return currentVisibleTableColumns;
|
|
1762
|
+
}
|
|
1763
|
+
const visibleTableColumns = savedState.visibleTableColumns.filter(value => typeof value === 'string');
|
|
1764
|
+
return getOrderedVisibleTableColumns(visibleTableColumns);
|
|
1765
|
+
};
|
|
1766
|
+
const restoreTableColumnWidths = (savedState, currentTableColumnWidths) => {
|
|
1767
|
+
return isTableColumnWidths(savedState.tableColumnWidths) ? savedState.tableColumnWidths : currentTableColumnWidths;
|
|
1768
|
+
};
|
|
1597
1769
|
const restoreSavedState = (state, savedState) => {
|
|
1598
1770
|
if (!isSavedState(savedState)) {
|
|
1599
1771
|
return state;
|
|
1600
1772
|
}
|
|
1601
|
-
const restoredVisibleTableColumns = Array.isArray(savedState.visibleTableColumns) ? getOrderedVisibleTableColumns(savedState.visibleTableColumns.filter(value => typeof value === 'string')) : state.visibleTableColumns;
|
|
1602
1773
|
return {
|
|
1603
1774
|
...state,
|
|
1604
|
-
eventCategoryFilter:
|
|
1605
|
-
filterValue:
|
|
1606
|
-
selectedDetailTab:
|
|
1607
|
-
selectedEventId:
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1775
|
+
eventCategoryFilter: restoreEventCategoryFilter(savedState, state.eventCategoryFilter),
|
|
1776
|
+
filterValue: restoreFilterValue(savedState, state.filterValue),
|
|
1777
|
+
selectedDetailTab: restoreSelectedDetailTab(savedState, state.selectedDetailTab),
|
|
1778
|
+
selectedEventId: restoreSelectedEventId(savedState, state.selectedEventId),
|
|
1779
|
+
tableColumnWidths: restoreTableColumnWidths(savedState, state.tableColumnWidths),
|
|
1780
|
+
timelineEndSeconds: restoreTimelineEndSeconds(savedState, state.timelineEndSeconds),
|
|
1781
|
+
timelineStartSeconds: restoreTimelineStartSeconds(savedState, state.timelineStartSeconds),
|
|
1782
|
+
visibleTableColumns: restoreVisibleTableColumns(savedState, state.visibleTableColumns)
|
|
1611
1783
|
};
|
|
1612
1784
|
};
|
|
1613
1785
|
|
|
@@ -1620,41 +1792,15 @@ const {
|
|
|
1620
1792
|
wrapGetter
|
|
1621
1793
|
} = create$1();
|
|
1622
1794
|
|
|
1623
|
-
const defaultTableWidth = 480;
|
|
1624
|
-
const minTableWidth = 240;
|
|
1625
|
-
const minDetailsWidth = 280;
|
|
1626
|
-
const sashWidth = 8;
|
|
1627
|
-
const viewPadding = 8;
|
|
1628
|
-
const timelineHorizontalPadding = 10;
|
|
1629
|
-
const horizontalPadding = viewPadding * 2;
|
|
1630
|
-
const leftPadding = viewPadding;
|
|
1631
|
-
const getMainWidth = width => {
|
|
1632
|
-
return Math.max(0, width - horizontalPadding);
|
|
1633
|
-
};
|
|
1634
|
-
const clampTableWidth = (width, tableWidth) => {
|
|
1635
|
-
const mainWidth = getMainWidth(width);
|
|
1636
|
-
const maxTableWidth = Math.max(0, mainWidth - minDetailsWidth - sashWidth);
|
|
1637
|
-
const minClampedTableWidth = Math.min(minTableWidth, maxTableWidth);
|
|
1638
|
-
return Math.max(minClampedTableWidth, Math.min(tableWidth, maxTableWidth));
|
|
1639
|
-
};
|
|
1640
|
-
const getDetailsWidth = (width, tableWidth) => {
|
|
1641
|
-
const mainWidth = getMainWidth(width);
|
|
1642
|
-
const clampedTableWidth = clampTableWidth(width, tableWidth);
|
|
1643
|
-
return Math.max(0, mainWidth - clampedTableWidth - sashWidth);
|
|
1644
|
-
};
|
|
1645
|
-
const getTableWidthFromClientX = (viewX, width, clientX) => {
|
|
1646
|
-
const nextTableWidth = clientX - viewX - leftPadding;
|
|
1647
|
-
return clampTableWidth(width, nextTableWidth);
|
|
1648
|
-
};
|
|
1649
|
-
|
|
1650
1795
|
const createDefaultState = () => {
|
|
1651
1796
|
return {
|
|
1652
1797
|
assetDir: '',
|
|
1798
|
+
categoryFilters: [],
|
|
1653
1799
|
databaseName: 'lvce-chat-view-sessions',
|
|
1654
1800
|
dataBaseVersion: 2,
|
|
1801
|
+
detailTabs: [],
|
|
1655
1802
|
errorMessage: '',
|
|
1656
1803
|
eventCategoryFilter: All,
|
|
1657
|
-
eventCategoryFilterOptions: createEventCategoryFilterOptions(),
|
|
1658
1804
|
events: [],
|
|
1659
1805
|
eventStoreName: 'chat-view-events',
|
|
1660
1806
|
filterValue: '',
|
|
@@ -1670,6 +1816,8 @@ const createDefaultState = () => {
|
|
|
1670
1816
|
showEventStreamFinishedEvents: false,
|
|
1671
1817
|
showInputEvents: false,
|
|
1672
1818
|
showResponsePartEvents: false,
|
|
1819
|
+
tableColumnWidths: defaultTableColumnWidths,
|
|
1820
|
+
tableResizerDownId: 0,
|
|
1673
1821
|
tableWidth: defaultTableWidth,
|
|
1674
1822
|
timelineEndSeconds: '',
|
|
1675
1823
|
timelineSelectionActive: false,
|
|
@@ -1713,7 +1861,7 @@ const RenderCss = 2;
|
|
|
1713
1861
|
const RenderIncremental = 3;
|
|
1714
1862
|
|
|
1715
1863
|
const diff = (oldState, newState) => {
|
|
1716
|
-
if (oldState.errorMessage !== newState.errorMessage || oldState.eventCategoryFilter !== newState.eventCategoryFilter || oldState.events !== newState.events || oldState.filterValue !== newState.filterValue || oldState.sessionId !== newState.sessionId || oldState.showEventStreamFinishedEvents !== newState.showEventStreamFinishedEvents || oldState.showInputEvents !== newState.showInputEvents || oldState.showResponsePartEvents !== newState.showResponsePartEvents || oldState.tableWidth !== newState.tableWidth || oldState.timelineEndSeconds !== newState.timelineEndSeconds || oldState.timelineSelectionActive !== newState.timelineSelectionActive || oldState.timelineSelectionAnchorSeconds !== newState.timelineSelectionAnchorSeconds || oldState.timelineSelectionFocusSeconds !== newState.timelineSelectionFocusSeconds || oldState.timelineStartSeconds !== newState.timelineStartSeconds || oldState.useDevtoolsLayout !== newState.useDevtoolsLayout || oldState.visibleTableColumns !== newState.visibleTableColumns || oldState.selectedDetailTab !== newState.selectedDetailTab || oldState.selectedEvent !== newState.selectedEvent || oldState.selectedEventIndex !== newState.selectedEventIndex || oldState.width !== newState.width || oldState.uid !== newState.uid) {
|
|
1864
|
+
if (oldState.categoryFilters !== newState.categoryFilters || oldState.detailTabs !== newState.detailTabs || oldState.errorMessage !== newState.errorMessage || oldState.eventCategoryFilter !== newState.eventCategoryFilter || oldState.events !== newState.events || oldState.filterValue !== newState.filterValue || oldState.sessionId !== newState.sessionId || oldState.showEventStreamFinishedEvents !== newState.showEventStreamFinishedEvents || oldState.showInputEvents !== newState.showInputEvents || oldState.showResponsePartEvents !== newState.showResponsePartEvents || oldState.tableColumnWidths !== newState.tableColumnWidths || oldState.tableWidth !== newState.tableWidth || oldState.timelineEndSeconds !== newState.timelineEndSeconds || oldState.timelineSelectionActive !== newState.timelineSelectionActive || oldState.timelineSelectionAnchorSeconds !== newState.timelineSelectionAnchorSeconds || oldState.timelineSelectionFocusSeconds !== newState.timelineSelectionFocusSeconds || oldState.timelineStartSeconds !== newState.timelineStartSeconds || oldState.useDevtoolsLayout !== newState.useDevtoolsLayout || oldState.visibleTableColumns !== newState.visibleTableColumns || oldState.selectedDetailTab !== newState.selectedDetailTab || oldState.selectedEvent !== newState.selectedEvent || oldState.selectedEventIndex !== newState.selectedEventIndex || oldState.width !== newState.width || oldState.uid !== newState.uid) {
|
|
1717
1865
|
return [RenderIncremental, RenderCss];
|
|
1718
1866
|
}
|
|
1719
1867
|
return [];
|
|
@@ -1727,6 +1875,10 @@ const diff2 = uid => {
|
|
|
1727
1875
|
return diff(oldState, newState);
|
|
1728
1876
|
};
|
|
1729
1877
|
|
|
1878
|
+
const getColumnVisibilityFlags = (state, column) => {
|
|
1879
|
+
return isVisibleTableColumn(state.visibleTableColumns, column) ? Checked : Unchecked;
|
|
1880
|
+
};
|
|
1881
|
+
|
|
1730
1882
|
const MenuChatDebugTableHeader = 2189;
|
|
1731
1883
|
const handleHeaderContextMenu = async (state, eventX, eventY) => {
|
|
1732
1884
|
await showContextMenu2(state.uid, MenuChatDebugTableHeader, eventX, eventY, {
|
|
@@ -1735,6 +1887,90 @@ const handleHeaderContextMenu = async (state, eventX, eventY) => {
|
|
|
1735
1887
|
return state;
|
|
1736
1888
|
};
|
|
1737
1889
|
|
|
1890
|
+
const toTimeNumber = value => {
|
|
1891
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
1892
|
+
return value;
|
|
1893
|
+
}
|
|
1894
|
+
if (typeof value === 'string') {
|
|
1895
|
+
const timestamp = Date.parse(value);
|
|
1896
|
+
if (!Number.isNaN(timestamp)) {
|
|
1897
|
+
return timestamp;
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
return undefined;
|
|
1901
|
+
};
|
|
1902
|
+
|
|
1903
|
+
const getEventTime = event => {
|
|
1904
|
+
return toTimeNumber(event.started ?? event.startTime ?? event.startTimestamp ?? event.timestamp);
|
|
1905
|
+
};
|
|
1906
|
+
|
|
1907
|
+
const getEventsWithTime = events => {
|
|
1908
|
+
return events.flatMap(event => {
|
|
1909
|
+
const time = getEventTime(event);
|
|
1910
|
+
if (time === undefined) {
|
|
1911
|
+
return [];
|
|
1912
|
+
}
|
|
1913
|
+
return [{
|
|
1914
|
+
event,
|
|
1915
|
+
time
|
|
1916
|
+
}];
|
|
1917
|
+
});
|
|
1918
|
+
};
|
|
1919
|
+
|
|
1920
|
+
const parseTimelineSeconds = value => {
|
|
1921
|
+
const trimmed = value.trim();
|
|
1922
|
+
if (!trimmed) {
|
|
1923
|
+
return undefined;
|
|
1924
|
+
}
|
|
1925
|
+
const parsed = Number.parseFloat(trimmed);
|
|
1926
|
+
if (!Number.isFinite(parsed) || parsed < 0) {
|
|
1927
|
+
return undefined;
|
|
1928
|
+
}
|
|
1929
|
+
return parsed;
|
|
1930
|
+
};
|
|
1931
|
+
|
|
1932
|
+
const roundSeconds = value => {
|
|
1933
|
+
return Number(value.toFixed(3));
|
|
1934
|
+
};
|
|
1935
|
+
|
|
1936
|
+
const getNormalizedRange = (durationSeconds, startValue, endValue) => {
|
|
1937
|
+
const parsedStart = parseTimelineSeconds(startValue);
|
|
1938
|
+
const parsedEnd = parseTimelineSeconds(endValue);
|
|
1939
|
+
if (parsedStart === undefined && parsedEnd === undefined) {
|
|
1940
|
+
return {
|
|
1941
|
+
endSeconds: null,
|
|
1942
|
+
hasSelection: false,
|
|
1943
|
+
startSeconds: null
|
|
1944
|
+
};
|
|
1945
|
+
}
|
|
1946
|
+
const rawStart = parsedStart ?? 0;
|
|
1947
|
+
const rawEnd = parsedEnd ?? durationSeconds;
|
|
1948
|
+
const normalizedStart = Math.max(0, Math.min(durationSeconds, Math.min(rawStart, rawEnd)));
|
|
1949
|
+
const normalizedEnd = Math.max(0, Math.min(durationSeconds, Math.max(rawStart, rawEnd)));
|
|
1950
|
+
return {
|
|
1951
|
+
endSeconds: roundSeconds(normalizedEnd),
|
|
1952
|
+
hasSelection: true,
|
|
1953
|
+
startSeconds: roundSeconds(normalizedStart)
|
|
1954
|
+
};
|
|
1955
|
+
};
|
|
1956
|
+
|
|
1957
|
+
const filterEventsByTimelineRange = (events, startValue, endValue) => {
|
|
1958
|
+
const eventsWithTime = getEventsWithTime(events);
|
|
1959
|
+
if (eventsWithTime.length === 0) {
|
|
1960
|
+
return events;
|
|
1961
|
+
}
|
|
1962
|
+
const baseTime = eventsWithTime[0].time;
|
|
1963
|
+
const lastTime = eventsWithTime.at(-1)?.time ?? baseTime;
|
|
1964
|
+
const durationSeconds = roundSeconds(Math.max(0, lastTime - baseTime) / 1000);
|
|
1965
|
+
const range = getNormalizedRange(durationSeconds, startValue, endValue);
|
|
1966
|
+
if (!range.hasSelection || range.startSeconds === null || range.endSeconds === null) {
|
|
1967
|
+
return events;
|
|
1968
|
+
}
|
|
1969
|
+
const startTime = baseTime + range.startSeconds * 1000;
|
|
1970
|
+
const endTime = baseTime + range.endSeconds * 1000;
|
|
1971
|
+
return eventsWithTime.filter(item => item.time >= startTime && item.time <= endTime).map(item => item.event);
|
|
1972
|
+
};
|
|
1973
|
+
|
|
1738
1974
|
const hasMatchingToolName = (startedEvent, finishedEvent) => {
|
|
1739
1975
|
if (typeof startedEvent.toolName === 'string' && typeof finishedEvent.toolName === 'string') {
|
|
1740
1976
|
return startedEvent.toolName === finishedEvent.toolName;
|
|
@@ -1877,162 +2113,18 @@ const getFilteredEvents = (events, filterValue, eventCategoryFilter, showInputEv
|
|
|
1877
2113
|
return filteredByCategory.filter(event => JSON.stringify(event).toLowerCase().includes(filterText));
|
|
1878
2114
|
};
|
|
1879
2115
|
|
|
1880
|
-
const
|
|
1881
|
-
|
|
1882
|
-
return value;
|
|
1883
|
-
}
|
|
1884
|
-
if (typeof value === 'string') {
|
|
1885
|
-
const timestamp = Date.parse(value);
|
|
1886
|
-
if (!Number.isNaN(timestamp)) {
|
|
1887
|
-
return timestamp;
|
|
1888
|
-
}
|
|
1889
|
-
}
|
|
1890
|
-
return undefined;
|
|
1891
|
-
};
|
|
1892
|
-
|
|
1893
|
-
const getEventTime = event => {
|
|
1894
|
-
return toTimeNumber(event.started ?? event.startTime ?? event.startTimestamp ?? event.timestamp);
|
|
2116
|
+
const loadSelectedEvent = async (_databaseName, _dataBaseVersion, _eventStoreName, sessionId, _sessionIdIndexName, eventId, type) => {
|
|
2117
|
+
return loadSelectedEvent$1(sessionId, eventId, type);
|
|
1895
2118
|
};
|
|
1896
2119
|
|
|
1897
|
-
const
|
|
1898
|
-
|
|
1899
|
-
const trimmed = value.trim();
|
|
1900
|
-
if (!trimmed) {
|
|
1901
|
-
return undefined;
|
|
1902
|
-
}
|
|
1903
|
-
const parsed = Number.parseFloat(trimmed);
|
|
1904
|
-
if (!Number.isFinite(parsed) || parsed < 0) {
|
|
1905
|
-
return undefined;
|
|
1906
|
-
}
|
|
1907
|
-
return parsed;
|
|
1908
|
-
};
|
|
1909
|
-
const roundSeconds = value => {
|
|
1910
|
-
return Number(value.toFixed(3));
|
|
1911
|
-
};
|
|
1912
|
-
const getEventsWithTime = events => {
|
|
1913
|
-
return events.flatMap(event => {
|
|
1914
|
-
const time = getEventTime(event);
|
|
1915
|
-
if (time === undefined) {
|
|
1916
|
-
return [];
|
|
1917
|
-
}
|
|
1918
|
-
return [{
|
|
1919
|
-
event,
|
|
1920
|
-
time
|
|
1921
|
-
}];
|
|
1922
|
-
});
|
|
1923
|
-
};
|
|
1924
|
-
const getTimelineDurationSeconds = events => {
|
|
1925
|
-
const eventsWithTime = getEventsWithTime(events);
|
|
1926
|
-
if (eventsWithTime.length === 0) {
|
|
1927
|
-
return 0;
|
|
1928
|
-
}
|
|
1929
|
-
const baseTime = eventsWithTime[0].time;
|
|
1930
|
-
const lastTime = eventsWithTime.at(-1)?.time ?? baseTime;
|
|
1931
|
-
return roundSeconds(Math.max(0, lastTime - baseTime) / 1000);
|
|
1932
|
-
};
|
|
1933
|
-
const getSelectionPercent = (value, durationSeconds) => {
|
|
1934
|
-
if (durationSeconds <= 0) {
|
|
1935
|
-
return 0;
|
|
1936
|
-
}
|
|
1937
|
-
return Number((value / durationSeconds * 100).toFixed(3));
|
|
1938
|
-
};
|
|
1939
|
-
const getNormalizedRange = (durationSeconds, startValue, endValue) => {
|
|
1940
|
-
const parsedStart = parseTimelineSeconds(startValue);
|
|
1941
|
-
const parsedEnd = parseTimelineSeconds(endValue);
|
|
1942
|
-
if (parsedStart === undefined && parsedEnd === undefined) {
|
|
1943
|
-
return {
|
|
1944
|
-
endSeconds: null,
|
|
1945
|
-
hasSelection: false,
|
|
1946
|
-
startSeconds: null
|
|
1947
|
-
};
|
|
1948
|
-
}
|
|
1949
|
-
const rawStart = parsedStart ?? 0;
|
|
1950
|
-
const rawEnd = parsedEnd ?? durationSeconds;
|
|
1951
|
-
const normalizedStart = Math.max(0, Math.min(durationSeconds, Math.min(rawStart, rawEnd)));
|
|
1952
|
-
const normalizedEnd = Math.max(0, Math.min(durationSeconds, Math.max(rawStart, rawEnd)));
|
|
1953
|
-
return {
|
|
1954
|
-
endSeconds: roundSeconds(normalizedEnd),
|
|
1955
|
-
hasSelection: true,
|
|
1956
|
-
startSeconds: roundSeconds(normalizedStart)
|
|
1957
|
-
};
|
|
1958
|
-
};
|
|
1959
|
-
const filterEventsByTimelineRange = (events, startValue, endValue) => {
|
|
1960
|
-
const eventsWithTime = getEventsWithTime(events);
|
|
1961
|
-
if (eventsWithTime.length === 0) {
|
|
1962
|
-
return events;
|
|
1963
|
-
}
|
|
1964
|
-
const baseTime = eventsWithTime[0].time;
|
|
1965
|
-
const lastTime = eventsWithTime.at(-1)?.time ?? baseTime;
|
|
1966
|
-
const durationSeconds = roundSeconds(Math.max(0, lastTime - baseTime) / 1000);
|
|
1967
|
-
const range = getNormalizedRange(durationSeconds, startValue, endValue);
|
|
1968
|
-
if (!range.hasSelection || range.startSeconds === null || range.endSeconds === null) {
|
|
1969
|
-
return events;
|
|
1970
|
-
}
|
|
1971
|
-
const startTime = baseTime + range.startSeconds * 1000;
|
|
1972
|
-
const endTime = baseTime + range.endSeconds * 1000;
|
|
1973
|
-
return eventsWithTime.filter(item => item.time >= startTime && item.time <= endTime).map(item => item.event);
|
|
1974
|
-
};
|
|
1975
|
-
const getTimelineInfo = (events, startValue, endValue) => {
|
|
1976
|
-
const eventsWithTime = getEventsWithTime(events);
|
|
1977
|
-
if (eventsWithTime.length === 0) {
|
|
1978
|
-
return {
|
|
1979
|
-
buckets: [],
|
|
1980
|
-
durationSeconds: 0,
|
|
1981
|
-
endSeconds: null,
|
|
1982
|
-
hasSelection: false,
|
|
1983
|
-
selectionEndPercent: null,
|
|
1984
|
-
selectionStartPercent: null,
|
|
1985
|
-
startSeconds: null
|
|
1986
|
-
};
|
|
1987
|
-
}
|
|
1988
|
-
const baseTime = eventsWithTime[0].time;
|
|
1989
|
-
const lastTime = eventsWithTime.at(-1)?.time ?? baseTime;
|
|
1990
|
-
const durationMs = Math.max(0, lastTime - baseTime);
|
|
1991
|
-
const durationSeconds = roundSeconds(durationMs / 1000);
|
|
1992
|
-
const range = getNormalizedRange(durationSeconds, startValue, endValue);
|
|
1993
|
-
const bucketCount = durationSeconds === 0 ? 1 : Math.max(12, Math.min(48, Math.ceil(durationSeconds)));
|
|
1994
|
-
const bucketDurationMs = durationMs === 0 ? 1000 : durationMs / bucketCount;
|
|
1995
|
-
const counts = Array.from({
|
|
1996
|
-
length: bucketCount
|
|
1997
|
-
}).fill(0);
|
|
1998
|
-
for (const item of eventsWithTime) {
|
|
1999
|
-
const offsetMs = item.time - baseTime;
|
|
2000
|
-
const index = durationMs === 0 ? 0 : Math.min(bucketCount - 1, Math.floor(offsetMs / durationMs * bucketCount));
|
|
2001
|
-
counts[index] += 1;
|
|
2002
|
-
}
|
|
2003
|
-
const maxCount = Math.max(...counts);
|
|
2004
|
-
const selectionStartPercent = range.hasSelection && range.startSeconds !== null ? getSelectionPercent(range.startSeconds, durationSeconds) : null;
|
|
2005
|
-
const selectionEndPercent = range.hasSelection && range.endSeconds !== null ? getSelectionPercent(range.endSeconds, durationSeconds) : null;
|
|
2006
|
-
const buckets = counts.map((count, index) => {
|
|
2007
|
-
const bucketStartMs = index * bucketDurationMs;
|
|
2008
|
-
const bucketEndMs = index === bucketCount - 1 ? durationMs : (index + 1) * bucketDurationMs;
|
|
2009
|
-
const hasSelection = range.hasSelection && range.startSeconds !== null && range.endSeconds !== null;
|
|
2010
|
-
const selectionStartMs = hasSelection ? range.startSeconds * 1000 : 0;
|
|
2011
|
-
const selectionEndMs = hasSelection ? range.endSeconds * 1000 : 0;
|
|
2012
|
-
return {
|
|
2013
|
-
count,
|
|
2014
|
-
endSeconds: roundSeconds(bucketEndMs / 1000),
|
|
2015
|
-
isSelected: hasSelection && bucketEndMs >= selectionStartMs && bucketStartMs <= selectionEndMs,
|
|
2016
|
-
startSeconds: roundSeconds(bucketStartMs / 1000),
|
|
2017
|
-
unitCount: count === 0 ? 0 : Math.max(1, Math.round(count / maxCount * maxBarUnits))
|
|
2018
|
-
};
|
|
2019
|
-
});
|
|
2020
|
-
return {
|
|
2021
|
-
buckets,
|
|
2022
|
-
durationSeconds,
|
|
2023
|
-
endSeconds: range.endSeconds,
|
|
2024
|
-
hasSelection: range.hasSelection,
|
|
2025
|
-
selectionEndPercent,
|
|
2026
|
-
selectionStartPercent,
|
|
2027
|
-
startSeconds: range.startSeconds
|
|
2028
|
-
};
|
|
2120
|
+
const selectEventAtIndexDependencies = {
|
|
2121
|
+
loadSelectedEvent: loadSelectedEvent
|
|
2029
2122
|
};
|
|
2030
|
-
|
|
2031
2123
|
const getCurrentEvents$3 = state => {
|
|
2032
2124
|
const filteredEvents = getFilteredEvents(state.events, state.filterValue, state.eventCategoryFilter, state.showInputEvents, state.showResponsePartEvents, state.showEventStreamFinishedEvents);
|
|
2033
2125
|
return filterEventsByTimelineRange(filteredEvents, state.timelineStartSeconds, state.timelineEndSeconds);
|
|
2034
2126
|
};
|
|
2035
|
-
const selectEventAtIndex = async (state, selectedEventIndex, dependencies) => {
|
|
2127
|
+
const selectEventAtIndex = async (state, selectedEventIndex, dependencies = selectEventAtIndexDependencies) => {
|
|
2036
2128
|
const currentEvents = getCurrentEvents$3(state);
|
|
2037
2129
|
const selectedEvent = currentEvents[selectedEventIndex];
|
|
2038
2130
|
if (!selectedEvent) {
|
|
@@ -2102,9 +2194,6 @@ const handleTableBodyContextMenu = async (state, eventX, eventY) => {
|
|
|
2102
2194
|
return state;
|
|
2103
2195
|
};
|
|
2104
2196
|
|
|
2105
|
-
const getColumnVisibilityFlags = (state, column) => {
|
|
2106
|
-
return isVisibleTableColumn(state.visibleTableColumns, column) ? Checked : Unchecked;
|
|
2107
|
-
};
|
|
2108
2197
|
const getMenuEntries2 = (state, props) => {
|
|
2109
2198
|
if (props.menuId === MenuChatDebugTableHeader) {
|
|
2110
2199
|
return [{
|
|
@@ -2119,80 +2208,39 @@ const getMenuEntries2 = (state, props) => {
|
|
|
2119
2208
|
flags: getColumnVisibilityFlags(state, Duration),
|
|
2120
2209
|
id: 'duration',
|
|
2121
2210
|
label: duration()
|
|
2122
|
-
}, {
|
|
2123
|
-
args: [Status],
|
|
2124
|
-
command: 'ChatDebug.toggleTableColumnVisibility',
|
|
2125
|
-
flags: getColumnVisibilityFlags(state, Status),
|
|
2126
|
-
id: 'status',
|
|
2127
|
-
label: status()
|
|
2128
|
-
}, {
|
|
2129
|
-
args: [],
|
|
2130
|
-
command: 'ChatDebug.resetTableColumns',
|
|
2131
|
-
flags: None,
|
|
2132
|
-
id: 'reset-columns',
|
|
2133
|
-
label: resetColumns()
|
|
2134
|
-
}];
|
|
2135
|
-
}
|
|
2136
|
-
if (props.menuId === MenuChatDebugTableBody) {
|
|
2137
|
-
return [{
|
|
2138
|
-
args: [],
|
|
2139
|
-
command: 'ChatDebug.copy',
|
|
2140
|
-
flags: None,
|
|
2141
|
-
id: 'copy',
|
|
2142
|
-
label: copy()
|
|
2143
|
-
}];
|
|
2144
|
-
}
|
|
2145
|
-
return [];
|
|
2146
|
-
};
|
|
2147
|
-
|
|
2148
|
-
const getMenuIds = () => {
|
|
2149
|
-
return [MenuChatDebugTableHeader, MenuChatDebugTableBody, 556, 557];
|
|
2150
|
-
};
|
|
2151
|
-
|
|
2152
|
-
const getErrorMessage = error => {
|
|
2153
|
-
if (error instanceof Error) {
|
|
2154
|
-
return error.message;
|
|
2155
|
-
}
|
|
2156
|
-
if (typeof error === 'string') {
|
|
2157
|
-
return error;
|
|
2158
|
-
}
|
|
2159
|
-
if (error && typeof error === 'object' && 'message' in error && typeof error.message === 'string') {
|
|
2160
|
-
return error.message;
|
|
2161
|
-
}
|
|
2162
|
-
return undefined;
|
|
2163
|
-
};
|
|
2164
|
-
const getFailedToLoadMessage = (sessionId, error) => {
|
|
2165
|
-
const errorMessage = getErrorMessage(error);
|
|
2166
|
-
if (errorMessage) {
|
|
2167
|
-
return failedToLoadChatDebugSessionWithError(sessionId, errorMessage);
|
|
2211
|
+
}, {
|
|
2212
|
+
args: [Status],
|
|
2213
|
+
command: 'ChatDebug.toggleTableColumnVisibility',
|
|
2214
|
+
flags: getColumnVisibilityFlags(state, Status),
|
|
2215
|
+
id: 'status',
|
|
2216
|
+
label: status()
|
|
2217
|
+
}, {
|
|
2218
|
+
args: [],
|
|
2219
|
+
command: 'ChatDebug.resetTableColumns',
|
|
2220
|
+
flags: None$1,
|
|
2221
|
+
id: 'reset-columns',
|
|
2222
|
+
label: resetColumns()
|
|
2223
|
+
}];
|
|
2168
2224
|
}
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
};
|
|
2178
|
-
|
|
2179
|
-
const getInvalidUriMessage = (uri, code) => {
|
|
2180
|
-
if (code === ParseChatDebugUriErrorCode.MissingUri) {
|
|
2181
|
-
return unableToLoadDebugSessionMissingUri();
|
|
2225
|
+
if (props.menuId === MenuChatDebugTableBody) {
|
|
2226
|
+
return [{
|
|
2227
|
+
args: [props.eventIndex],
|
|
2228
|
+
command: 'ChatDebug.handleTableRowCopy',
|
|
2229
|
+
flags: None$1,
|
|
2230
|
+
id: 'copy',
|
|
2231
|
+
label: copy()
|
|
2232
|
+
}];
|
|
2182
2233
|
}
|
|
2183
|
-
return
|
|
2234
|
+
return [];
|
|
2184
2235
|
};
|
|
2185
2236
|
|
|
2186
|
-
const
|
|
2187
|
-
return
|
|
2237
|
+
const getMenuIds = () => {
|
|
2238
|
+
return [MenuChatDebugTableHeader, MenuChatDebugTableBody, 556, 557];
|
|
2188
2239
|
};
|
|
2189
2240
|
|
|
2190
|
-
const listChatViewEventsDependencies = {
|
|
2191
|
-
listChatViewEventsFromWorker: listChatViewEvents$1
|
|
2192
|
-
};
|
|
2193
2241
|
const listChatViewEvents = async (sessionId, _databaseName, _dataBaseVersion, _eventStoreName, _sessionIdIndexName) => {
|
|
2194
2242
|
try {
|
|
2195
|
-
return await
|
|
2243
|
+
return await listChatViewEvents$1(sessionId);
|
|
2196
2244
|
} catch (error) {
|
|
2197
2245
|
return {
|
|
2198
2246
|
error,
|
|
@@ -2201,11 +2249,21 @@ const listChatViewEvents = async (sessionId, _databaseName, _dataBaseVersion, _e
|
|
|
2201
2249
|
}
|
|
2202
2250
|
};
|
|
2203
2251
|
|
|
2204
|
-
const
|
|
2205
|
-
|
|
2252
|
+
const loadEventsDependencies = {
|
|
2253
|
+
listChatViewEvents: listChatViewEvents,
|
|
2254
|
+
loadSelectedEvent: loadSelectedEvent
|
|
2255
|
+
};
|
|
2256
|
+
|
|
2257
|
+
const ParseChatDebugUriErrorCode = {
|
|
2258
|
+
InvalidSessionId: 'invalid-session-id',
|
|
2259
|
+
InvalidUriEncoding: 'invalid-uri-encoding',
|
|
2260
|
+
InvalidUriFormat: 'invalid-uri-format',
|
|
2261
|
+
MissingUri: 'missing-uri'
|
|
2206
2262
|
};
|
|
2207
|
-
|
|
2208
|
-
|
|
2263
|
+
|
|
2264
|
+
const ParseChatDebugUriResultType = {
|
|
2265
|
+
Error: 2,
|
|
2266
|
+
Success: 1
|
|
2209
2267
|
};
|
|
2210
2268
|
|
|
2211
2269
|
const chatDebugUriPattern = /^chat-debug:\/\/([^/?#]+)$/;
|
|
@@ -2215,7 +2273,7 @@ const parseChatDebugUri = uri => {
|
|
|
2215
2273
|
return {
|
|
2216
2274
|
code: ParseChatDebugUriErrorCode.MissingUri,
|
|
2217
2275
|
message: missingUri(),
|
|
2218
|
-
type:
|
|
2276
|
+
type: ParseChatDebugUriResultType.Error
|
|
2219
2277
|
};
|
|
2220
2278
|
}
|
|
2221
2279
|
const match = uri.match(chatDebugUriPattern);
|
|
@@ -2223,7 +2281,7 @@ const parseChatDebugUri = uri => {
|
|
|
2223
2281
|
return {
|
|
2224
2282
|
code: ParseChatDebugUriErrorCode.InvalidUriFormat,
|
|
2225
2283
|
message: invalidUriFormat(),
|
|
2226
|
-
type:
|
|
2284
|
+
type: ParseChatDebugUriResultType.Error
|
|
2227
2285
|
};
|
|
2228
2286
|
}
|
|
2229
2287
|
const encodedSessionId = match[1];
|
|
@@ -2234,30 +2292,83 @@ const parseChatDebugUri = uri => {
|
|
|
2234
2292
|
return {
|
|
2235
2293
|
code: ParseChatDebugUriErrorCode.InvalidUriEncoding,
|
|
2236
2294
|
message: invalidUriEncoding(),
|
|
2237
|
-
type:
|
|
2295
|
+
type: ParseChatDebugUriResultType.Error
|
|
2238
2296
|
};
|
|
2239
2297
|
}
|
|
2240
2298
|
if (!sessionId || invalidSessionIdPattern.test(sessionId)) {
|
|
2241
2299
|
return {
|
|
2242
2300
|
code: ParseChatDebugUriErrorCode.InvalidSessionId,
|
|
2243
2301
|
message: invalidSessionId(),
|
|
2244
|
-
type:
|
|
2302
|
+
type: ParseChatDebugUriResultType.Error
|
|
2245
2303
|
};
|
|
2246
2304
|
}
|
|
2247
2305
|
return {
|
|
2248
2306
|
sessionId,
|
|
2249
|
-
type:
|
|
2307
|
+
type: ParseChatDebugUriResultType.Success
|
|
2250
2308
|
};
|
|
2251
2309
|
};
|
|
2252
2310
|
|
|
2253
|
-
const
|
|
2254
|
-
|
|
2255
|
-
|
|
2311
|
+
const getSessionIdFromUri = state => {
|
|
2312
|
+
const parsed = parseChatDebugUri(state.uri);
|
|
2313
|
+
if (parsed.type === ParseChatDebugUriResultType.Error) {
|
|
2314
|
+
return undefined;
|
|
2315
|
+
}
|
|
2316
|
+
return parsed.sessionId;
|
|
2317
|
+
};
|
|
2318
|
+
|
|
2319
|
+
const getInvalidUriMessage = (uri, code) => {
|
|
2320
|
+
if (code === ParseChatDebugUriErrorCode.MissingUri) {
|
|
2321
|
+
return unableToLoadDebugSessionMissingUri();
|
|
2322
|
+
}
|
|
2323
|
+
return unableToLoadDebugSessionInvalidUri(uri);
|
|
2324
|
+
};
|
|
2325
|
+
|
|
2326
|
+
const getStateWithInvalidUri = state => {
|
|
2327
|
+
const parsed = parseChatDebugUri(state.uri);
|
|
2328
|
+
if (parsed.type !== ParseChatDebugUriResultType.Error) {
|
|
2329
|
+
return state;
|
|
2330
|
+
}
|
|
2331
|
+
return {
|
|
2332
|
+
...state,
|
|
2333
|
+
errorMessage: getInvalidUriMessage(state.uri, parsed.code),
|
|
2334
|
+
events: [],
|
|
2335
|
+
initial: false,
|
|
2336
|
+
selectedEvent: null,
|
|
2337
|
+
selectedEventId: null,
|
|
2338
|
+
selectedEventIndex: null,
|
|
2339
|
+
sessionId: ''
|
|
2340
|
+
};
|
|
2341
|
+
};
|
|
2342
|
+
|
|
2343
|
+
const getErrorMessage = error => {
|
|
2344
|
+
if (error instanceof Error) {
|
|
2345
|
+
return error.message;
|
|
2346
|
+
}
|
|
2347
|
+
if (typeof error === 'string') {
|
|
2348
|
+
return error;
|
|
2349
|
+
}
|
|
2350
|
+
if (error && typeof error === 'object' && 'message' in error && typeof error.message === 'string') {
|
|
2351
|
+
return error.message;
|
|
2352
|
+
}
|
|
2353
|
+
return undefined;
|
|
2354
|
+
};
|
|
2355
|
+
const getFailedToLoadMessage = (sessionId, error) => {
|
|
2356
|
+
const errorMessage = getErrorMessage(error);
|
|
2357
|
+
if (errorMessage) {
|
|
2358
|
+
return failedToLoadChatDebugSessionWithError(sessionId, errorMessage);
|
|
2359
|
+
}
|
|
2360
|
+
return failedToLoadChatDebugSession(sessionId);
|
|
2256
2361
|
};
|
|
2362
|
+
|
|
2363
|
+
const getSessionNotFoundMessage = sessionId => {
|
|
2364
|
+
return noChatSessionFound(sessionId);
|
|
2365
|
+
};
|
|
2366
|
+
|
|
2257
2367
|
const getCurrentEvents$2 = state => {
|
|
2258
2368
|
const filteredEvents = getFilteredEvents(state.events, state.filterValue, state.eventCategoryFilter, state.showInputEvents, state.showResponsePartEvents, state.showEventStreamFinishedEvents);
|
|
2259
2369
|
return filterEventsByTimelineRange(filteredEvents, state.timelineStartSeconds, state.timelineEndSeconds);
|
|
2260
2370
|
};
|
|
2371
|
+
|
|
2261
2372
|
const restoreSelectedEvent = async state => {
|
|
2262
2373
|
if (state.selectedEventId === null) {
|
|
2263
2374
|
return {
|
|
@@ -2293,29 +2404,7 @@ const restoreSelectedEvent = async state => {
|
|
|
2293
2404
|
selectedEventIndex
|
|
2294
2405
|
};
|
|
2295
2406
|
};
|
|
2296
|
-
|
|
2297
|
-
const parsed = parseChatDebugUri(state.uri);
|
|
2298
|
-
if (parsed.type !== 'error') {
|
|
2299
|
-
return state;
|
|
2300
|
-
}
|
|
2301
|
-
return {
|
|
2302
|
-
...state,
|
|
2303
|
-
errorMessage: getInvalidUriMessage(state.uri, parsed.code),
|
|
2304
|
-
events: [],
|
|
2305
|
-
initial: false,
|
|
2306
|
-
selectedEvent: null,
|
|
2307
|
-
selectedEventId: null,
|
|
2308
|
-
selectedEventIndex: null,
|
|
2309
|
-
sessionId: ''
|
|
2310
|
-
};
|
|
2311
|
-
};
|
|
2312
|
-
const getSessionIdFromUri = state => {
|
|
2313
|
-
const parsed = parseChatDebugUri(state.uri);
|
|
2314
|
-
if (parsed.type === 'error') {
|
|
2315
|
-
return undefined;
|
|
2316
|
-
}
|
|
2317
|
-
return parsed.sessionId;
|
|
2318
|
-
};
|
|
2407
|
+
|
|
2319
2408
|
const loadEventsForSessionId = async (state, sessionId) => {
|
|
2320
2409
|
const {
|
|
2321
2410
|
databaseName,
|
|
@@ -2360,6 +2449,7 @@ const loadEventsForSessionId = async (state, sessionId) => {
|
|
|
2360
2449
|
};
|
|
2361
2450
|
return restoreSelectedEvent(nextState);
|
|
2362
2451
|
};
|
|
2452
|
+
|
|
2363
2453
|
const loadEventsFromUri = async state => {
|
|
2364
2454
|
const sessionId = getSessionIdFromUri(state);
|
|
2365
2455
|
if (!sessionId) {
|
|
@@ -2367,6 +2457,7 @@ const loadEventsFromUri = async state => {
|
|
|
2367
2457
|
}
|
|
2368
2458
|
return loadEventsForSessionId(state, sessionId);
|
|
2369
2459
|
};
|
|
2460
|
+
|
|
2370
2461
|
const refreshEvents = async state => {
|
|
2371
2462
|
const sessionId = state.sessionId || getSessionIdFromUri(state);
|
|
2372
2463
|
if (!sessionId) {
|
|
@@ -2403,7 +2494,7 @@ const handleDetailsTopContextMenu = state => {
|
|
|
2403
2494
|
return state;
|
|
2404
2495
|
};
|
|
2405
2496
|
|
|
2406
|
-
const
|
|
2497
|
+
const selectDetailTab = (state, value) => {
|
|
2407
2498
|
if (!isDetailTab(value)) {
|
|
2408
2499
|
return state;
|
|
2409
2500
|
}
|
|
@@ -2417,9 +2508,11 @@ const getCurrentEvents$1 = state => {
|
|
|
2417
2508
|
const filteredEvents = getFilteredEvents(state.events, state.filterValue, state.eventCategoryFilter, state.showInputEvents, state.showResponsePartEvents, state.showEventStreamFinishedEvents);
|
|
2418
2509
|
return filterEventsByTimelineRange(filteredEvents, state.timelineStartSeconds, state.timelineEndSeconds);
|
|
2419
2510
|
};
|
|
2511
|
+
|
|
2420
2512
|
const getEventIndexByStableId$1 = (events, event) => {
|
|
2421
2513
|
return events.findIndex(candidate => candidate.eventId === event.eventId);
|
|
2422
2514
|
};
|
|
2515
|
+
|
|
2423
2516
|
const getSelectedEventIndex$1 = state => {
|
|
2424
2517
|
const {
|
|
2425
2518
|
selectedEventIndex
|
|
@@ -2438,6 +2531,7 @@ const getSelectedEventIndex$1 = state => {
|
|
|
2438
2531
|
}
|
|
2439
2532
|
return newIndex;
|
|
2440
2533
|
};
|
|
2534
|
+
|
|
2441
2535
|
const getPreservedSelectedEventIndex$1 = (oldState, newState) => {
|
|
2442
2536
|
const {
|
|
2443
2537
|
selectedEventIndex
|
|
@@ -2457,6 +2551,7 @@ const getPreservedSelectedEventIndex$1 = (oldState, newState) => {
|
|
|
2457
2551
|
}
|
|
2458
2552
|
return newIndex;
|
|
2459
2553
|
};
|
|
2554
|
+
|
|
2460
2555
|
const withPreservedSelection$1 = (state, nextState) => {
|
|
2461
2556
|
const selectedEventIndex = getPreservedSelectedEventIndex$1(state, nextState);
|
|
2462
2557
|
return {
|
|
@@ -2475,12 +2570,6 @@ const handleEventCategoryFilter = (state, value) => {
|
|
|
2475
2570
|
return withPreservedSelection$1(state, nextState);
|
|
2476
2571
|
};
|
|
2477
2572
|
|
|
2478
|
-
const handleEventRowClickDependencies = {
|
|
2479
|
-
loadSelectedEvent: loadSelectedEvent
|
|
2480
|
-
};
|
|
2481
|
-
const isPrimaryButton = button => {
|
|
2482
|
-
return button === 0;
|
|
2483
|
-
};
|
|
2484
2573
|
const parseSelectedEventIndex$1 = value => {
|
|
2485
2574
|
const parsed = Number.parseInt(value, 10);
|
|
2486
2575
|
if (Number.isNaN(parsed) || parsed < 0) {
|
|
@@ -2488,6 +2577,13 @@ const parseSelectedEventIndex$1 = value => {
|
|
|
2488
2577
|
}
|
|
2489
2578
|
return parsed;
|
|
2490
2579
|
};
|
|
2580
|
+
|
|
2581
|
+
const handleEventRowClickDependencies = {
|
|
2582
|
+
loadSelectedEvent: loadSelectedEvent
|
|
2583
|
+
};
|
|
2584
|
+
const isPrimaryButton = button => {
|
|
2585
|
+
return button === 0;
|
|
2586
|
+
};
|
|
2491
2587
|
const handleEventRowClick = async (state, value, button = 0) => {
|
|
2492
2588
|
if (!isPrimaryButton(button)) {
|
|
2493
2589
|
return state;
|
|
@@ -2503,20 +2599,6 @@ const getBoolean = value => {
|
|
|
2503
2599
|
return value === true || value === 'true' || value === 'on' || value === '1';
|
|
2504
2600
|
};
|
|
2505
2601
|
|
|
2506
|
-
const Filter = 'filter';
|
|
2507
|
-
const EventCategoryFilter = 'eventCategoryFilter';
|
|
2508
|
-
const ShowEventStreamFinishedEvents = 'showEventStreamFinishedEvents';
|
|
2509
|
-
const ShowInputEvents = 'showInputEvents';
|
|
2510
|
-
const ShowResponsePartEvents = 'showResponsePartEvents';
|
|
2511
|
-
const UseDevtoolsLayout = 'useDevtoolsLayout';
|
|
2512
|
-
const SelectedEventIndex = 'selectedEventIndex';
|
|
2513
|
-
const CloseDetails = 'closeDetails';
|
|
2514
|
-
const DetailTab = 'detailTab';
|
|
2515
|
-
const TimelineStartSeconds = 'timelineStartSeconds';
|
|
2516
|
-
const TimelineEndSeconds = 'timelineEndSeconds';
|
|
2517
|
-
const TimelineRangePreset = 'timelineRangePreset';
|
|
2518
|
-
const Refresh = 'refresh';
|
|
2519
|
-
|
|
2520
2602
|
const getCurrentEvents = state => {
|
|
2521
2603
|
const filteredEvents = getFilteredEvents(state.events, state.filterValue, state.eventCategoryFilter, state.showInputEvents, state.showResponsePartEvents, state.showEventStreamFinishedEvents);
|
|
2522
2604
|
return filterEventsByTimelineRange(filteredEvents, state.timelineStartSeconds, state.timelineEndSeconds);
|
|
@@ -2702,6 +2784,54 @@ const handleSashPointerUp = (state, eventX, eventY) => {
|
|
|
2702
2784
|
return state;
|
|
2703
2785
|
};
|
|
2704
2786
|
|
|
2787
|
+
const getTableResizerId = name => {
|
|
2788
|
+
switch (name) {
|
|
2789
|
+
case 'ResizerOne':
|
|
2790
|
+
return 1;
|
|
2791
|
+
case 'ResizerTwo':
|
|
2792
|
+
return 2;
|
|
2793
|
+
default:
|
|
2794
|
+
return 0;
|
|
2795
|
+
}
|
|
2796
|
+
};
|
|
2797
|
+
const handleTableResizerPointerDown = (state, name, clientX) => {
|
|
2798
|
+
return {
|
|
2799
|
+
...state,
|
|
2800
|
+
tableResizerDownId: getTableResizerId(name)
|
|
2801
|
+
};
|
|
2802
|
+
};
|
|
2803
|
+
|
|
2804
|
+
const handleTableResizerPointerMove = (state, clientX) => {
|
|
2805
|
+
if (!state.tableResizerDownId) {
|
|
2806
|
+
return state;
|
|
2807
|
+
}
|
|
2808
|
+
return {
|
|
2809
|
+
...state,
|
|
2810
|
+
tableColumnWidths: getResizedTableColumnWidths(state.width, state.tableWidth, state.visibleTableColumns, state.tableColumnWidths, state.x, clientX, state.tableResizerDownId)
|
|
2811
|
+
};
|
|
2812
|
+
};
|
|
2813
|
+
|
|
2814
|
+
const handleTableResizerPointerUp = state => {
|
|
2815
|
+
if (!state.tableResizerDownId) {
|
|
2816
|
+
return state;
|
|
2817
|
+
}
|
|
2818
|
+
return {
|
|
2819
|
+
...state,
|
|
2820
|
+
tableResizerDownId: 0
|
|
2821
|
+
};
|
|
2822
|
+
};
|
|
2823
|
+
|
|
2824
|
+
const handleTableRowCopy = async (state, eventIndex) => {
|
|
2825
|
+
const currentEvents = getCurrentEvents$3(state);
|
|
2826
|
+
const event = currentEvents[eventIndex];
|
|
2827
|
+
if (!event) {
|
|
2828
|
+
return state;
|
|
2829
|
+
}
|
|
2830
|
+
const text = JSON.stringify(event, null, 2);
|
|
2831
|
+
await writeClipBoardText(text);
|
|
2832
|
+
return state;
|
|
2833
|
+
};
|
|
2834
|
+
|
|
2705
2835
|
const handleTimelineContextMenu = state => {
|
|
2706
2836
|
return state;
|
|
2707
2837
|
};
|
|
@@ -2780,6 +2910,16 @@ const formatTimelinePresetValue = value => {
|
|
|
2780
2910
|
return value.toFixed(3).replace(trailingZeroFractionRegex, '').replace(trailingFractionZeroRegex, '$1');
|
|
2781
2911
|
};
|
|
2782
2912
|
|
|
2913
|
+
const getTimelineDurationSeconds = events => {
|
|
2914
|
+
const eventsWithTime = getEventsWithTime(events);
|
|
2915
|
+
if (eventsWithTime.length === 0) {
|
|
2916
|
+
return 0;
|
|
2917
|
+
}
|
|
2918
|
+
const baseTime = eventsWithTime[0].time;
|
|
2919
|
+
const lastTime = eventsWithTime.at(-1)?.time ?? baseTime;
|
|
2920
|
+
return roundSeconds(Math.max(0, lastTime - baseTime) / 1000);
|
|
2921
|
+
};
|
|
2922
|
+
|
|
2783
2923
|
const getTimelineSecondsFromClientX = (events, eventX, timelineLeft, timelineWidth) => {
|
|
2784
2924
|
if (timelineWidth <= 0) {
|
|
2785
2925
|
return undefined;
|
|
@@ -2845,7 +2985,7 @@ const handleTimelinePointerUp = (state, eventX) => {
|
|
|
2845
2985
|
return clearTimelineSelectionState(nextState);
|
|
2846
2986
|
};
|
|
2847
2987
|
|
|
2848
|
-
const
|
|
2988
|
+
const setUseDevtoolsLayout = (state, checked) => {
|
|
2849
2989
|
const useDevtoolsLayout = getBoolean(checked);
|
|
2850
2990
|
const selectedEventIndex = useDevtoolsLayout ? getSelectedEventIndex$1(state) : null;
|
|
2851
2991
|
return {
|
|
@@ -2880,42 +3020,157 @@ const handleShowResponsePartEvents = (state, checked) => {
|
|
|
2880
3020
|
};
|
|
2881
3021
|
|
|
2882
3022
|
const loadContent = async (state, savedState) => {
|
|
2883
|
-
|
|
3023
|
+
const nextState = await loadEventsFromUri(restoreSavedState(state, savedState));
|
|
3024
|
+
return {
|
|
3025
|
+
...nextState,
|
|
3026
|
+
categoryFilters: createCategoryFilters(),
|
|
3027
|
+
detailTabs: createDetailTabs()
|
|
3028
|
+
};
|
|
2884
3029
|
};
|
|
2885
3030
|
|
|
2886
3031
|
const getCss = state => {
|
|
2887
3032
|
const tableWidth = clampTableWidth(state.width, state.tableWidth);
|
|
2888
3033
|
const detailsWidth = getDetailsWidth(state.width, state.tableWidth);
|
|
3034
|
+
const tableColumnLayout = getTableColumnLayout(tableWidth, state.visibleTableColumns, state.tableColumnWidths);
|
|
3035
|
+
const resizerOneLeft = tableColumnLayout.resizerLefts[0] || 0;
|
|
3036
|
+
const resizerTwoLeft = tableColumnLayout.resizerLefts[1] || 0;
|
|
2889
3037
|
return `
|
|
2890
3038
|
.ChatDebugView {
|
|
2891
3039
|
--ChatDebugViewDetailsWidth: ${detailsWidth}px;
|
|
3040
|
+
--ChatDebugViewDurationColumnWidth: ${state.tableColumnWidths.duration}px;
|
|
3041
|
+
--ChatDebugViewResizerOneLeft: ${resizerOneLeft}px;
|
|
3042
|
+
--ChatDebugViewResizerTwoLeft: ${resizerTwoLeft}px;
|
|
2892
3043
|
--ChatDebugViewSashWidth: ${sashWidth}px;
|
|
2893
3044
|
--ChatDebugViewTableWidth: ${tableWidth}px;
|
|
3045
|
+
--ChatDebugViewTypeColumnWidth: ${state.tableColumnWidths.type}px;
|
|
2894
3046
|
padding: ${viewPadding}px;
|
|
2895
3047
|
}
|
|
2896
3048
|
|
|
3049
|
+
.ChatDebugViewTop {
|
|
3050
|
+
display: flex;
|
|
3051
|
+
align-items: center;
|
|
3052
|
+
gap: 8px;
|
|
3053
|
+
min-width: 0;
|
|
3054
|
+
}
|
|
3055
|
+
|
|
3056
|
+
.ChatDebugViewFilterInput {
|
|
3057
|
+
flex: 1;
|
|
3058
|
+
min-width: 0;
|
|
3059
|
+
}
|
|
2897
3060
|
|
|
2898
|
-
.
|
|
2899
|
-
|
|
3061
|
+
.ChatDebugViewTableWrapper {
|
|
3062
|
+
position: relative;
|
|
3063
|
+
width: min(100%, var(--ChatDebugViewTableWidth));
|
|
3064
|
+
max-width: 100%;
|
|
3065
|
+
flex:1;
|
|
3066
|
+
display:flex
|
|
2900
3067
|
}
|
|
2901
3068
|
|
|
2902
|
-
.
|
|
2903
|
-
|
|
2904
|
-
|
|
3069
|
+
.ChatDebugViewTable {
|
|
3070
|
+
width: 100%;
|
|
3071
|
+
table-layout: fixed;
|
|
3072
|
+
border-collapse: collapse;
|
|
3073
|
+
flex: 1;
|
|
3074
|
+
}
|
|
3075
|
+
|
|
3076
|
+
.ChatDebugViewHeaderCell,
|
|
3077
|
+
.ChatDebugViewCell {
|
|
3078
|
+
overflow: hidden;
|
|
3079
|
+
text-overflow: ellipsis;
|
|
3080
|
+
white-space: nowrap;
|
|
3081
|
+
}
|
|
3082
|
+
|
|
3083
|
+
.ChatDebugViewHeaderCellType.ChatDebugViewColumnFixed,
|
|
3084
|
+
.ChatDebugViewCellType.ChatDebugViewColumnFixed {
|
|
3085
|
+
width: var(--ChatDebugViewTypeColumnWidth);
|
|
3086
|
+
max-width: var(--ChatDebugViewTypeColumnWidth);
|
|
3087
|
+
}
|
|
3088
|
+
|
|
3089
|
+
.ChatDebugViewHeaderCellDuration.ChatDebugViewColumnFixed,
|
|
3090
|
+
.ChatDebugViewCellDuration.ChatDebugViewColumnFixed {
|
|
3091
|
+
width: var(--ChatDebugViewDurationColumnWidth);
|
|
3092
|
+
max-width: var(--ChatDebugViewDurationColumnWidth);
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
.ChatDebugViewResizers {
|
|
3096
|
+
position: absolute;
|
|
3097
|
+
inset: 0;
|
|
3098
|
+
pointer-events: none;
|
|
3099
|
+
}
|
|
3100
|
+
|
|
3101
|
+
.ChatDebugViewResizer {
|
|
3102
|
+
position: absolute;
|
|
3103
|
+
top: 0;
|
|
3104
|
+
bottom: 0;
|
|
3105
|
+
width: 12px;
|
|
3106
|
+
margin: 0;
|
|
3107
|
+
padding: 0;
|
|
3108
|
+
border: 0;
|
|
3109
|
+
background: transparent;
|
|
3110
|
+
pointer-events: auto;
|
|
3111
|
+
cursor: col-resize;
|
|
3112
|
+
}
|
|
3113
|
+
|
|
3114
|
+
.ChatDebugViewResizerOne {
|
|
3115
|
+
left: var(--ChatDebugViewResizerOneLeft);
|
|
3116
|
+
transform: translateX(-50%);
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
.ChatDebugViewResizerTwo {
|
|
3120
|
+
left: var(--ChatDebugViewResizerTwoLeft);
|
|
3121
|
+
transform: translateX(-50%);
|
|
3122
|
+
}
|
|
3123
|
+
|
|
3124
|
+
.ChatDebugViewResizerInner {
|
|
3125
|
+
position: absolute;
|
|
3126
|
+
top: 0;
|
|
3127
|
+
bottom: 0;
|
|
3128
|
+
left: 50%;
|
|
3129
|
+
width: 1px;
|
|
3130
|
+
transform: translateX(-50%);
|
|
3131
|
+
background: var(--vscode-widget-border, rgba(255, 255, 255, 0.18));
|
|
2905
3132
|
}
|
|
2906
3133
|
|
|
2907
|
-
|
|
3134
|
+
|
|
3135
|
+
.ChatDebugViewDetails {
|
|
3136
|
+
margin-left: auto;
|
|
3137
|
+
min-height: 26px;
|
|
3138
|
+
}
|
|
3139
|
+
border: 1px solid transparent;
|
|
3140
|
+
border-radius: 4px;
|
|
3141
|
+
background: transparent;
|
|
3142
|
+
color: var(--vscode-descriptionForeground, inherit);
|
|
3143
|
+
}
|
|
3144
|
+
font-size: 11px;
|
|
3145
|
+
font-weight: 600;
|
|
3146
|
+
letter-spacing: 0.02em;
|
|
2908
3147
|
display: flex;
|
|
2909
3148
|
contain: strict;
|
|
2910
|
-
flex:1
|
|
3149
|
+
flex:1;
|
|
3150
|
+
transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
|
|
2911
3151
|
|
|
2912
3152
|
}
|
|
2913
3153
|
.ChatDebugViewEvent {
|
|
2914
|
-
|
|
3154
|
+
border-color: var(--vscode-widget-border, rgba(255, 255, 255, 0.14));
|
|
3155
|
+
background: var(--vscode-toolbar-hoverBackground, rgba(255, 255, 255, 0.06));
|
|
3156
|
+
color: var(--vscode-foreground, inherit);
|
|
3157
|
+
|
|
3158
|
+
.ChatDebugViewEventLineContent {
|
|
3159
|
+
flex: 1;
|
|
3160
|
+
background: var(--vscode-toolbar-activeBackground, rgba(255, 255, 255, 0.1));
|
|
3161
|
+
min-width: 0;
|
|
3162
|
+
overflow-wrap: anywhere;
|
|
3163
|
+
white-space: pre-wrap;
|
|
3164
|
+
word-break: break-word;
|
|
3165
|
+
outline: 1px solid var(--vscode-focusBorder, rgba(255, 255, 255, 0.4));
|
|
3166
|
+
|
|
3167
|
+
.ChatDebugViewEventLineNumber {
|
|
3168
|
+
flex: none;
|
|
2915
3169
|
}
|
|
2916
3170
|
|
|
2917
3171
|
.row {
|
|
2918
3172
|
flex-shrink: 0;
|
|
3173
|
+
min-width: 0;
|
|
2919
3174
|
}
|
|
2920
3175
|
|
|
2921
3176
|
.ChatDebugViewRefreshButton {
|
|
@@ -2923,6 +3178,7 @@ const getCss = state => {
|
|
|
2923
3178
|
align-items: center;
|
|
2924
3179
|
justify-content: center;
|
|
2925
3180
|
flex: none;
|
|
3181
|
+
margin-left: auto;
|
|
2926
3182
|
min-height: 28px;
|
|
2927
3183
|
padding: 0 10px;
|
|
2928
3184
|
border: 1px solid rgba(255, 255, 255, 0.16);
|
|
@@ -2964,6 +3220,10 @@ const renderCss = (oldState, newState) => {
|
|
|
2964
3220
|
return [SetCss, newState.uid, css];
|
|
2965
3221
|
};
|
|
2966
3222
|
|
|
3223
|
+
const mergeClassNames = (...classNames) => {
|
|
3224
|
+
return classNames.filter(Boolean).join(' ');
|
|
3225
|
+
};
|
|
3226
|
+
|
|
2967
3227
|
const text = data => {
|
|
2968
3228
|
return {
|
|
2969
3229
|
childCount: 0,
|
|
@@ -3283,6 +3543,9 @@ const ChatDebugViewEventsFullWidth = 'ChatDebugViewEventsFullWidth';
|
|
|
3283
3543
|
const ChatDebugViewFilterInput = 'ChatDebugViewFilterInput';
|
|
3284
3544
|
const ChatDebugViewFilterInputDevtools = 'ChatDebugViewFilterInput--devtools';
|
|
3285
3545
|
const ChatDebugViewHeaderCell = 'ChatDebugViewHeaderCell';
|
|
3546
|
+
const ChatDebugViewHeaderCellDuration = 'ChatDebugViewHeaderCellDuration';
|
|
3547
|
+
const ChatDebugViewHeaderCellStatus = 'ChatDebugViewHeaderCellStatus';
|
|
3548
|
+
const ChatDebugViewHeaderCellType = 'ChatDebugViewHeaderCellType';
|
|
3286
3549
|
const ChatDebugViewRefreshButton = 'ChatDebugViewRefreshButton';
|
|
3287
3550
|
const ChatDebugViewQuickFilterInput = 'ChatDebugViewQuickFilterInput';
|
|
3288
3551
|
const ChatDebugViewQuickFilterPill = 'ChatDebugViewQuickFilterPill';
|
|
@@ -3294,6 +3557,12 @@ const ChatDebugViewTable = 'ChatDebugViewTable';
|
|
|
3294
3557
|
const ChatDebugViewTableBody = 'ChatDebugViewTableBody';
|
|
3295
3558
|
const ChatDebugViewTableHeader = 'ChatDebugViewTableHeader';
|
|
3296
3559
|
const ChatDebugViewTableHeaderRow = 'ChatDebugViewTableHeaderRow';
|
|
3560
|
+
const ChatDebugViewTableWrapper = 'ChatDebugViewTableWrapper';
|
|
3561
|
+
const ChatDebugViewResizer = 'ChatDebugViewResizer';
|
|
3562
|
+
const ChatDebugViewResizerInner = 'ChatDebugViewResizerInner';
|
|
3563
|
+
const ChatDebugViewResizerOne = 'ChatDebugViewResizerOne';
|
|
3564
|
+
const ChatDebugViewResizerTwo = 'ChatDebugViewResizerTwo';
|
|
3565
|
+
const ChatDebugViewResizers = 'ChatDebugViewResizers';
|
|
3297
3566
|
const TableRowEven = 'TableRowEven';
|
|
3298
3567
|
const ChatDebugViewTimeline = 'ChatDebugViewTimeline';
|
|
3299
3568
|
const ChatDebugViewTimelineBucket = 'ChatDebugViewTimelineBucket';
|
|
@@ -3318,6 +3587,7 @@ const ChatDebugViewTimingValue = 'ChatDebugViewTimingValue';
|
|
|
3318
3587
|
const ChatDebugViewTop = 'ChatDebugViewTop';
|
|
3319
3588
|
const ChatDebugViewTopDevtools = 'ChatDebugViewTop--devtools';
|
|
3320
3589
|
const ChatDebugViewCell = 'ChatDebugViewCell';
|
|
3590
|
+
const ChatDebugViewColumnFixed = 'ChatDebugViewColumnFixed';
|
|
3321
3591
|
const ChatDebugViewCellDuration = 'ChatDebugViewCellDuration';
|
|
3322
3592
|
const ChatDebugViewCellStatus = 'ChatDebugViewCellStatus';
|
|
3323
3593
|
const ChatDebugViewCellStatusError = 'ChatDebugViewCellStatusError';
|
|
@@ -3329,9 +3599,6 @@ const TokenKey = 'Token TokenKey';
|
|
|
3329
3599
|
const TokenNumeric = 'Token TokenNumeric';
|
|
3330
3600
|
const TokenString = 'Token TokenString';
|
|
3331
3601
|
const TokenText = 'Token TokenText';
|
|
3332
|
-
const joinClassNames = (...classNames) => {
|
|
3333
|
-
return classNames.filter(Boolean).join(' ');
|
|
3334
|
-
};
|
|
3335
3602
|
|
|
3336
3603
|
const getDebugErrorDom = errorMessage => {
|
|
3337
3604
|
return [{
|
|
@@ -3347,24 +3614,27 @@ const getDebugErrorDom = errorMessage => {
|
|
|
3347
3614
|
|
|
3348
3615
|
const HandleEventCategoryFilter = 4;
|
|
3349
3616
|
const HandleFilterInput = 5;
|
|
3350
|
-
const
|
|
3617
|
+
const SelectDetailTab = 6;
|
|
3351
3618
|
const HandleEventRowClick = 7;
|
|
3352
3619
|
const HandleHeaderContextMenu = 8;
|
|
3353
3620
|
const HandleSashPointerDown = 9;
|
|
3354
3621
|
const HandleSashPointerMove = 10;
|
|
3355
3622
|
const HandleSashPointerUp = 11;
|
|
3356
|
-
const
|
|
3357
|
-
const
|
|
3358
|
-
const
|
|
3359
|
-
const
|
|
3360
|
-
const
|
|
3361
|
-
const
|
|
3362
|
-
const
|
|
3363
|
-
const
|
|
3364
|
-
const
|
|
3365
|
-
const
|
|
3366
|
-
const
|
|
3367
|
-
const
|
|
3623
|
+
const HandleTableResizerPointerDown = 12;
|
|
3624
|
+
const HandleTableResizerPointerMove = 13;
|
|
3625
|
+
const HandleTableResizerPointerUp = 14;
|
|
3626
|
+
const HandleTableBodyContextMenu = 15;
|
|
3627
|
+
const HandleDetailsContextMenu = 16;
|
|
3628
|
+
const HandleTimelinePointerDown = 17;
|
|
3629
|
+
const HandleTimelinePointerMove = 18;
|
|
3630
|
+
const HandleTimelinePointerUp = 19;
|
|
3631
|
+
const HandleTimelineDoubleClick = 20;
|
|
3632
|
+
const HandleTableKeyDown = 21;
|
|
3633
|
+
const HandleTimelineRangePreset = 22;
|
|
3634
|
+
const HandleCloseDetails = 23;
|
|
3635
|
+
const HandleClickRefresh = 24;
|
|
3636
|
+
const HandleDetailsTopContextMenu = 25;
|
|
3637
|
+
const HandleTimelineContextMenu = 26;
|
|
3368
3638
|
|
|
3369
3639
|
const getRefreshButtonDom = () => {
|
|
3370
3640
|
return [{
|
|
@@ -3377,18 +3647,19 @@ const getRefreshButtonDom = () => {
|
|
|
3377
3647
|
value: Refresh
|
|
3378
3648
|
}, text(refresh$1())];
|
|
3379
3649
|
};
|
|
3650
|
+
|
|
3380
3651
|
const getDebugViewTopDom = (filterValue, useDevtoolsLayout, quickFilterNodes) => {
|
|
3381
3652
|
const refreshButtonDom = getRefreshButtonDom();
|
|
3382
3653
|
if (useDevtoolsLayout) {
|
|
3383
3654
|
return [{
|
|
3384
3655
|
childCount: 2 + (quickFilterNodes.length > 0 ? 1 : 0),
|
|
3385
|
-
className:
|
|
3656
|
+
className: mergeClassNames(ChatDebugViewTop, ChatDebugViewTopDevtools),
|
|
3386
3657
|
onContextMenu: HandleHeaderContextMenu,
|
|
3387
3658
|
type: Search
|
|
3388
3659
|
}, {
|
|
3389
3660
|
autocomplete: 'off',
|
|
3390
3661
|
childCount: 0,
|
|
3391
|
-
className:
|
|
3662
|
+
className: mergeClassNames(InputBox, ChatDebugViewFilterInput, ChatDebugViewFilterInputDevtools),
|
|
3392
3663
|
inputType: 'search',
|
|
3393
3664
|
name: Filter,
|
|
3394
3665
|
onInput: HandleFilterInput,
|
|
@@ -3405,7 +3676,7 @@ const getDebugViewTopDom = (filterValue, useDevtoolsLayout, quickFilterNodes) =>
|
|
|
3405
3676
|
}, {
|
|
3406
3677
|
autocomplete: 'off',
|
|
3407
3678
|
childCount: 0,
|
|
3408
|
-
className:
|
|
3679
|
+
className: mergeClassNames(InputBox, ChatDebugViewFilterInput),
|
|
3409
3680
|
inputType: 'search',
|
|
3410
3681
|
name: Filter,
|
|
3411
3682
|
onInput: HandleFilterInput,
|
|
@@ -3415,6 +3686,39 @@ const getDebugViewTopDom = (filterValue, useDevtoolsLayout, quickFilterNodes) =>
|
|
|
3415
3686
|
}, ...refreshButtonDom];
|
|
3416
3687
|
};
|
|
3417
3688
|
|
|
3689
|
+
const None = 'none';
|
|
3690
|
+
|
|
3691
|
+
const getPanelId = detailTab => {
|
|
3692
|
+
return `ChatDebugViewDetailsPanel-${detailTab}`;
|
|
3693
|
+
};
|
|
3694
|
+
|
|
3695
|
+
const getTabId = detailTab => {
|
|
3696
|
+
return `ChatDebugViewDetailsTab-${detailTab}`;
|
|
3697
|
+
};
|
|
3698
|
+
|
|
3699
|
+
const getDetailTabDom = (detailTab, selectedDetailTab) => {
|
|
3700
|
+
const isSelected = detailTab.name === selectedDetailTab;
|
|
3701
|
+
return [{
|
|
3702
|
+
'aria-controls': getPanelId(detailTab.name),
|
|
3703
|
+
'aria-selected': isSelected,
|
|
3704
|
+
childCount: 1,
|
|
3705
|
+
className: mergeClassNames(ChatDebugViewDetailsTab, isSelected ? ChatDebugViewDetailsTabSelected : ''),
|
|
3706
|
+
id: getTabId(detailTab.name),
|
|
3707
|
+
name: DetailTab,
|
|
3708
|
+
onChange: SelectDetailTab,
|
|
3709
|
+
onClick: SelectDetailTab,
|
|
3710
|
+
role: 'tab',
|
|
3711
|
+
tabIndex: isSelected ? 0 : -1,
|
|
3712
|
+
type: Button$1,
|
|
3713
|
+
value: detailTab.name
|
|
3714
|
+
}, text(detailTab.label)];
|
|
3715
|
+
};
|
|
3716
|
+
const getTabNodes = (detailTabs, selectedDetailTab) => {
|
|
3717
|
+
return detailTabs.flatMap(detailTab => {
|
|
3718
|
+
return getDetailTabDom(detailTab, selectedDetailTab);
|
|
3719
|
+
});
|
|
3720
|
+
};
|
|
3721
|
+
|
|
3418
3722
|
const getDurationText = event => {
|
|
3419
3723
|
const explicitDuration = event.durationMs ?? event.duration;
|
|
3420
3724
|
if (typeof explicitDuration === 'number' && Number.isFinite(explicitDuration)) {
|
|
@@ -3480,6 +3784,7 @@ const getTimingRowDom = (label, value) => {
|
|
|
3480
3784
|
type: Span
|
|
3481
3785
|
}, text(value)];
|
|
3482
3786
|
};
|
|
3787
|
+
|
|
3483
3788
|
const getTimingDetailsDom = event => {
|
|
3484
3789
|
return [{
|
|
3485
3790
|
childCount: 3,
|
|
@@ -3488,36 +3793,12 @@ const getTimingDetailsDom = event => {
|
|
|
3488
3793
|
}, ...getTimingRowDom(started(), getStartText(event)), ...getTimingRowDom(ended(), getEndText(event)), ...getTimingRowDom(duration(), getDurationText(event))];
|
|
3489
3794
|
};
|
|
3490
3795
|
|
|
3491
|
-
const
|
|
3492
|
-
|
|
3493
|
-
};
|
|
3494
|
-
const getPanelId = detailTab => {
|
|
3495
|
-
return `ChatDebugViewDetailsPanel-${detailTab}`;
|
|
3496
|
-
};
|
|
3497
|
-
const getTabNodes = selectedDetailTab => {
|
|
3498
|
-
return detailTabs.flatMap(detailTab => {
|
|
3499
|
-
const isSelected = detailTab === selectedDetailTab;
|
|
3500
|
-
return [{
|
|
3501
|
-
'aria-controls': getPanelId(detailTab),
|
|
3502
|
-
'aria-selected': isSelected,
|
|
3503
|
-
childCount: 1,
|
|
3504
|
-
className: joinClassNames(ChatDebugViewDetailsTab, isSelected && ChatDebugViewDetailsTabSelected),
|
|
3505
|
-
id: getTabId(detailTab),
|
|
3506
|
-
name: DetailTab,
|
|
3507
|
-
onChange: HandleDetailTab,
|
|
3508
|
-
onClick: HandleDetailTab,
|
|
3509
|
-
role: 'tab',
|
|
3510
|
-
tabIndex: isSelected ? 0 : -1,
|
|
3511
|
-
type: Button$1,
|
|
3512
|
-
value: detailTab
|
|
3513
|
-
}, text(getDetailTabLabel(detailTab))];
|
|
3514
|
-
});
|
|
3515
|
-
};
|
|
3516
|
-
const getDetailsDom = (previewEventNodes, responseEventNodes = previewEventNodes, selectedEvent = null, selectedDetailTab = Response) => {
|
|
3517
|
-
if (previewEventNodes.length === 0 && responseEventNodes.length === 0) {
|
|
3796
|
+
const getDetailsDom = (previewEventNodes, payloadEventNodes = previewEventNodes, responseEventNodes = payloadEventNodes, selectedEvent = null, detailTabs = createDetailTabs(), selectedDetailTab = Response) => {
|
|
3797
|
+
if (previewEventNodes.length === 0 && payloadEventNodes.length === 0 && responseEventNodes.length === 0) {
|
|
3518
3798
|
return [];
|
|
3519
3799
|
}
|
|
3520
|
-
const
|
|
3800
|
+
const safeSelectedDetailTab = getSelectedDetailTab(detailTabs, selectedDetailTab);
|
|
3801
|
+
const contentNodes = safeSelectedDetailTab === Timing && selectedEvent ? getTimingDetailsDom(selectedEvent) : safeSelectedDetailTab === Preview ? previewEventNodes : safeSelectedDetailTab === Payload ? payloadEventNodes : responseEventNodes;
|
|
3521
3802
|
return [{
|
|
3522
3803
|
childCount: 2,
|
|
3523
3804
|
className: ChatDebugViewDetails,
|
|
@@ -3542,11 +3823,11 @@ const getDetailsDom = (previewEventNodes, responseEventNodes = previewEventNodes
|
|
|
3542
3823
|
className: ChatDebugViewDetailsTabs,
|
|
3543
3824
|
role: 'tablist',
|
|
3544
3825
|
type: Div
|
|
3545
|
-
}, ...getTabNodes(
|
|
3546
|
-
'aria-labelledby': getTabId(
|
|
3826
|
+
}, ...getTabNodes(detailTabs, safeSelectedDetailTab), {
|
|
3827
|
+
'aria-labelledby': getTabId(safeSelectedDetailTab),
|
|
3547
3828
|
childCount: 1,
|
|
3548
3829
|
className: ChatDebugViewDetailsBottom,
|
|
3549
|
-
id: getPanelId(
|
|
3830
|
+
id: getPanelId(safeSelectedDetailTab),
|
|
3550
3831
|
onContextMenu: HandleDetailsContextMenu,
|
|
3551
3832
|
role: 'tabpanel',
|
|
3552
3833
|
type: Div
|
|
@@ -3586,9 +3867,6 @@ const getEventTypeLabel = event => {
|
|
|
3586
3867
|
return `${event.type}, ${toolName}`;
|
|
3587
3868
|
};
|
|
3588
3869
|
|
|
3589
|
-
const isRecord = value => {
|
|
3590
|
-
return typeof value === 'object' && value !== null;
|
|
3591
|
-
};
|
|
3592
3870
|
const isErrorStatusCode = value => {
|
|
3593
3871
|
if (typeof value === 'number') {
|
|
3594
3872
|
return value >= 400;
|
|
@@ -3599,6 +3877,11 @@ const isErrorStatusCode = value => {
|
|
|
3599
3877
|
}
|
|
3600
3878
|
return false;
|
|
3601
3879
|
};
|
|
3880
|
+
|
|
3881
|
+
const isRecord = value => {
|
|
3882
|
+
return typeof value === 'object' && value !== null;
|
|
3883
|
+
};
|
|
3884
|
+
|
|
3602
3885
|
const hasErrorStatus = event => {
|
|
3603
3886
|
if (event.type === 'error') {
|
|
3604
3887
|
return true;
|
|
@@ -3634,24 +3917,26 @@ const getStatusText = event => {
|
|
|
3634
3917
|
};
|
|
3635
3918
|
|
|
3636
3919
|
const getRowCellNodes = (event, isErrorStatus, visibleTableColumns) => {
|
|
3637
|
-
|
|
3920
|
+
const orderedVisibleTableColumns = getOrderedVisibleTableColumns(visibleTableColumns);
|
|
3921
|
+
return orderedVisibleTableColumns.flatMap((column, index) => {
|
|
3922
|
+
const isFixed = index < orderedVisibleTableColumns.length - 1;
|
|
3638
3923
|
switch (column) {
|
|
3639
3924
|
case Duration:
|
|
3640
3925
|
return [{
|
|
3641
3926
|
childCount: 1,
|
|
3642
|
-
className:
|
|
3927
|
+
className: mergeClassNames(ChatDebugViewCell, ChatDebugViewCellDuration, isFixed ? ChatDebugViewColumnFixed : ''),
|
|
3643
3928
|
type: Td
|
|
3644
3929
|
}, text(getDurationText(event))];
|
|
3645
3930
|
case Status:
|
|
3646
3931
|
return [{
|
|
3647
3932
|
childCount: 1,
|
|
3648
|
-
className:
|
|
3933
|
+
className: mergeClassNames(ChatDebugViewCell, ChatDebugViewCellStatus, isErrorStatus ? ChatDebugViewCellStatusError : '', isFixed ? ChatDebugViewColumnFixed : ''),
|
|
3649
3934
|
type: Td
|
|
3650
3935
|
}, text(getStatusText(event))];
|
|
3651
3936
|
case Type:
|
|
3652
3937
|
return [{
|
|
3653
3938
|
childCount: 1,
|
|
3654
|
-
className:
|
|
3939
|
+
className: mergeClassNames(ChatDebugViewCell, ChatDebugViewCellType, isFixed ? ChatDebugViewColumnFixed : ''),
|
|
3655
3940
|
type: Td
|
|
3656
3941
|
}, text(getEventTypeLabel(event))];
|
|
3657
3942
|
default:
|
|
@@ -3659,6 +3944,7 @@ const getRowCellNodes = (event, isErrorStatus, visibleTableColumns) => {
|
|
|
3659
3944
|
}
|
|
3660
3945
|
});
|
|
3661
3946
|
};
|
|
3947
|
+
|
|
3662
3948
|
const getDevtoolsRows = (events, selectedEventIndex, visibleTableColumns = defaultVisibleTableColumns) => {
|
|
3663
3949
|
return events.flatMap((event, i) => {
|
|
3664
3950
|
const isEvenRow = i % 2 === 1;
|
|
@@ -3668,7 +3954,7 @@ const getDevtoolsRows = (events, selectedEventIndex, visibleTableColumns = defau
|
|
|
3668
3954
|
const rowCellNodes = getRowCellNodes(event, isErrorStatus, visibleTableColumns);
|
|
3669
3955
|
return [{
|
|
3670
3956
|
childCount: visibleTableColumns.length,
|
|
3671
|
-
className:
|
|
3957
|
+
className: mergeClassNames(ChatDebugViewEventRow, isEvenRow ? TableRowEven : '', isSelected ? ChatDebugViewEventRowSelected : ''),
|
|
3672
3958
|
'data-index': rowIndex,
|
|
3673
3959
|
type: Tr
|
|
3674
3960
|
}, ...rowCellNodes];
|
|
@@ -3683,6 +3969,25 @@ const getEmptyStateDom = emptyMessage => {
|
|
|
3683
3969
|
}, text(emptyMessage)];
|
|
3684
3970
|
};
|
|
3685
3971
|
|
|
3972
|
+
const getLineNodeDom = (line, index) => {
|
|
3973
|
+
return [{
|
|
3974
|
+
childCount: 2,
|
|
3975
|
+
className: Row,
|
|
3976
|
+
type: Div
|
|
3977
|
+
}, {
|
|
3978
|
+
childCount: 1,
|
|
3979
|
+
className: ChatDebugViewEventLineNumber,
|
|
3980
|
+
type: Span
|
|
3981
|
+
}, text(String(index + 1)), {
|
|
3982
|
+
childCount: line.childCount,
|
|
3983
|
+
className: ChatDebugViewEventLineContent,
|
|
3984
|
+
type: Span
|
|
3985
|
+
}, ...line.nodes];
|
|
3986
|
+
};
|
|
3987
|
+
const getLineNodes = lines => {
|
|
3988
|
+
return lines.flatMap(getLineNodeDom);
|
|
3989
|
+
};
|
|
3990
|
+
|
|
3686
3991
|
const isDigit = character => {
|
|
3687
3992
|
return character !== undefined && character >= '0' && character <= '9';
|
|
3688
3993
|
};
|
|
@@ -3830,24 +4135,6 @@ const getLineContentNodes = line => {
|
|
|
3830
4135
|
}, text(segment.value)];
|
|
3831
4136
|
});
|
|
3832
4137
|
};
|
|
3833
|
-
const getLineNodes = lines => {
|
|
3834
|
-
return lines.flatMap((line, index) => {
|
|
3835
|
-
const lineContentNodes = getLineContentNodes(line);
|
|
3836
|
-
return [{
|
|
3837
|
-
childCount: 2,
|
|
3838
|
-
className: Row,
|
|
3839
|
-
type: Div
|
|
3840
|
-
}, {
|
|
3841
|
-
childCount: 1,
|
|
3842
|
-
className: ChatDebugViewEventLineNumber,
|
|
3843
|
-
type: Span
|
|
3844
|
-
}, text(String(index + 1)), {
|
|
3845
|
-
childCount: lineContentNodes.length / 2,
|
|
3846
|
-
className: ChatDebugViewEventLineContent,
|
|
3847
|
-
type: Span
|
|
3848
|
-
}, ...lineContentNodes];
|
|
3849
|
-
});
|
|
3850
|
-
};
|
|
3851
4138
|
const isChatViewEvent = value => {
|
|
3852
4139
|
return typeof value === 'object' && value !== null && typeof value.type === 'string';
|
|
3853
4140
|
};
|
|
@@ -3857,7 +4144,13 @@ const getEventNode = value => {
|
|
|
3857
4144
|
type: getEventTypeLabel(value)
|
|
3858
4145
|
} : value;
|
|
3859
4146
|
const lines = getJsonLines(renderedValue);
|
|
3860
|
-
const lineNodes = getLineNodes(lines
|
|
4147
|
+
const lineNodes = getLineNodes(lines.map(line => {
|
|
4148
|
+
const lineContentNodes = getLineContentNodes(line);
|
|
4149
|
+
return {
|
|
4150
|
+
childCount: lineContentNodes.length / 2,
|
|
4151
|
+
nodes: lineContentNodes
|
|
4152
|
+
};
|
|
4153
|
+
}));
|
|
3861
4154
|
return [{
|
|
3862
4155
|
childCount: lines.length,
|
|
3863
4156
|
className: ChatDebugViewEvent,
|
|
@@ -3866,19 +4159,61 @@ const getEventNode = value => {
|
|
|
3866
4159
|
};
|
|
3867
4160
|
|
|
3868
4161
|
const getEventsClassName = hasSelectedEvent => {
|
|
3869
|
-
const widthClassName =
|
|
4162
|
+
const widthClassName = mergeClassNames(ChatDebugViewEvents, hasSelectedEvent ? '' : ChatDebugViewEventsFullWidth);
|
|
3870
4163
|
return widthClassName;
|
|
3871
4164
|
};
|
|
3872
4165
|
|
|
4166
|
+
const getPreviewName = event => {
|
|
4167
|
+
if (typeof event.name === 'string' && event.name) {
|
|
4168
|
+
return event.name;
|
|
4169
|
+
}
|
|
4170
|
+
if (typeof event.toolName === 'string' && event.toolName) {
|
|
4171
|
+
return event.toolName;
|
|
4172
|
+
}
|
|
4173
|
+
return undefined;
|
|
4174
|
+
};
|
|
4175
|
+
|
|
3873
4176
|
const hasOwn = (event, key) => {
|
|
3874
4177
|
return Object.hasOwn(event, key);
|
|
3875
4178
|
};
|
|
3876
|
-
|
|
3877
|
-
|
|
4179
|
+
|
|
4180
|
+
const shouldIncludeArguments = (event, name) => {
|
|
4181
|
+
if (!hasOwn(event, 'arguments')) {
|
|
4182
|
+
return false;
|
|
4183
|
+
}
|
|
4184
|
+
if (name === 'getWorkspaceUri') {
|
|
4185
|
+
return false;
|
|
4186
|
+
}
|
|
4187
|
+
return true;
|
|
4188
|
+
};
|
|
4189
|
+
|
|
4190
|
+
const getPayloadEvent = event => {
|
|
4191
|
+
const name = getPreviewName(event);
|
|
4192
|
+
const payloadEvent = {
|
|
4193
|
+
...(name === undefined ? {} : {
|
|
4194
|
+
name
|
|
4195
|
+
}),
|
|
4196
|
+
...(shouldIncludeArguments(event, name) ? {
|
|
4197
|
+
arguments: event.arguments
|
|
4198
|
+
} : {}),
|
|
4199
|
+
...(hasOwn(event, 'result') ? {
|
|
4200
|
+
result: event.result
|
|
4201
|
+
} : {})
|
|
4202
|
+
};
|
|
4203
|
+
if (Object.keys(payloadEvent).length > 0) {
|
|
4204
|
+
return payloadEvent;
|
|
4205
|
+
}
|
|
4206
|
+
return event;
|
|
3878
4207
|
};
|
|
4208
|
+
|
|
3879
4209
|
const isChatMessageAddedEvent = event => {
|
|
3880
4210
|
return event.type === 'chat-message-added';
|
|
3881
4211
|
};
|
|
4212
|
+
|
|
4213
|
+
const isChatMessageUpdatedEvent = event => {
|
|
4214
|
+
return event.type === 'chat-message-updated';
|
|
4215
|
+
};
|
|
4216
|
+
|
|
3882
4217
|
const getPreviewMessageText = event => {
|
|
3883
4218
|
if (isChatMessageUpdatedEvent(event) && typeof event.text === 'string') {
|
|
3884
4219
|
return event.text;
|
|
@@ -3903,23 +4238,24 @@ const getPreviewMessageText = event => {
|
|
|
3903
4238
|
}
|
|
3904
4239
|
return text;
|
|
3905
4240
|
};
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
if (typeof event.toolName === 'string' && event.toolName) {
|
|
3911
|
-
return event.toolName;
|
|
4241
|
+
|
|
4242
|
+
const getWriteFilePreviewText = (event, name) => {
|
|
4243
|
+
if (name !== 'write_file') {
|
|
4244
|
+
return undefined;
|
|
3912
4245
|
}
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
if (!hasOwn(
|
|
3917
|
-
return
|
|
4246
|
+
const {
|
|
4247
|
+
arguments: toolArguments
|
|
4248
|
+
} = event;
|
|
4249
|
+
if (typeof toolArguments !== 'object' || toolArguments === null || !Object.hasOwn(toolArguments, 'content')) {
|
|
4250
|
+
return undefined;
|
|
3918
4251
|
}
|
|
3919
|
-
|
|
3920
|
-
|
|
4252
|
+
const {
|
|
4253
|
+
content
|
|
4254
|
+
} = toolArguments;
|
|
4255
|
+
if (typeof content !== 'string') {
|
|
4256
|
+
return undefined;
|
|
3921
4257
|
}
|
|
3922
|
-
return
|
|
4258
|
+
return content;
|
|
3923
4259
|
};
|
|
3924
4260
|
const getPreviewEvent = event => {
|
|
3925
4261
|
const previewMessageText = getPreviewMessageText(event);
|
|
@@ -3927,21 +4263,11 @@ const getPreviewEvent = event => {
|
|
|
3927
4263
|
return previewMessageText;
|
|
3928
4264
|
}
|
|
3929
4265
|
const name = getPreviewName(event);
|
|
3930
|
-
const
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
}),
|
|
3934
|
-
...(shouldIncludeArguments(event, name) ? {
|
|
3935
|
-
arguments: event.arguments
|
|
3936
|
-
} : {}),
|
|
3937
|
-
...(hasOwn(event, 'result') ? {
|
|
3938
|
-
result: event.result
|
|
3939
|
-
} : {})
|
|
3940
|
-
};
|
|
3941
|
-
if (Object.keys(previewEvent).length > 0) {
|
|
3942
|
-
return previewEvent;
|
|
4266
|
+
const writeFilePreviewText = getWriteFilePreviewText(event, name);
|
|
4267
|
+
if (writeFilePreviewText !== undefined) {
|
|
4268
|
+
return writeFilePreviewText;
|
|
3943
4269
|
}
|
|
3944
|
-
return event;
|
|
4270
|
+
return getPayloadEvent(event);
|
|
3945
4271
|
};
|
|
3946
4272
|
|
|
3947
4273
|
const getSashNodesDom = hasSelectedEvent => {
|
|
@@ -3971,26 +4297,28 @@ const getTableBodyDom = (rowNodes, eventCount) => {
|
|
|
3971
4297
|
};
|
|
3972
4298
|
|
|
3973
4299
|
const getHeaderCellNodes = visibleTableColumns => {
|
|
3974
|
-
|
|
4300
|
+
const orderedVisibleTableColumns = getOrderedVisibleTableColumns(visibleTableColumns);
|
|
4301
|
+
return orderedVisibleTableColumns.flatMap((column, index) => {
|
|
4302
|
+
const isFixed = index < orderedVisibleTableColumns.length - 1;
|
|
3975
4303
|
switch (column) {
|
|
3976
4304
|
case Duration:
|
|
3977
4305
|
return [{
|
|
3978
4306
|
childCount: 1,
|
|
3979
|
-
className: ChatDebugViewHeaderCell,
|
|
4307
|
+
className: mergeClassNames(ChatDebugViewHeaderCell, ChatDebugViewHeaderCellDuration, isFixed ? ChatDebugViewColumnFixed : ''),
|
|
3980
4308
|
scope: 'col',
|
|
3981
4309
|
type: Th
|
|
3982
4310
|
}, text(duration())];
|
|
3983
4311
|
case Status:
|
|
3984
4312
|
return [{
|
|
3985
4313
|
childCount: 1,
|
|
3986
|
-
className: ChatDebugViewHeaderCell,
|
|
4314
|
+
className: mergeClassNames(ChatDebugViewHeaderCell, ChatDebugViewHeaderCellStatus, isFixed ? ChatDebugViewColumnFixed : ''),
|
|
3987
4315
|
scope: 'col',
|
|
3988
4316
|
type: Th
|
|
3989
4317
|
}, text(status())];
|
|
3990
4318
|
case Type:
|
|
3991
4319
|
return [{
|
|
3992
4320
|
childCount: 1,
|
|
3993
|
-
className: ChatDebugViewHeaderCell,
|
|
4321
|
+
className: mergeClassNames(ChatDebugViewHeaderCell, ChatDebugViewHeaderCellType, isFixed ? ChatDebugViewColumnFixed : ''),
|
|
3994
4322
|
scope: 'col',
|
|
3995
4323
|
type: Th
|
|
3996
4324
|
}, text(type())];
|
|
@@ -3999,6 +4327,7 @@ const getHeaderCellNodes = visibleTableColumns => {
|
|
|
3999
4327
|
}
|
|
4000
4328
|
});
|
|
4001
4329
|
};
|
|
4330
|
+
|
|
4002
4331
|
const getTableHeaderDom = (visibleTableColumns = defaultVisibleTableColumns) => {
|
|
4003
4332
|
const headerCellNodes = getHeaderCellNodes(visibleTableColumns);
|
|
4004
4333
|
return [{
|
|
@@ -4013,16 +4342,64 @@ const getTableHeaderDom = (visibleTableColumns = defaultVisibleTableColumns) =>
|
|
|
4013
4342
|
}, ...headerCellNodes];
|
|
4014
4343
|
};
|
|
4015
4344
|
|
|
4345
|
+
const resizerNames = ['ResizerOne', 'ResizerTwo'];
|
|
4346
|
+
const resizerClassNames = [ChatDebugViewResizerOne, ChatDebugViewResizerTwo];
|
|
4347
|
+
const getTableResizersDom = visibleTableColumns => {
|
|
4348
|
+
const visibleColumnCount = getOrderedVisibleTableColumns(visibleTableColumns).length;
|
|
4349
|
+
const resizerCount = Math.max(0, visibleColumnCount - 1);
|
|
4350
|
+
if (resizerCount === 0) {
|
|
4351
|
+
return [];
|
|
4352
|
+
}
|
|
4353
|
+
const visibleResizerClassNames = resizerClassNames.slice(0, resizerCount);
|
|
4354
|
+
const resizerNodes = visibleResizerClassNames.flatMap((resizerClassName, index) => [{
|
|
4355
|
+
childCount: 1,
|
|
4356
|
+
className: `${ChatDebugViewResizer} ${resizerClassName}`,
|
|
4357
|
+
name: resizerNames[index],
|
|
4358
|
+
onPointerDown: HandleTableResizerPointerDown,
|
|
4359
|
+
role: None,
|
|
4360
|
+
type: Button$1
|
|
4361
|
+
}, {
|
|
4362
|
+
childCount: 0,
|
|
4363
|
+
className: ChatDebugViewResizerInner,
|
|
4364
|
+
type: Div
|
|
4365
|
+
}]);
|
|
4366
|
+
return [{
|
|
4367
|
+
childCount: resizerCount,
|
|
4368
|
+
className: ChatDebugViewResizers,
|
|
4369
|
+
type: Div
|
|
4370
|
+
}, ...resizerNodes];
|
|
4371
|
+
};
|
|
4372
|
+
|
|
4016
4373
|
const getTableDom = (rowNodes, eventCount, visibleTableColumns = defaultVisibleTableColumns) => {
|
|
4374
|
+
const resizerNodes = getTableResizersDom(visibleTableColumns);
|
|
4017
4375
|
return [{
|
|
4376
|
+
childCount: 1 + (resizerNodes.length > 0 ? 1 : 0),
|
|
4377
|
+
className: ChatDebugViewTableWrapper,
|
|
4378
|
+
type: Div
|
|
4379
|
+
}, {
|
|
4018
4380
|
childCount: 2,
|
|
4019
4381
|
className: ChatDebugViewTable,
|
|
4020
4382
|
type: Table
|
|
4021
|
-
}, ...getTableHeaderDom(visibleTableColumns), ...getTableBodyDom(rowNodes, eventCount)];
|
|
4383
|
+
}, ...getTableHeaderDom(visibleTableColumns), ...getTableBodyDom(rowNodes, eventCount), ...resizerNodes];
|
|
4022
4384
|
};
|
|
4023
4385
|
|
|
4024
|
-
const
|
|
4025
|
-
|
|
4386
|
+
const getTextNode = value => {
|
|
4387
|
+
const lines = value.split('\n');
|
|
4388
|
+
const lineNodes = getLineNodes(lines.map(line => {
|
|
4389
|
+
return {
|
|
4390
|
+
childCount: 1,
|
|
4391
|
+
nodes: [{
|
|
4392
|
+
childCount: 1,
|
|
4393
|
+
className: TokenText,
|
|
4394
|
+
type: Span
|
|
4395
|
+
}, text(line)]
|
|
4396
|
+
};
|
|
4397
|
+
}));
|
|
4398
|
+
return [{
|
|
4399
|
+
childCount: lines.length,
|
|
4400
|
+
className: ChatDebugViewEvent,
|
|
4401
|
+
type: Div
|
|
4402
|
+
}, ...lineNodes];
|
|
4026
4403
|
};
|
|
4027
4404
|
|
|
4028
4405
|
const getBucketUnitDom = (unitCount, presetValue) => {
|
|
@@ -4032,7 +4409,7 @@ const getBucketUnitDom = (unitCount, presetValue) => {
|
|
|
4032
4409
|
'data-value': presetValue
|
|
4033
4410
|
} : {}),
|
|
4034
4411
|
childCount: 0,
|
|
4035
|
-
className:
|
|
4412
|
+
className: mergeClassNames(ChatDebugViewTimelineBucketUnit, ChatDebugViewTimelineBucketUnitEmpty),
|
|
4036
4413
|
type: Div
|
|
4037
4414
|
}];
|
|
4038
4415
|
}
|
|
@@ -4052,13 +4429,13 @@ const getBucketDom = bucket => {
|
|
|
4052
4429
|
const presetValue = `${formatTimelinePresetValue(bucket.startSeconds)}:${formatTimelinePresetValue(bucket.endSeconds)}`;
|
|
4053
4430
|
return [{
|
|
4054
4431
|
childCount: 1,
|
|
4055
|
-
className:
|
|
4432
|
+
className: mergeClassNames(ChatDebugViewTimelineBucket, bucket.isSelected ? ChatDebugViewTimelineBucketSelected : ''),
|
|
4056
4433
|
'data-value': presetValue,
|
|
4057
4434
|
onClick: HandleTimelineRangePreset,
|
|
4058
4435
|
type: Div
|
|
4059
4436
|
}, {
|
|
4060
4437
|
childCount: bucket.unitCount === 0 ? 1 : bucket.unitCount,
|
|
4061
|
-
className:
|
|
4438
|
+
className: mergeClassNames(ChatDebugViewTimelineBucketBar, bucket.isSelected ? ChatDebugViewTimelineBucketBarSelected : ''),
|
|
4062
4439
|
'data-value': presetValue,
|
|
4063
4440
|
type: Div
|
|
4064
4441
|
}, ...getBucketUnitDom(bucket.unitCount, presetValue)];
|
|
@@ -4077,6 +4454,96 @@ const getEffectiveTimelineRange = (timelineStartSeconds, timelineEndSeconds, tim
|
|
|
4077
4454
|
};
|
|
4078
4455
|
};
|
|
4079
4456
|
|
|
4457
|
+
const formatPercent = value => {
|
|
4458
|
+
return `${Number(value.toFixed(3))}%`;
|
|
4459
|
+
};
|
|
4460
|
+
|
|
4461
|
+
const getSelectionNodesDom = (hasSelection, selectionStartPercent, selectionEndPercent) => {
|
|
4462
|
+
if (!hasSelection || selectionStartPercent === null || selectionEndPercent === null) {
|
|
4463
|
+
return [];
|
|
4464
|
+
}
|
|
4465
|
+
return [{
|
|
4466
|
+
childCount: 0,
|
|
4467
|
+
className: ChatDebugViewTimelineSelectionRange,
|
|
4468
|
+
style: `left:${formatPercent(selectionStartPercent)};width:${formatPercent(selectionEndPercent - selectionStartPercent)};`,
|
|
4469
|
+
type: Div
|
|
4470
|
+
}, {
|
|
4471
|
+
childCount: 0,
|
|
4472
|
+
className: mergeClassNames(ChatDebugViewTimelineSelectionMarker, ChatDebugViewTimelineSelectionMarkerStart),
|
|
4473
|
+
style: `left:${formatPercent(selectionStartPercent)};`,
|
|
4474
|
+
type: Div
|
|
4475
|
+
}, {
|
|
4476
|
+
childCount: 0,
|
|
4477
|
+
className: mergeClassNames(ChatDebugViewTimelineSelectionMarker, ChatDebugViewTimelineSelectionMarkerEnd),
|
|
4478
|
+
style: `left:${formatPercent(selectionEndPercent)};`,
|
|
4479
|
+
type: Div
|
|
4480
|
+
}];
|
|
4481
|
+
};
|
|
4482
|
+
|
|
4483
|
+
const getSelectionPercent = (value, durationSeconds) => {
|
|
4484
|
+
if (durationSeconds <= 0) {
|
|
4485
|
+
return 0;
|
|
4486
|
+
}
|
|
4487
|
+
return Number((value / durationSeconds * 100).toFixed(3));
|
|
4488
|
+
};
|
|
4489
|
+
|
|
4490
|
+
const maxBarUnits = 8;
|
|
4491
|
+
const getTimelineInfo = (events, startValue, endValue) => {
|
|
4492
|
+
const eventsWithTime = getEventsWithTime(events);
|
|
4493
|
+
if (eventsWithTime.length === 0) {
|
|
4494
|
+
return {
|
|
4495
|
+
buckets: [],
|
|
4496
|
+
durationSeconds: 0,
|
|
4497
|
+
endSeconds: null,
|
|
4498
|
+
hasSelection: false,
|
|
4499
|
+
selectionEndPercent: null,
|
|
4500
|
+
selectionStartPercent: null,
|
|
4501
|
+
startSeconds: null
|
|
4502
|
+
};
|
|
4503
|
+
}
|
|
4504
|
+
const baseTime = eventsWithTime[0].time;
|
|
4505
|
+
const lastTime = eventsWithTime.at(-1)?.time ?? baseTime;
|
|
4506
|
+
const durationMs = Math.max(0, lastTime - baseTime);
|
|
4507
|
+
const durationSeconds = roundSeconds(durationMs / 1000);
|
|
4508
|
+
const range = getNormalizedRange(durationSeconds, startValue, endValue);
|
|
4509
|
+
const bucketCount = durationSeconds === 0 ? 1 : Math.max(12, Math.min(48, Math.ceil(durationSeconds)));
|
|
4510
|
+
const bucketDurationMs = durationMs === 0 ? 1000 : durationMs / bucketCount;
|
|
4511
|
+
const counts = Array.from({
|
|
4512
|
+
length: bucketCount
|
|
4513
|
+
}).fill(0);
|
|
4514
|
+
for (const item of eventsWithTime) {
|
|
4515
|
+
const offsetMs = item.time - baseTime;
|
|
4516
|
+
const index = durationMs === 0 ? 0 : Math.min(bucketCount - 1, Math.floor(offsetMs / durationMs * bucketCount));
|
|
4517
|
+
counts[index] += 1;
|
|
4518
|
+
}
|
|
4519
|
+
const maxCount = Math.max(...counts);
|
|
4520
|
+
const selectionStartPercent = range.hasSelection && range.startSeconds !== null ? getSelectionPercent(range.startSeconds, durationSeconds) : null;
|
|
4521
|
+
const selectionEndPercent = range.hasSelection && range.endSeconds !== null ? getSelectionPercent(range.endSeconds, durationSeconds) : null;
|
|
4522
|
+
const buckets = counts.map((count, index) => {
|
|
4523
|
+
const bucketStartMs = index * bucketDurationMs;
|
|
4524
|
+
const bucketEndMs = index === bucketCount - 1 ? durationMs : (index + 1) * bucketDurationMs;
|
|
4525
|
+
const hasSelection = range.hasSelection && range.startSeconds !== null && range.endSeconds !== null;
|
|
4526
|
+
const selectionStartMs = hasSelection ? range.startSeconds * 1000 : 0;
|
|
4527
|
+
const selectionEndMs = hasSelection ? range.endSeconds * 1000 : 0;
|
|
4528
|
+
return {
|
|
4529
|
+
count,
|
|
4530
|
+
endSeconds: roundSeconds(bucketEndMs / 1000),
|
|
4531
|
+
isSelected: hasSelection && bucketEndMs >= selectionStartMs && bucketStartMs <= selectionEndMs,
|
|
4532
|
+
startSeconds: roundSeconds(bucketStartMs / 1000),
|
|
4533
|
+
unitCount: count === 0 ? 0 : Math.max(1, Math.round(count / maxCount * maxBarUnits))
|
|
4534
|
+
};
|
|
4535
|
+
});
|
|
4536
|
+
return {
|
|
4537
|
+
buckets,
|
|
4538
|
+
durationSeconds,
|
|
4539
|
+
endSeconds: range.endSeconds,
|
|
4540
|
+
hasSelection: range.hasSelection,
|
|
4541
|
+
selectionEndPercent,
|
|
4542
|
+
selectionStartPercent,
|
|
4543
|
+
startSeconds: range.startSeconds
|
|
4544
|
+
};
|
|
4545
|
+
};
|
|
4546
|
+
|
|
4080
4547
|
const formatTimelineSeconds = value => {
|
|
4081
4548
|
if (Number.isInteger(value)) {
|
|
4082
4549
|
return `${value}s`;
|
|
@@ -4098,22 +4565,7 @@ const getTimelineNodes = (timelineEvents, timelineStartSeconds, timelineEndSecon
|
|
|
4098
4565
|
if (timelineInfo.buckets.length === 0) {
|
|
4099
4566
|
return [];
|
|
4100
4567
|
}
|
|
4101
|
-
const selectionNodes = timelineInfo.hasSelection
|
|
4102
|
-
childCount: 0,
|
|
4103
|
-
className: ChatDebugViewTimelineSelectionRange,
|
|
4104
|
-
style: `left:${formatPercent(timelineInfo.selectionStartPercent)};width:${formatPercent(timelineInfo.selectionEndPercent - timelineInfo.selectionStartPercent)};`,
|
|
4105
|
-
type: Div
|
|
4106
|
-
}, {
|
|
4107
|
-
childCount: 0,
|
|
4108
|
-
className: joinClassNames(ChatDebugViewTimelineSelectionMarker, ChatDebugViewTimelineSelectionMarkerStart),
|
|
4109
|
-
style: `left:${formatPercent(timelineInfo.selectionStartPercent)};`,
|
|
4110
|
-
type: Div
|
|
4111
|
-
}, {
|
|
4112
|
-
childCount: 0,
|
|
4113
|
-
className: joinClassNames(ChatDebugViewTimelineSelectionMarker, ChatDebugViewTimelineSelectionMarkerEnd),
|
|
4114
|
-
style: `left:${formatPercent(timelineInfo.selectionEndPercent)};`,
|
|
4115
|
-
type: Div
|
|
4116
|
-
}] : [];
|
|
4568
|
+
const selectionNodes = getSelectionNodesDom(timelineInfo.hasSelection, timelineInfo.selectionStartPercent, timelineInfo.selectionEndPercent);
|
|
4117
4569
|
return [{
|
|
4118
4570
|
childCount: 2,
|
|
4119
4571
|
className: ChatDebugViewTimeline,
|
|
@@ -4126,7 +4578,7 @@ const getTimelineNodes = (timelineEvents, timelineStartSeconds, timelineEndSecon
|
|
|
4126
4578
|
}, {
|
|
4127
4579
|
childCount: 1,
|
|
4128
4580
|
className: ChatDebugViewTimelineSummary,
|
|
4129
|
-
type:
|
|
4581
|
+
type: H2
|
|
4130
4582
|
}, text(getTimelineSummary(timelineEvents, effectiveRange.startSeconds, effectiveRange.endSeconds)), {
|
|
4131
4583
|
childCount: 2,
|
|
4132
4584
|
className: ChatDebugViewTimelineInteractive,
|
|
@@ -4144,27 +4596,30 @@ const getTimelineNodes = (timelineEvents, timelineStartSeconds, timelineEndSecon
|
|
|
4144
4596
|
}, ...selectionNodes];
|
|
4145
4597
|
};
|
|
4146
4598
|
|
|
4147
|
-
const getDevtoolsDom = (events, selectedEvent, selectedEventIndex, timelineEvents, timelineStartSeconds, timelineEndSeconds, emptyMessage = noEventsFound(), timelineSelectionActive = false, timelineSelectionAnchorSeconds = '', timelineSelectionFocusSeconds = '', selectedDetailTab = Response, visibleTableColumns = defaultVisibleTableColumns) => {
|
|
4599
|
+
const getDevtoolsDom = (events, selectedEvent, selectedEventIndex, timelineEvents, timelineStartSeconds, timelineEndSeconds, emptyMessage = noEventsFound(), timelineSelectionActive = false, timelineSelectionAnchorSeconds = '', timelineSelectionFocusSeconds = '', selectedDetailTab = Response, visibleTableColumns = defaultVisibleTableColumns, detailTabs = createDetailTabs()) => {
|
|
4148
4600
|
const rowNodes = getDevtoolsRows(events, selectedEventIndex, visibleTableColumns);
|
|
4149
4601
|
const timelineNodes = getTimelineNodes(timelineEvents, timelineStartSeconds, timelineEndSeconds, timelineSelectionActive, timelineSelectionAnchorSeconds, timelineSelectionFocusSeconds);
|
|
4150
|
-
const
|
|
4602
|
+
const previewEvent = selectedEvent ? getPreviewEvent(selectedEvent) : undefined;
|
|
4603
|
+
const previewEventNodes = typeof previewEvent === 'string' ? getTextNode(previewEvent) : previewEvent === undefined ? [] : getEventNode(previewEvent);
|
|
4604
|
+
const payloadEventNodes = selectedEvent ? getEventNode(getPayloadEvent(selectedEvent)) : [];
|
|
4151
4605
|
const responseEventNodes = selectedEvent ? getEventNode(selectedEvent) : [];
|
|
4152
4606
|
const hasSelectedEvent = responseEventNodes.length > 0;
|
|
4153
4607
|
const tableNodes = events.length === 0 ? getEmptyStateDom(emptyMessage) : getTableDom(rowNodes, events.length, visibleTableColumns);
|
|
4154
4608
|
const eventsClassName = getEventsClassName(hasSelectedEvent);
|
|
4155
|
-
const
|
|
4609
|
+
const safeSelectedDetailTab = getSelectedDetailTab(detailTabs, selectedDetailTab);
|
|
4610
|
+
const detailsNodes = getDetailsDom(previewEventNodes, payloadEventNodes, responseEventNodes, selectedEvent, detailTabs, safeSelectedDetailTab);
|
|
4156
4611
|
const sashNodes = getSashNodesDom(hasSelectedEvent);
|
|
4157
4612
|
const splitChildCount = hasSelectedEvent ? 3 : 1;
|
|
4158
4613
|
const mainChildCount = 1 + (timelineNodes.length > 0 ? 1 : 0);
|
|
4159
4614
|
return [{
|
|
4160
4615
|
childCount: mainChildCount,
|
|
4161
4616
|
className: ChatDebugViewDevtoolsMain,
|
|
4162
|
-
role:
|
|
4617
|
+
role: None,
|
|
4163
4618
|
type: Div
|
|
4164
4619
|
}, ...timelineNodes, {
|
|
4165
4620
|
childCount: splitChildCount,
|
|
4166
4621
|
className: ChatDebugViewDevtoolsSplit,
|
|
4167
|
-
role:
|
|
4622
|
+
role: None,
|
|
4168
4623
|
type: Div
|
|
4169
4624
|
}, {
|
|
4170
4625
|
childCount: 1,
|
|
@@ -4176,6 +4631,13 @@ const getDevtoolsDom = (events, selectedEvent, selectedEventIndex, timelineEvent
|
|
|
4176
4631
|
}, ...tableNodes, ...sashNodes, ...detailsNodes];
|
|
4177
4632
|
};
|
|
4178
4633
|
|
|
4634
|
+
const getEmptyMessage = (eventCount, hasFilterValue, useNoToolCallEventsMessage, noFilteredEventsMessage) => {
|
|
4635
|
+
if (eventCount === 0 && hasFilterValue) {
|
|
4636
|
+
return useNoToolCallEventsMessage ? noToolCallEvents() : noFilteredEventsMessage;
|
|
4637
|
+
}
|
|
4638
|
+
return noEventsFound();
|
|
4639
|
+
};
|
|
4640
|
+
|
|
4179
4641
|
const getLegacyEventsDom = (errorMessage, emptyMessage, eventNodes) => {
|
|
4180
4642
|
return [{
|
|
4181
4643
|
childCount: eventNodes.length === 0 ? 1 : eventNodes.length,
|
|
@@ -4190,16 +4652,16 @@ const getLegacyEventsDom = (errorMessage, emptyMessage, eventNodes) => {
|
|
|
4190
4652
|
}, text(errorMessage || emptyMessage)] : eventNodes)];
|
|
4191
4653
|
};
|
|
4192
4654
|
|
|
4193
|
-
const getQuickFilterNodes = (eventCategoryFilter,
|
|
4655
|
+
const getQuickFilterNodes = (eventCategoryFilter, categoryFilters) => {
|
|
4194
4656
|
return [{
|
|
4195
|
-
childCount:
|
|
4657
|
+
childCount: categoryFilters.length,
|
|
4196
4658
|
className: ChatDebugViewQuickFilters,
|
|
4197
4659
|
type: Div
|
|
4198
|
-
}, ...
|
|
4199
|
-
const isSelected =
|
|
4660
|
+
}, ...categoryFilters.flatMap(categoryFilter => {
|
|
4661
|
+
const isSelected = categoryFilter.name === eventCategoryFilter;
|
|
4200
4662
|
return [{
|
|
4201
4663
|
childCount: 2,
|
|
4202
|
-
className:
|
|
4664
|
+
className: mergeClassNames(ChatDebugViewQuickFilterPill, isSelected ? ChatDebugViewQuickFilterPillSelected : ''),
|
|
4203
4665
|
type: Label
|
|
4204
4666
|
}, {
|
|
4205
4667
|
checked: isSelected,
|
|
@@ -4209,8 +4671,8 @@ const getQuickFilterNodes = (eventCategoryFilter, eventCategoryFilterOptions) =>
|
|
|
4209
4671
|
name: EventCategoryFilter,
|
|
4210
4672
|
onChange: HandleEventCategoryFilter,
|
|
4211
4673
|
type: Input,
|
|
4212
|
-
value:
|
|
4213
|
-
}, text(
|
|
4674
|
+
value: categoryFilter.name
|
|
4675
|
+
}, text(categoryFilter.label)];
|
|
4214
4676
|
})];
|
|
4215
4677
|
};
|
|
4216
4678
|
|
|
@@ -4229,7 +4691,7 @@ const getTimelineFilterDescription = (timelineStartSeconds, timelineEndSeconds)
|
|
|
4229
4691
|
return '';
|
|
4230
4692
|
};
|
|
4231
4693
|
|
|
4232
|
-
const getChatDebugViewDom = (errorMessage, filterValue, eventCategoryFilter,
|
|
4694
|
+
const getChatDebugViewDom = (errorMessage, filterValue, eventCategoryFilter, categoryFilters, _showEventStreamFinishedEvents, _showInputEvents, _showResponsePartEvents, useDevtoolsLayout, selectedEvent, selectedEventIndex, timelineStartSeconds, timelineEndSeconds, timelineEvents, events, timelineSelectionActive = false, timelineSelectionAnchorSeconds = '', timelineSelectionFocusSeconds = '', selectedDetailTab = Response, visibleTableColumns = defaultVisibleTableColumns, detailTabs = createDetailTabs()) => {
|
|
4233
4695
|
if (errorMessage) {
|
|
4234
4696
|
return getDebugErrorDom(errorMessage);
|
|
4235
4697
|
}
|
|
@@ -4250,15 +4712,15 @@ const getChatDebugViewDom = (errorMessage, filterValue, eventCategoryFilter, eve
|
|
|
4250
4712
|
const filterDescription = filterDescriptionParts.join(' ');
|
|
4251
4713
|
const noFilteredEventsMessage = noEventsFoundMatching(filterDescription);
|
|
4252
4714
|
const useNoToolCallEventsMessage = eventCategoryFilter === Tools && !trimmedFilterValue && !hasTimelineFilter;
|
|
4253
|
-
const emptyMessage = events.length
|
|
4715
|
+
const emptyMessage = getEmptyMessage(events.length, hasFilterValue, useNoToolCallEventsMessage, noFilteredEventsMessage);
|
|
4254
4716
|
const safeSelectedEventIndex = selectedEventIndex === null || selectedEventIndex < 0 || selectedEventIndex >= events.length ? null : selectedEventIndex;
|
|
4255
|
-
const contentNodes = useDevtoolsLayout ? getDevtoolsDom(events, selectedEvent, safeSelectedEventIndex, timelineEvents, timelineStartSeconds, timelineEndSeconds, emptyMessage, timelineSelectionActive, timelineSelectionAnchorSeconds, timelineSelectionFocusSeconds,
|
|
4256
|
-
const quickFilterNodes = useDevtoolsLayout ? getQuickFilterNodes(eventCategoryFilter,
|
|
4717
|
+
const contentNodes = useDevtoolsLayout ? getDevtoolsDom(events, selectedEvent, safeSelectedEventIndex, timelineEvents, timelineStartSeconds, timelineEndSeconds, emptyMessage, timelineSelectionActive, timelineSelectionAnchorSeconds, timelineSelectionFocusSeconds, getSelectedDetailTab(detailTabs, selectedDetailTab), visibleTableColumns, detailTabs) : getLegacyEventsDom(errorMessage, emptyMessage, events.flatMap(getEventNode));
|
|
4718
|
+
const quickFilterNodes = useDevtoolsLayout ? getQuickFilterNodes(eventCategoryFilter, categoryFilters) : [];
|
|
4257
4719
|
const debugViewTopDom = getDebugViewTopDom(filterValue, useDevtoolsLayout, quickFilterNodes);
|
|
4258
4720
|
const rootChildCount = 2;
|
|
4259
4721
|
return [{
|
|
4260
4722
|
childCount: rootChildCount,
|
|
4261
|
-
className:
|
|
4723
|
+
className: mergeClassNames(ChatDebugView, useDevtoolsLayout ? ChatDebugViewDevtools : ''),
|
|
4262
4724
|
type: Div
|
|
4263
4725
|
}, ...debugViewTopDom, ...contentNodes];
|
|
4264
4726
|
};
|
|
@@ -4277,7 +4739,7 @@ const renderItems = (oldState, newState) => {
|
|
|
4277
4739
|
}
|
|
4278
4740
|
const timelineEvents = getTimelineEvents(newState);
|
|
4279
4741
|
const filteredEvents = filterEventsByTimelineRange(timelineEvents, newState.timelineStartSeconds, newState.timelineEndSeconds);
|
|
4280
|
-
const dom = getChatDebugViewDom(newState.errorMessage, newState.filterValue, newState.eventCategoryFilter, newState.
|
|
4742
|
+
const dom = getChatDebugViewDom(newState.errorMessage, newState.filterValue, newState.eventCategoryFilter, newState.categoryFilters, newState.showEventStreamFinishedEvents, newState.showInputEvents, newState.showResponsePartEvents, newState.useDevtoolsLayout, newState.selectedEvent, newState.selectedEventIndex, newState.timelineStartSeconds, newState.timelineEndSeconds, withSessionEventIds(timelineEvents), withSessionEventIds(filteredEvents), newState.timelineSelectionActive, newState.timelineSelectionAnchorSeconds, newState.timelineSelectionFocusSeconds, newState.selectedDetailTab, newState.visibleTableColumns, newState.detailTabs);
|
|
4281
4743
|
return [SetDom2, newState.uid, dom];
|
|
4282
4744
|
};
|
|
4283
4745
|
|
|
@@ -4353,8 +4815,8 @@ const renderEventListeners = () => {
|
|
|
4353
4815
|
name: HandleEventCategoryFilter,
|
|
4354
4816
|
params: ['handleEventCategoryFilter', TargetValue]
|
|
4355
4817
|
}, {
|
|
4356
|
-
name:
|
|
4357
|
-
params: ['
|
|
4818
|
+
name: SelectDetailTab,
|
|
4819
|
+
params: ['selectDetailTab', TargetValue]
|
|
4358
4820
|
}, {
|
|
4359
4821
|
name: HandleTimelineRangePreset,
|
|
4360
4822
|
params: ['handleTimelineRangePreset', 'event.target.dataset.value']
|
|
@@ -4377,6 +4839,16 @@ const renderEventListeners = () => {
|
|
|
4377
4839
|
}, {
|
|
4378
4840
|
name: HandleSashPointerUp,
|
|
4379
4841
|
params: ['handleSashPointerUp', ClientX, ClientY]
|
|
4842
|
+
}, {
|
|
4843
|
+
name: HandleTableResizerPointerDown,
|
|
4844
|
+
params: ['handleTableResizerPointerDown', TargetName, ClientX],
|
|
4845
|
+
trackPointerEvents: [HandleTableResizerPointerMove, HandleTableResizerPointerUp]
|
|
4846
|
+
}, {
|
|
4847
|
+
name: HandleTableResizerPointerMove,
|
|
4848
|
+
params: ['handleTableResizerPointerMove', ClientX]
|
|
4849
|
+
}, {
|
|
4850
|
+
name: HandleTableResizerPointerUp,
|
|
4851
|
+
params: ['handleTableResizerPointerUp']
|
|
4380
4852
|
}, {
|
|
4381
4853
|
name: HandleTimelinePointerDown,
|
|
4382
4854
|
params: ['handleTimelinePointerDown', ClientX],
|
|
@@ -4400,12 +4872,14 @@ const rerender = state => {
|
|
|
4400
4872
|
const isSameVisibleTableColumns = (a, b) => {
|
|
4401
4873
|
return a.length === b.length && a.every((value, index) => value === b[index]);
|
|
4402
4874
|
};
|
|
4875
|
+
|
|
4403
4876
|
const resetTableColumns = state => {
|
|
4404
|
-
if (isSameVisibleTableColumns(state.visibleTableColumns, defaultVisibleTableColumns)) {
|
|
4877
|
+
if (isSameVisibleTableColumns(state.visibleTableColumns, defaultVisibleTableColumns) && isSameTableColumnWidths(state.tableColumnWidths, defaultTableColumnWidths)) {
|
|
4405
4878
|
return state;
|
|
4406
4879
|
}
|
|
4407
4880
|
return {
|
|
4408
4881
|
...state,
|
|
4882
|
+
tableColumnWidths: defaultTableColumnWidths,
|
|
4409
4883
|
visibleTableColumns: defaultVisibleTableColumns
|
|
4410
4884
|
};
|
|
4411
4885
|
};
|
|
@@ -4438,6 +4912,7 @@ const saveState = state => {
|
|
|
4438
4912
|
selectedDetailTab,
|
|
4439
4913
|
selectedEventId,
|
|
4440
4914
|
sessionId,
|
|
4915
|
+
tableColumnWidths,
|
|
4441
4916
|
timelineEndSeconds,
|
|
4442
4917
|
timelineStartSeconds,
|
|
4443
4918
|
visibleTableColumns
|
|
@@ -4448,6 +4923,7 @@ const saveState = state => {
|
|
|
4448
4923
|
selectedDetailTab,
|
|
4449
4924
|
selectedEventId,
|
|
4450
4925
|
sessionId,
|
|
4926
|
+
tableColumnWidths,
|
|
4451
4927
|
timelineEndSeconds,
|
|
4452
4928
|
timelineStartSeconds,
|
|
4453
4929
|
visibleTableColumns
|
|
@@ -4470,7 +4946,13 @@ const setSessionIdDependencies = {
|
|
|
4470
4946
|
listChatViewEvents: listChatViewEvents
|
|
4471
4947
|
};
|
|
4472
4948
|
const setSessionId = async (state, sessionId) => {
|
|
4473
|
-
const
|
|
4949
|
+
const {
|
|
4950
|
+
databaseName,
|
|
4951
|
+
dataBaseVersion,
|
|
4952
|
+
eventStoreName,
|
|
4953
|
+
sessionIdIndexName
|
|
4954
|
+
} = state;
|
|
4955
|
+
const result = await setSessionIdDependencies.listChatViewEvents(sessionId, databaseName, dataBaseVersion, eventStoreName, sessionIdIndexName);
|
|
4474
4956
|
if (result.type === 'error') {
|
|
4475
4957
|
return {
|
|
4476
4958
|
...state,
|
|
@@ -4525,7 +5007,6 @@ const commandMap = {
|
|
|
4525
5007
|
'ChatDebug.handleCloseDetails': wrapCommand(handleCloseDetails),
|
|
4526
5008
|
'ChatDebug.handleDetailsContextMenu': wrapCommand(handleDetailsContextMenu),
|
|
4527
5009
|
'ChatDebug.handleDetailsTopContextMenu': wrapCommand(handleDetailsTopContextMenu),
|
|
4528
|
-
'ChatDebug.handleDetailTab': wrapCommand(handleDetailTab),
|
|
4529
5010
|
'ChatDebug.handleEventCategoryFilter': wrapCommand(handleEventCategoryFilter),
|
|
4530
5011
|
'ChatDebug.handleEventRowClick': wrapCommand(handleEventRowClick),
|
|
4531
5012
|
'ChatDebug.handleHeaderContextMenu': wrapCommand(handleHeaderContextMenu),
|
|
@@ -4537,6 +5018,10 @@ const commandMap = {
|
|
|
4537
5018
|
'ChatDebug.handleShowInputEvents': wrapCommand(handleShowInputEvents),
|
|
4538
5019
|
'ChatDebug.handleShowResponsePartEvents': wrapCommand(handleShowResponsePartEvents),
|
|
4539
5020
|
'ChatDebug.handleTableBodyContextMenu': wrapCommand(handleTableBodyContextMenu),
|
|
5021
|
+
'ChatDebug.handleTableResizerPointerDown': wrapCommand(handleTableResizerPointerDown),
|
|
5022
|
+
'ChatDebug.handleTableResizerPointerMove': wrapCommand(handleTableResizerPointerMove),
|
|
5023
|
+
'ChatDebug.handleTableResizerPointerUp': wrapCommand(handleTableResizerPointerUp),
|
|
5024
|
+
'ChatDebug.handleTableRowCopy': wrapCommand(handleTableRowCopy),
|
|
4540
5025
|
'ChatDebug.handleTimelineContextMenu': wrapCommand(handleTimelineContextMenu),
|
|
4541
5026
|
'ChatDebug.handleTimelineDoubleClick': wrapCommand(handleTimelineDoubleClick),
|
|
4542
5027
|
'ChatDebug.handleTimelineEndSeconds': wrapCommand(handleTimelineEndSeconds),
|
|
@@ -4545,7 +5030,7 @@ const commandMap = {
|
|
|
4545
5030
|
'ChatDebug.handleTimelinePointerUp': wrapCommand(handleTimelinePointerUp),
|
|
4546
5031
|
'ChatDebug.handleTimelineRangePreset': wrapCommand(handleTimelineRangePreset),
|
|
4547
5032
|
'ChatDebug.handleTimelineStartSeconds': wrapCommand(handleTimelineStartSeconds),
|
|
4548
|
-
'ChatDebug.handleUseDevtoolsLayout': wrapCommand(
|
|
5033
|
+
'ChatDebug.handleUseDevtoolsLayout': wrapCommand(setUseDevtoolsLayout),
|
|
4549
5034
|
'ChatDebug.loadContent': wrapCommand(loadContent),
|
|
4550
5035
|
'ChatDebug.loadContent2': wrapCommand(loadContent),
|
|
4551
5036
|
'ChatDebug.refresh': wrapCommand(refresh),
|
|
@@ -4555,6 +5040,7 @@ const commandMap = {
|
|
|
4555
5040
|
'ChatDebug.resetTableColumns': wrapCommand(resetTableColumns),
|
|
4556
5041
|
'ChatDebug.resize': wrapCommand(resize),
|
|
4557
5042
|
'ChatDebug.saveState': wrapGetter(saveState),
|
|
5043
|
+
'ChatDebug.selectDetailTab': wrapCommand(selectDetailTab),
|
|
4558
5044
|
'ChatDebug.setEvents': wrapCommand(setEvents),
|
|
4559
5045
|
'ChatDebug.setSessionId': wrapCommand(setSessionId),
|
|
4560
5046
|
'ChatDebug.terminate': terminate,
|