@wirecat/cli-base 0.80.3 → 0.80.5

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/CHANGELOG.md CHANGED
@@ -8,6 +8,32 @@ Versions before 0.8.0 are in the [git tags](https://github.com/WireCatLabs/cli-b
8
8
  Every entry says what changed as a caller sees it, why, and what to watch for — the rules are
9
9
  [`docs/dev/CONVENTIONS.md`](docs/dev/CONVENTIONS.md#the-changelog).
10
10
 
11
+ ## 0.80.5 — 07.11.2026
12
+
13
+ ### Added
14
+
15
+ - **cli-core's schedule and stats words in the vocabulary**, so a CLI that mounts those shared commands needs no lint
16
+ override: `--notify-on <when>` (role `value`: when a scheduled run tells the owner) and `--deliver-to <route>` (role
17
+ `value`: where its result also goes, `telegram-bot:<profile>/<chat>` or `email:<profile>/<address>`, repeated for
18
+ more), `--max-cost-per-day <usd>` (role `budget`), `--who <side>` (role `target`: whose replies are measured),
19
+ `--open-new` (role `mode`: a read again for tasks also opens new ones) and the view noun `waiting` (chats whose
20
+ newest message waits on the owner). A route is `--deliver-to`, not `--to`: `--to` keeps one meaning, who a message
21
+ is for. A CLI that overrode these in `lint/overrides.json` removes the entries when it bumps; `cli-dev lint` reports
22
+ them as stale.
23
+ - **`cli-dev lint --allow-stale`** prints a stale baseline entry or override as a warning instead of failing. For
24
+ cli-core's CI, which lints each CLI built against its branch: a word cli-core's branch adds to the vocabulary makes
25
+ that CLI's entry stale, and removing it is the CLI's cleanup on its next bump, not a break.
26
+
27
+ ## 0.80.4 — 07.11.2026
28
+
29
+ ### Fixed
30
+
31
+ - **`cli-dev repo-check` skips the ruleset of a private repository on GitHub's free plan** with a line on stderr:
32
+ GitHub answers 403 "Upgrade to GitHub Pro or make this repository public", and such a repository cannot have one.
33
+ Any other 403 still fails, and the cron and parity checks still run.
34
+ - **`cli-dev release-pr --body` and `cli-dev live --file` take an absolute path**, such as a CI runner's temporary
35
+ folder; 0.80.3 joined it onto the working folder.
36
+
11
37
  ## 0.80.3 — 07.11.2026
12
38
 
13
39
  ### Added
@@ -1,5 +1,5 @@
1
1
  import { appendFileSync, existsSync, readFileSync } from "node:fs";
2
- import { dirname, join } from "node:path";
2
+ import { dirname, join, resolve } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { parseArgs } from "node:util";
5
5
  import { packageVersion } from "../release/index.js";
@@ -64,7 +64,7 @@ const live = (args, io, shell) => {
64
64
  file: { type: "string", default: LIVE_FILE },
65
65
  },
66
66
  });
67
- const file = join(io.cwd, values.file);
67
+ const file = resolve(io.cwd, values.file);
68
68
  const version = values.version ?? packageVersion(io.cwd);
