Google will delete OAuth clients falsely flagged as unused
4 points by panstromek 50m ago 1 comments
Ask HN: How do I start my own cybersecurity related company?
2 points by babuloseo 9h ago 4 comments
Ask HN: Would you be interested in OpenRouter for MCPs?
3 points by subramanya1997 1d ago 1 comments
Better way to have LLMs modify existing code using ASTs
1 mmiscool 1 5/26/2025, 11:06:46 AM npmjs.com โ
To solve this problem I implemented the snipSplicer npm package.
This library allows you to pass the content of an original code file with a properly formatted snippet and return the file modified applying the code from the snippet.
It works by parsing the original code and the snippet in to an AST and then uses a deterministic process to surgically replace existing functions or class methods with the ones in the snippet.
It also handles cases where the function or method dose not currently exist by either appending the function to the code file or inserting any new methods in to the proper class if it exists.
This approach is extremely reliable and consumes significantly fewer output tokens.
Here is a slide deck that discusses this approach and how it was implemented. https://docs.google.com/presentation/d/1xdX09ELgW7lMU1E9KWIr...
I am very interested in feedback and the possibility of supporting more languages in the future. Every thing is open source and I am happy to accept pull requests from the community to support more languages.
https://www.npmjs.com/package/snipsplicer https://github.com/mmiscool/snipsplicer