{"_id":"@agent-sh/harness-write","_rev":"4-0de5a35b6f818fe373f026561262b4fc","name":"@agent-sh/harness-write","dist-tags":{"latest":"0.6.0"},"versions":{"0.2.0":{"name":"@agent-sh/harness-write","version":"0.2.0","keywords":["ai","agent","llm","tool-use","write-file","edit-file","bedrock","openai"],"author":{"name":"Avi Fenesh"},"license":"MIT","_id":"@agent-sh/harness-write@0.2.0","maintainers":[{"name":"avifenesh","email":"aviarchi1994@gmail.com"}],"homepage":"https://github.com/avifenesh/tools/tree/main/packages/write#readme","bugs":{"url":"https://github.com/avifenesh/tools/issues"},"dist":{"shasum":"cb35263ca1423c9858d0de39e31095e91ffbf0dd","tarball":"https://registry.npmjs.org/@agent-sh/harness-write/-/harness-write-0.2.0.tgz","fileCount":9,"integrity":"sha512-WoOyjqHFYg/c2BW5AyrsUh7pJl35fFcGXOJj2dGDmeGKMoACNHdF0qan1vcIAqT9VCZ75yUsvf8hXZ7cfCiDjQ==","signatures":[{"sig":"MEUCIQCVO/6kH7vG+p61/ZYWD1+9Nww3BXssbv0b/Cf94WNTKQIgTa7t6vH2N4ddpUEzl1ZsM4oWC2Gpi1EzlCMG4ZM8tYk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":315637},"main":"./dist/index.cjs","type":"module","_from":"file:agent-sh-harness-write-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"vitest run","build":"tsup","clean":"rm -rf dist .turbo","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"avifenesh","email":"aviarchi1994@gmail.com"},"_resolved":"/tmp/c42725bb56de77098f2c42e97817ec9c/agent-sh-harness-write-0.2.0.tgz","_integrity":"sha512-WoOyjqHFYg/c2BW5AyrsUh7pJl35fFcGXOJj2dGDmeGKMoACNHdF0qan1vcIAqT9VCZ75yUsvf8hXZ7cfCiDjQ==","repository":{"url":"git+https://github.com/avifenesh/tools.git","type":"git","directory":"packages/write"},"_npmVersion":"10.8.2","description":"Write / Edit / MultiEdit tools for AI agent harnesses — ledger-anchored, atomic, with structured fuzzy diagnostics","directories":{},"_nodeVersion":"20.20.2","dependencies":{"valibot":"^0.42.1","@agent-sh/harness-core":"0.2.0","@agent-sh/harness-read":"0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.4","typescript":"^5.6.3","@types/node":"^22.9.0"},"_npmOperationalInternal":{"tmp":"tmp/harness-write_0.2.0_1776853081137_0.153751789768789","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@agent-sh/harness-write","version":"0.4.0","keywords":["ai","agent","llm","tool-use","write-file","edit-file","bedrock","openai"],"author":{"name":"Avi Fenesh"},"license":"MIT","_id":"@agent-sh/harness-write@0.4.0","maintainers":[{"name":"avifenesh","email":"aviarchi1994@gmail.com"}],"homepage":"https://github.com/avifenesh/tools/tree/main/packages/write#readme","bugs":{"url":"https://github.com/avifenesh/tools/issues"},"dist":{"shasum":"bd8407a3ca1868e3198cb79e0bad485a79691943","tarball":"https://registry.npmjs.org/@agent-sh/harness-write/-/harness-write-0.4.0.tgz","fileCount":9,"integrity":"sha512-kja2gw4tmlzhPlhx4CfZmzoYBxjPnm6rIZX/lVg5eAJ9CSfwjjeAZujjAbakMtdMXx3k9YHGMjfP7sqgFn2c0Q==","signatures":[{"sig":"MEUCIApPIAtYecXbjC39ZIT7JxyASkY6iTmLM/Y9dn3cphD9AiEA+d/WZ4ZSm5pFmwxklvSikF7DlHK7zNlBqAM/P8crZqE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":333604},"main":"./dist/index.cjs","type":"module","_from":"file:agent-sh-harness-write-0.4.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"vitest run","build":"tsup","clean":"rm -rf dist .turbo","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"avifenesh","email":"aviarchi1994@gmail.com"},"_resolved":"/tmp/0388adc85c35268a647e68a52f96beb9/agent-sh-harness-write-0.4.0.tgz","_integrity":"sha512-kja2gw4tmlzhPlhx4CfZmzoYBxjPnm6rIZX/lVg5eAJ9CSfwjjeAZujjAbakMtdMXx3k9YHGMjfP7sqgFn2c0Q==","repository":{"url":"git+https://github.com/avifenesh/tools.git","type":"git","directory":"packages/write"},"_npmVersion":"10.8.2","description":"Write / Edit / MultiEdit tools for AI agent harnesses — ledger-anchored, atomic, with structured fuzzy diagnostics","directories":{},"_nodeVersion":"20.20.2","dependencies":{"valibot":"^1.2.0","@agent-sh/harness-core":"0.2.0","@agent-sh/harness-read":"0.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.4","typescript":"^5.6.3","@types/node":"^22.9.0"},"_npmOperationalInternal":{"tmp":"tmp/harness-write_0.4.0_1780428524902_0.6660846846607877","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@agent-sh/harness-write","version":"0.5.0","keywords":["ai","agent","llm","tool-use","write-file","edit-file","bedrock","openai"],"author":{"name":"Avi Fenesh"},"license":"MIT","_id":"@agent-sh/harness-write@0.5.0","maintainers":[{"name":"avifenesh","email":"aviarchi1994@gmail.com"}],"homepage":"https://github.com/avifenesh/tools/tree/main/packages/write#readme","bugs":{"url":"https://github.com/avifenesh/tools/issues"},"dist":{"shasum":"d36b59098b87aaf9f6b4f3b238d270f8773f81e6","tarball":"https://registry.npmjs.org/@agent-sh/harness-write/-/harness-write-0.5.0.tgz","fileCount":9,"integrity":"sha512-utnTymeKTvhaloLyKg26IML01u/4d0CzAmgAXv711VKUXZPh2rsFOdN56+TiWYcjQW2xv+bb6oWbotupzrwiBg==","signatures":[{"sig":"MEUCIDFgMJHQZR5TRkvREI03vvCRCVDnkfAtnQV9zYBb4I+VAiEAyEyRbsusqogv0JWEJSUU3FBG7MgMSUy0sOjHSzMXzCs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":372176},"main":"./dist/index.cjs","type":"module","_from":"file:agent-sh-harness-write-0.5.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"vitest run","build":"tsup","clean":"rm -rf dist .turbo","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"avifenesh","email":"aviarchi1994@gmail.com"},"_resolved":"/tmp/b82301c5e06ff73b1fc9e8fd8ec7683d/agent-sh-harness-write-0.5.0.tgz","_integrity":"sha512-utnTymeKTvhaloLyKg26IML01u/4d0CzAmgAXv711VKUXZPh2rsFOdN56+TiWYcjQW2xv+bb6oWbotupzrwiBg==","repository":{"url":"git+https://github.com/avifenesh/tools.git","type":"git","directory":"packages/write"},"_npmVersion":"10.8.2","description":"Write / Edit / MultiEdit tools for AI agent harnesses — ledger-anchored, atomic, with structured fuzzy diagnostics","directories":{},"_nodeVersion":"20.20.2","dependencies":{"valibot":"^1.2.0","@agent-sh/harness-core":"0.2.0","@agent-sh/harness-read":"0.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.4","typescript":"^5.6.3","@types/node":"^22.9.0"},"_npmOperationalInternal":{"tmp":"tmp/harness-write_0.5.0_1780760596335_0.7515865674892401","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@agent-sh/harness-write","version":"0.6.0","description":"Write / Edit / MultiEdit tools for AI agent harnesses — ledger-anchored, atomic, with structured fuzzy diagnostics","keywords":["ai","agent","llm","tool-use","write-file","edit-file","bedrock","openai"],"license":"MIT","author":{"name":"Avi Fenesh"},"homepage":"https://github.com/avifenesh/tools/tree/main/packages/write#readme","bugs":{"url":"https://github.com/avifenesh/tools/issues"},"repository":{"type":"git","url":"git+https://github.com/avifenesh/tools.git","directory":"packages/write"},"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"publishConfig":{"access":"public"},"engines":{"node":">=20"},"dependencies":{"valibot":"^1.2.0","@agent-sh/harness-core":"0.2.0","@agent-sh/harness-read":"0.4.0"},"devDependencies":{"@types/node":"^22.9.0","tsup":"^8.3.5","typescript":"^5.6.3","vitest":"^3.2.6"},"scripts":{"build":"tsup","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit","clean":"rm -rf dist .turbo"},"_id":"@agent-sh/harness-write@0.6.0","_integrity":"sha512-Dn3Wvm2tWLRj1XkdWBDb6llpZM1u+hA9hW32RLoWW4d4CmZEp/OTaFtu8ZANPUxTeXuTw2rWQU7fNcWTTgBjyA==","_resolved":"/tmp/c07af07f43939a6710b1aff8ce63b8da/agent-sh-harness-write-0.6.0.tgz","_from":"file:agent-sh-harness-write-0.6.0.tgz","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-Dn3Wvm2tWLRj1XkdWBDb6llpZM1u+hA9hW32RLoWW4d4CmZEp/OTaFtu8ZANPUxTeXuTw2rWQU7fNcWTTgBjyA==","shasum":"576715e21abea51c82471398d59582be56bb5bc2","tarball":"https://registry.npmjs.org/@agent-sh/harness-write/-/harness-write-0.6.0.tgz","fileCount":9,"unpackedSize":387025,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC+VuZ0hOmagSGt/ctn/hSW5918rCUV+SOkz4/jsGySNwIgbhlNhX/+TLZskOv60BectRugQ/GYkOhM/EpW12hjGj0="}]},"_npmUser":{"name":"avifenesh","email":"aviarchi1994@gmail.com"},"directories":{},"maintainers":[{"name":"avifenesh","email":"aviarchi1994@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/harness-write_0.6.0_1781213343820_0.8664541382260522"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-22T10:18:01.031Z","modified":"2026-06-11T21:29:04.185Z","0.2.0":"2026-04-22T10:18:01.263Z","0.4.0":"2026-06-02T19:28:45.075Z","0.5.0":"2026-06-06T15:43:16.464Z","0.6.0":"2026-06-11T21:29:04.054Z"},"bugs":{"url":"https://github.com/avifenesh/tools/issues"},"author":{"name":"Avi Fenesh"},"license":"MIT","homepage":"https://github.com/avifenesh/tools/tree/main/packages/write#readme","keywords":["ai","agent","llm","tool-use","write-file","edit-file","bedrock","openai"],"repository":{"type":"git","url":"git+https://github.com/avifenesh/tools.git","directory":"packages/write"},"description":"Write / Edit / MultiEdit tools for AI agent harnesses — ledger-anchored, atomic, with structured fuzzy diagnostics","maintainers":[{"name":"avifenesh","email":"aviarchi1994@gmail.com"}],"readme":"# @agent-sh/harness-write\n\nAtomic file write + `edit` + `multi_edit` with read-before-edit ledger, OLD_STRING_NOT_UNIQUE match locations, and fuzzy candidate suggestions on miss.\n\nPart of the [`@agent-sh/harness-*`](https://github.com/avifenesh/tools) monorepo — see the top-level README for architectural context and the full tool surface.\n\n## Install\n\n```sh\nnpm install @agent-sh/harness-write\n```\n\nRequires Node ≥ 20.\n\n## Usage\n\n```ts\nimport { edit, InMemoryLedger } from \"@agent-sh/harness-write\";\n\nconst ledger = new InMemoryLedger();\n// ... after the model Reads the file, the read-executor records into ledger ...\nconst r = await edit(\n  { path: \"src/index.ts\", old_string: \"old\", new_string: \"new\" },\n  { cwd: process.cwd(), permissions: { roots: [process.cwd()], sensitivePatterns: [] }, ledger },\n);\n```\n\n## Tool naming\n\nThe MultiEdit tool's canonical name is `multi_edit` (exported as\n`MULTIEDIT_TOOL_NAME`), matching the `multiEdit` entry point and the snake_case\nconvention of the other multi-word tool names (`bash_output`, `bash_kill`).\nThe pre-0.6.0 spelling `multiedit` is still exported as\n`MULTIEDIT_TOOL_NAME_LEGACY`. `isMultiEditToolName()` is a pure matcher that\naccepts both spellings; `normalizeMultiEditToolName()` maps both to the\ncanonical name and emits a one-time `DeprecationWarning` when it sees the\nlegacy spelling — use it at dispatch points. Permission hooks receive\n`tool: \"multi_edit\"` on every query a MultiEdit call makes. The `multiedit`\nalias will be removed in a future major release — migrate registrations and\nany hardcoded name matching to `multi_edit`.\n\n## Contract\n\nThe full contract — input shape, output discriminated-union, error codes, permission model, and acceptance tests — lives in [`agent-knowledge/design/write.md`](https://github.com/avifenesh/tools/blob/main/agent-knowledge/design/write.md). Changes to this package must stay in sync with that spec.\n\n## License\n\nMIT © Avi Fenesh\n","readmeFilename":"README.md"}