hive-intelligence 1.1.3 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +315 -85
  3. package/agent-skills/.claude-plugin/plugin.json +10 -4
  4. package/agent-skills/.mcp.json +8 -0
  5. package/agent-skills/AGENTS.md +37 -0
  6. package/agent-skills/README.md +28 -23
  7. package/agent-skills/SKILL.md +40 -10
  8. package/agent-skills/evals/trigger-queries.json +270 -0
  9. package/agent-skills/package.json +4 -4
  10. package/agent-skills/packs/hive-build/SKILL.md +54 -25
  11. package/agent-skills/packs/hive-build/evals/evals.json +16 -3
  12. package/agent-skills/packs/hive-build/evals/triggers.json +50 -0
  13. package/agent-skills/packs/hive-build-onboarding/SKILL.md +27 -34
  14. package/agent-skills/packs/hive-build-onboarding/evals/evals.json +1 -1
  15. package/agent-skills/packs/hive-build-onboarding/evals/triggers.json +50 -0
  16. package/agent-skills/packs/hive-cli/SKILL.md +33 -35
  17. package/agent-skills/packs/hive-cli/evals/evals.json +1 -1
  18. package/agent-skills/packs/hive-cli/evals/triggers.json +50 -0
  19. package/agent-skills/packs/hive-defi-research/SKILL.md +105 -19
  20. package/agent-skills/packs/hive-defi-research/evals/evals.json +6 -3
  21. package/agent-skills/packs/hive-defi-research/evals/triggers.json +50 -0
  22. package/agent-skills/packs/hive-dex-pool-analysis/SKILL.md +106 -16
  23. package/agent-skills/packs/hive-dex-pool-analysis/evals/evals.json +5 -3
  24. package/agent-skills/packs/hive-dex-pool-analysis/evals/triggers.json +50 -0
  25. package/agent-skills/packs/hive-market-research/SKILL.md +130 -21
  26. package/agent-skills/packs/hive-market-research/evals/evals.json +15 -2
  27. package/agent-skills/packs/hive-market-research/evals/triggers.json +50 -0
  28. package/agent-skills/packs/hive-mcp/SKILL.md +98 -153
  29. package/agent-skills/packs/hive-mcp/evals/evals.json +4 -3
  30. package/agent-skills/packs/hive-mcp/evals/triggers.json +50 -0
  31. package/agent-skills/packs/hive-mcp/references/client-install-matrix.md +62 -35
  32. package/agent-skills/packs/hive-mcp/references/clients.md +154 -0
  33. package/agent-skills/packs/hive-network-infrastructure/SKILL.md +105 -20
  34. package/agent-skills/packs/hive-network-infrastructure/evals/evals.json +4 -2
  35. package/agent-skills/packs/hive-network-infrastructure/evals/triggers.json +50 -0
  36. package/agent-skills/packs/hive-nft-research/SKILL.md +105 -18
  37. package/agent-skills/packs/hive-nft-research/evals/evals.json +4 -2
  38. package/agent-skills/packs/hive-nft-research/evals/triggers.json +50 -0
  39. package/agent-skills/packs/hive-prediction-markets/SKILL.md +108 -21
  40. package/agent-skills/packs/hive-prediction-markets/evals/evals.json +4 -2
  41. package/agent-skills/packs/hive-prediction-markets/evals/triggers.json +50 -0
  42. package/agent-skills/packs/hive-query/SKILL.md +80 -33
  43. package/agent-skills/packs/hive-query/evals/evals.json +7 -5
  44. package/agent-skills/packs/hive-query/evals/triggers.json +50 -0
  45. package/agent-skills/packs/hive-query/references/root-mcp-workflow.md +39 -18
  46. package/agent-skills/packs/hive-security-risk/SKILL.md +110 -19
  47. package/agent-skills/packs/hive-security-risk/evals/evals.json +4 -2
  48. package/agent-skills/packs/hive-security-risk/evals/triggers.json +50 -0
  49. package/agent-skills/packs/hive-solana-analysis/SKILL.md +115 -19
  50. package/agent-skills/packs/hive-solana-analysis/evals/evals.json +4 -2
  51. package/agent-skills/packs/hive-solana-analysis/evals/triggers.json +50 -0
  52. package/agent-skills/packs/hive-stateful-monitoring/SKILL.md +120 -0
  53. package/agent-skills/packs/hive-stateful-monitoring/evals/evals.json +54 -0
  54. package/agent-skills/packs/hive-stateful-monitoring/evals/triggers.json +50 -0
  55. package/agent-skills/packs/hive-stateful-monitoring/references/b2b-subject-context.md +53 -0
  56. package/agent-skills/packs/hive-token-diligence/SKILL.md +119 -21
  57. package/agent-skills/packs/hive-token-diligence/evals/evals.json +6 -4
  58. package/agent-skills/packs/hive-token-diligence/evals/triggers.json +50 -0
  59. package/agent-skills/packs/hive-tool-discovery/SKILL.md +48 -19
  60. package/agent-skills/packs/hive-tool-discovery/evals/evals.json +17 -3
  61. package/agent-skills/packs/hive-tool-discovery/evals/triggers.json +50 -0
  62. package/agent-skills/packs/hive-tool-discovery/references/discovery-surfaces.md +31 -6
  63. package/agent-skills/packs/hive-wallet-investigation/SKILL.md +111 -18
  64. package/agent-skills/packs/hive-wallet-investigation/evals/evals.json +5 -3
  65. package/agent-skills/packs/hive-wallet-investigation/evals/triggers.json +50 -0
  66. package/agent-skills/references/agents-routing.md +19 -7
  67. package/agent-skills/scripts/validate-agent-skills-package.mjs +116 -18
  68. package/agent-skills/skills.sh.json +3 -2
  69. package/bin/hive-mcp.js +5 -5
  70. package/build/{alias-CZ3DEYHF.js → alias-BKAVOYQV.js} +2 -3
  71. package/build/{api-client-I23XLSHU.js → api-client-FTVDFW5V.js} +4 -4
  72. package/build/{auth-KKINNBXT.js → auth-EZFJ5RYB.js} +3 -4
  73. package/build/{browser-auth-EEFGRHWY.js → browser-auth-OJSUNFBI.js} +2 -3
  74. package/build/{cache-EGNMENNA.js → cache-TBDQ7QBU.js} +2 -3
  75. package/build/{chunk-V77LO4RO.js → chunk-6PC3HUAK.js} +10 -4
  76. package/build/{chunk-XYBEFFZ3.js → chunk-725R3KLJ.js} +26 -4
  77. package/build/{chunk-PGBVNMNZ.js → chunk-7GD2MFYI.js} +57 -7
  78. package/build/{chunk-IDZD2NVG.js → chunk-AEU43ACS.js} +33 -10
  79. package/build/chunk-EPF36Q3Z.js +71 -0
  80. package/build/chunk-I5Z6FZRL.js +178 -0
  81. package/build/{chunk-KBVPIZS4.js → chunk-ILVPOLA7.js} +12 -4
  82. package/build/{chunk-B6G222LS.js → chunk-L326MQZP.js} +22 -6
  83. package/build/{chunk-QNCI4DEB.js → chunk-M6REON2I.js} +35 -21
  84. package/build/chunk-N32UIHBU.js +125 -0
  85. package/build/{chunk-IZTN7WFH.js → chunk-Q7VBYLX7.js} +12 -3
  86. package/build/chunk-QDZ7MAVN.js +447 -0
  87. package/build/{chunk-KGYBTXIN.js → chunk-R6YZTFQL.js} +2 -1
  88. package/build/{chunk-DYJBTKNR.js → chunk-RU6QOFHH.js} +9 -10
  89. package/build/{chunk-RKICZ6DZ.js → chunk-RUHO24SX.js} +16 -10
  90. package/build/{chunk-MPIUUE3T.js → chunk-TNQ7GJ6Q.js} +0 -60
  91. package/build/{chunk-2X3U4DFK.js → chunk-W2QL7LYI.js} +43586 -21498
  92. package/build/chunk-ZXKFJQDE.js +20 -0
  93. package/build/cli.js +3342 -3410
  94. package/build/{completion-BELZL7ND.js → completion-7KBW243H.js} +4 -5
  95. package/build/{config-TDX4VUGW.js → config-KAEUX6RM.js} +23 -4
  96. package/build/{config-dir-V43W2WIA.js → config-dir-5IH7MOOT.js} +2 -3
  97. package/build/{doctor-5K5UWHNX.js → doctor-ORDOCGLM.js} +34 -10
  98. package/build/{errors-E6MVUBNA.js → errors-HGHUF575.js} +2 -3
  99. package/build/{format-TSFSI2K7.js → format-H7FOQSYY.js} +1 -2
  100. package/build/{init-YQ5NBICF.js → init-UCTCUYFA.js} +52 -9
  101. package/build/init-all-BVWW3JVK.js +408 -0
  102. package/build/mcpServer-RUEOTTF7.js +34 -0
  103. package/build/monitor-worker.js +1396 -0
  104. package/build/{namespace-PVHBFDW2.js → namespace-L5DGCY7K.js} +2 -3
  105. package/build/{open-YUIJP37F.js → open-V2RNA3QT.js} +2 -3
  106. package/build/{output-IYJBFCYK.js → output-ITGLBKIG.js} +2 -3
  107. package/build/release.json +8 -0
  108. package/build/{serve-KWNJK6EY.js → serve-DKLR2WQH.js} +9 -4
  109. package/build/server.js +5399 -2945
  110. package/build/{setup-YTUKMPNP.js → setup-PTYFMTK5.js} +60 -56
  111. package/build/stdio.js +10 -8
  112. package/build/{telemetry-5IPRKZBL.js → telemetry-HPLDYR7U.js} +5 -4
  113. package/build/{tools-PJHWFCAG.js → tools-I7GLWTV6.js} +15 -15
  114. package/build/{uninstall-HWXEIP6K.js → uninstall-SAOIPL6K.js} +19 -11
  115. package/build/update-check-IEXPOYYR.js +18 -0
  116. package/build/upgrade-J4HIGCKE.js +171 -0
  117. package/build/version-Z4HJL4VV.js +16 -0
  118. package/build/{watch-KZ5EDZK3.js → watch-WVR4CGCD.js} +8 -7
  119. package/package.json +82 -41
  120. package/agent-skills/packs/hive-defi-research/references/workflow.md +0 -41
  121. package/agent-skills/packs/hive-dex-pool-analysis/references/workflow.md +0 -42
  122. package/agent-skills/packs/hive-market-research/references/workflow.md +0 -47
  123. package/agent-skills/packs/hive-network-infrastructure/references/workflow.md +0 -41
  124. package/agent-skills/packs/hive-nft-research/references/workflow.md +0 -42
  125. package/agent-skills/packs/hive-prediction-markets/references/workflow.md +0 -42
  126. package/agent-skills/packs/hive-security-risk/references/workflow.md +0 -46
  127. package/agent-skills/packs/hive-solana-analysis/references/workflow.md +0 -42
  128. package/agent-skills/packs/hive-token-diligence/references/workflow.md +0 -45
  129. package/agent-skills/packs/hive-wallet-investigation/references/workflow.md +0 -45
  130. package/build/alias-CZ3DEYHF.js.map +0 -1
  131. package/build/api-client-I23XLSHU.js.map +0 -1
  132. package/build/auth-KKINNBXT.js.map +0 -1
  133. package/build/browser-auth-EEFGRHWY.js.map +0 -1
  134. package/build/cache-EGNMENNA.js.map +0 -1
  135. package/build/chunk-2MYMHMBF.js +0 -340
  136. package/build/chunk-2MYMHMBF.js.map +0 -1
  137. package/build/chunk-2X3U4DFK.js.map +0 -1
  138. package/build/chunk-B6G222LS.js.map +0 -1
  139. package/build/chunk-DYJBTKNR.js.map +0 -1
  140. package/build/chunk-IDZD2NVG.js.map +0 -1
  141. package/build/chunk-IZTN7WFH.js.map +0 -1
  142. package/build/chunk-KBVPIZS4.js.map +0 -1
  143. package/build/chunk-KGYBTXIN.js.map +0 -1
  144. package/build/chunk-MPIUUE3T.js.map +0 -1
  145. package/build/chunk-PGBVNMNZ.js.map +0 -1
  146. package/build/chunk-QNCI4DEB.js.map +0 -1
  147. package/build/chunk-RKICZ6DZ.js.map +0 -1
  148. package/build/chunk-UKHZIVDT.js +0 -44
  149. package/build/chunk-UKHZIVDT.js.map +0 -1
  150. package/build/chunk-V77LO4RO.js.map +0 -1
  151. package/build/chunk-XYBEFFZ3.js.map +0 -1
  152. package/build/cli.js.map +0 -1
  153. package/build/completion-BELZL7ND.js.map +0 -1
  154. package/build/config-TDX4VUGW.js.map +0 -1
  155. package/build/config-dir-V43W2WIA.js.map +0 -1
  156. package/build/doctor-5K5UWHNX.js.map +0 -1
  157. package/build/errors-E6MVUBNA.js.map +0 -1
  158. package/build/format-TSFSI2K7.js.map +0 -1
  159. package/build/init-YQ5NBICF.js.map +0 -1
  160. package/build/init-all-6OWEQALB.js +0 -274
  161. package/build/init-all-6OWEQALB.js.map +0 -1
  162. package/build/mcpServer-AEX3RQ4U.js +0 -20
  163. package/build/mcpServer-AEX3RQ4U.js.map +0 -1
  164. package/build/namespace-PVHBFDW2.js.map +0 -1
  165. package/build/open-YUIJP37F.js.map +0 -1
  166. package/build/output-IYJBFCYK.js.map +0 -1
  167. package/build/serve-KWNJK6EY.js.map +0 -1
  168. package/build/server.js.map +0 -1
  169. package/build/setup-YTUKMPNP.js.map +0 -1
  170. package/build/stdio.js.map +0 -1
  171. package/build/telemetry-5IPRKZBL.js.map +0 -1
  172. package/build/tools-PJHWFCAG.js.map +0 -1
  173. package/build/uninstall-HWXEIP6K.js.map +0 -1
  174. package/build/watch-KZ5EDZK3.js.map +0 -1
