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

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 (246) hide show
  1. package/NOTICE.md +54 -7
  2. package/README.md +149 -264
  3. package/dist/{_esm-FEASBWRP.js → _esm-CE7KNONL.js} +9 -10
  4. package/dist/alive-3J3CHOQP.js +21 -0
  5. package/dist/{ccip-NQXCEK2U.js → ccip-7RMRLAGV.js} +4 -4
  6. package/dist/{ccip-XR5NE5QK.js → ccip-NLCSCHKI.js} +5 -5
  7. package/dist/chunk-2SNUOHAT.js +75 -0
  8. package/dist/chunk-2SNUOHAT.js.map +1 -0
  9. package/dist/chunk-3O2BQIF6.js +2227 -0
  10. package/dist/chunk-3O2BQIF6.js.map +1 -0
  11. package/dist/{chunk-ZMHYXMO6.js → chunk-5IEP5EGE.js} +3 -3
  12. package/dist/chunk-5LJCEMFD.js +12700 -0
  13. package/dist/chunk-5LJCEMFD.js.map +1 -0
  14. package/dist/chunk-6W5GYG3W.js +128 -0
  15. package/dist/chunk-6W5GYG3W.js.map +1 -0
  16. package/dist/chunk-7EKYXMUO.js +7536 -0
  17. package/dist/chunk-7EKYXMUO.js.map +1 -0
  18. package/dist/chunk-7QKHZQKW.js +1680 -0
  19. package/dist/chunk-7QKHZQKW.js.map +1 -0
  20. package/dist/chunk-A36LQPHV.js +29 -0
  21. package/dist/chunk-A36LQPHV.js.map +1 -0
  22. package/dist/chunk-AEG2PXBP.js +192 -0
  23. package/dist/chunk-AEG2PXBP.js.map +1 -0
  24. package/dist/chunk-AKWGE6JQ.js +49 -0
  25. package/dist/chunk-AKWGE6JQ.js.map +1 -0
  26. package/dist/chunk-AWFUPKTM.js +238 -0
  27. package/dist/chunk-AWFUPKTM.js.map +1 -0
  28. package/dist/{chunk-UGX7YPX2.js → chunk-AWQPGIR6.js} +7 -9
  29. package/dist/{chunk-UGX7YPX2.js.map → chunk-AWQPGIR6.js.map} +1 -1
  30. package/dist/{chunk-5CLSD5YN.js → chunk-BPMWXTFX.js} +2 -2
  31. package/dist/chunk-EBVIKMCH.js +108 -0
  32. package/dist/chunk-EBVIKMCH.js.map +1 -0
  33. package/dist/{chunk-YALGASEU.js → chunk-EGELTSPU.js} +2 -2
  34. package/dist/{chunk-S3IGX57D.js → chunk-EL56RW2J.js} +166 -7237
  35. package/dist/chunk-EL56RW2J.js.map +1 -0
  36. package/dist/chunk-HE2MS4QO.js +256 -0
  37. package/dist/chunk-HE2MS4QO.js.map +1 -0
  38. package/dist/{chunk-CYOF7ROH.js → chunk-HPWO4O6S.js} +3 -3
  39. package/dist/chunk-IOODYAXL.js +324 -0
  40. package/dist/chunk-IOODYAXL.js.map +1 -0
  41. package/dist/chunk-JMM6YE7J.js +2174 -0
  42. package/dist/chunk-JMM6YE7J.js.map +1 -0
  43. package/dist/{chunk-QVX5MWJZ.js → chunk-JRGFKVAZ.js} +2 -2
  44. package/dist/{chunk-HIVZG55D.js → chunk-KG3D7FIF.js} +2 -2
  45. package/dist/chunk-KHE6L6TD.js +416 -0
  46. package/dist/chunk-KHE6L6TD.js.map +1 -0
  47. package/dist/chunk-KOGZDMHO.js +21 -0
  48. package/dist/chunk-KOGZDMHO.js.map +1 -0
  49. package/dist/chunk-KYFZTGMC.js +237 -0
  50. package/dist/chunk-KYFZTGMC.js.map +1 -0
  51. package/dist/chunk-LFZJM56J.js +159 -0
  52. package/dist/chunk-LFZJM56J.js.map +1 -0
  53. package/dist/chunk-LHHMV4GU.js +27 -0
  54. package/dist/chunk-LHHMV4GU.js.map +1 -0
  55. package/dist/{chunk-YBMMV4Y4.js → chunk-MEFB5KHA.js} +13 -5
  56. package/dist/chunk-MEFB5KHA.js.map +1 -0
  57. package/dist/{chunk-NCE5NSN6.js → chunk-N35E6CM2.js} +140 -10
  58. package/dist/chunk-N35E6CM2.js.map +1 -0
  59. package/dist/chunk-NZIP4PA2.js +114 -0
  60. package/dist/chunk-NZIP4PA2.js.map +1 -0
  61. package/dist/chunk-O2FRQ2L2.js +168 -0
  62. package/dist/chunk-O2FRQ2L2.js.map +1 -0
  63. package/dist/chunk-OK2TDZQU.js +404 -0
  64. package/dist/chunk-OK2TDZQU.js.map +1 -0
  65. package/dist/chunk-ORWL5BSN.js +269 -0
  66. package/dist/chunk-ORWL5BSN.js.map +1 -0
  67. package/dist/{chunk-Z6MFJV5Z.js → chunk-OSYTBCUC.js} +850 -499
  68. package/dist/chunk-OSYTBCUC.js.map +1 -0
  69. package/dist/chunk-P7LABKCW.js +90 -0
  70. package/dist/chunk-P7LABKCW.js.map +1 -0
  71. package/dist/chunk-PAYV4XUA.js +151 -0
  72. package/dist/chunk-PAYV4XUA.js.map +1 -0
  73. package/dist/{chunk-ZABPQJ3M.js → chunk-POUWHWID.js} +2 -2
  74. package/dist/chunk-QUVVWYJW.js +112 -0
  75. package/dist/chunk-QUVVWYJW.js.map +1 -0
  76. package/dist/chunk-RAULEAZ6.js +228 -0
  77. package/dist/chunk-RAULEAZ6.js.map +1 -0
  78. package/dist/chunk-S4SAZ7OD.js +30 -0
  79. package/dist/chunk-S4SAZ7OD.js.map +1 -0
  80. package/dist/chunk-SJLTEINJ.js +117 -0
  81. package/dist/chunk-SJLTEINJ.js.map +1 -0
  82. package/dist/chunk-SPAVAYSW.js +125 -0
  83. package/dist/chunk-SPAVAYSW.js.map +1 -0
  84. package/dist/chunk-TTBKWWTV.js +1605 -0
  85. package/dist/chunk-TTBKWWTV.js.map +1 -0
  86. package/dist/{chunk-RRN3YTK7.js → chunk-TTNESUPQ.js} +3 -3
  87. package/dist/chunk-U6YQ6FRI.js +378 -0
  88. package/dist/chunk-U6YQ6FRI.js.map +1 -0
  89. package/dist/chunk-VFMQTSXG.js +29 -0
  90. package/dist/chunk-VFMQTSXG.js.map +1 -0
  91. package/dist/chunk-VUFAK2LW.js +115 -0
  92. package/dist/chunk-VUFAK2LW.js.map +1 -0
  93. package/dist/chunk-VZGAONSJ.js +194 -0
  94. package/dist/chunk-VZGAONSJ.js.map +1 -0
  95. package/dist/{chunk-OYMYCW7J.js → chunk-WO5BJNIB.js} +682 -53
  96. package/dist/chunk-WO5BJNIB.js.map +1 -0
  97. package/dist/chunk-WVUSXNIE.js +39 -0
  98. package/dist/chunk-WVUSXNIE.js.map +1 -0
  99. package/dist/chunk-XKESD27X.js +10 -0
  100. package/dist/chunk-XKESD27X.js.map +1 -0
  101. package/dist/{chunk-HSDCI7OV.js → chunk-XZKD7DIF.js} +3 -3
  102. package/dist/{chunk-XJIW7USF.js → chunk-YFQOA5AU.js} +118 -9
  103. package/dist/chunk-YFQOA5AU.js.map +1 -0
  104. package/dist/chunk-YHKXNYTB.js +105 -0
  105. package/dist/chunk-YHKXNYTB.js.map +1 -0
  106. package/dist/{cli-SBXI5AMS.js → cli-O5SN7ZJ4.js} +382 -214
  107. package/dist/cli-O5SN7ZJ4.js.map +1 -0
  108. package/dist/config-OJQI27LT.js +45 -0
  109. package/dist/dist-3LOO6M4U.js +2842 -0
  110. package/dist/dist-3LOO6M4U.js.map +1 -0
  111. package/dist/doctor-IQQJHGGM.js +590 -0
  112. package/dist/doctor-IQQJHGGM.js.map +1 -0
  113. package/dist/env-proxy-XL4P73MZ.js +15 -0
  114. package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js → ethersCompat-Df4a6QIZ-THAVUGIJ.js} +5 -5
  115. package/dist/fund-WEV6DMTD.js +365 -0
  116. package/dist/fund-WEV6DMTD.js.map +1 -0
  117. package/dist/hook-command-D2P3ILRV.js +32 -0
  118. package/dist/hosts/claude/.claude-plugin/marketplace.json +19 -0
  119. package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +14 -0
  120. package/dist/hosts/claude/tenjin/.mcp.json +12 -0
  121. package/dist/hosts/claude/tenjin/hooks/hooks.json +221 -0
  122. package/dist/index.js +21 -2
  123. package/dist/index.js.map +1 -1
  124. package/dist/install-TUCRF32I.js +60 -0
  125. package/dist/install-identity-WHPNMNMQ.js +26 -0
  126. package/dist/install-wallet-MA27FTQ5.js +113 -0
  127. package/dist/install-wallet-MA27FTQ5.js.map +1 -0
  128. package/dist/mcp-QML7ZMPH.js +13427 -0
  129. package/dist/mcp-QML7ZMPH.js.map +1 -0
  130. package/dist/package-LGKYOEPV.js +37 -0
  131. package/dist/package-LGKYOEPV.js.map +1 -0
  132. package/dist/paths-POPTXJO6.js +61 -0
  133. package/dist/paths-POPTXJO6.js.map +1 -0
  134. package/dist/pay-2C2UBBXJ.js +51 -0
  135. package/dist/pay-2C2UBBXJ.js.map +1 -0
  136. package/dist/payments-C44QUFXU.js +106 -0
  137. package/dist/payments-C44QUFXU.js.map +1 -0
  138. package/dist/redact-6W23GGJC.js +15 -0
  139. package/dist/redact-6W23GGJC.js.map +1 -0
  140. package/dist/{secp256k1-N3ZHU7LB.js → secp256k1-ZZZT2CAX.js} +3 -3
  141. package/dist/secp256k1-ZZZT2CAX.js.map +1 -0
  142. package/dist/send-KVJX4XIR.js +222 -0
  143. package/dist/send-KVJX4XIR.js.map +1 -0
  144. package/dist/status-S7C3WMSH.js +115 -0
  145. package/dist/status-S7C3WMSH.js.map +1 -0
  146. package/dist/status-line-YR2T5HC4.js +86 -0
  147. package/dist/status-line-YR2T5HC4.js.map +1 -0
  148. package/dist/uninstall-HY6LKIIT.js +149 -0
  149. package/dist/uninstall-HY6LKIIT.js.map +1 -0
  150. package/dist/update-OJV22LR3.js +36 -0
  151. package/dist/update-OJV22LR3.js.map +1 -0
  152. package/dist/usdc-JK4RRFFQ.js +39 -0
  153. package/dist/usdc-JK4RRFFQ.js.map +1 -0
  154. package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js → viemAdapter-By13KInL-X2VY6CY3.js} +5 -5
  155. package/dist/viemAdapter-By13KInL-X2VY6CY3.js.map +1 -0
  156. package/dist/wallet-PD2IMZDU.js +39 -0
  157. package/dist/wallet-PD2IMZDU.js.map +1 -0
  158. package/dist/wallet-kdf-worker.mjs +980 -0
  159. package/docs/agent-permissions.md +180 -0
  160. package/docs/safety-model.md +59 -0
  161. package/docs/troubleshooting.md +13 -0
  162. package/package.json +28 -19
  163. package/LICENSE +0 -21
  164. package/dist/buy-EE6SEXP6.js +0 -1598
  165. package/dist/buy-EE6SEXP6.js.map +0 -1
  166. package/dist/candidate-ERMSYYQZ.js +0 -127
  167. package/dist/candidate-ERMSYYQZ.js.map +0 -1
  168. package/dist/chunk-3OV7E5G5.js +0 -18
  169. package/dist/chunk-3OV7E5G5.js.map +0 -1
  170. package/dist/chunk-4ONXEEQL.js +0 -152
  171. package/dist/chunk-4ONXEEQL.js.map +0 -1
  172. package/dist/chunk-662MSGZB.js +0 -286
  173. package/dist/chunk-662MSGZB.js.map +0 -1
  174. package/dist/chunk-7KUW4MJD.js +0 -59
  175. package/dist/chunk-7KUW4MJD.js.map +0 -1
  176. package/dist/chunk-AWPAWHNX.js +0 -333
  177. package/dist/chunk-AWPAWHNX.js.map +0 -1
  178. package/dist/chunk-DXTQ3CSI.js +0 -171
  179. package/dist/chunk-DXTQ3CSI.js.map +0 -1
  180. package/dist/chunk-ESPNTPQ2.js +0 -207
  181. package/dist/chunk-ESPNTPQ2.js.map +0 -1
  182. package/dist/chunk-FJPLRISB.js +0 -79
  183. package/dist/chunk-FJPLRISB.js.map +0 -1
  184. package/dist/chunk-GO75V3NZ.js +0 -160
  185. package/dist/chunk-GO75V3NZ.js.map +0 -1
  186. package/dist/chunk-JPHG2JW3.js +0 -96
  187. package/dist/chunk-JPHG2JW3.js.map +0 -1
  188. package/dist/chunk-MUBUQVC3.js +0 -67
  189. package/dist/chunk-MUBUQVC3.js.map +0 -1
  190. package/dist/chunk-NCE5NSN6.js.map +0 -1
  191. package/dist/chunk-OYMYCW7J.js.map +0 -1
  192. package/dist/chunk-RY4XKNV3.js +0 -140
  193. package/dist/chunk-RY4XKNV3.js.map +0 -1
  194. package/dist/chunk-S3IGX57D.js.map +0 -1
  195. package/dist/chunk-TLCMMYLY.js +0 -126
  196. package/dist/chunk-TLCMMYLY.js.map +0 -1
  197. package/dist/chunk-UO22YNY4.js +0 -69
  198. package/dist/chunk-UO22YNY4.js.map +0 -1
  199. package/dist/chunk-XHC6FCGZ.js +0 -261
  200. package/dist/chunk-XHC6FCGZ.js.map +0 -1
  201. package/dist/chunk-XJIW7USF.js.map +0 -1
  202. package/dist/chunk-YBMMV4Y4.js.map +0 -1
  203. package/dist/chunk-YN5SHIXQ.js +0 -126
  204. package/dist/chunk-YN5SHIXQ.js.map +0 -1
  205. package/dist/chunk-Z52RA3NC.js +0 -137
  206. package/dist/chunk-Z52RA3NC.js.map +0 -1
  207. package/dist/chunk-Z6MFJV5Z.js.map +0 -1
  208. package/dist/cli-SBXI5AMS.js.map +0 -1
  209. package/dist/config-VELDKLHY.js +0 -21
  210. package/dist/doctor-T3KWNNP2.js +0 -20
  211. package/dist/inspect-LMKOXE4Y.js +0 -96
  212. package/dist/inspect-LMKOXE4Y.js.map +0 -1
  213. package/dist/install-LEX3ENQ6.js +0 -387
  214. package/dist/install-LEX3ENQ6.js.map +0 -1
  215. package/dist/lookup-ZPN2Q67N.js +0 -129
  216. package/dist/lookup-ZPN2Q67N.js.map +0 -1
  217. package/dist/outcome-N7TAK6WR.js +0 -66
  218. package/dist/outcome-N7TAK6WR.js.map +0 -1
  219. package/dist/publish-BKBQQAW4.js +0 -1478
  220. package/dist/publish-BKBQQAW4.js.map +0 -1
  221. package/dist/usdc-JIAJW4SV.js +0 -22
  222. package/dist/wallet-CWEMYVIH.js +0 -179
  223. package/dist/wallet-CWEMYVIH.js.map +0 -1
  224. package/dist/wallet-PA54CRBL.js +0 -30
  225. package/skills/tenjin/SKILL.md +0 -199
  226. package/skills/tenjin-publish/SKILL.md +0 -111
  227. package/skills/tenjin-search/SKILL.md +0 -133
  228. /package/dist/{_esm-FEASBWRP.js.map → _esm-CE7KNONL.js.map} +0 -0
  229. /package/dist/{ccip-NQXCEK2U.js.map → alive-3J3CHOQP.js.map} +0 -0
  230. /package/dist/{ccip-XR5NE5QK.js.map → ccip-7RMRLAGV.js.map} +0 -0
  231. /package/dist/{config-VELDKLHY.js.map → ccip-NLCSCHKI.js.map} +0 -0
  232. /package/dist/{chunk-ZMHYXMO6.js.map → chunk-5IEP5EGE.js.map} +0 -0
  233. /package/dist/{chunk-5CLSD5YN.js.map → chunk-BPMWXTFX.js.map} +0 -0
  234. /package/dist/{chunk-YALGASEU.js.map → chunk-EGELTSPU.js.map} +0 -0
  235. /package/dist/{chunk-CYOF7ROH.js.map → chunk-HPWO4O6S.js.map} +0 -0
  236. /package/dist/{chunk-QVX5MWJZ.js.map → chunk-JRGFKVAZ.js.map} +0 -0
  237. /package/dist/{chunk-HIVZG55D.js.map → chunk-KG3D7FIF.js.map} +0 -0
  238. /package/dist/{chunk-ZABPQJ3M.js.map → chunk-POUWHWID.js.map} +0 -0
  239. /package/dist/{chunk-RRN3YTK7.js.map → chunk-TTNESUPQ.js.map} +0 -0
  240. /package/dist/{chunk-HSDCI7OV.js.map → chunk-XZKD7DIF.js.map} +0 -0
  241. /package/dist/{doctor-T3KWNNP2.js.map → config-OJQI27LT.js.map} +0 -0
  242. /package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js.map → env-proxy-XL4P73MZ.js.map} +0 -0
  243. /package/dist/{secp256k1-N3ZHU7LB.js.map → ethersCompat-Df4a6QIZ-THAVUGIJ.js.map} +0 -0
  244. /package/dist/{usdc-JIAJW4SV.js.map → hook-command-D2P3ILRV.js.map} +0 -0
  245. /package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js.map → install-TUCRF32I.js.map} +0 -0
  246. /package/dist/{wallet-PA54CRBL.js.map → install-identity-WHPNMNMQ.js.map} +0 -0
