Repository navigation
0.2a0
Pre-release
Pre-release
Bug fixes and hardening following a review of 0.1a0. #4
Editing tools
insertnow inserts whole lines. A line break is added where the inserted text would otherwise run into a neighbouring line, matching the content's existing\r\nor\nendings.insertrejectsinsert_linevalues that are negative, past the end of the content or not integers. Previously these silently inserted somewhere else.viewreturns an error for a malformed or impossibleview_range, such as"5","0,2"or a start past the end of the content.viewpreserves trailing whitespace, so viewed text can be pasted intostr_replace, and now includesversionin its output.- Lines are split on
\nonly. Form feeds and Unicode separators no longer count as line breaks, so line numbers match what an editor shows. - Batch edits with missing keys, wrong types or non-object items are reported as
Edit #N failederrors instead of raisingKeyErrororTypeError. - The batch
edittool rejects an emptyeditsarray. - All tools return
{"error": ...}for bad input and for anyValueErrorraised by a store, instead of raising an exception.
Render hook
- Keys returned by a
renderhook can no longer override theid,versionorstatusfields. - A
renderhook that raises after a batch edit no longer makes the saved edit look like a failure. The result reports the edits as saved and includes arender_errorkey.
Stores
- An edit that leaves the content unchanged no longer creates a new version in
SqliteVersionedStoreor rewrites the file inDiskStore. create()raisesFileExistsErrorfor a duplicate ref in both stores.SqliteVersionedStorepreviously raisedsqlite3.IntegrityError.SqliteVersionedStore.create()writes the object and its first version in a single transaction.SqliteVersionedStore.delete()works whenPRAGMA foreign_keysis enabled.DiskStorepreserves line endings and file permission bits when editing a file. Previously\r\nwas rewritten as\nand the mode was reset.DiskStoreresolves symlinks before checking that a ref stays inside its root directory.DiskStorerejects refs ending in.meta.json, so metadata sidecar files can no longer be read or edited as content.DiskStoreraisesNotFoundfor directories andValueErrorfor empty refs and files that are not UTF-8 text.DiskStoreremoves its temporary file if a write fails.
Everything else
- Now requires Python 3.11 or higher, and is tested against Python 3.15.
- Dropped the
typing_extensionsdependency. EditToolset.tools()is now tested against the realAgentToolfromdatasette-agent.- The README documents tool output, error handling and backend behaviour.