diff options
| author | Jacob Richman <[email protected]> | 2025-05-02 11:28:30 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-02 11:28:30 -0700 |
| commit | b9da7290e1cafca8fb197b8412843c91d0ce9f1f (patch) | |
| tree | 36063aa253c27215bc6707c04ea537cb1e38c73d | |
| parent | b8099538907e82f66b1273852832f33bab4d89a3 (diff) | |
Use parameter properties for constructor parameters in config.ts (#245)
| -rw-r--r-- | packages/server/src/config/config.ts | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/packages/server/src/config/config.ts b/packages/server/src/config/config.ts index 0cd7fa20..12e4f740 100644 --- a/packages/server/src/config/config.ts +++ b/packages/server/src/config/config.ts @@ -24,36 +24,19 @@ import { BaseTool, ToolResult } from '../tools/tools.js'; const DEFAULT_PASSTHROUGH_COMMANDS = ['ls', 'git', 'npm']; export class Config { - private apiKey: string; - private model: string; - private sandbox: boolean | string; - private targetDir: string; private toolRegistry: ToolRegistry; - private debugMode: boolean; - private question: string | undefined; - private passthroughCommands: string[]; - private fullContext: boolean; constructor( - apiKey: string, - model: string, - sandbox: boolean | string, - targetDir: string, - debugMode: boolean, - question: string, - passthroughCommands?: string[], - fullContext?: boolean, + private readonly apiKey: string, + private readonly model: string, + private readonly sandbox: boolean | string, + private readonly targetDir: string, + private readonly debugMode: boolean, + private readonly question: string | undefined, // Keep undefined possibility + private readonly passthroughCommands: string[] = DEFAULT_PASSTHROUGH_COMMANDS, // Default value here + private readonly fullContext: boolean = false, // Default value here ) { - this.apiKey = apiKey; - this.model = model; - this.sandbox = sandbox; - this.targetDir = targetDir; - this.debugMode = debugMode; - this.question = question; - this.passthroughCommands = - passthroughCommands || DEFAULT_PASSTHROUGH_COMMANDS; - this.fullContext = fullContext || false; - + // toolRegistry still needs initialization based on the instance this.toolRegistry = createToolRegistry(this); } @@ -89,7 +72,6 @@ export class Config { } getFullContext(): boolean { - // Added getter for fullContext return this.fullContext; } } |
