hive-intelligence 1.1.4 → 1.3.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 (130) 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 +27 -34
  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-EPF6FD7A.js → api-client-FTVDFW5V.js} +4 -4
  68. package/build/{auth-Q5Q24IRI.js → auth-EZFJ5RYB.js} +3 -3
  69. package/build/{browser-auth-VPF5LZMZ.js → browser-auth-OJSUNFBI.js} +2 -2
  70. package/build/{cache-T6KC5YEY.js → cache-TBDQ7QBU.js} +2 -2
  71. package/build/{chunk-POT2MBEK.js → chunk-6PC3HUAK.js} +10 -3
  72. package/build/{chunk-NP6NSOG2.js → chunk-725R3KLJ.js} +26 -3
  73. package/build/{chunk-GZPDEXO4.js → chunk-7GD2MFYI.js} +57 -6
  74. package/build/{chunk-ZXB53E7H.js → chunk-AEU43ACS.js} +31 -7
  75. package/build/chunk-EPF36Q3Z.js +71 -0
  76. package/build/chunk-I5Z6FZRL.js +178 -0
  77. package/build/{chunk-3WYWXTNN.js → chunk-ILVPOLA7.js} +12 -3
  78. package/build/{chunk-VBOKVQ74.js → chunk-L326MQZP.js} +6 -5
  79. package/build/{chunk-FRXMGRZQ.js → chunk-M6REON2I.js} +2 -2
  80. package/build/chunk-N32UIHBU.js +125 -0
  81. package/build/{chunk-7JWXBKEJ.js → chunk-Q7VBYLX7.js} +9 -2
  82. package/build/chunk-QDZ7MAVN.js +447 -0
  83. package/build/{chunk-ZTJVOWDQ.js → chunk-R6YZTFQL.js} +2 -0
  84. package/build/{chunk-YZ2PXBJK.js → chunk-RU6QOFHH.js} +6 -9
  85. package/build/{chunk-5XXI25JE.js → chunk-RUHO24SX.js} +16 -9
  86. package/build/{chunk-FH3YGSY5.js → chunk-TNQ7GJ6Q.js} +0 -59
  87. package/build/{chunk-JTUKQWIO.js → chunk-W2QL7LYI.js} +34807 -15070
  88. package/build/{chunk-ZCU7XQKF.js → chunk-ZXKFJQDE.js} +7 -1
  89. package/build/cli.js +3337 -3407
  90. package/build/{completion-46K674EL.js → completion-7KBW243H.js} +4 -4
  91. package/build/{config-XE6Q5P4I.js → config-KAEUX6RM.js} +23 -3
  92. package/build/{config-dir-MAWX5AUF.js → config-dir-5IH7MOOT.js} +2 -2
  93. package/build/{doctor-HGMQE6IN.js → doctor-ORDOCGLM.js} +12 -12
  94. package/build/{errors-J2PH3NLJ.js → errors-HGHUF575.js} +2 -2
  95. package/build/{format-5X2HIVDT.js → format-H7FOQSYY.js} +1 -1
  96. package/build/{init-JMDNM7ZZ.js → init-UCTCUYFA.js} +52 -8
  97. package/build/init-all-BVWW3JVK.js +408 -0
  98. package/build/mcpServer-RUEOTTF7.js +34 -0
  99. package/build/monitor-worker.js +296 -40
  100. package/build/{namespace-FSX2G3NM.js → namespace-L5DGCY7K.js} +2 -2
  101. package/build/{open-5A6ZQMGC.js → open-V2RNA3QT.js} +1 -1
  102. package/build/{output-V3D4YZ6U.js → output-ITGLBKIG.js} +2 -2
  103. package/build/release.json +8 -0
  104. package/build/{serve-AGCOXXFM.js → serve-DKLR2WQH.js} +3 -3
  105. package/build/server.js +4481 -2319
  106. package/build/{setup-RMETGJWK.js → setup-PTYFMTK5.js} +60 -55
  107. package/build/stdio.js +7 -6
  108. package/build/{telemetry-WCME5XEU.js → telemetry-HPLDYR7U.js} +5 -4
  109. package/build/{tools-KAB6QBZC.js → tools-I7GLWTV6.js} +15 -15
  110. package/build/{uninstall-FLJMBBSC.js → uninstall-SAOIPL6K.js} +19 -10
  111. package/build/{update-check-LNZQK3XA.js → update-check-IEXPOYYR.js} +4 -4
  112. package/build/{upgrade-DTUIHVPS.js → upgrade-J4HIGCKE.js} +5 -5
  113. package/build/{version-I6HDAF4L.js → version-Z4HJL4VV.js} +4 -2
  114. package/build/{watch-YNN255QX.js → watch-WVR4CGCD.js} +8 -7
  115. package/package.json +71 -35
  116. package/agent-skills/packs/hive-defi-research/references/workflow.md +0 -41
  117. package/agent-skills/packs/hive-dex-pool-analysis/references/workflow.md +0 -42
  118. package/agent-skills/packs/hive-market-research/references/workflow.md +0 -47
  119. package/agent-skills/packs/hive-network-infrastructure/references/workflow.md +0 -41
  120. package/agent-skills/packs/hive-nft-research/references/workflow.md +0 -42
  121. package/agent-skills/packs/hive-prediction-markets/references/workflow.md +0 -42
  122. package/agent-skills/packs/hive-security-risk/references/workflow.md +0 -46
  123. package/agent-skills/packs/hive-solana-analysis/references/workflow.md +0 -42
  124. package/agent-skills/packs/hive-token-diligence/references/workflow.md +0 -45
  125. package/agent-skills/packs/hive-wallet-investigation/references/workflow.md +0 -45
  126. package/build/chunk-4F5CI6LX.js +0 -340
  127. package/build/chunk-CEWCB5YS.js +0 -71
  128. package/build/chunk-IZPAMRHP.js +0 -43
  129. package/build/init-all-5SKNV75X.js +0 -273
  130. package/build/mcpServer-5TKKSKJM.js +0 -21