@@ -149,7 +149,8 @@ function errorEnvelope(err, meta) {
149
149
  error: {
150
150
  code: err.code,
151
151
  message: err.message,
152
- ...err.suggestion && { suggestion: err.suggestion }
152
+ ...err.suggestion && { suggestion: err.suggestion },
153
+ ...err.docUrl && { doc_url: err.docUrl }
153
154
  },
154
155
  meta
155
156
  };
@@ -201,12 +202,34 @@ async function writeOutput(envelope) {
201
202
  const provider = envelope.meta.provider ? dim(` (${envelope.meta.provider})`) : "";
202
203
  const timing = envelope.meta.duration_ms != null ? dim(` ${envelope.meta.duration_ms}ms`) : "";
203
204
  process.stderr.write(`${status}${provider}${timing}
204
-
205
205
  `);
206
+ const receipt = [
207
+ envelope.meta.provider ? `provider=${envelope.meta.provider}` : void 0,
208
+ envelope.meta.source ? `source=${envelope.meta.source}` : void 0,
209
+ envelope.meta.origin_source ? `origin=${envelope.meta.origin_source}` : void 0,
210
+ envelope.meta.runtime_status ? `runtime=${envelope.meta.runtime_status}` : void 0,
211
+ envelope.meta.fetched_at ? `fetched=${envelope.meta.fetched_at}` : void 0,
212
+ envelope.meta.observed_at ? `observed=${envelope.meta.observed_at}` : void 0,
213
+ envelope.meta.cache_age_ms != null ? `cache_age_ms=${envelope.meta.cache_age_ms}` : void 0,
214
+ envelope.meta.cache_status ? `cache=${envelope.meta.cache_status}` : void 0,
215
+ envelope.meta.receipt_id ? `receipt=${envelope.meta.receipt_id}` : void 0
216
+ ].filter((value) => Boolean(value));
217
+ if (receipt.length > 0) {
218
+ process.stderr.write(dim(`Evidence: ${receipt.join(" \xB7 ")}
219
+ `));
220
+ }
221
+ if (envelope.meta.truncated) {
222
+ process.stderr.write(yellow("Evidence warning: response was truncated.\n"));
223
+ }
224
+ for (const warning of envelope.meta.warnings ?? []) {
225
+ process.stderr.write(yellow(`Evidence warning: ${warning}
226
+ `));
227
+ }
228
+ process.stderr.write("\n");
206
229
  }
