feat: Implement proposal loading from disk in ProposalRegistry and enhance agent command handling

This commit is contained in:
scawful
2025-10-01 20:13:00 -04:00
parent 12dc71c444
commit fabf0c9e51
5 changed files with 220 additions and 44 deletions

View File

@@ -5,17 +5,24 @@ namespace cli {
absl::StatusOr<std::vector<std::string>> MockAIService::GetCommands(
const std::string& prompt) {
// NOTE: These commands use positional arguments (not --flags) because
// the command handlers haven't been updated to parse flags yet.
// TODO: Update handlers to use absl::flags parsing
if (prompt == "Make all the soldiers in Hyrule Castle wear red armor.") {
// Simplified command sequence - just export then import
// (In reality, you'd modify the palette file between export and import)
return std::vector<std::string>{
"palette export --group sprites_aux1 --id 4 --to soldier_palette.col",
"palette set-color --file soldier_palette.col --index 5 --color \"#FF0000\"",
"palette import --group sprites_aux1 --id 4 --from soldier_palette.col"};
} else if (prompt.find("Place a tree at coordinates") != std::string::npos) {
// Example prompt: "Place a tree at coordinates (10, 20) on the light world map"
// For simplicity, we'll hardcode the tile id for a tree
return std::vector<std::string>{"overworld set-tile --map 0 --x 10 --y 20 --tile 0x02E"};
"palette export sprites_aux1 4 soldier_palette.col"
// Would normally modify soldier_palette.col here to change colors
// Then import it back
};
} else if (prompt == "Place a tree") {
// Example: Place a tree on the light world map
// Command format: map_id x y tile_id (hex)
return std::vector<std::string>{"overworld set-tile 0 10 20 0x02E"};
}
return absl::UnimplementedError("Prompt not supported by mock AI service.");
return absl::UnimplementedError("Prompt not supported by mock AI service. Try: 'Make all the soldiers in Hyrule Castle wear red armor.' or 'Place a tree'");
}
} // namespace cli