Releases: ashutosh887/stub
Release list
trystub 1.2.0
Added
- Operator actions on
StubClient.stub.sweep()reclaims reservations left held past the
server'sRESERVATION_TTL_SECONDS;stub.provisionShards(accountId, shards?)splits an
account's current balance across shard rows for throughput. Both are operator-only: construct
the client with the server'sADMIN_TOKENasapiKey, not an agent's scoped key. - Stub server: reservation TTL sweep. A held reservation nobody ever settles or releases
(a crashed agent) is reclaimed automatically pastRESERVATION_TTL_SECONDS(default 900s), via
npm run sweepor the new admin-gatedPOST /api/sweep. Idempotent: contends on the reservation
row under OCC exactly like a normalrelease(), so it can never double-refund a hold another
process is settling.
Fixed
- Stub server: sharded accounts now enforce the same policy as everyone else. A sharded budget
account previously skipped the frozen check, the policy engine, the velocity breaker, and
ancestor hierarchy caps entirely — only the shard-level cap was enforced. Fixed to match the
plain spend path exactly;/api/spendnow dispatches to the sharded path automatically for any
account provisioned withprovisionShards.
trystub 1.1.0
LLM token metering
New trystub/llm entry point. Hold an estimate, run the call once, settle the real token cost. Reads OpenAI and Anthropic usage fields. Ships no price table on purpose, since a stale price inside a dependency quietly mis-bills you.
Retries that cannot double-charge
Per-call timeout, bounded retries on network errors, 429 and 5xx, and a generated idempotency key on every spend and reserve. A request retried after the server already committed resolves to the same single ledger entry.
Dual ESM and CommonJS
require("trystub") works now. Previously ESM only.
Runs on local Postgres
Set DATABASE_URL and Stub runs without an AWS account. Transactions run at SERIALIZABLE, so plain Postgres raises the same 40001 serialization failures as Aurora DSQL.
Sharded balances
core/sharded.ts splits a hot balance across shard rows for 1.2 to 2.8x throughput. No shard can go below zero, so the overspend invariant still holds. Opt-in via shardedSpend. npm run bench measures the contention ceiling.
npm i trystub
trystub 1.0.2
SDK discoverability release (no API changes).
- Expanded npm keywords (8 to 19) for better search ranking.
- Added bugs URL and publishConfig.access.
- README: status badges and a link to the build story.
Published on npm with provenance: https://www.npmjs.com/package/trystub/v/1.0.2
trystub 1.0.1
SDK documentation release.
- README now leads with the tagline and clearer usage.
trystub 1.0.0
First public release of the trystub SDK — a drop-in budget gate for autonomous AI agents.
npm install trystubStubClient:guard/spend/reserve/settle/releasepayThroughStub(x402): reserve → pay once → settle, exactly-once around an irreversible payment- Dependency-free; works anywhere
fetchexists