@agent-e/server 1.7.3 → 1.8.1
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/dist/AgentEServer-KIQBHRUS.mjs +7 -0
- package/dist/{chunk-AWYCK646.mjs → chunk-ALGME445.mjs} +87 -2
- package/dist/chunk-ALGME445.mjs.map +1 -0
- package/dist/cli.js +86 -1
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.js +86 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +2 -2
- package/dist/AgentEServer-JRUR4XQJ.mjs +0 -7
- package/dist/chunk-AWYCK646.mjs.map +0 -1
- /package/dist/{AgentEServer-JRUR4XQJ.mjs.map → AgentEServer-KIQBHRUS.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -339,6 +339,15 @@ function getDashboardHtml() {
|
|
|
339
339
|
.t-pending-icon { color: var(--warning); }
|
|
340
340
|
.t-pending-val { color: var(--warning); font-variant-numeric: tabular-nums; }
|
|
341
341
|
|
|
342
|
+
/* -- LLM line colors (V1.8.1) -- */
|
|
343
|
+
.t-narration-icon { color: #a78bfa; }
|
|
344
|
+
.t-narration { color: #c4b5fd; }
|
|
345
|
+
.t-explanation-icon { color: #60a5fa; }
|
|
346
|
+
.t-explanation { color: #93c5fd; }
|
|
347
|
+
.t-anomaly-icon { color: #f59e0b; }
|
|
348
|
+
.t-anomaly-label { color: #fbbf24; }
|
|
349
|
+
.t-anomaly { color: #fcd34d; }
|
|
350
|
+
|
|
342
351
|
/* -- Advisor Inline Buttons -- */
|
|
343
352
|
.advisor-btn {
|
|
344
353
|
display: none;
|
|
@@ -717,7 +726,7 @@ function getDashboardHtml() {
|
|
|
717
726
|
<header class="header" id="header">
|
|
718
727
|
<div class="header-left">
|
|
719
728
|
<span class="header-logo">AgentE</span>
|
|
720
|
-
<span class="header-version">v1.
|
|
729
|
+
<span class="header-version">v1.8.1</span>
|
|
721
730
|
</div>
|
|
722
731
|
<div class="header-right">
|
|
723
732
|
<div class="kpi-pill">
|
|
@@ -1055,6 +1064,31 @@ function getDashboardHtml() {
|
|
|
1055
1064
|
+ advisorBtns;
|
|
1056
1065
|
}
|
|
1057
1066
|
|
|
1067
|
+
// -- LLM line renderers (V1.8.1) --
|
|
1068
|
+
function narrationToTerminal(msg) {
|
|
1069
|
+
return '<span class="t-tick">[Tick ' + pad(msg.tick) + ']</span> '
|
|
1070
|
+
+ '<span class="t-narration-icon">\\u{1F9E0} </span>'
|
|
1071
|
+
+ '<span class="t-narration">"' + esc(msg.text) + '"</span>';
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
function explanationToTerminal(msg) {
|
|
1075
|
+
return '<span class="t-tick">[Tick ' + pad(msg.tick) + ']</span> '
|
|
1076
|
+
+ '<span class="t-explanation-icon">\\u{1F4A1} </span>'
|
|
1077
|
+
+ '<span class="t-explanation">"' + esc(msg.text) + '"</span>';
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
function anomalyToTerminal(msg) {
|
|
1081
|
+
var metricsStr = '';
|
|
1082
|
+
if (msg.metrics && msg.metrics.length > 0) {
|
|
1083
|
+
var m = msg.metrics[0];
|
|
1084
|
+
metricsStr = m.name + ' ' + m.deviation.toFixed(1) + '\\u03C3 \u2014 ';
|
|
1085
|
+
}
|
|
1086
|
+
return '<span class="t-tick">[Tick ' + pad(msg.tick) + ']</span> '
|
|
1087
|
+
+ '<span class="t-anomaly-icon">\\u{1F50D} </span>'
|
|
1088
|
+
+ '<span class="t-anomaly-label">Anomaly detected: </span>'
|
|
1089
|
+
+ '<span class="t-anomaly">' + esc(metricsStr) + '"' + esc(msg.text) + '"</span>';
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1058
1092
|
// -- Alerts --
|
|
1059
1093
|
function renderAlerts(alerts) {
|
|
1060
1094
|
if (!alerts || alerts.length === 0) {
|
|
@@ -1394,6 +1428,19 @@ function getDashboardHtml() {
|
|
|
1394
1428
|
$hPending.textContent = pendingDecisions.length;
|
|
1395
1429
|
}
|
|
1396
1430
|
break;
|
|
1431
|
+
|
|
1432
|
+
// V1.8.1: LLM feed events
|
|
1433
|
+
case 'narration':
|
|
1434
|
+
addTerminalLine(narrationToTerminal(msg));
|
|
1435
|
+
break;
|
|
1436
|
+
|
|
1437
|
+
case 'explanation':
|
|
1438
|
+
addTerminalLine(explanationToTerminal(msg));
|
|
1439
|
+
break;
|
|
1440
|
+
|
|
1441
|
+
case 'anomaly':
|
|
1442
|
+
addTerminalLine(anomalyToTerminal(msg));
|
|
1443
|
+
break;
|
|
1397
1444
|
}
|
|
1398
1445
|
};
|
|
1399
1446
|
}
|
|
@@ -2138,6 +2185,44 @@ var init_AgentEServer = __esm({
|
|
|
2138
2185
|
this.agentE.on("alert", (diagnosis) => {
|
|
2139
2186
|
this.alerts.push(diagnosis);
|
|
2140
2187
|
});
|
|
2188
|
+
this.agentE.on("narration", (n) => {
|
|
2189
|
+
const narration = n;
|
|
2190
|
+
const tick = this.lastState?.tick ?? 0;
|
|
2191
|
+
this.broadcast({
|
|
2192
|
+
type: "narration",
|
|
2193
|
+
tick,
|
|
2194
|
+
text: narration.narration,
|
|
2195
|
+
principle: narration.diagnosis.principle.name,
|
|
2196
|
+
severity: narration.diagnosis.violation.severity,
|
|
2197
|
+
confidence: narration.confidence
|
|
2198
|
+
});
|
|
2199
|
+
});
|
|
2200
|
+
this.agentE.on("explanation", (e) => {
|
|
2201
|
+
const explanation = e;
|
|
2202
|
+
this.broadcast({
|
|
2203
|
+
type: "explanation",
|
|
2204
|
+
tick: this.lastState?.tick ?? 0,
|
|
2205
|
+
text: explanation.explanation,
|
|
2206
|
+
parameter: explanation.plan.parameter,
|
|
2207
|
+
direction: explanation.plan.targetValue > explanation.plan.currentValue ? "increase" : "decrease",
|
|
2208
|
+
expectedOutcome: explanation.expectedOutcome,
|
|
2209
|
+
risks: explanation.risks
|
|
2210
|
+
});
|
|
2211
|
+
});
|
|
2212
|
+
this.agentE.on("anomaly", (a) => {
|
|
2213
|
+
const anomaly = a;
|
|
2214
|
+
this.broadcast({
|
|
2215
|
+
type: "anomaly",
|
|
2216
|
+
tick: anomaly.tick,
|
|
2217
|
+
text: anomaly.interpretation,
|
|
2218
|
+
metrics: anomaly.anomalies.map((m) => ({
|
|
2219
|
+
name: m.metric,
|
|
2220
|
+
deviation: m.deviation,
|
|
2221
|
+
currentValue: m.currentValue
|
|
2222
|
+
})),
|
|
2223
|
+
severity: anomaly.severity
|
|
2224
|
+
});
|
|
2225
|
+
});
|
|
2141
2226
|
this.agentE.connect(adapter).start();
|
|
2142
2227
|
const routeHandler = createRouteHandler(this);
|
|
2143
2228
|
this.server = http.createServer(routeHandler);
|