tenjin-cli 0.1.0-alpha.26 → 0.1.0-alpha.27
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 +3 -3
- package/dist/{chunk-ALJRB7NG.js → chunk-2TYQD22Q.js} +8 -6
- package/dist/{chunk-ALJRB7NG.js.map → chunk-2TYQD22Q.js.map} +1 -1
- package/dist/{chunk-W36HL4TB.js → chunk-4L7KMA7P.js} +4 -4
- package/dist/{chunk-UDWGT4FX.js → chunk-5FGO6TYT.js} +13 -5
- package/dist/chunk-5FGO6TYT.js.map +1 -0
- package/dist/{chunk-5HS54CLI.js → chunk-5NEHH2E5.js} +3 -3
- package/dist/{chunk-Z7R2QDX2.js → chunk-64SE3QC5.js} +42 -7
- package/dist/chunk-64SE3QC5.js.map +1 -0
- package/dist/chunk-6ZSGER3A.js +52 -0
- package/dist/chunk-6ZSGER3A.js.map +1 -0
- package/dist/{chunk-QF4SSCQV.js → chunk-AWKQSKUL.js} +4 -3
- package/dist/chunk-AWKQSKUL.js.map +1 -0
- package/dist/{chunk-XMIVHQ35.js → chunk-B2L53TMK.js} +17 -2
- package/dist/{chunk-XMIVHQ35.js.map → chunk-B2L53TMK.js.map} +1 -1
- package/dist/{chunk-OZ3LWLCI.js → chunk-DATCR7AU.js} +3 -3
- package/dist/{chunk-65EJJVT3.js → chunk-DSNXKUXI.js} +2 -2
- package/dist/{chunk-HII5HOQV.js → chunk-G4AM2SOL.js} +5 -3
- package/dist/{chunk-HII5HOQV.js.map → chunk-G4AM2SOL.js.map} +1 -1
- package/dist/{chunk-OBPZ36HG.js → chunk-GU4GGKYP.js} +58 -5
- package/dist/chunk-GU4GGKYP.js.map +1 -0
- package/dist/{chunk-VNT3CQFV.js → chunk-H2L33M7F.js} +17 -13
- package/dist/{chunk-VNT3CQFV.js.map → chunk-H2L33M7F.js.map} +1 -1
- package/dist/{chunk-GHR4BTNJ.js → chunk-HC3QEZKT.js} +4 -4
- package/dist/chunk-HC3QEZKT.js.map +1 -0
- package/dist/{chunk-H4BOQLWW.js → chunk-MAQUL5BD.js} +2 -2
- package/dist/{chunk-4HAV6IFE.js → chunk-O7CUHHYU.js} +6 -6
- package/dist/{chunk-4HAV6IFE.js.map → chunk-O7CUHHYU.js.map} +1 -1
- package/dist/{chunk-5INS5ZZF.js → chunk-OHZYNZSD.js} +3 -3
- package/dist/{chunk-YHWBDCGS.js → chunk-PY7MQUKP.js} +20 -18
- package/dist/{chunk-YHWBDCGS.js.map → chunk-PY7MQUKP.js.map} +1 -1
- package/dist/{chunk-ZLD6MJVJ.js → chunk-S4SAZ7OD.js} +1 -1
- package/dist/chunk-S4SAZ7OD.js.map +1 -0
- package/dist/{chunk-WT7DHJNJ.js → chunk-SKQQOEWH.js} +4 -4
- package/dist/{chunk-XICKN3CH.js → chunk-VIOUZW7Z.js} +2 -46
- package/dist/chunk-VIOUZW7Z.js.map +1 -0
- package/dist/{chunk-YTM7OURD.js → chunk-VNNXAYJE.js} +2 -2
- package/dist/{chunk-5NUF4BHR.js → chunk-VXIBZ6W5.js} +3 -3
- package/dist/{chunk-6JIYGYRB.js → chunk-X7I343ZY.js} +2 -2
- package/dist/{chunk-DI7WHXOZ.js → chunk-XVYATBKD.js} +2 -2
- package/dist/{chunk-EJXIK6WY.js → chunk-YKM2ZTA2.js} +56 -22
- package/dist/chunk-YKM2ZTA2.js.map +1 -0
- package/dist/{chunk-YLCWI6ZR.js → chunk-YQOQ6XEI.js} +59 -18
- package/dist/chunk-YQOQ6XEI.js.map +1 -0
- package/dist/{cli-2U5JB7OQ.js → cli-6JNIPZQ6.js} +32 -31
- package/dist/{cli-2U5JB7OQ.js.map → cli-6JNIPZQ6.js.map} +1 -1
- package/dist/{config-44EGO636.js → config-G75YT6NC.js} +11 -10
- package/dist/{doctor-BD42BBEG.js → doctor-3GMDOW4Y.js} +28 -28
- package/dist/{doctor-BD42BBEG.js.map → doctor-3GMDOW4Y.js.map} +1 -1
- package/dist/{env-proxy-KEGEMWKX.js → env-proxy-XL4P73MZ.js} +2 -2
- package/dist/{fund-WQOOUESE.js → fund-3IPR5YRJ.js} +17 -15
- package/dist/{fund-WQOOUESE.js.map → fund-3IPR5YRJ.js.map} +1 -1
- package/dist/{hook-command-23LC5NRN.js → hook-command-ZXX4FT4N.js} +14 -14
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/{install-REPLHNU7.js → install-6OROTYHZ.js} +17 -17
- package/dist/{install-identity-4RDWTLJ2.js → install-identity-PM4AGFFX.js} +7 -6
- package/dist/{install-wallet-USHWL7AX.js → install-wallet-6756NOB5.js} +10 -9
- package/dist/{install-wallet-USHWL7AX.js.map → install-wallet-6756NOB5.js.map} +1 -1
- package/dist/{mcp-T5SYCLP7.js → mcp-33FAAZ7F.js} +503 -77
- package/dist/mcp-33FAAZ7F.js.map +1 -0
- package/dist/{pay-276DSSYG.js → pay-XOYR4PCH.js} +13 -12
- package/dist/{payments-TZYLJXK3.js → payments-UTQDBO7H.js} +8 -7
- package/dist/{payments-TZYLJXK3.js.map → payments-UTQDBO7H.js.map} +1 -1
- package/dist/{send-YHDKZPED.js → send-CVGNOQW3.js} +12 -10
- package/dist/{send-YHDKZPED.js.map → send-CVGNOQW3.js.map} +1 -1
- package/dist/{status-X2INT6VD.js → status-NACN4DGX.js} +10 -8
- package/dist/{status-X2INT6VD.js.map → status-NACN4DGX.js.map} +1 -1
- package/dist/{status-line-QKDJYZGV.js → status-line-3IQKGRUH.js} +6 -5
- package/dist/{status-line-QKDJYZGV.js.map → status-line-3IQKGRUH.js.map} +1 -1
- package/dist/{status-line-wiring-LW4HFRHB.js → status-line-wiring-QXBOOY2T.js} +4 -4
- package/dist/{uninstall-NVTGU7JD.js → uninstall-NYFKSYW4.js} +17 -17
- package/dist/{update-QXVH2DE7.js → update-RJDA5ZY3.js} +7 -16
- package/dist/update-RJDA5ZY3.js.map +1 -0
- package/dist/{wallet-CKKB23D5.js → wallet-B3FVHNTS.js} +10 -9
- package/docs/agent-permissions.md +5 -4
- package/package.json +3 -3
- package/dist/chunk-EJXIK6WY.js.map +0 -1
- package/dist/chunk-GHR4BTNJ.js.map +0 -1
- package/dist/chunk-OBPZ36HG.js.map +0 -1
- package/dist/chunk-PM2MOXJ3.js +0 -66
- package/dist/chunk-PM2MOXJ3.js.map +0 -1
- package/dist/chunk-QF4SSCQV.js.map +0 -1
- package/dist/chunk-UDWGT4FX.js.map +0 -1
- package/dist/chunk-XICKN3CH.js.map +0 -1
- package/dist/chunk-YLCWI6ZR.js.map +0 -1
- package/dist/chunk-Z7R2QDX2.js.map +0 -1
- package/dist/chunk-ZLD6MJVJ.js.map +0 -1
- package/dist/mcp-T5SYCLP7.js.map +0 -1
- package/dist/update-QXVH2DE7.js.map +0 -1
- /package/dist/{chunk-W36HL4TB.js.map → chunk-4L7KMA7P.js.map} +0 -0
- /package/dist/{chunk-5HS54CLI.js.map → chunk-5NEHH2E5.js.map} +0 -0
- /package/dist/{chunk-OZ3LWLCI.js.map → chunk-DATCR7AU.js.map} +0 -0
- /package/dist/{chunk-65EJJVT3.js.map → chunk-DSNXKUXI.js.map} +0 -0
- /package/dist/{chunk-H4BOQLWW.js.map → chunk-MAQUL5BD.js.map} +0 -0
- /package/dist/{chunk-5INS5ZZF.js.map → chunk-OHZYNZSD.js.map} +0 -0
- /package/dist/{chunk-WT7DHJNJ.js.map → chunk-SKQQOEWH.js.map} +0 -0
- /package/dist/{chunk-YTM7OURD.js.map → chunk-VNNXAYJE.js.map} +0 -0
- /package/dist/{chunk-5NUF4BHR.js.map → chunk-VXIBZ6W5.js.map} +0 -0
- /package/dist/{chunk-6JIYGYRB.js.map → chunk-X7I343ZY.js.map} +0 -0
- /package/dist/{chunk-DI7WHXOZ.js.map → chunk-XVYATBKD.js.map} +0 -0
- /package/dist/{config-44EGO636.js.map → config-G75YT6NC.js.map} +0 -0
- /package/dist/{env-proxy-KEGEMWKX.js.map → env-proxy-XL4P73MZ.js.map} +0 -0
- /package/dist/{hook-command-23LC5NRN.js.map → hook-command-ZXX4FT4N.js.map} +0 -0
- /package/dist/{install-REPLHNU7.js.map → install-6OROTYHZ.js.map} +0 -0
- /package/dist/{install-identity-4RDWTLJ2.js.map → install-identity-PM4AGFFX.js.map} +0 -0
- /package/dist/{pay-276DSSYG.js.map → pay-XOYR4PCH.js.map} +0 -0
- /package/dist/{status-line-wiring-LW4HFRHB.js.map → status-line-wiring-QXBOOY2T.js.map} +0 -0
- /package/dist/{uninstall-NVTGU7JD.js.map → uninstall-NYFKSYW4.js.map} +0 -0
- /package/dist/{wallet-CKKB23D5.js.map → wallet-B3FVHNTS.js.map} +0 -0
|
@@ -3,13 +3,12 @@ import {
|
|
|
3
3
|
runWalletBalance,
|
|
4
4
|
runWalletCreate,
|
|
5
5
|
runWalletShow
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2TYQD22Q.js";
|
|
7
7
|
import "./chunk-PZ5N6BAL.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-UDWGT4FX.js";
|
|
8
|
+
import "./chunk-VNNXAYJE.js";
|
|
9
|
+
import "./chunk-O7CUHHYU.js";
|
|
10
|
+
import "./chunk-VXIBZ6W5.js";
|
|
11
|
+
import "./chunk-X7I343ZY.js";
|
|
13
12
|
import "./chunk-AWQPGIR6.js";
|
|
14
13
|
import "./chunk-N35E6CM2.js";
|
|
15
14
|
import "./chunk-JRGFKVAZ.js";
|
|
@@ -19,9 +18,11 @@ import "./chunk-KG3D7FIF.js";
|
|
|
19
18
|
import "./chunk-RBJPAZFI.js";
|
|
20
19
|
import "./chunk-BPMWXTFX.js";
|
|
21
20
|
import "./chunk-MEFB5KHA.js";
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-B2L53TMK.js";
|
|
22
|
+
import "./chunk-5FGO6TYT.js";
|
|
23
23
|
import "./chunk-2I4QTOLB.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-6ZSGER3A.js";
|
|
25
|
+
import "./chunk-VIOUZW7Z.js";
|
|
25
26
|
import "./chunk-JLEF5WHM.js";
|
|
26
27
|
import "./chunk-K6AXXYCG.js";
|
|
27
28
|
import "./chunk-ZXTAQYNA.js";
|
|
@@ -30,4 +31,4 @@ export {
|
|
|
30
31
|
runWalletCreate,
|
|
31
32
|
runWalletShow
|
|
32
33
|
};
|
|
33
|
-
//# sourceMappingURL=wallet-
|
|
34
|
+
//# sourceMappingURL=wallet-B3FVHNTS.js.map
|
|
@@ -34,7 +34,7 @@ tenjin config set sessionBudget 2.00
|
|
|
34
34
|
|
|
35
35
|
## What bounds a ROUTER payment, on top of that
|
|
36
36
|
|
|
37
|
-
The routing decision comes from a server, and
|
|
37
|
+
The routing decision comes from a server, and each call costs a flat $0.003 from the wallet's channel, paid from deposits of up to $0.25 that count against the limits (the deposit is counted when it leaves the wallet, the fees from it are not counted again): it proposes, it never authorizes. These checks are what keep a wrong or hostile one from being worth anything:
|
|
38
38
|
|
|
39
39
|
- The routing fee is paid only by `tenjin mcp`, with the stock x402 client, and only at exactly $0.003 in USDC on Base over `batch-settlement`. The wallet has one routing channel. When it cannot cover the next fee, the call carries a deposit of up to $0.25, sized down to `maxAutoSpend` while that still covers ten fees ($0.03), and refused below that. A deposit is an automatic payment: it is reserved in `spend.json` before it is signed, so it must fit `maxAutoSpend`, the day's `sessionBudget` and `allowlistCreators` (the router's host is the creator), and it is counted from the moment it is sent, so a lost answer or a killed process leaves it counted; only an answered 4xx or 5xx, on which the server settles nothing, gives it back. The deposit is the spend: the fees come out of it and are not counted again, so the day's running total never refuses one. Each fee still gets the per-payment checks: it has to fit `maxAutoSpend` (a 0 you set, or the 0 that holds until the spend question is answered, refuses it) and pass `allowlistCreators`, and a `sessionBudget` of 0 refuses it. A fee that fails one is not paid, even from a channel that is already funded, and the call takes the free path. Approving the limits at install, where the question names the fee, is what approves it.
|
|
40
40
|
- A routing call that cannot be paid takes the free path: the wallet holds less than the deposit, `tenjin mcp` cannot unlock the wallet without a prompt, a limit refuses the deposit, the payment fails, or the channel is carrying another session's call at that moment. The first such call in a session tells you, in Claude Code's own message line, the reason and the fix (`tenjin wallet fund 0.25`, `TENJIN_WALLET_PASSPHRASE`, or `tenjin doctor`); a busy channel says nothing, and while the router charges no fee the wallet is not touched and nothing is said. The native tools are never blocked for it, and `tenjin doctor` names the same reasons.
|
|
@@ -111,12 +111,13 @@ To stop the router without removing anything, `tenjin config set router.enabled
|
|
|
111
111
|
1. You type a turn. The hook sends the bounded packet to Tenjin, which answers whether a paid capability fits and, if it does, keeps that packet under a short-lived id.
|
|
112
112
|
2. When one fits, your assistant sees one line, opening with `Tenjin router (installed by the user):`, that names the service, its price and the call to make: `mcp__x402__request({id, input})` with the required fields as placeholders, or already filled in when the hook holds them (the search a native call was about to run, or the page it was about to fetch). The hook keeps the service's spec on this machine under the id.
|
|
113
113
|
3. Your assistant fills the fields and calls `request({id, input})` once. This CLI validates the input against the spec, builds the request, pays that provider once under your limits, hands back the result, and tells Tenjin only how the call ended. Deciding costs nothing. Where the spec names the fields its result promises, the result holds only those, and the provider's whole response is saved under `~/.tenjin/results/` (readable by you alone, kept a day) at the path the result names in `fullResultPath`.
|
|
114
|
-
4. An input that does not fit the spec is refused before anything is sent: your assistant gets every problem and the whole spec (each input with its description and allowed values, the required fields inside a nested object, an example and what comes back), locally and with nothing paid, and calls again. `request({id})` alone shows the same spec. A spec whose input schema this CLI cannot compile is refused outright, with nothing sent or paid.
|
|
114
|
+
4. An input that does not fit the spec is refused before anything is sent to the provider: your assistant gets every problem and the whole spec (each input with its description and allowed values, the required fields inside a nested object, an example and what comes back), locally and with nothing paid, and calls again. `request({id})` alone shows the same spec. A spec whose input schema this CLI cannot compile is refused outright, with nothing sent to the provider or paid.
|
|
115
|
+
5. Some lines offer a choice of services for the same step, such as several image models. Your assistant uses the one you named or asked to compare, asks you when you have not said and you are there to answer, and otherwise uses the line's default, then calls `request({id, choice, input})`. One choice runs exactly as that service's own offer. `all` runs every choice side by side, each paid once to its own provider, but only after one check that the whole set fits your limits: each payment within `maxAutoSpend`, and their total inside the day's `sessionBudget`. A set that does not fit returns `needs_approval` with nothing paid. The result lists each choice with its cost and the file it saved under `~/.tenjin/downloads/`.
|
|
115
116
|
|
|
116
117
|
## What a paid lookup leaves on your machine
|
|
117
118
|
|
|
118
119
|
- Every paid lookup is recorded in `~/.tenjin/paid/ledger.jsonl`: what was sent (masked), who was paid, how much, the settlement transaction, and any files saved.
|
|
119
|
-
- Files a paid lookup returns, and media files a paid third-party service links to, are saved under `~/.tenjin/downloads/`.
|
|
120
|
+
- Files a paid lookup returns, and media files a paid third-party service links to or returns inline as base64 in its JSON, are saved under `~/.tenjin/downloads/`. An inline file is replaced in the result by a note naming where it was saved.
|
|
120
121
|
- When a tool names the fields it returns, your agent gets those fields and the provider's whole response is saved under `~/.tenjin/results/` for a day, at the path the result names.
|
|
121
122
|
- When a seller never confirmed settlement, `tenjin payments reconcile` asks USDC on Base whether the payment was used once it has expired, and one that was never charged goes back to today's limit; the `request` tool does the same for up to three beside each lookup, without waiting for it.
|
|
122
123
|
|
|
@@ -131,7 +132,7 @@ To stop the router without removing anything, `tenjin config set router.enabled
|
|
|
131
132
|
- Slash commands and one-word acknowledgements are never sent at all.
|
|
132
133
|
- The packet is stored on the backend against the decision id, so the lookup your assistant sends next is decided with the context you gave. Expired packets are unreadable after 15 minutes (the route refuses an expired id) and are deleted by the next router request or the daily cleanup, whichever comes first.
|
|
133
134
|
- On a paid lookup: the capability chosen, a hash of the contract, a hash of the arguments, your wallet address, the amount and the transaction hash are kept.
|
|
134
|
-
- On
|
|
135
|
+
- On every call run from an offer's spec: the offer's id, how the call ended, the provider's HTTP status and how long it took. A call stopped before anything was paid says which side stopped it: the input, the offer's terms, the provider's answer, the network, or the wallet. Never the input or the result.
|
|
135
136
|
|
|
136
137
|
The answer can put one line into your session, or into a task your assistant delegates: the service that fits, what it does, its listed price, and the `mcp__x402__request` call carrying the id that brings your context to it. The line says it comes from the Tenjin router you installed, and it is an option: your assistant's own tools keep working. Which service actually runs, and what it costs, is decided when your assistant makes that call, under your spend policy.
|
|
137
138
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tenjin-cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.27",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The tool router for coding agents. Tenjin picks the right tool when your agent needs one, and one wallet pays for every call.",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"tenjin": "dist/index.js"
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
|
-
"node": ">=
|
|
32
|
+
"node": ">=22.0.0"
|
|
33
33
|
},
|
|
34
34
|
"files": [
|
|
35
35
|
"dist",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@clack/prompts": "^1.7.0",
|
|
42
42
|
"@eslint/js": "^10",
|
|
43
43
|
"@modelcontextprotocol/sdk": "1.31.0",
|
|
44
|
-
"@types/node": "^
|
|
44
|
+
"@types/node": "^22.20.5",
|
|
45
45
|
"@x402/core": "2.28.0",
|
|
46
46
|
"@x402/evm": "2.28.0",
|
|
47
47
|
"@x402/extensions": "2.28.0",
|