tenjin-cli 0.1.0-alpha.30 → 0.1.0-alpha.31

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 (172) hide show
  1. package/README.md +65 -116
  2. package/dist/{_esm-CE7KNONL.js → _esm-MEXZI5DL.js} +4 -4
  3. package/dist/{alive-3J3CHOQP.js → alive-J64H46HI.js} +14 -4
  4. package/dist/{chunk-O2FRQ2L2.js → chunk-27EPWVOY.js} +4 -64
  5. package/dist/chunk-27EPWVOY.js.map +1 -0
  6. package/dist/{chunk-OSYTBCUC.js → chunk-2XLC3AEX.js} +16 -14
  7. package/dist/{chunk-OSYTBCUC.js.map → chunk-2XLC3AEX.js.map} +1 -1
  8. package/dist/chunk-3623BLPV.js +184 -0
  9. package/dist/chunk-3623BLPV.js.map +1 -0
  10. package/dist/chunk-3UCIG4TG.js +65 -0
  11. package/dist/chunk-3UCIG4TG.js.map +1 -0
  12. package/dist/{chunk-PAYV4XUA.js → chunk-4ZZO6ULA.js} +2 -2
  13. package/dist/{chunk-VUFAK2LW.js → chunk-5C32RLTA.js} +2 -2
  14. package/dist/{chunk-VUFAK2LW.js.map → chunk-5C32RLTA.js.map} +1 -1
  15. package/dist/{chunk-YHKXNYTB.js → chunk-5K5W4S66.js} +2 -2
  16. package/dist/{chunk-3O2BQIF6.js → chunk-5MARFNSB.js} +273 -482
  17. package/dist/chunk-5MARFNSB.js.map +1 -0
  18. package/dist/{chunk-HPWO4O6S.js → chunk-6E5R45ZO.js} +2 -2
  19. package/dist/{chunk-JMM6YE7J.js → chunk-77TCKDEC.js} +125 -312
  20. package/dist/chunk-77TCKDEC.js.map +1 -0
  21. package/dist/{chunk-LFZJM56J.js → chunk-7Q5FDF65.js} +2 -2
  22. package/dist/chunk-7WEQQJLG.js +68 -0
  23. package/dist/chunk-7WEQQJLG.js.map +1 -0
  24. package/dist/{chunk-AWFUPKTM.js → chunk-7WU4OPLP.js} +12 -6
  25. package/dist/{chunk-AWFUPKTM.js.map → chunk-7WU4OPLP.js.map} +1 -1
  26. package/dist/{chunk-AEG2PXBP.js → chunk-7ZRL2LBQ.js} +3 -3
  27. package/dist/{chunk-IOODYAXL.js → chunk-AGZ7PJKY.js} +6 -4
  28. package/dist/{chunk-IOODYAXL.js.map → chunk-AGZ7PJKY.js.map} +1 -1
  29. package/dist/{chunk-VFMQTSXG.js → chunk-B7HUUJOK.js} +3 -3
  30. package/dist/{chunk-EL56RW2J.js → chunk-BL3332HQ.js} +7 -7
  31. package/dist/{chunk-5LJCEMFD.js → chunk-D65GNPS3.js} +35 -27
  32. package/dist/{chunk-5LJCEMFD.js.map → chunk-D65GNPS3.js.map} +1 -1
  33. package/dist/{chunk-P7LABKCW.js → chunk-DOQGNFHM.js} +33 -2
  34. package/dist/{chunk-P7LABKCW.js.map → chunk-DOQGNFHM.js.map} +1 -1
  35. package/dist/{chunk-OK2TDZQU.js → chunk-FW75G2W4.js} +7 -5
  36. package/dist/chunk-FW75G2W4.js.map +1 -0
  37. package/dist/chunk-GA7JETVM.js +150 -0
  38. package/dist/chunk-GA7JETVM.js.map +1 -0
  39. package/dist/{chunk-6W5GYG3W.js → chunk-I3EQFHCD.js} +48 -1
  40. package/dist/chunk-I3EQFHCD.js.map +1 -0
  41. package/dist/{chunk-EBVIKMCH.js → chunk-JKKAIPTU.js} +2 -2
  42. package/dist/{chunk-N35E6CM2.js → chunk-K3I7C2MO.js} +6 -6
  43. package/dist/{chunk-KYFZTGMC.js → chunk-K72RURN3.js} +5 -3
  44. package/dist/{chunk-KYFZTGMC.js.map → chunk-K72RURN3.js.map} +1 -1
  45. package/dist/{chunk-RAULEAZ6.js → chunk-KXQ4UIP7.js} +3 -3
  46. package/dist/{chunk-VZGAONSJ.js → chunk-KXVP2VKA.js} +5 -5
  47. package/dist/chunk-LEFIX6RS.js +100 -0
  48. package/dist/chunk-LEFIX6RS.js.map +1 -0
  49. package/dist/{chunk-TTBKWWTV.js → chunk-MNXS2U45.js} +246 -83
  50. package/dist/chunk-MNXS2U45.js.map +1 -0
  51. package/dist/{chunk-AWQPGIR6.js → chunk-NEFNKLBE.js} +5 -5
  52. package/dist/chunk-OHRR5OYM.js +63 -0
  53. package/dist/chunk-OHRR5OYM.js.map +1 -0
  54. package/dist/{chunk-U6YQ6FRI.js → chunk-P4NH7OUK.js} +31 -11
  55. package/dist/chunk-P4NH7OUK.js.map +1 -0
  56. package/dist/chunk-QSCPK4F5.js +145 -0
  57. package/dist/chunk-QSCPK4F5.js.map +1 -0
  58. package/dist/chunk-QXP3Z3JN.js +131 -0
  59. package/dist/chunk-QXP3Z3JN.js.map +1 -0
  60. package/dist/{chunk-YFQOA5AU.js → chunk-R5LCN54M.js} +4 -4
  61. package/dist/{chunk-KHE6L6TD.js → chunk-UKY4CHNC.js} +92 -10
  62. package/dist/chunk-UKY4CHNC.js.map +1 -0
  63. package/dist/{chunk-QUVVWYJW.js → chunk-UQUOVWBG.js} +8 -6
  64. package/dist/{chunk-QUVVWYJW.js.map → chunk-UQUOVWBG.js.map} +1 -1
  65. package/dist/{chunk-HE2MS4QO.js → chunk-V6BSF6OC.js} +17 -13
  66. package/dist/{chunk-HE2MS4QO.js.map → chunk-V6BSF6OC.js.map} +1 -1
  67. package/dist/{chunk-WVUSXNIE.js → chunk-WJXLQXJY.js} +6 -2
  68. package/dist/{chunk-WVUSXNIE.js.map → chunk-WJXLQXJY.js.map} +1 -1
  69. package/dist/{chunk-NZIP4PA2.js → chunk-WK7F3B2E.js} +2 -2
  70. package/dist/chunk-XQJXNMSB.js +23 -0
  71. package/dist/chunk-XQJXNMSB.js.map +1 -0
  72. package/dist/chunk-Y527D4TV.js +56 -0
  73. package/dist/chunk-Y527D4TV.js.map +1 -0
  74. package/dist/{chunk-SPAVAYSW.js → chunk-YFPY4ONH.js} +6 -4
  75. package/dist/{chunk-SPAVAYSW.js.map → chunk-YFPY4ONH.js.map} +1 -1
  76. package/dist/{chunk-WO5BJNIB.js → chunk-YVFXE7RR.js} +9 -129
  77. package/dist/chunk-YVFXE7RR.js.map +1 -0
  78. package/dist/clack-EZ7TDWQU.js +19 -0
  79. package/dist/claude-cli-2YKABJJZ.js +31 -0
  80. package/dist/{cli-O5SN7ZJ4.js → cli-D5OE3URZ.js} +128 -56
  81. package/dist/{cli-O5SN7ZJ4.js.map → cli-D5OE3URZ.js.map} +1 -1
  82. package/dist/codex-event-PPNVRRDH.js +16 -0
  83. package/dist/codex-host-2RJOJW2B.js +28 -0
  84. package/dist/codex-install-UUZ6QMBQ.js +221 -0
  85. package/dist/codex-install-UUZ6QMBQ.js.map +1 -0
  86. package/dist/{config-OJQI27LT.js → config-ZD4OB2DO.js} +18 -12
  87. package/dist/{doctor-IQQJHGGM.js → doctor-KBR34Q4B.js} +48 -37
  88. package/dist/doctor-KBR34Q4B.js.map +1 -0
  89. package/dist/{fund-WEV6DMTD.js → fund-5ITKQGYF.js} +38 -31
  90. package/dist/{fund-WEV6DMTD.js.map → fund-5ITKQGYF.js.map} +1 -1
  91. package/dist/hook-command-4TYCHHRL.js +39 -0
  92. package/dist/hosts/claude/.claude-plugin/marketplace.json +2 -2
  93. package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +3 -2
  94. package/dist/hosts/claude/tenjin/hooks/hooks.json +4 -1
  95. package/dist/hosts/claude/tenjin/hooks/register.tsx +589 -0
  96. package/dist/hosts/claude/tenjin/types/index.d.ts +41 -0
  97. package/dist/hosts/codex/.agents/plugins/marketplace.json +20 -0
  98. package/dist/hosts/codex/tenjin/.codex-plugin/plugin.json +16 -0
  99. package/dist/hosts/codex/tenjin/.mcp.json +12 -0
  100. package/dist/hosts/codex/tenjin/hooks/hooks.json +52 -0
  101. package/dist/hosts-FWZOV26H.js +216 -0
  102. package/dist/hosts-FWZOV26H.js.map +1 -0
  103. package/dist/index.js +5 -5
  104. package/dist/{install-TUCRF32I.js → install-XWGE4Q7L.js} +38 -21
  105. package/dist/{install-identity-WHPNMNMQ.js → install-identity-K7EJIQFP.js} +11 -7
  106. package/dist/{install-wallet-MA27FTQ5.js → install-wallet-XQ6XFZV4.js} +27 -23
  107. package/dist/{install-wallet-MA27FTQ5.js.map → install-wallet-XQ6XFZV4.js.map} +1 -1
  108. package/dist/{mcp-QML7ZMPH.js → mcp-3LIJSSJB.js} +184 -58
  109. package/dist/mcp-3LIJSSJB.js.map +1 -0
  110. package/dist/{package-LGKYOEPV.js → package-ZKQFDWLE.js} +2 -2
  111. package/dist/{pay-2C2UBBXJ.js → pay-WHBERZ3W.js} +27 -23
  112. package/dist/{payments-C44QUFXU.js → payments-KVICEKD2.js} +14 -10
  113. package/dist/{payments-C44QUFXU.js.map → payments-KVICEKD2.js.map} +1 -1
  114. package/dist/plugin-registration-5TIA564H.js +54 -0
  115. package/dist/plugin-registration-5TIA564H.js.map +1 -0
  116. package/dist/{send-KVJX4XIR.js → send-7G7Y7DLN.js} +25 -19
  117. package/dist/{send-KVJX4XIR.js.map → send-7G7Y7DLN.js.map} +1 -1
  118. package/dist/{status-S7C3WMSH.js → status-OF7RH5HM.js} +26 -21
  119. package/dist/{status-S7C3WMSH.js.map → status-OF7RH5HM.js.map} +1 -1
  120. package/dist/{status-line-YR2T5HC4.js → status-line-XOUE6MPL.js} +10 -6
  121. package/dist/{status-line-YR2T5HC4.js.map → status-line-XOUE6MPL.js.map} +1 -1
  122. package/dist/{uninstall-HY6LKIIT.js → uninstall-JXUAFNDB.js} +30 -21
  123. package/dist/{uninstall-HY6LKIIT.js.map → uninstall-JXUAFNDB.js.map} +1 -1
  124. package/dist/update-ZKUERSO2.js +44 -0
  125. package/dist/update-ZKUERSO2.js.map +1 -0
  126. package/dist/{usdc-JK4RRFFQ.js → usdc-OGOGEHV2.js} +7 -6
  127. package/dist/usdc-OGOGEHV2.js.map +1 -0
  128. package/dist/{viemAdapter-By13KInL-X2VY6CY3.js → viemAdapter-By13KInL-S3DA7DFW.js} +2 -2
  129. package/dist/viemAdapter-By13KInL-S3DA7DFW.js.map +1 -0
  130. package/dist/{wallet-PD2IMZDU.js → wallet-2HA6W4R4.js} +24 -20
  131. package/dist/wallet-2HA6W4R4.js.map +1 -0
  132. package/docs/agent-permissions.md +21 -5
  133. package/package.json +1 -1
  134. package/dist/chunk-3O2BQIF6.js.map +0 -1
  135. package/dist/chunk-6W5GYG3W.js.map +0 -1
  136. package/dist/chunk-JMM6YE7J.js.map +0 -1
  137. package/dist/chunk-KHE6L6TD.js.map +0 -1
  138. package/dist/chunk-O2FRQ2L2.js.map +0 -1
  139. package/dist/chunk-OK2TDZQU.js.map +0 -1
  140. package/dist/chunk-TTBKWWTV.js.map +0 -1
  141. package/dist/chunk-U6YQ6FRI.js.map +0 -1
  142. package/dist/chunk-WO5BJNIB.js.map +0 -1
  143. package/dist/doctor-IQQJHGGM.js.map +0 -1
  144. package/dist/hook-command-D2P3ILRV.js +0 -32
  145. package/dist/mcp-QML7ZMPH.js.map +0 -1
  146. package/dist/update-OJV22LR3.js +0 -36
  147. /package/dist/{_esm-CE7KNONL.js.map → _esm-MEXZI5DL.js.map} +0 -0
  148. /package/dist/{alive-3J3CHOQP.js.map → alive-J64H46HI.js.map} +0 -0
  149. /package/dist/{chunk-PAYV4XUA.js.map → chunk-4ZZO6ULA.js.map} +0 -0
  150. /package/dist/{chunk-YHKXNYTB.js.map → chunk-5K5W4S66.js.map} +0 -0
  151. /package/dist/{chunk-HPWO4O6S.js.map → chunk-6E5R45ZO.js.map} +0 -0
  152. /package/dist/{chunk-LFZJM56J.js.map → chunk-7Q5FDF65.js.map} +0 -0
  153. /package/dist/{chunk-AEG2PXBP.js.map → chunk-7ZRL2LBQ.js.map} +0 -0
  154. /package/dist/{chunk-VFMQTSXG.js.map → chunk-B7HUUJOK.js.map} +0 -0
  155. /package/dist/{chunk-EL56RW2J.js.map → chunk-BL3332HQ.js.map} +0 -0
  156. /package/dist/{chunk-EBVIKMCH.js.map → chunk-JKKAIPTU.js.map} +0 -0
  157. /package/dist/{chunk-N35E6CM2.js.map → chunk-K3I7C2MO.js.map} +0 -0
  158. /package/dist/{chunk-RAULEAZ6.js.map → chunk-KXQ4UIP7.js.map} +0 -0
  159. /package/dist/{chunk-VZGAONSJ.js.map → chunk-KXVP2VKA.js.map} +0 -0
  160. /package/dist/{chunk-AWQPGIR6.js.map → chunk-NEFNKLBE.js.map} +0 -0
  161. /package/dist/{chunk-YFQOA5AU.js.map → chunk-R5LCN54M.js.map} +0 -0
  162. /package/dist/{chunk-NZIP4PA2.js.map → chunk-WK7F3B2E.js.map} +0 -0
  163. /package/dist/{config-OJQI27LT.js.map → clack-EZ7TDWQU.js.map} +0 -0
  164. /package/dist/{hook-command-D2P3ILRV.js.map → claude-cli-2YKABJJZ.js.map} +0 -0
  165. /package/dist/{install-TUCRF32I.js.map → codex-event-PPNVRRDH.js.map} +0 -0
  166. /package/dist/{install-identity-WHPNMNMQ.js.map → codex-host-2RJOJW2B.js.map} +0 -0
  167. /package/dist/{package-LGKYOEPV.js.map → config-ZD4OB2DO.js.map} +0 -0
  168. /package/dist/{pay-2C2UBBXJ.js.map → hook-command-4TYCHHRL.js.map} +0 -0
  169. /package/dist/{update-OJV22LR3.js.map → install-XWGE4Q7L.js.map} +0 -0
  170. /package/dist/{usdc-JK4RRFFQ.js.map → install-identity-K7EJIQFP.js.map} +0 -0
  171. /package/dist/{viemAdapter-By13KInL-X2VY6CY3.js.map → package-ZKQFDWLE.js.map} +0 -0
  172. /package/dist/{wallet-PD2IMZDU.js.map → pay-WHBERZ3W.js.map} +0 -0
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  </picture>
6
6
  </p>
