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

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 (132) hide show
  1. package/README.md +156 -188
  2. package/dist/{_esm-FEASBWRP.js → _esm-N4KAVXQR.js} +9 -9
  3. package/dist/buy-OOOLUDND.js +41 -0
  4. package/dist/candidate-TWCWTFGA.js +22 -0
  5. package/dist/{ccip-XR5NE5QK.js → ccip-RPPPKTJR.js} +5 -5
  6. package/dist/{ccip-NQXCEK2U.js → ccip-ZGGWQN4X.js} +4 -4
  7. package/dist/{chunk-XJIW7USF.js → chunk-333FOTUJ.js} +5 -5
  8. package/dist/{chunk-YALGASEU.js → chunk-47PP7TAG.js} +1610 -1610
  9. package/dist/chunk-47PP7TAG.js.map +1 -0
  10. package/dist/{buy-EE6SEXP6.js → chunk-4GR7DGD6.js} +23 -41
  11. package/dist/{buy-EE6SEXP6.js.map → chunk-4GR7DGD6.js.map} +1 -1
  12. package/dist/{chunk-DXTQ3CSI.js → chunk-5JH7ZB6Z.js} +7 -7
  13. package/dist/{chunk-DXTQ3CSI.js.map → chunk-5JH7ZB6Z.js.map} +1 -1
  14. package/dist/{chunk-OYMYCW7J.js → chunk-6WWVYYSB.js} +32 -2
  15. package/dist/{chunk-OYMYCW7J.js.map → chunk-6WWVYYSB.js.map} +1 -1
  16. package/dist/{chunk-UGX7YPX2.js → chunk-7FK2UN2T.js} +65 -65
  17. package/dist/{chunk-UGX7YPX2.js.map → chunk-7FK2UN2T.js.map} +1 -1
  18. package/dist/{chunk-ESPNTPQ2.js → chunk-BXUS5UCT.js} +9 -4
  19. package/dist/{chunk-ESPNTPQ2.js.map → chunk-BXUS5UCT.js.map} +1 -1
  20. package/dist/{chunk-4ONXEEQL.js → chunk-C4TIWOAM.js} +2 -2
  21. package/dist/{chunk-4ONXEEQL.js.map → chunk-C4TIWOAM.js.map} +1 -1
  22. package/dist/{chunk-AWPAWHNX.js → chunk-CJU555P5.js} +24 -24
  23. package/dist/{chunk-AWPAWHNX.js.map → chunk-CJU555P5.js.map} +1 -1
  24. package/dist/{chunk-YN5SHIXQ.js → chunk-DPET3TW5.js} +2 -2
  25. package/dist/{chunk-TLCMMYLY.js → chunk-DPUMEMGM.js} +5 -5
  26. package/dist/chunk-DPUMEMGM.js.map +1 -0
  27. package/dist/{chunk-XHC6FCGZ.js → chunk-EUQN3L5X.js} +9 -9
  28. package/dist/{chunk-XHC6FCGZ.js.map → chunk-EUQN3L5X.js.map} +1 -1
  29. package/dist/{chunk-GO75V3NZ.js → chunk-FHB3VKZW.js} +6 -6
  30. package/dist/{chunk-GO75V3NZ.js.map → chunk-FHB3VKZW.js.map} +1 -1
  31. package/dist/{chunk-S3IGX57D.js → chunk-FU6MCSLG.js} +9 -9
  32. package/dist/{lookup-ZPN2Q67N.js → chunk-H5ETJRQD.js} +40 -31
  33. package/dist/chunk-H5ETJRQD.js.map +1 -0
  34. package/dist/chunk-KXIX7YDV.js +59 -0
  35. package/dist/chunk-KXIX7YDV.js.map +1 -0
  36. package/dist/{chunk-5CLSD5YN.js → chunk-KYQVEKP5.js} +7 -7
  37. package/dist/{chunk-RRN3YTK7.js → chunk-KZAAWQNP.js} +3 -3
  38. package/dist/{chunk-NCE5NSN6.js → chunk-M2O56UK7.js} +158 -158
  39. package/dist/chunk-M2O56UK7.js.map +1 -0
  40. package/dist/{chunk-7KUW4MJD.js → chunk-MM4TGTST.js} +6 -6
  41. package/dist/{chunk-7KUW4MJD.js.map → chunk-MM4TGTST.js.map} +1 -1
  42. package/dist/{chunk-662MSGZB.js → chunk-NXCJN2FJ.js} +55 -28
  43. package/dist/chunk-NXCJN2FJ.js.map +1 -0
  44. package/dist/{candidate-ERMSYYQZ.js → chunk-OJD54DIU.js} +15 -19
  45. package/dist/{candidate-ERMSYYQZ.js.map → chunk-OJD54DIU.js.map} +1 -1
  46. package/dist/{chunk-ZABPQJ3M.js → chunk-POJRB2AE.js} +2 -2
  47. package/dist/{chunk-FJPLRISB.js → chunk-QH6677FJ.js} +5 -4
  48. package/dist/chunk-QH6677FJ.js.map +1 -0
  49. package/dist/{wallet-CWEMYVIH.js → chunk-R7BMDJZM.js} +15 -27
  50. package/dist/{wallet-CWEMYVIH.js.map → chunk-R7BMDJZM.js.map} +1 -1
  51. package/dist/{chunk-Z6MFJV5Z.js → chunk-S3KZ3PPK.js} +15 -11
  52. package/dist/{chunk-Z6MFJV5Z.js.map → chunk-S3KZ3PPK.js.map} +1 -1
  53. package/dist/{chunk-CYOF7ROH.js → chunk-S5RYMCV6.js} +3 -3
  54. package/dist/{chunk-ZMHYXMO6.js → chunk-U5S527PP.js} +3 -3
  55. package/dist/{chunk-RY4XKNV3.js → chunk-UHTVXQ2O.js} +3 -3
  56. package/dist/{publish-BKBQQAW4.js → chunk-ULLWHHIT.js} +19 -34
  57. package/dist/{publish-BKBQQAW4.js.map → chunk-ULLWHHIT.js.map} +1 -1
  58. package/dist/{chunk-Z52RA3NC.js → chunk-VV4P5RVK.js} +47 -20
  59. package/dist/chunk-VV4P5RVK.js.map +1 -0
  60. package/dist/{chunk-QVX5MWJZ.js → chunk-W6R3HAAG.js} +2 -2
  61. package/dist/{chunk-3OV7E5G5.js → chunk-WWX32ML4.js} +1 -1
  62. package/dist/{chunk-3OV7E5G5.js.map → chunk-WWX32ML4.js.map} +1 -1
  63. package/dist/{chunk-HIVZG55D.js → chunk-XJN5WUKL.js} +2 -2
  64. package/dist/{chunk-JPHG2JW3.js → chunk-XNNOR7F7.js} +25 -25
  65. package/dist/chunk-XNNOR7F7.js.map +1 -0
  66. package/dist/{inspect-LMKOXE4Y.js → chunk-YFREUEUI.js} +8 -26
  67. package/dist/{inspect-LMKOXE4Y.js.map → chunk-YFREUEUI.js.map} +1 -1
  68. package/dist/{chunk-HSDCI7OV.js → chunk-YLYINX2H.js} +3 -3
  69. package/dist/{cli-SBXI5AMS.js → cli-AFSLAKR6.js} +47 -36
  70. package/dist/{cli-SBXI5AMS.js.map → cli-AFSLAKR6.js.map} +1 -1
  71. package/dist/{config-VELDKLHY.js → config-DBEEM3UA.js} +5 -5
  72. package/dist/{doctor-T3KWNNP2.js → doctor-XDA3YU6H.js} +7 -7
  73. package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js → ethersCompat-Df4a6QIZ-WHYKB6HA.js} +5 -5
  74. package/dist/index.js +1 -1
  75. package/dist/inspect-YBGDAG47.js +33 -0
  76. package/dist/{install-LEX3ENQ6.js → install-7J6KKEEP.js} +240 -85
  77. package/dist/install-7J6KKEEP.js.map +1 -0
  78. package/dist/outcome-ZFGHX2XW.js +20 -0
  79. package/dist/publish-IH7RJXGB.js +36 -0
  80. package/dist/publish-IH7RJXGB.js.map +1 -0
  81. package/dist/run-DCZFEW2C.js +16806 -0
  82. package/dist/run-DCZFEW2C.js.map +1 -0
  83. package/dist/search-R6NIQFXI.js +24 -0
  84. package/dist/search-R6NIQFXI.js.map +1 -0
  85. package/dist/{secp256k1-N3ZHU7LB.js → secp256k1-XRPVBC6V.js} +3 -3
  86. package/dist/secp256k1-XRPVBC6V.js.map +1 -0
  87. package/dist/usdc-AU6ZIKA6.js +22 -0
  88. package/dist/usdc-AU6ZIKA6.js.map +1 -0
  89. package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js → viemAdapter-By13KInL-TUQJBMHM.js} +5 -5
  90. package/dist/viemAdapter-By13KInL-TUQJBMHM.js.map +1 -0
  91. package/dist/{wallet-PA54CRBL.js → wallet-HKG3GSTX.js} +10 -10
  92. package/dist/wallet-HKG3GSTX.js.map +1 -0
  93. package/dist/wallet-UWHSHWC6.js +31 -0
  94. package/dist/wallet-UWHSHWC6.js.map +1 -0
  95. package/package.json +4 -3
  96. package/skills/tenjin/SKILL.md +56 -13
  97. package/skills/tenjin-publish/SKILL.md +21 -6
  98. package/skills/tenjin-search/SKILL.md +35 -20
  99. package/dist/chunk-662MSGZB.js.map +0 -1
  100. package/dist/chunk-FJPLRISB.js.map +0 -1
  101. package/dist/chunk-JPHG2JW3.js.map +0 -1
  102. package/dist/chunk-NCE5NSN6.js.map +0 -1
  103. package/dist/chunk-TLCMMYLY.js.map +0 -1
  104. package/dist/chunk-YALGASEU.js.map +0 -1
  105. package/dist/chunk-Z52RA3NC.js.map +0 -1
  106. package/dist/install-LEX3ENQ6.js.map +0 -1
  107. package/dist/lookup-ZPN2Q67N.js.map +0 -1
  108. package/dist/outcome-N7TAK6WR.js +0 -66
  109. package/dist/outcome-N7TAK6WR.js.map +0 -1
  110. package/dist/usdc-JIAJW4SV.js +0 -22
  111. /package/dist/{_esm-FEASBWRP.js.map → _esm-N4KAVXQR.js.map} +0 -0
  112. /package/dist/{ccip-NQXCEK2U.js.map → buy-OOOLUDND.js.map} +0 -0
  113. /package/dist/{ccip-XR5NE5QK.js.map → candidate-TWCWTFGA.js.map} +0 -0
  114. /package/dist/{config-VELDKLHY.js.map → ccip-RPPPKTJR.js.map} +0 -0
  115. /package/dist/{doctor-T3KWNNP2.js.map → ccip-ZGGWQN4X.js.map} +0 -0
  116. /package/dist/{chunk-XJIW7USF.js.map → chunk-333FOTUJ.js.map} +0 -0
  117. /package/dist/{chunk-YN5SHIXQ.js.map → chunk-DPET3TW5.js.map} +0 -0
  118. /package/dist/{chunk-S3IGX57D.js.map → chunk-FU6MCSLG.js.map} +0 -0
  119. /package/dist/{chunk-5CLSD5YN.js.map → chunk-KYQVEKP5.js.map} +0 -0
  120. /package/dist/{chunk-RRN3YTK7.js.map → chunk-KZAAWQNP.js.map} +0 -0
  121. /package/dist/{chunk-ZABPQJ3M.js.map → chunk-POJRB2AE.js.map} +0 -0
  122. /package/dist/{chunk-CYOF7ROH.js.map → chunk-S5RYMCV6.js.map} +0 -0
  123. /package/dist/{chunk-ZMHYXMO6.js.map → chunk-U5S527PP.js.map} +0 -0
  124. /package/dist/{chunk-RY4XKNV3.js.map → chunk-UHTVXQ2O.js.map} +0 -0
  125. /package/dist/{chunk-QVX5MWJZ.js.map → chunk-W6R3HAAG.js.map} +0 -0
  126. /package/dist/{chunk-HIVZG55D.js.map → chunk-XJN5WUKL.js.map} +0 -0
  127. /package/dist/{chunk-HSDCI7OV.js.map → chunk-YLYINX2H.js.map} +0 -0
  128. /package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js.map → config-DBEEM3UA.js.map} +0 -0
  129. /package/dist/{secp256k1-N3ZHU7LB.js.map → doctor-XDA3YU6H.js.map} +0 -0
  130. /package/dist/{usdc-JIAJW4SV.js.map → ethersCompat-Df4a6QIZ-WHYKB6HA.js.map} +0 -0
  131. /package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js.map → inspect-YBGDAG47.js.map} +0 -0
  132. /package/dist/{wallet-PA54CRBL.js.map → outcome-ZFGHX2XW.js.map} +0 -0
