@wirecat/cli-base 0.97.0 → 0.98.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/CHANGELOG.md +66 -0
- package/dist/commands/document.js +1 -1
- package/dist/commands/registry.d.ts +2 -1
- package/dist/dev/adopt.d.ts +6 -0
- package/dist/dev/adopt.js +43 -0
- package/dist/dev/audit.js +2 -2
- package/dist/dev/conformance.d.ts +5 -0
- package/dist/dev/conformance.js +24 -4
- package/dist/dev/family.d.ts +10 -0
- package/dist/dev/family.js +41 -0
- package/dist/dev/lint.d.ts +5 -0
- package/dist/dev/lint.js +32 -7
- package/dist/dev/main.js +166 -23
- package/dist/dev/network.js +10 -2
- package/dist/http/index.d.ts +23 -2
- package/dist/http/index.js +61 -0
- package/dist/release/fragments.d.ts +17 -0
- package/dist/release/fragments.js +108 -0
- package/dist/release/index.d.ts +2 -0
- package/dist/release/index.js +2 -0
- package/dist/release/level.d.ts +2 -0
- package/dist/release/level.js +52 -0
- package/dist/standards/audit.d.ts +2 -0
- package/dist/standards/audit.js +2 -0
- package/dist/standards/flags-account.d.ts +3 -0
- package/dist/standards/flags-account.js +36 -0
- package/dist/standards/lint.d.ts +17 -1
- package/dist/standards/lint.js +22 -5
- package/dist/standards/tables.d.ts +1 -1
- package/dist/standards/tables.js +1 -1
- package/dist/standards/vocabulary.js +3 -0
- package/docs/standards/accounts.md +3 -3
- package/docs/standards/layout.md +1 -1
- package/docs/standards/lifecycle.md +4 -6
- package/docs/standards/output.md +2 -2
- package/docs/standards/releases.md +6 -4
- package/docs/standards/testing.md +1 -1
- package/docs/standards/toolchain.md +7 -3
- package/package.json +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** The version level a changelog section needs: `Added` a minor, a break a major (a minor before 1.0.0). */
|
|
2
|
+
const LEVELS = ["patch", "minor", "major"];
|
|
3
|
+
const parse = (version) => version.split(".").map(Number);
|
|
4
|
+
const raised = (from, to) => {
|
|
5
|
+
const [a = 0, b = 0] = parse(from);
|
|
6
|
+
const [x = 0, y = 0] = parse(to);
|
|
7
|
+
if (x !== a)
|
|
8
|
+
return "major";
|
|
9
|
+
return y !== b ? "minor" : "patch";
|
|
10
|
+
};
|
|
11
|
+
// Before 1.0.0 the minor carries what a major would; a fix-only release is the only patch.
|
|
12
|
+
const needed = (version, section) => {
|
|
13
|
+
const breaks = /^### (Changed — may break callers|Removed)$/m.test(section);
|
|
14
|
+
if (breaks)
|
|
15
|
+
return (parse(version)[0] ?? 0) >= 1 ? "major" : "minor";
|
|
16
|
+
return /^### Added$/m.test(section) ? "minor" : "patch";
|
|
17
|
+
};
|
|
18
|
+
const raise = (from, level) => {
|
|
19
|
+
const [a = 0, b = 0, c = 0] = parse(from);
|
|
20
|
+
if (level === "major")
|
|
21
|
+
return `${a + 1}.0.0`;
|
|
22
|
+
return level === "minor" ? `${a}.${b + 1}.0` : `${a}.${b}.${c + 1}`;
|
|
23
|
+
};
|
|
24
|
+
const later = (x, y) => {
|
|
25
|
+
const [a, b] = [parse(x), parse(y)];
|
|
26
|
+
const i = a.findIndex((n, k) => n !== b[k]);
|
|
27
|
+
return i === -1 || (a[i] ?? 0) > (b[i] ?? 0) ? x : y;
|
|
28
|
+
};
|
|
29
|
+
const sections = (changelog) => {
|
|
30
|
+
const [top, below] = [...changelog.matchAll(/^## (\S+).*$/gm)];
|
|
31
|
+
if (!top || !below?.[1])
|
|
32
|
+
return undefined;
|
|
33
|
+
return { version: top[1], previous: below[1], section: changelog.slice(top.index, below.index) };
|
|
34
|
+
};
|
|
35
|
+
// The next free number on npm is a patch; the top section may need a minor or major over the version below it.
|
|
36
|
+
export const levelledVersion = (changelog, next) => {
|
|
37
|
+
const parts = sections(changelog);
|
|
38
|
+
if (!parts)
|
|
39
|
+
return next;
|
|
40
|
+
return later(next, raise(parts.previous, needed(next, parts.section)));
|
|
41
|
+
};
|
|
42
|
+
export const versionLevelProblem = (changelog) => {
|
|
43
|
+
const parts = sections(changelog);
|
|
44
|
+
if (!parts?.version || !/^\d+\.\d+\.\d+$/.test(parts.version))
|
|
45
|
+
return undefined;
|
|
46
|
+
const { version, previous, section } = parts;
|
|
47
|
+
const want = needed(version, section);
|
|
48
|
+
const got = raised(previous, version);
|
|
49
|
+
if (LEVELS.indexOf(got) >= LEVELS.indexOf(want))
|
|
50
|
+
return undefined;
|
|
51
|
+
return `${version} raises the ${got} version over ${previous}, but its changelog needs a ${want} release`;
|
|
52
|
+
};
|
|
@@ -30,6 +30,8 @@ declare const parityGroupSchema: v.StrictObjectSchema<{
|
|
|
30
30
|
/** The one CLI that has the path or flag by design; every other CLI compared must lack it. */
|
|
31
31
|
readonly only: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a lower-case word, words joined by -">]>, undefined>;
|
|
32
32
|
readonly reason: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>, v.MinLengthAction<string, 10, "say why, in a sentence">]>;
|
|
33
|
+
/** Warns from 14 days before and fails 14 days after, as a lint override does. */
|
|
34
|
+
readonly review_after: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoDateAction<string, "a date, YYYY-MM-DD">]>, undefined>;
|
|
33
35
|
}, undefined>, undefined>;
|
|
34
36
|
}, undefined>;
|
|
35
37
|
export type ParityGroup = v.InferOutput<typeof parityGroupSchema>;
|
package/dist/standards/audit.js
CHANGED
|
@@ -59,6 +59,8 @@ const parityGroupSchema = v.strictObject({
|
|
|
59
59
|
/** The one CLI that has the path or flag by design; every other CLI compared must lack it. */
|
|
60
60
|
only: v.optional(word),
|
|
61
61
|
reason: v.pipe(text, v.minLength(10, "say why, in a sentence")),
|
|
62
|
+
/** Warns from 14 days before and fails 14 days after, as a lint override does. */
|
|
63
|
+
review_after: v.optional(v.pipe(v.string(), v.isoDate("a date, YYYY-MM-DD"))),
|
|
62
64
|
})),
|
|
63
65
|
});
|
|
64
66
|
export const defineParityGroups = (input) => parseRegistry("parity groups", v.array(parityGroupSchema), input, (groups) => [
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** The words cli-core's shared sign-in and account commands use in every CLI. */
|
|
2
|
+
export const ACCOUNT_FLAGS = [
|
|
3
|
+
{
|
|
4
|
+
name: "--client-id",
|
|
5
|
+
value: "<id>",
|
|
6
|
+
role: "mode",
|
|
7
|
+
type: "id",
|
|
8
|
+
meaning: "sign in through the owner's own OAuth app with this client ID instead of WireCat's (WC-SECR-25)",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "--client-file",
|
|
12
|
+
value: "<file>",
|
|
13
|
+
role: "mode",
|
|
14
|
+
type: "path",
|
|
15
|
+
meaning: "sign in through the owner's own OAuth app read from this client JSON instead of WireCat's (WC-SECR-25)",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "--keep-data",
|
|
19
|
+
role: "mode",
|
|
20
|
+
type: "switch",
|
|
21
|
+
meaning: "remove the account but leave what the store holds of it, still searchable",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "--delete-data",
|
|
25
|
+
role: "mode",
|
|
26
|
+
type: "switch",
|
|
27
|
+
meaning: "remove the account and delete what the store and the tool's files hold of it",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "--answer-stdin",
|
|
31
|
+
role: "mode",
|
|
32
|
+
type: "switch",
|
|
33
|
+
meaning: "a sign-in step asks its question as a JSON line and reads the answer from stdin",
|
|
34
|
+
},
|
|
35
|
+
{ name: "--hide-phone", role: "output", type: "switch", meaning: "leave the phone number out of the answer" },
|
|
36
|
+
];
|
package/dist/standards/lint.d.ts
CHANGED
|
@@ -35,8 +35,24 @@ export declare const overridesSchema: v.ArraySchema<v.StrictObjectSchema<{
|
|
|
35
35
|
export type Override = v.InferOutput<typeof overridesSchema>[number];
|
|
36
36
|
/** What the schemas cannot say, so they stay convertible to JSON Schema: no entry twice. */
|
|
37
37
|
export declare const baselineProblems: (targets: readonly string[]) => string[];
|
|
38
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Days around an override's `review_after` that only warn: a review comes due without turning every CI run of the CLI
|
|
40
|
+
* red on one morning, and a shared word due in several CLIs at once gets two weeks to land its fix.
|
|
41
|
+
*/
|
|
42
|
+
export declare const REVIEW_GRACE_DAYS = 14;
|
|
43
|
+
/** An exception that expires: a lint override, or a parity group's difference, which may leave the date out. */
|
|
44
|
+
export interface Dated {
|
|
45
|
+
rule: string;
|
|
46
|
+
target: string;
|
|
47
|
+
review_after?: string;
|
|
48
|
+
owner?: string;
|
|
49
|
+
}
|
|
50
|
+
/** Entries more than `REVIEW_GRACE_DAYS` past their `review_after` on `today` (YYYY-MM-DD). */
|
|
51
|
+
export declare const overdue: (entries: readonly Dated[], today: string) => string[];
|
|
52
|
+
/** No entry twice, and none overdue. */
|
|
39
53
|
export declare const overridesProblems: (entries: readonly Override[], today: string) => string[];
|
|
54
|
+
/** Entries whose `review_after` is at most `REVIEW_GRACE_DAYS` away on either side: due soon, or due and not failing yet. */
|
|
55
|
+
export declare const overridesDueSoon: (entries: readonly Dated[], today: string, check?: string) => string[];
|
|
40
56
|
export declare const OVERRIDE_BUDGET = 10;
|
|
41
57
|
/** More overrides of one rule than this, across every CLI, and the rule itself is due for review. */
|
|
42
58
|
export declare const OVERRIDE_RULE_REVIEW = 3;
|
package/dist/standards/lint.js
CHANGED
|
@@ -44,7 +44,7 @@ export const LINT_RULES = defineLintRules([
|
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
id: "command-example-count",
|
|
47
|
-
severity: "
|
|
47
|
+
severity: "low",
|
|
48
48
|
scope: "command",
|
|
49
49
|
summary: "a leaf command has one to three examples; generated commands are exempt",
|
|
50
50
|
},
|
|
@@ -150,13 +150,30 @@ export const overrideSchema = v.strictObject({
|
|
|
150
150
|
export const overridesSchema = v.array(overrideSchema);
|
|
151
151
|
/** What the schemas cannot say, so they stay convertible to JSON Schema: no entry twice. */
|
|
152
152
|
export const baselineProblems = (targets) => duplicates(targets).map((target) => `"${target}" is listed twice`);
|
|
153
|
-
/**
|
|
153
|
+
/**
|
|
154
|
+
* Days around an override's `review_after` that only warn: a review comes due without turning every CI run of the CLI
|
|
155
|
+
* red on one morning, and a shared word due in several CLIs at once gets two weeks to land its fix.
|
|
156
|
+
*/
|
|
157
|
+
export const REVIEW_GRACE_DAYS = 14;
|
|
158
|
+
const shiftDays = (date, days) => new Date(Date.parse(`${date}T00:00:00Z`) + days * 86_400_000).toISOString().slice(0, 10);
|
|
159
|
+
const ask = (entry) => (entry.owner ? `; ask ${entry.owner}` : "");
|
|
160
|
+
/** Entries more than `REVIEW_GRACE_DAYS` past their `review_after` on `today` (YYYY-MM-DD). */
|
|
161
|
+
export const overdue = (entries, today) => entries
|
|
162
|
+
.filter((entry) => entry.review_after !== undefined && shiftDays(entry.review_after, REVIEW_GRACE_DAYS) < today)
|
|
163
|
+
.map((entry) => `"${entry.rule} ${entry.target}" was due for review on ${entry.review_after}${ask(entry)}`);
|
|
164
|
+
/** No entry twice, and none overdue. */
|
|
154
165
|
export const overridesProblems = (entries, today) => [
|
|
155
166
|
...duplicates(entries.map((entry) => `${entry.rule} ${entry.target}`)).map((both) => `"${both}" is listed twice`),
|
|
156
|
-
...entries
|
|
157
|
-
.filter((entry) => entry.review_after < today)
|
|
158
|
-
.map((entry) => `"${entry.rule} ${entry.target}" was due for review on ${entry.review_after}; ask ${entry.owner}`),
|
|
167
|
+
...overdue(entries, today),
|
|
159
168
|
];
|
|
169
|
+
/** Entries whose `review_after` is at most `REVIEW_GRACE_DAYS` away on either side: due soon, or due and not failing yet. */
|
|
170
|
+
export const overridesDueSoon = (entries, today, check = "lint") => entries.flatMap((entry) => entry.review_after !== undefined &&
|
|
171
|
+
entry.review_after <= shiftDays(today, REVIEW_GRACE_DAYS) &&
|
|
172
|
+
shiftDays(entry.review_after, REVIEW_GRACE_DAYS) >= today
|
|
173
|
+
? [
|
|
174
|
+
`"${entry.rule} ${entry.target}" is due for review on ${entry.review_after} and fails ${check} after ${shiftDays(entry.review_after, REVIEW_GRACE_DAYS)}${ask(entry)}`,
|
|
175
|
+
]
|
|
176
|
+
: []);
|
|
160
177
|
export const OVERRIDE_BUDGET = 10;
|
|
161
178
|
/** More overrides of one rule than this, across every CLI, and the rule itself is due for review. */
|
|
162
179
|
export const OVERRIDE_RULE_REVIEW = 3;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AUDIT_BLOCKS, AUDIT_RULES, type AuditRule, defineAuditRules, defineParityGroups, defineRequiredRoots, PARITY_GROUPS, type ParityGroup, REQUIRED_ROOTS, type RequiredRoot, } from "./audit.js";
|
|
2
2
|
export { defineFieldRules, FIELD_RULES, type FieldRule } from "./fields.js";
|
|
3
3
|
export { defineIdentifiers, IDENTIFIERS, type Identifier } from "./identifiers.js";
|
|
4
|
-
export { baselineProblems, baselineSchema, defineLintRules, LINT_RULES, LINT_SEVERITIES, type LintRule, type LintSeverity, OVERRIDE_BUDGET, OVERRIDE_RULE_REVIEW, type Override, overridesProblems, overridesSchema, rulesForReview, } from "./lint.js";
|
|
4
|
+
export { baselineProblems, baselineSchema, defineLintRules, LINT_RULES, LINT_SEVERITIES, type LintRule, type LintSeverity, OVERRIDE_BUDGET, OVERRIDE_RULE_REVIEW, type Override, overridesDueSoon, overridesProblems, overridesSchema, REVIEW_GRACE_DAYS, rulesForReview, } from "./lint.js";
|
|
5
5
|
export { defineVocabulary, FLAG_ROLES, FLAG_TYPES, type FlagRole, type FlagType, VOCABULARY, type Vocabulary, type VocabularyFlag, type VocabularyNoun, type VocabularyVerb, vocabularySchema, } from "./vocabulary.js";
|
package/dist/standards/tables.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AUDIT_BLOCKS, AUDIT_RULES, defineAuditRules, defineParityGroups, defineRequiredRoots, PARITY_GROUPS, REQUIRED_ROOTS, } from "./audit.js";
|
|
2
2
|
export { defineFieldRules, FIELD_RULES } from "./fields.js";
|
|
3
3
|
export { defineIdentifiers, IDENTIFIERS } from "./identifiers.js";
|
|
4
|
-
export { baselineProblems, baselineSchema, defineLintRules, LINT_RULES, LINT_SEVERITIES, OVERRIDE_BUDGET, OVERRIDE_RULE_REVIEW, overridesProblems, overridesSchema, rulesForReview, } from "./lint.js";
|
|
4
|
+
export { baselineProblems, baselineSchema, defineLintRules, LINT_RULES, LINT_SEVERITIES, OVERRIDE_BUDGET, OVERRIDE_RULE_REVIEW, overridesDueSoon, overridesProblems, overridesSchema, REVIEW_GRACE_DAYS, rulesForReview, } from "./lint.js";
|
|
5
5
|
export { defineVocabulary, FLAG_ROLES, FLAG_TYPES, VOCABULARY, vocabularySchema, } from "./vocabulary.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
+
import { ACCOUNT_FLAGS } from "./flags-account.js";
|
|
2
3
|
import { CALENDAR_FLAGS } from "./flags-calendar.js";
|
|
3
4
|
import { CRM_FLAGS } from "./flags-crm.js";
|
|
4
5
|
import { HOW_FLAGS } from "./flags-how.js";
|
|
@@ -166,6 +167,7 @@ const verbs = [
|
|
|
166
167
|
"look at a source before taking anything from it: a chat link without joining, a mailbox without importing",
|
|
167
168
|
],
|
|
168
169
|
["send", "send a message"],
|
|
170
|
+
["call", "call one provider API method by its own name, generated from the provider's method list"],
|
|
169
171
|
["edit", "change a sent message"],
|
|
170
172
|
["forward", "send an existing message on to another chat"],
|
|
171
173
|
["pin", "pin a message or chat"],
|
|
@@ -422,6 +424,7 @@ export const VOCABULARY = defineVocabulary({
|
|
|
422
424
|
...HOW_FLAGS,
|
|
423
425
|
...WHAT_FLAGS,
|
|
424
426
|
...PRIVACY_FLAGS,
|
|
427
|
+
...ACCOUNT_FLAGS,
|
|
425
428
|
...CALENDAR_FLAGS,
|
|
426
429
|
...MAIL_FLAGS,
|
|
427
430
|
...KNOWLEDGE_FLAGS,
|
|
@@ -185,12 +185,12 @@ Every CLI that signs in has four commands under `session`:
|
|
|
185
185
|
- **Enforced by:** review only.
|
|
186
186
|
- **Example:** `gcal personal session status` answers whether the `personal` profile holds a Google login;
|
|
187
187
|
`gcal session list` lists `personal` and `work` with no profile named.
|
|
188
|
-
- **Exceptions:** known gaps, as of 2026-
|
|
188
|
+
- **Exceptions:** known gaps, as of 2026-11-12 (gcal and mail have all four):
|
|
189
189
|
- tg, max and wa have `session start` and `session end`, no `session status`, and list their profiles with
|
|
190
190
|
`account list` instead of `session list`.
|
|
191
191
|
- drive has `session start`, `session list` and `session end`, and no `session status`.
|
|
192
|
-
- zm has `session start
|
|
193
|
-
- memo
|
|
192
|
+
- zm has `session start`, `session status` and `session end`, and no `session list`.
|
|
193
|
+
- memo has no `session` group: it has no profiles and reads the stores of the other CLIs, mail's among them.
|
|
194
194
|
|
|
195
195
|
A CLI that adds a missing command adds it under `session`; a renamed path keeps no alias
|
|
196
196
|
([WC-CMD-8](commands.md#wc-cmd-8--keep-no-aliases-a-renamed-path-stops-working-in-the-release-that-renames-it)).
|
package/docs/standards/layout.md
CHANGED
|
@@ -26,7 +26,7 @@ Rule ids on this page are `WC-LAY-<n>`. How to read a rule, how ids work and whi
|
|
|
26
26
|
- `skills/`: the agent skill the package ships;
|
|
27
27
|
- `CHANGELOG.md`, `CLAUDE.md`, `SECURITY.md`, `README.md`, `LICENSE`;
|
|
28
28
|
- git-ignored, on the working machine only: `CLEANUP.md`, `HANDOFF.md`, plans and journals.
|
|
29
|
-
- **Exceptions:** a folder the CLI has no use for may be missing
|
|
29
|
+
- **Exceptions:** a folder the CLI has no use for may be missing. A product folder may
|
|
30
30
|
be added, such as `spec/` for a protocol or API description.
|
|
31
31
|
- **Applies to:** all CLIs. **Since:** cli-base 0.41.0. **Rulings:** none.
|
|
32
32
|
|
|
@@ -20,13 +20,11 @@ and [WC-SECR-2](security.md#wc-secr-2--a-log-keeps-only-known-attribute-keys-and
|
|
|
20
20
|
|
|
21
21
|
### Who follows these rules today
|
|
22
22
|
|
|
23
|
-
- **WC-LIFE-15:** tg, max, wa, gcal
|
|
24
|
-
`feat/runs` branch (2026-10-25). zm's `resolveSettings` also returns `keepFailedRuns: false`, which turns off the
|
|
25
|
-
failure log cli-core's `run` would keep.
|
|
23
|
+
- **WC-LIFE-15:** tg, max, wa, gcal, mail, drive, memo, zm and the template.
|
|
26
24
|
- **WC-LIFE-16:** cli-core's shared calendar `sync`, from cli-core 0.464.0 (cli-core #2118); gcal has it. The
|
|
27
25
|
deadlines of WC-LIFE-5 come with the same release. cli-core's shared CRM `sync`, from cli-core 0.591.0 (cli-core
|
|
28
26
|
#2553), declares `cooperative` and `partial` and takes `--max-pages`; b24 has it. The other syncs (`messages sync`
|
|
29
|
-
in tg, max and wa, drive's `sync`,
|
|
27
|
+
in tg, max and wa, drive's `sync`, mail's `sync`, zm's `recordings sync`) are cooperative but spend no request
|
|
30
28
|
budget yet. gcal sets `requestMs` to 1.5 s, b24 to 1 s: a Bitrix24 portal allows 2 requests a second, shared by
|
|
31
29
|
every app and webhook.
|
|
32
30
|
|
|
@@ -207,10 +205,10 @@ before its deadline.
|
|
|
207
205
|
### WC-LIFE-13 · A rerun goes on from where the last run stopped, and starting over is an option
|
|
208
206
|
|
|
209
207
|
- **Why:** a rerun that lists or pages everything again repeats the work the kill cut short.
|
|
210
|
-
- **Enforced by:** `drive-cli: src/sync.test.ts
|
|
208
|
+
- **Enforced by:** `drive-cli: src/sync.test.ts`.
|
|
211
209
|
- **Example:** a rerun skips what is stored and does not redo the listing or paging that got there. The position
|
|
212
210
|
lives in the store when the store already holds it: tg and max keep the held stretch of each chat, so
|
|
213
|
-
`messages sync --all` skips a chat held to its newest message;
|
|
211
|
+
`messages sync --all` skips a chat held to its newest message; zm keeps
|
|
214
212
|
the checkpoint of `recordings sync`. Otherwise it lives in a checkpoint file,
|
|
215
213
|
`<state>/checkpoints/<profile>/<job>.json`, written with `saveCheckpoint` and read with `readCheckpoint` from
|
|
216
214
|
`@wirecat/cli-core/background`. The write is atomic, and a torn file reads as no checkpoint: one run from the start,
|
package/docs/standards/output.md
CHANGED
|
@@ -137,7 +137,7 @@ JSON Schema 2020-12.
|
|
|
137
137
|
|
|
138
138
|
- **Why:** an agent that reads one CLI's answer can read the other's.
|
|
139
139
|
- **Enforced by:** `same-path-contract` (weekly audit; it does not block a pull request yet) · `same-entity-schema`
|
|
140
|
-
(
|
|
140
|
+
(the family audit, which reads every CLI's schemas).
|
|
141
141
|
- **Example:** what only one messenger knows goes under `provider_metadata`, never as a top-level field one CLI has and
|
|
142
142
|
the other lacks.
|
|
143
143
|
- **Exceptions:** none.
|
|
@@ -190,7 +190,7 @@ whole or partial.
|
|
|
190
190
|
### WC-OUT-15 · Branch on `code` and `reason`, never on `message`
|
|
191
191
|
|
|
192
192
|
- **Why:** the message is for a person and may change. The code and reason are the contract.
|
|
193
|
-
- **Enforced by:** `same-error-reason` (
|
|
193
|
+
- **Enforced by:** `same-error-reason` (the family audit, which reads every CLI's reasons).
|
|
194
194
|
- **Example:** `reason` is a registered dotted id, such as `query.too-large`, defined with `defineReasons` where it is
|
|
195
195
|
raised. `details` keeps only registered keys, and never a `cause`.
|
|
196
196
|
- **Exceptions:** none.
|
|
@@ -220,10 +220,12 @@ and fails a first release (the base version is `0.0.0`) whose `package.json` ins
|
|
|
220
220
|
After the live check of the real service passes
|
|
221
221
|
([WC-TEST-18](testing.md#wc-test-18--check-the-real-service-by-hand-never-in-the-test-suite)),
|
|
222
222
|
`cli-dev live record --script <its script>` appends `<version> <commit> <date> <script> <tree>` to
|
|
223
|
-
`docs/dev/live-checks.txt`, committed in the release pull request; `<tree>` is a SHA-256 of
|
|
224
|
-
package.json pnpm-lock.yaml
|
|
225
|
-
|
|
226
|
-
|
|
223
|
+
`docs/dev/live-checks.txt`, committed in the release pull request; `<tree>` is `v2:` and a SHA-256 of
|
|
224
|
+
`git ls-tree -r HEAD -- src package.json pnpm-lock.yaml` without the files that never ship: `*.test.*`, `src/testing/`,
|
|
225
|
+
`__snapshots__/` and `__fixtures__/`. A merge that changes only those needs no new live check. `bin/release` runs
|
|
226
|
+
`cli-dev live check` first: it refuses a version with no line, and one whose shipped files differ from the files the
|
|
227
|
+
record hashed. The commit is information only. A `<tree>` without `v2:` was written before cli-base 0.98.0 and is
|
|
228
|
+
still compared with every file; a line from before cli-base 0.80.8 has no `<tree>` and is compared with its commit.
|
|
227
229
|
|
|
228
230
|
- **Why:** every automated check passed on bitrix24-cli while it ignored `deny` on reads; a release that says what
|
|
229
231
|
was checked, and a live check bound to the code released, are what a reviewer reads instead of the whole diff.
|
|
@@ -209,7 +209,7 @@ and which run after merge is in [CI](ci.md).
|
|
|
209
209
|
update check, MCP logins and lock files that only cli-core writes do not count. Tests still keep them in the
|
|
210
210
|
sandboxed home, like every other path
|
|
211
211
|
([WC-TEST-1](#wc-test-1--point-every-path-a-test-could-write-at-a-temporary-directory)).
|
|
212
|
-
- **Applies to:** all CLIs with local state.
|
|
212
|
+
- **Applies to:** all CLIs with local state. **Since:** cli-base 0.41.0. **Rulings:** none.
|
|
213
213
|
|
|
214
214
|
### WC-TEST-15 · A refactor keeps `commands --json` and the MCP tool list as they were
|
|
215
215
|
|
|
@@ -209,10 +209,14 @@ no-unbounded-spread ([WC-TOOL-12](#wc-tool-12--do-not-spread-a-list-of-user-data
|
|
|
209
209
|
comes out when the shared package catches up. A word the CLI needs that the vocabulary does not have yet goes in
|
|
210
210
|
`lint/overrides.json`, never in the baseline: its `reason` links the cli-base pull request or issue that adds the
|
|
211
211
|
word, and it comes out in the change that takes the cli-base release with the word. The shared package's words
|
|
212
|
-
go in the baseline, as above; the CLI's own go in the overrides, where the count and the date keep them few.
|
|
212
|
+
go in the baseline, as above; the CLI's own go in the overrides, where the count and the date keep them few. Once cli-core marks the commands it mounts
|
|
213
|
+
(`origin: "cli-core"` in `commands --json`), the lint fails a word rule's baseline entry on the CLI's own command and
|
|
214
|
+
an override on cli-core's; with `--allow-stale` it only warns. A permanent exception also goes in `lint/overrides.json`, with `rule`, `target`, `reason`, `owner`
|
|
213
215
|
and `review_after`. More than 10
|
|
214
|
-
overrides fail the run
|
|
215
|
-
|
|
216
|
+
overrides fail the run. An override warns from 14 days before its `review_after`, and fails the run once it is more
|
|
217
|
+
than 14 days past it, so a date shared by several CLIs gives two weeks to land the fix. A rule of `low` severity
|
|
218
|
+
(`command-help-too-long`, `command-example-count`) is advice: its violations and stale baseline entries are printed
|
|
219
|
+
as warnings and fail nothing. The rules themselves are on the [Commands page](commands.md).
|
|
216
220
|
- **Exceptions:** zoom runs `lint:commands` in full validation only. cli-core runs its own command lint test in
|
|
217
221
|
`ci:quick`. cli-base, cli-testing, cli-docs and community have no command tree.
|
|
218
222
|
- **Applies to:** the CLIs. **Since:** cli-base 0.41.0. **Rulings:** none.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.98.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",
|