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.
- package/README.md +182 -73
- package/agent-skills/.claude-plugin/plugin.json +4 -4
- package/agent-skills/.mcp.json +1 -4
- package/agent-skills/README.md +16 -10
- package/agent-skills/SKILL.md +30 -12
- package/agent-skills/package.json +1 -1
- package/agent-skills/packs/hive-build/SKILL.md +47 -19
- package/agent-skills/packs/hive-build/evals/evals.json +16 -3
- package/agent-skills/packs/hive-build/evals/triggers.json +50 -0
- package/agent-skills/packs/hive-build-onboarding/SKILL.md +30 -37
- package/agent-skills/packs/hive-build-onboarding/evals/evals.json +1 -1
- package/agent-skills/packs/hive-build-onboarding/evals/triggers.json +50 -0
- package/agent-skills/packs/hive-cli/SKILL.md +33 -35
- package/agent-skills/packs/hive-cli/evals/evals.json +1 -1
- package/agent-skills/packs/hive-cli/evals/triggers.json +50 -0
- package/agent-skills/packs/hive-defi-research/SKILL.md +105 -19
- package/agent-skills/packs/hive-defi-research/evals/evals.json +6 -3
- package/agent-skills/packs/hive-defi-research/evals/triggers.json +50 -0
- package/agent-skills/packs/hive-dex-pool-analysis/SKILL.md +106 -16
- package/agent-skills/packs/hive-dex-pool-analysis/evals/evals.json +5 -3
- package/agent-skills/packs/hive-dex-pool-analysis/evals/triggers.json +50 -0
- package/agent-skills/packs/hive-market-research/SKILL.md +130 -21
- package/agent-skills/packs/hive-market-research/evals/evals.json +15 -2
- package/agent-skills/packs/hive-market-research/evals/triggers.json +50 -0
- package/agent-skills/packs/hive-mcp/SKILL.md +69 -47
- package/agent-skills/packs/hive-mcp/evals/evals.json +3 -2
- package/agent-skills/packs/hive-mcp/evals/triggers.json +50 -0
- package/agent-skills/packs/hive-mcp/references/client-install-matrix.md +62 -35
- package/agent-skills/packs/hive-mcp/references/clients.md +81 -68
- package/agent-skills/packs/hive-network-infrastructure/SKILL.md +105 -20
- package/agent-skills/packs/hive-network-infrastructure/evals/evals.json +4 -2
- package/agent-skills/packs/hive-network-infrastructure/evals/triggers.json +50 -0
- package/agent-skills/packs/hive-nft-research/SKILL.md +105 -18
- package/agent-skills/packs/hive-nft-research/evals/evals.json +4 -2
- package/agent-skills/packs/hive-nft-research/evals/triggers.json +50 -0
- package/agent-skills/packs/hive-prediction-markets/SKILL.md +108 -21
- package/agent-skills/packs/hive-prediction-markets/evals/evals.json +4 -2
- package/agent-skills/packs/hive-prediction-markets/evals/triggers.json +50 -0
- package/agent-skills/packs/hive-query/SKILL.md +79 -33
- package/agent-skills/packs/hive-query/evals/evals.json +7 -5
- package/agent-skills/packs/hive-query/evals/triggers.json +50 -0
- package/agent-skills/packs/hive-query/references/root-mcp-workflow.md +39 -18
- package/agent-skills/packs/hive-security-risk/SKILL.md +110 -19
- package/agent-skills/packs/hive-security-risk/evals/evals.json +4 -2
- package/agent-skills/packs/hive-security-risk/evals/triggers.json +50 -0
- package/agent-skills/packs/hive-solana-analysis/SKILL.md +115 -19
- package/agent-skills/packs/hive-solana-analysis/evals/evals.json +4 -2
- package/agent-skills/packs/hive-solana-analysis/evals/triggers.json +50 -0
- package/agent-skills/packs/hive-stateful-monitoring/SKILL.md +92 -47
- package/agent-skills/packs/hive-stateful-monitoring/evals/evals.json +7 -2
- package/agent-skills/packs/hive-stateful-monitoring/evals/triggers.json +50 -0
- package/agent-skills/packs/hive-stateful-monitoring/references/b2b-subject-context.md +53 -0
- package/agent-skills/packs/hive-token-diligence/SKILL.md +119 -21
- package/agent-skills/packs/hive-token-diligence/evals/evals.json +6 -4
- package/agent-skills/packs/hive-token-diligence/evals/triggers.json +50 -0
- package/agent-skills/packs/hive-tool-discovery/SKILL.md +48 -19
- package/agent-skills/packs/hive-tool-discovery/evals/evals.json +17 -3
- package/agent-skills/packs/hive-tool-discovery/evals/triggers.json +50 -0
- package/agent-skills/packs/hive-tool-discovery/references/discovery-surfaces.md +31 -6
- package/agent-skills/packs/hive-wallet-investigation/SKILL.md +111 -18
- package/agent-skills/packs/hive-wallet-investigation/evals/evals.json +5 -3
- package/agent-skills/packs/hive-wallet-investigation/evals/triggers.json +50 -0
- package/agent-skills/references/agents-routing.md +17 -7
- package/agent-skills/scripts/validate-agent-skills-package.mjs +68 -8
- package/bin/hive-mcp.js +5 -5
- package/build/{alias-3OPMQF4X.js → alias-BKAVOYQV.js} +2 -2
- package/build/api-client-WMWFWXC7.js +16 -0
- package/build/{auth-Q5Q24IRI.js → auth-HRFQWQMZ.js} +3 -11
- package/build/browser-auth-KXIO5BHM.js +20 -0
- package/build/{cache-T6KC5YEY.js → cache-TBDQ7QBU.js} +2 -2
- package/build/chunk-3OZFBWFK.js +180 -0
- package/build/{chunk-POT2MBEK.js → chunk-6PC3HUAK.js} +10 -3
- package/build/{chunk-NP6NSOG2.js → chunk-725R3KLJ.js} +26 -3
- package/build/chunk-7DYHWY4Y.js +125 -0
- package/build/{chunk-ZXB53E7H.js → chunk-AEU43ACS.js} +31 -7
- package/build/chunk-AQQAPAER.js +197 -0
- package/build/chunk-EPF36Q3Z.js +71 -0
- package/build/{upgrade-DTUIHVPS.js → chunk-GHCYCBA3.js} +4 -5
- package/build/{chunk-3WYWXTNN.js → chunk-ILVPOLA7.js} +12 -3
- package/build/{chunk-VBOKVQ74.js → chunk-L326MQZP.js} +6 -5
- package/build/{chunk-FRXMGRZQ.js → chunk-M6REON2I.js} +2 -2
- package/build/{chunk-7JWXBKEJ.js → chunk-P7NLFSZQ.js} +9 -60
- package/build/chunk-QDZ7MAVN.js +447 -0
- package/build/{chunk-ZTJVOWDQ.js → chunk-R6YZTFQL.js} +2 -0
- package/build/{chunk-YZ2PXBJK.js → chunk-RU6QOFHH.js} +6 -9
- package/build/{chunk-FH3YGSY5.js → chunk-TNQ7GJ6Q.js} +0 -59
- package/build/{chunk-5XXI25JE.js → chunk-TVQJY47C.js} +12 -160
- package/build/{chunk-JTUKQWIO.js → chunk-UFTNBCSA.js} +35515 -14994
- package/build/{chunk-ZCU7XQKF.js → chunk-ZXKFJQDE.js} +7 -1
- package/build/cli.js +3342 -3423
- package/build/{completion-46K674EL.js → completion-7KBW243H.js} +4 -4
- package/build/{config-XE6Q5P4I.js → config-KAEUX6RM.js} +23 -3
- package/build/{config-dir-MAWX5AUF.js → config-dir-5IH7MOOT.js} +2 -2
- package/build/{doctor-HGMQE6IN.js → doctor-GHUAUFS2.js} +12 -12
- package/build/{errors-J2PH3NLJ.js → errors-HGHUF575.js} +2 -2
- package/build/{format-5X2HIVDT.js → format-H7FOQSYY.js} +1 -1
- package/build/{init-JMDNM7ZZ.js → init-UCTCUYFA.js} +52 -8
- package/build/init-all-RG542NWG.js +427 -0
- package/build/mcpServer-D7OXUDU5.js +34 -0
- package/build/monitor-worker.js +296 -40
- package/build/{namespace-FSX2G3NM.js → namespace-L5DGCY7K.js} +2 -2
- package/build/{open-5A6ZQMGC.js → open-V2RNA3QT.js} +1 -1
- package/build/{output-V3D4YZ6U.js → output-ITGLBKIG.js} +2 -2
- package/build/release.json +8 -0
- package/build/{serve-AGCOXXFM.js → serve-K3IT7DS4.js} +3 -3
- package/build/server.js +6396 -3220
- package/build/{setup-RMETGJWK.js → setup-PTYFMTK5.js} +60 -55
- package/build/stdio.js +7 -6
- package/build/{telemetry-WCME5XEU.js → telemetry-HPLDYR7U.js} +5 -4
- package/build/{tools-KAB6QBZC.js → tools-D72ZH6P5.js} +15 -15
- package/build/{uninstall-FLJMBBSC.js → uninstall-SAOIPL6K.js} +19 -10
- package/build/{update-check-LNZQK3XA.js → update-check-IEXPOYYR.js} +4 -4
- package/build/upgrade-4S5XT5JG.js +14 -0
- package/build/{version-I6HDAF4L.js → version-Z4HJL4VV.js} +4 -2
- package/build/{watch-YNN255QX.js → watch-IOSRSCFE.js} +8 -7
- package/package.json +73 -35
- package/agent-skills/packs/hive-defi-research/references/workflow.md +0 -41
- package/agent-skills/packs/hive-dex-pool-analysis/references/workflow.md +0 -42
- package/agent-skills/packs/hive-market-research/references/workflow.md +0 -47
- package/agent-skills/packs/hive-network-infrastructure/references/workflow.md +0 -41
- package/agent-skills/packs/hive-nft-research/references/workflow.md +0 -42
- package/agent-skills/packs/hive-prediction-markets/references/workflow.md +0 -42
- package/agent-skills/packs/hive-security-risk/references/workflow.md +0 -46
- package/agent-skills/packs/hive-solana-analysis/references/workflow.md +0 -42
- package/agent-skills/packs/hive-token-diligence/references/workflow.md +0 -45
- package/agent-skills/packs/hive-wallet-investigation/references/workflow.md +0 -45
- package/build/api-client-EPF6FD7A.js +0 -28
- package/build/browser-auth-VPF5LZMZ.js +0 -8
- package/build/chunk-4F5CI6LX.js +0 -340
- package/build/chunk-CEWCB5YS.js +0 -71
- package/build/chunk-GZPDEXO4.js +0 -126
- package/build/chunk-IZPAMRHP.js +0 -43
- package/build/init-all-5SKNV75X.js +0 -273
- package/build/mcpServer-5TKKSKJM.js +0 -21
package/build/chunk-4F5CI6LX.js
DELETED
|
@@ -1,340 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
resolveApiKey,
|
|
4
|
-
resolveApiUrl
|
|
5
|
-
} from "./chunk-POT2MBEK.js";
|
|
6
|
-
|
|
7
|
-
// src/cli/config.ts
|
|
8
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
9
|
-
import { homedir, platform } from "os";
|
|
10
|
-
import { dirname, join } from "path";
|
|
11
|
-
var DEFAULT_URL = "https://mcp.hiveintelligence.xyz";
|
|
12
|
-
var SERVER_NAME = "hive";
|
|
13
|
-
function getServerUrl() {
|
|
14
|
-
return resolveApiUrl() || DEFAULT_URL;
|
|
15
|
-
}
|
|
16
|
-
function getApiKey() {
|
|
17
|
-
return resolveApiKey() || "YOUR_HIVE_API_KEY";
|
|
18
|
-
}
|
|
19
|
-
function authHeader(key) {
|
|
20
|
-
return { Authorization: `Bearer ${key}` };
|
|
21
|
-
}
|
|
22
|
-
function configClaudeDesktop() {
|
|
23
|
-
const url = getServerUrl();
|
|
24
|
-
const key = getApiKey();
|
|
25
|
-
const config = {
|
|
26
|
-
[SERVER_NAME]: {
|
|
27
|
-
url: `${url}/mcp`,
|
|
28
|
-
headers: authHeader(key)
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
const p = getClaudeDesktopConfigPath();
|
|
32
|
-
console.log(
|
|
33
|
-
'\nAdd this to your claude_desktop_config.json under "mcpServers":\n'
|
|
34
|
-
);
|
|
35
|
-
console.log(`Config file: ${p}
|
|
36
|
-
`);
|
|
37
|
-
console.log(JSON.stringify(config, null, 2));
|
|
38
|
-
if (key === "YOUR_HIVE_API_KEY") {
|
|
39
|
-
console.log(
|
|
40
|
-
"\nReplace YOUR_HIVE_API_KEY with your actual key from: hive auth login"
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function configCursor() {
|
|
45
|
-
const url = getServerUrl();
|
|
46
|
-
const key = getApiKey();
|
|
47
|
-
const config = {
|
|
48
|
-
mcpServers: {
|
|
49
|
-
[SERVER_NAME]: {
|
|
50
|
-
url: `${url}/mcp`,
|
|
51
|
-
headers: authHeader(key)
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
console.log("\nAdd to .cursor/mcp.json:\n");
|
|
56
|
-
console.log(JSON.stringify(config, null, 2));
|
|
57
|
-
}
|
|
58
|
-
function configVscode() {
|
|
59
|
-
const url = getServerUrl();
|
|
60
|
-
const config = {
|
|
61
|
-
inputs: [
|
|
62
|
-
{
|
|
63
|
-
type: "promptString",
|
|
64
|
-
id: "hive-api-key",
|
|
65
|
-
description: "Hive API Key (hive_live_...)",
|
|
66
|
-
password: true
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
servers: {
|
|
70
|
-
[SERVER_NAME]: {
|
|
71
|
-
type: "http",
|
|
72
|
-
url: `${url}/mcp`,
|
|
73
|
-
headers: { Authorization: "Bearer ${input:hive-api-key}" }
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
console.log("\nAdd to .vscode/mcp.json:\n");
|
|
78
|
-
console.log(JSON.stringify(config, null, 2));
|
|
79
|
-
}
|
|
80
|
-
function configClaudeCode() {
|
|
81
|
-
const url = getServerUrl();
|
|
82
|
-
const key = getApiKey();
|
|
83
|
-
console.log("\nRun this command:\n");
|
|
84
|
-
console.log(
|
|
85
|
-
`claude mcp add --transport http --header "Authorization: Bearer ${key}" ${SERVER_NAME} ${url}/mcp`
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
function configHttpUrl(url) {
|
|
89
|
-
console.log(`
|
|
90
|
-
Remote MCP server URL: ${url}/mcp`);
|
|
91
|
-
console.log("\nFor Claude Code:");
|
|
92
|
-
console.log(
|
|
93
|
-
` claude mcp add --transport http --header "Authorization: Bearer YOUR_HIVE_API_KEY" ${SERVER_NAME} ${url}/mcp`
|
|
94
|
-
);
|
|
95
|
-
console.log("\nFor Cursor / Claude Desktop:");
|
|
96
|
-
console.log(
|
|
97
|
-
JSON.stringify(
|
|
98
|
-
{
|
|
99
|
-
[SERVER_NAME]: {
|
|
100
|
-
url: `${url}/mcp`,
|
|
101
|
-
headers: authHeader("YOUR_HIVE_API_KEY")
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
null,
|
|
105
|
-
2
|
|
106
|
-
)
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
function readJsonSafe(filePath) {
|
|
110
|
-
if (!existsSync(filePath)) return {};
|
|
111
|
-
const raw = readFileSync(filePath, "utf-8");
|
|
112
|
-
try {
|
|
113
|
-
return JSON.parse(raw);
|
|
114
|
-
} catch {
|
|
115
|
-
throw new Error(
|
|
116
|
-
`Config file at ${filePath} contains invalid JSON. Fix it manually before running setup.`
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
function writeJsonSafe(filePath, data) {
|
|
121
|
-
const dir = dirname(filePath);
|
|
122
|
-
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
123
|
-
writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n", "utf-8");
|
|
124
|
-
}
|
|
125
|
-
function getClaudeDesktopConfigPath() {
|
|
126
|
-
return platform() === "darwin" ? join(
|
|
127
|
-
homedir(),
|
|
128
|
-
"Library",
|
|
129
|
-
"Application Support",
|
|
130
|
-
"Claude",
|
|
131
|
-
"claude_desktop_config.json"
|
|
132
|
-
) : platform() === "win32" ? join(
|
|
133
|
-
homedir(),
|
|
134
|
-
"AppData",
|
|
135
|
-
"Roaming",
|
|
136
|
-
"Claude",
|
|
137
|
-
"claude_desktop_config.json"
|
|
138
|
-
) : join(homedir(), ".config", "Claude", "claude_desktop_config.json");
|
|
139
|
-
}
|
|
140
|
-
function getCursorConfigPath() {
|
|
141
|
-
return join(homedir(), ".cursor", "mcp.json");
|
|
142
|
-
}
|
|
143
|
-
function getVscodeConfigPath() {
|
|
144
|
-
return join(homedir(), ".vscode", "mcp.json");
|
|
145
|
-
}
|
|
146
|
-
function getWindsurfMcpConfigPath() {
|
|
147
|
-
return join(homedir(), ".codeium", "windsurf", "mcp_config.json");
|
|
148
|
-
}
|
|
149
|
-
function getGeminiCliSettingsPath() {
|
|
150
|
-
return join(homedir(), ".gemini", "settings.json");
|
|
151
|
-
}
|
|
152
|
-
function getClaudeCodeUserConfigPath() {
|
|
153
|
-
return join(homedir(), ".claude.json");
|
|
154
|
-
}
|
|
155
|
-
function writeClaudeDesktopConfig() {
|
|
156
|
-
const url = getServerUrl();
|
|
157
|
-
const key = getApiKey();
|
|
158
|
-
const p = getClaudeDesktopConfigPath();
|
|
159
|
-
if (key === "YOUR_HIVE_API_KEY") {
|
|
160
|
-
return { path: p, written: false };
|
|
161
|
-
}
|
|
162
|
-
const existing = readJsonSafe(p);
|
|
163
|
-
const mcpServers = existing.mcpServers || {};
|
|
164
|
-
mcpServers[SERVER_NAME] = {
|
|
165
|
-
url: `${url}/mcp`,
|
|
166
|
-
headers: authHeader(key)
|
|
167
|
-
};
|
|
168
|
-
existing.mcpServers = mcpServers;
|
|
169
|
-
writeJsonSafe(p, existing);
|
|
170
|
-
return { path: p, written: true };
|
|
171
|
-
}
|
|
172
|
-
function writeCursorConfig() {
|
|
173
|
-
const url = getServerUrl();
|
|
174
|
-
const key = getApiKey();
|
|
175
|
-
const p = getCursorConfigPath();
|
|
176
|
-
if (key === "YOUR_HIVE_API_KEY") {
|
|
177
|
-
return { path: p, written: false };
|
|
178
|
-
}
|
|
179
|
-
const existing = readJsonSafe(p);
|
|
180
|
-
const mcpServers = existing.mcpServers || {};
|
|
181
|
-
mcpServers[SERVER_NAME] = {
|
|
182
|
-
url: `${url}/mcp`,
|
|
183
|
-
headers: authHeader(key)
|
|
184
|
-
};
|
|
185
|
-
existing.mcpServers = mcpServers;
|
|
186
|
-
writeJsonSafe(p, existing);
|
|
187
|
-
return { path: p, written: true };
|
|
188
|
-
}
|
|
189
|
-
function writeVscodeConfig() {
|
|
190
|
-
const url = getServerUrl();
|
|
191
|
-
const key = getApiKey();
|
|
192
|
-
const p = getVscodeConfigPath();
|
|
193
|
-
if (key === "YOUR_HIVE_API_KEY") {
|
|
194
|
-
return { path: p, written: false };
|
|
195
|
-
}
|
|
196
|
-
const existing = readJsonSafe(p);
|
|
197
|
-
const servers = existing.servers || {};
|
|
198
|
-
servers[SERVER_NAME] = {
|
|
199
|
-
type: "http",
|
|
200
|
-
url: `${url}/mcp`,
|
|
201
|
-
headers: authHeader(key)
|
|
202
|
-
};
|
|
203
|
-
existing.servers = servers;
|
|
204
|
-
writeJsonSafe(p, existing);
|
|
205
|
-
return { path: p, written: true };
|
|
206
|
-
}
|
|
207
|
-
function writeClaudeCodeConfig() {
|
|
208
|
-
const url = getServerUrl();
|
|
209
|
-
const key = getApiKey();
|
|
210
|
-
return {
|
|
211
|
-
command: `claude mcp add --transport http --header "Authorization: Bearer ${key}" ${SERVER_NAME} ${url}/mcp`
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
function writeClaudeCodeUserConfig() {
|
|
215
|
-
const url = getServerUrl();
|
|
216
|
-
const key = getApiKey();
|
|
217
|
-
const p = getClaudeCodeUserConfigPath();
|
|
218
|
-
if (key === "YOUR_HIVE_API_KEY") {
|
|
219
|
-
return { path: p, written: false };
|
|
220
|
-
}
|
|
221
|
-
const existing = readJsonSafe(p);
|
|
222
|
-
const mcpServers = existing.mcpServers || {};
|
|
223
|
-
mcpServers[SERVER_NAME] = {
|
|
224
|
-
type: "http",
|
|
225
|
-
url: `${url}/mcp`,
|
|
226
|
-
headers: authHeader(key)
|
|
227
|
-
};
|
|
228
|
-
existing.mcpServers = mcpServers;
|
|
229
|
-
writeJsonSafe(p, existing);
|
|
230
|
-
return { path: p, written: true };
|
|
231
|
-
}
|
|
232
|
-
function writeWindsurfConfig() {
|
|
233
|
-
const url = getServerUrl();
|
|
234
|
-
const key = getApiKey();
|
|
235
|
-
const p = getWindsurfMcpConfigPath();
|
|
236
|
-
if (key === "YOUR_HIVE_API_KEY") {
|
|
237
|
-
return { path: p, written: false };
|
|
238
|
-
}
|
|
239
|
-
const existing = readJsonSafe(p);
|
|
240
|
-
const mcpServers = existing.mcpServers || {};
|
|
241
|
-
mcpServers[SERVER_NAME] = {
|
|
242
|
-
url: `${url}/mcp`,
|
|
243
|
-
headers: authHeader(key)
|
|
244
|
-
};
|
|
245
|
-
existing.mcpServers = mcpServers;
|
|
246
|
-
writeJsonSafe(p, existing);
|
|
247
|
-
return { path: p, written: true };
|
|
248
|
-
}
|
|
249
|
-
function writeGeminiCliConfig() {
|
|
250
|
-
const url = getServerUrl();
|
|
251
|
-
const key = getApiKey();
|
|
252
|
-
const p = getGeminiCliSettingsPath();
|
|
253
|
-
if (key === "YOUR_HIVE_API_KEY") {
|
|
254
|
-
return { path: p, written: false };
|
|
255
|
-
}
|
|
256
|
-
const existing = readJsonSafe(p);
|
|
257
|
-
const mcpServers = existing.mcpServers || {};
|
|
258
|
-
mcpServers[SERVER_NAME] = {
|
|
259
|
-
url: `${url}/mcp`,
|
|
260
|
-
headers: authHeader(key)
|
|
261
|
-
};
|
|
262
|
-
existing.mcpServers = mcpServers;
|
|
263
|
-
writeJsonSafe(p, existing);
|
|
264
|
-
return { path: p, written: true };
|
|
265
|
-
}
|
|
266
|
-
function printChatGptDesktopInstructions() {
|
|
267
|
-
const url = getServerUrl();
|
|
268
|
-
const key = getApiKey();
|
|
269
|
-
const keyLabel = key === "YOUR_HIVE_API_KEY" ? "<YOUR_HIVE_API_KEY>" : key;
|
|
270
|
-
return {
|
|
271
|
-
manual: true,
|
|
272
|
-
steps: [
|
|
273
|
-
"Recommended: use OpenAI Responses API with a remote MCP tool",
|
|
274
|
-
`server_url: ${url}/mcp`,
|
|
275
|
-
`authorization: ${keyLabel}`,
|
|
276
|
-
"Direct ChatGPT app connectors may require OAuth/CIMD; Hive has not shipped OAuth yet.",
|
|
277
|
-
"For ChatGPT app testing, put an OAuth-compatible proxy in front of Hive and inject the Hive key server-side."
|
|
278
|
-
]
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
function removeServerEntry(filePath, serversKey) {
|
|
282
|
-
if (!existsSync(filePath)) return { removed: false, path: filePath };
|
|
283
|
-
const existing = readJsonSafe(filePath);
|
|
284
|
-
const servers = existing[serversKey] || {};
|
|
285
|
-
if (!(SERVER_NAME in servers)) return { removed: false, path: filePath };
|
|
286
|
-
delete servers[SERVER_NAME];
|
|
287
|
-
if (Object.keys(servers).length === 0) {
|
|
288
|
-
delete existing[serversKey];
|
|
289
|
-
} else {
|
|
290
|
-
existing[serversKey] = servers;
|
|
291
|
-
}
|
|
292
|
-
writeJsonSafe(filePath, existing);
|
|
293
|
-
return { removed: true, path: filePath };
|
|
294
|
-
}
|
|
295
|
-
function removeClaudeDesktopConfig() {
|
|
296
|
-
return removeServerEntry(getClaudeDesktopConfigPath(), "mcpServers");
|
|
297
|
-
}
|
|
298
|
-
function removeCursorConfig() {
|
|
299
|
-
return removeServerEntry(getCursorConfigPath(), "mcpServers");
|
|
300
|
-
}
|
|
301
|
-
function removeVscodeConfig() {
|
|
302
|
-
return removeServerEntry(getVscodeConfigPath(), "servers");
|
|
303
|
-
}
|
|
304
|
-
function removeClaudeCodeUserConfig() {
|
|
305
|
-
return removeServerEntry(getClaudeCodeUserConfigPath(), "mcpServers");
|
|
306
|
-
}
|
|
307
|
-
function removeWindsurfConfig() {
|
|
308
|
-
return removeServerEntry(getWindsurfMcpConfigPath(), "mcpServers");
|
|
309
|
-
}
|
|
310
|
-
function removeGeminiCliConfig() {
|
|
311
|
-
return removeServerEntry(getGeminiCliSettingsPath(), "mcpServers");
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
export {
|
|
315
|
-
configClaudeDesktop,
|
|
316
|
-
configCursor,
|
|
317
|
-
configVscode,
|
|
318
|
-
configClaudeCode,
|
|
319
|
-
configHttpUrl,
|
|
320
|
-
getClaudeDesktopConfigPath,
|
|
321
|
-
getCursorConfigPath,
|
|
322
|
-
getVscodeConfigPath,
|
|
323
|
-
getWindsurfMcpConfigPath,
|
|
324
|
-
getGeminiCliSettingsPath,
|
|
325
|
-
getClaudeCodeUserConfigPath,
|
|
326
|
-
writeClaudeDesktopConfig,
|
|
327
|
-
writeCursorConfig,
|
|
328
|
-
writeVscodeConfig,
|
|
329
|
-
writeClaudeCodeConfig,
|
|
330
|
-
writeClaudeCodeUserConfig,
|
|
331
|
-
writeWindsurfConfig,
|
|
332
|
-
writeGeminiCliConfig,
|
|
333
|
-
printChatGptDesktopInstructions,
|
|
334
|
-
removeClaudeDesktopConfig,
|
|
335
|
-
removeCursorConfig,
|
|
336
|
-
removeVscodeConfig,
|
|
337
|
-
removeClaudeCodeUserConfig,
|
|
338
|
-
removeWindsurfConfig,
|
|
339
|
-
removeGeminiCliConfig
|
|
340
|
-
};
|
package/build/chunk-CEWCB5YS.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
createToolNotFoundResult,
|
|
4
|
-
executeEndpoint,
|
|
5
|
-
getAllWrappedEndpoints,
|
|
6
|
-
getSharedClients,
|
|
7
|
-
resolveEndpoint,
|
|
8
|
-
secureLogger
|
|
9
|
-
} from "./chunk-JTUKQWIO.js";
|
|
10
|
-
|
|
11
|
-
// src/services/tool-execution.ts
|
|
12
|
-
async function executeToolByName(toolName, args) {
|
|
13
|
-
const allEndpoints = getAllWrappedEndpoints();
|
|
14
|
-
const lookup = resolveEndpoint(allEndpoints, toolName);
|
|
15
|
-
if (!lookup.ok) {
|
|
16
|
-
const result2 = createToolNotFoundResult(toolName);
|
|
17
|
-
secureLogger.toolCall(toolName, false, result2.durationMs, {
|
|
18
|
-
transport: "rest",
|
|
19
|
-
runtimeStatus: "failing",
|
|
20
|
-
errorClass: "not_found"
|
|
21
|
-
});
|
|
22
|
-
return {
|
|
23
|
-
ok: false,
|
|
24
|
-
error: result2.error,
|
|
25
|
-
durationMs: result2.durationMs,
|
|
26
|
-
meta: result2.hive
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
const result = await executeEndpoint(lookup.endpoint, args, {
|
|
30
|
-
transport: "rest",
|
|
31
|
-
clients: getSharedClients()
|
|
32
|
-
});
|
|
33
|
-
if (result.validationErrors) {
|
|
34
|
-
return {
|
|
35
|
-
ok: false,
|
|
36
|
-
error: result.error,
|
|
37
|
-
validationErrors: result.validationErrors,
|
|
38
|
-
durationMs: result.durationMs,
|
|
39
|
-
meta: result.hive
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
if (result.ok) {
|
|
43
|
-
return {
|
|
44
|
-
ok: true,
|
|
45
|
-
data: result.data,
|
|
46
|
-
durationMs: result.durationMs,
|
|
47
|
-
meta: result.hive
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
if (result.error?.code === "PROVIDER_UNAVAILABLE") {
|
|
51
|
-
return {
|
|
52
|
-
ok: false,
|
|
53
|
-
error: result.error,
|
|
54
|
-
durationMs: result.durationMs,
|
|
55
|
-
meta: result.hive
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
if (result.error?.code === "INTERNAL_ERROR") {
|
|
59
|
-
secureLogger.error(`[tool-execution] ${toolName} threw`, result.error, {});
|
|
60
|
-
}
|
|
61
|
-
return {
|
|
62
|
-
ok: false,
|
|
63
|
-
error: result.error,
|
|
64
|
-
durationMs: result.durationMs,
|
|
65
|
-
meta: result.hive
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export {
|
|
70
|
-
executeToolByName
|
|
71
|
-
};
|
package/build/chunk-GZPDEXO4.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/cli/browser-auth.ts
|
|
4
|
-
import { createServer } from "http";
|
|
5
|
-
import { randomBytes } from "crypto";
|
|
6
|
-
import { execFile } from "child_process";
|
|
7
|
-
import { platform } from "os";
|
|
8
|
-
function openBrowser(url) {
|
|
9
|
-
const plat = platform();
|
|
10
|
-
let cmd;
|
|
11
|
-
let args;
|
|
12
|
-
if (plat === "darwin") {
|
|
13
|
-
cmd = "open";
|
|
14
|
-
args = [url];
|
|
15
|
-
} else if (plat === "win32") {
|
|
16
|
-
cmd = "cmd";
|
|
17
|
-
args = ["/c", "start", "", url];
|
|
18
|
-
} else {
|
|
19
|
-
cmd = "xdg-open";
|
|
20
|
-
args = [url];
|
|
21
|
-
}
|
|
22
|
-
execFile(cmd, args, (err) => {
|
|
23
|
-
if (err) process.stderr.write(`
|
|
24
|
-
Open this URL manually:
|
|
25
|
-
${url}
|
|
26
|
-
|
|
27
|
-
`);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
async function browserLogin(opts) {
|
|
31
|
-
const baseUrl = opts.baseUrl || "https://hiveintelligence.xyz";
|
|
32
|
-
const timeout = opts.timeout || 3e5;
|
|
33
|
-
const state = randomBytes(16).toString("hex");
|
|
34
|
-
return new Promise((resolve, reject) => {
|
|
35
|
-
let settled = false;
|
|
36
|
-
const server = createServer((req, res) => {
|
|
37
|
-
const url = new URL(req.url || "/", `http://localhost`);
|
|
38
|
-
if (url.pathname !== "/callback") {
|
|
39
|
-
res.writeHead(404);
|
|
40
|
-
res.end("Not found");
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
if (settled) {
|
|
44
|
-
res.writeHead(200);
|
|
45
|
-
res.end();
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const key = url.searchParams.get("key");
|
|
49
|
-
const email = url.searchParams.get("email");
|
|
50
|
-
const returnedState = url.searchParams.get("state");
|
|
51
|
-
if (returnedState !== state) {
|
|
52
|
-
res.writeHead(403);
|
|
53
|
-
res.end("State mismatch \u2014 possible CSRF attack. Please try again.");
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
if (!key) {
|
|
57
|
-
res.writeHead(400);
|
|
58
|
-
res.end("Missing API key in callback");
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
settled = true;
|
|
62
|
-
res.writeHead(200, { "Content-Type": "text/html" });
|
|
63
|
-
res.end(`<!DOCTYPE html>
|
|
64
|
-
<html>
|
|
65
|
-
<head><title>Hive CLI \u2014 Authenticated</title>
|
|
66
|
-
<style>
|
|
67
|
-
body { font-family: -apple-system, BlinkMacSystemFont, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background: #0a0a0a; color: #fafafa; }
|
|
68
|
-
.card { text-align: center; padding: 2rem; }
|
|
69
|
-
h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
|
|
70
|
-
p { color: #888; }
|
|
71
|
-
</style>
|
|
72
|
-
</head>
|
|
73
|
-
<body>
|
|
74
|
-
<div class="card">
|
|
75
|
-
<h1>Authenticated</h1>
|
|
76
|
-
<p>You can close this tab and return to the terminal.</p>
|
|
77
|
-
</div>
|
|
78
|
-
</body>
|
|
79
|
-
</html>`);
|
|
80
|
-
clearTimeout(timer);
|
|
81
|
-
server.close();
|
|
82
|
-
resolve({ key, email: email || "", state: returnedState });
|
|
83
|
-
});
|
|
84
|
-
server.listen(0, "127.0.0.1", () => {
|
|
85
|
-
const addr = server.address();
|
|
86
|
-
if (!addr || typeof addr === "string") {
|
|
87
|
-
reject(new Error("Failed to start local server"));
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
const port = addr.port;
|
|
91
|
-
const loginUrl = new URL("/auth/cli", baseUrl);
|
|
92
|
-
loginUrl.searchParams.set("callback_port", String(port));
|
|
93
|
-
loginUrl.searchParams.set("state", state);
|
|
94
|
-
process.stderr.write(`
|
|
95
|
-
Opening browser to sign in...
|
|
96
|
-
`);
|
|
97
|
-
process.stderr.write(
|
|
98
|
-
`If the browser doesn't open, visit:
|
|
99
|
-
${loginUrl.toString()}
|
|
100
|
-
|
|
101
|
-
`
|
|
102
|
-
);
|
|
103
|
-
openBrowser(loginUrl.toString());
|
|
104
|
-
});
|
|
105
|
-
const timer = setTimeout(() => {
|
|
106
|
-
if (settled) return;
|
|
107
|
-
settled = true;
|
|
108
|
-
server.close();
|
|
109
|
-
reject(
|
|
110
|
-
new Error(
|
|
111
|
-
"Login timed out after 5 minutes. Run: hive auth login --manual"
|
|
112
|
-
)
|
|
113
|
-
);
|
|
114
|
-
}, timeout);
|
|
115
|
-
server.on("error", (err) => {
|
|
116
|
-
if (settled) return;
|
|
117
|
-
settled = true;
|
|
118
|
-
clearTimeout(timer);
|
|
119
|
-
reject(err);
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export {
|
|
125
|
-
browserLogin
|
|
126
|
-
};
|
package/build/chunk-IZPAMRHP.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
executeRemoteTool
|
|
4
|
-
} from "./chunk-7JWXBKEJ.js";
|
|
5
|
-
import {
|
|
6
|
-
trackCommand
|
|
7
|
-
} from "./chunk-YZ2PXBJK.js";
|
|
8
|
-
import {
|
|
9
|
-
debug,
|
|
10
|
-
shouldOutputJson,
|
|
11
|
-
writeOutput
|
|
12
|
-
} from "./chunk-NP6NSOG2.js";
|
|
13
|
-
|
|
14
|
-
// src/cli/execute.ts
|
|
15
|
-
import ora from "ora";
|
|
16
|
-
async function executeTool(toolName, args, timeoutMs = 3e4) {
|
|
17
|
-
debug(`Executing ${toolName} remotely`);
|
|
18
|
-
const showSpinner = !shouldOutputJson() && !!process.stderr.isTTY;
|
|
19
|
-
const spinner = showSpinner ? ora({ text: `Calling ${toolName}...`, stream: process.stderr }).start() : null;
|
|
20
|
-
const startMs = Date.now();
|
|
21
|
-
let response;
|
|
22
|
-
try {
|
|
23
|
-
response = await executeRemoteTool(toolName, args, timeoutMs);
|
|
24
|
-
spinner?.succeed(`${toolName} (${Date.now() - startMs}ms)`);
|
|
25
|
-
} catch (err) {
|
|
26
|
-
spinner?.fail(`${toolName} failed (${Date.now() - startMs}ms)`);
|
|
27
|
-
throw err;
|
|
28
|
-
}
|
|
29
|
-
trackCommand(
|
|
30
|
-
toolName,
|
|
31
|
-
Date.now() - startMs,
|
|
32
|
-
response.ok ? void 0 : response.error?.code
|
|
33
|
-
);
|
|
34
|
-
await writeOutput(response);
|
|
35
|
-
if (!response.ok) {
|
|
36
|
-
const exitCode = response.error?.code === "TOOL_NOT_FOUND" ? 3 : response.error?.code === "PROVIDER_UNAVAILABLE" ? 5 : response.error?.code === "RATE_LIMITED" ? 6 : response.error?.code === "TIMEOUT" ? 124 : 4;
|
|
37
|
-
process.exit(exitCode);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export {
|
|
42
|
-
executeTool
|
|
43
|
-
};
|