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

Method getProjectState

app/src/AI/ToolDispatcher.cpp:2339–2361  ·  view source on GitHub ↗

* @brief Returns project structure assembled from a curated set of safe list commands. */

Source from the content-addressed store, hash-verified

2337 * @brief Returns project structure assembled from a curated set of safe list commands.
2338 */
2339QJsonObject AI::ToolDispatcher::getProjectState() const
2340{
2341 static const QStringList kSafeListCommands = {
2342 QStringLiteral("project.group.list"),
2343 QStringLiteral("project.dataset.list"),
2344 QStringLiteral("project.action.list"),
2345 QStringLiteral("project.source.list"),
2346 QStringLiteral("project.dataTable.list"),
2347 QStringLiteral("project.workspace.list"),
2348 QStringLiteral("project.frameParser.getCode"),
2349 QStringLiteral("project.frameParser.getConfig"),
2350 };
2351
2352 QJsonObject state;
2353 for (const auto& name : kSafeListCommands) {
2354 if (!API::CommandRegistry::instance().hasCommand(name))
2355 continue;
2356
2357 state.insert(name, runSafeCommand(name));
2358 }
2359
2360 return state;
2361}
2362
2363/**
2364 * @brief Returns the markdown reference body for the given scripting kind.

Callers 1

liveProjectStateBlockMethod · 0.80

Calls 2

runSafeCommandFunction · 0.85
hasCommandMethod · 0.80

Tested by

no test coverage detected