7
7
 
8
- <h3 align="center">The tool router for coding agents. Tenjin picks the right tool when your agent needs one, and one wallet pays for every call.</h3>
8
+ <h3 align="center">The tool router for coding agents.</h3>
9
9
 
10
10
  <p align="center">
11
11
  <a href="https://www.npmjs.com/package/tenjin-cli"><img src="https://img.shields.io/npm/v/tenjin-cli?color=C85A3B&label=npm" alt="npm version"></a>
@@ -14,9 +14,10 @@
14
14
  </p>
15
15
 
16
16
  <p align="center">
17
- <a href="#quick-start">Quick start</a> ·
18
- <a href="#what-it-can-do">Tools</a> ·
19
- <a href="#wallet-and-payments">Wallet &amp; payments</a> ·
17
+ <a href="#install">Install</a> ·
18
+ <a href="#try-it">Try it</a> ·
19
+ <a href="#what-your-agent-can-do">Tools</a> ·
20
+ <a href="#wallet-and-limits">Wallet and limits</a> ·
20
21
  <a href="#request-a-tool">Request a tool</a>
21
22
  </p>
22
23
 
@@ -24,169 +25,117 @@
24
25
  <img src="./assets/demo.gif" alt="Tenjin in Claude Code: research, live crypto prices, company lookup, email verification, and computation" width="720">
