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.
Files changed (148) hide show
  1. package/LICENSE +12 -10
  2. package/README.md +325 -351
  3. package/agent-skills/.claude-plugin/plugin.json +111 -0
  4. package/agent-skills/.mcp.json +11 -0
  5. package/agent-skills/AGENTS.md +37 -0
  6. package/agent-skills/LICENSE +21 -0
  7. package/agent-skills/README.md +145 -0
  8. package/agent-skills/SKILL.md +80 -0
  9. package/agent-skills/evals/README.md +20 -0
  10. package/agent-skills/evals/trigger-queries.json +464 -0
  11. package/agent-skills/package.json +49 -0
  12. package/agent-skills/packs/hive-build/SKILL.md +328 -0
  13. package/agent-skills/packs/hive-build/evals/evals.json +28 -0
  14. package/agent-skills/packs/hive-build-onboarding/SKILL.md +137 -0
  15. package/agent-skills/packs/hive-build-onboarding/evals/evals.json +27 -0
  16. package/agent-skills/packs/hive-cli/SKILL.md +141 -0
  17. package/agent-skills/packs/hive-cli/evals/evals.json +27 -0
  18. package/agent-skills/packs/hive-defi-research/SKILL.md +42 -0
  19. package/agent-skills/packs/hive-defi-research/evals/evals.json +27 -0
  20. package/agent-skills/packs/hive-defi-research/references/workflow.md +41 -0
  21. package/agent-skills/packs/hive-dex-pool-analysis/SKILL.md +41 -0
  22. package/agent-skills/packs/hive-dex-pool-analysis/evals/evals.json +27 -0
  23. package/agent-skills/packs/hive-dex-pool-analysis/references/workflow.md +42 -0
  24. package/agent-skills/packs/hive-market-research/SKILL.md +45 -0
  25. package/agent-skills/packs/hive-market-research/evals/evals.json +27 -0
  26. package/agent-skills/packs/hive-market-research/references/workflow.md +47 -0
  27. package/agent-skills/packs/hive-mcp/SKILL.md +147 -0
  28. package/agent-skills/packs/hive-mcp/evals/evals.json +38 -0
  29. package/agent-skills/packs/hive-mcp/references/client-install-matrix.md +83 -0
  30. package/agent-skills/packs/hive-mcp/references/clients.md +141 -0
  31. package/agent-skills/packs/hive-network-infrastructure/SKILL.md +44 -0
  32. package/agent-skills/packs/hive-network-infrastructure/evals/evals.json +27 -0
  33. package/agent-skills/packs/hive-network-infrastructure/references/workflow.md +41 -0
  34. package/agent-skills/packs/hive-nft-research/SKILL.md +41 -0
  35. package/agent-skills/packs/hive-nft-research/evals/evals.json +27 -0
  36. package/agent-skills/packs/hive-nft-research/references/workflow.md +42 -0
  37. package/agent-skills/packs/hive-prediction-markets/SKILL.md +44 -0
  38. package/agent-skills/packs/hive-prediction-markets/evals/evals.json +27 -0
  39. package/agent-skills/packs/hive-prediction-markets/references/workflow.md +42 -0
  40. package/agent-skills/packs/hive-query/SKILL.md +99 -0
  41. package/agent-skills/packs/hive-query/evals/evals.json +38 -0
  42. package/agent-skills/packs/hive-query/references/root-mcp-workflow.md +54 -0
  43. package/agent-skills/packs/hive-security-risk/SKILL.md +42 -0
  44. package/agent-skills/packs/hive-security-risk/evals/evals.json +27 -0
  45. package/agent-skills/packs/hive-security-risk/references/workflow.md +46 -0
  46. package/agent-skills/packs/hive-solana-analysis/SKILL.md +42 -0
  47. package/agent-skills/packs/hive-solana-analysis/evals/evals.json +27 -0
  48. package/agent-skills/packs/hive-solana-analysis/references/workflow.md +42 -0
  49. package/agent-skills/packs/hive-stateful-monitoring/SKILL.md +75 -0
  50. package/agent-skills/packs/hive-stateful-monitoring/evals/evals.json +49 -0
  51. package/agent-skills/packs/hive-token-diligence/SKILL.md +44 -0
  52. package/agent-skills/packs/hive-token-diligence/evals/evals.json +27 -0
  53. package/agent-skills/packs/hive-token-diligence/references/workflow.md +45 -0
  54. package/agent-skills/packs/hive-tool-discovery/SKILL.md +49 -0
  55. package/agent-skills/packs/hive-tool-discovery/evals/evals.json +38 -0
  56. package/agent-skills/packs/hive-tool-discovery/references/discovery-surfaces.md +62 -0
  57. package/agent-skills/packs/hive-wallet-investigation/SKILL.md +42 -0
  58. package/agent-skills/packs/hive-wallet-investigation/evals/evals.json +27 -0
  59. package/agent-skills/packs/hive-wallet-investigation/references/workflow.md +45 -0
  60. package/agent-skills/references/agents-routing.md +51 -0
  61. package/agent-skills/scripts/validate-agent-skills-package.mjs +216 -0
  62. package/agent-skills/skills.sh.json +41 -0
  63. package/bin/hive-mcp.js +33 -0
  64. package/build/{alias-INGXWFCG.js → alias-3OPMQF4X.js} +2 -3
  65. package/build/api-client-EPF6FD7A.js +28 -0
  66. package/build/auth-Q5Q24IRI.js +39 -0
  67. package/build/browser-auth-VPF5LZMZ.js +8 -0
  68. package/build/{cache-US4LSZPI.js → cache-T6KC5YEY.js} +2 -3
  69. package/build/{chunk-QMRVH5ZP.js → chunk-3WYWXTNN.js} +9 -2
  70. package/build/chunk-4F5CI6LX.js +340 -0
  71. package/build/chunk-5XXI25JE.js +496 -0
  72. package/build/chunk-7JWXBKEJ.js +252 -0
  73. package/build/chunk-CEWCB5YS.js +71 -0
  74. package/build/{chunk-CGXVV6WR.js → chunk-FH3YGSY5.js} +86 -105
  75. package/build/chunk-FRXMGRZQ.js +102 -0
  76. package/build/chunk-GZPDEXO4.js +126 -0
  77. package/build/chunk-IZPAMRHP.js +43 -0
  78. package/build/chunk-JTUKQWIO.js +79720 -0
  79. package/build/{chunk-CP3FXEQA.js → chunk-NP6NSOG2.js} +4 -6
  80. package/build/{chunk-XQJ6PB2L.js → chunk-POT2MBEK.js} +0 -1
  81. package/build/chunk-VBOKVQ74.js +280 -0
  82. package/build/{chunk-WKVZVQTG.js → chunk-YZ2PXBJK.js} +6 -4
  83. package/build/chunk-ZCU7XQKF.js +14 -0
  84. package/build/chunk-ZTJVOWDQ.js +85 -0
  85. package/build/chunk-ZXB53E7H.js +246 -0
  86. package/build/cli.js +138 -125
  87. package/build/{completion-J6HFY6PS.js → completion-46K674EL.js} +54 -50
  88. package/build/config-XE6Q5P4I.js +57 -0
  89. package/build/{config-dir-IEOID7Q6.js → config-dir-MAWX5AUF.js} +2 -3
  90. package/build/{doctor-7WZMCQC7.js → doctor-HGMQE6IN.js} +37 -13
  91. package/build/{errors-U6UZWVSD.js → errors-J2PH3NLJ.js} +2 -3
  92. package/build/format-5X2HIVDT.js +42 -0
  93. package/build/{init-CAVIFVSH.js → init-JMDNM7ZZ.js} +1 -2
  94. package/build/init-all-5SKNV75X.js +273 -0
  95. package/build/mcpServer-5TKKSKJM.js +21 -0
  96. package/build/monitor-worker.js +1140 -0
  97. package/build/{namespace-7JWWBWBL.js → namespace-FSX2G3NM.js} +2 -3
  98. package/build/{open-FUXYIHFO.js → open-5A6ZQMGC.js} +5 -6
  99. package/build/{output-7PGQWJY2.js → output-V3D4YZ6U.js} +2 -3
  100. package/build/serve-AGCOXXFM.js +49 -0
  101. package/build/server.js +5042 -14125
  102. package/build/setup-RMETGJWK.js +135 -0
  103. package/build/stdio.js +32 -0
  104. package/build/{telemetry-KNWMQURH.js → telemetry-WCME5XEU.js} +4 -4
  105. package/build/{tools-VRRMBCZQ.js → tools-KAB6QBZC.js} +15 -15
  106. package/build/uninstall-FLJMBBSC.js +114 -0
  107. package/build/update-check-LNZQK3XA.js +18 -0
  108. package/build/upgrade-DTUIHVPS.js +171 -0
  109. package/build/version-I6HDAF4L.js +14 -0
  110. package/build/{watch-A75SVIQ6.js → watch-YNN255QX.js} +7 -7
  111. package/package.json +124 -53
  112. package/bin/hive.js +0 -25
  113. package/build/alias-INGXWFCG.js.map +0 -1
  114. package/build/auth-77MKFFBQ.js +0 -233
  115. package/build/auth-77MKFFBQ.js.map +0 -1
  116. package/build/cache-US4LSZPI.js.map +0 -1
  117. package/build/chunk-CGXVV6WR.js.map +0 -1
  118. package/build/chunk-CP3FXEQA.js.map +0 -1
  119. package/build/chunk-DTUDM6HX.js +0 -3108
  120. package/build/chunk-DTUDM6HX.js.map +0 -1
  121. package/build/chunk-LBTLYTZS.js +0 -115
  122. package/build/chunk-LBTLYTZS.js.map +0 -1
  123. package/build/chunk-OK3LSM73.js +0 -22
  124. package/build/chunk-OK3LSM73.js.map +0 -1
  125. package/build/chunk-QMRVH5ZP.js.map +0 -1
  126. package/build/chunk-RRI526CJ.js +0 -212
  127. package/build/chunk-RRI526CJ.js.map +0 -1
  128. package/build/chunk-WKVZVQTG.js.map +0 -1
  129. package/build/chunk-XQJ6PB2L.js.map +0 -1
  130. package/build/cli.js.map +0 -1
  131. package/build/completion-J6HFY6PS.js.map +0 -1
  132. package/build/config-ANFERP7A.js +0 -99
  133. package/build/config-ANFERP7A.js.map +0 -1
  134. package/build/config-dir-IEOID7Q6.js.map +0 -1
  135. package/build/doctor-7WZMCQC7.js.map +0 -1
  136. package/build/errors-U6UZWVSD.js.map +0 -1
  137. package/build/format-CVLLK6GD.js +0 -75
  138. package/build/format-CVLLK6GD.js.map +0 -1
  139. package/build/init-CAVIFVSH.js.map +0 -1
  140. package/build/namespace-7JWWBWBL.js.map +0 -1
  141. package/build/open-FUXYIHFO.js.map +0 -1
  142. package/build/output-7PGQWJY2.js.map +0 -1
  143. package/build/server.js.map +0 -1
  144. package/build/telemetry-KNWMQURH.js.map +0 -1
  145. package/build/tools-VRRMBCZQ.js.map +0 -1
  146. package/build/version-3TZ3U4IR.js +0 -9
  147. package/build/version-3TZ3U4IR.js.map +0 -1
  148. package/build/watch-A75SVIQ6.js.map +0 -1
