@wirecat/cli-base 0.24.0 → 0.26.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.
Files changed (104) hide show
  1. package/README.md +27 -4
  2. package/THIRD_PARTY_NOTICES +760 -0
  3. package/dist/commands/document.d.ts +10 -10
  4. package/dist/commands/document.d.ts.map +1 -1
  5. package/dist/commands/document.js +27 -9
  6. package/dist/commands/document.js.map +1 -1
  7. package/dist/commands/index.d.ts +16 -4
  8. package/dist/commands/index.d.ts.map +1 -1
  9. package/dist/commands/index.js +10 -3
  10. package/dist/commands/index.js.map +1 -1
  11. package/dist/completion/index.js +2 -2
  12. package/dist/completion/index.js.map +1 -1
  13. package/dist/deadline.js +1 -1
  14. package/dist/deadline.js.map +1 -1
  15. package/dist/dev/lint.d.ts +10 -2
  16. package/dist/dev/lint.d.ts.map +1 -1
  17. package/dist/dev/lint.js +134 -7
  18. package/dist/dev/lint.js.map +1 -1
  19. package/dist/dev/main.d.ts.map +1 -1
  20. package/dist/dev/main.js +14 -3
  21. package/dist/dev/main.js.map +1 -1
  22. package/dist/errors.d.ts +3 -3
  23. package/dist/errors.d.ts.map +1 -1
  24. package/dist/errors.js.map +1 -1
  25. package/dist/failure.d.ts +3 -3
  26. package/dist/failure.d.ts.map +1 -1
  27. package/dist/failure.js +9 -7
  28. package/dist/failure.js.map +1 -1
  29. package/dist/logging.d.ts +1 -1
  30. package/dist/logging.d.ts.map +1 -1
  31. package/dist/logging.js +5 -3
  32. package/dist/logging.js.map +1 -1
  33. package/dist/output-buffer.js +3 -3
  34. package/dist/output-buffer.js.map +1 -1
  35. package/dist/query/dates.d.ts +15 -0
  36. package/dist/query/dates.d.ts.map +1 -0
  37. package/dist/query/dates.js +104 -0
  38. package/dist/query/dates.js.map +1 -0
  39. package/dist/query/evaluate.d.ts +15 -0
  40. package/dist/query/evaluate.d.ts.map +1 -0
  41. package/dist/query/evaluate.js +70 -0
  42. package/dist/query/evaluate.js.map +1 -0
  43. package/dist/query/fields.d.ts +54 -0
  44. package/dist/query/fields.d.ts.map +1 -0
  45. package/dist/query/fields.js +87 -0
  46. package/dist/query/fields.js.map +1 -0
  47. package/dist/query/help.d.ts +5 -0
  48. package/dist/query/help.d.ts.map +1 -0
  49. package/dist/query/help.js +18 -0
  50. package/dist/query/help.js.map +1 -0
  51. package/dist/query/index.d.ts +13 -0
  52. package/dist/query/index.d.ts.map +1 -0
  53. package/dist/query/index.js +13 -0
  54. package/dist/query/index.js.map +1 -0
  55. package/dist/query/parser.d.ts +9 -0
  56. package/dist/query/parser.d.ts.map +1 -0
  57. package/dist/query/parser.js +303 -0
  58. package/dist/query/parser.js.map +1 -0
  59. package/dist/query/registry.d.ts +23 -0
  60. package/dist/query/registry.d.ts.map +1 -0
  61. package/dist/query/registry.js +77 -0
  62. package/dist/query/registry.js.map +1 -0
  63. package/dist/query/types.d.ts +53 -0
  64. package/dist/query/types.d.ts.map +1 -0
  65. package/dist/query/types.js +44 -0
  66. package/dist/query/types.js.map +1 -0
  67. package/dist/query/validate.d.ts +11 -0
  68. package/dist/query/validate.d.ts.map +1 -0
  69. package/dist/query/validate.js +82 -0
  70. package/dist/query/validate.js.map +1 -0
  71. package/dist/result-fields.js +1 -1
  72. package/dist/result-fields.js.map +1 -1
  73. package/dist/standards/errors.d.ts +3 -3
  74. package/dist/standards/errors.d.ts.map +1 -1
  75. package/dist/standards/errors.js +7 -7
  76. package/dist/standards/errors.js.map +1 -1
  77. package/dist/standards/index.d.ts +2 -2
  78. package/dist/standards/index.d.ts.map +1 -1
  79. package/dist/standards/index.js +2 -2
  80. package/dist/standards/index.js.map +1 -1
  81. package/dist/standards/lint.d.ts +1 -1
  82. package/dist/standards/lint.d.ts.map +1 -1
  83. package/dist/standards/lint.js +31 -1
  84. package/dist/standards/lint.js.map +1 -1
  85. package/dist/standards/log.d.ts +7 -3
  86. package/dist/standards/log.d.ts.map +1 -1
  87. package/dist/standards/log.js +7 -3
  88. package/dist/standards/log.js.map +1 -1
  89. package/dist/standards/output.d.ts +10 -8
  90. package/dist/standards/output.d.ts.map +1 -1
  91. package/dist/standards/output.js +7 -5
  92. package/dist/standards/output.js.map +1 -1
  93. package/dist/standards/registry.d.ts +2 -0
  94. package/dist/standards/registry.d.ts.map +1 -1
  95. package/dist/standards/registry.js +3 -1
  96. package/dist/standards/registry.js.map +1 -1
  97. package/dist/standards/steps.d.ts +1 -1
  98. package/dist/standards/steps.js +2 -2
  99. package/dist/standards/steps.js.map +1 -1
  100. package/dist/standards/vocabulary.d.ts +18 -0
  101. package/dist/standards/vocabulary.d.ts.map +1 -1
  102. package/dist/standards/vocabulary.js +579 -15
  103. package/dist/standards/vocabulary.js.map +1 -1
  104. package/package.json +7 -2
