{"_id":"@amql/mutate","name":"@amql/mutate","dist-tags":{"alpha":"0.0.0-alpha.0","latest":"0.0.0-alpha.0"},"versions":{"0.0.0-alpha.0":{"name":"@amql/mutate","version":"0.0.0-alpha.0","type":"module","exports":{".":{"types":"./index.d.ts","flow":"./index.js.flow","require":"./index.cjs","import":"./index.js"}},"engines":{"node":">=18.0.0"},"scripts":{"prepack":"wasm-js-bridge build-workspace"},"license":"MIT","description":"Pure source code mutation operations","repository":{"type":"git","url":"git+https://github.com/vikr01/aql.git"},"_id":"@amql/mutate@0.0.0-alpha.0","gitHead":"4ee0598df7c53c686813ef469453e946c91514be","types":"./index.d.ts","bugs":{"url":"https://github.com/vikr01/aql/issues"},"homepage":"https://github.com/vikr01/aql#readme","_nodeVersion":"22.17.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-5RclYyI1w92chbOYZbSzBCFjQMG4nifXmNkzIkT7Nkn8rpEJlxtE7e7g7TM3B+JNIzR6mBZ5hKV7rTO0x9maMQ==","shasum":"39fc43625563838fc3a36fcc565112eeed758853","tarball":"https://registry.npmjs.org/@amql/mutate/-/mutate-0.0.0-alpha.0.tgz","fileCount":6,"unpackedSize":258765,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDXp3J9ZuSL2PiT9J2wN7G7SdjNQRvhFlncevrOBZ84agIgMGb0nAHKAoxrmPzEXnz2f5g/0JAiC0gE+V491J76n7Q="}]},"_npmUser":{"name":"vikr01","email":"vik120@icloud.com"},"directories":{},"maintainers":[{"name":"vikr01","email":"vik120@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mutate_0.0.0-alpha.0_1773348949399_0.7198151635752184"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-12T20:55:49.260Z","0.0.0-alpha.0":"2026-03-12T20:55:49.538Z","modified":"2026-03-12T20:55:49.944Z"},"maintainers":[{"name":"vikr01","email":"vik120@icloud.com"}],"description":"Pure source code mutation operations","homepage":"https://github.com/vikr01/aql#readme","repository":{"type":"git","url":"git+https://github.com/vikr01/aql.git"},"bugs":{"url":"https://github.com/vikr01/aql/issues"},"license":"MIT","readme":"# amql-mutate\n\n> Pure source code mutation operations for AQL\n\n## Role\n\n- Insert, remove, replace, move nodes in source text\n- All functions are pure: source text + node refs in, modified source + updated refs out\n- No file I/O — callers handle reading/writing\n- Defines shared newtypes: `NodeKind`, `RelativePath`\n- Dependency of [amql-engine](../amql-engine)\n\n## Features\n\n- `wasm` — WASM bindings via `wasm_bindgen`\n- `ts` — TypeScript type generation via `ts-rs`\n- `jsonschema` — JSON Schema derivation via `schemars`\n\n## Types\n\n- `NodeRef` — self-contained reference to an AST node (file + byte range + kind)\n- `InsertPosition` — Before, After, Into\n- `MutationResult` — modified source + updated node refs\n- `NodeKind` — opaque newtype for tree-sitter node kinds\n- `RelativePath` — opaque newtype for project-relative file paths\n\n## Getting Started\n\n```rust\nuse aql_mutate::{remove_node, NodeRef, RelativePath, NodeKind};\n\nlet node = NodeRef {\n    file: RelativePath::from(\"src/main.rs\"),\n    start_byte: 100, end_byte: 200,\n    kind: NodeKind::from(\"function_item\"),\n    line: 5, column: 0, end_line: 10, end_column: 1,\n};\nlet (result, detached) = remove_node(source, &node)?;\n```\n\n## npm\n\n- Package: `@aql/mutate`\n- Build: `bun run build` (wasm-pack + codegen)\n- Types: branded newtypes (`NodeKind`, `RelativePath`), generated via `ts-rs`\n\n## License\n\n[MIT](../../LICENSE)\n","readmeFilename":"README.md","_rev":"1-a77098bd216ac22667fb084fba8b7db7"}