tenjin-cli 0.1.0-alpha.4 → 0.1.0-alpha.7

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 (135) hide show
  1. package/README.md +269 -38
  2. package/dist/{buy-OOOLUDND.js → buy-XVOMNWKN.js} +21 -18
  3. package/dist/{candidate-TWCWTFGA.js → candidate-DJB2NNTG.js} +7 -8
  4. package/dist/{chunk-KXIX7YDV.js → chunk-2KIDDWQO.js} +5 -5
  5. package/dist/{chunk-NXCJN2FJ.js → chunk-2L73UI6T.js} +51 -42
  6. package/dist/chunk-2L73UI6T.js.map +1 -0
  7. package/dist/{chunk-OJD54DIU.js → chunk-2YX6LTCD.js} +5 -5
  8. package/dist/{chunk-H5ETJRQD.js → chunk-5X4EBGGU.js} +22 -14
  9. package/dist/chunk-5X4EBGGU.js.map +1 -0
  10. package/dist/chunk-6S44OLND.js +699 -0
  11. package/dist/chunk-6S44OLND.js.map +1 -0
  12. package/dist/{chunk-FU6MCSLG.js → chunk-7WDY4AXV.js} +2 -64
  13. package/dist/chunk-7WDY4AXV.js.map +1 -0
  14. package/dist/{chunk-VV4P5RVK.js → chunk-BBUYCDSG.js} +16 -4
  15. package/dist/chunk-BBUYCDSG.js.map +1 -0
  16. package/dist/chunk-CYRYVZPN.js +213 -0
  17. package/dist/chunk-CYRYVZPN.js.map +1 -0
  18. package/dist/{chunk-FHB3VKZW.js → chunk-DAJ56EUU.js} +5 -3
  19. package/dist/chunk-DAJ56EUU.js.map +1 -0
  20. package/dist/chunk-DH6D6QIO.js +239 -0
  21. package/dist/chunk-DH6D6QIO.js.map +1 -0
  22. package/dist/chunk-E6BNARCS.js +614 -0
  23. package/dist/chunk-E6BNARCS.js.map +1 -0
  24. package/dist/chunk-GABYDXWL.js +190 -0
  25. package/dist/chunk-GABYDXWL.js.map +1 -0
  26. package/dist/{chunk-EUQN3L5X.js → chunk-GM4RZUVU.js} +21 -9
  27. package/dist/chunk-GM4RZUVU.js.map +1 -0
  28. package/dist/{chunk-C4TIWOAM.js → chunk-GXYNLMUQ.js} +28 -11
  29. package/dist/chunk-GXYNLMUQ.js.map +1 -0
  30. package/dist/{chunk-6WWVYYSB.js → chunk-J6CVKC4M.js} +86 -4
  31. package/dist/chunk-J6CVKC4M.js.map +1 -0
  32. package/dist/{chunk-5JH7ZB6Z.js → chunk-KT2DGKFT.js} +76 -10
  33. package/dist/chunk-KT2DGKFT.js.map +1 -0
  34. package/dist/chunk-L6AV2Q73.js +105 -0
  35. package/dist/chunk-L6AV2Q73.js.map +1 -0
  36. package/dist/{chunk-333FOTUJ.js → chunk-MJZZTKCC.js} +108 -2
  37. package/dist/chunk-MJZZTKCC.js.map +1 -0
  38. package/dist/{chunk-XNNOR7F7.js → chunk-OTDI5FXG.js} +3 -5
  39. package/dist/{chunk-XNNOR7F7.js.map → chunk-OTDI5FXG.js.map} +1 -1
  40. package/dist/chunk-PIIWLEEG.js +337 -0
  41. package/dist/chunk-PIIWLEEG.js.map +1 -0
  42. package/dist/{chunk-ULLWHHIT.js → chunk-PLU3E63S.js} +468 -559
  43. package/dist/chunk-PLU3E63S.js.map +1 -0
  44. package/dist/chunk-QW2Q2KAH.js +27 -0
  45. package/dist/chunk-QW2Q2KAH.js.map +1 -0
  46. package/dist/{chunk-S3KZ3PPK.js → chunk-RGFBBNGP.js} +291 -59
  47. package/dist/chunk-RGFBBNGP.js.map +1 -0
  48. package/dist/chunk-SGK2B724.js +67 -0
  49. package/dist/chunk-SGK2B724.js.map +1 -0
  50. package/dist/chunk-UYP7G3GZ.js +412 -0
  51. package/dist/chunk-UYP7G3GZ.js.map +1 -0
  52. package/dist/{chunk-DPUMEMGM.js → chunk-VZ3AJCO5.js} +3 -5
  53. package/dist/{chunk-DPUMEMGM.js.map → chunk-VZ3AJCO5.js.map} +1 -1
  54. package/dist/{chunk-QH6677FJ.js → chunk-WDJTGVKN.js} +2 -2
  55. package/dist/{chunk-QH6677FJ.js.map → chunk-WDJTGVKN.js.map} +1 -1
  56. package/dist/{chunk-4GR7DGD6.js → chunk-WI5EOAQQ.js} +33 -256
  57. package/dist/{chunk-4GR7DGD6.js.map → chunk-WI5EOAQQ.js.map} +1 -1
  58. package/dist/{chunk-DPET3TW5.js → chunk-WRWCDLVK.js} +13 -12
  59. package/dist/chunk-WRWCDLVK.js.map +1 -0
  60. package/dist/chunk-XBJ3VLWX.js +35 -0
  61. package/dist/chunk-XBJ3VLWX.js.map +1 -0
  62. package/dist/chunk-ZEWY3RJ3.js +149 -0
  63. package/dist/chunk-ZEWY3RJ3.js.map +1 -0
  64. package/dist/chunk-ZFE7STX7.js +143 -0
  65. package/dist/chunk-ZFE7STX7.js.map +1 -0
  66. package/dist/{cli-AFSLAKR6.js → cli-7B2QNJG3.js} +247 -26
  67. package/dist/cli-7B2QNJG3.js.map +1 -0
  68. package/dist/{config-DBEEM3UA.js → config-SAQEQRFB.js} +7 -6
  69. package/dist/{doctor-XDA3YU6H.js → doctor-ENJ22XWN.js} +10 -8
  70. package/dist/{publish-IH7RJXGB.js → edit-2QO5GQDU.js} +19 -17
  71. package/dist/index.js +1 -1
  72. package/dist/{inspect-YBGDAG47.js → inspect-IPKKQB2S.js} +16 -15
  73. package/dist/{install-7J6KKEEP.js → install-7ZIYISQ7.js} +180 -133
  74. package/dist/install-7ZIYISQ7.js.map +1 -0
  75. package/dist/outcome-NSDE2KAJ.js +20 -0
  76. package/dist/publish-7WIFFNFG.js +40 -0
  77. package/dist/read-5TQR7LCF.js +158 -0
  78. package/dist/read-5TQR7LCF.js.map +1 -0
  79. package/dist/{run-DCZFEW2C.js → run-NPKIP26Y.js} +109 -34
  80. package/dist/{run-DCZFEW2C.js.map → run-NPKIP26Y.js.map} +1 -1
  81. package/dist/search-63ELMRZH.js +24 -0
  82. package/dist/send-ENE47KQE.js +222 -0
  83. package/dist/send-ENE47KQE.js.map +1 -0
  84. package/dist/session-FZU4VFFE.js +87 -0
  85. package/dist/session-FZU4VFFE.js.map +1 -0
  86. package/dist/{usdc-AU6ZIKA6.js → usdc-4VCDHFWX.js} +20 -4
  87. package/dist/{wallet-UWHSHWC6.js → wallet-OCCGEH6H.js} +8 -8
  88. package/dist/{wallet-HKG3GSTX.js → wallet-RBDVNZVR.js} +17 -7
  89. package/dist/wallet-RBDVNZVR.js.map +1 -0
  90. package/package.json +1 -1
  91. package/skills/tenjin/SKILL.md +32 -7
  92. package/skills/tenjin-publish/SKILL.md +109 -16
  93. package/skills/tenjin-search/SKILL.md +174 -15
  94. package/dist/chunk-333FOTUJ.js.map +0 -1
  95. package/dist/chunk-5JH7ZB6Z.js.map +0 -1
  96. package/dist/chunk-6WWVYYSB.js.map +0 -1
  97. package/dist/chunk-BXUS5UCT.js +0 -212
  98. package/dist/chunk-BXUS5UCT.js.map +0 -1
  99. package/dist/chunk-C4TIWOAM.js.map +0 -1
  100. package/dist/chunk-CJU555P5.js +0 -333
  101. package/dist/chunk-CJU555P5.js.map +0 -1
  102. package/dist/chunk-DPET3TW5.js.map +0 -1
  103. package/dist/chunk-EUQN3L5X.js.map +0 -1
  104. package/dist/chunk-FHB3VKZW.js.map +0 -1
  105. package/dist/chunk-FU6MCSLG.js.map +0 -1
  106. package/dist/chunk-H5ETJRQD.js.map +0 -1
  107. package/dist/chunk-MM4TGTST.js +0 -59
  108. package/dist/chunk-MM4TGTST.js.map +0 -1
  109. package/dist/chunk-MUBUQVC3.js +0 -67
  110. package/dist/chunk-MUBUQVC3.js.map +0 -1
  111. package/dist/chunk-NXCJN2FJ.js.map +0 -1
  112. package/dist/chunk-R7BMDJZM.js +0 -167
  113. package/dist/chunk-R7BMDJZM.js.map +0 -1
  114. package/dist/chunk-S3KZ3PPK.js.map +0 -1
  115. package/dist/chunk-ULLWHHIT.js.map +0 -1
  116. package/dist/chunk-VV4P5RVK.js.map +0 -1
  117. package/dist/chunk-YFREUEUI.js +0 -78
  118. package/dist/chunk-YFREUEUI.js.map +0 -1
  119. package/dist/cli-AFSLAKR6.js.map +0 -1
  120. package/dist/install-7J6KKEEP.js.map +0 -1
  121. package/dist/outcome-ZFGHX2XW.js +0 -20
  122. package/dist/search-R6NIQFXI.js +0 -24
  123. /package/dist/{buy-OOOLUDND.js.map → buy-XVOMNWKN.js.map} +0 -0
  124. /package/dist/{candidate-TWCWTFGA.js.map → candidate-DJB2NNTG.js.map} +0 -0
  125. /package/dist/{chunk-KXIX7YDV.js.map → chunk-2KIDDWQO.js.map} +0 -0
  126. /package/dist/{chunk-OJD54DIU.js.map → chunk-2YX6LTCD.js.map} +0 -0
  127. /package/dist/{config-DBEEM3UA.js.map → config-SAQEQRFB.js.map} +0 -0
  128. /package/dist/{doctor-XDA3YU6H.js.map → doctor-ENJ22XWN.js.map} +0 -0
  129. /package/dist/{inspect-YBGDAG47.js.map → edit-2QO5GQDU.js.map} +0 -0
  130. /package/dist/{outcome-ZFGHX2XW.js.map → inspect-IPKKQB2S.js.map} +0 -0
  131. /package/dist/{publish-IH7RJXGB.js.map → outcome-NSDE2KAJ.js.map} +0 -0
  132. /package/dist/{search-R6NIQFXI.js.map → publish-7WIFFNFG.js.map} +0 -0
  133. /package/dist/{usdc-AU6ZIKA6.js.map → search-63ELMRZH.js.map} +0 -0
  134. /package/dist/{wallet-HKG3GSTX.js.map → usdc-4VCDHFWX.js.map} +0 -0
  135. /package/dist/{wallet-UWHSHWC6.js.map → wallet-OCCGEH6H.js.map} +0 -0
