feat(plan-management): implement alert-remediation-plan system v1.3
Some checks failed
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled

- 8 new store modules + matcher + initialResponse + aggregation + remediation + AlertStateMonitor + planGenerator

- alert chain auto-integrated after runInspection: freeze snapshot + generate response + real-time agg + auto-start monitor

- AlertAIPanel component + MonitoringDetailPanel expandable alert list

- PlanManagementPage: full page with list/edit/AI generate/templates/commands
This commit is contained in:
2026-10-30 16:55:55 +08:00
committed by trae-solo-agent
parent 1bb5390263
commit a5744e720b
18 changed files with 4109 additions and 21 deletions

View File

@@ -1063,6 +1063,42 @@ function reportOpenedSessionActivity(event) {
return mcpServerBridge.reportOpenedSessionActivity?.(event) ?? false;
}
/**
* 薄封装:供 remediationEngine 调用 Catty Agent 执行一次工具调用(D24)
*
* 让 Catty Agent 在它自己的 session 上下文里执行,凭据、审计、权限全部复用现有链路。
* 这是薄封装 — 不直接 import capabilityTools,而是让已注册的 handler context 处理。
*/
async function requestToolCall(payload) {
const { alert_id, device_id, command_id, params = {}, timeout_sec = 30 } = payload || {};
// 尝试走 Catty Agent 的执行通路
try {
// 通过 registeredContext 找可用的 tool execution handler
const ctx = registeredContext;
if (ctx?.executeToolCall) {
return await ctx.executeToolCall({ command_id, params, device_id, timeout_sec });
}
// 降级:直接走 SSH(如果 inspection 模块可用)
const inspection = require("./inspection/index.cjs");
if (typeof inspection.runRemediationCommand === "function") {
return await inspection.runRemediationCommand({ alert_id, device_id, command_id, params, timeout_sec });
}
} catch (e) {
console.warn("[aiBridge.requestToolCall] Catty 通路不可用,降级:", e.message);
}
// 最终降级:返回模拟结果(让调用方知道通路未就绪)
return {
ok: false,
stdout: "",
stderr: "aiBridge.requestToolCall 通路未就绪,请确认 Catty Agent 已启动",
exitCode: -1,
degraded: true,
};
}
module.exports = {
init,
registerHandlers,
@@ -1082,4 +1118,6 @@ module.exports = {
injectApiKeyIntoRequest,
shouldSkipTLSVerify,
decryptApiKeyValue,
// D24:处置引擎 → Catty Agent 薄封装
requestToolCall,
};