@wirecat/cli-base 0.63.0 → 0.65.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 (42) hide show
  1. package/CHANGELOG.md +232 -0
  2. package/dist/codegen/discovery.d.ts +3 -3
  3. package/dist/codegen/discovery.js +18 -9
  4. package/dist/codegen/index.d.ts +3 -1
  5. package/dist/codegen/index.js +3 -1
  6. package/dist/codegen/json-schema.d.ts +8 -0
  7. package/dist/codegen/json-schema.js +78 -0
  8. package/dist/commands/index.d.ts +1 -1
  9. package/dist/commands/index.js +1 -1
  10. package/dist/credentials.d.ts +1 -1
  11. package/dist/dev/bundle.d.ts +31 -0
  12. package/dist/dev/bundle.js +280 -0
  13. package/dist/dev/main.js +48 -1
  14. package/dist/skill/index.d.ts +1 -1
  15. package/dist/skill/index.js +2 -2
  16. package/dist/standards/audit.js +8 -0
  17. package/dist/standards/flags-calendar.d.ts +2 -0
  18. package/dist/standards/flags-calendar.js +72 -0
  19. package/dist/standards/flags-how.js +7 -1
  20. package/dist/standards/flags-what.js +7 -0
  21. package/dist/standards/vocabulary.js +13 -2
  22. package/docs/standards/README.md +5 -5
  23. package/docs/standards/accounts.md +44 -11
  24. package/docs/standards/architecture.md +19 -12
  25. package/docs/standards/ci.md +33 -12
  26. package/docs/standards/commands.md +35 -10
  27. package/docs/standards/data-model.md +5 -1
  28. package/docs/standards/docs.md +4 -1
  29. package/docs/standards/kit-surface.md +6 -5
  30. package/docs/standards/layout.md +32 -0
  31. package/docs/standards/lifecycle.md +69 -8
  32. package/docs/standards/mcp.md +48 -24
  33. package/docs/standards/new-cli.md +30 -16
  34. package/docs/standards/output.md +13 -2
  35. package/docs/standards/permissions.md +46 -3
  36. package/docs/standards/releases.md +21 -5
  37. package/docs/standards/security.md +16 -8
  38. package/docs/standards/store.md +4 -3
  39. package/docs/standards/testing.md +19 -8
  40. package/docs/standards/time.md +8 -1
  41. package/docs/standards/toolchain.md +24 -18
  42. package/package.json +6 -1
