openclaw-aegis 1.7.0 → 1.8.0
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/cli/index.js +44 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +27 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -2604,6 +2604,8 @@ var AegisApiServer = class {
|
|
|
2604
2604
|
this.route("GET", "/anomalies", this.handleAnomalies.bind(this));
|
|
2605
2605
|
this.route("GET", "/anomalies/baselines", this.handleBaselines.bind(this));
|
|
2606
2606
|
this.route("GET", "/predictions", this.handlePredictions.bind(this));
|
|
2607
|
+
this.route("GET", "/rca", this.handleRca.bind(this));
|
|
2608
|
+
this.route("GET", "/rca/:incidentId", this.handleRcaByIncident.bind(this));
|
|
2607
2609
|
}
|
|
2608
2610
|
route(method, path7, handler) {
|
|
2609
2611
|
const paramNames = [];
|
|
@@ -3077,6 +3079,48 @@ var AegisApiServer = class {
|
|
|
3077
3079
|
}
|
|
3078
3080
|
return { status: 200, body: this.deps.anomalyDetector.getBaselines() };
|
|
3079
3081
|
}
|
|
3082
|
+
handleRca() {
|
|
3083
|
+
if (!this.deps.rootCauseAnalyzer) {
|
|
3084
|
+
return { status: 501, body: { error: "Root cause analysis not available" } };
|
|
3085
|
+
}
|
|
3086
|
+
const results = this.deps.rootCauseAnalyzer.analyze();
|
|
3087
|
+
return {
|
|
3088
|
+
status: 200,
|
|
3089
|
+
body: {
|
|
3090
|
+
candidates: results.map((r) => ({
|
|
3091
|
+
rootCause: r.rootCause,
|
|
3092
|
+
confidence: (r.confidence * 100).toFixed(0) + "%",
|
|
3093
|
+
evidence: r.evidence,
|
|
3094
|
+
suggestion: r.suggestion,
|
|
3095
|
+
correlatedProbes: r.correlatedProbes
|
|
3096
|
+
})),
|
|
3097
|
+
count: results.length
|
|
3098
|
+
}
|
|
3099
|
+
};
|
|
3100
|
+
}
|
|
3101
|
+
handleRcaByIncident(params) {
|
|
3102
|
+
if (!this.deps.rootCauseAnalyzer) {
|
|
3103
|
+
return { status: 501, body: { error: "Root cause analysis not available" } };
|
|
3104
|
+
}
|
|
3105
|
+
const results = this.deps.rootCauseAnalyzer.analyzeIncident(params.incidentId);
|
|
3106
|
+
if (results.length === 0) {
|
|
3107
|
+
return { status: 404, body: { error: `No RCA results for incident '${params.incidentId}'` } };
|
|
3108
|
+
}
|
|
3109
|
+
return {
|
|
3110
|
+
status: 200,
|
|
3111
|
+
body: {
|
|
3112
|
+
incidentId: params.incidentId,
|
|
3113
|
+
candidates: results.map((r) => ({
|
|
3114
|
+
rootCause: r.rootCause,
|
|
3115
|
+
confidence: (r.confidence * 100).toFixed(0) + "%",
|
|
3116
|
+
evidence: r.evidence,
|
|
3117
|
+
suggestion: r.suggestion,
|
|
3118
|
+
correlatedProbes: r.correlatedProbes
|
|
3119
|
+
})),
|
|
3120
|
+
count: results.length
|
|
3121
|
+
}
|
|
3122
|
+
};
|
|
3123
|
+
}
|
|
3080
3124
|
handlePredictions() {
|
|
3081
3125
|
if (!this.deps.predictiveAlerter) {
|
|
3082
3126
|
return { status: 501, body: { error: "Predictive alerts not available" } };
|