hive-intelligence 1.6.3 → 1.7.1
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/README.md +10 -4
- package/agent-skills/.claude-plugin/plugin.json +10 -0
- package/agent-skills/README.md +2 -0
- package/agent-skills/SKILL.md +18 -6
- package/agent-skills/evals/trigger-queries.json +70 -0
- package/agent-skills/package.json +3 -1
- package/agent-skills/packs/hive/SKILL.md +382 -0
- package/agent-skills/packs/hive/evals/evals.json +50 -0
- package/agent-skills/packs/hive/evals/triggers.json +15 -0
- package/agent-skills/packs/hive-build-onboarding/SKILL.md +1 -1
- package/agent-skills/packs/hive-cli/SKILL.md +2 -2
- package/agent-skills/packs/hive-mcp/SKILL.md +9 -5
- package/agent-skills/packs/hive-prediction-markets/SKILL.md +145 -0
- package/agent-skills/packs/hive-prediction-markets/evals/evals.json +29 -0
- package/agent-skills/packs/hive-prediction-markets/evals/triggers.json +14 -0
- package/agent-skills/packs/hive-query/SKILL.md +2 -1
- package/agent-skills/packs/hive-stateful-monitoring/SKILL.md +3 -3
- package/agent-skills/references/agents-routing.md +4 -1
- package/agent-skills/scripts/validate-agent-skills-package.mjs +2 -0
- package/agent-skills/skills.sh.json +9 -1
- package/build/{api-client-6AM3HVHQ.js → api-client-UGNFUZ2L.js} +12 -3
- package/build/{auth-4LPSQJXD.js → auth-5TLYP2DC.js} +1 -1
- package/build/call-args-NVOYX6DL.js +27 -0
- package/build/{chunk-XZJICKAL.js → chunk-2C5FBG7B.js} +4 -3
- package/build/{chunk-IJ5KOZH5.js → chunk-3SQPLZW6.js} +42730 -39105
- package/build/{chunk-S4HBVZ7O.js → chunk-3Z5VR53Z.js} +36 -7
- package/build/{chunk-GADPH72D.js → chunk-4QDGA6GP.js} +52 -1
- package/build/{chunk-2SPCKQBJ.js → chunk-5QAXJON7.js} +71 -0
- package/build/{chunk-GYVF75XB.js → chunk-FQNW6SZ6.js} +1 -1
- package/build/{chunk-LW2DHE32.js → chunk-L4KVJDA7.js} +1 -1
- package/build/chunk-POPAEM4E.js +474 -0
- package/build/{chunk-P7NLFSZQ.js → chunk-TWYGJEVN.js} +100 -9
- package/build/{chunk-32NRUWXA.js → chunk-UPWYFTTJ.js} +3 -3
- package/build/{chunk-KUF754NT.js → chunk-WII7MTYZ.js} +52 -12
- package/build/chunk-XN3T6YOG.js +32 -0
- package/build/chunk-XT6RURQV.js +394 -0
- package/build/{chunk-LP5ECG7A.js → chunk-ZDXMZPC6.js} +26 -2
- package/build/cli.js +120 -48
- package/build/{completion-YVSWWF6D.js → completion-ROZAH667.js} +1 -1
- package/build/{doctor-YBCU5FLQ.js → doctor-44WSVNGJ.js} +42 -5
- package/build/{errors-EL6UMXNJ.js → errors-W3GXQN34.js} +7 -1
- package/build/feedback-FRRLZDAF.js +113 -0
- package/build/{init-all-54G3CVZA.js → init-all-LYRFE2YQ.js} +5 -5
- package/build/{mcpServer-V4XUSCX7.js → mcpServer-43LTLURB.js} +2 -2
- package/build/monitor-worker.js +62 -10
- package/build/{namespace-PA2IDNRT.js → namespace-XMFFW47T.js} +1 -1
- package/build/{output-XGTE4EWJ.js → output-BBHBJI32.js} +5 -1
- package/build/release.json +4 -4
- package/build/routing-CP43PP5F.js +43 -0
- package/build/{serve-SU67DIY3.js → serve-LTMDRKXS.js} +1 -1
- package/build/server.js +295 -41
- package/build/stdio.js +2 -2
- package/build/{tools-FNPMELSU.js → tools-VA7JXD3K.js} +81 -33
- package/build/{uninstall-P3JJZCXT.js → uninstall-3KJLHTNM.js} +26 -7
- package/build/{upgrade-ATIFZANV.js → upgrade-3NR3LAGU.js} +2 -2
- package/build/{watch-FG2C5Y2Z.js → watch-HJOTI32P.js} +5 -3
- package/package.json +1 -1
package/build/cli.js
CHANGED
|
@@ -2,15 +2,21 @@
|
|
|
2
2
|
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
executeTool
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import
|
|
7
|
-
ExitCode
|
|
8
|
-
} from "./chunk-S4HBVZ7O.js";
|
|
5
|
+
} from "./chunk-WII7MTYZ.js";
|
|
6
|
+
import "./chunk-XN3T6YOG.js";
|
|
9
7
|
import {
|
|
10
8
|
NAMESPACE
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-5QAXJON7.js";
|
|
10
|
+
import "./chunk-TWYGJEVN.js";
|
|
13
11
|
import "./chunk-RU6QOFHH.js";
|
|
12
|
+
import {
|
|
13
|
+
ALWAYS_RESERVED_OPTIONS,
|
|
14
|
+
parseFlagTokens,
|
|
15
|
+
reservedOptionNames
|
|
16
|
+
} from "./chunk-XT6RURQV.js";
|
|
17
|
+
import {
|
|
18
|
+
ExitCode
|
|
19
|
+
} from "./chunk-3Z5VR53Z.js";
|
|
14
20
|
import {
|
|
15
21
|
checkForUpdates
|
|
16
22
|
} from "./chunk-M6REON2I.js";
|
|
@@ -21,7 +27,7 @@ import {
|
|
|
21
27
|
import {
|
|
22
28
|
red,
|
|
23
29
|
setOutputOptions
|
|
24
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-ZDXMZPC6.js";
|
|
25
31
|
import {
|
|
26
32
|
setCliFlags
|
|
27
33
|
} from "./chunk-6PC3HUAK.js";
|
|
@@ -3421,6 +3427,13 @@ program2.name("hive").version(SERVER_VERSION).description(
|
|
|
3421
3427
|
write(process.stderr.isTTY ? red(str) : str);
|
|
3422
3428
|
}
|
|
3423
3429
|
}).showHelpAfterError("(use --help for usage)").option("--json", "Force JSON envelope output").option("--pretty", "Force human-readable output").option("--fields <list>", "Comma-separated fields to include in output").option("-q, --quiet", "Suppress all non-data output").option("-v, --verbose", "Show debug info").option("--no-color", "Disable ANSI colors").option("--env-file <path>", "Path to .env file", ".env").option("--timeout <ms>", "Tool execution timeout in ms", "30000").option("--no-retry", "Disable automatic retry on failure").option("--no-cache", "Bypass tool catalog cache").option("--jq <expr>", "Filter JSON output with query expression").option("--csv", "Output as CSV").option("--api-key <key>", "Override API key for this command");
|
|
3430
|
+
var RESERVED_LONG_FLAGS = [
|
|
3431
|
+
.../* @__PURE__ */ new Set([
|
|
3432
|
+
...program2.options.map((o) => o.long).filter((f) => Boolean(f)),
|
|
3433
|
+
...ALWAYS_RESERVED_OPTIONS
|
|
3434
|
+
])
|
|
3435
|
+
];
|
|
3436
|
+
var RESERVED_OPTION_NAMES = reservedOptionNames(RESERVED_LONG_FLAGS);
|
|
3424
3437
|
program2.hook("preAction", (thisCommand) => {
|
|
3425
3438
|
const opts = thisCommand.opts();
|
|
3426
3439
|
dotenv.config({ path: opts.envFile, quiet: true });
|
|
@@ -3440,7 +3453,7 @@ program2.hook("preAction", (thisCommand) => {
|
|
|
3440
3453
|
setCliFlags({ apiKey: opts.apiKey, noRetry: opts.retry === false });
|
|
3441
3454
|
});
|
|
3442
3455
|
program2.action(async () => {
|
|
3443
|
-
const { startStdio } = await import("./serve-
|
|
3456
|
+
const { startStdio } = await import("./serve-LTMDRKXS.js");
|
|
3444
3457
|
await startStdio(program2.opts().envFile);
|
|
3445
3458
|
});
|
|
3446
3459
|
program2.command("serve").description("Start the MCP server").option("--http", "Start HTTP server instead of stdio").option("--port <number>", "HTTP server port", "8080").action(async (opts) => {
|
|
@@ -3453,10 +3466,10 @@ program2.command("serve").description("Start the MCP server").option("--http", "
|
|
|
3453
3466
|
);
|
|
3454
3467
|
process.exit(ExitCode.INVALID_ARGS);
|
|
3455
3468
|
}
|
|
3456
|
-
const { startHttp } = await import("./serve-
|
|
3469
|
+
const { startHttp } = await import("./serve-LTMDRKXS.js");
|
|
3457
3470
|
await startHttp(port, program2.opts().envFile);
|
|
3458
3471
|
} else {
|
|
3459
|
-
const { startStdio } = await import("./serve-
|
|
3472
|
+
const { startStdio } = await import("./serve-LTMDRKXS.js");
|
|
3460
3473
|
await startStdio(program2.opts().envFile);
|
|
3461
3474
|
}
|
|
3462
3475
|
});
|
|
@@ -3543,44 +3556,73 @@ for (const domain of NAMESPACE) {
|
|
|
3543
3556
|
}
|
|
3544
3557
|
var toolsCmd = program2.command("tools").description("Discover and execute tools");
|
|
3545
3558
|
toolsCmd.command("list").description("List all registered tools").option("--category <name>", "Filter by category").option("--provider <name>", "Filter by provider prefix").option("--limit <n>", "Max tools to show", "50").option("--offset <n>", "Skip first N tools", "0").action(async (opts) => {
|
|
3546
|
-
const { listTools } = await import("./tools-
|
|
3559
|
+
const { listTools } = await import("./tools-VA7JXD3K.js");
|
|
3547
3560
|
await listTools(opts);
|
|
3548
3561
|
});
|
|
3549
3562
|
toolsCmd.command("search <query>").description("Search tools by name or description").action(async (query) => {
|
|
3550
|
-
const { searchTools } = await import("./tools-
|
|
3563
|
+
const { searchTools } = await import("./tools-VA7JXD3K.js");
|
|
3551
3564
|
await searchTools(query);
|
|
3552
3565
|
});
|
|
3553
|
-
toolsCmd.command("info <name>").description("Show
|
|
3554
|
-
const { toolInfo } = await import("./tools-
|
|
3555
|
-
await toolInfo(name);
|
|
3566
|
+
toolsCmd.command("info <name>").description("Show a tool's parameters, response schema, and description").action(async (name) => {
|
|
3567
|
+
const { toolInfo } = await import("./tools-VA7JXD3K.js");
|
|
3568
|
+
await toolInfo(name, RESERVED_OPTION_NAMES);
|
|
3556
3569
|
});
|
|
3557
|
-
toolsCmd.command("call <name>").description("Execute a tool by name").option("--args <json>", "Tool arguments as JSON (or pipe JSON via stdin)").
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3570
|
+
toolsCmd.command("call <name>").description("Execute a tool by name").option("--args <json>", "Tool arguments as JSON (or pipe JSON via stdin)").allowUnknownOption(true).allowExcessArguments(true).addHelpText(
|
|
3571
|
+
"after",
|
|
3572
|
+
`
|
|
3573
|
+
Parameters:
|
|
3574
|
+
Every parameter in the tool's schema is accepted as a flag, in kebab-case
|
|
3575
|
+
or snake_case: --vs-currencies usd, --vs_currencies usd. Values are typed
|
|
3576
|
+
from the schema (integer, number, boolean, array via comma-separated or
|
|
3577
|
+
repeated flags, object via JSON). --no-<param> sets a boolean false.
|
|
3578
|
+
Flags win over --args. Run 'hive tools info <name>' for the table.
|
|
3579
|
+
|
|
3580
|
+
Reserved names (${RESERVED_LONG_FLAGS.join(", ")})
|
|
3581
|
+
belong to the CLI; a parameter with one of these names is only reachable
|
|
3582
|
+
through --args '<json>'.
|
|
3583
|
+
|
|
3584
|
+
Examples:
|
|
3585
|
+
$ hive tools call get_price --ids bitcoin --vs-currencies usd
|
|
3586
|
+
$ hive tools call get_price --args '{"ids":"bitcoin","vs_currencies":"usd"}'
|
|
3587
|
+
$ echo '{"ids":"bitcoin"}' | hive tools call get_price`
|
|
3588
|
+
).action(async (_name, opts, cmd) => {
|
|
3589
|
+
const { planToolCall } = await import("./call-args-NVOYX6DL.js");
|
|
3590
|
+
const { CliError } = await import("./errors-W3GXQN34.js");
|
|
3591
|
+
const { outputError } = await import("./output-BBHBJI32.js");
|
|
3592
|
+
const tokens = cmd.args;
|
|
3593
|
+
let stdinJson;
|
|
3594
|
+
if (!opts.args && tokens.length <= 1 && !process.stdin.isTTY) {
|
|
3567
3595
|
const chunks = [];
|
|
3568
3596
|
for await (const chunk of process.stdin) chunks.push(chunk);
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3597
|
+
stdinJson = Buffer.concat(chunks).toString("utf-8").trim();
|
|
3598
|
+
}
|
|
3599
|
+
let plan;
|
|
3600
|
+
try {
|
|
3601
|
+
plan = await planToolCall({
|
|
3602
|
+
tokens,
|
|
3603
|
+
argsJson: opts.args,
|
|
3604
|
+
stdinJson,
|
|
3605
|
+
reservedNames: RESERVED_OPTION_NAMES,
|
|
3606
|
+
lookupSchema: async (toolName) => {
|
|
3607
|
+
const { loadToolCatalog } = await import("./tools-VA7JXD3K.js");
|
|
3608
|
+
const catalog = await loadToolCatalog();
|
|
3609
|
+
return catalog.find((t) => t.name === toolName)?.inputSchema;
|
|
3576
3610
|
}
|
|
3611
|
+
});
|
|
3612
|
+
} catch (err) {
|
|
3613
|
+
if (err instanceof CliError) {
|
|
3614
|
+
await outputError(err, {
|
|
3615
|
+
tool: parseFlagTokens(tokens).positionals[0]
|
|
3616
|
+
});
|
|
3617
|
+
return;
|
|
3577
3618
|
}
|
|
3619
|
+
throw err;
|
|
3578
3620
|
}
|
|
3579
3621
|
const timeout = parseInt(program2.opts().timeout, 10);
|
|
3580
|
-
await executeTool(
|
|
3622
|
+
await executeTool(plan.toolName, plan.args, timeout);
|
|
3581
3623
|
});
|
|
3582
3624
|
toolsCmd.command("refresh").description("Force-refresh the tool catalog cache").action(async () => {
|
|
3583
|
-
const { refreshTools } = await import("./tools-
|
|
3625
|
+
const { refreshTools } = await import("./tools-VA7JXD3K.js");
|
|
3584
3626
|
await refreshTools();
|
|
3585
3627
|
});
|
|
3586
3628
|
var configCmd = program2.command("config").description("Generate configuration for MCP clients");
|
|
@@ -3639,7 +3681,7 @@ program2.command("init").description(
|
|
|
3639
3681
|
await runSetup();
|
|
3640
3682
|
return;
|
|
3641
3683
|
}
|
|
3642
|
-
const { runInitAll } = await import("./init-all-
|
|
3684
|
+
const { runInitAll } = await import("./init-all-LYRFE2YQ.js");
|
|
3643
3685
|
const exitCode = await runInitAll({
|
|
3644
3686
|
all: Boolean(opts.all),
|
|
3645
3687
|
browser: Boolean(opts.browser),
|
|
@@ -3657,7 +3699,7 @@ program2.command("uninstall").description(
|
|
|
3657
3699
|
"--all",
|
|
3658
3700
|
"Clean every known client (default; explicit flag for symmetry with `init --all`)"
|
|
3659
3701
|
).option("--dry-run", "Preview removals without changing anything").action(async (opts) => {
|
|
3660
|
-
const { runUninstall } = await import("./uninstall-
|
|
3702
|
+
const { runUninstall } = await import("./uninstall-3KJLHTNM.js");
|
|
3661
3703
|
const exitCode = await runUninstall({
|
|
3662
3704
|
all: opts.all !== false,
|
|
3663
3705
|
dryRun: Boolean(opts.dryRun),
|
|
@@ -3665,20 +3707,46 @@ program2.command("uninstall").description(
|
|
|
3665
3707
|
});
|
|
3666
3708
|
if (exitCode !== 0) process.exit(exitCode);
|
|
3667
3709
|
});
|
|
3710
|
+
var routingCmd = program2.command("routing").description(
|
|
3711
|
+
"Install or remove the Hive routing block in AGENTS.md or CLAUDE.md"
|
|
3712
|
+
);
|
|
3713
|
+
for (const action of ["install", "decline", "remove"]) {
|
|
3714
|
+
routingCmd.command(action).description(
|
|
3715
|
+
action === "install" ? "Append the Hive routing block (AGENTS.md preferred over CLAUDE.md)" : action === "decline" ? "Record that this project does not want the routing block" : "Remove the routing block and restore the file's original bytes"
|
|
3716
|
+
).option("--file <name>", "Target file: AGENTS.md or CLAUDE.md").option("--dry-run", "Print the resulting file; write nothing").option("--create", "Create the target file when it does not exist").action(async (opts) => {
|
|
3717
|
+
const { runRouting } = await import("./routing-CP43PP5F.js");
|
|
3718
|
+
const exitCode = await runRouting(action, {
|
|
3719
|
+
file: opts.file,
|
|
3720
|
+
dryRun: Boolean(opts.dryRun),
|
|
3721
|
+
create: Boolean(opts.create),
|
|
3722
|
+
json: Boolean(program2.opts().json)
|
|
3723
|
+
});
|
|
3724
|
+
if (exitCode !== 0) process.exit(exitCode);
|
|
3725
|
+
});
|
|
3726
|
+
}
|
|
3727
|
+
program2.command("feedback <message>").description(
|
|
3728
|
+
"Send product feedback (up to 1,000 characters), optionally tied to a tool and receipt"
|
|
3729
|
+
).option("--tool <name>", "Tool the feedback is about").option(
|
|
3730
|
+
"--receipt <id>",
|
|
3731
|
+
"Receipt ID (defaults to the last successful call's receipt)"
|
|
3732
|
+
).action(async (message, opts) => {
|
|
3733
|
+
const { runFeedback } = await import("./feedback-FRRLZDAF.js");
|
|
3734
|
+
await runFeedback(message, { tool: opts.tool, receipt: opts.receipt });
|
|
3735
|
+
});
|
|
3668
3736
|
program2.command("doctor").description("Diagnose environment and server connectivity").option("--probe", "Run live API probes (slower)").action(async (opts) => {
|
|
3669
|
-
const { runDoctor } = await import("./doctor-
|
|
3737
|
+
const { runDoctor } = await import("./doctor-44WSVNGJ.js");
|
|
3670
3738
|
await runDoctor(opts);
|
|
3671
3739
|
});
|
|
3672
3740
|
program2.command("upgrade").description("Update Hive to the latest published version").action(async () => {
|
|
3673
|
-
const { runUpgrade } = await import("./upgrade-
|
|
3741
|
+
const { runUpgrade } = await import("./upgrade-3NR3LAGU.js");
|
|
3674
3742
|
await runUpgrade();
|
|
3675
3743
|
});
|
|
3676
3744
|
program2.command("completion <shell>").description("Generate shell completion script (bash, zsh, fish, powershell)").option("--install", "Auto-install to shell rc file").action(async (shell, opts) => {
|
|
3677
3745
|
if (opts.install) {
|
|
3678
|
-
const { installCompletion } = await import("./completion-
|
|
3746
|
+
const { installCompletion } = await import("./completion-ROZAH667.js");
|
|
3679
3747
|
await installCompletion(shell);
|
|
3680
3748
|
} else {
|
|
3681
|
-
const { generateCompletion } = await import("./completion-
|
|
3749
|
+
const { generateCompletion } = await import("./completion-ROZAH667.js");
|
|
3682
3750
|
await generateCompletion(shell);
|
|
3683
3751
|
}
|
|
3684
3752
|
});
|
|
@@ -3690,31 +3758,31 @@ program2.command("keys").description("Retired \u2014 manage API keys in the dash
|
|
|
3690
3758
|
});
|
|
3691
3759
|
var authCmd = program2.command("auth").description("Manage authentication profiles");
|
|
3692
3760
|
authCmd.command("login").description("Log in via browser (or --manual to paste API key)").option("--profile <name>", "Profile name", "default").option("--manual", "Manually paste API key instead of browser login").action(async (opts) => {
|
|
3693
|
-
const { runLogin } = await import("./auth-
|
|
3761
|
+
const { runLogin } = await import("./auth-5TLYP2DC.js");
|
|
3694
3762
|
await runLogin(opts);
|
|
3695
3763
|
});
|
|
3696
3764
|
authCmd.command("logout").description("Remove stored credentials").action(async () => {
|
|
3697
|
-
const { runLogout } = await import("./auth-
|
|
3765
|
+
const { runLogout } = await import("./auth-5TLYP2DC.js");
|
|
3698
3766
|
await runLogout();
|
|
3699
3767
|
});
|
|
3700
3768
|
authCmd.command("whoami").description("Show current profile").action(async () => {
|
|
3701
|
-
const { runWhoami } = await import("./auth-
|
|
3769
|
+
const { runWhoami } = await import("./auth-5TLYP2DC.js");
|
|
3702
3770
|
await runWhoami();
|
|
3703
3771
|
});
|
|
3704
3772
|
authCmd.command("profiles").description("List all profiles").action(async () => {
|
|
3705
|
-
const { runProfiles } = await import("./auth-
|
|
3773
|
+
const { runProfiles } = await import("./auth-5TLYP2DC.js");
|
|
3706
3774
|
await runProfiles();
|
|
3707
3775
|
});
|
|
3708
3776
|
authCmd.command("switch <name>").description("Switch active profile").action(async (name) => {
|
|
3709
|
-
const { runSwitch } = await import("./auth-
|
|
3777
|
+
const { runSwitch } = await import("./auth-5TLYP2DC.js");
|
|
3710
3778
|
await runSwitch(name);
|
|
3711
3779
|
});
|
|
3712
3780
|
program2.command("usage").description("Show your API usage and plan limits").action(async () => {
|
|
3713
|
-
const { runUsage } = await import("./auth-
|
|
3781
|
+
const { runUsage } = await import("./auth-5TLYP2DC.js");
|
|
3714
3782
|
await runUsage();
|
|
3715
3783
|
});
|
|
3716
3784
|
program2.command("status").description("Quick health and version check").action(async () => {
|
|
3717
|
-
const { runStatus } = await import("./doctor-
|
|
3785
|
+
const { runStatus } = await import("./doctor-44WSVNGJ.js");
|
|
3718
3786
|
await runStatus();
|
|
3719
3787
|
});
|
|
3720
3788
|
program2.command("open [target]").description("Open Hive dashboard, docs, status, or GitHub in browser").action(async (target) => {
|
|
@@ -3745,7 +3813,7 @@ program2.command("watch <domain> <command>").description("Poll a tool on interva
|
|
|
3745
3813
|
}
|
|
3746
3814
|
const interval = parseInt(opts.interval, 10);
|
|
3747
3815
|
const timeout = parseInt(program2.opts().timeout, 10);
|
|
3748
|
-
const { runWatch } = await import("./watch-
|
|
3816
|
+
const { runWatch } = await import("./watch-HJOTI32P.js");
|
|
3749
3817
|
await runWatch(cmdDef.tool, args, interval, timeout);
|
|
3750
3818
|
});
|
|
3751
3819
|
var aliasCmd = program2.command("alias").description("Manage command aliases");
|
|
@@ -3797,6 +3865,10 @@ Examples:
|
|
|
3797
3865
|
$ hive defi tvl --protocol aave
|
|
3798
3866
|
$ hive security scan --chain 1 --address 0x...
|
|
3799
3867
|
$ hive tools search "price" --jq ".[] | .name"
|
|
3868
|
+
$ hive tools call get_price --ids bitcoin --vs-currencies usd
|
|
3869
|
+
$ hive archive funding --base-coin BTC --limit 50
|
|
3870
|
+
$ hive feedback "the funding history was exactly what I needed"
|
|
3871
|
+
$ hive routing install
|
|
3800
3872
|
$ hive status
|
|
3801
3873
|
$ hive alias set btc 'market price --ids bitcoin --vs usd'
|
|
3802
3874
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
-
fetchToolCatalog
|
|
4
|
-
|
|
3
|
+
fetchToolCatalog,
|
|
4
|
+
getAnonQuota
|
|
5
|
+
} from "./chunk-TWYGJEVN.js";
|
|
6
|
+
import "./chunk-3Z5VR53Z.js";
|
|
5
7
|
import "./chunk-ZXKFJQDE.js";
|
|
6
8
|
import {
|
|
7
9
|
debug,
|
|
@@ -9,7 +11,7 @@ import {
|
|
|
9
11
|
shouldOutputJson,
|
|
10
12
|
successEnvelope,
|
|
11
13
|
writeOutput
|
|
12
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZDXMZPC6.js";
|
|
13
15
|
import "./chunk-6PC3HUAK.js";
|
|
14
16
|
import "./chunk-OMO7XLC5.js";
|
|
15
17
|
|
|
@@ -18,6 +20,27 @@ var DEFAULT_API_URL = "https://mcp.hiveintelligence.xyz";
|
|
|
18
20
|
function getApiUrl() {
|
|
19
21
|
return process.env.HIVE_API_URL || DEFAULT_API_URL;
|
|
20
22
|
}
|
|
23
|
+
function describeQuotaCheck(quota) {
|
|
24
|
+
const check = "Keyless quota";
|
|
25
|
+
if (quota.status === 404) {
|
|
26
|
+
return {
|
|
27
|
+
check,
|
|
28
|
+
status: "INFO",
|
|
29
|
+
detail: "quota: unavailable on this server"
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const data = quota.body?.ok && quota.body.data && typeof quota.body.data === "object" ? quota.body.data : null;
|
|
33
|
+
if (data && typeof data.remaining === "number" && typeof data.limit === "number") {
|
|
34
|
+
const resetAt = typeof data.reset_at === "string" ? data.reset_at : "unknown";
|
|
35
|
+
return {
|
|
36
|
+
check,
|
|
37
|
+
status: "INFO",
|
|
38
|
+
detail: `keyless allowance today: ${data.remaining} of ${data.limit}, resets ${resetAt}`
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const reason = quota.body?.error?.message ?? `HTTP ${quota.status}`;
|
|
42
|
+
return { check, status: "WARN", detail: `quota: ${reason}` };
|
|
43
|
+
}
|
|
21
44
|
async function runDoctor(opts) {
|
|
22
45
|
const checks = [];
|
|
23
46
|
const apiKey = process.env.HIVE_API_KEY;
|
|
@@ -95,6 +118,19 @@ async function runDoctor(opts) {
|
|
|
95
118
|
});
|
|
96
119
|
}
|
|
97
120
|
}
|
|
121
|
+
{
|
|
122
|
+
debug("GET /api/v1/quota");
|
|
123
|
+
try {
|
|
124
|
+
checks.push(describeQuotaCheck(await getAnonQuota()));
|
|
125
|
+
} catch (err) {
|
|
126
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
127
|
+
checks.push({
|
|
128
|
+
check: "Keyless quota",
|
|
129
|
+
status: "WARN",
|
|
130
|
+
detail: `quota: unreachable (${msg})`
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
98
134
|
{
|
|
99
135
|
const { SERVER_VERSION } = await import("./version-ITRM4X2U.js");
|
|
100
136
|
const { fetchLatestVersion, isNewerVersion } = await import("./update-check-36QU6PKA.js");
|
|
@@ -204,9 +240,9 @@ ${fails === 0 ? "All checks passed" : `${fails} issues found`}${warns ? ` (${war
|
|
|
204
240
|
if (fails > 0) process.exit(1);
|
|
205
241
|
}
|
|
206
242
|
async function runStatus() {
|
|
207
|
-
const { SERVER_VERSION } = await import("./mcpServer-
|
|
243
|
+
const { SERVER_VERSION } = await import("./mcpServer-43LTLURB.js");
|
|
208
244
|
const { resolveApiKey, resolveApiUrl } = await import("./config-dir-2QLA5PXD.js");
|
|
209
|
-
const { getActiveProfile, maskKey } = await import("./auth-
|
|
245
|
+
const { getActiveProfile, maskKey } = await import("./auth-5TLYP2DC.js");
|
|
210
246
|
const apiUrl = resolveApiUrl();
|
|
211
247
|
const apiKey = resolveApiKey();
|
|
212
248
|
const profile = getActiveProfile();
|
|
@@ -250,6 +286,7 @@ Hive CLI v${SERVER_VERSION}
|
|
|
250
286
|
`);
|
|
251
287
|
}
|
|
252
288
|
export {
|
|
289
|
+
describeQuotaCheck,
|
|
253
290
|
runDoctor,
|
|
254
291
|
runStatus
|
|
255
292
|
};
|
|
@@ -3,14 +3,20 @@ import {
|
|
|
3
3
|
CliError,
|
|
4
4
|
ERROR_DOC_URLS,
|
|
5
5
|
ExitCode,
|
|
6
|
+
NEVER_RETRY_ERROR_CODES,
|
|
6
7
|
classifyError,
|
|
8
|
+
errorDocSlug,
|
|
9
|
+
isCliErrorCode,
|
|
7
10
|
suggestSimilarTools
|
|
8
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-3Z5VR53Z.js";
|
|
9
12
|
import "./chunk-OMO7XLC5.js";
|
|
10
13
|
export {
|
|
11
14
|
CliError,
|
|
12
15
|
ERROR_DOC_URLS,
|
|
13
16
|
ExitCode,
|
|
17
|
+
NEVER_RETRY_ERROR_CODES,
|
|
14
18
|
classifyError,
|
|
19
|
+
errorDocSlug,
|
|
20
|
+
isCliErrorCode,
|
|
15
21
|
suggestSimilarTools
|
|
16
22
|
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
readLastReceipt
|
|
4
|
+
} from "./chunk-XN3T6YOG.js";
|
|
5
|
+
import {
|
|
6
|
+
postFeedback
|
|
7
|
+
} from "./chunk-TWYGJEVN.js";
|
|
8
|
+
import {
|
|
9
|
+
CliError,
|
|
10
|
+
isCliErrorCode
|
|
11
|
+
} from "./chunk-3Z5VR53Z.js";
|
|
12
|
+
import {
|
|
13
|
+
SERVER_VERSION
|
|
14
|
+
} from "./chunk-ZXKFJQDE.js";
|
|
15
|
+
import {
|
|
16
|
+
info,
|
|
17
|
+
outputError,
|
|
18
|
+
shouldOutputJson,
|
|
19
|
+
successEnvelope,
|
|
20
|
+
writeOutput
|
|
21
|
+
} from "./chunk-ZDXMZPC6.js";
|
|
22
|
+
import "./chunk-6PC3HUAK.js";
|
|
23
|
+
import "./chunk-OMO7XLC5.js";
|
|
24
|
+
|
|
25
|
+
// src/cli/feedback.ts
|
|
26
|
+
var FEEDBACK_MAX_CHARS = 1e3;
|
|
27
|
+
function isFeedbackDisabled(env = process.env) {
|
|
28
|
+
return (env.HIVE_FEEDBACK ?? "").trim().toLowerCase() === "off";
|
|
29
|
+
}
|
|
30
|
+
function buildFeedbackPayload(message, opts, lastReceipt) {
|
|
31
|
+
let receiptId = opts.receipt;
|
|
32
|
+
let tool = opts.tool;
|
|
33
|
+
if (!receiptId && lastReceipt) {
|
|
34
|
+
receiptId = lastReceipt.receipt_id;
|
|
35
|
+
tool ??= lastReceipt.tool;
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
message,
|
|
39
|
+
...tool && { tool },
|
|
40
|
+
...receiptId && { receipt_id: receiptId },
|
|
41
|
+
client: `hive-cli/${SERVER_VERSION}`
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
async function runFeedback(message, opts = {}) {
|
|
45
|
+
if (isFeedbackDisabled()) {
|
|
46
|
+
if (shouldOutputJson()) {
|
|
47
|
+
await writeOutput(
|
|
48
|
+
successEnvelope(
|
|
49
|
+
{ sent: false, disabled: true, reason: "HIVE_FEEDBACK=off" },
|
|
50
|
+
{}
|
|
51
|
+
)
|
|
52
|
+
);
|
|
53
|
+
} else {
|
|
54
|
+
info("Feedback is disabled (HIVE_FEEDBACK=off); nothing was sent.");
|
|
55
|
+
}
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const text = message.trim();
|
|
59
|
+
if (!text) {
|
|
60
|
+
await outputError(
|
|
61
|
+
new CliError(
|
|
62
|
+
"VALIDATION_ERROR",
|
|
63
|
+
"Feedback message is empty",
|
|
64
|
+
'Usage: hive feedback "<message>" [--tool <name>] [--receipt <id>]'
|
|
65
|
+
),
|
|
66
|
+
{}
|
|
67
|
+
);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (text.length > FEEDBACK_MAX_CHARS) {
|
|
71
|
+
await outputError(
|
|
72
|
+
new CliError(
|
|
73
|
+
"VALIDATION_ERROR",
|
|
74
|
+
`Feedback message is ${text.length} characters; the limit is 1,000`,
|
|
75
|
+
"Shorten the message, or send the rest as a second `hive feedback` call"
|
|
76
|
+
),
|
|
77
|
+
{}
|
|
78
|
+
);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const payload = buildFeedbackPayload(text, opts, readLastReceipt());
|
|
82
|
+
const response = await postFeedback(payload);
|
|
83
|
+
const meta = response.meta ?? {};
|
|
84
|
+
if (!response.ok) {
|
|
85
|
+
const code = response.error?.code;
|
|
86
|
+
const detail = response.error?.message ?? "Feedback request failed";
|
|
87
|
+
const err = code === "FEEDBACK_RATE_LIMITED" ? new CliError(
|
|
88
|
+
"FEEDBACK_RATE_LIMITED",
|
|
89
|
+
detail,
|
|
90
|
+
"Wait for the reset before sending more feedback"
|
|
91
|
+
) : new CliError(
|
|
92
|
+
isCliErrorCode(code) ? code : "API_ERROR",
|
|
93
|
+
detail,
|
|
94
|
+
response.error?.suggestion
|
|
95
|
+
);
|
|
96
|
+
await outputError(err, meta);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (shouldOutputJson()) {
|
|
100
|
+
await writeOutput(successEnvelope(response.data, meta));
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const id = response.data?.id;
|
|
104
|
+
info(
|
|
105
|
+
typeof id === "string" ? `Feedback recorded: ${id}` : "Feedback recorded."
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
export {
|
|
109
|
+
FEEDBACK_MAX_CHARS,
|
|
110
|
+
buildFeedbackPayload,
|
|
111
|
+
isFeedbackDisabled,
|
|
112
|
+
runFeedback
|
|
113
|
+
};
|
|
@@ -2,7 +2,7 @@ import { createRequire } from 'node:module'; const require = createRequire(impor
|
|
|
2
2
|
import {
|
|
3
3
|
detectClients,
|
|
4
4
|
installSkillsForClients
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FQNW6SZ6.js";
|
|
6
6
|
import {
|
|
7
7
|
getClaudeDesktopInstructions,
|
|
8
8
|
getCodexInstructions,
|
|
@@ -22,12 +22,12 @@ import {
|
|
|
22
22
|
} from "./chunk-BDO27NIP.js";
|
|
23
23
|
import {
|
|
24
24
|
saveProfile
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-UPWYFTTJ.js";
|
|
26
26
|
import {
|
|
27
27
|
detectInstallMode
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-L4KVJDA7.js";
|
|
29
29
|
import "./chunk-M6REON2I.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-4QDGA6GP.js";
|
|
31
31
|
import "./chunk-ZXKFJQDE.js";
|
|
32
32
|
import {
|
|
33
33
|
bold,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
green,
|
|
36
36
|
red,
|
|
37
37
|
yellow
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-ZDXMZPC6.js";
|
|
39
39
|
import {
|
|
40
40
|
resolveApiKey,
|
|
41
41
|
resolveApiUrl
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
getToolsForScope,
|
|
10
10
|
memoizedJsonSchemaToZodInputSchema,
|
|
11
11
|
memoizedJsonSchemaToZodOutputSchema
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-3SQPLZW6.js";
|
|
13
|
+
import "./chunk-4QDGA6GP.js";
|
|
14
14
|
import "./chunk-EPF36Q3Z.js";
|
|
15
15
|
import {
|
|
16
16
|
PUBLIC_MCP_REGISTRY_ID,
|