@tabai/sdk 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -79,9 +79,12 @@ The one failure worth handling by name is an agent with no headroom:
|
|
|
79
79
|
|
|
80
80
|
Both figures are present only on `LIMIT_EXCEEDED`, and they are there so the answer is actionable. **The correct response is to settle, not to retry**: retrying a call that exceeded a credit limit produces the same refusal at the same cost. A Settlement restores headroom in the block it lands.
|
|
81
81
|
|
|
82
|
-
### A new agent
|
|
82
|
+
### A new agent starts at the baseline, and earns the rest
|
|
83
83
|
|
|
84
|
-
A credit limit is capped by the Bonds of
|
|
84
|
+
A credit limit is capped by the Bonds of the Services the agent deals with, and a Service the agent has authorised counts as one before any Settlement.
|
|
85
|
+
So a brand-new agent that authorises a bonded Service starts at `min(baseline, 95% of that Service's free Bond)`: the Service's own decision to carry a stranger, backed by its own stake.
|
|
86
|
+
Anything above the baseline is earned, by settled history with at least three Curated, bonded Services.
|
|
87
|
+
An agent that has authorised nobody has no counterparties and no limit.
|
|
85
88
|
|
|
86
89
|
---
|
|
87
90
|
|
|
@@ -123,7 +126,7 @@ Add --broadcast to send it. This spends real funds.
|
|
|
123
126
|
|
|
124
127
|
## Configuration
|
|
125
128
|
|
|
126
|
-
|
|
129
|
+
Two things are yours to name, and both live in a config file rather than the environment, because neither is a secret: the agent whose Open Tab a call meters to, and any Service beyond the hosted demo one. `doctor` warns when the agent is missing.
|
|
127
130
|
|
|
128
131
|
Put a `tab.config.mjs` beside your project, or in any parent directory:
|
|
129
132
|
|
|
@@ -184,7 +187,7 @@ The key is read at the moment a Settlement is built, and never from this file. `
|
|
|
184
187
|
|
|
185
188
|
| Variable | Needed for |
|
|
186
189
|
| --- | --- |
|
|
187
|
-
| `MONAD_RPC_URL` |
|
|
190
|
+
| `MONAD_RPC_URL` | `doctor`'s chain checks and a Settlement signer. The MCP tools read through the registry API |
|
|
188
191
|
| `MONAD_CHAIN_ID` | `143` for Mainnet, `10143` for Testnet. Defaults to Testnet |
|
|
189
192
|
| `TAB_BOOK_ADDRESS`, `TAB_SETTLEMENT_ADDRESS`, `SERVICE_REGISTRY_ADDRESS`, `BOND_ADDRESS` | resolving credit, Services and Bond |
|
|
190
193
|
| `NEXT_PUBLIC_REGISTRY_API_URL` | the Service directory and an agent's history. Defaults to the project's hosted registry for the chosen network |
|
|
@@ -308,7 +311,7 @@ app.all("/hub/nansen/*", (c) => proxy(c.req.raw));
|
|
|
308
311
|
|
|
309
312
|
The price is known only after the upstream's `402`, so `pricing` is a book the forward writes and `priceOf` reads, keyed by the request. **The amount rides in the unit count, not the unit price.** `TabBook.recordDelivery` refuses any unit price the applied price list does not hold, and a fronted price varies per call, so the Service publishes a small fixed unit for the fronted tool, one base unit by default, and a call consumes as many units as it cost. Without that published price every fronted delivery reverts `UnknownTool`, the plugin delivers anyway because a broken price list is the Service's fault, and the Service pays the upstream for work it bills nobody. `unitBaseUnits` sets a coarser unit, rounded up so the Service is never left short. `preflight` runs between the upstream's `402` and the operator's signature, with the quoted amount in hand: a Service simulates the delivery against `TabBook` there and refuses an Agent with no headroom before its own funds move. Only `exact` with EIP-3009 is signed, on the Service's own chain and Asset; an upstream that accepts nothing the Service can pay in is answered with why, and nothing is metered.
|
|
310
313
|
|
|
311
|
-
`fetchHubManifest` reads Monad's API Hub, which fronts
|
|
314
|
+
`fetchHubManifest` reads Monad's API Hub, which fronts dozens of pay-per-request providers behind one x402 endpoint, and `tab_discover` lists a fronted provider's endpoints under the Service as the tools they are, with the Hub's per-call price in base units:
|
|
312
315
|
|
|
313
316
|
```js
|
|
314
317
|
services: [{ serviceId, endpoint, hub: { provider: "defillama", prefix: "apihub" } }]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tabai/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Post-paid billing for autonomous agents on Monad. MCP server, CLI and TypeScript SDK: call a priced tool now, settle in USDC later, and let TabSettlement apply the payment to the tab in the same transaction.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"monad",
|