@wirecat/cli-base 0.64.0 → 0.65.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 +131 -0
- package/dist/credentials.d.ts +3 -0
- package/dist/credentials.js +13 -3
- package/dist/dev/bundle.d.ts +6 -0
- package/dist/dev/bundle.js +12 -3
- package/dist/dev/land.d.ts +4 -3
- package/dist/dev/land.js +4 -3
- package/dist/dev/main.js +4 -0
- package/dist/standards/audit.js +9 -1
- package/dist/standards/flags-calendar.js +13 -0
- package/dist/standards/flags-what.js +7 -0
- package/dist/standards/vocabulary.js +3 -1
- package/docs/standards/README.md +3 -3
- package/docs/standards/accounts.md +42 -9
- package/docs/standards/architecture.md +19 -12
- package/docs/standards/ci.md +1 -0
- package/docs/standards/commands.md +36 -12
- package/docs/standards/data-model.md +5 -1
- package/docs/standards/docs.md +4 -1
- package/docs/standards/kit-surface.md +5 -4
- package/docs/standards/layout.md +3 -2
- package/docs/standards/lifecycle.md +69 -8
- package/docs/standards/mcp.md +48 -24
- package/docs/standards/new-cli.md +2 -2
- package/docs/standards/output.md +13 -2
- package/docs/standards/permissions.md +24 -11
- package/docs/standards/releases.md +8 -2
- package/docs/standards/security.md +29 -5
- package/docs/standards/store.md +3 -2
- package/docs/standards/testing.md +10 -5
- package/docs/standards/time.md +8 -1
- package/docs/standards/toolchain.md +7 -2
- package/package.json +1 -1
package/docs/standards/store.md
CHANGED
|
@@ -52,8 +52,9 @@ Related pages: which account a read covers, and how a read across accounts is as
|
|
|
52
52
|
accounts on purpose asks for the whole store with `crossAccount(deps, reason)`; see [Accounts](accounts.md).
|
|
53
53
|
- **Exceptions:** `forAccount` binds only the account areas (accounts, chats, sync, messages, attachments, roster,
|
|
54
54
|
people, conversations, vectors, counters, tags, mentions). The `chats`, `conversations` and `attachments` services
|
|
55
|
-
use the bound store; the other services still pair `deps.store()` with `deps.account()`.
|
|
56
|
-
|
|
55
|
+
use the bound store; the other services still pair `deps.store()` with `deps.account()`. The calendar areas
|
|
56
|
+
(calendars, calendar entries, their sync cursors) are not bound either: cli-core's calendar commands pass
|
|
57
|
+
`accountId` to every call, a known gap as of 2026-10-27. New code uses the bound store.
|
|
57
58
|
- **Applies to:** cli-core and every CLI that adds a service. **Since:** cli-base 0.41.0. **Rulings:** none.
|
|
58
59
|
|
|
59
60
|
### WC-STORE-4 · Reach the store through its public module, never a table module
|
|
@@ -171,8 +171,9 @@ and which run after merge is in [CI](ci.md).
|
|
|
171
171
|
- **Enforced by:** `node-ci.yml:check` · `<app>: pnpm test:matrix:check`.
|
|
172
172
|
- **Example:** under vitest, `run()` appends each parsed command path and option name (never a value) to
|
|
173
173
|
`coverage/argv.jsonl`. `pnpm test:matrix` turns that into `docs/dev/test-matrix.md` and fails on a command or
|
|
174
|
-
option with neither a test nor a reason. A
|
|
175
|
-
function directly does not
|
|
174
|
+
option with neither a test nor a reason. A test counts only when it runs the command through `run()`: a test that
|
|
175
|
+
calls a function directly records no command line, so the matrix does not see it. A reason says what covers the
|
|
176
|
+
command instead: the live scenario that runs it, or, for a generated group, the two tests below.
|
|
176
177
|
- **Exceptions:** commands generated from a service's API description, such as drive's and gcal's
|
|
177
178
|
`api <method>` from a Google Discovery snapshot, share one reason for the whole group (`api *` and its options).
|
|
178
179
|
It names two tests: one that checks every generated command's options against the snapshot, and one that drives a
|
|
@@ -198,9 +199,13 @@ and which run after merge is in [CI](ci.md).
|
|
|
198
199
|
- **Enforced by:** `node-ci.yml:check` · `<app>: pnpm contracts:upgrade`.
|
|
199
200
|
- **Example:** `pnpm contracts:upgrade` runs the previous published package and this build on the same synthetic
|
|
200
201
|
state and checks that the data survives. Each store migration also has its own upgrade test (WC-STORE-9).
|
|
201
|
-
- **Exceptions:** a CLI with no local state, or with no published version yet. Local state is data the CLI
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
- **Exceptions:** a CLI with no local state, or with no published version yet. Local state is data the CLI writes
|
|
203
|
+
and reads back in a later run, such as a store, a session or a cache. The shared store counts, also when cli-core's
|
|
204
|
+
code writes it, because the CLI's release decides which cli-core and so which migrations run: gcal's calendars and
|
|
205
|
+
events in the store are its local state. A config file, run records, the
|
|
206
|
+
update check, MCP logins and lock files that only cli-core writes do not count. Tests still keep them in the
|
|
207
|
+
sandboxed home, like every other path
|
|
208
|
+
([WC-TEST-1](#wc-test-1--point-every-path-a-test-could-write-at-a-temporary-directory)).
|
|
204
209
|
- **Applies to:** all CLIs with local state. wa has no upgrade contract yet. **Since:** cli-base 0.41.0. **Rulings:** none.
|
|
205
210
|
|
|
206
211
|
### WC-TEST-15 · A refactor keeps `commands --json` and the MCP tool list as they were
|
package/docs/standards/time.md
CHANGED
|
@@ -76,7 +76,14 @@ local midnight. The answer gives the window it used, in UTC.
|
|
|
76
76
|
- **Why:** "messages of 1 September" means the owner's day, not the UTC day, which starts hours earlier or later.
|
|
77
77
|
- **Enforced by:** review only.
|
|
78
78
|
- **Example:** in `Asia/Vladivostok`, `--since-time 2026-09-01` gives `meta.window.since` = `2026-08-31T14:00:00.000Z`.
|
|
79
|
-
-
|
|
79
|
+
A thing that has only dates, such as an all-day event (`start_date` 2026-09-01, `end_date` 2026-09-02, the end
|
|
80
|
+
not included), matches by comparing local dates, never UTC moments: it is in the window when its dates overlap the
|
|
81
|
+
local dates the window covers. So in `Europe/Madrid` a filter for 1 September returns the all-day event of
|
|
82
|
+
1 September and not the one of 31 August, whatever zone the event's calendar is in.
|
|
83
|
+
- **Exceptions:** none. Known gap, as of 2026-10-27, read from the code and not run: cli-core's event filter
|
|
84
|
+
(`src/store/sqlite/calendar.ts`, the `events` query) compares `starts_at` and `ends_at` with the UTC window for
|
|
85
|
+
all-day events too, and gcal stores an all-day event's start as midnight in its calendar's zone. The two agree
|
|
86
|
+
when the calendar's zone is the zone in use, and miss by a day at the edges when it is not.
|
|
80
87
|
- **Applies to:** all CLIs. **Since:** cli-base 0.48.0. **Rulings:** none.
|
|
81
88
|
|
|
82
89
|
### WC-TIME-6 · Run the tests in a zone that is not UTC, and prove stored values do not depend on it
|
|
@@ -200,8 +200,13 @@ no-unbounded-spread ([WC-TOOL-12](#wc-tool-12--do-not-spread-a-list-of-user-data
|
|
|
200
200
|
request.
|
|
201
201
|
- **Enforced by:** `<app>: pnpm lint:commands`.
|
|
202
202
|
- **Example:** `"lint:commands": "cli-dev lint --cli dist/bin/max.js"`, run by `ci:quick` after the build. Known
|
|
203
|
-
violations live in `lint/baseline/<rule-id>.json`; an entry with no violation left fails the run. A
|
|
204
|
-
|
|
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
|
|
205
210
|
overrides fail the run, and so does one past its date. The rules themselves are on the
|
|
206
211
|
[Commands page](commands.md).
|
|
207
212
|
- **Exceptions:** zoom runs `lint:commands` in full validation only. cli-core runs its own command lint test in
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.65.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",
|