Feat: Implemented advanced settings for Claude Code AI provider (#872)

* Feat: Implemented advanced settings for Claude Code AI provider

- Added new 'claudeCode' property to default config
- Added getters and validation functions to 'config-manager.js'
- Added new 'isEmpty' utility to 'utils.js'
- Added new constants file 'commands.js' for AI_COMMAND_NAMES
- Updated Claude Code AI provider to use new config functions
- Updated 'claude-code-usage.md' documentation
- Added 'config-manager.test.js' tests to cover new settings

* chore: run format

---------

Co-authored-by: Ralph Khreish <35776126+Crunchyman-ralph@users.noreply.github.com>
This commit is contained in:
Geoff Hammond
2025-07-03 06:43:46 +10:00
committed by GitHub
parent c99df64f65
commit f7fbdd6755
8 changed files with 426 additions and 90 deletions

View File

@@ -7,6 +7,7 @@
import { createClaudeCode } from './custom-sdk/claude-code/index.js';
import { BaseAIProvider } from './base-provider.js';
import { getClaudeCodeSettingsForCommand } from '../../scripts/modules/config-manager.js';
export class ClaudeCodeProvider extends BaseAIProvider {
constructor() {
@@ -26,6 +27,7 @@ export class ClaudeCodeProvider extends BaseAIProvider {
/**
* Creates and returns a Claude Code client instance.
* @param {object} params - Parameters for client initialization
* @param {string} [params.commandName] - Name of the command invoking the service
* @param {string} [params.baseURL] - Optional custom API endpoint (not used by Claude Code)
* @returns {Function} Claude Code client function
* @throws {Error} If initialization fails
@@ -35,10 +37,7 @@ export class ClaudeCodeProvider extends BaseAIProvider {
// Claude Code doesn't use API keys or base URLs
// Just return the provider factory
return createClaudeCode({
defaultSettings: {
// Add any default settings if needed
// These can be overridden per request
}
defaultSettings: getClaudeCodeSettingsForCommand(params?.commandName)
});
} catch (error) {
this.handleError('client initialization', error);