tenjin-cli 0.1.0-alpha.27 → 0.1.0-alpha.29

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.
Files changed (148) hide show
  1. package/README.md +18 -26
  2. package/dist/alive-3J3CHOQP.js +21 -0
  3. package/dist/{chunk-XVYATBKD.js → chunk-25GGN553.js} +897 -522
  4. package/dist/chunk-25GGN553.js.map +1 -0
  5. package/dist/{chunk-B2L53TMK.js → chunk-2SNUOHAT.js} +28 -23
  6. package/dist/chunk-2SNUOHAT.js.map +1 -0
  7. package/dist/{chunk-5NEHH2E5.js → chunk-3FY5HG7R.js} +86 -19
  8. package/dist/chunk-3FY5HG7R.js.map +1 -0
  9. package/dist/{chunk-YQOQ6XEI.js → chunk-4FYMDRD3.js} +51 -41
  10. package/dist/chunk-4FYMDRD3.js.map +1 -0
  11. package/dist/chunk-6W5GYG3W.js +128 -0
  12. package/dist/chunk-6W5GYG3W.js.map +1 -0
  13. package/dist/{chunk-G4AM2SOL.js → chunk-AMEUXNJT.js} +4 -8
  14. package/dist/{chunk-G4AM2SOL.js.map → chunk-AMEUXNJT.js.map} +1 -1
  15. package/dist/chunk-EWLU46J6.js +100 -0
  16. package/dist/chunk-EWLU46J6.js.map +1 -0
  17. package/dist/chunk-LRCJ2IZ5.js +115 -0
  18. package/dist/{chunk-HC3QEZKT.js.map → chunk-LRCJ2IZ5.js.map} +1 -1
  19. package/dist/{chunk-X7I343ZY.js → chunk-LX5OT4TQ.js} +3 -3
  20. package/dist/{chunk-X7I343ZY.js.map → chunk-LX5OT4TQ.js.map} +1 -1
  21. package/dist/{chunk-DATCR7AU.js → chunk-MG3G644T.js} +5 -7
  22. package/dist/{chunk-DATCR7AU.js.map → chunk-MG3G644T.js.map} +1 -1
  23. package/dist/{chunk-BOAI23CX.js → chunk-MOG7PB3A.js} +21 -15
  24. package/dist/chunk-MOG7PB3A.js.map +1 -0
  25. package/dist/{chunk-GU4GGKYP.js → chunk-MRUPDSUM.js} +14 -59
  26. package/dist/chunk-MRUPDSUM.js.map +1 -0
  27. package/dist/{chunk-AWKQSKUL.js → chunk-OOSRB3OF.js} +2 -2
  28. package/dist/{chunk-PZ5N6BAL.js → chunk-ORWL5BSN.js} +5 -4
  29. package/dist/chunk-ORWL5BSN.js.map +1 -0
  30. package/dist/chunk-P4LVLFO4.js +29 -0
  31. package/dist/chunk-P4LVLFO4.js.map +1 -0
  32. package/dist/{chunk-VXIBZ6W5.js → chunk-QTGUDCIR.js} +5 -5
  33. package/dist/{chunk-YKM2ZTA2.js → chunk-R4AO7GC2.js} +462 -105
  34. package/dist/chunk-R4AO7GC2.js.map +1 -0
  35. package/dist/{chunk-OHZYNZSD.js → chunk-RJEPZMYY.js} +12 -8
  36. package/dist/chunk-RJEPZMYY.js.map +1 -0
  37. package/dist/chunk-SBL4THYT.js +2074 -0
  38. package/dist/chunk-SBL4THYT.js.map +1 -0
  39. package/dist/{chunk-VNNXAYJE.js → chunk-SFEQGENI.js} +2 -2
  40. package/dist/{chunk-K6AXXYCG.js → chunk-SJLTEINJ.js} +10 -2
  41. package/dist/{chunk-K6AXXYCG.js.map → chunk-SJLTEINJ.js.map} +1 -1
  42. package/dist/{chunk-5FGO6TYT.js → chunk-TROZ6HL4.js} +3 -5
  43. package/dist/{chunk-5FGO6TYT.js.map → chunk-TROZ6HL4.js.map} +1 -1
  44. package/dist/{chunk-SKQQOEWH.js → chunk-USOLCBKC.js} +6 -8
  45. package/dist/{chunk-SKQQOEWH.js.map → chunk-USOLCBKC.js.map} +1 -1
  46. package/dist/{chunk-64SE3QC5.js → chunk-VKQXVCZR.js} +54 -5
  47. package/dist/chunk-VKQXVCZR.js.map +1 -0
  48. package/dist/{chunk-VIOUZW7Z.js → chunk-VVAHFCX2.js} +209 -37
  49. package/dist/chunk-VVAHFCX2.js.map +1 -0
  50. package/dist/{chunk-4L7KMA7P.js → chunk-WM7TJEBP.js} +8 -10
  51. package/dist/{chunk-4L7KMA7P.js.map → chunk-WM7TJEBP.js.map} +1 -1
  52. package/dist/{chunk-2TYQD22Q.js → chunk-XDYKZRLN.js} +23 -16
  53. package/dist/chunk-XDYKZRLN.js.map +1 -0
  54. package/dist/{chunk-LAIZ2AQA.js → chunk-XJQ6CH7X.js} +3 -2
  55. package/dist/{chunk-O7CUHHYU.js → chunk-ZQNGTLOC.js} +8 -10
  56. package/dist/{chunk-O7CUHHYU.js.map → chunk-ZQNGTLOC.js.map} +1 -1
  57. package/dist/{cli-6JNIPZQ6.js → cli-JPTDHGRX.js} +58 -52
  58. package/dist/{cli-6JNIPZQ6.js.map → cli-JPTDHGRX.js.map} +1 -1
  59. package/dist/{config-G75YT6NC.js → config-YYKDH2TH.js} +12 -15
  60. package/dist/{doctor-3GMDOW4Y.js → doctor-SSTXGCHX.js} +298 -269
  61. package/dist/doctor-SSTXGCHX.js.map +1 -0
  62. package/dist/{fund-3IPR5YRJ.js → fund-QWVWRVDK.js} +95 -43
  63. package/dist/{fund-3IPR5YRJ.js.map → fund-QWVWRVDK.js.map} +1 -1
  64. package/dist/hook-command-VWJXRT7H.js +31 -0
  65. package/dist/hosts/claude/.claude-plugin/marketplace.json +19 -0
  66. package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +14 -0
  67. package/dist/hosts/claude/tenjin/.mcp.json +12 -0
  68. package/dist/hosts/claude/tenjin/hooks/hooks.json +221 -0
  69. package/dist/index.js +13 -4
  70. package/dist/index.js.map +1 -1
  71. package/dist/install-2GXXD4DK.js +51 -0
  72. package/dist/{install-identity-PM4AGFFX.js → install-identity-FK3YF227.js} +7 -9
  73. package/dist/{install-wallet-6756NOB5.js → install-wallet-TC22U52X.js} +21 -17
  74. package/dist/{install-wallet-6756NOB5.js.map → install-wallet-TC22U52X.js.map} +1 -1
  75. package/dist/{mcp-33FAAZ7F.js → mcp-42H2F4NY.js} +2128 -372
  76. package/dist/mcp-42H2F4NY.js.map +1 -0
  77. package/dist/package-6DJA3Y2O.js +37 -0
  78. package/dist/{paths-MUXHUOCM.js → paths-POPTXJO6.js} +6 -2
  79. package/dist/{pay-XOYR4PCH.js → pay-LSDJBIAZ.js} +20 -18
  80. package/dist/payments-SPECLBRQ.js +105 -0
  81. package/dist/payments-SPECLBRQ.js.map +1 -0
  82. package/dist/{send-CVGNOQW3.js → send-MHAOLPK3.js} +13 -17
  83. package/dist/{send-CVGNOQW3.js.map → send-MHAOLPK3.js.map} +1 -1
  84. package/dist/status-O2RWLPS5.js +114 -0
  85. package/dist/status-O2RWLPS5.js.map +1 -0
  86. package/dist/{status-line-3IQKGRUH.js → status-line-45TVCRM3.js} +7 -9
  87. package/dist/{status-line-3IQKGRUH.js.map → status-line-45TVCRM3.js.map} +1 -1
  88. package/dist/uninstall-VOK2Z5M4.js +146 -0
  89. package/dist/uninstall-VOK2Z5M4.js.map +1 -0
  90. package/dist/update-FGP3HNLD.js +33 -0
  91. package/dist/update-FGP3HNLD.js.map +1 -0
  92. package/dist/{wallet-B3FVHNTS.js → wallet-DA7OFNEW.js} +18 -14
  93. package/dist/wallet-DA7OFNEW.js.map +1 -0
  94. package/docs/agent-permissions.md +35 -22
  95. package/docs/safety-model.md +3 -1
  96. package/package.json +2 -2
  97. package/dist/chunk-2TYQD22Q.js.map +0 -1
  98. package/dist/chunk-5NEHH2E5.js.map +0 -1
  99. package/dist/chunk-64SE3QC5.js.map +0 -1
  100. package/dist/chunk-6ZSGER3A.js +0 -52
  101. package/dist/chunk-6ZSGER3A.js.map +0 -1
  102. package/dist/chunk-B2L53TMK.js.map +0 -1
  103. package/dist/chunk-BOAI23CX.js.map +0 -1
  104. package/dist/chunk-DSNXKUXI.js +0 -172
  105. package/dist/chunk-DSNXKUXI.js.map +0 -1
  106. package/dist/chunk-GU4GGKYP.js.map +0 -1
  107. package/dist/chunk-H2L33M7F.js +0 -944
  108. package/dist/chunk-H2L33M7F.js.map +0 -1
  109. package/dist/chunk-HC3QEZKT.js +0 -87
  110. package/dist/chunk-JLEF5WHM.js +0 -132
  111. package/dist/chunk-JLEF5WHM.js.map +0 -1
  112. package/dist/chunk-MAQUL5BD.js +0 -99
  113. package/dist/chunk-MAQUL5BD.js.map +0 -1
  114. package/dist/chunk-OHZYNZSD.js.map +0 -1
  115. package/dist/chunk-PY7MQUKP.js +0 -755
  116. package/dist/chunk-PY7MQUKP.js.map +0 -1
  117. package/dist/chunk-PZ5N6BAL.js.map +0 -1
  118. package/dist/chunk-TGLKKLQG.js +0 -11
  119. package/dist/chunk-TGLKKLQG.js.map +0 -1
  120. package/dist/chunk-VIOUZW7Z.js.map +0 -1
  121. package/dist/chunk-XVYATBKD.js.map +0 -1
  122. package/dist/chunk-YKM2ZTA2.js.map +0 -1
  123. package/dist/chunk-YQOQ6XEI.js.map +0 -1
  124. package/dist/doctor-3GMDOW4Y.js.map +0 -1
  125. package/dist/hook-command-ZXX4FT4N.js +0 -32
  126. package/dist/install-6OROTYHZ.js +0 -72
  127. package/dist/mcp-33FAAZ7F.js.map +0 -1
  128. package/dist/payments-UTQDBO7H.js +0 -48
  129. package/dist/payments-UTQDBO7H.js.map +0 -1
  130. package/dist/status-NACN4DGX.js +0 -72
  131. package/dist/status-NACN4DGX.js.map +0 -1
  132. package/dist/status-line-wiring-QXBOOY2T.js +0 -31
  133. package/dist/uninstall-NYFKSYW4.js +0 -175
  134. package/dist/uninstall-NYFKSYW4.js.map +0 -1
  135. package/dist/update-RJDA5ZY3.js +0 -442
  136. package/dist/update-RJDA5ZY3.js.map +0 -1
  137. /package/dist/{config-G75YT6NC.js.map → alive-3J3CHOQP.js.map} +0 -0
  138. /package/dist/{chunk-AWKQSKUL.js.map → chunk-OOSRB3OF.js.map} +0 -0
  139. /package/dist/{chunk-VXIBZ6W5.js.map → chunk-QTGUDCIR.js.map} +0 -0
  140. /package/dist/{chunk-VNNXAYJE.js.map → chunk-SFEQGENI.js.map} +0 -0
  141. /package/dist/{chunk-LAIZ2AQA.js.map → chunk-XJQ6CH7X.js.map} +0 -0
  142. /package/dist/{hook-command-ZXX4FT4N.js.map → config-YYKDH2TH.js.map} +0 -0
  143. /package/dist/{install-6OROTYHZ.js.map → hook-command-VWJXRT7H.js.map} +0 -0
  144. /package/dist/{install-identity-PM4AGFFX.js.map → install-2GXXD4DK.js.map} +0 -0
  145. /package/dist/{paths-MUXHUOCM.js.map → install-identity-FK3YF227.js.map} +0 -0
  146. /package/dist/{pay-XOYR4PCH.js.map → package-6DJA3Y2O.js.map} +0 -0
  147. /package/dist/{status-line-wiring-QXBOOY2T.js.map → paths-POPTXJO6.js.map} +0 -0
  148. /package/dist/{wallet-B3FVHNTS.js.map → pay-LSDJBIAZ.js.map} +0 -0
