Commit graph

3640 commits

Author SHA1 Message Date
Max
10e004bfad feat(logging): enhance logging across various components for improved traceability
- Added detailed trace logging in the Assistant's Stream function to capture computer and workspace information.
- Replaced fmt.Printf statements with kunlog.Trace in the Telegram polling adapter for consistent logging.
- Updated sandbox lifecycle management functions to utilize kunlog for logging workspace and node resolution details.
- Enhanced error handling in the Claude parser with trace logging for JSON unmarshal and scanner errors.
- Improved file handling logging in the workspace API to provide clearer insights into file read operations.
2026-03-21 20:44:59 +08:00
Max
6f1cc27baf feat(sandbox): enhance workspace and node handling in lifecycle management
- Updated the BuildIdentifier function to use the ownerID as a fallback for workspaceID, improving identifier generation consistency.
- Enhanced ResolveNodeID to auto-select nodes based on filters and added detailed logging for better traceability.
- Modified GetComputer to include improved logging and streamlined node resolution logic.
- Introduced StringOrArray type for flexible handling of computer filter parameters in the SandboxConfig.
- Enriched workspace response structure to include detailed node information, enhancing API response clarity.
- Implemented default workspace ID generation based on owner and node, ensuring consistent workspace identification.
- Added locale support in CreateOptions for better internationalization.
2026-03-21 20:10:08 +08:00
Max
4f7989d796 feat(tests): enhance bash script validation in platform tests
- Added assertions to ensure the presence and order of `set -e` and `set +e` in the generated bash script when a system prompt is included.
- Updated the test for the scenario without a prompt to confirm that `set -e` is not present, ensuring correct script behavior.
- Improved documentation in the `buildBashScript` function to clarify the use of `set -e` for error handling during script execution.
2026-03-21 11:04:18 +08:00
Max
610e6b3506 feat(stream): introduce execute message handling for sandbox CLI actions
- Added support for "execute" message type to track tool execution observations within the sandbox environment.
- Implemented handling for execute messages in the stream processing, allowing for real-time updates on tool execution status.
- Enhanced the stream parser to manage the lifecycle of execute messages, including merging input and output data.
- Updated the stream handler to accommodate new message types, improving overall message processing capabilities.
- Refactored related tests to ensure coverage for the new execute message functionality, enhancing reliability.
2026-03-20 22:48:36 +08:00
Max
020927e9af feat(sandbox): enhance assistant directory handling and update RunPrepareSteps signature
- Updated the sandbox initialization to resolve both the assistant directory and skills subdirectory, improving directory management.
- Modified the RunPrepareSteps function signature to include an assistantDir parameter, allowing for better handling of file copy operations.
- Adjusted all relevant calls to RunPrepareSteps across the codebase to accommodate the new parameter, ensuring consistency in execution.
- Enhanced test cases to reflect the updated function signature, improving coverage and reliability of the sandbox preparation process.
2026-03-18 22:58:38 +08:00
Max
42b45f9357 refactor(sandbox): streamline sandbox configuration loading and enhance local execution capabilities
- Replaced the previous file extension checks with a unified parsing function for sandbox configuration, improving code clarity and maintainability.
- Introduced a new HostExecConfig structure to manage local execution settings, allowing for more granular control over command execution permissions.
- Removed deprecated Moapi API files and related functionality, simplifying the codebase and reducing maintenance overhead.
- Updated the Tai node registration process to ensure local capabilities are accurately reflected based on the environment, enhancing overall system robustness.
2026-03-18 11:22:08 +08:00
Max
9ba95498f9 feat(stream): enhance process management and error handling in Claude CLI
- Improved the PowerShell script for killing processes on Windows to ensure child processes are also terminated.
- Introduced a sentinel error for stream completion, allowing for better handling of normal stream terminations.
- Updated the parsing function to close stdout on context cancellation, preventing indefinite blocking on read errors.
- Enhanced logging to provide clearer feedback on stream completion and process management during execution.
2026-03-17 20:58:59 +08:00
Max
0e64d05dbf feat(oscompat): improve PowerShell script for Claude CLI compatibility on Windows
- Added UTF-8 encoding settings for input and output streams to prevent JSON corruption on CJK Windows.
- Implemented a search for common installation paths of claude.exe across user profiles to ensure accessibility when running as a different user.
- Updated logging in the Stream function to include the working directory for better context during execution.
2026-03-17 18:49:15 +08:00
Max
b037475c14 feat(build): enhance macOS application signing process
- Updated the Makefile and GitHub workflows to include entitlements during the codesigning process for macOS applications, improving security and compliance.
- Added timestamp and runtime options to the codesigning commands, ensuring better handling of application signatures.
- Refactored the signing logic to maintain consistency across different build targets, enhancing the overall release process.
2026-03-16 23:30:20 +08:00
Max
ee48f3a946 feat(workflow): enhance release workflows with version tagging and dependency management
- Added steps to clone necessary dependencies in the Linux release workflow, ensuring all components are available for the build.
- Implemented version setting from Git tags in both Linux and macOS workflows, improving version management consistency.
- Updated the build script to extract and set the version from the YAO_VERSION environment variable, enhancing clarity in version handling.
- Streamlined artifact creation steps to ensure proper versioning and organization of release artifacts.

