Commit graph

60 commits

Author SHA1 Message Date
Max
8786aa9a6a feat(database): add PostgreSQL support and enhance JSON handling
- Updated database configuration to include PostgreSQL 14.0 in CI workflows.
- Enhanced JSON null detection in the Xun store to support PostgreSQL dialect.
- Refactored time conversion utilities to handle multiple database formats, including PostgreSQL.
- Improved cleanup logic in the DataCleaner to ensure proper order of operations for referential integrity.
- Added utility functions for converting between Unix timestamps and database timestamps.
2026-04-06 02:56:04 +08:00
Max
14426327dd chore(logging): enhance logging and context management in agent and sandbox components
- Updated logging in various methods to include detailed traces for better monitoring of execution flow, including assistantID and chatID.
- Improved context management by ensuring proper release of resources and tracking of execution durations in agent calls.
- Added heartbeat logging in the Claude parser to monitor stream processing and prevent potential issues with long-running tasks.
- Refined the .gitignore file to exclude additional markdown files in the sandbox directory.
2026-03-25 22:00:58 +08:00
Max
427c38bac7 fix(robot): improve locale handling in agent context
- Updated agent context to ensure locale is propagated correctly, defaulting to "en" when no locale is provided. This change enhances internationalization support and ensures consistent behavior across different contexts.
- Adjusted test assertions to reflect the updated execution trigger logic for times mode robots, allowing for a maximum of 2 triggers instead of 1.
2026-03-25 15:18:02 +08:00
Max
1bddac44a4 refactor(robot): rename ListRobots to ListAllRobots and enhance caching logic
- Renamed ListRobots function to ListAllRobots for clarity and consistency across the codebase.
- Updated related API endpoints and tests to reflect the new function name.
- Improved caching logic to ensure both autonomous and non-autonomous robots are loaded correctly.
- Enhanced filtering and pagination capabilities within the ListAllRobots function.
- Added new test cases to validate the updated functionality and ensure robust performance.
2026-03-23 12:25:17 +08:00
Max
0e1e60b39c chore(deps): update dependencies in go.mod and go.sum
- Upgraded google.golang.org/grpc from v1.78.0 to v1.79.3 for improved performance and features.
- Updated golang.org/x/oauth2 from v0.32.0 to v0.34.0 to incorporate the latest enhancements and fixes.
- Added agent/robot/ROBOT-WATCHER-IMPROVEMENT.md to .gitignore to prevent tracking of specific improvement documentation.
2026-03-23 09:59:50 +08:00
Max
7cccf62841 feat(tai): refactor Dial* functions and remove requireKubeConfig hard-fail
- Consolidate DialRemote/DialTunnel common logic into buildResources + dialEnv interface
- Remove strict capability check that prevented ConnResources creation for host-exec-only nodes
- Merge gRPC-discovered capabilities with registration-declared capabilities in DialTunnel
- Replace requireKubeConfig hard-fail with graceful skip when kubeconfig is absent
- Introduce tai/types package for shared Ports/Capabilities/SystemInfo/AuthInfo/NodeMeta
- Add tai/conn.go (ConnResources) and tai/dial.go (DialRemote/DialTunnel/DialLocal)
- Rename tai/sandbox → tai/runtime for clarity
- Update sandbox/v2, workspace, agent/sandbox/v2 test utilities for build-tag isolation

Made-with: Cursor
2026-03-12 15:44:24 +08:00
Max
3f390c223c feat(sandbox/v2): enhance V2 sandbox integration and testing
- Implemented V2 sandbox initialization in the assistant loading process, allowing for standalone sandbox.yao configuration.
- Added support for V2 sandbox execution paths in the Assistant's Stream method, differentiating between V1 and V2 sandboxes.
- Introduced comprehensive tests for V2 sandbox configurations, ensuring correct loading and execution behavior.
- Updated the context and types to accommodate V2 sandbox features, including system information and workspace management.

Made-with: Cursor
2026-03-10 01:13:17 +08:00
Max
83ebe49036 refactor: unify server lifecycle, migrate gRPC client, and clean up sandbox v2
Server lifecycle:
- Introduce service.Service to manage HTTP + gRPC startup/shutdown
- Fix gRPC mutex deadlock in StartServer when port is occupied
- Add GracefulStop with 5s timeout before forced Stop in grpc.go
- Pre-check HTTP and gRPC port availability in cmd/start.go
- Print gRPC server address in startup access-points block

