From 2d3e50458ac04af571d461f27810d172015e196b Mon Sep 17 00:00:00 2001 From: AgentKV Date: Sun, 2 Aug 2026 12:27:52 +0000 Subject: [PATCH] =?UTF-8?q?release:=200.4.0=20=E2=80=94=20breakdown=20and?= =?UTF-8?q?=20expiring=5Fsoon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- CHANGELOG.md | 25 +++++++++++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aabad1c..aefaa6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,31 @@ All notable changes to `@agentx402-ai/core` are documented here. The format foll [Keep a Changelog](https://keepachangelog.com/), and the project adheres to [Semantic Versioning](https://semver.org/). +## [0.4.0] — 2026-08-02 + +Mirrors two `UsageBlock` fields the platform already emits. Both are optional and additive — no +existing export changes, and a client on 0.3.0 keeps working against a service that sends them. +Releasing them matters because a client cannot read a field its own types do not declare: AgentRAG +emits both today, so without this release every consumer has to widen the type by hand. + +### Added + +- **`breakdown`** — composite-op itemization, for responses whose charge has more than one leg + (an AgentRAG `ask` that also ingested pages). The top-level `price_usd` remains the **primary** + verb's price on the taken path, so a request's total is `price_usd` plus the sum of + `breakdown[].price_usd` — the two are not alternatives and adding them is not double-counting. + Absent on single-leg ops rather than an empty array, so `breakdown?.length` is never `0`. + +- **`expiring_soon`** — present as literal `true` when the collection named by the response is + inside the final 24 hours of its lifetime, omitted otherwise. Never `false`, so the only correct + test is presence. It is the caller's cue to extend the collection (or, for AgentRAG, to run a + matching ask, which slides the expiry) before it is lost. + +### Fixed + +- `package-lock.json` carried `0.2.0` while `package.json` was at `0.3.0` — a drift introduced at + the 0.3.0 release. Both now move together. + ## [0.3.0] — 2026-07-31 Shared money-safety plumbing. Both service SDKs carried their own copy of the spend bound and diff --git a/package-lock.json b/package-lock.json index 673f13f..7cdc304 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@agentx402-ai/core", - "version": "0.2.0", + "version": "0.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@agentx402-ai/core", - "version": "0.2.0", + "version": "0.4.0", "license": "MIT", "dependencies": { "@x402/core": "^2.16.0", diff --git a/package.json b/package.json index 5575e2d..098dde8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@agentx402-ai/core", - "version": "0.3.0", + "version": "0.4.0", "description": "Shared auth/pay/usage/error/retry plumbing for agentx402 service SDKs (x402 + EIP-712 + EIP-3009 over viem).", "license": "MIT", "author": "The AgentKV Authors ",