11import { Anthropic } from "@anthropic-ai/sdk"
22import cloneDeep from "clone-deep"
3- import delay from "delay "
3+ import { setTimeout as setTimeoutPromise } from "node:timers/promises "
44import fs from "fs/promises"
55import getFolderSize from "get-folder-size"
66import os from "os"
@@ -1215,7 +1215,7 @@ export class Cline {
12151215 // for their associated messages to be sent to the webview, maintaining
12161216 // the correct order of messages (although the webview is smart about
12171217 // grouping command_output messages despite any gaps anyways)
1218- await delay ( 50 )
1218+ await setTimeoutPromise ( 50 )
12191219
12201220 result = result . trim ( )
12211221
@@ -1460,7 +1460,7 @@ export class Cline {
14601460 }
14611461
14621462 console . log ( "first chunk failed, waiting 1 second before retrying" )
1463- await delay ( 1000 )
1463+ await setTimeoutPromise ( 1000 )
14641464 this . didAutomaticallyRetryFailedApiRequest = true
14651465 } else {
14661466 // request failed after retrying automatically once, ask user if they want to retry again
@@ -1902,7 +1902,7 @@ export class Cline {
19021902 await this . diffViewProvider . open ( relPath )
19031903 }
19041904 await this . diffViewProvider . update ( newContent , true )
1905- await delay ( 300 ) // wait for diff view to update
1905+ await setTimeoutPromise ( 300 ) // wait for diff view to update
19061906 this . diffViewProvider . scrollToFirstDiff ( )
19071907 // showOmissionWarning(this.diffViewProvider.originalContent || "", newContent)
19081908
@@ -1924,7 +1924,7 @@ export class Cline {
19241924 telemetryService . captureToolUsage ( this . taskId , block . name , true , true )
19251925
19261926 // we need an artificial delay to let the diagnostics catch up to the changes
1927- await delay ( 3_500 )
1927+ await setTimeoutPromise ( 3_500 )
19281928 } else {
19291929 // If auto-approval is enabled but this tool wasn't auto-approved, send notification
19301930 showNotificationForApprovalIfAutoApprovalEnabled (
@@ -3666,7 +3666,7 @@ export class Cline {
36663666
36673667 if ( busyTerminals . length > 0 && this . didEditFile ) {
36683668 // || this.didEditFile
3669- await delay ( 300 ) // delay after saving file to let terminals catch up
3669+ await setTimeoutPromise ( 300 ) // delay after saving file to let terminals catch up
36703670 }
36713671
36723672 // let terminalWasBusy = false
0 commit comments