package/README.md CHANGED
@@ -35,24 +35,74 @@ tenjin search "what actually changed in <library> v3's public API" # your firs
35
35
 
36
36
  ## Commands
37
37
 
38
- | Command | Purpose |
39
- | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
40
- | `tenjin install` | Walk you through harness skills, your publish consent mode, and wallet setup, then run the doctor checks |
41
- | `tenjin doctor` | Environment, API reachability, contract, and wallet checks |
42
- | `tenjin config [get\|set]` | Spend policy (`maxAutoSpend`, `sessionBudget`, `confirm`, allowlists) and `publish.mode` / `publish.defaultPrice` |
43
- | `tenjin wallet [create\|show\|balance]` | Local Base wallet; the key never leaves the machine |
44
- | `tenjin search "<question>"` | Ask for payable candidates or an honest MISS; prints the compact JSON verbatim |
45
- | `tenjin inspect <url-or-id>` | Show a candidate's pre-purchase card from the 402 body; never pays |
46
- | `tenjin buy <url-or-id> [--max-price <usd>] [--yes]` | Entitlement re-check (free re-read if owned), then x402 exact payment |
47
- | `tenjin outcome --search-id <id> --status <s>` | Report `used` / `partially_used` / `rejected` / `regenerated` / `purchase_declined` |
48
- | `tenjin publish <file.md> [--price <usd>] [--mode <m>]` | Publish a Markdown piece with an optional answer card, gated by a local scan and your consent mode |
49
- | `tenjin publish --candidate <id>` | Publish a parked candidate (its `draft.md`); clears it on success |
50
- | `tenjin candidate [add\|list\|drop]` | Park, list, or discard local publish drafts; a search MISS nudges you about parked ones |
51
-
52
- `buy` re-reads an entitled resource for free before ever paying, re-delivers
53
- already-bought content from the local library without paying again, and refuses to
54
- sign if the price rose since it first saw the 402. Spend policy is enforced in the
55
- wallet provider layer before any payment.
38
+ | Command | Purpose |
39
+ | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
40
+ | `tenjin install` | Walk you through harness skills, your publish consent mode, and wallet setup, then run the doctor checks |
41
+ | `tenjin doctor` | Environment, API reachability, contract, skill-wiring, and wallet checks |
42
+ | `tenjin config [get\|set]` | Spend policy (`maxAutoSpend`, `sessionBudget`, `confirm`, allowlists) and `publish.mode` / `publish.defaultPrice` |
43
+ | `tenjin wallet [create\|show\|balance]` | Local Base wallet; the key never leaves the machine |
44
+ | `tenjin search "<question>"` | Ask for payable candidates or an honest MISS; prints the compact JSON verbatim |
45
+ | `tenjin inspect <url-or-id>` | Show a candidate's pre-purchase card from the 402 body; never pays |
46
+ | `tenjin read <url-or-id>` | Deliver a free piece, re-deliver from the local library, or recover one you own with a cached session key (never a payment); refuses with exit 3 if it would cost |
47
+ | `tenjin session start [--scope read]` | Open the wallet once to mint a ≤24h read-scoped session key, so `read` can recover owned pieces unattended; spends nothing |
48
+ | `tenjin buy <url-or-id> [--max-price <usd>] [--yes]` | Entitlement re-check (free re-read if owned), then x402 exact payment |
49
+ | `tenjin outcome --search-id <id> --status <s>` | Report `used` / `partially_used` / `rejected` / `regenerated` / `purchase_declined` |
50
+ | `tenjin publish <file.md> [--price <usd>] [--mode <m>]` | Publish a Markdown piece with an optional answer card, gated by a local scan and your consent mode |
51
+ | `tenjin publish --candidate <id>` | Publish a parked candidate (its `draft.md`); clears it on success |
52
+ | `tenjin edit <postId> [flags] [--yes]` | Show one of your posts and its card, or merge-update it: omitted fields are kept, `--clear <field>` clears one |
53
+ | `tenjin candidate [add\|list\|drop]` | Park, list, or discard local publish drafts; a search MISS nudges you about parked ones |
54
+ | `tenjin send <amount> usdc <to> [--yes]` | **Escape hatch:** move USDC on Base out of the agent wallet (preview, explicit confirm, then the tx hash) |
55
+
56
+ `send` is human-invoked only: it is deliberately absent from the MCP toolset and
57
+ the harness skills, and nothing is signed until the previewed (checksummed)
58
+ recipient, amount, and network fee are confirmed, interactively at a TTY or
59
+ explicitly with `--yes` when headless. It refuses when the active wallet's
60
+ passphrase entry is missing. The `sendMaxAmount` hard per-send cap has no
61
+ default: `tenjin send` refuses until you run `tenjin config set sendMaxAmount
62
+ <usd|0|none>` (`0` disables the verb, `none` opts in to uncapped), and `--yes`
63
+ can never bypass the cap or the unset refusal.
64
+ For routing FUTURE revenue away from the agent wallet entirely, connect the
65
+ agent to your own Tenjin account instead (delegation); `send` exists for funds
66
+ already sitting on the agent key.
67
+
68
+ `read` and `buy` split delivery by whether money can move, not by how much work is
69
+ involved. `read` is free-only and tries three things in order: the local library,
70
+ then an unauthenticated fetch (which delivers free pieces), then — only if a
71
+ read-scoped session key is already cached — one signed GET presenting that
72
+ delegation, which delivers a piece this wallet already bought. A paid piece that
73
+ none of the three reaches hard-refuses (exit 3) with the price and a pointer at
74
+ `buy`; the refusal's `entitlementCheck` says whether a session was actually
75
+ presented (`session`) or there was none to present (`not_performed`).
76
+
77
+ `tenjin session start --scope read` is what mints that key: one wallet signature,
78
+ ≤24h, spends nothing. It is a separate opt-in verb precisely so `read` never needs
79
+ the wallet — `read` imports no wallet, payment, or session-MINTING module, and its
80
+ import graph is test-pinned to stay clear of all three. It cannot unlock a
81
+ keystore at all and never consults the spend policy. The key it may present is
82
+ P-256: the wrong curve for the EIP-712/secp256k1 signature an EIP-3009 transfer
83
+ authorization needs, so `read` cannot pay however it is refactored.
84
+
85
+ The session file itself is a **wallet-derived credential** — treat it like one.
86
+ Its scope is not a containment boundary, so do not read "read-scoped" as a limit
87
+ on what a copied file is worth. What actually bounds it: it expires within 24h
88
+ (server-clamped), it is stored 0600, and it records the origin it was minted for
89
+ and is never presented anywhere else. That last one is why a stray `--base-url`
90
+ cannot redirect it to a host an agent picked.
91
+
92
+ `buy` is the paying verb: it re-reads an entitled resource for free before ever
93
+ paying, re-delivers already-bought content from the local library without paying
94
+ again, and refuses to sign if the price rose since it first saw the 402. Spend
95
+ policy is enforced in the wallet provider layer before any payment.
96
+
97
+ `edit` sends only the fields you pass, so an omitted field is kept; `--clear
98
+ <field>` is the one way to empty a card field, and `--question` / `--task`
99
+ replace the stored list while `--add-question` / `--add-task` append to it. The
100
+ append flags read the post and then write it back, with no concurrency guard (the
101
+ API offers no `If-Match`), so a web-panel edit landing between the two calls can
102
+ be overwritten. Reading your own post is owner-scoped, so even the no-flag show
103
+ signs with your wallet on first use, minting a read-scoped 24h session; only a run
104
+ that intends to write asks for a write-capable one. An edit sends only what
105
+ actually changes, so re-running the same command writes nothing.
56
106
 