@@ -0,0 +1,447 @@
1
+ import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ resolveApiUrl
4
+ } from "./chunk-6PC3HUAK.js";
5
+
6
+ // src/cli/config.ts
7
+ import {
8
+ chmodSync,
9
+ existsSync,
10
+ mkdirSync,
11
+ readFileSync,
12
+ writeFileSync
13
+ } from "fs";
14
+ import { homedir, platform } from "os";
15
+ import { dirname, join } from "path";
16
+ import { spawnSync } from "child_process";
17
+ var DEFAULT_URL = "https://mcp.hiveintelligence.xyz";
18
+ var SERVER_NAME = "hive";
19
+ function getServerUrl(override) {
20
+ return (override || resolveApiUrl() || DEFAULT_URL).replace(/\/+$/, "");
21
+ }
22
+ function configClaudeDesktop() {
23
+ const instructions = getClaudeDesktopInstructions();
24
+ console.log("\nConnect Hive in Claude Desktop:\n");
25
+ for (const [index, step] of instructions.steps.entries()) {
26
+ console.log(`${index + 1}. ${step}`);
27
+ }
28
+ console.log(
29
+ "\nClaude Desktop's claude_desktop_config.json is for local stdio servers; Hive's hosted URL must be added through the Connectors UI."
30
+ );
31
+ }
32
+ function getClaudeDesktopInstructions(baseUrl) {
33
+ const url = getServerUrl(baseUrl);
34
+ return {
35
+ manual: true,
36
+ steps: [
37
+ "Open Settings > Connectors.",
38
+ 'Choose "Add custom connector".',
39
+ `Enter ${url}/mcp.`,
40
+ "Sign in to Hive and approve the requested scopes."
41
+ ]
42
+ };
43
+ }
44
+ function configCursor() {
45
+ const url = getServerUrl();
46
+ const config = {
47
+ mcpServers: {
48
+ [SERVER_NAME]: {
49
+ url: `${url}/mcp`
50
+ }
51
+ }
52
+ };
53
+ console.log("\nAdd to .cursor/mcp.json:\n");
54
+ console.log(JSON.stringify(config, null, 2));
55
+ }
56
+ function configVscode() {
57
+ const instructions = getVscodeInstructions();
58
+ console.log("\nInstall Hive in your VS Code user profile:\n");
59
+ for (const [index, instruction] of instructions.steps.entries()) {
60
+ console.log(`${index + 1}. ${instruction}`);
61
+ }
62
+ }
63
+ function configClaudeCode() {
64
+ const url = getServerUrl();
65
+ console.log("\nRun this command:\n");
66
+ console.log(
67
+ `claude mcp add --transport http --scope user ${SERVER_NAME} ${url}/mcp`
68
+ );
69
+ console.log("\nClaude opens Hive browser authorization on first connect.");
70
+ }
71
+ function configCodex() {
72
+ const instructions = getCodexInstructions();
73
+ console.log("\nConnect Hive in Codex with native OAuth:\n");
74
+ for (const [index, step] of instructions.steps.entries()) {
75
+ console.log(`${index + 1}. ${step}`);
76
+ }
77
+ }
78
+ function configGrok() {
79
+ const instructions = getGrokInstructions();
80
+ console.log("\nConnect Hive in Grok:\n");
81
+ for (const [index, step] of instructions.steps.entries()) {
82
+ console.log(`${index + 1}. ${step}`);
83
+ }
84
+ }
85
+ function configHttpUrl(url) {
86
+ console.log(`
87
+ Remote MCP server URL: ${url}/mcp`);
88
+ console.log("\nFor Claude Code:");
89
+ console.log(
90
+ ` claude mcp add --transport http --scope user ${SERVER_NAME} ${url}/mcp`
91
+ );
92
+ console.log("\nFor OAuth-capable MCP clients:");
93
+ console.log(
94
+ JSON.stringify(
95
+ {
96
+ [SERVER_NAME]: {
97
+ url: `${url}/mcp`
98
+ }
99
+ },
100
+ null,
101
+ 2
102
+ )
103
+ );
104
+ console.log(
105
+ "\nHeadless fallback: send Authorization: Bearer $HIVE_API_KEY from secret storage."
106
+ );
107
+ }
108
+ function readJsonSafe(filePath) {
109
+ if (!existsSync(filePath)) return {};
110
+ const raw = readFileSync(filePath, "utf-8");
111
+ try {
112
+ return JSON.parse(raw);
113
+ } catch {
114
+ throw new Error(
115
+ `Config file at ${filePath} contains invalid JSON. Fix it manually before running setup.`
116
+ );
117
+ }
118
+ }
119
+ function writeJsonSafe(filePath, data) {
120
+ const dir = dirname(filePath);
121
+ if (!existsSync(dir)) mkdirSync(dir, { recursive: true, mode: 448 });
122
+ writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n", {
123
+ encoding: "utf-8",
124
+ mode: 384
125
+ });
126
+ chmodSync(filePath, 384);
127
+ }
128
+ function getClaudeDesktopConfigPath() {
129
+ return platform() === "darwin" ? join(
130
+ homedir(),
131
+ "Library",
132
+ "Application Support",
133
+ "Claude",
134
+ "claude_desktop_config.json"
135
+ ) : platform() === "win32" ? join(
136
+ homedir(),
137
+ "AppData",
138
+ "Roaming",
139
+ "Claude",
140
+ "claude_desktop_config.json"
141
+ ) : join(homedir(), ".config", "Claude", "claude_desktop_config.json");
142
+ }
143
+ function getCursorConfigPath() {
144
+ return join(homedir(), ".cursor", "mcp.json");
145
+ }
146
+ function getVscodeConfigPath() {
147
+ return 'VS Code user profile ("MCP: Open User Configuration")';
148
+ }
149
+ function getWindsurfMcpConfigPath() {
150
+ return join(homedir(), ".codeium", "windsurf", "mcp_config.json");
151
+ }
152
+ function getGeminiCliSettingsPath() {
153
+ return join(homedir(), ".gemini", "settings.json");
154
+ }
155
+ function getClaudeCodeUserConfigPath() {
156
+ return join(homedir(), ".claude.json");
157
+ }
158
+ function getCodexConfigPath() {
159
+ return join(homedir(), ".codex", "config.toml");
160
+ }
161
+ function writeClaudeDesktopConfig() {
162
+ return { path: getClaudeDesktopConfigPath(), written: false };
163
+ }
164
+ function writeCursorConfig(baseUrl) {
165
+ const url = getServerUrl(baseUrl);
166
+ const p = getCursorConfigPath();
167
+ const existing = readJsonSafe(p);
168
+ const mcpServers = existing.mcpServers || {};
169
+ mcpServers[SERVER_NAME] = {
170
+ url: `${url}/mcp`
171
+ };
172
+ existing.mcpServers = mcpServers;
173
+ writeJsonSafe(p, existing);
174
+ return { path: p, written: true };
175
+ }
176
+ function vscodeServerDefinition(baseUrl) {
177
+ const url = getServerUrl(baseUrl);
178
+ return { name: SERVER_NAME, type: "http", url: `${url}/mcp` };
179
+ }
180
+ function getVscodeInstallDeeplink(baseUrl) {
181
+ return `vscode:mcp/install?${encodeURIComponent(
182
+ JSON.stringify(vscodeServerDefinition(baseUrl))
183
+ )}`;
184
+ }
185
+ function getVscodeInstructions(baseUrl) {
186
+ const definition = JSON.stringify(vscodeServerDefinition(baseUrl));
187
+ return {
188
+ manual: true,
189
+ steps: [
190
+ `Open the one-click install link: ${getVscodeInstallDeeplink(baseUrl)}`,
191
+ `Or run: code --add-mcp '${definition}'`,
192
+ 'If neither opens, run "MCP: Add Server" and choose Global in the VS Code Command Palette.',
193
+ "Review the server, start it, and complete Hive browser authorization."
194
+ ]
195
+ };
196
+ }
197
+ function writeVscodeConfig(baseUrl, runner = (command, args) => spawnSync(command, args, {
198
+ encoding: "utf8",
199
+ timeout: 1e4,
200
+ stdio: ["ignore", "pipe", "pipe"]
201
+ })) {
202
+ const definition = JSON.stringify(vscodeServerDefinition(baseUrl));
203
+ const command = `code --add-mcp '${definition}'`;
204
+ const result = runner("code", ["--add-mcp", definition]);
205
+ const stderr = result.stderr?.toString().trim();
206
+ return {
207
+ path: getVscodeConfigPath(),
208
+ written: result.status === 0,
209
+ command,
210
+ deeplink: getVscodeInstallDeeplink(baseUrl),
211
+ ...result.status === 0 ? {} : {
212
+ error: stderr || result.error?.message || "VS Code CLI is unavailable or rejected the MCP definition."
213
+ }
214
+ };
215
+ }
216
+ function writeClaudeCodeConfig(baseUrl) {
217
+ const url = getServerUrl(baseUrl);
218
+ return {
219
+ command: `claude mcp add --transport http --scope user ${SERVER_NAME} ${url}/mcp`
220
+ };
221
+ }
222
+ function codexCommands(baseUrl) {
223
+ const url = getServerUrl(baseUrl);
224
+ return {
225
+ add: `codex mcp add ${SERVER_NAME} --url ${url}/mcp`,
226
+ login: `codex mcp login ${SERVER_NAME}`
227
+ };
228
+ }
229
+ function runCodexClientCommand(command, args) {
230
+ const result = spawnSync(command, args, {
231
+ encoding: "utf8",
232
+ timeout: 3e5,
233
+ // stdout stays live for browser-login instructions. stderr is captured so
234
+ // an existing entry and unsupported CLI version are handled idempotently.
235
+ stdio: ["inherit", "inherit", "pipe"]
236
+ });
237
+ if (result.stderr) process.stderr.write(result.stderr);
238
+ return result;
239
+ }
240
+ function getCodexInstructions(baseUrl) {
241
+ const commands = codexCommands(baseUrl);
242
+ return {
243
+ manual: true,
244
+ steps: [
245
+ "If `codex mcp add --help` does not list `--url`, run `codex update`; if that command is unavailable, update Codex through its original installer or package manager. Confirm `--url` appears before continuing.",
246
+ `Run: ${commands.add}`,
247
+ `Run: ${commands.login}`,
248
+ "Complete Hive browser authorization and approve the requested scopes."
249
+ ]
250
+ };
251
+ }
252
+ function writeCodexConfig(baseUrl, runner = runCodexClientCommand) {
253
+ const url = getServerUrl(baseUrl);
254
+ const commands = codexCommands(baseUrl);
255
+ const addResult = runner("codex", [
256
+ "mcp",
257
+ "add",
258
+ SERVER_NAME,
259
+ "--url",
260
+ `${url}/mcp`
261
+ ]);
262
+ const addStderr = addResult.stderr?.toString().trim();
263
+ const written = addResult.status === 0 || Boolean(addStderr?.match(/already exists/i));
264
+ if (!written) {
265
+ const upgradeRequired = Boolean(
266
+ addStderr?.match(/unexpected argument.*--url|unrecognized.*--url/i)
267
+ );
268
+ return {
269
+ path: getCodexConfigPath(),
270
+ written: false,
271
+ authenticated: false,
272
+ commands,
273
+ error: (upgradeRequired ? "This Codex version cannot add remote HTTP MCP servers. Run `codex update`, or update Codex through its original installer or package manager if self-update is unavailable. Confirm `codex mcp add --help` lists `--url`, then retry." : addStderr) || addResult.error?.message || "Codex CLI is unavailable or rejected the MCP server."
274
+ };
275
+ }
276
+ const loginResult = runner("codex", ["mcp", "login", SERVER_NAME]);
277
+ const loginStderr = loginResult.stderr?.toString().trim();
278
+ const loginUpgradeRequired = Boolean(
279
+ loginStderr?.match(/unrecognized subcommand.*login|unexpected argument.*login/i)
280
+ );
281
+ return {
282
+ path: getCodexConfigPath(),
283
+ written: true,
284
+ authenticated: loginResult.status === 0,
285
+ commands,
286
+ ...loginResult.status === 0 ? {} : {
287
+ error: (loginUpgradeRequired ? "Hive was added, but this Codex version cannot run MCP OAuth login. Run `codex update`, or update Codex through its original installer or package manager if self-update is unavailable, then run `codex mcp login hive`." : loginStderr) || loginResult.error?.message || "Codex installed Hive but native OAuth login did not complete."
288
+ }
289
+ };
290
+ }
291
+ function writeClaudeCodeUserConfig(baseUrl) {
292
+ const url = getServerUrl(baseUrl);
293
+ const p = getClaudeCodeUserConfigPath();
294
+ const existing = readJsonSafe(p);
295
+ const mcpServers = existing.mcpServers || {};
296
+ mcpServers[SERVER_NAME] = {
297
+ type: "http",
298
+ url: `${url}/mcp`
299
+ };
300
+ existing.mcpServers = mcpServers;
301
+ writeJsonSafe(p, existing);
302
+ return { path: p, written: true };
303
+ }
304
+ function writeWindsurfConfig(baseUrl) {
305
+ const url = getServerUrl(baseUrl);
306
+ const p = getWindsurfMcpConfigPath();
307
+ const existing = readJsonSafe(p);
308
+ const mcpServers = existing.mcpServers || {};
309
+ mcpServers[SERVER_NAME] = {
310
+ serverUrl: `${url}/mcp`
311
+ };
312
+ existing.mcpServers = mcpServers;
313
+ writeJsonSafe(p, existing);
314
+ return { path: p, written: true };
315
+ }
316
+ function writeGeminiCliConfig(baseUrl) {
317
+ const url = getServerUrl(baseUrl);
318
+ const p = getGeminiCliSettingsPath();
319
+ const existing = readJsonSafe(p);
320
+ const mcpServers = existing.mcpServers || {};
321
+ mcpServers[SERVER_NAME] = {
322
+ httpUrl: `${url}/mcp`
323
+ };
324
+ existing.mcpServers = mcpServers;
325
+ writeJsonSafe(p, existing);
326
+ return { path: p, written: true };
327
+ }
328
+ function printChatGptDesktopInstructions(baseUrl) {
329
+ const url = getServerUrl(baseUrl);
330
+ return {
331
+ manual: true,
332
+ steps: [
333
+ "In ChatGPT, open Settings > Apps and enable Developer mode if your workspace requires it.",
334
+ "Choose Create app, enter the Hive MCP endpoint, then scan tools.",
335
+ `MCP endpoint: ${url}/mcp`,
336
+ "Complete the Hive OAuth sign-in and approve the requested MCP scopes.",
337
+ "For headless OpenAI API agents, use the Responses API remote MCP tool with HIVE_API_KEY kept server-side."
338
+ ]
339
+ };
340
+ }
341
+ function getGrokInstructions(baseUrl) {
342
+ const url = getServerUrl(baseUrl);
343
+ return {
344
+ manual: true,
345
+ steps: [
346
+ "Open https://grok.com/connectors.",
347
+ "Add a custom MCP connector named Hive.",
348
+ `Use the MCP endpoint ${url}/mcp.`,
349
+ "Complete Hive OAuth and approve the requested scopes."
350
+ ]
351
+ };
352
+ }
353
+ function removeServerEntry(filePath, serversKey) {
354
+ if (!existsSync(filePath)) return { removed: false, path: filePath };
355
+ const existing = readJsonSafe(filePath);
356
+ const servers = existing[serversKey] || {};
357
+ if (!(SERVER_NAME in servers)) return { removed: false, path: filePath };
358
+ delete servers[SERVER_NAME];
359
+ if (Object.keys(servers).length === 0) {
360
+ delete existing[serversKey];
361
+ } else {
362
+ existing[serversKey] = servers;
363
+ }
364
+ writeJsonSafe(filePath, existing);
365
+ return { removed: true, path: filePath };
366
+ }
367
+ function removeClaudeDesktopConfig() {
368
+ return {
369
+ ...removeServerEntry(getClaudeDesktopConfigPath(), "mcpServers"),
370
+ manual: true,
371
+ instructions: "Claude Settings \u2192 Connectors \u2192 Hive \u2192 Disconnect/Remove"
372
+ };
373
+ }
374
+ function removeCursorConfig() {
375
+ return removeServerEntry(getCursorConfigPath(), "mcpServers");
376
+ }
377
+ function removeVscodeConfig() {
378
+ return {
379
+ removed: false,
380
+ path: 'VS Code Command Palette \u2192 "MCP: List Servers" \u2192 Hive \u2192 Uninstall',
381
+ manual: true,
382
+ instructions: 'VS Code Command Palette \u2192 "MCP: List Servers" \u2192 Hive \u2192 Uninstall'
383
+ };
384
+ }
385
+ function removeClaudeCodeUserConfig() {
386
+ return removeServerEntry(getClaudeCodeUserConfigPath(), "mcpServers");
387
+ }
388
+ function removeCodexConfig(runner = (command, args) => spawnSync(command, args, {
389
+ encoding: "utf8",
390
+ timeout: 1e4,
391
+ stdio: ["ignore", "pipe", "pipe"]
392
+ })) {
393
+ const path = getCodexConfigPath();
394
+ if (!existsSync(dirname(path))) return { removed: false, path };
395
+ const result = runner("codex", ["mcp", "remove", SERVER_NAME]);
396
+ if (result.status === 0) return { removed: true, path };
397
+ return {
398
+ removed: false,
399
+ path,
400
+ manual: true,
401
+ instructions: `Run: codex mcp remove ${SERVER_NAME}`
402
+ };
403
+ }
404
+ function removeWindsurfConfig() {
405
+ return removeServerEntry(getWindsurfMcpConfigPath(), "mcpServers");
406
+ }
407
+ function removeGeminiCliConfig() {
408
+ return removeServerEntry(getGeminiCliSettingsPath(), "mcpServers");
409
+ }
410
+
411
+ export {
412
+ configClaudeDesktop,
413
+ getClaudeDesktopInstructions,
414
+ configCursor,
415
+ configVscode,
416
+ configClaudeCode,
417
+ configCodex,
418
+ configGrok,
419
+ configHttpUrl,
420
+ getClaudeDesktopConfigPath,
421
+ getCursorConfigPath,
422
+ getVscodeConfigPath,
423
+ getWindsurfMcpConfigPath,
424
+ getGeminiCliSettingsPath,
425
+ getClaudeCodeUserConfigPath,
426
+ getCodexConfigPath,
427
+ writeClaudeDesktopConfig,
428
+ writeCursorConfig,
429
+ getVscodeInstallDeeplink,
430
+ getVscodeInstructions,
431
+ writeVscodeConfig,
432
+ writeClaudeCodeConfig,
433
+ getCodexInstructions,
434
+ writeCodexConfig,
435
+ writeClaudeCodeUserConfig,
436
+ writeWindsurfConfig,
437
+ writeGeminiCliConfig,
438
+ printChatGptDesktopInstructions,
439
+ getGrokInstructions,
440
+ removeClaudeDesktopConfig,
441
+ removeCursorConfig,
442
+ removeVscodeConfig,
443
+ removeClaudeCodeUserConfig,
444
+ removeCodexConfig,
445
+ removeWindsurfConfig,
446
+ removeGeminiCliConfig
447
+ };
@@ -18,11 +18,13 @@ var ERROR_CODE_TO_EXIT = {
18
18
  TOOL_NOT_FOUND: ExitCode.TOOL_NOT_FOUND,
19
19
  API_ERROR: ExitCode.API_ERROR,
20
20
  PROVIDER_UNAVAILABLE: ExitCode.AUTH_FAILURE,
21
+ AUTH_REQUIRED: ExitCode.AUTH_FAILURE,
21
22
  RATE_LIMITED: ExitCode.RATE_LIMITED,
22
23
  TIMEOUT: ExitCode.TIMEOUT,
23
24
  VALIDATION_ERROR: ExitCode.INVALID_ARGS
24
25
  };
