@bli-cockpit/cli 0.2.32 → 0.2.33
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/commands/jarvis.js
CHANGED
|
@@ -60,7 +60,11 @@ async function sendOneTurn(context, prompt, io) {
|
|
|
60
60
|
authorization: `Bearer ${context.deviceToken}`,
|
|
61
61
|
"content-type": "application/json",
|
|
62
62
|
},
|
|
63
|
-
body: JSON.stringify({
|
|
63
|
+
body: JSON.stringify({
|
|
64
|
+
question: prompt,
|
|
65
|
+
thread: context.command.thread,
|
|
66
|
+
subject: context.command.subject,
|
|
67
|
+
}),
|
|
64
68
|
});
|
|
65
69
|
}
|
|
66
70
|
catch (error) {
|
|
@@ -79,16 +83,19 @@ async function sendOneTurn(context, prompt, io) {
|
|
|
79
83
|
reply: body.reply,
|
|
80
84
|
thread: body.thread ?? context.command.thread,
|
|
81
85
|
model: body.model ?? null,
|
|
86
|
+
subject: body.subject ?? null,
|
|
82
87
|
}));
|
|
83
88
|
}
|
|
84
89
|
else {
|
|
85
|
-
|
|
90
|
+
const subject = body.subject?.displayName ? ` (${body.subject.displayName})` : "";
|
|
91
|
+
writeLine(io.stdout, `jarvis${subject}> ${body.reply}`);
|
|
86
92
|
}
|
|
87
93
|
writeLine(io.stderr, `[jarvis cli] answered ${JSON.stringify({
|
|
88
94
|
prompt_length: prompt.length,
|
|
89
95
|
reply_length: body.reply.length,
|
|
90
96
|
elapsed_ms: Date.now() - startedAt,
|
|
91
97
|
thread: context.command.thread === "main" ? "default" : "named",
|
|
98
|
+
subject: context.command.subject ? "selected" : "caller",
|
|
92
99
|
})}`);
|
|
93
100
|
return 0;
|
|
94
101
|
}
|
|
@@ -611,8 +611,8 @@ function parseAgentRulesHost(value) {
|
|
|
611
611
|
}
|
|
612
612
|
function parseJarvisArgs(args) {
|
|
613
613
|
const values = parseNamedArgs(args, {
|
|
614
|
-
allowedFlags: ["--home", "--dashboard-url", "--prompt", "--thread", "--json"],
|
|
615
|
-
valueFlags: ["--home", "--dashboard-url", "--prompt", "--thread"],
|
|
614
|
+
allowedFlags: ["--home", "--dashboard-url", "--prompt", "--as", "--thread", "--json"],
|
|
615
|
+
valueFlags: ["--home", "--dashboard-url", "--prompt", "--as", "--thread"],
|
|
616
616
|
});
|
|
617
617
|
const flaggedPrompt = optionalNonEmpty(values.flags.get("--prompt"));
|
|
618
618
|
const positionalPrompt = optionalNonEmpty(values.positionals.join(" "));
|
|
@@ -628,6 +628,7 @@ function parseJarvisArgs(args) {
|
|
|
628
628
|
homeDir: optionalNonEmpty(values.flags.get("--home")),
|
|
629
629
|
dashboardUrl: optionalUrl(values.flags.get("--dashboard-url")),
|
|
630
630
|
prompt: flaggedPrompt ?? positionalPrompt,
|
|
631
|
+
subject: optionalNonEmpty(values.flags.get("--as")),
|
|
631
632
|
thread,
|
|
632
633
|
json: values.booleans.has("--json"),
|
|
633
634
|
};
|
|
@@ -46,7 +46,7 @@ export function localCommandHelp(command) {
|
|
|
46
46
|
" cockpit start [--ticket <id>|--clear-ticket] [--topic <label>] [--intent <intent>] [--phase <phase>] [--workspace <path>] [--branch <name>] [--max-depth <n>] [--max-repos <n>] [--json]",
|
|
47
47
|
" cockpit sync [--workspace <path>] [--dashboard-url <url>] [--max-depth <n>] [--max-repos <n>] [--json]",
|
|
48
48
|
" cockpit analyze [--workspace <path>] [--dashboard-url <url>] [--max-depth <n>] [--max-repos <n>] [--json]",
|
|
49
|
-
" cockpit jarvis [question] [--prompt <question>] [--thread <name>] [--dashboard-url <url>] [--json]",
|
|
49
|
+
" cockpit jarvis [question] [--prompt <question>] [--as <person>] [--thread <name>] [--dashboard-url <url>] [--json]",
|
|
50
50
|
" cockpit backfill (--since-days <n>|--all) [--source codex|claude] [--dry-run] [--max-files <n>] [--max-depth <n>] [--max-repos <n>] [--yes] [--workspace <path>] [--json]",
|
|
51
51
|
" cockpit status [--workspace <path>] [--max-depth <n>] [--max-repos <n>] [--json]",
|
|
52
52
|
" cockpit sessions [--source codex|claude] [--since-days <n>|--all] [--workspace <path>] [--max-depth <n>] [--max-repos <n>] [--json]",
|
|
@@ -190,9 +190,10 @@ function localSubcommandHelp(command) {
|
|
|
190
190
|
[
|
|
191
191
|
"jarvis",
|
|
192
192
|
[
|
|
193
|
-
"Usage: cockpit jarvis [question] [--prompt <question>] [--thread <name>] [--dashboard-url <url>] [--json]",
|
|
193
|
+
"Usage: cockpit jarvis [question] [--prompt <question>] [--as <person>] [--thread <name>] [--dashboard-url <url>] [--json]",
|
|
194
194
|
"",
|
|
195
195
|
"Chats with the same JARVIS used by Cockpit web chat and the BLI Slack DM.",
|
|
196
|
+
"--as selects the existing website person space; it changes who the chat is about, never who is authenticated.",
|
|
196
197
|
"Run with no question for an interactive terminal conversation.",
|
|
197
198
|
"Agents can pass --prompt, positional text, or pipe one question on stdin.",
|
|
198
199
|
"--json writes one machine-readable response to stdout; operational metadata stays on stderr.",
|
|
@@ -15,7 +15,7 @@ export async function runCockpitCli(argv, io) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
if (command === "--version" || command === "-V" || command === "version") {
|
|
18
|
-
writeLine(io?.stdout ?? process.stdout, "0.2.
|
|
18
|
+
writeLine(io?.stdout ?? process.stdout, "0.2.33");
|
|
19
19
|
return 0;
|
|
20
20
|
}
|
|
21
21
|
|