Commit graph

3509 commits

Author SHA1 Message Date
Max
c7cdfbdfe6 Refactor error handling in middleware and clean up template struct comments
- Adjust error handling in the middleware to ensure proper redirection for HTTP status codes 301 and 302.
- Clean up comments in the Template struct for better readability and consistency.
2026-02-15 17:56:54 +08:00
Max
621290d578 Enhance guard handling and template configuration merging
- Update the OAuth guard to prevent automatic response writing on failure, allowing for custom error handling.
- Introduce a mechanism to register default guard redirects from template configurations, improving guard management.
- Refactor the page configuration merging process to prioritize page-specific settings while allowing inheritance from templates.
- Ensure guards can be explicitly disabled in page configurations, enhancing flexibility in guard application.
2026-02-15 16:34:31 +08:00
Max
069f60f1f8 Add zip processing functionality for attachments
- Introduce a new `processZip` function to package multiple attachment files into a single zip archive and upload it to the uploader storage.
- Implement filename deduplication within the zip archive to handle potential naming conflicts.
- Enhance the `Init` function to register the new `Zip` process for attachment management.
- Include detailed documentation for the `processZip` function, outlining its arguments, return values, and usage examples.
2026-02-15 12:12:17 +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
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
342c2f11a3 Refactor agent call handling and enhance request structures
- Update `forceSkipForSubAgent` to respect caller's `skip.output` setting, allowing for silent internal worker agent execution.
- Refactor error handling in `callAgentWithContext` to utilize a new `NewResult` function for consistent result construction.
- Introduce `ProcessCallRequest` structure for improved agent call parameters, including a default timeout constant for process calls.
2026-02-14 11:30:20 +08:00
Max
19c2d6b547 Implement dynamic route resolution using rewrite rules
- Introduce a new `RewriteRule` type and associated functions for managing URL rewrite rules in `service/static.go`.
- Add `GetRewriteRules` and `ResolveRoute` functions to facilitate the retrieval and application of rewrite rules.
- Update the `sui/api/run.go` to utilize the new route resolver for handling dynamic routes when the config file is not found.
- Define `RouteResolver` in `sui/core/interfaces.go` to allow for dynamic route resolution across the application.
2026-02-13 23:44:28 +08:00
Max
baebefdb02 Update Dockerfile to use the latest Docker image
- Change the base image in the Dockerfile from `docker:stable` to `docker:latest` to ensure the use of the most recent features and security updates.
2026-02-13 11:39:36 +08:00
Max
f2166bc847 Add FFmpeg installation and testing to workflows
- Introduce FFmpeg installation steps in both `pr-test.yml` and `unit-test.yml` workflows, allowing for video processing capabilities.
- Add a test command to verify the FFmpeg installation by checking its version, ensuring successful integration into the CI pipeline.
2026-02-13 10:47:44 +08:00
Max
b9cff8e049 Refactor Redis and MongoDB setup in workflows
- Replace `supercharge/redis-github-action` with a direct Docker command to start Redis in both `pr-test.yml` and `unit-test.yml`, improving control over the Redis instance.
- Update MongoDB setup to use a Docker command with environment variables for initialization and include a readiness check to ensure MongoDB is fully operational before proceeding.
2026-02-13 10:37:40 +08:00
Max
b7d026deb1 Update Redis and MongoDB GitHub Action versions in workflows
- Upgrade `supercharge/redis-github-action` from version 1.4.0 to 1.8.0 in both `pr-test.yml` and `unit-test.yml` workflows to leverage improvements and new features.
- Upgrade `supercharge/mongodb-github-action` from version 1.8.0 to 1.11.0 in both workflows for enhanced functionality and performance.
2026-02-13 10:28:17 +08:00
Max
16b3651204 Add job.jsapi import and enhance session handling in goroutine execution
- Introduce the `job/jsapi` import in `main.go` to support new job functionalities.
- Update session handling in `goroutine.go` to restore authorized information from SharedData, improving context management during execution.
2026-02-12 23:02:22 +08:00
Max
464f1abf63 Remove OpenAI API references from Assistant struct and initialization
- Eliminate the `openai` field from the `Assistant` struct and its initialization in the `initialize` method, streamlining the Assistant's internal structure.
- This change simplifies the codebase by removing unnecessary dependencies on the OpenAI API, enhancing maintainability.
2026-02-12 19:47:06 +08:00
Max
d598394337 Update asset metadata timestamps and enhance translation handling
- Update timestamps in `bindata.go` for various asset files to reflect recent modifications.
- Modify translation handling in `parser.go` to merge messages from YAML locale files with script messages, ensuring all translation keys are available at runtime.
- Refactor `writeLocaleFiles` in `page.go` to accept a build context, allowing for better integration of script translations during the build process.
2026-02-12 19:06:56 +08:00
Max
62a4723c71 Add RSS and Sitemap support in main.go imports 2026-02-12 14:30:18 +08:00
Max
831f3051ea Ensure SafeWriter is closed before reading buffer in test
- Added a call to `CloseSafeWriter` in `TestJsValueStreamingWorkflow` to flush all pending async writes before reading the output buffer. This change improves test reliability, particularly on slow CI runners, by preventing potential issues with empty buffers.
2026-02-11 17:07:33 +08:00
Max
1b028abdef Enhance test reliability by closing SafeWriter before buffer read
- Add calls to `CloseSafeWriter` in `TestJsValueSendVsSendStream` to ensure all pending async writes are flushed before reading the output buffer. This change addresses potential issues with empty buffers on slow CI runners, improving test consistency.
2026-02-11 16:03:21 +08:00
Max
69a6a43362 Add Anthropic API key to workflow configurations
- Include `ANTHROPIC_API_KEY` in both `pr-test.yml` and `unit-test.yml` workflows to support Anthropic API integration.
- Refactor tool call processing in `anthropic.go` to ensure deterministic order by sorting tool call indices before processing, enhancing reliability in tool call execution.
2026-02-11 15:12:21 +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
ad311cad2a Add audio transcription file handling and related tests
- Introduce `AudioTranscriptionsFile` method in the OpenAI package to transcribe audio directly from a file path, improving memory efficiency.
- Implement new test cases for `AudioTranscriptionsFile`, including scenarios for language options and error handling for non-existent files.
- Update the process package to support the new transcription method, ensuring compatibility with existing functionality.
- Enhance test coverage for audio transcription processes, validating expected outputs and error conditions.
2026-02-10 19:05:29 +08:00
Max
bdcc3585e2 Enhance script resolution logic and update asset metadata
- Refactor the `ResolveScript` function to improve the script path resolution strategy, allowing for better handling of assistant directories and module paths.
- Update asset metadata timestamps in `bindata.go` to reflect recent changes, ensuring accurate tracking of file modifications.
- Modify CSS component name formatting in `build.go` and TypeScript component selectors in `index.ts` for consistency in syntax.
- Improve locale handling in `locale.go` by implementing a fallback mechanism for locale file resolution based on language prefixes.
- Normalize locale values in `request.go` to lowercase for consistency across the application.
- Enhance component name sanitization in `utils.go` to replace additional characters, ensuring valid component naming conventions.
2026-02-09 18:32:24 +08:00
Max
a372a56cf0 Update IPC socket path in tests to match configuration change
- Modify the test for the Claude executor to check for the IPC socket at the new path "/run/yao.sock" instead of the previous "/tmp/yao.sock". This aligns the test with the updated default configuration for the IPC socket path, ensuring consistency across the codebase.
2026-02-09 00:07:48 +08:00
Max
6f50cf139a Update container IPC socket path in default configuration
- Change the ContainerIPCSocket path from "/tmp/yao.sock" to "/run/yao.sock" to align with system conventions for IPC sockets.

