@@ -119,6 +119,8 @@ export interface WorkspaceCreationParams {
119119 directoryName : string ;
120120 /** Logger for streaming creation progress and init hook output */
121121 initLogger : InitLogger ;
122+ /** Optional abort signal for cancellation */
123+ abortSignal ?: AbortSignal ;
122124}
123125
124126/**
@@ -145,6 +147,8 @@ export interface WorkspaceInitParams {
145147 workspacePath : string ;
146148 /** Logger for streaming initialization progress and output */
147149 initLogger : InitLogger ;
150+ /** Optional abort signal for cancellation */
151+ abortSignal ?: AbortSignal ;
148152}
149153
150154/**
@@ -208,26 +212,29 @@ export interface Runtime {
208212 /**
209213 * Read file contents as a stream
210214 * @param path Absolute or relative path to file
215+ * @param abortSignal Optional abort signal for cancellation
211216 * @returns Readable stream of file contents
212217 * @throws RuntimeError if file cannot be read
213218 */
214- readFile ( path : string ) : ReadableStream < Uint8Array > ;
219+ readFile ( path : string , abortSignal ?: AbortSignal ) : ReadableStream < Uint8Array > ;
215220
216221 /**
217222 * Write file contents atomically from a stream
218223 * @param path Absolute or relative path to file
224+ * @param abortSignal Optional abort signal for cancellation
219225 * @returns Writable stream for file contents
220226 * @throws RuntimeError if file cannot be written
221227 */
222- writeFile ( path : string ) : WritableStream < Uint8Array > ;
228+ writeFile ( path : string , abortSignal ?: AbortSignal ) : WritableStream < Uint8Array > ;
223229
224230 /**
225231 * Get file statistics
226232 * @param path Absolute or relative path to file/directory
233+ * @param abortSignal Optional abort signal for cancellation
227234 * @returns File statistics
228235 * @throws RuntimeError if path does not exist or cannot be accessed
229236 */
230- stat ( path : string ) : Promise < FileStat > ;
237+ stat ( path : string , abortSignal ?: AbortSignal ) : Promise < FileStat > ;
231238
232239 /**
233240 * Resolve a path to its absolute, canonical form (expanding tildes, resolving symlinks, etc.).
@@ -310,12 +317,14 @@ export interface Runtime {
310317 * @param projectPath Project root path (local path, used for git commands in LocalRuntime and to extract project name)
311318 * @param oldName Current workspace name
312319 * @param newName New workspace name
320+ * @param abortSignal Optional abort signal for cancellation
313321 * @returns Promise resolving to Result with old/new paths on success, or error message
314322 */
315323 renameWorkspace (
316324 projectPath : string ,
317325 oldName : string ,
318- newName : string
326+ newName : string ,
327+ abortSignal ?: AbortSignal
319328 ) : Promise <
320329 { success : true ; oldPath : string ; newPath : string } | { success : false ; error : string }
321330 > ;
@@ -333,12 +342,14 @@ export interface Runtime {
333342 * @param projectPath Project root path (local path, used for git commands in LocalRuntime and to extract project name)
334343 * @param workspaceName Workspace name to delete
335344 * @param force If true, force deletion even with uncommitted changes or special conditions (submodules, etc.)
345+ * @param abortSignal Optional abort signal for cancellation
336346 * @returns Promise resolving to Result with deleted path on success, or error message
337347 */
338348 deleteWorkspace (
339349 projectPath : string ,
340350 workspaceName : string ,
341- force : boolean
351+ force : boolean ,
352+ abortSignal ?: AbortSignal
342353 ) : Promise < { success : true ; deletedPath : string } | { success : false ; error : string } > ;
343354
344355 /**
0 commit comments