Commit graph

6 commits

Author SHA1 Message Date
Max
1f1f44fab5 Refactor 'readable' field to 'readonly' in model and database handling
- Updated the Info struct to replace the 'readable' field with 'readonly' for better clarity in metadata representation.
- Modified Create and Update methods in db.go to utilize the new 'readonly' field.
- Enhanced test cases to assert the correctness of 'readonly' and 'builtin' fields, ensuring comprehensive validation of model attributes.
- Adjusted model loading logic to correctly populate 'readonly' and 'builtin' fields from metadata.
2025-07-16 11:39:36 +08:00
Max
25c5688727 Enhance model loading and error handling in YaoModel
- Refactored the Load, Unload, and Reload methods to support multiple data source options, including loading from a provided source, file system, or database.
- Improved error handling by implementing panic recovery in the Unload method to manage model retrieval failures gracefully.
- Removed the Source field from UnloadOptions struct to streamline the options interface.
2025-07-15 20:21:45 +08:00
Max
bd95ac0604 Enhance DSL data handling and model structure
- Introduced a new fmtRow function to format row data for DSL info, improving data consistency and readability.
- Updated the Inspect and List methods to utilize the fmtRow function for better data representation.
- Added new fields for 'readonly' and 'built_in' in the DSL model, allowing for more detailed metadata management.
- Enhanced the Create and Update methods to handle the new fields, ensuring proper data storage and retrieval.
- Updated the ListOptions struct to include a Pattern field for file name matching, improving search capabilities.
2025-07-15 18:28:01 +08:00
Max
bdd7c0865e Refactor DSL list retrieval to support conditional data source selection
- Enhanced the List method in the DSL struct to conditionally retrieve data from either the database or file system based on the StoreType specified in ListOptions.
- Updated the Info struct to include a new Source field for optional source content retrieval.
- Modified the List methods in both DB and FS to include source information when requested, improving data accessibility and flexibility.
2025-07-15 16:58:41 +08:00
Max
62e20a90ea Refactor DSL management by introducing IO interfaces for database and file system operations
- Removed the db.go and fs.go files, consolidating database and file system interactions into a unified IO interface.
- Updated DSL struct to include db and fs fields for improved separation of concerns.
- Refactored existing methods across various DSL managers (API, Connector, MCP, Model) to utilize the new IO interfaces for operations like Inspect, Create, Update, Delete, and List.
- Enhanced error handling and validation in Create, Update, and Delete methods to ensure robust functionality.
- Updated types to include new options for Load, Unload, and Reload operations, improving flexibility and usability.
2025-07-15 12:25:56 +08:00
Max
06f5134083 Update dependencies in go.mod and go.sum to latest versions for improved stability and performance 2025-07-14 21:03:57 +08:00