hive-intelligence 1.1.4 → 1.4.0

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 (134) hide show
  1. package/README.md +182 -73
  2. package/agent-skills/.claude-plugin/plugin.json +4 -4
  3. package/agent-skills/.mcp.json +1 -4
  4. package/agent-skills/README.md +16 -10
  5. package/agent-skills/SKILL.md +30 -12
  6. package/agent-skills/package.json +1 -1
  7. package/agent-skills/packs/hive-build/SKILL.md +47 -19
  8. package/agent-skills/packs/hive-build/evals/evals.json +16 -3
  9. package/agent-skills/packs/hive-build/evals/triggers.json +50 -0
  10. package/agent-skills/packs/hive-build-onboarding/SKILL.md +30 -37
  11. package/agent-skills/packs/hive-build-onboarding/evals/evals.json +1 -1
  12. package/agent-skills/packs/hive-build-onboarding/evals/triggers.json +50 -0
  13. package/agent-skills/packs/hive-cli/SKILL.md +33 -35
  14. package/agent-skills/packs/hive-cli/evals/evals.json +1 -1
  15. package/agent-skills/packs/hive-cli/evals/triggers.json +50 -0
  16. package/agent-skills/packs/hive-defi-research/SKILL.md +105 -19
  17. package/agent-skills/packs/hive-defi-research/evals/evals.json +6 -3
  18. package/agent-skills/packs/hive-defi-research/evals/triggers.json +50 -0
  19. package/agent-skills/packs/hive-dex-pool-analysis/SKILL.md +106 -16
  20. package/agent-skills/packs/hive-dex-pool-analysis/evals/evals.json +5 -3
  21. package/agent-skills/packs/hive-dex-pool-analysis/evals/triggers.json +50 -0
  22. package/agent-skills/packs/hive-market-research/SKILL.md +130 -21
  23. package/agent-skills/packs/hive-market-research/evals/evals.json +15 -2
  24. package/agent-skills/packs/hive-market-research/evals/triggers.json +50 -0
  25. package/agent-skills/packs/hive-mcp/SKILL.md +69 -47
  26. package/agent-skills/packs/hive-mcp/evals/evals.json +3 -2
  27. package/agent-skills/packs/hive-mcp/evals/triggers.json +50 -0
  28. package/agent-skills/packs/hive-mcp/references/client-install-matrix.md +62 -35
  29. package/agent-skills/packs/hive-mcp/references/clients.md +81 -68
  30. package/agent-skills/packs/hive-network-infrastructure/SKILL.md +105 -20
  31. package/agent-skills/packs/hive-network-infrastructure/evals/evals.json +4 -2
  32. package/agent-skills/packs/hive-network-infrastructure/evals/triggers.json +50 -0
  33. package/agent-skills/packs/hive-nft-research/SKILL.md +105 -18
  34. package/agent-skills/packs/hive-nft-research/evals/evals.json +4 -2
  35. package/agent-skills/packs/hive-nft-research/evals/triggers.json +50 -0
  36. package/agent-skills/packs/hive-prediction-markets/SKILL.md +108 -21
  37. package/agent-skills/packs/hive-prediction-markets/evals/evals.json +4 -2
  38. package/agent-skills/packs/hive-prediction-markets/evals/triggers.json +50 -0
  39. package/agent-skills/packs/hive-query/SKILL.md +79 -33
  40. package/agent-skills/packs/hive-query/evals/evals.json +7 -5
  41. package/agent-skills/packs/hive-query/evals/triggers.json +50 -0
  42. package/agent-skills/packs/hive-query/references/root-mcp-workflow.md +39 -18
  43. package/agent-skills/packs/hive-security-risk/SKILL.md +110 -19
  44. package/agent-skills/packs/hive-security-risk/evals/evals.json +4 -2
  45. package/agent-skills/packs/hive-security-risk/evals/triggers.json +50 -0
  46. package/agent-skills/packs/hive-solana-analysis/SKILL.md +115 -19
  47. package/agent-skills/packs/hive-solana-analysis/evals/evals.json +4 -2
  48. package/agent-skills/packs/hive-solana-analysis/evals/triggers.json +50 -0
  49. package/agent-skills/packs/hive-stateful-monitoring/SKILL.md +92 -47
  50. package/agent-skills/packs/hive-stateful-monitoring/evals/evals.json +7 -2
  51. package/agent-skills/packs/hive-stateful-monitoring/evals/triggers.json +50 -0
  52. package/agent-skills/packs/hive-stateful-monitoring/references/b2b-subject-context.md +53 -0
  53. package/agent-skills/packs/hive-token-diligence/SKILL.md +119 -21
  54. package/agent-skills/packs/hive-token-diligence/evals/evals.json +6 -4
  55. package/agent-skills/packs/hive-token-diligence/evals/triggers.json +50 -0
  56. package/agent-skills/packs/hive-tool-discovery/SKILL.md +48 -19
  57. package/agent-skills/packs/hive-tool-discovery/evals/evals.json +17 -3
  58. package/agent-skills/packs/hive-tool-discovery/evals/triggers.json +50 -0
  59. package/agent-skills/packs/hive-tool-discovery/references/discovery-surfaces.md +31 -6
  60. package/agent-skills/packs/hive-wallet-investigation/SKILL.md +111 -18
  61. package/agent-skills/packs/hive-wallet-investigation/evals/evals.json +5 -3
  62. package/agent-skills/packs/hive-wallet-investigation/evals/triggers.json +50 -0
  63. package/agent-skills/references/agents-routing.md +17 -7
  64. package/agent-skills/scripts/validate-agent-skills-package.mjs +68 -8
  65. package/bin/hive-mcp.js +5 -5
  66. package/build/{alias-3OPMQF4X.js → alias-BKAVOYQV.js} +2 -2
  67. package/build/api-client-WMWFWXC7.js +16 -0
  68. package/build/{auth-Q5Q24IRI.js → auth-HRFQWQMZ.js} +3 -11
  69. package/build/browser-auth-KXIO5BHM.js +20 -0
  70. package/build/{cache-T6KC5YEY.js → cache-TBDQ7QBU.js} +2 -2
  71. package/build/chunk-3OZFBWFK.js +180 -0
  72. package/build/{chunk-POT2MBEK.js → chunk-6PC3HUAK.js} +10 -3
  73. package/build/{chunk-NP6NSOG2.js → chunk-725R3KLJ.js} +26 -3
  74. package/build/chunk-7DYHWY4Y.js +125 -0
  75. package/build/{chunk-ZXB53E7H.js → chunk-AEU43ACS.js} +31 -7
  76. package/build/chunk-AQQAPAER.js +197 -0
  77. package/build/chunk-EPF36Q3Z.js +71 -0
  78. package/build/{upgrade-DTUIHVPS.js → chunk-GHCYCBA3.js} +4 -5
  79. package/build/{chunk-3WYWXTNN.js → chunk-ILVPOLA7.js} +12 -3
  80. package/build/{chunk-VBOKVQ74.js → chunk-L326MQZP.js} +6 -5
  81. package/build/{chunk-FRXMGRZQ.js → chunk-M6REON2I.js} +2 -2
  82. package/build/{chunk-7JWXBKEJ.js → chunk-P7NLFSZQ.js} +9 -60
  83. package/build/chunk-QDZ7MAVN.js +447 -0
  84. package/build/{chunk-ZTJVOWDQ.js → chunk-R6YZTFQL.js} +2 -0
  85. package/build/{chunk-YZ2PXBJK.js → chunk-RU6QOFHH.js} +6 -9
  86. package/build/{chunk-FH3YGSY5.js → chunk-TNQ7GJ6Q.js} +0 -59
  87. package/build/{chunk-5XXI25JE.js → chunk-TVQJY47C.js} +12 -160
  88. package/build/{chunk-JTUKQWIO.js → chunk-UFTNBCSA.js} +35515 -14994
  89. package/build/{chunk-ZCU7XQKF.js → chunk-ZXKFJQDE.js} +7 -1
  90. package/build/cli.js +3342 -3423
  91. package/build/{completion-46K674EL.js → completion-7KBW243H.js} +4 -4
  92. package/build/{config-XE6Q5P4I.js → config-KAEUX6RM.js} +23 -3
  93. package/build/{config-dir-MAWX5AUF.js → config-dir-5IH7MOOT.js} +2 -2
  94. package/build/{doctor-HGMQE6IN.js → doctor-GHUAUFS2.js} +12 -12
  95. package/build/{errors-J2PH3NLJ.js → errors-HGHUF575.js} +2 -2
  96. package/build/{format-5X2HIVDT.js → format-H7FOQSYY.js} +1 -1
  97. package/build/{init-JMDNM7ZZ.js → init-UCTCUYFA.js} +52 -8
  98. package/build/init-all-RG542NWG.js +427 -0
  99. package/build/mcpServer-D7OXUDU5.js +34 -0
  100. package/build/monitor-worker.js +296 -40
  101. package/build/{namespace-FSX2G3NM.js → namespace-L5DGCY7K.js} +2 -2
  102. package/build/{open-5A6ZQMGC.js → open-V2RNA3QT.js} +1 -1
  103. package/build/{output-V3D4YZ6U.js → output-ITGLBKIG.js} +2 -2
  104. package/build/release.json +8 -0
  105. package/build/{serve-AGCOXXFM.js → serve-K3IT7DS4.js} +3 -3
  106. package/build/server.js +6396 -3220
  107. package/build/{setup-RMETGJWK.js → setup-PTYFMTK5.js} +60 -55
  108. package/build/stdio.js +7 -6
  109. package/build/{telemetry-WCME5XEU.js → telemetry-HPLDYR7U.js} +5 -4
  110. package/build/{tools-KAB6QBZC.js → tools-D72ZH6P5.js} +15 -15
  111. package/build/{uninstall-FLJMBBSC.js → uninstall-SAOIPL6K.js} +19 -10
  112. package/build/{update-check-LNZQK3XA.js → update-check-IEXPOYYR.js} +4 -4
  113. package/build/upgrade-4S5XT5JG.js +14 -0
  114. package/build/{version-I6HDAF4L.js → version-Z4HJL4VV.js} +4 -2
  115. package/build/{watch-YNN255QX.js → watch-IOSRSCFE.js} +8 -7
  116. package/package.json +73 -35
  117. package/agent-skills/packs/hive-defi-research/references/workflow.md +0 -41
  118. package/agent-skills/packs/hive-dex-pool-analysis/references/workflow.md +0 -42
  119. package/agent-skills/packs/hive-market-research/references/workflow.md +0 -47
  120. package/agent-skills/packs/hive-network-infrastructure/references/workflow.md +0 -41
  121. package/agent-skills/packs/hive-nft-research/references/workflow.md +0 -42
  122. package/agent-skills/packs/hive-prediction-markets/references/workflow.md +0 -42
  123. package/agent-skills/packs/hive-security-risk/references/workflow.md +0 -46
  124. package/agent-skills/packs/hive-solana-analysis/references/workflow.md +0 -42
  125. package/agent-skills/packs/hive-token-diligence/references/workflow.md +0 -45
  126. package/agent-skills/packs/hive-wallet-investigation/references/workflow.md +0 -45
  127. package/build/api-client-EPF6FD7A.js +0 -28
  128. package/build/browser-auth-VPF5LZMZ.js +0 -8
  129. package/build/chunk-4F5CI6LX.js +0 -340
  130. package/build/chunk-CEWCB5YS.js +0 -71
  131. package/build/chunk-GZPDEXO4.js +0 -126
  132. package/build/chunk-IZPAMRHP.js +0 -43
  133. package/build/init-all-5SKNV75X.js +0 -273
  134. package/build/mcpServer-5TKKSKJM.js +0 -21
