taximeter 0.1.2 → 0.2.1
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/CHANGELOG.md +14 -0
- package/README.md +33 -6
- package/SECURITY.md +4 -1
- package/dist/{chunk-DWBUWM3G.js → chunk-DF4YCPFO.js} +411 -46
- package/dist/cli/index.js +1 -1
- package/dist/index.d.ts +27 -9
- package/dist/index.js +1 -1
- package/dist/ui/assets/{index-Bts-0doc.js → index-AWIe7JNX.js} +9 -9
- package/dist/ui/index.html +1 -1
- package/docs/SDK.md +26 -2
- package/package.json +1 -1
- package/taximeter.config.example.json +2 -1
package/dist/ui/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="color-scheme" content="light dark" />
|
|
7
7
|
<meta name="description" content="A taximeter for your AI agents. Your local payment ledger." />
|
|
8
8
|
<title>Taximeter — Local ledger</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-AWIe7JNX.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-De4zKRDL.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
package/docs/SDK.md
CHANGED
|
@@ -8,7 +8,7 @@ Install the registry release with `npm install taximeter`. From a source checkou
|
|
|
8
8
|
run `npm ci` and `npm run build`, then save the examples at the repository root.
|
|
9
9
|
Their `import "taximeter"` statements resolve the package's own built exports.
|
|
10
10
|
To try a local build in another project, run `npm pack`, copy the resulting
|
|
11
|
-
tarball there, and use `npm install ./taximeter-0.1.
|
|
11
|
+
tarball there, and use `npm install ./taximeter-0.2.1.tgz`.
|
|
12
12
|
|
|
13
13
|
## Try it locally
|
|
14
14
|
|
|
@@ -132,11 +132,32 @@ environment, with explicit SDK options taking precedence. See the
|
|
|
132
132
|
files or environment settings. Keep budgets consistent across writers sharing
|
|
133
133
|
the same database.
|
|
134
134
|
|
|
135
|
+
`config.policy.unknownAsset` defaults to `"deny"`. Only network and contract pairs
|
|
136
|
+
in Taximeter's offline asset registry are known; payment-supplied symbols and
|
|
137
|
+
decimal metadata do not establish trust. To use custom-token budgets, explicitly
|
|
138
|
+
set `config.policy.unknownAsset` to `"allow"` and configure the matching contract
|
|
139
|
+
and network budget. This permits parsed unknown assets; the default USDC budgets
|
|
140
|
+
do not cap them.
|
|
141
|
+
|
|
135
142
|
The wrapper closes only a ledger it created. For an injected ledger, close all
|
|
136
143
|
wrappers after their requests finish, then let the owner close the ledger.
|
|
137
144
|
Reusing a closed wrapper passes requests directly to the original transport
|
|
138
145
|
without metering. Do not use a closed wrapper for later payments.
|
|
139
146
|
|
|
147
|
+
Version 0.2.x upgrades existing ledgers to schema version 2 when opening them.
|
|
148
|
+
Source events and outcomes remain unchanged; the added budget index is rebuilt
|
|
149
|
+
from those records. Upgrade all writers together. Older 0.1.x clients cannot
|
|
150
|
+
reopen a migrated database. `ledger.rebuildCache()` repairs the derived index
|
|
151
|
+
from the append-only log inside a transaction.
|
|
152
|
+
|
|
153
|
+
From 0.2.1, opening an on-disk schema-1 ledger prints `Migrating ledger…` to stderr
|
|
154
|
+
and saves a standalone, WAL-aware backup at
|
|
155
|
+
`<database>.backup-v1-<unique suffix>/ledger.db` before upgrading. The saved path
|
|
156
|
+
is printed before the synchronous backfill begins. A backup failure aborts the
|
|
157
|
+
upgrade; a backfill failure rolls it back and retains the completed backup.
|
|
158
|
+
Fresh and schema-2 databases skip this step. See the [rollback instructions](../README.md#configuration)
|
|
159
|
+
before using a backup with an older client.
|
|
160
|
+
|
|
140
161
|
## Fetch behavior and limits
|
|
141
162
|
|
|
142
163
|
- Use a Node fetch implementation that accepts standard `string`, `URL`, or
|
|
@@ -159,6 +180,9 @@ without metering. Do not use a closed wrapper for later payments.
|
|
|
159
180
|
returns a 402 JSON response with `error: "blocked_by_taximeter"`, `reason`,
|
|
160
181
|
`budget`, `spent`, and `remaining`, and records a blocked event. The enclosing
|
|
161
182
|
payment client can apply its own response handling or throw its own error.
|
|
183
|
+
- A parsed unknown asset is denied by default with `reason: "unknown_asset"`,
|
|
184
|
+
`budget: null`, `spent: "0"`, and `remaining: null`. Unsupported or unparseable
|
|
185
|
+
payment formats still pass through with a diagnostic.
|
|
162
186
|
- If the transport throws after forwarding an authorization, the original
|
|
163
187
|
error is rethrown and the authorization remains reserved with unknown
|
|
164
188
|
settlement. Missing settlement evidence has the same conservative treatment.
|
|
@@ -171,7 +195,7 @@ without metering. Do not use a closed wrapper for later payments.
|
|
|
171
195
|
The initial adapter meters exact EVM EIP-3009 payments: legacy v1 on Base and
|
|
172
196
|
Base Sepolia, and v2 with EVM CAIP-2 networks. Permit2, ERC-7710, other schemes,
|
|
173
197
|
and other rails remain unmetered. Known Base/Base Sepolia USDC uses six decimal
|
|
174
|
-
places; unknown tokens remain exact atomic units. Budgets and totals are
|
|
198
|
+
places; explicitly allowed unknown tokens remain exact atomic units. Budgets and totals are
|
|
175
199
|
separate for every network and asset. See
|
|
176
200
|
[protocol notes](https://github.com/Ding808/taximeter/blob/main/SPEC-NOTES.md) for
|
|
177
201
|
wire formats, challenge correlation, idempotency, and settlement rules.
|
package/package.json
CHANGED