aboutsummaryrefslogtreecommitdiff
path: root/modules/core
diff options
context:
space:
mode:
Diffstat (limited to 'modules/core')
-rw-r--r--modules/core/core-bundle.js73
-rw-r--r--modules/core/module-aiassist.js31
-rw-r--r--modules/core/module-loader.js2
-rw-r--r--modules/core/terminal.js42
4 files changed, 125 insertions, 23 deletions
diff --git a/modules/core/core-bundle.js b/modules/core/core-bundle.js
index 2264ef0..245f2bd 100644
--- a/modules/core/core-bundle.js
+++ b/modules/core/core-bundle.js
@@ -2918,6 +2918,16 @@ Only output XML function calls for tool tasks. If no tool is needed, answer norm
this.hideAutocomplete();
}
});
+ // 2026-10-22: dashboard.html wrote this key on ⟳ Refresh and nothing listened.
+ window.addEventListener('storage', function (ev) {
+ if (ev.key !== 'webx11_dashboard_data_request') return;
+ const aiMod = this.moduleManager && this.moduleManager.modules
+ ? this.moduleManager.modules.WebX11AIAssistantModule : null;
+ if (aiMod && typeof aiMod._collectDashboardData === 'function') {
+ aiMod._collectDashboardData();
+ }
+ }.bind(this));
+
window.addEventListener('online', () => this.updateNetworkStatus());
window.addEventListener('offline', () => this.updateNetworkStatus());
document.getElementById('file-upload-input').addEventListener('change', (e) => {
@@ -4014,18 +4024,28 @@ Only output XML function calls for tool tasks. If no tool is needed, answer norm
if (cmd === 'smart-prompt') { const val = args[0] && args[0] === 'off' ? 'off' : 'on'; localStorage.setItem('webx11_smart_prompt', val); this.print('Smart prompt ' + val, 'success'); this.updatePrompt(); return; }
if (cmd === 'mem') { this.printMemoryStats(); return; }
if (cmd === 'dashboard') {
- // Collect dashboard data and open the dashboard page
- const aiMod = this.moduleManager?.modules?.WebX11AIAssistantModule;
- if (aiMod && typeof aiMod._collectDashboardData === 'function') {
- aiMod._collectDashboardData().then(function() {
- this.print('πŸ“Š Dashboard data collected β€” opening dashboard...', 'success');
- window.open('/spaces/newos4/downloads/dashboard.html', 'newOS4 Dashboard', 'width=1200,height=800');
- }.bind(this));
- } else {
- // Fallback: just open the page (it will try localStorage)
- this.print('πŸ“Š Opening dashboard...', 'info');
- window.open('/spaces/newos4/downloads/dashboard.html', 'newOS4 Dashboard', 'width=1200,height=800');
+ const aiMod = this.moduleManager && this.moduleManager.modules
+ ? this.moduleManager.modules.WebX11AIAssistantModule : null;
+ const collect = function () {
+ if (aiMod && typeof aiMod._collectDashboardData === 'function') return aiMod._collectDashboardData();
+ return Promise.resolve(null);
+ };
+ if (args.indexOf('--stop') !== -1) {
+ if (this._dashTimer) { clearInterval(this._dashTimer); this._dashTimer = null; this.print('πŸ“Š Dashboard watch stopped', 'info'); }
+ else this.print('πŸ“Š Dashboard watch is not running', 'warning');
+ return;
+ }
+ if (args.indexOf('--watch') !== -1) {
+ if (this._dashTimer) clearInterval(this._dashTimer);
+ collect();
+ this._dashTimer = setInterval(collect, 5000);
+ this.print('πŸ“Š Dashboard watch on (5s) β€” open the dashboard tab; `dashboard --stop` to stop', 'success');
+ return;
}
+ collect().then(function () {
+ this.print('πŸ“Š Dashboard data collected β€” opening dashboard...', 'success');
+ window.open('/spaces/newos4/downloads/dashboard.html', 'newOS4 Dashboard', 'width=1200,height=800');
+ }.bind(this));
return;
}
if (cmd === 'config') {
@@ -12794,6 +12814,37 @@ buildSystemPrompt() {
predictorAccuracy: predictorAcc
};
+ // 2026-10-22: the panel had a renderer and no collector, so it always said
+ // "Not synthesized yet" while WorldModelModule._model was right there.
+ // Map the model shape (modules.loaded, skills.count, files.total, memory.nodes…)
+ // onto the keys the page reads (modules, skills, files, memoryNodes…).
+ try {
+ var wm = mm ? mm.modules['WorldModelModule'] : null;
+ var wmModel = wm && wm._model;
+ if (wmModel) {
+ data.worldModel = {
+ synthesized: wmModel.synthesized || null,
+ version: wmModel.version || '?',
+ modules: wmModel.modules ? wmModel.modules.loaded : null,
+ skills: wmModel.skills ? wmModel.skills.count : null,
+ files: wmModel.files ? wmModel.files.total : null,
+ agents: wmModel.agents ? wmModel.agents.agents : null,
+ memoryNodes: wmModel.memory ? wmModel.memory.nodes : null,
+ memoryEdges: wmModel.memory ? wmModel.memory.edges : null,
+ health: wmModel.system ? wmModel.system.health : null,
+ activeProjects: ((wmModel.projects && wmModel.projects.activeProjects) || [])
+ .map(function (p) { return p.name + ' (' + p.accesses + 'x)'; }),
+ recent: (wmModel.recent || []).slice(0, 5),
+ changes: (typeof wm._diffSincePrev === 'function') ? wm._diffSincePrev() : [],
+ errors: (typeof wm._errorSample === 'function') ? wm._errorSample() : []
+ };
+ } else {
+ data.worldModel = { missing: true };
+ }
+ } catch (e) {
+ data.worldModel = { missing: true, error: e.message };
+ }
+
data.timestamp = Date.now();
// Write to localStorage for the dashboard HTML page to read
diff --git a/modules/core/module-aiassist.js b/modules/core/module-aiassist.js
index a8c0ae1..abbe9ce 100644
--- a/modules/core/module-aiassist.js
+++ b/modules/core/module-aiassist.js
@@ -4632,6 +4632,37 @@ buildSystemPrompt() {
predictorAccuracy: predictorAcc
};
+ // 2026-10-22: the panel had a renderer and no collector, so it always said
+ // "Not synthesized yet" while WorldModelModule._model was right there.
+ // Map the model shape (modules.loaded, skills.count, files.total, memory.nodes…)
+ // onto the keys the page reads (modules, skills, files, memoryNodes…).
+ try {
+ var wm = mm ? mm.modules['WorldModelModule'] : null;
+ var wmModel = wm && wm._model;
+ if (wmModel) {
+ data.worldModel = {
+ synthesized: wmModel.synthesized || null,
+ version: wmModel.version || '?',
+ modules: wmModel.modules ? wmModel.modules.loaded : null,
+ skills: wmModel.skills ? wmModel.skills.count : null,
+ files: wmModel.files ? wmModel.files.total : null,
+ agents: wmModel.agents ? wmModel.agents.agents : null,
+ memoryNodes: wmModel.memory ? wmModel.memory.nodes : null,
+ memoryEdges: wmModel.memory ? wmModel.memory.edges : null,
+ health: wmModel.system ? wmModel.system.health : null,
+ activeProjects: ((wmModel.projects && wmModel.projects.activeProjects) || [])
+ .map(function (p) { return p.name + ' (' + p.accesses + 'x)'; }),
+ recent: (wmModel.recent || []).slice(0, 5),
+ changes: (typeof wm._diffSincePrev === 'function') ? wm._diffSincePrev() : [],
+ errors: (typeof wm._errorSample === 'function') ? wm._errorSample() : []
+ };
+ } else {
+ data.worldModel = { missing: true };
+ }
+ } catch (e) {
+ data.worldModel = { missing: true, error: e.message };
+ }
+
data.timestamp = Date.now();
// Write to localStorage for the dashboard HTML page to read
diff --git a/modules/core/module-loader.js b/modules/core/module-loader.js
index 64ece7c..46aad17 100644
--- a/modules/core/module-loader.js
+++ b/modules/core/module-loader.js
@@ -4,7 +4,7 @@
// Core module bundle loaded synchronously in main.html.
// This loader only handles version cache-busting, splash, terminal init, and optional ext modules.
- const LATEST_VER = 'v4.6.50';
+ const LATEST_VER = 'v4.6.51';
const CACHE = '?v=' + LATEST_VER;
const stored = localStorage.getItem('webx11_cache_ver');
if (stored !== LATEST_VER) {
diff --git a/modules/core/terminal.js b/modules/core/terminal.js
index 425c5d6..c586538 100644
--- a/modules/core/terminal.js
+++ b/modules/core/terminal.js
@@ -479,6 +479,16 @@
this.hideAutocomplete();
}
});
+ // 2026-10-22: dashboard.html wrote this key on ⟳ Refresh and nothing listened.
+ window.addEventListener('storage', function (ev) {
+ if (ev.key !== 'webx11_dashboard_data_request') return;
+ const aiMod = this.moduleManager && this.moduleManager.modules
+ ? this.moduleManager.modules.WebX11AIAssistantModule : null;
+ if (aiMod && typeof aiMod._collectDashboardData === 'function') {
+ aiMod._collectDashboardData();
+ }
+ }.bind(this));
+
window.addEventListener('online', () => this.updateNetworkStatus());
window.addEventListener('offline', () => this.updateNetworkStatus());
document.getElementById('file-upload-input').addEventListener('change', (e) => {
@@ -1575,18 +1585,28 @@
if (cmd === 'smart-prompt') { const val = args[0] && args[0] === 'off' ? 'off' : 'on'; localStorage.setItem('webx11_smart_prompt', val); this.print('Smart prompt ' + val, 'success'); this.updatePrompt(); return; }
if (cmd === 'mem') { this.printMemoryStats(); return; }
if (cmd === 'dashboard') {
- // Collect dashboard data and open the dashboard page
- const aiMod = this.moduleManager?.modules?.WebX11AIAssistantModule;
- if (aiMod && typeof aiMod._collectDashboardData === 'function') {
- aiMod._collectDashboardData().then(function() {
- this.print('πŸ“Š Dashboard data collected β€” opening dashboard...', 'success');
- window.open('/spaces/newos4/downloads/dashboard.html', 'newOS4 Dashboard', 'width=1200,height=800');
- }.bind(this));
- } else {
- // Fallback: just open the page (it will try localStorage)
- this.print('πŸ“Š Opening dashboard...', 'info');
- window.open('/spaces/newos4/downloads/dashboard.html', 'newOS4 Dashboard', 'width=1200,height=800');
+ const aiMod = this.moduleManager && this.moduleManager.modules
+ ? this.moduleManager.modules.WebX11AIAssistantModule : null;
+ const collect = function () {
+ if (aiMod && typeof aiMod._collectDashboardData === 'function') return aiMod._collectDashboardData();
+ return Promise.resolve(null);
+ };
+ if (args.indexOf('--stop') !== -1) {
+ if (this._dashTimer) { clearInterval(this._dashTimer); this._dashTimer = null; this.print('πŸ“Š Dashboard watch stopped', 'info'); }
+ else this.print('πŸ“Š Dashboard watch is not running', 'warning');
+ return;
}
+ if (args.indexOf('--watch') !== -1) {
+ if (this._dashTimer) clearInterval(this._dashTimer);
+ collect();
+ this._dashTimer = setInterval(collect, 5000);
+ this.print('πŸ“Š Dashboard watch on (5s) β€” open the dashboard tab; `dashboard --stop` to stop', 'success');
+ return;
+ }
+ collect().then(function () {
+ this.print('πŸ“Š Dashboard data collected β€” opening dashboard...', 'success');
+ window.open('/spaces/newos4/downloads/dashboard.html', 'newOS4 Dashboard', 'width=1200,height=800');
+ }.bind(this));
return;
}
if (cmd === 'config') {