25
26
  var ERROR_DOC_URLS = {
27
+ AUTH_REQUIRED: "https://www.hiveintelligence.xyz/errors#auth-required",
26
28
  RATE_LIMITED: "https://www.hiveintelligence.xyz/errors#rate-limited",
27
29
  TIMEOUT: "https://www.hiveintelligence.xyz/errors#timeout",
28
30
  PROVIDER_UNAVAILABLE: "https://www.hiveintelligence.xyz/errors#provider-unavailable",
@@ -1,12 +1,15 @@
1
1
  import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ CLI_TELEMETRY_CONSENT_COPY
4
+ } from "./chunk-EPF36Q3Z.js";
2
5
  import {
3
6
  SERVER_VERSION
4
- } from "./chunk-ZCU7XQKF.js";
7
+ } from "./chunk-ZXKFJQDE.js";
5
8
  import {
6
9
  ensureConfigDir,
7
10
  getConfig,
8
11
  saveConfig
9
- } from "./chunk-POT2MBEK.js";
12
+ } from "./chunk-6PC3HUAK.js";
10
13
 
11
14
  // src/cli/telemetry.ts
12
15
  import { platform, release } from "os";
@@ -19,13 +22,7 @@ function enableTelemetry() {
19
22
  const config = getConfig();
20
23
  config.telemetry = true;
21
24
  saveConfig(config);
22
- process.stderr.write(
23
- "Telemetry enabled. Thank you for helping improve Hive CLI.\n"
24
- );
25
- process.stderr.write(
26
- "Only command names, duration, and error codes are collected.\n"
27
- );
28
- process.stderr.write("API keys, arguments, and data are never tracked.\n\n");
25
+ process.stderr.write(CLI_TELEMETRY_CONSENT_COPY);
29
26
  }
