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
EditArgs (type alias)
Section titled “EditArgs (type alias)”Signature
type EditArgs = typeof EditParameters.TypeSince v0.0.0
EditDetails (interface)
Section titled “EditDetails (interface)”Signature
export interface EditDetails { readonly diff: string readonly patch: string readonly firstChangedLine?: number}Since v0.0.0
EditParameters
Section titled “EditParameters”Signature
declare const EditParameters: anySince v0.0.0
An edit tool.
Signature
declare const make: () => Tool.Tool<EditArgs>Since v0.0.0
prepareArguments
Section titled “prepareArguments”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) => unknownSince v0.0.0