@@ -4,13 +4,13 @@ import {
4
4
  runConfigGet,
5
5
  runConfigList,
6
6
  runConfigSet
7
- } from "./chunk-XHC6FCGZ.js";
8
- import "./chunk-GO75V3NZ.js";
9
- import "./chunk-ESPNTPQ2.js";
7
+ } from "./chunk-EUQN3L5X.js";
8
+ import "./chunk-FHB3VKZW.js";
10
9
  import "./chunk-YBMMV4Y4.js";
11
10
  import "./chunk-UO22YNY4.js";
11
+ import "./chunk-BXUS5UCT.js";
12
12
  import "./chunk-MUBUQVC3.js";
13
- import "./chunk-OYMYCW7J.js";
13
+ import "./chunk-6WWVYYSB.js";
14
14
  import "./chunk-ZXTAQYNA.js";
15
15
  export {
16
16
  persistPublishMode,
@@ -18,4 +18,4 @@ export {
18
18
  runConfigList,
19
19
  runConfigSet
20
20
  };
21
- //# sourceMappingURL=config-VELDKLHY.js.map
21
+ //# sourceMappingURL=config-DBEEM3UA.js.map
@@ -3,18 +3,18 @@ import {
3
3
  collectDoctorChecks,
4
4
  renderDoctorHuman,
5
5
  runDoctor
6
- } from "./chunk-AWPAWHNX.js";
7
- import "./chunk-4ONXEEQL.js";
8
- import "./chunk-FJPLRISB.js";
9
- import "./chunk-ESPNTPQ2.js";
10
- import "./chunk-YN5SHIXQ.js";
6
+ } from "./chunk-CJU555P5.js";
7
+ import "./chunk-DPET3TW5.js";
8
+ import "./chunk-C4TIWOAM.js";
9
+ import "./chunk-QH6677FJ.js";
11
10
  import "./chunk-2I4QTOLB.js";
