@wirecat/cli-base 0.98.0 → 0.99.0

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,44 @@ 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.99.0 — 13.11.2026
12
+
13
+ ### Changed — may break callers
14
+
15
+ - **`same-entity-schema` and `same-error-reason` fail `cli-dev audit --family`.** 0.98.0 printed them as
16
+ warnings. A parity-group difference of these two rules names no CLI list (`entity hit`,
17
+ `reason ai.address-refused=model.address-refused`), because which CLIs share an entity or a reason changes with
18
+ each release; its `review_after`, not a stale check, retires it. The 11 differences measured on 13.11.2026 are
19
+ declared until 27.11.2026 (in `messengers` and `gcal-shared`), so no published CLI fails today; a new one does.
20
+ Watch for: from 27.11.2026 the audit warns about them, and from 11.12.2026 it fails until each is aligned
21
+ (cli-core 0.650.0 aligns the address reason) or its date is moved with a reason.
22
+
23
+ ### Added
24
+
25
+ - **`cli-dev manifest` adds the hosts the shared packages reach for every CLI.** `network.hosts` now also lists
26
+ `registry.npmjs.org` (the update check, `doctor` online, cli-core's runtime download), `huggingface.co`,
27
+ `*.huggingface.co` and `*.hf.co` (the local models for search, speech and pictures, and the hosts Hugging Face
28
+ redirects its files to), `github.com` and `*.githubusercontent.com` (the ONNX runtime and the speech detector from
29
+ GitHub releases), so Desktop shows them. Exported as `SHARED_HOSTS` from `@wirecat/cli-base/wcat/manifest`. Watch for: every CLI's
30
+ `generate:check` fails after the bump until `pnpm generate` rewrites `contracts/wirecat.json`; a CLI that listed
31
+ one of these hosts itself may drop it.
32
+
33
+ ### Fixed
34
+
35
+ - **`cli-dev audit --family` passes a CLI on cli-core 0.648.0.** cli-core 0.648.0 marks the commands it mounts
36
+ `origin: "cli-core"` in `commands --json`, while the contract it compares them with keeps the origin they were
37
+ written with, so `shared-command-contract` failed on all of them (88 in b24). The `cli-core` mark now counts as the
38
+ contract's own origin; any other change of origin still fails. With its contracts clean again, a CLI's shared
39
+ commands that the published max, tg and wa still word as an older cli-core did (`doctor reports`) are accepted as
40
+ inherited, as before.
41
+ - **`undeclared-host` skips a URL inside a sentence.** Help links in printed text, API descriptions and markdown
42
+ links are never fetched; only a URL that starts a string counts now, and `schemas.openxmlformats.org` joins the
43
+ XML namespace names that are skipped by name. drive's baseline drops 9 of its 11 hosts
44
+ and mail's overrides 6 of 17. Help links and OAuth scopes kept alone in a string still need an override: nothing
45
+ tells them apart from a request's address.
46
+ - **`raw-network` accepts `fetch` destructured in an arrow's or a method's parameter** (`({ env, fetch }) =>`,
47
+ `probe({ fetch }) {`), which binds the injected one; `call({ fetch })` is still reported.
48
+
11
49
  ## 0.98.0 — 12.11.2026
12
50
 
13
51
  ### Added
package/dist/dev/audit.js CHANGED
@@ -4,6 +4,7 @@ import { LINT_RULES, OVERRIDE_BUDGET } from "../standards/lint.js";
4
4
  import { capabilityDifference } from "./capabilities.js";
5
5
  import { judge, kindOf, lintCommands, longName, registeredKinds, summaryOf, walk } from "./lint.js";
6
6
  import { sharedContractProblems } from "./shared-contracts.js";
7
+ const UNLISTED_RULES = new Set(["same-entity-schema", "same-error-reason"]);
7
8
  const STRICT_CONTRACT_RULES = new Set([
8
9
  "shared-command-contract",
9
10
  "same-path-contract",
@@ -263,6 +264,12 @@ export const auditClis = (inputs, options, rules = AUDIT_RULES) => {
263
264
  // An `absent` or `only` difference names no CLI list: it stands for every finding where only that CLI lacks the
264
265
  // flag, or only that CLI has it.
265
266
  const differences = options.groups.flatMap((group) => group.differences.flatMap((entry) => {
267
+ // Which CLIs share an entity or a reason changes with each release, so the entry names only what differs, and
268
+ // its review_after, not a stale check, retires it.
269
+ if (UNLISTED_RULES.has(entry.rule))
270
+ return findings
271
+ .filter((finding) => finding.rule === entry.rule && finding.target.endsWith(` ${entry.target}`))
272
+ .map((finding) => ({ ...entry, group: group.name, target: finding.target, expected: finding.message }));
266
273
  const cli = entry.absent ?? entry.only;
267
274
  if (!cli)
268
275
  return [{ group: group.name, ...entry }];
package/dist/dev/main.js CHANGED
@@ -669,7 +669,6 @@ const auditFamily = (args, io) => {
669
669
  family.close();
670
670
  }
671
671
  };
672
- const FAMILY_REPORTS = new Set(["same-entity-schema", "same-error-reason"]);
673
672
  const auditRun = (args, io, family = false) => {
674
673
  const started = Date.now();
675
674
  const { values } = parseArgs({
@@ -859,14 +858,8 @@ const auditRun = (args, io, family = false) => {
859
858
  }));
860
859
  else
861
860
  io.out(scorecardTable(result.rows));
862
- for (const finding of result.blocking) {
863
- const line = `new ${finding.rule} ${finding.target}: ${finding.message}`;
864
- // Measured for the first time by the family audit, and strict, so no baseline can hold them: shown, not failed.
865
- if (family && FAMILY_REPORTS.has(finding.rule))
866
- io.err(`warning ${line}`);
867
- else
868
- problems.push(line);
869
- }
861
+ for (const finding of result.blocking)
862
+ problems.push(`new ${finding.rule} ${finding.target}: ${finding.message}`);
870
863
  if (values.for === undefined && result.rows.some((row) => row.fixed > 0))
871
864
  io.err(`warning ${values.baseline} holds rows no CLI has any more (the "fixed" column): remove them with --write-baseline`);
872
865
  io.err(`audit: ${inputs.length} CLIs, ${result.findings.length} findings, ${result.blocking.length} new that block${AUDIT_BLOCKS === "never" ? " (cross-CLI divergences do not block)" : ""}`);
@@ -49,13 +49,15 @@ const opensNothing = (module, clause) => {
49
49
  .every((binding) => allowed.has(binding.split(/\s+as\s+/)[0]));
50
50
  };
51
51
  // A file that binds its own `fetch` (an injected FetchLike, `const fetch = hostFetch(…)`) calls that one. Only a
52
- // declaration binds it: a typed or defaulted parameter, a destructuring pattern, an arrow's own parameter. An object
53
- // key (`{ fetch: deps.fetch ?? fetch }`) or an argument (`call(fetch)`) hands the global on and binds nothing.
52
+ // declaration binds it: a typed or defaulted parameter, a destructuring pattern, an arrow's or a method's own parameter
53
+ // (`({ env, fetch }) =>`). An object key (`{ fetch: deps.fetch ?? fetch }`) or an argument (`call(fetch)`,
54
+ // `call({ fetch })`) hands the global on and binds nothing.
54
55
  const BINDS_FETCH = new RegExp([
55
56
  String.raw `\b(?:const|let|var|function)\s+fetch\b`,
56
57
  String.raw `[(,]\s*fetch\s*\??\s*:\s*(?:typeof\b|[A-Z(])`,
57
58
  String.raw `[(,]\s*fetch\s*=(?![=>])`,
58
59
  String.raw `\{[^{}]*(?<![\w$.:]\s*)\bfetch\b(?!\s*:)[^{}]*\}\s*(?::|=(?![=>]))`,
60
+ String.raw `\{[^{}]*(?<![\w$.:]\s*)\bfetch\b(?!\s*:)[^{}]*\}(?:[^(){};]|\{[^{}]*\})*\)\s*(?:(?::[^={;\n]*)?=>|\{)`,
59
61
  String.raw `(?:\(\s*fetch\s*\)|\bfetch)\s*=>`,
60
62
  ].join("|"));
61
63
  const GLOBAL_FETCH = /(?<!\btypeof\s+)\b(?:globalThis|window|self)\s*\.\s*fetch\b/;
@@ -81,9 +83,14 @@ export const rawNetwork = ({ sources }) => sources.flatMap(({ path, text }) => {
81
83
  : `imports ${what}: send HTTP through hostFetch from @wirecat/cli-base/http, or say why in lint/overrides.json`,
82
84
  }));
83
85
  });
84
- const URL_HOST = /\bhttps?:\/\/([a-z0-9.-]+)/gi;
86
+ // Only a URL that starts a string can be a request's address; one inside a sentence (help text, an API's description,
87
+ // a markdown link) is printed, never fetched.
88
+ const URL_HOST = /(?<=["'`])https?:\/\/([a-z0-9.-]+)/gi;
85
89
  /** Names, not addresses: placeholders and schema or namespace identifiers nobody fetches. */
86
- const NOT_CONTACTED = /(?:^|\.)(?:example(?:\.com|\.org|\.net)?|test|invalid)$|^(?:json-schema\.org|www\.w3\.org)$/;
90
+ const NOT_CONTACTED = new RegExp([
91
+ String.raw `(?:^|\.)(?:example(?:\.com|\.org|\.net)?|test|invalid)$`,
92
+ String.raw `^(?:json-schema\.org|www\.w3\.org|schemas\.openxmlformats\.org)$`,
93
+ ].join("|"));
87
94
  /** One finding per host, so a host named in many files takes one override. */
88
95
  export const undeclaredHosts = ({ sources, hosts, docsHost, }) => {
89
96
  if (hosts === undefined)
@@ -67,6 +67,8 @@ export const sharedContractProblems = (commands, references, edits = []) => {
67
67
  const wanted = { ...expected, ...inherited };
68
68
  const changed = [...new Set([...Object.keys(actual), ...Object.keys(wanted)])].filter((field) => field !== "aliases" &&
69
69
  field !== "availability" &&
70
+ // Discovery marks a shared command "cli-core" (cli-core 0.648.0); the contract keeps how it was written.
71
+ !(field === "origin" && fields.origin === "cli-core") &&
70
72
  !same(actual[field], wanted[field]));
71
73
  if (changed.length)
72
74
  problems.push({ path, message: `core contract differs without an exact override: ${changed.join(", ")}` });
@@ -22,7 +22,10 @@ declare const parityGroupSchema: v.StrictObjectSchema<{
22
22
  /** Permanent differences, each with its reason; they count against the override budget of the group. */
23
23
  readonly differences: v.ArraySchema<v.StrictObjectSchema<{
24
24
  readonly rule: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a lower-case word, words joined by -">]>;
25
- /** `<clis> <path> <flag>`; with `absent` or `only`, only `<path> <flag>`: the CLI list is whoever else was compared. */
25
+ /**
26
+ * `<clis> <path> <flag>`; with `absent` or `only`, only `<path> <flag>`: the CLI list is whoever else was compared.
27
+ * same-entity-schema and same-error-reason name no CLI list either: `entity hit`, `reason profile.unknown: code`.
28
+ */
26
29
  readonly target: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
27
30
  readonly expected: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>, undefined>;
28
31
  /** The CLI that lacks the path or flag by design; the rest must agree, so other CLIs joining do not stale it. */
@@ -51,7 +51,10 @@ const parityGroupSchema = v.strictObject({
51
51
  /** Permanent differences, each with its reason; they count against the override budget of the group. */
52
52
  differences: v.array(v.strictObject({
53
53
  rule: word,
54
- /** `<clis> <path> <flag>`; with `absent` or `only`, only `<path> <flag>`: the CLI list is whoever else was compared. */
54
+ /**
55
+ * `<clis> <path> <flag>`; with `absent` or `only`, only `<path> <flag>`: the CLI list is whoever else was compared.
56
+ * same-entity-schema and same-error-reason name no CLI list either: `entity hit`, `reason profile.unknown: code`.
57
+ */
55
58
  target: text,
56
59
  expected: v.optional(text),
57
60
  /** The CLI that lacks the path or flag by design; the rest must agree, so other CLIs joining do not stale it. */
@@ -95,8 +98,28 @@ const MEMO_DOCTOR_DEEP = {
95
98
  reason: "memo's doctor --deep also checks its own store (cli-memo #672); cli-core's shared doctor leaves --deep to " +
96
99
  "each CLI, and no other CLI has one",
97
100
  };
101
+ // The family audit measured these first in cli-base 0.98.0, as warnings; they fail since NEED-2578, and these were the
102
+ // differences on that day. The target names no CLI list: whoever shares the entity or reason, the difference holds.
103
+ const review = (rule, target, reason) => ({ rule, target, reason, review_after: "2026-11-27" });
104
+ const ENTITY = "same-entity-schema";
105
+ const REASON = "same-error-reason";
106
+ const MESSENGERS_SINCE_0_98 = [
107
+ review(ENTITY, "entity contact_context", "max, tg and wa print it in different schemas (measured 2026-11-13)"),
108
+ review(ENTITY, "entity contact_preparation", "max, tg and wa print it in different schemas (measured 2026-11-13)"),
109
+ review(ENTITY, "entity linked_person", "max, tg and wa print it in different schemas (measured 2026-11-13)"),
110
+ ];
111
+ const FAMILY_SINCE_0_98 = [
112
+ review(ENTITY, "entity api_method", "b24's schema differs from drive and gcal's (measured 2026-11-13)"),
113
+ review(ENTITY, "entity scheduled_job", "three schemas: b24, mail, memo / gcal / max, tg (measured 2026-11-13)"),
114
+ review(ENTITY, "entity hit", "three schemas: b24, memo, zm / gcal / max, tg, wa (measured 2026-11-13)"),
115
+ review(ENTITY, "entity deal", "b24's CRM deal and memo's differ (measured 2026-11-13)"),
116
+ review(ENTITY, "entity lead", "b24's CRM lead and memo's differ (measured 2026-11-13)"),
117
+ review(ENTITY, "entity product", "b24's CRM product and memo's differ (measured 2026-11-13)"),
118
+ review(REASON, "reason ai.address-refused=model.address-refused", "one failure under two names; cli-core 0.650.0 keeps one"),
119
+ review(REASON, "reason profile.unknown: code", "b24 gives it not_found, drive validation_error (measured 2026-11-13)"),
120
+ ];
98
121
  export const PARITY_GROUPS = defineParityGroups([
99
- { name: "messengers", members: ["tg", "max"], covers: "tree", differences: [] },
122
+ { name: "messengers", members: ["tg", "max"], covers: "tree", differences: MESSENGERS_SINCE_0_98 },
100
123
  {
101
124
  name: "all",
102
125
  members: ["tg", "max", "memo", "drive", "zm", "wa"],
@@ -118,7 +141,7 @@ export const PARITY_GROUPS = defineParityGroups([
118
141
  name: "gcal-shared",
119
142
  members: ["tg", "max", "memo", "drive", "zm", "wa", "gcal"],
120
143
  covers: ["commands", "upgrade", "notes", "meetings"],
121
- differences: [],
144
+ differences: FAMILY_SINCE_0_98,
122
145
  },
123
146
  // bitrix24-cli's search is cli-core's CRM `search all`, and beeline-cli's meetings take call recordings, not
124
147
  // zoom-cli's: both are compared on the root commands every CLI shares, the way gcal and mail are on theirs.
@@ -8,6 +8,12 @@ import { type CommandInfo } from "../commands/registry.js";
8
8
  import type { WcatTool } from "./describe.js";
9
9
  export declare const MANIFEST_FORMAT = 2;
10
10
  export declare const MANIFEST_FILE = "contracts/wirecat.json";
11
+ /**
12
+ * Hosts every CLI may reach through the shared packages rather than its own code: npm for the update check, Hugging
13
+ * Face for the models search, speech and pictures use, GitHub releases for the ONNX runtime and the speech detector,
14
+ * and the hosts both redirect their files to. `cli-dev manifest` adds them to the hosts a CLI declares.
15
+ */
16
+ export declare const SHARED_HOSTS: readonly string[];
11
17
  /** Desktop's `plain_word`: letters, digits and `._:=,/+@-`, at most two leading dashes, `--` alone, `{name}` slots. */
12
18
  export declare const PLAIN_WORD: RegExp;
13
19
  declare const signInSchema: v.StrictObjectSchema<{
@@ -11,6 +11,19 @@ import { issuesOf, jsonSchemaOf, SNAKE_CASE } from "../standards/registry.js";
11
11
  import { PROGRAM_PREFIX, TOOL_NAME } from "./names.js";
12
12
  export const MANIFEST_FORMAT = 2;
13
13
  export const MANIFEST_FILE = "contracts/wirecat.json";
14
+ /**
15
+ * Hosts every CLI may reach through the shared packages rather than its own code: npm for the update check, Hugging
16
+ * Face for the models search, speech and pictures use, GitHub releases for the ONNX runtime and the speech detector,
17
+ * and the hosts both redirect their files to. `cli-dev manifest` adds them to the hosts a CLI declares.
18
+ */
19
+ export const SHARED_HOSTS = [
20
+ "registry.npmjs.org",
21
+ "huggingface.co",
22
+ "*.huggingface.co",
23
+ "*.hf.co",
24
+ "github.com",
25
+ "*.githubusercontent.com",
26
+ ];
14
27
  /** Desktop's `plain_word`: letters, digits and `._:=,/+@-`, at most two leading dashes, `--` alone, `{name}` slots. */
15
28
  export const PLAIN_WORD = /^(?:--|-{0,2}(?:[A-Za-z0-9]|\{[A-Za-z]+\})(?:[A-Za-z0-9._:=,/+@-]|\{[A-Za-z]+\})*)$/;
16
29
  const plainWord = v.pipe(v.string(), v.maxLength(100, "a command word is at most 100 characters"), v.regex(PLAIN_WORD, (issue) => `${JSON.stringify(issue.input)} is not a plain word: letters, digits and ._:=,/+@-, at most two leading dashes, -- alone and {name} slots; no spaces, quotes or shell syntax`));
@@ -205,7 +218,7 @@ export const buildManifest = ({ identity, commands, pkg, skills }) => {
205
218
  ...(identity.hosts
206
219
  ? {
207
220
  network: {
208
- hosts: [...identity.hosts],
221
+ hosts: [...new Set([...identity.hosts, ...SHARED_HOSTS])],
209
222
  ...(identity.userHosts ? { user_hosts: identity.userHosts } : {}),
210
223
  },
211
224
  }
@@ -461,7 +461,9 @@ right one, never `not_found`.
461
461
  The CLI's `WCAT` identity lists every internet host it contacts in `hosts` (`["api.acme.example"]`, `[]` for none):
462
462
  lower-case hostnames with no scheme, port or path, and a leading `*.` only before two labels or more. A host the
463
463
  person chooses (a mail server, a page to read) is named in words in `userHosts`, and the CLI adds the configured host
464
- to the list at run time. `cli-dev manifest` writes them to `network` in `contracts/wirecat.json`. The CLI's own source
464
+ to the list at run time. `cli-dev manifest` writes them to `network` in `contracts/wirecat.json`, with the hosts the
465
+ shared packages reach for every CLI (`SHARED_HOSTS`: npm for the update check, Hugging Face and GitHub releases
466
+ for local models). The CLI's own source
465
467
  sends HTTP only through `hostFetch` from `@wirecat/cli-base/http`, which refuses any other host before a byte leaves
466
468
  the machine and checks every redirect.
467
469
 
@@ -474,7 +476,8 @@ the machine and checks every redirect.
474
476
  `const fetch = hostFetch({ hosts: WCAT.hosts ?? [] })`. `raw-network` reports `src/api.ts node:https` for an
475
477
  import of `node:https`, and `src/api.ts fetch` for the global `fetch` called or handed on as a value
476
478
  (`options.fetch ?? fetch`); `undeclared-host` reports `collector.acme.dev`, naming the files, for a URL whose host
477
- the shipped manifest does not list.
479
+ the shipped manifest does not list. A URL inside a sentence, such as a help link in printed text, is not reported;
480
+ one that starts a string is, because nothing tells it apart from a request's address.
478
481
  - **Exceptions:** network code that cannot use `hostFetch` (a socket protocol, a provider SDK) says why in
479
482
  `lint/overrides.json`, and still lists its hosts. The lint is not a sandbox: a dependency, a computed URL or `eval`
480
483
  passes it, which is why Desktop also scans the package and flags what it finds. A shipped manifest without
@@ -482,7 +485,8 @@ the machine and checks every redirect.
482
485
  no hosts yet; the warning becomes a failure once they do. With no manifest at all, the run only says the check is
483
486
  skipped.
484
487
  - **Applies to:** all CLIs, and third-party CLIs that join `wcat`. **Since:** the release after cli-base 0.84.0; the
485
- global fetch as a value and the missing-hosts warning since the release after 0.93.0.
488
+ global fetch as a value and the missing-hosts warning since the release after 0.93.0; the shared hosts, and URLs
489
+ inside a sentence left out of `undeclared-host`, since the release after 0.98.0.
486
490
  **Rulings:** none.
487
491
 
488
492
  ## Sources
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-base",
3
- "version": "0.98.0",
3
+ "version": "0.99.0",
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",