Commit cc20087
committed
feat(sdk): implement complete TypeScript SDK for CLI integration
- 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 diagnostics1 parent 8008824 commit cc20087
File tree
6 files changed
+4721
-0
lines changed- cortex-gui/src/sdk
- __tests__
6 files changed
+4721
-0
lines changed
0 commit comments