package/README.md CHANGED
@@ -13,6 +13,10 @@ Published on npm and used by `max-cli`, `cli-messaging`, `tg-cli` and `brazecli`
13
13
  each version is in [`CHANGELOG.md`](CHANGELOG.md); how the package is put together and released is in
14
14
  [`docs/dev/`](docs/dev/ARCHITECTURE.md).
15
15
 
16
+ Up to version 0.20.0 (October 2026) this package was `@wirecat/cli-core`, in the repository `WireCatLabs/cli-core`.
17
+ That name now passes to the shared messaging library (today `@wirecat/cli-messaging`): in older changelogs, plans and
18
+ issues, "cli-core" means this package.
19
+
16
20
  ## The rule this package exists to keep
17
21
 
18
22
  **In a machine mode, stdout carries data and nothing else.** No spinner, no `✓`, no warning, no
@@ -56,6 +60,7 @@ streams.stderr // []
56
60
  | `/release` | release time: `releaseCheck` and the checks it runs — changelog shape, links, package contents, version in step — see below |
57
61
  | `/skill` | the CLI's SKILL.md for coding agents: `skillCommand` (`show`, `install`), `skillHint`, `skillResource` — see below |
58
62
  | `/mcp` | local stdio MCP setup for Codex and Claude Code, plus a read-only handshake and tool-list probe |
63
+ | `/query` | one query language for every list: the Lucene 9.12.3 parser port, fields from an entity schema, validation, the Fields help and `evaluate` as a test oracle — see below |
59
64
  | `/standards` | the registries the standard is made of — vocabulary, output envelope, error object and reasons, next steps, log record, lint rules — as Valibot schemas that also emit JSON Schema 2020-12 |
60
65
 
61
66
  **Nothing in the root export is HTTP.** Status classification, `Retry-After` parsing and the fetch
@@ -68,7 +73,7 @@ import { providerWaitMs, statusToCode } from "@wirecat/cli-base/http"
68
73
 
69
74
  **Portable command control stays independent of provider and store lifetimes.**
70
75
  `fieldsOf("id,speaker.id")` parses up to 128 field paths; `projectFields(value, paths)` selects data
