@wirecat/cli-base 0.24.0 → 0.25.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/README.md +23 -4
- package/THIRD_PARTY_NOTICES +760 -0
- package/dist/commands/document.d.ts +10 -10
- package/dist/commands/document.d.ts.map +1 -1
- package/dist/commands/document.js +27 -9
- package/dist/commands/document.js.map +1 -1
- package/dist/commands/index.d.ts +16 -4
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +10 -3
- package/dist/commands/index.js.map +1 -1
- package/dist/completion/index.js +2 -2
- package/dist/completion/index.js.map +1 -1
- package/dist/deadline.js +1 -1
- package/dist/deadline.js.map +1 -1
- package/dist/dev/lint.d.ts +10 -2
- package/dist/dev/lint.d.ts.map +1 -1
- package/dist/dev/lint.js +132 -7
- package/dist/dev/lint.js.map +1 -1
- package/dist/dev/main.d.ts.map +1 -1
- package/dist/dev/main.js +14 -3
- package/dist/dev/main.js.map +1 -1
- package/dist/errors.d.ts +3 -3
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/failure.d.ts +3 -3
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +9 -7
- package/dist/failure.js.map +1 -1
- package/dist/logging.d.ts +1 -1
- package/dist/logging.d.ts.map +1 -1
- package/dist/logging.js +5 -3
- package/dist/logging.js.map +1 -1
- package/dist/output-buffer.js +3 -3
- package/dist/output-buffer.js.map +1 -1
- package/dist/query/dates.d.ts +15 -0
- package/dist/query/dates.d.ts.map +1 -0
- package/dist/query/dates.js +104 -0
- package/dist/query/dates.js.map +1 -0
- package/dist/query/evaluate.d.ts +15 -0
- package/dist/query/evaluate.d.ts.map +1 -0
- package/dist/query/evaluate.js +70 -0
- package/dist/query/evaluate.js.map +1 -0
- package/dist/query/fields.d.ts +54 -0
- package/dist/query/fields.d.ts.map +1 -0
- package/dist/query/fields.js +87 -0
- package/dist/query/fields.js.map +1 -0
- package/dist/query/help.d.ts +5 -0
- package/dist/query/help.d.ts.map +1 -0
- package/dist/query/help.js +18 -0
- package/dist/query/help.js.map +1 -0
- package/dist/query/index.d.ts +13 -0
- package/dist/query/index.d.ts.map +1 -0
- package/dist/query/index.js +13 -0
- package/dist/query/index.js.map +1 -0
- package/dist/query/parser.d.ts +9 -0
- package/dist/query/parser.d.ts.map +1 -0
- package/dist/query/parser.js +303 -0
- package/dist/query/parser.js.map +1 -0
- package/dist/query/registry.d.ts +23 -0
- package/dist/query/registry.d.ts.map +1 -0
- package/dist/query/registry.js +77 -0
- package/dist/query/registry.js.map +1 -0
- package/dist/query/types.d.ts +45 -0
- package/dist/query/types.d.ts.map +1 -0
- package/dist/query/types.js +17 -0
- package/dist/query/types.js.map +1 -0
- package/dist/query/validate.d.ts +11 -0
- package/dist/query/validate.d.ts.map +1 -0
- package/dist/query/validate.js +82 -0
- package/dist/query/validate.js.map +1 -0
- package/dist/result-fields.js +1 -1
- package/dist/result-fields.js.map +1 -1
- package/dist/standards/errors.d.ts +3 -3
- package/dist/standards/errors.d.ts.map +1 -1
- package/dist/standards/errors.js +7 -7
- package/dist/standards/errors.js.map +1 -1
- package/dist/standards/index.d.ts +2 -2
- package/dist/standards/index.d.ts.map +1 -1
- package/dist/standards/index.js +2 -2
- package/dist/standards/index.js.map +1 -1
- package/dist/standards/lint.d.ts +1 -1
- package/dist/standards/lint.d.ts.map +1 -1
- package/dist/standards/lint.js +31 -1
- package/dist/standards/lint.js.map +1 -1
- package/dist/standards/log.d.ts +7 -3
- package/dist/standards/log.d.ts.map +1 -1
- package/dist/standards/log.js +7 -3
- package/dist/standards/log.js.map +1 -1
- package/dist/standards/output.d.ts +10 -8
- package/dist/standards/output.d.ts.map +1 -1
- package/dist/standards/output.js +7 -5
- package/dist/standards/output.js.map +1 -1
- package/dist/standards/registry.d.ts +2 -0
- package/dist/standards/registry.d.ts.map +1 -1
- package/dist/standards/registry.js +3 -1
- package/dist/standards/registry.js.map +1 -1
- package/dist/standards/steps.d.ts +1 -1
- package/dist/standards/steps.js +2 -2
- package/dist/standards/steps.js.map +1 -1
- package/dist/standards/vocabulary.d.ts +18 -0
- package/dist/standards/vocabulary.d.ts.map +1 -1
- package/dist/standards/vocabulary.js +91 -15
- package/dist/standards/vocabulary.js.map +1 -1
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -56,6 +56,7 @@ streams.stderr // []
|
|
|
56
56
|
| `/release` | release time: `releaseCheck` and the checks it runs — changelog shape, links, package contents, version in step — see below |
|
|
57
57
|
| `/skill` | the CLI's SKILL.md for coding agents: `skillCommand` (`show`, `install`), `skillHint`, `skillResource` — see below |
|
|
58
58
|
| `/mcp` | local stdio MCP setup for Codex and Claude Code, plus a read-only handshake and tool-list probe |
|
|
59
|
+
| `/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
60
|
| `/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
61
|
|
|
61
62
|
**Nothing in the root export is HTTP.** Status classification, `Retry-After` parsing and the fetch
|
|
@@ -68,7 +69,7 @@ import { providerWaitMs, statusToCode } from "@wirecat/cli-base/http"
|
|
|
68
69
|
|
|
69
70
|
**Portable command control stays independent of provider and store lifetimes.**
|
|
70
71
|
`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 `
|
|
72
|
+
from objects or list items while preserving the list envelope and `operation_id` / `send_id`.
|
|
72
73
|
`items.id` also works for bare objects and JSONL items. Unknown fields are omitted; parent selections
|
|
73
74
|
win over their children. Unsafe prototype paths are refused, including when paths are passed directly.
|
|
74
75
|
|
|
@@ -104,14 +105,26 @@ is a type here, not a runtime dependency — an optional peer, 15 or newer.
|
|
|
104
105
|
import { annotate, describeProgram } from "@wirecat/cli-base/commands"
|
|
105
106
|
|
|
106
107
|
annotate(program.command("send"), { mutates: true, examples: ["max messages send 42 hi"] })
|
|
107
|
-
annotate(generated, { origin: "generated",
|
|
108
|
+
annotate(generated, { origin: "generated", operation_id: "campaigns.list" })
|
|
108
109
|
|
|
109
110
|
describeProgram(program) // [{ path: ["send"], usage, origin, mutates, options: [...], commands: [...] }]
|
|
110
111
|
```
|
|
111
112
|
|
|
112
|
-
Each option says whether it `
|
|
113
|
+
Each option says whether it `takes_value` and, separately, whether it is `mandatory` — not
|
|
113
114
|
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
|
|
115
|
+
environment variable, the options it `conflicts` with and the values it `implies`, keyed by long flag.
|
|
116
|
+
Every key of the document is snake_case.
|
|
117
|
+
|
|
118
|
+
**A list filters with one query, `@wirecat/cli-base/query`** — `tasks list state:open priority>1`, the
|
|
119
|
+
query positional and last, `[query...]`, over the entity's own snake_case keys. `queryFieldsOf(schema, annotations)`
|
|
120
|
+
reads the fields from the entity's Valibot schema (string → `kw`, a list of choices → `enum`, number → `num`, `isoTime` →
|
|
121
|
+
`time`, boolean → `bool`, `reference` → `ref`); annotations add the exceptions: words (`text`), relations,
|
|
122
|
+
`is:` states, examples, the fields a provider filters natively. `parseLucene(text, { defaultField: "none",
|
|
123
|
+
command })` refuses a bare word (`query.bare-word`); `validateQuery` checks names, operators, values and
|
|
124
|
+
placement and names every field when one is unknown; `fieldsHelp` prints the help's Fields section;
|
|
125
|
+
`QUERY_REASONS` registers the errors. A list filters where its data lives — its store or the provider — and
|
|
126
|
+
never in memory: `evaluate` exists to test those compilers against. `annotate(list, { output: { entity },
|
|
127
|
+
query })` puts both in `commands --json`, where `cli-dev lint` reads them.
|
|
115
128
|
|
|
116
129
|
`refuseJoinedPath(program, args)` throws a `validation_error` when a command path arrived as one
|
|
117
130
|
argument (`"projects add" --help`, what a zsh loop over `$c` passes), naming the words to type.
|
|
@@ -317,6 +330,12 @@ judges it by `LINT_RULES` and `VOCABULARY` from `/standards`. Known violations l
|
|
|
317
330
|
`lint/baseline/<rule-id>.json`, one file per rule, and may only shrink: an entry with no violation left
|
|
318
331
|
fails the run. `--write-baseline` rewrites those files to today's violations. Permanent exceptions go in
|
|
319
332
|
`lint/overrides.json` — `[{ "rule", "target", "reason" }]` — and more than `--budget` (10) of them fails.
|
|
333
|
+
Every option needs a role from the vocabulary (`paging`, `output`, `sort`, `mode`, `action`, `budget`, `scope`,
|
|
334
|
+
`target`, `value`, `query`) — there is no filter role. `filter-flag` reports an option of a read-only command
|
|
335
|
+
named after a field of its entity (`--kind`, `--since-time`, `--before-id`), except a `scope` flag such as
|
|
336
|
+
`--account`; `list-without-query` a `list` with an `output` entity and no query; `query-example` a field example
|
|
337
|
+
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
|
|
338
|
+
keys, cli-base's envelope, error, log record and commands document schemas, and the document as printed.
|
|
320
339
|
|
|
321
340
|
`--rules` names a module exporting `CHANGELOG` and `docsRules(root)`; `--program` one exporting
|
|
322
341
|
`createProgram`; `--untested` one exporting `UNTESTED`. A TypeScript module loads on Node 24 as it is.
|