You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Manage the registration of AI models involved in the AI dashboard assistant (#6)
feat: Add model management features including creation, deletion, and… … retrieval
- Introduced ModelsComposed interface for structured model data representation.
- Created UpdateModelDto interface extending CreateModelDto for partial updates.
- Implemented ModelStateMapper for mapping model states to statuses.
- Defined ModelRepository interface for model data operations.
- Developed use cases for creating, deleting, and retrieving models.
- Added hooks for managing model state and interactions in the UI.
- Integrated OpenSearch for model data storage and retrieval.
- Implemented model prediction validation to ensure response integrity.
- Established navigation service for dashboard assistant.
- Configured model provider settings for various AI models.
refactor http client to simplify proxy requests replace custom proxy request methods with standard HTTP verbs in «proxyRequest» to streamline usage and reduce redundancy.
update all repository usages to call «get», «put», and «delete» directly on «proxyRequest».
introduce «HttpMethod» enum for consistency and migrate dependencies.
remove legacy generic request logic and require core HTTP provider for improved reliability.
simplify «subscribe» signature to accept only next callback removes support for observer objects in «subscribe»
reduces API complexity and enforces a single subscription pattern
remove export for unused type streamline type exports to reduce unused imports and improve code maintainability
move number formatting utility for better code reuse replace import of «formatUINumber» with «formatNumber» from a shared location to promote consistency and reuse across the project
remove unused agent and model use-case logic eliminate use-case functions related to agent-model operations and direct model deletion to streamline setup and focus on composite entity deletion logic
refactor «updateFormDataOnChange» for cleaner event handling streamline input «onChange» logic by converting «updateFormDataOnChange» to a curried function, improving code readability and reducing repetitive code across form fields
refactor navigation and use-case setup for dashboard assistant Replaces legacy navigation and use-case setup with centralized services and dependency injection.
Introduces «AssistantNavigationService» and «NavigationService» for improved routing management and URL handling.
Refactors use-case initialization to leverage «getUseCases» and repository service, enabling more flexible dependency management.
Removes static setup files to reduce coupling and simplify configuration.
Updates codebase to consistently use new navigation and use-case interfaces.
replace custom proxy HTTP client with cleaner abstraction refactor HTTP client implementation to remove embedded «proxyRequest» logic
introduce «ProxyHttpClient» and «AxiosHttpClient» for improved separation of concerns
update repository constructors to accept both direct and proxy clients for clarity and flexibility
simplify interface by removing unnecessary methods and legacy client code
improve documentation formatting for architecture and folder structure Refines visual consistency in architecture and folder diagrams
by aligning indentation and spacing. Enhances readability and
clarifies code organization for future contributors.
remove dashboard assistant overview component Eliminates the overview UI and related toast functionality from the dashboard assistant. Simplifies codebase by removing unused or obsolete interface components.
refactor providers and add global toast support replace nested context providers with a new «Providers» component for cleaner composition.
add «ToastProvider» to enable application-wide toast notifications using «EuiGlobalToastList».
rename file extension to .tsx for consistency and update function naming from «removeToast» to «dismissToast» for clarity.
remove legacy navigation and toast logic Simplifies component by replacing old navigation and toast implementations with updated services.
Removes unnecessary dependencies and higher-order components to streamline usage and maintenance.
refactor navigation service usage in model table replace direct access to navigation service property with «getRegisterModelUrl» method
improve code consistency and clarity by standardizing navigation API
rename «home» to «goHome» for clearer intent
add «axios» and «history» dependencies with resolutions adds «axios» and «history» as dependencies to support HTTP requests and navigation functionality
adds «@types/history» for TypeScript support
enforces «axios» version resolution to address potential version conflicts
updates «yarn.lock» to reflect new and updated packages
improve header layout and add model/refresh actions replace static title with flexible group layout for better alignment. add buttons for model creation and data refresh to enhance usability. prepare for navigation integration in future updates.
add toast notifications for query success and error Integrates optional toast callbacks to display success and error messages when data queries resolve or fail.
Improves user feedback for asynchronous operations by leveraging «useToast» and customizable toasts configuration.
make «reload» asynchronous to await data loading ensure «reload» properly waits for «loadData» completion
improves reliability when triggering reload in async workflows
add hook for activating agents and enhance deletion toasts Introduce a new hook for agent activation, including success and error toasts for better feedback.
Improve deletion logic by adding detailed toast notifications for success and failure, increasing user clarity and responsiveness.
add model activation, testing, and deletion actions to monitoring UI Enhances monitoring interface by integrating model activation, testing, and deletion functionality.
Adds support for triggering model tests via flyout, displays test results, and improves user feedback on model management operations.
Updates imports to incorporate new hooks and components for a smoother, more interactive workflow.
add model metadata fields to preview panel Display additional metadata such as «version», «agentId», «inUse», and «createdAt» in the preview panel for enhanced visibility and context when reviewing model details.
add model usage, version, agent info, and actions to table Enhances model deployment table with new columns for version,
agent ID, usage status, and creation date to improve visibility.
Introduces action buttons for using, testing, and deleting models,
enabling more direct management from the table. Updates «onChange»
handlers to support these actions and disables actions based on
model state for better UX.
refactor deployment flow and improve callback handling simplify deployment status and registration components by
removing unused props, renaming callbacks for clarity, and
delegating navigation logic to parent components. improve
error and success handling by unifying callback usage and
streamlining button visibility logic for deployment actions.
migrate routing logic to React, enhance navigation convert routing file to JSX and wrap «ModelRegister» with navigation handlers using «useHistory» to enable redirect on cancel and deploy actions; improves user flow and code consistency with React Router.
replace add model button navigation with router link wrap the add model button in a «Link» component and use «routerPaths» for navigation
improves routing consistency and prepares for future navigation service integration
standardize model status values casing Update «ModelStatus» enum to use capitalized strings to ensure consistency with status checks in UI logic.
Prevent mismatches by aligning status comparisons with updated enum values.
route all HTTP methods through POST requests standardize proxying of GET, PUT, and DELETE methods by sending POST requests instead of their respective HTTP verbs to improve compatibility with the proxy backend
replace status icon with agent status component and unify dash usage unify display of missing values by replacing Unicode dash with «LONGDASH» constant
replace «StatusIcon» with «AgentStatus» for clearer agent status display
remove unused exports and improve code readability by updating render logic
enrich deployed models with agent info and metadata merge data from assistant use cases to include agent, usage, version, and creation date for deployed models
improve monitoring detail and enable richer model insights
fallback gracefully if composed model data is unavailable
remove models table component from dashboard assistant eliminate unused or deprecated UI logic to simplify codebase
removal helps reduce maintenance burden and potential confusion
by discarding a redundant feature from the dashboard assistant
add agent status mapping to model deployment data Derives agent state from composed model data and maps it to deployment items,
enabling clearer tracking of model status (active, inactive, error).
Refactors agent attachment logic for improved maintainability and consistency.
remove assistant config hooks and related exports Eliminates unused assistant configuration hooks and cleans up exports to streamline module structure. Reduces complexity and removes unnecessary code.
remove agent register command functionality Eliminates support for generating agent registration commands to simplify the codebase and reduce unused logic. Cleans up related UI components, use cases, and repository methods.
replace Axios HTTP client with native fetch implementation removes dependency on Axios and related packages for HTTP requests
introduces a new HTTP client using native «window.fetch» for improved bundle size and alignment with browser APIs
updates initialization logic to use the new client and cleans up package dependencies
remove custom navigation service and related setup Eliminates redundant navigation logic to simplify codebase.
Leverages core platform navigation utilities instead of maintaining separate abstractions.
Reduces maintenance overhead and potential for inconsistencies.
simplify error handling for permission checks remove dependency on AxiosError and refactor error handling logic
to directly check for status codes, making permission-related error
responses more straightforward and decoupled from Axios-specific errors
remove unused history dependency and types Eliminates redundant dependencies to reduce bundle size and simplify maintenance. Ensures only required packages are included for improved project hygiene.
add empty dependencies section to config ensures explicit declaration of dependencies for clarity
prepares for future additions or updates to dependencies
reduce flyout size for model test and deployment Improve UI experience by switching flyout size from medium to small for model testing and deployment dialogs, allowing more focused user interactions and better use of screen space.
remove unused assistant config use case Eliminates the assistant config retrieval logic and related exports to simplify the codebase and remove unused dependencies.
rename and refactor model-agent data composition logic Update function and variable names for clarity, changing «getModelsComposed» to «retrieveModelsWithAgentData» and «getModelsComposedUseCase» to «composeModelsWithAgentDataUseCase». Improve code readability by making terminology consistent around models and agent data enrichment. Simplify integration across related modules to better reflect actual behavior.
rename file to clarify agent data usage improve naming consistency by replacing 'info' with 'data'
to better reflect the file's purpose and align with domain terminology
rename and unify model and assistant installation use cases Align naming conventions across model validation and assistant installation flows for improved clarity and maintainability.
Rename model connection and assistant install functions and exports, update usages in service layer and hooks, and remove redundant exports.
Ensure function names clearly reflect their intent, reducing ambiguity in usage throughout the codebase.
remove assistant repository and centralize agent config handling Streamline agent configuration access by removing the assistant repository abstraction and related code. Refactor logic to retrieve active agent directly through the agent repository, simplifying dependencies and reducing redundancy.
improve header handling in HTTP client centralize addition of default and content-type headers in «fetch»
ensure HTTP method is always specified
simplify header logic in «get», «post», «put», and «delete» functions
prevents missing or incorrect headers for requests
refactor model-agent mapping and data composition logic streamline model and agent data association by replacing redundant types and mappers with a unified mapping approach
remove legacy hooks and DTOs to reduce duplication and simplify codebase
update data composition logic to use improved mapping strategy for clearer separation between models and agents
remove dependency on @osd/config-schema in model form validation replace schema-based validation with custom browser-safe logic in «validateModelForm»
improves compatibility and simplifies validation by handling input checks and provider-specific rules directly
removes reliance on server-side libraries for client-side form validation
add Docker-based test runner and integration/unit tests Introduce a Docker Compose test runner with supporting scripts to standardize local build and test execution. Add comprehensive unit and integration tests for HTTP clients, OpenSearch repositories, installation manager steps, and related mappers. Update the test command set and adjust return values to improve reliability of installation orchestration. Enhance maintainability and test coverage for core assistant setup and OpenSearch integration logic.
add comprehensive unit tests and repository mocks Introduce unit tests for model, agent, connector, and settings modules to improve code reliability and coverage. Add reusable repository mocks for consistent test isolation. Refactor tests to use mock factories and enhance maintainability. Replace manual spies with standardized mocks in HTTP client tests for clarity and consistency.
handle errors when deleting model group wrap call to delete model group in try-catch to prevent unhandled exceptions if deletion fails. improves robustness when the target does not exist or deletion encounters errors.
add delete confirmation modal for model deletion Introduce a confirmation modal requiring exact model name input before deletion to prevent accidental removals. Update related tests and table logic to ensure the delete button remains enabled even when the model is in use, shifting actual deletion to the confirmation step. Adjust test utilities for proper context and routing support.
extract and reuse model delete confirmation modal Refactors the model delete confirmation logic into a dedicated, reusable modal component. Simplifies the monitoring page by removing inline modal code and related state, and updates usage to leverage the new component. Adds focused unit tests for the new modal and removes legacy tests tied to the previous implementation. Improves code maintainability and encourages reuse of the delete confirmation UI.
set «delay» to null in «userEvent.setup» for tests ensure «userEvent» actions run without artificial delays to improve test speed and reliability
fix async handling in unit test with await ensure «waitFor» is properly awaited to avoid potential race conditions and improve reliability of asynchronous test assertions
add «--verbose» flag to Jest arguments ensure test output includes detailed information by default, improving test debugging and visibility without requiring manual flag entry
improve tests for «reload» and page status handling ensure «reload» in tests is awaited for proper async behavior
reset mocks and refine data source context to prevent false positives
add explicit checks that «search» is not called during data source fetching
improve test reliability and accuracy around loading state
add module-level documentation for dashboard assistant Introduce comprehensive README files for each core module, detailing structure, purpose, configuration points, and integration guidelines. Improve onboarding for new contributors and clarify where to modify prompts, agent tools, and provider settings. Facilitate consistent development and easier maintenance by outlining best practices and usage tips for each module.
improve documentation with prompt and troubleshooting examples add prompt customization examples and detailed troubleshooting guidance to clarify usage, provider integration, and common error resolution
include targeted before/after prompt patterns and updated recommendations for configuring providers and tool responses
enhance clarity for new custom provider integration and response handling
update docs to reflect architecture and API changes Revise documentation to align with recent architecture updates, including renaming classes, updating repository and use case interfaces, and clarifying component responsibilities. Remove outdated references to deprecated components, adjust examples for new API signatures, and improve installation and usage instructions for custom model tables and agent status. Clarify the installer flow and update configuration and request examples for consistency.
add quick index and module docs to improve navigation Enhances documentation by introducing a quick index and dedicated module documentation section, making it easier for users and contributors to navigate and understand the project structure.
add documentation for dashboard assistant components and services Introduce comprehensive README files detailing the purpose, structure, and usage patterns of UI components and service modules for the dashboard assistant. Improve onboarding and maintainability by clarifying available exports, integration points, and extension guidance. Facilitate faster development and easier understanding for new contributors.
improve model activation with polling and add tests Enhances activation logic by updating «registerAgentQuery» to poll for model readiness, preventing premature actions caused by eventual consistency. Adds comprehensive unit tests to verify polling behavior, success callbacks, and error handling for model use and test actions.
refactor actions column to use built-in table actions Simplifies the actions column by replacing custom button rendering and tooltips with the table's built-in «actions» configuration. Improves code maintainability and UI consistency while retaining all existing functionality.
improve test robustness for monitoring component Refactors tests to interact with the "View status details" action via the "All actions" menu instead of relying on button order, enhancing reliability and alignment with user behavior. Updates «userEvent.setup» configuration and test setup/teardown for clearer mock management. Removes unused mock function «updateDeployedModel».
improve test robustness for model action buttons Refactors tests to interact with action buttons within their table context, handling scenarios where actions may be presented either directly or in a popover menu. Ensures accurate validation of enabled and disabled states, and triggers corresponding handlers reliably. Enhances test resilience to changes in UI rendering and interaction patterns.
update tests and table layout for action button flexibility Refactors tests to support action buttons appearing inline or within an "All actions" popover, improving resilience to UI layout variations. Updates column indices and descriptions in tests to match the removal of the "Version" and "Created" columns from the table. Simplifies table structure by removing unnecessary columns for a cleaner interface.
prevent state updates on unmounted provider add «isMountedRef» to guard «addToast» and «dismissToast» against updating state after unmount
avoids potential memory leaks and React warnings from calling «setToasts» on unmounted components
export «AllTheProviders» for external use enable reuse of «AllTheProviders» in other test modules by exporting it, improving test setup consistency and flexibility
improve tests for «useModel» by adding provider and refactoring wrap hook in «AllTheProviders» to ensure proper context and refactor tests for reliability and clarity. streamline timer handling and async flows, avoiding redundant test cases while maintaining core coverage of activation and polling logic.
lint: fix lint errors
simplify agent registration logic and ensure propagation delay remove polling logic from agent activation and introduce a fixed delay after agent registration in «registerAgentUseCase» to handle eventual consistency. streamline «useModel» by delegating success handling to toast callbacks and removing unnecessary hooks.
simplify unit test and refactor «registerAgentUseCase» formatting Removes unnecessary test logic and mocks to streamline the unit test for agent registration, focusing only on core success flow. Refactors the formatting of «registerAgentUseCase» for improved readability.
Merge branch '4.14.0' into enhancement/7621-create-ai-assistant-manag… …er-plugin
improve error handling for permission errors in agent registration clarify and unify permission error detection by checking both «err.status» and «err.response.status»
add actionable guidance to the permission error message in agent registration to help users resolve access issues
ensure consistent error handling between agent retrieval and registration operations
add permission error handling for model monitoring Detects insufficient permissions when fetching deployed models and displays a user-friendly message instead of the model table. Updates «useMonitoring» to expose «permissionError» and «permissionErrorMessage», and updates the UI to conditionally render based on these values. Improves clarity and user feedback when access is restricted.
introduce specific error for ML config permission issues replace generic permission errors with a dedicated «PermissionMLConfigError» to provide clearer, actionable feedback when access to ML configuration is denied due to insufficient permissions. improves maintainability and user guidance for permission-related failures.
improve ML permission error handling and user feedback Refactors ML permission errors by introducing a unified «PermissionMLError» hierarchy, enabling more granular error detection and messaging for different ML resources. Updates UI to present clearer callouts when permissions are insufficient, and ensures permission errors are surfaced and handled consistently in the monitoring workflow. Enhances user guidance and robustness by refining when and how permission-related actions are displayed.
reorganize and centralize error exports for permissions Consolidates permission-related error exports by introducing index files and relocating agent error definitions. Simplifies imports and improves module organization for easier maintenance.
handle permission errors in «getAll» for connectors Improve error handling in «getAll» by throwing a custom permission error when access to ML Connector resources is denied. Add utility to detect permission-related errors and introduce a specific error class for clearer feedback. Simplify usage in monitoring by removing redundant try/catch logic.
improve ML model permissions error handling introduce «PermissionMLModelError» to provide clearer feedback for permission-related failures when accessing ML model APIs
refactor monitoring logic to rely on a single «permissionErrorMessage» for permission state, simplifying error checks and UI handling
improve error reporting consistency and maintainability for model operations
improve error display with popover and copy option replace tooltip with popover for error messages during deployment steps, allowing users to view full details and copy error text for easier debugging and support. enhances usability and accessibility of error handling in the deployment status view.
make «getAll» and «search» async with explicit await update «getAll» and «search» to use async/await for clarity and consistent error handling
returns are now explicitly awaited before returning, improving readability and potential stack trace accuracy
improve layout and styling for model registration form refactor structure of model registration form to simplify flex usage and apply custom class for targeted styling. add main stylesheet and introduce a new CSS rule to ensure proper layout within the app wrapper, enhancing consistency and alignment across the interface.
conditionally hide refresh interval in monitoring header add optional «showRefreshInterval» prop to control display of the refresh interval in the monitoring page header
hide the refresh interval when «permissionErrorMessage» is present to prevent unnecessary UI elements for users without sufficient permissions
replace «EuiCallOut» with «EuiEmptyPrompt» for permission errors improves UI consistency by using «EuiEmptyPrompt» instead of «EuiCallOut» to display permission error messages, ensuring a more standard and visually integrated error state
remove unused "Learn more" links from onboarding UI Simplifies onboarding components by removing non-functional "Learn more" links and related configuration. Reduces UI clutter and improves clarity for users during model registration and deployment status steps.
update copyright to Wazuh and clean up formatting Switches copyright notices from OpenSearch to Wazuh across source files
for proper attribution. Adds missing headers where needed and unifies
header formatting. Also cleans up minor code formatting inconsistencies
and simplifies some JSX structures for readability.
improve test to handle missing agent scenario Update test to simulate missing agent by resolving to null instead of throwing an error, ensuring «composeModelsWithAgentDataUseCase» correctly handles absent agent data and improves test clarity.
fix unit tests to mock error shape from HTTP client Update test error mocks to use «response.status» property, matching the actual error structure returned by the HTTP client. Improves test accuracy for permission and not-found error scenarios.
improve test reliability and mock external dependencies Add missing mocks for external service calls to ensure isolation and stability in unit tests. Update test expectations for asynchronous operations and clarify behavior when external connector retrieval fails, preventing unnecessary API calls and ensuring empty state handling. Reset shared API provider between tests to avoid state leakage.
update changelog for model config and AI assistant management Document new features for managing model configurations and AI assistants, including enhanced models table columns and selection of active configurations in the overview.
remove trailing periods from changelog entries improve consistency in documentation formatting by omitting unnecessary trailing periods in list items
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,4 +7,5 @@ All notable changes to the Wazuh ML Commons project will be documented in this f
7
7
### Added
8
8
9
9
- Support for Wazuh 4.14.0
10
-
10
+
- Added new columns to the models table that lists all model configurations [#6](https://github.com/wazuh/wazuh-dashboard-ml-commons/pull/6)
11
+
- Added the ability to manage configurations, register new AI assistants, and select which configuration is used in the AI models overview [#6](https://github.com/wazuh/wazuh-dashboard-ml-commons/pull/6)
0 commit comments