Commit graph

88 commits

Author SHA1 Message Date
Max
15a71692a2 fix(tests): improve error handling in unit tests and Makefile
- Enhanced the Makefile to include additional checks for test failures, specifically for panic messages and general failure indicators.
- Updated service tests to dynamically retrieve the server port, ensuring accurate request routing.
- Added a clear function call in the dashboard process test setup to ensure a clean state before tests run.
2026-04-06 17:17:11 +08:00
Max
413fd71841 feat(middleware): add support for markdown content negotiation and rendering
- Implemented content negotiation for markdown files based on URL suffix and Accept header.
- Introduced a new RenderRaw method to serve raw markdown content, bypassing HTML rendering.
- Updated PageConfig to include a handler for markdown output, enhancing flexibility in content delivery.
2026-04-02 18:55:36 +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
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
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
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
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
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
0fe0843b43 Refactor agent and assistant structure for improved clarity and performance
- Removed deprecated API and vision components, streamlining the agent's architecture.
- Updated the Load function to utilize a new agentDSL variable, enhancing the management of assistant capabilities.
- Enhanced context handling by introducing a message metadata store for thread-safe operations, improving message tracking and management.
- Refactored context methods to eliminate deprecated fields, ensuring cleaner and more maintainable code.
- Improved documentation and comments throughout the codebase to clarify changes and enhance developer understanding.
2025-11-30 11:47:25 +08:00
Max
8dca4719c0 Remove deprecated agent API files and refactor agent loading logic
- Deleted obsolete agent API files (agent.go, api.go, api_test.go, types.go) to streamline the codebase.
- Refactored the agent loading logic to initialize the API instance correctly, ensuring proper integration with the new structure.
- Updated context handling to improve clarity and maintainability across the agent's functionality.
- Enhanced error handling and cache management in the agent's initialization process.
2025-11-11 11:23:20 +08:00
Max
c54ef71d6a ⚠️ BREAKING: Removed the Studio package and renamed Neo to Agent. Configuration file path changed from neo/neo.yml to agent/agent.yml.
Remove deprecated studio package and refactor agent integration

- Deleted the studio package, which is no longer in use, to streamline the codebase.
- Updated references in the agent and chat modules to utilize the new agent package instead of the deprecated neo package.
- Ensured that all related middleware and routing functionalities are now aligned with the agent architecture, enhancing overall system coherence.
2025-11-06 18:13:54 +08:00
Max
f464638213 Add OpenAPI OAuth support in guards
- Introduced guardOpenapiOauth function to handle OAuth token validation and session ID retrieval.
- Updated guardCookieJWT and guardBearerJWT functions to integrate OpenAPI OAuth checks.
- Enhanced backward compatibility for existing cookie-based JWT handling.
- Added utility functions for access token and session ID extraction from requests.
2025-08-05 11:36:44 +08:00
Max
b96a400869 Add OpenAPI support and enhance configuration handling
- Integrated OpenAPI loading functionality into the engine's Load and Reload processes, allowing for better API management.
- Updated the OpenAPI configuration to set a default BaseURL and ensure it does not have a trailing slash.
- Implemented the Attach method to connect the OpenAPI server to the Gin router, facilitating API endpoint management.
- Removed the obsolete hello package to streamline the OpenAPI module.
2025-07-20 18:52:30 +08:00
Max
f55fc7b374 ⚠️ BREAKING: Rename XGen to CUI and update license terms
1. Major Changes:
   - Migrate all XGen references to CUI
   - Update project naming conventions across codebase

2. License Updates:
   - Revise open source license terms
   - Update copyright and usage conditions

This is a breaking change that requires updates in dependent projects.
2025-05-18 12:16:45 +08:00
Max
fabced291c fix: Enhance loading functions to handle non-existent directories
- Added checks in various loading functions to ignore processing if the respective directories do not exist, improving error handling and preventing unnecessary operations.
- Updated the Load function signature to return warnings alongside errors, allowing for better feedback on loading issues across different components.
2025-05-13 09:10:10 +08:00
Max
2c5b323d7d Add option to disable Gzip compression for static files and update headers 2024-11-30 18:23:21 +08:00
Max
5f5af44018 Optimize libsui js-sdk loading logic 2024-08-03 08:37:54 +08:00
Max
e4c8eeb180 optimize the SUI compiler & add http server gzip support 2024-07-07 15:29:50 +08:00
Max
6dcd704ea4 [add] Configuring SUI page caching to optimize static page loading speed 2024-06-27 20:02:03 +08:00
Max
9faf8f802f chore: Update engine.Load calls with additional options 2024-05-05 17:54:32 +08:00
Max
a48c4cbe7d Refactor middleware and request handling code 2024-03-19 13:58:43 +08:00
Max
2effd3c360 Update authorization error messages 2024-02-20 20:07:26 +08:00
Max
5104dab56b Add cookie-trace and cookie-jwt guards 2024-02-10 17:02:44 +08:00
Max
76d9811048 Add guard functionality and export page config 2024-01-03 18:03:27 +08:00
Max
06c73e5f1c [add] Integrate page builder ui 2023-12-10 13:59:04 +08:00
Max
07dfc90d2e Refactor middleware to handle Sui files and fix potential errors 2023-12-10 12:38:55 +08:00
Max
9304558a4e [add] debug logs 2023-12-06 15:34:02 +08:00
Max
dc91443217 [add] sui page route parser 2023-11-23 13:00:07 +08:00
Max
e8db2a7d8e [add] sui file server (dev) 2023-11-22 21:02:48 +08:00
Max
01d4b49c33 [add] server rewrite support and fix api reload 2023-11-22 18:10:17 +08:00
Max
c19d4b0534 [add] moapi process and api 2023-11-10 01:37:09 +08:00
Max
5517b4ac60 [fix] SPA static file server 2023-10-11 22:13:57 +08:00
Max
198fd88449 [add] SUI & Page Builder API (10%) 2023-09-24 17:27:03 +08:00
Max
955920e868 [fix] the spa router length bug 2023-09-07 22:40:11 +08:00
Max
68ebf1e6cc [add] multiple single page applications support 2023-09-06 22:13:45 +08:00
Max
7ee7de96c9 [add] Neo (70%) 2023-04-30 14:21:45 +08:00
Max
95ff65d625 [change] optimizing static http server. 2023-04-21 17:06:06 +08:00
Max
d8d14f1994 [add] public dir PWA support 2023-04-11 21:24:16 +08:00
Max
d2c1f034a6 [tidy] remove unused code 2023-04-01 11:52:12 +08:00
Max
5f2b8fbf63 [add] migrate watch 2023-04-01 11:19:09 +08:00
Max
2bd41ed135 [change] start command 2023-03-26 18:21:55 +08:00
Max
75ee709c23 [change] refactor the yao service 2023-03-26 17:12:02 +08:00
Max
a807899f95 [*] migrate to gou v0.10.3 (50%) 2023-02-01 17:25:11 +08:00
Max
63f9e6574d [optimize] watchReload close the DB connections 2023-01-16 16:13:11 +08:00
Max
9a54e15ae9 [optimize] close the DB connections when reloading 2023-01-16 15:15:44 +08:00
Max
517eae1270 [add] dashboard widget guard 2022-12-19 19:26:26 +08:00
Max
0a26776065 [add] Widget List 2022-12-02 06:14:50 +08:00
Max
93ba063cb4 [add] setup 2022-10-28 11:58:05 +08:00
Max
2b745dd7af [add] widget chart guard & compute 2022-10-25 00:44:18 +08:00