11
+ import "./chunk-BXUS5UCT.js";
12
12
  import "./chunk-MUBUQVC3.js";
13
- import "./chunk-OYMYCW7J.js";
13
+ import "./chunk-6WWVYYSB.js";
14
14
  import "./chunk-ZXTAQYNA.js";
15
15
  export {
16
16
  collectDoctorChecks,
17
17
  renderDoctorHuman,
18
18
  runDoctor
19
19
  };
20
- //# sourceMappingURL=doctor-T3KWNNP2.js.map
20
+ //# sourceMappingURL=doctor-XDA3YU6H.js.map
@@ -4,10 +4,10 @@ import {
4
4
  c,
5
5
  f,
6
6
  s
7
- } from "./chunk-ZABPQJ3M.js";
8
- import "./chunk-HSDCI7OV.js";
9
- import "./chunk-HIVZG55D.js";
10
- import "./chunk-5CLSD5YN.js";
7
+ } from "./chunk-POJRB2AE.js";
8
+ import "./chunk-YLYINX2H.js";
9
+ import "./chunk-XJN5WUKL.js";
10
+ import "./chunk-KYQVEKP5.js";
11
11
  import "./chunk-ZXTAQYNA.js";
12
12
  export {
13
13
  s as i,
@@ -15,4 +15,4 @@ export {
15
15
  a as r,
16
16
  f as t
17
17
  };
18
- //# sourceMappingURL=ethersCompat-Df4a6QIZ-3YZIAXDK.js.map
18
+ //# sourceMappingURL=ethersCompat-Df4a6QIZ-WHYKB6HA.js.map
package/dist/index.js CHANGED
@@ -21,6 +21,6 @@ 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
+ var { main } = await import("./cli-AFSLAKR6.js");
25
25
  process.exit(await main(process.argv.slice(2)));
26
26
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,33 @@
1
+ import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
+ import {
3
+ runInspect
4
+ } from "./chunk-YFREUEUI.js";
5
+ import "./chunk-5JH7ZB6Z.js";
6
+ import "./chunk-FU6MCSLG.js";
7
+ import "./chunk-MM4TGTST.js";
8
+ import "./chunk-XNNOR7F7.js";
9
+ import "./chunk-NXCJN2FJ.js";
10
+ import "./chunk-WWX32ML4.js";
11
+ import "./chunk-VV4P5RVK.js";
12
+ import "./chunk-C4TIWOAM.js";
13
+ import "./chunk-QH6677FJ.js";
14
+ import "./chunk-KZAAWQNP.js";
15
+ import "./chunk-S5RYMCV6.js";
16
+ import "./chunk-POJRB2AE.js";
17
+ import "./chunk-YLYINX2H.js";
18
+ import "./chunk-FHB3VKZW.js";
19
+ import "./chunk-YBMMV4Y4.js";
20
+ import "./chunk-UO22YNY4.js";
21
+ import "./chunk-BXUS5UCT.js";
22
+ import "./chunk-MUBUQVC3.js";
23
+ import "./chunk-6WWVYYSB.js";
24
+ import "./chunk-UHTVXQ2O.js";
25
+ import "./chunk-W6R3HAAG.js";
26
+ import "./chunk-XJN5WUKL.js";
27
+ import "./chunk-RBJPAZFI.js";
28
+ import "./chunk-KYQVEKP5.js";
29
+ import "./chunk-ZXTAQYNA.js";
30
+ export {
31
+ runInspect
32
+ };
33
+ //# sourceMappingURL=inspect-YBGDAG47.js.map
@@ -1,31 +1,49 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
2
  import {
3
- collectDoctorChecks,
4
- renderDoctorHuman
5
- } from "./chunk-AWPAWHNX.js";
6
- import "./chunk-4ONXEEQL.js";
7
- import "./chunk-FJPLRISB.js";
3
+ runWalletCreate
4
+ } from "./chunk-R7BMDJZM.js";
5
+ import {
6
+ describeWallet,
7
+ resolveWalletProvider
8
+ } from "./chunk-S3KZ3PPK.js";
9
+ import {
10
+ collectDoctorChecks
11
+ } from "./chunk-CJU555P5.js";
12
+ import {
13
+ walletFileExists
14
+ } from "./chunk-DPET3TW5.js";
15
+ import "./chunk-C4TIWOAM.js";
16
+ import "./chunk-QH6677FJ.js";
17
+ import "./chunk-2I4QTOLB.js";
8
18
  import {
9
19
  persistPublishMode
10
- } from "./chunk-XHC6FCGZ.js";
11
- import "./chunk-GO75V3NZ.js";
20
+ } from "./chunk-EUQN3L5X.js";
21
+ import "./chunk-FHB3VKZW.js";
22
+ import "./chunk-YBMMV4Y4.js";
23
+ import "./chunk-UO22YNY4.js";
12
24
  import {
13
25
  CONFIG_DEFAULTS,
14
26
  PublishModeSchema,
15
27
  loadRawConfig,
16
28
  parsePublishModeFlag
17
- } from "./chunk-ESPNTPQ2.js";
18
- import "./chunk-YN5SHIXQ.js";
19
- import "./chunk-2I4QTOLB.js";
20
- import "./chunk-YBMMV4Y4.js";
21
- import "./chunk-UO22YNY4.js";
29
+ } from "./chunk-BXUS5UCT.js";
22
30
  import {
23
31
  writeFileAtomic
24
32
  } from "./chunk-MUBUQVC3.js";