This change improves the configuration's compatibility with standard practices for inter-process communication.
2026-02-08 22:12:31 +08:00
Max
ac926b4233 Enhance container configuration for VNC images
- Add support for increasing the shared memory size (/dev/shm) for Chrome rendering in VNC images, setting it to a quarter of MaxMemory with a minimum of 256MB.
- This change addresses Chrome renderer/GPU process crashes by ensuring adequate memory allocation for namespace-based process isolation.
2026-02-08 20:30:04 +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
91ee8c947d Update API URL in proxy configuration test and clean up attachment handling logic
- Modify the expected API URL in the `TestBuildProxyConfig` to include the `/v1` prefix for consistency with the updated URL building logic.
- Remove unnecessary `modified` flags in the `prepareAttachments` method to streamline attachment processing and ensure clarity in the codebase.

This change enhances the accuracy of tests and improves the maintainability of the attachment handling logic.
2026-02-08 14:35:12 +08:00
Max
2a839ff94e Add Claude CLI argument mapping for sandbox arguments
- Introduce a whitelist mapping for `package.yao` sandbox arguments to corresponding Claude CLI flags, allowing selective argument passing.
- Update `BuildCommandWithContinuation` to iterate over the whitelist and append valid arguments to the Claude CLI command.

This change enhances the flexibility of argument handling in the Claude CLI, ensuring only specified arguments are processed.
2026-02-08 12:57:10 +08:00
Max
31a75f0161 Refactor API URL building in OpenAI and Claude components
- Update `buildAPIURL` function in OpenAI provider to delegate URL construction to `connector.BuildAPIURL`, ensuring consistent URL formatting across the agent LLM and sandbox proxy paths.
- Modify backend URL construction in Claude's `BuildProxyConfig` to utilize the shared `connector.BuildAPIURL` helper, applying the necessary `/v1` prefix for compatibility.

This change enhances code maintainability and consistency in API URL handling across different components.
2026-02-08 12:31:28 +08:00
Max
fea1ac0708 Add user attachment handling in Claude executor
- Introduce functionality to resolve and manage user-uploaded files in the sandbox environment.
- Implement `prepareAttachments` method to convert attachment URLs to local file paths and handle duplicates.
- Update message processing to replace attachment content with text references, allowing Claude CLI to access files using Read and Bash tools.
- Enhance documentation to inform users about the new attachment handling capabilities.