@@ -0,0 +1,221 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "hooks": [
6
+ {
7
+ "type": "command",
8
+ "command": "node",
9
+ "args": [
10
+ "${CLAUDE_PLUGIN_ROOT}/../../../index.js",
11
+ "hook",
12
+ "alive"
13
+ ],
14
+ "timeout": 5
15
+ }
16
+ ]
17
+ }
18
+ ],
19
+ "UserPromptSubmit": [
20
+ {
21
+ "hooks": [
22
+ {
23
+ "type": "mcp_tool",
24
+ "server": "plugin:tenjin:router",
25
+ "tool": "hook",
26
+ "input": {
27
+ "kind": "prompt",
28
+ "hook_event_name": "${hook_event_name}",
29
+ "session_id": "${session_id}",
30
+ "transcript_path": "${transcript_path}",
31
+ "cwd": "${cwd}",
32
+ "prompt": "${prompt}"
33
+ },
34
+ "timeout": 5
35
+ }
36
+ ]
37
+ }
38
+ ],
39
+ "PreToolUse": [
40
+ {
41
+ "matcher": "WebSearch|WebFetch",
42
+ "hooks": [
43
+ {
44
+ "type": "mcp_tool",
45
+ "server": "plugin:tenjin:router",
46
+ "tool": "hook",
47
+ "input": {
48
+ "kind": "native",
49
+ "hook_event_name": "${hook_event_name}",
50
+ "session_id": "${session_id}",
51
+ "transcript_path": "${transcript_path}",
52
+ "cwd": "${cwd}",
53
+ "tool_name": "${tool_name}",
54
+ "tool_input": "${tool_input}",
55
+ "tool_use_id": "${tool_use_id}",
56
+ "agent_id": "${agent_id}",
57
+ "agent_type": "${agent_type}"
58
+ },
59
+ "timeout": 5
60
+ }
61
+ ]
62
+ },
63
+ {
64
+ "matcher": "Agent|Task",
65
+ "hooks": [
66
+ {
67
+ "type": "mcp_tool",
68
+ "server": "plugin:tenjin:router",
69
+ "tool": "hook",
70
+ "input": {
71
+ "kind": "agent",
72
+ "hook_event_name": "${hook_event_name}",
73
+ "session_id": "${session_id}",
74
+ "transcript_path": "${transcript_path}",
75
+ "cwd": "${cwd}",
76
+ "tool_name": "${tool_name}",
77
+ "tool_input": "${tool_input}",
78
+ "tool_use_id": "${tool_use_id}",
79
+ "agent_id": "${agent_id}",
80
+ "agent_type": "${agent_type}"
81
+ },
82
+ "timeout": 5
83
+ }
84
+ ]
85
+ },
86
+ {
87
+ "matcher": "AskUserQuestion",
88
+ "hooks": [
89
+ {
90
+ "type": "mcp_tool",
91
+ "server": "plugin:tenjin:router",
92
+ "tool": "hook",
93
+ "input": {
94
+ "kind": "ask",
95
+ "hook_event_name": "${hook_event_name}",
96
+ "session_id": "${session_id}",
97
+ "transcript_path": "${transcript_path}",
98
+ "cwd": "${cwd}",
99
+ "tool_name": "${tool_name}",
100
+ "tool_input": "${tool_input}",
101
+ "tool_use_id": "${tool_use_id}",
102
+ "agent_id": "${agent_id}",
103
+ "agent_type": "${agent_type}"
104
+ },
105
+ "timeout": 5
106
+ }
107
+ ]
108
+ },
109
+ {
110
+ "matcher": "mcp__plugin_tenjin_router__hook",
111
+ "hooks": [
112
+ {
113
+ "type": "command",
114
+ "command": "node",
115
+ "args": [
116
+ "-e",
117
+ "process.stdout.write(process.argv[1])",
118
+ "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"Only the Tenjin hooks call this tool. To make a lookup, call mcp__plugin_tenjin_router__request.\"}}"
119
+ ],
120
+ "timeout": 5
121
+ }
122
+ ]
123
+ },
124
+ {
125
+ "matcher": "mcp__plugin_tenjin_router__request",
126
+ "hooks": [
127
+ {
128
+ "type": "command",
129
+ "command": "node",
130
+ "args": [
131
+ "-e",
132
+ "process.stdout.write(process.argv[1])",
133
+ "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"allow\",\"permissionDecisionReason\":\"Tenjin lookup\"}}"
134
+ ],
135
+ "timeout": 5
136
+ }
137
+ ]
138
+ }
139
+ ],
140
+ "PostToolUse": [
141
+ {
142
+ "matcher": "WebSearch|WebFetch",
143
+ "hooks": [
144
+ {
145
+ "type": "mcp_tool",
146
+ "server": "plugin:tenjin:router",
147
+ "tool": "hook",
148
+ "input": {
149
+ "kind": "shortfall",
150
+ "hook_event_name": "${hook_event_name}",
151
+ "session_id": "${session_id}",
152
+ "transcript_path": "${transcript_path}",
153
+ "cwd": "${cwd}",
154
+ "tool_name": "${tool_name}",
155
+ "tool_input": "${tool_input}",
156
+ "tool_use_id": "${tool_use_id}",
157
+ "agent_id": "${agent_id}",
158
+ "agent_type": "${agent_type}",
159
+ "tool_response": "${tool_response}",
160
+ "error": "${error}",
161
+ "is_interrupt": "${is_interrupt}"
162
+ },
163
+ "timeout": 15
164
+ }
165
+ ]
166
+ },
167
+ {
168
+ "matcher": "AskUserQuestion",
169
+ "hooks": [
170
+ {
171
+ "type": "mcp_tool",
172
+ "server": "plugin:tenjin:router",
173
+ "tool": "hook",
174
+ "input": {
175
+ "kind": "answer",
176
+ "hook_event_name": "${hook_event_name}",
177
+ "session_id": "${session_id}",
178
+ "transcript_path": "${transcript_path}",
179
+ "cwd": "${cwd}",
180
+ "tool_name": "${tool_name}",
181
+ "tool_input": "${tool_input}",
182
+ "tool_use_id": "${tool_use_id}",
183
+ "agent_id": "${agent_id}",
184
+ "agent_type": "${agent_type}",
185
+ "tool_response": "${tool_response}"
186
+ },
187
+ "timeout": 5
188
+ }
189
+ ]
190
+ }
191
+ ],
192
+ "PostToolUseFailure": [
193
+ {
194
+ "matcher": "WebSearch|WebFetch",
195
+ "hooks": [
196
+ {
197
+ "type": "mcp_tool",
198
+ "server": "plugin:tenjin:router",
199
+ "tool": "hook",
200
+ "input": {
201
+ "kind": "shortfall",
202
+ "hook_event_name": "${hook_event_name}",
203
+ "session_id": "${session_id}",
204
+ "transcript_path": "${transcript_path}",
205
+ "cwd": "${cwd}",
206
+ "tool_name": "${tool_name}",
207
+ "tool_input": "${tool_input}",
208
+ "tool_use_id": "${tool_use_id}",
209
+ "agent_id": "${agent_id}",
210
+ "agent_type": "${agent_type}",
211
+ "tool_response": "${tool_response}",
212
+ "error": "${error}",
213
+ "is_interrupt": "${is_interrupt}"
214
+ },
215
+ "timeout": 15
216
+ }
217
+ ]
218
+ }
219
+ ]
220
+ }
221
+ }
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ if (Number.isNaN(nodeMajor) || nodeMajor < MIN_NODE_MAJOR) {
12
12
  error: {
13
13
  code: "NODE_UNSUPPORTED",
14
14
  message: `Tenjin CLI requires Node ${MIN_NODE_MAJOR} or newer (found ${process.versions.node}).`,
15
- fix: "Install Node 22 or newer"
15
+ fix: `Install Node ${MIN_NODE_MAJOR} or newer`
16
16
  }
17
17
  };