Made-with: Cursor
2026-03-16 09:40:36 +08:00
Max
2eca43f1c5 refactor(build): standardize artifact naming and streamline workflows
- Updated Makefile to remove "unstable" suffix from artifact names for both Linux and macOS builds, enhancing consistency.
- Simplified version retrieval in GitHub workflows, ensuring a more straightforward approach to version management.
- Consolidated Docker build steps to support multi-architecture builds, improving efficiency and clarity in the release process.
- Removed deprecated production-slim Dockerfile, streamlining the Docker setup.

Made-with: Cursor
2026-03-16 09:10:47 +08:00
Max
d6e5afd26b refactor(workflow): consolidate build steps and remove redundant release processes
- Merged the Linux build job into a single 'build' job for improved clarity and efficiency.
- Removed redundant version retrieval steps from both Linux and macOS workflows, streamlining the release process.
- Updated dependencies and artifact handling to ensure compatibility with the new workflow structure.
- Enhanced the macOS workflow to trigger on version tags, improving version management during releases.

Made-with: Cursor
2026-03-15 17:47:07 +08:00
Max
128d9b174f feat(workflow): enhance macOS release process with improved build steps and version handling
- Updated the macOS release workflow to include a version input, allowing for dynamic version specification.
- Refactored build steps to streamline the setup of Node.js, pnpm, and Go tools, improving build efficiency.
- Added multiple repository checkouts for dependencies, ensuring all necessary components are available for the build.
- Implemented certificate management for code signing, enhancing the security of the release process.
- Improved artifact creation and signing steps, ensuring a more robust and reliable release pipeline.

Made-with: Cursor
2026-03-15 17:39:35 +08:00
Max
fddd137806 fix(sandbox): update token generation and improve ClaudeRunner file handling
- Changed token generation from "sandbox:mcp" to "grpc:mcp" for both access and refresh tokens, aligning with updated service requirements.
- Enhanced ClaudeRunner to copy skills from the specified directory to the ".claude/skills" path, improving skill management.
- Updated MCP configuration file path to ".claude/mcp.json" for better organization and consistency in file handling.
- Added error logging for skill copying and exit code handling in stream execution, enhancing debugging capabilities.

Made-with: Cursor
2026-03-15 17:22:44 +08:00
Max
89e5840490 feat(sandbox): update sandbox status messages and improve loading feedback
- Modified Docker run commands in CI workflows to include the `-direct` flag for enhanced server operation.
- Removed outdated loading status message during sandbox preparation and added new messages for improved user feedback.
- Introduced a loading message for waiting on AI responses, enhancing the user experience during sandbox execution.
- Refactored identity handling in stream processing to streamline message management.

