hive-intelligence 1.1.3 → 1.1.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.
- package/LICENSE +23 -0
- package/README.md +175 -54
- package/agent-skills/.claude-plugin/plugin.json +6 -0
- package/agent-skills/.mcp.json +11 -0
- package/agent-skills/AGENTS.md +37 -0
- package/agent-skills/README.md +13 -14
- package/agent-skills/SKILL.md +16 -4
- package/agent-skills/evals/trigger-queries.json +270 -0
- package/agent-skills/package.json +3 -3
- package/agent-skills/packs/hive-build/SKILL.md +11 -10
- package/agent-skills/packs/hive-build/evals/evals.json +2 -2
- package/agent-skills/packs/hive-mcp/SKILL.md +44 -121
- package/agent-skills/packs/hive-mcp/evals/evals.json +1 -1
- package/agent-skills/packs/hive-mcp/references/client-install-matrix.md +1 -1
- package/agent-skills/packs/hive-mcp/references/clients.md +141 -0
- package/agent-skills/packs/hive-query/SKILL.md +3 -2
- package/agent-skills/packs/hive-query/references/root-mcp-workflow.md +1 -1
- package/agent-skills/packs/hive-stateful-monitoring/SKILL.md +75 -0
- package/agent-skills/packs/hive-stateful-monitoring/evals/evals.json +49 -0
- package/agent-skills/packs/hive-tool-discovery/SKILL.md +1 -1
- package/agent-skills/references/agents-routing.md +2 -0
- package/agent-skills/scripts/validate-agent-skills-package.mjs +49 -11
- package/agent-skills/skills.sh.json +3 -2
- package/build/{alias-CZ3DEYHF.js → alias-3OPMQF4X.js} +2 -3
- package/build/{api-client-I23XLSHU.js → api-client-EPF6FD7A.js} +4 -4
- package/build/{auth-KKINNBXT.js → auth-Q5Q24IRI.js} +3 -4
- package/build/{browser-auth-EEFGRHWY.js → browser-auth-VPF5LZMZ.js} +2 -3
- package/build/{cache-EGNMENNA.js → cache-T6KC5YEY.js} +2 -3
- package/build/{chunk-KBVPIZS4.js → chunk-3WYWXTNN.js} +0 -1
- package/build/{chunk-2MYMHMBF.js → chunk-4F5CI6LX.js} +6 -6
- package/build/{chunk-RKICZ6DZ.js → chunk-5XXI25JE.js} +7 -8
- package/build/{chunk-IZTN7WFH.js → chunk-7JWXBKEJ.js} +5 -3
- package/build/chunk-CEWCB5YS.js +71 -0
- package/build/{chunk-MPIUUE3T.js → chunk-FH3YGSY5.js} +0 -1
- package/build/{chunk-QNCI4DEB.js → chunk-FRXMGRZQ.js} +35 -21
- package/build/{chunk-PGBVNMNZ.js → chunk-GZPDEXO4.js} +0 -1
- package/build/{chunk-UKHZIVDT.js → chunk-IZPAMRHP.js} +5 -6
- package/build/{chunk-2X3U4DFK.js → chunk-JTUKQWIO.js} +3267 -916
- package/build/{chunk-XYBEFFZ3.js → chunk-NP6NSOG2.js} +1 -2
- package/build/{chunk-V77LO4RO.js → chunk-POT2MBEK.js} +0 -1
- package/build/{chunk-B6G222LS.js → chunk-VBOKVQ74.js} +18 -3
- package/build/{chunk-DYJBTKNR.js → chunk-YZ2PXBJK.js} +5 -3
- package/build/chunk-ZCU7XQKF.js +14 -0
- package/build/{chunk-KGYBTXIN.js → chunk-ZTJVOWDQ.js} +0 -1
- package/build/{chunk-IDZD2NVG.js → chunk-ZXB53E7H.js} +5 -6
- package/build/cli.js +56 -54
- package/build/{completion-BELZL7ND.js → completion-46K674EL.js} +2 -3
- package/build/{config-TDX4VUGW.js → config-XE6Q5P4I.js} +3 -4
- package/build/{config-dir-V43W2WIA.js → config-dir-MAWX5AUF.js} +2 -3
- package/build/{doctor-5K5UWHNX.js → doctor-HGMQE6IN.js} +33 -9
- package/build/{errors-E6MVUBNA.js → errors-J2PH3NLJ.js} +2 -3
- package/build/{format-TSFSI2K7.js → format-5X2HIVDT.js} +1 -2
- package/build/{init-YQ5NBICF.js → init-JMDNM7ZZ.js} +1 -2
- package/build/{init-all-6OWEQALB.js → init-all-5SKNV75X.js} +10 -11
- package/build/{mcpServer-AEX3RQ4U.js → mcpServer-5TKKSKJM.js} +7 -6
- package/build/monitor-worker.js +1140 -0
- package/build/{namespace-PVHBFDW2.js → namespace-FSX2G3NM.js} +2 -3
- package/build/{open-YUIJP37F.js → open-5A6ZQMGC.js} +2 -3
- package/build/{output-IYJBFCYK.js → output-V3D4YZ6U.js} +2 -3
- package/build/{serve-KWNJK6EY.js → serve-AGCOXXFM.js} +9 -4
- package/build/server.js +437 -145
- package/build/{setup-YTUKMPNP.js → setup-RMETGJWK.js} +4 -5
- package/build/stdio.js +9 -8
- package/build/{telemetry-5IPRKZBL.js → telemetry-WCME5XEU.js} +4 -4
- package/build/{tools-PJHWFCAG.js → tools-KAB6QBZC.js} +15 -15
- package/build/{uninstall-HWXEIP6K.js → uninstall-FLJMBBSC.js} +7 -8
- package/build/update-check-LNZQK3XA.js +18 -0
- package/build/upgrade-DTUIHVPS.js +171 -0
- package/build/version-I6HDAF4L.js +14 -0
- package/build/{watch-KZ5EDZK3.js → watch-YNN255QX.js} +7 -7
- package/package.json +14 -9
- package/build/alias-CZ3DEYHF.js.map +0 -1
- package/build/api-client-I23XLSHU.js.map +0 -1
- package/build/auth-KKINNBXT.js.map +0 -1
- package/build/browser-auth-EEFGRHWY.js.map +0 -1
- package/build/cache-EGNMENNA.js.map +0 -1
- package/build/chunk-2MYMHMBF.js.map +0 -1
- package/build/chunk-2X3U4DFK.js.map +0 -1
- package/build/chunk-B6G222LS.js.map +0 -1
- package/build/chunk-DYJBTKNR.js.map +0 -1
- package/build/chunk-IDZD2NVG.js.map +0 -1
- package/build/chunk-IZTN7WFH.js.map +0 -1
- package/build/chunk-KBVPIZS4.js.map +0 -1
- package/build/chunk-KGYBTXIN.js.map +0 -1
- package/build/chunk-MPIUUE3T.js.map +0 -1
- package/build/chunk-PGBVNMNZ.js.map +0 -1
- package/build/chunk-QNCI4DEB.js.map +0 -1
- package/build/chunk-RKICZ6DZ.js.map +0 -1
- package/build/chunk-UKHZIVDT.js.map +0 -1
- package/build/chunk-V77LO4RO.js.map +0 -1
- package/build/chunk-XYBEFFZ3.js.map +0 -1
- package/build/cli.js.map +0 -1
- package/build/completion-BELZL7ND.js.map +0 -1
- package/build/config-TDX4VUGW.js.map +0 -1
- package/build/config-dir-V43W2WIA.js.map +0 -1
- package/build/doctor-5K5UWHNX.js.map +0 -1
- package/build/errors-E6MVUBNA.js.map +0 -1
- package/build/format-TSFSI2K7.js.map +0 -1
- package/build/init-YQ5NBICF.js.map +0 -1
- package/build/init-all-6OWEQALB.js.map +0 -1
- package/build/mcpServer-AEX3RQ4U.js.map +0 -1
- package/build/namespace-PVHBFDW2.js.map +0 -1
- package/build/open-YUIJP37F.js.map +0 -1
- package/build/output-IYJBFCYK.js.map +0 -1
- package/build/serve-KWNJK6EY.js.map +0 -1
- package/build/server.js.map +0 -1
- package/build/setup-YTUKMPNP.js.map +0 -1
- package/build/stdio.js.map +0 -1
- package/build/telemetry-5IPRKZBL.js.map +0 -1
- package/build/tools-PJHWFCAG.js.map +0 -1
- package/build/uninstall-HWXEIP6K.js.map +0 -1
- package/build/watch-KZ5EDZK3.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
resolveApiKey
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-POT2MBEK.js";
|
|
5
|
+
import "./chunk-3WYWXTNN.js";
|
|
6
6
|
|
|
7
7
|
// src/cli/setup.ts
|
|
8
8
|
import { createInterface } from "readline";
|
|
@@ -16,7 +16,7 @@ async function runSetup(client) {
|
|
|
16
16
|
const apiKey = resolveApiKey();
|
|
17
17
|
if (!apiKey) {
|
|
18
18
|
process.stderr.write("\nNo API key found. Let's log in first.\n");
|
|
19
|
-
const { runLogin } = await import("./auth-
|
|
19
|
+
const { runLogin } = await import("./auth-Q5Q24IRI.js");
|
|
20
20
|
await runLogin({ manual: false });
|
|
21
21
|
}
|
|
22
22
|
let selectedClient;
|
|
@@ -54,7 +54,7 @@ async function runSetup(client) {
|
|
|
54
54
|
writeCursorConfig,
|
|
55
55
|
writeVscodeConfig,
|
|
56
56
|
writeClaudeCodeConfig
|
|
57
|
-
} = await import("./config-
|
|
57
|
+
} = await import("./config-XE6Q5P4I.js");
|
|
58
58
|
switch (selectedClient) {
|
|
59
59
|
case "claude-desktop": {
|
|
60
60
|
const result = writeClaudeDesktopConfig();
|
|
@@ -133,4 +133,3 @@ async function runSetup(client) {
|
|
|
133
133
|
export {
|
|
134
134
|
runSetup
|
|
135
135
|
};
|
|
136
|
-
//# sourceMappingURL=setup-YTUKMPNP.js.map
|
package/build/stdio.js
CHANGED
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
checkForUpdates
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FRXMGRZQ.js";
|
|
6
6
|
import {
|
|
7
|
-
SERVER_NAME,
|
|
8
|
-
SERVER_VERSION,
|
|
9
7
|
createHiveMcpServer,
|
|
10
8
|
secureLogger
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import
|
|
14
|
-
|
|
9
|
+
} from "./chunk-JTUKQWIO.js";
|
|
10
|
+
import "./chunk-VBOKVQ74.js";
|
|
11
|
+
import {
|
|
12
|
+
SERVER_NAME,
|
|
13
|
+
SERVER_VERSION
|
|
14
|
+
} from "./chunk-ZCU7XQKF.js";
|
|
15
|
+
import "./chunk-POT2MBEK.js";
|
|
16
|
+
import "./chunk-3WYWXTNN.js";
|
|
15
17
|
|
|
16
18
|
// src/stdio.ts
|
|
17
19
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
@@ -28,4 +30,3 @@ main().catch((error) => {
|
|
|
28
30
|
secureLogger.error("Failed to start Hive MCP stdio server", error);
|
|
29
31
|
process.exit(1);
|
|
30
32
|
});
|
|
31
|
-
//# sourceMappingURL=stdio.js.map
|
|
@@ -5,9 +5,10 @@ import {
|
|
|
5
5
|
isTelemetryEnabled,
|
|
6
6
|
telemetryStatus,
|
|
7
7
|
trackCommand
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-YZ2PXBJK.js";
|
|
9
|
+
import "./chunk-ZCU7XQKF.js";
|
|
10
|
+
import "./chunk-POT2MBEK.js";
|
|
11
|
+
import "./chunk-3WYWXTNN.js";
|
|
11
12
|
export {
|
|
12
13
|
disableTelemetry,
|
|
13
14
|
enableTelemetry,
|
|
@@ -15,4 +16,3 @@ export {
|
|
|
15
16
|
telemetryStatus,
|
|
16
17
|
trackCommand
|
|
17
18
|
};
|
|
18
|
-
//# sourceMappingURL=telemetry-5IPRKZBL.js.map
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
fetchToolCatalog
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7JWXBKEJ.js";
|
|
5
|
+
import "./chunk-ZCU7XQKF.js";
|
|
5
6
|
import {
|
|
6
7
|
info,
|
|
7
8
|
shouldOutputJson,
|
|
8
9
|
successEnvelope,
|
|
9
10
|
writeOutput
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-NP6NSOG2.js";
|
|
12
|
+
import "./chunk-POT2MBEK.js";
|
|
13
|
+
import "./chunk-3WYWXTNN.js";
|
|
13
14
|
|
|
14
15
|
// src/cli/tools.ts
|
|
15
16
|
async function loadToolCatalog() {
|
|
16
|
-
const { getCachedTools, setCachedTools } = await import("./cache-
|
|
17
|
+
const { getCachedTools, setCachedTools } = await import("./cache-T6KC5YEY.js");
|
|
17
18
|
const cached = getCachedTools();
|
|
18
19
|
if (cached) return cached;
|
|
19
20
|
const response = await fetchToolCatalog();
|
|
20
21
|
if (!response.ok) {
|
|
21
22
|
const msg = response.error && typeof response.error === "object" && "message" in response.error ? String(response.error.message) : "Failed to fetch tool catalog";
|
|
22
|
-
const { CliError } = await import("./errors-
|
|
23
|
-
const { outputError } = await import("./output-
|
|
23
|
+
const { CliError } = await import("./errors-J2PH3NLJ.js");
|
|
24
|
+
const { outputError } = await import("./output-V3D4YZ6U.js");
|
|
24
25
|
await outputError(
|
|
25
26
|
new CliError("API_ERROR", msg, "Check: hive doctor"),
|
|
26
27
|
{}
|
|
@@ -39,7 +40,7 @@ async function listTools(opts) {
|
|
|
39
40
|
tools = tools.filter((t) => t.name.toLowerCase().startsWith(prefix + "_"));
|
|
40
41
|
}
|
|
41
42
|
if (opts.category) {
|
|
42
|
-
const { NAMESPACE } = await import("./namespace-
|
|
43
|
+
const { NAMESPACE } = await import("./namespace-FSX2G3NM.js");
|
|
43
44
|
const cat = opts.category.toLowerCase();
|
|
44
45
|
const ns = NAMESPACE.find(
|
|
45
46
|
(d) => d.name === cat || d.description.toLowerCase().includes(cat)
|
|
@@ -73,7 +74,7 @@ async function listTools(opts) {
|
|
|
73
74
|
await writeOutput(successEnvelope(data, {}));
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
|
-
const { table } = await import("./format-
|
|
77
|
+
const { table } = await import("./format-5X2HIVDT.js");
|
|
77
78
|
const rangeStart = totalFiltered === 0 ? 0 : offset + 1;
|
|
78
79
|
const rangeEnd = offset + items.length;
|
|
79
80
|
info(`
|
|
@@ -102,7 +103,7 @@ async function searchTools(query) {
|
|
|
102
103
|
await writeOutput(successEnvelope(data, {}));
|
|
103
104
|
return;
|
|
104
105
|
}
|
|
105
|
-
const { table } = await import("./format-
|
|
106
|
+
const { table } = await import("./format-5X2HIVDT.js");
|
|
106
107
|
info(`
|
|
107
108
|
${matches.length} matches for "${query}"
|
|
108
109
|
`);
|
|
@@ -121,8 +122,8 @@ async function toolInfo(name) {
|
|
|
121
122
|
const allTools = await loadToolCatalog();
|
|
122
123
|
const tool = allTools.find((t2) => t2.name === name);
|
|
123
124
|
if (!tool) {
|
|
124
|
-
const { CliError, suggestSimilarTools } = await import("./errors-
|
|
125
|
-
const { outputError } = await import("./output-
|
|
125
|
+
const { CliError, suggestSimilarTools } = await import("./errors-J2PH3NLJ.js");
|
|
126
|
+
const { outputError } = await import("./output-V3D4YZ6U.js");
|
|
126
127
|
const similar = suggestSimilarTools(
|
|
127
128
|
name,
|
|
128
129
|
allTools.map((t2) => t2.name)
|
|
@@ -161,8 +162,8 @@ ${t.description}
|
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
164
|
async function refreshTools() {
|
|
164
|
-
const { clearCache } = await import("./cache-
|
|
165
|
-
const { info: printInfo } = await import("./output-
|
|
165
|
+
const { clearCache } = await import("./cache-T6KC5YEY.js");
|
|
166
|
+
const { info: printInfo } = await import("./output-V3D4YZ6U.js");
|
|
166
167
|
clearCache();
|
|
167
168
|
printInfo("Cache cleared. Fetching fresh tool catalog...\n");
|
|
168
169
|
const tools = await loadToolCatalog();
|
|
@@ -175,4 +176,3 @@ export {
|
|
|
175
176
|
searchTools,
|
|
176
177
|
toolInfo
|
|
177
178
|
};
|
|
178
|
-
//# sourceMappingURL=tools-PJHWFCAG.js.map
|
|
@@ -2,7 +2,7 @@ import { createRequire } from 'node:module'; const require = createRequire(impor
|
|
|
2
2
|
import {
|
|
3
3
|
detectClients,
|
|
4
4
|
removeSkillsForClients
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZXB53E7H.js";
|
|
6
6
|
import {
|
|
7
7
|
removeClaudeCodeUserConfig,
|
|
8
8
|
removeClaudeDesktopConfig,
|
|
@@ -10,16 +10,16 @@ import {
|
|
|
10
10
|
removeGeminiCliConfig,
|
|
11
11
|
removeVscodeConfig,
|
|
12
12
|
removeWindsurfConfig
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-4F5CI6LX.js";
|
|
14
|
+
import "./chunk-VBOKVQ74.js";
|
|
15
15
|
import {
|
|
16
16
|
bold,
|
|
17
17
|
dim,
|
|
18
18
|
green,
|
|
19
19
|
yellow
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-NP6NSOG2.js";
|
|
21
|
+
import "./chunk-POT2MBEK.js";
|
|
22
|
+
import "./chunk-3WYWXTNN.js";
|
|
23
23
|
|
|
24
24
|
// src/cli/uninstall.ts
|
|
25
25
|
function w(line) {
|
|
@@ -57,7 +57,7 @@ async function runUninstall(opts = {}) {
|
|
|
57
57
|
const clientIds = [];
|
|
58
58
|
for (const c of clients) {
|
|
59
59
|
if (c.id === "chatgpt-desktop") {
|
|
60
|
-
info("ChatGPT
|
|
60
|
+
info("OpenAI / ChatGPT apps \u2014 remove any proxy or app connector manually");
|
|
61
61
|
continue;
|
|
62
62
|
}
|
|
63
63
|
if (summary.dryRun) {
|
|
@@ -112,4 +112,3 @@ async function runUninstall(opts = {}) {
|
|
|
112
112
|
export {
|
|
113
113
|
runUninstall
|
|
114
114
|
};
|
|
115
|
-
//# sourceMappingURL=uninstall-HWXEIP6K.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
checkForUpdates,
|
|
4
|
+
fetchLatestVersion,
|
|
5
|
+
getPendingUpdateVersion,
|
|
6
|
+
isNewerVersion,
|
|
7
|
+
shouldSkipUpdateCheck
|
|
8
|
+
} from "./chunk-FRXMGRZQ.js";
|
|
9
|
+
import "./chunk-ZCU7XQKF.js";
|
|
10
|
+
import "./chunk-POT2MBEK.js";
|
|
11
|
+
import "./chunk-3WYWXTNN.js";
|
|
12
|
+
export {
|
|
13
|
+
checkForUpdates,
|
|
14
|
+
fetchLatestVersion,
|
|
15
|
+
getPendingUpdateVersion,
|
|
16
|
+
isNewerVersion,
|
|
17
|
+
shouldSkipUpdateCheck
|
|
18
|
+
};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
fetchLatestVersion,
|
|
4
|
+
isNewerVersion
|
|
5
|
+
} from "./chunk-FRXMGRZQ.js";
|
|
6
|
+
import {
|
|
7
|
+
REGISTRY_PACKAGE,
|
|
8
|
+
SERVER_VERSION
|
|
9
|
+
} from "./chunk-ZCU7XQKF.js";
|
|
10
|
+
import {
|
|
11
|
+
info,
|
|
12
|
+
shouldOutputJson,
|
|
13
|
+
successEnvelope,
|
|
14
|
+
writeOutput
|
|
15
|
+
} from "./chunk-NP6NSOG2.js";
|
|
16
|
+
import "./chunk-POT2MBEK.js";
|
|
17
|
+
import "./chunk-3WYWXTNN.js";
|
|
18
|
+
|
|
19
|
+
// src/cli/upgrade.ts
|
|
20
|
+
import { spawnSync } from "child_process";
|
|
21
|
+
import { readdirSync, rmSync, existsSync } from "fs";
|
|
22
|
+
import { join } from "path";
|
|
23
|
+
import { homedir } from "os";
|
|
24
|
+
import { fileURLToPath } from "url";
|
|
25
|
+
function detectInstallMode(execPath, cwd = process.cwd()) {
|
|
26
|
+
const p = execPath.replace(/\\/g, "/");
|
|
27
|
+
if (p.includes("/_npx/")) return "npx";
|
|
28
|
+
if (p.includes("/lib/node_modules/")) return "global";
|
|
29
|
+
const c = cwd.replace(/\\/g, "/");
|
|
30
|
+
if (p.includes("/node_modules/") && !p.startsWith(c)) return "global";
|
|
31
|
+
return "local";
|
|
32
|
+
}
|
|
33
|
+
function resolveExecPath() {
|
|
34
|
+
try {
|
|
35
|
+
return fileURLToPath(import.meta.url);
|
|
36
|
+
} catch {
|
|
37
|
+
return process.argv[1] ?? "";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function npxCacheDir() {
|
|
41
|
+
const base = process.env.npm_config_cache || join(homedir(), ".npm");
|
|
42
|
+
return join(base, "_npx");
|
|
43
|
+
}
|
|
44
|
+
function bustNpxCache() {
|
|
45
|
+
const dir = npxCacheDir();
|
|
46
|
+
if (!existsSync(dir)) return 0;
|
|
47
|
+
let cleared = 0;
|
|
48
|
+
let entries = [];
|
|
49
|
+
try {
|
|
50
|
+
entries = readdirSync(dir);
|
|
51
|
+
} catch {
|
|
52
|
+
return 0;
|
|
53
|
+
}
|
|
54
|
+
for (const entry of entries) {
|
|
55
|
+
const pkgPath = join(dir, entry, "node_modules", REGISTRY_PACKAGE);
|
|
56
|
+
if (existsSync(pkgPath)) {
|
|
57
|
+
try {
|
|
58
|
+
rmSync(join(dir, entry), { recursive: true, force: true });
|
|
59
|
+
cleared++;
|
|
60
|
+
} catch {
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return cleared;
|
|
65
|
+
}
|
|
66
|
+
function updateGlobal() {
|
|
67
|
+
const result = spawnSync(
|
|
68
|
+
"npm",
|
|
69
|
+
["install", "-g", `${REGISTRY_PACKAGE}@latest`],
|
|
70
|
+
{ stdio: shouldOutputJson() ? "ignore" : "inherit" }
|
|
71
|
+
);
|
|
72
|
+
return result.status === 0;
|
|
73
|
+
}
|
|
74
|
+
async function runUpgrade() {
|
|
75
|
+
const mode = detectInstallMode(resolveExecPath());
|
|
76
|
+
const latest = await fetchLatestVersion(8e3);
|
|
77
|
+
const actions = [];
|
|
78
|
+
if (latest === null) {
|
|
79
|
+
if (shouldOutputJson()) {
|
|
80
|
+
await writeOutput(
|
|
81
|
+
successEnvelope(
|
|
82
|
+
{
|
|
83
|
+
current: SERVER_VERSION,
|
|
84
|
+
latest: null,
|
|
85
|
+
updateAvailable: false,
|
|
86
|
+
mode,
|
|
87
|
+
actions,
|
|
88
|
+
note: "Could not reach the npm registry to check for updates."
|
|
89
|
+
},
|
|
90
|
+
{}
|
|
91
|
+
)
|
|
92
|
+
);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
info(
|
|
96
|
+
"Could not reach the npm registry to check for updates. Try again later.\n"
|
|
97
|
+
);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const updateAvailable = isNewerVersion(latest, SERVER_VERSION);
|
|
101
|
+
if (!updateAvailable) {
|
|
102
|
+
if (shouldOutputJson()) {
|
|
103
|
+
await writeOutput(
|
|
104
|
+
successEnvelope(
|
|
105
|
+
{
|
|
106
|
+
current: SERVER_VERSION,
|
|
107
|
+
latest,
|
|
108
|
+
updateAvailable: false,
|
|
109
|
+
mode,
|
|
110
|
+
actions
|
|
111
|
+
},
|
|
112
|
+
{}
|
|
113
|
+
)
|
|
114
|
+
);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
info(`Hive is up to date (v${SERVER_VERSION}).
|
|
118
|
+
`);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (mode === "global") {
|
|
122
|
+
const ok = updateGlobal();
|
|
123
|
+
actions.push(ok ? "updated global install" : "global update failed");
|
|
124
|
+
}
|
|
125
|
+
const cleared = bustNpxCache();
|
|
126
|
+
if (cleared > 0)
|
|
127
|
+
actions.push(
|
|
128
|
+
`cleared ${cleared} npx cache entr${cleared === 1 ? "y" : "ies"}`
|
|
129
|
+
);
|
|
130
|
+
if (shouldOutputJson()) {
|
|
131
|
+
await writeOutput(
|
|
132
|
+
successEnvelope(
|
|
133
|
+
{
|
|
134
|
+
current: SERVER_VERSION,
|
|
135
|
+
latest,
|
|
136
|
+
updateAvailable: true,
|
|
137
|
+
mode,
|
|
138
|
+
actions
|
|
139
|
+
},
|
|
140
|
+
{}
|
|
141
|
+
)
|
|
142
|
+
);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
info(`
|
|
146
|
+
Update available: ${SERVER_VERSION} -> ${latest}
|
|
147
|
+
`);
|
|
148
|
+
if (mode === "global") {
|
|
149
|
+
info(
|
|
150
|
+
actions.includes("updated global install") ? `Updated global hive-intelligence to ${latest}.
|
|
151
|
+
` : `Global update failed \u2014 run: npm install -g ${REGISTRY_PACKAGE}@latest
|
|
152
|
+
`
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
if (cleared > 0) {
|
|
156
|
+
info(`Cleared npx cache so the next run pulls ${latest}.
|
|
157
|
+
`);
|
|
158
|
+
}
|
|
159
|
+
if (mode === "local") {
|
|
160
|
+
info(
|
|
161
|
+
"Running from a local checkout \u2014 pull the latest source with git instead.\n"
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
info(
|
|
165
|
+
"Restart your MCP client (Claude, Cursor, VS Code) to load the new version.\n"
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
export {
|
|
169
|
+
detectInstallMode,
|
|
170
|
+
runUpgrade
|
|
171
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
CLI_BINARY,
|
|
4
|
+
REGISTRY_PACKAGE,
|
|
5
|
+
SERVER_NAME,
|
|
6
|
+
SERVER_VERSION
|
|
7
|
+
} from "./chunk-ZCU7XQKF.js";
|
|
8
|
+
import "./chunk-3WYWXTNN.js";
|
|
9
|
+
export {
|
|
10
|
+
CLI_BINARY,
|
|
11
|
+
REGISTRY_PACKAGE,
|
|
12
|
+
SERVER_NAME,
|
|
13
|
+
SERVER_VERSION
|
|
14
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
executeTool
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-IZPAMRHP.js";
|
|
5
|
+
import "./chunk-7JWXBKEJ.js";
|
|
6
|
+
import "./chunk-YZ2PXBJK.js";
|
|
7
|
+
import "./chunk-ZCU7XQKF.js";
|
|
8
|
+
import "./chunk-NP6NSOG2.js";
|
|
9
|
+
import "./chunk-POT2MBEK.js";
|
|
10
|
+
import "./chunk-3WYWXTNN.js";
|
|
10
11
|
|
|
11
12
|
// src/cli/watch.ts
|
|
12
13
|
var MAX_CONSECUTIVE_FAILURES = 10;
|
|
@@ -64,4 +65,3 @@ Aborting watch: ${MAX_CONSECUTIVE_FAILURES} consecutive failures.
|
|
|
64
65
|
export {
|
|
65
66
|
runWatch
|
|
66
67
|
};
|
|
67
|
-
//# sourceMappingURL=watch-KZ5EDZK3.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hive-intelligence",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "Crypto MCP server and CLI for AI agents:
|
|
3
|
+
"version": "1.1.4",
|
|
4
|
+
"description": "Crypto MCP server and CLI for AI agents: 369 tools for market data, wallets, DeFi, DEX, NFTs, token risk, Solana, prediction markets, and stateful monitoring.",
|
|
5
5
|
"mcpName": "io.github.sharpe-labs/hive-mcp",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"workspaces": [
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"packages/*"
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "tsup && chmod 755 build/server.js build/stdio.js build/cli.js",
|
|
13
|
-
"build:client": "npm --workspace
|
|
12
|
+
"build": "tsup && chmod 755 build/server.js build/stdio.js build/cli.js build/monitor-worker.js",
|
|
13
|
+
"build:client": "npm --workspace hive-mcp-client run build",
|
|
14
14
|
"check": "npm run build && npm run typecheck && npm run env:render:check && npx tsx scripts/verify-tools.ts && npm run verify:toolsets && npm run verify:agent-skills && npm run measure-tokens -- --threshold=10000 && npm run test:unit && npm run test:mcp-compliance && npm run test:audit",
|
|
15
15
|
"typecheck": "tsc --noEmit",
|
|
16
16
|
"prepare": "npm run build",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"start": "cross-env SERVER_MODE=MCP tsx src/stdio.ts",
|
|
22
22
|
"dev": "cross-env SERVER_MODE=MCP tsx src/stdio.ts",
|
|
23
23
|
"test": "vitest run",
|
|
24
|
-
"test:client": "npm --workspace
|
|
24
|
+
"test:client": "npm --workspace hive-mcp-client run test",
|
|
25
25
|
"test:watch": "vitest",
|
|
26
26
|
"test:coverage": "vitest run --coverage",
|
|
27
27
|
"test:unit": "vitest run tests/unit",
|
|
@@ -55,6 +55,11 @@
|
|
|
55
55
|
"verify:toolsets": "tsx scripts/verify-toolsets.ts",
|
|
56
56
|
"verify:agent-skills": "tsx scripts/verify-agent-skills.ts && npm --workspace @hiveintelligence/agent-skills run validate",
|
|
57
57
|
"export:toolsets": "tsx scripts/export-task-toolsets.ts",
|
|
58
|
+
"skills:sync": "tsx scripts/sync-public-skills.ts",
|
|
59
|
+
"sdk:sync": "tsx scripts/sync-public-sdk.ts",
|
|
60
|
+
"monitors:run": "tsx src/monitor-worker.ts",
|
|
61
|
+
"smoke:stateful-monitoring": "tsx scripts/smoke-stateful-monitoring.ts",
|
|
62
|
+
"smoke:b2b-partner": "tsx scripts/smoke-b2b-partner-adoption.ts",
|
|
58
63
|
"canary:toolsets": "tsx scripts/run-task-canaries.ts",
|
|
59
64
|
"canary:discovery": "tsx scripts/check-public-discovery.ts"
|
|
60
65
|
},
|
|
@@ -92,14 +97,14 @@
|
|
|
92
97
|
"rest-api"
|
|
93
98
|
],
|
|
94
99
|
"author": "Hive Intelligence",
|
|
95
|
-
"license": "
|
|
100
|
+
"license": "UNLICENSED",
|
|
96
101
|
"repository": {
|
|
97
102
|
"type": "git",
|
|
98
|
-
"url": "git+https://github.com/
|
|
103
|
+
"url": "git+https://github.com/hive-intel/hive-sdk.git"
|
|
99
104
|
},
|
|
100
105
|
"homepage": "https://hiveintelligence.xyz",
|
|
101
106
|
"bugs": {
|
|
102
|
-
"url": "https://github.com/
|
|
107
|
+
"url": "https://github.com/hive-intel/hive-sdk/issues"
|
|
103
108
|
},
|
|
104
109
|
"engines": {
|
|
105
110
|
"node": ">=20.0.0"
|
|
@@ -112,7 +117,7 @@
|
|
|
112
117
|
"@supabase/supabase-js": "^2.104.1",
|
|
113
118
|
"@types/compression": "^1.8.1",
|
|
114
119
|
"@unkey/api": "2.3.3",
|
|
115
|
-
"axios": "^1.
|
|
120
|
+
"axios": "^1.16.1",
|
|
116
121
|
"ccxt": "4.5.50",
|
|
117
122
|
"commander": "^14.0.3",
|
|
118
123
|
"compression": "^1.8.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/alias.ts"],"sourcesContent":["import { getConfig, saveConfig, ensureConfigDir } from \"./config-dir.js\";\n\nexport function getAliases(): Record<string, string> {\n return getConfig().aliases ?? {};\n}\n\nexport function setAlias(name: string, command: string): void {\n ensureConfigDir();\n const config = getConfig();\n config.aliases = { ...config.aliases, [name]: command };\n saveConfig(config);\n}\n\nexport function removeAlias(name: string): void {\n const config = getConfig();\n const { [name]: _, ...rest } = config.aliases;\n config.aliases = rest;\n saveConfig(config);\n}\n\n/**\n * If argv[2] matches an alias, expand it in-place.\n * Extra flags after the alias are appended.\n * Returns a new argv array (never mutates the original).\n */\nexport function expandAlias(argv: string[]): string[] {\n if (argv.length < 3) return argv;\n const aliases = getAliases();\n const candidate = argv[2];\n const expansion = aliases[candidate];\n if (!expansion) return argv;\n const expandedParts = expansion.split(/\\s+/);\n const trailing = argv.slice(3);\n return [argv[0], argv[1], ...expandedParts, ...trailing];\n}\n"],"mappings":";;;;;;;;;AAEO,SAAS,aAAqC;AACnD,SAAO,UAAU,EAAE,WAAW,CAAC;AACjC;AAEO,SAAS,SAAS,MAAc,SAAuB;AAC5D,kBAAgB;AAChB,QAAM,SAAS,UAAU;AACzB,SAAO,UAAU,EAAE,GAAG,OAAO,SAAS,CAAC,IAAI,GAAG,QAAQ;AACtD,aAAW,MAAM;AACnB;AAEO,SAAS,YAAY,MAAoB;AAC9C,QAAM,SAAS,UAAU;AACzB,QAAM,EAAE,CAAC,IAAI,GAAG,GAAG,GAAG,KAAK,IAAI,OAAO;AACtC,SAAO,UAAU;AACjB,aAAW,MAAM;AACnB;AAOO,SAAS,YAAY,MAA0B;AACpD,MAAI,KAAK,SAAS,EAAG,QAAO;AAC5B,QAAM,UAAU,WAAW;AAC3B,QAAM,YAAY,KAAK,CAAC;AACxB,QAAM,YAAY,QAAQ,SAAS;AACnC,MAAI,CAAC,UAAW,QAAO;AACvB,QAAM,gBAAgB,UAAU,MAAM,KAAK;AAC3C,QAAM,WAAW,KAAK,MAAM,CAAC;AAC7B,SAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,GAAG,eAAe,GAAG,QAAQ;AACzD;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/cache.ts"],"sourcesContent":["import { existsSync, unlinkSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport {\n getConfigDir,\n ensureConfigDir,\n readJsonFile,\n writeJsonFile,\n} from \"./config-dir.js\";\n\nconst DEFAULT_TTL_MS = 300_000; // 5 minutes\n\ninterface CacheEntry {\n fetchedAt: string;\n data: unknown[];\n}\n\nfunction getCachePath(): string {\n return join(getConfigDir(), \"cache\", \"tools.json\");\n}\n\nfunction getTtlMs(): number {\n const envTtl = process.env.HIVE_CACHE_TTL_MS;\n if (envTtl) {\n const parsed = parseInt(envTtl, 10);\n if (!isNaN(parsed) && parsed > 0) return parsed;\n }\n return DEFAULT_TTL_MS;\n}\n\nexport function getCachedTools(): unknown[] | null {\n const path = getCachePath();\n const entry = readJsonFile<CacheEntry>(path);\n if (!entry || !entry.fetchedAt || !Array.isArray(entry.data)) return null;\n\n const age = Date.now() - new Date(entry.fetchedAt).getTime();\n if (age > getTtlMs()) return null;\n\n return entry.data;\n}\n\nexport function setCachedTools(data: unknown[]): void {\n ensureConfigDir();\n const entry: CacheEntry = {\n fetchedAt: new Date().toISOString(),\n data,\n };\n writeJsonFile(getCachePath(), entry);\n}\n\nexport function clearCache(): void {\n const path = getCachePath();\n if (existsSync(path)) unlinkSync(path);\n const updatePath = join(getConfigDir(), \"cache\", \"update-check.json\");\n if (existsSync(updatePath)) unlinkSync(updatePath);\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAS,YAAY,kBAAkB;AACvC,SAAS,YAAY;AAQrB,IAAM,iBAAiB;AAOvB,SAAS,eAAuB;AAC9B,SAAO,KAAK,aAAa,GAAG,SAAS,YAAY;AACnD;AAEA,SAAS,WAAmB;AAC1B,QAAM,SAAS,QAAQ,IAAI;AAC3B,MAAI,QAAQ;AACV,UAAM,SAAS,SAAS,QAAQ,EAAE;AAClC,QAAI,CAAC,MAAM,MAAM,KAAK,SAAS,EAAG,QAAO;AAAA,EAC3C;AACA,SAAO;AACT;AAEO,SAAS,iBAAmC;AACjD,QAAM,OAAO,aAAa;AAC1B,QAAM,QAAQ,aAAyB,IAAI;AAC3C,MAAI,CAAC,SAAS,CAAC,MAAM,aAAa,CAAC,MAAM,QAAQ,MAAM,IAAI,EAAG,QAAO;AAErE,QAAM,MAAM,KAAK,IAAI,IAAI,IAAI,KAAK,MAAM,SAAS,EAAE,QAAQ;AAC3D,MAAI,MAAM,SAAS,EAAG,QAAO;AAE7B,SAAO,MAAM;AACf;AAEO,SAAS,eAAe,MAAuB;AACpD,kBAAgB;AAChB,QAAM,QAAoB;AAAA,IACxB,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,IAClC;AAAA,EACF;AACA,gBAAc,aAAa,GAAG,KAAK;AACrC;AAEO,SAAS,aAAmB;AACjC,QAAM,OAAO,aAAa;AAC1B,MAAI,WAAW,IAAI,EAAG,YAAW,IAAI;AACrC,QAAM,aAAa,KAAK,aAAa,GAAG,SAAS,mBAAmB;AACpE,MAAI,WAAW,UAAU,EAAG,YAAW,UAAU;AACnD;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/config.ts"],"sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { homedir, platform } from \"node:os\";\nimport { dirname, join } from \"node:path\";\nimport { resolveApiKey, resolveApiUrl } from \"./config-dir.js\";\n\nconst DEFAULT_URL = \"https://mcp.hiveintelligence.xyz\";\nconst SERVER_NAME = \"hive\";\n\nfunction getServerUrl(): string {\n return resolveApiUrl() || DEFAULT_URL;\n}\n\nfunction getApiKey(): string {\n return resolveApiKey() || \"YOUR_HIVE_API_KEY\";\n}\n\nfunction authHeader(key: string): Record<string, string> {\n return { Authorization: `Bearer ${key}` };\n}\n\n// ─── Print-only functions (display config to stdout) ────────────────\n\nexport function configClaudeDesktop(): void {\n const url = getServerUrl();\n const key = getApiKey();\n const config = {\n [SERVER_NAME]: {\n url: `${url}/mcp`,\n headers: authHeader(key),\n },\n };\n const p = getClaudeDesktopConfigPath();\n console.log(\n '\\nAdd this to your claude_desktop_config.json under \"mcpServers\":\\n',\n );\n console.log(`Config file: ${p}\\n`);\n console.log(JSON.stringify(config, null, 2));\n if (key === \"YOUR_HIVE_API_KEY\") {\n console.log(\n \"\\nReplace YOUR_HIVE_API_KEY with your actual key from: hive auth login\",\n );\n }\n}\n\nexport function configCursor(): void {\n const url = getServerUrl();\n const key = getApiKey();\n const config = {\n mcpServers: {\n [SERVER_NAME]: {\n url: `${url}/mcp`,\n headers: authHeader(key),\n },\n },\n };\n console.log(\"\\nAdd to .cursor/mcp.json:\\n\");\n console.log(JSON.stringify(config, null, 2));\n}\n\nexport function configVscode(): void {\n const url = getServerUrl();\n const config = {\n inputs: [\n {\n type: \"promptString\",\n id: \"hive-api-key\",\n description: \"Hive API Key (hive_live_...)\",\n password: true,\n },\n ],\n servers: {\n [SERVER_NAME]: {\n type: \"http\",\n url: `${url}/mcp`,\n headers: { Authorization: \"Bearer ${input:hive-api-key}\" },\n },\n },\n };\n console.log(\"\\nAdd to .vscode/mcp.json:\\n\");\n console.log(JSON.stringify(config, null, 2));\n}\n\nexport function configClaudeCode(): void {\n const url = getServerUrl();\n const key = getApiKey();\n console.log(\"\\nRun this command:\\n\");\n console.log(\n `claude mcp add --transport http --header \"Authorization: Bearer ${key}\" ${SERVER_NAME} ${url}/mcp`,\n );\n}\n\nexport function configHttpUrl(url: string): void {\n console.log(`\\nRemote MCP server URL: ${url}/mcp`);\n console.log(\"\\nFor Claude Code:\");\n console.log(\n ` claude mcp add --transport http --header \"Authorization: Bearer YOUR_HIVE_API_KEY\" ${SERVER_NAME} ${url}/mcp`,\n );\n console.log(\"\\nFor Cursor / Claude Desktop:\");\n console.log(\n JSON.stringify(\n {\n [SERVER_NAME]: {\n url: `${url}/mcp`,\n headers: authHeader(\"YOUR_HIVE_API_KEY\"),\n },\n },\n null,\n 2,\n ),\n );\n}\n\n// ─── Config file paths ──────────────────────────────────────────────\n\nfunction readJsonSafe(filePath: string): Record<string, unknown> {\n if (!existsSync(filePath)) return {};\n const raw = readFileSync(filePath, \"utf-8\");\n try {\n return JSON.parse(raw) as Record<string, unknown>;\n } catch {\n throw new Error(\n `Config file at ${filePath} contains invalid JSON. Fix it manually before running setup.`,\n );\n }\n}\n\nfunction writeJsonSafe(filePath: string, data: unknown): void {\n const dir = dirname(filePath);\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n writeFileSync(filePath, JSON.stringify(data, null, 2) + \"\\n\", \"utf-8\");\n}\n\nexport function getClaudeDesktopConfigPath(): string {\n return platform() === \"darwin\"\n ? join(\n homedir(),\n \"Library\",\n \"Application Support\",\n \"Claude\",\n \"claude_desktop_config.json\",\n )\n : platform() === \"win32\"\n ? join(\n homedir(),\n \"AppData\",\n \"Roaming\",\n \"Claude\",\n \"claude_desktop_config.json\",\n )\n : join(homedir(), \".config\", \"Claude\", \"claude_desktop_config.json\");\n}\n\nexport function getCursorConfigPath(): string {\n return join(homedir(), \".cursor\", \"mcp.json\");\n}\n\nexport function getVscodeConfigPath(): string {\n return join(homedir(), \".vscode\", \"mcp.json\");\n}\n\nexport function getWindsurfMcpConfigPath(): string {\n return join(homedir(), \".codeium\", \"windsurf\", \"mcp_config.json\");\n}\n\nexport function getGeminiCliSettingsPath(): string {\n return join(homedir(), \".gemini\", \"settings.json\");\n}\n\nexport function getClaudeCodeUserConfigPath(): string {\n return join(homedir(), \".claude.json\");\n}\n\n// ─── Write functions (merge into existing config) ───────────────────\n\nexport function writeClaudeDesktopConfig(): {\n path: string;\n written: boolean;\n} {\n const url = getServerUrl();\n const key = getApiKey();\n const p = getClaudeDesktopConfigPath();\n\n if (key === \"YOUR_HIVE_API_KEY\") {\n return { path: p, written: false };\n }\n\n const existing = readJsonSafe(p);\n const mcpServers = (existing.mcpServers || {}) as Record<string, unknown>;\n mcpServers[SERVER_NAME] = {\n url: `${url}/mcp`,\n headers: authHeader(key),\n };\n existing.mcpServers = mcpServers;\n writeJsonSafe(p, existing);\n return { path: p, written: true };\n}\n\nexport function writeCursorConfig(): { path: string; written: boolean } {\n const url = getServerUrl();\n const key = getApiKey();\n const p = getCursorConfigPath();\n\n if (key === \"YOUR_HIVE_API_KEY\") {\n return { path: p, written: false };\n }\n\n const existing = readJsonSafe(p);\n const mcpServers = (existing.mcpServers || {}) as Record<string, unknown>;\n mcpServers[SERVER_NAME] = {\n url: `${url}/mcp`,\n headers: authHeader(key),\n };\n existing.mcpServers = mcpServers;\n writeJsonSafe(p, existing);\n return { path: p, written: true };\n}\n\nexport function writeVscodeConfig(): { path: string; written: boolean } {\n const url = getServerUrl();\n const key = getApiKey();\n const p = getVscodeConfigPath();\n\n if (key === \"YOUR_HIVE_API_KEY\") {\n return { path: p, written: false };\n }\n\n const existing = readJsonSafe(p);\n const servers = (existing.servers || {}) as Record<string, unknown>;\n servers[SERVER_NAME] = {\n type: \"http\",\n url: `${url}/mcp`,\n headers: authHeader(key),\n };\n existing.servers = servers;\n writeJsonSafe(p, existing);\n return { path: p, written: true };\n}\n\nexport function writeClaudeCodeConfig(): { command: string } {\n const url = getServerUrl();\n const key = getApiKey();\n return {\n command: `claude mcp add --transport http --header \"Authorization: Bearer ${key}\" ${SERVER_NAME} ${url}/mcp`,\n };\n}\n\n/**\n * Write Hive's MCP entry into Claude Code's user-scope config\n * (~/.claude.json). This is what `claude mcp add` does internally;\n * doing it directly avoids requiring the `claude` CLI to be on PATH\n * and lets us batch-install across every client from one process.\n */\nexport function writeClaudeCodeUserConfig(): {\n path: string;\n written: boolean;\n} {\n const url = getServerUrl();\n const key = getApiKey();\n const p = getClaudeCodeUserConfigPath();\n\n if (key === \"YOUR_HIVE_API_KEY\") {\n return { path: p, written: false };\n }\n\n const existing = readJsonSafe(p);\n const mcpServers = (existing.mcpServers || {}) as Record<string, unknown>;\n mcpServers[SERVER_NAME] = {\n type: \"http\",\n url: `${url}/mcp`,\n headers: authHeader(key),\n };\n existing.mcpServers = mcpServers;\n writeJsonSafe(p, existing);\n return { path: p, written: true };\n}\n\nexport function writeWindsurfConfig(): { path: string; written: boolean } {\n const url = getServerUrl();\n const key = getApiKey();\n const p = getWindsurfMcpConfigPath();\n\n if (key === \"YOUR_HIVE_API_KEY\") {\n return { path: p, written: false };\n }\n\n const existing = readJsonSafe(p);\n const mcpServers = (existing.mcpServers || {}) as Record<string, unknown>;\n mcpServers[SERVER_NAME] = {\n url: `${url}/mcp`,\n headers: authHeader(key),\n };\n existing.mcpServers = mcpServers;\n writeJsonSafe(p, existing);\n return { path: p, written: true };\n}\n\nexport function writeGeminiCliConfig(): { path: string; written: boolean } {\n const url = getServerUrl();\n const key = getApiKey();\n const p = getGeminiCliSettingsPath();\n\n if (key === \"YOUR_HIVE_API_KEY\") {\n return { path: p, written: false };\n }\n\n const existing = readJsonSafe(p);\n const mcpServers = (existing.mcpServers || {}) as Record<string, unknown>;\n mcpServers[SERVER_NAME] = {\n url: `${url}/mcp`,\n headers: authHeader(key),\n };\n existing.mcpServers = mcpServers;\n writeJsonSafe(p, existing);\n return { path: p, written: true };\n}\n\n/**\n * Print the manual ChatGPT Desktop setup instructions. Programmatic\n * configuration is not possible — ChatGPT only accepts MCP servers\n * through its in-app Settings → Connectors UI.\n */\nexport function printChatGptDesktopInstructions(): {\n manual: true;\n steps: string[];\n} {\n const url = getServerUrl();\n const key = getApiKey();\n const keyLabel = key === \"YOUR_HIVE_API_KEY\" ? \"<YOUR_HIVE_API_KEY>\" : key;\n return {\n manual: true,\n steps: [\n \"Open ChatGPT Desktop\",\n \"Settings → Connectors → Add MCP server\",\n `URL: ${url}/mcp`,\n `Auth header: Authorization: Bearer ${keyLabel}`,\n ],\n };\n}\n\n// ─── Removal functions (uninstall flow) ─────────────────────────────\n\nfunction removeServerEntry(\n filePath: string,\n serversKey: \"mcpServers\" | \"servers\",\n): { removed: boolean; path: string } {\n if (!existsSync(filePath)) return { removed: false, path: filePath };\n const existing = readJsonSafe(filePath);\n const servers = (existing[serversKey] || {}) as Record<string, unknown>;\n if (!(SERVER_NAME in servers)) return { removed: false, path: filePath };\n delete servers[SERVER_NAME];\n // Don't leave an empty servers key behind — match the project's\n // existing convention (config files only contain non-empty objects).\n if (Object.keys(servers).length === 0) {\n delete existing[serversKey];\n } else {\n existing[serversKey] = servers;\n }\n // If the entire file is now empty, leave it on disk but write {}\n // (deleting could surprise other tools that expect the file).\n writeJsonSafe(filePath, existing);\n return { removed: true, path: filePath };\n}\n\nexport function removeClaudeDesktopConfig() {\n return removeServerEntry(getClaudeDesktopConfigPath(), \"mcpServers\");\n}\n\nexport function removeCursorConfig() {\n return removeServerEntry(getCursorConfigPath(), \"mcpServers\");\n}\n\nexport function removeVscodeConfig() {\n return removeServerEntry(getVscodeConfigPath(), \"servers\");\n}\n\nexport function removeClaudeCodeUserConfig() {\n return removeServerEntry(getClaudeCodeUserConfigPath(), \"mcpServers\");\n}\n\nexport function removeWindsurfConfig() {\n return removeServerEntry(getWindsurfMcpConfigPath(), \"mcpServers\");\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