Skip to content

tools/Edit

The edit tool: exact-text replacements in one file, matched against the original, with a fuzzy fallback for whitespace and Unicode punctuation. Keeps the file’s BOM and line endings; returns a display diff and a unified patch as details.

Since v0.0.0


Signature

type EditArgs = typeof EditParameters.Type

Source

Since v0.0.0

Signature

export interface EditDetails {
readonly diff: string
readonly patch: string
readonly firstChangedLine?: number
}

Source

Since v0.0.0

Signature

declare const EditParameters: any

Source

Since v0.0.0

An edit tool.

Signature

declare const make: () => Tool.Tool<EditArgs>

Source

Since v0.0.0

Repair shapes models commonly send: edits as a JSON string or as a single edit object, and a top-level oldText/newText pair. Works on a copy; anything else is returned unchanged. The edit tool applies it as its prepareArguments.

Signature

declare const prepareArguments: (input: unknown) => unknown

Source

Since v0.0.0