aboutsummaryrefslogtreecommitdiff
path: root/modules/core/virtual-fs.js
diff options
context:
space:
mode:
Diffstat (limited to 'modules/core/virtual-fs.js')
-rw-r--r--modules/core/virtual-fs.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/core/virtual-fs.js b/modules/core/virtual-fs.js
index 7f6b441..d8b5098 100644
--- a/modules/core/virtual-fs.js
+++ b/modules/core/virtual-fs.js
@@ -37,6 +37,7 @@ class VirtualFileSystem {
const vmCache = {}; // factories can cache costly results within same tick
const mm = () => typeof window !== 'undefined' ? window.webx11?.moduleManager?.modules : null;
const ai = () => mm()?.WebX11AIAssistantModule || null;
+ const ds = () => mm()?.DebugSupervisorModule || null;
const heap = () => typeof performance !== 'undefined' && performance.memory ? performance.memory : null;
const fmt = (bytes) => {
if (!bytes && bytes !== 0) return 'N/A';
@@ -112,7 +113,7 @@ class VirtualFileSystem {
const a = ai();
const cCount = a?.context?.length || 0;
const lCount = a?._toolCallLog?.length || 0;
- const eCount = a?._errorLog?.length || 0;
+ const eCount = ds() ? Object.keys(ds()._errorDB?.errors || {}).length : 0;
const modules = mm() ? Object.keys(mm()).length : 0;
const domNodes = typeof document !== 'undefined' ? document.querySelectorAll('*').length : 0;
return [
@@ -166,9 +167,12 @@ class VirtualFileSystem {
return a._toolCallLog.map((e, i) => `[${i}] ${JSON.stringify(e)}`).join('\n');
}),
'errors': vm('errors', () => {
- const a = ai();
- if (!a || !a._errorLog || a._errorLog.length === 0) return '(empty)';
- return a._errorLog.map((e, i) => `[${i}] ${JSON.stringify(e)}`).join('\n');
+ const d = ds();
+ if (!d || !d._errorDB || Object.keys(d._errorDB.errors).length === 0) return '(empty)';
+ return Object.entries(d._errorDB.errors)
+ .sort((a, b) => b[1].lastSeen - a[1].lastSeen)
+ .map(([hash, e]) => `[${hash}] ${e.type}/${e.severity} ×${e.count}: ${e.message.substring(0, 100)}`)
+ .join('\n');
}),
'commands': vm('commands', () => {
const a = ai();