Commit graph

93 commits

Author SHA1 Message Date
Max
1efa87e50a feat(llm): add Yao Agents preset and LLM management endpoints
- Introduced a new preset for Yao Agents in presets.yml, including configuration details such as API URL and capabilities.
- Added new LLM management endpoints in the OpenAPI settings, allowing for CRUD operations on LLM providers and roles.
- Enhanced data structures to support the new LLM functionality, including LLMPageData for aggregated responses.
2026-04-29 10:28:07 +08:00
Max
bba43c369a feat(setting): implement cloud settings endpoints and owner verification
- Added new endpoints for managing cloud settings under /setting/cloud, including GET, PUT, and POST methods.
- Introduced owner verification logic to ensure only team owners can modify settings, utilizing caching for efficiency.
- Enhanced data structures for cloud settings responses, including CloudRegion and CloudPageData types.
- Refactored existing functions to integrate new owner verification and error handling mechanisms.
2026-04-28 21:20:43 +08:00
Max
3bc15b1039 feat(openapi): add unified /setting/* endpoints for OpenAPI
- Introduced handlers for the new /setting/* endpoints in the OpenAPI module.
- Updated import statements to include the new setting package for better organization.
- Enhanced routing capabilities to support the new settings functionality.
2026-04-28 19:33:27 +08:00
Max
8fdd1a3a6c feat(robot): add workspace support to robot management
- Introduced a new `workspace` field across various robot-related structures, including `CreateRobotRequest`, `UpdateRobotRequest`, and `RobotResponse`, allowing for better organization and management of robots within specific workspaces.
- Updated database queries and response mappings to accommodate the new workspace field, ensuring seamless integration with existing functionalities.
- Enhanced agent execution context to include workspace information, improving the contextual awareness of agents during operations.
- Added tests to validate the creation and updating of robots with workspace data, ensuring robust functionality and backward compatibility.
2026-03-28 16:59:52 +08:00
Max
d43b637ad4 feat(assistant): enhance sandbox handling and improve assistant tag filtering
- Added support for sandbox configuration in the LoadPath function, allowing for better management of sandbox settings.
- Updated tests to validate the retrieval of assistant tags with type filters, ensuring accurate responses for both assistant and robot types.
- Enhanced the assistant model to differentiate between sandbox versions, improving the handling of sandbox data in the database.
- Improved API responses to include computer filter details for V2 sandboxes, enhancing the information returned to clients.
2026-03-24 19:19:04 +08:00
Max
2dc4307175 feat(tai): enhance node registration and management
- Updated the registration process to utilize NodeID instead of TaiID, allowing for server-generated TaiIDs.
- Implemented additional fields in the registration request, including DisplayName and improved error handling for missing parameters.
- Enhanced the connection logic for registered nodes, ensuring proper client binding and logging for better traceability.
- Introduced new methods for extracting and managing extra claims in OAuth tokens, improving the flexibility of user identification.

Made-with: Cursor
2026-03-10 15:40:41 +08:00
Max
1c79908649 Enhance OAuth Device Flow implementation
- Add support for the OAuth Device Authorization Flow (RFC 8628) in the OpenAPI service, allowing devices with limited input capabilities to obtain authorization.
- Implement `DeviceAuthorization()` and `AuthorizeDevice()` methods to handle device and user code generation, storage, and authorization.
- Update the OAuth endpoints to include `/device/authorize` for user code authorization and fix the discovery endpoint path for device authorization.
- Introduce MongoDB service in CI workflows for testing and enhance the unit test workflow with Redis setup.
- Update Go module dependencies to include necessary packages for the new features.

This commit significantly advances the OAuth capabilities of the application, enabling a more flexible authorization process for devices.
2026-03-04 15:19:48 +08:00
Max
ea9e070f29 Enhance robot integration with Telegram and improve event handling
- Add Telegram integration support by introducing a dispatcher for handling Telegram events and messages.
- Implement event notifications for robot configuration changes (creation, update, deletion) to facilitate integration with external services.
- Refactor the robot initialization process to load robots into cache and start the dispatcher, improving the overall system setup.
- Update the delivery event structure to include additional metadata for better context during message handling.
- Enhance logging capabilities for better observability during robot execution and event processing.
2026-03-01 22:03:25 +08:00
Max
4f9238ac95 Add chat metadata persistence and enhance executor goals injection tests
- Implement TestEnsureChatMetadata to verify that metadata, including robot_id, is correctly persisted in chat records.
- Update EnsureChat method to store metadata from the context when creating chat records.
- Introduce TestExecutorGoalsInjection to validate that pre-confirmed goals are injected into executions from TriggerInput.Data.
- Enhance executor logic to handle goal injection and persistence, ensuring accurate execution titles.
- Modify chat filtering to support chat_id_prefix for improved chat retrieval based on robot identifiers.
2026-02-28 13:57:45 +08:00
Max
3fee0e3fc3 Enhance execution listing and interaction with pagination and streaming support
- Refactor execution listing to support pagination with `Page` and `PageSize` options, replacing previous `Limit` and `Offset` parameters.
- Introduce `ExcludeStatuses` in execution queries to filter out specific execution statuses.
- Implement streaming interaction methods in the manager, allowing real-time responses from the host agent during interactions.
- Update API endpoints to accommodate new query parameters and enhance interaction capabilities with streaming support.
- Modify tests to ensure coverage for new pagination and streaming functionalities.
2026-02-27 16:38:30 +08:00
Max
b4ded8a3ed Enhance Assistant model with capabilities and sandbox configuration
- Introduce `Capabilities` and `Sandbox` fields in the Assistant model, allowing for detailed descriptions of assistant capabilities and sandbox configurations.
- Update loading and conversion functions to handle the new fields, ensuring they are correctly parsed and stored.
- Modify filtering and response handling to include the new fields, providing better integration with the API.
- Add comprehensive tests to validate the functionality of the new fields, ensuring they are correctly processed in various scenarios.
2026-02-24 10:50:10 +08:00
Max
406750c665 Refactor OTP tests to remove deprecated /otp/create endpoint; update tests to reflect server-side OTP generation and enhance login flow validation. 2026-02-21 21:53:54 +08:00
Max
37ab2bc84b Enhance user login functionality with options for customization
- Introduce `LoginWithOptions` method to allow for customizable login flows, enabling overrides for scopes, token expiration, and refresh token issuance.
- Add `LoginOptions` struct to encapsulate optional parameters for login, improving flexibility in user authentication.
- Update token handling in `issueTokens` to accommodate new options, ensuring proper management of access and refresh tokens based on user preferences.
- Integrate OTP service initialization into the OpenAPI server setup for enhanced authentication capabilities.
2026-02-21 21:38:39 +08:00
Max
b68660b3cd Enhance OAuth token handling and refresh logic
- Update the `Authenticate` method in the OAuth guard to allow for token refresh when an access token is expired but still valid.
- Introduce `TryRefreshToken` method to handle the refresh token logic, including token rotation and cookie management.
- Implement `VerifyTokenAllowExpired` and `VerifyRefreshToken` methods to improve token verification processes.
- Adjust error handling to provide clearer responses for token refresh failures.
- Refactor token expiration strategies in the login process to ensure consistent handling of access and refresh tokens.
2026-02-21 18:06:27 +08:00
Max
bf8d82f022 Add Yao authentication source and OAuth email handling
- Introduce `YaoAuthSource` and `OAuthEmail` fields in various structures to capture authentication source and OAuth email during user login and registration processes.
- Update `SignIDToken`, `GetInfo`, and `Map` functions to include new claims for Yao authentication source.
- Modify login context to preserve authentication source and OAuth email across different user flows.
- Enhance token issuance to include authentication source and OAuth email in claims for better tracking and user context.
- Ensure proper handling of OAuth email for third-party logins without affecting user profile email.

This change improves the user experience by providing clearer context on authentication methods used during login and registration processes.
2026-02-07 19:44:10 +08:00
Max
6fa808c875 Enhance ListRobots API to Include Runtime Status
- Added concurrent fetching of runtime status for each robot in the ListRobots function, improving response efficiency.
- Updated the Response struct to include new fields for runtime status: Running, MaxRunning, LastRun, and NextRun, optimizing dashboard display.
- Implemented unit tests to verify the inclusion of runtime status fields in the ListRobots response, ensuring accurate data representation for users.
2026-01-24 18:49:39 +08:00
Max
3ef536c1e7 Add Activity Type Filtering to ListActivities API
- Introduced a new `Type` field in the `ActivityQuery` struct to allow filtering activities by type (e.g., execution.started, execution.completed, execution.failed, execution.cancelled).
- Updated the `ListActivities` method in `ExecutionStore` to handle the new type filter, mapping it to corresponding execution statuses.
- Enhanced unit tests in `execution_test.go` to validate filtering by activity type, including tests for valid and invalid type scenarios.
- Modified OpenAPI definitions and related types to support the new type filter in the activities endpoint, improving API usability and flexibility.
2026-01-24 18:28:16 +08:00
Max
2f040196ec Add Results and Activities Functionality to ExecutionStore
- Implemented `ListResults` and `CountResults` methods in `ExecutionStore` to retrieve and count completed executions with delivery content, supporting filtering by member ID, team ID, trigger type, and keyword.
- Developed `ListActivities` method to derive activities from execution status changes, allowing retrieval of recent activities for a team.
- Created corresponding unit tests in `execution_test.go` to validate the functionality of results and activities listing, ensuring accurate filtering and pagination.
- Updated OpenAPI routes and types to include new endpoints for listing results and activities, enhancing the API's capabilities for managing execution data.
2026-01-24 17:57:58 +08:00
Max
d590bd7557 Enhance Execution Management with UI Display Fields and Localization Support
- Added `Name` and `CurrentTaskName` fields to the `Execution` struct for improved UI display during execution phases.
- Implemented localization support for UI messages, allowing dynamic updates based on the execution context and user locale.
- Updated the executor to manage these fields at various phases, ensuring accurate representation of execution status.
- Enhanced OpenAPI documentation to reflect the new fields and their usage in execution responses.
- Added unit tests to validate the functionality of UI fields and localization handling.
2026-01-24 10:10:48 +08:00
Max
bb7638f1e5 Implement Autonomous Mode Filtering in Robot API
- Added support for filtering robots by `autonomous_mode` in the ListRobots API.
- Enhanced ListQuery structure to include an optional `AutonomousMode` field.
- Updated listRobotsFromDB function to apply the autonomous mode filter based on the query.
- Created new test cases to validate the filtering functionality for both autonomous and on-demand robots.
- Revised related OpenAPI endpoints and frontend integration to accommodate the new filtering options.
2026-01-22 16:14:59 +08:00
Max
64b5ffd154 Enhance Robot API with Permission Fields and Status Management
- Added `YaoCreatedBy` and `YaoTeamID` fields to `RobotState` and `RobotResponse` for improved access control.
- Updated `GetRobotStatus` to retrieve permission fields from the store and populate the robot state.
- Modified `robotFields` in the store to include new Yao permission fields for better management of access control.
- Enhanced OpenAPI integration by registering robot routes and ensuring proper permission checks in handlers.
- Updated documentation in TODO.md to reflect the completion of permission logic and API enhancements.
2026-01-22 12:21:44 +08:00
Max
324ee7dc92 Refactor Job System for Enhanced Function Execution and Error Handling
- Improved the `Job` struct to support dynamic function execution with the `AddFunc` method, allowing for flexible job management.
- Enhanced the `Goroutine` struct with the `ExecuteFunc` method to manage function execution, including robust error handling and context management.
- Updated unit tests for `AddFunc` to ensure proper function registration and execution, including memory cleanup verification.
- Revised documentation to reflect the new function execution capabilities within the job system.
2025-12-19 15:08:16 +08:00
Max
6714ef9813 Refactor Citation Handling and Enhance Search Result Storage
- Updated the CitationGenerator to produce simple integer IDs instead of formatted strings, improving clarity and consistency in citation references.
- Enhanced the executeAutoSearch method to save both successful and failed search results, capturing detailed execution data for better traceability.
- Introduced a new SearchExecutionResult type to structure search result data, including query, keywords, configuration, duration, and error information.
- Updated related tests to reflect changes in citation ID format and ensure proper functionality of the new storage mechanisms.
- Revised documentation to clarify the new citation format and search result handling processes.
2025-12-15 17:17:51 +08:00
Max
77fbfc1651 Refactor ListChats response handling to support grouping
- Updated the ListChats function to build responses based on the grouping mode, ensuring that when `group_by` is set, the `data` field is omitted to prevent duplication.
- Enhanced the response structure to conditionally include either `groups` or `data`, improving clarity and efficiency in chat session responses.
- Revised tests to validate the new response behavior, ensuring correct handling of grouped and flat responses based on the grouping criteria.
2025-12-10 16:45:22 +08:00
Max
279ae161c6 Enhance chat storage design with HTTP API documentation
- Added comprehensive documentation for the new RESTful HTTP APIs for managing chat sessions and messages, including endpoints for listing, retrieving, updating, and deleting chat sessions.
- Included detailed request and response examples for each endpoint, along with query parameters and permission filtering guidelines.
- Updated the `CHAT_STORAGE_DESIGN.md` to reflect these changes, ensuring clarity on the API's functionality and usage.
2025-12-09 16:03:17 +08:00
Max
5f803ef4d4 Implement authorized script execution and enhance context handling
- 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.
2025-12-08 11:42:01 +08:00
Max
339a486eb4 Refactor assistant capabilities and update data handling
- 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.
2025-12-02 12:36:47 +08:00
Max
e781e8f591 Refactor trace node management to support multiple parents and enhance type handling
- 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.
2025-11-21 17:33:00 +08:00
Max
fe0d93fa04 Update event field names in tests and types for consistency with API specifications
- 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.
2025-11-21 09:34:57 +08:00
Max
c6b9ef500c Refactor logging and formatting in OpenAI provider and test files
- 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.
2025-11-20 18:16:32 +08:00
Max
71cd7b9993 Enhance trace management functionality and logging 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.
2025-11-20 18:15:48 +08:00
Max
44d2ba4210 Refactor logging in model tests for consistency
- 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.
2025-11-11 16:42:01 +08:00
Max
8b690d37bc Refactor completion request handling in context tests
- 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.
2025-11-11 16:23:22 +08:00
Max
2099921cf4 Refactor test cases for assistant updates to improve consistency
- 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.
2025-11-08 16:22:29 +08:00
Max
fa5b98f5bf Add UpdateAssistant method for modifying assistant fields
- 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.
2025-11-08 16:21:35 +08:00
Max
90386ddb70 Refactor response handling in GetAssistant and ListAssistantTags functions
- 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.
2025-11-08 15:17:56 +08:00
Max
0f17db74ca Implement GetAssistant endpoint with permission verification
- 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.
2025-11-08 13:46:29 +08:00
Max
42b5e17d78 Fix formatting in TestListAssistantTags to improve readability
- Removed unnecessary blank lines in the test function, enhancing code clarity and maintainability.
2025-11-08 11:44:19 +08:00
Max
46e0f30599 Implement filtering for assistant tags retrieval
- 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.
2025-11-08 11:14:08 +08:00
Max
bed36b754f Enhance assistant model and query handling
- 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.
2025-11-08 10:25:28 +08:00
Max
c54ef71d6a ⚠️ BREAKING: Removed the Studio package and renamed Neo to Agent. Configuration file path changed from neo/neo.yml to agent/agent.yml.
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.
2025-11-06 18:13:54 +08:00
Max
0b88fb6098 Refactor content type assertion in file tests for improved clarity
- 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.
2025-11-06 11:57:59 +08:00
Max
59c32bd1f6 Update file tests to handle content type variations
- 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.
2025-11-06 11:57:38 +08:00
Max
5d18e76acd Enhance attachment management with public and share fields
- 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.
2025-11-05 18:11:36 +08:00
Max
d7dc5dfd3f Fix error handling in invitation resend test
- 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.
2025-10-29 09:52:57 +08:00
Max
481a6edbd5 Enhance team invitation functionality with locale support
- 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.
2025-10-29 09:28:55 +08:00
Max
7549a890e5 Refactor team configuration tests to remove uploader and avatar agent assertions
- 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.
2025-10-28 17:22:44 +08:00
Max
bf452ba1d3 Add member profile retrieval functionality
- 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.
2025-10-28 16:18:52 +08:00
Max
af02a21f65 Implement member profile update functionality
- 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.
2025-10-28 11:49:01 +08:00
Max
8ffa767dfe Add logo support to team creation and update functionality
- 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.
2025-10-27 17:46:25 +08:00