30
27
  function disableTelemetry() {
31
28
  ensureConfigDir();
@@ -5,7 +5,7 @@ import {
5
5
  getCredentials,
6
6
  saveConfig,
7
7
  saveCredentials
8
- } from "./chunk-POT2MBEK.js";
8
+ } from "./chunk-6PC3HUAK.js";
9
9
 
10
10
  // src/cli/auth.ts
11
11
  import { createInterface } from "readline";
@@ -204,7 +204,7 @@ Profile "${profileName}" saved. Key: ${maskKey(apiKey)}
204
204
  Hive CLI \u2014 Login (profile: ${profileName})
205
205
  `);
206
206
  try {
207
- const { browserLogin } = await import("./browser-auth-VPF5LZMZ.js");
207
+ const { browserLogin } = await import("./browser-auth-OJSUNFBI.js");
208
208
  const apiUrl = process.env.HIVE_API_URL || "https://mcp.hiveintelligence.xyz";
209
209
  const websiteUrl = process.env.HIVE_WEBSITE_URL || "https://hiveintelligence.xyz";
210
210
  const result = await browserLogin({ baseUrl: websiteUrl });
@@ -294,7 +294,7 @@ async function runSwitch(name) {
294
294
  }
295
295
  }
296
296
  async function runSignup(opts) {
297
- const { authSignup } = await import("./api-client-EPF6FD7A.js");
297
+ const { authSignup } = await import("./api-client-FTVDFW5V.js");
298
298
  const profileName = opts.profile ?? "default";
299
299
  process.stderr.write(`
