@enigmax/dashboard 0.1.2 → 0.1.4
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/assets/index.html +73 -1
- package/package.json +1 -1
package/assets/index.html
CHANGED
|
@@ -124,6 +124,13 @@
|
|
|
124
124
|
border-radius: 7px; padding: 5px 14px; font-size: 12px; cursor: pointer; font-family: inherit;
|
|
125
125
|
}
|
|
126
126
|
.btn-danger:hover { border-color: var(--accent2); }
|
|
127
|
+
.sys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 24px; }
|
|
128
|
+
.sys-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--surface2); font-size: 13px; }
|
|
129
|
+
.sys-item .k { color: var(--muted); }
|
|
130
|
+
.pill { font-size: 11px; border-radius: 6px; padding: 2px 9px; border: 1px solid var(--border); white-space: nowrap; }
|
|
131
|
+
.pill.on { color: #06210f; background: var(--good); border-color: var(--good); font-weight: 600; }
|
|
132
|
+
.pill.off { color: var(--muted); background: var(--surface2); }
|
|
133
|
+
.pill.lvl { color: #1a1206; background: var(--accent); border-color: var(--accent); font-weight: 600; }
|
|
127
134
|
@media (max-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); } header { gap: 12px; } }
|
|
128
135
|
</style>
|
|
129
136
|
</head>
|
|
@@ -165,6 +172,16 @@
|
|
|
165
172
|
<div class="card"><div class="label">Best Compression</div><div id="best" class="value">-</div><div class="foot">Most saved in one call</div></div>
|
|
166
173
|
</div>
|
|
167
174
|
|
|
175
|
+
<div class="panel">
|
|
176
|
+
<div class="panel-head">
|
|
177
|
+
<h2>Enigma Systems <small>what's active - configuration, not savings</small></h2>
|
|
178
|
+
<div class="ctrls"><button id="updateBtn" type="button" class="toggle on">Check & update</button></div>
|
|
179
|
+
</div>
|
|
180
|
+
<div class="sub" style="margin-bottom:14px">Only Context Compression and (opt-in) real tool-usage are measured for savings below. The rest is shown as state: enigma can't measure their effect because they run inside the agent, not through enigma - so it reports their configuration honestly instead of inventing a number.</div>
|
|
181
|
+
<div id="systems" class="sys-grid"><div class="empty" style="padding:16px 0">Loading...</div></div>
|
|
182
|
+
<div id="updateNote" class="set-note"></div>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
168
185
|
<div class="panel">
|
|
169
186
|
<div class="panel-head">
|
|
170
187
|
<h2>Savings Per Day <small id="rangeLabel"></small></h2>
|
|
@@ -695,6 +712,60 @@
|
|
|
695
712
|
} catch { $("settingsBody").innerHTML = '<div class="empty" style="padding:24px 0">Settings unavailable.</div>'; }
|
|
696
713
|
}
|
|
697
714
|
|
|
715
|
+
// --- "Enigma systems" overview (factual state, never invented savings) ---
|
|
716
|
+
function pill(state, text) { return '<span class="pill ' + state + '">' + esc(text) + "</span>"; }
|
|
717
|
+
function boolPill(b) { return b ? pill("on", "on") : pill("off", "off"); }
|
|
718
|
+
function levelPill(v) { return (!v || v === "off") ? pill("off", "off") : pill("lvl", v); }
|
|
719
|
+
|
|
720
|
+
function renderSystems(s) {
|
|
721
|
+
const el = $("systems");
|
|
722
|
+
if (!s) { el.innerHTML = '<div class="empty" style="padding:16px 0">Status unavailable.</div>'; return; }
|
|
723
|
+
const item = (k, v) => '<div class="sys-item"><span class="k">' + k + '</span><span class="v">' + v + "</span></div>";
|
|
724
|
+
const sk = s.skills || {};
|
|
725
|
+
const skillTags = '<span class="tag">' + (sk.enigma || 0) + " enigma</span>"
|
|
726
|
+
+ '<span class="tag ext">' + (sk.external || 0) + " external</span>"
|
|
727
|
+
+ ((sk.disabled || 0) ? '<span class="tag">' + sk.disabled + " disabled</span>" : "");
|
|
728
|
+
const sec = s.security || {};
|
|
729
|
+
const ps = s.proxyStats || {};
|
|
730
|
+
const proxyMeasured = (ps.calls || 0) > 0
|
|
731
|
+
? item("Proxy measured · real", '<span class="tag">' + fmt(ps.calls) + " calls</span><span class=\"tag\">"
|
|
732
|
+
+ fmt(ps.input) + " in</span><span class=\"tag\">" + fmt(ps.output) + " out</span><span class=\"tag\">" + fmt(ps.cacheRead) + " cache</span>")
|
|
733
|
+
: "";
|
|
734
|
+
const guard = (sec.guardProtects || []).map((p) => '<span class="tag">' + esc(p) + "</span>").join("");
|
|
735
|
+
el.innerHTML =
|
|
736
|
+
item("Context compression (MCP) · measured", boolPill(s.compress))
|
|
737
|
+
+ item("Real tool-usage stats · measured", boolPill(s.usageStats))
|
|
738
|
+
+ item("Claude Code measuring proxy · experimental", boolPill(s.proxy))
|
|
739
|
+
+ proxyMeasured
|
|
740
|
+
+ item("Token-efficient output", levelPill(s.outputStyle))
|
|
741
|
+
+ item("Minimal code", levelPill(s.minimalCode))
|
|
742
|
+
+ item("Parallel sub-agents", boolPill(s.parallelSubagents))
|
|
743
|
+
+ item("Auto-lint on edit", boolPill(s.autoLint))
|
|
744
|
+
+ item("Commit emoji", boolPill(s.commitEmoji))
|
|
745
|
+
+ item("Local dashboard", pill(s.dashboard === "off" ? "off" : "lvl", s.dashboard || "off"))
|
|
746
|
+
+ item("Permission bypass (security)", boolPill(sec.permissionBypass))
|
|
747
|
+
+ item("Commit guard blocks", guard || '<span class="tag">set up with enigma security</span>')
|
|
748
|
+
+ item("Skills", skillTags);
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
async function runUpdate() {
|
|
752
|
+
$("updateNote").textContent = "Checking for updates...";
|
|
753
|
+
try {
|
|
754
|
+
const res = await fetch("/api/update", { method: "POST", headers: { "Content-Type": "application/json" }, body: "{}" });
|
|
755
|
+
const out = await res.json();
|
|
756
|
+
$("updateNote").textContent = out.ok ? (out.note || "Updated.") : ("Update failed: " + (out.error || "error"));
|
|
757
|
+
loadSystems();
|
|
758
|
+
if (skillsLoaded) loadSkills();
|
|
759
|
+
} catch { $("updateNote").textContent = "Could not reach the server to update."; }
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
async function loadSystems() {
|
|
763
|
+
try {
|
|
764
|
+
const r = await fetch("/api/status", { cache: "no-store" });
|
|
765
|
+
renderSystems((await r.json()).systems);
|
|
766
|
+
} catch { $("systems").innerHTML = '<div class="empty" style="padding:16px 0">Status unavailable.</div>'; }
|
|
767
|
+
}
|
|
768
|
+
|
|
698
769
|
// --- skills subpage (lists enigma + external skills over /api/skills) ---
|
|
699
770
|
function skillRow(s) {
|
|
700
771
|
const ver = s.version ? '<span class="tag">v' + esc(s.version) + "</span>" : "";
|
|
@@ -800,7 +871,7 @@
|
|
|
800
871
|
if (v === "settings" && !settingsLoaded) { settingsLoaded = true; loadSettings(); }
|
|
801
872
|
if (v === "skills" && !skillsLoaded) { skillsLoaded = true; loadSkills(); }
|
|
802
873
|
// The chart was sized while its view may have been hidden; nudge it on return.
|
|
803
|
-
if (v === "savings"
|
|
874
|
+
if (v === "savings") { loadSystems(); if (chart) { try { applyRange(); } catch { /* not ready */ } } }
|
|
804
875
|
}
|
|
805
876
|
|
|
806
877
|
initChart();
|
|
@@ -809,6 +880,7 @@
|
|
|
809
880
|
document.addEventListener("visibilitychange", () => { if (!document.hidden) poll(); });
|
|
810
881
|
wireSettings();
|
|
811
882
|
wireSkills();
|
|
883
|
+
$("updateBtn").addEventListener("click", runUpdate);
|
|
812
884
|
window.addEventListener("hashchange", route);
|
|
813
885
|
route();
|
|
814
886
|
</script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enigmax/dashboard",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Local browser dashboard UI for enigma: the static page and chart assets enigma serves on its loopback dashboard (savings, real tool usage, in-browser settings). Installed on demand by enigma-cli; not a runtime dependency.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|