Made-with: Cursor
2026-03-15 13:52:38 +08:00
Max
a5c8109db8 feat(sandbox): enhance sandbox initialization and image management
- Updated Docker run commands in CI workflows to include the `-direct` flag for improved server operation.
- Implemented image existence checks and automatic pulling for sandbox environments, enhancing reliability during initialization.
- Added loading status updates for sandbox operations, providing better feedback during the setup process.
- Refactored lifecycle management to ensure accurate tracking of sandbox states and improved error handling.

Made-with: Cursor
2026-03-15 13:17:58 +08:00
Max
3797091d37 feat(sandbox): enhance lifecycle management and box status handling
- Updated BuildIdentifier to include assistant ID in session identifiers for better uniqueness.
- Implemented automatic starting of stopped boxes in resolveBox, improving recovery processes.
- Introduced status management for boxes, allowing for accurate tracking of their state (running, exited, stopped).
- Added idle timeout defaults based on lifecycle policy in BuildCreateOptions, enhancing configuration flexibility.
- Refactored tests to validate new box status behavior and lifecycle management improvements.

Made-with: Cursor
2026-03-15 11:51:09 +08:00
Max
6d5ae17d2f feat(grpc): refactor BuildGRPCEnv to use port from Tai node and update tests
- Modified BuildGRPCEnv to accept the Tai node's gRPC port directly, enhancing flexibility for different modes.
- Updated test cases to reflect changes in gRPC address construction, ensuring accurate environment variable settings for local, direct, and tunnel modes.
- Added a new test for handling unknown modes, improving test coverage and robustness.
- Adjusted Docker configuration to ensure proper host resolution for gRPC communication.

Made-with: Cursor
2026-03-15 10:49:47 +08:00
Max
b39397ded0 feat(monitor): integrate monitor service start and stop in load and unload processes
- Added functionality to start the monitor service during the loading process, ensuring that watchers are registered.
- Implemented the stopping of the monitor service before unloading other services to allow for event handling.
- Updated middleware to utilize access logging for improved request tracking.

Made-with: Cursor
2026-03-15 10:18:55 +08:00
Max
de114ade15 feat(docker): add relay daemon port mapping for container communication
- Introduced a relay daemon port (2099/tcp) to facilitate communication between the host Tai server and containers.
- Updated port bindings to ensure the relay port is always mapped to the host IP for improved connectivity.

Made-with: Cursor
2026-03-15 00:56:30 +08:00
Max
9c9701ed7e feat(tunnel): refactor VNC and proxy handling with structured routing
- Updated VNC and proxy handling in the tunnel to utilize a structured routing approach, enhancing clarity and maintainability.
- Replaced direct port checks with a new `forwardRoute` struct to encapsulate routing information, including channel type, container ID, and port.
- Modified request handling to streamline the forwarding process and improve error handling for unknown routes.
- Enhanced tests to validate the new routing logic and ensure consistent behavior across VNC and proxy requests.

Made-with: Cursor
2026-03-14 21:51:32 +08:00
Max
d26bbd1e1f feat(sandbox): enhance sandbox configuration with display name and identifier updates
- Introduced a human-readable display name for the sandbox, constructed from the agent and workspace names.
- Updated the BuildIdentifier function to include workspace ID in identifiers for long-running and persistent lifecycles.
- Modified sandbox creation options to incorporate the display name, improving clarity in sandbox management.
- Refactored related tests to ensure compatibility with the new identifier structure and display name integration.

Made-with: Cursor
2026-03-14 18:32:09 +08:00
Max
c4dbcdba2b feat(openapi): integrate Tai forward handlers for proxy and VNC operations
- Replaced direct tunnel handling with a dedicated Tai integration for managing proxy and VNC requests.
- Updated routing to streamline the attachment of Tai handlers, enhancing modularity and maintainability.

