mirror of
https://github.com/cline/cline.git
synced 2026-09-19 02:05:44 +08:00
* refactor: simplify API configuration management and state handling Refactored `StateManager` and `ApiConfiguration` handling to use a more maintainable, data-driven approach. Replaced manual key mapping in `setApiConfiguration` with automated categorization based on static definitions. - Updated `buildApiHandler` and `createHandlerForProvider` to accept `Partial<ApiConfiguration>`, improving flexibility. - Introduced `categorizeApiConfigurationKeys` and other helpers to separate settings from secrets automatically. - Centralized secret key definitions in `state-keys.ts` to reduce boilerplate and potential for errors when adding new providers. - Cleaned up redundant imports and type definitions across the core API and storage modules. * apply feedback * clean up * refactor: consolidate API configuration types and state key definitions - Rename `ApiHandlerSecrets` to `Secrets` for consistency across codebase - Merge `ApiHandlerOptions` with `ApiHandlerSettings` to reduce duplication - Extract `GlobalStateAndSettingKeys` as a computed constant from state field definitions - Consolidate remote configuration fields into `REMOTE_CONFIG_EXTRA_FIELDS` group - Remove redundant type definitions and improve type safety in state management This refactoring simplifies the type system by eliminating duplicate interfaces and ensures consistent naming conventions throughout the storage and API layers. * Clean up * rename type with default * type safe * add unit test * Apply suggestions from code review Co-authored-by: Tomás Barreiro <52393857+BarreiroT@users.noreply.github.com> * apply feedback --------- Co-authored-by: Tomás Barreiro <52393857+BarreiroT@users.noreply.github.com>