@tempoxyz/patron 0.0.0-stage → 0.0.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/README.md CHANGED
@@ -1,3 +1,65 @@
1
- # Temporary Holding Version
1
+ # patron
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Your AI agents pay every website they read: $0.001 a page, in OUSD on Tempo, privately.
4
+
5
+ ```sh
6
+ npx @tempoxyz/patron
7
+ ```
8
+
9
+ First run signs you in with Tempo Wallet, asks for a monthly budget (default $5), buys
10
+ tokens and adds a hook to Claude Code. After that, every page Claude Code fetches pays its
11
+ site one token. Nothing stays running: the hook runs once per read and exits, and when
12
+ tokens run low it starts a one-shot purchase that exits when done.
13
+
14
+ Run `npx @tempoxyz/patron` again for status (tokens left, pages paid, budget used, rank) and to pause,
15
+ change the budget or uninstall.
16
+
17
+ ## Commands
18
+
19
+ | Command | What it does |
20
+ | :- | :- |
21
+ | `patron` | Set up, or show status and options |
22
+ | `patron status` | Tokens left, pages paid this month, budget used, leaderboard rank |
23
+ | `patron pause` / `patron resume` | Stop or restart paying |
24
+ | `patron budget <usd>` | Change the monthly budget |
25
+ | `patron tip <url> [usd]` | Tip a site, $0.10 by default |
26
+ | `patron name <handle>` | Set your public leaderboard name |
27
+ | `patron uninstall` | Remove agent hooks, optionally local data |
28
+ | `patron hook` | Run by agents after each web read |
29
+
30
+ ## Privacy
31
+
32
+ Tokens are Privacy Pass blind tokens (RFC 9578). The gateway knows your address bought a
33
+ number of tokens, but cannot link a token to you when it is spent. Each read sends one token
34
+ and the site's domain through an Oblivious HTTP relay (RFC 9458): the relay sees your IP but
35
+ not the content; the gateway sees the content but not your IP.
36
+
37
+ Local state lives in `~/.patron`: settings, tokens encrypted with AES-256-GCM under a key
38
+ file readable only by you, and this month's per-site counts, which never leave the machine.
39
+
40
+ ## Budget
41
+
42
+ The budget caps purchases: Patron never buys more than the monthly budget's worth of tokens
43
+ in a calendar month. With Tempo Wallet, the access key Patron holds also has a spending
44
+ limit equal to the budget, renewed every 30 days.
45
+
46
+ ## Agents
47
+
48
+ | Agent | Hook |
49
+ | :- | :- |
50
+ | Claude Code | Async `PostToolUse` hook for WebFetch and WebSearch in `~/.claude/settings.json` |
51
+
52
+ Codex runs web search as a hosted tool that hooks do not see, and Cursor and Amp have no
53
+ documented hook for web reads, so they are not supported yet.
54
+
55
+ ## Environment
56
+
57
+ | Variable | Default |
58
+ | :- | :- |
59
+ | `PATRON_HOME` | `~/.patron` |
60
+ | `PATRON_GATEWAY_URL` | `https://patron-gateway.tempo-dev.workers.dev` |
61
+ | `PATRON_RELAY_URL` | `https://patron-relay.tempo-dev.workers.dev` |
62
+ | `PATRON_NETWORK` | `mainnet` (or `testnet`) |
63
+ | `PATRON_PRIVATE_KEY` | unset; a testnet key instead of Tempo Wallet, for automation |
64
+ | `PATRON_BUDGET_USD` | `5`, for non-interactive setup |
65
+ | `PATRON_HOOK_COMMAND` | resolved at setup; overrides the hook command |
package/dist/bin.js ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __patronCreateRequire } from 'node:module'
3
+ const require = __patronCreateRequire(import.meta.url)
4
+
5
+ // src/bin.ts
6
+ if (process.argv[2] === "hook") {
7
+ const { runHookProcess } = await import("./chunks/hook-process-QQ34YQIA.js");
8
+ await runHookProcess().catch(() => void 0);
9
+ process.exit(0);
10
+ } else {
11
+ const { run } = await import("./chunks/-MVQH5G3L.js");
12
+ process.exitCode = await run(process.argv.slice(2));
13
+ }