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.
Files changed (112) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +175 -54
  3. package/agent-skills/.claude-plugin/plugin.json +6 -0
  4. package/agent-skills/.mcp.json +11 -0
  5. package/agent-skills/AGENTS.md +37 -0
  6. package/agent-skills/README.md +13 -14
  7. package/agent-skills/SKILL.md +16 -4
  8. package/agent-skills/evals/trigger-queries.json +270 -0
  9. package/agent-skills/package.json +3 -3
  10. package/agent-skills/packs/hive-build/SKILL.md +11 -10
  11. package/agent-skills/packs/hive-build/evals/evals.json +2 -2
  12. package/agent-skills/packs/hive-mcp/SKILL.md +44 -121
  13. package/agent-skills/packs/hive-mcp/evals/evals.json +1 -1
  14. package/agent-skills/packs/hive-mcp/references/client-install-matrix.md +1 -1
  15. package/agent-skills/packs/hive-mcp/references/clients.md +141 -0
  16. package/agent-skills/packs/hive-query/SKILL.md +3 -2
  17. package/agent-skills/packs/hive-query/references/root-mcp-workflow.md +1 -1
  18. package/agent-skills/packs/hive-stateful-monitoring/SKILL.md +75 -0
  19. package/agent-skills/packs/hive-stateful-monitoring/evals/evals.json +49 -0
  20. package/agent-skills/packs/hive-tool-discovery/SKILL.md +1 -1
  21. package/agent-skills/references/agents-routing.md +2 -0
  22. package/agent-skills/scripts/validate-agent-skills-package.mjs +49 -11
  23. package/agent-skills/skills.sh.json +3 -2
  24. package/build/{alias-CZ3DEYHF.js → alias-3OPMQF4X.js} +2 -3
  25. package/build/{api-client-I23XLSHU.js → api-client-EPF6FD7A.js} +4 -4
  26. package/build/{auth-KKINNBXT.js → auth-Q5Q24IRI.js} +3 -4
  27. package/build/{browser-auth-EEFGRHWY.js → browser-auth-VPF5LZMZ.js} +2 -3
  28. package/build/{cache-EGNMENNA.js → cache-T6KC5YEY.js} +2 -3
  29. package/build/{chunk-KBVPIZS4.js → chunk-3WYWXTNN.js} +0 -1
  30. package/build/{chunk-2MYMHMBF.js → chunk-4F5CI6LX.js} +6 -6
  31. package/build/{chunk-RKICZ6DZ.js → chunk-5XXI25JE.js} +7 -8
  32. package/build/{chunk-IZTN7WFH.js → chunk-7JWXBKEJ.js} +5 -3
  33. package/build/chunk-CEWCB5YS.js +71 -0
  34. package/build/{chunk-MPIUUE3T.js → chunk-FH3YGSY5.js} +0 -1
  35. package/build/{chunk-QNCI4DEB.js → chunk-FRXMGRZQ.js} +35 -21
  36. package/build/{chunk-PGBVNMNZ.js → chunk-GZPDEXO4.js} +0 -1
  37. package/build/{chunk-UKHZIVDT.js → chunk-IZPAMRHP.js} +5 -6
  38. package/build/{chunk-2X3U4DFK.js → chunk-JTUKQWIO.js} +3267 -916
  39. package/build/{chunk-XYBEFFZ3.js → chunk-NP6NSOG2.js} +1 -2
  40. package/build/{chunk-V77LO4RO.js → chunk-POT2MBEK.js} +0 -1
  41. package/build/{chunk-B6G222LS.js → chunk-VBOKVQ74.js} +18 -3
  42. package/build/{chunk-DYJBTKNR.js → chunk-YZ2PXBJK.js} +5 -3
  43. package/build/chunk-ZCU7XQKF.js +14 -0
  44. package/build/{chunk-KGYBTXIN.js → chunk-ZTJVOWDQ.js} +0 -1
  45. package/build/{chunk-IDZD2NVG.js → chunk-ZXB53E7H.js} +5 -6
  46. package/build/cli.js +56 -54
  47. package/build/{completion-BELZL7ND.js → completion-46K674EL.js} +2 -3
  48. package/build/{config-TDX4VUGW.js → config-XE6Q5P4I.js} +3 -4
  49. package/build/{config-dir-V43W2WIA.js → config-dir-MAWX5AUF.js} +2 -3
  50. package/build/{doctor-5K5UWHNX.js → doctor-HGMQE6IN.js} +33 -9
  51. package/build/{errors-E6MVUBNA.js → errors-J2PH3NLJ.js} +2 -3
  52. package/build/{format-TSFSI2K7.js → format-5X2HIVDT.js} +1 -2
  53. package/build/{init-YQ5NBICF.js → init-JMDNM7ZZ.js} +1 -2
  54. package/build/{init-all-6OWEQALB.js → init-all-5SKNV75X.js} +10 -11
  55. package/build/{mcpServer-AEX3RQ4U.js → mcpServer-5TKKSKJM.js} +7 -6
  56. package/build/monitor-worker.js +1140 -0
  57. package/build/{namespace-PVHBFDW2.js → namespace-FSX2G3NM.js} +2 -3
  58. package/build/{open-YUIJP37F.js → open-5A6ZQMGC.js} +2 -3
  59. package/build/{output-IYJBFCYK.js → output-V3D4YZ6U.js} +2 -3
  60. package/build/{serve-KWNJK6EY.js → serve-AGCOXXFM.js} +9 -4
  61. package/build/server.js +437 -145
  62. package/build/{setup-YTUKMPNP.js → setup-RMETGJWK.js} +4 -5
  63. package/build/stdio.js +9 -8
  64. package/build/{telemetry-5IPRKZBL.js → telemetry-WCME5XEU.js} +4 -4
  65. package/build/{tools-PJHWFCAG.js → tools-KAB6QBZC.js} +15 -15
  66. package/build/{uninstall-HWXEIP6K.js → uninstall-FLJMBBSC.js} +7 -8
  67. package/build/update-check-LNZQK3XA.js +18 -0
  68. package/build/upgrade-DTUIHVPS.js +171 -0
  69. package/build/version-I6HDAF4L.js +14 -0
  70. package/build/{watch-KZ5EDZK3.js → watch-YNN255QX.js} +7 -7
  71. package/package.json +14 -9
  72. package/build/alias-CZ3DEYHF.js.map +0 -1
  73. package/build/api-client-I23XLSHU.js.map +0 -1
  74. package/build/auth-KKINNBXT.js.map +0 -1
  75. package/build/browser-auth-EEFGRHWY.js.map +0 -1
  76. package/build/cache-EGNMENNA.js.map +0 -1
  77. package/build/chunk-2MYMHMBF.js.map +0 -1
  78. package/build/chunk-2X3U4DFK.js.map +0 -1
  79. package/build/chunk-B6G222LS.js.map +0 -1
  80. package/build/chunk-DYJBTKNR.js.map +0 -1
  81. package/build/chunk-IDZD2NVG.js.map +0 -1
  82. package/build/chunk-IZTN7WFH.js.map +0 -1
  83. package/build/chunk-KBVPIZS4.js.map +0 -1
  84. package/build/chunk-KGYBTXIN.js.map +0 -1
  85. package/build/chunk-MPIUUE3T.js.map +0 -1
  86. package/build/chunk-PGBVNMNZ.js.map +0 -1
  87. package/build/chunk-QNCI4DEB.js.map +0 -1
  88. package/build/chunk-RKICZ6DZ.js.map +0 -1
  89. package/build/chunk-UKHZIVDT.js.map +0 -1
  90. package/build/chunk-V77LO4RO.js.map +0 -1
  91. package/build/chunk-XYBEFFZ3.js.map +0 -1
  92. package/build/cli.js.map +0 -1
  93. package/build/completion-BELZL7ND.js.map +0 -1
  94. package/build/config-TDX4VUGW.js.map +0 -1
  95. package/build/config-dir-V43W2WIA.js.map +0 -1
  96. package/build/doctor-5K5UWHNX.js.map +0 -1
  97. package/build/errors-E6MVUBNA.js.map +0 -1
  98. package/build/format-TSFSI2K7.js.map +0 -1
  99. package/build/init-YQ5NBICF.js.map +0 -1
  100. package/build/init-all-6OWEQALB.js.map +0 -1
  101. package/build/mcpServer-AEX3RQ4U.js.map +0 -1
  102. package/build/namespace-PVHBFDW2.js.map +0 -1
  103. package/build/open-YUIJP37F.js.map +0 -1
  104. package/build/output-IYJBFCYK.js.map +0 -1
  105. package/build/serve-KWNJK6EY.js.map +0 -1
  106. package/build/server.js.map +0 -1
  107. package/build/setup-YTUKMPNP.js.map +0 -1
  108. package/build/stdio.js.map +0 -1
  109. package/build/telemetry-5IPRKZBL.js.map +0 -1
  110. package/build/tools-PJHWFCAG.js.map +0 -1
  111. package/build/uninstall-HWXEIP6K.js.map +0 -1
  112. package/build/watch-KZ5EDZK3.js.map +0 -1
