diff --git a/README.md b/README.md index 090e626..115693d 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ The extension detects outdated CLI builds and warns with upgrade guidance. It re Set `patchloom.path` in settings, or add the CLI to your `PATH`. **CLI compatibility warning** -Run `Patchloom: Open Releases` to download the latest release. The extension requires 0.3.0 or newer; 0.6.0 is recommended. +Run `Patchloom: Open Releases` to download the latest release. The extension requires 0.3.0 or newer; 0.7.0 is recommended. **MCP config not injected** Run `Patchloom: Configure MCP` and select the target editor config. @@ -183,7 +183,7 @@ File bugs and feature requests at [patchloom/patchloom-vscode/issues](https://gi ## Requirements - VS Code 1.90 or newer (or compatible editors: Cursor, Windsurf, VSCodium) -- [Patchloom CLI](https://github.com/patchloom/patchloom) 0.3.0 or newer (0.6.0+ recommended for 43 MCP tools including 11 AST tools, declarative MCP registry, and concurrent performance improvements) +- [Patchloom CLI](https://github.com/patchloom/patchloom) 0.3.0 or newer (0.7.0+ recommended for 43 MCP tools, LLM-aligned CLI arguments, post-write formatter hook, and transaction engine unification) ## Contributing diff --git a/src/commands/quickActions.ts b/src/commands/quickActions.ts index 5b1fac0..92e9353 100644 --- a/src/commands/quickActions.ts +++ b/src/commands/quickActions.ts @@ -46,7 +46,7 @@ export async function runQuickAction(): Promise { { label: "Replace text in file", description: "Literal text replacement with diff preview", - detail: "Builds `patchloom replace --to `", + detail: "Builds `patchloom replace --new `", run: async () => { const target = await pickWorkspaceFileTarget("Select a file for Patchloom replace"); if (!target) { @@ -809,7 +809,7 @@ export function buildReplaceQuickAction(targetPath: string, from: string, to: st title: `Replace text in ${path.basename(targetPath)}`, targetPath, targetArgIndices: [4], - args: ["replace", from, "--to", to, targetPath] + args: ["replace", from, "--new", to, targetPath] }; } diff --git a/src/install/managed.ts b/src/install/managed.ts index 6031210..b339495 100644 --- a/src/install/managed.ts +++ b/src/install/managed.ts @@ -25,7 +25,8 @@ export type PatchloomTargetTriple = | "x86_64-apple-darwin" | "aarch64-unknown-linux-gnu" | "x86_64-unknown-linux-gnu" - | "x86_64-pc-windows-msvc"; + | "x86_64-pc-windows-msvc" + | "aarch64-pc-windows-msvc"; export interface ManagedInstallTarget { readonly platform: NodeJS.Platform; @@ -250,6 +251,15 @@ export function detectManagedInstallTarget( }; } + if (platform === "win32" && arch === "arm64") { + return { + platform, + arch, + targetTriple: "aarch64-pc-windows-msvc", + archiveFormat: ".zip" + }; + } + return undefined; } diff --git a/test/unit/binary.test.ts b/test/unit/binary.test.ts index 5a66eb3..f3662ba 100644 --- a/test/unit/binary.test.ts +++ b/test/unit/binary.test.ts @@ -226,6 +226,12 @@ test("detectManagedInstallTarget maps supported platforms to release targets", ( targetTriple: "x86_64-pc-windows-msvc", archiveFormat: ".zip" }); + assert.deepEqual(detectManagedInstallTarget("win32", "arm64"), { + platform: "win32", + arch: "arm64", + targetTriple: "aarch64-pc-windows-msvc", + archiveFormat: ".zip" + }); assert.equal(detectManagedInstallTarget("linux", "arm"), undefined); }); diff --git a/test/unit/outputChannel.test.ts b/test/unit/outputChannel.test.ts index d03832f..ebca18d 100644 --- a/test/unit/outputChannel.test.ts +++ b/test/unit/outputChannel.test.ts @@ -29,11 +29,11 @@ test("logCommand appends command with arguments and cwd", () => { dispose() {} })); - log.logCommand("/usr/bin/patchloom", ["replace", "old", "--to", "new", "file.txt"], "/workspace"); + log.logCommand("/usr/bin/patchloom", ["replace", "old", "--new", "new", "file.txt"], "/workspace"); assert.equal(lines.length, 2); assert.ok(lines[0].includes("patchloom")); - assert.ok(lines[0].includes("replace old --to new file.txt")); + assert.ok(lines[0].includes("replace old --new new file.txt")); assert.ok(lines[1].includes("cwd: /workspace")); }); diff --git a/test/unit/patchloomCli.test.ts b/test/unit/patchloomCli.test.ts index cd78952..155f330 100644 --- a/test/unit/patchloomCli.test.ts +++ b/test/unit/patchloomCli.test.ts @@ -154,7 +154,7 @@ describe("patchloom CLI integration", async () => { await fs.writeFile(txtFile, "Hello old_name, welcome to old_name project.\n", "utf8"); await execFileAsync(binaryPath, [ - "replace", "old_name", "--to", "new_name", txtFile, "--apply" + "replace", "old_name", "--new", "new_name", txtFile, "--apply" ], { cwd: dir, timeout: 5000 }); const result = await fs.readFile(txtFile, "utf8"); @@ -268,7 +268,7 @@ describe("patchloom CLI integration", async () => { try { await execFileAsync(binaryPath, [ - "replace", "hello", "--to", "goodbye", file, "--check" + "replace", "hello", "--new", "goodbye", file, "--check" ], { timeout: 5000 }); assert.fail("should have exited with non-zero code"); } catch (error) { @@ -567,7 +567,7 @@ describe("patchloom CLI integration", async () => { // Apply a change (creates a backup) await execFileAsync(binaryPath, [ - "replace", "original", "--to", "modified", file, "--apply" + "replace", "original", "--new", "modified", file, "--apply" ], { cwd: dir, timeout: 5000 }); const modified = await fs.readFile(file, "utf8"); @@ -792,7 +792,7 @@ describe("managed install end-to-end MCP", { timeout: 120_000 }, async () => { jsonrpc: "2.0", id: 3, method: "tools/call", params: { name: "doc_set", - arguments: { path: "config.json", selector: "port", value: 8080 } + arguments: { path: "config.json", key: "port", value: 8080 } } }) + "\n"); diff --git a/test/unit/quickActions.test.ts b/test/unit/quickActions.test.ts index 2a79210..1ba81d8 100644 --- a/test/unit/quickActions.test.ts +++ b/test/unit/quickActions.test.ts @@ -33,7 +33,7 @@ test("buildReplaceQuickAction builds a replace command for one file", () => { assert.equal(action.title, "Replace text in README.md"); assert.deepEqual(action.targetArgIndices, [4]); - assert.deepEqual(action.args, ["replace", "old", "--to", "new", "/workspace/demo/README.md"]); + assert.deepEqual(action.args, ["replace", "old", "--new", "new", "/workspace/demo/README.md"]); }); test("buildTidyQuickAction includes selected tidy flags", () => { @@ -71,25 +71,25 @@ test("retargetQuickAction swaps only the target path arguments", () => { assert.deepEqual(retargeted.args, [ "replace", "/workspace/demo/README.md", - "--to", + "--new", "new", "/tmp/preview/README.md" ]); }); test("withApplyFlag appends apply once", () => { - assert.deepEqual(withApplyFlag(["replace", "old", "--to", "new", "README.md"]), [ + assert.deepEqual(withApplyFlag(["replace", "old", "--new", "new", "README.md"]), [ "replace", "old", - "--to", + "--new", "new", "README.md", "--apply" ]); - assert.deepEqual(withApplyFlag(["replace", "old", "--to", "new", "README.md", "--apply"]), [ + assert.deepEqual(withApplyFlag(["replace", "old", "--new", "new", "README.md", "--apply"]), [ "replace", "old", - "--to", + "--new", "new", "README.md", "--apply"