@@ -15,22 +15,23 @@ The [community standards](https://github.com/WireCatLabs/community/blob/main/sta
15
15
  one source of the presets. Each repository holds a copy of them in `config/wirecat/`, installed by
16
16
  `adopt-standards.py`.
17
17
 
18
- "The ten repositories" on this page means the six CLIs (tg, max, memo, drive, zoom, wa), cli-base, cli-core,
19
- cli-testing, cli-docs, plus community itself. cli-template follows every rule here as a CLI does
18
+ "The WireCat repositories" on this page means every WireCat CLI (today tg, max, memo, drive, zoom, wa and gcal; a
19
+ CLI made with `npx @wirecat/cli-template new` counts from its first commit), cli-base, cli-core, cli-testing, cli-docs,
20
+ plus community itself. cli-template follows every rule here as a CLI does
20
21
  ([New CLI](new-cli.md#the-template-repository-itself)).
21
22
 
22
23
  ## Rules
23
24
 
24
25
  ### WC-TOOL-1 · Install the shared presets with `adopt-standards.py`, and never edit the copies
25
26
 
26
- - **Why:** one reviewed set of presets keeps ten repositories alike; an edited copy drifts without anyone seeing it.
27
+ - **Why:** one reviewed set of presets keeps the repositories alike; an edited copy drifts without anyone seeing it.
27
28
  - **Enforced by:** `pnpm standards:check` · `standards.yml:standards`.
28
29
  - **Example:** `python3 scripts/adopt-standards.py /path/to/project` from a community checkout, then commit
29
30
  `config/wirecat/` and the lockfile. `standards:check` compares each file in `config/wirecat/` with the hash in
30
31
  `config/wirecat/manifest.json`.
31
32
  - **Exceptions:** none. A general improvement goes to community and comes back through a new adoption. A
32
33
  project-only setting goes in the root config (WC-TOOL-2).
33
- - **Applies to:** the ten repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
34
+ - **Applies to:** the WireCat repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
34
35
 
35
36
  ### WC-TOOL-2 · Make each root config extend its copy in `config/wirecat/`
36
37
 
@@ -41,7 +42,7 @@ cli-testing, cli-docs, plus community itself. cli-template follows every rule he
41
42
  `lefthook.yml` extends `config/wirecat/lefthook.yml`.
42
43
  - **Exceptions:** do not extend `@wirecat/cli-base/biome` or `@wirecat/cli-base/lefthook.yml`. No repository uses
43
44
  them, and `standards:check` accepts only the paths above.
44
- - **Applies to:** the ten repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
45
+ - **Applies to:** the WireCat repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
45
46
 
46
47
  ### WC-TOOL-3 · Pin the tool versions that `toolchain.json` names
47
48
 
@@ -50,7 +51,7 @@ cli-testing, cli-docs, plus community itself. cli-template follows every rule he
50
51
  - **Example:** `package.json` has `"packageManager": "pnpm@11.20.0"` and exact `devDependencies` for
51
52
  `@biomejs/biome`, `cspell` and its three dictionaries, `lefthook` and `markdownlint-cli2`, as in the manifest.
52
53
  - **Exceptions:** none.
53
- - **Applies to:** the ten repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
54
+ - **Applies to:** the WireCat repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
54
55
 
55
56
  ### WC-TOOL-4 · Extend the shared TypeScript config, and do not loosen it
56
57
 
@@ -101,7 +102,7 @@ cli-testing, cli-docs, plus community itself. cli-template follows every rule he
101
102
  - **Example:** the shared preset sets 2 spaces, double quotes, semicolons only where needed, trailing commas, arrow
102
103
  parentheses always and 120 columns. Run `pnpm lint:fix` to apply them.
103
104
  - **Exceptions:** none.
104
- - **Applies to:** the ten repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
105
+ - **Applies to:** the WireCat repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
105
106
 
106
107
  ### WC-TOOL-8 · Keep the shared Biome rules at error
107
108
 
@@ -111,7 +112,7 @@ cli-testing, cli-docs, plus community itself. cli-template follows every rule he
111
112
  noUnusedImports, noUnusedVariables and noExplicitAny.
112
113
  - **Exceptions:** a repository may add rules or raise a level. It may not turn a shared rule off (index, "Which rule
113
114
  wins").
114
- - **Applies to:** the ten repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
115
+ - **Applies to:** the WireCat repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
115
116
 
116
117
  ### WC-TOOL-9 · Write to the console only with `console.error`, except in `scripts/`
117
118
 
@@ -122,7 +123,7 @@ cli-testing, cli-docs, plus community itself. cli-template follows every rule he
122
123
  - **Exceptions:** files under `scripts/` may print, because they are development tools. A shared package prints
123
124
  nothing at all, not even with `console.error`
124
125
  ([WC-ARCH-19](architecture.md#wc-arch-19--shared-packages-print-nothing-and-log-nothing-on-their-own)).
125
- - **Applies to:** the ten repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
126
+ - **Applies to:** the WireCat repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
126
127
 
127
128
  ### WC-TOOL-10 · Keep the secret lint on, and suppress a finding only with its reason
128
129
 
@@ -132,7 +133,7 @@ cli-testing, cli-docs, plus community itself. cli-template follows every rule he
132
133
  `// biome-ignore lint/security/noSecrets: Crockford base32 alphabet, not a key`.
133
134
  - **Exceptions:** the rule is off in test files, `test/`, `tests/`, `__tests__/`, `fixtures/` and `generated/`,
134
135
  because those hold fake credentials or cannot keep a suppression comment.
135
- - **Applies to:** the ten repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
136
+ - **Applies to:** the WireCat repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
136
137
 
137
138
  ### WC-TOOL-11 · Keep the three grit plugins that block unsafe calls
138
139
 
@@ -149,7 +150,7 @@ no-unbounded-spread ([WC-TOOL-12](#wc-tool-12--do-not-spread-a-list-of-user-data
149
150
  concatenation. no-new-function reports `new Function(...)` and `Function(...)`.
150
151
  - **Exceptions:** a reviewed site may keep a `biome-ignore` comment with the reason, for example a Windows `.cmd` shim
151
152
  with fixed arguments. The plugins read syntax, not data flow, so review and CodeQL at release cover the rest.
152
- - **Applies to:** the ten repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
153
+ - **Applies to:** the WireCat repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
153
154
 
154
155
  ### WC-TOOL-12 · Do not spread a list of user data into call arguments
155
156
 
@@ -159,7 +160,7 @@ no-unbounded-spread ([WC-TOOL-12](#wc-tool-12--do-not-spread-a-list-of-user-data
159
160
  plugin reports `.push(...x)`, `Math.max(...x)` and `Math.min(...x)` as a warning.
160
161
  - **Exceptions:** a spread over a list that is small by construction may stay. The plugin skips tests, `testing/`,
161
162
  `scripts/`, `bench/` and `performance/`.
162
- - **Applies to:** the ten repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
163
+ - **Applies to:** the WireCat repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
163
164
 
164
165
  ### WC-TOOL-13 · Cap every file at 1,000 lines with Biome
165
166
 
@@ -172,7 +173,7 @@ no-unbounded-spread ([WC-TOOL-12](#wc-tool-12--do-not-spread-a-list-of-user-data
172
173
  `src/telegram/adapter.ts`; four files in cli-core). A smaller cap is allowed: zoom uses 500. cli-docs turns it off for
173
174
  stylesheets. Biome reads only JavaScript and TypeScript, so the cap does not cover
174
175
  code in another language, such as wa's Go engine; the review signals of WC-LAY-7 still apply to it.
175
- - **Applies to:** the ten repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
176
+ - **Applies to:** the WireCat repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
176
177
 
177
178
  ### WC-TOOL-14 · Turn on the import cycle rule
178
179
 
@@ -180,7 +181,7 @@ no-unbounded-spread ([WC-TOOL-12](#wc-tool-12--do-not-spread-a-list-of-user-data
180
181
  - **Enforced by:** `pnpm lint` · `standards.yml:standards` (the shared Biome base, like WC-TOOL-8).
181
182
  - **Example:** the shared Biome base sets the suspicious rule noImportCycles to error.
182
183
  - **Exceptions:** none.
183
- - **Applies to:** the ten repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
184
+ - **Applies to:** the WireCat repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
184
185
 
185
186
  ### WC-TOOL-15 · Declare layer boundaries as restricted imports in `biome.json`
186
187
 
@@ -199,8 +200,13 @@ no-unbounded-spread ([WC-TOOL-12](#wc-tool-12--do-not-spread-a-list-of-user-data
199
200
  request.
200
201
  - **Enforced by:** `<app>: pnpm lint:commands`.
201
202
  - **Example:** `"lint:commands": "cli-dev lint --cli dist/bin/max.js"`, run by `ci:quick` after the build. Known
202
- violations live in `lint/baseline/<rule-id>.json`; an entry with no violation left fails the run. A permanent
203
- exception goes in `lint/overrides.json` with `rule`, `target`, `reason`, `owner` and `review_after`. More than 10
203
+ violations live in `lint/baseline/<rule-id>.json`; an entry with no violation left fails the run. A violation that a
204
+ shared package forces, such as a verb cli-core names before the vocabulary has it, goes in the baseline too and
205
+ comes out when the shared package catches up. A word the CLI needs that the vocabulary does not have yet goes in
206
+ `lint/overrides.json`, never in the baseline: its `reason` links the cli-base pull request or issue that adds the
207
+ word, and it comes out in the change that takes the cli-base release with the word. The shared package's words
208
+ go in the baseline, as above; the CLI's own go in the overrides, where the count and the date keep them few. A permanent exception also goes in `lint/overrides.json`, with `rule`, `target`, `reason`, `owner`
209
+ and `review_after`. More than 10
204
210
  overrides fail the run, and so does one past its date. The rules themselves are on the
205
211
  [Commands page](commands.md).
206
212
  - **Exceptions:** zoom runs `lint:commands` in full validation only. cli-core runs its own command lint test in
@@ -218,7 +224,7 @@ no-unbounded-spread ([WC-TOOL-12](#wc-tool-12--do-not-spread-a-list-of-user-data
218
224
  - **Exceptions:** a general word goes into the community word list, not into each project. cli-base checks
219
225
  `README.md` and `docs/standards/`; cli-docs its site pages in `content/docs/`; community every Markdown file it
220
226
  publishes. cli-core, zoom and cli-testing check only `README.md` yet.
221
- - **Applies to:** the ten repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
227
+ - **Applies to:** the WireCat repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
222
228
 
223
229
  ### WC-TOOL-18 · Lint Markdown with `markdownlint-cli2` and the shared preset
224
230
 
@@ -227,7 +233,7 @@ no-unbounded-spread ([WC-TOOL-12](#wc-tool-12--do-not-spread-a-list-of-user-data
227
233
  - **Example:** the preset turns on only: no tabs (MD010), at most two blank lines in a row (MD012), a language on
228
234
  every fenced code block (MD040) and no empty links (MD042). `.markdownlint-cli2.jsonc` lists the files to check.
229
235
  - **Exceptions:** a repository may turn on more rules in its root config.
230
- - **Applies to:** the ten repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
236
+ - **Applies to:** the WireCat repositories. **Since:** cli-base 0.41.0. **Rulings:** none.
231
237
 
232
238
  ### WC-TOOL-19 · Check user pages with `rumdl` and the shared `rumdl.toml`
233
239
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-base",
3
- "version": "0.63.0",
3
+ "version": "0.65.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",
@@ -135,6 +135,7 @@
135
135
  "@vitest/coverage-v8": "^5.0.5",
136
136
  "commander": "^15.0.0",
137
137
  "cspell": "10.4.0",
138
+ "esbuild": "0.28.2",
138
139
  "lefthook": "2.2.2",
139
140
  "markdownlint-cli2": "0.24.0",
140
141
  "typescript": "^7.0.2",
@@ -146,12 +147,16 @@
146
147
  },
147
148
  "peerDependencies": {
148
149
  "commander": ">=15",
150
+ "esbuild": "^0.28.0",
149
151
  "vitest": ">=5"
150
152
  },
151
153
  "peerDependenciesMeta": {
152
154
  "commander": {
153
155
  "optional": true
154
156
  },
157
+ "esbuild": {
158
+ "optional": true
159
+ },
155
160
  "vitest": {
156
161
  "optional": true
157
162
  }