diff --git a/.changeset/filesystem-oldtext-description.md b/.changeset/filesystem-oldtext-description.md new file mode 100644 index 0000000000..433bc05b9b --- /dev/null +++ b/.changeset/filesystem-oldtext-description.md @@ -0,0 +1,5 @@ +--- +"@modelcontextprotocol/server-filesystem": patch +--- + +`edit_file`'s `edits[].oldText` parameter description now states the matching rule the tool applies (exact apart from line endings, else whole lines ignoring leading and trailing whitespace), instead of "must match exactly", which contradicted the tool's own description. diff --git a/.changeset/filesystem-ship-license.md b/.changeset/filesystem-ship-license.md new file mode 100644 index 0000000000..77a174aa7d --- /dev/null +++ b/.changeset/filesystem-ship-license.md @@ -0,0 +1,5 @@ +--- +"@modelcontextprotocol/server-filesystem": patch +--- + +Ship the repository's `LICENSE` in the npm package, which `package.json` already pointed at but the tarball left out, and correct the README's license section, which said MIT only, to describe the MIT to Apache-2.0 transition terms in that file. diff --git a/docs/quality-gate.md b/docs/quality-gate.md index bc959c26b9..e1df090e0b 100644 --- a/docs/quality-gate.md +++ b/docs/quality-gate.md @@ -195,7 +195,9 @@ covers: the repo-wide tooling and the guards that keep the gate itself honest. installed server. It catches what the boot smoke cannot, since the smoke runs the checkout: a file missing from the tarball, a dependency that only resolves inside the workspace. It also fails an npm tarball that ships a - test, a test helper or a test runner's config. It needs the network, so it is not a gate + test, a test helper or a test runner's config, and one that leaves out the + license file its `package.json` names (`SEE LICENSE IN LICENSE`; the + packages #5700 has yet to fix are exempt). It needs the network, so it is not a gate stage. `release.yml` runs it before anything publishes, and the `release` skill runs it by hand for the release ledger. - **`npm run format`** rewrites files, so it is something you run, not diff --git a/scripts/pack-and-verify.mjs b/scripts/pack-and-verify.mjs index c1b7c9497b..ecd13315c1 100644 --- a/scripts/pack-and-verify.mjs +++ b/scripts/pack-and-verify.mjs @@ -101,8 +101,10 @@ export function parseArgs(argv) { /** * What is wrong with an npm tarball's contents, judged from its manifest and - * file list alone: every `bin` target must be in it, and no test or test - * config file may be (#4930). Anything subtler (a module the entry point + * file list alone: every `bin` target must be in it, no test or test config + * file may be (#4930), and a license file the manifest names + * (`"license": "SEE LICENSE IN LICENSE"`) must be in it (#5639), unless the + * package is in `LICENSE_PENDING`. Anything subtler (a module the entry point * imports, a data file) is found by actually running the installed bin, which * is the next step. * @@ -124,6 +126,45 @@ export function tarballProblems(manifest, files) { ...files .filter(isTestFile) .map((f) => `${f} is a test file, which a package does not ship`), + ...licenseProblems(manifest, present), + ]; +} + +/** + * The npm packages that do not ship the license file their manifest names + * yet. The filesystem package published with `"license": "SEE LICENSE IN + * LICENSE"` and no LICENSE in its tarball (#5639); these three still do, and + * #5700 fixes them. The check passes them so that their releases are not + * blocked meanwhile. Remove a package from this list in the change that makes + * it ship the file: the script tests fail on a listed package that already + * does, so the list can only shrink. + */ +export const LICENSE_PENDING = new Set([ + "@modelcontextprotocol/server-everything", + "@modelcontextprotocol/server-memory", + "@modelcontextprotocol/server-sequential-thinking", +]); + +/** + * The license file a manifest points at, from the `SEE LICENSE IN ` + * form of its `license` field, or `null` when it names an SPDX expression or + * nothing. + * + * @param {{ license?: string }} manifest + * @returns {string | null} + */ +export function licenseFile(manifest) { + const match = /^SEE LICENSE IN (.+)$/.exec(manifest.license ?? ""); + return match ? match[1].trim() : null; +} + +/** The license file the manifest names, when the tarball lacks it. */ +function licenseProblems(manifest, present) { + const file = licenseFile(manifest); + if (!file || LICENSE_PENDING.has(manifest.name)) return []; + if (present.has(path.posix.normalize(file))) return []; + return [ + `package.json says "${manifest.license}", but ${file} is not in the tarball`, ]; } diff --git a/scripts/pack-and-verify.test.mjs b/scripts/pack-and-verify.test.mjs index 7bac8e1abe..fb2c179a44 100644 --- a/scripts/pack-and-verify.test.mjs +++ b/scripts/pack-and-verify.test.mjs @@ -2,29 +2,44 @@ // tarball check and where an installed command lives. The rest of the script // is `npm pack`, `npm install`, `uv build` and a real server boot, which need // the network and are exercised by running `npm run pack:verify` itself. -// Run via `npm run test:scripts`. +// One test is a guard on the repository as it stands (#5639): each npm +// package's file list, from an offline `npm pack --dry-run`, holds the license +// file its manifest names, with the same text as the root LICENSE. That runs +// in `validate:guards`, so a package that would publish without it fails +// before release rather than at it. Run via `npm run test:scripts`. import { test } from "node:test"; import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; import { existsSync, mkdirSync, mkdtempSync, + readFileSync, rmSync, writeFileSync, } from "node:fs"; import { tmpdir } from "node:os"; import path from "node:path"; +import { fileURLToPath } from "node:url"; import { + LICENSE_PENDING, artifactDirProblem, consumerEnv, installedLaunch, isDistribution, isTestFile, + licenseFile, main, parseArgs, tarballProblems, } from "./pack-and-verify.mjs"; +import { SERVERS } from "./smoke-servers.mjs"; + +const repoRoot = path.resolve( + path.dirname(fileURLToPath(import.meta.url)), + "..", +); test("parseArgs separates server names from --out", () => { assert.deepEqual(parseArgs([]), { names: [], out: undefined }); @@ -88,6 +103,85 @@ test("a test or test-config file in the tarball is named (#4930)", () => { ); }); +test("a license file the manifest names must be in the tarball (#5639)", () => { + const manifest = { + name: "@scope/pkg", + bin: { cmd: "dist/index.js" }, + license: "SEE LICENSE IN LICENSE", + }; + assert.deepEqual(tarballProblems(manifest, ["dist/index.js", "LICENSE"]), []); + assert.deepEqual(tarballProblems(manifest, ["dist/index.js"]), [ + 'package.json says "SEE LICENSE IN LICENSE", but LICENSE is not in the tarball', + ]); + // An SPDX expression names no file, so there is nothing to look for. + assert.deepEqual( + tarballProblems({ ...manifest, license: "MIT" }, ["dist/index.js"]), + [], + ); + // A package still waiting on its fix (#5700) is passed meanwhile. + const [pending] = LICENSE_PENDING; + assert.deepEqual( + tarballProblems({ ...manifest, name: pending }, ["dist/index.js"]), + [], + ); +}); + +test("licenseFile reads the SEE LICENSE IN form, and only that", () => { + assert.equal(licenseFile({ license: "SEE LICENSE IN LICENSE" }), "LICENSE"); + assert.equal( + licenseFile({ license: "SEE LICENSE IN docs/LICENSE.txt" }), + "docs/LICENSE.txt", + ); + assert.equal(licenseFile({ license: "Apache-2.0" }), null); + assert.equal(licenseFile({}), null); +}); + +test("each npm package ships the root LICENSE its manifest names, unless pending", () => { + const rootLicense = readFileSync(path.join(repoRoot, "LICENSE"), "utf8"); + const npmServers = SERVERS.filter((s) => s.language === "ts"); + assert.ok(npmServers.length > 0, "no TypeScript servers found"); + const names = new Set(); + for (const server of npmServers) { + const pkgDir = path.join(repoRoot, "src", server.name); + const manifest = JSON.parse( + readFileSync(path.join(pkgDir, "package.json"), "utf8"), + ); + names.add(manifest.name); + const file = licenseFile(manifest); + assert.ok(file, `${manifest.name}: license is not "SEE LICENSE IN "`); + // What `npm pack` would put in the tarball, read without building it: + // `--ignore-scripts` skips the `prepare` build, and `--dry-run` writes + // nothing. The license file does not depend on the build. + const res = spawnSync( + "npm", + ["pack", "--dry-run", "--json", "--ignore-scripts"], + { cwd: pkgDir, encoding: "utf8", shell: process.platform === "win32" }, + ); + assert.equal(res.status, 0, `npm pack failed in ${pkgDir}: ${res.stderr}`); + const shipped = JSON.parse(res.stdout)[0].files.some( + (f) => path.posix.normalize(f.path) === path.posix.normalize(file), + ); + if (LICENSE_PENDING.has(manifest.name)) { + assert.ok( + !shipped, + `${manifest.name} now ships ${file}: remove it from LICENSE_PENDING`, + ); + continue; + } + assert.ok(shipped, `${manifest.name}: ${file} is not in its tarball`); + assert.equal( + readFileSync(path.join(pkgDir, file), "utf8"), + rootLicense, + `src/${server.name}/${file} differs from the root LICENSE: copy it again`, + ); + } + for (const pending of LICENSE_PENDING) + assert.ok( + names.has(pending), + `LICENSE_PENDING names ${pending}, which is not a package here`, + ); +}); + test("isTestFile matches tests, helpers and runner configs, nothing else", () => { for (const f of [ "dist/__tests__/helpers.js", diff --git a/src/filesystem/LICENSE b/src/filesystem/LICENSE new file mode 100644 index 0000000000..4a93985763 --- /dev/null +++ b/src/filesystem/LICENSE @@ -0,0 +1,216 @@ +The MCP project is undergoing a licensing transition from the MIT License to the Apache License, Version 2.0 ("Apache-2.0"). All new code and specification contributions to the project are licensed under Apache-2.0. Documentation contributions (excluding specifications) are licensed under CC-BY-4.0. + +Contributions for which relicensing consent has been obtained are licensed under Apache-2.0. Contributions made by authors who originally licensed their work under the MIT License and who have not yet granted explicit permission to relicense remain licensed under the MIT License. + +No rights beyond those granted by the applicable original license are conveyed for such contributions. + +--- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to the Licensor for inclusion in the Work by the copyright + owner or by an individual or Legal Entity authorized to submit on behalf + of the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + +--- + +MIT License + +Copyright (c) 2024-2025 Model Context Protocol a Series of LF Projects, LLC. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +Creative Commons Attribution 4.0 International (CC-BY-4.0) + +Documentation in this project (excluding specifications) is licensed under +CC-BY-4.0. See https://creativecommons.org/licenses/by/4.0/legalcode for +the full license text. diff --git a/src/filesystem/README.md b/src/filesystem/README.md index 7435ff3606..ded76e4b14 100644 --- a/src/filesystem/README.md +++ b/src/filesystem/README.md @@ -221,7 +221,7 @@ Files inside the allowed directories are also [resources](https://modelcontextpr - Inputs: - `path` (string): File to edit - `edits` (array): List of edit operations - - `oldText` (string): Text to search for (can be substring) + - `oldText` (string): Text to search for: an exact substring of the file (line endings aside) or, when there is none, a run of whole lines that differ only in leading and trailing whitespace (see Matching below) - `newText` (string): Text to replace with - `dryRun` (boolean): Preview changes without applying (default: false) - Returns detailed diff and match information for dry runs, otherwise applies changes @@ -603,4 +603,10 @@ docker build -t mcp/filesystem -f src/filesystem/Dockerfile . ## License -This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository. +This server is distributed under the terms of the [`LICENSE`](LICENSE) file, a copy of the repository's root `LICENSE` that ships in the npm package. The Model Context Protocol project is moving from the MIT License to the Apache License, Version 2.0 (Apache-2.0), so those terms depend on the contribution: + +- New code and specification contributions are licensed under Apache-2.0, as are contributions whose authors have consented to relicensing. +- Contributions from authors who originally licensed their work under the MIT License and have not granted permission to relicense remain licensed under the MIT License. +- Documentation contributions (excluding specifications) are licensed under CC-BY-4.0. + +The [`LICENSE`](LICENSE) file holds the full text of the Apache-2.0 and MIT licenses and the terms above; it, not this summary, is authoritative. diff --git a/src/filesystem/__tests__/edit-oldtext-description.test.ts b/src/filesystem/__tests__/edit-oldtext-description.test.ts new file mode 100644 index 0000000000..7bc889a06c --- /dev/null +++ b/src/filesystem/__tests__/edit-oldtext-description.test.ts @@ -0,0 +1,79 @@ +// edit_file's edits[].oldText parameter description, as a client reads it from +// tools/list (#5688). It once said "must match exactly" while the tool's own +// description, and the matching it does, allow line endings to differ and fall +// back to whole lines compared without leading and trailing whitespace. A +// model reads both, so this pins the parameter description to the same rule +// and proves the fallback it describes actually applies. + +import fs from "fs/promises"; +import path from "path"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { + call, + connect, + makeTempDir, + quietStderr, + type Connected, +} from "./helpers.js"; + +type SchemaNode = { + description?: string; + properties?: Record; + items?: SchemaNode; +}; + +let dir: string; +let conn: Connected; + +beforeEach(async () => { + // The server logs its roots decision to stderr on every connect. + quietStderr(); + dir = await makeTempDir("mcp-fs-oldtext-"); + conn = await connect([dir]); +}); + +afterEach(async () => { + vi.restoreAllMocks(); + await conn.close(); + await fs.rm(dir, { recursive: true, force: true }); +}); + +async function oldTextDescription(): Promise { + const { tools } = await conn.client.listTools(); + const editFile = tools.find((tool) => tool.name === "edit_file"); + const schema = editFile?.inputSchema as SchemaNode | undefined; + const oldText = schema?.properties?.edits?.items?.properties?.oldText; + expect(typeof oldText?.description).toBe("string"); + return oldText?.description ?? ""; +} + +describe("edit_file edits[].oldText description (#5688)", () => { + it("no longer claims oldText must match exactly", async () => { + expect(await oldTextDescription()).not.toMatch(/must match exactly/i); + }); + + it("states the line-ending and whole-line whitespace rule", async () => { + const description = await oldTextDescription(); + expect(description).toContain("line endings (LF or CRLF) never matter"); + expect(description).toContain( + "a run of whole lines matches if each line is equal once leading and " + + "trailing whitespace is ignored", + ); + expect(description).toContain("newText then takes the file's indentation"); + }); + + it("matches the behavior it describes: unindented lines edit indented ones", async () => { + // "x = 1\ny = 2" is not a substring of the file, so only the whole-line + // fallback can match it, and the replacement takes the file's indentation. + const file = path.join(dir, "sample.py"); + await fs.writeFile(file, "def f():\n x = 1\n y = 2\n"); + const result = await call(conn.client, "edit_file", { + path: file, + edits: [{ oldText: "x = 1\ny = 2", newText: "x = 3\ny = 4" }], + }); + expect(result.isError).toBeFalsy(); + expect(await fs.readFile(file, "utf8")).toBe( + "def f():\n x = 3\n y = 4\n", + ); + }); +}); diff --git a/src/filesystem/__tests__/server-tools.test.ts b/src/filesystem/__tests__/server-tools.test.ts index eadae875a4..2d3993bb99 100644 --- a/src/filesystem/__tests__/server-tools.test.ts +++ b/src/filesystem/__tests__/server-tools.test.ts @@ -273,7 +273,12 @@ describe("server identity and tool list", () => { properties: { oldText: { type: "string", - description: "Text to search for - must match exactly", + description: + "Text to search for. It matches the file's text exactly, except that line " + + "endings (LF or CRLF) never matter; when there is no exact match, a run of " + + "whole lines matches if each line is equal once leading and trailing " + + "whitespace is ignored, and newText then takes the file's indentation. " + + "Whitespace inside a line must match.", }, newText: { type: "string", diff --git a/src/filesystem/server.ts b/src/filesystem/server.ts index 4b7a59ef30..94f74fa9f5 100644 --- a/src/filesystem/server.ts +++ b/src/filesystem/server.ts @@ -111,7 +111,15 @@ const AppendFileArgsSchema = z.object({ }); const EditOperation = z.object({ - oldText: z.string().describe("Text to search for - must match exactly"), + oldText: z + .string() + .describe( + "Text to search for. It matches the file's text exactly, except that line " + + "endings (LF or CRLF) never matter; when there is no exact match, a run of " + + "whole lines matches if each line is equal once leading and trailing " + + "whitespace is ignored, and newText then takes the file's indentation. " + + "Whitespace inside a line must match.", + ), newText: z.string().describe("Text to replace with"), });