Made-with: Cursor
2026-03-14 16:23:24 +08:00
Max
223d02ebfe feat(sandbox): implement sandbox token handling in stream execution
- Added support for issuing and passing a sandbox token during stream execution in the Assistant.
- Updated StreamRequest to include a Token field for managing user authentication.
- Enhanced ClaudeRunner to set environment variables for the sandbox token and refresh token.
- Refactored SandboxToken structure to clarify its purpose and manage token credentials effectively.
- Modified sandbox management routes to enforce OAuth guard for improved security.

Made-with: Cursor
2026-03-14 15:50:59 +08:00
Max
f20f7797a3 refactor(tunnel): improve error handling in gRPC stream tests
- Updated test cases to handle potential stream closure more gracefully by checking for send errors before proceeding with receive operations.
- Enhanced clarity in test logic to ensure that expected errors are correctly asserted when metadata is missing or channel IDs are non-existent.

Made-with: Cursor
2026-03-13 20:02:50 +08:00
Max
b667ec310b feat(registry, grpc): introduce channel ID constants and logging enhancements
- Added constants for channel ID byte size and short length to improve clarity and maintainability.
- Implemented ShortChannelID function to truncate channel IDs for log messages, enhancing readability.
- Updated gRPC tunnel logging to utilize the new ShortChannelID function, ensuring consistent and concise channel ID representation in logs.

Made-with: Cursor
2026-03-13 18:41:15 +08:00
Max
82bb44cbda feat(workspace): add root directory retrieval for workspaces
- Implemented a new endpoint to retrieve the absolute path of a workspace's root directory.
- Enhanced the workspace interface with a GetRoot method to facilitate this functionality.
- Updated the workspace manager to utilize the new method for improved path resolution.

Made-with: Cursor
2026-03-13 18:25:14 +08:00
Max
59004de3e8 feat(grpc, openapi): enhance server keepalive settings and improve sorting in responses
- Added keepalive parameters to the gRPC server configuration to manage connection health more effectively.
- Implemented sorting logic in the computer and sandbox response handling to ensure consistent ordering by display name and last active timestamp.
- Refactored node display name retrieval for better clarity and reuse across different functions.

Made-with: Cursor
2026-03-13 12:08:32 +08:00
Max
b9cb36e52b chore(env): update sandbox environment and unit test workflow for improved configuration
- Added new environment variables for Docker and K8s API ports to avoid conflicts and enhance flexibility.
- Updated the unit test workflow to reference the new K3D API port variable, ensuring consistency across configurations.
- Adjusted the K8s API port in the workflow to align with the updated environment settings for better integration.

Made-with: Cursor
2026-03-12 21:34:18 +08:00
Max
dd61a23f08 feat(workflows): enhance unit test workflow and sandbox environment configuration
- Updated the unit test workflow to include code quality checks before building Yao and ci-token.
- Added extraction of the tai binary from the Docker image to streamline the testing process.
- Refactored the sandbox-v2 environment file to improve clarity and organization of connection modes and addresses for various Tai instances.
- Introduced new environment variables for local, Docker, K8s, and hostexec configurations to enhance flexibility in testing setups.

Made-with: Cursor
2026-03-12 21:19:53 +08:00
Max
cd8db3f591 refactor(workflows): streamline MySQL setup in unit test workflow
- Removed static MySQL service configuration and replaced it with a dynamic Docker run command for better flexibility.
- Added a readiness check for MySQL to ensure it is fully operational before proceeding with tests.
- Updated the MySQL ping command to directly reference the container name for improved clarity.

Made-with: Cursor
2026-03-12 20:52:57 +08:00
Max
c7b36aa3b5 feat(workflows): add MySQL and PostgreSQL configurations to unit test workflow
- Introduced MySQL and PostgreSQL environment variables in the unit test workflow for better database integration during testing.
- Configured MySQL and PostgreSQL services in the workflow to ensure proper database connectivity and health checks.
- Updated the sandbox-v2 environment file to include database connection details for local testing.