300
300
  Hive CLI \u2014 Signup (profile: ${profileName})
@@ -352,7 +352,7 @@ Account created but no API key was generated.
352
352
  }
353
353
  }
354
354
  async function runKeysList() {
355
- const { listKeysApi } = await import("./api-client-EPF6FD7A.js");
355
+ const { listKeysApi } = await import("./api-client-FTVDFW5V.js");
356
356
  const creds = getCredentials();
357
357
  const config = getConfig();
358
358
  const jwt = creds.profiles[config.activeProfile]?.jwt;
@@ -391,7 +391,7 @@ async function runKeysList() {
391
391
  process.stderr.write("\n");
392
392
  }
393
393
  async function runKeysCreate(opts) {
394
- const { createKey } = await import("./api-client-EPF6FD7A.js");
394
+ const { createKey } = await import("./api-client-FTVDFW5V.js");
395
395
  const creds = getCredentials();
396
396
  const config = getConfig();
397
397
  const jwt = creds.profiles[config.activeProfile]?.jwt;
@@ -424,7 +424,7 @@ API Key: ${data.key}
424
424
  );
425
425
  }
426
426
  async function runKeysRevoke(keyId) {
427
- const { revokeKeyApi } = await import("./api-client-EPF6FD7A.js");
427
+ const { revokeKeyApi } = await import("./api-client-FTVDFW5V.js");
428
428
  const creds = getCredentials();
429
429
  const config = getConfig();
430
430
  const jwt = creds.profiles[config.activeProfile]?.jwt;
@@ -445,11 +445,18 @@ async function runKeysRevoke(keyId) {
445
445
  }
446
446
  }
