taximeter 0.1.0 → 0.1.2
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 +12 -0
- package/README.md +11 -10
- package/SECURITY.md +1 -1
- package/dist/{chunk-I7YXGTRZ.js → chunk-DWBUWM3G.js} +13 -3
- package/dist/cli/index.js +7 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -5
- package/dist/ui/assets/{index-DOE5bD9P.js → index-Bts-0doc.js} +10 -10
- package/dist/ui/index.html +1 -1
- package/docs/SDK.md +7 -8
- package/package.json +3 -8
- package/CODE_OF_CONDUCT.md +0 -31
- package/CONTRIBUTING.md +0 -141
- package/DECISIONS.md +0 -54
- package/SPEC-NOTES.md +0 -369
- package/SPEC.md +0 -474
- package/VERIFICATION.md +0 -943
- package/docs/RECORDING.md +0 -75
- package/docs/demo.mjs +0 -145
- package/docs/demo.tape +0 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Taximeter
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Exclude development specifications, verification transcripts, design decisions, contribution files, and recording sources from the npm package. Keep the CLI, SDK, dashboard, usage documentation, demo image, license, security guidance, changelog, and example configuration. Link to repository-only documentation from packaged guides.
|
|
8
|
+
|
|
9
|
+
## 0.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Publish the complete local x402 spend meter after the npm ownership bootstrap. Include the proxy, fetch SDK, exact ledger, budget enforcement, CLI exports, prebuilt dashboard, and tested documentation. Improve release authentication diagnostics and keep package verification aligned with the release version.
|
|
14
|
+
|
|
3
15
|
## 0.1.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -7,9 +7,8 @@ npx taximeter start
|
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
Taximeter records supported agent payments, checks budgets before forwarding them,
|
|
10
|
-
and keeps an exact local ledger.
|
|
11
|
-
|
|
12
|
-
source quickstart below works today. Requires Node 20 or newer.
|
|
10
|
+
and keeps an exact local ledger. Install from npm with the command above, or build
|
|
11
|
+
from source with the quickstart below. Requires Node 20 or newer.
|
|
13
12
|
|
|
14
13
|
## A 20-second demo
|
|
15
14
|
|
|
@@ -17,7 +16,8 @@ source quickstart below works today. Requires Node 20 or newer.
|
|
|
17
16
|
|
|
18
17
|
This local recording shows 20 payments passing and payment 21 being blocked at
|
|
19
18
|
an exact total of 140 atomic units. It uses synthetic x402 envelopes and never
|
|
20
|
-
moves money. [Record the demo](docs/RECORDING.md)
|
|
19
|
+
moves money. [Record the demo](https://github.com/Ding808/taximeter/blob/main/docs/RECORDING.md)
|
|
20
|
+
with the simulation in the source checkout.
|
|
21
21
|
|
|
22
22
|
## Why
|
|
23
23
|
|
|
@@ -51,7 +51,7 @@ Open a terminal in this source checkout, with Node 20+ and npm installed.
|
|
|
51
51
|
You should now see:
|
|
52
52
|
|
|
53
53
|
```text
|
|
54
|
-
Taximeter 0.1.
|
|
54
|
+
Taximeter 0.1.2
|
|
55
55
|
Proxy: http://127.0.0.1:8402
|
|
56
56
|
Dashboard: http://127.0.0.1:8403
|
|
57
57
|
Point an HTTP-proxy-aware agent at http://127.0.0.1:8402.
|
|
@@ -61,7 +61,7 @@ HTTPS CONNECT is unmetered; use --upstream or withMeter for HTTPS payments.
|
|
|
61
61
|
Open [the local dashboard](http://127.0.0.1:8403). It explains how to connect an
|
|
62
62
|
agent before the first payment arrives. Stop the process with Ctrl+C.
|
|
63
63
|
The prebuilt npm package starts directly; installing it does not build the frontend.
|
|
64
|
-
Dependency download time depends on the connection.
|
|
64
|
+
Dependency download time depends on the connection.
|
|
65
65
|
|
|
66
66
|
Choose the connection mode your agent supports:
|
|
67
67
|
|
|
@@ -127,7 +127,8 @@ Repeated EIP-3009 authorizations count once across retries, using network, contr
|
|
|
127
127
|
payer, nonce, amount, recipient, and validity bounds. Conflicting authorization
|
|
128
128
|
details receive separate reservations. Each unresolved forwarding attempt keeps
|
|
129
129
|
capacity reserved; an old unconfirmed retry must reacquire capacity in the current
|
|
130
|
-
window. [Protocol notes](SPEC-NOTES.md)
|
|
130
|
+
window. [Protocol notes](https://github.com/Ding808/taximeter/blob/main/SPEC-NOTES.md)
|
|
131
|
+
explain these rules and the supported subset.
|
|
131
132
|
|
|
132
133
|
CSV `amount` is the counted contribution, including zero for blocked/known failed
|
|
133
134
|
rows. `authorizedAmount` retains the original amount. Sum `amount` with BigInt
|
|
@@ -193,7 +194,7 @@ Host/recipient denials have `budget: null` and `remaining: null`.
|
|
|
193
194
|
- A wallet or facilitator: it never holds keys or funds, signs, verifies, or settles payments.
|
|
194
195
|
- A cloud service: no accounts, telemetry, analytics, or external font requests.
|
|
195
196
|
- A multi-user service: no authentication, tenancy, or RBAC. Both listeners bind to loopback.
|
|
196
|
-
- A universal payment parser: Permit2, ERC-7710, non-EVM rails, Stripe MPP, and cards are
|
|
197
|
+
- A universal payment parser: Permit2, ERC-7710, non-EVM rails, Stripe MPP, and cards are unsupported.
|
|
197
198
|
- A security boundary against a bypassing agent: unsupported traffic passes through with diagnostics. CONNECT and post-upgrade frames are unmetered. Storage failure also passes traffic and prints a warning, so budget guarantees require working storage.
|
|
198
199
|
|
|
199
200
|
Raw payment authorizations stay in the local audit ledger and JSON export. Treat
|
|
@@ -202,6 +203,6 @@ to report a problem.
|
|
|
202
203
|
|
|
203
204
|
## Contributing / license
|
|
204
205
|
|
|
205
|
-
|
|
206
|
-
|
|
206
|
+
See the [contribution guide](https://github.com/Ding808/taximeter/blob/main/CONTRIBUTING.md)
|
|
207
|
+
for development instructions, design documents, and verification evidence.
|
|
207
208
|
Licensed under [MIT](LICENSE).
|
package/SECURITY.md
CHANGED
|
@@ -31,7 +31,7 @@ against a hostile agent or another process running as the same user.
|
|
|
31
31
|
|
|
32
32
|
- Unsupported or malformed payment forms pass through with a diagnostic.
|
|
33
33
|
Supported parsing is narrower than the full x402 protocol; see
|
|
34
|
-
[
|
|
34
|
+
[protocol notes](https://github.com/Ding808/taximeter/blob/main/SPEC-NOTES.md).
|
|
35
35
|
- HTTPS CONNECT tunnels encrypted bytes without metering their payments.
|
|
36
36
|
Taximeter does not install a certificate authority or intercept TLS.
|
|
37
37
|
- The SDK must wrap the transport inside the payment wrapper. Redirects and
|
|
@@ -818,10 +818,10 @@ var Ledger = class {
|
|
|
818
818
|
"SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'schema_version'"
|
|
819
819
|
).get();
|
|
820
820
|
if (!table) this.database.exec(__default);
|
|
821
|
-
const
|
|
821
|
+
const version3 = z7.object({ version: z7.literal(1) }).parse(
|
|
822
822
|
this.database.prepare("SELECT MAX(version) AS version FROM schema_version").get()
|
|
823
823
|
);
|
|
824
|
-
return
|
|
824
|
+
return version3.version;
|
|
825
825
|
}).immediate();
|
|
826
826
|
} catch (error) {
|
|
827
827
|
this.database.close();
|
|
@@ -1136,6 +1136,15 @@ async function closeProxy(server) {
|
|
|
1136
1136
|
);
|
|
1137
1137
|
}
|
|
1138
1138
|
|
|
1139
|
+
// src/version.ts
|
|
1140
|
+
import { z as z9 } from "zod";
|
|
1141
|
+
|
|
1142
|
+
// package.json
|
|
1143
|
+
var version = "0.1.2";
|
|
1144
|
+
|
|
1145
|
+
// src/version.ts
|
|
1146
|
+
var version2 = z9.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/).parse(version);
|
|
1147
|
+
|
|
1139
1148
|
export {
|
|
1140
1149
|
integerStringSchema,
|
|
1141
1150
|
httpUrlSchema,
|
|
@@ -1163,5 +1172,6 @@ export {
|
|
|
1163
1172
|
toInvoice,
|
|
1164
1173
|
Ledger,
|
|
1165
1174
|
createProxy,
|
|
1166
|
-
closeProxy
|
|
1175
|
+
closeProxy,
|
|
1176
|
+
version2 as version
|
|
1167
1177
|
};
|
package/dist/cli/index.js
CHANGED
|
@@ -20,8 +20,9 @@ import {
|
|
|
20
20
|
toInvoice,
|
|
21
21
|
toJson,
|
|
22
22
|
totalSchema,
|
|
23
|
-
totals
|
|
24
|
-
|
|
23
|
+
totals,
|
|
24
|
+
version
|
|
25
|
+
} from "../chunk-DWBUWM3G.js";
|
|
25
26
|
|
|
26
27
|
// src/cli/index.ts
|
|
27
28
|
import { CommanderError } from "commander";
|
|
@@ -48,7 +49,7 @@ import { z } from "zod";
|
|
|
48
49
|
var dashboardEventSchema = paymentEventSchema.omit({ raw: true });
|
|
49
50
|
var groupSchema = totalSchema.extend({ key: z.string().nullable() });
|
|
50
51
|
var dashboardStateSchema = z.object({
|
|
51
|
-
version: z.literal(
|
|
52
|
+
version: z.literal(version),
|
|
52
53
|
generatedAt: z.iso.datetime(),
|
|
53
54
|
totalEvents: z.number().int(),
|
|
54
55
|
blockedEvents: z.number().int(),
|
|
@@ -121,7 +122,7 @@ function dashboardState(ledger, config, now = Date.now()) {
|
|
|
121
122
|
return { ts: new Date(start).toISOString(), totals: totals(rows) };
|
|
122
123
|
});
|
|
123
124
|
return dashboardStateSchema.parse({
|
|
124
|
-
version
|
|
125
|
+
version,
|
|
125
126
|
generatedAt: new Date(now).toISOString(),
|
|
126
127
|
totalEvents: events.length,
|
|
127
128
|
blockedEvents: events.filter((event) => event.status === "blocked").length,
|
|
@@ -358,7 +359,7 @@ function configFrom(flags) {
|
|
|
358
359
|
}
|
|
359
360
|
async function runCli(input, output = (text) => process.stdout.write(text)) {
|
|
360
361
|
const argv = z4.array(z4.string()).parse(input);
|
|
361
|
-
const program = new Command().name("taximeter").description("A taximeter for your AI agents.").version(
|
|
362
|
+
const program = new Command().name("taximeter").description("A taximeter for your AI agents.").version(version).exitOverride();
|
|
362
363
|
program.configureOutput({ writeOut: output, writeErr: (text) => process.stderr.write(text) });
|
|
363
364
|
options(program.command("start").description("Start the local proxy and dashboard")).option("--proxy-port <port>", "Proxy port (0 selects an available port)").option("--dashboard-port <port>", "Dashboard port").option("--upstream <url>", "Forward origin-form requests to this HTTP(S) upstream").action(async (raw) => {
|
|
364
365
|
const flags = startFlags.parse(raw);
|
|
@@ -375,7 +376,7 @@ async function runCli(input, output = (text) => process.stdout.write(text)) {
|
|
|
375
376
|
);
|
|
376
377
|
const running = await startServices(config);
|
|
377
378
|
output(
|
|
378
|
-
`Taximeter
|
|
379
|
+
`Taximeter ${version}
|
|
379
380
|
Proxy: http://127.0.0.1:${running.proxyPort}
|
|
380
381
|
Dashboard: http://127.0.0.1:${running.dashboardPort}
|
|
381
382
|
Point an HTTP-proxy-aware agent at http://127.0.0.1:${running.proxyPort}.
|
package/dist/index.d.ts
CHANGED
|
@@ -399,6 +399,6 @@ type MeteredFetch = typeof globalThis.fetch & {
|
|
|
399
399
|
/** Place inside the payment wrapper: wrapFetchWithPayment(withMeter(fetch, opts), client). */
|
|
400
400
|
declare function withMeter(fetchImpl: typeof globalThis.fetch, input?: MeterOptions): MeteredFetch;
|
|
401
401
|
|
|
402
|
-
declare const version
|
|
402
|
+
declare const version: string;
|
|
403
403
|
|
|
404
404
|
export { Ledger, Meter, type MeterOptions, type MeteredFetch, type PaymentEvent, type Rail, type TaximeterConfig, X402Rail, closeProxy, createProxy, deriveEvents, evaluate, formatAmount, loadConfig, parseConfig, paymentEventSchema, toCsv, toInvoice, toJson, totals, version, withMeter };
|
package/dist/index.js
CHANGED
|
@@ -16,8 +16,9 @@ import {
|
|
|
16
16
|
toCsv,
|
|
17
17
|
toInvoice,
|
|
18
18
|
toJson,
|
|
19
|
-
totals
|
|
20
|
-
|
|
19
|
+
totals,
|
|
20
|
+
version
|
|
21
|
+
} from "./chunk-DWBUWM3G.js";
|
|
21
22
|
|
|
22
23
|
// src/sdk/index.ts
|
|
23
24
|
import { z } from "zod";
|
|
@@ -158,9 +159,6 @@ function withMeter(fetchImpl, input = {}) {
|
|
|
158
159
|
}
|
|
159
160
|
});
|
|
160
161
|
}
|
|
161
|
-
|
|
162
|
-
// src/index.ts
|
|
163
|
-
var version = "0.1.0";
|
|
164
162
|
export {
|
|
165
163
|
Ledger,
|
|
166
164
|
Meter,
|