@bli-cockpit/cli 0.2.124 → 0.2.125

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,5 +1,7 @@
1
1
  import { optionalNonEmpty, optionalUrl, parseNamedArgs } from './local-arg-values.js';
2
2
  const ACTIONS = ['list', 'show', 'rescreen', 'invite', 'decide', 'grade', 'takehome-show', 'takehome-set', 'settings-show', 'settings-set'];
3
+ /** Typed word → the one action it means. The left side is what a person reads on the button. */
4
+ const ALSO_SPELLED = { 'send-takehome': 'invite' };
3
5
  const DECISIONS = ['passed_on', 'archived', 'reopen'];
4
6
  /** Verbs that name an application id, a role slug, or nothing at all. */
5
7
  const NEEDS_ID = ['show', 'rescreen', 'invite', 'decide', 'grade'];
@@ -14,15 +16,18 @@ export function parseCareersArgs(args) {
14
16
  // `team device` reads as `team device list`: the noun alone is a question.
15
17
  const first = positionals[0] ?? 'list';
16
18
  const paired = first === 'takehome' || first === 'settings';
17
- const action = paired
19
+ const typed = paired
18
20
  ? `${first}-${positionals.splice(0, positionals[1] === undefined ? 1 : 2)[1] ?? 'show'}`
19
21
  : (positionals.shift() ?? 'list');
22
+ // `send-takehome` is the button's own words; `invite` is the older spelling
23
+ // of the same act. One action from here on, the typed word only for errors.
24
+ const action = ALSO_SPELLED[typed] ?? typed;
20
25
  if (!ACTIONS.includes(action))
21
- throw new Error(`careers takes ${ACTIONS.join(', ')}.`);
26
+ throw new Error(`careers takes ${[...ACTIONS, ...Object.keys(ALSO_SPELLED)].join(', ')}.`);
22
27
  const verb = action;
23
28
  const target = positionals.shift();
24
29
  if (NEEDS_ID.includes(verb) && !target)
25
- throw new Error(`careers ${verb} needs an application id.`);
30
+ throw new Error(`careers ${typed} needs an application id.`);
26
31
  if (NEEDS_ROLE.includes(verb) && !target)
27
32
  throw new Error(`careers ${verb.replace('-', ' ')} needs a role slug.`);
28
33
  if (positionals.length > 0)
@@ -25,11 +25,11 @@ export const TOWER_COMMAND_HELP = [
25
25
  [
26
26
  "careers",
27
27
  [
28
- "Usage: cockpit careers [list|show <id>|rescreen <id>|invite <id>|decide <id> --decision <d>|grade <id>|takehome show <role>|takehome set <role>|settings show|settings set] [flags]",
28
+ "Usage: cockpit careers [list|show <id>|rescreen <id>|send-takehome <id>|decide <id> --decision <d>|grade <id>|takehome show <role>|takehome set <role>|settings show|settings set] [flags]",
29
29
  "",
30
30
  "Super-admin application review and pipeline. Lists at most 100 matches with total and has_more; use filters to narrow.",
31
31
  "list [--role <slug>] [--min-score <n>] [--since <date>] [--stage <screened|invited|submitted|graded|booking_sent|passed_on|archived>] — the board, newest first, with the two thresholds in force.",
32
- "invite <id> sends that role's take-home from the configured mailbox, whatever the screening scored. Only a row still at `screened`.",
32
+ "send-takehome <id> (also `invite <id>`): sends that role's take-home from the configured mailbox, whatever the screening scored. The same act as Tower's Send take-home button, and only a row still at `screened`.",
33
33
  "decide <id> --decision <passed_on|archived|reopen> — your own call on a row; `reopen` puts it back to `screened`.",
34
34
  "grade <id> [--now]: puts one submission back in the take-home grader's queue. The grader runs on Railway every 15 minutes; --now says so rather than pretending the run happened here.",
35
35
  "takehome show <role> — the subject, body, link and the reviewer's rubric for that role.",
@@ -104,7 +104,7 @@ export function localCommandHelp(command) {
104
104
  " cockpit project [list] [--archived] [--dashboard-url <url>] [--json]",
105
105
  ` cockpit search "<words>" [--kind ${SEARCH_KINDS.join(",")}] [--limit <n>] [--dashboard-url <url>] [--json]`,
106
106
  " cockpit release [--dry-run] [--skip-checks] [--no-floor] [--tag <tag>] [--access <public|restricted>] [--otp <code>]",
107
- " cockpit careers [list|show <id>|rescreen <id>|invite <id>|decide <id> --decision <passed_on|archived|reopen>|grade <id> [--now]|takehome show <role>|takehome set <role> --body-file <path>|settings show|settings set --enabled <true|false>] [--role <slug>] [--min-score <n>] [--since <date>] [--stage <s>] [--json]",
107
+ " cockpit careers [list|show <id>|rescreen <id>|send-takehome <id>|decide <id> --decision <passed_on|archived|reopen>|grade <id> [--now]|takehome show <role>|takehome set <role> --body-file <path>|settings show|settings set --enabled <true|false>] [--role <slug>] [--min-score <n>] [--since <date>] [--stage <s>] [--json]",
108
108
  " cockpit usage sessions [--task <BLI-NNNN> | --subject <name>] [--repo <label>] [--since <window>] [--json]",
109
109
  " cockpit usage sessions --session <id> [--from-window <n>] [--json]",
110
110
  " --by-topic groups work types; --by-subject groups open subjects from session summaries.",
@@ -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.124");
18
+ writeLine(io?.stdout ?? process.stdout, "0.2.125");
19
19
  return 0;
20
20
  }
21
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bli-cockpit/cli",
3
- "version": "0.2.124",
3
+ "version": "0.2.125",
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.32",
31
- "@bli-cockpit/mcp": "0.1.51",
31
+ "@bli-cockpit/mcp": "0.1.52",
32
32
  "@bli-cockpit/telemetry-core": "0.1.48"
33
33
  }
34
34
  }