Commit 631ba4f
feat(sdk): implement complete TypeScript SDK for CLI integration (#423)
- Add comprehensive TypeScript types matching cortex-protocol definitions
- Implement CliExecutor with Node.js and Tauri process runners
- Create CortexClient with methods for all CLI commands (exec, run, sessions, models, agents, etc.)
- Add robust error handling with typed errors (RateLimitError, TimeoutError, etc.)
- Support streaming execution with JSON event parsing
- Include retry logic with exponential backoff
- Add comprehensive test suite with mocked process runners
- Handle CLI exit codes and stderr streams properly
- Support multi-environment execution (Node.js, Tauri)
The SDK provides a type-safe interface to the Cortex CLI for:
- Headless AI execution (exec command)
- Session management (list, resume, export, import)
- Model and agent management
- Configuration and authentication
- GitHub integration
- Debug and diagnostics
Co-authored-by: Droid Agent <droid@factory.ai>1 parent f01044d commit 631ba4f
6 files changed
Lines changed: 4721 additions & 0 deletions
0 commit comments