This commit addresses issue #1186 by introducing a configurable schema compliance
mechanism for tool definitions sent to LLMs.
Key changes:
1. **New Configuration**: Added `model.generationConfig.schemaCompliance` setting (defaults to 'auto', optional 'openapi_30').
2. **Schema Converter**: Implemented `toOpenAPI30` converter in `packages/core` to strictly downgrade modern JSON Schema to OpenAPI 3.0.3 (required for Gemini API), handling:
- Nullable types (`["string", "null"]` -> `nullable: true`)
- Numeric exclusive limits
- Const to Enum conversion
- Removal of tuples and invalid keywords (``, `dependencies`, etc.)
3. **Tests**: Added comprehensive unit tests for the schema converter and updated pipeline tests.
Fixes#1186
- Added new `SdkMcpController` to manage communication between CLI MCP clients and SDK MCP servers.
- Introduced `createSdkMcpServer` function for creating SDK-embedded MCP servers.
- Updated configuration options to support both external and SDK MCP servers.
- Enhanced timeout settings for various SDK operations, including MCP requests.
- Refactored existing control request handling to accommodate new SDK MCP server functionality.
- Updated tests to cover new SDK MCP server features and ensure proper integration.
- Introduced a new logging system with adjustable log levels (debug, info, warn, error).
- Updated query options to include a logLevel parameter for controlling verbosity.
- Refactored existing code to utilize the new logging system for better error handling and debugging.
- Cleaned up unused code and improved the structure of the SDK.
- Replace `EOL` from `node:os` with `\n` for consistent line splitting in ACP connection output processing
- This ensures cross-platform compatibility since `EOL` is platform-specific while `\n` is universally used in text decoding
- The change maintains the same behavior on all platforms by using standard newline characters
- Implemented detection and handling for TodoWriteTool to route updates as plan entries instead of tool call events.
- Added sub-agent tool tracking for TaskTool, allowing for event emission and cleanup.
- Updated event listeners to manage sub-agent tool calls and approval requests effectively.