@@ -1,8 +1,8 @@
1
1
  import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
2
  import {
3
3
  NAMESPACE
4
- } from "./chunk-FH3YGSY5.js";
5
- import "./chunk-3WYWXTNN.js";
4
+ } from "./chunk-TNQ7GJ6Q.js";
5
+ import "./chunk-ILVPOLA7.js";
6
6
 
7
7
  // src/cli/completion.ts
8
8
  import {
@@ -72,7 +72,7 @@ _hive_completions() {
72
72
  case "$prev" in
73
73
  ${cases}
74
74
  tools) COMPREPLY=($(compgen -W "list search info call refresh" -- "$cur")); return ;;
75
- config) COMPREPLY=($(compgen -W "claude-desktop cursor vscode claude-code http" -- "$cur")); return ;;
75
+ config) COMPREPLY=($(compgen -W "claude-desktop cursor vscode claude-code codex grok http" -- "$cur")); return ;;
76
76
  auth) COMPREPLY=($(compgen -W "login logout whoami profiles switch" -- "$cur")); return ;;
77
77
  alias) COMPREPLY=($(compgen -W "set list remove" -- "$cur")); return ;;
78
78
  telemetry) COMPREPLY=($(compgen -W "enable disable status" -- "$cur")); return ;;
@@ -130,7 +130,7 @@ ${subcommandCases}
130
130
  ;;
