* @brief meta.describeCommand handler: returns command schema or not_found. */
| 755 | * @brief meta.describeCommand handler: returns command schema or not_found. |
| 756 | */ |
| 757 | void AI::Conversation::runMetaDescribe(const QString& callId, |
| 758 | const QString& name, |
| 759 | const QJsonObject& arguments) |
| 760 | { |
| 761 | appendToolCallCard(callId, name, arguments, CallStatus::Running); |
| 762 | const auto target = arguments.value(QStringLiteral("name")).toString(); |
| 763 | QJsonObject reply; |
| 764 | if (target.isEmpty()) { |
| 765 | reply[QStringLiteral("ok")] = false; |
| 766 | reply[QStringLiteral("error")] = QStringLiteral("missing_name"); |
| 767 | } else { |
| 768 | const auto desc = m_dispatcher->describeCommand(target); |
| 769 | if (desc.isEmpty()) { |
| 770 | reply[QStringLiteral("ok")] = false; |
| 771 | reply[QStringLiteral("error")] = QStringLiteral("not_found"); |
| 772 | reply[QStringLiteral("name")] = target; |
| 773 | } else { |
| 774 | reply[QStringLiteral("ok")] = true; |
| 775 | reply[QStringLiteral("command")] = desc; |
| 776 | const auto skill = skillForCommand(target); |
| 777 | if (!skill.isEmpty()) |
| 778 | reply[QStringLiteral("loadSkillFirst")] = skill; |
| 779 | } |
| 780 | } |
| 781 | recordToolResult(callId, name, reply); |
| 782 | updateToolCallCard(callId, |
| 783 | reply.value(QStringLiteral("ok")).toBool() ? CallStatus::Done |
| 784 | : CallStatus::Error, |
| 785 | reply); |
| 786 | releaseOutstandingToolResult(); |
| 787 | } |
| 788 | |
| 789 | /** |
| 790 | * @brief meta.fetchScriptingDocs handler: returns the canonical doc body for a kind. |
nothing calls this directly
no test coverage detected