25
33
  import {
26
34
  CliError,
27
35
  external_exports
28
- } from "./chunk-OYMYCW7J.js";
36
+ } from "./chunk-6WWVYYSB.js";
37
+ import "./chunk-333FOTUJ.js";
38
+ import "./chunk-7FK2UN2T.js";
39
+ import "./chunk-M2O56UK7.js";
40
+ import "./chunk-UHTVXQ2O.js";
41
+ import "./chunk-W6R3HAAG.js";
42
+ import "./chunk-U5S527PP.js";
43
+ import "./chunk-47PP7TAG.js";
44
+ import "./chunk-XJN5WUKL.js";
45
+ import "./chunk-RBJPAZFI.js";
46
+ import "./chunk-KYQVEKP5.js";
29
47
  import "./chunk-ZXTAQYNA.js";
30
48
 
31
49
  // src/commands/install.ts
@@ -63,9 +81,29 @@ var HARNESSES = ["claude", "codex", "shared"];
63
81
  var InstallInputSchema = external_exports.object({
64
82
  harness: external_exports.array(external_exports.string()).optional(),
65
83
  dryRun: external_exports.boolean().optional(),
66
- publishMode: external_exports.string().optional()
84
+ publishMode: external_exports.string().optional(),
85
+ noWallet: external_exports.boolean().optional(),
86
+ /** Tri-state opt-in for the ~/.claude/CLAUDE.md nudge: true (--claude-md), false
87
+ * (--no-claude-md), or undefined (ask interactively, else skip). */
88
+ claudeMd: external_exports.boolean().optional()
67
89
  });
