| 1140 | } |
| 1141 | |
| 1142 | void ChatRootView::refreshRules() |
| 1143 | { |
| 1144 | m_activeRules.clear(); |
| 1145 | |
| 1146 | auto project = PluginLLMCore::RulesLoader::getActiveProject(); |
| 1147 | if (!project) { |
| 1148 | emit activeRulesChanged(); |
| 1149 | emit activeRulesCountChanged(); |
| 1150 | return; |
| 1151 | } |
| 1152 | |
| 1153 | auto ruleFiles |
| 1154 | = PluginLLMCore::RulesLoader::getRuleFilesForProject(project, PluginLLMCore::RulesContext::Chat); |
| 1155 | |
| 1156 | for (const auto &ruleFile : ruleFiles) { |
| 1157 | QVariantMap ruleMap; |
| 1158 | ruleMap["filePath"] = ruleFile.filePath; |
| 1159 | ruleMap["fileName"] = ruleFile.fileName; |
| 1160 | ruleMap["category"] = ruleFile.category; |
| 1161 | m_activeRules.append(ruleMap); |
| 1162 | } |
| 1163 | |
| 1164 | emit activeRulesChanged(); |
| 1165 | emit activeRulesCountChanged(); |
| 1166 | } |
| 1167 | |
| 1168 | bool ChatRootView::useTools() const |
| 1169 | { |