- Add --session-id flag to CLI for specifying custom session ID
- Add sessionId option to SDK QueryOptions
- Implement UUID validation for session IDs
- Pass session ID from SDK to CLI via --session-id argument
- Add integration tests for session-id functionality
- Update unit tests for ProcessTransport
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add abort listener cleanup in Query.close() to prevent memory leak
- Add abort listener cleanup in ControlDispatcher.shutdown()
- Remove AbortController recreation in Session.handleInterrupt()
This fixes the MaxListenersExceededWarning that occurred when:
- Creating 11+ Query instances in SDK/non-interactive mode
- Multiple user interrupts (Ctrl+C) in interactive mode
- Intensive control request scenarios
- Add 'resume' and 'continue' options to TransportOptions for session restoration
- Extend authType to support all CLI authentication types:
- use_openai, use_anthropic, qwen_oauth, use_gemini, use_vertex_ai
- Update type definitions and validation schemas accordingly
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Rename USE_FORK_FOR_ELECTRON to FORK_MODE
- Add fork mode in ProcessTransport for Electron IPC support
- Add comprehensive unit tests for fork mode
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- 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.