447
447
  async function runUsage() {
448
- const { getUsage } = await import("./api-client-EPF6FD7A.js");
448
+ const { getUsage } = await import("./api-client-FTVDFW5V.js");
449
449
  const result = await getUsage();
450
450
  if (!result.ok) {
451
- process.stderr.write("Failed to fetch usage. Check your API key.\n");
452
- process.exit(1);
451
+ const { outputError } = await import("./output-ITGLBKIG.js");
452
+ const { CliError, classifyError } = await import("./errors-HGHUF575.js");
453
+ const code = result.error?.code;
454
+ const err = code === "AUTH_REQUIRED" || code === "INVALID_TOKEN" ? new CliError(
455
+ "AUTH_REQUIRED",
456
+ code === "INVALID_TOKEN" ? "API key was rejected \u2014 usage requires a valid account key." : "No API key found \u2014 usage requires an account key.",
457
+ "Run: hive auth login (or set HIVE_API_KEY)"
458
+ ) : classifyError(result.error?.message ?? "Failed to fetch usage");
459
+ await outputError(err, {});
453
460
  }
454
461
  const data = result.data;
455
462
  const plan = data.plan;
@@ -291,65 +291,6 @@ var NAMESPACE = [
291
291
  }
292
292
  ]
293
293
  },