131
131
  config)
132
132
  local -a subcmds
133
- subcmds=('claude-desktop:Claude Desktop config' 'cursor:Cursor config' 'vscode:VS Code config' 'claude-code:Claude Code config' 'http:HTTP remote config')
133
+ subcmds=('claude-desktop:Claude Desktop config' 'cursor:Cursor config' 'vscode:VS Code config' 'claude-code:Claude Code config' 'codex:Codex OAuth setup' 'grok:Grok connector setup' 'http:HTTP remote config')
134
134
  _describe 'subcommand' subcmds
135
135
  ;;
136
136
  auth)
@@ -2,18 +2,27 @@ import { createRequire } from 'node:module'; const require = createRequire(impor
2
2
  import {
3
3
  configClaudeCode,
4
4
  configClaudeDesktop,
5
+ configCodex,
5
6
  configCursor,
7
+ configGrok,
6
8
  configHttpUrl,
7
9
  configVscode,
8
10
  getClaudeCodeUserConfigPath,
9
11
  getClaudeDesktopConfigPath,
12
+ getClaudeDesktopInstructions,
13
+ getCodexConfigPath,
14
+ getCodexInstructions,
10
15
  getCursorConfigPath,
11
16
  getGeminiCliSettingsPath,
17
+ getGrokInstructions,
12
18
  getVscodeConfigPath,
19
+ getVscodeInstallDeeplink,
20
+ getVscodeInstructions,
13
21
  getWindsurfMcpConfigPath,
14
22
  printChatGptDesktopInstructions,
15
23
  removeClaudeCodeUserConfig,
16
24
  removeClaudeDesktopConfig,
25
+ removeCodexConfig,
17
26
  removeCursorConfig,
18
27
  removeGeminiCliConfig,
19
28
  removeVscodeConfig,
@@ -21,28 +30,38 @@ import {
21
30
  writeClaudeCodeConfig,
22
31
  writeClaudeCodeUserConfig,
23
32
  writeClaudeDesktopConfig,
33
+ writeCodexConfig,
24
34
  writeCursorConfig,
25
35
  writeGeminiCliConfig,
26
36
  writeVscodeConfig,
27
37
  writeWindsurfConfig
28
- } from "./chunk-4F5CI6LX.js";
29
- import "./chunk-POT2MBEK.js";
30
- import "./chunk-3WYWXTNN.js";
38
+ } from "./chunk-QDZ7MAVN.js";
39
+ import "./chunk-6PC3HUAK.js";
40
+ import "./chunk-ILVPOLA7.js";
31
41
  export {
32
42
  configClaudeCode,
33
43
  configClaudeDesktop,
44
+ configCodex,
34
45
  configCursor,
46
+ configGrok,
35
47
  configHttpUrl,
36
48
  configVscode,
37
49
  getClaudeCodeUserConfigPath,
38
50
  getClaudeDesktopConfigPath,
51
+ getClaudeDesktopInstructions,
52
+ getCodexConfigPath,
53
+ getCodexInstructions,
39
54
  getCursorConfigPath,
40
55
  getGeminiCliSettingsPath,
56
+ getGrokInstructions,
41
57
  getVscodeConfigPath,
58
+ getVscodeInstallDeeplink,
59
+ getVscodeInstructions,
42
60
  getWindsurfMcpConfigPath,
43
61
  printChatGptDesktopInstructions,
44
62
  removeClaudeCodeUserConfig,
45
63
  removeClaudeDesktopConfig,
64
+ removeCodexConfig,
46
65
  removeCursorConfig,
47
66
  removeGeminiCliConfig,
48
67
  removeVscodeConfig,
@@ -50,6 +69,7 @@ export {
50
69
  writeClaudeCodeConfig,
51
70
  writeClaudeCodeUserConfig,
52
71
  writeClaudeDesktopConfig,
72
+ writeCodexConfig,
53
73
  writeCursorConfig,
54
74
  writeGeminiCliConfig,
55
75
  writeVscodeConfig,
@@ -12,8 +12,8 @@ import {
12
12
  saveCredentials,
13
13
  setCliFlags,
14
14
  writeJsonFile
15
- } from "./chunk-POT2MBEK.js";
16
- import "./chunk-3WYWXTNN.js";
15
+ } from "./chunk-6PC3HUAK.js";
16
+ import "./chunk-ILVPOLA7.js";
17
17
  export {
18
18
  ensureConfigDir,
19
19
  getConfig,
@@ -1,17 +1,17 @@
1
1
  import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
2
  import {
3
3
  fetchToolCatalog
4
- } from "./chunk-7JWXBKEJ.js";
5
- import "./chunk-ZCU7XQKF.js";
4
+ } from "./chunk-P7NLFSZQ.js";
5
+ import "./chunk-ZXKFJQDE.js";
6
6
  import {
7
7
  debug,
8
8
  info,
9
9
  shouldOutputJson,
10
10
  successEnvelope,
11
11
  writeOutput
12
- } from "./chunk-NP6NSOG2.js";
13
- import "./chunk-POT2MBEK.js";
14
- import "./chunk-3WYWXTNN.js";
12
+ } from "./chunk-725R3KLJ.js";
13
+ import "./chunk-6PC3HUAK.js";
14
+ import "./chunk-ILVPOLA7.js";
15
15
 
16
16
  // src/cli/doctor.ts
17
17
  var DEFAULT_API_URL = "https://mcp.hiveintelligence.xyz";
@@ -24,7 +24,7 @@ async function runDoctor(opts) {
24
24
  checks.push({
25
25
  check: "HIVE_API_KEY",
26
26
  status: apiKey ? "PASS" : "INFO",
27
- detail: apiKey ? `Set (${apiKey.slice(0, 4)}...)` : "Not set (optional \u2014 API is currently free)"
27
+ detail: apiKey ? `Set (${apiKey.slice(0, 4)}...)` : "Not set (keyless mode: discovery + limited free hero calls; set a key for full access)"
28
28
  });
29
29
  const apiUrl = process.env.HIVE_API_URL;
30
30
  checks.push({
@@ -96,8 +96,8 @@ async function runDoctor(opts) {
96
96
  }
97
97
  }
98
98
  {
99
- const { SERVER_VERSION } = await import("./version-I6HDAF4L.js");
100
- const { fetchLatestVersion, isNewerVersion } = await import("./update-check-LNZQK3XA.js");
99
+ const { SERVER_VERSION } = await import("./version-Z4HJL4VV.js");
100
+ const { fetchLatestVersion, isNewerVersion } = await import("./update-check-IEXPOYYR.js");
101
101
  const latest = await fetchLatestVersion(5e3);
102
102
  if (latest === null) {
103
103
  checks.push({
@@ -188,7 +188,7 @@ async function runDoctor(opts) {
188
188
  if (fails > 0) process.exit(1);
189
189
  return;
190
190
  }
191
- const { table } = await import("./format-5X2HIVDT.js");
191
+ const { table } = await import("./format-H7FOQSYY.js");
192
192
  info("\nHive MCP Doctor\n");
193
193
  info(
194
194
  table(
@@ -204,9 +204,9 @@ ${fails === 0 ? "All checks passed" : `${fails} issues found`}${warns ? ` (${war
204
204
  if (fails > 0) process.exit(1);
205
205
  }
206
206
  async function runStatus() {
207
- const { SERVER_VERSION } = await import("./mcpServer-5TKKSKJM.js");
208
- const { resolveApiKey, resolveApiUrl } = await import("./config-dir-MAWX5AUF.js");
209
- const { getActiveProfile, maskKey } = await import("./auth-Q5Q24IRI.js");
207
+ const { SERVER_VERSION } = await import("./mcpServer-D7OXUDU5.js");
208
+ const { resolveApiKey, resolveApiUrl } = await import("./config-dir-5IH7MOOT.js");
209
+ const { getActiveProfile, maskKey } = await import("./auth-HRFQWQMZ.js");
210
210
  const apiUrl = resolveApiUrl();
211
211
  const apiKey = resolveApiKey();
212
212
  const profile = getActiveProfile();
@@ -5,8 +5,8 @@ import {
5
5
  ExitCode,
6
6
  classifyError,
7
7
  suggestSimilarTools
8
- } from "./chunk-ZTJVOWDQ.js";
9
- import "./chunk-3WYWXTNN.js";
8
+ } from "./chunk-R6YZTFQL.js";
9
+ import "./chunk-ILVPOLA7.js";
10
10
  export {
11
11
  CliError,
12
12
  ERROR_DOC_URLS,
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
- import "./chunk-3WYWXTNN.js";
2
+ import "./chunk-ILVPOLA7.js";
3
3
 
4
4
  // src/cli/format.ts
5
5
  function pad(str, width) {
@@ -1,13 +1,57 @@
1
1
  import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
- import "./chunk-3WYWXTNN.js";
2
+ import "./chunk-ILVPOLA7.js";
3
3
 
4
4
  // src/cli/init.ts
5
- import { existsSync, readFileSync, writeFileSync } from "fs";
5
+ import { chmodSync, existsSync, readFileSync, writeFileSync } from "fs";
6
6
  import { join } from "path";
7
7
  import { createInterface } from "readline";
8
8
  var DEFAULT_API_URL = "https://mcp.hiveintelligence.xyz";
9
- var rl = createInterface({ input: process.stdin, output: process.stdout });
10
- var ask = (q) => new Promise((resolve) => rl.question(q, resolve));
9
+ var ask = (q) => new Promise((resolve) => {
10
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
11
+ rl.question(q, (answer) => {
12
+ rl.close();
13
+ resolve(answer);
14
+ });
15
+ });
16
+ function askSecret(q) {
17
+ if (!process.stdin.isTTY || !process.stdin.setRawMode) return ask(q);
18
+ process.stdout.write(q);
19
+ return new Promise((resolve, reject) => {
20
+ let value = "";
21
+ const cleanup = () => {
22
+ process.stdin.off("data", onData);
23
+ process.stdin.setRawMode(false);
24
+ process.stdin.pause();
25
+ process.stdout.write("\n");
26
+ };
27
+ const onData = (chunk) => {
28
+ const input = chunk.toString("utf8");
29
+ if (input === "") {
30
+ cleanup();
31
+ reject(new Error("Setup cancelled."));
32
+ return;
33
+ }
34
+ if (input === "\r" || input === "\n") {
35
+ cleanup();
36
+ resolve(value);
37
+ return;
38
+ }
39
+ if (input === "\x7F" || input === "\b") {
40
+ value = value.slice(0, -1);
41
+ return;
42
+ }
43
+ value += input;
44
+ };
45
+ process.stdin.setRawMode(true);
46
+ process.stdin.resume();
47
+ process.stdin.on("data", onData);
48
+ });
49
+ }
50
+ function redactEnvForDisplay(lines) {
51
+ return lines.split("\n").map(
52
+ (line) => line.startsWith("HIVE_API_KEY=") ? "HIVE_API_KEY=<redacted>" : line
53
+ ).join("\n");
54
+ }
11
55
  async function runInit(opts) {
12
56
  console.log("\nHive MCP Setup\n");
13
57
  const envPath = join(process.cwd(), ".env");
@@ -33,7 +77,7 @@ async function runInit(opts) {
33
77
  }
34
78
  } else {
35
79
  const currentKeyTag = apiKey ? ` [current: ${apiKey.slice(0, 6)}...]` : "";
36
- const keyInput = await ask(
80
+ const keyInput = await askSecret(
37
81
  `HIVE_API_KEY${currentKeyTag}
38
82
  Your Hive Intelligence API key: `
39
83
  );
@@ -50,7 +94,6 @@ HIVE_API_URL${currentUrlTag}
50
94
  apiUrl = urlInput.trim();
51
95
  }
52
96
  }
53
- rl.close();
54
97
  if (apiKey) existing.HIVE_API_KEY = apiKey;
55
98
  if (apiUrl) existing.HIVE_API_URL = apiUrl;
56
99
  if (apiKey) {
@@ -88,11 +131,12 @@ Validating API key against ${baseUrl}...`);
88
131
  const lines = Object.entries(existing).map(([k, v]) => `${k}=${v}`).join("\n");
89
132
  if (opts.dryRun) {
90
133
  console.log("Dry run \u2014 would write to .env:\n");
91
- console.log(lines);
134
+ console.log(redactEnvForDisplay(lines));
92
135
  console.log("");
93
136
  return;
94
137
  }
95
- writeFileSync(envPath, lines + "\n", "utf-8");
138
+ writeFileSync(envPath, lines + "\n", { encoding: "utf-8", mode: 384 });
139
+ chmodSync(envPath, 384);
96
140
  console.log(`.env written to ${envPath}`);
97
141
  console.log("Run: hive doctor to verify connectivity\n");
98
142
  }