sandbox setting and argument (#243)

This commit is contained in:
Olcan 2025-05-02 08:15:46 -07:00 committed by GitHub
parent 53ac7952c7
commit a7679db6e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 44 additions and 23 deletions

View file

@ -26,6 +26,7 @@ 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;
@ -36,6 +37,7 @@ export class Config {
constructor(
apiKey: string,
model: string,
sandbox: boolean | string,
targetDir: string,
debugMode: boolean,
question: string,
@ -44,6 +46,7 @@ export class Config {
) {
this.apiKey = apiKey;
this.model = model;
this.sandbox = sandbox;
this.targetDir = targetDir;
this.debugMode = debugMode;
this.question = question;
@ -62,6 +65,10 @@ export class Config {
return this.model;
}
getSandbox(): boolean | string {
return this.sandbox;
}
getTargetDir(): string {
return this.targetDir;
}
@ -113,6 +120,7 @@ export function loadEnvironment(): void {
export function createServerConfig(
apiKey: string,
model: string,
sandbox: boolean | string,
targetDir: string,
debugMode: boolean,
question: string,
@ -122,6 +130,7 @@ export function createServerConfig(
return new Config(
apiKey,
model,
sandbox,
path.resolve(targetDir),
debugMode,
question,