294
- {
295
- name: "social",
296
- description: "Social media analytics \u2014 sentiment, influencers, trending topics",
297
- commands: [
298
- {
299
- name: "trending",
300
- description: "Trending topics",
301
- tool: "get_trending_topics"
302
- },
303
- {
304
- name: "metrics",
305
- description: "Topic engagement metrics",
306
- tool: "get_topic_metrics",
307
- args: {
308
- topic: {
309
- flag: "--topic <name>",
310
- description: "Topic or coin name",
311
- required: true
312
- }
313
- }
314
- },
315
- {
316
- name: "creators",
317
- description: "Top content creators",
318
- tool: "get_topic_creators",
319
- args: {
320
- topic: {
321
- flag: "--topic <name>",
322
- description: "Topic or coin name",
323
- required: true
324
- }
325
- }
326
- },
327
- {
328
- name: "posts",
329
- description: "Social media posts",
330
- tool: "get_topic_posts",
331
- args: {
332
- topic: {
333
- flag: "--topic <name>",
334
- description: "Topic or coin name",
335
- required: true
336
- }
337
- }
338
- },
339
- {
340
- name: "news",
341
- description: "Topic news articles",
342
- tool: "get_topic_news",
343
- args: {
344
- topic: {
345
- flag: "--topic <name>",
346
- description: "Topic or coin name",
347
- required: true
348
- }
349
- }
350
- }
351
- ]
352
- },
353
294
  {
354
295
  name: "exchange",
355
296
  description: "Centralized exchange data \u2014 tickers, orderbooks, trades, funding",