@@ -0,0 +1,71 @@
1
+ import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ createToolNotFoundResult,
4
+ executeEndpoint,
5
+ getAllWrappedEndpoints,
6
+ getSharedClients,
7
+ resolveEndpoint,
8
+ secureLogger
9
+ } from "./chunk-JTUKQWIO.js";
10
+
11
+ // src/services/tool-execution.ts
12
+ async function executeToolByName(toolName, args) {
13
+ const allEndpoints = getAllWrappedEndpoints();
14
+ const lookup = resolveEndpoint(allEndpoints, toolName);
15
+ if (!lookup.ok) {
16
+ const result2 = createToolNotFoundResult(toolName);
17
+ secureLogger.toolCall(toolName, false, result2.durationMs, {
18
+ transport: "rest",
19
+ runtimeStatus: "failing",
20
+ errorClass: "not_found"
21
+ });
22
+ return {
23
+ ok: false,
24
+ error: result2.error,
25
+ durationMs: result2.durationMs,
26
+ meta: result2.hive
27
+ };
28
+ }
29
+ const result = await executeEndpoint(lookup.endpoint, args, {
30
+ transport: "rest",
31
+ clients: getSharedClients()
32
+ });
33
+ if (result.validationErrors) {
34
+ return {
35
+ ok: false,
36
+ error: result.error,
37
+ validationErrors: result.validationErrors,
38
+ durationMs: result.durationMs,
39
+ meta: result.hive
40
+ };
41
+ }
42
+ if (result.ok) {
43
+ return {
44
+ ok: true,
45
+ data: result.data,
46
+ durationMs: result.durationMs,
47
+ meta: result.hive
48
+ };
49
+ }
50
+ if (result.error?.code === "PROVIDER_UNAVAILABLE") {
51
+ return {
52
+ ok: false,
53
+ error: result.error,
54
+ durationMs: result.durationMs,
55
+ meta: result.hive
56
+ };
57
+ }
58
+ if (result.error?.code === "INTERNAL_ERROR") {
59
+ secureLogger.error(`[tool-execution] ${toolName} threw`, result.error, {});
60
+ }
61
+ return {
62
+ ok: false,
63
+ error: result.error,
64
+ durationMs: result.durationMs,
65
+ meta: result.hive
66
+ };
67
+ }
68
+
69
+ export {
70
+ executeToolByName
71
+ };
@@ -660,4 +660,3 @@ export {
660
660
  resolveCommand,
661
661
  getAllDomainCommands
662
662
  };
