Commit graph

3321 commits

Author SHA1 Message Date
Max
4ba62600dc Refactor Knowledge Base Collection Initialization and Document Retrieval
- Removed the synchronous preparation of the knowledge base (KB) collection from the InitializeConversation method, now initializing it asynchronously after user login.
- Introduced a new method, GetDocumentsContent, to retrieve content for multiple documents by their IDs, supporting text-based files and improving document handling.
- Updated the API interface to include the new GetDocumentsContent method, enhancing the document management capabilities.
- Enhanced locale handling in the login context to support user preferences during KB collection creation.
2026-01-10 12:38:42 +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
c9d867b3d1 Enhance Script Resolution Logic and Validation
- Updated the ResolveScript function to support an additional script format, allowing for sub-agent paths in the input.
- Improved error messaging for invalid script paths to clarify expected formats.
- Refactored path building logic to accommodate both standard and sub-agent script structures, enhancing flexibility in script resolution.
- Modified the test runner to validate results using an asserter that includes the response for tool_called assertions, improving test accuracy.
2026-01-05 12:32:31 +08:00
Max
748cf253da Refactor extractCollectionIDFromDocID Function
- Simplified the extractCollectionIDFromDocID function by directly returning the first part of the docID, removing unnecessary logic for prefix handling.
- Commented out the previous logic for clarity and potential future reference, maintaining code readability.
2026-01-05 10:47:22 +08:00
Max
a37bb5cdba Enhance API Guards and Documentation
- Added a new guard option for OAuth 2.1 authentication, with ACL checks performed in the Run function for API calls.
- Updated the API routing to include the new guard and clarified the OAuth guard's functionality in the code comments.
- Enhanced documentation to reflect the new guard options and their descriptions, improving clarity for developers on available authentication methods.
2026-01-04 16:40:23 +08:00
Max
8485dd420e Refactor API Routing and Update Content-Type Header
- Added new root-level endpoints for team management, including listing and creating teams, while maintaining OAuth protection.
- Streamlined user-related endpoints by removing unnecessary groupings, enhancing clarity and accessibility.
- Updated the Content-Type header in the API response to application/json for better consistency with API standards.
2026-01-04 16:15:44 +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
05cb4b9199 Improve Backend Scripts Documentation with Additional Examples
- Added new examples for backend script method calls from `.json` configurations, enhancing practical understanding for developers.
- Clarified usage of request parameters and common pitfalls, improving guidance for effective backend script implementation.
- Updated existing sections to ensure consistency and clarity in documentation, supporting better developer experience.
2026-01-04 12:06:45 +08:00
Max
46ae99948e Enhance Backend Scripts Documentation
- Added important notes regarding ES Module exports and route parameter access in backend scripts.
- Introduced a new section on data binding methods, detailing how to call backend script methods from `.json` configurations.
- Included examples demonstrating the correct usage of request parameters and common pitfalls to avoid, improving clarity for developers.
2026-01-03 17:39:28 +08:00
Max
f115e6d782 Update Documentation for SUI Structure and Locale Handling
- Revised the README and agent-sui documentation to clarify the directory structure, including the addition of __data.json and __locales directories for global and page-level data.
- Enhanced explanations of the pages directory, emphasizing the organization of global and assistant-specific pages.
- Updated the i18n documentation to detail locale detection and the importance of server-side rendering for translations, including a code snippet for changing locales via JavaScript.
2026-01-03 15:06:32 +08:00
Max
0825e06dbe Implement Multi-Directory Watching and Enhance Locale File Handling
- Introduced the IWatchDirs interface to support watching multiple directories for changes, allowing templates to specify directories dynamically.
- Updated the watch command to handle multiple directories and display watched directories in the output.
- Added functionality to write locale files from a page's __locales directory to the public directory, improving localization support.
- Enhanced error handling during directory watching and locale file processing for better reliability and logging.
2026-01-03 14:39:57 +08:00
Max
ebf3dcc870 Refactor Documentation for Backend API Method Naming and Iframe Communication
- Updated iframe documentation to remove token handling from the setup message, clarifying the focus on theme and locale.
- Added a new section in MCP documentation detailing HTTP transport configuration for API access, enhancing clarity on authorization.
- Revised frontend API documentation to standardize method naming by removing the 'Api' prefix in examples, improving consistency across backend calls.
- Enhanced event handling documentation by updating method names in examples, ensuring alignment with the new naming conventions.
2026-01-03 11:42:23 +08:00
Max
aa01ea216c Update Documentation for Frontend API and Event Handling Enhancements
- Expanded the README to include CUI integration details in the Frontend API section, clarifying communication methods with the CUI host.
- Added new examples for frontend scripting styles, including Direct and Component styles, to improve user understanding of event handling and form submissions.
- Updated event handling documentation to reflect changes in handler signatures and data structures, enhancing clarity on event data usage.
- Revised component documentation to standardize method naming conventions and improve consistency across examples.
2026-01-03 11:31:15 +08:00
Max
e6778e83fd Enhance Agent Documentation with Iframe Integration Details
- Added a new section in the README for Iframe Integration, providing an overview of iframe communication with CUI.
- Expanded the pages documentation to include frontend scripting styles and examples for handling form submissions and backend API calls.
- Introduced detailed examples for parent communication and receiving context in iframes, improving clarity on how to implement these features.
2026-01-03 11:22:04 +08:00
Max
b7fc91a312 Update Agent Documentation with MCP Directory Structure and Model Integration
- Added a new section in the MCP documentation detailing the directory structure for assistants, enhancing clarity on how to define namespaced MCP servers.
- Included examples of using assistant models within MCP tools, providing guidance on referencing models in tool configurations.
- Updated the README to include a link to the new Models documentation, improving navigation and resource accessibility for users.
2026-01-01 11:46:12 +08:00
Max
692caec864 Enhance Agent Documentation with Navigation Examples and Formatting Improvements
- Added examples for using action messages to navigate pages in the sidebar during conversations, improving user guidance.
- Reformatted HTML and markdown tables for better readability and consistency across documentation.
- Updated input fields and variable descriptions to enhance clarity and usability in the agent documentation.
2026-01-01 11:32:55 +08:00
Max
ef00880960 Update Agent Documentation and MCP Tool Configuration
- Revised the API access endpoint in the agent documentation to reflect the new structure.
- Expanded examples for agent hooks, database queries, and MCP tools, providing clearer guidance for users.
- Updated MCP tool configuration to use 'label' instead of 'name' and refined transport types for better clarity.
- Introduced input schema definitions for process transport tools, enhancing the documentation on tool mapping and error handling.
2026-01-01 11:24:29 +08:00
Max
bdfe7e83e8 Revise Agent and SUI Documentation for Clarity and Consistency
- Updated the Agent API documentation to reflect a new structure, emphasizing quick start instructions and reorganizing content for better readability.
- Renamed the main documentation title to "Yao Agent" and streamlined sections, including API endpoints and file management.
- Adjusted the SUI documentation to align with the Yao App Engine license, ensuring consistency across project documentation.
2026-01-01 11:08:30 +08:00
Max
bd8e91d434 Update Assistant Configuration File Names in Documentation
- Renamed assistant configuration files from `assistant.yao` to `package.yao` in the documentation for both demo and another assistants, ensuring consistency and clarity in file naming conventions.
2026-01-01 10:37:42 +08:00
Max
097fb73416 Refactor SUI Command Arguments and Enhance Default Template Handling
- Updated the `build` and `watch` commands to accept a single argument for `<sui>` and made the `<template>` argument optional, improving usability.
- Introduced a default template assignment for the `agent` SUI, ensuring a more intuitive setup for users.
- Enhanced error messages for command usage to provide clearer guidance on expected input format.
- Added new OpenAPI file to the bindata, improving the framework's capabilities for API integration.
2026-01-01 10:28:45 +08:00
Max
d3ed830ec1 Enhance OpenAPI and JSON Parsing Functionality
- Added app handlers to the OpenAPI attachment process, improving routing for application-related endpoints.
- Refactored the parseJSONField function to handle both JSON and boolean column types, enhancing value parsing flexibility and robustness.
- Improved error handling and clarity in the JSON parsing logic, ensuring original values are returned when parsing fails.
2025-12-31 11:54:36 +08:00
Max
4d1b427634 Enhance Message Filtering in LLM Context Conversion
- Added logic to skip internal message types ("tool_call", "loading", "action", "event") during LLM context conversion to prevent confusion, while retaining "error" messages for troubleshooting purposes.
- Improved clarity in the handling of message types to ensure only relevant content is processed for LLM interactions.
2025-12-30 16:06:20 +08:00
Max
195391afaa Enhance PDF and Content Processing with New File Handling Features
- Added support for parsing various file types (PDF, DOCX, PPTX) in the content processing pipeline, allowing for more flexible content extraction.
- Implemented a new method to convert file attachments to raw text when content parsing is skipped, improving performance for internal calls.
- Introduced loading message suppression for image processing to enhance user experience during PDF analysis.
- Updated the PDF handler to cache processed text and manage loading messages effectively, ensuring smoother interactions during content retrieval.
- Enhanced error handling and logging for PDF processing, improving traceability and debugging capabilities.
2025-12-29 15:20:38 +08:00
Max
983dbd3cee Refactor Content Processing and Enhance Search Functionality
- Updated the BuildContent method to utilize content parsing with improved error handling and context injection, enhancing the processing of user input.
- Refactored the loadMap function to support multiple search configuration types, improving flexibility in handling search settings.
- Enhanced the shouldAutoSearch method to include a check for search disabling via context metadata, allowing for more granular control over search behavior.
- Updated the getMergedSearchUses method to prioritize options.Uses, ensuring that search configurations can be dynamically adjusted based on provided options.
- Removed deprecated audio and excel handling code, streamlining the content processing package and improving maintainability.
2025-12-29 14:26:48 +08:00
Max
5f67ab2eef Refactor buildStandardResponse for Consistency in Code Style
- Removed unnecessary semicolon in the buildStandardResponse method, aligning with Go's idiomatic style.
- Improved code readability by ensuring consistent formatting in the handling of the NextResponse variable.
2025-12-28 20:28:50 +08:00
Max
b61f0130e6 Refactor buildStandardResponse to Handle NextResponse More Safely
- Updated the buildStandardResponse method to assign the NextResponse to a variable only if it is not nil, improving code clarity and preventing potential nil pointer dereferences.
- This change enhances the robustness of the response building process in the Assistant's delegation handling.
2025-12-28 10:49:38 +08:00
Max
88aca7cef0 Skip Tests Requiring External API Keys in search_web_test.go
- Added skip statements to multiple test functions in search_web_test.go that require external API keys (Tavily, Serper, SerpAPI), preventing them from running until the necessary credentials are available.
- Updated comments to clarify the reason for skipping these tests, enhancing documentation for future development and testing efforts.
2025-12-27 20:07:16 +08:00
Max
4c7e41cd48 Skip Tests Requiring External API Key in jsapi_search_test.go
- Added skip statements to multiple test functions in jsapi_search_test.go that require an external API key (Tavily/Serper), preventing them from running until the necessary credentials are available.
- Updated comments to indicate the reason for skipping these tests, enhancing clarity for future development and testing efforts.
2025-12-27 19:49:28 +08:00
Max
31ce461162 Refactor Assistant Stream and Content Handling for Improved Context Management
- Updated the Stream method to include options for handling message history and context more effectively, ensuring original messages are preserved for autoSearch and delegation.
- Introduced a new buildContextMessage function to consolidate conversation context, filtering out system messages and limiting to the last five user messages for efficiency.
- Enhanced content processing by adding a convertToContentParts function to handle different content formats, improving compatibility with historical data.
- Improved logging and error handling in the executeLLMStream method to ensure clarity in LLM request tracing and response handling.
- Added new utility functions for extracting text content and building context messages, enhancing overall code clarity and maintainability.
2025-12-27 19:36:31 +08:00
Max
401f22eeb1 Enhance User Input Buffering Logic for Delegated Agents
- Updated the BufferUserInput method to ensure only the root stack buffers user input, preventing duplication in delegated agents.
- Added comments in the Stream and processNextResponse methods to clarify that user input is already buffered by the root agent, allowing delegated agents to skip this step.
- Improved code clarity and maintainability by documenting delegation behavior in the context of user input handling.
2025-12-27 17:32:00 +08:00
Max
7b3df059c4 Add Delegation Support in Create Hook for Agent Routing
- Introduced delegation functionality in the Create hook, allowing agents to route requests to sub-agents without invoking LLM processing.
- Updated the HookCreateResponse structure to include a Delegate field, enabling immediate delegation to another agent.
- Enhanced the Stream method to handle delegation responses, ensuring proper stream closure and error handling for delegated agents.
- Improved logging for delegation actions to facilitate debugging and traceability in agent interactions.
2025-12-27 16:51:49 +08:00
Max
5a63d9280b Implement Tool Call Assertions in Asserter for Enhanced Validation
- Added support for `tool_called` and `tool_result` assertions in the Asserter, allowing for validation of tool execution and arguments.
- Introduced methods to check if specific tools were called and to validate their results against expected patterns.
- Updated the `README.md` to include detailed documentation on new assertion types, including usage examples and value formats.
- Enhanced the dynamic runner to set the response for tool-related assertions, improving the overall testing framework's capabilities.
2025-12-27 14:23:15 +08:00
Max
3969279f71 Add Detailed Validation for Agent Assertions in Dynamic Testing
- Introduced `ValidateWithDetails` method in the Asserter to provide comprehensive results for agent assertions, including failure messages and validation criteria.
- Updated `checkCheckpoints` to utilize the new validation method, enhancing the checkpoint validation process with detailed agent validation results.
- Enhanced `CheckpointResult` structure to include `AgentValidationResult`, capturing the agent's response and validation details.
- Expanded documentation in README.md to explain the new validation process and output structure for agent assertions, ensuring clarity on the validation workflow and expected results.
2025-12-27 13:40:15 +08:00
Max
5fb5035d8c Enhance Agent Response Structure and Dynamic Test Functionality
- Added support for tool call responses in the agent's response structure, allowing for better handling of tool execution results.
- Updated the `TurnResult` and `TurnResponse` types to include full agent responses, including tool call details and next hook data.
- Improved dynamic test execution by ensuring consistent chat session state across turns, enhancing the overall testing framework's capabilities.
- Enhanced documentation in README.md to reflect changes in response structure and dynamic testing output format.
2025-12-27 12:58:09 +08:00
Max
4d1d17f1ab Update timeout settings in documentation and code for agent testing framework
- Changed the default timeout value from 5 minutes to 2 minutes in the codebase and updated relevant sections in DESIGN_V2.md and README.md to reflect this change.
- Enhanced error handling in dynamic integration tests to account for both max turns exceeded and goal achieved scenarios without checkpoints.
- Improved formatting in the documentation for better clarity and consistency.
2025-12-26 12:18:53 +08:00
Max
006dc8b3da Enhance README.md with Comprehensive Hook Documentation for Agent Testing
- Added detailed sections on Before/After hooks, including types, execution order, and function signatures.
- Provided examples for common use cases such as database setup/teardown and conditional setup based on metadata.
- Clarified parameters for hook functions, improving guidance for users on implementing hooks in their tests.
- Enhanced overall documentation to support better understanding of the testing framework's capabilities.
2025-12-26 11:53:24 +08:00
Max
ea10a71050 Enhance README.md with Detailed Input Format Examples for Agent Testing
- Expanded the input format section to include comprehensive examples organized by scenario, covering various testing cases such as simple text input, assertions, conversation history, and dynamic mode.
- Added scenarios demonstrating the use of file attachments, agent-driven assertions, and options for test configuration.
- Improved clarity on the structure and requirements for JSONL input, ensuring users have clear guidance on how to format their test cases effectively.
- Removed outdated TODO_V2.md file to streamline documentation and focus on the updated README content.
2025-12-26 11:42:45 +08:00
Max
e9b3d46a6f Enhance README.md for Agent Test Framework
- Updated the introduction to clarify the framework's capabilities, emphasizing support for standard testing, dynamic testing, agent-driven assertions, and CI integration.
- Revised section headers for better organization, changing "Agent Tests" to "Standard Tests" and adding new sections for "Agent-Driven Input" and "Dynamic Mode."
- Included detailed examples for generating test cases using agents and running dynamic tests with simulators.
- Improved clarity on input modes and script test modes, ensuring users understand the requirements and options available for testing.
- Added notes on the importance of the `-n` flag for agent-driven input mode and clarified the distinction between script and agent-driven test case generation.
2025-12-26 11:28:19 +08:00
Max
8de302d4e8 Implement Dynamic Testing Features in Agent Test Framework
- Introduced dynamic testing capabilities, allowing for multi-turn conversations with checkpoints through the new `DynamicRunner`.
- Enhanced the `runSingleTest` method to support dynamic mode, including the execution of before/after scripts and detailed output for dynamic test results.
- Added new output methods in `output.go` for dynamic test start, turns, checkpoints, and results, improving console feedback during testing.
- Updated `DESIGN_V2.md` and `TODO_V2.md` to reflect the new dynamic mode features, including simulator configurations and checkpoint definitions.
- Revised the `Case` struct in `types.go` to include fields for dynamic testing, such as `Simulator`, `Checkpoints`, and `MaxTurns`.
2025-12-26 11:17:54 +08:00
Max
6ea982f027 Implement Agent-Driven Input and Dry-Run Mode in Test Framework
- Added support for generating test cases using agents and scripts through the new `LoadFromAgent` and `LoadFromScript` methods in the loader.
- Enhanced the `RunTests` method to handle different input sources, including agent-driven and script-based test case generation.
- Introduced a `--dry-run` flag to allow users to preview generated test cases without executing them.
- Updated relevant documentation in DESIGN_V2.md and TODO_V2.md to reflect the new features and implementation status.
2025-12-26 10:53:11 +08:00
Max
88610da75b Implement Agent-Driven Assertions in Test Framework
- Added support for agent-driven assertions in the Asserter, allowing validation of responses using specified agents.
- Introduced the `Use` and `Options` fields in the Assertion struct to facilitate agent configuration.
- Enhanced the `evaluateAssertion` method to handle assertions of type "agent".
- Implemented the `assertAgent` method to manage agent interactions and validation logic.
- Updated `script_assert.go` to include the `assertAgentMethod` for JavaScript API integration.
- Revised documentation in DESIGN_V2.md and TODO_V2.md to reflect the new agent-driven assertion capabilities and implementation status.
2025-12-26 10:16:40 +08:00
Max
5351128f89 Refactor Before/After Script Integration in Agent Test Framework
- Updated DESIGN_V2.md to reflect changes in the handling of before/after scripts, removing the `scripts:` prefix and clarifying their usage in JSONL test cases.
- Enhanced runner.go to integrate global before/after hooks, ensuring they execute correctly before and after test cases.
- Revised types.go to include new fields for before/after scripts in test case and options structures.
- Improved TODO_V2.md to track the implementation progress of before/after script functionality and related tasks.
- Added utility function LoadAgentTestScripts to facilitate loading of test scripts from the agent's src directory.
2025-12-26 09:44:56 +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
2ec28a1710 Enhance DESIGN_V2.md and TODO_V2.md with Before/After Script Support
- Updated DESIGN_V2.md to introduce support for `before` and `after` scripts in JSONL test cases, detailing their usage and execution order.
- Added examples for defining and utilizing before/after functions, including global initialization and cleanup processes.
- Revised TODO_V2.md to outline tasks for implementing before/after script functionality, ensuring clarity on remaining development efforts.
- Improved overall documentation to facilitate understanding of the new scripting capabilities in the Agent Test Framework.
2025-12-26 08:58:33 +08:00
Max
a5e974dc07 Update DESIGN_V2.md and TODO_V2.md for Output Format Enhancements
- Revised DESIGN_V2.md to clarify output formats for console and JSON, including detailed descriptions for standard, dynamic, and parallel modes.
- Updated the console output sections to provide clearer examples and summaries of test results, enhancing readability and usability.
- Modified TODO_V2.md to reflect the change from JSONL to JSON output format for message counts, ensuring consistency in documentation.
- Improved overall documentation to support better understanding of output handling in the Agent Test Framework.
2025-12-25 18:58:31 +08:00
Max
c34cae62e8 Update DESIGN_V2.md and TODO_V2.md for Input Field Enhancements
- Revised DESIGN_V2.md to clarify the `input` field's capabilities, allowing for string, single message, or message array formats for conversation context.
- Updated the test case format to reflect the new `input` structure, ensuring compatibility with existing single-turn tests.
- Enhanced TODO_V2.md to indicate the completion of message history support and outline remaining tasks, including options field support and JSONL output format updates.
- Improved documentation to ensure clarity on the new input handling and its implications for agent-driven testing.
2025-12-25 18:16:26 +08:00
Max
d03668e876 Enhance DESIGN_V2.md and TODO_V2.md for Message History Support
- Updated DESIGN_V2.md to introduce message history support in the Agent Test Framework, allowing tests to simulate multi-turn conversations without complex state management.
- Revised the test case format to include a `messages` field, enabling the passing of full conversation history directly to the agent.
- Enhanced TODO_V2.md to outline tasks for implementing message history support, including updates to the test case parser and output formats.
- Improved documentation on agent-driven assertions and error handling to reflect the new capabilities and ensure clarity for developers.
2025-12-25 18:10:52 +08:00
Max
d58aa12d4d Enhance DESIGN_V2.md and TODO_V2.md for Multi-Turn Testing
- Added detailed sections on Static and Dynamic modes in DESIGN_V2.md, outlining their characteristics and execution flows for multi-turn testing.
- Introduced a Quick Reference table for format rules, clarifying the usage of flags and assertions in test cases.
- Updated TODO_V2.md to reflect tasks for implementing mode support, including the addition of checkpoints and handling of order constraints in dynamic testing.
- Improved documentation for error handling in both static and dynamic modes, ensuring clarity on expected behaviors during test execution.
2025-12-25 17:57:26 +08:00
Max
38dd455cc5 Update DESIGN_V2.md and TODO_V2.md for Agent Test Framework
- Corrected references in DESIGN_V2.md to ensure consistent usage of agent identifiers, including updates to input sources and simulator configurations.
- Enhanced the documentation in TODO_V2.md with a summary of format rules for agent testing, clarifying the usage of prefixes for various contexts and options.
- Added tasks related to the dynamic simulator implementation and metadata handling to guide future development efforts.
2025-12-25 17:43:34 +08:00
Max
d7b84bdf36 Enhance Documentation and Add JSONL Support for Agent Assertions
- Updated the DESIGN_V2.md file to clarify the usage of agent-driven assertions in JSONL test cases, including detailed examples and API specifications.
- Introduced a new section on script testing with agent assertions, outlining the implementation and usage of the `t.assert.Agent()` method.
- Modified the TODO_V2.md file to reflect the addition of JSONL support for agent assertions and outlined tasks for further development in this area.
2025-12-25 17:35:30 +08:00