25
26
  </p>
26
27
 
27
- ---
28
-
29
28
  ## Why
30
29
 
31
- Giving your agent good tools is a chore today:
30
+ Giving your coding agent good tools is a chore:
32
31
 
33
- - **A key for every tool.** Sign up, pick a plan, paste an API key into a config file. Five tools, five accounts.
34
- - **MCP servers crowd the context.** Every server you install loads its tool definitions into every session, needed or not.
35
- - **Your agent forgets anyway.** It reaches for plain web search out of habit, so you write rules to remind it, and it still slips.
36
- - **Some tools you need once.** Installing something permanent for a one-off lookup isn't worth the setup.
32
+ - **A key for every tool.** Sign up, pick a plan, paste an API key. Five tools, five accounts.
33
+ - **MCP servers crowd the context.** Each one loads its tool list into every session, needed or not.
34
+ - **Your agent forgets anyway.** It reaches for plain web search, so you write rules, and it still slips.
35
+ - **Some tools you need once.** A one-off lookup isn't worth the setup.
37
36
 
38
- Tenjin handles all of it. Install it once and keep working. The Tenjin router watches the moments where a tool could help: your prompt, your agent's web searches and page fetches, the tasks it hands to subagents, and the questions it asks you. When a curated tool beats what your agent was about to do, the router suggests it and your agent calls it. Your wallet pays for each call through [x402](#wallet-and-payments), so you manage no keys and install nothing new.
37
+ With Tenjin, you install once and keep working. The router suggests the right tool when it helps, and your wallet pays per call. No keys, no extra servers, no rules.
39
38
 
