tenjin-cli 0.1.0-alpha.1 → 0.1.0-alpha.3

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 (133) hide show
  1. package/NOTICE.md +33 -0
  2. package/README.md +167 -16
  3. package/dist/{_esm-ZH2J4QEH.js → _esm-C5CRWCYU.js} +2 -2
  4. package/dist/_esm-FEASBWRP.js +881 -0
  5. package/dist/buy-EE6SEXP6.js +1598 -0
  6. package/dist/buy-EE6SEXP6.js.map +1 -0
  7. package/dist/candidate-ERMSYYQZ.js +127 -0
  8. package/dist/candidate-ERMSYYQZ.js.map +1 -0
  9. package/dist/{ccip-UCLT5VOW.js → ccip-NQXCEK2U.js} +6 -5
  10. package/dist/ccip-XR5NE5QK.js +19 -0
  11. package/dist/chunk-2I4QTOLB.js +11 -0
  12. package/dist/chunk-2I4QTOLB.js.map +1 -0
  13. package/dist/chunk-3OV7E5G5.js +18 -0
  14. package/dist/chunk-3OV7E5G5.js.map +1 -0
  15. package/dist/chunk-4ONXEEQL.js +152 -0
  16. package/dist/chunk-4ONXEEQL.js.map +1 -0
  17. package/dist/chunk-5CLSD5YN.js +209 -0
  18. package/dist/chunk-5CLSD5YN.js.map +1 -0
  19. package/dist/chunk-662MSGZB.js +286 -0
  20. package/dist/chunk-662MSGZB.js.map +1 -0
  21. package/dist/chunk-7KUW4MJD.js +59 -0
  22. package/dist/chunk-7KUW4MJD.js.map +1 -0
  23. package/dist/{doctor-3QBYN46N.js → chunk-AWPAWHNX.js} +88 -93
  24. package/dist/chunk-AWPAWHNX.js.map +1 -0
  25. package/dist/chunk-CYOF7ROH.js +70 -0
  26. package/dist/chunk-CYOF7ROH.js.map +1 -0
  27. package/dist/chunk-DXTQ3CSI.js +171 -0
  28. package/dist/chunk-DXTQ3CSI.js.map +1 -0
  29. package/dist/{chunk-EZROUI5U.js → chunk-ESPNTPQ2.js} +80 -8
  30. package/dist/chunk-ESPNTPQ2.js.map +1 -0
  31. package/dist/chunk-FJPLRISB.js +79 -0
  32. package/dist/chunk-FJPLRISB.js.map +1 -0
  33. package/dist/chunk-GO75V3NZ.js +160 -0
  34. package/dist/chunk-GO75V3NZ.js.map +1 -0
  35. package/dist/chunk-HIVZG55D.js +204 -0
  36. package/dist/chunk-HIVZG55D.js.map +1 -0
  37. package/dist/chunk-HSDCI7OV.js +7806 -0
  38. package/dist/chunk-HSDCI7OV.js.map +1 -0
  39. package/dist/chunk-JPHG2JW3.js +96 -0
  40. package/dist/chunk-JPHG2JW3.js.map +1 -0
  41. package/dist/{chunk-ZPZFPVDN.js → chunk-MUBUQVC3.js} +1 -1
  42. package/dist/chunk-MUBUQVC3.js.map +1 -0
  43. package/dist/{chunk-T4LKNY7T.js → chunk-NCE5NSN6.js} +166 -11
  44. package/dist/chunk-NCE5NSN6.js.map +1 -0
  45. package/dist/{chunk-YG2DO46P.js → chunk-OYMYCW7J.js} +18 -3
  46. package/dist/{chunk-YG2DO46P.js.map → chunk-OYMYCW7J.js.map} +1 -1
  47. package/dist/{chunk-Q53IYV2G.js → chunk-QVX5MWJZ.js} +20 -17
  48. package/dist/{chunk-Q53IYV2G.js.map → chunk-QVX5MWJZ.js.map} +1 -1
  49. package/dist/{chunk-CUWUHTIL.js → chunk-RBJPAZFI.js} +16 -202
  50. package/dist/chunk-RBJPAZFI.js.map +1 -0
  51. package/dist/chunk-RRN3YTK7.js +6199 -0
  52. package/dist/chunk-RRN3YTK7.js.map +1 -0
  53. package/dist/chunk-RY4XKNV3.js +140 -0
  54. package/dist/chunk-RY4XKNV3.js.map +1 -0
  55. package/dist/chunk-S3IGX57D.js +14682 -0
  56. package/dist/chunk-S3IGX57D.js.map +1 -0
  57. package/dist/chunk-TLCMMYLY.js +126 -0
  58. package/dist/chunk-TLCMMYLY.js.map +1 -0
  59. package/dist/{chunk-IPOWB3G3.js → chunk-UGX7YPX2.js} +3314 -306
  60. package/dist/chunk-UGX7YPX2.js.map +1 -0
  61. package/dist/chunk-UO22YNY4.js +69 -0
  62. package/dist/chunk-UO22YNY4.js.map +1 -0
  63. package/dist/{config-CEFTL5ZL.js → chunk-XHC6FCGZ.js} +115 -18
  64. package/dist/chunk-XHC6FCGZ.js.map +1 -0
  65. package/dist/chunk-XJIW7USF.js +217 -0
  66. package/dist/chunk-XJIW7USF.js.map +1 -0
  67. package/dist/{chunk-BRJHUQSY.js → chunk-YALGASEU.js} +1548 -1452
  68. package/dist/chunk-YALGASEU.js.map +1 -0
  69. package/dist/{chunk-DXPYFVKG.js → chunk-YN5SHIXQ.js} +6 -6
  70. package/dist/chunk-YN5SHIXQ.js.map +1 -0
  71. package/dist/chunk-Z52RA3NC.js +137 -0
  72. package/dist/chunk-Z52RA3NC.js.map +1 -0
  73. package/dist/{chunk-EXBMF5X7.js → chunk-Z6MFJV5Z.js} +151 -19
  74. package/dist/chunk-Z6MFJV5Z.js.map +1 -0
  75. package/dist/chunk-ZABPQJ3M.js +83 -0
  76. package/dist/chunk-ZABPQJ3M.js.map +1 -0
  77. package/dist/{chunk-LPRVHM7P.js → chunk-ZMHYXMO6.js} +1655 -114
  78. package/dist/chunk-ZMHYXMO6.js.map +1 -0
  79. package/dist/{chunk-3IMLRUZE.js → chunk-ZXTAQYNA.js} +6 -2
  80. package/dist/{cli-WA65NP4Y.js → cli-SBXI5AMS.js} +177 -177
  81. package/dist/cli-SBXI5AMS.js.map +1 -0
  82. package/dist/config-VELDKLHY.js +21 -0
  83. package/dist/doctor-T3KWNNP2.js +20 -0
  84. package/dist/doctor-T3KWNNP2.js.map +1 -0
  85. package/dist/ethersCompat-Df4a6QIZ-3YZIAXDK.js +18 -0
  86. package/dist/ethersCompat-Df4a6QIZ-3YZIAXDK.js.map +1 -0
  87. package/dist/index.js +1 -1
  88. package/dist/inspect-LMKOXE4Y.js +96 -0
  89. package/dist/inspect-LMKOXE4Y.js.map +1 -0
  90. package/dist/install-LEX3ENQ6.js +387 -0
  91. package/dist/install-LEX3ENQ6.js.map +1 -0
  92. package/dist/lookup-ZPN2Q67N.js +129 -0
  93. package/dist/lookup-ZPN2Q67N.js.map +1 -0
  94. package/dist/{mine.wasm-GQECMSGN.js → mine.wasm-6PIT3DK6.js} +2 -2
  95. package/dist/outcome-N7TAK6WR.js +66 -0
  96. package/dist/outcome-N7TAK6WR.js.map +1 -0
  97. package/dist/publish-BKBQQAW4.js +1478 -0
  98. package/dist/publish-BKBQQAW4.js.map +1 -0
  99. package/dist/{secp256k1-BEZS642W.js → secp256k1-N3ZHU7LB.js} +5 -4
  100. package/dist/secp256k1-N3ZHU7LB.js.map +1 -0
  101. package/dist/usdc-JIAJW4SV.js +22 -0
  102. package/dist/usdc-JIAJW4SV.js.map +1 -0
  103. package/dist/viemAdapter-By13KInL-ZZE6UV4Y.js +14 -0
  104. package/dist/viemAdapter-By13KInL-ZZE6UV4Y.js.map +1 -0
  105. package/dist/{wallet-XD576HF3.js → wallet-CWEMYVIH.js} +28 -22
  106. package/dist/{wallet-XD576HF3.js.map → wallet-CWEMYVIH.js.map} +1 -1
  107. package/dist/wallet-PA54CRBL.js +30 -0
  108. package/dist/wallet-PA54CRBL.js.map +1 -0
  109. package/package.json +19 -16
  110. package/skills/tenjin/SKILL.md +199 -0
  111. package/skills/tenjin-publish/SKILL.md +111 -0
  112. package/skills/tenjin-search/SKILL.md +133 -0
  113. package/dist/chunk-BRJHUQSY.js.map +0 -1
  114. package/dist/chunk-CUWUHTIL.js.map +0 -1
  115. package/dist/chunk-DXPYFVKG.js.map +0 -1
  116. package/dist/chunk-EXBMF5X7.js.map +0 -1
  117. package/dist/chunk-EZROUI5U.js.map +0 -1
  118. package/dist/chunk-IPOWB3G3.js.map +0 -1
  119. package/dist/chunk-LPRVHM7P.js.map +0 -1
  120. package/dist/chunk-T4LKNY7T.js.map +0 -1
  121. package/dist/chunk-ZPZFPVDN.js.map +0 -1
  122. package/dist/cli-WA65NP4Y.js.map +0 -1
  123. package/dist/config-CEFTL5ZL.js.map +0 -1
  124. package/dist/doctor-3QBYN46N.js.map +0 -1
  125. package/dist/usdc-44R6XZF2.js +0 -18
  126. package/dist/wallet-ELBTBMXO.js +0 -20
  127. /package/dist/{_esm-ZH2J4QEH.js.map → _esm-C5CRWCYU.js.map} +0 -0
  128. /package/dist/{ccip-UCLT5VOW.js.map → _esm-FEASBWRP.js.map} +0 -0
  129. /package/dist/{chunk-3IMLRUZE.js.map → ccip-NQXCEK2U.js.map} +0 -0
  130. /package/dist/{secp256k1-BEZS642W.js.map → ccip-XR5NE5QK.js.map} +0 -0
  131. /package/dist/{usdc-44R6XZF2.js.map → chunk-ZXTAQYNA.js.map} +0 -0
  132. /package/dist/{wallet-ELBTBMXO.js.map → config-VELDKLHY.js.map} +0 -0
  133. /package/dist/{mine.wasm-GQECMSGN.js.map → mine.wasm-6PIT3DK6.js.map} +0 -0
