hive-intelligence 1.1.2 → 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 +12 -10
- package/README.md +325 -351
- package/agent-skills/.claude-plugin/plugin.json +111 -0
- package/agent-skills/.mcp.json +11 -0
- package/agent-skills/AGENTS.md +37 -0
- package/agent-skills/LICENSE +21 -0
- package/agent-skills/README.md +145 -0
- package/agent-skills/SKILL.md +80 -0
- package/agent-skills/evals/README.md +20 -0
- package/agent-skills/evals/trigger-queries.json +464 -0
- package/agent-skills/package.json +49 -0
- package/agent-skills/packs/hive-build/SKILL.md +328 -0
- package/agent-skills/packs/hive-build/evals/evals.json +28 -0
- package/agent-skills/packs/hive-build-onboarding/SKILL.md +137 -0
- package/agent-skills/packs/hive-build-onboarding/evals/evals.json +27 -0
- package/agent-skills/packs/hive-cli/SKILL.md +141 -0
- package/agent-skills/packs/hive-cli/evals/evals.json +27 -0
- package/agent-skills/packs/hive-defi-research/SKILL.md +42 -0
- package/agent-skills/packs/hive-defi-research/evals/evals.json +27 -0
- package/agent-skills/packs/hive-defi-research/references/workflow.md +41 -0
- package/agent-skills/packs/hive-dex-pool-analysis/SKILL.md +41 -0
- package/agent-skills/packs/hive-dex-pool-analysis/evals/evals.json +27 -0
- package/agent-skills/packs/hive-dex-pool-analysis/references/workflow.md +42 -0
- package/agent-skills/packs/hive-market-research/SKILL.md +45 -0
- package/agent-skills/packs/hive-market-research/evals/evals.json +27 -0
- package/agent-skills/packs/hive-market-research/references/workflow.md +47 -0
- package/agent-skills/packs/hive-mcp/SKILL.md +147 -0
- package/agent-skills/packs/hive-mcp/evals/evals.json +38 -0
- package/agent-skills/packs/hive-mcp/references/client-install-matrix.md +83 -0
- package/agent-skills/packs/hive-mcp/references/clients.md +141 -0
- package/agent-skills/packs/hive-network-infrastructure/SKILL.md +44 -0
- package/agent-skills/packs/hive-network-infrastructure/evals/evals.json +27 -0
- package/agent-skills/packs/hive-network-infrastructure/references/workflow.md +41 -0
- package/agent-skills/packs/hive-nft-research/SKILL.md +41 -0
- package/agent-skills/packs/hive-nft-research/evals/evals.json +27 -0
- package/agent-skills/packs/hive-nft-research/references/workflow.md +42 -0
- package/agent-skills/packs/hive-prediction-markets/SKILL.md +44 -0
- package/agent-skills/packs/hive-prediction-markets/evals/evals.json +27 -0
- package/agent-skills/packs/hive-prediction-markets/references/workflow.md +42 -0
- package/agent-skills/packs/hive-query/SKILL.md +99 -0
- package/agent-skills/packs/hive-query/evals/evals.json +38 -0
- package/agent-skills/packs/hive-query/references/root-mcp-workflow.md +54 -0
- package/agent-skills/packs/hive-security-risk/SKILL.md +42 -0
- package/agent-skills/packs/hive-security-risk/evals/evals.json +27 -0
- package/agent-skills/packs/hive-security-risk/references/workflow.md +46 -0
- package/agent-skills/packs/hive-solana-analysis/SKILL.md +42 -0
- package/agent-skills/packs/hive-solana-analysis/evals/evals.json +27 -0
- package/agent-skills/packs/hive-solana-analysis/references/workflow.md +42 -0
- 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-token-diligence/SKILL.md +44 -0
- package/agent-skills/packs/hive-token-diligence/evals/evals.json +27 -0
- package/agent-skills/packs/hive-token-diligence/references/workflow.md +45 -0
- package/agent-skills/packs/hive-tool-discovery/SKILL.md +49 -0
- package/agent-skills/packs/hive-tool-discovery/evals/evals.json +38 -0
- package/agent-skills/packs/hive-tool-discovery/references/discovery-surfaces.md +62 -0
- package/agent-skills/packs/hive-wallet-investigation/SKILL.md +42 -0
- package/agent-skills/packs/hive-wallet-investigation/evals/evals.json +27 -0
- package/agent-skills/packs/hive-wallet-investigation/references/workflow.md +45 -0
- package/agent-skills/references/agents-routing.md +51 -0
- package/agent-skills/scripts/validate-agent-skills-package.mjs +216 -0
- package/agent-skills/skills.sh.json +41 -0
- package/bin/hive-mcp.js +33 -0
- package/build/{alias-INGXWFCG.js → alias-3OPMQF4X.js} +2 -3
- package/build/api-client-EPF6FD7A.js +28 -0
- package/build/auth-Q5Q24IRI.js +39 -0
- package/build/browser-auth-VPF5LZMZ.js +8 -0
- package/build/{cache-US4LSZPI.js → cache-T6KC5YEY.js} +2 -3
- package/build/{chunk-QMRVH5ZP.js → chunk-3WYWXTNN.js} +9 -2
- package/build/chunk-4F5CI6LX.js +340 -0
- package/build/chunk-5XXI25JE.js +496 -0
- package/build/chunk-7JWXBKEJ.js +252 -0
- package/build/chunk-CEWCB5YS.js +71 -0
- package/build/{chunk-CGXVV6WR.js → chunk-FH3YGSY5.js} +86 -105
- package/build/chunk-FRXMGRZQ.js +102 -0
- package/build/chunk-GZPDEXO4.js +126 -0
- package/build/chunk-IZPAMRHP.js +43 -0
- package/build/chunk-JTUKQWIO.js +79720 -0
- package/build/{chunk-CP3FXEQA.js → chunk-NP6NSOG2.js} +4 -6
- package/build/{chunk-XQJ6PB2L.js → chunk-POT2MBEK.js} +0 -1
- package/build/chunk-VBOKVQ74.js +280 -0
- package/build/{chunk-WKVZVQTG.js → chunk-YZ2PXBJK.js} +6 -4
- package/build/chunk-ZCU7XQKF.js +14 -0
- package/build/chunk-ZTJVOWDQ.js +85 -0
- package/build/chunk-ZXB53E7H.js +246 -0
- package/build/cli.js +138 -125
- package/build/{completion-J6HFY6PS.js → completion-46K674EL.js} +54 -50
- package/build/config-XE6Q5P4I.js +57 -0
- package/build/{config-dir-IEOID7Q6.js → config-dir-MAWX5AUF.js} +2 -3
- package/build/{doctor-7WZMCQC7.js → doctor-HGMQE6IN.js} +37 -13
- package/build/{errors-U6UZWVSD.js → errors-J2PH3NLJ.js} +2 -3
- package/build/format-5X2HIVDT.js +42 -0
- package/build/{init-CAVIFVSH.js → init-JMDNM7ZZ.js} +1 -2
- package/build/init-all-5SKNV75X.js +273 -0
- package/build/mcpServer-5TKKSKJM.js +21 -0
- package/build/monitor-worker.js +1140 -0
- package/build/{namespace-7JWWBWBL.js → namespace-FSX2G3NM.js} +2 -3
- package/build/{open-FUXYIHFO.js → open-5A6ZQMGC.js} +5 -6
- package/build/{output-7PGQWJY2.js → output-V3D4YZ6U.js} +2 -3
- package/build/serve-AGCOXXFM.js +49 -0
- package/build/server.js +5042 -14125
- package/build/setup-RMETGJWK.js +135 -0
- package/build/stdio.js +32 -0
- package/build/{telemetry-KNWMQURH.js → telemetry-WCME5XEU.js} +4 -4
- package/build/{tools-VRRMBCZQ.js → tools-KAB6QBZC.js} +15 -15
- package/build/uninstall-FLJMBBSC.js +114 -0
- 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-A75SVIQ6.js → watch-YNN255QX.js} +7 -7
- package/package.json +124 -53
- package/bin/hive.js +0 -25
- package/build/alias-INGXWFCG.js.map +0 -1
- package/build/auth-77MKFFBQ.js +0 -233
- package/build/auth-77MKFFBQ.js.map +0 -1
- package/build/cache-US4LSZPI.js.map +0 -1
- package/build/chunk-CGXVV6WR.js.map +0 -1
- package/build/chunk-CP3FXEQA.js.map +0 -1
- package/build/chunk-DTUDM6HX.js +0 -3108
- package/build/chunk-DTUDM6HX.js.map +0 -1
- package/build/chunk-LBTLYTZS.js +0 -115
- package/build/chunk-LBTLYTZS.js.map +0 -1
- package/build/chunk-OK3LSM73.js +0 -22
- package/build/chunk-OK3LSM73.js.map +0 -1
- package/build/chunk-QMRVH5ZP.js.map +0 -1
- package/build/chunk-RRI526CJ.js +0 -212
- package/build/chunk-RRI526CJ.js.map +0 -1
- package/build/chunk-WKVZVQTG.js.map +0 -1
- package/build/chunk-XQJ6PB2L.js.map +0 -1
- package/build/cli.js.map +0 -1
- package/build/completion-J6HFY6PS.js.map +0 -1
- package/build/config-ANFERP7A.js +0 -99
- package/build/config-ANFERP7A.js.map +0 -1
- package/build/config-dir-IEOID7Q6.js.map +0 -1
- package/build/doctor-7WZMCQC7.js.map +0 -1
- package/build/errors-U6UZWVSD.js.map +0 -1
- package/build/format-CVLLK6GD.js +0 -75
- package/build/format-CVLLK6GD.js.map +0 -1
- package/build/init-CAVIFVSH.js.map +0 -1
- package/build/namespace-7JWWBWBL.js.map +0 -1
- package/build/open-FUXYIHFO.js.map +0 -1
- package/build/output-7PGQWJY2.js.map +0 -1
- package/build/server.js.map +0 -1
- package/build/telemetry-KNWMQURH.js.map +0 -1
- package/build/tools-VRRMBCZQ.js.map +0 -1
- package/build/version-3TZ3U4IR.js +0 -9
- package/build/version-3TZ3U4IR.js.map +0 -1
- package/build/watch-A75SVIQ6.js.map +0 -1
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
saveCredentials,
|
|
13
13
|
setCliFlags,
|
|
14
14
|
writeJsonFile
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-POT2MBEK.js";
|
|
16
|
+
import "./chunk-3WYWXTNN.js";
|
|
17
17
|
export {
|
|
18
18
|
ensureConfigDir,
|
|
19
19
|
getConfig,
|
|
@@ -28,4 +28,3 @@ export {
|
|
|
28
28
|
setCliFlags,
|
|
29
29
|
writeJsonFile
|
|
30
30
|
};
|
|
31
|
-
//# sourceMappingURL=config-dir-IEOID7Q6.js.map
|
|
@@ -1,16 +1,17 @@
|
|
|
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
|
debug,
|
|
7
8
|
info,
|
|
8
9
|
shouldOutputJson,
|
|
9
10
|
successEnvelope,
|
|
10
11
|
writeOutput
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-NP6NSOG2.js";
|
|
13
|
+
import "./chunk-POT2MBEK.js";
|
|
14
|
+
import "./chunk-3WYWXTNN.js";
|
|
14
15
|
|
|
15
16
|
// src/cli/doctor.ts
|
|
16
17
|
var DEFAULT_API_URL = "https://mcp.hiveintelligence.xyz";
|
|
@@ -22,8 +23,8 @@ async function runDoctor(opts) {
|
|
|
22
23
|
const apiKey = process.env.HIVE_API_KEY;
|
|
23
24
|
checks.push({
|
|
24
25
|
check: "HIVE_API_KEY",
|
|
25
|
-
status: apiKey ? "PASS" : "
|
|
26
|
-
detail: apiKey ? `Set (${apiKey.slice(0, 4)}...)` : "Not set \u2014
|
|
26
|
+
status: apiKey ? "PASS" : "INFO",
|
|
27
|
+
detail: apiKey ? `Set (${apiKey.slice(0, 4)}...)` : "Not set (optional \u2014 API is currently free)"
|
|
27
28
|
});
|
|
28
29
|
const apiUrl = process.env.HIVE_API_URL;
|
|
29
30
|
checks.push({
|
|
@@ -94,6 +95,30 @@ async function runDoctor(opts) {
|
|
|
94
95
|
});
|
|
95
96
|
}
|
|
96
97
|
}
|
|
98
|
+
{
|
|
99
|
+
const { SERVER_VERSION } = await import("./version-I6HDAF4L.js");
|
|
100
|
+
const { fetchLatestVersion, isNewerVersion } = await import("./update-check-LNZQK3XA.js");
|
|
101
|
+
const latest = await fetchLatestVersion(5e3);
|
|
102
|
+
if (latest === null) {
|
|
103
|
+
checks.push({
|
|
104
|
+
check: "Updates",
|
|
105
|
+
status: "INFO",
|
|
106
|
+
detail: `v${SERVER_VERSION} (could not reach npm registry)`
|
|
107
|
+
});
|
|
108
|
+
} else if (isNewerVersion(latest, SERVER_VERSION)) {
|
|
109
|
+
checks.push({
|
|
110
|
+
check: "Updates",
|
|
111
|
+
status: "WARN",
|
|
112
|
+
detail: `v${SERVER_VERSION} -> v${latest} available \u2014 run: hive upgrade`
|
|
113
|
+
});
|
|
114
|
+
} else {
|
|
115
|
+
checks.push({
|
|
116
|
+
check: "Updates",
|
|
117
|
+
status: "PASS",
|
|
118
|
+
detail: `v${SERVER_VERSION} (latest)`
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
97
122
|
if (opts.probe) {
|
|
98
123
|
const probeUrl = `${getApiUrl()}/health?run=true`;
|
|
99
124
|
debug(`Probe: GET ${probeUrl}`);
|
|
@@ -116,10 +141,10 @@ async function runDoctor(opts) {
|
|
|
116
141
|
const pObj = p;
|
|
117
142
|
const name = String(pObj.name ?? pObj.provider ?? "unknown");
|
|
118
143
|
const status = String(pObj.status ?? "unknown");
|
|
119
|
-
const pass = status === "healthy" || status === "passed" || status === "partial";
|
|
144
|
+
const pass = status === "ok" || status === "healthy" || status === "passed" || status === "partial";
|
|
120
145
|
checks.push({
|
|
121
146
|
check: `Probe: ${name}`,
|
|
122
|
-
status: pass
|
|
147
|
+
status: pass || status === "missing_key" || status === "plan_required" ? pass ? "PASS" : "SKIP" : "FAIL",
|
|
123
148
|
detail: status
|
|
124
149
|
});
|
|
125
150
|
}
|
|
@@ -163,7 +188,7 @@ async function runDoctor(opts) {
|
|
|
163
188
|
if (fails > 0) process.exit(1);
|
|
164
189
|
return;
|
|
165
190
|
}
|
|
166
|
-
const { table } = await import("./format-
|
|
191
|
+
const { table } = await import("./format-5X2HIVDT.js");
|
|
167
192
|
info("\nHive MCP Doctor\n");
|
|
168
193
|
info(
|
|
169
194
|
table(
|
|
@@ -179,9 +204,9 @@ ${fails === 0 ? "All checks passed" : `${fails} issues found`}${warns ? ` (${war
|
|
|
179
204
|
if (fails > 0) process.exit(1);
|
|
180
205
|
}
|
|
181
206
|
async function runStatus() {
|
|
182
|
-
const {
|
|
183
|
-
const { resolveApiKey, resolveApiUrl } = await import("./config-dir-
|
|
184
|
-
const { getActiveProfile, maskKey } = await import("./auth-
|
|
207
|
+
const { SERVER_VERSION } = await import("./mcpServer-5TKKSKJM.js");
|
|
208
|
+
const { resolveApiKey, resolveApiUrl } = await import("./config-dir-MAWX5AUF.js");
|
|
209
|
+
const { getActiveProfile, maskKey } = await import("./auth-Q5Q24IRI.js");
|
|
185
210
|
const apiUrl = resolveApiUrl();
|
|
186
211
|
const apiKey = resolveApiKey();
|
|
187
212
|
const profile = getActiveProfile();
|
|
@@ -228,4 +253,3 @@ export {
|
|
|
228
253
|
runDoctor,
|
|
229
254
|
runStatus
|
|
230
255
|
};
|
|
231
|
-
//# sourceMappingURL=doctor-7WZMCQC7.js.map
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
ExitCode,
|
|
6
6
|
classifyError,
|
|
7
7
|
suggestSimilarTools
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-ZTJVOWDQ.js";
|
|
9
|
+
import "./chunk-3WYWXTNN.js";
|
|
10
10
|
export {
|
|
11
11
|
CliError,
|
|
12
12
|
ERROR_DOC_URLS,
|
|
@@ -14,4 +14,3 @@ export {
|
|
|
14
14
|
classifyError,
|
|
15
15
|
suggestSimilarTools
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=errors-U6UZWVSD.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import "./chunk-3WYWXTNN.js";
|
|
3
|
+
|
|
4
|
+
// src/cli/format.ts
|
|
5
|
+
function pad(str, width) {
|
|
6
|
+
return str.length >= width ? str.slice(0, width) : str + " ".repeat(width - str.length);
|
|
7
|
+
}
|
|
8
|
+
function table(headers, rows) {
|
|
9
|
+
const widths = headers.map(
|
|
10
|
+
(h, i) => Math.max(h.length, ...rows.map((r) => (r[i] || "").length)) + 2
|
|
11
|
+
);
|
|
12
|
+
const headerLine = headers.map((h, i) => pad(h, widths[i])).join("");
|
|
13
|
+
const separator = widths.map((w) => "-".repeat(w)).join("");
|
|
14
|
+
const dataLines = rows.map(
|
|
15
|
+
(row) => row.map((cell, i) => pad(cell, widths[i])).join("")
|
|
16
|
+
);
|
|
17
|
+
return [headerLine, separator, ...dataLines].join("\n");
|
|
18
|
+
}
|
|
19
|
+
function formatTable(data) {
|
|
20
|
+
if (data.length === 0) return "(empty result)";
|
|
21
|
+
const maxCols = 8;
|
|
22
|
+
const maxWidth = 40;
|
|
23
|
+
const allKeys = [...new Set(data.flatMap(Object.keys))];
|
|
24
|
+
const cols = allKeys.slice(0, maxCols);
|
|
25
|
+
const widths = cols.map((col) => {
|
|
26
|
+
const values = data.map((row) => String(row[col] ?? "").slice(0, maxWidth));
|
|
27
|
+
return Math.max(col.length, ...values.map((v) => v.length));
|
|
28
|
+
});
|
|
29
|
+
const header = cols.map((col, i) => col.padEnd(widths[i])).join(" ");
|
|
30
|
+
const separator = widths.map((w) => "-".repeat(w)).join(" ");
|
|
31
|
+
const rows = data.map(
|
|
32
|
+
(row) => cols.map(
|
|
33
|
+
(col, i) => String(row[col] ?? "").slice(0, maxWidth).padEnd(widths[i])
|
|
34
|
+
).join(" ")
|
|
35
|
+
);
|
|
36
|
+
return [header, separator, ...rows].join("\n");
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
formatTable,
|
|
40
|
+
pad,
|
|
41
|
+
table
|
|
42
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-3WYWXTNN.js";
|
|
3
3
|
|
|
4
4
|
// src/cli/init.ts
|
|
5
5
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -99,4 +99,3 @@ Validating API key against ${baseUrl}...`);
|
|
|
99
99
|
export {
|
|
100
100
|
runInit
|
|
101
101
|
};
|
|
102
|
-
//# sourceMappingURL=init-CAVIFVSH.js.map
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
browserLogin
|
|
4
|
+
} from "./chunk-GZPDEXO4.js";
|
|
5
|
+
import {
|
|
6
|
+
saveProfile
|
|
7
|
+
} from "./chunk-5XXI25JE.js";
|
|
8
|
+
import {
|
|
9
|
+
detectClients,
|
|
10
|
+
installSkillsForClients
|
|
11
|
+
} from "./chunk-ZXB53E7H.js";
|
|
12
|
+
import {
|
|
13
|
+
printChatGptDesktopInstructions,
|
|
14
|
+
writeClaudeCodeUserConfig,
|
|
15
|
+
writeClaudeDesktopConfig,
|
|
16
|
+
writeCursorConfig,
|
|
17
|
+
writeGeminiCliConfig,
|
|
18
|
+
writeVscodeConfig,
|
|
19
|
+
writeWindsurfConfig
|
|
20
|
+
} from "./chunk-4F5CI6LX.js";
|
|
21
|
+
import "./chunk-VBOKVQ74.js";
|
|
22
|
+
import {
|
|
23
|
+
bold,
|
|
24
|
+
dim,
|
|
25
|
+
green,
|
|
26
|
+
red,
|
|
27
|
+
yellow
|
|
28
|
+
} from "./chunk-NP6NSOG2.js";
|
|
29
|
+
import {
|
|
30
|
+
resolveApiKey,
|
|
31
|
+
resolveApiUrl
|
|
32
|
+
} from "./chunk-POT2MBEK.js";
|
|
33
|
+
import "./chunk-3WYWXTNN.js";
|
|
34
|
+
|
|
35
|
+
// src/cli/init-all.ts
|
|
36
|
+
function w(line) {
|
|
37
|
+
process.stderr.write(line + "\n");
|
|
38
|
+
}
|
|
39
|
+
function step(label) {
|
|
40
|
+
w(`
|
|
41
|
+
${bold(label)}`);
|
|
42
|
+
}
|
|
43
|
+
function ok(line) {
|
|
44
|
+
w(` ${green("\u2713")} ${line}`);
|
|
45
|
+
}
|
|
46
|
+
function bad(line) {
|
|
47
|
+
w(` ${red("\u2717")} ${line}`);
|
|
48
|
+
}
|
|
49
|
+
function warn(line) {
|
|
50
|
+
w(` ${yellow("!")} ${line}`);
|
|
51
|
+
}
|
|
52
|
+
function info(line) {
|
|
53
|
+
w(` ${dim(line)}`);
|
|
54
|
+
}
|
|
55
|
+
function writeForClient(client) {
|
|
56
|
+
const base = {
|
|
57
|
+
client: client.id,
|
|
58
|
+
name: client.name
|
|
59
|
+
};
|
|
60
|
+
if (!client.programmable) {
|
|
61
|
+
if (client.id === "chatgpt-desktop") {
|
|
62
|
+
const inst = printChatGptDesktopInstructions();
|
|
63
|
+
return { ...base, ok: false, manual: true, steps: inst.steps };
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
...base,
|
|
67
|
+
ok: false,
|
|
68
|
+
manual: true,
|
|
69
|
+
error: client.hint || "Manual setup required"
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
let result;
|
|
74
|
+
switch (client.id) {
|
|
75
|
+
case "claude-code":
|
|
76
|
+
result = writeClaudeCodeUserConfig();
|
|
77
|
+
break;
|
|
78
|
+
case "claude-desktop":
|
|
79
|
+
result = writeClaudeDesktopConfig();
|
|
80
|
+
break;
|
|
81
|
+
case "cursor":
|
|
82
|
+
result = writeCursorConfig();
|
|
83
|
+
break;
|
|
84
|
+
case "vscode":
|
|
85
|
+
result = writeVscodeConfig();
|
|
86
|
+
break;
|
|
87
|
+
case "windsurf":
|
|
88
|
+
result = writeWindsurfConfig();
|
|
89
|
+
break;
|
|
90
|
+
case "gemini-cli":
|
|
91
|
+
result = writeGeminiCliConfig();
|
|
92
|
+
break;
|
|
93
|
+
case "chatgpt-desktop":
|
|
94
|
+
return {
|
|
95
|
+
...base,
|
|
96
|
+
ok: false,
|
|
97
|
+
manual: true,
|
|
98
|
+
steps: printChatGptDesktopInstructions().steps
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
...base,
|
|
103
|
+
ok: result.written,
|
|
104
|
+
path: result.path,
|
|
105
|
+
error: result.written ? void 0 : "No API key resolved \u2014 auth first or set HIVE_API_KEY"
|
|
106
|
+
};
|
|
107
|
+
} catch (err) {
|
|
108
|
+
return {
|
|
109
|
+
...base,
|
|
110
|
+
ok: false,
|
|
111
|
+
error: err instanceof Error ? err.message : String(err)
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
async function verifyConnection() {
|
|
116
|
+
const apiKey = resolveApiKey();
|
|
117
|
+
const apiUrl = resolveApiUrl();
|
|
118
|
+
if (!apiKey) return false;
|
|
119
|
+
try {
|
|
120
|
+
const controller = new AbortController();
|
|
121
|
+
const timer = setTimeout(() => controller.abort(), 8e3);
|
|
122
|
+
const res = await fetch(`${apiUrl}/api/v1/tools?limit=1`, {
|
|
123
|
+
headers: { Authorization: `Bearer ${apiKey}` },
|
|
124
|
+
signal: controller.signal
|
|
125
|
+
});
|
|
126
|
+
clearTimeout(timer);
|
|
127
|
+
return res.ok;
|
|
128
|
+
} catch {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async function runInitAll(opts = {}) {
|
|
133
|
+
const summary = {
|
|
134
|
+
authenticated: false,
|
|
135
|
+
apiKeyPresent: Boolean(resolveApiKey()),
|
|
136
|
+
apiUrl: opts.apiUrl || resolveApiUrl(),
|
|
137
|
+
clients: [],
|
|
138
|
+
skills: [],
|
|
139
|
+
verified: null,
|
|
140
|
+
dryRun: Boolean(opts.dryRun)
|
|
141
|
+
};
|
|
142
|
+
if (!opts.json) {
|
|
143
|
+
w(bold("\nHive Intelligence \u2014 Init"));
|
|
144
|
+
if (summary.dryRun) info("(dry-run \u2014 nothing will be written)");
|
|
145
|
+
}
|
|
146
|
+
if (opts.browser) {
|
|
147
|
+
step("Authenticating via browser");
|
|
148
|
+
if (summary.dryRun) {
|
|
149
|
+
info("Would open browser for PKCE auth at /auth/cli");
|
|
150
|
+
summary.authenticated = false;
|
|
151
|
+
} else {
|
|
152
|
+
try {
|
|
153
|
+
const result = await browserLogin({
|
|
154
|
+
baseUrl: process.env.HIVE_AUTH_BASE_URL || "https://hiveintelligence.xyz",
|
|
155
|
+
timeout: 3e5
|
|
156
|
+
});
|
|
157
|
+
saveProfile("default", result.key, summary.apiUrl);
|
|
158
|
+
summary.authenticated = true;
|
|
159
|
+
summary.apiKeyPresent = true;
|
|
160
|
+
ok(`Signed in as ${result.email || "(email unavailable)"}`);
|
|
161
|
+
} catch (err) {
|
|
162
|
+
bad(`Browser auth failed: ${err instanceof Error ? err.message : err}`);
|
|
163
|
+
if (!summary.apiKeyPresent) {
|
|
164
|
+
warn("No saved key \u2014 clients will be configured with placeholder.");
|
|
165
|
+
warn("Run `hive auth login --manual` to paste a key by hand.");
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
} else if (!summary.apiKeyPresent) {
|
|
170
|
+
step("Authentication");
|
|
171
|
+
warn("No API key in env or saved profile.");
|
|
172
|
+
info("Run `hive init --browser` to authenticate via PKCE flow,");
|
|
173
|
+
info("or `hive auth login --manual` to paste a key by hand.");
|
|
174
|
+
} else {
|
|
175
|
+
step("Authentication");
|
|
176
|
+
ok("Existing API key resolved (env or saved profile)");
|
|
177
|
+
summary.authenticated = true;
|
|
178
|
+
}
|
|
179
|
+
step("Detecting MCP-capable clients");
|
|
180
|
+
const detected = detectClients();
|
|
181
|
+
for (const c of detected) {
|
|
182
|
+
if (c.detected) {
|
|
183
|
+
ok(`${c.name} ${dim("(" + c.configPath + ")")}`);
|
|
184
|
+
} else if (!opts.all) {
|
|
185
|
+
continue;
|
|
186
|
+
} else {
|
|
187
|
+
info(`${c.name} \u2014 not detected (${c.hint || "skipped"})`);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
const targets = opts.all ? detected.filter((c) => c.detected && c.programmable) : detected.filter((c) => c.detected && c.programmable);
|
|
191
|
+
step("Writing client configs");
|
|
192
|
+
for (const client of targets) {
|
|
193
|
+
if (summary.dryRun) {
|
|
194
|
+
info(`Would write ${client.configPath}`);
|
|
195
|
+
summary.clients.push({
|
|
196
|
+
client: client.id,
|
|
197
|
+
name: client.name,
|
|
198
|
+
ok: true,
|
|
199
|
+
path: client.configPath
|
|
200
|
+
});
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
const result = writeForClient(client);
|
|
204
|
+
summary.clients.push(result);
|
|
205
|
+
if (result.ok && result.path) {
|
|
206
|
+
ok(`${result.name} ${dim("\u2192 " + result.path)}`);
|
|
207
|
+
} else if (result.manual && result.steps) {
|
|
208
|
+
warn(`${result.name} \u2014 manual setup required:`);
|
|
209
|
+
for (const stepText of result.steps) info(` \u2022 ${stepText}`);
|
|
210
|
+
} else {
|
|
211
|
+
bad(`${result.name} \u2014 ${result.error || "unknown error"}`);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
const chatgpt = detected.find((c) => c.id === "chatgpt-desktop");
|
|
215
|
+
if (chatgpt && !summary.clients.some((c) => c.client === "chatgpt-desktop")) {
|
|
216
|
+
const inst = printChatGptDesktopInstructions();
|
|
217
|
+
summary.clients.push({
|
|
218
|
+
client: "chatgpt-desktop",
|
|
219
|
+
name: chatgpt.name,
|
|
220
|
+
ok: false,
|
|
221
|
+
manual: true,
|
|
222
|
+
steps: inst.steps
|
|
223
|
+
});
|
|
224
|
+
info(`${chatgpt.name} \u2014 manual setup (Settings \u2192 Connectors)`);
|
|
225
|
+
}
|
|
226
|
+
if (!opts.skipSkills) {
|
|
227
|
+
step("Installing skill packs");
|
|
228
|
+
if (summary.dryRun) {
|
|
229
|
+
info("Would copy agent-skills/packs/ into per-client skills dirs");
|
|
230
|
+
} else {
|
|
231
|
+
const skillTargets = targets.map((c) => c.id);
|
|
232
|
+
const skillResults = installSkillsForClients(skillTargets);
|
|
233
|
+
summary.skills = skillResults;
|
|
234
|
+
for (const r of skillResults) {
|
|
235
|
+
if (r.installed.length > 0) {
|
|
236
|
+
ok(
|
|
237
|
+
`${r.client}: ${r.installed.length} pack${r.installed.length === 1 ? "" : "s"} ${dim("\u2192 " + r.destination)}`
|
|
238
|
+
);
|
|
239
|
+
} else if (r.reason) {
|
|
240
|
+
info(`${r.client}: ${r.reason}`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (!opts.skipVerify && !summary.dryRun) {
|
|
246
|
+
step("Verifying connection");
|
|
247
|
+
const verified = await verifyConnection();
|
|
248
|
+
summary.verified = verified;
|
|
249
|
+
if (verified) ok("Connection to Hive verified");
|
|
250
|
+
else
|
|
251
|
+
warn(
|
|
252
|
+
"Could not verify \u2014 run `hive doctor` for details (this can be a transient network issue)"
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
if (opts.json) {
|
|
256
|
+
process.stdout.write(JSON.stringify(summary, null, 2) + "\n");
|
|
257
|
+
} else {
|
|
258
|
+
w("");
|
|
259
|
+
w(bold("Next steps"));
|
|
260
|
+
w(dim(" Try a query: ") + "hive market price --ids bitcoin --vs usd");
|
|
261
|
+
w(dim(" Open dashboard: ") + "hive open dashboard");
|
|
262
|
+
w(dim(" Health check: ") + "hive doctor");
|
|
263
|
+
w("");
|
|
264
|
+
}
|
|
265
|
+
const anyClientOk = summary.clients.some((c) => c.ok);
|
|
266
|
+
const browserOnly = opts.browser && !opts.all;
|
|
267
|
+
if (browserOnly && summary.authenticated) return 0;
|
|
268
|
+
if (!summary.dryRun && !anyClientOk) return 1;
|
|
269
|
+
return 0;
|
|
270
|
+
}
|
|
271
|
+
export {
|
|
272
|
+
runInitAll
|
|
273
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
HiveMCPServer,
|
|
4
|
+
createHiveMcpServer,
|
|
5
|
+
getSharedClients,
|
|
6
|
+
getToolsForScope
|
|
7
|
+
} from "./chunk-JTUKQWIO.js";
|
|
8
|
+
import "./chunk-VBOKVQ74.js";
|
|
9
|
+
import {
|
|
10
|
+
SERVER_NAME,
|
|
11
|
+
SERVER_VERSION
|
|
12
|
+
} from "./chunk-ZCU7XQKF.js";
|
|
13
|
+
import "./chunk-3WYWXTNN.js";
|
|
14
|
+
export {
|
|
15
|
+
HiveMCPServer,
|
|
16
|
+
SERVER_NAME,
|
|
17
|
+
SERVER_VERSION,
|
|
18
|
+
createHiveMcpServer,
|
|
19
|
+
getSharedClients,
|
|
20
|
+
getToolsForScope
|
|
21
|
+
};
|