@bli-cockpit/cli 0.2.190 → 0.2.191

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.
@@ -1,10 +1,13 @@
1
1
  import { optionalNonEmpty, optionalUrl, parseNamedArgs } from "./local-arg-values.js";
2
2
  export function parseSetupArgs(args) {
3
- const values = parseNamedArgs(args, { allowedFlags: ["--person", "--compare", "--json", "--home", "--dashboard-url"], valueFlags: ["--person", "--compare", "--home", "--dashboard-url"] });
3
+ const values = parseNamedArgs(args, { allowedFlags: ["--person", "--compare", "--since", "--details", "--json", "--home", "--dashboard-url"], valueFlags: ["--since", "--person", "--compare", "--home", "--dashboard-url"] });
4
4
  if (values.positionals.length)
5
5
  throw new Error("setup takes --person or --compare, not a subcommand.");
6
6
  const compare = optionalNonEmpty(values.flags.get("--compare"));
7
7
  if (compare && (compare.split(",").length !== 2 || compare.split(",").some(value => !value.trim())))
8
8
  throw new Error("--compare takes two emails separated by a comma.");
9
- return { kind: "setup", person: optionalNonEmpty(values.flags.get("--person")), compare, json: values.booleans.has("--json"), homeDir: optionalNonEmpty(values.flags.get("--home")), dashboardUrl: optionalUrl(values.flags.get("--dashboard-url")) };
9
+ const since = optionalNonEmpty(values.flags.get("--since"));
10
+ if (since && since !== "7d" && since !== "30d" && (!/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?Z)?$/.test(since) || !Number.isFinite(Date.parse(since)) || new Date(since).toISOString().slice(0, 10) !== since.slice(0, 10) || Date.parse(since) >= Date.now()))
11
+ throw new Error("--since takes 7d, 30d, or an ISO date before now.");
12
+ return { kind: "setup", since, details: values.booleans.has("--details"), person: optionalNonEmpty(values.flags.get("--person")), compare, json: values.booleans.has("--json"), homeDir: optionalNonEmpty(values.flags.get("--home")), dashboardUrl: optionalUrl(values.flags.get("--dashboard-url")) };
10
13
  }
@@ -27,7 +27,7 @@ export function localSubcommandHelp(command) {
27
27
  // BLI-3709: the Tower nouns live next door, split along the same seam the
28
28
  // argument parsers already use — see `local-help-commands-tower.ts`.
29
29
  ...TOWER_COMMAND_HELP,
30
- ["setup", ["Usage: cockpit setup [--person <email>] [--compare <email,email>] [--json]", "Read agent setups beside 30-day outcomes, or compare two exact emails."]],
30
+ ["setup", ["Usage: cockpit setup [--since <7d|30d|date>] [--details] [--person <email>] [--compare <email,email>] [--json]", "Read agent setups beside windowed outcomes (default 30 days), or compare two exact emails."]],
31
31
  [
32
32
  "onboard",
33
33
  [
@@ -139,7 +139,7 @@ export function localCommandHelp(command) {
139
139
  " cockpit rename [list|resolve <id> --scope <page|everywhere|undo>] [--dashboard-url <url>] [--json]",
140
140
  " cockpit logs <collector|dashboard|railway|railway:<service>|-> [--since 15m|1h|2d|<iso>] [--raw <template-id> [--limit <n>]] [--all-levels] [--table <file>] [--json]",
141
141
  " cockpit brain status [--project <id>] [--show open|running|needs_human|fixed|not_actionable|cleared] [--dashboard-url <url>] [--json]",
142
- " cockpit setup [--person <email>] [--compare <email,email>] [--json]",
142
+ " cockpit setup [--since <7d|30d|date>] [--details] [--person <email>] [--compare <email,email>] [--json]",
143
143
  " cockpit usage sessions [--task <BLI-NNNN> | --subject <name>] [--repo <label>] [--since <window>] [--json]",
144
144
  " cockpit usage sessions --session <id> [--from-window <n>] [--json]",
145
145
  " --by-topic groups work types; --by-subject groups open subjects from session summaries.",
@@ -21,7 +21,7 @@ export async function runCockpitCli(argv, io) {
21
21
  }
22
22
 
23
23
  if (command === "--version" || command === "-V" || command === "version") {
24
- writeLine(io?.stdout ?? process.stdout, "0.2.190");
24
+ writeLine(io?.stdout ?? process.stdout, "0.2.191");
25
25
  return 0;
26
26
  }
27
27
 
@@ -3,6 +3,8 @@ import { writeLine } from "./cli-io.js";
3
3
  export async function runSetup(command, io) {
4
4
  const door = await openAgentDoor("setup", command, io);
5
5
  const query = new URLSearchParams();
6
+ if (command.since)
7
+ query.set("since", command.since);
6
8
  if (command.person)
7
9
  query.set("person", command.person);
8
10
  if (command.compare)
@@ -16,6 +18,8 @@ export async function runSetup(command, io) {
16
18
  const number = (value) => value === null ? "unknown" : value.toLocaleString(undefined, { maximumFractionDigits: 1 });
17
19
  for (const person of body.people ?? []) {
18
20
  writeLine(io.stdout, `${person.rank ? `#${person.rank} ` : "Unranked · "}${person.display_name ?? person.email ?? "Unknown person"}: ${number(person.prs_per_week)} merged PRs/week · ${number(person.tokens_per_pr)} tokens/merged PR · ${person.yield === null ? "unknown yield" : `${number(person.yield * 100)}% session yield`}`);
21
+ if (person.tokens_basis)
22
+ writeLine(io.stdout, ` Token basis: ${person.tokens_basis === "total_fallback" ? "total (input/cache breakdown unavailable)" : "input + output, excluding cache reads"}`);
19
23
  if (!person.machines.length)
20
24
  writeLine(io.stdout, " No setup received.");
21
25
  for (const machine of person.machines) {
@@ -30,7 +34,7 @@ export async function runSetup(command, io) {
30
34
  }
31
35
  for (const pair of body.comparison ?? []) {
32
36
  writeLine(io.stdout, `${pair.first ?? "Unknown person"} / ${pair.second ?? "Unknown person"}`);
33
- for (const difference of pair.differences)
37
+ for (const difference of command.details ? [...pair.differences, ...(pair.details ?? [])] : pair.differences)
34
38
  writeLine(io.stdout, ` ${difference}`);
35
39
  }
36
40
  if (body.note)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bli-cockpit/cli",
3
- "version": "0.2.190",
3
+ "version": "0.2.191",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@bli-cockpit/memory-mcp": "0.1.57",
31
- "@bli-cockpit/mcp": "0.1.102",
31
+ "@bli-cockpit/mcp": "0.1.103",
32
32
  "@bli-cockpit/telemetry-core": "0.1.66"
33
33
  },
34
34
  "repository": {