This change improves the interaction with user-uploaded files, enabling better integration within the Claude CLI environment.
2026-02-08 11:49:51 +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
fa664b7db7 Add root configuration to processPing response
- Include the root path from the configuration in the response of the processPing function to provide additional context for the engine's state.
2026-02-07 12:32:32 +08:00
Max
898ba7d4fd Update Makefile to switch .env login URLs from development to release mode
- Modify .env file paths for AFTER_LOGIN_SUCCESS_URL and AFTER_LOGIN_FAILURE_URL to point to the release mode (dashboard) instead of the development mode (__yao_admin_root).
- Ensure backup files are removed after the changes to maintain a clean environment.
2026-02-07 12:21:07 +08:00
Max
37410985f3 Add new skill references and assets for development environments
- Include additional skill markdown files and references for SUI and Yao agent development.
- Add new brand assets for Discord, Twitter, and Yao agents in the default template.
- Update index and layout files with new modification timestamps for consistency.
- Introduce a new VNC scope configuration for sandbox environments.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-07 12:01:42 +08:00
Max
ce4864cfde Enhance sandbox environment setup for VNC and Python compatibility
- Ensure the existence of $HOME/.Xauthority for PyAutoGUI/Xlib compatibility.
- Adjust PYTHONPATH to maintain access to user-installed Python packages.
- Explicitly set XAUTHORITY to the correct path for X11 authentication.
- Pass secrets as environment variables for Claude CLI to ensure proper access.

- Refactor VNC image support check to utilize a centralized keyword list for better maintainability.
2026-02-06 19:38:22 +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
28363b973e Fix sandbox compatibility, claude-proxy streaming, and rename playwright to browser
- Fix ListDir to support BusyBox/Alpine ls by falling back from GNU
  --time-style format, resolving CI test failures
- Update parseLS to handle both GNU (epoch) and BusyBox (date string) formats
- Fix claude-proxy streaming: always include usage in message_delta events
  to prevent Claude CLI from falling back to non-streaming mode
- Fix claude-proxy non-streaming: ensure usage is always present in responses
- Add paragraph separators between text blocks in Claude executor stream parser
- Translate VNC proxy UI from Chinese to English
- Rename sandbox-claude-playwright to sandbox-claude-browser across
  Dockerfiles, build scripts, and documentation

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 12:31:07 +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
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
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
1680d5eefe Refactor Yao app initialization and enhance error handling
- Update start command to check if the current directory is a Yao app root or a subdirectory, providing clearer error messages for users.
- Modify installation logic to handle empty directories more effectively, ensuring the init app is installed only when appropriate.
- Improve welcome message formatting and update links for documentation and community resources.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-04 19:04:23 +08:00
Max
76159373e5 feat: add production builds with -s -w stripping and UPX compression
- Add prod builds (stripped) and prod-upx builds (compressed) for Linux
- Add prod builds (stripped) for macOS (UPX not supported)
- Add docker/production-slim for slim images using prod-upx binaries
- Update build-docker.yml to build slim variants
- Update build-macos.yml to sign and notarize all 4 variants
- Add BUILDOPTIONS constant to show build flags in version output
- Add make release-all target for building both dev and prod locally

Linux artifacts: 6 variants (dev, prod, prod-upx for amd64/arm64)
macOS artifacts: 4 variants (dev, prod for amd64/arm64)
Docker images: 6 variants (dev, prod, prod-slim for amd64/arm64)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-03 12:27:37 +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
3d7b0a2dbd Refactor context ID generation to use UUID
- Replace the existing NanoID generation in generateContextID with UUID for improved uniqueness.
- Update RequestID method to return the context ID directly instead of generating a new NanoID.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-02 11:49:10 +08:00
Max
702b743de7 Implement continuation support for Claude CLI commands
- Refactor BuildCommand to support session continuation using --continue flag.
- Introduce BuildCommandWithContinuation to handle both initial and continuation requests.
- Add BuildLastUserMessageJSONL for generating JSONL from the last user message in continuation scenarios.
- Enhance Executor to check for existing sessions and adjust command building accordingly.
- Update environment setup to ensure session data is stored correctly for persistence.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-01 13:07:18 +08:00
Max
d78b4ea54a Refactor container file operations for improved performance
- Update ReadFile method to read directly from the host's bind-mounted workspace instead of using Docker's CopyFromContainer, enhancing performance.
- Introduce containerPathToHost method to convert container paths to host paths, ensuring proper access to bind-mounted directories.
- Simplify idle container cleanup logic by storing the idle time in a variable for better readability.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-01 11:24:47 +08:00
Max
2e94ce5062 Fix real_e2e_test max_tokens limit for Volcengine API
Add ConnectorOptions with max_tokens: 4096 to avoid exceeding
Volcengine GLM-4.7's 16384 token limit (Claude CLI defaults to 32000)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-01-31 23:26:11 +08:00