Fixes two CI failures:
1. Windows Abseil header lookup - removed manual include_directories
in util.cmake that were only added when gRPC was enabled. CMake
target properties now handle Abseil includes automatically.
2. Code formatting violations in test/yaze_test.cc - applied clang-format
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements Phase 1 from AI_API_ENHANCEMENT_HANDOFF.md to provide
unified model discovery and management across all AI providers.
Changes:
- Add ModelRegistry singleton class for centralized model tracking
- Support Ollama and Gemini providers with extensible design
- Provide ListAllModels() for unified model enumeration
- Cache model information for performance
This foundation enables Phase 2 HTTP API /api/v1/models endpoint
and future UI unification work in agent_chat_widget.cc.
Phase 1 Status: COMPLETE
Co-Authored-By: Claude <noreply@anthropic.com>
Implements Phase 2 from AI_API_ENHANCEMENT_HANDOFF.md to expose yaze
functionality via HTTP endpoints for automation and external tools.
Changes:
- Add YAZE_ENABLE_HTTP_API CMake option (defaults to YAZE_ENABLE_AGENT_CLI)
- Add YAZE_HTTP_API_ENABLED compile definition when enabled
- Integrate HttpServer into z3ed with conditional compilation
- Add --http-port and --http-host CLI flags with full parsing
- Create comprehensive API documentation with examples
Initial endpoints:
- GET /api/v1/health - Server health check
- GET /api/v1/models - List available AI models from all providers
Built with mac-ai preset (46 steps, 89MB binary).
Tested both endpoints successfully on localhost:8080.
Co-Authored-By: Claude <noreply@anthropic.com>
- Introduced a conditional inclusion of the Abseil library in the yaze_util target when YAZE_ENABLE_GRPC is enabled, enhancing support for gRPC features.
- This change improves modularity and ensures that necessary dependencies are included only when required, streamlining the build process.
- Added a new utility function, detail::FlagParseFatal, to handle fatal errors during flag parsing, improving error reporting and program termination.
- Replaced existing runtime error throws with calls to FlagParseFatal for unrecognized flags and parsing failures, ensuring consistent error handling.
- Updated header file to declare the new function, enhancing code organization and clarity.
- Added proposal_executor.cc and ai_service.cc to the YAZE_AGENT_CORE_SOURCES for improved AI functionality.
- Adjusted conditional source inclusion for AI runtime, ensuring proper handling of AI features based on build configuration.
- Introduced a service factory stub for AI services when the runtime is disabled, enhancing testing capabilities.
- Added conditional compilation for AI services and callbacks based on the YAZE_AI_RUNTIME_AVAILABLE flag.
- Implemented stubs for AI service methods to return errors when the AI runtime is disabled, enhancing error handling.
- Updated GeminiAIService and OllamaAIService to provide appropriate responses when AI features are not available.
- Introduced a new service factory stub to create mock AI services when the runtime is disabled, improving testing capabilities.
- Moved all third-party libraries (SDL, ImGui, Asar, etc.) from `src/lib/` and `third_party/` to a new `ext/` directory for better organization and clarity in dependency management.
- Updated CMake configuration to reflect the new paths, ensuring all targets and includes point to the `ext/` directory.
- Enhanced CMake presets to support new build options for AI and gRPC features, improving modularity and build flexibility.
- Added new feature flags for agent UI and remote automation, allowing for more granular control over build configurations.
- Updated documentation to reflect changes in the project structure and build options, ensuring clarity for contributors and users.
- Introduced AgentConfigSnapshot structure to encapsulate agent configuration settings, including model metadata, tool preferences, and automation options.
- Updated AgentChatHistoryCodec to support serialization and deserialization of agent configuration, warnings, and model metadata.
- Enhanced AgentChatHistoryPopup with provider filtering and message pinning functionality for improved user experience.
- Added new methods for managing agent settings and builder workflows, facilitating better integration of agent configurations into the chat interface.
- Documented the new Agent Builder workflow in README for clarity on usage and features.
- Added new entries to `.pre-commit-config.yaml`, `cmake-format.yaml`, and `.github/dependabot.yml` to improve code quality checks and dependency updates.
- Enhanced GitHub Actions workflows by adding new steps for testing and build retention.
- Introduced support for the nlohmann_json library in CMake, allowing for conditional inclusion based on the `YAZE_ENABLE_JSON` option.
- Updated CMake configurations to streamline SDL2 and gRPC integration, ensuring proper linking and target management.
Benefits:
- Improves code quality and consistency through automated checks and formatting.
- Enhances dependency management and build reliability across platforms.
- Provides flexibility for users to enable optional features, improving overall functionality.
- Updated `.clangd` configuration to include additional include paths and feature flags tailored for ROM hacking workflows, optimizing IntelliSense support.
- Introduced `.pre-commit-config.yaml` for managing code quality checks and formatting, ensuring consistent code style across the project.
- Added `cmake-format.yaml` for CMake formatting configuration, promoting adherence to style guidelines.
- Enhanced CI workflows to include new actions for testing and building, improving overall reliability and efficiency in the development process.
Benefits:
- Streamlines development setup and improves code quality through automated checks.
- Facilitates better collaboration by ensuring consistent coding standards and configurations.
- Added `yaze_app_core_lib` and `yaze_editor` to the linking of the `yaze_emu_test` target in the CMake configuration.
- This change enhances the test's access to core application functionalities, improving test coverage and reliability.
Benefits:
- Ensures that the emulator tests have the necessary dependencies linked, facilitating more comprehensive testing of the emulator's features.
- Added logic to handle gRPC target resolution, allowing for fallback to bare names when using FetchContent or vcpkg.
- Updated the handling of CMAKE_CROSSCOMPILING to ensure proper configuration for host builds, preventing issues with protoc binary location.
- Adjusted target_add_protobuf function to use generator expressions for better compatibility and maintainability.
Benefits:
- Improves build reliability and flexibility when integrating gRPC support.
- Ensures correct handling of cross-compilation scenarios, enhancing compatibility across platforms.
- Introduced a new `yaze_grpc_support` library to centralize all gRPC and protobuf usage, addressing Windows linker errors and improving build stability.
- Updated CMake configurations across various components to link against the new support library instead of individual protobuf targets, simplifying the linking process.
- Removed legacy whole-archive linking logic, ensuring a cleaner and more maintainable build setup.
Benefits:
- Reduces complexity in CMake files and enhances compatibility across platforms.
- Prevents potential linker errors by consolidating gRPC and protobuf dependencies into a single library.
- Updated CMake configuration to conditionally apply whole-archive linking for the `yaze_agent` target on Unix-like systems, ensuring all necessary symbols are included.
- Maintained standard linking for Windows while improving compatibility across platforms.
Benefits:
- Increases build stability and ensures proper symbol inclusion for test support libraries, reducing potential linker errors.
- Enhanced CMake configuration to conditionally apply /WHOLEARCHIVE linking for protobuf targets, ensuring only library targets are included.
- Updated linking logic across multiple components including `yaze`, `yaze_emu`, `z3ed`, and test suites to improve compatibility and prevent linker errors.
Benefits:
- Increases build stability and clarity by ensuring only relevant targets are linked, reducing potential conflicts during the build process.
- Adjusted CMake files to conditionally link protobuf using /WHOLEARCHIVE on Windows to include internal symbols while avoiding LNK1241 errors.
- Updated linking logic for `yaze`, `yaze_editor`, `yaze_emu`, `z3ed`, and test suites to ensure compatibility across platforms.
Benefits:
- Improves build stability and compatibility for Windows users by ensuring proper symbol inclusion without resource duplication issues.
- Refactored `OverworldMap` to utilize `OverworldVersionHelper` for version checks, enhancing clarity and maintainability.
- Updated logic for loading area information and handling custom overworld data based on versioning.
- Cleaned up includes and namespace declarations for better organization and readability.
Benefits:
- Streamlines version handling, reducing code duplication and potential errors.
- Enhances overall code structure, making it easier to navigate and maintain.
- Added /WHOLEARCHIVE linking for protobuf in various CMake files to ensure internal symbols are included while preventing resource duplication.
- Updated linking options for `yaze`, `yaze_emu`, `z3ed`, and test suites to apply this option conditionally on Windows with MSVC.
Benefits:
- Ensures proper inclusion of protobuf symbols in executables, improving compatibility and functionality across platforms.
- Updated caching keys in CI and release workflows from v2 to v3 for gRPC dependencies to improve cache management.
- Enhanced linking options for `yaze_editor` and `yaze_agent` to ensure test symbols are included correctly across different platforms.
Benefits:
- Streamlines the build process by ensuring proper versioning and linking of test support libraries.
- Improves cache efficiency in CI workflows, reducing build times.
- Updated `UpdateMapProperties` methods across various entities (entrances, exits, items, sprites) to include an optional context parameter for improved area size detection.
- Introduced `OverworldVersionHelper` for centralized ROM version detection and feature gating, replacing scattered inline checks.
- Refactored coordinate calculations to utilize normalized map IDs, ensuring consistency and preventing data corruption.
- Enhanced exit properties to sync player positions and calculate scroll/camera values based on the overworld context.
Benefits:
- Streamlines entity property updates and improves compatibility with different ROM versions.
- Reduces code duplication and enhances maintainability by centralizing version checks.
- Ensures accurate coordinate calculations for overworld entities, improving overall functionality.
- Upgraded gRPC version from v1.68.0 to v1.75.1 for improved compatibility across all platforms.
- Removed /WHOLEARCHIVE linking for protobuf to prevent duplicate version resource errors in the dependency chain.
- Updated status messages to reflect the latest gRPC version and build optimizations.
Benefits:
- Enhances build stability and compatibility with modern toolchains.
- Simplifies linking process by avoiding unnecessary options that cause conflicts.
- Removed unused gRPC and protobuf dependencies from `vcpkg.json`.
- Updated CI configuration to enable vcpkg installation for SDL2 and yaml-cpp.
- Added support for MSVC in CI workflows and improved caching strategies for vcpkg packages.
- Enhanced logging in build steps to provide better feedback on dependency status and build progress.
- Changed `x_camera_` and `y_camera_` in `OverworldExit` from `uint8_t` to `uint16_t` for consistency and to accommodate larger values.
- Updated the `DrawExitEditorPopup` function to use `InputHexWord` for camera positions, reflecting the new data type.
- Added `ImGui::PushID` and `ImGui::PopID` calls in various popup functions to resolve duplicate ID warnings, enhancing the stability of the UI.
Benefits:
- Ensures proper handling of camera coordinates in the overworld editor.
- Improves UI robustness by addressing ID conflicts in popups.
- Replaced the legacy ContextMenuItem structure with a new CanvasMenuItem across various files, enhancing consistency in context menu management.
- Introduced CanvasMenuBuilder for fluent menu construction, allowing for easier addition of items and submenus.
- Updated Canvas and related components to utilize the new menu system, improving organization and maintainability of context menus.
Benefits:
- Streamlines context menu item management, making it more intuitive and flexible.
- Enhances code readability and reduces duplication, facilitating future enhancements.
- Introduced a new `PopupRegistry` class to manage persistent popups, improving the organization and lifecycle handling of popups within the canvas.
- Added `canvas_menu.cc` and `canvas_menu.h` to define menu item and section structures, along with rendering functions for a more declarative menu system.
- Updated `canvas.cc` to utilize the new popup registry, ensuring backward compatibility with legacy popup handling during the migration phase.
Benefits:
- Streamlines popup management, enhancing usability and maintainability of the canvas UI.
- Facilitates the addition of complex menu structures and interactions, improving overall user experience.
- Introduced new files `canvas_interaction.cc` and `canvas_interaction.h` to encapsulate event-driven logic for tile painting, rectangle selection, and entity interactions.
- Refactored `CanvasInteractionHandler` to utilize the new event-based functions, improving code organization and maintainability.
- Added `canvas_events.h` to define event payload structures for various canvas interactions, enhancing clarity and usability.
Benefits:
- Streamlines interaction handling by separating concerns and reducing stateful dependencies.
- Improves testability and readability of the canvas interaction logic, facilitating future enhancements.
- Added new files `canvas_geometry.cc`, `canvas_geometry.h`, `canvas_rendering.cc`, and `canvas_rendering.h` to encapsulate canvas geometry calculations and rendering logic.
- Refactored `Canvas::DrawBackground` and related methods to utilize the new geometry and rendering helpers, improving code organization and readability.
- Introduced `CanvasState` to consolidate canvas state management, gradually replacing scattered state members.
Benefits:
- Enhances maintainability and clarity of canvas-related code.
- Streamlines rendering operations and geometry calculations, improving overall performance and usability.
- Added inclusion of `overworld_item.h` in both `overworld_map.h` and `overworld.cc` to facilitate item management within the overworld.
- Enhanced the `SaveItems` function to reset bomb door lookup tables and update item pointers, ensuring proper handling of overworld items.
- Improved data writing logic for overworld items, including adjustments for pointer reuse and metadata updates.
Benefits:
- Streamlines item management in the overworld, enhancing functionality and maintainability.
- Ensures compatibility with expanded ROM structures, improving overall game experience.
- Introduced new `entity_operations.cc` and `entity_operations.h` files to handle the insertion of entrances, exits, sprites, and items in the overworld editor.
- Updated `map_properties.cc` to include a context menu for entity insertion, allowing users to add various entities directly from the canvas.
- Enhanced `overworld_editor.cc` to manage entity insertion callbacks and streamline the editing process.
Benefits:
- Improves the functionality of the overworld editor by enabling direct manipulation of entities.
- Provides a more intuitive user experience with context-sensitive menus for entity operations.
- Modified CMake presets to include static triplet for vcpkg in Windows configurations, enhancing build consistency.
- Updated vcpkg baseline and commit ID across configuration files to ensure compatibility with the latest package versions.
- Enhanced CI workflows to utilize the new vcpkg toolchain file, improving the setup process for Windows builds.
Benefits:
- Ensures the project leverages the latest features and fixes from vcpkg, enhancing overall stability.
- Streamlines the Windows build process by consolidating vcpkg configurations, reducing potential discrepancies during builds.
- Removed the `core_library.cmake` file and integrated its components into `app.cmake` to streamline the application structure.
- Updated the CMake configuration to reflect the new organization, ensuring proper inclusion of core components such as ROM management and application controller.
- Enhanced build messages to clarify the status of the application core library configuration.
Benefits:
- Simplifies the CMake structure by consolidating related components, improving maintainability and clarity.
- Promotes a clearer separation of concerns within the application architecture.
- Moved the gRPC test harness proto and services to `yaze_test_support` to avoid circular dependencies and improve modularity.
- Updated the core library CMake configuration to reflect the new structure, ensuring proper inclusion of ROM service and canvas automation.
- Enhanced the build messages to clarify the status of gRPC services and test harness integration.
Benefits:
- Streamlines the build process by clearly separating core and test functionalities.
- Improves maintainability and clarity in the CMake configuration for gRPC services.
- Moved core components such as `Controller` and `Window` from `src/app/core/` to `src/app/` and `src/app/platform/`, respectively, to improve modularity and clarity.
- Updated include paths across the codebase to reflect the new locations of these components.
- Introduced a new foundational core library in `src/core/` for project management and ROM patching logic, enhancing the separation of concerns.
- Adjusted CMake configurations to ensure proper compilation of the new core library and updated dependencies in various modules.
Benefits:
- Streamlines the application structure, making it easier to navigate and maintain.
- Enhances code organization by clearly delineating core functionalities from application-specific logic.
- Improves overall architecture by promoting a clearer separation of concerns between different components.
- Added a new `session_types` module to encapsulate session-related structures and logic, including `EditorSet` and `RomSession`.
- Refactored `EditorManager` to utilize `SessionCoordinator` for session management, enhancing modularity and clarity.
- Updated various methods to replace direct references to current ROM and editor sets with calls to `SessionCoordinator`, improving session handling.
- Removed redundant session management logic from `EditorManager`, delegating responsibilities to `SessionCoordinator`.
Benefits:
- Streamlines session management, making it easier to handle multiple sessions and their associated editors.
- Enhances code maintainability by centralizing session-related logic and reducing coupling within the `EditorManager`.
- Improves overall architecture by promoting a clearer separation of concerns between session management and editor functionality.
- Relocated AsarWrapper implementation and header files from `src/app/core/` to `src/core/` to enhance modularity and organization.
- Updated all relevant include paths across the codebase to reflect the new location of AsarWrapper.
- Adjusted CMake configurations to ensure proper compilation of the core library.
Benefits:
- Improves project structure by separating core functionalities from application-specific code.
- Facilitates easier maintenance and understanding of the codebase by clarifying the organization of core components.
- Eliminated the inclusion of EditorCardManager from multiple editor header files, streamlining dependencies and reducing coupling.
- Updated comments in PaletteEditor to reflect the transition to EditorCardRegistry for card management.
Benefits:
- Enhances modularity by decoupling editor components from the centralized card manager.
- Improves maintainability and clarity in the codebase by aligning with the new card management approach.
- Revised the editor status section to reflect the current state of various editors, including stability notes and testing requirements.
- Clarified the welcome screen visibility logic in the documentation, emphasizing its behavior when no ROM is loaded and the conditions for manual control.
- Enhanced the overall structure and clarity of the development guide to better inform contributors about the project's status and UI management practices.
Benefits:
- Provides a clearer understanding of the current capabilities and testing needs of the editors.
- Improves documentation accuracy regarding UI behavior, aiding developers in troubleshooting and feature implementation.
- Added LayoutManager to manage ImGui DockBuilder layouts for various editor types, providing professional default layouts similar to VSCode.
- Integrated layout initialization and persistence features, allowing users to save and load custom layouts.
- Updated EditorManager to initialize LayoutManager and set default layouts upon editor activation.
Benefits:
- Improves user experience by offering tailored layouts for different editing tasks.
- Enhances maintainability by centralizing layout management and initialization logic within the new LayoutManager class.
- Enhanced the logic for displaying the welcome screen by clarifying conditions for visibility and adding error logging for null references.
- Improved state management and debugging information to provide better insights into the welcome screen's behavior during runtime.
Benefits:
- Increases clarity and maintainability of the welcome screen logic, ensuring a more intuitive user experience.
- Enhances debugging capabilities with detailed logging of state changes and conditions affecting the welcome screen display.
- Updated EditorManager to streamline UI component rendering, ensuring that UI elements like the Command Palette and Global Search are properly displayed.
- Refactored MenuOrchestrator to introduce a new Debug menu, consolidating debugging tools and enhancing accessibility for users.
- Improved PopupManager to include new popups for feature flags and data integrity checks, providing better feedback and control over debugging processes.
Benefits:
- Enhances user experience by organizing UI elements and debugging tools more effectively.
- Improves maintainability by centralizing UI management and debugging functionalities within dedicated components.
- Updated multiple editor components to check visibility flags before rendering cards, ensuring that only visible cards are displayed.
- Refactored card rendering logic in GraphicsEditor, ScreenEditor, MessageEditor, MusicEditor, SpriteEditor, and Emulator to enhance user experience and performance.
- Improved maintainability by centralizing visibility checks and ensuring consistent behavior across different editor types.
Benefits:
- Streamlines the rendering process, leading to a more efficient UI experience.
- Enhances code clarity and maintainability by standardizing visibility handling across editors.
- Updated the sidebar UI in EditorCardRegistry to improve visibility and theming consistency using ThemeManager.
- Refactored SettingsEditor to register multiple settings cards, enhancing modularity and organization of settings.
- Improved the layout and interaction of category tabs, ensuring a more intuitive user experience.
Benefits:
- Streamlines the settings management process, leading to a more organized and efficient user interface.
- Enhances maintainability by clearly defining card registration and visibility logic within the editor framework.
- Updated EditorManager and various editor components to utilize EditorCardRegistry for card registration and visibility management, enhancing dependency injection and modularity.
- Refactored card registration logic across multiple editors, ensuring a consistent approach to managing editor cards.
- Improved UI coordination by delegating visibility checks and card management to the new registry, streamlining the user experience.
Benefits:
- Simplifies card management, leading to a more organized and efficient user experience.
- Enhances maintainability by clearly defining roles for card handling and editor operations, aligning with the overall architecture improvements.
- Updated EditorManager to initialize PopupManager in the constructor, ensuring safe access to popups during menu operations.
- Refactored MenuOrchestrator to utilize PopupID constants for popup management, improving clarity and maintainability.
- Enhanced PopupManager to register popups with structured definitions, allowing for better organization and future expansion.
Benefits:
- Streamlines the initialization process, preventing potential crashes due to uninitialized components.
- Improves the organization of popup management, leading to a more intuitive user experience and easier maintenance.
- Removed the save as menu and new project menu from EditorManager, delegating their functionality to PopupManager for better separation of concerns.
- Introduced a command palette in UICoordinator, enhancing user experience with fuzzy search capabilities for commands.
- Updated UI components to improve clarity and maintainability, ensuring a more efficient workflow for users.
Benefits:
- Enhances the organization of UI elements, leading to a more intuitive user experience.
- Improves code maintainability by consolidating UI management responsibilities within dedicated components.