@wirecat/cli-base 0.98.0 → 0.100.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 +61 -0
- package/dist/dev/audit.js +7 -0
- package/dist/dev/main.js +2 -9
- package/dist/dev/network.js +11 -4
- package/dist/dev/shared-contracts.js +2 -0
- package/dist/query/dates.js +12 -9
- package/dist/standards/audit.d.ts +4 -1
- package/dist/standards/audit.js +30 -6
- package/dist/standards/flags-calendar.js +7 -0
- package/dist/wcat/manifest.d.ts +6 -0
- package/dist/wcat/manifest.js +14 -1
- package/docs/standards/ci.md +2 -0
- package/docs/standards/commands.md +7 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,67 @@ Versions before 0.8.0 are in the [git tags](https://github.com/WireCatLabs/cli-b
|
|
|
8
8
|
Every entry says what changed as a caller sees it, why, and what to watch for — the rules are
|
|
9
9
|
[`docs/dev/CONVENTIONS.md`](docs/dev/CONVENTIONS.md#the-changelog).
|
|
10
10
|
|
|
11
|
+
## 0.100.0 — 14.11.2026
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- `PARITY_GROUPS`' `shared-roots` group takes asterisk-cli (its command is `pbx`), compared like beeline on
|
|
16
|
+
`commands`, `doctor`, `skill`, `mcp` and `upgrade`, and WC-CI-9 reserves 02:48 UTC for its monthly run.
|
|
17
|
+
`cli-dev repo-check` then passes for asterisk-cli without its own `config/parity-groups.json`.
|
|
18
|
+
- `PARITY_GROUPS`' `shared-roots` group takes notion-cli (its command is `notion`), compared on `commands`, `doctor`,
|
|
19
|
+
`skill`, `mcp` and `upgrade` until its documents commands ship, and WC-CI-9 reserves 02:20 UTC for its monthly run.
|
|
20
|
+
`cli-dev repo-check` then passes for notion-cli without its own `config/parity-groups.json`.
|
|
21
|
+
|
|
22
|
+
- **The flag vocabulary has `--setting <name=value>`** (role `value`, string): one of the service's own settings,
|
|
23
|
+
repeated for more. cli-core's shared `meetings create` and `meetings update` take it, so a CLI that mounts them
|
|
24
|
+
passes `option-role` without a baseline line.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- **A query's `time` field takes a time without seconds or without an offset**, as cli-core's `--since-time` does:
|
|
29
|
+
`created_at>"2026-10-01T09:00"` and `created_at>"2026-10-01 09:00"` worked as flags but failed as
|
|
30
|
+
`query.invalid-date`. A time with no offset is read in the zone the query is evaluated in (`dateRange`'s `zone`);
|
|
31
|
+
one that daylight saving skips or repeats there is refused and asks for an offset. Watch for: `validateQuery`
|
|
32
|
+
checks a time without an offset in its `zone` option, UTC when none is given.
|
|
33
|
+
|
|
34
|
+
## 0.99.0 — 13.11.2026
|
|
35
|
+
|
|
36
|
+
### Changed — may break callers
|
|
37
|
+
|
|
38
|
+
- **`same-entity-schema` and `same-error-reason` fail `cli-dev audit --family`.** 0.98.0 printed them as
|
|
39
|
+
warnings. A parity-group difference of these two rules names no CLI list (`entity hit`,
|
|
40
|
+
`reason ai.address-refused=model.address-refused`), because which CLIs share an entity or a reason changes with
|
|
41
|
+
each release; its `review_after`, not a stale check, retires it. The 11 differences measured on 13.11.2026 are
|
|
42
|
+
declared until 27.11.2026 (in `messengers` and `gcal-shared`), so no published CLI fails today; a new one does.
|
|
43
|
+
Watch for: from 27.11.2026 the audit warns about them, and from 11.12.2026 it fails until each is aligned
|
|
44
|
+
(cli-core 0.650.0 aligns the address reason) or its date is moved with a reason.
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
|
|
48
|
+
- **`cli-dev manifest` adds the hosts the shared packages reach for every CLI.** `network.hosts` now also lists
|
|
49
|
+
`registry.npmjs.org` (the update check, `doctor` online, cli-core's runtime download), `huggingface.co`,
|
|
50
|
+
`*.huggingface.co` and `*.hf.co` (the local models for search, speech and pictures, and the hosts Hugging Face
|
|
51
|
+
redirects its files to), `github.com` and `*.githubusercontent.com` (the ONNX runtime and the speech detector from
|
|
52
|
+
GitHub releases), so Desktop shows them. Exported as `SHARED_HOSTS` from `@wirecat/cli-base/wcat/manifest`. Watch for: every CLI's
|
|
53
|
+
`generate:check` fails after the bump until `pnpm generate` rewrites `contracts/wirecat.json`; a CLI that listed
|
|
54
|
+
one of these hosts itself may drop it.
|
|
55
|
+
|
|
56
|
+
### Fixed
|
|
57
|
+
|
|
58
|
+
- **`cli-dev audit --family` passes a CLI on cli-core 0.648.0.** cli-core 0.648.0 marks the commands it mounts
|
|
59
|
+
`origin: "cli-core"` in `commands --json`, while the contract it compares them with keeps the origin they were
|
|
60
|
+
written with, so `shared-command-contract` failed on all of them (88 in b24). The `cli-core` mark now counts as the
|
|
61
|
+
contract's own origin; any other change of origin still fails. With its contracts clean again, a CLI's shared
|
|
62
|
+
commands that the published max, tg and wa still word as an older cli-core did (`doctor reports`) are accepted as
|
|
63
|
+
inherited, as before.
|
|
64
|
+
- **`undeclared-host` skips a URL inside a sentence.** Help links in printed text, API descriptions and markdown
|
|
65
|
+
links are never fetched; only a URL that starts a string counts now, and `schemas.openxmlformats.org` joins the
|
|
66
|
+
XML namespace names that are skipped by name. drive's baseline drops 9 of its 11 hosts
|
|
67
|
+
and mail's overrides 6 of 17. Help links and OAuth scopes kept alone in a string still need an override: nothing
|
|
68
|
+
tells them apart from a request's address.
|
|
69
|
+
- **`raw-network` accepts `fetch` destructured in an arrow's or a method's parameter** (`({ env, fetch }) =>`,
|
|
70
|
+
`probe({ fetch }) {`), which binds the injected one; `call({ fetch })` is still reported.
|
|
71
|
+
|
|
11
72
|
## 0.98.0 — 12.11.2026
|
|
12
73
|
|
|
13
74
|
### Added
|
package/dist/dev/audit.js
CHANGED
|
@@ -4,6 +4,7 @@ import { LINT_RULES, OVERRIDE_BUDGET } from "../standards/lint.js";
|
|
|
4
4
|
import { capabilityDifference } from "./capabilities.js";
|
|
5
5
|
import { judge, kindOf, lintCommands, longName, registeredKinds, summaryOf, walk } from "./lint.js";
|
|
6
6
|
import { sharedContractProblems } from "./shared-contracts.js";
|
|
7
|
+
const UNLISTED_RULES = new Set(["same-entity-schema", "same-error-reason"]);
|
|
7
8
|
const STRICT_CONTRACT_RULES = new Set([
|
|
8
9
|
"shared-command-contract",
|
|
9
10
|
"same-path-contract",
|
|
@@ -263,6 +264,12 @@ export const auditClis = (inputs, options, rules = AUDIT_RULES) => {
|
|
|
263
264
|
// An `absent` or `only` difference names no CLI list: it stands for every finding where only that CLI lacks the
|
|
264
265
|
// flag, or only that CLI has it.
|
|
265
266
|
const differences = options.groups.flatMap((group) => group.differences.flatMap((entry) => {
|
|
267
|
+
// Which CLIs share an entity or a reason changes with each release, so the entry names only what differs, and
|
|
268
|
+
// its review_after, not a stale check, retires it.
|
|
269
|
+
if (UNLISTED_RULES.has(entry.rule))
|
|
270
|
+
return findings
|
|
271
|
+
.filter((finding) => finding.rule === entry.rule && finding.target.endsWith(` ${entry.target}`))
|
|
272
|
+
.map((finding) => ({ ...entry, group: group.name, target: finding.target, expected: finding.message }));
|
|
266
273
|
const cli = entry.absent ?? entry.only;
|
|
267
274
|
if (!cli)
|
|
268
275
|
return [{ group: group.name, ...entry }];
|
package/dist/dev/main.js
CHANGED
|
@@ -669,7 +669,6 @@ const auditFamily = (args, io) => {
|
|
|
669
669
|
family.close();
|
|
670
670
|
}
|
|
671
671
|
};
|
|
672
|
-
const FAMILY_REPORTS = new Set(["same-entity-schema", "same-error-reason"]);
|
|
673
672
|
const auditRun = (args, io, family = false) => {
|
|
674
673
|
const started = Date.now();
|
|
675
674
|
const { values } = parseArgs({
|
|
@@ -859,14 +858,8 @@ const auditRun = (args, io, family = false) => {
|
|
|
859
858
|
}));
|
|
860
859
|
else
|
|
861
860
|
io.out(scorecardTable(result.rows));
|
|
862
|
-
for (const finding of result.blocking)
|
|
863
|
-
|
|
864
|
-
// Measured for the first time by the family audit, and strict, so no baseline can hold them: shown, not failed.
|
|
865
|
-
if (family && FAMILY_REPORTS.has(finding.rule))
|
|
866
|
-
io.err(`warning ${line}`);
|
|
867
|
-
else
|
|
868
|
-
problems.push(line);
|
|
869
|
-
}
|
|
861
|
+
for (const finding of result.blocking)
|
|
862
|
+
problems.push(`new ${finding.rule} ${finding.target}: ${finding.message}`);
|
|
870
863
|
if (values.for === undefined && result.rows.some((row) => row.fixed > 0))
|
|
871
864
|
io.err(`warning ${values.baseline} holds rows no CLI has any more (the "fixed" column): remove them with --write-baseline`);
|
|
872
865
|
io.err(`audit: ${inputs.length} CLIs, ${result.findings.length} findings, ${result.blocking.length} new that block${AUDIT_BLOCKS === "never" ? " (cross-CLI divergences do not block)" : ""}`);
|
package/dist/dev/network.js
CHANGED
|
@@ -49,13 +49,15 @@ const opensNothing = (module, clause) => {
|
|
|
49
49
|
.every((binding) => allowed.has(binding.split(/\s+as\s+/)[0]));
|
|
50
50
|
};
|
|
51
51
|
// A file that binds its own `fetch` (an injected FetchLike, `const fetch = hostFetch(…)`) calls that one. Only a
|
|
52
|
-
// declaration binds it: a typed or defaulted parameter, a destructuring pattern, an arrow's own parameter
|
|
53
|
-
// key (`{ fetch: deps.fetch ?? fetch }`) or an argument (`call(fetch)
|
|
52
|
+
// declaration binds it: a typed or defaulted parameter, a destructuring pattern, an arrow's or a method's own parameter
|
|
53
|
+
// (`({ env, fetch }) =>`). An object key (`{ fetch: deps.fetch ?? fetch }`) or an argument (`call(fetch)`,
|
|
54
|
+
// `call({ fetch })`) hands the global on and binds nothing.
|
|
54
55
|
const BINDS_FETCH = new RegExp([
|
|
55
56
|
String.raw `\b(?:const|let|var|function)\s+fetch\b`,
|
|
56
57
|
String.raw `[(,]\s*fetch\s*\??\s*:\s*(?:typeof\b|[A-Z(])`,
|
|
57
58
|
String.raw `[(,]\s*fetch\s*=(?![=>])`,
|
|
58
59
|
String.raw `\{[^{}]*(?<![\w$.:]\s*)\bfetch\b(?!\s*:)[^{}]*\}\s*(?::|=(?![=>]))`,
|
|
60
|
+
String.raw `\{[^{}]*(?<![\w$.:]\s*)\bfetch\b(?!\s*:)[^{}]*\}(?:[^(){};]|\{[^{}]*\})*\)\s*(?:(?::[^={;\n]*)?=>|\{)`,
|
|
59
61
|
String.raw `(?:\(\s*fetch\s*\)|\bfetch)\s*=>`,
|
|
60
62
|
].join("|"));
|
|
61
63
|
const GLOBAL_FETCH = /(?<!\btypeof\s+)\b(?:globalThis|window|self)\s*\.\s*fetch\b/;
|
|
@@ -81,9 +83,14 @@ export const rawNetwork = ({ sources }) => sources.flatMap(({ path, text }) => {
|
|
|
81
83
|
: `imports ${what}: send HTTP through hostFetch from @wirecat/cli-base/http, or say why in lint/overrides.json`,
|
|
82
84
|
}));
|
|
83
85
|
});
|
|
84
|
-
|
|
86
|
+
// Only a URL that starts a string can be a request's address; one inside a sentence (help text, an API's description,
|
|
87
|
+
// a markdown link) is printed, never fetched.
|
|
88
|
+
const URL_HOST = /(?<=["'`])https?:\/\/([a-z0-9.-]+)/gi;
|
|
85
89
|
/** Names, not addresses: placeholders and schema or namespace identifiers nobody fetches. */
|
|
86
|
-
const NOT_CONTACTED =
|
|
90
|
+
const NOT_CONTACTED = new RegExp([
|
|
91
|
+
String.raw `(?:^|\.)(?:example(?:\.com|\.org|\.net)?|test|invalid)$`,
|
|
92
|
+
String.raw `^(?:json-schema\.org|www\.w3\.org|schemas\.openxmlformats\.org)$`,
|
|
93
|
+
].join("|"));
|
|
87
94
|
/** One finding per host, so a host named in many files takes one override. */
|
|
88
95
|
export const undeclaredHosts = ({ sources, hosts, docsHost, }) => {
|
|
89
96
|
if (hosts === undefined)
|
|
@@ -67,6 +67,8 @@ export const sharedContractProblems = (commands, references, edits = []) => {
|
|
|
67
67
|
const wanted = { ...expected, ...inherited };
|
|
68
68
|
const changed = [...new Set([...Object.keys(actual), ...Object.keys(wanted)])].filter((field) => field !== "aliases" &&
|
|
69
69
|
field !== "availability" &&
|
|
70
|
+
// Discovery marks a shared command "cli-core" (cli-core 0.648.0); the contract keeps how it was written.
|
|
71
|
+
!(field === "origin" && fields.origin === "cli-core") &&
|
|
70
72
|
!same(actual[field], wanted[field]));
|
|
71
73
|
if (changed.length)
|
|
72
74
|
problems.push({ path, message: `core contract differs without an exact override: ${changed.join(", ")}` });
|
package/dist/query/dates.js
CHANGED
|
@@ -11,7 +11,7 @@ export const timezoneOf = (given) => {
|
|
|
11
11
|
};
|
|
12
12
|
const calendar = (value, span) => {
|
|
13
13
|
if (!/^\d{4}-\d{2}-\d{2}$/u.test(value))
|
|
14
|
-
queryError("query.invalid-date", span, "use an ISO date
|
|
14
|
+
queryError("query.invalid-date", span, "use an ISO date such as 2026-10-01");
|
|
15
15
|
const year = Number(value.slice(0, 4)), month = Number(value.slice(5, 7)), day = Number(value.slice(8, 10));
|
|
16
16
|
const date = new Date(0);
|
|
17
17
|
date.setUTCFullYear(year, month - 1, day);
|
|
@@ -105,6 +105,7 @@ export const zonedMoment = (value, zone, span, { end = false } = {}) => {
|
|
|
105
105
|
return time;
|
|
106
106
|
};
|
|
107
107
|
const AGO = /^(\d+)(m|h|d)$/u;
|
|
108
|
+
const MOMENT = /^(\d{4}-\d{2}-\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d{1,3})?)?(Z|[+-]\d{2}:\d{2})?$/u;
|
|
108
109
|
const AGO_MS = { m: 60_000, h: 3_600_000, d: 86_400_000 };
|
|
109
110
|
const dayOf = (word, zone, now, span) => {
|
|
110
111
|
const today = new Intl.DateTimeFormat("en-CA", {
|
|
@@ -133,14 +134,16 @@ export const dateEndpoint = (value, zone, side, inclusive, span, now = Date.now(
|
|
|
133
134
|
time: dayBoundary(value, zone, side === "lower" ? !inclusive : inclusive, span),
|
|
134
135
|
inclusive: side === "lower",
|
|
135
136
|
};
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
137
|
+
const [, day, hour, minute, second = "0", offset] = MOMENT.exec(value) ?? [];
|
|
138
|
+
if (day === undefined)
|
|
139
|
+
queryError("query.invalid-date", span, "use an ISO date, a date and time such as 2026-10-01T09:00 (optional seconds and offset), today, yesterday or " +
|
|
140
|
+
"30m/2h/7d ago");
|
|
141
|
+
const moment = value.replace(" ", "T");
|
|
142
|
+
if (offset === undefined)
|
|
143
|
+
return { time: wallTime(moment, zone, span), inclusive };
|
|
144
|
+
calendar(day, span);
|
|
145
|
+
const time = Date.parse(moment);
|
|
146
|
+
if (!Number.isFinite(time) || Number(hour) > 23 || Number(minute) > 59 || Number(second) > 59)
|
|
144
147
|
queryError("query.invalid-date", span);
|
|
145
148
|
return { time, inclusive };
|
|
146
149
|
};
|
|
@@ -22,7 +22,10 @@ declare const parityGroupSchema: v.StrictObjectSchema<{
|
|
|
22
22
|
/** Permanent differences, each with its reason; they count against the override budget of the group. */
|
|
23
23
|
readonly differences: v.ArraySchema<v.StrictObjectSchema<{
|
|
24
24
|
readonly rule: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a lower-case word, words joined by -">]>;
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* `<clis> <path> <flag>`; with `absent` or `only`, only `<path> <flag>`: the CLI list is whoever else was compared.
|
|
27
|
+
* same-entity-schema and same-error-reason name no CLI list either: `entity hit`, `reason profile.unknown: code`.
|
|
28
|
+
*/
|
|
26
29
|
readonly target: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
|
|
27
30
|
readonly expected: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>, undefined>;
|
|
28
31
|
/** The CLI that lacks the path or flag by design; the rest must agree, so other CLIs joining do not stale it. */
|
package/dist/standards/audit.js
CHANGED
|
@@ -51,7 +51,10 @@ const parityGroupSchema = v.strictObject({
|
|
|
51
51
|
/** Permanent differences, each with its reason; they count against the override budget of the group. */
|
|
52
52
|
differences: v.array(v.strictObject({
|
|
53
53
|
rule: word,
|
|
54
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* `<clis> <path> <flag>`; with `absent` or `only`, only `<path> <flag>`: the CLI list is whoever else was compared.
|
|
56
|
+
* same-entity-schema and same-error-reason name no CLI list either: `entity hit`, `reason profile.unknown: code`.
|
|
57
|
+
*/
|
|
55
58
|
target: text,
|
|
56
59
|
expected: v.optional(text),
|
|
57
60
|
/** The CLI that lacks the path or flag by design; the rest must agree, so other CLIs joining do not stale it. */
|
|
@@ -95,8 +98,28 @@ const MEMO_DOCTOR_DEEP = {
|
|
|
95
98
|
reason: "memo's doctor --deep also checks its own store (cli-memo #672); cli-core's shared doctor leaves --deep to " +
|
|
96
99
|
"each CLI, and no other CLI has one",
|
|
97
100
|
};
|
|
101
|
+
// The family audit measured these first in cli-base 0.98.0, as warnings; they fail since NEED-2578, and these were the
|
|
102
|
+
// differences on that day. The target names no CLI list: whoever shares the entity or reason, the difference holds.
|
|
103
|
+
const review = (rule, target, reason) => ({ rule, target, reason, review_after: "2026-11-27" });
|
|
104
|
+
const ENTITY = "same-entity-schema";
|
|
105
|
+
const REASON = "same-error-reason";
|
|
106
|
+
const MESSENGERS_SINCE_0_98 = [
|
|
107
|
+
review(ENTITY, "entity contact_context", "max, tg and wa print it in different schemas (measured 2026-11-13)"),
|
|
108
|
+
review(ENTITY, "entity contact_preparation", "max, tg and wa print it in different schemas (measured 2026-11-13)"),
|
|
109
|
+
review(ENTITY, "entity linked_person", "max, tg and wa print it in different schemas (measured 2026-11-13)"),
|
|
110
|
+
];
|
|
111
|
+
const FAMILY_SINCE_0_98 = [
|
|
112
|
+
review(ENTITY, "entity api_method", "b24's schema differs from drive and gcal's (measured 2026-11-13)"),
|
|
113
|
+
review(ENTITY, "entity scheduled_job", "three schemas: b24, mail, memo / gcal / max, tg (measured 2026-11-13)"),
|
|
114
|
+
review(ENTITY, "entity hit", "three schemas: b24, memo, zm / gcal / max, tg, wa (measured 2026-11-13)"),
|
|
115
|
+
review(ENTITY, "entity deal", "b24's CRM deal and memo's differ (measured 2026-11-13)"),
|
|
116
|
+
review(ENTITY, "entity lead", "b24's CRM lead and memo's differ (measured 2026-11-13)"),
|
|
117
|
+
review(ENTITY, "entity product", "b24's CRM product and memo's differ (measured 2026-11-13)"),
|
|
118
|
+
review(REASON, "reason ai.address-refused=model.address-refused", "one failure under two names; cli-core 0.650.0 keeps one"),
|
|
119
|
+
review(REASON, "reason profile.unknown: code", "b24 gives it not_found, drive validation_error (measured 2026-11-13)"),
|
|
120
|
+
];
|
|
98
121
|
export const PARITY_GROUPS = defineParityGroups([
|
|
99
|
-
{ name: "messengers", members: ["tg", "max"], covers: "tree", differences:
|
|
122
|
+
{ name: "messengers", members: ["tg", "max"], covers: "tree", differences: MESSENGERS_SINCE_0_98 },
|
|
100
123
|
{
|
|
101
124
|
name: "all",
|
|
102
125
|
members: ["tg", "max", "memo", "drive", "zm", "wa"],
|
|
@@ -118,13 +141,14 @@ export const PARITY_GROUPS = defineParityGroups([
|
|
|
118
141
|
name: "gcal-shared",
|
|
119
142
|
members: ["tg", "max", "memo", "drive", "zm", "wa", "gcal"],
|
|
120
143
|
covers: ["commands", "upgrade", "notes", "meetings"],
|
|
121
|
-
differences:
|
|
144
|
+
differences: FAMILY_SINCE_0_98,
|
|
122
145
|
},
|
|
123
|
-
// bitrix24-cli's search is cli-core's CRM `search all`, and beeline-cli's meetings take call
|
|
124
|
-
// zoom-cli's:
|
|
146
|
+
// bitrix24-cli's search is cli-core's CRM `search all`, and beeline-cli's and asterisk-cli's meetings take call
|
|
147
|
+
// recordings, not zoom-cli's: they are compared on the root commands every CLI shares, the way gcal and mail are.
|
|
148
|
+
// notion-cli joins here until its documents commands ship; then it moves next to drive.
|
|
125
149
|
{
|
|
126
150
|
name: "shared-roots",
|
|
127
|
-
members: ["tg", "max", "memo", "drive", "zm", "wa", "b24", "beeline"],
|
|
151
|
+
members: ["tg", "max", "memo", "drive", "zm", "wa", "b24", "beeline", "pbx", "notion"],
|
|
128
152
|
covers: ["commands", "doctor", "skill", "mcp", "upgrade"],
|
|
129
153
|
differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP],
|
|
130
154
|
},
|
|
@@ -22,6 +22,13 @@ export const CALENDAR_FLAGS = [
|
|
|
22
22
|
type: "string",
|
|
23
23
|
meaning: "a person invited to the event, by email address; repeat it for more",
|
|
24
24
|
},
|
|
25
|
+
{
|
|
26
|
+
name: "--setting",
|
|
27
|
+
value: "<name=value>",
|
|
28
|
+
role: "value",
|
|
29
|
+
type: "string",
|
|
30
|
+
meaning: "one of the service's own settings, such as a meeting's waiting room; repeat it for more",
|
|
31
|
+
},
|
|
25
32
|
{
|
|
26
33
|
name: "--id",
|
|
27
34
|
value: "<id>",
|
package/dist/wcat/manifest.d.ts
CHANGED
|
@@ -8,6 +8,12 @@ import { type CommandInfo } from "../commands/registry.js";
|
|
|
8
8
|
import type { WcatTool } from "./describe.js";
|
|
9
9
|
export declare const MANIFEST_FORMAT = 2;
|
|
10
10
|
export declare const MANIFEST_FILE = "contracts/wirecat.json";
|
|
11
|
+
/**
|
|
12
|
+
* Hosts every CLI may reach through the shared packages rather than its own code: npm for the update check, Hugging
|
|
13
|
+
* Face for the models search, speech and pictures use, GitHub releases for the ONNX runtime and the speech detector,
|
|
14
|
+
* and the hosts both redirect their files to. `cli-dev manifest` adds them to the hosts a CLI declares.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SHARED_HOSTS: readonly string[];
|
|
11
17
|
/** Desktop's `plain_word`: letters, digits and `._:=,/+@-`, at most two leading dashes, `--` alone, `{name}` slots. */
|
|
12
18
|
export declare const PLAIN_WORD: RegExp;
|
|
13
19
|
declare const signInSchema: v.StrictObjectSchema<{
|
package/dist/wcat/manifest.js
CHANGED
|
@@ -11,6 +11,19 @@ import { issuesOf, jsonSchemaOf, SNAKE_CASE } from "../standards/registry.js";
|
|
|
11
11
|
import { PROGRAM_PREFIX, TOOL_NAME } from "./names.js";
|
|
12
12
|
export const MANIFEST_FORMAT = 2;
|
|
13
13
|
export const MANIFEST_FILE = "contracts/wirecat.json";
|
|
14
|
+
/**
|
|
15
|
+
* Hosts every CLI may reach through the shared packages rather than its own code: npm for the update check, Hugging
|
|
16
|
+
* Face for the models search, speech and pictures use, GitHub releases for the ONNX runtime and the speech detector,
|
|
17
|
+
* and the hosts both redirect their files to. `cli-dev manifest` adds them to the hosts a CLI declares.
|
|
18
|
+
*/
|
|
19
|
+
export const SHARED_HOSTS = [
|
|
20
|
+
"registry.npmjs.org",
|
|
21
|
+
"huggingface.co",
|
|
22
|
+
"*.huggingface.co",
|
|
23
|
+
"*.hf.co",
|
|
24
|
+
"github.com",
|
|
25
|
+
"*.githubusercontent.com",
|
|
26
|
+
];
|
|
14
27
|
/** Desktop's `plain_word`: letters, digits and `._:=,/+@-`, at most two leading dashes, `--` alone, `{name}` slots. */
|
|
15
28
|
export const PLAIN_WORD = /^(?:--|-{0,2}(?:[A-Za-z0-9]|\{[A-Za-z]+\})(?:[A-Za-z0-9._:=,/+@-]|\{[A-Za-z]+\})*)$/;
|
|
16
29
|
const plainWord = v.pipe(v.string(), v.maxLength(100, "a command word is at most 100 characters"), v.regex(PLAIN_WORD, (issue) => `${JSON.stringify(issue.input)} is not a plain word: letters, digits and ._:=,/+@-, at most two leading dashes, -- alone and {name} slots; no spaces, quotes or shell syntax`));
|
|
@@ -205,7 +218,7 @@ export const buildManifest = ({ identity, commands, pkg, skills }) => {
|
|
|
205
218
|
...(identity.hosts
|
|
206
219
|
? {
|
|
207
220
|
network: {
|
|
208
|
-
hosts: [...identity.hosts],
|
|
221
|
+
hosts: [...new Set([...identity.hosts, ...SHARED_HOSTS])],
|
|
209
222
|
...(identity.userHosts ? { user_hosts: identity.userHosts } : {}),
|
|
210
223
|
},
|
|
211
224
|
}
|
package/docs/standards/ci.md
CHANGED
|
@@ -168,6 +168,7 @@ its prompt in cli-template says so from cli-template 0.8.0. A CLI on an older te
|
|
|
168
168
|
| UTC | Repository |
|
|
169
169
|
|---|---|
|
|
170
170
|
| 02:17 | cli-base |
|
|
171
|
+
| 02:20 | notion-cli |
|
|
171
172
|
| 02:24 | whatsapp-cli |
|
|
172
173
|
| 02:27 | gcal-cli |
|
|
173
174
|
| 02:31 | cli-memo |
|
|
@@ -175,6 +176,7 @@ its prompt in cli-template says so from cli-template 0.8.0. A CLI on an older te
|
|
|
175
176
|
| 02:38 | cli-core |
|
|
176
177
|
| 02:41 | mail-cli |
|
|
177
178
|
| 02:45 | drive-cli |
|
|
179
|
+
| 02:48 | asterisk-cli |
|
|
178
180
|
| 02:52 | cli-testing |
|
|
179
181
|
| 02:59 | max-cli |
|
|
180
182
|
| 03:02 | cli-template |
|
|
@@ -461,7 +461,9 @@ right one, never `not_found`.
|
|
|
461
461
|
The CLI's `WCAT` identity lists every internet host it contacts in `hosts` (`["api.acme.example"]`, `[]` for none):
|
|
462
462
|
lower-case hostnames with no scheme, port or path, and a leading `*.` only before two labels or more. A host the
|
|
463
463
|
person chooses (a mail server, a page to read) is named in words in `userHosts`, and the CLI adds the configured host
|
|
464
|
-
to the list at run time. `cli-dev manifest` writes them to `network` in `contracts/wirecat.json
|
|
464
|
+
to the list at run time. `cli-dev manifest` writes them to `network` in `contracts/wirecat.json`, with the hosts the
|
|
465
|
+
shared packages reach for every CLI (`SHARED_HOSTS`: npm for the update check, Hugging Face and GitHub releases
|
|
466
|
+
for local models). The CLI's own source
|
|
465
467
|
sends HTTP only through `hostFetch` from `@wirecat/cli-base/http`, which refuses any other host before a byte leaves
|
|
466
468
|
the machine and checks every redirect.
|
|
467
469
|
|
|
@@ -474,7 +476,8 @@ the machine and checks every redirect.
|
|
|
474
476
|
`const fetch = hostFetch({ hosts: WCAT.hosts ?? [] })`. `raw-network` reports `src/api.ts node:https` for an
|
|
475
477
|
import of `node:https`, and `src/api.ts fetch` for the global `fetch` called or handed on as a value
|
|
476
478
|
(`options.fetch ?? fetch`); `undeclared-host` reports `collector.acme.dev`, naming the files, for a URL whose host
|
|
477
|
-
the shipped manifest does not list.
|
|
479
|
+
the shipped manifest does not list. A URL inside a sentence, such as a help link in printed text, is not reported;
|
|
480
|
+
one that starts a string is, because nothing tells it apart from a request's address.
|
|
478
481
|
- **Exceptions:** network code that cannot use `hostFetch` (a socket protocol, a provider SDK) says why in
|
|
479
482
|
`lint/overrides.json`, and still lists its hosts. The lint is not a sandbox: a dependency, a computed URL or `eval`
|
|
480
483
|
passes it, which is why Desktop also scans the package and flags what it finds. A shipped manifest without
|
|
@@ -482,7 +485,8 @@ the machine and checks every redirect.
|
|
|
482
485
|
no hosts yet; the warning becomes a failure once they do. With no manifest at all, the run only says the check is
|
|
483
486
|
skipped.
|
|
484
487
|
- **Applies to:** all CLIs, and third-party CLIs that join `wcat`. **Since:** the release after cli-base 0.84.0; the
|
|
485
|
-
global fetch as a value and the missing-hosts warning since the release after 0.93.0
|
|
488
|
+
global fetch as a value and the missing-hosts warning since the release after 0.93.0; the shared hosts, and URLs
|
|
489
|
+
inside a sentence left out of `undeclared-host`, since the release after 0.98.0.
|
|
486
490
|
**Rulings:** none.
|
|
487
491
|
|
|
488
492
|
## Sources
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.100.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",
|