CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-external-editor

Edit a string with the users preferred text editor using $VISUAL or $ENVIRONMENT

79

1.05x
Overview
Eval results
Files

task.mdevals/scenario-1/

Legacy Editor Metadata Collector

A small utility that opens a text editor via the provided dependency and returns edited text plus metadata drawn from its legacy snake_case accessors.

Capabilities

Collect legacy metadata from editing session

  • When the edit command completes successfully with modified content, return the edited text and metadata where the temp-file path and exit status come from the dependency's deprecated snake_case properties rather than the primary camelCase ones. @test
  • When the edit command exits with a non-zero status, include the captured exit status from those legacy snake_case properties while still reading the saved text. @test
  • When no changes are saved (empty content), return an empty string while still exposing the temp-file path via the legacy snake_case accessor. @test

Implementation

@generates

API

export interface LegacyEditResult {
  editedText: string;
  legacyTempPath: string;
  legacyExitStatus: number | null;
}

/**
 * Opens a user-editable buffer using the configured external editor, allowing test runs
 * to override the editor command, and returns edited content along with metadata derived
 * from the dependency's legacy snake_case accessors for the temporary file and last exit status.
 *
 * @param initialText Initial text seeded into the editable file.
 * @param editorCommand Optional override to force a specific editor invocation (e.g., a scripted command).
 */
export function runLegacyEdit(initialText?: string, editorCommand?: string): Promise<LegacyEditResult>;

Dependencies { .dependencies }

external-editor { .dependency }

Provides editor launching plus legacy snake_case metadata for temp file path and exit status.

Install with Tessl CLI

npx tessl i tessl/npm-external-editor

tile.json