* @brief Returns a one-shot composite of every readable status endpoint. */
| 2298 | * @brief Returns a one-shot composite of every readable status endpoint. |
| 2299 | */ |
| 2300 | QJsonObject AI::ToolDispatcher::getSnapshot() const |
| 2301 | { |
| 2302 | static const QStringList kStatusCommands = { |
| 2303 | QStringLiteral("project.getStatus"), |
| 2304 | QStringLiteral("io.getStatus"), |
| 2305 | QStringLiteral("dashboard.getStatus"), |
| 2306 | QStringLiteral("console.getConfig"), |
| 2307 | QStringLiteral("consoleExport.getStatus"), |
| 2308 | QStringLiteral("csvExport.getStatus"), |
| 2309 | QStringLiteral("csvPlayer.getStatus"), |
| 2310 | QStringLiteral("project.mqtt.publisher.getStatus"), |
| 2311 | QStringLiteral("project.mqtt.subscriber.getStatus"), |
| 2312 | QStringLiteral("sessions.getStatus"), |
| 2313 | QStringLiteral("mdf4Export.getStatus"), |
| 2314 | QStringLiteral("mdf4Player.getStatus"), |
| 2315 | QStringLiteral("licensing.getStatus"), |
| 2316 | QStringLiteral("notifications.getUnreadCount"), |
| 2317 | }; |
| 2318 | |
| 2319 | QJsonObject snapshot; |
| 2320 | QJsonArray skipped; |
| 2321 | for (const auto& name : kStatusCommands) { |
| 2322 | if (!API::CommandRegistry::instance().hasCommand(name)) { |
| 2323 | skipped.append(name); |
| 2324 | continue; |
| 2325 | } |
| 2326 | |
| 2327 | snapshot.insert(name, runSafeCommand(name)); |
| 2328 | } |
| 2329 | |
| 2330 | if (!skipped.isEmpty()) |
| 2331 | snapshot.insert(QStringLiteral("skipped"), skipped); |
| 2332 | |
| 2333 | return snapshot; |
| 2334 | } |
| 2335 | |
| 2336 | /** |
| 2337 | * @brief Returns project structure assembled from a curated set of safe list commands. |
no test coverage detected