release: 0.4.0 — breakdown and expiring_soon - #11
Merged
Conversation
Mirrors two optional UsageBlock fields the platform already emits on the wire. Both are additive; no existing export changes and a 0.3.0 consumer keeps working. Releasing them is what makes them usable: a client cannot read a field its own types do not declare, and AgentRAG emits both today, so until now every consumer had to widen the type by hand. `breakdown` itemizes a composite op's extra charge legs — the top-level price_usd stays the primary verb's price, so a request's total is price_usd plus the sum of breakdown[].price_usd. `expiring_soon` is present as literal true only inside a collection's final 24h, so presence is the only correct test. Also brings package-lock.json's version field along: it still read 0.2.0, a drift introduced at the 0.3.0 release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cuts
@agentx402-ai/core0.4.0. Publishing happens via the GitHub Release → OIDC trusted-publishing path once this lands andv0.4.0is tagged.What ships
Two optional
UsageBlockfields the platform already emits on the wire, added in #10 and unreleased until now. Both additive — no existing export changes, and a 0.3.0 consumer keeps working against a service that sends them.Releasing them is what makes them usable: a client cannot read a field its own types do not declare. AgentRAG emits both today, so until this lands every consumer has to widen the type by hand.
breakdown— composite-op itemization for responses whose charge has more than one leg (an AgentRAGaskthat also ingested pages). The top-levelprice_usdremains the primary verb's price on the taken path, so a request's total isprice_usdplus the sum ofbreakdown[].price_usd— these are not alternatives, and adding them is not double-counting. Absent on single-leg ops rather than an empty array, sobreakdown?.lengthis never0.expiring_soon— literaltruewhen the collection named by the response is inside the final 24 hours of its lifetime, omitted otherwise. Neverfalse, so presence is the only correct test.Also fixed
package-lock.jsoncarried0.2.0whilepackage.jsonwas at0.3.0— a drift introduced at the 0.3.0 release and unnoticed since. Both now move together.Verification
npm ci --ignore-scriptsexit 0 (the publish workflow runs exactly this, so a lock/package mismatch would have failed the release),biome ciclean across 19 files,npm run buildexit 0, 147 tests passing.The publish workflow's own guard — tag must equal
package.jsonversion — simulated locally: tagv0.4.0vsv0.4.0, match.