18
18
  process.stdout.write(`${JSON.stringify(envelope, null, 2)}
@@ -21,6 +21,25 @@ if (Number.isNaN(nodeMajor) || nodeMajor < MIN_NODE_MAJOR) {
21
21
  `);
22
22
  process.exit(1);
23
23
  }
24
- var { main } = await import("./cli-SBXI5AMS.js");
24
+ if (process.argv.length === 3 && process.argv[2] === "status-line") {
25
+ const { statusLineMain } = await import("./status-line-YR2T5HC4.js");
26
+ await statusLineMain();
27
+ process.exit(0);
28
+ }
29
+ if (process.argv.length === 4 && process.argv[2] === "hook" && process.argv[3] === "alive") {
30
+ const [{ aliveMain }, { dataDir: dataDir2 }, { default: pkg }] = await Promise.all([
31
+ import("./alive-3J3CHOQP.js"),
32
+ import("./paths-POPTXJO6.js"),
33
+ import("./package-LGKYOEPV.js")
34
+ ]);
35
+ await aliveMain({ dataDir: dataDir2(process.env), version: pkg.version });
36
+ process.exit(0);
37
+ }
38
+ var { useEnvProxy } = await import("./env-proxy-XL4P73MZ.js");
39
+ useEnvProxy(process.env);
40
+ var { main } = await import("./cli-O5SN7ZJ4.js");
41
+ var { enableCliIdentity } = await import("./install-identity-WHPNMNMQ.js");
42
+ var { dataDir } = await import("./paths-POPTXJO6.js");
43
+ enableCliIdentity(dataDir(process.env));
25
44
  process.exit(await main(process.argv.slice(2)));
