diff --git a/packages/core/src/tool/patch.txt b/packages/core/src/tool/patch.txt index 6045144164..dfee80f932 100644 --- a/packages/core/src/tool/patch.txt +++ b/packages/core/src/tool/patch.txt @@ -1,17 +1,9 @@ -Use the `patch` tool to edit files. Pass one patch enclosed by: +Use the `patch` tool to edit files. Provide one patch in this format: *** Begin Patch [one or more file operations] *** End Patch -Each file operation starts with one of: +Each operation starts with `*** Add File: `, `*** Delete File: `, or `*** Update File: `. Add file contents use `+` lines; delete operations have no body. -*** Add File: -*** Delete File: -*** Update File: - -Add operations contain `+` lines. Delete operations contain no body. Update operations may include `*** Move to: ` followed by one or more hunks. - -Each hunk starts with `@@` or `@@ `. Hunk lines start with a space for unchanged context, `-` for content to remove, or `+` for content to add. An optional `*** End of File` marker anchors a hunk to the end of the file. - -Unchanged context must match the current file exactly. If a line changes, emit the old line with `-` and the new line with `+`; never place intended new content in unchanged context. +An update may start with `*** Move to: ` and contains change lines, optionally separated by `@@` or `@@ ` markers. Change lines start with a space for unchanged context, `-` for removed content, or `+` for added content. An optional `*** End of File` marker anchors the final change to the end of the file. diff --git a/packages/core/src/tool/plugin/patch.ts b/packages/core/src/tool/plugin/patch.ts index c2bb663a30..8325bb7f40 100644 --- a/packages/core/src/tool/plugin/patch.ts +++ b/packages/core/src/tool/plugin/patch.ts @@ -17,7 +17,7 @@ export const name = "patch" export const Input = Schema.Struct({ patchText: Schema.String.annotate({ - description: "The complete patch, including the `*** Begin Patch` and `*** End Patch` markers", + description: "The complete patch text", }), })