@wirecat/cli-base 0.75.0 → 0.75.1

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,16 @@ 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.75.1 — 02.11.2026
12
+
13
+ ### Fixed
14
+
15
+ - **A list's help and MCP `query` description no longer offer `word*` or ranges that none of its fields takes.**
16
+ `fieldsHelp`'s `Syntax:` line on a `backend: "sql"` list now lists the phrase, `word*` and `[a TO b] · > >= < <=`
17
+ forms only when one of its shown fields takes them, as a native list's line already did; `AND OR NOT` and `( )`
18
+ stay. A list of whole values only (enum, bool) said it took both, and refused them. `queryDescription` drops
19
+ `[a TO b], > <` the same way. A list whose fields take every form prints the same line as before.
20
+
11
21
  ## 0.75.0 — 02.11.2026
12
22
 
13
23
  ### Fixed
@@ -2,18 +2,14 @@ export const QUERY_SYNTAX = 'field:value · "a phrase" · word* · AND OR NOT ·
2
2
  const shownOf = (registry) => registry.backend === "native" ? registry.fields.filter((field) => field.native) : registry.fields;
3
3
  const leftOut = (fields) => fields.filter((field) => field.negatable).map((field) => field.name);
4
4
  const has = (fields, operator) => fields.some((field) => field.operators.includes(operator));
5
- // A provider takes only field:value joined by AND, so a native list advertises no OR and no grouping.
6
- const syntaxOf = (shown, backend) => {
7
- if (backend !== "native")
8
- return QUERY_SYNTAX;
9
- return [
10
- "field:value",
11
- ...(has(shown, "phrase") ? ['"a phrase"'] : []),
12
- ...(has(shown, "wildcard") ? ["word*"] : []),
13
- "terms joined by AND",
14
- ...(has(shown, "range") ? ["[a TO b] · > >= < <="] : []),
15
- ].join(" · ");
16
- };
5
+ // Each form is offered only when a shown field takes it, and a provider takes no OR and no grouping.
6
+ const syntaxOf = (shown, backend) => [
7
+ "field:value",
8
+ ...(has(shown, "phrase") ? ['"a phrase"'] : []),
9
+ ...(has(shown, "wildcard") ? ["word*"] : []),
10
+ ...(backend === "native" ? ["terms joined by AND"] : ["AND OR NOT", "( )"]),
11
+ ...(has(shown, "range") ? ["[a TO b] · > >= < <="] : []),
12
+ ].join(" · ");
17
13
  const kindOf = (field) => field.values ? `${field.type}: ${field.values.join("|")}` : `${field.type}: ${field.operators.join(", ")}`;
18
14
  /** The Fields section of a list's help: one line per field it filters by, its defaults, the syntax and the guide. */
19
15
  export const fieldsHelp = (registry, guide) => {
@@ -47,7 +43,7 @@ export const queryDescription = (registry) => {
47
43
  ? `field:value terms joined by AND that narrow the list${negatable.length > 0
48
44
  ? `; -field:value or NOT field:value leaves out what matches, for ${negatable.join(", ")} only`
49
45
  : ""}`
50
- : "field:value terms that narrow the list (Lucene: AND OR NOT, -field:value, [a TO b], > <)";
46
+ : `field:value terms that narrow the list (Lucene: AND OR NOT, -field:value${has(shown, "range") ? ", [a TO b], > <" : ""})`;
51
47
  const fields = shown.map((field) => (field.values ? `${field.name} (${field.values.join("|")})` : field.name));
52
48
  const defaults = registry.defaults?.length ? `; unless named: ${registry.defaults.join(" ")}` : "";
53
49
  return `${terms}; fields: ${fields.join(", ")}; e.g. ${shown[0]?.example ?? ""}${defaults}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-base",
3
- "version": "0.75.0",
3
+ "version": "0.75.1",
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",