@hydra-acp/cli 0.1.50 → 0.1.51
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/dist/cli.js +22 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -26122,6 +26122,19 @@ function createChunker(opts) {
|
|
|
26122
26122
|
// src/cli/commands/cat.ts
|
|
26123
26123
|
var DEFAULT_STREAM_THRESHOLD = 1 * 1024 * 1024;
|
|
26124
26124
|
var HYDRA_STDIN_TOOL_PREFIX = "mcp__hydra_stdin__";
|
|
26125
|
+
function deriveTitleFromPrompt(prompt) {
|
|
26126
|
+
if (!prompt) {
|
|
26127
|
+
return void 0;
|
|
26128
|
+
}
|
|
26129
|
+
for (const raw of prompt.split(/\r?\n/)) {
|
|
26130
|
+
const line = raw.trim();
|
|
26131
|
+
if (!line) {
|
|
26132
|
+
continue;
|
|
26133
|
+
}
|
|
26134
|
+
return line.length > 80 ? `${line.slice(0, 80)}\u2026` : line;
|
|
26135
|
+
}
|
|
26136
|
+
return void 0;
|
|
26137
|
+
}
|
|
26125
26138
|
function isHydraStdinPermissionRequest(params) {
|
|
26126
26139
|
if (!params || typeof params !== "object") {
|
|
26127
26140
|
return false;
|
|
@@ -26551,6 +26564,11 @@ async function openOrAttachSession(conn, opts, useAutoStream) {
|
|
|
26551
26564
|
const hydraMeta = {};
|
|
26552
26565
|
if (opts.name) {
|
|
26553
26566
|
hydraMeta.name = opts.name;
|
|
26567
|
+
} else {
|
|
26568
|
+
const derived = deriveTitleFromPrompt(opts.prompt);
|
|
26569
|
+
if (derived) {
|
|
26570
|
+
hydraMeta.name = derived;
|
|
26571
|
+
}
|
|
26554
26572
|
}
|
|
26555
26573
|
if (opts.model) {
|
|
26556
26574
|
hydraMeta.model = opts.model;
|
|
@@ -26660,7 +26678,9 @@ async function main() {
|
|
|
26660
26678
|
printHelp();
|
|
26661
26679
|
return;
|
|
26662
26680
|
}
|
|
26663
|
-
const
|
|
26681
|
+
const inlinePromptPresent = readShortPrompt(argv) !== void 0 || typeof flags.prompt === "string";
|
|
26682
|
+
const rawSubcommand = positional[0];
|
|
26683
|
+
const subcommand = rawSubcommand !== void 0 && !rawSubcommand.startsWith("-") ? rawSubcommand : inlinePromptPresent ? "cat" : rawSubcommand;
|
|
26664
26684
|
const name = resolveOption(flags, "name");
|
|
26665
26685
|
const agentIdFromFlag = resolveOption(flags, "agent");
|
|
26666
26686
|
const model = resolveOption(flags, "model");
|
|
@@ -27099,6 +27119,7 @@ function printHelp() {
|
|
|
27099
27119
|
"Usage:",
|
|
27100
27120
|
" hydra-acp [--session <id-or-url>] [--reattach] [opts]",
|
|
27101
27121
|
" Auto: TUI when stdout is a TTY, shim otherwise (the editor-spawned case).",
|
|
27122
|
+
" With -p / --prompt and no subcommand, auto-dispatch to cat.",
|
|
27102
27123
|
" hydra-acp tui [same flags] Force TUI explicitly.",
|
|
27103
27124
|
" hydra-acp shim [same flags] Force shim explicitly (non-interactive; password prompts not allowed).",
|
|
27104
27125
|
" hydra-acp cat [-p <prompt>] [--session <id-or-url>] [--detach] [--agent <id>] [--model <id>] [--name <label>]",
|