68
- var AGENTS_MARKER = "<!-- tenjin-cli:skills -->";
90
+ var SKILLS_MARKER = "<!-- tenjin-cli:skills -->";
91
+ function nudgeLine(skillsDir) {
92
+ return `${SKILLS_MARKER} Tenjin: before regenerating public research (version-specific compatibility, integration gotchas, benchmarks, dated probes), run 'tenjin search "<question>" --json' first; it is free and anonymous but sends the generalized question text to tenjin.blog, so strip private identifiers. Skills (tenjin-search, tenjin-publish, tenjin) are installed at ${skillsDir}; read the relevant SKILL.md before using the CLI.`;
93
+ }
94
+ function upsertMarkerLine(existing, line) {
95
+ const text = existing ?? "";
96
+ if (!text.includes(SKILLS_MARKER)) {
97
+ const prefix = text.length === 0 || text.endsWith("\n") ? "" : "\n";
98
+ return { content: `${text}${prefix}${line}
99
+ `, change: "append" };
100
+ }
101
+ const lines = text.split("\n");
102
+ const idx = lines.findIndex((l) => l.includes(SKILLS_MARKER));
103
+ if (lines[idx] === line) return { content: null, change: "none" };
104
+ lines[idx] = line;
105
+ return { content: lines.join("\n"), change: "replace" };
106
+ }
69
107
  var CODEX_NETWORK_RULE = "[sandbox_workspace_write]\nnetwork_access = true";
70
108
  async function runInstall(input, ctx, deps = {}) {
71
109
  const parsed = InstallInputSchema.safeParse(input);
@@ -76,32 +114,176 @@ async function runInstall(input, ctx, deps = {}) {
76
114
  });
77
115
  }
78
116
  const dryRun = parsed.data.dryRun === true;
117
+ const noWallet = parsed.data.noWallet === true;
118
+ const claudeMdFlag = parsed.data.claudeMd;
79
119
  const publishModeFlag = parsed.data.publishMode !== void 0 ? parseModeFlag(parsed.data.publishMode) : void 0;
80
120
  const env = deps.env ?? process.env;
81
121
  const home = deps.homeDir ?? homedir();
82
122
  const which = deps.which ?? ((bin) => onPath(bin, env));
123
+ const humanOutput = ctx.flags.json === true ? false : deps.isInteractive ?? ctx.io.isTTY;
124
+ const canPrompt = humanOutput && (deps.isInteractive ?? Boolean(process.stdin.isTTY));
83
125
  const skillsSource = deps.skillsSourceDir ?? resolveSkillsSource(fileURLToPath(new URL(".", import.meta.url)));
84
126
  await assertSkillsSource(skillsSource);
85
127
  const plans = resolvePlans(parsed.data.harness, home, which);
128
+ const claudeMdWrite = plans.some((p) => p.harness === "claude") ? await decideClaudeMd(claudeMdFlag, canPrompt, dryRun, deps) : false;
86
129
  const harnesses = [];
87
130
  for (const plan of plans) {
88
- harnesses.push(await applyPlan(plan, skillsSource, dryRun));
131
+ harnesses.push(await applyPlan(plan, skillsSource, dryRun, claudeMdWrite));
89
132
  }
90
133
  const collect = deps.collectChecks ?? ((c) => collectDoctorChecks(c, deps.doctorDeps ?? {}));
91
134
  const doctor = await collect(ctx);
92
- const doctorStatus = doctor.failure !== void 0 ? "fail" : "pass";
93
- const publishMode = await selectPublishMode(publishModeFlag, ctx, deps, dryRun);
135
+ const publishMode = await selectPublishMode(publishModeFlag, ctx, deps, dryRun, canPrompt);
94
136
  const data = {
95
137
  dryRun,
96
138
  skillsSource,
97
139
  harnesses,
98
- doctor: { status: doctorStatus, checks: doctor.checks },
140
+ doctor: { status: doctor.failure !== void 0 ? "fail" : "pass", checks: doctor.checks },
99
141
  publishMode
100
142
  };
101
- const humanLines = renderHuman(ctx.io, harnesses, doctor, dryRun);
102
- humanLines.push(publishModeLine(ctx.io, publishMode, dryRun));
143
+ if (!humanOutput) return { data };
144
+ const humanLines = await buildWalkthrough(ctx, deps, {
145
+ dryRun,
146
+ noWallet,
147
+ canPrompt,
148
+ harnesses,
149
+ publishMode,
150
+ doctor
151
+ });
103
152
  return { data, humanLines };
104
153
  }
