lance-context 1.19.0 → 1.20.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/dashboard/ui.ts"],"names":[],"mappings":"AAkCA;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/dashboard/ui.ts"],"names":[],"mappings":"AAkCA;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAurDzC"}
|
package/dist/dashboard/ui.js
CHANGED
|
@@ -1600,6 +1600,9 @@ export function getDashboardHTML() {
|
|
|
1600
1600
|
|
|
1601
1601
|
// Fetch initial data
|
|
1602
1602
|
async function fetchData() {
|
|
1603
|
+
log.info('Fetching dashboard data...');
|
|
1604
|
+
const startTime = performance.now();
|
|
1605
|
+
|
|
1603
1606
|
// Use Promise.allSettled to handle partial failures gracefully
|
|
1604
1607
|
const results = await Promise.allSettled([
|
|
1605
1608
|
fetch('/api/status'),
|
|
@@ -1608,6 +1611,9 @@ export function getDashboardHTML() {
|
|
|
1608
1611
|
fetch('/api/beads')
|
|
1609
1612
|
]);
|
|
1610
1613
|
|
|
1614
|
+
const elapsed = Math.round(performance.now() - startTime);
|
|
1615
|
+
log.info('API requests completed in ' + elapsed + 'ms');
|
|
1616
|
+
|
|
1611
1617
|
let currentStatus = null;
|
|
1612
1618
|
let currentConfig = null;
|
|
1613
1619
|
|
|
@@ -1615,20 +1621,26 @@ export function getDashboardHTML() {
|
|
|
1615
1621
|
if (results[0].status === 'fulfilled' && results[0].value.ok) {
|
|
1616
1622
|
try {
|
|
1617
1623
|
currentStatus = await results[0].value.json();
|
|
1624
|
+
log.info('Status loaded', currentStatus);
|
|
1618
1625
|
updateStatus(currentStatus);
|
|
1619
1626
|
} catch (e) {
|
|
1620
|
-
|
|
1627
|
+
log.error('Failed to parse status', e);
|
|
1621
1628
|
}
|
|
1629
|
+
} else {
|
|
1630
|
+
log.warn('Failed to fetch status', results[0]);
|
|
1622
1631
|
}
|
|
1623
1632
|
|
|
1624
1633
|
// Process config result
|
|
1625
1634
|
if (results[1].status === 'fulfilled' && results[1].value.ok) {
|
|
1626
1635
|
try {
|
|
1627
1636
|
currentConfig = await results[1].value.json();
|
|
1637
|
+
log.info('Config loaded', currentConfig);
|
|
1628
1638
|
updateConfig(currentConfig);
|
|
1629
1639
|
} catch (e) {
|
|
1630
|
-
|
|
1640
|
+
log.error('Failed to parse config', e);
|
|
1631
1641
|
}
|
|
1642
|
+
} else {
|
|
1643
|
+
log.warn('Failed to fetch config', results[1]);
|
|
1632
1644
|
}
|
|
1633
1645
|
|
|
1634
1646
|
// Check if configured backend differs from running backend
|
|
@@ -1661,21 +1673,34 @@ export function getDashboardHTML() {
|
|
|
1661
1673
|
}
|
|
1662
1674
|
}
|
|
1663
1675
|
|
|
1676
|
+
// Logging utility for browser console
|
|
1677
|
+
const log = {
|
|
1678
|
+
info: (msg, data) => console.log('%c[lance-context]%c ' + msg, 'color: #58a6ff; font-weight: bold', 'color: inherit', data || ''),
|
|
1679
|
+
warn: (msg, data) => console.warn('%c[lance-context]%c ' + msg, 'color: #d29922; font-weight: bold', 'color: inherit', data || ''),
|
|
1680
|
+
error: (msg, data) => console.error('%c[lance-context]%c ' + msg, 'color: #f85149; font-weight: bold', 'color: inherit', data || ''),
|
|
1681
|
+
event: (name, data) => console.log('%c[lance-context]%c SSE: %c' + name, 'color: #58a6ff; font-weight: bold', 'color: inherit', 'color: #3fb950', data || ''),
|
|
1682
|
+
};
|
|
1683
|
+
|
|
1684
|
+
log.info('Dashboard initialized');
|
|
1685
|
+
|
|
1664
1686
|
// Connect to SSE
|
|
1665
1687
|
function connectSSE() {
|
|
1666
1688
|
if (eventSource) {
|
|
1667
1689
|
eventSource.close();
|
|
1668
1690
|
}
|
|
1669
1691
|
|
|
1692
|
+
log.info('Connecting to SSE...');
|
|
1670
1693
|
eventSource = new EventSource('/api/events');
|
|
1671
1694
|
|
|
1672
1695
|
eventSource.addEventListener('connected', (e) => {
|
|
1696
|
+
log.event('connected');
|
|
1673
1697
|
setConnected(true);
|
|
1674
1698
|
fetchData();
|
|
1675
1699
|
});
|
|
1676
1700
|
|
|
1677
1701
|
eventSource.addEventListener('indexing:progress', (e) => {
|
|
1678
1702
|
const progress = JSON.parse(e.data);
|
|
1703
|
+
log.event('indexing:progress', progress);
|
|
1679
1704
|
progressContainer.className = 'progress-container active';
|
|
1680
1705
|
indexBadge.textContent = 'Indexing...';
|
|
1681
1706
|
indexBadge.className = 'badge warning pulsing';
|
|
@@ -1683,6 +1708,7 @@ export function getDashboardHTML() {
|
|
|
1683
1708
|
});
|
|
1684
1709
|
|
|
1685
1710
|
eventSource.addEventListener('indexing:start', () => {
|
|
1711
|
+
log.event('indexing:start');
|
|
1686
1712
|
progressContainer.className = 'progress-container active';
|
|
1687
1713
|
indexBadge.textContent = 'Indexing...';
|
|
1688
1714
|
indexBadge.className = 'badge warning pulsing';
|
|
@@ -1691,27 +1717,31 @@ export function getDashboardHTML() {
|
|
|
1691
1717
|
});
|
|
1692
1718
|
|
|
1693
1719
|
eventSource.addEventListener('indexing:complete', () => {
|
|
1720
|
+
log.event('indexing:complete');
|
|
1694
1721
|
progressContainer.className = 'progress-container';
|
|
1695
1722
|
fetchData();
|
|
1696
1723
|
});
|
|
1697
1724
|
|
|
1698
1725
|
eventSource.addEventListener('status:change', (e) => {
|
|
1699
1726
|
const status = JSON.parse(e.data);
|
|
1727
|
+
log.event('status:change', status);
|
|
1700
1728
|
updateStatus(status);
|
|
1701
1729
|
});
|
|
1702
1730
|
|
|
1703
1731
|
eventSource.addEventListener('usage:update', (e) => {
|
|
1704
1732
|
const usage = JSON.parse(e.data);
|
|
1733
|
+
log.event('usage:update', { count: usage.length });
|
|
1705
1734
|
// The event data is the usage array, need to compute total
|
|
1706
1735
|
const total = usage.reduce((sum, u) => sum + u.count, 0);
|
|
1707
1736
|
updateUsage({ usage, total });
|
|
1708
1737
|
});
|
|
1709
1738
|
|
|
1710
1739
|
eventSource.addEventListener('heartbeat', () => {
|
|
1711
|
-
// Just keep connection alive
|
|
1740
|
+
// Just keep connection alive - don't log to reduce noise
|
|
1712
1741
|
});
|
|
1713
1742
|
|
|
1714
|
-
eventSource.onerror = () => {
|
|
1743
|
+
eventSource.onerror = (e) => {
|
|
1744
|
+
log.warn('SSE connection error, will reconnect...', e);
|
|
1715
1745
|
setConnected(false);
|
|
1716
1746
|
// EventSource will automatically reconnect
|
|
1717
1747
|
};
|
package/dist/dashboard/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/dashboard/ui.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;OAwBV,CAAC;AAER;;GAEG;AACH,MAAM,WAAW,GAAG,sBAAsB,kBAAkB,CAAC,onCAAonC,CAAC,EAAE,CAAC;AAErrC;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO;;;;;;gDAMuC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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