package/README.md CHANGED
@@ -45,14 +45,14 @@ In Claude Code or Claude Desktop, paste:
45
45
  Install Tenjin from tenjin.sh
46
46
  ```
47
47
 
48
- Your agent installs it, asks you about spend limits in the session, and helps you fund the wallet.
48
+ Your agent installs it, asks you about spend limits in the session, and helps you fund the wallet. Then type `/reload-plugins`, or start a new session, and Tenjin is on (when upgrading from an earlier release, start a new session). It needs Claude Code 2.1.287 or newer.
49
49
 
50
50
  Or in a terminal (Node.js 22 or newer):
51
51
 
52
52
  ```bash
53
53
  npm i -g tenjin-cli
54
- tenjin install # sets up Claude Code and creates your wallet
55
- tenjin wallet fund 2 # optional: add $2 with a card, via Coinbase
54
+ tenjin install # adds the Tenjin plugin to Claude Code and creates your wallet
55
+ tenjin wallet fund 5 # optional: add $5 with a card, via Coinbase
56
56
  ```
57
57
 
58
58
  ## What it can do
@@ -99,11 +99,7 @@ flowchart LR
99
99
 
100
100
  The Tenjin router hooks into Claude Code at your prompt, before each web search or page fetch, when your agent hands work to a subagent, and around a question your agent asks you. At each point it asks Jev, a decision model from [TypeSafe](https://typesafe.ai), whether a tool in the catalog fits. When none does, Jev may pick one third-party service from a short list matching the step (the Tenjin list, plus the open Bazaar if you turned it on), or none. Either way Jev only chooses from a list, so it never writes a call or an instruction for your agent; a third-party listing's description is the seller's own, and your agent judges it.
101
101
 
102
- When one fits, your agent sees a one-line suggestion with the tool and its price, and calls it through Tenjin's `x402` MCP server: the offer's id alone shows the tool's inputs, an example and what it returns, and the id with the agent's input runs it. Tenjin builds the call, pays the provider from your wallet, within your limits, and hands back the result. Your status line shows the call as it happens:
103
-
104
- ```text
105
- x402 · request: calling pro-api.coinmarketcap.com/x402/v3/cryptocurrency/quotes/latest · {"query":{"symbol":"BTC,ETH"}}
106
- ```
102
+ When one fits, your agent sees a one-line suggestion with the tool and its price, and calls it through the Tenjin plugin's MCP server: the offer's id alone shows the tool's inputs, an example and what it returns, and the id with the agent's input runs it. Tenjin builds the call, pays the provider from your wallet, within your limits, and hands back the result.
107
103
 
108
104
  To pick a tool, the router sends your prompt and recent messages with secrets masked, plus the searches, URLs, subagent tasks and questions it routes; tool results stay on your machine. [What it sends, and everything install writes →](./docs/agent-permissions.md#what-the-hooks-send)
109
105
 
@@ -117,22 +113,22 @@ Tenjin pays for tools with [x402](https://www.x402.org), an open standard that b
117
113
 
118
114
  ### Limits
119
115
 
120
- | Limit | Default | Change it |
121
- | ---------- | ------- | ------------------------------------- |
122
- | Per lookup | $0.25 | `tenjin config set maxAutoSpend 0.10` |
123
- | Per day | $5 | `tenjin config set sessionBudget 2` |
116
+ | Limit | Default | Change it |
117
+ | -------- | ------- | ------------------------------------- |
118
+ | Per call | $0.25 | `tenjin config set maxAutoSpend 0.10` |
119
+ | Per day | $5 | `tenjin config set sessionBudget 2` |
124
120
 
125
- `tenjin install` asks you to approve these limits, or tells your agent to ask you when the agent runs it. [How the limits work →](./docs/agent-permissions.md#what-bounds-a-payment)
121
+ `tenjin install` asks you to approve these limits, or tells your agent to ask you when the agent runs it. A call that would pay more (all its payments together, such as five takes of a video) pays nothing on its own: your assistant tells you what it costs, and in Claude Code it asks you through Claude Code's own permission prompt and runs it once you say yes. [How the limits work →](./docs/agent-permissions.md#what-bounds-a-payment)
126
122
 
127
123
  ### Routing fee
128
124
 
129
- Each routing call costs a flat $0.003, paid over x402 `batch-settlement` by `tenjin mcp` from a channel deposit of up to $0.25 (less when your per-call limit is lower). A deposit is an automatic payment: it counts against the limits above, and approving them at install approves the fee. The fees come out of the deposit and are not counted again. When a call cannot be paid, it takes the free path, and Claude Code tells you once per session why and what fixes it; `tenjin doctor` says the same. Details are in [docs/agent-permissions.md](docs/agent-permissions.md#what-bounds-a-router-payment-on-top-of-that).
125
+ Each routing call costs a flat $0.003, paid over x402 `batch-settlement` by `tenjin mcp` from a channel deposit of up to $0.25 (less when your per-call limit is lower). A deposit is an automatic payment: it counts against the limits above, and approving them at install approves the fee. The fees come out of the deposit and are not counted again. When a deposit is taken, Claude Code says so once; `tenjin status` shows it as prepaid routing credit, apart from what lookups cost, and `tenjin wallet balance` adds the credit still left. When a call cannot be paid, it takes the free path, and Claude Code tells you once per session why and what fixes it; `tenjin doctor` says the same. Details are in [docs/agent-permissions.md](docs/agent-permissions.md#what-bounds-a-router-payment-on-top-of-that).
130
126
 
131
127
  ### Funding
132
128
 
133
- `tenjin wallet fund 2` opens a Coinbase Onramp checkout for your wallet: pay by card, or Apple Pay where your region supports it. Sign in to Coinbase or create an account during checkout. You can also send USDC on Base to the address `tenjin wallet address` prints; at a terminal it and `tenjin wallet fund` also draw that address as a QR code for a phone wallet to scan (`--no-qr` skips it).
129
+ `tenjin wallet fund 5` opens a Coinbase Onramp checkout for your wallet. In the US, Apple Pay or Google Pay with no Coinbase account. Elsewhere, your Coinbase account. You can also send USDC on Base to the address `tenjin wallet address` prints; at a terminal it and `tenjin wallet fund` also draw that address as a QR code for a phone wallet to scan (`--no-qr` skips it).
134
130
 
135
- $1–2 goes a long way. $2 covers about 280 web searches, 200 page reads or 100 Wolfram Alpha answers.
131
+ $5, the Apple Pay and Google Pay minimum, covers about 700 web searches, 500 page reads or 250 Wolfram Alpha answers.
136
132
 
137
133
  ### Withdrawing
138
134
 
@@ -144,23 +140,19 @@ $1–2 goes a long way. $2 covers about 280 web searches, 200 page reads or 100
144
140
  tenjin status # what you've spent today
145
141
  tenjin wallet balance # what's left
146
142
  tenjin wallet fund 5 # top up
143
+ tenjin payments # the paid lookups this machine made
147
144
  tenjin payments reconcile # settle paid lookups whose settlement was unknown
148
145
  tenjin update # newest version; wallet and settings stay
149
146
  tenjin config set router.enabled false # pause the router on this machine
150
147
  tenjin config set --project router.enabled false # ...or just in this repo
151
- tenjin uninstall # remove the Claude Code setup; your wallet stays
148
+ tenjin uninstall # remove the Claude Code plugin; your wallet stays
152
149
  ```