154
+ var EXAMPLE_QUESTION = "what actually changed in <library> v3's public API";
155
+ async function buildWalkthrough(ctx, deps, s) {
156
+ const io = ctx.io;
157
+ const lines = [];
158
+ if (s.dryRun) lines.push(paint(io, "yellow", "Dry run: nothing was written."));
159
+ lines.push(...skillsWalkthrough(io, s.harnesses, s.dryRun), "");
160
+ lines.push(
161
+ `${paint(io, "bold", `publish mode: ${s.publishMode.value}`)} ${paint(io, "dim", modeBlurb(s.publishMode.value))}`,
162
+ ""
163
+ );
164
+ lines.push(...await walletWalkthrough(ctx, deps, s.dryRun || !s.canPrompt, s.noWallet, io), "");
165
+ lines.push(...doctorSummary(io, s.doctor), "");
166
+ lines.push(`Done. Try: tenjin search "${EXAMPLE_QUESTION}"`);
167
+ return lines;
168
+ }
169
+ function harnessLabel(h) {
170
+ return h === "claude" ? "Claude Code" : h === "codex" ? "Codex" : "Agent Skills";
171
+ }
172
+ function skillsWalkthrough(io, harnesses, dryRun) {
173
+ const lines = [];
174
+ for (const h of harnesses) {
175
+ const n = h.skills.length;
176
+ const changed = h.skills.some((s) => s.status !== "up-to-date");
177
+ const verb = dryRun ? "would install" : changed ? "installed" : "up to date";
178
+ const wired = [];
179
+ if (h.agentsMd !== void 0) wired.push("AGENTS.md nudge");
180
+ if (h.claudeMd !== void 0 && h.claudeMd.status !== "skipped") wired.push("CLAUDE.md nudge");
181
+ const suffix = wired.length > 0 ? ` + ${wired.join(" + ")}` : "";
182
+ lines.push(
183
+ `${paint(io, "green", "\u2713")} ${harnessLabel(h.harness)}: ${n} skills ${verb}${suffix}`
184
+ );
185
+ const nudgePaths = nudgeFilesTouched(h);
186
+ if (nudgePaths.length > 0) {
187
+ lines.push(
188
+ paint(
189
+ io,
190
+ "dim",
191
+ " The nudge tells agents to run a free anonymous `tenjin search` before regenerating research; the generalized question text is sent to tenjin.blog."
192
+ )
193
+ );
194
+ lines.push(
195
+ paint(
196
+ io,
197
+ "dim",
198
+ ` Undo anytime: delete the ${SKILLS_MARKER} line from ${nudgePaths.join(" and ")}.`
199
+ )
200
+ );
201
+ }
202
+ if (h.claudeMd?.status === "skipped") {
203
+ lines.push(
204
+ paint(
205
+ io,
206
+ "dim",
207
+ " Add a Tenjin search nudge to ~/.claude/CLAUDE.md later: tenjin install --harness claude --claude-md"
208
+ )
209
+ );
210
+ }
211
+ if (h.codexNetworkRule !== void 0) {
212
+ lines.push(
213
+ paint(io, "dim", " Codex blocks network by default; add to ~/.codex/config.toml:")
214
+ );
215
+ for (const rl of h.codexNetworkRule.split("\n")) lines.push(paint(io, "dim", ` ${rl}`));
216
+ }
217
+ for (const w of h.warnings) lines.push(paint(io, "yellow", ` ! ${w}`));
218
+ }
219
+ return lines;
220
+ }
221
+ function nudgeFilesTouched(h) {
222
+ const paths = [];
223
+ if (h.agentsMd !== void 0 && ["appended", "updated", "would-append", "would-update"].includes(h.agentsMd.status)) {
224
+ paths.push(h.agentsMd.path);
225
+ }
226
+ if (h.claudeMd !== void 0 && ["written", "updated", "would-write", "would-update"].includes(h.claudeMd.status)) {
227
+ paths.push(h.claudeMd.path);
228
+ }
229
+ return paths;
230
+ }
231
+ function modeBlurb(v) {
232
+ return v === "review" ? "asks before every publish" : v === "auto" ? "publishes clean scans automatically" : "only detected secrets stop a publish";
233
+ }
234
+ async function walletWalkthrough(ctx, deps, skipCreate, noWallet, io) {
235
+ const exists = await (deps.walletExists ?? walletFileExists)(ctx.dataDir);
236
+ if (exists) {
237
+ const address2 = await (deps.walletAddress ?? existingWalletAddress)(ctx);
238
+ return [`${paint(io, "bold", "Wallet:")} ${address2} (existing)`];
239
+ }
240
+ const later = `${paint(io, "bold", "Wallet:")} none. Create one later with: tenjin wallet create`;
241
+ if (skipCreate || noWallet) return [later];
242
+ const confirm = deps.confirmWallet ?? defaultConfirmYesNo;
243
+ if (!await confirm("Create a wallet now? [Y/n] ")) return [later];
244
+ const address = await (deps.createWallet ?? defaultCreateWallet)(ctx);
245
+ return [
246
+ paint(io, "bold", "Wallet created:"),
247
+ ` ${address}`,
248
+ " Fund it: send a few dollars of USDC on Base to that address (this is a pocket-money wallet; keep it small).",
249
+ " Check with: tenjin wallet balance"
250
+ ];
251
+ }
252
+ async function existingWalletAddress(ctx) {
253
+ return (await describeWallet(resolveWalletProvider(ctx))).address;
254
+ }
255
+ async function defaultCreateWallet(ctx) {
256
+ const result = await runWalletCreate(ctx);
257
+ return result.data.address;
258
+ }
259
+ function defaultConfirmYesNo(label) {
260
+ return new Promise((resolve) => {
261
+ const rl = createInterface({ input: process.stdin, output: process.stderr });
262
+ let settled = false;
263
+ const settle = (value) => {
264
+ if (settled) return;
265
+ settled = true;
266
+ rl.close();
267
+ resolve(value);
268
+ };
269
+ rl.once("close", () => settle(false));
270
+ rl.question(label, (answer) => {
271
+ const a = answer.trim().toLowerCase();
272
+ settle(a === "" || a === "y" || a === "yes");
273
+ });
274
+ });
275
+ }
276
+ function doctorSummary(io, doctor) {
277
+ const problems = doctor.checks.filter((c) => c.status !== "ok");
278
+ if (problems.length === 0) return [`${paint(io, "green", "\u2713")} Everything checks out`];
279
+ const lines = [paint(io, "yellow", "Some checks need attention:")];
280
+ for (const c of problems) {
281
+ const icon = c.status === "fail" ? paint(io, "red", "\u2717") : paint(io, "yellow", "!");
282
+ lines.push(` ${icon} ${c.name}: ${c.detail}`);
283
+ if (c.fix !== void 0) lines.push(paint(io, "dim", ` fix: ${c.fix}`));
284
+ }
285
+ return lines;
286
+ }
105
287
  var DEFAULT_MODE = CONFIG_DEFAULTS.publish.mode;