package/NOTICE.md CHANGED
@@ -41,6 +41,39 @@ BlockRun MCP is licensed under the MIT License:
41
41
  > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
42
42
  > SOFTWARE.
43
43
 
44
+ ## gitleaks
45
+
46
+ The provider secret-token shape patterns in the publish redaction scan
47
+ (`src/lib/scan.ts`: AWS access keys, GitHub/Slack/Stripe tokens, JWTs, and the
48
+ PEM private-key marker) are adapted from the
49
+ [gitleaks](https://github.com/gitleaks/gitleaks) ruleset (MIT), by Zachary Rice.
50
+ The regexes are vendored and adapted inline; gitleaks is not a runtime
51
+ dependency (the scan is pure and offline by design).
52
+
53
+ gitleaks is licensed under the MIT License:
54
+
55
+ > MIT License
56
+ >
57
+ > Copyright (c) 2019 Zachary Rice
58
+ >
59
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
60
+ > of this software and associated documentation files (the "Software"), to deal
61
+ > in the Software without restriction, including without limitation the rights
62
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
63
+ > copies of the Software, and to permit persons to whom the Software is
64
+ > furnished to do so, subject to the following conditions:
65
+ >
66
+ > The above copyright notice and this permission notice shall be included in all
67
+ > copies or substantial portions of the Software.
68
+ >
69
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
70
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
71
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
72
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
73
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
74
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
75
+ > SOFTWARE.
76
+
44
77
  ## tenjin-mcp
45
78
 
46
79
  This repository absorbs, with credit, patterns from the archived
package/README.md CHANGED
@@ -17,9 +17,13 @@ already been produced, read free essays, buy valuable answers with USDC, and
17
17
  publish their own reusable research. This repo is the home of the `tenjin-cli`
18
18
  npm package and, soon, the Claude Code plugin and agent skills that wrap it.
19
19
 
20
- > **Status: early preview.** The CLI ships `doctor`, `config`, and `wallet`
21
- > today; `lookup`, `inspect`, `buy`, `outcome`, and `publish` are landing next.
22
- > Everything under "zero install" below is complete and live now; start there.
20
+ > **Status: early preview.** The CLI ships `install`, `doctor`, `config`, and
21
+ > `wallet` today. `lookup`, `inspect`, `buy`, and `outcome` are implemented but require the
22
+ > marketplace lookup API (Track A2) to be deployed to the base URL you point at;
23
+ > against a deploy without it, `doctor` shows a `lookup-contract` warning and those
24
+ > commands will not work yet. `publish` writes a piece with an optional answer
25
+ > card, gated by a local secrets scan and your `publish.mode` consent. Everything
26
+ > under "zero install" below is complete and live now; start there.
23
27
 
24
28
  ## Use Tenjin today, zero install
25
29
 
@@ -39,17 +43,53 @@ your machine; Tenjin never receives a private key. It is listed in the
39
43
  [official MCP registry](https://registry.modelcontextprotocol.io) as
40
44
  `blog.tenjin/tenjin`.
41
45
 
42
- ### Install the skill
46
+ ### Install the skills: `npx tenjin-cli install`
43
47
 
44
48
  ```bash
45
- npx skills add BackTrackCo/tenjin-agent
49
+ npx tenjin-cli install
46
50
  ```
47
51
 
48
- Installs the `tenjin` skill into Claude Code, Codex, or any
49
- Agent-Skills-compatible harness. It is the same zero-install curriculum served
50
- at [tenjin.blog/skills.md](https://tenjin.blog/skills.md) (canonical), and works
51
- today with no CLI and no account; a funded wallet is only needed for paid reads
52
- and publishing.
52
+ One command auto-detects your harness (Claude Code, Codex, or any
53
+ Agent-Skills-compatible setup), copies the three Tenjin skills into place, and
54
+ then runs the `doctor` checks as its last step. It is idempotent: re-run any
55
+ time, `--dry-run` previews the changes without writing, and
56
+ `--harness claude|codex|shared` (repeatable) targets a specific one.
57
+
58
+ Where the skills land:
59
+
60
+ - **Claude Code** (`~/.claude` present or `claude` on PATH):
61
+ `~/.claude/skills/`. The Claude Code plugin marketplace (a later release)
62
+ will supersede this path for Claude users.
63
+ - **Codex** (`~/.codex` present or `codex` on PATH): `~/.agents/skills/`, the
64
+ harness-shared Agent Skills location. The installer also appends a one-line
65
+ pointer to your AGENTS.md and prints the `config.toml` rule Codex needs,
66
+ because its default `workspace-write` sandbox blocks network and would
67
+ otherwise break every paid call:
68
+
69
+ ```toml
70
+ [sandbox_workspace_write]
71
+ network_access = true
72
+ ```
73
+
74
+ - **Nothing detected**: the installer falls back to `~/.agents/skills/`, so a
75
+ harness installed later still finds the skills.
76
+
77
+ The repo ships three skills:
78
+
79
+ - **`tenjin`**: the zero-install curriculum, a synced copy of the canonical
80
+ [tenjin.blog/skills.md](https://tenjin.blog/skills.md). Teaches the raw
81
+ HTTP/MCP surface; works with no CLI and no account. Use this when the CLI is
82
+ not installed.
83
+ - **`tenjin-search`**: thin adapter over `tenjin lookup/inspect/buy/outcome`
84
+ with a deliberately narrow trigger (public, durable, costly-to-reproduce
85
+ questions). Requires the CLI below.
86
+ - **`tenjin-publish`**: explicit-invocation-only publishing rubric and
87
+ `tenjin publish` adapter. Never triggers on its own.
88
+
89
+ A funded wallet is only needed for paid reads and publishing.
90
+
91
+ > Prefer no CLI? `npx skills add BackTrackCo/tenjin-agent` installs the same
92
+ > skills into any Agent-Skills-compatible harness without the `tenjin` binary.
53
93
 
54
94
  ### Add the remote MCP server
55
95
 
@@ -92,25 +132,86 @@ npm install -g tenjin-cli@next # pre-release channel
92
132
  tenjin doctor # verify Node floor, API reachability, contract, wallet
93
133
  ```
94
134
 
95
- Shipping today:
135
+ Shipping today (no backend dependency):
96
136
 
97
137
  | Command | Purpose |
98
138
  | --------------------------------------- | -------------------------------------------------------------------- |
139
+ | `tenjin install` | Auto-detect harnesses, wire the skills, then run the doctor checks |
99
140
  | `tenjin doctor` | Environment, API reachability, contract, and wallet checks |
100
141
  | `tenjin config [get\|set]` | Spend policy: `maxAutoSpend`, `sessionBudget`, `confirm`, allowlists |
101
142
  | `tenjin wallet [create\|show\|balance]` | Local Base wallet; the key never leaves the machine |
102
143
 
103
- Next: `lookup` / `inspect` / `buy` / `outcome` against the marketplace lookup
104
- API, `publish --draft`, an `install` command that auto-wires Claude Code and
105
- Codex, a Claude Code plugin marketplace in this repo, and `tenjin mcp` (local
144
+ Marketplace commands (need the Track A2 lookup API deployed to your `--base-url`):
145
+
146
+ | Command | Purpose |
147
+ | ---------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
148
+ | `tenjin lookup "<question>"` | Ask for payable candidates or an honest MISS; prints the compact JSON verbatim |
149
+ | `tenjin inspect <url-or-id>` | Show a candidate's pre-purchase card from the 402 body; never pays |
150
+ | `tenjin buy <url-or-id> [--max-price <usd>] [--yes]` | Entitlement re-check (free re-read if owned), then x402 exact payment |
151
+ | `tenjin outcome --lookup-id <id> --status <s>` | Report `used` / `partially_used` / `rejected` / `regenerated` / `purchase_declined` |
152
+ | `tenjin publish <file.md> [--price <usd>] [--yes]` | Publish a Markdown piece with an optional answer card, gated by a local scan and your consent mode |
153
+ | `tenjin publish --candidate <id>` | Publish a parked candidate (its draft.md); clears it on success |
154
+
155
+ `buy` re-reads an entitled resource for free before ever paying, re-delivers
156
+ already-bought content from the local library without paying again, and refuses to
157
+ sign if the price rose since it first saw the 402. Spend policy is enforced in the
158
+ wallet provider layer before any payment. The default output carries a heading
159
+ outline, never the body: `--print-body` includes it, and `--sections <tokens>`
160
+ includes the leading sections within a token budget (a deterministic heading
161
+ split, no model calls).
162
+
163
+ The lookup question must be **generalized public text**: derive the smallest
164
+ public phrasing of your task and never include secrets or private context. By
165
+ default the server stores no query text at all; `tenjin config set evalCohort
166
+ true` opts into 90-day retention of the question for retrieval evaluation.
167
+
168
+ > **Money units.** `--max-price` (and the spend-policy config values) are entered
169
+ > in **decimal USD** at the CLI edge (e.g. `--max-price 0.10`), and emitted in
170
+ > machine output as both atomic and USD. This is a deliberate deviation from the
171
+ > atomic-unit flags in CLI spec 10, per plan 12 decision O1 (humans think in
172
+ > dollars; agents read the atomic value in the JSON).
173
+
174
+ ### Consent modes and pricing
175
+
176
+ `publish.mode` governs ALL publishing uniformly. A piece you asked for and a
177
+ reusable answer your agent derived after a lookup both go through it, after a
178
+ deterministic local scan (secrets, keys, PII, wallet addresses) that runs in
179
+ every mode:
180
+
181
+ - **`review`** (the default) asks a one-click yes/no for every publish, even a
182
+ clean scan. This is the safe default: nothing leaves your machine unseen.
183
+ - **`auto`** publishes a clean scan immediately, including answers your agent
184
+ derives; any warning finding stops and asks; a hard block (a live secret or
185
+ private key) always refuses.
186
+ - **`full-auto`** does not stop for warnings, only for hard blocks. It is honored
187
+ from your global config, an env var, a flag, or a gitignored `.tenjin.json`. Only
188
+ a committed `.tenjin.json` asking for `full-auto` is downgraded to `auto`, so
189
+ cloning a repo can never enable silent auto-publishing.
190
+
191
+ `--yes` clears the warning findings and the review confirm; it never clears a hard
192
+ block. Set the mode with `tenjin config set publish.mode <mode>`, or per run with
193
+ `--mode`. `tenjin install` asks once on an interactive setup and otherwise leaves
194
+ the default (review); change it any time with `tenjin config set publish.mode`.
195
+
196
+ Pricing: `--price` (or a frontmatter `price:`) wins, otherwise `publish.defaultPrice`
197
+ (default $0.10). A card never auto-prices; the `tenjin-publish` skill's rubric is
198
+ what actually chooses a price before it calls the command.
199
+
200
+ Instead of a file, `publish --candidate <id>` publishes a parked candidate (see
201
+ `tenjin candidate`) from its stored `draft.md`, prefilling the card's question from
202
+ the candidate. It runs the same scan and consent flow and clears the candidate only
203
+ on a successful publish; a file and `--candidate` are mutually exclusive.
204
+
205
+ Next: a Claude Code plugin marketplace in this repo, and `tenjin mcp` (local
106
206
  stdio server over the same core).
107
207
 
108
208
  ### Output contract
109
209
 
110
210
  Every invocation prints exactly one JSON envelope to stdout
111
211
  (`{schemaVersion, command, ok, data | error}`); human rendering goes to stderr
112
- only. Exit codes: `0` success, `1` runtime/network, `2` usage, `3` policy
113
- refusal, `4` payment failure (reserved).
212
+ only. Exit codes: `0` success (including an honest MISS), `1` runtime/network,
213
+ `2` usage, `3` policy refusal (spend cap, allowlist, missing approval), `4`
214
+ payment failure after approval.
114
215
 
115
216
  ### Safety model
116
217
 
@@ -150,6 +251,56 @@ pnpm lint && pnpm typecheck && pnpm format:check
150
251
  pnpm pack-smoke # exercises the packed npm artifact
151
252
  ```
152
253
 
254
+ ## Release
255
+
256
+ Publishing to npm uses **Changesets** + **npm Trusted Publishing (OIDC)**,
257
+ driven by the two-job `workflow_dispatch`-only `.github/workflows/release.yml`.
258
+ This mirrors the house template in `BackTrackCo/x402r-sdk`. Nothing auto-fires
259
+ from a push or a tag: a maintainer clicks Run workflow at each step.
260
+
261
+ Day to day, add a changeset in the same PR as any shippable change:
262
+
263
+ ```sh
264
+ pnpm changeset # pick the bump type, write a summary; commit the .md
265
+ ```
266
+
267
+ To cut a release (two clicks):
268
+
269
+ 1. **Dispatch (click 1)**: Actions -> Release -> Run workflow -> `main`. The
270
+ `version` job runs `changeset version` (consumes `.changeset/*.md`, bumps
271
+ `package.json`, regenerates `CHANGELOG.md`) and opens the
272
+ **"chore(release): version packages"** PR. Nothing is published yet.
273
+ 2. **Review and merge** that PR (its final state is what ships; edit the
274
+ version or changelog directly if needed).
275
+ 3. **Dispatch (click 2)**: same path. With no pending changesets, the `publish`
276
+ job builds, runs the check suite + `pnpm audit` + the packed-artifact smoke
277
+ as a pre-publish gate, then `changeset publish` ships `tenjin-cli` with
278
+ provenance and creates the GitHub release. Prereleases use Changesets' pre
279
+ mode (`pnpm changeset pre enter alpha`) and publish to that dist-tag; stable
280
+ goes to `latest`.
281
+
282
+ Auth is npm Trusted Publishing (OIDC): each publish mints a short-lived,
283
+ per-run token, so there is **no `NPM_TOKEN`** to store or rotate.
284
+
285
+ ### One-time owner setup
286
+
287
+ `tenjin-cli` already exists on npm (published `0.1.0-alpha.1`), so no manual
288
+ first publish is needed. The owner must, one time:
289
+
290
+ 1. **Install the release-bot GitHub App on `BackTrackCo/tenjin-agent`** (the
291
+ same `x402r-release-bot` App used by `x402r-sdk`, or an equivalent), then
292
+ set repo **variable** `RELEASE_APP_CLIENT_ID` and repo **secret**
293
+ `RELEASE_APP_PRIVATE_KEY`. Required because Changesets' version PR must be
294
+ opened by an App identity to trigger CI (the default `GITHUB_TOKEN` cannot,
295
+ by GitHub's anti-recursion rule). Neither the variable nor the secret is
296
+ set on this repo yet, so `release.yml` will fail at the token step until
297
+ they exist.
298
+ 2. **Add a Trusted Publisher** to `tenjin-cli` on npmjs.com: provider GitHub
299
+ Actions, organization `BackTrackCo`, repository `tenjin-agent`, workflow
300
+ filename `release.yml`, environment `npm-publish`.
301
+ 3. **Create a GitHub Environment named `npm-publish`** (Settings ->
302
+ Environments), optionally with required reviewers to gate each publish.
303
+
153
304
  ## License
154
305
 
155
306
  MIT. See [NOTICE.md](./NOTICE.md) for third-party attributions (wallet-safety
@@ -4,7 +4,7 @@ import {
4
4
  __export,
5
5
  __require,
6
6
  __toESM
7
- } from "./chunk-3IMLRUZE.js";
7
+ } from "./chunk-ZXTAQYNA.js";
8
8
 
9
9
  // node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/constants.js
10
10
  var require_constants = __commonJS({
@@ -3734,4 +3734,4 @@ var WebSocket3 = (() => {
3734
3734
  export {
3735
3735
  WebSocket3 as WebSocket
3736
3736
  };
3737
- //# sourceMappingURL=_esm-ZH2J4QEH.js.map
3737
+ //# sourceMappingURL=_esm-C5CRWCYU.js.map