Made-with: Cursor
2026-03-12 20:49:34 +08:00
Max
7a5c573f10 fix(workflows): update sandbox-v2 env loading to exclude comments and empty lines
- Modified the workflow to use grep for loading the sandbox-v2 environment variables, ensuring that comments and empty lines are excluded from the environment file.
2026-03-12 20:38:00 +08:00
Max
7373b0b6f7 feat(tai): enhance gRPC tunnel functionality and internal host handling
- Introduced ExpandHosts function to parse and expand comma-separated host entries, including special values like "internal" and "localhost".
- Updated gRPC server to utilize the new ExpandHosts function for improved host management.
- Added HostHasInternal function to check for "internal" in host strings, enhancing configuration flexibility.
- Implemented new gRPC endpoints for TaiTunnel registration and forwarding, improving tunnel communication capabilities.
- Refactored authentication logic to include new TaiTunnel endpoints, ensuring proper access control.

Made-with: Cursor
2026-03-12 20:35:17 +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
c366ce4d0a feat(assistant): enhance assistant info structure and sandbox integration
- Updated the AssistantInfo struct to include new fields: Connector, ConnectorOptions, Modes, DefaultMode, Sandbox, and ComputerFilter for improved assistant configuration.
- Enhanced the loading process to extract Sandbox flag and ComputerFilter from V2 sandbox configuration.
- Refactored GetInfo method to return comprehensive assistant details for better UI integration.
- Introduced new endpoint for workspace options to streamline InputArea selector functionality.

Made-with: Cursor
2026-03-12 10:42:22 +08:00
Max
5ec7801689 feat(sandbox/v2): enhance connector integration and VNC configuration
- Refactored the sandbox initialization process to resolve the connector before obtaining the Computer, allowing for the injection of OPENAI_PROXY_* environment variables.
- Updated the GetComputer and BuildCreateOptions functions to accept an optional connector parameter for improved environment variable management.
- Standardized the VNC configuration by replacing SANDBOX_VNC_ENABLED with VNC_ENABLED across Dockerfiles and related scripts for consistency.
- Enhanced the VNC service startup script to check the new VNC_ENABLED variable, ensuring proper service initialization.

Made-with: Cursor
2026-03-10 23:28:31 +08:00
Max
6407b8531f feat(sandbox): enhance sandbox response structure and filtering
- Introduced new fields in the sandboxResponse struct, including Kind, DisplayName, Mode, and Addr, to provide more detailed information about sandbox entities.
- Added hostToResponse function to convert registry.NodeSnapshot to sandboxResponse, improving the handling of host entries.
- Implemented filtering logic in handleList to differentiate between box and host entries based on ownership and capabilities.
- Enhanced sorting of the response list by LastActive timestamp for better organization of results.

Made-with: Cursor
2026-03-10 17:50:48 +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
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
597168c606 feat(sandbox): integrate sandbox initialization and heartbeat management
- Added sandbox initialization in the load process to ensure proper setup of the sandbox manager.
- Implemented gRPC heartbeat handling to track container liveness, enhancing the monitoring capabilities of the sandbox.
- Updated related documentation to reflect the new integration and functionality.

Made-with: Cursor
2026-03-09 09:56:52 +08:00
Max
e633640998 refactor(sandbox/v2): transition from pool to node configuration
- Updated benchmark and test functions to utilize node configurations instead of pool configurations for improved clarity and consistency.
- Refactored related setup functions and test cases to align with the new node-based architecture.
- Adjusted error messages and documentation to reflect the transition from pool to node terminology.

Made-with: Cursor
2026-03-09 03:20:09 +08:00
Max
ce0a97c0af feat(sandbox/v2): refactor benchmarks and tests to use TaiID
- Updated benchmark functions to utilize TaiID instead of pool names for improved consistency and accuracy in tests.
- Refactored test cases across various files to ensure compatibility with the new TaiID structure.
- Enhanced setup functions to accept pointers to poolConfig for better memory management.
- Removed deprecated config struct and adjusted related documentation to reflect the changes in the sandbox architecture.

