@wirecat/cli-base 0.96.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 +81 -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 +8 -0
- package/dist/dev/lint.js +34 -7
- package/dist/dev/main.js +173 -23
- package/dist/dev/network.js +10 -2
- package/dist/dev/result-shape.d.ts +19 -0
- package/dist/dev/result-shape.js +263 -0
- 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/index.d.ts +1 -1
- package/dist/standards/lint.d.ts +18 -2
- package/dist/standards/lint.js +29 -6
- package/dist/standards/output.d.ts +12 -0
- 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/README.md +1 -1
- 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 +42 -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
package/dist/http/index.d.ts
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* status-code semantics and `Retry-After` parsing. Import `@wirecat/cli-base/http` only when
|
|
6
6
|
* the thing on the other end is actually HTTP.
|
|
7
7
|
*/
|
|
8
|
-
import type
|
|
9
|
-
import type
|
|
8
|
+
import { type ErrorCode } from "../errors.js";
|
|
9
|
+
import { type RetryConfig } from "../retry.js";
|
|
10
|
+
import { type SleepLike, type WallClock } from "../time.js";
|
|
10
11
|
/** The one function an HTTP client needs from its environment. A Worker, a browser, a test and Node all satisfy it. */
|
|
11
12
|
export type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
12
13
|
/** `Retry-After` is either a number of seconds or an HTTP date. Both forms occur in the wild. */
|
|
@@ -20,3 +21,23 @@ export declare const statusToCode: (status: number) => ErrorCode;
|
|
|
20
21
|
export { type JsonResponseOptions, readJsonResponse } from "./body.js";
|
|
21
22
|
export { HOST_FETCH_TIMEOUT_MS, type HostFetchOptions, hostFetch } from "./fetch.js";
|
|
22
23
|
export { HOST_PATTERN, hostCovered, hostProblems } from "./hosts.js";
|
|
24
|
+
/** cli-core's `Pacer` fits: one queue for every process of a profile, since a provider's limit is per account. */
|
|
25
|
+
export interface PacerLike {
|
|
26
|
+
/** The epoch milliseconds at which this request may go. */
|
|
27
|
+
reserve(): Promise<number>;
|
|
28
|
+
/** Everyone waits this long, because the provider said so. */
|
|
29
|
+
holdFor(ms: number): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
export interface RetryingOptions {
|
|
32
|
+
retry?: RetryConfig;
|
|
33
|
+
/** Which requests may be sent again after a failure. A write is sent again only when the provider refused it (429). */
|
|
34
|
+
reads?: (method: string, url: URL) => boolean;
|
|
35
|
+
pacer?: PacerLike;
|
|
36
|
+
/** The most the retries and pacing of one request may wait in all; more ends it with the last answer. */
|
|
37
|
+
budget?: number;
|
|
38
|
+
sleep?: SleepLike;
|
|
39
|
+
now?: WallClock;
|
|
40
|
+
random?: () => number;
|
|
41
|
+
}
|
|
42
|
+
/** `fetch` that waits and sends again: reads on a retryable status or error, writes only on 429. */
|
|
43
|
+
export declare const retrying: (send: FetchLike, options?: RetryingOptions) => FetchLike;
|
package/dist/http/index.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The HTTP layer, deliberately behind its own entry point.
|
|
3
|
+
*
|
|
4
|
+
* A CLI that speaks a socket, a message bus or a local database has no business depending on
|
|
5
|
+
* status-code semantics and `Retry-After` parsing. Import `@wirecat/cli-base/http` only when
|
|
6
|
+
* the thing on the other end is actually HTTP.
|
|
7
|
+
*/
|
|
8
|
+
import { CliError, isCliError } from "../errors.js";
|
|
9
|
+
import { backoffMs, DEFAULT_RETRY } from "../retry.js";
|
|
10
|
+
import { realSleep, wallClock } from "../time.js";
|
|
1
11
|
/** `Retry-After` is either a number of seconds or an HTTP date. Both forms occur in the wild. */
|
|
2
12
|
export const parseRetryAfter = (header, now) => {
|
|
3
13
|
if (!header)
|
|
@@ -46,3 +56,54 @@ export const statusToCode = (status) => {
|
|
|
46
56
|
export { readJsonResponse } from "./body.js";
|
|
47
57
|
export { HOST_FETCH_TIMEOUT_MS, hostFetch } from "./fetch.js";
|
|
48
58
|
export { HOST_PATTERN, hostCovered, hostProblems } from "./hosts.js";
|
|
59
|
+
const SAFE = new Set(["GET", "HEAD", "OPTIONS"]);
|
|
60
|
+
/** `fetch` that waits and sends again: reads on a retryable status or error, writes only on 429. */
|
|
61
|
+
export const retrying = (send, options = {}) => {
|
|
62
|
+
const { retry = DEFAULT_RETRY, reads = (method) => SAFE.has(method), pacer, budget = Number.POSITIVE_INFINITY, sleep = realSleep, now = wallClock, random = Math.random, } = options;
|
|
63
|
+
return async (input, init = {}) => {
|
|
64
|
+
const request = input instanceof Request ? input : undefined;
|
|
65
|
+
const method = (init.method ?? request?.method ?? "GET").toUpperCase();
|
|
66
|
+
const read = reads(method, new URL(request?.url ?? String(input)));
|
|
67
|
+
const signal = init.signal ?? request?.signal ?? undefined;
|
|
68
|
+
const once = init.body instanceof ReadableStream;
|
|
69
|
+
let waited = 0;
|
|
70
|
+
const pause = async (ms) => {
|
|
71
|
+
waited += ms;
|
|
72
|
+
await sleep(ms, signal, "retry");
|
|
73
|
+
};
|
|
74
|
+
for (let attempt = 1;; attempt++) {
|
|
75
|
+
if (pacer) {
|
|
76
|
+
const wait = (await pacer.reserve()) - now().getTime();
|
|
77
|
+
if (wait > 0) {
|
|
78
|
+
if (waited + wait > budget)
|
|
79
|
+
throw new CliError("rate_limited", `the provider's pace needs a ${wait} ms wait, more than this run allows`, {
|
|
80
|
+
retry_after_ms: wait,
|
|
81
|
+
sent: false,
|
|
82
|
+
});
|
|
83
|
+
await pause(wait);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const last = once || attempt > retry.retries;
|
|
87
|
+
try {
|
|
88
|
+
const response = await send(request && !last ? request.clone() : input, init);
|
|
89
|
+
if (last || !retryableStatus(response.status) || !(read || response.status === 429))
|
|
90
|
+
return response;
|
|
91
|
+
const wait = providerWaitMs(response.headers, now) ?? backoffMs(attempt, retry, random);
|
|
92
|
+
if (wait > retry.maxRetryAfterMs || waited + wait > budget)
|
|
93
|
+
return response;
|
|
94
|
+
await response.body?.cancel().catch(() => { });
|
|
95
|
+
if (response.status === 429)
|
|
96
|
+
await pacer?.holdFor(wait);
|
|
97
|
+
await pause(wait);
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
if (last || !read || signal?.aborted || !isCliError(error) || error.details.retryable !== true)
|
|
101
|
+
throw error;
|
|
102
|
+
const wait = backoffMs(attempt, retry, random);
|
|
103
|
+
if (waited + wait > budget)
|
|
104
|
+
throw error;
|
|
105
|
+
await pause(wait);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type Fragment = {
|
|
2
|
+
name: string;
|
|
3
|
+
text: string;
|
|
4
|
+
};
|
|
5
|
+
/** The changelog's `###` headings in the WireCat CLIs, in their order. */
|
|
6
|
+
export declare const CHANGELOG_HEADINGS: readonly ["Added", "Changed — may break callers", "Fixed", "Security", "Removed"];
|
|
7
|
+
export type FragmentRules = {
|
|
8
|
+
headings: readonly string[];
|
|
9
|
+
ids: readonly string[];
|
|
10
|
+
};
|
|
11
|
+
export declare const readFragments: (root: string) => Fragment[];
|
|
12
|
+
export declare const fragmentProblems: ({ name, text }: Fragment, { headings, ids }: FragmentRules) => string[];
|
|
13
|
+
/**
|
|
14
|
+
* Adds every fragment's entries under the same-named heading of `## <version> — `, after the entries already there,
|
|
15
|
+
* fragments in name order. A fragment links from `changes/`, so `../` is dropped for CHANGELOG.md at the root.
|
|
16
|
+
*/
|
|
17
|
+
export declare const collectFragments: (changelog: string, version: string, fragments: Fragment[], { headings }: Pick<FragmentRules, "headings">) => string;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Changelog fragments: each pull request adds `changes/<branch>.md` instead of editing `## Unreleased`, so open
|
|
3
|
+
* pull requests do not conflict in CHANGELOG.md. A release collects them into the version's section and deletes
|
|
4
|
+
* them in the release commit (`cli-dev changelog fragments`). Moved here from b24 and cli-core, which kept copies.
|
|
5
|
+
*/
|
|
6
|
+
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { idPattern } from "./markdown.js";
|
|
9
|
+
/** The changelog's `###` headings in the WireCat CLIs, in their order. */
|
|
10
|
+
export const CHANGELOG_HEADINGS = ["Added", "Changed — may break callers", "Fixed", "Security", "Removed"];
|
|
11
|
+
const NAME = /^[a-z0-9][a-z0-9._-]*\.md$/;
|
|
12
|
+
export const readFragments = (root) => {
|
|
13
|
+
const directory = join(root, "changes");
|
|
14
|
+
if (!existsSync(directory))
|
|
15
|
+
return [];
|
|
16
|
+
return readdirSync(directory, { withFileTypes: true })
|
|
17
|
+
.filter((entry) => entry.isFile() && entry.name.endsWith(".md") && entry.name !== "README.md")
|
|
18
|
+
.map((entry) => ({ name: entry.name, text: readFileSync(join(directory, entry.name), "utf8") }))
|
|
19
|
+
.sort((a, b) => (a.name < b.name ? -1 : 1));
|
|
20
|
+
};
|
|
21
|
+
export const fragmentProblems = ({ name, text }, { headings, ids }) => {
|
|
22
|
+
const file = `changes/${name}`;
|
|
23
|
+
const id = idPattern(ids);
|
|
24
|
+
const problems = [];
|
|
25
|
+
if (!NAME.test(name))
|
|
26
|
+
problems.push(`${file}: name it changes/<branch>.md in lower case, "/" as "-"`);
|
|
27
|
+
const entries = new Map();
|
|
28
|
+
let heading;
|
|
29
|
+
text.split("\n").forEach((line, index) => {
|
|
30
|
+
const where = `${file}:${index + 1}`;
|
|
31
|
+
if (line.startsWith("### ")) {
|
|
32
|
+
heading = line.slice(4).trim();
|
|
33
|
+
if (!headings.includes(heading))
|
|
34
|
+
problems.push(`${where}: "${heading}" is not one of: ${headings.join(", ")}`);
|
|
35
|
+
if (entries.has(heading))
|
|
36
|
+
problems.push(`${where}: "${heading}" twice`);
|
|
37
|
+
entries.set(heading, 0);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (line.startsWith("#"))
|
|
41
|
+
problems.push(`${where}: only "### <heading>" headings; the release adds the version`);
|
|
42
|
+
if (!line.trim())
|
|
43
|
+
return;
|
|
44
|
+
if (heading === undefined)
|
|
45
|
+
problems.push(`${where}: text before the first ### heading`);
|
|
46
|
+
else
|
|
47
|
+
entries.set(heading, (entries.get(heading) ?? 0) + 1);
|
|
48
|
+
for (const found of line.match(id) ?? [])
|
|
49
|
+
problems.push(`${where}: internal id ${found} — say what changed instead`);
|
|
50
|
+
});
|
|
51
|
+
if (entries.size === 0)
|
|
52
|
+
problems.push(`${file}: no "### <heading>" with an entry under it`);
|
|
53
|
+
for (const [found, count] of entries)
|
|
54
|
+
if (count === 0)
|
|
55
|
+
problems.push(`${file}: "${found}" has no entry`);
|
|
56
|
+
return problems;
|
|
57
|
+
};
|
|
58
|
+
const trimBlank = (lines) => {
|
|
59
|
+
let start = 0;
|
|
60
|
+
let end = lines.length;
|
|
61
|
+
while (start < end && !lines[start]?.trim())
|
|
62
|
+
start++;
|
|
63
|
+
while (end > start && !lines[end - 1]?.trim())
|
|
64
|
+
end--;
|
|
65
|
+
return lines.slice(start, end);
|
|
66
|
+
};
|
|
67
|
+
const byHeading = (lines, where) => {
|
|
68
|
+
const found = new Map();
|
|
69
|
+
let current;
|
|
70
|
+
for (const line of lines) {
|
|
71
|
+
if (line.startsWith("### ")) {
|
|
72
|
+
const heading = line.slice(4).trim();
|
|
73
|
+
current = found.get(heading) ?? [];
|
|
74
|
+
found.set(heading, current);
|
|
75
|
+
}
|
|
76
|
+
else if (current)
|
|
77
|
+
current.push(line);
|
|
78
|
+
else if (line.trim())
|
|
79
|
+
throw new Error(`${where} has text before its first ### heading: "${line}"`);
|
|
80
|
+
}
|
|
81
|
+
return new Map([...found].map(([heading, body]) => [heading, trimBlank(body)]));
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Adds every fragment's entries under the same-named heading of `## <version> — `, after the entries already there,
|
|
85
|
+
* fragments in name order. A fragment links from `changes/`, so `../` is dropped for CHANGELOG.md at the root.
|
|
86
|
+
*/
|
|
87
|
+
export const collectFragments = (changelog, version, fragments, { headings }) => {
|
|
88
|
+
const parts = changelog.split(/\n(?=## )/);
|
|
89
|
+
const index = parts.findIndex((part) => part.startsWith(`## ${version} — `));
|
|
90
|
+
const section = parts[index];
|
|
91
|
+
if (section === undefined)
|
|
92
|
+
throw new Error(`CHANGELOG.md has no "## ${version} — " section to collect changes/ into`);
|
|
93
|
+
const [title = "", ...lines] = section.split("\n");
|
|
94
|
+
const merged = byHeading(lines, title);
|
|
95
|
+
for (const fragment of fragments) {
|
|
96
|
+
const text = fragment.text.replace(/\]\(\.\.\//g, "](");
|
|
97
|
+
for (const [heading, body] of byHeading(text.split("\n"), `changes/${fragment.name}`))
|
|
98
|
+
merged.set(heading, [...(merged.get(heading) ?? []), ...body]);
|
|
99
|
+
}
|
|
100
|
+
const rank = (heading) => (headings.includes(heading) ? headings.indexOf(heading) : headings.length);
|
|
101
|
+
const body = [...merged]
|
|
102
|
+
.filter(([, entries]) => entries.length > 0)
|
|
103
|
+
.sort(([a], [b]) => rank(a) - rank(b))
|
|
104
|
+
.map(([heading, entries]) => `### ${heading}\n\n${entries.join("\n")}\n`)
|
|
105
|
+
.join("\n");
|
|
106
|
+
parts[index] = `${title}\n\n${body}`;
|
|
107
|
+
return parts.join("\n");
|
|
108
|
+
};
|
package/dist/release/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { foldUnreleased, mergeRepeatedHeadings, restoreReleased } from "./fold.js";
|
|
2
|
+
export { CHANGELOG_HEADINGS, collectFragments, type Fragment, type FragmentRules, fragmentProblems, readFragments, } from "./fragments.js";
|
|
3
|
+
export { levelledVersion, versionLevelProblem } from "./level.js";
|
|
2
4
|
export { type ChangelogRules, changelogProblems, type DocsRules, docsProblems, idPattern, JOURNAL_IDS, markdownFiles, slug, } from "./markdown.js";
|
|
3
5
|
export { REQUIRED_PAGES, type StructureRules, structureProblems } from "./structure.js";
|
|
4
6
|
export type Check = {
|
package/dist/release/index.js
CHANGED
|
@@ -7,6 +7,8 @@ import { spawnSync } from "node:child_process";
|
|
|
7
7
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { join } from "node:path";
|
|
9
9
|
export { foldUnreleased, mergeRepeatedHeadings, restoreReleased } from "./fold.js";
|
|
10
|
+
export { CHANGELOG_HEADINGS, collectFragments, fragmentProblems, readFragments, } from "./fragments.js";
|
|
11
|
+
export { levelledVersion, versionLevelProblem } from "./level.js";
|
|
10
12
|
export { changelogProblems, docsProblems, idPattern, JOURNAL_IDS, markdownFiles, slug, } from "./markdown.js";
|
|
11
13
|
export { REQUIRED_PAGES, structureProblems } from "./structure.js";
|
|
12
14
|
/**
|
|
@@ -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
|
+
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { EFFECT_LEVELS, type EffectLevel, type Effects, effectsSchema, writes } from "./effects.js";
|
|
2
2
|
export { BASE_REASONS, COMMON_DETAILS, CRASH_CODE, CRASH_REASON, defineReasons, type ErrorObject, type ErrorReason, errorObjectSchema, } from "./errors.js";
|
|
3
3
|
export { defineLogEvents, isContentKey, LOG_ATTRIBUTE_KEYS, LOG_EVENTS, LOG_SEVERITIES, type LogEvent, type LogRecord, type LogSeverity, logAttributesJsonSchema, logEventProblems, logRecordSchema, traceIdOf, } from "./log.js";
|
|
4
|
-
export { COMPACT_FLAG, clockMeta, type Issue, type ItemEnvelope, isoTime, issueSchema, itemEnvelopeSchema, jsonlEndSchema, jsonlItemSchema, jsonlOf, type ListEnvelope, listEnvelopeSchema, localTime, MAX_NEXT_STEPS, type Meta, type Missing, metaSchema, missingSchema, type NextStep, nextStepSchema, type Page, pageSchema, type Ranking, rankingSchema, reference, type Total, totalSchema, } from "./output.js";
|
|
4
|
+
export { COMPACT_FLAG, clockMeta, type Issue, type ItemEnvelope, isoTime, issueSchema, itemEnvelopeSchema, jsonlEndSchema, jsonlItemSchema, jsonlOf, type ListEnvelope, type ListResult, listEnvelopeSchema, localTime, MAX_NEXT_STEPS, type Meta, type Missing, metaSchema, missingSchema, type NextStep, nextStepSchema, type Page, pageSchema, type Ranking, rankingSchema, reference, type Total, totalSchema, } from "./output.js";
|
|
5
5
|
export { fill, jsonSchemaOf, RegistryError } from "./registry.js";
|
|
6
6
|
export { defineSteps, SAME_COMMAND, STEPS, type StepDefinition, type StepInput, type StepTarget, stepOf, } from "./steps.js";
|
package/dist/standards/lint.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ declare const lintRuleSchema: v.StrictObjectSchema<{
|
|
|
4
4
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a lower-case word, words joined by -">]>;
|
|
5
5
|
readonly severity: v.PicklistSchema<readonly ["high", "medium", "low"], undefined>;
|
|
6
6
|
/** What the rule looks at; a violation's target names one of these. */
|
|
7
|
-
readonly scope: v.PicklistSchema<["command", "group", "argument", "option", "flag", "key", "source"], undefined>;
|
|
7
|
+
readonly scope: v.PicklistSchema<["command", "group", "argument", "option", "flag", "key", "source", "type"], undefined>;
|
|
8
8
|
readonly summary: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
|
|
9
9
|
}, undefined>;
|
|
10
10
|
export type LintRule = v.InferOutput<typeof lintRuleSchema>;
|
|
@@ -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
|
@@ -5,7 +5,7 @@ const lintRuleSchema = v.strictObject({
|
|
|
5
5
|
id: word,
|
|
6
6
|
severity: v.picklist(LINT_SEVERITIES),
|
|
7
7
|
/** What the rule looks at; a violation's target names one of these. */
|
|
8
|
-
scope: v.picklist(["command", "group", "argument", "option", "flag", "key", "source"]),
|
|
8
|
+
scope: v.picklist(["command", "group", "argument", "option", "flag", "key", "source", "type"]),
|
|
9
9
|
summary: text,
|
|
10
10
|
});
|
|
11
11
|
export const defineLintRules = (input) => parseRegistry("lint rules", v.array(lintRuleSchema), input, (rules) => duplicates(rules.map((rule) => rule.id)).map((id) => `"${id}" is listed twice`));
|
|
@@ -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
|
},
|
|
@@ -128,6 +128,12 @@ export const LINT_RULES = defineLintRules([
|
|
|
128
128
|
scope: "source",
|
|
129
129
|
summary: "every `http(s)://` host in the CLI's own source is in the manifest's `network.hosts`",
|
|
130
130
|
},
|
|
131
|
+
{
|
|
132
|
+
id: "result-shape",
|
|
133
|
+
severity: "medium",
|
|
134
|
+
scope: "type",
|
|
135
|
+
summary: "a list or search in the published TypeScript API returns `{ items, hasMore, nextOffset?, total? }`: no bare array, no `hits` or `has_more`",
|
|
136
|
+
},
|
|
131
137
|
]);
|
|
132
138
|
/** `lint/baseline/<rule-id>.json`: today's violations of one rule, by target. It may only shrink. */
|
|
133
139
|
export const baselineSchema = v.array(text);
|
|
@@ -144,13 +150,30 @@ export const overrideSchema = v.strictObject({
|
|
|
144
150
|
export const overridesSchema = v.array(overrideSchema);
|
|
145
151
|
/** What the schemas cannot say, so they stay convertible to JSON Schema: no entry twice. */
|
|
146
152
|
export const baselineProblems = (targets) => duplicates(targets).map((target) => `"${target}" is listed twice`);
|
|
147
|
-
/**
|
|
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. */
|
|
148
165
|
export const overridesProblems = (entries, today) => [
|
|
149
166
|
...duplicates(entries.map((entry) => `${entry.rule} ${entry.target}`)).map((both) => `"${both}" is listed twice`),
|
|
150
|
-
...entries
|
|
151
|
-
.filter((entry) => entry.review_after < today)
|
|
152
|
-
.map((entry) => `"${entry.rule} ${entry.target}" was due for review on ${entry.review_after}; ask ${entry.owner}`),
|
|
167
|
+
...overdue(entries, today),
|
|
153
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
|
+
: []);
|
|
154
177
|
export const OVERRIDE_BUDGET = 10;
|
|
155
178
|
/** More overrides of one rule than this, across every CLI, and the rule itself is due for review. */
|
|
156
179
|
export const OVERRIDE_RULE_REVIEW = 3;
|
|
@@ -63,6 +63,18 @@ export declare const pageSchema: v.VariantSchema<"mode", [v.StrictObjectSchema<{
|
|
|
63
63
|
}, undefined>, undefined>;
|
|
64
64
|
}, undefined>], undefined>;
|
|
65
65
|
export type Total = v.InferOutput<typeof totalSchema>;
|
|
66
|
+
/**
|
|
67
|
+
* A list or search returned by a TypeScript API (WC-OUT-25). It pages by `offset` and `limit`; a source with its own
|
|
68
|
+
* position gives `nextCursor` instead. `--json` prints it as the list envelope, in snake_case.
|
|
69
|
+
*/
|
|
70
|
+
export interface ListResult<T> {
|
|
71
|
+
items: T[];
|
|
72
|
+
hasMore: boolean;
|
|
73
|
+
/** The `offset` that reads the next page; absent on the last one. */
|
|
74
|
+
nextOffset?: number;
|
|
75
|
+
nextCursor?: string;
|
|
76
|
+
total?: Total;
|
|
77
|
+
}
|
|
66
78
|
/** A source that failed or was skipped: the answer holds what the others gave. */
|
|
67
79
|
export declare const issueSchema: v.StrictObjectSchema<{
|
|
68
80
|
readonly code: v.PicklistSchema<readonly ["validation_error", "configuration_error", "authentication_error", "permission_error", "not_found", "confirmation_required", "rate_limited", "timeout", "network_error", "provider_error", "provider_unavailable", "invalid_response", "outcome_unknown", "conflict", "cancelled"], undefined>;
|
|
@@ -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,
|
package/docs/standards/README.md
CHANGED
|
@@ -30,7 +30,7 @@ the four steps that need a person. A new CLI is ready for its first release when
|
|
|
30
30
|
| [Toolchain](toolchain.md) | `TOOL` | 20 | TypeScript, Biome, grit plugins, size caps, import cycles, spelling, Markdown, Go |
|
|
31
31
|
| [Layout](layout.md) | `LAY` | 10 | Repository layout, entry points, exports, file size, one job per file, splitting a unit, the bundled bin |
|
|
32
32
|
| [Commands](commands.md) | `CMD` | 32 | Paths, vocabulary, flags, arguments, effects, lifetime, query, help, external references, joining `wcat`, settings in the config file, refs, network hosts |
|
|
33
|
-
| [Output](output.md) | `OUT` |
|
|
33
|
+
| [Output](output.md) | `OUT` | 25 | Data on stdout only, envelopes, errors, exit codes, partial answers, projection, list results in a TypeScript API |
|
|
34
34
|
| [MCP](mcp.md) | `MCP` | 13 | The MCP tools, how they come from commands, what each permission shows |
|
|
35
35
|
| [Accounts](accounts.md) | `ACCT` | 13 | The explicit profile, reads across accounts, scope flags, linked identities, sign-in commands, memo's account groups |
|
|
36
36
|
| [Permissions](permissions.md) | `PERM` | 23 | Levels, keys, defaults, hard limits, the write guard and its journal, handing the keys to cli-core |
|
|
@@ -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,
|