Commit graph

314 commits

Author SHA1 Message Date
Max
c6e1c449e1 Enhance Tai service readiness checks and OAuth device flow
- Improve health check logic in CI workflows for both HTTP and gRPC readiness of the Tai service, ensuring clearer error reporting if the service fails to start.
- Update the OAuth Device Flow implementation to support additional claims during device authorization, enhancing the flexibility of the authorization process.
- Refactor the `AuthorizeDevice` method to accept extra claims, allowing for more detailed user context during authorization.
- Introduce a new utility function to extract bearer tokens from requests, streamlining token handling across the OpenAPI service.

These changes enhance the robustness of service readiness checks and improve the OAuth device authorization flow, contributing to a more reliable and flexible authentication mechanism.
2026-03-04 16:55:29 +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
6e68efaba3 Implement gRPC support in the Yao SDK
- Add gRPC server configuration to the application, allowing for gRPC communication.
- Introduce new Makefile targets for gRPC unit testing and proto code generation.
- Update CI workflows to include gRPC tests with SQLite as the transport layer.
- Refactor the sandbox design to support multi-node capabilities and improve isolation.
- Enhance the service layer to facilitate internal request forwarding for gRPC APIs.

This commit lays the groundwork for integrating gRPC into the Yao SDK, improving performance and scalability.
2026-03-04 13:17:48 +08:00
Max
ccc25e7079 Add tags field to Server struct in MCP model
- Introduce a new Tags field in the Server struct to allow for additional metadata.
- Update the listServers function to populate the Tags field from the server metadata, enhancing the server representation with more contextual information.
2026-03-02 15:05:11 +08:00
Max
87f80b0ccc Refactor OAuth token refresh handling to improve concurrency management
- Introduce a refresh gate mechanism to prevent duplicate refresh attempts for the same token, allowing concurrent requests to safely handle expired tokens.
- Update the guard and refresh token logic to utilize the new error handling for in-progress refresh operations, enhancing the reliability of the authentication flow.
- Remove the previous caching mechanism for refresh status, streamlining the code and improving clarity in the refresh process.
2026-03-02 14:12:22 +08:00
Max
a6d91c866d Implement refresh token rotation handling to prevent duplicate refresh attempts
- Enhance the OAuth authentication flow to allow concurrent requests to safely handle expired tokens without triggering multiple refresh attempts.
- Introduce a mechanism to mark refresh tokens as being rotated, ensuring that only one request processes the refresh while others can proceed with valid claims.
- Update the guard logic to reflect these changes, improving the overall efficiency and reliability of token management.
2026-03-02 11:01:45 +08:00
Max
efb612734d Add integration credential verification endpoint to robot API
- Introduce a new POST endpoint for verifying integration credentials at /robots/integrations/verify.
- Ensure the endpoint is positioned correctly in the routing to avoid conflicts with existing routes.
- Enhance the API's capabilities for integration management by allowing credential verification.
2026-03-02 08:08:10 +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
76602715b1 Add ServerURL to YaoMetadata and implement resolveServerURL function
- Introduce ServerURL field in YaoMetadata to provide the public server URL for the instance, with a fallback mechanism.
- Implement resolveServerURL function to determine the ServerURL based on the YAO_SERVER_URL environment variable or the issuer_url.
- Update yaoMetadata method to populate the ServerURL field, enhancing API endpoint construction for clients and integrations.
2026-02-28 20:06:31 +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
bc4787f857 Update executor to support V2 execution model and enhance event handling
- Implement V2 execution model in the standard executor, simplifying task execution to a single call without validation loops.
- Introduce support for resuming suspended executions, allowing for human input during task processing.
- Enhance event handling by pushing task completion and failure events to the event bus for better tracking and integration.
- Update tests to reflect changes in execution flow and ensure robust handling of task statuses and results.
2026-02-25 18:40:48 +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
a38d115465 Refactor LLM capabilities handling and remove deprecated model loading
- Remove the `LoadModelCapabilities` test and associated model capabilities initialization from the agent, streamlining the loading process.
- Update the LLM provider implementations to utilize a unified `Capabilities` structure, replacing references to `openai.Capabilities` with `llm.Capabilities`.
- Enhance capability retrieval methods to simplify the extraction of connector capabilities, ensuring compatibility across different LLM providers.
- Clean up unused functions and variables related to model capabilities, improving code maintainability.
2026-02-24 09:32:19 +08:00
Max
1e4e1224e2 Enhance subscription management by adding cancel functions and improving channel handling
- Update the Subscribe and SubscribeFrom methods to return a cancel function, ensuring proper resource cleanup when subscriptions are no longer needed.
- Modify unsubscribe logic to close channels safely, preventing potential panics from sending on closed channels.
- Enhance test cases to utilize the new cancel functionality, ensuring robust handling of subscriptions in various scenarios.
2026-02-24 00:22:08 +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
886c91372b Disable /otp/create endpoint to prevent unauthorized OTP code generation; update documentation to reflect server-side creation process only. 2026-02-21 21:45:45 +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
85159f49dd Add STT capability support in LLM agent
- Update the `ToMap` function in `capabilities.go` to include the `stt` capability from OpenAI.
- Modify the `convertAnthropicCaps` function to map the `STT` field from Anthropic capabilities.
- Enhance documentation in `llm.go` to describe the new `stt` capability for audio transcription models.
2026-02-14 18:03:13 +08:00
Max
650a002a5a Implement support for Anthropic connectors in the LLM and sandbox components
- Add handling for Anthropic connector types in the sandbox, allowing direct connections without a proxy.
- Enhance capability retrieval to support both OpenAI and Anthropic formats, ensuring a unified interface.
- Update the executor and command logic to differentiate between OpenAI and Anthropic configurations, streamlining environment setup.
- Modify the provider selection logic to accommodate Anthropic capabilities, improving flexibility in LLM provider management.
- Refactor API detection to include Anthropic, ensuring accurate identification of connector types.
2026-02-11 12:05:07 +08:00
Max
cc053f3d0e Refactor OAuth access token handling and remove unused API key methods
- Clean up the `guard.go` file by removing the `isAPIKey` and `getAccessTokenFromAPIKey` methods, which are no longer needed.
- Add comments to clarify the purpose of the API key authentication block, ensuring it remains intact for future implementation.
- This change streamlines the access token retrieval process and improves code clarity.
2026-02-08 15:19:09 +08:00
Max
3bbc11604c Implement ENV variable resolution in team configuration
- Add `resolveTeamConfigENV` function to process and replace environment variables in team configuration settings, including robot email domains, whitelist entries, and invite configuration.
- Enhance `loadTeamConfigs` to call the new function, ensuring that team configurations are properly resolved before storage.