Made-with: Cursor
2026-03-09 02:50:28 +08:00
Max
43fd532357 chore: update unit-test workflow to use latest Tai image
- Change Docker image references in the unit-test workflow from yaoapp/tai:1.2.0 to yaoapp/tai:latest for consistency and to ensure the latest features and fixes are utilized.
- Update related documentation to reflect the unified Computer interface in the sandbox, replacing Box and Host references with Computer.

Made-with: Cursor
2026-03-08 22:52:11 +08:00
Max
4d4b03be96 feat(sandbox/v2): unify Box and Host under Computer interface
- Define Computer interface with Exec, Stream, VNC, Proxy, ComputerInfo,
  BindWorkplace, and Workplace methods in types.go
- Implement Computer interface on Host (VNC and Proxy via Tai gRPC)
- Add VNC/Proxy stubs to Box (delegates to Tai HTTP endpoints)
- Update JSAPI bindings for unified computer.vnc() and computer.proxy()
- Extend host_test.go with __host__ VNC and HTTP proxy test cases

Made-with: Cursor
2026-03-08 22:33:12 +08:00
Max
18bcf22089 ci: retrigger pr-test with tai:latest (1.2.1)
Made-with: Cursor
2026-03-08 20:24:12 +08:00
Max
df420978f0 feat(workspace): implement JSAPI with archive support and full test coverage
- tai/volume: add WithRemotePath sync option, 8 archive/compression methods
  (Zip/Unzip/Gzip/Gunzip/Tar/Untar/Tgz/Untgz) with local+remote impls
- workspace/jsapi: implement 24-method WorkspaceFS (file I/O, Copy with
  local:///tmp:// URI dispatch, archive ops) and 4 static methods
- workspace/manager: add Rename, MkdirAll, Volume() accessors via singleton
- Tests: comprehensive Go tests for tai/volume, workspace, workspace/jsapi
  covering both local and remote modes via SANDBOX_TEST_REMOTE_ADDR
- CI: update tai Docker image to latest in pr-test.yml
- sandbox/v2: add JSAPI docs and host/node module stubs

Made-with: Cursor
2026-03-08 14:17:39 +08:00
Max
7e941dca0e fix(tai/volume): update test gRPC port default from 9100 to 19100
Align taiTestGRPC() helper with the new Tai 1.2.0 port standard.
Also support TAI_TEST_HOST and TAI_TEST_GRPC_PORT env vars used by CI.

Made-with: Cursor
2026-03-08 11:41:32 +08:00
Max
d70694b7ac ci: update Tai to 1.2.0 with new default ports and fix documentation
- Update CI (unit-test.yml, pr-test.yml) to use yaoapp/tai:1.2.0
  with new default ports (gRPC:19100, HTTP:8099, VNC:16080, Docker:12375)
- Add explicit 0.0.0.0 bind for containerized Tai instances
- Fix sandbox/v2 grpc.go default port fallback (9100 → 19100)
- Fix tai/tunnel/proxy.go fallback ports (8080→8099, 6080→16080)
- Sync tai SDK and sandbox/v2 documentation with implementation
- Add new docs: api.md, registry.md, tunnel.md

Made-with: Cursor
2026-03-08 11:33:56 +08:00
Max
1e454a38ad feat(sandbox/v2): add Host.Stream for real-time streaming exec on Tai host
Add HostExecStream type and Host.Stream method that wraps the HostExec
gRPC ExecStream RPC, providing separate stdout/stderr channels with
Wait and Cancel support. Includes 4 tests covering incremental output,
multi-line, stderr separation, and cancel behavior across k8s and
win-linux platforms. Update API.md documentation accordingly.

Made-with: Cursor
2026-03-08 00:12:21 +08:00