@@ -59,8 +59,9 @@ export class SandboxClient {
5959 const result = await this . controlApi . createTemplate ( {
6060 input : new $AgentRun . CreateTemplateInput ( {
6161 ...finalInput ,
62- networkConfiguration : finalInput . networkConfiguration
63- ? new $AgentRun . NetworkConfiguration ( {
62+ networkConfiguration :
63+ finalInput . networkConfiguration ?
64+ new $AgentRun . NetworkConfiguration ( {
6465 ...finalInput . networkConfiguration ,
6566 } )
6667 : undefined ,
@@ -117,8 +118,9 @@ export class SandboxClient {
117118 templateName : name ,
118119 input : new $AgentRun . UpdateTemplateInput ( {
119120 ...input ,
120- networkConfiguration : input . networkConfiguration
121- ? new $AgentRun . NetworkConfiguration ( {
121+ networkConfiguration :
122+ input . networkConfiguration ?
123+ new $AgentRun . NetworkConfiguration ( {
122124 ...input . networkConfiguration ,
123125 } )
124126 : undefined ,
@@ -190,6 +192,7 @@ export class SandboxClient {
190192 const cfg = Config . withConfigs ( this . config , config ) ;
191193
192194 try {
195+ console . log ( { input } ) ;
193196 const result = await this . controlApi . createSandbox ( {
194197 input : new $AgentRun . CreateSandboxInput ( {
195198 ...input ,
@@ -212,7 +215,7 @@ export class SandboxClient {
212215 createCodeInterpreterSandbox = async ( params : {
213216 templateName : string ;
214217 options ?: {
215- sandboxIdleTimeoutSeconds ?: number ;
218+ sandboxIdleTimeoutInSeconds ?: number ;
216219 nasConfig ?: NASConfig ;
217220 ossMountConfig ?: OSSMountConfig ;
218221 polarFsConfig ?: PolarFsConfig ;
@@ -223,7 +226,7 @@ export class SandboxClient {
223226 return CodeInterpreterSandbox . createFromTemplate (
224227 templateName ,
225228 options ,
226- config ?? this . config
229+ config ?? this . config ,
227230 ) ;
228231 } ;
229232
@@ -234,7 +237,7 @@ export class SandboxClient {
234237 createBrowserSandbox = async ( params : {
235238 templateName : string ;
236239 options ?: {
237- sandboxIdleTimeoutSeconds ?: number ;
240+ sandboxIdleTimeoutInSeconds ?: number ;
238241 nasConfig ?: NASConfig ;
239242 ossMountConfig ?: OSSMountConfig ;
240243 polarFsConfig ?: PolarFsConfig ;
@@ -245,7 +248,7 @@ export class SandboxClient {
245248 return BrowserSandbox . createFromTemplate (
246249 templateName ,
247250 options ,
248- config ?? this . config
251+ config ?? this . config ,
249252 ) ;
250253 } ;
251254
@@ -360,12 +363,12 @@ export class SandboxClient {
360363 config : cfg ,
361364 } ) ;
362365 return ( result . sandboxes || [ ] ) . map ( ( item : $AgentRun . Sandbox ) =>
363- Sandbox . fromInnerObject ( item , cfg )
366+ Sandbox . fromInnerObject ( item , cfg ) ,
364367 ) ;
365368 } ;
366369
367370 private prepareTemplateCreateInput (
368- input : TemplateCreateInput
371+ input : TemplateCreateInput ,
369372 ) : TemplateCreateInput {
370373 const defaults = this . getTemplateDefaults ( input . templateType ) ;
371374 const finalInput = { ...defaults , ...input } ;
@@ -381,7 +384,7 @@ export class SandboxClient {
381384 }
382385
383386 private getTemplateDefaults (
384- templateType : TemplateType
387+ templateType : TemplateType ,
385388 ) : Partial < TemplateCreateInput > {
386389 const base = {
387390 cpu : 2 ,
@@ -409,7 +412,7 @@ export class SandboxClient {
409412 input . diskSize !== 10240
410413 ) {
411414 throw new Error (
412- `When templateType is BROWSER or AIO, diskSize must be 10240, got ${ input . diskSize } `
415+ `When templateType is BROWSER or AIO, diskSize must be 10240, got ${ input . diskSize } ` ,
413416 ) ;
414417 }
415418
@@ -419,7 +422,7 @@ export class SandboxClient {
419422 input . networkConfiguration ?. networkMode === TemplateNetworkMode . PRIVATE
420423 ) {
421424 throw new Error (
422- `When templateType is CODE_INTERPRETER or AIO, networkMode cannot be PRIVATE`
425+ `When templateType is CODE_INTERPRETER or AIO, networkMode cannot be PRIVATE` ,
423426 ) ;
424427 }
425428 }
0 commit comments