{"_id":"@aboutlo/pi-smart-edit","_rev":"3-d5c4af76a4f4cbf05058b415bb95861e","name":"@aboutlo/pi-smart-edit","dist-tags":{"latest":"0.4.0"},"versions":{"0.2.0":{"name":"@aboutlo/pi-smart-edit","version":"0.2.0","keywords":["pi-package"],"_id":"@aboutlo/pi-smart-edit@0.2.0","maintainers":[{"name":"aboutlo","email":"lorenzo.sicilia@gmail.com"}],"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"69f7f02fa611601033ed3ea0c5e0fb92f2d9d028","tarball":"https://registry.npmjs.org/@aboutlo/pi-smart-edit/-/pi-smart-edit-0.2.0.tgz","fileCount":11,"integrity":"sha512-JvxU2XkdtmM/b8TiBoCp7oQAcyWKI5q8JFz9LDxccZ6aBYVNk4iqmm6g1Qean83iPINVeNqWePgXxiK91laJ3g==","signatures":[{"sig":"MEYCIQDn2vdjfcl+WEPxyV6j2Vku6PagOdUcVA2r99UeU612nwIhAN8l7wAtLggpsscMDv08w922s8IU4M7A1vMlzdst5tuk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":56505},"type":"module","_from":"file:aboutlo-pi-smart-edit-0.2.0.tgz","scripts":{"lint":"eslint .","test":"node --experimental-strip-types --test src/**/*.test.ts","build":"echo 'no build needed - jiti handles TS'","lint:fix":"eslint . --fix","typecheck":"tsc --noEmit","release:major":"pnpm version major && pnpm publish && git push --follow-tags","release:minor":"pnpm version minor && pnpm publish && git push --follow-tags","release:patch":"pnpm version patch && pnpm publish && git push --follow-tags"},"_npmUser":{"name":"aboutlo","email":"lorenzo.sicilia@gmail.com"},"_resolved":"/private/var/folders/sn/3lcghnzs6mg50fjrcd7bn15w0000gq/T/2ff763697c20d49c14231ae9d2643d55/aboutlo-pi-smart-edit-0.2.0.tgz","_integrity":"sha512-JvxU2XkdtmM/b8TiBoCp7oQAcyWKI5q8JFz9LDxccZ6aBYVNk4iqmm6g1Qean83iPINVeNqWePgXxiK91laJ3g==","_npmVersion":"11.9.0","description":"A [pi](https://github.com/badlogic/pi) extension that overrides the built-in `edit` tool with whitespace-tolerant matching, designed for local/quantized LLMs.","directories":{},"_nodeVersion":"24.14.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jiti":"^2.4.2","eslint":"^9.25.1","@eslint/js":"^9.25.1","typescript":"^5.8.3","@types/node":"^24.12.0","typescript-eslint":"^8.30.1","@mariozechner/pi-coding-agent":"*"},"peerDependencies":{"@sinclair/typebox":"*","@mariozechner/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-smart-edit_0.2.0_1776632106171_0.8622894697354757","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@aboutlo/pi-smart-edit","version":"0.3.0","keywords":["pi-package"],"_id":"@aboutlo/pi-smart-edit@0.3.0","maintainers":[{"name":"aboutlo","email":"lorenzo.sicilia@gmail.com"}],"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"881d049cd327e96fbaad6e66b597c06d8359d683","tarball":"https://registry.npmjs.org/@aboutlo/pi-smart-edit/-/pi-smart-edit-0.3.0.tgz","fileCount":11,"integrity":"sha512-9OINeiqm4vV1N2vAJMVjciQHAxi9wD7GXkxoZoVh12R1MkFYp3BYLIn0gA9LG+l+RRJc2fWYFCtx+R2h2zW9iA==","signatures":[{"sig":"MEUCIAiuQGO52faxevIyetaVb8dYrGBherp1uiV38vlVSA14AiEApDxaA9ImTrZEXA+mt0pK36AcfAsFe9+Bjshzdb6E/FE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":56505},"type":"module","_from":"file:aboutlo-pi-smart-edit-0.3.0.tgz","scripts":{"lint":"eslint .","test":"node --experimental-strip-types --test src/**/*.test.ts","build":"echo 'no build needed - jiti handles TS'","lint:fix":"eslint . --fix","typecheck":"tsc --noEmit","release:major":"pnpm version major && pnpm publish && git push --follow-tags","release:minor":"pnpm version minor && pnpm publish && git push --follow-tags","release:patch":"pnpm version patch && pnpm publish && git push --follow-tags"},"_npmUser":{"name":"aboutlo","email":"lorenzo.sicilia@gmail.com"},"_resolved":"/private/var/folders/sn/3lcghnzs6mg50fjrcd7bn15w0000gq/T/8922f789ee0fc370bb3f51cbb79f4750/aboutlo-pi-smart-edit-0.3.0.tgz","_integrity":"sha512-9OINeiqm4vV1N2vAJMVjciQHAxi9wD7GXkxoZoVh12R1MkFYp3BYLIn0gA9LG+l+RRJc2fWYFCtx+R2h2zW9iA==","_npmVersion":"11.9.0","description":"A [pi](https://github.com/badlogic/pi) extension that overrides the built-in `edit` tool with whitespace-tolerant matching, designed for local/quantized LLMs.","directories":{},"_nodeVersion":"24.14.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jiti":"^2.4.2","eslint":"^9.25.1","@eslint/js":"^9.25.1","typescript":"^5.8.3","@types/node":"^24.12.0","typescript-eslint":"^8.30.1","@mariozechner/pi-coding-agent":"*"},"peerDependencies":{"@sinclair/typebox":"*","@mariozechner/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-smart-edit_0.3.0_1776632134093_0.5920242922880901","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@aboutlo/pi-smart-edit","version":"0.4.0","type":"module","keywords":["pi-package"],"pi":{"extensions":["./src/index.ts"]},"dependencies":{},"devDependencies":{"@eslint/js":"^9.25.1","@mariozechner/pi-coding-agent":"*","@types/node":"^24.12.0","eslint":"^9.25.1","jiti":"^2.4.2","typescript":"^5.8.3","typescript-eslint":"^8.30.1"},"peerDependencies":{"@mariozechner/pi-coding-agent":"*","@sinclair/typebox":"*"},"publishConfig":{"access":"public"},"scripts":{"test":"node --experimental-strip-types --test src/**/*.test.ts","typecheck":"tsc --noEmit","lint":"eslint .","lint:fix":"eslint . --fix","build":"echo 'no build needed - jiti handles TS'","release:patch":"pnpm version patch && pnpm publish && git push --follow-tags","release:minor":"pnpm version minor && pnpm publish && git push --follow-tags","release:major":"pnpm version major && pnpm publish && git push --follow-tags"},"_id":"@aboutlo/pi-smart-edit@0.4.0","description":"A [pi](https://github.com/badlogic/pi) extension that overrides the built-in `edit` tool with whitespace-tolerant matching, designed for local/quantized LLMs.","_integrity":"sha512-kgqZ7skKd16gifgIFq3gxkeMiunEIZBPRza4vDV5BKq4Fr4ztI1oeyZ/BjLKamv8d2T1paNwB3RwnLaE7CObnQ==","_resolved":"/private/var/folders/sn/3lcghnzs6mg50fjrcd7bn15w0000gq/T/aaa9d96b6dcd0ca8b88719915ac42c47/aboutlo-pi-smart-edit-0.4.0.tgz","_from":"file:aboutlo-pi-smart-edit-0.4.0.tgz","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-kgqZ7skKd16gifgIFq3gxkeMiunEIZBPRza4vDV5BKq4Fr4ztI1oeyZ/BjLKamv8d2T1paNwB3RwnLaE7CObnQ==","shasum":"2b509b01fb04b000df9e1081be8e09c51ce2ed8b","tarball":"https://registry.npmjs.org/@aboutlo/pi-smart-edit/-/pi-smart-edit-0.4.0.tgz","fileCount":11,"unpackedSize":56505,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIARv6K+051pUGB0LPhdpwu1Mfm9AwpiGbdU4k7aCyVsLAiEAtk/sPeGpyXxEBYRd/yt+rH9oGJQd6nf3FRAd9KEAIAY="}]},"_npmUser":{"name":"aboutlo","email":"lorenzo.sicilia@gmail.com"},"directories":{},"maintainers":[{"name":"aboutlo","email":"lorenzo.sicilia@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-smart-edit_0.4.0_1776632149185_0.6585219815448979"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-19T20:55:06.091Z","modified":"2026-04-19T20:55:49.491Z","0.2.0":"2026-04-19T20:55:06.300Z","0.3.0":"2026-04-19T20:55:34.267Z","0.4.0":"2026-04-19T20:55:49.363Z"},"keywords":["pi-package"],"description":"A [pi](https://github.com/badlogic/pi) extension that overrides the built-in `edit` tool with whitespace-tolerant matching, designed for local/quantized LLMs.","maintainers":[{"name":"aboutlo","email":"lorenzo.sicilia@gmail.com"}],"readme":"# pi-extension-smart-edit\n\nA [pi](https://github.com/badlogic/pi) extension that overrides the built-in `edit` tool with whitespace-tolerant matching, designed for local/quantized LLMs.\n\n**smart-edit is a drop-in replacement for `edit` that makes local/quantized LLM coding more reliable.**\n\n## TL;DR\n\nWith Qwen 3.6 int4 runs (10 vs 10), smart-edit improved **edit success from 46% to 89%** and **task pass from 40% to 80%** on my local benchmark\\*.\n\nIt also reduced average runtime from **707s to 492s** (**~30% faster**) on that benchmark set.\n\nFor Qwen 3.6 nvfp4, the latest patched run improved task pass (10% → 20%) but has lower edit success and slower runtime by far in my use case (see table).\n\n---\n\n## Problem\n\nLocal LLMs often fail exact-text edits because of tiny formatting drift (indentation, quotes, trailing spaces). This causes retry loops and wasted tokens.\n\n## Solution\n\n`smart-edit` keeps `edit` precise, but more tolerant for local models:\n\n1. Exact match (same behavior as built-in)\n2. Normalized line match (whitespace/quote tolerant)\n\nSo you keep strict edits, but avoid brittle failures from tiny formatting drift.\n\nIt supports the current `edit` contract and keeps compatibility with older argument shapes, so resumed sessions continue to work.\n\n## Install\n\n```bash\npi install /path/to/pi-extension-smart-edit\n```\n\nOr for quick local testing:\n\n```bash\npi -e /path/to/pi-extension-smart-edit/src/index.ts\n```\n\n## Usage\n\nAfter loading the extension, use `edit` normally in pi. The model/tooling handles the argument shape automatically.\n\n## Benchmark summary\n\nThis benchmark runs the same medium coding task 10 times per model, then reports:\n\n- `edit` success rate,\n- end-to-end task pass rate (typecheck + tests + no timeout),\n- runtime.\n\n### Results\n\n| Model          | Edit Success (without) | Edit Success (with) | Task Pass (without) | Task Pass (with) | Avg Time (without) | Avg Time (with) |\n| -------------- | ---------------------: | ------------------: | ------------------: | ---------------: | -----------------: | --------------: |\n| Qwen 3.5 int4  |                    69% |                 90% |                 20% |              40% |               620s |            655s |\n| Qwen 3.5 nvfp4 |                    98% |                 86% |                 20% |              20% |               651s |            814s |\n| Qwen 3.6 int4  |                    46% |              89% 🔥 |                 40% |           80% 🔥 |               707s |         492s 🔥 |\n| Qwen 3.6 nvfp4 |                    74% |                 72% |                 10% |              20% |               706s |            839s |\n\n- Benchmark code isn't shared. I may do it later once I open source the other repo that I'm developing with only local LLMs\n","readmeFilename":"README.md"}