69
69
  if (action === "check") {
70
70
  const records = existsSync(file) ? parseLiveRecords(readFileSync(file, "utf8")) : [];
@@ -107,7 +107,7 @@ const releasePr = (args, io, shell) => {
107
107
  return 2;
108
108
  }
109
109
  const baseVersion = String(JSON.parse(base.out).version);
110
- const problems = releasePrProblems(readFileSync(join(io.cwd, values.body), "utf8"), baseVersion, packageVersion(io.cwd));
110
+ const problems = releasePrProblems(readFileSync(resolve(io.cwd, values.body), "utf8"), baseVersion, packageVersion(io.cwd));
111
111
  for (const problem of problems)
112
112
  io.err(problem);
113
113
  if (problems.length === 0)
@@ -124,6 +124,9 @@ export const rulesetProblems = (shell, slug) => {
124
124
  return { problems: [], skipped: "gh is not signed in (set GH_TOKEN in CI)" };
125
125
  if (!status)
126
126
  return { problems: [], skipped: `GitHub could not be reached: ${answer.out.split("\n")[0] ?? ""}` };
127
+ // A private repository on the free plan cannot have rulesets at all (NEED-2331).
128
+ if (status === "403" && answer.out.includes("Upgrade to GitHub Pro or make this repository public"))
129
+ return { problems: [], skipped: "a private repository on GitHub's free plan has no rulesets" };
127
130
  return {
128
131
  problems: [
129
132
  `GitHub answered ${status} for ${slug}'s rules on main: ` +
package/dist/dev/main.js CHANGED
@@ -51,10 +51,11 @@ const USAGE = `usage: cli-dev <command> [options]
51
51
  test-matrix --program <module> --untested <module> --name <cli> [--page <path>] [--check]
52
52
  docs/dev/test-matrix.md from coverage/argv.jsonl
53
53
  lint (--cli <bin> | --commands <file>) [--baseline <dir>] [--overrides <file>] [--budget <n>]
54
- [--schemas <file>] [--write-baseline]
54
+ [--schemas <file>] [--write-baseline] [--allow-stale]
55
55
  the command tree against the standard's rules; fails on a
56
56
  new violation, a stale baseline entry or override, or more
57
- overrides than the budget (10). --write-baseline rewrites
57
+ overrides than the budget (10); --allow-stale only warns on a
58
+ stale entry. --write-baseline rewrites
58
59
  lint/baseline/<rule>.json to today's violations. --schemas
59
60
  is a JSON object of the CLI's own JSON Schemas by name
60
61
  audit (--cli <bin> | --commands <file>)... [--schemas <cli>=<file>]... [--reasons <cli>=<file>]...
@@ -361,6 +362,8 @@ const lintRun = (args, io) => {
361
362
  budget: { type: "string", default: String(OVERRIDE_BUDGET) },
362
363
  schemas: { type: "string" },
363
364
  "write-baseline": { type: "boolean", default: false },
365
+ // For a shared package's CI building its consumers: an entry its new words made stale is their cleanup.
366
+ "allow-stale": { type: "boolean", default: false },
364
367
  },
365
368
  });
366
369
  if (Boolean(values.cli) === Boolean(values.commands)) {
@@ -424,10 +427,11 @@ const lintRun = (args, io) => {
424
427
  problems.push(`no lint rule "${id}" (named in ${values.baseline} or ${values.overrides})`);
425
428
  for (const found of verdict.fresh)
426
429
  problems.push(`${severity.get(found.rule) ?? "?"} ${found.rule} ${found.target}: ${found.message}`);
427
- for (const entry of verdict.stale)
428
- problems.push(entry.in === "baseline"
429
- ? `stale baseline entry, fixed or overridden — remove it: ${values.baseline}/${entry.rule}.json "${entry.target}"`
430
- : `stale override, no such violation — remove it: ${entry.rule} "${entry.target}"`);
430
+ const stale = verdict.stale.map((entry) => entry.in === "baseline"
431
+ ? `stale baseline entry, fixed or overridden — remove it: ${values.baseline}/${entry.rule}.json "${entry.target}"`
432
+ : `stale override, no such violation — remove it: ${entry.rule} "${entry.target}"`);
433
+ if (!values["allow-stale"])
434
+ problems.push(...stale);
431
435
  const warnings = wcatWarnings(io.cwd, values.cli);
432
436
  const warned = new Set(warnings.map((warning) => `${warning.rule} ${warning.target}`));
433
437
  const wcatOverridden = new Set(overrides.filter(isWcat).map((entry) => `${entry.rule} ${entry.target}`));
@@ -441,6 +445,9 @@ const lintRun = (args, io) => {
441
445
  for (const warning of warnings)
442
446
  if (!wcatOverridden.has(`${warning.rule} ${warning.target}`))
443
447
  io.err(`warning ${warning.rule} ${warning.target}: ${warning.message}`);
448
+ if (values["allow-stale"])
449
+ for (const line of stale)
450
+ io.err(`warning ${line}`);
444
451
  return report(io, problems, "lint: ok");
445
452
  };
446
453
  const wcatWarnings = (cwd, cli) => {
@@ -323,6 +323,7 @@ export const HOW_FLAGS = [
323
323
  meaning: "tell the people it concerns about it: the chat's members, or an event's attendees",
324
324
  },
325
325
  { name: "--no-notify", role: "mode", type: "switch", meaning: "tell nobody about it" },
326
+ { name: "--open-new", role: "mode", type: "switch", meaning: "a read again for tasks also opens new tasks" },
326
327
  { name: "--offline", role: "mode", type: "switch", meaning: "answer from what was recorded and never connect" },
327
328
  {
328
329
  name: "--operation-id",
@@ -0,0 +1,2 @@
1
+ import type { VocabularyFlag } from "./vocabulary.js";
2
+ export declare const SCHEDULE_FLAGS: VocabularyFlag[];
@@ -0,0 +1,25 @@
1
+ export const SCHEDULE_FLAGS = [
2
+ {
3
+ name: "--notify-on",
4
+ value: "<when>",
5
+ role: "value",
6
+ type: "choice",
7
+ meaning: "when a scheduled run tells the owner: always, failures or never",
8
+ },
9
+ {
10
+ name: "--deliver-to",
11
+ value: "<route>",
12
+ role: "value",
13
+ type: "string",
14
+ meaning: "where a scheduled run's result also goes, by the owner's own CLI: telegram-bot:<profile>/<chat> or " +
15
+ "email:<profile>/<address>; repeat it for more. Not --to, which names who a message is for",
16
+ },
17
+ {
18
+ name: "--max-cost-per-day",
19
+ value: "<usd>",
20
+ role: "budget",
21
+ type: "number",
22
+ meaning: "start no run for the rest of the day once the day's runs cost this much; 0 for no cap",
23
+ unit: "US dollars",
24
+ },
25
+ ];
@@ -420,6 +420,13 @@ export const WHAT_FLAGS = [
420
420
  meaning: "look again from this day, for what arrived late",
421
421
  },
422
422
  { name: "--run", value: "<id>", role: "target", type: "id", meaning: "the run it is about" },
423
+ {
424
+ name: "--who",
425
+ value: "<side>",
426
+ role: "target",
427
+ type: "choice",
428
+ meaning: "whose replies are measured: me (the owner's) or others (the other side's)",
429
+ },
423
430
  {
424
431
  name: "--write",
425
432
  value: "<id>",
@@ -4,6 +4,7 @@ import { CRM_FLAGS } from "./flags-crm.js";
4
4
  import { HOW_FLAGS } from "./flags-how.js";
5
5
  import { MAIL_FLAGS } from "./flags-mail.js";
6
6
  import { PRIVACY_FLAGS } from "./flags-privacy.js";
7
+ import { SCHEDULE_FLAGS } from "./flags-schedule.js";
7
8
  import { WHAT_FLAGS } from "./flags-what.js";
8
9
  import { duplicates, parseRegistry, text, word } from "./registry.js";
9
10
  export const FLAG_TYPES = [
@@ -360,6 +361,7 @@ const views = [
360
361
  ["newcomers", "members observed joining during the selected time window"],
361
362
  ["retention", "whether members of a selected cohort remain or return over time"],
362
363
  ["responses", "observed replies between participants and the time taken to answer"],
364
+ ["waiting", "chats whose newest message waits on the owner's reply"],
363
365
  ["discussion", "source posts compared by known views and observed discussion replies"],
364
366
  ["unanswered", "questions without an observed qualifying answer"],
365
367
  ["me", "the account a profile's token belongs to"],
@@ -396,5 +398,13 @@ export const VOCABULARY = defineVocabulary({
396
398
  ],
397
399
  views: views.map(([entry, meaning]) => ({ word: entry, meaning })),
398
400
  roots: roots.map(([entry, meaning]) => ({ word: entry, meaning })),
399
- flags: [...HOW_FLAGS, ...WHAT_FLAGS, ...PRIVACY_FLAGS, ...CALENDAR_FLAGS, ...MAIL_FLAGS, ...CRM_FLAGS],
401
+ flags: [
402
+ ...HOW_FLAGS,
403
+ ...WHAT_FLAGS,
404
+ ...PRIVACY_FLAGS,
405
+ ...CALENDAR_FLAGS,
406
+ ...MAIL_FLAGS,
407
+ ...CRM_FLAGS,
408
+ ...SCHEDULE_FLAGS,
409
+ ],
400
410
  });
@@ -119,8 +119,8 @@ installing that command; nothing else is registered anywhere.
119
119
 
120
120
  `cli-dev repo-check --cli <name>` checks steps 1, 3 and 4 on every pull request of a CLI made from cli-template
121
121
  (`ci.yml:repo-setup`): the ruleset's four rules on `main`, a monthly minute no other repository holds, and the CLI in
122
- a parity group. It reads the ruleset with `gh` and the job's `GITHUB_TOKEN`; without a login or a network it says so
123
- and skips that part, and fails on the rest.
122
+ a parity group. It reads the ruleset with `gh` and the job's `GITHUB_TOKEN`; without a login or a network, or for a private
123
+ repository on GitHub's free plan, which cannot have rulesets, it says so and skips that part, and fails on the rest.
124
124
 
125
125
  The listings beyond npm (ClawHub, the MCP Registry, the Claude plugin, the docs site, Glama) are a checklist in
126
126
  [Publishing](../PUBLISHING.md#a-new-cli).
@@ -404,7 +404,7 @@ builds a context of its own.
404
404
  - **Example:** gcal's `src/program.ts` passes `configuration` to the definition and to
405
405
  `appMcpCommand(IDENTITY, configuration, …)`. With `{ "deals": "deny" }` in the profile, `b24 work deals list`
406
406
  exits 5 (`permission_error`) and sends nothing. cli-template's `contracts/plan.json` has
407
- `"deny": { "profile": "personal", "skip": {…} }`, so every CLI made from it runs the check on each pull request.
407
+ `"deny": { "profile": "personal" }`, so every CLI made from it runs the check on each pull request.
408
408
  - **Exceptions:** known gaps, as of 2026-11-07: beeline's definition passes only `resolveSettings`, and the MCP
409
409
  servers of b24 and beeline call `toolsFromCommands` without `permissions`.
410
410
  - **Applies to:** every CLI on cli-core's `run()`. **Since:** cli-base 0.80.1. **Rulings:** none.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-base",
3
- "version": "0.80.3",
3
+ "version": "0.80.5",
4
4
  "description": "The parts every command line tool needs: output modes, terminal rendering, error model, exit codes, credentials, clocks",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Viacheslav Ptsarev",