Repository navigation
v0.9.0
Everyday edits cost an agent a fraction of the tokens they did: adding a block, fixing a sentence, or reading an entry with a large synced field.
Added
Find and replace in long text. entries_update, terms_update, and globals_update take {"find": "...", "replace": "..."} for a Bard, Markdown, text, or textarea field, at the top level or inside a set addressed by id:
{"article": {"find": "opens at nine", "replace": "opens at eight"}}Only that piece of the stored text changes:
- Cost: fixing a sentence sends about 60 tokens instead of the whole article.
- Exactly once:
findmust match the stored text exactly once, and matches that cross formatting count too. - Formatting: in Bard, the match must sit inside one formatting run, and the replacement keeps that run's marks, so a link or bold is never lost.
- Errors: a miss, several matches, or a match across formatting is an error that quotes the nearby text, so the agent can fix
findwithout reading the field again. - Concurrent edits: if someone changed the text in the meantime, it no longer matches, so nothing is overwritten.
Changed
Adding, removing, and reordering blocks no longer costs the whole page. A list sent for a Replicator or Grid field now merges by id:
- An item with a stored id merges into that set, so
{"id": "wKJQXf2s"}keeps it as it is. - An item in another type replaces its set, and any other item is a new set.
- The sets left out are removed.
Adding a block is the list of ids with the new block where it goes. entries_update returns the new set's id under added, so the next edit can address it without reading the page again. A bare id the field doesn't store is refused, so a block someone removed in the meantime never comes back empty.
entries_get returns the staged working copy by default, as the Control Panel's edit form does. That's the version entries_update builds on and entries_publish promotes. working_copy: false returns the live entry, and source says which one you got on every revision-enabled entry.
Any large value comes back as a preview. Bard, Markdown, and page builders were already previewed or indexed in entries_get and terms_get. Now any other value over 4 KB comes back as {__preview, truncated, note} too, unless the agent asks for it with fields:
- an assoc array as its key count and first keys
- a list as its item count
- a string as its first 300 characters
That includes keys the blueprint no longer defines, which fields can now name. A Grid stays inline whatever its size.
Write results no longer echo what was just written. navigations_update returns the result, the edit URL, and the ids of new branches under added, instead of the whole tree. globals_update and terms_update no longer return the saved data.
Asset summaries drop id, basename, and folder, which repeat the path and the container you passed. A page of 25 assets is about 38% smaller.
The update tools are no longer marked idempotent. Retrying a call that inserts text or adds a set applies it twice.
Fixed
Writes take back whatever a field already stores, as the Control Panel does.
- A key is unknown only when the blueprint doesn't define it and the stored value doesn't hold it. That holds at every level: page builder sets, Grid rows, Bard sets, and Groups.
- A page builder sent back with stored keys its blueprint no longer defines, sets of removed types, or asset paths whose file is gone is no longer refused.
- A set's stale key can be changed or cleared by id.
- A new key that's neither defined nor stored is still refused, so typos don't become content.
Every unknown key is reported in one error, instead of one set per attempt.
Upgrading
0.9.0 changes some behavior agents and clients may rely on:
- List items merge. A list item with a stored id merges into that set instead of replacing it, so a key left out of it stays. Send
nullto clear a key. - Working copy by default.
entries_getreturns the staged working copy when there is one. Passworking_copy: falsefor the live entry. - Large values are previews. A large
array,yaml,code,textarea, or custom fieldtype value comes back as a preview. Read it in full withfields. - Smaller write results.
navigations_update,globals_update, andterms_updateno longer return the saved tree or data.assets_list,assets_get, andassets_uploadno longer returnid,basename, orfolder; the asset tools take the container andpath.
Token counts in the chart were measured over HTTP with the cl100k tokenizer, on pages with 8 to 16 blocks.
Full changelog: v0.8.0...v0.9.0