MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / compactBatchRowResult

Function compactBatchRowResult

app/src/AI/ToolDispatcher.cpp:1363–1392  ·  view source on GitHub ↗

* @brief Projects a per-op result blob onto just the identity/status fields the model needs. */

Source from the content-addressed store, hash-verified

1361 * @brief Projects a per-op result blob onto just the identity/status fields the model needs.
1362 */
1363static QJsonObject compactBatchRowResult(const QJsonObject& opResult)
1364{
1365 static const QStringList kIdentityKeys = {
1366 QStringLiteral("widgetId"),
1367 QStringLiteral("widgetType"),
1368 QStringLiteral("widgetTypeSlug"),
1369 QStringLiteral("workspaceId"),
1370 QStringLiteral("groupId"),
1371 QString(Keys::DatasetId),
1372 QString(Keys::UniqueId),
1373 QStringLiteral("id"),
1374 QStringLiteral("title"),
1375 QStringLiteral("index"),
1376 QStringLiteral("relativeIndex"),
1377 QStringLiteral("added"),
1378 QStringLiteral("removed"),
1379 QStringLiteral("deleted"),
1380 QStringLiteral("updated"),
1381 QStringLiteral("renamed"),
1382 QStringLiteral("cleared"),
1383 };
1384
1385 QJsonObject slim;
1386 for (const auto& key : kIdentityKeys) {
1387 const auto v = opResult.value(key);
1388 if (!v.isUndefined() && !v.isNull())
1389 slim.insert(key, v);
1390 }
1391 return slim;
1392}
1393
1394/**
1395 * @brief True when a fanned-out inner command (Safe/Confirm tier) may run without an extra

Callers 1

executeBulkApplyFunction · 0.85

Calls 1

valueMethod · 0.45

Tested by

no test coverage detected