gRPC client refactor:
- Move token manager and client from tai/grpc/ to grpc/client/
- Add backward-compatible aliases in tai/yao.go and tai/token.go
- Update cmd/run.go to import grpc/client directly (no tai dependency)

Sandbox v2 docker migration:
- Delete sandbox/v2/docker/ (moved to tai repo)
- Update sandbox/docker/build.sh hint to point to tai repo
- Clean up .gitignore entries for removed docker directory
- Temporarily disable SandboxV2Test and BenchmarkSandboxV2 in CI
  (docker images need rebuild after tai repo migration)

Tai integration:
- Add direct-mode registration API handlers in tai/api/
- Add heartbeat handler and token management wrappers
- Update tai/registry and tai/tunnel for latest protocol
- Replace yao-grpc references with tai call in docs

Made-with: Cursor
2026-03-07 17:19:19 +08:00
Max
dfb33681f9 Implement Sandbox V2 support in the Yao SDK
- Add new gRPC endpoint for Heartbeat in the Yao service, enabling communication with the sandbox.
- Update Makefile to include a dedicated unit test target for Sandbox V2, ensuring proper testing of new features.
- Enhance CI workflows to incorporate Sandbox V2 tests, allowing for dual-mode testing (local and remote) with Docker.
- Modify .gitignore to exclude specific Docker files while allowing shell scripts for Sandbox V2.
- Update documentation in DESIGN.md to reflect the new architecture and capabilities of the Sandbox V2.

These changes enhance the Yao SDK's functionality, providing improved support for sandbox operations and testing.
2026-03-05 13:21:09 +08:00
Max
9450101a68 Add K8s runtime support to Tai SDK and CI k3d integration
- Add K8s sandbox implementation (sandbox/k8s.go) using client-go
- Extend tai.New() to support K8s runtime via Tai proxy
- Remove containerd support, fix default port assignment bug
- Update CI workflows to spin up k3d cluster and route K8s tests
  through Tai proxy for full end-to-end coverage
- Make test ports configurable via environment variables

Made-with: Cursor
2026-03-03 23:35:40 +08:00
Max
44af6ba759 Enhance command structure with MCP and Robot functionalities
- Introduce new MCP and Robot command groups in the CLI, allowing for better organization of package management commands.
- Add corresponding command descriptions for MCP and Robot functionalities to improve user guidance.
- Update the agent command group to include additional commands for enhanced agent management.
- Modify .gitignore to exclude specific design markdown files from version control.
- Add environment variable for test application path in GitHub workflows to streamline testing setup.
2026-03-03 08:11:43 +08:00
Max
691802ae62 Enhance testing framework with Registry Client SDK integration
- Update .gitignore to exclude registry data files.
- Modify Makefile to include new unit-test-registry target for running tests against the Yao Registry service.
- Add comprehensive Registry Client SDK tests in GitHub workflows, ensuring proper setup and execution of tests with Docker service dependencies.
- Implement steps for user creation, service restart, and test execution, along with reporting results back to the pull request.
2026-03-02 21:16:22 +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
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
fd24e31912 Update Makefile for enhanced testing and add new event documentation
- Modify unit test commands in the Makefile to include additional skip patterns for memory leak tests, improving test coverage and accuracy.
- Expand benchmark and memory leak detection to include the event module, ensuring comprehensive testing across all components.
- Add new design and TODO documentation files for the event module to facilitate future development.
2026-02-23 12:18:13 +08:00
Max
ce137b34f5 Enhance tool inspection and remove studio configuration
- Add external tool inspection functionality in the engine, allowing detection of tools like FFmpeg, PDF converters, and Docker.
- Update the `inspect` command to include detected tools in the output.
- Remove the studio configuration from the application, simplifying the configuration structure and related code.
- Clean up unused studio-related code in various files, including login processing and configuration management.
2026-02-14 21:06:59 +08:00
Max
95cdf7961c Add Chrome support to sandbox module and update documentation
- Introduce a new Chrome image for the sandbox, enabling VNC access with real Chrome and CDP support (amd64 only).
- Update README to reflect the addition of the Chrome image and its build instructions.
- Modify build script to include a dedicated build process for the Chrome image.
- Enhance .gitignore to exclude the new Chrome plan file.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 17:48:49 +08:00
Max
55164c5665 Enhance VNC sandbox images with Yao branding and sudo support
- Add passwordless sudo for sandbox user in playwright and desktop images
- Configure Yao branding for Fluxbox (CUI dark theme, centered logo)
- Configure Yao branding for XFCE (panel icons, wallpaper, workspace shortcut)
- Add D-Bus support for XFCE desktop environment
- Add dynamic wallpaper generation with configurable resolution and logo size
- Hide Fluxbox toolbar for cleaner Playwright automation view
- Create chromium wrapper script using Playwright's bundled browser
- Add feh and imagemagick for wallpaper management in Fluxbox
- Update .gitignore for config scripts and TODO file

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-05 18:23:15 +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
6e97de948b Enhance build process and options management
- Update Makefile to include new production and UPX build targets for optimized binaries.
- Add BUILDOPTIONS constant to share/const.go for tracking build configurations.
- Modify version command to display build options.
- Update Dockerfile to install UPX for compression during builds.
- Add release and prod targets to streamline artifact creation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-03 10:22:55 +08:00
Max
ea8be6c287 Add secure proxy configuration with options and secrets support
- Implement secure config file location (/tmp/.yao/proxy.json) instead of user-visible /workspace/
- Add generic options map support for backend-specific parameters (e.g., thinking for Volcengine GLM-4.7)
- Add secrets support for passing sensitive env vars (e.g., GITHUB_TOKEN) to sandbox container
- Remove excessive debug logs, keep critical ones with log.Printf("[Sandbox]...")
- Fix test assertions for system prompt passing via CLI args instead of env var
- Update i18n messages for sandbox loading states

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-01-31 22:46:48 +08:00
Max
3d16a9de77 Replace CCR with claude-proxy for Claude sandbox
- Add claude-proxy: lightweight Go proxy to translate between Anthropic
  and OpenAI-compatible APIs with full streaming and tool-calling support