26
45
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n// Bin entry. The Node version guard runs BEFORE importing anything else — no\n// static imports above it — so an out-of-support runtime gets one JSON error\n// envelope plus a human stderr line instead of a syntax/parse crash from a\n// lazily-loaded module written in newer syntax. Kept in conservative syntax.\nconst MIN_NODE_MAJOR = 22;\n\nconst nodeMajor = Number.parseInt(process.versions.node.split('.')[0] ?? '', 10);\n\nif (Number.isNaN(nodeMajor) || nodeMajor < MIN_NODE_MAJOR) {\n const envelope = {\n schemaVersion: 1,\n command: 'preflight',\n ok: false,\n error: {\n code: 'NODE_UNSUPPORTED',\n message: `Tenjin CLI requires Node ${MIN_NODE_MAJOR} or newer (found ${process.versions.node}).`,\n fix: 'Install Node 22 or newer',\n },\n };\n process.stdout.write(`${JSON.stringify(envelope, null, 2)}\\n`);\n process.stderr.write(`error: Node ${MIN_NODE_MAJOR}+ required, found ${process.versions.node}\\n`);\n process.exit(1);\n}\n\nconst { main } = await import('./cli');\nprocess.exit(await main(process.argv.slice(2)));\n\n// Marks this file a module so top-level await is legal; emits nothing.\nexport {};\n"],"mappings":";;;;AAKA,IAAM,iBAAiB;AAEvB,IAAM,YAAY,OAAO,SAAS,QAAQ,SAAS,KAAK,MAAM,GAAG,EAAE,CAAC,KAAK,IAAI,EAAE;AAE/E,IAAI,OAAO,MAAM,SAAS,KAAK,YAAY,gBAAgB;AACzD,QAAM,WAAW;AAAA,IACf,eAAe;AAAA,IACf,SAAS;AAAA,IACT,IAAI;AAAA,IACJ,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS,4BAA4B,cAAc,oBAAoB,QAAQ,SAAS,IAAI;AAAA,MAC5F,KAAK;AAAA,IACP;AAAA,EACF;AACA,UAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,UAAU,MAAM,CAAC,CAAC;AAAA,CAAI;AAC7D,UAAQ,OAAO,MAAM,eAAe,cAAc,qBAAqB,QAAQ,SAAS,IAAI;AAAA,CAAI;AAChG,UAAQ,KAAK,CAAC;AAChB;AAEA,IAAM,EAAE,KAAK,IAAI,MAAM,OAAO,mBAAO;AACrC,QAAQ,KAAK,MAAM,KAAK,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n// Bin entry. The Node version guard runs BEFORE importing anything else — no\n// static imports above it — so an out-of-support runtime gets one JSON error\n// envelope plus a human stderr line instead of a syntax/parse crash from a\n// lazily-loaded module written in newer syntax. Kept in conservative syntax.\nconst MIN_NODE_MAJOR = 22;\n\nconst nodeMajor = Number.parseInt(process.versions.node.split('.')[0] ?? '', 10);\n\nif (Number.isNaN(nodeMajor) || nodeMajor < MIN_NODE_MAJOR) {\n const envelope = {\n schemaVersion: 1,\n command: 'preflight',\n ok: false,\n error: {\n code: 'NODE_UNSUPPORTED',\n message: `Tenjin CLI requires Node ${MIN_NODE_MAJOR} or newer (found ${process.versions.node}).`,\n fix: `Install Node ${MIN_NODE_MAJOR} or newer`,\n },\n };\n process.stdout.write(`${JSON.stringify(envelope, null, 2)}\\n`);\n process.stderr.write(`error: Node ${MIN_NODE_MAJOR}+ required, found ${process.versions.node}\\n`);\n process.exit(1);\n}\n\n// THE STATUS LINE NEVER LOADS THE CLI. Claude Code runs it once a second for as\n// long as a session is open, and commander, zod and the command tree are parse\n// cost it has no use for. Only the bare invocation is diverted; `--help` and\n// every flag fall through to the command tree, which registers it like any verb.\nif (process.argv.length === 3 && process.argv[2] === 'status-line') {\n const { statusLineMain } = await import('./router/status-line');\n await statusLineMain();\n process.exit(0);\n}\n\n// THE PLUGIN'S SessionStart LEG NEVER LOADS THE CLI EITHER. It runs before\n// every session starts, writes two small files and prints nothing, so it\n// takes the same shortcut. A flag falls through to the command tree.\nif (process.argv.length === 4 && process.argv[2] === 'hook' && process.argv[3] === 'alive') {\n const [{ aliveMain }, { dataDir }, { default: pkg }] = await Promise.all([\n import('./router/alive'),\n import('./lib/paths'),\n import('../package.json'),\n ]);\n await aliveMain({ dataDir: dataDir(process.env), version: pkg.version });\n process.exit(0);\n}\n\n// After the status line, which sends no request: every other process from this\n// bin (the CLI, the hooks, `tenjin mcp`) honours HTTPS_PROXY and NO_PROXY.\nconst { useEnvProxy } = await import('./lib/env-proxy');\nuseEnvProxy(process.env);\n\nconst { main } = await import('./cli');\n// Here and not in `main`, so an in-process test of the command tree sends no\n// telemetry and mints no install id; see lib/install-identity.\nconst { enableCliIdentity } = await import('./lib/install-identity');\nconst { dataDir } = await import('./lib/paths');\nenableCliIdentity(dataDir(process.env));\nprocess.exit(await main(process.argv.slice(2)));\n\n// Marks this file a module so top-level await is legal; emits nothing.\nexport {};\n"],"mappings":";;;;AAKA,IAAM,iBAAiB;AAEvB,IAAM,YAAY,OAAO,SAAS,QAAQ,SAAS,KAAK,MAAM,GAAG,EAAE,CAAC,KAAK,IAAI,EAAE;AAE/E,IAAI,OAAO,MAAM,SAAS,KAAK,YAAY,gBAAgB;AACzD,QAAM,WAAW;AAAA,IACf,eAAe;AAAA,IACf,SAAS;AAAA,IACT,IAAI;AAAA,IACJ,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS,4BAA4B,cAAc,oBAAoB,QAAQ,SAAS,IAAI;AAAA,MAC5F,KAAK,gBAAgB,cAAc;AAAA,IACrC;AAAA,EACF;AACA,UAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,UAAU,MAAM,CAAC,CAAC;AAAA,CAAI;AAC7D,UAAQ,OAAO,MAAM,eAAe,cAAc,qBAAqB,QAAQ,SAAS,IAAI;AAAA,CAAI;AAChG,UAAQ,KAAK,CAAC;AAChB;AAMA,IAAI,QAAQ,KAAK,WAAW,KAAK,QAAQ,KAAK,CAAC,MAAM,eAAe;AAClE,QAAM,EAAE,eAAe,IAAI,MAAM,OAAO,2BAAsB;AAC9D,QAAM,eAAe;AACrB,UAAQ,KAAK,CAAC;AAChB;AAKA,IAAI,QAAQ,KAAK,WAAW,KAAK,QAAQ,KAAK,CAAC,MAAM,UAAU,QAAQ,KAAK,CAAC,MAAM,SAAS;AAC1F,QAAM,CAAC,EAAE,UAAU,GAAG,EAAE,SAAAA,SAAQ,GAAG,EAAE,SAAS,IAAI,CAAC,IAAI,MAAM,QAAQ,IAAI;AAAA,IACvE,OAAO,qBAAgB;AAAA,IACvB,OAAO,qBAAa;AAAA,IACpB,OAAO,uBAAiB;AAAA,EAC1B,CAAC;AACD,QAAM,UAAU,EAAE,SAASA,SAAQ,QAAQ,GAAG,GAAG,SAAS,IAAI,QAAQ,CAAC;AACvE,UAAQ,KAAK,CAAC;AAChB;AAIA,IAAM,EAAE,YAAY,IAAI,MAAM,OAAO,yBAAiB;AACtD,YAAY,QAAQ,GAAG;AAEvB,IAAM,EAAE,KAAK,IAAI,MAAM,OAAO,mBAAO;AAGrC,IAAM,EAAE,kBAAkB,IAAI,MAAM,OAAO,gCAAwB;AACnE,IAAM,EAAE,QAAQ,IAAI,MAAM,OAAO,qBAAa;AAC9C,kBAAkB,QAAQ,QAAQ,GAAG,CAAC;AACtC,QAAQ,KAAK,MAAM,KAAK,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC;","names":["dataDir"]}
@@ -0,0 +1,60 @@
1
+ import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
+ import {
3
+ AFTER_CALL_TIMEOUT_SECONDS,
4
+ DISCLOSURE,
5
+ FUND_COMMAND,
6
+ FUND_QUESTION,
7
+ NEW_SESSION_STEP,
8
+ RELOAD_STEP,
9
+ ROUTE_HOOK_TIMEOUT_SECONDS,
10
+ SHOW_NOT_RUN,
11
+ loadStep,
12
+ migrateSettingsInstall,
13
+ pluginProof,
14
+ projectInstallAt,
15
+ projectInstallHere,
16
+ runRouterInstall,
17
+ settingsInstallPaths
18
+ } from "./chunk-JMM6YE7J.js";
19
+ import "./chunk-VZGAONSJ.js";
20
+ import "./chunk-KOGZDMHO.js";
21
+ import "./chunk-KHE6L6TD.js";
22
+ import "./chunk-3O2BQIF6.js";
23
+ import "./chunk-A36LQPHV.js";
24
+ import "./chunk-XKESD27X.js";
25
+ import "./chunk-AKWGE6JQ.js";
26
+ import "./chunk-WVUSXNIE.js";
27
+ import "./chunk-P7LABKCW.js";
28
+ import "./chunk-PAYV4XUA.js";
29
+ import "./chunk-MEFB5KHA.js";
30
+ import "./chunk-KYFZTGMC.js";
31
+ import "./chunk-2SNUOHAT.js";
32
+ import "./chunk-SPAVAYSW.js";
33
+ import "./chunk-6W5GYG3W.js";
34
+ import "./chunk-S4SAZ7OD.js";
35
+ import "./chunk-IOODYAXL.js";
36
+ import "./chunk-2I4QTOLB.js";
37
+ import "./chunk-AWFUPKTM.js";
38
+ import "./chunk-WO5BJNIB.js";
39
+ import "./chunk-O2FRQ2L2.js";
40
+ import "./chunk-SJLTEINJ.js";
41
+ import "./chunk-VUFAK2LW.js";
42
+ import "./chunk-ZXTAQYNA.js";
43
+ export {
44
+ AFTER_CALL_TIMEOUT_SECONDS,
45
+ DISCLOSURE,
46
+ FUND_COMMAND,
47
+ FUND_QUESTION,
48
+ NEW_SESSION_STEP,
49
+ RELOAD_STEP,
50
+ ROUTE_HOOK_TIMEOUT_SECONDS,
51
+ SHOW_NOT_RUN,
52
+ loadStep,
53
+ migrateSettingsInstall,
54
+ pluginProof,
55
+ projectInstallAt,
56
+ projectInstallHere,
57
+ runRouterInstall,
58
+ settingsInstallPaths
59
+ };
60
+ //# sourceMappingURL=install-TUCRF32I.js.map
@@ -0,0 +1,26 @@
1
+ import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
+ import {
3
+ enableCliIdentity,
4
+ enableDaemonIdentity,
5
+ identityFor,
6
+ noteBaseUrlFlag,
7
+ readOrCreateInstallId,
8
+ tenjinOrigins
9
+ } from "./chunk-QUVVWYJW.js";
10
+ import "./chunk-IOODYAXL.js";
11
+ import "./chunk-2I4QTOLB.js";
12
+ import "./chunk-AWFUPKTM.js";
13
+ import "./chunk-WO5BJNIB.js";
14
+ import "./chunk-O2FRQ2L2.js";
15
+ import "./chunk-SJLTEINJ.js";
16
+ import "./chunk-VUFAK2LW.js";
17
+ import "./chunk-ZXTAQYNA.js";
18
+ export {
19
+ enableCliIdentity,
20
+ enableDaemonIdentity,
21
+ identityFor,
22
+ noteBaseUrlFlag,
23
+ readOrCreateInstallId,
24
+ tenjinOrigins
25
+ };
26
+ //# sourceMappingURL=install-identity-WHPNMNMQ.js.map
@@ -0,0 +1,113 @@
1
+ import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
+ import {
3
+ runWalletCreate
4
+ } from "./chunk-HE2MS4QO.js";
5
+ import "./chunk-ORWL5BSN.js";
6
+ import "./chunk-YFQOA5AU.js";
7
+ import "./chunk-VFMQTSXG.js";
8
+ import "./chunk-YHKXNYTB.js";
9
+ import "./chunk-LFZJM56J.js";
10
+ import "./chunk-EL56RW2J.js";
11
+ import {
12
+ describeWallet,
13
+ resolveWalletProvider,
14
+ walletFileExists
15
+ } from "./chunk-OSYTBCUC.js";
16
+ import "./chunk-AEG2PXBP.js";
17
+ import "./chunk-NZIP4PA2.js";
18
+ import "./chunk-TTNESUPQ.js";
19
+ import {
20
+ confirmChoice
21
+ } from "./chunk-P7LABKCW.js";
22
+ import "./chunk-PAYV4XUA.js";
23
+ import "./chunk-MEFB5KHA.js";
24
+ import "./chunk-KYFZTGMC.js";
25
+ import "./chunk-2SNUOHAT.js";
26
+ import "./chunk-AWQPGIR6.js";
27
+ import "./chunk-N35E6CM2.js";
28
+ import "./chunk-JRGFKVAZ.js";
29
+ import "./chunk-5IEP5EGE.js";
30
+ import "./chunk-EGELTSPU.js";
31
+ import "./chunk-KG3D7FIF.js";
32
+ import "./chunk-RBJPAZFI.js";
33
+ import "./chunk-BPMWXTFX.js";
34
+ import "./chunk-2I4QTOLB.js";
35
+ import {
36
+ CliError
37
+ } from "./chunk-WO5BJNIB.js";
38
+ import "./chunk-O2FRQ2L2.js";
39
+ import "./chunk-SJLTEINJ.js";
40
+ import "./chunk-ZXTAQYNA.js";
41
+
42
+ // src/commands/install-wallet.ts
43
+ var WALLET_QUESTION = "Create a wallet now?";
44
+ function walletFix(reason) {
45
+ switch (reason) {
46
+ case "no-passphrase-store":
47
+ return "No OS credential store is available to hold the wallet passphrase. Set TENJIN_WALLET_PASSPHRASE and re-run `tenjin install`, or run `tenjin wallet create` in a terminal to enter one.";
48
+ case "create-failed":
49
+ return "Fix the reported problem, then run `tenjin wallet create`.";
50
+ case "dry-run":
51
+ case "flag":
52
+ return "Create one with `tenjin wallet create`.";
53
+ }
54
+ }
55
+ function walletValue(w) {
56
+ if (w.status === "existing") return `${w.address} (existing)`;
57
+ if (w.status === "created") return `${w.address}, $0 - fund with: tenjin wallet fund`;
58
+ if (w.status === "skipped") return `none (${w.reason}) - ${w.fix}`;
59
+ return "none - create with: tenjin wallet create";
60
+ }
61
+ async function resolveWallet(ctx, deps, skipReason, canPrompt) {
62
+ const exists = await (deps.walletExists ?? walletFileExists)(ctx.dataDir);
63
+ if (exists) {
64
+ return {
65
+ status: "existing",
66
+ address: await (deps.walletAddress ?? existingWalletAddress)(ctx)
67
+ };
68
+ }
69
+ if (skipReason !== void 0) {
70
+ return { status: "skipped", reason: skipReason, fix: walletFix(skipReason) };
71
+ }
72
+ if (canPrompt) {
73
+ const confirm = deps.confirmWallet ?? defaultConfirm;
74
+ if (!await confirm(WALLET_QUESTION)) return { status: "declined" };
75
+ }
76
+ try {
77
+ const create = deps.createWallet ?? ((c) => defaultCreateWallet(c, deps.walletPassphrase, deps.env));
78
+ return { status: "created", address: await create(ctx) };
79
+ } catch (err) {
80
+ const reason = isNoPassphraseError(err) ? "no-passphrase-store" : "create-failed";
81
+ return {
82
+ status: "skipped",
83
+ reason,
84
+ fix: walletFix(reason),
85
+ ...reason === "create-failed" ? { warning: `The wallet could not be created: ${errorText(err)}` } : {}
86
+ };
87
+ }
88
+ }
89
+ function isNoPassphraseError(err) {
90
+ return err instanceof CliError && err.code === "USAGE" && err.message.includes("No wallet passphrase is available");
91
+ }
92
+ function errorText(err) {
93
+ return err instanceof Error ? err.message : String(err);
94
+ }
95
+ async function existingWalletAddress(ctx) {
96
+ return (await describeWallet(resolveWalletProvider(ctx))).address;
97
+ }
98
+ async function defaultCreateWallet(ctx, passphrase, env) {
99
+ const result = await runWalletCreate(ctx, {
100
+ ...passphrase !== void 0 ? { passphrase } : {},
101
+ ...env !== void 0 ? { env } : {}
102
+ });
103
+ return result.data.address;
104
+ }
105
+ function defaultConfirm(label) {
106
+ return confirmChoice(label, true);
107
+ }
108
+ export {
109
+ WALLET_QUESTION,
110
+ resolveWallet,
111
+ walletValue
112
+ };
113
+ //# sourceMappingURL=install-wallet-MA27FTQ5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/install-wallet.ts"],"sourcesContent":["import { CliError } from '../lib/errors';\nimport { confirmChoice } from '../lib/clack';\nimport { describeWallet, resolveWalletProvider } from '../lib/wallet';\nimport type { PassphraseOverrides } from '../lib/wallet/local';\nimport { walletFileExists } from '../lib/wallet/store';\nimport { runWalletCreate } from './wallet';\nimport type { CommandContext } from '../context';\n\n/**\n * The wallet step `tenjin install` runs: keep the wallet this machine has, or\n * create one. Shared by the router install and the shelf install so the two\n * can never disagree about when a wallet is made or what a skip tells you.\n */\n\n/** The wallet question's literal copy. */\nexport const WALLET_QUESTION = 'Create a wallet now?';\n\n/** The seams the wallet step reads; every one defaults to the real thing. */\nexport interface WalletDeps {\n env?: NodeJS.ProcessEnv;\n /** \"Create a wallet now?\"; defaults to the clack confirm (default yes). */\n confirmWallet?: (label: string) => Promise<boolean>;\n /** Does a wallet already exist? Defaults to walletFileExists(dataDir). */\n walletExists?: (dataDir: string) => Promise<boolean>;\n /** An existing wallet's address. Defaults to the local provider. */\n walletAddress?: (ctx: CommandContext) => Promise<string>;\n /** Create a wallet and return its address. Defaults to runWalletCreate. */\n createWallet?: (ctx: CommandContext) => Promise<string>;\n /**\n * Passphrase-resolution seam forwarded to `wallet create`. Tests MUST set it\n * (or `createWallet`): without it a headless run creates a real wallet, and\n * on macOS that writes to the developer's own login keychain.\n */\n walletPassphrase?: PassphraseOverrides;\n}\n\n/**\n * Why no wallet was created, when none was.\n *\n * `no-passphrase-store` is the one that matters: this machine has no OS\n * credential store that would hold a generated passphrase, and no\n * `TENJIN_WALLET_PASSPHRASE`. There is no fallback here BY DESIGN. A passphrase\n * written to a plain file beside the keystore it unlocks is not a passphrase, so\n * the run creates nothing and says so loudly with both remedies.\n */\nexport type WalletSkipReason = 'no-passphrase-store' | 'create-failed' | 'dry-run' | 'flag';\n\n/**\n * How the wallet step resolved, so rendering stays separate from prompting.\n *\n * `declined` (an answer) and `skipped` (no answer, with a reason) are kept apart\n * deliberately: an install that could not create a key is a different state from\n * one the operator told not to, and only the first needs a remedy.\n */\nexport interface WalletOutcome {\n status: 'existing' | 'created' | 'declined' | 'skipped';\n address?: string;\n /** Only ever set on `skipped`. */\n reason?: WalletSkipReason;\n /** The exact command that changes this outcome, mirroring the CliError contract. */\n fix?: string;\n /** The underlying failure, for a `create-failed` skip. */\n warning?: string;\n}\n\n/** The remedy for each skip, so no skipped state is ever a dead end. */\nfunction walletFix(reason: WalletSkipReason): string {\n switch (reason) {\n case 'no-passphrase-store':\n return 'No OS credential store is available to hold the wallet passphrase. Set TENJIN_WALLET_PASSPHRASE and re-run `tenjin install`, or run `tenjin wallet create` in a terminal to enter one.';\n case 'create-failed':\n return 'Fix the reported problem, then run `tenjin wallet create`.';\n case 'dry-run':\n case 'flag':\n return 'Create one with `tenjin wallet create`.';\n }\n}\n\nexport function walletValue(w: WalletOutcome): string {\n if (w.status === 'existing') return `${w.address} (existing)`;\n if (w.status === 'created') return `${w.address}, $0 - fund with: tenjin wallet fund`;\n if (w.status === 'skipped') return `none (${w.reason}) - ${w.fix}`;\n return 'none - create with: tenjin wallet create';\n}\n\n/**\n * The wallet decision. A wallet is now created BY DEFAULT on both paths, because\n * the loop this command exists to set up does not close without one: `buy` needs\n * a funded key and publish-on-MISS needs a key to sign the write, so a walletless\n * install is a setup that stops at the first useful thing the agent tries.\n *\n * The headless path is the change. It creates without asking, using the\n * passphrase policy `resolvePassphraseForCreate` already enforces: an explicit\n * `TENJIN_WALLET_PASSPHRASE`, else a strong generated passphrase written to the\n * platform's OS credential store and verified by reading it back. When neither is\n * available it creates NOTHING and reports `skipped: no-passphrase-store` with\n * both remedies. There is deliberately no plain-file fallback: a passphrase\n * sitting next to the keystore it unlocks protects nothing, and an install is\n * never the right place to invent one.\n *\n * A creation failure never fails the install. The skills, hooks and permissions\n * this run just wired are all useful without a wallet, so the failure is reported\n * loudly and the command still succeeds.\n */\nexport async function resolveWallet(\n ctx: CommandContext,\n deps: WalletDeps,\n skipReason: 'dry-run' | 'flag' | undefined,\n canPrompt: boolean,\n): Promise<WalletOutcome> {\n const exists = await (deps.walletExists ?? walletFileExists)(ctx.dataDir);\n if (exists) {\n return {\n status: 'existing',\n address: await (deps.walletAddress ?? existingWalletAddress)(ctx),\n };\n }\n if (skipReason !== undefined) {\n return { status: 'skipped', reason: skipReason, fix: walletFix(skipReason) };\n }\n\n // Interactive keeps the question (default yes); headless has nobody to ask and\n // takes the default rather than treating silence as a no.\n if (canPrompt) {\n const confirm = deps.confirmWallet ?? defaultConfirm;\n if (!(await confirm(WALLET_QUESTION))) return { status: 'declined' };\n }\n\n try {\n const create =\n deps.createWallet ??\n ((c: CommandContext) => defaultCreateWallet(c, deps.walletPassphrase, deps.env));\n return { status: 'created', address: await create(ctx) };\n } catch (err) {\n // The one failure with a real remedy: no env passphrase and no OS store, so\n // resolvePassphraseForCreate refused rather than encrypt with a passphrase\n // that has no durable copy. Anything else is reported as itself.\n const reason: WalletSkipReason = isNoPassphraseError(err)\n ? 'no-passphrase-store'\n : 'create-failed';\n return {\n status: 'skipped',\n reason,\n fix: walletFix(reason),\n ...(reason === 'create-failed'\n ? { warning: `The wallet could not be created: ${errorText(err)}` }\n : {}),\n };\n }\n}\n\n/** Is this the passphrase layer refusing because no durable store could serve? */\nfunction isNoPassphraseError(err: unknown): boolean {\n return (\n err instanceof CliError &&\n err.code === 'USAGE' &&\n err.message.includes('No wallet passphrase is available')\n );\n}\n\nfunction errorText(err: unknown): string {\n return err instanceof Error ? err.message : String(err);\n}\n\nasync function existingWalletAddress(ctx: CommandContext): Promise<string> {\n return (await describeWallet(resolveWalletProvider(ctx))).address;\n}\n\nasync function defaultCreateWallet(\n ctx: CommandContext,\n passphrase?: PassphraseOverrides,\n env?: NodeJS.ProcessEnv,\n): Promise<string> {\n const result = await runWalletCreate(ctx, {\n ...(passphrase !== undefined ? { passphrase } : {}),\n ...(env !== undefined ? { env } : {}),\n });\n return (result.data as { address: string }).address;\n}\n\n/** The shared confirm, defaulting to YES (setup ergonomics); cancel reads as no. */\nfunction defaultConfirm(label: string): Promise<boolean> {\n return confirmChoice(label, true);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,IAAM,kBAAkB;AAmD/B,SAAS,UAAU,QAAkC;AACnD,UAAQ,QAAQ;AAAA,IACd,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,EACX;AACF;AAEO,SAAS,YAAY,GAA0B;AACpD,MAAI,EAAE,WAAW,WAAY,QAAO,GAAG,EAAE,OAAO;AAChD,MAAI,EAAE,WAAW,UAAW,QAAO,GAAG,EAAE,OAAO;AAC/C,MAAI,EAAE,WAAW,UAAW,QAAO,SAAS,EAAE,MAAM,OAAO,EAAE,GAAG;AAChE,SAAO;AACT;AAqBA,eAAsB,cACpB,KACA,MACA,YACA,WACwB;AACxB,QAAM,SAAS,OAAO,KAAK,gBAAgB,kBAAkB,IAAI,OAAO;AACxE,MAAI,QAAQ;AACV,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,SAAS,OAAO,KAAK,iBAAiB,uBAAuB,GAAG;AAAA,IAClE;AAAA,EACF;AACA,MAAI,eAAe,QAAW;AAC5B,WAAO,EAAE,QAAQ,WAAW,QAAQ,YAAY,KAAK,UAAU,UAAU,EAAE;AAAA,EAC7E;AAIA,MAAI,WAAW;AACb,UAAM,UAAU,KAAK,iBAAiB;AACtC,QAAI,CAAE,MAAM,QAAQ,eAAe,EAAI,QAAO,EAAE,QAAQ,WAAW;AAAA,EACrE;AAEA,MAAI;AACF,UAAM,SACJ,KAAK,iBACJ,CAAC,MAAsB,oBAAoB,GAAG,KAAK,kBAAkB,KAAK,GAAG;AAChF,WAAO,EAAE,QAAQ,WAAW,SAAS,MAAM,OAAO,GAAG,EAAE;AAAA,EACzD,SAAS,KAAK;AAIZ,UAAM,SAA2B,oBAAoB,GAAG,IACpD,wBACA;AACJ,WAAO;AAAA,MACL,QAAQ;AAAA,MACR;AAAA,MACA,KAAK,UAAU,MAAM;AAAA,MACrB,GAAI,WAAW,kBACX,EAAE,SAAS,oCAAoC,UAAU,GAAG,CAAC,GAAG,IAChE,CAAC;AAAA,IACP;AAAA,EACF;AACF;AAGA,SAAS,oBAAoB,KAAuB;AAClD,SACE,eAAe,YACf,IAAI,SAAS,WACb,IAAI,QAAQ,SAAS,mCAAmC;AAE5D;AAEA,SAAS,UAAU,KAAsB;AACvC,SAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AACxD;AAEA,eAAe,sBAAsB,KAAsC;AACzE,UAAQ,MAAM,eAAe,sBAAsB,GAAG,CAAC,GAAG;AAC5D;AAEA,eAAe,oBACb,KACA,YACA,KACiB;AACjB,QAAM,SAAS,MAAM,gBAAgB,KAAK;AAAA,IACxC,GAAI,eAAe,SAAY,EAAE,WAAW,IAAI,CAAC;AAAA,IACjD,GAAI,QAAQ,SAAY,EAAE,IAAI,IAAI,CAAC;AAAA,EACrC,CAAC;AACD,SAAQ,OAAO,KAA6B;AAC9C;AAGA,SAAS,eAAe,OAAiC;AACvD,SAAO,cAAc,OAAO,IAAI;AAClC;","names":[]}