This change improves the flexibility of team configurations by allowing dynamic environment variable substitution.
2026-02-07 20:22:14 +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
16a96642f5 Refactor user registration process to include default team creation
- Introduce a new function `registerUserWithTeam` that handles user registration and default team creation with rollback on failure.
- Update `GinEntryRegister` and `LoginThirdParty` functions to utilize the new registration method, ensuring consistency in user and team creation.
- Remove redundant error handling for user provider retrieval in `GinEntryRegister`.
- Enhance logging for user registration and team creation failures.
2026-02-07 17:19:28 +08:00
Max
0a965c383d Add sandbox ID and VNC URL methods to sandbox executor
- Implement GetSandboxID method to return a mock sandbox ID for testing.
- Add GetVNCUrl method to return an empty string for VNC access in tests.
- Update SandboxExecutor interface to include new methods for sandbox identification and VNC URL retrieval.
- Enhance context creation to set sandbox ID and VNC URL properties in the sandbox instance.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-05 21:46:07 +08:00
Max
69058787f9 Add VNC remote desktop support for sandbox containers
- Add VNC-enabled Docker images (playwright, desktop) with Xvfb, x11vnc, noVNC
- Implement VNC proxy service for WebSocket-based VNC access
- Add API endpoints: /sandbox/{id}/vnc, /vnc/client, /vnc/ws
- Support dynamic VNC port mapping for Docker Desktop (macOS/Windows)
- Add YAO_SANDBOX_VNC_PORT_MAPPING config option for local development
- Update build.sh to support building VNC images
- Include design document and updated README

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-05 14:45:54 +08:00
Max
015fc9ef92 Add secure_cookie field to EntryConfig API response
- Add SecureCookie field to EntryConfig struct for frontend access
- Add GetCookieName helper to response package for dynamic cookie names
- Update guard.go to use GetCookieName instead of hardcoded __Host- prefix
- Pass secure_cookie setting to /user/entry API response

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-04 20:55:53 +08:00
Max
d7ba22ae8e Enhance OAuth security configuration and cookie handling
- Add SecureCookie field to TempSecurityConfig and SecurityConfig for better cookie security management.
- Implement SetSecureCookieEnabled and IsSecureCookieEnabled functions to manage secure cookie settings globally.
- Update response handling to utilize secure cookie settings, ensuring compliance with security best practices.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-04 20:16:24 +08:00
Max
454da5208b Enhance Execution Control and Error Handling in Robot Manager
- Updated execution control methods (`PauseExecution`, `ResumeExecution`, `StopExecution`) to include error handling and database status updates for paused, running, and cancelled states.
- Introduced `ExecuteWithControl` method in the Executor interface to manage execution with pause/resume capabilities, allowing for better control during execution.
- Enhanced the `Execute` methods across different executors (DryRun, Sandbox, Standard) to support pre-generated execution IDs and control mechanisms.
- Improved error messages in the execution handling API to provide clearer feedback on execution status and errors.
- Added support for a new execution status `ExecPaused` in the execution model, enhancing the tracking of execution states.
2026-01-28 19:10:01 +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
0e72aa9d8f Enhance Execution Response with Progress Calculation
- Added logic to calculate the current state for progress bar display in the `NewExecutionResponseBrief` function.
- If `exec.Current` is nil, the progress is derived from the task statuses, providing a synthetic current state for better UI feedback.
- Updated the `Current` field in the execution response to include this calculated progress, improving clarity in execution status representation.
2026-01-24 12:27:47 +08:00
Max
28d5730289 Add Description Field to Task Struct and Enhance Execution Management
- Introduced a new `Description` field in the `Task` struct for a human-readable task description, improving UI clarity.
- Updated the `ParseTask` function to save the description from input data and convert it to a message if no explicit messages are provided.
- Enhanced the `Executor` to update UI fields with localized messages during task execution phases, ensuring better user feedback.
- Implemented a new method in the `ExecutionStore` to persist task status updates, allowing real-time UI updates.
- Added unit tests to validate the new task description handling and UI updates during execution phases.
2026-01-24 12:16:02 +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
ff412da7b3 Enhance Assistant Filtering with Multi-Type Support
- Added a new `Types` field to the `AssistantFilter` struct to allow filtering by multiple types using an IN query.
- Updated the `GetAssistants` function to apply the new multi-type filter alongside the existing single type filter.
- Modified the OpenAPI endpoint to support the new `types` query parameter for better flexibility in assistant retrieval.
- Ensured backward compatibility by setting a default type when neither `type` nor `types` is specified.
- Updated related documentation and tests to reflect the changes in filtering capabilities.
2026-01-22 19:21:51 +08:00
Max
36ac190637 Implement Auto-Generation of Member ID in Robot API
- Updated the CreateRobot API to auto-generate the member_id if not provided, enhancing usability and ensuring unique identifiers.
- Revised CreateRobotRequest structure to make member_id optional, aligning with the new auto-generation logic.
- Added a new function for generating unique member IDs with collision detection, ensuring compliance with existing ID patterns.
- Enhanced unit tests to validate the new behavior, ensuring robust error handling and proper ID generation.
- Updated related OpenAPI documentation to reflect changes in request structure and behavior.
2026-01-22 17:31:36 +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
6f93175a46 Update TODO.md for Frontend Integration and Phase Progression
- Revised implementation strategy to emphasize immediate frontend integration after backend phases.
- Detailed tasks for Phase 1-FE, including SDK implementation and page integration for robot management.
- Updated progress tracking table to reflect current status of backend and frontend phases.
- Added verification steps for frontend integration to ensure end-to-end functionality.
2026-01-22 12:28:58 +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
df5836d8cc Enhance Robot API with Bio Field and CRUD Operations
- Added a `Bio` field to the `Robot` structure, allowing for a description of the robot.
- Updated the `cleanupAPITestRobots` function to delete robots with member IDs starting with both "robot_api_" and "api_robot_".
- Implemented new API functions for creating, updating, and removing robots, ensuring proper validation and cache management.
- Enhanced request and response types in `api/types.go` to include the new `Bio` field.
- Added comprehensive tests for the new CRUD operations in `robot_test.go`, ensuring robust validation and error handling.
2026-01-22 11:50:25 +08:00
Max
cf2a98ccb4 Enhance Robot API and Store Architecture
- Introduced a new `RobotStore` in `store/robot.go` for core CRUD operations on robot members, including methods for saving, retrieving, listing, deleting, and updating configurations.
- Extended the API layer with new thin wrappers in `api/robot.go` for creating, updating, and removing robot members, ensuring cache refresh and validation.
- Added new files `api/results.go` and `api/activities.go` to handle results and activities, respectively, integrating with the execution store for enhanced functionality.
- Updated `DESIGN.md` and `GAPS.md` to reflect the new architecture and decisions regarding the separation of store and API layers, promoting better organization and reuse across different consumers.
2026-01-22 11:08:43 +08:00
Max
a0fa0e9eff Refactor E2E Test Structure and Enhance Logging
- Updated the `TestE2EControlStop` function to improve execution status verification with a retry mechanism, accommodating potential delays.
- Streamlined `TestE2EEventTriggerVariousEventTypes` to focus on a single event type, reducing CI execution time while maintaining coverage.
- Enhanced logging and assertions for better clarity in test outcomes, improving overall test reliability.
2026-01-22 10:49:37 +08:00
Max
d95b911934 Update Auth Scope Handling in User KB Collection Preparation
- Added a comment to clarify that the __yao_created_by field is only set for create operations, ensuring consistency with the WithCreateScope function.
- Removed the __yao_updated_by field from the auth scope, streamlining the user knowledge base collection preparation process.
2026-01-10 12:48:15 +08:00
Max
4ba62600dc Refactor Knowledge Base Collection Initialization and Document Retrieval
- Removed the synchronous preparation of the knowledge base (KB) collection from the InitializeConversation method, now initializing it asynchronously after user login.
- Introduced a new method, GetDocumentsContent, to retrieve content for multiple documents by their IDs, supporting text-based files and improving document handling.
- Updated the API interface to include the new GetDocumentsContent method, enhancing the document management capabilities.
- Enhanced locale handling in the login context to support user preferences during KB collection creation.
2026-01-10 12:38:42 +08:00
Max
748cf253da Refactor extractCollectionIDFromDocID Function
- Simplified the extractCollectionIDFromDocID function by directly returning the first part of the docID, removing unnecessary logic for prefix handling.
- Commented out the previous logic for clarity and potential future reference, maintaining code readability.
2026-01-05 10:47:22 +08:00
Max
8485dd420e Refactor API Routing and Update Content-Type Header
- Added new root-level endpoints for team management, including listing and creating teams, while maintaining OAuth protection.
- Streamlined user-related endpoints by removing unnecessary groupings, enhancing clarity and accessibility.
- Updated the Content-Type header in the API response to application/json for better consistency with API standards.
2026-01-04 16:15:44 +08:00
Max
787954f0af Enhance OpenAPI Integration and API Routing
- Introduced support for OpenAPI mode, allowing dynamic routing and OAuth guards for API endpoints.
- Updated API root path handling to accommodate OpenAPI configurations, ensuring consistent URL structures.
- Added well-known routes for Yao metadata and OAuth discovery, improving API discoverability.
- Refactored middleware and guards to streamline OpenAPI integration, enhancing overall service functionality.
- Removed deprecated agent TypeScript file, simplifying the codebase and improving maintainability.
2026-01-04 15:46:09 +08:00
Max
05cb4b9199 Improve Backend Scripts Documentation with Additional Examples
- Added new examples for backend script method calls from `.json` configurations, enhancing practical understanding for developers.
- Clarified usage of request parameters and common pitfalls, improving guidance for effective backend script implementation.
- Updated existing sections to ensure consistency and clarity in documentation, supporting better developer experience.
2026-01-04 12:06:45 +08:00