- Added ExecuteWithAuthorized method to the Script struct, allowing scripts to be executed with user authorization information.
- Updated existing Execute method to utilize ExecuteWithAuthorized for improved authorization handling.
- Enhanced script execution tests to verify behavior with and without authorized information, ensuring accurate context management.
- Implemented authorized information conversion to a map for easier integration with runtime environments.
- Refactored context handling in script execution to ensure authorized data is correctly passed and utilized.
- Enhanced the getConnectorCapabilities method to prioritize model capabilities and connector settings, improving capability retrieval logic.
- Deprecated the tools field in the Assistant model, transitioning to MCP for tool management, and updated related methods accordingly.
- Introduced new fields for connector options and prompt presets in the Assistant model, allowing for more flexible configurations.
- Updated the GetAssistant method to support field selection, improving data retrieval efficiency and flexibility.
- Refactored tests and documentation to reflect changes in the assistant structure and capabilities, ensuring clarity and maintainability.
- Updated the TraceNode structure to allow multiple parent IDs, facilitating implicit joins in trace management.
- Enhanced the TraceNodeOption to include a type field for better categorization of nodes.
- Refactored related methods in the trace manager and node handling to accommodate the new parent structure and type field.
- Improved test coverage for trace node creation and retrieval, ensuring robust handling of the new multi-parent functionality.
- Changed event field names in tests from "Type", "TraceID", and "Timestamp" to "type", "trace_id", and "timestamp" to align with the updated API format.
- Updated struct field tags in types.go to reflect the new naming conventions, ensuring consistency across the codebase and improving JSON serialization.
- Adjusted indentation and formatting in the OpenAI provider's logging statements to enhance readability and maintainability.
- Cleaned up test files by removing unnecessary blank lines, improving overall code clarity and consistency.
- Ensured that logging for request and response details is properly structured for better debugging capabilities.
- Introduced new methods in the trace manager for retrieving events, trace info, nodes, logs, and spaces from storage, improving data access and management.
- Updated the driver implementations to support loading and unarchiving traces, ensuring robust handling of trace data.
- Enhanced error handling and logging in the OpenAI provider to facilitate better debugging and traceability of requests and responses.
- Added a new TraceSpaceData struct to encapsulate space metadata along with key-value data for improved API responses.
- Updated log formatting in TestListModels, TestGetModelDetails, and TestModelIDFormat to ensure consistent output structure.
- Removed unnecessary blank lines to enhance code readability and maintainability in the test suite.
- Renamed and restructured the TestNewOpenAPI function to TestGetCompletionRequest for clarity.
- Updated test cases to validate completion requests using a structured request body instead of query parameters.
- Enhanced error handling and assertions to ensure comprehensive coverage of various scenarios, including metadata handling and expected outputs.
- Removed the obsolete openapi_chat_test.go file to streamline the test suite.
- Standardized formatting in TestUpdateAssistant and assistant_update_test.go to enhance readability.
- Ensured comments clearly indicate which fields are ignored during updates, maintaining clarity in test intentions.
- Implemented UpdateAssistant method in Mongo, Redis, and Xun stores to allow partial updates of assistant fields.
- Updated Store interface to include the new UpdateAssistant method, enhancing the flexibility of assistant management.
- Added comprehensive tests for UpdateAssistant functionality, covering various scenarios including single and multiple field updates, JSON field handling, and error cases.
- Updated API routes to support PUT requests for updating assistants, ensuring proper permission checks and response handling.
- Simplified the response structure by directly returning the assistant and tags objects instead of wrapping them in a "data" field.
- Updated corresponding tests to reflect the new response format, ensuring accurate assertions and improved readability.
- Added a new GetAssistant function to retrieve assistant details by ID, incorporating permission checks to ensure authorized access.
- Updated the assistant route to use the new GetAssistant handler, enhancing security by verifying user permissions before returning assistant data.
- Introduced a FilterBuiltInAssistant function to clear sensitive fields for built-in assistants, ensuring compliance with data protection standards.
- Enhanced test coverage for the GetAssistant functionality, including tests for successful retrieval, permission filtering, and error handling scenarios.
- Enhanced the HandleAssistantTags function to support multiple filtering options including type, connector, built-in status, mentionable status, automated status, and keywords.
- Updated the GetAssistantTags method in the store interfaces to accept a filter parameter, allowing for more granular tag retrieval.
- Refactored the Xun, Mongo, and Redis implementations of GetAssistantTags to utilize the new filtering capabilities.
- Added comprehensive tests for the new filtering functionality, ensuring correct behavior across various scenarios.
- Updated API endpoint documentation to reflect the new filtering options for assistant tags.
- Added permission fields (YaoCreatedBy, YaoUpdatedBy, YaoTeamID, YaoTenantID) to the AssistantModel for better tracking of ownership and access control.
- Introduced a custom QueryFilter in the AssistantFilter struct to allow for flexible permission-based filtering of assistants.
- Updated the GetAssistants method to apply the custom query filter, improving the retrieval logic based on user permissions.
- Enhanced test coverage for the new QueryFilter functionality, ensuring accurate filtering of assistants based on various criteria.
Remove deprecated studio package and refactor agent integration
- Deleted the studio package, which is no longer in use, to streamline the codebase.
- Updated references in the agent and chat modules to utilize the new agent package instead of the deprecated neo package.
- Ensured that all related middleware and routing functionalities are now aligned with the agent architecture, enhancing overall system coherence.
- Adjusted the assertion for content type in the file tests to enhance readability and maintainability.
- Ensured that the content type validation remains robust while checking for variations that may include charset.
- Modified assertions in file upload, retrieval, and content tests to account for content type variations that may include charset.
- Enhanced test robustness by checking that the content type starts with the expected value, improving validation accuracy.
- Introduced new fields in the attachment model for public access control and sharing options, allowing attachments to be marked as public or shared with specific teams.
- Updated the upload process to handle new permission fields, ensuring proper handling of public and share options during file uploads.
- Implemented permission checks in the file retrieval and deletion processes to enforce access control based on user roles and attachment settings.
- Added comprehensive tests for the new permission fields to validate functionality and ensure correct behavior in various scenarios.
- Updated the `TestInvitationResend` function to properly handle errors when sending the invitation request, ensuring that any failures are reported during the test execution.
- This change improves the reliability of the test by providing clearer feedback on issues encountered during the invitation process.
- Updated the invitation resend process to accept a locale parameter, allowing for locale-specific email formatting and invitation link generation.
- Modified the `teamInvitationResend` function to include locale handling, ensuring proper configuration based on the user's locale.
- Enhanced the `toString` utility function to support time formatting based on locale, improving date presentation in emails.
- Added new utility functions for locale-specific time formatting, ensuring consistent user experience across different regions.
- Expanded tests to validate the new locale handling in invitation processes, ensuring comprehensive coverage for various scenarios.
- Removed assertions for the uploader and avatar agent fields in the team configuration tests, as these fields are no longer preserved in the public configuration.
- Updated the GetTeamConfigPublic function to reflect the changes in the TeamConfig structure, ensuring only relevant fields are included in the public configuration.
- Adjusted test cases to maintain coverage while aligning with the updated configuration structure.
- Introduced a new endpoint `GET /teams/:team_id/members/:member_id/profile` to allow users to retrieve member profile information, including display name, bio, avatar, and email.
- Implemented the `GinMemberGetProfile` handler to process profile retrieval requests with appropriate authentication and error handling.
- Added business logic in `memberGetProfile` to ensure only authenticated users can access their own profile data.
- Expanded test cases in `TestMemberProfileGet` to validate various scenarios for profile retrieval, ensuring comprehensive coverage for authentication and data validation.
- Added a new endpoint `PUT /teams/:team_id/members/:member_id/profile` to allow members to update their profile information, including display name, bio, avatar, and email.
- Introduced `UpdateMemberProfileRequest` structure to handle profile update requests.
- Enhanced the `GinMemberUpdateProfile` handler to process profile updates with appropriate validation and error handling.
- Implemented business logic in `memberUpdateProfile` to ensure only the member can update their own profile.
- Expanded test cases to validate the new profile update functionality, ensuring comprehensive coverage for various update scenarios.
- Enhanced the team creation and update processes to include an optional logo field, allowing teams to have custom logos.
- Updated the CreateTeamRequest and UpdateTeamRequest structures to accommodate the new logo field.
- Modified the GinTeamCreate and GinTeamUpdate handlers to handle logo data appropriately.
- Expanded test cases for team creation and updates to validate logo handling, ensuring comprehensive coverage for scenarios involving logos.
- Added avatar field to CreateRobotMemberRequest and UpdateRobotMemberRequest structures, allowing for avatar URL or file ID during member creation and updates.
- Updated GinMemberCreateRobot and GinMemberUpdateRobot handlers to process avatar information, ensuring it is included in the member data.
- Expanded test cases for member creation and updates to validate avatar handling, including scenarios for updating only the avatar without affecting other fields.
- Enhanced team configuration tests to verify preservation of uploader and avatar agent fields, improving overall test coverage and reliability.
- Added the `UpdateRobotMember` method to handle updates for robot members, including validation for member existence, type checks, and email uniqueness.
- Introduced a new `UpdateRobotMemberRequest` structure to facilitate updates via the API, allowing for modifications to various fields such as `robot_email`, `status`, and `autonomous_mode`.
- Enhanced the `GinMemberUpdateRobot` handler to process update requests, ensuring proper authentication and error handling for various scenarios.
- Expanded test coverage with new test cases for the robot member update functionality, validating successful updates, error conditions, and edge cases.
- Refactored existing member management logic to integrate the new update capabilities, improving overall system robustness and user experience.
- Introduced the `robot_email`, `authorized_senders`, and `email_filter_rules` fields to the robot member model, enhancing the configuration options for robot members.
- Updated the member creation and existence check logic to ensure the uniqueness of `robot_email` globally, improving data integrity.
- Refactored API endpoints and request/response structures to accommodate the new fields, ensuring consistency across the member management system.
- Enhanced test cases to validate the new robot member features, including scenarios for email uniqueness and configuration updates, improving overall test coverage and reliability.
- Introduced a new MemberListRequest structure to support advanced filtering options such as status, member_type, role_id, email, and display_name.
- Updated the GinMemberList handler to parse and validate query parameters, improving user experience with clearer error messages for invalid inputs.
- Enhanced the memberList function to handle advanced filtering and sorting, allowing for more flexible and efficient member retrieval.
- Added comprehensive test cases to validate new filtering and sorting functionalities, ensuring robust coverage and reliability in member listing scenarios.
- Refactored existing member response structures to include new fields and improve data representation.
- Added the is_owner field to the member model to indicate if a member is the team owner, improving clarity and performance for queries related to team ownership.
- Updated the team creation process to automatically set the is_owner field for the creator of the team, ensuring accurate member status upon creation.
- Refactored related tests to verify the correct assignment of the is_owner field, enhancing test coverage and reliability in team membership scenarios.
- Removed redundant permission and restriction fields from the member model to streamline the data structure and improve maintainability.
- Added functions to check the existence of invitation codes, members, OAuth accounts, roles, teams, and user types before performing updates, enhancing error handling and user feedback.
- Updated relevant update functions to utilize these existence checks, ensuring accurate error messages when no changes are made or when entities do not exist.
- Refactored tests to validate the new existence check logic, improving overall test coverage and reliability.
- Introduced member_id as a unique identifier for members, improving data integrity and consistency across member operations.
- Updated member-related functions to utilize member_id instead of internal IDs, enhancing API usability and clarity.
- Implemented email existence checks for team members, allowing for better validation during member creation and updates.
- Refactored existing tests to accommodate changes in member identification and email validation, ensuring comprehensive coverage and reliability.
- Added new API endpoint for checking if an email exists within a team, improving user experience during member management.
- Introduced a new endpoint for creating robot members, enhancing the member model to include fields specific to robots such as email, system prompt, and autonomous mode.
- Refactored existing member creation logic to accommodate robot-specific requirements and ensure email uniqueness within teams.
- Updated request and response structures to support the new robot member functionality, improving API consistency.
- Added comprehensive test cases to validate the new robot member creation process, including scenarios for required fields, duplicate emails, and invalid inputs.
- Integrated Neo loading in the Prepare function of testutils.go to ensure the Neo environment is initialized before running tests.
- Updated error handling to log failures in loading Neo, enhancing test reliability and feedback.
- Adjusted variable assignment for Knowledge Base loading to maintain consistency in error handling.
- Modified the user creation functions in entry_test.go and invitation_test.go to use "active" as the status value instead of "enabled", aligning with the valid enum values for user status.
- This change ensures consistency across user-related tests and improves clarity regarding user status representation.
- Introduced ObtainAccessTokenWithRootPermission function to streamline the creation of test users with root permissions, ensuring consistent access token generation for tests.
- Updated various test cases to utilize the new function, improving clarity and reducing redundancy in access token acquisition.
- Enhanced team configuration retrieval to expose public settings while hiding sensitive information, improving security in API responses.
- Added detailed logging for ACL enforcement failures in the OAuth guard, providing clearer insights into permission issues.
- Updated error messages in the ACL enforcement logic to include contextual information such as client and user IDs, enhancing debugging capabilities.
- Introduced new constraints (CreatorOnly, EditorOnly) in the data access model, allowing for more granular control over data visibility based on user roles.
- Enhanced scope definitions to support additional constraints, improving flexibility in access control configurations.
- Updated documentation to reflect changes in data constraints and their usage in API handlers.
- Refactored the ACL enforcement process to include a comprehensive chain of permission checks for clients, users, teams, and members.
- Introduced data access constraints (OwnerOnly, TeamOnly) to enhance access control based on endpoint requirements.
- Updated the Error struct to include the stage of permission checks where failures occur, improving error reporting.
- Enhanced scope management with wildcard matching capabilities and added checks for restricted scopes.
- Implemented tests to validate the enforcement logic and ensure correct handling of data access constraints.
- Updated ACL configuration to include Cache and Provider fields for improved role management.
- Initialized Role Manager within the ACL setup, ensuring proper role handling and cache management.
- Enhanced tests to verify access denial and error handling for unmatched endpoints, improving overall test coverage and clarity in error responses.
- Updated the OAuth guard to set authorized information in the context using the new authorized package.
- Refactored the GetAuthorizedInfo function to utilize the authorized.GetInfo method, improving clarity and maintainability.
- Enhanced the ACL implementation by adding scope resolution logic in the Enforce method, ensuring proper access control based on user roles and scopes.
- Improved error handling and logging during ACL operations, providing better insights into access decisions.
- Added a new function, createPublicEntryConfig, to create a deep copy of EntryConfig without sensitive data, ensuring that global configuration remains intact when returning public config.
- Updated entry verification logic to utilize EntryVerificationStatus for clearer status handling during user verification.
- Enhanced tests to verify that the global config is not modified after multiple requests for public entry configuration, addressing a critical bug related to captcha secret exposure.
- Updated captcha test cases to utilize the new CaptchaGet function for retrieving captcha answers, improving test reliability.
- Refactored CaptchaMake and CaptchaValidate functions to leverage a new utils package for better encapsulation and maintainability.
- Enhanced error handling and logging in captcha-related processes, contributing to a more robust user experience during authentication.
- Streamlined the captcha generation process by integrating with the utils.captcha package, ensuring consistency across the codebase.
- Renamed and updated functions and tests to replace 'login' terminology with 'entry', reflecting the unified handling of login and registration processes.
- Removed deprecated login configuration functions and structures, streamlining the codebase.
- Enhanced test coverage for entry configuration retrieval and validation, ensuring comprehensive testing of the new unified approach.
- Improved error handling and logging for entry configuration scenarios, contributing to a better user experience during authentication.
- Updated the AcceptInvitation method to require both invitation ID and token, improving the invitation acceptance process.
- Modified related tests to accommodate the new invitation ID parameter, ensuring comprehensive coverage of acceptance scenarios.
- Enhanced the invitation acceptance endpoint to validate invitation ID, providing clearer error handling for invalid or expired invitations.
- Refactored tests to include detailed scenarios for accepting invitations, including success and failure cases, ensuring robust testing of the invitation flow.
- Updated the invitation creation response to return complete invitation details, including the invitation token.
- Improved error handling when retrieving created invitations, ensuring fallback to ID return on failure.
- Modified team configuration tests to require authentication, reflecting recent API changes.
- Added access token retrieval for authenticated requests in team configuration tests, enhancing security and compliance.
- Updated invitation creation logic to support email invitations and customizable expiry durations.
- Enhanced tests for invitation creation, including scenarios for registered and unregistered users, and handling of missing email requirements.
- Refactored API endpoints to use consistent parameter naming for team IDs.
- Improved error handling and logging for invitation-related operations, ensuring clarity in failure cases.
- Added support for sending invitation emails through the messenger service, with appropriate templates and settings.
- Cleaned up whitespace in user configuration validation and environment variable extraction tests.
- Enhanced logging statements for better clarity during test execution.
- Standardized formatting across test cases to improve maintainability.
- Updated login configuration tests to clarify endpoint descriptions.
- Introduced team configuration loading and retrieval functionality, including new endpoints for public access to team configurations.
- Refactored team management routes to standardize parameter usage and improve clarity.
- Added error handling for missing environment variables in client configuration.
- Implemented team configuration types and related structures for better organization and usability.
- Introduced invitation_id handling for member management, allowing for unique identification of pending invitations.
- Added methods to create, update, and remove members by invitation_id, improving the invitation workflow.
- Updated member data structures and API responses to include invitation-related fields, enhancing clarity and usability.
- Implemented tests for invitation ID operations, ensuring robust validation and error handling.
- Refactored team access checks to streamline member management processes.