@wirecat/cli-base 0.115.0 → 0.117.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 +78 -0
- package/dist/codegen/fake.js +30 -5
- package/dist/codegen/index.d.ts +1 -1
- package/dist/codegen/index.js +1 -1
- package/dist/codegen/openapi.js +34 -3
- package/dist/codegen/pipeline.js +7 -2
- package/dist/codegen/sign-in.d.ts +3 -1
- package/dist/codegen/sign-in.js +9 -2
- package/dist/dev/family.js +1 -0
- package/dist/standards/audit.js +4 -2
- package/dist/standards/vocabulary.js +4 -0
- package/dist/wcat/manifest.d.ts +42 -0
- package/dist/wcat/manifest.js +34 -1
- package/docs/standards/README.md +1 -1
- package/docs/standards/architecture.md +6 -1
- package/docs/standards/ci.md +1 -0
- package/docs/standards/commands.md +9 -4
- package/docs/standards/kit-surface.md +8 -4
- package/docs/standards/mcp.md +20 -1
- package/docs/standards/new-cli.md +16 -5
- package/docs/standards/security.md +42 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,84 @@ 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.117.0 — 18.11.2026
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **The command vocabulary has a tracker's nouns: `issues`, `teams`, `states` and `labels`.** cli-core's tracker
|
|
16
|
+
commands (`issues list`, `teams list`…) name them, so `cli-dev lint` passes a tracker CLI's command tree. `labels`
|
|
17
|
+
are a tracker's own, shared by its users; `tags` stay the labels the owner puts on things.
|
|
18
|
+
- **A CLI can say how Desktop signs it in, in Desktop's own window.** `ManifestIdentity.signIn` takes an optional
|
|
19
|
+
`methods` list, each `{ id, label, words, stdin? }`, and `cli-dev manifest` writes it to `desktop.signIn.methods`.
|
|
20
|
+
Until now an own tool could only be signed in at a terminal. `words` start with `{profile}` and name a command the
|
|
21
|
+
CLI has; `stdin: true` says the secret the person types is the command's whole stdin. Nothing else (a password
|
|
22
|
+
variable, a client file, OAuth words) is accepted, because Desktop does not take those from a tool it did not build.
|
|
23
|
+
Watch for: a manifest without `methods` is byte-for-byte as before; one with it needs a Desktop that shows a token
|
|
24
|
+
field for a `stdin` method.
|
|
25
|
+
- **ydisk (`@wirecat/yandex-disk-cli`) joins the shared lists.** It is in `PARITY_GROUPS`' `shared-roots` group, beside
|
|
26
|
+
notion, so `cli-dev audit --family` installs its latest release and compares the root commands every CLI shares. Its
|
|
27
|
+
monthly run holds 03:04 UTC in WC-CI-9's table. Watch for: a CLI's `--family` audit now installs one more package.
|
|
28
|
+
- **The handbook has a rule for a provider token the owner pastes, WC-SECR-26.** Yandex Disk, for one, gives the
|
|
29
|
+
owner a token to copy instead of a sign-in a CLI can run. The rule says how `session start` reads it (hidden at a
|
|
30
|
+
terminal or from stdin, never an argument), checks it with the service before keeping it, keeps it in the keyring
|
|
31
|
+
through cli-core's `ProfileTokenStore`, and what `session status --check`, `doctor --online` and `session end` do.
|
|
32
|
+
Watch for: a CLI with such a sign-in checks its `session end` and docs against the "Revoked" line.
|
|
33
|
+
- **WC-MCP-9 covers the MCP Registry entry.** A `server.json` passes `--profiles` as a required argument with a
|
|
34
|
+
placeholder such as `personal`, never a fixed `all`, and leaves its versions to `release.yml`. Watch for: tg, max,
|
|
35
|
+
wa, zm, gcal, drive, notion, mail, pbx, b24, amo, hubspot and cli-template shipped `--profiles all`; each now passes the
|
|
36
|
+
required argument.
|
|
37
|
+
|
|
38
|
+
### Changed — may break callers
|
|
39
|
+
|
|
40
|
+
- **`signInPlace` signs an HTTP `basic` scheme**, as `Authorization: Basic <base64>` of a `<user>:<password>` token,
|
|
41
|
+
and marks the place `basic: true`; it returned `undefined` before. WordPress application passwords are Basic, and a
|
|
42
|
+
CLI's tests need `fakeApi` to take them. Watch for: a caller that told Basic apart by `undefined`, as cli-core's `api`
|
|
43
|
+
group up to 0.695.0 does, must read `place.basic` instead. Until it does, a call that offers Basic and a token may
|
|
44
|
+
be signed with Basic, and a token with no `:` is no longer refused. The caller keeps that check: `value` never throws.
|
|
45
|
+
Digest is still `undefined`.
|
|
46
|
+
- **A sample of a union takes the branch with the most required fields, not the first.** Attio's `GET /v2/self`
|
|
47
|
+
answers `{ active: false }` first, so `fakeApi` answered a sign-in check without the workspace's id. Watch for: a
|
|
48
|
+
test that reads a sampled union, in `fakeApi` or the GraphQL fake, now sees the larger branch. A field typed
|
|
49
|
+
`string | { id }` samples as the object; Notion's description samples 92 of its 609 definitions differently, while
|
|
50
|
+
HubSpot's, ydisk's, Drive's and Calendar's sample as before.
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
|
|
54
|
+
- **`fakeApi` refuses a token sent to another host in base64 too**, in a header or a query string, as Basic sends it,
|
|
55
|
+
not only as the raw token.
|
|
56
|
+
- **The New CLI page lists every shared list a new WireCat CLI joins, with the file and when.** It left out the family
|
|
57
|
+
audit's package map, `PACKAGES` in `src/dev/family.ts`, so a new CLI's neighbours never installed it for
|
|
58
|
+
`cli-dev audit --family`.
|
|
59
|
+
- **The Kit surface page no longer says that nothing checks the permission keys.** cli-core's `serviceApiCommand`
|
|
60
|
+
checks each operation's keys from 0.684.0; the page now says so, and that `--dry-run` shows them once the CLI merges
|
|
61
|
+
`serviceApiPermissions` into its `commandPermissions`. It also no longer says that cli-core cannot read every page:
|
|
62
|
+
`--all` does.
|
|
63
|
+
- **WC-CMD-29 says what it requires of a CLI's name: the `wcat-<name>` key.** A short name beside it, as every WireCat
|
|
64
|
+
CLI installs, is fine; the lint's warning about it is not a failure, and an override only silences it.
|
|
65
|
+
- **WC-ARCH-5 names a known gap:** drive's and ydisk's live `files` groups are hand-written in each CLI until cli-core
|
|
66
|
+
has a shared files domain.
|
|
67
|
+
- **Publishing no longer tells a CLI to pass `--profiles all` in `server.json`.**
|
|
68
|
+
- **`names: { fromPath: true }` names a PUT on a collection `-upsert` when a PUT on its item exists too.** Attio's
|
|
69
|
+
`PUT /v2/objects/{object}/records` (create or update by a unique value) and `PUT …/records/{record_id}` both became
|
|
70
|
+
`objects-records-replace`, and generation stopped. Watch for: a CLI that named one of such a pair in
|
|
71
|
+
`names.commands` to avoid the clash now gets `-upsert` for the other.
|
|
72
|
+
- **A string with a `pattern` gets a sample the pattern and its length bounds take.** A pattern of groups,
|
|
73
|
+
alternatives or a `.` (Attio's `^https:\/\/.*` and ISO 8601 durations) fell back to `xxxxxx`, which the strict fake
|
|
74
|
+
then refused.
|
|
75
|
+
- **The OpenAPI adapter reads `prefixItems`, an `allOf` of unions of plain values, and skips `minProperties` and
|
|
76
|
+
`maxProperties`.** Each stopped generation for Attio's description. A tuple is read as a list of its places, an
|
|
77
|
+
`allOf` of unions with no object in any branch as its first member; one with an object is still refused. A closed
|
|
78
|
+
tuple (`items: false`) is still refused.
|
|
79
|
+
|
|
80
|
+
## 0.116.0 — 17.11.2026
|
|
81
|
+
|
|
82
|
+
### Changed — may break callers
|
|
83
|
+
|
|
84
|
+
- **`names: { fromPath: true }` names a GET of a path ending in `/me` as one item, `-get`, not `-list`.** Notion's
|
|
85
|
+
`GET /v1/users/me` was `users-me-list` and is now `users-me-get`; a CLI that regenerates on this version renames that
|
|
86
|
+
command. Watch for: a path whose last fixed word follows a parameter (`/pages/{id}/markdown`) is still named
|
|
87
|
+
`-list`, since the path alone cannot tell it from a real list (`/blocks/{id}/children`); name it in `commands`.
|
|
88
|
+
|
|
11
89
|
## 0.115.0 — 17.11.2026
|
|
12
90
|
|
|
13
91
|
### Added
|
package/dist/codegen/fake.js
CHANGED
|
@@ -155,8 +155,12 @@ const patternSample = (pattern) => {
|
|
|
155
155
|
return undefined;
|
|
156
156
|
at += 2;
|
|
157
157
|
}
|
|
158
|
-
else if ("()
|
|
158
|
+
else if ("()|".includes(char))
|
|
159
159
|
return undefined;
|
|
160
|
+
else if (char === ".") {
|
|
161
|
+
atom = "x";
|
|
162
|
+
at += 1;
|
|
163
|
+
}
|
|
160
164
|
else {
|
|
161
165
|
atom = char;
|
|
162
166
|
at += 1;
|
|
@@ -170,6 +174,9 @@ const patternSample = (pattern) => {
|
|
|
170
174
|
const sample = atoms.join("");
|
|
171
175
|
return regexOf(pattern)?.test(sample) ? sample : undefined;
|
|
172
176
|
};
|
|
177
|
+
const requiredCount = (node, definitions) => objectParts(node, definitions)?.required.length ?? 0;
|
|
178
|
+
// Strings a pattern made of groups or alternatives often takes: a link, an ISO duration and date, a number, a word.
|
|
179
|
+
const GUESSES = ["https://example.com", "P1D", "2026-01-01", "0", "000000", "x", "example", "a@example.com"];
|
|
173
180
|
/** A value the schema accepts: the first enum value, the minimum, one array item, every object field. */
|
|
174
181
|
export const sampleOf = (node, definitions, seen = new Set()) => {
|
|
175
182
|
switch (node.type) {
|
|
@@ -178,8 +185,11 @@ export const sampleOf = (node, definitions, seen = new Set()) => {
|
|
|
178
185
|
// A schema that contains itself stops at its first repeat.
|
|
179
186
|
return target && !seen.has(node.ref) ? sampleOf(target, definitions, new Set([...seen, node.ref])) : null;
|
|
180
187
|
}
|
|
181
|
-
case "union":
|
|
182
|
-
|
|
188
|
+
case "union": {
|
|
189
|
+
// The branch that asks the most: a first branch such as `{ active: false }` would leave out what a reader needs.
|
|
190
|
+
const [best] = [...node.of].sort((a, b) => requiredCount(b, definitions) - requiredCount(a, definitions));
|
|
191
|
+
return best ? sampleOf(best, definitions, seen) : null;
|
|
192
|
+
}
|
|
183
193
|
case "allOf": {
|
|
184
194
|
const parts = objectParts(node, definitions);
|
|
185
195
|
return parts ? sampleOf({ type: "object", ...parts }, definitions, seen) : null;
|
|
@@ -190,7 +200,14 @@ export const sampleOf = (node, definitions, seen = new Set()) => {
|
|
|
190
200
|
if (node.format === "binary")
|
|
191
201
|
return "attach://xxxxxx";
|
|
192
202
|
const plain = "x".repeat(Math.max(node.minLength ?? 6, 1)).slice(0, node.maxLength ?? 64);
|
|
193
|
-
|
|
203
|
+
if (node.pattern === undefined)
|
|
204
|
+
return plain;
|
|
205
|
+
const pattern = regexOf(node.pattern);
|
|
206
|
+
const fits = (one) => one !== undefined &&
|
|
207
|
+
one.length >= (node.minLength ?? 0) &&
|
|
208
|
+
one.length <= (node.maxLength ?? Number.POSITIVE_INFINITY) &&
|
|
209
|
+
pattern?.test(one) !== false;
|
|
210
|
+
return [patternSample(node.pattern), ...GUESSES, plain].find(fits) ?? plain;
|
|
194
211
|
}
|
|
195
212
|
case "integer":
|
|
196
213
|
case "number":
|
|
@@ -285,7 +302,15 @@ export const fakeApi = (options) => {
|
|
|
285
302
|
return place?.in === "query" ? [place.name] : [];
|
|
286
303
|
}));
|
|
287
304
|
const carries = (request, url, place, token) => (place.in === "header" ? request.headers.get(place.name) : url.searchParams.get(place.name)) === place.value(token);
|
|
288
|
-
|
|
305
|
+
// A Basic header holds the token only in base64, which a query string may also carry URL-encoded.
|
|
306
|
+
const encoded = Object.values(options.securitySchemes ?? {}).some((scheme) => signInPlace(scheme)?.basic);
|
|
307
|
+
const secrets = (token) => {
|
|
308
|
+
if (!encoded)
|
|
309
|
+
return [token];
|
|
310
|
+
const base64 = Buffer.from(token).toString("base64");
|
|
311
|
+
return [token, base64, encodeURIComponent(base64)];
|
|
312
|
+
};
|
|
313
|
+
const leaks = (request, url, token) => secrets(token).some((secret) => [...request.headers.values()].some((value) => value.includes(secret)) || url.search.includes(secret));
|
|
289
314
|
const fetch = async (input, init) => {
|
|
290
315
|
const request = new Request(input, init);
|
|
291
316
|
const url = new URL(request.url);
|
package/dist/codegen/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* adds no runtime dependency. `adaptOpenApi` reads an OpenAPI document and `adaptDiscovery` Google Discovery
|
|
6
6
|
* documents the consumer has parsed, and `adaptGraphql` a GraphQL introspection result; `upgradeToOpenApi3` brings Swagger 1.2 and 2.0 to OpenAPI 3 through two optional
|
|
7
7
|
* peer dependencies. `fakeApi` serves the generated manifest as a strict fake for a CLI's tests, and `signInRequirements` with
|
|
8
|
-
* `signInPlace` say which sign-in a call needs and where its token goes. An adapter from
|
|
8
|
+
* `signInPlace` say which sign-in a call needs and where its token goes (Basic included). An adapter from
|
|
9
9
|
* Postman or anything else lives in the consumer.
|
|
10
10
|
*/
|
|
11
11
|
export { adaptDiscovery, type DiscoveryMetadata, type DiscoveryOptions, type DiscoveryProvenance, type DiscoveryResult, type DiscoveryService, readDiscovery, type SyncDiscoveryOptions, syncDiscovery, } from "./discovery.js";
|
package/dist/codegen/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* adds no runtime dependency. `adaptOpenApi` reads an OpenAPI document and `adaptDiscovery` Google Discovery
|
|
6
6
|
* documents the consumer has parsed, and `adaptGraphql` a GraphQL introspection result; `upgradeToOpenApi3` brings Swagger 1.2 and 2.0 to OpenAPI 3 through two optional
|
|
7
7
|
* peer dependencies. `fakeApi` serves the generated manifest as a strict fake for a CLI's tests, and `signInRequirements` with
|
|
8
|
-
* `signInPlace` say which sign-in a call needs and where its token goes. An adapter from
|
|
8
|
+
* `signInPlace` say which sign-in a call needs and where its token goes (Basic included). An adapter from
|
|
9
9
|
* Postman or anything else lives in the consumer.
|
|
10
10
|
*/
|
|
11
11
|
export { adaptDiscovery, readDiscovery, syncDiscovery, } from "./discovery.js";
|
package/dist/codegen/openapi.js
CHANGED
|
@@ -3,7 +3,19 @@ const METHODS = ["get", "post", "put", "patch", "delete", "head"];
|
|
|
3
3
|
* Carried by the model, or harmless to lose. `not` only narrows what a payload may hold; losing it
|
|
4
4
|
* accepts more, never refuses a valid request.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
// minProperties and maxProperties only check a count; the service checks it again, so a looser schema loses nothing.
|
|
7
|
+
const IGNORED = new Set([
|
|
8
|
+
"readOnly",
|
|
9
|
+
"example",
|
|
10
|
+
"examples",
|
|
11
|
+
"externalDocs",
|
|
12
|
+
"title",
|
|
13
|
+
"xml",
|
|
14
|
+
"writeOnly",
|
|
15
|
+
"not",
|
|
16
|
+
"minProperties",
|
|
17
|
+
"maxProperties",
|
|
18
|
+
]);
|
|
7
19
|
const KNOWN = new Set([
|
|
8
20
|
...IGNORED,
|
|
9
21
|
"type",
|
|
@@ -20,6 +32,7 @@ const KNOWN = new Set([
|
|
|
20
32
|
"minimum",
|
|
21
33
|
"maximum",
|
|
22
34
|
"items",
|
|
35
|
+
"prefixItems",
|
|
23
36
|
"minItems",
|
|
24
37
|
"maxItems",
|
|
25
38
|
"uniqueItems",
|
|
@@ -207,7 +220,7 @@ class Adapter {
|
|
|
207
220
|
if (types.size === 1)
|
|
208
221
|
return [...types][0];
|
|
209
222
|
}
|
|
210
|
-
if (source.items !== undefined)
|
|
223
|
+
if (source.items !== undefined || source.prefixItems !== undefined)
|
|
211
224
|
return "array";
|
|
212
225
|
if (source.properties !== undefined || source.required !== undefined || source.additionalProperties !== undefined)
|
|
213
226
|
return "object";
|
|
@@ -303,7 +316,12 @@ class Adapter {
|
|
|
303
316
|
}
|
|
304
317
|
case "array": {
|
|
305
318
|
// JSON Schema reads a missing `items` as "any item".
|
|
306
|
-
const
|
|
319
|
+
const rest = source.items === undefined ? { type: "unknown" } : this.schema(source.items, `${where}[]`);
|
|
320
|
+
// A tuple (`prefixItems`) is read as a list whose every item is one of its places: looser, never wrong.
|
|
321
|
+
const places = Array.isArray(source.prefixItems)
|
|
322
|
+
? source.prefixItems.map((one, index) => this.schema(one, `${where}.prefixItems[${index}]`))
|
|
323
|
+
: [];
|
|
324
|
+
const items = places.length === 0 ? rest : { type: "union", of: [...places, rest] };
|
|
307
325
|
const node = { ...common, type: "array", items };
|
|
308
326
|
if (typeof source.minItems === "number")
|
|
309
327
|
node.minItems = source.minItems;
|
|
@@ -401,6 +419,19 @@ class Adapter {
|
|
|
401
419
|
if (unions.length === 0)
|
|
402
420
|
return undefined;
|
|
403
421
|
const [union] = unions;
|
|
422
|
+
// Every value of an allOf of unions of plain values passes each one, so the first alone is looser and never refuses
|
|
423
|
+
// a right value, as Attio's kanban status_attribute narrows a path union again. With an object in a branch the
|
|
424
|
+
// value may need fields from two unions at once, which the first alone would refuse.
|
|
425
|
+
const plain = (member) => !isObject(member) ||
|
|
426
|
+
(member.type !== "object" &&
|
|
427
|
+
member.properties === undefined &&
|
|
428
|
+
member.allOf === undefined &&
|
|
429
|
+
member.$ref === undefined);
|
|
430
|
+
if (unions.length > 1 &&
|
|
431
|
+
union &&
|
|
432
|
+
unions.length === members.length &&
|
|
433
|
+
unions.every((one) => one.members.every(plain)))
|
|
434
|
+
return { ...this.schema(union.member, `${where}.allOf[0]`), ...common };
|
|
404
435
|
if (unions.length > 1 || !union) {
|
|
405
436
|
this.problems.push(`${where}: an allOf of several unions`);
|
|
406
437
|
return { type: "unknown" };
|
package/dist/codegen/pipeline.js
CHANGED
|
@@ -43,12 +43,17 @@ const commandFromPath = (operation, all, names) => {
|
|
|
43
43
|
const collection = all.some((other) => other.binding.kind === "http" &&
|
|
44
44
|
((other.binding.method === "GET" && other.binding.path === path) ||
|
|
45
45
|
(other.binding.path.startsWith(`${path}/{`) && !other.binding.path.slice(path.length + 1).includes("/"))));
|
|
46
|
+
// A PUT on the collection beside a PUT on its item is the "create or update by a unique value" (Attio's assert).
|
|
47
|
+
const itemPut = all.some((other) => other.binding.kind === "http" &&
|
|
48
|
+
other.binding.method === "PUT" &&
|
|
49
|
+
other.binding.path.startsWith(`${path}/{`) &&
|
|
50
|
+
!other.binding.path.slice(path.length + 1).includes("/"));
|
|
46
51
|
const verb = {
|
|
47
|
-
GET: onItem ? "get" : "list",
|
|
52
|
+
GET: onItem || parts.at(-1) === "me" ? "get" : "list",
|
|
48
53
|
HEAD: "head",
|
|
49
54
|
DELETE: "delete",
|
|
50
55
|
PATCH: "update",
|
|
51
|
-
PUT: onItem
|
|
56
|
+
PUT: onItem ? "replace" : collection ? (itemPut ? "upsert" : "replace") : "",
|
|
52
57
|
POST: onItem ? "update" : collection ? "create" : "",
|
|
53
58
|
}[method];
|
|
54
59
|
return [...words, verb].filter(Boolean).join("-");
|
|
@@ -9,8 +9,10 @@ export interface SignInPlace {
|
|
|
9
9
|
/** A header name in lower case, or a query parameter as the spec spells it. */
|
|
10
10
|
name: string;
|
|
11
11
|
value: (token: string) => string;
|
|
12
|
+
/** Basic: the token is `<user>:<password>`, which a sign-in with a token alone does not keep. */
|
|
13
|
+
basic?: true;
|
|
12
14
|
}
|
|
13
|
-
/** `undefined` for a scheme a token cannot be sent by:
|
|
15
|
+
/** `undefined` for a scheme a token cannot be sent by: digest, a key in a cookie, mutual TLS. */
|
|
14
16
|
export declare const signInPlace: (scheme: SecurityScheme) => SignInPlace | undefined;
|
|
15
17
|
/**
|
|
16
18
|
* The requirements one call signs in by: the operation's own `security`, else the document's. `undefined` when it needs
|
package/dist/codegen/sign-in.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const BEARER = { in: "header", name: "authorization", value: (token) => `Bearer ${token}` };
|
|
2
|
-
/** `undefined` for a scheme a token cannot be sent by:
|
|
2
|
+
/** `undefined` for a scheme a token cannot be sent by: digest, a key in a cookie, mutual TLS. */
|
|
3
3
|
export const signInPlace = (scheme) => {
|
|
4
4
|
if (scheme.type === "apiKey") {
|
|
5
5
|
if (!scheme.name || (scheme.in !== "header" && scheme.in !== "query"))
|
|
@@ -13,7 +13,14 @@ export const signInPlace = (scheme) => {
|
|
|
13
13
|
if (scheme.type === "http") {
|
|
14
14
|
if (!scheme.scheme || /^bearer$/i.test(scheme.scheme))
|
|
15
15
|
return BEARER;
|
|
16
|
-
if (/^
|
|
16
|
+
if (/^basic$/i.test(scheme.scheme))
|
|
17
|
+
return {
|
|
18
|
+
in: "header",
|
|
19
|
+
name: "authorization",
|
|
20
|
+
value: (token) => `Basic ${Buffer.from(token).toString("base64")}`,
|
|
21
|
+
basic: true,
|
|
22
|
+
};
|
|
23
|
+
if (/^digest$/i.test(scheme.scheme))
|
|
17
24
|
return undefined;
|
|
18
25
|
return { in: "header", name: "authorization", value: (token) => `${scheme.scheme} ${token}` };
|
|
19
26
|
}
|
package/dist/dev/family.js
CHANGED
|
@@ -8,6 +8,7 @@ const PACKAGES = new Map([
|
|
|
8
8
|
...FIRST_PARTY_TOOLS.flatMap((tool) => (tool.package ? [[tool.name, tool.package]] : [])),
|
|
9
9
|
["gcal", "@wirecat/gcal-cli"],
|
|
10
10
|
["b24", "@wirecat/bitrix24-cli"],
|
|
11
|
+
["ydisk", "@wirecat/yandex-disk-cli"],
|
|
11
12
|
]);
|
|
12
13
|
/** Every other CLI of the parity groups that npm has, by name. */
|
|
13
14
|
export const familyPackages = (groups, own) => new Map([...new Set(groups.flatMap((group) => group.members))]
|
package/dist/standards/audit.js
CHANGED
|
@@ -159,10 +159,12 @@ export const PARITY_GROUPS = defineParityGroups([
|
|
|
159
159
|
// bitrix24-cli's search is cli-core's CRM `search all`, and beeline-cli's and asterisk-cli's meetings take call
|
|
160
160
|
// recordings, not zoom-cli's: they are compared on the root commands every CLI shares, the way gcal and mail are.
|
|
161
161
|
// amo-cli and hubspot-cli share them too, and their CRM commands are compared with b24 in `crm` below.
|
|
162
|
-
// notion-cli joins here until its documents commands ship; then it moves next to drive.
|
|
162
|
+
// notion-cli joins here until its documents commands ship; then it moves next to drive. ydisk joins here too: in "all"
|
|
163
|
+
// its search and notes differ from the messengers' and memo's as drive's do, and a documents group of drive, notion
|
|
164
|
+
// and ydisk differs in 39 paths (session, folders browse, summaries; measured on the published CLIs 2026-11-17).
|
|
163
165
|
{
|
|
164
166
|
name: "shared-roots",
|
|
165
|
-
members: ["tg", "max", "memo", "drive", "zm", "wa", "b24", "beeline", "pbx", "notion", "amo", "hubspot"],
|
|
167
|
+
members: ["tg", "max", "memo", "drive", "zm", "wa", "b24", "beeline", "pbx", "notion", "amo", "hubspot", "ydisk"],
|
|
166
168
|
covers: ["commands", "doctor", "skill", "mcp", "upgrade"],
|
|
167
169
|
differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP],
|
|
168
170
|
},
|
|
@@ -289,6 +289,10 @@ const collections = [
|
|
|
289
289
|
["transactions", "money that moved in or out of a wallet, as the bank or the owner recorded it"],
|
|
290
290
|
["splits", "parts of one transaction, each with its own amount and category"],
|
|
291
291
|
["users", "people who work in the owner's account at a service, such as a CRM's employees"],
|
|
292
|
+
["issues", "work items in an issue tracker, each in a team, a workflow state and maybe a project"],
|
|
293
|
+
["teams", "groups in a tracker that own issues, states and labels"],
|
|
294
|
+
["states", "the workflow steps a tracker team moves its issues through, each of a type such as started"],
|
|
295
|
+
["labels", "a tracker's shared labels on issues, kept by the tracker and not by the owner"],
|
|
292
296
|
["fields", "a record type's field definitions: code, label, type and options, such as a CRM's custom fields"],
|
|
293
297
|
["activities", "a CRM's calls, e-mails, meetings, to-dos and comments on its records"],
|
|
294
298
|
["changes", "what changed in a copied source over a time: records added, moved, closed or reassigned"],
|
package/dist/wcat/manifest.d.ts
CHANGED
|
@@ -21,6 +21,20 @@ declare const signInSchema: v.StrictObjectSchema<{
|
|
|
21
21
|
readonly gives: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "one line of text">, v.MaxLengthAction<string, number, undefined>]>;
|
|
22
22
|
/** What the person is asked for: "An Acme API token, from Settings → API." */
|
|
23
23
|
readonly asks: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "one line of text">, v.MaxLengthAction<string, number, undefined>]>;
|
|
24
|
+
/** Left out when the CLI signs in only at a terminal, so the manifest of every other CLI stays as it was. */
|
|
25
|
+
readonly methods: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StrictObjectSchema<{
|
|
26
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a lower-case method id">]>;
|
|
27
|
+
/** The button or tab: "API token". */
|
|
28
|
+
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "one line of text">, v.MaxLengthAction<string, number, undefined>]>;
|
|
29
|
+
/** `{profile}` first, then the command: `["{profile}", "session", "start", "--json"]`. */
|
|
30
|
+
readonly words: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 100, "a command word is at most 100 characters">, v.RegexAction<string, (issue: v.RegexIssue<string>) => string>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
|
31
|
+
readonly stdin: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
32
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
33
|
+
id: string;
|
|
34
|
+
label: string;
|
|
35
|
+
words: string[];
|
|
36
|
+
stdin?: boolean | undefined;
|
|
37
|
+
}[], 1, undefined>]>, undefined>;
|
|
24
38
|
}, undefined>;
|
|
25
39
|
export type SignIn = v.InferOutput<typeof signInSchema>;
|
|
26
40
|
/** Exactly the keys of a Desktop catalog entry that the tool itself knows; `null` when unused. */
|
|
@@ -42,6 +56,20 @@ declare const desktopSchema: v.StrictObjectSchema<{
|
|
|
42
56
|
readonly gives: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "one line of text">, v.MaxLengthAction<string, number, undefined>]>;
|
|
43
57
|
/** What the person is asked for: "An Acme API token, from Settings → API." */
|
|
44
58
|
readonly asks: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "one line of text">, v.MaxLengthAction<string, number, undefined>]>;
|
|
59
|
+
/** Left out when the CLI signs in only at a terminal, so the manifest of every other CLI stays as it was. */
|
|
60
|
+
readonly methods: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StrictObjectSchema<{
|
|
61
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a lower-case method id">]>;
|
|
62
|
+
/** The button or tab: "API token". */
|
|
63
|
+
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "one line of text">, v.MaxLengthAction<string, number, undefined>]>;
|
|
64
|
+
/** `{profile}` first, then the command: `["{profile}", "session", "start", "--json"]`. */
|
|
65
|
+
readonly words: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 100, "a command word is at most 100 characters">, v.RegexAction<string, (issue: v.RegexIssue<string>) => string>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
|
66
|
+
readonly stdin: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
67
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
68
|
+
id: string;
|
|
69
|
+
label: string;
|
|
70
|
+
words: string[];
|
|
71
|
+
stdin?: boolean | undefined;
|
|
72
|
+
}[], 1, undefined>]>, undefined>;
|
|
45
73
|
}, undefined>, undefined>;
|
|
46
74
|
readonly skill: v.NullableSchema<v.StrictObjectSchema<{
|
|
47
75
|
readonly status: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 100, "a command word is at most 100 characters">, v.RegexAction<string, (issue: v.RegexIssue<string>) => string>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
|
@@ -137,6 +165,20 @@ export declare const manifestSchema: v.StrictObjectSchema<{
|
|
|
137
165
|
readonly gives: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "one line of text">, v.MaxLengthAction<string, number, undefined>]>;
|
|
138
166
|
/** What the person is asked for: "An Acme API token, from Settings → API." */
|
|
139
167
|
readonly asks: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "one line of text">, v.MaxLengthAction<string, number, undefined>]>;
|
|
168
|
+
/** Left out when the CLI signs in only at a terminal, so the manifest of every other CLI stays as it was. */
|
|
169
|
+
readonly methods: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StrictObjectSchema<{
|
|
170
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a lower-case method id">]>;
|
|
171
|
+
/** The button or tab: "API token". */
|
|
172
|
+
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "one line of text">, v.MaxLengthAction<string, number, undefined>]>;
|
|
173
|
+
/** `{profile}` first, then the command: `["{profile}", "session", "start", "--json"]`. */
|
|
174
|
+
readonly words: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 100, "a command word is at most 100 characters">, v.RegexAction<string, (issue: v.RegexIssue<string>) => string>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
|
175
|
+
readonly stdin: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
176
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
177
|
+
id: string;
|
|
178
|
+
label: string;
|
|
179
|
+
words: string[];
|
|
180
|
+
stdin?: boolean | undefined;
|
|
181
|
+
}[], 1, undefined>]>, undefined>;
|
|
140
182
|
}, undefined>, undefined>;
|
|
141
183
|
readonly skill: v.NullableSchema<v.StrictObjectSchema<{
|
|
142
184
|
readonly status: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 100, "a command word is at most 100 characters">, v.RegexAction<string, (issue: v.RegexIssue<string>) => string>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
package/dist/wcat/manifest.js
CHANGED
|
@@ -29,11 +29,25 @@ export const PLAIN_WORD = /^(?:--|-{0,2}(?:[A-Za-z0-9]|\{[A-Za-z]+\})(?:[A-Za-z0
|
|
|
29
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`));
|
|
30
30
|
const words = v.pipe(v.array(plainWord), v.minLength(1));
|
|
31
31
|
const line = (max) => v.pipe(v.string(), v.regex(/^\S(?:[^\n\r]*\S)?$/, "one line of text"), v.maxLength(max));
|
|
32
|
+
/**
|
|
33
|
+
* A sign-in Desktop runs in its own window. Only the parts Desktop accepts from a tool it did not build: the words, and
|
|
34
|
+
* whether the secret the person types is the command's whole stdin.
|
|
35
|
+
*/
|
|
36
|
+
const signInMethodSchema = v.strictObject({
|
|
37
|
+
id: v.pipe(v.string(), v.regex(/^[a-z][a-z0-9-]{0,31}$/, "a lower-case method id")),
|
|
38
|
+
/** The button or tab: "API token". */
|
|
39
|
+
label: line(40),
|
|
40
|
+
/** `{profile}` first, then the command: `["{profile}", "session", "start", "--json"]`. */
|
|
41
|
+
words,
|
|
42
|
+
stdin: v.optional(v.boolean()),
|
|
43
|
+
});
|
|
32
44
|
const signInSchema = v.strictObject({
|
|
33
45
|
/** What signing in lets the agent do, in a sentence: "Lets your agent read your Acme contacts." */
|
|
34
46
|
gives: line(300),
|
|
35
47
|
/** What the person is asked for: "An Acme API token, from Settings → API." */
|
|
36
48
|
asks: line(300),
|
|
49
|
+
/** Left out when the CLI signs in only at a terminal, so the manifest of every other CLI stays as it was. */
|
|
50
|
+
methods: v.optional(v.pipe(v.array(signInMethodSchema), v.minLength(1))),
|
|
37
51
|
});
|
|
38
52
|
/** Exactly the keys of a Desktop catalog entry that the tool itself knows; `null` when unused. */
|
|
39
53
|
const desktopSchema = v.strictObject({
|
|
@@ -199,6 +213,23 @@ export const buildManifest = ({ identity, commands, pkg, skills }) => {
|
|
|
199
213
|
},
|
|
200
214
|
}
|
|
201
215
|
: {};
|
|
216
|
+
const methods = identity.signIn?.methods;
|
|
217
|
+
for (const method of methods ?? []) {
|
|
218
|
+
const [first, ...rest] = method.words;
|
|
219
|
+
if (first !== "{profile}" || !profiles)
|
|
220
|
+
throw new ManifestError([
|
|
221
|
+
`signIn method ${method.id}: Desktop signs in a profile, so its words start with {profile}`,
|
|
222
|
+
]);
|
|
223
|
+
// Arguments may follow the command (`session start qr`), so any leading run of words that is a command will do.
|
|
224
|
+
const runsAt = (end) => {
|
|
225
|
+
const command = at.get(rest.slice(0, end + 1).join(" "));
|
|
226
|
+
return command !== undefined && (command.commands.length === 0 || command.runnable === true);
|
|
227
|
+
};
|
|
228
|
+
if (!rest.some((_, end) => runsAt(end)))
|
|
229
|
+
throw new ManifestError([`signIn method ${method.id}: \`${rest.join(" ")}\` names no command of this CLI`]);
|
|
230
|
+
if (rest.some((word) => word.includes("{")))
|
|
231
|
+
throw new ManifestError([`signIn method ${method.id}: {profile} is the only slot Desktop fills in a sign-in`]);
|
|
232
|
+
}
|
|
202
233
|
const twice = identity.hosts?.filter((host, index) => identity.hosts?.indexOf(host) !== index) ?? [];
|
|
203
234
|
if (twice.length > 0)
|
|
204
235
|
throw new ManifestError(twice.map((host) => `hosts: ${host} is listed twice`));
|
|
@@ -257,7 +288,9 @@ export const buildManifest = ({ identity, commands, pkg, skills }) => {
|
|
|
257
288
|
: null,
|
|
258
289
|
search: null,
|
|
259
290
|
setup: setupPath ? [...profile, ...setupPath.split(" ")] : null,
|
|
260
|
-
signIn: identity.signIn
|
|
291
|
+
signIn: identity.signIn
|
|
292
|
+
? { gives: identity.signIn.gives, asks: identity.signIn.asks, ...(methods ? { methods } : {}) }
|
|
293
|
+
: null,
|
|
261
294
|
skill: skills && has("skill status", "skill install", "skill show")
|
|
262
295
|
? {
|
|
263
296
|
status: ["skill", "status", "--no-record", "--json"],
|
package/docs/standards/README.md
CHANGED
|
@@ -39,7 +39,7 @@ the four steps that need a person. A new CLI is ready for its first release when
|
|
|
39
39
|
| [Store](store.md) | `STORE` | 14 | Store areas, account scope, migrations, test isolation |
|
|
40
40
|
| [Data model](data-model.md) | `DATA` | 9 | Core entities, entities and source records, `external_id`, field names, links and duplicates, files, calendar entries |
|
|
41
41
|
| [Testing](testing.md) | `TEST` | 19 | Sandbox, no network, no real waits, one test time limit, leak tests, coverage, contracts, test matrix, parity, fakes as strict as the service |
|
|
42
|
-
| [Security](security.md) | `SECR` |
|
|
42
|
+
| [Security](security.md) | `SECR` | 25 | Secrets, logs, keyring, argv, error text, untrusted text, scanners, workflow hardening, reporting, OAuth sign-in and which app it uses, a provider token the owner pastes, meeting secrets, keyring in moved-folder runs |
|
|
43
43
|
| [Documents](docs.md) | `DOC` | 24 | User pages and developer pages, generated pages, current facts, changelog, repository page |
|
|
44
44
|
| [Comparisons](comparisons.md) | `CMP` | 11 | Which tools a comparison page lists, rows as user tasks, agents and safety, where others are better, proof of marks |
|
|
45
45
|
| [Releases](releases.md) | `REL` | 16 | `bin/release`, the release lock, versions, the owner's yes, trusted publishing |
|
|
@@ -100,7 +100,12 @@ cli-core's entities, and the adapter behind cli-core's ports. CRM is the first d
|
|
|
100
100
|
Telegram's app registration, or gcal's generated `api` commands. Known gap, as of 2026-11-08: b24's `people`,
|
|
101
101
|
`organizations`, `products` and `users` are still its own commands, read live, with its own `people` and
|
|
102
102
|
`organizations` writes; they move to cli-core's when it has them. Deals, leads, pipelines, stages and `sync` are
|
|
103
|
-
cli-core's.
|
|
103
|
+
cli-core's. Known gap, as of 2026-11-17: cli-core has no shared files domain yet, so the live `files` group that
|
|
104
|
+
reads and changes the provider's files is hand-written in each file-storage CLI: drive's `files list`, `get`,
|
|
105
|
+
`copy`, `move`, `update`, `mkdir` and `upload` (`src/commands/remote.ts`), and ydisk's `files list`, `download`,
|
|
106
|
+
`upload`, `copy`, `move`, `delete` and `restore` (`src/commands/files.ts`). Their paths, flags and output may differ
|
|
107
|
+
until the group moves to cli-core; a third file-storage CLI waits for it or copies the nearer of the two, not a
|
|
108
|
+
third shape.
|
|
104
109
|
- **Applies to:** messenger CLIs (tg, max, wa), calendar CLIs (gcal) and CRM CLIs (b24). **Since:** cli-base 0.41.0
|
|
105
110
|
(CRM, and the shared domain built first: cli-base 0.80.1). **Rulings:** NEED-820, NEED-440, NEED-301, NEED-444,
|
|
106
111
|
NEED-2298.
|
package/docs/standards/ci.md
CHANGED
|
@@ -184,6 +184,7 @@ its prompt in cli-template says so from cli-template 0.8.0. A CLI on an older te
|
|
|
184
184
|
| 02:55 | amo-cli |
|
|
185
185
|
| 02:59 | max-cli |
|
|
186
186
|
| 03:02 | cli-template |
|
|
187
|
+
| 03:04 | ydisk-cli |
|
|
187
188
|
| 03:06 | tg-cli |
|
|
188
189
|
| 03:09 | beeline-cli |
|
|
189
190
|
| 03:11 | hubspot-cli |
|
|
@@ -390,7 +390,11 @@ file shipped, `--wcat-describe` answers format 2: the format-1 keys with `"wcat_
|
|
|
390
390
|
and `manifest_sha256` of its bytes. Without it the answer stays format 1.
|
|
391
391
|
|
|
392
392
|
A new CLI joins from its first release: that release installs `wcat-<name>` (a `"bin"` key) and its bin calls
|
|
393
|
-
`wcatStart` first, so it answers `--wcat-describe`.
|
|
393
|
+
`wcatStart` first, so it answers `--wcat-describe`. That key is all the rule requires of the name. The short name
|
|
394
|
+
beside it, the command word people type (`ydisk`, `gcal`), is fine and is what WireCat CLIs do: the template writes
|
|
395
|
+
both keys, and tg, max, wa, zm, b24, gcal, drive, notion, memo, mail, pbx and ydisk each install `<name>` and
|
|
396
|
+
`wcat-<name>` from the same file. The short word is lower-case letters, digits and `-`, and a CLI outside WireCat
|
|
397
|
+
does not take a reserved one.
|
|
394
398
|
|
|
395
399
|
- **Why:** `wcat <name>` runs any `wcat-<name>` program on PATH, and `wcat --help` lists each one with what it says
|
|
396
400
|
about itself. A name WireCat reserves would be taken over by WireCat's own tool or by a `wcat` command. WireCat
|
|
@@ -406,9 +410,10 @@ A new CLI joins from its first release: that release installs `wcat-<name>` (a `
|
|
|
406
410
|
answer `--wcat-describe`. `cli-dev manifest --program dist/program.js --identity dist/wcat.js --check` fails when
|
|
407
411
|
`contracts/wirecat.json` is stale. `cli-dev release-pr` fails the pull request that raises the version from `0.0.0`,
|
|
408
412
|
the version `new` writes, when `package.json` has no `wcat-` `"bin"` key.
|
|
409
|
-
- **Exceptions:**
|
|
410
|
-
|
|
411
|
-
|
|
413
|
+
- **Exceptions:** `cli-dev lint` warns about every `"bin"` key without the prefix, the short name beside `wcat-<name>`
|
|
414
|
+
included. A CLI that keeps the short name says why in `lint/overrides.json` (`"rule": "wcat-bin-name"`, the target
|
|
415
|
+
as the warning prints it), which silences the warning and counts against the budget; gcal, pbx and beeline do,
|
|
416
|
+
and the other CLIs carry the warning. Either is allowed: the warning is not a failure.
|
|
412
417
|
An override covers the short name only, never a CLI with no `wcat-<name>`: `cli-dev release-pr` does not read
|
|
413
418
|
`lint/overrides.json`.
|
|
414
419
|
A WireCat CLI listed in Desktop's own catalog needs no manifest until Desktop reads one for it.
|
|
@@ -186,13 +186,17 @@ the coverage page after a spec sync.
|
|
|
186
186
|
|
|
187
187
|
### Limits
|
|
188
188
|
|
|
189
|
-
- **
|
|
190
|
-
`
|
|
191
|
-
`
|
|
189
|
+
- **cli-core checks the permission keys; the CLI still shows them.** From cli-core 0.684.0, `serviceApiCommand`
|
|
190
|
+
reads each operation's `permissions`, `servers` and `securitySchemes`: it sends the call to the operation's server
|
|
191
|
+
with the sign-in its scheme names, and checks `api.<operation>` and each manifest key that applies to the call
|
|
192
|
+
(`files.delete` when `permanently` is true) before it sends. That guard runs whatever the CLI declares. `--dry-run`
|
|
193
|
+
and permission discovery show those keys only when the CLI merges `serviceApiPermissions(...)` into its own
|
|
194
|
+
`commandPermissions`, field by field (`extra`, `alsoChecks`, `defaults`), as ydisk's `src/config.ts` does:
|
|
195
|
+
`alsoChecks: (path) => [...api.alsoChecks(path), ...own(path)]`.
|
|
192
196
|
- A merge joins every source's servers at the top, for every operation; sources on different hosts need a
|
|
193
197
|
`servers` entry per path, which the merge does not write.
|
|
194
198
|
- Pagination is found only from the names above; a service with its own names needs an override per operation.
|
|
195
|
-
|
|
199
|
+
`serviceApiCommand` gives a read that pages `--all`, which reads every page.
|
|
196
200
|
- Pagination is not found in an answer that is a union.
|
|
197
201
|
- The fake checks shapes, not behaviour: it does not page, filter or keep state. A scenario that needs that writes
|
|
198
202
|
it in `answers`. It checks neither header parameters nor RPC operations. A sample follows enums and limits but not
|
package/docs/standards/mcp.md
CHANGED
|
@@ -153,6 +153,24 @@ profile by default. The server opens one messenger connection for each profile i
|
|
|
153
153
|
profile shares it. When it serves more than one profile, each call names its profile; a call without one is refused
|
|
154
154
|
and lists the profiles served. Each call follows its own profile's permissions.
|
|
155
155
|
|
|
156
|
+
**The MCP Registry entry.** A `server.json` starts the server the same way: it passes `mcp serve` and a
|
|
157
|
+
`--profiles` that the person installing it fills in. That argument is `"type": "named"`, `"isRequired": true`, with
|
|
158
|
+
a `"placeholder"` such as `personal` and no `"value"`, so the client asks which profiles to serve. A fixed
|
|
159
|
+
`"value": "all"` is the default this rule forbids: every client installed from the registry would reach every
|
|
160
|
+
account on the computer. The person may still type `all`. memo, which has no profiles, passes `mcp serve` alone.
|
|
161
|
+
The two `version` fields in `server.json`, the server's and its package's, are not kept by hand: `release.yml` sets
|
|
162
|
+
both to the version it publishes, then runs `mcp-publisher validate`, so a new CLI leaves them at `0.0.0`.
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"type": "named",
|
|
167
|
+
"name": "--profiles",
|
|
168
|
+
"description": "The profiles this server serves: one name, a comma-separated list such as work,personal, or all for every profile on this computer",
|
|
169
|
+
"isRequired": true,
|
|
170
|
+
"placeholder": "personal"
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
156
174
|
- **Why:** which accounts an agent can reach is the owner's choice, written in the agent's config. A connection per
|
|
157
175
|
call would break the messenger's pace limits and look unlike the official client.
|
|
158
176
|
- **Enforced by:** review only.
|
|
@@ -164,7 +182,8 @@ and lists the profiles served. Each call follows its own profile's permissions.
|
|
|
164
182
|
it reads other CLIs' stores and selects their accounts with `--source email:<name>` or `--account telegram:1`
|
|
165
183
|
([cli-base#390](https://github.com/WireCatLabs/cli-base/issues/390), owner decision 2026-10-31). The audit declares
|
|
166
184
|
this once, as a difference of memo, not of the other CLIs.
|
|
167
|
-
- **Applies to:** messenger CLIs
|
|
185
|
+
- **Applies to:** messenger CLIs; the MCP Registry entry above, every CLI that ships a `server.json`. **Since:**
|
|
186
|
+
cli-base 0.41.0; the registry entry since cli-base 0.117.0. **Rulings:** NEED-1881.
|
|
168
187
|
|
|
169
188
|
### WC-MCP-10 · A tool and its command give the same answer and the same error
|
|
170
189
|
|
|
@@ -161,11 +161,22 @@ installing that command; nothing else is registered anywhere.
|
|
|
161
161
|
[WC-CI-9](ci.md#wc-ci-9--run-full-validation-and-release-security-on-the-first-day-of-each-month-without-publishing)
|
|
162
162
|
and off the hour; a CLI outside WireCatLabs gets one between 04:01 and 05:59 UTC, after that window. Nothing to
|
|
163
163
|
change by hand.
|
|
164
|
-
4. **WireCat CLIs only: join the shared lists.**
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
4. **WireCat CLIs only: join the shared lists.** Each list below names every WireCat CLI by hand, and nothing adds a
|
|
165
|
+
new one by itself. `new` prints the entries for the first three, ready to paste; add the others the same way.
|
|
166
|
+
|
|
167
|
+
| Where | The entry | When |
|
|
168
|
+
|---|---|---|
|
|
169
|
+
| cli-base `docs/standards/ci.md`, the table under [WC-CI-9](ci.md#wc-ci-9--run-full-validation-and-release-security-on-the-first-day-of-each-month-without-publishing) | the monthly cron minute `new` picked, and the repository | before the first release |
|
|
170
|
+
| cli-core `src/ports/wirecat-tools.ts`, `WIRECAT_TOOLS` | the command, `appName`, `envPrefix`, package and what it does | before the first release |
|
|
171
|
+
| cli-docs `tools.json` | the command, repository, package, language, summaries and `docsRef` | after the first release, since `docsRef` is its tag |
|
|
172
|
+
| cli-base `src/standards/audit.ts`, `PARITY_GROUPS` | the command in `all` when its tree matches the messengers' and memo's, else in `shared-roots`, which compares only the root commands every CLI shares (ydisk, notion, the CRM CLIs); and in its category's group where one exists (`crm`) | before the first release |
|
|
173
|
+
| cli-base `src/dev/family.ts`, `PACKAGES` | the command and its npm package, so `cli-dev audit --family` installs it for its neighbours | after the first release, since the audit installs it from npm |
|
|
174
|
+
|
|
175
|
+
The cli-base entries due before the first release go in one pull request. A command in `FIRST_PARTY_TOOLS`
|
|
176
|
+
(`src/wcat/names.ts`) reaches `PACKAGES` from there, and that list also reserves the name (`RESERVED_NAMES`) and
|
|
177
|
+
makes `wcat --help` offer to install it; add a CLI there only when `wcat` should offer it. A messenger also joins
|
|
178
|
+
cli-core's `parity.json`. A CLI outside WireCatLabs joins none of these: it keeps its parity groups in its own
|
|
179
|
+
repository and runs `cli-dev audit --groups <file>`. See [Testing](testing.md).
|
|
169
180
|
|
|
170
181
|
`cli-dev repo-check --cli <name>` checks steps 1, 3 and 4 on every pull request of a CLI made from cli-template
|
|
171
182
|
(`ci.yml:repo-setup`): the ruleset's four rules on `main` and the required checks of step 1 (`conformance` only where
|
|
@@ -321,7 +321,8 @@ store and runs no search. A CLI declares its provider and may replace any step.
|
|
|
321
321
|
- **Example:** new keyring entries are named `oauth:<provider>:<profile>`. drive's and zm's entries from before the
|
|
322
322
|
module are read and refreshed in the shape they were stored in, so nobody signs in again.
|
|
323
323
|
- **Exceptions:** a CLI that replaces a step still keeps the explicit profile, the lock, and tokens that are never
|
|
324
|
-
printed. A CLI that signs in another way (a bot token, a session) does not use the module
|
|
324
|
+
printed. A CLI that signs in another way (a bot token, a session) does not use the module; a provider token the
|
|
325
|
+
owner pastes follows [WC-SECR-26](#wc-secr-26--a-provider-token-the-owner-pastes-is-read-hidden-checked-with-the-service-then-kept-in-the-keyring).
|
|
325
326
|
- **Applies to:** every CLI that signs in with OAuth. **Since:** cli-base 0.57.1. **Rulings:** NEED-1734.
|
|
326
327
|
|
|
327
328
|
### WC-SECR-23 · Meeting passcodes and the query of a join link never reach the store, the output or an agent
|
|
@@ -418,6 +419,46 @@ cli-core's layer for Google and Microsoft, a tool's own layer for a provider onl
|
|
|
418
419
|
- **Applies to:** every CLI that signs in with OAuth, and wirecat-desktop. **Since:** cli-base 0.76.1.
|
|
419
420
|
**Rulings:** owner, 2026-11-04.
|
|
420
421
|
|
|
422
|
+
### WC-SECR-26 · A provider token the owner pastes is read hidden, checked with the service, then kept in the keyring
|
|
423
|
+
|
|
424
|
+
Some providers hand the owner a token to copy instead of a sign-in the CLI can run itself: Yandex shows an OAuth token
|
|
425
|
+
in the browser ([Yandex ID's guide](https://yandex.ru/dev/id/doc/en/tokens/debug-token)), and an API key page does
|
|
426
|
+
the same. `session start` takes such a token, and the CLI keeps it the way it keeps any other secret.
|
|
427
|
+
|
|
428
|
+
- **Read:** with cli-core's `readSecret`, typed at a terminal without echo or read as one line from stdin. Never as an
|
|
429
|
+
argument ([WC-SECR-5](#wc-secr-5--a-secret-is-never-taken-on-the-command-line)). `<TOOL>_TOKEN` in the environment
|
|
430
|
+
is read for CI ([WC-SECR-4](#wc-secr-4--secrets-come-from-the-environment-then-the-os-keyring-then-a-private-file)),
|
|
431
|
+
never written there and never printed, not in an answer, an error or a `--dry-run`.
|
|
432
|
+
- **Checked before it is kept:** `session start` asks the service whose token it is, and keeps the token only when the
|
|
433
|
+
service accepts it. The answer says `verified: true`, the user and where the token went (`stored_in`), never the
|
|
434
|
+
token.
|
|
435
|
+
- **Stored:** with cli-core's `ProfileTokenStore`, as `token:<profile>` under the CLI's app name: the keyring, a
|
|
436
|
+
`0600` file when no keyring works, and a temporary entry in a run with moved folders
|
|
437
|
+
([WC-SECR-24](#wc-secr-24--a-run-with-moved-folders-shares-the-owners-keyring-entry-and-never-deletes-it)).
|
|
438
|
+
- **Checked later:** `session status` says where the token comes from (the environment, the keyring or a file);
|
|
439
|
+
`session status --check` and `doctor --online` ask the service whose token it is.
|
|
440
|
+
- **Revoked:** `session end` forgets the token on this computer. When the provider has a call that revokes such a
|
|
441
|
+
token, `session end` makes it first; when it has none, `session end` and the CLI's docs say that the token stays
|
|
442
|
+
valid at the provider and where the owner revokes it there.
|
|
443
|
+
- **The app.** The CLI runs no OAuth flow, so [WC-SECR-25](#wc-secr-25--sign-in-with-wirecats-app-by-default-and-let-the-owner-choose-their-own)'s
|
|
444
|
+
order does not apply to it. The docs name the app the token is issued for: WireCat's when there is one, or the
|
|
445
|
+
steps to register the owner's own, with the narrowest access the commands need.
|
|
446
|
+
|
|
447
|
+
- **Why:** a pasted token opens the account like a password. Shell history, a process list or a log line would keep
|
|
448
|
+
it where other programs and people can read it, and a token kept before the service accepted it breaks the next
|
|
449
|
+
command with a confusing error.
|
|
450
|
+
- **Enforced by:** review only, check planned: a cli-core test that session start refuses a token given as an
|
|
451
|
+
argument and keeps none the service refused.
|
|
452
|
+
- **Example:** `ydisk personal session start` asks `Yandex Disk OAuth token:` without echo, or reads
|
|
453
|
+
`ydisk personal session start < token.txt`, asks the Disk whose token it is, and answers
|
|
454
|
+
`{ "profile": "personal", "state": "saved", "stored_in": "keyring", "verified": true, "user": { … } }`.
|
|
455
|
+
- **Exceptions:** a sign-in the CLI runs itself follows
|
|
456
|
+
[WC-SECR-22](#wc-secr-22--sign-in-with-oauth-through-cli-cores-sign-in-module). A bot token keeps its own entry,
|
|
457
|
+
`bot:<profile>` (WC-SECR-4). Known gap, as of 2026-11-17: ydisk's `session end` forgets the token and says it stays
|
|
458
|
+
valid at Yandex, but its docs do not yet say where to revoke it.
|
|
459
|
+
- **Applies to:** every CLI whose sign-in takes a token the owner pastes (ydisk today). **Since:** cli-base 0.117.0.
|
|
460
|
+
**Rulings:** none.
|
|
461
|
+
|
|
421
462
|
## Sources
|
|
422
463
|
|
|
423
464
|
These documents explain the rules on this page in more detail. Where one of them disagrees with this page, this page
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.117.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",
|