@@ -0,0 +1,102 @@
1
+ import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ REGISTRY_PACKAGE,
4
+ SERVER_VERSION
5
+ } from "./chunk-ZCU7XQKF.js";
6
+ import {
7
+ ensureConfigDir,
8
+ getConfigDir,
9
+ readJsonFile,
10
+ writeJsonFile
11
+ } from "./chunk-POT2MBEK.js";
12
+
13
+ // src/cli/update-check.ts
14
+ import { join } from "path";
15
+ var CACHE_TTL_MS = 864e5;
16
+ function getCachePath() {
17
+ return join(getConfigDir(), "cache", "update-check.json");
18
+ }
19
+ async function checkForUpdates() {
20
+ if (shouldSkipUpdateCheck(process.argv, process.env)) {
21
+ return;
22
+ }
23
+ const cached = readUpdateCache();
24
+ if (cached?.checkedAt) {
25
+ const age = Date.now() - new Date(cached.checkedAt).getTime();
26
+ if (age < CACHE_TTL_MS) {
27
+ if (cached.latestVersion && isNewerVersion(cached.latestVersion, SERVER_VERSION)) {
28
+ showUpdateMessage(cached.latestVersion);
29
+ }
30
+ return;
31
+ }
32
+ }
33
+ const latest = await fetchLatestVersion();
34
+ if (latest === null) return;
35
+ ensureConfigDir();
36
+ writeJsonFile(getCachePath(), {
37
+ checkedAt: (/* @__PURE__ */ new Date()).toISOString(),
38
+ latestVersion: latest
39
+ });
40
+ if (isNewerVersion(latest, SERVER_VERSION)) showUpdateMessage(latest);
41
+ }
42
+ async function fetchLatestVersion(timeoutMs = 3e3) {
43
+ try {
44
+ const controller = new AbortController();
45
+ const timeout = setTimeout(() => controller.abort(), timeoutMs);
46
+ const res = await fetch(
47
+ `https://registry.npmjs.org/${REGISTRY_PACKAGE}/latest`,
48
+ { signal: controller.signal }
49
+ );
50
+ clearTimeout(timeout);
51
+ if (!res.ok) return null;
52
+ const data = await res.json();
53
+ return data.version ?? null;
54
+ } catch {
55
+ return null;
56
+ }
57
+ }
58
+ function readUpdateCache() {
59
+ return readJsonFile(getCachePath());
60
+ }
61
+ function getPendingUpdateVersion() {
62
+ const cached = readUpdateCache();
63
+ if (cached?.latestVersion && isNewerVersion(cached.latestVersion, SERVER_VERSION)) {
64
+ return cached.latestVersion;
65
+ }
66
+ return null;
67
+ }
68
+ function shouldSkipUpdateCheck(argv = process.argv, env = process.env) {
69
+ if (env.CI || env.HIVE_NO_UPDATE_CHECK) return true;
70
+ if (env.NODE_ENV === "test" || env.VITEST || env.VITEST_WORKER_ID) {
71
+ return true;
72
+ }
73
+ return argv.some((arg) => ["--help", "-h", "--version", "-V"].includes(arg));
74
+ }
75
+ function isNewerVersion(candidate, current) {
76
+ const parse = (version) => version.replace(/^[^\d]*/, "").split(/[.-]/).slice(0, 3).map((part) => Number.parseInt(part, 10) || 0);
77
+ const a = parse(candidate);
78
+ const b = parse(current);
79
+ for (let i = 0; i < 3; i++) {
80
+ if (a[i] > b[i]) return true;
81
+ if (a[i] < b[i]) return false;
82
+ }
83
+ return false;
84
+ }
85
+ function showUpdateMessage(newVersion) {
86
+ process.stderr.write(
87
+ `
88
+ Update available: ${SERVER_VERSION} \u2192 ${newVersion}
89
+ npm: npm update -g hive-intelligence
90
+ npx: npx -y -p hive-intelligence@latest hive
91
+
92
+ `
93
+ );
94
+ }
95
+
96
+ export {
97
+ checkForUpdates,
98
+ fetchLatestVersion,
99
+ getPendingUpdateVersion,
100
+ shouldSkipUpdateCheck,
101
+ isNewerVersion
102
+ };
@@ -0,0 +1,126 @@
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
+ };
@@ -0,0 +1,43 @@
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
+ };