663
- //# sourceMappingURL=chunk-MPIUUE3T.js.map
@@ -1,18 +1,18 @@
1
1
  import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
2
  import {
3
+ REGISTRY_PACKAGE,
3
4
  SERVER_VERSION
4
- } from "./chunk-2X3U4DFK.js";
5
+ } from "./chunk-ZCU7XQKF.js";
5
6
  import {
6
7
  ensureConfigDir,
7
8
  getConfigDir,
8
9
  readJsonFile,
9
10
  writeJsonFile
10
- } from "./chunk-V77LO4RO.js";
11
+ } from "./chunk-POT2MBEK.js";
11
12
 
12
13
  // src/cli/update-check.ts
13
14
  import { join } from "path";
14
15
  var CACHE_TTL_MS = 864e5;
15
- var REGISTRY_PACKAGE = "hive-intelligence";
16
16
  function getCachePath() {
17
17
  return join(getConfigDir(), "cache", "update-check.json");
18
18
  }
@@ -20,7 +20,7 @@ async function checkForUpdates() {
20
20
  if (shouldSkipUpdateCheck(process.argv, process.env)) {
21
21
  return;
22
22
  }
23
- const cached = readJsonFile(getCachePath());
23
+ const cached = readUpdateCache();
24
24
  if (cached?.checkedAt) {
25
25
  const age = Date.now() - new Date(cached.checkedAt).getTime();
26
26
  if (age < CACHE_TTL_MS) {
@@ -30,36 +30,47 @@ async function checkForUpdates() {
30
30
  return;
31
31
  }
32
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) {
33
43
  try {
34
44
  const controller = new AbortController();
35
- const timeout = setTimeout(() => controller.abort(), 3e3);
45
+ const timeout = setTimeout(() => controller.abort(), timeoutMs);
36
46
  const res = await fetch(
37
47
  `https://registry.npmjs.org/${REGISTRY_PACKAGE}/latest`,
38
- {
39
- signal: controller.signal
40
- }
48
+ { signal: controller.signal }
41
49
  );
42
50
  clearTimeout(timeout);
43
- if (!res.ok) return;
51
+ if (!res.ok) return null;
44
52
  const data = await res.json();
45
- ensureConfigDir();
46
- writeJsonFile(getCachePath(), {
47
- checkedAt: (/* @__PURE__ */ new Date()).toISOString(),
48
- latestVersion: data.version ?? null
49
- });
50
- if (!data.version || !isNewerVersion(data.version, SERVER_VERSION)) return;
51
- showUpdateMessage(data.version);
53
+ return data.version ?? null;
52
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;
53
65
  }
66
+ return null;
54
67
  }
55
68
  function shouldSkipUpdateCheck(argv = process.argv, env = process.env) {
56
69
  if (env.CI || env.HIVE_NO_UPDATE_CHECK) return true;
57
70
  if (env.NODE_ENV === "test" || env.VITEST || env.VITEST_WORKER_ID) {
58
71
  return true;
59
72
  }
60
- return argv.some(
61
- (arg) => ["--help", "-h", "--version", "-V"].includes(arg)
62
- );
73
+ return argv.some((arg) => ["--help", "-h", "--version", "-V"].includes(arg));
63
74
  }
64
75
  function isNewerVersion(candidate, current) {
65
76
  const parse = (version) => version.replace(/^[^\d]*/, "").split(/[.-]/).slice(0, 3).map((part) => Number.parseInt(part, 10) || 0);
@@ -83,6 +94,9 @@ Update available: ${SERVER_VERSION} \u2192 ${newVersion}
83
94
  }
84
95
 
85
96
  export {
86
- checkForUpdates
97
+ checkForUpdates,
98
+ fetchLatestVersion,
99
+ getPendingUpdateVersion,
100
+ shouldSkipUpdateCheck,
101
+ isNewerVersion
87
102
  };
88
- //# sourceMappingURL=chunk-QNCI4DEB.js.map
@@ -124,4 +124,3 @@ Opening browser to sign in...
124
124
  export {
125
125
  browserLogin
126
126
  };
127
- //# sourceMappingURL=chunk-PGBVNMNZ.js.map
@@ -1,15 +1,15 @@
1
1
  import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
- import {
3
- trackCommand
4
- } from "./chunk-DYJBTKNR.js";
5
2
  import {
6
3
  executeRemoteTool
7
- } from "./chunk-IZTN7WFH.js";
4
+ } from "./chunk-7JWXBKEJ.js";
5
+ import {
6
+ trackCommand
7
+ } from "./chunk-YZ2PXBJK.js";
8
8
  import {
9
9
  debug,
10
10
  shouldOutputJson,
11
11
  writeOutput
12
- } from "./chunk-XYBEFFZ3.js";
12
+ } from "./chunk-NP6NSOG2.js";
13
13
 
14
14
  // src/cli/execute.ts
15
15
  import ora from "ora";
@@ -41,4 +41,3 @@ async function executeTool(toolName, args, timeoutMs = 3e4) {
41
41
  export {
42
42
  executeTool
43
43
  };
44
- //# sourceMappingURL=chunk-UKHZIVDT.js.map