106
288
  var PUBLISH_MODE_PROMPT = [
107
289
  "Publish consent mode?",
@@ -110,7 +292,7 @@ var PUBLISH_MODE_PROMPT = [
110
292
  " full-auto - publishes even past warnings; only detected secrets stop it",
111
293
  `[${DEFAULT_MODE}]: `
112
294
  ].join("\n");
113
- async function selectPublishMode(flag, ctx, deps, dryRun) {
295
+ async function selectPublishMode(flag, ctx, deps, dryRun, interactive) {
114
296
  if (flag !== void 0) {
115
297
  if (!dryRun) await persistPublishMode(ctx.dataDir, flag);
116
298
  return { value: flag, source: "flag" };
@@ -119,7 +301,6 @@ async function selectPublishMode(flag, ctx, deps, dryRun) {
119
301
  if (config.publish?.mode !== void 0) {
120
302
  return { value: config.publish.mode, source: "existing" };
121
303
  }
122
- const interactive = ctx.flags.json !== true && (deps.isInteractive ?? (ctx.io.isTTY && Boolean(process.stdin.isTTY)));
123
304
  if (dryRun || !interactive) return { value: DEFAULT_MODE, source: "default-skipped" };
124
305
  const prompt = deps.promptMode ?? defaultPromptMode;
125
306
  for (let attempt = 0; attempt < 2; attempt++) {
@@ -154,15 +335,6 @@ function defaultPromptMode(label) {
154
335
  rl.question(label, (answer) => settle(answer));
155
336
  });
156
337
  }
157
- function publishModeLine(io, selection, dryRun) {
158
- const detail = {
159
- flag: dryRun ? "would set from --publish-mode" : "set from --publish-mode",
160
- existing: "already configured",
161
- prompt: "saved",
162
- "default-skipped": "default; run interactively or pass --publish-mode to change"
163
- };
164
- return paint(io, "bold", `publish mode: ${selection.value} (${detail[selection.source]})`);
165
- }
166
338
  function resolvePlans(override, home, which) {
167
339
  const claudeDir = join2(home, ".claude", "skills");
168
340
  const sharedDir = join2(home, ".agents", "skills");
@@ -209,7 +381,7 @@ function validateHarness(value) {
209
381
  fix: `--harness must be one of: ${HARNESSES.join(", ")}.`
210
382
  });
211
383
  }
212
- async function applyPlan(plan, skillsSource, dryRun) {
384
+ async function applyPlan(plan, skillsSource, dryRun, claudeMdWrite) {
213
385
  const skills = [];
214
386
  const warnings = [];
215
387
  for (const name of SKILL_NAMES) {
@@ -233,13 +405,33 @@ async function applyPlan(plan, skillsSource, dryRun) {
233
405
  if (plan.wiresAgentsMd) {
234
406
  result.agentsMd = await wireAgentsMd(plan, dryRun);
235
407
  result.codexNetworkRule = CODEX_NETWORK_RULE;
408
+ } else if (plan.harness === "claude") {
409
+ result.claudeMd = await wireClaudeMd(plan, dryRun, claudeMdWrite);
236
410
  }
237
411
  return result;
238
412
  }
413
+ async function decideClaudeMd(flag, canPrompt, dryRun, deps) {
414
+ if (flag !== void 0) return flag;
415
+ if (dryRun || !canPrompt) return false;
416
+ const confirm = deps.confirmClaudeMd ?? defaultConfirmYesNo;
417
+ return confirm(
418
+ "Add a one-line nudge to ~/.claude/CLAUDE.md telling agents to try a free Tenjin search before regenerating research? It sends only generalized question text to tenjin.blog. [Y/n] "
419
+ );
420
+ }
421
+ async function wireClaudeMd(plan, dryRun, write) {
422
+ const path = join2(plan.home, ".claude", "CLAUDE.md");
423
+ if (!write) return { path, status: "skipped" };
424
+ const existing = existsSync2(path) ? await readFile(path, "utf8") : null;
425
+ const { content, change } = upsertMarkerLine(existing, nudgeLine(plan.skillsDir));
426
+ if (change === "none") return { path, status: "up-to-date" };
427
+ if (!dryRun && content !== null) await writeFileAtomic(path, content);
428
+ if (change === "append") return { path, status: dryRun ? "would-write" : "written" };
429
+ return { path, status: dryRun ? "would-update" : "updated" };
430
+ }
239
431
  function notesFor(plan) {
240
432
  if (plan.harness === "claude") {
241
433
  return [
242
- "Installed at the user level (~/.claude/skills). The Claude Code plugin marketplace (roadmap C3) will supersede this path for Claude users."
434
+ "Installed at the user level (~/.claude/skills). A Claude Code plugin will later make this automatic."
243
435
  ];
244
436
  }
245
437
  return [
@@ -289,19 +481,21 @@ function treesEqual(a, b) {
289
481
  async function wireAgentsMd(plan, dryRun) {
290
482
  const shared = join2(plan.home, ".agents", "AGENTS.md");
291
483
  const codex = join2(plan.home, ".codex", "AGENTS.md");
292
- const line = `${AGENTS_MARKER} Tenjin agent skills are installed at ${plan.skillsDir} (tenjin-search, tenjin-publish, tenjin). Read the relevant SKILL.md before using the tenjin CLI.`;
293
- for (const path2 of [shared, codex]) {
294
- if (existsSync2(path2) && (await readFile(path2, "utf8")).includes(AGENTS_MARKER)) {
295
- return { path: path2, status: "already-present" };
484
+ const line = nudgeLine(plan.skillsDir);
485
+ for (const path of [shared, codex]) {
486
+ if (existsSync2(path) && (await readFile(path, "utf8")).includes(SKILLS_MARKER)) {
487
+ return upsertAgentsMd(path, line, dryRun);
296
488
  }
297
489
  }
298
- const path = chooseAgentsMdPath(plan.home);
299
- if (dryRun) return { path, status: "would-append" };
490
+ return upsertAgentsMd(chooseAgentsMdPath(plan.home), line, dryRun);
491
+ }
492
+ async function upsertAgentsMd(path, line, dryRun) {
300
493
  const existing = existsSync2(path) ? await readFile(path, "utf8") : null;
301
- const prefix = existing === null || existing.length === 0 || existing.endsWith("\n") ? "" : "\n";
302
- await writeFileAtomic(path, `${existing ?? ""}${prefix}${line}
303
- `);
304
- return { path, status: "appended" };
494
+ const { content, change } = upsertMarkerLine(existing, line);
495
+ if (change === "none") return { path, status: "already-present" };
496
+ if (!dryRun && content !== null) await writeFileAtomic(path, content);
497
+ if (change === "append") return { path, status: dryRun ? "would-append" : "appended" };
498
+ return { path, status: dryRun ? "would-update" : "updated" };
305
499
  }
306
500
  function chooseAgentsMdPath(home) {
307
501
  const shared = join2(home, ".agents", "AGENTS.md");
@@ -329,47 +523,8 @@ function isFile(p) {
329
523
  return false;
330
524
  }
331
525
  }
332
- function renderHuman(io, harnesses, doctor, dryRun) {
333
- const lines = [];
334
- if (dryRun) lines.push(paint(io, "yellow", "dry run: no files written"));
335
- for (const h of harnesses) {
336
- const how = h.detectedBy.length > 0 ? ` (${h.detectedBy.join(", ")})` : "";
337
- lines.push(paint(io, "bold", `${h.harness}${how} -> ${h.skillsDir}`));
338
- for (const s of h.skills) {
339
- lines.push(` ${skillIcon(io, s.status)} ${s.name.padEnd(14)} ${paint(io, "dim", s.status)}`);
340
- }
341
- if (h.agentsMd !== void 0) {
342
- lines.push(` ${paint(io, "dim", `AGENTS.md ${h.agentsMd.status}: ${h.agentsMd.path}`)}`);
343
- }
344
- for (const w of h.warnings) lines.push(` ${paint(io, "yellow", `! ${w}`)}`);
345
- for (const n of h.notes) lines.push(` ${paint(io, "dim", n)}`);
346
- if (h.codexNetworkRule !== void 0) {
347
- lines.push(
348
- paint(
349
- io,
350
- "dim",
351
- " Codex's default workspace-write sandbox blocks network, which breaks paid x402 calls."
352
- )
353
- );
354
- lines.push(paint(io, "dim", " Add this to ~/.codex/config.toml:"));
355
- for (const rl of h.codexNetworkRule.split("\n")) lines.push(` ${rl}`);
356
- }
357
- }
358
- lines.push("");
359
- lines.push(paint(io, "bold", "doctor (final checks):"));
360
- lines.push(...renderDoctorHuman(io, doctor.checks));
361
- if (doctor.failure !== void 0) {
362
- lines.push(paint(io, "yellow", "doctor reported a problem above; the skills are still wired."));
363
- }
364
- return lines;
365
- }
366
- function skillIcon(io, status) {
367
- if (status === "up-to-date") return paint(io, "green", "=");
368
- if (status === "updated" || status === "would-update") return paint(io, "yellow", "~");
369
- return paint(io, "green", "+");
370
- }
371
526
  function paint(io, format, text) {
372
- if (io.stderr instanceof Stream) return styleText(format, text, { stream: io.stderr });
527
+ if (io.stdout instanceof Stream) return styleText(format, text, { stream: io.stdout });
373
528
  return styleText(format, text);
374
529
  }
375
530
  async function assertSkillsSource(dir) {
@@ -384,4 +539,4 @@ async function assertSkillsSource(dir) {
384
539
  export {
385
540
  runInstall
386
541
  };
387
- //# sourceMappingURL=install-LEX3ENQ6.js.map
542
+ //# sourceMappingURL=install-7J6KKEEP.js.map