tessl install tessl/npm-external-editor@3.1.0Edit a string with the users preferred text editor using $VISUAL or $ENVIRONMENT
Agent Success
Agent success rate when using this tile
79%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.05x
Baseline
Agent success rate without this tile
75%
Provide a thin wrapper around a system text editor so callers can run synchronous or asynchronous editing sessions, read the edited content, observe the editor's exit status, and clean up the temporary file explicitly when needed.
@generates
export interface TempFileOptions {
prefix?: string;
postfix?: string;
template?: string;
dir?: string;
mode?: number;
}
export interface SessionResult {
content: string;
exitStatus: number;
path: string;
}
export class EditorLifecycle {
constructor(initialText?: string, fileOptions?: TempFileOptions);
/**
* Launch the editor synchronously and return edited content with exit status.
*/
launchSync(): SessionResult;
/**
* Launch the editor asynchronously and invoke the callback with content and exit status.
*/
launchAsync(callback: (err: Error | null, result?: SessionResult) => void): void;
/**
* Remove the temporary file even if no launch occurred.
*/
discard(): void;
}Uses an external editor library to manage launching, reading, exit status reporting, and cleanup for the temporary file.
@satisfied-by