@wirecat/cli-base 1.0.0 → 1.2.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 +92 -0
- package/dist/codegen/graphql.js +37 -1
- package/dist/dev/adopt.d.ts +2 -1
- package/dist/dev/adopt.js +7 -1
- package/dist/dev/audit.js +6 -3
- package/dist/dev/bundle.d.ts +22 -0
- package/dist/dev/bundle.js +20 -5
- package/dist/dev/core-override.d.ts +15 -0
- package/dist/dev/core-override.js +70 -0
- package/dist/dev/index.d.ts +2 -0
- package/dist/dev/index.js +2 -0
- package/dist/dev/lint.d.ts +16 -0
- package/dist/dev/lint.js +48 -5
- package/dist/dev/main.js +16 -18
- package/dist/dev/version-command.d.ts +8 -0
- package/dist/dev/version-command.js +29 -0
- package/dist/standards/audit.js +9 -6
- package/dist/standards/lint.js +6 -0
- package/dist/wcat/manifest.d.ts +120 -2
- package/dist/wcat/manifest.js +84 -7
- package/docs/standards/README.md +2 -2
- package/docs/standards/accounts.md +9 -11
- package/docs/standards/architecture.md +2 -1
- package/docs/standards/ci.md +11 -5
- package/docs/standards/commands.md +35 -2
- package/docs/standards/kit-surface.md +3 -3
- package/docs/standards/new-cli.md +3 -2
- package/docs/standards/toolchain.md +25 -1
- package/package.json +5 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { parseArgs } from "node:util";
|
|
2
|
+
import { versionScript } from "../release/index.js";
|
|
3
|
+
import { coreOverrideCheck } from "./core-override.js";
|
|
4
|
+
/** `cli-dev version`: the version in package.json against src/version.ts, then the cli-core override (WC-TOOL-21). */
|
|
5
|
+
export const versionCommand = (args, io) => {
|
|
6
|
+
const { values } = parseArgs({
|
|
7
|
+
args,
|
|
8
|
+
options: {
|
|
9
|
+
sync: { type: "boolean", default: false },
|
|
10
|
+
file: { type: "string", default: "src/version.ts" },
|
|
11
|
+
"cli-core-only": { type: "boolean", default: false },
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
let code = 0;
|
|
15
|
+
if (!values["cli-core-only"]) {
|
|
16
|
+
const version = versionScript(io.cwd, values.sync ? ["--sync"] : [], values.file);
|
|
17
|
+
code = version.code;
|
|
18
|
+
if (code === 0)
|
|
19
|
+
io.out(version.message);
|
|
20
|
+
else
|
|
21
|
+
io.err(version.message);
|
|
22
|
+
}
|
|
23
|
+
const { problems, notes } = coreOverrideCheck(io.cwd);
|
|
24
|
+
for (const note of notes)
|
|
25
|
+
io.out(note);
|
|
26
|
+
for (const problem of problems)
|
|
27
|
+
io.err(problem);
|
|
28
|
+
return code !== 0 ? code : problems.length > 0 ? 1 : 0;
|
|
29
|
+
};
|
package/dist/standards/audit.js
CHANGED
|
@@ -168,7 +168,7 @@ export const PARITY_GROUPS = defineParityGroups([
|
|
|
168
168
|
},
|
|
169
169
|
{
|
|
170
170
|
name: "all",
|
|
171
|
-
members: ["tg", "max", "memo", "
|
|
171
|
+
members: ["tg", "max", "memo", "zm", "wa"],
|
|
172
172
|
covers: ["commands", "doctor", "skill", "mcp", "upgrade", "search", "notes", "meetings"],
|
|
173
173
|
differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP],
|
|
174
174
|
},
|
|
@@ -177,7 +177,7 @@ export const PARITY_GROUPS = defineParityGroups([
|
|
|
177
177
|
// and moves back into "all" once its search is aligned with the messengers' or renamed.
|
|
178
178
|
{
|
|
179
179
|
name: "mail-shared",
|
|
180
|
-
members: ["tg", "max", "memo", "
|
|
180
|
+
members: ["tg", "max", "memo", "zm", "wa", "mail"],
|
|
181
181
|
covers: ["commands", "doctor", "skill", "mcp", "upgrade", "notes", "meetings"],
|
|
182
182
|
differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP],
|
|
183
183
|
},
|
|
@@ -185,7 +185,7 @@ export const PARITY_GROUPS = defineParityGroups([
|
|
|
185
185
|
// CLIs agree there (https://github.com/WireCatLabs/cli-base/issues/390), then gcal moves back into "all".
|
|
186
186
|
{
|
|
187
187
|
name: "gcal-shared",
|
|
188
|
-
members: ["tg", "max", "memo", "
|
|
188
|
+
members: ["tg", "max", "memo", "zm", "wa", "gcal"],
|
|
189
189
|
covers: ["commands", "upgrade", "notes", "meetings"],
|
|
190
190
|
differences: FAMILY_SINCE_0_98,
|
|
191
191
|
},
|
|
@@ -194,9 +194,12 @@ export const PARITY_GROUPS = defineParityGroups([
|
|
|
194
194
|
// amo-cli, hubspot-cli and attio-cli share them too, and their CRM commands are compared with b24 in `crm` below.
|
|
195
195
|
// wordpress-cli shares only these roots: it is the first content CLI, so its posts commands have no group yet.
|
|
196
196
|
// linear-cli shares only these roots too: it is the first tracker CLI, so its issues commands have no group yet.
|
|
197
|
-
//
|
|
198
|
-
//
|
|
199
|
-
//
|
|
197
|
+
// drive and ydisk are compared here only, not in "all", "mail-shared" or "gcal-shared": their notes and search are
|
|
198
|
+
// cli-core's documents commands. A note about one imported document is not memo's note of your own, and a search over
|
|
199
|
+
// imported documents is not the messengers' archive search, so the two differ on purpose (21 paths for drive against
|
|
200
|
+
// memo and the messengers, measured on the published CLIs 2026-11-26; one difference each would be over the budget of 10).
|
|
201
|
+
// notion-cli joins here until its documents commands ship. A documents group of drive, notion and ydisk differs in
|
|
202
|
+
// 39 paths (session, folders browse, summaries; measured on the published CLIs 2026-11-17).
|
|
200
203
|
{
|
|
201
204
|
name: "shared-roots",
|
|
202
205
|
members: [
|
package/dist/standards/lint.js
CHANGED
|
@@ -140,6 +140,12 @@ export const LINT_RULES = defineLintRules([
|
|
|
140
140
|
scope: "type",
|
|
141
141
|
summary: "a list or search in the published TypeScript API returns `{ items, hasMore, nextOffset?, total? }`: no bare array, no `hits` or `has_more`",
|
|
142
142
|
},
|
|
143
|
+
{
|
|
144
|
+
id: "reserved-shared-command",
|
|
145
|
+
severity: "high",
|
|
146
|
+
scope: "command",
|
|
147
|
+
summary: "`session start|status|end|list`, `doctor`, `mcp`, `account remove`, `mirrors` and `complete` are cli-core's shared commands, never built by the CLI",
|
|
148
|
+
},
|
|
143
149
|
]);
|
|
144
150
|
/**
|
|
145
151
|
* `lint/baseline/<rule-id>.json`: today's violations of one rule, by target. It may only shrink.
|
package/dist/wcat/manifest.d.ts
CHANGED
|
@@ -45,6 +45,19 @@ declare const signInSchema: v.StrictObjectSchema<{
|
|
|
45
45
|
readonly stdin: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
46
46
|
readonly site: v.OptionalSchema<v.LiteralSchema<"--site", undefined>, undefined>;
|
|
47
47
|
readonly login: v.OptionalSchema<v.LiteralSchema<"--login", undefined>, undefined>;
|
|
48
|
+
/** The flag that takes a new profile's mail address. */
|
|
49
|
+
readonly address: v.OptionalSchema<v.LiteralSchema<"--address", undefined>, undefined>;
|
|
50
|
+
/** The variable the CLI reads an app password or token from: a flag would show it in the process list. */
|
|
51
|
+
readonly password: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "an upper-case variable name">]>, undefined>;
|
|
52
|
+
/** The flag that takes the person's own OAuth client file, which Desktop writes to a private file for the run. */
|
|
53
|
+
readonly clientFile: v.OptionalSchema<v.LiteralSchema<"--client-file", undefined>, undefined>;
|
|
54
|
+
/** The setting that names the person's own OAuth app, saved before the run: `microsoft_client_id`. */
|
|
55
|
+
readonly clientId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a snake_case setting name">]>, undefined>;
|
|
56
|
+
/** The words that make a new profile sign in in the browser with the CLI's own app: `["--method", "oauth"]`. */
|
|
57
|
+
readonly oauth: v.OptionalSchema<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>]>, undefined>;
|
|
58
|
+
/** The flags for a local application: the portal it signs in to and its id. Its key goes on stdin. */
|
|
59
|
+
readonly portal: v.OptionalSchema<v.LiteralSchema<"--portal", undefined>, undefined>;
|
|
60
|
+
readonly appId: v.OptionalSchema<v.LiteralSchema<"--client-id", undefined>, undefined>;
|
|
48
61
|
}, undefined>, undefined>, v.MinLengthAction<{
|
|
49
62
|
id: string;
|
|
50
63
|
label: string;
|
|
@@ -52,9 +65,25 @@ declare const signInSchema: v.StrictObjectSchema<{
|
|
|
52
65
|
stdin?: boolean | undefined;
|
|
53
66
|
site?: "--site" | undefined;
|
|
54
67
|
login?: "--login" | undefined;
|
|
68
|
+
address?: "--address" | undefined;
|
|
69
|
+
password?: string | undefined;
|
|
70
|
+
clientFile?: "--client-file" | undefined;
|
|
71
|
+
clientId?: string | undefined;
|
|
72
|
+
oauth?: string[] | undefined;
|
|
73
|
+
portal?: "--portal" | undefined;
|
|
74
|
+
appId?: "--client-id" | undefined;
|
|
55
75
|
}[], 1, undefined>]>, undefined>;
|
|
56
76
|
}, undefined>;
|
|
57
77
|
export type SignIn = v.InferOutput<typeof signInSchema>;
|
|
78
|
+
declare const scheduleSchema: v.StrictObjectSchema<{
|
|
79
|
+
/** The interval a new timer starts with; one of `choices`. */
|
|
80
|
+
readonly every: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "minutes or hours: 15m, 1h">]>;
|
|
81
|
+
/** The intervals Desktop offers. */
|
|
82
|
+
readonly choices: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "minutes or hours: 15m, 1h">]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
|
83
|
+
/** The command the timer runs, without the profile: the schedule's environment names it. */
|
|
84
|
+
readonly args: 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>]>;
|
|
85
|
+
}, undefined>;
|
|
86
|
+
export type SyncSchedule = v.InferOutput<typeof scheduleSchema>;
|
|
58
87
|
/** Exactly the keys of a Desktop catalog entry that the tool itself knows; `null` when unused. */
|
|
59
88
|
declare const desktopSchema: v.StrictObjectSchema<{
|
|
60
89
|
readonly tagline: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "one line of text">, v.MaxLengthAction<string, number, undefined>]>;
|
|
@@ -84,6 +113,19 @@ declare const desktopSchema: v.StrictObjectSchema<{
|
|
|
84
113
|
readonly stdin: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
85
114
|
readonly site: v.OptionalSchema<v.LiteralSchema<"--site", undefined>, undefined>;
|
|
86
115
|
readonly login: v.OptionalSchema<v.LiteralSchema<"--login", undefined>, undefined>;
|
|
116
|
+
/** The flag that takes a new profile's mail address. */
|
|
117
|
+
readonly address: v.OptionalSchema<v.LiteralSchema<"--address", undefined>, undefined>;
|
|
118
|
+
/** The variable the CLI reads an app password or token from: a flag would show it in the process list. */
|
|
119
|
+
readonly password: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "an upper-case variable name">]>, undefined>;
|
|
120
|
+
/** The flag that takes the person's own OAuth client file, which Desktop writes to a private file for the run. */
|
|
121
|
+
readonly clientFile: v.OptionalSchema<v.LiteralSchema<"--client-file", undefined>, undefined>;
|
|
122
|
+
/** The setting that names the person's own OAuth app, saved before the run: `microsoft_client_id`. */
|
|
123
|
+
readonly clientId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a snake_case setting name">]>, undefined>;
|
|
124
|
+
/** The words that make a new profile sign in in the browser with the CLI's own app: `["--method", "oauth"]`. */
|
|
125
|
+
readonly oauth: v.OptionalSchema<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>]>, undefined>;
|
|
126
|
+
/** The flags for a local application: the portal it signs in to and its id. Its key goes on stdin. */
|
|
127
|
+
readonly portal: v.OptionalSchema<v.LiteralSchema<"--portal", undefined>, undefined>;
|
|
128
|
+
readonly appId: v.OptionalSchema<v.LiteralSchema<"--client-id", undefined>, undefined>;
|
|
87
129
|
}, undefined>, undefined>, v.MinLengthAction<{
|
|
88
130
|
id: string;
|
|
89
131
|
label: string;
|
|
@@ -91,6 +133,13 @@ declare const desktopSchema: v.StrictObjectSchema<{
|
|
|
91
133
|
stdin?: boolean | undefined;
|
|
92
134
|
site?: "--site" | undefined;
|
|
93
135
|
login?: "--login" | undefined;
|
|
136
|
+
address?: "--address" | undefined;
|
|
137
|
+
password?: string | undefined;
|
|
138
|
+
clientFile?: "--client-file" | undefined;
|
|
139
|
+
clientId?: string | undefined;
|
|
140
|
+
oauth?: string[] | undefined;
|
|
141
|
+
portal?: "--portal" | undefined;
|
|
142
|
+
appId?: "--client-id" | undefined;
|
|
94
143
|
}[], 1, undefined>]>, undefined>;
|
|
95
144
|
/**
|
|
96
145
|
* Desktop asks `setup show` only from this version on. The manifest ships inside the version it describes, so that
|
|
@@ -103,8 +152,13 @@ declare const desktopSchema: v.StrictObjectSchema<{
|
|
|
103
152
|
readonly install: 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>]>;
|
|
104
153
|
readonly show: 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>]>;
|
|
105
154
|
}, undefined>, undefined>;
|
|
106
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* `port` is a WireCat tool's fixed port, from the identity's `mcpPort`. Desktop gives any other tool a free port of
|
|
157
|
+
* its own and fills `{port}`. Left out, not `null`, without `mcpPort`, so the manifest of every other CLI stays as it
|
|
158
|
+
* was.
|
|
159
|
+
*/
|
|
107
160
|
readonly mcpServer: v.NullableSchema<v.StrictObjectSchema<{
|
|
161
|
+
readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1024, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
|
|
108
162
|
readonly start: 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>]>;
|
|
109
163
|
readonly stop: 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>]>;
|
|
110
164
|
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>]>;
|
|
@@ -118,6 +172,15 @@ declare const desktopSchema: v.StrictObjectSchema<{
|
|
|
118
172
|
readonly lastShape: v.LiteralSchema<"runs", undefined>;
|
|
119
173
|
readonly what: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "one line of text">, v.MaxLengthAction<string, number, undefined>]>;
|
|
120
174
|
readonly note: v.NullSchema<undefined>;
|
|
175
|
+
/** Left out, not `null`, without the identity's `syncSchedule`, so the manifest of every other CLI stays as it was. */
|
|
176
|
+
readonly schedule: v.OptionalSchema<v.StrictObjectSchema<{
|
|
177
|
+
/** The interval a new timer starts with; one of `choices`. */
|
|
178
|
+
readonly every: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "minutes or hours: 15m, 1h">]>;
|
|
179
|
+
/** The intervals Desktop offers. */
|
|
180
|
+
readonly choices: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "minutes or hours: 15m, 1h">]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
|
181
|
+
/** The command the timer runs, without the profile: the schedule's environment names it. */
|
|
182
|
+
readonly args: 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>]>;
|
|
183
|
+
}, undefined>, undefined>;
|
|
121
184
|
}, undefined>, undefined>;
|
|
122
185
|
readonly storeInfo: v.NullSchema<undefined>;
|
|
123
186
|
readonly storeTables: v.NullSchema<undefined>;
|
|
@@ -219,6 +282,19 @@ export declare const manifestSchema: v.StrictObjectSchema<{
|
|
|
219
282
|
readonly stdin: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
220
283
|
readonly site: v.OptionalSchema<v.LiteralSchema<"--site", undefined>, undefined>;
|
|
221
284
|
readonly login: v.OptionalSchema<v.LiteralSchema<"--login", undefined>, undefined>;
|
|
285
|
+
/** The flag that takes a new profile's mail address. */
|
|
286
|
+
readonly address: v.OptionalSchema<v.LiteralSchema<"--address", undefined>, undefined>;
|
|
287
|
+
/** The variable the CLI reads an app password or token from: a flag would show it in the process list. */
|
|
288
|
+
readonly password: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "an upper-case variable name">]>, undefined>;
|
|
289
|
+
/** The flag that takes the person's own OAuth client file, which Desktop writes to a private file for the run. */
|
|
290
|
+
readonly clientFile: v.OptionalSchema<v.LiteralSchema<"--client-file", undefined>, undefined>;
|
|
291
|
+
/** The setting that names the person's own OAuth app, saved before the run: `microsoft_client_id`. */
|
|
292
|
+
readonly clientId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a snake_case setting name">]>, undefined>;
|
|
293
|
+
/** The words that make a new profile sign in in the browser with the CLI's own app: `["--method", "oauth"]`. */
|
|
294
|
+
readonly oauth: v.OptionalSchema<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>]>, undefined>;
|
|
295
|
+
/** The flags for a local application: the portal it signs in to and its id. Its key goes on stdin. */
|
|
296
|
+
readonly portal: v.OptionalSchema<v.LiteralSchema<"--portal", undefined>, undefined>;
|
|
297
|
+
readonly appId: v.OptionalSchema<v.LiteralSchema<"--client-id", undefined>, undefined>;
|
|
222
298
|
}, undefined>, undefined>, v.MinLengthAction<{
|
|
223
299
|
id: string;
|
|
224
300
|
label: string;
|
|
@@ -226,6 +302,13 @@ export declare const manifestSchema: v.StrictObjectSchema<{
|
|
|
226
302
|
stdin?: boolean | undefined;
|
|
227
303
|
site?: "--site" | undefined;
|
|
228
304
|
login?: "--login" | undefined;
|
|
305
|
+
address?: "--address" | undefined;
|
|
306
|
+
password?: string | undefined;
|
|
307
|
+
clientFile?: "--client-file" | undefined;
|
|
308
|
+
clientId?: string | undefined;
|
|
309
|
+
oauth?: string[] | undefined;
|
|
310
|
+
portal?: "--portal" | undefined;
|
|
311
|
+
appId?: "--client-id" | undefined;
|
|
229
312
|
}[], 1, undefined>]>, undefined>;
|
|
230
313
|
/**
|
|
231
314
|
* Desktop asks `setup show` only from this version on. The manifest ships inside the version it describes, so that
|
|
@@ -238,8 +321,13 @@ export declare const manifestSchema: v.StrictObjectSchema<{
|
|
|
238
321
|
readonly install: 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>]>;
|
|
239
322
|
readonly show: 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>]>;
|
|
240
323
|
}, undefined>, undefined>;
|
|
241
|
-
/**
|
|
324
|
+
/**
|
|
325
|
+
* `port` is a WireCat tool's fixed port, from the identity's `mcpPort`. Desktop gives any other tool a free port of
|
|
326
|
+
* its own and fills `{port}`. Left out, not `null`, without `mcpPort`, so the manifest of every other CLI stays as it
|
|
327
|
+
* was.
|
|
328
|
+
*/
|
|
242
329
|
readonly mcpServer: v.NullableSchema<v.StrictObjectSchema<{
|
|
330
|
+
readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1024, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
|
|
243
331
|
readonly start: 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>]>;
|
|
244
332
|
readonly stop: 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>]>;
|
|
245
333
|
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>]>;
|
|
@@ -253,6 +341,15 @@ export declare const manifestSchema: v.StrictObjectSchema<{
|
|
|
253
341
|
readonly lastShape: v.LiteralSchema<"runs", undefined>;
|
|
254
342
|
readonly what: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "one line of text">, v.MaxLengthAction<string, number, undefined>]>;
|
|
255
343
|
readonly note: v.NullSchema<undefined>;
|
|
344
|
+
/** Left out, not `null`, without the identity's `syncSchedule`, so the manifest of every other CLI stays as it was. */
|
|
345
|
+
readonly schedule: v.OptionalSchema<v.StrictObjectSchema<{
|
|
346
|
+
/** The interval a new timer starts with; one of `choices`. */
|
|
347
|
+
readonly every: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "minutes or hours: 15m, 1h">]>;
|
|
348
|
+
/** The intervals Desktop offers. */
|
|
349
|
+
readonly choices: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "minutes or hours: 15m, 1h">]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
|
350
|
+
/** The command the timer runs, without the profile: the schedule's environment names it. */
|
|
351
|
+
readonly args: 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>]>;
|
|
352
|
+
}, undefined>, undefined>;
|
|
256
353
|
}, undefined>, undefined>;
|
|
257
354
|
readonly storeInfo: v.NullSchema<undefined>;
|
|
258
355
|
readonly storeTables: v.NullSchema<undefined>;
|
|
@@ -316,6 +413,27 @@ export interface ManifestIdentity extends WcatTool {
|
|
|
316
413
|
* `meetings show` and `meetings transcript`; Desktop opens a client's call with them.
|
|
317
414
|
*/
|
|
318
415
|
meetingsProvider?: string;
|
|
416
|
+
/**
|
|
417
|
+
* The sync Desktop runs, when the CLI has no root `sync` and several `<noun> sync` commands: the command and its
|
|
418
|
+
* flags, without the profile: `["messages", "sync", "--all", "--timeout", "120m"]`. Without it such a CLI states no
|
|
419
|
+
* sync. Needs `syncs`.
|
|
420
|
+
*/
|
|
421
|
+
syncCommand?: readonly string[];
|
|
422
|
+
/**
|
|
423
|
+
* Desktop's timer for the sync, run through cli-core's `schedule command`: the interval a new timer starts with, the
|
|
424
|
+
* intervals it offers, and the command when it differs from the sync's own (`args`, without the profile).
|
|
425
|
+
*/
|
|
426
|
+
syncSchedule?: {
|
|
427
|
+
every: string;
|
|
428
|
+
choices: readonly string[];
|
|
429
|
+
args?: readonly string[];
|
|
430
|
+
};
|
|
431
|
+
/**
|
|
432
|
+
* The fixed port of the CLI's MCP server in WireCat Desktop: 8765. Only WireCat's own tools set it, each a port no
|
|
433
|
+
* other tool has; Desktop gives every other tool one of its own. Needs `mcp server start`, `stop`, `status` and
|
|
434
|
+
* `mcp revoke`.
|
|
435
|
+
*/
|
|
436
|
+
mcpPort?: number;
|
|
319
437
|
/**
|
|
320
438
|
* Every host the CLI contacts, as `hostFetch` checks them: `["api.acme.example", "*.cdn.acme.example"]`; `[]` for
|
|
321
439
|
* none. Written to the manifest as `network.hosts`.
|
package/dist/wcat/manifest.js
CHANGED
|
@@ -45,9 +45,10 @@ export const SYNC_QUERY = /^command:"[a-z0-9][a-z0-9-]*(?: [a-z0-9][a-z0-9-]*)+"
|
|
|
45
45
|
const lastWords = v.pipe(v.array(v.union([plainWord, v.pipe(v.string(), v.regex(SYNC_QUERY))])), v.minLength(1));
|
|
46
46
|
const line = (max) => v.pipe(v.string(), v.regex(/^\S(?:[^\n\r]*\S)?$/, "one line of text"), v.maxLength(max));
|
|
47
47
|
/**
|
|
48
|
-
* A sign-in Desktop runs in its own window
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* A sign-in Desktop runs in its own window: the words, whether the secret the person types is the command's whole
|
|
49
|
+
* stdin, and for cli-core's application password sign-in the flags that take the site and the user name Desktop asks
|
|
50
|
+
* for. The other flags and names say where Desktop passes what the person typed. Desktop takes them only from
|
|
51
|
+
* WireCat's own tools, so a tool it did not build keeps to the words, `stdin`, `site` and `login`.
|
|
51
52
|
*/
|
|
52
53
|
const signInMethodSchema = v.strictObject({
|
|
53
54
|
id: v.pipe(v.string(), v.regex(/^[a-z][a-z0-9-]{0,31}$/, "a lower-case method id")),
|
|
@@ -58,6 +59,19 @@ const signInMethodSchema = v.strictObject({
|
|
|
58
59
|
stdin: v.optional(v.boolean()),
|
|
59
60
|
site: v.optional(v.literal("--site")),
|
|
60
61
|
login: v.optional(v.literal("--login")),
|
|
62
|
+
/** The flag that takes a new profile's mail address. */
|
|
63
|
+
address: v.optional(v.literal("--address")),
|
|
64
|
+
/** The variable the CLI reads an app password or token from: a flag would show it in the process list. */
|
|
65
|
+
password: v.optional(v.pipe(v.string(), v.regex(/^[A-Z][A-Z0-9_]*$/, "an upper-case variable name"))),
|
|
66
|
+
/** The flag that takes the person's own OAuth client file, which Desktop writes to a private file for the run. */
|
|
67
|
+
clientFile: v.optional(v.literal("--client-file")),
|
|
68
|
+
/** The setting that names the person's own OAuth app, saved before the run: `microsoft_client_id`. */
|
|
69
|
+
clientId: v.optional(v.pipe(v.string(), v.regex(SNAKE_CASE, "a snake_case setting name"))),
|
|
70
|
+
/** The words that make a new profile sign in in the browser with the CLI's own app: `["--method", "oauth"]`. */
|
|
71
|
+
oauth: v.optional(words),
|
|
72
|
+
/** The flags for a local application: the portal it signs in to and its id. Its key goes on stdin. */
|
|
73
|
+
portal: v.optional(v.literal("--portal")),
|
|
74
|
+
appId: v.optional(v.literal("--client-id")),
|
|
61
75
|
});
|
|
62
76
|
const signInSchema = v.strictObject({
|
|
63
77
|
/** What signing in lets the agent do, in a sentence: "Lets your agent read your Acme contacts." */
|
|
@@ -67,6 +81,17 @@ const signInSchema = v.strictObject({
|
|
|
67
81
|
/** Left out when the CLI signs in only at a terminal, so the manifest of every other CLI stays as it was. */
|
|
68
82
|
methods: v.optional(v.pipe(v.array(signInMethodSchema), v.minLength(1))),
|
|
69
83
|
});
|
|
84
|
+
/** The method keys Desktop refuses from a tool it did not build (wirecat-desktop docs/dev/cli-registry.md, rule 4). */
|
|
85
|
+
const OURS_ONLY = ["address", "password", "clientFile", "clientId", "oauth", "portal", "appId"];
|
|
86
|
+
const duration = v.pipe(v.string(), v.regex(/^[1-9][0-9]*[mh]$/, "minutes or hours: 15m, 1h"));
|
|
87
|
+
const scheduleSchema = v.strictObject({
|
|
88
|
+
/** The interval a new timer starts with; one of `choices`. */
|
|
89
|
+
every: duration,
|
|
90
|
+
/** The intervals Desktop offers. */
|
|
91
|
+
choices: v.pipe(v.array(duration), v.minLength(1)),
|
|
92
|
+
/** The command the timer runs, without the profile: the schedule's environment names it. */
|
|
93
|
+
args: words,
|
|
94
|
+
});
|
|
70
95
|
const desktopSignInSchema = v.strictObject({
|
|
71
96
|
...signInSchema.entries,
|
|
72
97
|
/**
|
|
@@ -85,8 +110,13 @@ const desktopSchema = v.strictObject({
|
|
|
85
110
|
setup: v.nullable(words),
|
|
86
111
|
signIn: v.nullable(desktopSignInSchema),
|
|
87
112
|
skill: v.nullable(v.strictObject({ status: words, install: words, show: words })),
|
|
88
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* `port` is a WireCat tool's fixed port, from the identity's `mcpPort`. Desktop gives any other tool a free port of
|
|
115
|
+
* its own and fills `{port}`. Left out, not `null`, without `mcpPort`, so the manifest of every other CLI stays as it
|
|
116
|
+
* was.
|
|
117
|
+
*/
|
|
89
118
|
mcpServer: v.nullable(v.strictObject({
|
|
119
|
+
port: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1024), v.maxValue(65535))),
|
|
90
120
|
start: words,
|
|
91
121
|
stop: words,
|
|
92
122
|
status: words,
|
|
@@ -100,6 +130,8 @@ const desktopSchema = v.strictObject({
|
|
|
100
130
|
lastShape: v.literal("runs"),
|
|
101
131
|
what: line(40),
|
|
102
132
|
note: v.null(),
|
|
133
|
+
/** Left out, not `null`, without the identity's `syncSchedule`, so the manifest of every other CLI stays as it was. */
|
|
134
|
+
schedule: v.optional(scheduleSchema),
|
|
103
135
|
})),
|
|
104
136
|
storeInfo: v.null(),
|
|
105
137
|
storeTables: v.null(),
|
|
@@ -206,9 +238,37 @@ export const buildManifest = ({ identity, commands, pkg, skills }) => {
|
|
|
206
238
|
throw new ManifestError(["no doctor command: Desktop checks every tool with it"]);
|
|
207
239
|
if (!identity.tagline)
|
|
208
240
|
throw new ManifestError(["no tagline: add `tagline`, at most 55 characters, to the identity the manifest reads"]);
|
|
241
|
+
// Arguments may follow a command (`session start qr`), so the longest leading run of words that is one names it.
|
|
242
|
+
const commandAt = (words) => {
|
|
243
|
+
for (let end = words.length; end > 0; end -= 1) {
|
|
244
|
+
const command = at.get(words.slice(0, end).join(" "));
|
|
245
|
+
if (command !== undefined && (command.commands.length === 0 || command.runnable === true))
|
|
246
|
+
return command;
|
|
247
|
+
}
|
|
248
|
+
return undefined;
|
|
249
|
+
};
|
|
250
|
+
const scheduleOf = (schedule, run) => {
|
|
251
|
+
const lacks = ["schedule command", "schedule list", "schedule remove", "schedule run"].filter((path) => !at.has(path));
|
|
252
|
+
if (lacks.length > 0)
|
|
253
|
+
throw new ManifestError([
|
|
254
|
+
`syncSchedule needs ${lacks.map((path) => `\`${path}\``).join(", ")}: Desktop runs them`,
|
|
255
|
+
]);
|
|
256
|
+
if (!schedule.choices.includes(schedule.every))
|
|
257
|
+
throw new ManifestError([`syncSchedule: every ${schedule.every} is not one of its choices`]);
|
|
258
|
+
const args = [...(schedule.args ?? run)];
|
|
259
|
+
if (commandAt(args) === undefined)
|
|
260
|
+
throw new ManifestError([`syncSchedule: \`${args.join(" ")}\` names no command of this CLI`]);
|
|
261
|
+
return { every: schedule.every, choices: [...schedule.choices], args };
|
|
262
|
+
};
|
|
209
263
|
const setupPath = ["setup", "session start"].find((path) => at.has(path));
|
|
210
|
-
const
|
|
264
|
+
const serves = has("mcp server start", "mcp server stop", "mcp server status", "mcp revoke");
|
|
265
|
+
if (identity.mcpPort !== undefined && !serves)
|
|
266
|
+
throw new ManifestError([
|
|
267
|
+
"mcpPort needs `mcp server start`, `stop`, `status` and `mcp revoke`: Desktop runs the server with them",
|
|
268
|
+
]);
|
|
269
|
+
const mcpServer = serves
|
|
211
270
|
? {
|
|
271
|
+
...(identity.mcpPort !== undefined ? { port: identity.mcpPort } : {}),
|
|
212
272
|
start: [
|
|
213
273
|
"mcp",
|
|
214
274
|
"server",
|
|
@@ -226,7 +286,11 @@ export const buildManifest = ({ identity, commands, pkg, skills }) => {
|
|
|
226
286
|
}
|
|
227
287
|
: null;
|
|
228
288
|
const nounSyncs = all.filter((command) => command.path.length === 2 && command.path[1] === "sync");
|
|
229
|
-
const
|
|
289
|
+
const named = identity.syncCommand ? commandAt(identity.syncCommand) : undefined;
|
|
290
|
+
if (identity.syncCommand && named === undefined)
|
|
291
|
+
throw new ManifestError([`syncCommand: \`${identity.syncCommand.join(" ")}\` names no command of this CLI`]);
|
|
292
|
+
const syncPath = named?.path ?? at.get("sync")?.path ?? (nounSyncs.length === 1 ? nounSyncs[0]?.path : undefined);
|
|
293
|
+
const syncWords = identity.syncCommand ?? syncPath ?? [];
|
|
230
294
|
if (syncPath && !identity.syncs)
|
|
231
295
|
throw new ManifestError([
|
|
232
296
|
`no syncs: \`${syncPath.join(" ")}\` exists, so add \`syncs\`, what it copies in at most 40 characters`,
|
|
@@ -235,13 +299,16 @@ export const buildManifest = ({ identity, commands, pkg, skills }) => {
|
|
|
235
299
|
const last = syncPath && has("runs list") ? ["runs", "list", ...query, "--limit", "50", "--no-record", "--json"] : null;
|
|
236
300
|
const sync = syncPath
|
|
237
301
|
? {
|
|
238
|
-
run: [...profile, ...
|
|
302
|
+
run: [...profile, ...syncWords, "--record", "--json"],
|
|
239
303
|
last,
|
|
240
304
|
lastShape: "runs",
|
|
241
305
|
what: identity.syncs,
|
|
242
306
|
note: null,
|
|
307
|
+
...(identity.syncSchedule ? { schedule: scheduleOf(identity.syncSchedule, syncWords) } : {}),
|
|
243
308
|
}
|
|
244
309
|
: null;
|
|
310
|
+
if (identity.syncSchedule && !sync)
|
|
311
|
+
throw new ManifestError(["syncSchedule needs a sync command"]);
|
|
245
312
|
if (identity.meetingsProvider && !has("meetings show", "meetings transcript"))
|
|
246
313
|
throw new ManifestError([
|
|
247
314
|
"meetingsProvider needs `meetings show` and `meetings transcript`: Desktop opens a call with them",
|
|
@@ -300,6 +367,16 @@ export const buildManifest = ({ identity, commands, pkg, skills }) => {
|
|
|
300
367
|
if (lacks.length > 0)
|
|
301
368
|
throw new ManifestError([`signIn method ${method.id}: \`${path}\` takes no ${lacks.join(" or ")}`]);
|
|
302
369
|
}
|
|
370
|
+
const passed = OURS_ONLY.filter((key) => method[key] !== undefined);
|
|
371
|
+
if (passed.length > 0 && !(typeof pkg.name === "string" && pkg.name.startsWith("@wirecat/")))
|
|
372
|
+
throw new ManifestError([
|
|
373
|
+
`signIn method ${method.id}: Desktop takes ${passed.join(", ")} only from WireCat's own @wirecat packages`,
|
|
374
|
+
]);
|
|
375
|
+
const path = rest.slice(0, end + 1).join(" ");
|
|
376
|
+
const flags = [method.address, method.clientFile, method.portal, method.appId].filter((flag) => flag !== undefined);
|
|
377
|
+
const missing = flags.filter((flag) => !takes(path, flag));
|
|
378
|
+
if (missing.length > 0)
|
|
379
|
+
throw new ManifestError([`signIn method ${method.id}: \`${path}\` takes no ${missing.join(" or ")}`]);
|
|
303
380
|
if (rest.some((word) => word.includes("{")))
|
|
304
381
|
throw new ManifestError([`signIn method ${method.id}: {profile} is the only slot Desktop fills in a sign-in`]);
|
|
305
382
|
}
|
package/docs/standards/README.md
CHANGED
|
@@ -27,9 +27,9 @@ the four steps that need a person. A new CLI is ready for its first release when
|
|
|
27
27
|
|
|
28
28
|
| Page | Area id | Rules | What it covers |
|
|
29
29
|
|---|---|---:|---|
|
|
30
|
-
| [Toolchain](toolchain.md) | `TOOL` |
|
|
30
|
+
| [Toolchain](toolchain.md) | `TOOL` | 21 | TypeScript, Biome, grit plugins, size caps, import cycles, spelling, Markdown, Go, cli-core's `-dev` override |
|
|
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
|
-
| [Commands](commands.md) | `CMD` |
|
|
32
|
+
| [Commands](commands.md) | `CMD` | 34 | Paths, vocabulary, flags, arguments, effects, lifetime, query, help, external references, joining `wcat`, settings in the config file, refs, network hosts, the generated `api` group, the paths cli-core reserves |
|
|
33
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 |
|
|
@@ -40,7 +40,7 @@ on the computer.
|
|
|
40
40
|
is refused.
|
|
41
41
|
- **Exceptions:** a command that touches no account runs without a profile, for example `session list`
|
|
42
42
|
([WC-ACCT-12](#wc-acct-12--sign-in-is-session-start-status-and-end-and-session-list-names-the-profiles)),
|
|
43
|
-
`config show` and `commands
|
|
43
|
+
`config show` and `commands`. `mcp serve` may name its profiles with `--profiles <names|all>` instead
|
|
44
44
|
([WC-MCP-9](mcp.md#wc-mcp-9--a-server-serves-the-profiles-it-is-told-with-one-connection-for-each)); `all` is the owner's explicit choice, never a fallback.
|
|
45
45
|
- **Applies to:** all CLIs. **Since:** cli-base 0.41.0. **Rulings:** NEED-84, NEED-1881.
|
|
46
46
|
|
|
@@ -185,17 +185,15 @@ 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:**
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
A CLI that adds a missing command adds it under `session`; a renamed path keeps no alias
|
|
188
|
+
- **Exceptions:** none. memo signs in to no account, so the rule does not apply to it: it reads the stores of the
|
|
189
|
+
other CLIs, and `memo models keys` keeps a model provider's key, not a sign-in. Every CLI that signs in has all
|
|
190
|
+
four, tg, max and wa included: cli-core's shared `session`
|
|
191
|
+
contract requires `status` and `list` (`messengerSessionCommands`), and its messenger `account` group has no `list`.
|
|
192
|
+
`account list` is removed from tg, max and wa with no alias.
|
|
193
|
+
|
|
194
|
+
A CLI that adds a missing command adds it under `session`. A renamed path keeps no alias
|
|
197
195
|
([WC-CMD-8](commands.md#wc-cmd-8--keep-no-aliases-a-renamed-path-stops-working-in-the-release-that-renames-it)).
|
|
198
|
-
- **Applies to:** every CLI that signs in. **Since:** cli-base 0.65.0. **Rulings:** NEED-1884.
|
|
196
|
+
- **Applies to:** every CLI that signs in. **Since:** cli-base 0.65.0. **Rulings:** NEED-1884, NEED-2915, NEED-2936.
|
|
199
197
|
|
|
200
198
|
### WC-ACCT-13 · memo's first word is an account group, and the default group `all` holds every account
|
|
201
199
|
|
|
@@ -113,7 +113,8 @@ cli-core's entities, and the adapter behind cli-core's ports. CRM is the first d
|
|
|
113
113
|
### WC-ARCH-6 · Replace a use case, not a command
|
|
114
114
|
|
|
115
115
|
- **Why:** when a CLI replaces the service method, its command and its MCP tool both get the change.
|
|
116
|
-
- **Enforced by:** review only.
|
|
116
|
+
- **Enforced by:** review only. For the paths cli-core reserves, `reserved-shared-command`
|
|
117
|
+
([WC-CMD-34](commands.md#wc-cmd-34--mount-cli-cores-shared-command-at-a-reserved-path-never-one-of-your-own)).
|
|
117
118
|
- **Example:** `Messenger.services` receives the shared services and returns only the ones it changes:
|
|
118
119
|
`services: (base) => ({ messages: { ...base.messages, list: maxList } })`. To add a subcommand, a CLI calls
|
|
119
120
|
`addCommand` on the command a factory returns. A calendar CLI changes what the shared calendar commands do through
|
package/docs/standards/ci.md
CHANGED
|
@@ -45,8 +45,13 @@ plus community itself. cli-template follows every rule here as a CLI does
|
|
|
45
45
|
`pnpm lint`, `pnpm docs:lint`, `pnpm run --if-present ci:quick` and a gitleaks scan of the new commits only. A new
|
|
46
46
|
commit cancels the run it replaces. The job times out after five minutes, a ceiling for a stalled setup, not an
|
|
47
47
|
expected time.
|
|
48
|
-
- **Exceptions:**
|
|
49
|
-
|
|
48
|
+
- **Exceptions:** a repository whose pull request validation runs `node-ci.yml` on every pull request and merge
|
|
49
|
+
(its `check` job lints and checks types) may leave `pnpm lint` and `ci:quick` out of this job, and one whose pull
|
|
50
|
+
request security checks scan the whole history for secrets may leave out the gitleaks scan. Each check then runs
|
|
51
|
+
in one place. cli-core does both (2026-11-26): its `standards` keeps the changelog rule, `standards:check` and
|
|
52
|
+
`docs:lint`. Runner queues and cold downloads are outside the budget.
|
|
53
|
+
- **Applies to:** the WireCat repositories. **Since:** cli-base 0.41.0. **Rulings:** NEED-2 on cli-core#3386
|
|
54
|
+
(2026-11-26).
|
|
50
55
|
|
|
51
56
|
### WC-CI-4 · Keep `ci:quick` to early bug checks that finish within two minutes
|
|
52
57
|
|
|
@@ -56,7 +61,7 @@ plus community itself. cli-template follows every rule here as a CLI does
|
|
|
56
61
|
- tg, max, memo, wa, b24 and cli-template: `pnpm typecheck && pnpm build && pnpm lint:commands`;
|
|
57
62
|
- drive: `pnpm typecheck && pnpm lint:commands`, which builds first;
|
|
58
63
|
- zoom, cli-base and cli-testing: `pnpm typecheck`;
|
|
59
|
-
- cli-core: `
|
|
64
|
+
- cli-core: none since 2026-11-26, its `ci / check` types every pull request (WC-CI-3 exception);
|
|
60
65
|
- cli-docs: its unit tests, without the one that needs generated pages;
|
|
61
66
|
- community: its script tests.
|
|
62
67
|
- **Exceptions:** never put live-account suites, agent suites or platform jobs here. Full tests and coverage run in
|
|
@@ -125,8 +130,9 @@ plus community itself. cli-template follows every rule here as a CLI does
|
|
|
125
130
|
gitleaks scan of the whole history. The shared workflow owns the CLI steps: the repository's `ci.yml` names a step
|
|
126
131
|
it cannot run yet in `skip`, with the reason beside it, and puts only its extra checks in `checks` (tg and max:
|
|
127
132
|
`pnpm check:agent-docs`).
|
|
128
|
-
- **Exceptions:**
|
|
129
|
-
request
|
|
133
|
+
- **Exceptions:** the whole-history secret scan is off (node-ci's `secrets` input) in a repository whose pull
|
|
134
|
+
request security checks run it, as in cli-core. Platform suites (Windows, macOS, install checks) are skipped here
|
|
135
|
+
and run at release, monthly or on request. Nothing in this run publishes or tags. cli-docs runs its full validation before each deployment and monthly
|
|
130
136
|
instead; community has no build to validate.
|
|
131
137
|
- **Applies to:** the CLIs, cli-base, cli-core and cli-testing. **Since:** cli-base 0.41.0. **Rulings:** none.
|
|
132
138
|
|
|
@@ -384,10 +384,12 @@ The references, each for its own part:
|
|
|
384
384
|
|
|
385
385
|
A CLI ships `contracts/wirecat.json` (`wcat_manifest: 2`), written by `cli-dev manifest` from its command tree and
|
|
386
386
|
its identity, never by hand. The developer types only `tagline`, `signIn`, with a sync
|
|
387
|
-
command `syncs`, and for
|
|
387
|
+
command `syncs` (with several `<noun> sync` commands also `syncCommand`, and for a timer `syncSchedule`), and for
|
|
388
|
+
saved calls or meetings `meetingsProvider`; the
|
|
388
389
|
commands, their `summary`, `effects` and `entity`, the fields of each entity a query covers, and every command word in
|
|
389
390
|
`desktop` are derived, and every word passes Desktop's plain-word rule. The hosts it contacts are typed too
|
|
390
|
-
([WC-CMD-32](#wc-cmd-32--declare-every-host-the-cli-contacts-and-reach-them-only-through-hostfetch)). The file holds nothing that changes per release (no version)
|
|
391
|
+
([WC-CMD-32](#wc-cmd-32--declare-every-host-the-cli-contacts-and-reach-them-only-through-hostfetch)). The file holds nothing that changes per release (no version). It holds an MCP port only for a WireCat tool, from
|
|
392
|
+
`mcpPort`, one port per tool. Desktop assigns every other tool a port of its own. With the
|
|
391
393
|
file shipped, `--wcat-describe` answers format 2: the format-1 keys with `"wcat_describe": 2`, the file's `desktop`
|
|
392
394
|
and `manifest_sha256` of its bytes. Without it the answer stays format 1.
|
|
393
395
|
|
|
@@ -527,6 +529,37 @@ one operation, stay directly under `api`.
|
|
|
527
529
|
- **Applies to:** every CLI with a generated `api` group, from its next regeneration. **Since:** the release after
|
|
528
530
|
cli-base 0.120.0, with the cli-core release that mounts groups. **Rulings:** NEED-2754, NEED-2759.
|
|
529
531
|
|
|
532
|
+
### WC-CMD-34 · Mount cli-core's shared command at a reserved path, never one of your own
|
|
533
|
+
|
|
534
|
+
These root paths belong to cli-core: `session start`, `session status`, `session end`, `session list`, `doctor`,
|
|
535
|
+
`mcp`, `account remove`, `mirrors` and `complete`. A CLI that has one of them mounts it from cli-core. It changes the
|
|
536
|
+
command only through `overrideSharedContract` or `customizeSharedCommand`, which keep cli-core's mark on it. It may add
|
|
537
|
+
a subcommand of its own to a shared group. A CLI does not need every path.
|
|
538
|
+
|
|
539
|
+
- **Why:** a hand-built `session` or `doctor` looks the same in help, but it misses every later fix in cli-core. The
|
|
540
|
+
audits of 25.11.2026 found an own `session` in zoom, drive, gcal, ydisk, notion and the CRM CLIs, an own `mirrors`
|
|
541
|
+
in ydisk, an own `doctor` in memo and an own MCP server in memo. `assertSharedContracts` checks only the commands
|
|
542
|
+
cli-core marked, so none of these failed a check.
|
|
543
|
+
- **Enforced by:** `reserved-shared-command`.
|
|
544
|
+
- **How it is checked:** the lint and the family audit read the CLI's command tree as JSON, where cli-core marks
|
|
545
|
+
each shared command with the origin `cli-core`. The rule reports each reserved path whose command has no such mark,
|
|
546
|
+
once per path (`session` once for its four leaves). For now it is a warning: the lint and the audit print it and
|
|
547
|
+
pass. It becomes an error in the cli-base release after cli-core marks the helpers in the known gap below, planned
|
|
548
|
+
for 2027-01-15.
|
|
549
|
+
- **Example:** `tokenSessionCommand({ app, service, resolveSettings, verify })` for a sign-in with one token,
|
|
550
|
+
`oauthSessionCommand` for a browser sign-in, `messengerSessionCommands` in tg, max and wa. `appDoctorCommand`,
|
|
551
|
+
`appMcpCommand`, `appCompleteCommand`, `accountRemoveCommand` and `fileMirrorsCommand` for the other paths. max
|
|
552
|
+
replaces `doctor` and `session` through `customizeSharedCommand`, so they keep the mark and need no exception.
|
|
553
|
+
- **Exceptions:** an entry in the CLI's `lint/overrides.json`, such as
|
|
554
|
+
`{ "rule": "reserved-shared-command", "target": "session", "reason": "…", "owner": "@…", "review_after": "2027-03-01" }`.
|
|
555
|
+
An entry without a reason or a date does not apply, and an entry more than 14 days past its date fails. An entry
|
|
556
|
+
in `lint/baseline/` is refused, because it has neither. The first expected one is mail's `session`: one profile
|
|
557
|
+
signs in by app password or by Google or Microsoft OAuth, and no shared session command covers that.
|
|
558
|
+
Known gap, as of 2026-11-25: cli-core 1.0.0 does not mark `tokenSessionCommand`, `oauthSessionCommand`,
|
|
559
|
+
`fileMirrorsCommand` and the standalone `accountRemoveCommand`. A CLI that mounts one of them is still reported,
|
|
560
|
+
so the rule stays a warning until cli-core marks them.
|
|
561
|
+
- **Applies to:** all CLIs. **Since:** cli-base 1.1.0, as a warning. **Rulings:** none.
|
|
562
|
+
|
|
530
563
|
## Sources
|
|
531
564
|
|
|
532
565
|
These documents explain the rules on this page in more detail. Where one of them disagrees with this page, this page
|