40
- ## Quick start
39
+ ## Install
41
40
 
42
- In Claude Code or Claude Desktop, paste:
41
+ Paste this into Claude Code:
43
42
 
44
43
  ```text
45
44
  Install Tenjin from tenjin.sh
46
45
  ```
47
46
 
48
- Your agent asks you about spend limits, installs it, then asks whether to add funds now; you never type a command. 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.
47
+ Your agent asks before it installs or spends anything, then sets everything up. Start a new session, and the router is on.
49
48
 
50
- Or in a terminal (Node.js 22 or newer):
49
+ Or from a terminal:
51
50
 
52
51
  ```bash
53
52
  npm i -g tenjin-cli
54
- tenjin install # adds the Tenjin plugin to Claude Code and creates your wallet
53
+ tenjin install # adds the plugin and creates your wallet
55
54
  tenjin wallet fund 5 # optional: add $5 with a card, via Coinbase
56
55
  ```
57
56
 
58
- ## What it can do
59
-
60
- The router picks from a catalog we curate and maintain. When nothing in it fits, it can point your agent at a reviewed third-party pay-per-call service from the [Tenjin list](#tenjin-list-and-experimental-bazaar), and your agent decides whether to use it or to ask you first. Each routing call costs a flat [routing fee](#routing-fee) of $0.003, on top of the provider's price, paid from channel deposits of up to $0.25 that count against the spend limits you approve at install.
61
-
62
- | Tool | What your agent gets | Price per call |
63
- | -------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -------------- |
64
- | **Docs lookup** · [Context7](https://context7.com) | Current, version-specific docs for a library or API | **Free** |
65
- | **Web research** · [Exa](https://exa.ai) | Search results with the page content, not just links | $0.007 |
66
- | **Read a page** · [Firecrawl](https://firecrawl.dev) | One exact page as clean text, even when a plain fetch fails | $0.01 |
67
- | **Crypto prices** · [CoinMarketCap](https://coinmarketcap.com) | Live quotes for any coin | $0.01 |
68
- | **Compute** · [Wolfram Alpha](https://www.wolframalpha.com) | Math, unit conversions, science and data questions | $0.02 |
69
- | **Email check** · [Hunter](https://hunter.io) | Whether an address is real and deliverable | $0.008 |
70
- | **Person lookup** · [Apollo](https://www.apollo.io) | A professional profile and work email from a name and company, a LinkedIn URL or an email | $0.01 |
71
- | **Company profile** · [Apollo](https://www.apollo.io) | Industry, headcount, revenue and funding from a domain | $0.01 |
72
- | **Company match** · [CompanyEnrich](https://companyenrich.com) | The company behind a name or a social URL | $0.01225 |
73
- | **X posts** · [glim](https://glim.sh) | Posts matching a search, or one post with its thread | $0.005 |
74
- | **Reddit** · [glim](https://glim.sh) | Posts matching a search, or one thread with its comments | $0.01 / $0.005 |
75
-
76
- Every tool, including the Tenjin list, with current prices: [tenjin.sh/tools](https://tenjin.sh/tools). More are added by demand: [tell us what you want](#request-a-tool).
57
+ Needs Claude Code 2.1.287+ and Node.js 22+. Add `--project` to set it up for one project only.
77
58
 
78
- ### Tenjin list and experimental Bazaar
59
+ **Codex (experimental):** run `tenjin install` in Codex or a terminal, and it sets up Codex too. [How it hooks in →](./docs/agent-permissions.md#codex)
79
60
 
80
- **The Tenjin list is on by default.** When nothing in the catalog fits a step (such as generating a sound effect), the router may suggest one third-party pay-per-call x402 service that Tenjin has reviewed. The suggestion names the seller, the URL, the price and the input it takes, and your agent judges whether to use it or to ask you first. It is paid like any lookup, under your spend limits.
61
+ ## Try it
81
62
 
82
- **The open Bazaar is experimental and off by default.** Turn it on with:
63
+ Work as usual. Ask for something your agent can't do on its own:
83
64
 
84
- ```sh
85
- tenjin config set experimental.bazaar on
65
+ ```text
66
+ > Generate a 10-second voiceover that says "Welcome to Tenjin"
67
+ > Make a whoosh sound effect for a page transition
68
+ > Make a hero image of plum blossoms in ukiyo-e style
69
+ > Make a 5-second video of a paper crane unfolding
70
+ > Summarize the risk factors in Nvidia's latest 10-K
71
+ > What are people on Reddit saying about Bun vs Node lately?
86
72
  ```
87
73
 
88
- With it on, the router may also suggest sellers from Coinbase's open x402 Bazaar, and to find them, short snippets of your prompts are sent to Coinbase's public Bazaar search. Those sellers are unreviewed third parties, matches can be noisy, prices can vary with the input, and payments are real, under your spend limits. `tenjin config` and `tenjin doctor` show both settings. Turn it off with `tenjin config set experimental.bazaar off`.
89
-
90
- ## How it works
74
+ The router names the tool and its price, and your agent calls it.
91
75
 
92
- ```mermaid
93
- flowchart LR
94
- A["Your prompt,<br>a web search,<br>or a subagent task"] --> B{"Tenjin<br>router"}
95
- B -- "a tool fits" --> C["Agent calls it<br>through x402"]
96
- C --> D["Wallet pays the provider,<br>result comes back"]
97
- B -- "nothing better" --> E["Agent carries on"]
98
- ```
76
+ ## What your agent can do
99
77
 
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.
78
+ | Your agent needs | With | Per call |
79
+ | -------------------------------------- | ------------------------------- | ------------- |
80
+ | Library docs | Context7 | free |
81
+ | Web search and page reads | Exa, Firecrawl | 0.1¢ to 1.5¢ |
82
+ | Math and live crypto prices | Wolfram Alpha, CoinMarketCap | 1¢ to 2¢ |
83
+ | People, companies and emails | Apollo, Hunter, CompanyEnrich | 0.8¢ to 15¢ |
84
+ | X and Reddit | glim | 0.1¢ to 1¢ |
85
+ | Images | GPT Image, Nano Banana, Recraft | 0.1¢ to 14.4¢ |
86
+ | Voiceovers, sound effects, music | ElevenLabs, Google Lyria | 1¢ to 12¢ |
87
+ | Video clips | MiniMax Hailuo, Google Veo | 15.5¢ to 45¢ |
88
+ | Papers and SEC filings | arXiv, PubMed, SEC EDGAR | 0.3¢ to 4¢ |
89
+ | Instagram, TikTok and Google Maps | Scrape Creators, Google Maps | 2¢ |
90
+ | PDFs, OCR, screenshots, hosting, email | Cloudflare and others | 0.2¢ to 50¢ |
101
91
 
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.
92
+ We review every tool by hand. [Every tool and its current price →](https://tenjin.sh/tools)
103
93
 
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)
105
-
106
- ## Wallet and payments
94
+ ## How it works
107
95
 
108
- Tenjin pays for tools with [x402](https://www.x402.org), an open standard that builds payments into HTTP. A paid endpoint answers `402 Payment Required` with its price, the client signs a payment for that amount, and the endpoint returns the result. Neither side needs an account or an API key. Read more: [x402.org](https://www.x402.org) · [whitepaper](https://www.x402.org/x402-whitepaper.pdf) · [Coinbase docs](https://docs.cdp.coinbase.com/x402/welcome) · [spec and SDKs](https://github.com/coinbase/x402).
96
+ 1. The router watches the moments a tool could help: your prompt, each web search or page fetch, each task handed to a subagent, and each question your agent asks you.
97
+ 2. Jev, a decision model from [TypeSafe](https://typesafe.ai), picks one tool from the catalog, or none. Your agent sees one line naming the tool and its price.
98
+ 3. Your agent calls it through the plugin's `request` tool, and your wallet pays the provider. When nothing fits, your agent carries on with its own tools.
109
99
 
110
- ### Your wallet
100
+ The router sees your prompt and up to six earlier messages, with secrets masked, and never sees tool results. [What the hooks send →](./docs/agent-permissions.md#what-the-hooks-send)
111
101
 
112
- `tenjin install` creates a wallet on your machine that holds [USDC](https://www.circle.com/usdc) on [Base](https://base.org). Tenjin encrypts the private key, unlocks it through your OS keychain, and never sends it anywhere. Tenjin never holds or moves your funds. Paying a provider costs no gas.
102
+ ## Wallet and limits
113
103
 
114
- ### Limits
104
+ `tenjin install` creates a wallet on your machine that holds USDC on Base. Its key never leaves your machine, and Tenjin never holds your funds. Payments run over [x402](https://www.x402.org) ([whitepaper](https://www.x402.org/x402-whitepaper.pdf), [Coinbase docs](https://docs.cdp.coinbase.com/x402/welcome)).
115
105
 
116
106
  | Limit | Default | Change it |
117
107
  | -------- | ------- | ------------------------------------- |
118
108
  | Per day | $5 | `tenjin config set sessionBudget 2` |
119
109
  | Per call | $0.25 | `tenjin config set maxAutoSpend 0.50` |
120
110
 
121
- The daily budget is the control, the per-call limit is the runaway guard, and your wallet balance is the hard stop. Both defaults hold from the moment you install. `tenjin install` asks once, or tells your agent to ask you when the agent runs it: use the defaults, or set your own limits. The per-call limit cannot go below $0.25, the routing deposit. To turn the router off, run `tenjin config set router.enabled false`.
122
-
123
- A call that would pay more than the per-call limit (all its payments together, such as five takes of a video; today two video models at $0.42 and $0.45, hosting at $0.50 and research at $0.60 are priced above it) 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)
124
-
125
- ### Routing fee
126
-
127
- 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. 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).
128
-
129
- ### Funding
130
-
131
- `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).
111
+ - A call over a limit pays nothing until you say yes. The per-call limit can't go below $0.25.
112
+ - Routing costs $0.003 a call, on top of the tool's price. $5 covers about 500 web searches, 130 images or 40 voiceovers.
113
+ - Add funds with `tenjin wallet fund 5`, or send USDC on Base to the address `tenjin wallet address` prints.
132
114
 
133
- $5, the Apple Pay and Google Pay minimum, covers about 700 web searches, 500 page reads or 250 Wolfram Alpha answers.
115
+ [How the limits and the fee work →](./docs/agent-permissions.md#what-bounds-a-payment)
134
116
 
135
- ### Withdrawing
136
-
137
- `tenjin wallet send <amount> USDC <address>` sends funds to any address. It's a regular onchain transfer, so it needs a little ETH on Base for gas.
138
-
139
- ## Everyday commands
117
+ ## Commands
140
118
 
141
119
  ```bash
142
- tenjin status # what you've spent today
143
- tenjin wallet balance # what's left
144
- tenjin wallet fund 5 # top up
145
- tenjin payments # the paid lookups this machine made
146
- tenjin payments reconcile # settle paid lookups whose settlement was unknown
147
- tenjin update # newest version; wallet and settings stay
148
- tenjin config set router.enabled false # pause the router on this machine
149
- tenjin config set --project router.enabled false # ...or just in this repo
150
- tenjin uninstall # remove the Claude Code plugin; your wallet stays
120
+ tenjin status # spent today, and your limits
121
+ tenjin wallet balance # what's left
122
+ tenjin payments # paid lookups from this machine
123
+ tenjin doctor # check that a lookup can run
124
+ tenjin update # newest version; wallet and settings stay
125
+ tenjin config set router.enabled false # pause the router
126
+ tenjin uninstall # remove the plugin; your wallet stays
151
127
  ```
152
128
 
153
- 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.
154
-
155
- 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.
156
-
157
- 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)
158
-
159
- <details>
160
- <summary>Spending limits: the fine print</summary>
161
-
162
- Limits are set only where no setting exists yet, so an update never overwrites yours. The daily budget is a rolling 24-hour window. Setting the daily limit to `0` blocks automatic payments; `tenjin config set sessionBudget none` removes the daily ceiling only.
163
-
164
- `tenjin pay <url>` pays any x402 endpoint you name. It ignores the automatic limits and always asks for your consent to the quoted price, interactively or with `--yes`. It is never used as a workaround when the router refuses. See the [safety model](./docs/safety-model.md).
165
-
166
- </details>
167
-
168
129
  ## Request a tool
169
130
 
170
- Tenjin is in alpha, and the catalog grows with what people ask for. Missing a service your agent keeps needing? Hit a lookup that went to the wrong place? We want to hear it.
131
+ Tenjin is in alpha, and the catalog grows with what people ask for.
171
132
 
172
133
  - **[Request a tool →](https://github.com/BackTrackCo/tenjin-agent/issues/new?title=Tool%20request%3A%20&labels=enhancement)**
173
134
  - **[Report a bug →](https://github.com/BackTrackCo/tenjin-agent/issues/new?labels=bug)**
174
135
 
175
136
  ## Learn more
176
137
 
177
- - [How a lookup runs, what it sends, and what install writes](./docs/agent-permissions.md)
138
+ - [Permissions, hooks, and what install writes](./docs/agent-permissions.md)
178
139
  - [Safety model](./docs/safety-model.md)
179
140
  - [Troubleshooting](./docs/troubleshooting.md)
180
-
181
- ## Developing
182
-
183
- Before contributing, read [CONTRIBUTING.md](./CONTRIBUTING.md) for the contributor agreement.
184
-
185
- ```bash
186
- pnpm install
187
- pnpm run githooks # once, to use the repo's git hooks
188
- pnpm run build
189
- pnpm run test
190
- pnpm run typecheck
191
- pnpm run lint
192
- ```
141
+ - [Contributing](./CONTRIBUTING.md)
@@ -93,7 +93,7 @@ import {
93
93
  withTimeout,
94
94
  zeroAddress,
95
95
  zeroHash
96
- } from "./chunk-AWQPGIR6.js";
96
+ } from "./chunk-NEFNKLBE.js";
97
97
  import {
98
98
  InvalidDomainError,
99
99
  InvalidPrimaryTypeError,
@@ -127,8 +127,7 @@ import {
127
127
  toPrefixedMessage,
128
128
  toRlp,
129
129
  validateTypedData
130
- } from "./chunk-N35E6CM2.js";
131
- import "./chunk-JRGFKVAZ.js";
130
+ } from "./chunk-K3I7C2MO.js";
132
131
  import {
133
132
  AccountStateConflictError,
134
133
  AtomicReadyWalletRejectedUpgradeError,
@@ -433,6 +432,7 @@ import {
433
432
  trim,
434
433
  weiUnits
435
434
  } from "./chunk-EGELTSPU.js";
435
+ import "./chunk-JRGFKVAZ.js";
436
436
  import "./chunk-KG3D7FIF.js";
437
437
  import "./chunk-RBJPAZFI.js";
438
438
  import "./chunk-BPMWXTFX.js";
@@ -877,4 +877,4 @@ export {
877
877
  zeroAddress,
878
878
  zeroHash
879
879
  };
880
- //# sourceMappingURL=_esm-CE7KNONL.js.map
880
+ //# sourceMappingURL=_esm-MEXZI5DL.js.map
@@ -1,21 +1,31 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
2
  import {
3
+ WALLET_READ_MS,
3
4
  aliveDir,
4
5
  aliveMain,
5
6
  markSessionServed,
6
7
  readAliveStamp,
7
8
  removeAliveState,
8
9
  runAliveHook,
9
- sessionServedByPlugin
10
- } from "./chunk-6W5GYG3W.js";
10
+ sessionServedByPlugin,
11
+ walletNotice
12
+ } from "./chunk-I3EQFHCD.js";
13
+ import "./chunk-YVFXE7RR.js";
14
+ import "./chunk-XQJXNMSB.js";
15
+ import "./chunk-3UCIG4TG.js";
16
+ import "./chunk-27EPWVOY.js";
17
+ import "./chunk-7WEQQJLG.js";
18
+ import "./chunk-SJLTEINJ.js";
11
19
  import "./chunk-ZXTAQYNA.js";
12
20
  export {
21
+ WALLET_READ_MS,
13
22
  aliveDir,
14
23
  aliveMain,
15
24
  markSessionServed,
16
25
  readAliveStamp,
17
26
  removeAliveState,
18
27
  runAliveHook,
19
- sessionServedByPlugin
28
+ sessionServedByPlugin,
29
+ walletNotice
20
30
  };
21
- //# sourceMappingURL=alive-3J3CHOQP.js.map
31
+ //# sourceMappingURL=alive-J64H46HI.js.map
@@ -1,68 +1,11 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
+ import {
3
+ writeFileAtomic
4
+ } from "./chunk-7WEQQJLG.js";
2
5
  import {
3
6
  balanceCachePath
4
7
  } from "./chunk-SJLTEINJ.js";
5
8
 
6
- // src/lib/atomic-json.ts
7
- import { chmod, link, mkdir, open, rename, rm, writeFile } from "node:fs/promises";
8
- import { randomBytes } from "node:crypto";
9
- import { basename, dirname, join } from "node:path";
10
- var isWindows = process.platform === "win32";
11
- async function writeFileAtomic(targetPath, data, opts = {}) {
12
- const dir = dirname(targetPath);
13
- const fileMode = opts.mode ?? 420;
14
- const dirMode = opts.dirMode ?? 493;
15
- await mkdir(dir, { recursive: true, ...isWindows ? {} : { mode: dirMode } });
16
- const tmpPath = join(dir, `.${basename(targetPath)}.${randomBytes(6).toString("hex")}.tmp`);
17
- try {
18
- await writeFile(tmpPath, data, isWindows ? void 0 : { mode: fileMode });
19
- if (!isWindows) await chmod(tmpPath, fileMode);
20
- await rename(tmpPath, targetPath);
21
- } catch (err) {
22
- await rm(tmpPath, { force: true }).catch(() => void 0);
23
- throw err;
24
- }
25
- }
26
- async function writeFileAtomicExclusive(targetPath, data, opts = {}) {
27
- const dir = dirname(targetPath);
28
- const fileMode = opts.mode ?? 420;
29
- const dirMode = opts.dirMode ?? 493;
30
- await mkdir(dir, { recursive: true, ...isWindows ? {} : { mode: dirMode } });
31
- if (isWindows) {
32
- const handle = await open(targetPath, "wx");
33
- try {
34
- await handle.writeFile(data);
35
- await handle.sync();
36
- } finally {
37
- await handle.close();
38
- }
39
- return;
40
- }
41
- const tmpPath = join(dir, `.${basename(targetPath)}.${randomBytes(6).toString("hex")}.tmp`);
42
- try {
43
- const handle = await open(tmpPath, "wx", fileMode);
44
- try {
45
- await handle.writeFile(data);
46
- await handle.chmod(fileMode);
47
- await handle.sync();
48
- } finally {
49
- await handle.close();
50
- }
51
- await link(tmpPath, targetPath);
52
- await fsyncDir(dir);
53
- } finally {
54
- await rm(tmpPath, { force: true }).catch(() => void 0);
55
- }
56
- }
57
- async function fsyncDir(dir) {
58
- const handle = await open(dir, "r");
59
- try {
60
- await handle.sync();
61
- } finally {
62
- await handle.close();
63
- }
64
- }
65
-
66
9
  // src/lib/usdc-balance.ts
67
10
  import { readFile } from "node:fs/promises";
68
11
  var USDC_ADDRESS = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
@@ -156,13 +99,10 @@ async function recallBalance(path, address, now) {
156
99
  }
157
100
 
158
101
  export {
159
- writeFileAtomic,
160
- writeFileAtomicExclusive,
161
- fsyncDir,
162
102
  USDC_ADDRESS,
163
103
  readUsdcBalance,
164
104
  DEFAULT_RPC_URL,
165
105
  readUsdcBalanceWithFallback,
166
106
  rememberingBalanceReader
167
107
  };
168
- //# sourceMappingURL=chunk-O2FRQ2L2.js.map
108
+ //# sourceMappingURL=chunk-27EPWVOY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/usdc-balance.ts"],"sourcesContent":["/**\n * Base USDC's address and one `balanceOf` over plain JSON-RPC. No viem on\n * purpose: the router hooks read a balance before they redirect a call, and\n * their chunk graph must stay free of it (`src/router/dist-chunks.test.ts`).\n * One `eth_call` needs nothing viem adds. `usdc.ts` keeps the viem client for\n * the send path and re-exports the address from here.\n */\n\nimport { readFile } from 'node:fs/promises';\nimport { writeFileAtomic } from './atomic-json';\nimport { balanceCachePath } from './paths';\n\n// Values mirror the app's lib/chain.ts Base mainnet entry (chain 8453).\nexport const USDC_ADDRESS = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';\n\n/** `balanceOf(address)`: the first four bytes of its keccak-256. */\nconst BALANCE_OF_SELECTOR = '0x70a08231';\nconst ADDRESS_RE = /^0x[0-9a-fA-F]{40}$/;\n/** One ABI word: what `balanceOf` returns. */\nconst WORD_RE = /^0x[0-9a-fA-F]{64}$/;\n\n/**\n * The address's USDC balance in atomic units, or null when it could not be\n * read inside `timeoutMs`: a transport failure, a non-2xx, an RPC error, or an\n * answer that is not one word. Never throws, so the caller picks which way an\n * unreadable balance falls.\n */\nexport async function readUsdcBalance(\n address: string,\n rpcUrl: string,\n opts: { timeoutMs: number; fetchImpl?: typeof fetch },\n): Promise<bigint | null> {\n if (!ADDRESS_RE.test(address) || opts.timeoutMs <= 0) return null;\n try {\n const res = await (opts.fetchImpl ?? fetch)(rpcUrl, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({\n jsonrpc: '2.0',\n id: 1,\n method: 'eth_call',\n params: [\n {\n to: USDC_ADDRESS,\n data: `${BALANCE_OF_SELECTOR}${address.slice(2).toLowerCase().padStart(64, '0')}`,\n },\n 'latest',\n ],\n }),\n signal: AbortSignal.timeout(opts.timeoutMs),\n });\n if (!res.ok) return null;\n const result = ((await res.json()) as { result?: unknown } | null)?.result;\n return typeof result === 'string' && WORD_RE.test(result) ? BigInt(result) : null;\n } catch {\n return null;\n }\n}\n\n/** Base's public RPC: the shipped `rpcUrl` default (`CONFIG_DEFAULTS`). */\nexport const DEFAULT_RPC_URL = 'https://mainnet.base.org';\n\n/**\n * Public Base RPCs a balance read on the DEFAULT `rpcUrl` falls back to, in\n * order, only after it fails. mainnet.base.org rate-limits a busy IP\n * (`-32016 over rate limit`): four paid lookups across two research runs were\n * refused with `balance_unavailable` before signing, while these two answered\n * every read. They see the wallet's address only when the default did not\n * answer, as the default sees it on every read.\n */\nexport const FALLBACK_RPC_URLS: readonly string[] = [\n 'https://base-rpc.publicnode.com',\n 'https://base.drpc.org',\n];\n\n/**\n * {@link readUsdcBalance} from `rpcUrl` first and, when that is the default,\n * then from each of {@link FALLBACK_RPC_URLS} until one answers, all inside the\n * one `timeoutMs`. Every RPC but the last gets half of what is left, so one\n * that hangs still leaves the others time to answer.\n *\n * AN RPC THE USER CONFIGURED IS THE ONLY ONE ASKED. Choosing one can be about\n * privacy, and the public RPCs would see the wallet's address; a read that\n * fails there fails, as it did before the fallbacks.\n */\nexport async function readUsdcBalanceWithFallback(\n address: string,\n rpcUrl: string,\n opts: { timeoutMs: number; fetchImpl?: typeof fetch },\n): Promise<bigint | null> {\n const urls = sameUrl(rpcUrl, DEFAULT_RPC_URL) ? [rpcUrl, ...FALLBACK_RPC_URLS] : [rpcUrl];\n const deadline = Date.now() + opts.timeoutMs;\n for (const [index, url] of urls.entries()) {\n const left = deadline - Date.now();\n if (left <= 0) return null;\n const timeoutMs = index === urls.length - 1 ? left : Math.ceil(left / 2);\n const balance = await readUsdcBalance(address, url, { ...opts, timeoutMs });\n if (balance !== null) return balance;\n }\n return null;\n}\n\nfunction sameUrl(a: string, b: string): boolean {\n try {\n return new URL(a).href === new URL(b).href;\n } catch {\n return a === b;\n }\n}\n\n/**\n * How long the hooks remember a balance read. Base's public RPC refuses the\n * sixth `eth_call` in a second, which a burst of parallel lookups reaches, and\n * each hook then waited on a failed read. A minute carries a burst past that;\n * the hooks' read only decides whether to offer.\n */\nexport const LAST_KNOWN_BALANCE_MS = 60_000;\n\n/**\n * {@link readUsdcBalanceWithFallback} for the router hooks, which returns the\n * last read it made for this address while it is under\n * {@link LAST_KNOWN_BALANCE_MS} old, without asking an RPC, and reads the chain\n * otherwise. A read that fails on every RPC is null, never the remembered\n * balance. The RPC URL is never stored, since it can embed a key.\n *\n * NEVER FOR A PAYMENT. `tenjin pay` reads the signer's balance live\n * immediately before signing (docs/agent-permissions.md): a minute-old balance\n * can be one the wallet has since spent.\n */\nexport function rememberingBalanceReader(\n dataDir: string,\n opts: { now?: () => number; read?: typeof readUsdcBalance } = {},\n): typeof readUsdcBalance {\n const read = opts.read ?? readUsdcBalanceWithFallback;\n const now = opts.now ?? Date.now;\n const path = balanceCachePath(dataDir);\n return async (address, rpcUrl, readOpts) => {\n const remembered = await recallBalance(path, address, now());\n if (remembered !== null) return remembered;\n const live = await read(address, rpcUrl, readOpts);\n if (live === null) return null;\n const record = {\n version: 1,\n address: address.toLowerCase(),\n atomic: live.toString(),\n at: now(),\n };\n try {\n await writeFileAtomic(path, JSON.stringify(record), { mode: 0o600, dirMode: 0o700 });\n } catch {\n // A cache that cannot be written is a cache that is not used.\n }\n return live;\n };\n}\n\n/** The remembered balance for this address while it is fresh, else null. */\nasync function recallBalance(path: string, address: string, now: number): Promise<bigint | null> {\n try {\n const row = JSON.parse(await readFile(path, 'utf8')) as Record<string, unknown> | null;\n if (\n row?.version !== 1 ||\n row.address !== address.toLowerCase() ||\n typeof row.atomic !== 'string' ||\n !/^\\d{1,40}$/.test(row.atomic) ||\n typeof row.at !== 'number' ||\n now - row.at < 0 ||\n now - row.at > LAST_KNOWN_BALANCE_MS\n ) {\n return null;\n }\n return BigInt(row.atomic);\n } catch {\n return null;\n }\n}\n"],"mappings":"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","names":[]}
@@ -1,10 +1,7 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
2
  import {
3
3
  createLocalSpendAuthorizer
4
- } from "./chunk-AEG2PXBP.js";
5
- import {
6
- emitNotice
7
- } from "./chunk-KYFZTGMC.js";
4
+ } from "./chunk-7ZRL2LBQ.js";
8
5
  import {
9
6
  hashAuthorization,
10
7
  hashMessage,
@@ -13,12 +10,7 @@ import {
13
10
  publicKeyToAddress,
14
11
  serializeSignature,
15
12
  serializeTransaction
16
- } from "./chunk-N35E6CM2.js";
17
- import {
18
- hmac,
19
- secp256k1,
20
- sha256
21
- } from "./chunk-JRGFKVAZ.js";
13
+ } from "./chunk-K3I7C2MO.js";
22
14
  import {
23
15
  InvalidAddressError,
24
16
  concat3 as concat,
@@ -34,6 +26,11 @@ import {
34
26
  toHex,
35
27
  toHex2
36
28
  } from "./chunk-EGELTSPU.js";
29
+ import {
30
+ hmac,
31
+ secp256k1,
32
+ sha256
33
+ } from "./chunk-JRGFKVAZ.js";
37
34
  import {
38
35
  ahash,
39
36
  anumber,
@@ -46,18 +43,23 @@ import {
46
43
  swap32IfBE,
47
44
  u32
48
45
  } from "./chunk-BPMWXTFX.js";
46
+ import {
47
+ emitNotice
48
+ } from "./chunk-K72RURN3.js";
49
49
  import {
50
50
  hasCode
51
51
  } from "./chunk-2I4QTOLB.js";
52
52
  import {
53
- CliError,
54
53
  external_exports
55
- } from "./chunk-WO5BJNIB.js";
54
+ } from "./chunk-YVFXE7RR.js";
55
+ import {
56
+ CliError
57
+ } from "./chunk-3UCIG4TG.js";
56
58
  import {
57
59
  fsyncDir,
58
60
  writeFileAtomic,
59
61
  writeFileAtomicExclusive
60
- } from "./chunk-O2FRQ2L2.js";
62
+ } from "./chunk-7WEQQJLG.js";
61
63
  import {
62
64
  archivedWalletPath,
63
65
  passphraseBlobPath,
@@ -1678,4 +1680,4 @@ export {
1678
1680
  @noble/ciphers/esm/utils.js:
1679
1681
  (*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *)
1680
1682
  */
1681
- //# sourceMappingURL=chunk-OSYTBCUC.js.map
1683
+ //# sourceMappingURL=chunk-2XLC3AEX.js.map