71
- from objects or list items while preserving the list envelope and `operationId` / `sendId`.
76
+ from objects or list items while preserving the list envelope and `operation_id` / `send_id`.
72
77
  `items.id` also works for bare objects and JSONL items. Unknown fields are omitted; parent selections
73
78
  win over their children. Unsafe prototype paths are refused, including when paths are passed directly.
74
79
 
@@ -104,14 +109,26 @@ is a type here, not a runtime dependency — an optional peer, 15 or newer.
104
109
  import { annotate, describeProgram } from "@wirecat/cli-base/commands"
105
110
 
106
111
  annotate(program.command("send"), { mutates: true, examples: ["max messages send 42 hi"] })
107
- annotate(generated, { origin: "generated", operationId: "campaigns.list" })
112
+ annotate(generated, { origin: "generated", operation_id: "campaigns.list" })
108
113
 
109
114
  describeProgram(program) // [{ path: ["send"], usage, origin, mutates, options: [...], commands: [...] }]
110
115
  ```
111
116
 
112
- Each option says whether it `takesValue` and, separately, whether it is `mandatory` — not
117
+ Each option says whether it `takes_value` and, separately, whether it is `mandatory` — not
113
118
  Commander's `required`, which means "takes a value when given" — plus its choices, default,
114
- environment variable, the options it `conflicts` with and the values it `implies`.
119
+ environment variable, the options it `conflicts` with and the values it `implies`, keyed by long flag.
120
+ Every key of the document is snake_case.
121
+
122
+ **A list filters with one query, `@wirecat/cli-base/query`** — `tasks list state:open priority>1`, the
123
+ query positional and last, `[query...]`, over the entity's own snake_case keys. `queryFieldsOf(schema, annotations)`
124
+ reads the fields from the entity's Valibot schema (string → `kw`, a list of choices → `enum`, number → `num`, `isoTime` →
125
+ `time`, boolean → `bool`, `reference` → `ref`); annotations add the exceptions: words (`text`), relations,
126
+ `is:` states, examples, the fields a provider filters natively. `parseLucene(text, { defaultField: "none",
127
+ command })` refuses a bare word (`query.bare-word`); `validateQuery` checks names, operators, values and
128
+ placement and names every field when one is unknown; `fieldsHelp` prints the help's Fields section;
129
+ `QUERY_REASONS` registers the errors. A list filters where its data lives — its store or the provider — and
130
+ never in memory: `evaluate` exists to test those compilers against. `annotate(list, { output: { entity },
131
+ query })` puts both in `commands --json`, where `cli-dev lint` reads them.
115
132
 
116
133
  `refuseJoinedPath(program, args)` throws a `validation_error` when a command path arrived as one
117
134
  argument (`"projects add" --help`, what a zsh loop over `$c` passes), naming the words to type.
@@ -317,6 +334,12 @@ judges it by `LINT_RULES` and `VOCABULARY` from `/standards`. Known violations l
317
334
  `lint/baseline/<rule-id>.json`, one file per rule, and may only shrink: an entry with no violation left
318
335
  fails the run. `--write-baseline` rewrites those files to today's violations. Permanent exceptions go in
319
336
  `lint/overrides.json` — `[{ "rule", "target", "reason" }]` — and more than `--budget` (10) of them fails.
337
+ Every option needs a role from the vocabulary (`paging`, `output`, `sort`, `mode`, `action`, `budget`, `scope`,
338
+ `target`, `value`, `query`) — there is no filter role. `filter-flag` reports an option of a read-only command
339
+ named after a field of its entity (`--kind`, `--since-time`, `--before-id`), except a `scope` flag such as
340
+ `--account`; `list-without-query` a `list` with an `output` entity and no query; `query-example` a field example
341
+ or default term that does not run. `--schemas <file>` names a JSON object of the CLI's own JSON Schemas by name; `key-casing` checks their
342
+ keys, cli-base's envelope, error, log record and commands document schemas, and the document as printed.
320
343
 
321
344
  `--rules` names a module exporting `CHANGELOG` and `docsRules(root)`; `--program` one exporting
322
345
  `createProgram`; `--untested` one exporting `UNTESTED`. A TypeScript module loads on Node 24 as it is.