57
107
  Read output defaults to a heading outline, not the body: `--print-body` includes
58
108
  the full body, and `--sections <tokens>` includes the leading sections within a
@@ -104,13 +154,144 @@ Pricing: `--price` (or a frontmatter `price:`) wins, otherwise `publish.defaultP
104
154
  (default $0.10). A card never auto-prices; the `tenjin-publish` skill's rubric is
105
155
  what actually chooses a price before it calls the command.
106
156
 
157
+ ## Auto-mode permission allowlist
158
+
159
+ Coding harnesses running unattended ("auto mode", "full auto", YOLO) classify each
160
+ shell command before running it, and an unknown binary is denied by default. That
161
+ denies the free verbs too, which breaks the whole marketplace loop: the skills
162
+ forbid working around a denial, so a denied `tenjin search` just stops.
163
+
164
+ Pre-clear the free verbs once. In Claude Code these go in the `permissions.allow`
165
+ array of `.claude/settings.json`:
166
+
167
+ ```
168
+ Bash(tenjin search:*)
169
+ Bash(tenjin inspect:*)
170
+ Bash(tenjin read:*)
171
+ Bash(tenjin outcome:*)
172
+ Bash(tenjin doctor:*)
173
+ Bash(tenjin wallet show:*)
174
+ Bash(tenjin wallet balance:*)
175
+ Bash(tenjin config get:*)
176
+ Bash(tenjin candidate list:*)
177
+ ```
178
+
179
+ None of those can spend, and none can open the keystore. That is the definition of
180
+ this tier, and it is deliberately narrower than "signs nothing": `tenjin read` can
181
+ present a session key that already exists (below), which is a signature — a P-256
182
+ delegation, the wrong curve to authorize a USDC transfer. It cannot mint one; that
183
+ needs the wallet.
184
+
185
+ Worth knowing before you paste the `read` line: once a session key exists, `read`
186
+ **transmits that wallet-derived credential** to the origin it was minted for. That
187
+ origin binding is what keeps a stray `--base-url` from redirecting it, and it is
188
+ the reason the binding exists rather than a nicety.
189
+
190
+ Three are not read-only, which is worth knowing before you pre-clear them:
191
+ `tenjin search` POSTs your generalized question off-machine, and `tenjin outcome`
192
+ POSTs a report that moves the marketplace's reuse signal — both unauthenticated
193
+ and free, neither carrying a credential — while `tenjin read` writes locally,
194
+ saving a delivered piece to your library.
195
+
196
+ `tenjin install` prints this block, and `tenjin doctor` reprints it on every run
197
+ (including in `doctor --json` under `permissions`, on the failure envelope as well
198
+ as the success one), so an agent that just got denied can point you at the exact
199
+ line.
200
+
201
+ **A prefix rule pins the verb, not the flags.** Every line above also clears
202
+ `--base-url <url>` on that verb, because the CLI accepts the global flags on every
203
+ subcommand. `--base-url` is validated as a URL and nothing more, and it wins
204
+ settings precedence, so it moves where the question goes, where `doctor` probes,
205
+ and (with the `buy` line below) where a SIWX signature and an EIP-3009 payment
206
+ authorization are sent. The origin pin only checks that a resource URL shares an
207
+ origin with the _configured_ base, so an attacker-controlled pair satisfies it.
208
+ There is no prefix syntax for "this verb but not that flag", so treat this as a
209
+ disclosed limit: set your base URL in config, and allowlist these verbs only if
210
+ you are content for an agent to be able to choose the destination host. The
211
+ skills tell agents never to pass `--base-url` on an allowlisted verb, but that is
212
+ a convention rather than an enforced boundary.
213
+
214
+ Purchases are a **separate, explicit opt-in**:
215
+
216
+ ```
217
+ Bash(tenjin buy:*)
218
+ ```
219
+
220
+ Read this before pasting it: **on the default config that line authorizes
221
+ unattended spending up to your wallet balance.** `--yes` is an ordinary flag on
222
+ the same allowlisted verb and it clears the confirm gate outright, so `confirm:
223
+ always` does not put a human on every purchase once the agent can pass `--yes`.
224
+ Walking the defaults: `allowlistCreators` is empty (gate off), `maxAutoSpend` is
225
+ `0` and `confirm` is `always`, which together only ask for a confirmation that
226
+ `--yes` satisfies, and `sessionBudget` is `0`, which the policy reads as **no
227
+ ceiling at all**, not a zero one. Set real values first:
228
+
229
+ ```bash
230
+ tenjin config set maxAutoSpend 0.25
231
+ tenjin config set sessionBudget 2.00
232
+ ```
233
+
234
+ The allowlist line itself never raises a spend cap. That is true, and it is not
235
+ the same as saying the caps stop an allowlisted `buy`.
236
+
237
+ Minting a session key is the **other** explicit opt-in — it spends nothing and
238
+ cannot spend, but it opens the keystore:
239
+
240
+ ```
241
+ Bash(tenjin session start:*)
242
+ ```
243
+
244
+ `tenjin session start --scope read` takes one wallet signature and leaves a ≤24h
245
+ P-256 delegation in `~/.tenjin/session.json` (0600), which `tenjin read` then
246
+ presents to recover pieces you already own. The key is the wrong curve to sign an
247
+ EIP-3009 payment authorization, so the line can never become a spend grant.
248
+
249
+ Do not read the `read` scope as more than that. The scope is enforced only on the
250
+ request shape that carries a session signature alongside the delegation header; a
251
+ copy of the same delegation presented differently is not scope-checked, so treat
252
+ the file as a credential carrying your wallet's authority. Its real bounds are the
253
+ 24h expiry, the 0600 mode, and the origin binding.
254
+
255
+ What you are clearing is **unattended keystore access**: on an encrypted wallet
256
+ the passphrase comes from the environment rather than from you, and the
257
+ `--base-url` caveat above bites hardest here, because a mint against a host an
258
+ agent chose is a wallet signature you did not intend to make. `tenjin doctor`
259
+ reports whether a session exists, for which origin, at what scope, and when it
260
+ expires.
261
+
262
+ Deliberately **never** recommended, because each is a human decision: `tenjin send`
263
+ (moves USDC out of the wallet, and is not bounded by the buy spend policy), `tenjin
264
+ publish`, `tenjin wallet create`, `tenjin config set` (it can widen the agent's own
265
+ spend policy), `tenjin candidate add` / `tenjin candidate drop`, `tenjin install`,
266
+ and `tenjin mcp`
267
+ (it re-exposes every command core, so clearing it clears everything). For the same
268
+ reason, prefer the narrow rules above over a broad `Bash(tenjin:*)`, `Bash(tenjin
269
+ wallet:*)`, or `Bash(tenjin config:*)`, which would swallow them.
270
+
271
+ Two gaps worth knowing, both of which fail closed (denied, never wrongly allowed):
272
+ bare `tenjin config` is as read-only as `config get` but no prefix rule reaches it
273
+ without also covering `config set`, so use `tenjin config get <key>`; and group-level
274
+ flag forms like `tenjin wallet --json show` are not covered, so put global flags
275
+ after the leaf verb (`tenjin wallet show --json`).
276
+
277
+ **Running the local MCP server instead?** That is a different permission surface:
278
+ the harness gates tools there, and these Bash rules do not apply. If you follow
279
+ the [MCP section](#local-stdio-mcp-server) as well, leave
280
+ `mcp__tenjin__tenjin_publish` and `mcp__tenjin__tenjin_wallet` gated, treat
281
+ `mcp__tenjin__tenjin_candidate` as gated for its add/drop actions, and treat
282
+ `mcp__tenjin__tenjin_buy` as the same opt-in decision as the `buy` line above.
283
+
284
+ This harness allowlist is unrelated to the `allowlistCreators` spend-policy key:
285
+ that one gates **who you may pay**, this one gates **which commands may run**.
286
+
107
287
  ## Skills (installed by `tenjin install`)
108
288
 
109
289
  `tenjin install` auto-detects your harness, copies the three Tenjin skills into
110
290
  place, wires the pointers each harness needs, and runs the `doctor` checks as its
111
291
  last step. It is idempotent: re-run any time, `--dry-run` previews the changes
112
292
  without writing, and `--harness claude|codex|shared` (repeatable) targets a
113
- specific one. `--publish-mode <mode>` sets your consent mode non-interactively.
293
+ specific one, which is remembered so `doctor` keeps checking it. `--publish-mode
294
+ <mode>` sets your consent mode non-interactively.
114
295
 
115
296
  Where the skills land:
116
297
 
@@ -137,8 +318,29 @@ The three skills:
137
318
  - **`tenjin-search`**: thin adapter over `tenjin search/inspect/buy/outcome`
138
319
  with a deliberately narrow trigger (public, durable, costly-to-reproduce
139
320
  questions).
140
- - **`tenjin-publish`**: explicit-invocation-only publishing rubric and
141
- `tenjin publish` adapter. Never triggers on its own.
321
+ - **`tenjin-publish`**: publishing rubric and `tenjin publish` adapter, with a
322
+ narrow trigger (an explicit ask, or the after-a-MISS reflex). Consent is
323
+ `publish.mode`, backed by the local **secret-shape** scan. Its blocking tier —
324
+ structured provider token formats, private keys, connection URIs with an
325
+ embedded password — is what no mode and no `--yes` can clear. Everything else
326
+ is a warning, which `review` shows you and `--yes`/`full-auto` clear:
327
+ generically named `API_KEY=`-style assignments, PII, wallet addresses,
328
+ internal hostnames, confidential markers, long verbatim quotes,
329
+ paid/licensed-content legends, the caller's own project references, and
330
+ labeled customer/account identifiers. So rights and employer-internal
331
+ content have no _blocking_ detector — those are warn-tier only — and the
332
+ skill's draft rules put that judgment on the author.
333
+
334
+ All three land on every run, including on a machine that already carries the
335
+ hosted `tenjin` skill: that install wires the CLI skills rather than skipping.
336
+ The hosted skill is kept as the zero-install fallback and the two CLI skills
337
+ take precedence while the CLI is installed. `tenjin doctor`'s `skills` check
338
+ reports that state per skills directory (which skills are wired, where) so a
339
+ half-wired machine is diagnosable without a screen recording. It judges each
340
+ directory a harness it detected here reads, plus any directory you named with
341
+ `--harness` — an explicit choice is recorded, because detection cannot see a
342
+ harness Tenjin does not probe for. A leftover directory that is neither is
343
+ described, not warned about.
142
344
 
143
345
  A funded wallet is only needed for paid reads and publishing.
144
346
 
@@ -196,16 +398,16 @@ server the CLI ships (see [Local stdio MCP server](#local-stdio-mcp-server)).
196
398
  ## Local stdio MCP server
197
399
 
198
400
  `tenjin mcp` runs a local MCP server over stdio backed by the same command cores
199
- as the CLI (`search`, `inspect`, `buy`, `outcome`, `publish`, `candidate`, and
200
- `wallet`), in-process, no shelling out. It exposes seven tools (`tenjin_search`,
201
- `tenjin_inspect`, `tenjin_buy`, `tenjin_outcome`, `tenjin_publish`,
202
- `tenjin_candidate`, `tenjin_wallet`), each returning the machine JSON envelope as
203
- `structuredContent` with a short text summary. The consent gates carry over
204
- exactly: the spend policy gates `tenjin_buy`, `publish.mode` gates
205
- `tenjin_publish` (the client renders the `needs_confirmation` payload as its own
206
- confirm UI, then re-calls with `yes:true`), and a hard content block is never
207
- bypassable. The wallet stays local: the key never leaves the machine and appears
208
- in no tool result.
401
+ as the CLI (`search`, `inspect`, `buy`, `outcome`, `publish`, `edit`,
402
+ `candidate`, and `wallet`), in-process, no shelling out. It exposes eight tools
403
+ (`tenjin_search`, `tenjin_inspect`, `tenjin_buy`, `tenjin_outcome`,
404
+ `tenjin_publish`, `tenjin_edit`, `tenjin_candidate`, `tenjin_wallet`), each
405
+ returning the machine JSON envelope as `structuredContent` with a short text
406
+ summary. The consent gates carry over exactly: the spend policy gates
407
+ `tenjin_buy`, `publish.mode` gates `tenjin_publish` and `tenjin_edit` (the client
408
+ renders the `needs_confirmation` payload as its own confirm UI, then re-calls
409
+ with `yes:true`), and a hard content block is never bypassable. The wallet stays
410
+ local: the key never leaves the machine and appears in no tool result.
209
411
 
210
412
  **Claude Code**
211
413
 
@@ -244,17 +446,36 @@ approval.
244
446
  is never written to disk. The wallet address stays readable, so `show`,
245
447
  `balance`, and `doctor` work without a passphrase; only signing decrypts.
246
448
  Signing is local and the CLI talks only to the configured base URL.
449
+ - There is exactly **one active wallet**. `wallet create` refuses when one
450
+ exists; the explicit `wallet create --replace` first verifies the outgoing
451
+ wallet's passphrase against its keystore, preserves it under the wallet's own
452
+ address in the OS store, parks the keystore beside the new one
453
+ (`wallet.<address>.json.bak`), and only then creates the new wallet — a
454
+ replace can never strand the old wallet's funds. `wallet show` lists archived
455
+ addresses as a recovery hint. To make an archived wallet active again: move
456
+ the current `wallet.json` aside (e.g. with another `--replace` later, or
457
+ manually), then `mv ~/.tenjin/wallet.<address>.json.bak ~/.tenjin/wallet.json`
458
+ — its passphrase entry is keyed by the wallet's address, so signing resumes
459
+ transparently.
247
460
  - The signing passphrase resolves in order: `TENJIN_WALLET_PASSPHRASE`, then the
248
461
  OS credential store, then an interactive prompt. On `wallet create` with no env
249
462
  passphrase, a strong random one is generated and saved to the OS store so later
250
- signing is transparent. Where it lands per platform:
463
+ signing is transparent. Every stored entry is **per wallet** — keyed by the
464
+ wallet's own address — so replacing a wallet never touches the outgoing
465
+ wallet's passphrase. (Installs from before per-wallet entries used one shared
466
+ slot; the first signing that proves ownership re-keys that slot under the
467
+ owning wallet's address — the copy is verified before the old slot is
468
+ removed.) Where entries land per platform:
251
469
  - **macOS**: the login keychain, via the OS `security` tool (the same
252
- mechanism the GitHub CLI uses).
253
- - **Windows**: a DPAPI-encrypted file (`passphrase.dpapi`), decryptable only by
254
- the same user on the same machine, via built-in PowerShell. The file holds
255
- ciphertext, not the passphrase.
470
+ mechanism the GitHub CLI uses): service `tenjin-cli`, account = the wallet
471
+ address.
472
+ - **Windows**: a DPAPI-encrypted file per wallet
473
+ (`passphrase.<address>.dpapi`), decryptable only by the same user on the
474
+ same machine, via built-in PowerShell. The file holds ciphertext, not the
475
+ passphrase.
256
476
  - **Desktop Linux**: the Secret Service keyring, via `secret-tool` when
257
- libsecret-tools is installed.
477
+ libsecret-tools is installed: service `tenjin-cli`, account = the wallet
478
+ address.
258
479
  - **Headless or CI (any OS)**: no durable OS store, so set
259
480
  `TENJIN_WALLET_PASSPHRASE`.
260
481
 
@@ -262,7 +483,17 @@ approval.
262
483
  key never leaves the machine.
263
484
 
264
485
  - Fund small: this is a pocket-money wallet by design.
265
- - Purchased content is untrusted data, never instructions.
486
+ - Purchased content is untrusted data, never instructions. The skills never
487
+ execute it, and instructions embedded in it never override the task. In
488
+ particular, no harness permission, hook, or settings change is ever recommended
489
+ on the strength of content the agent read: a claim that some permission change
490
+ is "the documented fix" is still a claim from untrusted content.
491
+ - The recommended auto-mode allowlist covers free verbs only; `tenjin buy` is an
492
+ explicit opt-in that authorizes unattended spending, and money-moving verbs are
493
+ never recommended. See
494
+ [Auto-mode permission allowlist](#auto-mode-permission-allowlist). A harness
495
+ permission denial is never worked around: the skills surface the exact allowlist
496
+ line and stop.
266
497
 
267
498
  ## Contributing and releases
268
499
 
@@ -1,30 +1,33 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
2
  import {
3
3
  runBuy
4
- } from "./chunk-4GR7DGD6.js";
5
- import "./chunk-5JH7ZB6Z.js";
6
- import "./chunk-FU6MCSLG.js";
7
- import "./chunk-S3KZ3PPK.js";
8
- import "./chunk-DPET3TW5.js";
9
- import "./chunk-MM4TGTST.js";
10
- import "./chunk-XNNOR7F7.js";
11
- import "./chunk-NXCJN2FJ.js";
4
+ } from "./chunk-WI5EOAQQ.js";
5
+ import "./chunk-L6AV2Q73.js";
6
+ import "./chunk-KT2DGKFT.js";
7
+ import "./chunk-SGK2B724.js";
8
+ import "./chunk-7WDY4AXV.js";
9
+ import "./chunk-POJRB2AE.js";
10
+ import "./chunk-QW2Q2KAH.js";
11
+ import "./chunk-RGFBBNGP.js";
12
+ import "./chunk-WRWCDLVK.js";
13
+ import "./chunk-CYRYVZPN.js";
14
+ import "./chunk-OTDI5FXG.js";
15
+ import "./chunk-2L73UI6T.js";
12
16
  import "./chunk-WWX32ML4.js";
13
- import "./chunk-VV4P5RVK.js";
14
- import "./chunk-C4TIWOAM.js";
15
- import "./chunk-QH6677FJ.js";
17
+ import "./chunk-GXYNLMUQ.js";
18
+ import "./chunk-WDJTGVKN.js";
19
+ import "./chunk-XBJ3VLWX.js";
16
20
  import "./chunk-2I4QTOLB.js";
21
+ import "./chunk-BBUYCDSG.js";
17
22
  import "./chunk-KZAAWQNP.js";
18
23
  import "./chunk-S5RYMCV6.js";
19
- import "./chunk-POJRB2AE.js";
20
24
  import "./chunk-YLYINX2H.js";
21
- import "./chunk-FHB3VKZW.js";
25
+ import "./chunk-DAJ56EUU.js";
22
26
  import "./chunk-YBMMV4Y4.js";
23
27
  import "./chunk-UO22YNY4.js";
24
- import "./chunk-BXUS5UCT.js";
25
- import "./chunk-MUBUQVC3.js";
26
- import "./chunk-6WWVYYSB.js";
27
- import "./chunk-333FOTUJ.js";
28
+ import "./chunk-UYP7G3GZ.js";
29
+ import "./chunk-J6CVKC4M.js";
30
+ import "./chunk-MJZZTKCC.js";
28
31
  import "./chunk-7FK2UN2T.js";
29
32
  import "./chunk-M2O56UK7.js";
30
33
  import "./chunk-UHTVXQ2O.js";
@@ -38,4 +41,4 @@ import "./chunk-ZXTAQYNA.js";
38
41
  export {
39
42
  runBuy
40
43
  };
41
- //# sourceMappingURL=buy-OOOLUDND.js.map
44
+ //# sourceMappingURL=buy-XVOMNWKN.js.map
@@ -3,20 +3,19 @@ import {
3
3
  runCandidateAdd,
4
4
  runCandidateDrop,
5
5
  runCandidateList
6
- } from "./chunk-OJD54DIU.js";
7
- import "./chunk-DPUMEMGM.js";
6
+ } from "./chunk-2YX6LTCD.js";
7
+ import "./chunk-VZ3AJCO5.js";
8
8
  import "./chunk-WWX32ML4.js";
9
- import "./chunk-VV4P5RVK.js";
10
9
  import "./chunk-2I4QTOLB.js";
11
- import "./chunk-FHB3VKZW.js";
10
+ import "./chunk-BBUYCDSG.js";
11
+ import "./chunk-DAJ56EUU.js";
12
12
  import "./chunk-UO22YNY4.js";
13
- import "./chunk-BXUS5UCT.js";
14
- import "./chunk-MUBUQVC3.js";
15
- import "./chunk-6WWVYYSB.js";
13
+ import "./chunk-UYP7G3GZ.js";
14
+ import "./chunk-J6CVKC4M.js";
16
15
  import "./chunk-ZXTAQYNA.js";
17
16
  export {
18
17
  runCandidateAdd,
19
18
  runCandidateDrop,
20
19
  runCandidateList
21
20
  };
22
- //# sourceMappingURL=candidate-TWCWTFGA.js.map
21
+ //# sourceMappingURL=candidate-DJB2NNTG.js.map
@@ -1,17 +1,17 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
2
  import {
3
3
  latestSearch
4
- } from "./chunk-XNNOR7F7.js";
4
+ } from "./chunk-OTDI5FXG.js";
5
5
  import {
6
6
  buildOutcomeItem,
7
7
  postOutcomes
8
- } from "./chunk-NXCJN2FJ.js";
8
+ } from "./chunk-2L73UI6T.js";
9
9
  import {
10
10
  resolveContextSettings
11
- } from "./chunk-FHB3VKZW.js";
11
+ } from "./chunk-DAJ56EUU.js";
12
12
  import {
13
13
  CliError
14
- } from "./chunk-6WWVYYSB.js";
14
+ } from "./chunk-J6CVKC4M.js";
15
15
 
16
16
  // src/commands/outcome.ts
17
17
  async function runOutcome(args, ctx, deps = {}) {
@@ -56,4 +56,4 @@ async function resolveSearchId(args, ctx) {
56
56
  export {
57
57
  runOutcome
58
58
  };
59
- //# sourceMappingURL=chunk-KXIX7YDV.js.map
59
+ //# sourceMappingURL=chunk-2KIDDWQO.js.map