feat: add --session-id support for CLI and SDK

- 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>
This commit is contained in:
mingholy.lmh 2026-02-12 18:58:27 +08:00
parent e8259092c6
commit 5d939fdb83
12 changed files with 603 additions and 3 deletions

View file

@ -242,9 +242,14 @@ describe('parseArguments', () => {
});
it('should allow -r flag as alias for --resume', async () => {
process.argv = ['node', 'script.js', '-r', 'session-123'];
process.argv = [
'node',
'script.js',
'-r',
'123e4567-e89b-12d3-a456-426614174000',
];
const argv = await parseArguments();
expect(argv.resume).toBe('session-123');
expect(argv.resume).toBe('123e4567-e89b-12d3-a456-426614174000');
});
it('should allow -c flag as alias for --continue', async () => {