From c1f35df65701aaa8d70482ce35bf05f3c6f953c9 Mon Sep 17 00:00:00 2001 From: v6ole Date: Thu, 18 Jun 2026 14:45:42 +0800 Subject: [PATCH] v8: agent logos on idle, transparent backgrounds, fix PI settings persistence --- .../plugin/index.js | 22 +++++++++++++++---- .../propertyInspector/codex-monitor/index.js | 9 +++----- .../static/img/claude-icon.svg | 4 ++++ .../static/img/codex-icon.svg | 5 ++++- .../static/img/opencode-icon.svg | 5 +++++ 5 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 com.streamdock.codex.monitor.sdPlugin/static/img/claude-icon.svg create mode 100644 com.streamdock.codex.monitor.sdPlugin/static/img/opencode-icon.svg diff --git a/com.streamdock.codex.monitor.sdPlugin/plugin/index.js b/com.streamdock.codex.monitor.sdPlugin/plugin/index.js index 5b082c4..490518d 100644 --- a/com.streamdock.codex.monitor.sdPlugin/plugin/index.js +++ b/com.streamdock.codex.monitor.sdPlugin/plugin/index.js @@ -1,4 +1,4 @@ -const { Plugins, Actions, log } = require('./utils/plugin'); +const { Plugins, Actions, log } = require('./utils/plugin'); const fs = require('fs'); const path = require('path'); const os = require('os'); @@ -8,7 +8,21 @@ const timers = {}; const sessionOffsets = {}; const DEBUG_LOG = path.join(__dirname, '..', 'debug.log'); function dlog(msg) { try { fs.appendFileSync(DEBUG_LOG, '[' + new Date().toISOString() + '] ' + msg + '\n'); } catch (_) {} } -dlog('=== AI Monitor v7 multi-agent ==='); +dlog('=== AI Monitor v8 multi-agent ==='); + +// --- Load agent logos as data URIs --- +function loadSvg(filename) { + try { + var file = path.join(__dirname, '..', 'static', 'img', filename); + var raw = fs.readFileSync(file, 'utf-8'); + return 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(raw); + } catch (_) { return ''; } +} +var AGENT_LOGOS = { + codex: loadSvg('codex-icon.svg'), + claude: loadSvg('claude-icon.svg'), + opencode: loadSvg('opencode-icon.svg') +}; const HOME = os.homedir(); const DEFAULT_POLL = 1000; @@ -107,7 +121,7 @@ function makeSvg(fill, label, blink, breathe) { var anim = ''; if (blink) anim = ''; else if (breathe) anim = ''; - return '' + anim + '' + label + ''; + return '' + anim + '' + label + ''; } function setDisplay(context, state) { @@ -124,7 +138,7 @@ function animateTick() { var alpha = d.blink ? (phase < 0.5 ? 1 : 0.2) : 0.4 + 0.6 * Math.sin(phase * Math.PI); var _r = parseInt(d.fill.slice(1,3),16), _g = parseInt(d.fill.slice(3,5),16), _b = parseInt(d.fill.slice(5,7),16); var color = 'rgb(' + Math.round(16+(_r-16)*alpha) + ',' + Math.round(16+(_g-16)*alpha) + ',' + Math.round(16+(_b-16)*alpha) + ')'; - var svg = '' + d.title + ''; + var svg = '' + d.title + ''; plugin.setImage(currentCtx, 'data:image/svg+xml;charset=utf-8,' + svg); } } diff --git a/com.streamdock.codex.monitor.sdPlugin/propertyInspector/codex-monitor/index.js b/com.streamdock.codex.monitor.sdPlugin/propertyInspector/codex-monitor/index.js index 7d602c2..a2ca865 100644 --- a/com.streamdock.codex.monitor.sdPlugin/propertyInspector/codex-monitor/index.js +++ b/com.streamdock.codex.monitor.sdPlugin/propertyInspector/codex-monitor/index.js @@ -8,16 +8,13 @@ const statusDot = document.getElementById('statusDot'); const statusText = document.getElementById('statusText'); - // $settings is the SDK-provided settings proxy (auto-persists) - $settings = $settings || {}; - function applySettings(settings) { - if (settings.agent) { agentSelect.value = settings.agent; } - if (settings.pollInterval !== undefined) { + if (settings && settings.agent) { agentSelect.value = settings.agent; } + if (settings && settings.pollInterval !== undefined) { pollSlider.value = settings.pollInterval; pollVal.textContent = settings.pollInterval + 'ms'; } - if (settings.showHealth !== undefined) { + if (settings && settings.showHealth !== undefined) { showHealthToggle.checked = settings.showHealth; } } diff --git a/com.streamdock.codex.monitor.sdPlugin/static/img/claude-icon.svg b/com.streamdock.codex.monitor.sdPlugin/static/img/claude-icon.svg new file mode 100644 index 0000000..9dd88d5 --- /dev/null +++ b/com.streamdock.codex.monitor.sdPlugin/static/img/claude-icon.svg @@ -0,0 +1,4 @@ + + + C + diff --git a/com.streamdock.codex.monitor.sdPlugin/static/img/codex-icon.svg b/com.streamdock.codex.monitor.sdPlugin/static/img/codex-icon.svg index ce718f7..381e097 100644 --- a/com.streamdock.codex.monitor.sdPlugin/static/img/codex-icon.svg +++ b/com.streamdock.codex.monitor.sdPlugin/static/img/codex-icon.svg @@ -1 +1,4 @@ -CX + + + CX + diff --git a/com.streamdock.codex.monitor.sdPlugin/static/img/opencode-icon.svg b/com.streamdock.codex.monitor.sdPlugin/static/img/opencode-icon.svg new file mode 100644 index 0000000..b840ca5 --- /dev/null +++ b/com.streamdock.codex.monitor.sdPlugin/static/img/opencode-icon.svg @@ -0,0 +1,5 @@ + + + + +