153
150
 
154
- Use `tenjin install --project` to set it up for a single project. Add `--json` to any command for machine-readable output.
151
+ Use `tenjin install --project` to set it up for a single project; `tenjin doctor` run in that project checks it, and `tenjin update` refreshes it with the rest. Add `--json` to any command for machine-readable output.
155
152
 
156
- Every paid lookup is recorded on your machine, with the files and full results it returned. [Where they live, and what `payments reconcile` does →](./docs/agent-permissions.md#what-a-paid-lookup-leaves-on-your-machine)
153
+ The CLI asks npm at most once a day whether a newer version exists and says so; it never updates itself, so `tenjin update` is yours to run. `tenjin config set update.mode off` turns that check off, the request to npm included, and `TENJIN_NO_UPDATE_CHECK=1` in the environment does the same wherever it is set.
157
154
 
158
- <details>
159
- <summary>Status line: keeping your own</summary>
160
-
161
- `tenjin install` sets Claude Code's [status line](https://code.claude.com/docs/en/statusline) only if you don't already have one. If you do, yours is left alone and the install prints a command that shows both; `tenjin install --status-line compose` writes it for you, and `--status-line skip` leaves the setting untouched. The status line reads local files only: no network, no wallet, and it can't affect a lookup or a payment.
162
-
163
- </details>
155
+ Every paid lookup is recorded on your machine, with the files and full results it returned. [Where they live, and what `payments reconcile` does →](./docs/agent-permissions.md#what-a-paid-lookup-leaves-on-your-machine)
164
156
 
165
157
  <details>
166
158
  <summary>Spending limits: the fine print</summary>
@@ -182,7 +174,7 @@ Tenjin is in alpha, and the catalog grows with what people ask for. Missing a se
182
174
 
183
175
  - [How a lookup runs, what it sends, and what install writes](./docs/agent-permissions.md)
184
176
  - [Safety model](./docs/safety-model.md)
185
- - [Troubleshooting](./docs/troubleshooting.md), including a stray `x402` server in `~/.mcp.json` after `0.1.0-alpha.18`
177
+ - [Troubleshooting](./docs/troubleshooting.md)
186
178
 
187
179
  ## Developing
188
180
 
@@ -0,0 +1,21 @@
1
+ import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
+ import {
3
+ aliveDir,
4
+ aliveMain,
5
+ markSessionServed,
6
+ readAliveStamp,
7
+ removeAliveState,
8
+ runAliveHook,
9
+ sessionServedByPlugin
10
+ } from "./chunk-6W5GYG3W.js";
11
+ import "./chunk-ZXTAQYNA.js";
12
+ export {
13
+ aliveDir,
14
+ aliveMain,
15
+ markSessionServed,
16
+ readAliveStamp,
17
+ removeAliveState,
18
+ runAliveHook,
19
+ sessionServedByPlugin
20
+ };
21
+ //# sourceMappingURL=alive-3J3CHOQP.js.map