- Update Dockerfile to include claude-proxy binary (multi-arch)
- Add auto-start proxy via entrypoint when env vars are set
- Update executor.go to write proxy config and start proxy
- Simplify command.go to use direct Claude CLI with proxy
- Support both docker run -e and config file for proxy settings

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-01-31 12:44:29 +08:00
Max
d4bed4f277 feat(sandbox): add persistent Docker sandbox for external CLI agents 2026-01-29 19:23:50 +08:00
Max
ff667b69d9 Update .gitignore to include introduction directory
- Added the introduction directory to the .gitignore file to prevent tracking of its contents in version control, improving repository cleanliness.
2026-01-09 19:02:43 +08:00
Max
45c01f9c04 Update TODO_V2.md and .gitignore for New Test Plan Documentation
- Added `UPGRADE_PLAN.md` to .gitignore to exclude the new upgrade plan documentation from version control.
- Revised TODO_V2.md to include a detailed implementation plan for the Agent Test Framework, outlining phases for before/after scripts, agent-driven assertions, and dynamic mode features.
- Improved overall documentation clarity to facilitate understanding of upcoming enhancements and tasks within the framework.
2025-12-26 09:10:27 +08:00
Max
17013f459f Update .gitignore and Refactor Path Resolution in Config
- Added MULTI_TURN_DESIGN.md to .gitignore to prevent tracking of design documents in the test directory.
- Refactored the LoadWithRoot function in config.go for improved readability by adjusting indentation for the absolute path resolution logic.
2025-12-25 12:13:04 +08:00
Max
70bed98e06 Add MongoDB Service to CI Workflows
- Introduced a MongoDB service in both `pr-test.yml` and `unit-test.yml` workflows to facilitate database testing.
- Configured MongoDB with environment variables for root username, password, and database name, enhancing test environment setup.
- Updated `.gitignore` to exclude job logs for search agents, ensuring cleaner repository management.
2025-12-15 11:30:09 +08:00
Max
d264c7a784 Implement search configuration management and testing enhancements
- Introduced a new search configuration structure, allowing for detailed settings for web, knowledge base, database, citation, and weights.
- Updated the `Assistant` model to include a `Search` field, enabling assistant-specific search configurations.
- Enhanced the loading and merging logic for search configurations, ensuring global defaults can be overridden by assistant-specific settings.
- Added comprehensive tests for loading, saving, and updating assistants with search configurations, verifying the integrity of search settings.
- Updated documentation in DESIGN.md to reflect the new search configuration hierarchy and usage, clarifying the interaction between global and assistant-level settings.
2025-12-13 11:19:20 +08:00
Max
e3fde0aa6c Enhance memory leak tests and performance reporting in stress tests
- Added context release calls in multiple test cases to ensure proper resource cleanup and prevent memory leaks.
- Updated performance thresholds in memory leak tests, increasing acceptable growth per iteration from 10KB to 15KB to account for overhead.
- Improved validation checks in stress tests to ensure response integrity and metadata accuracy, enhancing overall test robustness.
- Refactored performance report for clarity, consolidating key metrics and findings for better readability.
2025-11-28 21:09:27 +08:00
Max
bbcec4d186 Enhance i18n support in assistant model and storage
- Added null handling for input in the I18n Parse method to prevent errors with nil values.
- Refactored string parsing logic into a separate method for improved clarity and maintainability.
- Updated assistant translation logic to streamline the application of i18n translations for various fields, including name, description, and prompts.
- Introduced new tests to validate the retrieval of assistants with locale-specific translations, ensuring correct behavior across different languages.
- Enhanced the GetHistoryWithFilter method to maintain consistent silent message filtering and pagination logic.
2025-11-07 18:59:59 +08:00
Max
e96896eb40 Implement detailed ACL enforcement logic and data access constraints
- 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.
2025-10-21 17:04:20 +08:00
Max
0e260ffb6a Enhance OAuth guard with authorized info handling and ACL integration
- 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.
2025-10-20 08:50:20 +08:00
Max
8992cb9130 Update model options to include permission field for user-related models
- Added "permission": true to the option field in user, user_role, user_type, user_oauth_account, and dsl models, enhancing permission management capabilities.
- This change ensures consistency across user-related models and improves the overall functionality of the user management system.
2025-08-03 15:59:14 +08:00
Max
c74916296a Enhance model definitions and loading process for system models
- Added new system models for assistant, attachment, audit, chat, config, dsl, history, and kb with metadata including tags, built-in status, read-only attributes, and sort order.
- Refactored the model loading process to include a dedicated function for loading system models, improving organization and maintainability.
- Updated the application loading logic to set a default prefix for system tables, ensuring consistent naming conventions.
- Improved error handling during model loading and migration processes for better reliability.
2025-07-15 16:33:14 +08:00
Max
eeac6bbf96 chore: Update .gitignore and Makefile for improved artifact management
- Added backup entries for bindata.go and const.go in .gitignore to prevent accidental commits.
- Refactored Makefile to streamline CUI commit retrieval and ensure consistent versioning in artifact generation.
- Implemented backup and restoration of bindata.go and const.go during the release process for better safety.
2025-05-18 17:37:28 +08:00
Max
401fd3aa94 Fix code signing command and update .gitignore to exclude shell scripts 2024-12-04 11:38:52 +08:00
Max
a1de910337 [add] support for retrieving cookies in sui Request struct 2024-06-25 19:37:55 +08:00
Max
35bf78b08d [add] pipe widget (dev) 2024-02-13 20:54:25 +08:00
Max
8c4b46fb70 Add Yao Build Environment Docker Image 2024-01-18 13:47:43 +08:00
Max
a4a639568d [add] Update V8Go repository in GitHub Actions workflows 2023-12-22 20:43:35 +08:00
Max
515cbe68bc [_] 2022-11-17 10:19:52 +08:00
Max
990b47f770 [add] yao get command 2022-10-28 22:42:02 +08:00
Max
040dda1722
[add] admin root route cache (#179) 2022-09-29 21:11:50 +08:00
Max
800ae72e8b
[add] app custom admin route support (#176)
* [add] app custom admin route support

* [fix] bindata fmt

* [fix] adminRoot replace bug

* [fix] admin root replace bug

* [fix] bindata fmt
2022-09-29 13:31:28 +08:00
Max
a57b312560 [add] XGen v1.0 packing 2022-09-27 23:54:06 +08:00
Max
f66d6bc4ac [change] unit-tests workflow & remove OSS support 2022-09-01 14:36:19 +08:00
Max
ae3f00a502 arm test 2022-02-12 19:37:56 +08:00
Max
cf68a5b495 arm-preview 2022-02-12 19:00:55 +08:00
Max
fed5069ed2 规范日志输出 2022-02-09 17:46:10 +08:00
Max
ea72f26d5e 调整环境变量 2022-02-09 00:49:57 +08:00