207
230
  if (envelope.ok && envelope.data != null) {
208
231
  if (Array.isArray(envelope.data) && envelope.data.length > 0 && typeof envelope.data[0] === "object" && envelope.data[0] !== null) {
209
- const { formatTable } = await import("./format-TSFSI2K7.js");
232
+ const { formatTable } = await import("./format-H7FOQSYY.js");
210
233
  process.stdout.write(
211
234
  formatTable(envelope.data) + "\n"
212
235
  );
@@ -277,4 +300,3 @@ export {
277
300
  isCI,
278
301
  formatCsv
279
302
  };
280
- //# sourceMappingURL=chunk-XYBEFFZ3.js.map
@@ -5,6 +5,31 @@ import { createServer } from "http";
5
5
  import { randomBytes } from "crypto";
6
6
  import { execFile } from "child_process";
7
7
  import { platform } from "os";
8
+ async function exchangeCliCode(args) {
9
+ const exchangeUrl = new URL("/auth/cli/exchange", args.baseUrl);
10
+ const controller = new AbortController();
11
+ const timer = setTimeout(() => controller.abort(), 1e4);
12
+ try {
13
+ const response = await fetch(exchangeUrl, {
14
+ method: "POST",
15
+ headers: { "Content-Type": "application/json" },
16
+ body: JSON.stringify({ code: args.code, state: args.state }),
17
+ signal: controller.signal
18
+ });
19
+ if (!response.ok) {
20
+ throw new Error(`CLI auth exchange failed with HTTP ${response.status}`);
21
+ }
22
+ const payload = await response.json();
23
+ const key = typeof payload.key === "string" ? payload.key : typeof payload.api_key?.key === "string" ? payload.api_key.key : "";
24
+ if (!key) throw new Error("CLI auth exchange returned no API key.");
25
+ return {
26
+ key,
27
+ email: typeof payload.email === "string" ? payload.email : ""
28
+ };
29
+ } finally {
30
+ clearTimeout(timer);
31
+ }
32
+ }
8
33
  function openBrowser(url) {
9
34
  const plat = platform();
10
35
  let cmd;
@@ -33,7 +58,7 @@ async function browserLogin(opts) {
33
58
  const state = randomBytes(16).toString("hex");
34
59
  return new Promise((resolve, reject) => {
35
60
  let settled = false;
36
- const server = createServer((req, res) => {
61
+ const server = createServer(async (req, res) => {
37
62
  const url = new URL(req.url || "/", `http://localhost`);
38
63
  if (url.pathname !== "/callback") {
39
64
  res.writeHead(404);
@@ -45,20 +70,42 @@ async function browserLogin(opts) {
45
70
  res.end();
46
71
  return;
47
72
  }
48
- const key = url.searchParams.get("key");
49
- const email = url.searchParams.get("email");
73
+ const legacyKey = url.searchParams.get("key");
74
+ const code = url.searchParams.get("code");
50
75
  const returnedState = url.searchParams.get("state");
51
76
  if (returnedState !== state) {
52
77
  res.writeHead(403);
53
78
  res.end("State mismatch \u2014 possible CSRF attack. Please try again.");
54
79
  return;
55
80
  }
56
- if (!key) {
81
+ if (legacyKey) {
82
+ res.writeHead(400);
83
+ res.end(
84
+ "Insecure legacy callback rejected. Please update Hive auth and try again."
85
+ );
86
+ return;
87
+ }
88
+ if (!code) {
57
89
  res.writeHead(400);
58
- res.end("Missing API key in callback");
90
+ res.end("Missing one-time code in callback");
59
91
  return;
60
92
  }
61
93
  settled = true;
94
+ let exchanged;
95
+ try {
96
+ exchanged = await exchangeCliCode({
97
+ baseUrl,
98
+ code,
99
+ state: returnedState
100
+ });
101
+ } catch (error) {
102
+ clearTimeout(timer);
103
+ server.close();
104
+ res.writeHead(502);
105
+ res.end("Could not complete CLI auth exchange. Return to the terminal.");
106
+ reject(error);
107
+ return;
108
+ }
62
109
  res.writeHead(200, { "Content-Type": "text/html" });
63
110
  res.end(`<!DOCTYPE html>
64
111
  <html>
@@ -79,7 +126,11 @@ async function browserLogin(opts) {
79
126
  </html>`);
80
127
  clearTimeout(timer);
81
128
  server.close();
82
- resolve({ key, email: email || "", state: returnedState });
129
+ resolve({
130
+ key: exchanged.key,
131
+ email: exchanged.email,
132
+ state: returnedState
133
+ });
83
134
  });
84
135
  server.listen(0, "127.0.0.1", () => {
85
136
  const addr = server.address();
@@ -124,4 +175,3 @@ Opening browser to sign in...
124
175
  export {
125
176
  browserLogin
126
177
  };
127
- //# sourceMappingURL=chunk-PGBVNMNZ.js.map
@@ -1,12 +1,13 @@
1
1
  import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
2
  import {
3
3
  getClaudeDesktopConfigPath,
4
+ getCodexConfigPath,
4
5
  getCursorConfigPath,
5
6
  getVscodeConfigPath
6
- } from "./chunk-2MYMHMBF.js";
7
+ } from "./chunk-QDZ7MAVN.js";
7
8
  import {
8
9
  HIVE_AGENT_SKILLS
9
- } from "./chunk-B6G222LS.js";
10
+ } from "./chunk-L326MQZP.js";
10
11
 
11
12
  // src/cli/detect-clients.ts
12
13
  import { existsSync } from "fs";
@@ -24,6 +25,9 @@ function getGeminiCliConfigPath() {
24
25
  function detectClaudeCode() {
25
26
  return existsSync(getClaudeCodeConfigPath()) || existsSync(join(homedir(), ".claude"));
26
27
  }
28
+ function detectCodex() {
29
+ return existsSync(join(homedir(), ".codex"));
30
+ }
27
31
  function detectClaudeDesktop() {
28
32
  const configPath = getClaudeDesktopConfigPath();
29
33
  if (existsSync(configPath)) return true;
@@ -61,6 +65,7 @@ function detectGeminiCli() {
61
65
  function detectClients() {
62
66
  const claudeCode = detectClaudeCode();
63
67
  const claudeDesktop = detectClaudeDesktop();
68
+ const codex = detectCodex();
64
69
  const cursor = detectCursor();
65
70
  const vscode = detectVscode();
66
71
  const windsurf = detectWindsurf();
@@ -79,8 +84,16 @@ function detectClients() {
79
84
  name: "Claude Desktop",
80
85
  configPath: getClaudeDesktopConfigPath(),
81
86
  detected: claudeDesktop,
87
+ programmable: false,
88
+ hint: claudeDesktop ? "Add the hosted endpoint in Settings > Connectors; the local config file is stdio-only" : "Claude Desktop application directory not found"
89
+ },
90
+ {
91
+ id: "codex",
92
+ name: "OpenAI Codex",
93
+ configPath: getCodexConfigPath(),
94
+ detected: codex,
82
95
  programmable: true,
83
- hint: claudeDesktop ? void 0 : "Claude Desktop application directory not found"
96
+ hint: codex ? "Hive will use the official Codex MCP CLI and native OAuth login" : "~/.codex not found"
84
97
  },
85
98
  {
86
99
  id: "cursor",
@@ -96,7 +109,7 @@ function detectClients() {
96
109
  configPath: getVscodeConfigPath(),
97
110
  detected: vscode,
98
111
  programmable: true,
99
- hint: vscode ? void 0 : "VS Code user data dir not found"
112
+ hint: vscode ? "Hive will use the official code --add-mcp user-profile installer" : "VS Code user data dir not found"
100
113
  },
101
114
  {
102
115
  id: "windsurf",
@@ -116,12 +129,20 @@ function detectClients() {
116
129
  },
117
130
  {
118
131
  id: "chatgpt-desktop",
119
- name: "ChatGPT Desktop",
120
- configPath: "(in-app: Settings \u2192 Connectors)",
132
+ name: "OpenAI / ChatGPT apps",
133
+ configPath: "(app or API setup)",
121
134
  detected: false,
122
135
  // No reliable filesystem signal — always print instructions
123
136
  programmable: false,
124
- hint: "ChatGPT Desktop requires manual setup via Settings \u2192 Connectors \u2192 Add MCP server"
137
+ hint: "Create the Hive app manually in ChatGPT Settings > Apps, then complete OAuth."
138
+ },
139
+ {
140
+ id: "grok",
141
+ name: "Grok",
142
+ configPath: "https://grok.com/connectors",
143
+ detected: false,
144
+ programmable: false,
145
+ hint: "Add Hive manually at grok.com/connectors, then complete OAuth."
125
146
  }
126
147
  ];
127
148
  }
@@ -143,17 +164,20 @@ function getClientSkillsDir(client) {
143
164
  switch (client) {
144
165
  case "claude-code":
145
166
  return join2(homedir2(), ".claude", "skills");
167
+ case "codex":
168
+ return join2(homedir2(), ".codex", "skills");
146
169
  case "cursor":
147
170
  return join2(homedir2(), ".cursor", "skills");
148
171
  case "vscode":
149
- return null;
172
+ return join2(homedir2(), ".copilot", "skills");
150
173
  case "windsurf":
151
174
  return null;
152
175
  case "gemini-cli":
153
- return null;
176
+ return join2(homedir2(), ".gemini", "skills");
154
177
  case "claude-desktop":
155
178
  return join2(homedir2(), ".claude", "skills");
156
179
  case "chatgpt-desktop":
180
+ case "grok":
157
181
  return null;
158
182
  }
159
183
  }
@@ -244,4 +268,3 @@ export {
244
268
  installSkillsForClients,
245
269
  removeSkillsForClients
246
270
  };
247
- //# sourceMappingURL=chunk-IDZD2NVG.js.map
@@ -0,0 +1,71 @@
1
+ import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
+
3
+ // src/telemetryContract.ts
4
+ var TOOL_CALL_ANALYTICS_FIELD_DISCLOSURES = {
5
+ ts: "server-side event timestamp",
6
+ toolName: "server-owned tool name; arguments are not included",
7
+ success: "whether the call returned a non-error result",
8
+ durationMs: "call duration in milliseconds",
9
+ transport: "server transport class (mcp | rest | health | dynamic)",
10
+ provider: "server-owned data-provider label",
11
+ category: "server-owned Hive tool category",
12
+ receiptId: "random per-call runtime receipt UUID",
13
+ requestId: "random per-request correlation id",
14
+ principalHash: "HMAC-SHA256 of the principal id keyed by HIVE_ANALYTICS_HMAC_KEY; null for keyless traffic",
15
+ authLane: "bounded authentication lane or null when unknown",
16
+ clientName: "bounded low-cardinality MCP client profile ('unknown' allowed)",
17
+ isMaterial: "billable non-discovery call per src/mcpBilling.ts",
18
+ isInternal: "canary / monitor / founder-and-staff traffic, excluded from all metrics"
19
+ };
20
+ var TOOL_CALL_ANALYTICS_PAYLOAD_FIELDS = Object.freeze(
21
+ Object.keys(TOOL_CALL_ANALYTICS_FIELD_DISCLOSURES)
22
+ );
23
+ var OAUTH_FIRST_MATERIAL_RECEIPT_EVENT = "mcp_first_material_receipt";
24
+ var OAUTH_FIRST_MATERIAL_RECEIPT_FIELD_DISCLOSURES = {
25
+ connectionIdHash: "stable SHA-256 digest of the OAuth account and client pair",
26
+ userIdHash: "stable SHA-256 digest of the OAuth account ID",
27
+ oauthClientIdHash: "stable SHA-256 digest of the OAuth client ID",
28
+ clientProfile: "bounded low-cardinality MCP client profile",
29
+ clientVersion: "bounded client software version or unknown",
30
+ toolName: "server-owned material tool name; arguments are not included",
31
+ provider: "server-owned data-provider label",
32
+ category: "server-owned Hive tool category",
33
+ runtimeStatus: "runtime receipt status",
34
+ cacheStatus: "runtime receipt cache status",
35
+ source: "runtime receipt source class",
36
+ serverVersion: "Hive server version",
37
+ receiptVersion: "Hive runtime-receipt schema version",
38
+ secondsSinceConsent: "bounded whole seconds from OAuth consent approval to first receipt when known",
39
+ authLane: "bounded authentication lane (oauth | api_key) that produced the activation"
40
+ };
41
+ var OAUTH_FIRST_MATERIAL_RECEIPT_PAYLOAD_FIELDS = Object.freeze(
42
+ Object.keys(OAUTH_FIRST_MATERIAL_RECEIPT_FIELD_DISCLOSURES)
43
+ );
44
+ var CLI_TELEMETRY_PRIVACY_POLICY_URL = "https://www.hiveintelligence.xyz/privacy-policy";
45
+ var CLI_TELEMETRY_FIELD_DISCLOSURES = {
46
+ command: "command name only (command arguments are not included)",
47
+ durationMs: "command duration in milliseconds",
48
+ errorCode: "bounded error category when a command fails; omitted otherwise",
49
+ cliVersion: "Hive CLI version",
50
+ os: "operating system name and release",
51
+ nodeVersion: "Node.js version"
52
+ };
53
+ var CLI_TELEMETRY_PAYLOAD_FIELDS = Object.freeze(
54
+ Object.keys(CLI_TELEMETRY_FIELD_DISCLOSURES)
55
+ );
56
+ var CLI_TELEMETRY_CONSENT_COPY = [
57
+ "Telemetry enabled. Thank you for helping improve Hive CLI.",
58
+ "The telemetry payload is limited to exactly these fields:",
59
+ ...CLI_TELEMETRY_PAYLOAD_FIELDS.map(
60
+ (field) => ` - ${field}: ${CLI_TELEMETRY_FIELD_DISCLOSURES[field]}`
61
+ ),
62
+ "The analytics relay assigns a new random identifier to each event. It does not derive this telemetry identifier from your IP address or User-Agent.",
63
+ "API keys, command arguments, prompts, wallet addresses, and request or response data are never included in telemetry events.",
64
+ `Privacy policy: ${CLI_TELEMETRY_PRIVACY_POLICY_URL}`,
65
+ ""
66
+ ].join("\n");
67
+
68
+ export {
69
+ OAUTH_FIRST_MATERIAL_RECEIPT_EVENT,
70
+ CLI_TELEMETRY_CONSENT_COPY
71
+ };
@@ -0,0 +1,178 @@
1
+ import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ createToolNotFoundResult,
4
+ executeEndpoint,
5
+ getAllWrappedEndpoints,
6
+ getSharedClients,
7
+ getSupabaseAdmin,
8
+ resolveEndpoint,
9
+ secureLogger
10
+ } from "./chunk-W2QL7LYI.js";
11
+
12
+ // src/services/wallet-service.ts
13
+ async function consumeCredits(args) {
14
+ const { userId, cost, idempotencyKey, requestId, keyId } = args;
15
+ const { data, error } = await getSupabaseAdmin().rpc("consume_credits", {
16
+ p_user_id: userId,
17
+ p_cost: cost,
18
+ p_idempotency_key: idempotencyKey,
19
+ p_request_id: requestId ?? null,
20
+ p_key_id: keyId ?? null
21
+ });
22
+ if (error) {
23
+ secureLogger.error("consume_credits RPC failed", error, { userId });
24
+ throw new Error(`consume_credits failed: ${error.message}`);
25
+ }
26
+ const row = Array.isArray(data) ? data[0] : data;
27
+ if (!row) {
28
+ throw new Error("consume_credits returned no row");
29
+ }
30
+ return {
31
+ code: row.code,
32
+ balance: row.balance ?? null,
33
+ monthlyGrant: row.monthly_grant ?? 0,
34
+ cycleEnd: row.cycle_end ?? null
35
+ };
36
+ }
37
+ async function ensureWallet(userId, planId) {
38
+ const { error } = await getSupabaseAdmin().rpc("ensure_wallet", {
39
+ p_user_id: userId,
40
+ p_plan_id: planId
41
+ });
42
+ if (error) {
43
+ secureLogger.error("ensure_wallet RPC failed", error, { userId });
44
+ throw new Error(`ensure_wallet failed: ${error.message}`);
45
+ }
46
+ }
47
+ async function getWalletStatus(userId) {
48
+ const { data, error } = await getSupabaseAdmin().from("credit_wallets").select(
49
+ "plan_id, balance, monthly_grant, cycle_start, cycle_end, updated_at"
50
+ ).eq("user_id", userId).single();
51
+ if (error || !data) {
52
+ secureLogger.warn("getWalletStatus returned no row", {
53
+ userId,
54
+ hasError: !!error,
55
+ errorCode: error?.code,
56
+ errorMessage: error?.message
57
+ });
58
+ return null;
59
+ }
60
+ return {
61
+ planId: data.plan_id,
62
+ balance: data.balance ?? null,
63
+ monthlyGrant: data.monthly_grant,
64
+ cycleStart: data.cycle_start,
65
+ cycleEnd: data.cycle_end,
66
+ updatedAt: data.updated_at
67
+ };
68
+ }
69
+ async function applyPlanChange(args) {
70
+ const { data, error } = await getSupabaseAdmin().rpc("apply_plan_change", {
71
+ p_event_id: args.eventId,
72
+ p_event_type: args.eventType,
73
+ p_user_id: args.userId,
74
+ p_new_plan_id: args.newPlanId ?? null,
75
+ p_grant_credits: args.grantCredits ?? false,
76
+ p_cycle_start: args.cycleStart ?? null,
77
+ p_cycle_end: args.cycleEnd ?? null,
78
+ p_billing_status: args.billingStatus ?? null,
79
+ p_customer_id: args.customerId ?? null,
80
+ p_subscription_id: args.subscriptionId ?? null,
81
+ p_subscription_status: args.subscriptionStatus ?? null,
82
+ p_price_id: args.priceId ?? null,
83
+ p_ledger_reason: args.ledgerReason ?? "plan_change"
84
+ });
85
+ if (error) {
86
+ secureLogger.error("apply_plan_change RPC failed", error, {
87
+ userId: args.userId,
88
+ eventType: args.eventType
89
+ });
90
+ throw new Error(`apply_plan_change failed: ${error.message}`);
91
+ }
92
+ const row = Array.isArray(data) ? data[0] : data;
93
+ if (!row) {
94
+ throw new Error("apply_plan_change returned no row");
95
+ }
96
+ return {
97
+ outcome: String(row.outcome ?? "applied"),
98
+ replayed: Boolean(row.replayed),
99
+ planId: row.plan_id ?? null,
100
+ balance: row.balance ?? null,
101
+ billingStatus: row.billing_status ?? null
102
+ };
103
+ }
104
+
105
+ // src/services/tool-execution.ts
106
+ async function executeToolByName(toolName, args, options) {
107
+ const allEndpoints = getAllWrappedEndpoints();
108
+ const lookup = resolveEndpoint(allEndpoints, toolName);
109
+ if (!lookup.ok) {
110
+ const result2 = createToolNotFoundResult(toolName);
111
+ secureLogger.toolCall(toolName, false, result2.durationMs, {
112
+ transport: "rest",
113
+ runtimeStatus: "failing",
114
+ errorClass: "not_found",
115
+ receiptId: result2.hive.receipt_id,
116
+ receiptVersion: result2.hive.receipt_version,
117
+ requestId: options?.requestId,
118
+ serverVersion: result2.hive.server_version,
119
+ buildSha: result2.hive.build_sha,
120
+ inputDigest: result2.hive.input_digest,
121
+ resultDigest: result2.hive.result_digest
122
+ });
123
+ return {
124
+ ok: false,
125
+ error: result2.error,
126
+ durationMs: result2.durationMs,
127
+ meta: result2.hive
128
+ };
129
+ }
130
+ const result = await executeEndpoint(lookup.endpoint, args, {
131
+ transport: "rest",
132
+ requestId: options?.requestId,
133
+ clients: getSharedClients(),
134
+ beforeExecution: options?.beforeExecution
135
+ });
136
+ if (result.validationErrors) {
137
+ return {
138
+ ok: false,
139
+ error: result.error,
140
+ validationErrors: result.validationErrors,
141
+ durationMs: result.durationMs,
142
+ meta: result.hive
143
+ };
144
+ }
145
+ if (result.ok) {
146
+ return {
147
+ ok: true,
148
+ data: result.data,
149
+ durationMs: result.durationMs,
150
+ meta: result.hive
151
+ };
152
+ }
153
+ if (result.error?.code === "PROVIDER_UNAVAILABLE") {
154
+ return {
155
+ ok: false,
156
+ error: result.error,
157
+ durationMs: result.durationMs,
158
+ meta: result.hive
159
+ };
160
+ }
161
+ if (result.error?.code === "INTERNAL_ERROR") {
162
+ secureLogger.error(`[tool-execution] ${toolName} threw`, result.error, {});
163
+ }
164
+ return {
165
+ ok: false,
166
+ error: result.error,
167
+ durationMs: result.durationMs,
168
+ meta: result.hive
169
+ };
170
+ }
171
+
172
+ export {
173
+ consumeCredits,
174
+ ensureWallet,
175
+ getWalletStatus,
176
+ applyPlanChange,
177
+ executeToolByName
178
+ };
@@ -11,11 +11,20 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
11
11
  if (typeof require !== "undefined") return require.apply(this, arguments);
12
12
  throw Error('Dynamic require of "' + x + '" is not supported');
13
13
  });
14
- var __esm = (fn, res) => function __init() {
15
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
14
+ var __esm = (fn, res, err) => function __init() {
15
+ if (err) throw err[0];
16
+ try {
17
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
18
+ } catch (e) {
19
+ throw err = [e], e;
20
+ }
16
21
  };
17
22
  var __commonJS = (cb, mod) => function __require2() {
18
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
23
+ try {
24
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
25
+ } catch (e) {
26
+ throw mod = 0, e;
27
+ }
19
28
  };
20
29
  var __export = (target, all) => {
21
30
  for (var name in all)
@@ -49,4 +58,3 @@ export {
49
58
  __toESM,
50
59
  __toCommonJS
51
60
  };
52
- //# sourceMappingURL=chunk-KBVPIZS4.js.map
@@ -5,7 +5,7 @@ var HIVE_AGENT_SKILLS = [
5
5
  {
6
6
  name: "hive-mcp",
7
7
  label: "Install Hive MCP",
8
- description: "Connect Hive's hosted remote MCP endpoint to Claude, Cursor, VS Code, ChatGPT, Codex, Gemini, and other MCP clients.",
8
+ description: "Connect Hive's hosted remote MCP endpoint to Claude, ChatGPT/OpenAI, Grok, Cursor, VS Code, Codex, Gemini, and supported clients with OAuth-first interactive setup.",
9
9
  path: "agent-skills/packs/hive-mcp/SKILL.md",
10
10
  toolsetIds: ["search_discovery"],
11
11
  useWhen: ["install hive", "connect mcp", "configure client"]
@@ -21,7 +21,7 @@ var HIVE_AGENT_SKILLS = [
21
21
  {
22
22
  name: "hive-build",
23
23
  label: "Build With Hive",
24
- description: "Use Hive from application code through REST, MCP SDK clients, or backend services.",
24
+ description: "Use Hive from application code through REST, MCP clients, or the published TypeScript adapter.",
25
25
  path: "agent-skills/packs/hive-build/SKILL.md",
26
26
  toolsetIds: ["search_discovery"],
27
27
  useWhen: ["integrate api", "backend", "sdk", "production app"]
@@ -50,6 +50,8 @@ var HIVE_AGENT_SKILLS = [
50
50
  "network_infrastructure",
51
51
  "solana_analysis",
52
52
  "prediction_markets",
53
+ "rwa_perp_analysis",
54
+ "stateful_monitoring",
53
55
  "search_discovery"
54
56
  ],
55
57
  useWhen: [
@@ -60,10 +62,25 @@ var HIVE_AGENT_SKILLS = [
60
62
  "which hive endpoint"
61
63
  ]
62
64
  },
65
+ {
66
+ name: "hive-stateful-monitoring",
67
+ label: "Stateful Monitoring",
68
+ description: "Create, list, update, and archive durable crypto intelligence monitors that agents can schedule, remember, and report from.",
69
+ path: "agent-skills/packs/hive-stateful-monitoring/SKILL.md",
70
+ toolsetIds: ["stateful_monitoring"],
71
+ useWhen: [
72
+ "remember this",
73
+ "monitor wallet",
74
+ "watch token",
75
+ "schedule crypto report",
76
+ "alert me",
77
+ "persistent crypto memory"
78
+ ]
79
+ },
63
80
  {
64
81
  name: "hive-tool-discovery",
65
82
  label: "Tool Discovery",
66
- description: "Use search_tools, hive://toolsets, schema lookup, and invoke_api_endpoint correctly.",
83
+ description: "Use compact search_tools, exact hive://toolsets/{id} resources, schema lookup, separate read/write invokers, and validate_task_result correctly.",
67
84
  path: "agent-skills/packs/hive-tool-discovery/SKILL.md",
68
85
  toolsetIds: ["search_discovery"],
69
86
  useWhen: [
@@ -78,9 +95,9 @@ var HIVE_AGENT_SKILLS = [
78
95
  {
79
96
  name: "hive-market-research",
80
97
  label: "Market Research",
81
- description: "Research prices, liquidity, exchanges, OHLC, order books, and derivatives context.",
98
+ description: "Research prices, liquidity, exchanges, OHLC, order books, and derivatives context, including tokenized-RWA perp funding.",
82
99
  path: "agent-skills/packs/hive-market-research/SKILL.md",
83
- toolsetIds: ["market_research"],
100
+ toolsetIds: ["market_research", "rwa_perp_analysis"],
84
101
  useWhen: [
85
102
  "price",
86
103
  "market",
@@ -262,4 +279,3 @@ var HIVE_AGENT_SKILLS = [
262
279
  export {
263
280
  HIVE_AGENT_SKILLS
264
281
  };
265
- //# sourceMappingURL=chunk-B6G222LS.js.map