@wirecat/cli-base 0.131.0 → 1.0.0-rc.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 +93 -0
- package/README.md +7 -1
- package/dist/batch.d.ts +1 -0
- package/dist/batch.js +1 -0
- package/dist/codegen/graphql-fake.d.ts +1 -1
- package/dist/codegen/graphql-fake.js +1 -1
- package/dist/codegen/graphql.d.ts +1 -12
- package/dist/codegen/graphql.js +0 -44
- package/dist/codegen/index.d.ts +4 -3
- package/dist/codegen/index.js +2 -1
- package/dist/codegen/model.d.ts +4 -1
- package/dist/codegen/pipeline.d.ts +5 -5
- package/dist/codegen/runtime.d.ts +9 -2
- package/dist/codegen/runtime.js +7 -1
- package/dist/codegen/selection.d.ts +13 -0
- package/dist/codegen/selection.js +44 -0
- package/dist/codegen/wp-json.d.ts +2 -2
- package/dist/commands/document.d.ts +3 -0
- package/dist/commands/document.js +3 -0
- package/dist/commands/page.d.ts +14 -2
- package/dist/commands/page.js +3 -0
- package/dist/completion/index.d.ts +5 -1
- package/dist/completion/index.js +5 -1
- package/dist/credentials.d.ts +2 -0
- package/dist/credentials.js +2 -0
- package/dist/dev/api-report.d.ts +24 -0
- package/dist/dev/api-report.js +345 -0
- package/dist/dev/main.js +9 -19
- package/dist/dev/next-version.d.ts +5 -1
- package/dist/dev/next-version.js +30 -2
- package/dist/dev/result-shape.d.ts +4 -0
- package/dist/dev/result-shape.js +4 -4
- package/dist/dev/wcat-lint.d.ts +4 -1
- package/dist/dev/wcat-lint.js +9 -2
- package/dist/executable.d.ts +2 -0
- package/dist/executable.js +2 -0
- package/dist/http/fetch.d.ts +1 -0
- package/dist/http/fetch.js +1 -0
- package/dist/http/hosts.d.ts +11 -2
- package/dist/http/hosts.js +11 -2
- package/dist/http/index.d.ts +10 -2
- package/dist/http/index.js +10 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/logging.d.ts +3 -0
- package/dist/logging.js +3 -0
- package/dist/mcp/index.d.ts +17 -3
- package/dist/mcp/index.js +12 -2
- package/dist/output-buffer.d.ts +3 -0
- package/dist/output-buffer.js +1 -0
- package/dist/query/dates.d.ts +6 -1
- package/dist/query/dates.js +6 -1
- package/dist/query/help.d.ts +1 -0
- package/dist/query/help.js +1 -0
- package/dist/query/registry.d.ts +6 -1
- package/dist/query/registry.js +6 -1
- package/dist/query/types.d.ts +1 -0
- package/dist/query/types.js +1 -0
- package/dist/release/fold.d.ts +5 -0
- package/dist/release/fold.js +10 -1
- package/dist/release/fragments.d.ts +5 -2
- package/dist/release/fragments.js +18 -15
- package/dist/release/level.js +17 -11
- package/dist/skill/index.d.ts +34 -5
- package/dist/skill/index.js +21 -3
- package/dist/standards/audit.d.ts +15 -1
- package/dist/standards/audit.js +12 -1
- package/dist/standards/effects.d.ts +2 -0
- package/dist/standards/effects.js +1 -0
- package/dist/standards/errors.d.ts +2 -0
- package/dist/standards/errors.js +2 -0
- package/dist/standards/fields.d.ts +3 -0
- package/dist/standards/fields.js +2 -0
- package/dist/standards/flags-what.js +1 -3
- package/dist/standards/flags-work.d.ts +3 -0
- package/dist/standards/flags-work.js +25 -0
- package/dist/standards/identifiers.d.ts +7 -1
- package/dist/standards/identifiers.js +6 -1
- package/dist/standards/lint.d.ts +48 -8
- package/dist/standards/lint.js +45 -8
- package/dist/standards/log.d.ts +15 -3
- package/dist/standards/log.js +15 -3
- package/dist/standards/monthly.d.ts +2 -0
- package/dist/standards/monthly.js +2 -0
- package/dist/standards/output.d.ts +8 -1
- package/dist/standards/output.js +7 -1
- package/dist/standards/registry.d.ts +6 -1
- package/dist/standards/registry.js +6 -1
- package/dist/standards/steps.d.ts +5 -1
- package/dist/standards/steps.js +5 -1
- package/dist/standards/vocabulary.d.ts +5 -1
- package/dist/standards/vocabulary.js +8 -2
- package/dist/testing/index.d.ts +1 -2
- package/dist/testing/index.js +1 -2
- package/dist/update/index.d.ts +25 -4
- package/dist/update/index.js +24 -4
- package/dist/wcat/manifest.d.ts +11 -1
- package/dist/wcat/manifest.js +10 -1
- package/docs/standards/commands.md +5 -4
- package/docs/standards/docs.md +5 -2
- package/docs/standards/releases.md +37 -9
- package/docs/standards/toolchain.md +1 -1
- package/package.json +23 -5
package/dist/standards/output.js
CHANGED
|
@@ -6,7 +6,11 @@ export const MAX_NEXT_STEPS = 2;
|
|
|
6
6
|
/** The switch for one line per item (WC-OUT-24). Its name is still the owner's to settle, so it lives in one place. */
|
|
7
7
|
export const COMPACT_FLAG = "--compact";
|
|
8
8
|
export const isoTime = v.pipe(v.string(), v.isoTimestamp("an ISO 8601 time in UTC"), v.endsWith("Z", "an ISO 8601 time in UTC, ending in `Z`"));
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* The same moment on the wall clock of a zone, with its offset: `2026-11-02T16:03:00.000+01:00` (WC-TIME-2).
|
|
11
|
+
*
|
|
12
|
+
* @experimental
|
|
13
|
+
*/
|
|
10
14
|
export const localTime = v.pipe(v.string(), v.regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}[+-]\d{2}:\d{2}$/, "an ISO 8601 time with its offset"));
|
|
11
15
|
/** The typed name of a stored thing, `msg:telegram/1/2/3` or `note:42`: what every other command takes. */
|
|
12
16
|
export const reference = v.pipe(v.string(), v.regex(/^[a-z]+:\S+$/, "a reference such as `note:42`"));
|
|
@@ -100,6 +104,8 @@ const count = v.pipe(v.number(), v.integer(), v.minValue(0));
|
|
|
100
104
|
* What a model a command calls on its own did in this run (mail's `inbox` sorting new threads): how many items it was
|
|
101
105
|
* sent, how many it handled, how many wait for the next run, and what that cost. `usage` is absent when the provider
|
|
102
106
|
* counted nothing; `cost_usd` is null when no price is known.
|
|
107
|
+
*
|
|
108
|
+
* @experimental
|
|
103
109
|
*/
|
|
104
110
|
export const modelRunSchema = v.strictObject({
|
|
105
111
|
provider: text,
|
|
@@ -4,6 +4,7 @@ export declare const word: v.SchemaWithPipe<readonly [v.StringSchema<undefined>,
|
|
|
4
4
|
export declare const SNAKE_CASE: RegExp;
|
|
5
5
|
export declare const text: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
|
|
6
6
|
export declare const dottedId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "dotted lower-case words, such as `page.next`">]>;
|
|
7
|
+
/** @experimental */
|
|
7
8
|
export declare class RegistryError extends Error {
|
|
8
9
|
readonly registry: string;
|
|
9
10
|
readonly problems: readonly string[];
|
|
@@ -15,5 +16,9 @@ export declare const parseRegistry: <S extends v.GenericSchema>(registry: string
|
|
|
15
16
|
export declare const duplicates: (values: readonly string[]) => string[];
|
|
16
17
|
export declare const jsonSchemaOf: (schema: v.GenericSchema, definitions?: Record<string, v.GenericSchema>) => import("@valibot/to-json-schema").JsonSchema;
|
|
17
18
|
export declare const placeholders: (template: string) => string[];
|
|
18
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Fills `{name}` from `values`; a placeholder with no value throws, so a half-filled sentence never ships.
|
|
21
|
+
*
|
|
22
|
+
* @experimental
|
|
23
|
+
*/
|
|
19
24
|
export declare const fill: (template: string, values: Readonly<Record<string, string | number>>) => string;
|
|
@@ -5,6 +5,7 @@ export const word = v.pipe(v.string(), v.regex(/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,
|
|
|
5
5
|
export const SNAKE_CASE = /^[a-z][a-z0-9]*(_[a-z0-9]+)*$/;
|
|
6
6
|
export const text = v.pipe(v.string(), v.regex(/\S/, "must not be empty"));
|
|
7
7
|
export const dottedId = v.pipe(v.string(), v.regex(/^[a-z][a-z0-9-]*(\.[a-z][a-z0-9-]*)+$/, "dotted lower-case words, such as `page.next`"));
|
|
8
|
+
/** @experimental */
|
|
8
9
|
export class RegistryError extends Error {
|
|
9
10
|
registry;
|
|
10
11
|
problems;
|
|
@@ -33,7 +34,11 @@ export const duplicates = (values) => [...new Set(values.filter((value, index) =
|
|
|
33
34
|
export const jsonSchemaOf = (schema, definitions) => toJsonSchema(schema, { target: "draft-2020-12", ...(definitions ? { definitions } : {}) });
|
|
34
35
|
const PLACEHOLDER = /\{([a-z][a-z0-9]*(?:_[a-z0-9]+)*)\}/g;
|
|
35
36
|
export const placeholders = (template) => [...template.matchAll(PLACEHOLDER)].map((match) => match[1] ?? "");
|
|
36
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Fills `{name}` from `values`; a placeholder with no value throws, so a half-filled sentence never ships.
|
|
39
|
+
*
|
|
40
|
+
* @experimental
|
|
41
|
+
*/
|
|
37
42
|
export const fill = (template, values) => template.replace(PLACEHOLDER, (_, name) => {
|
|
38
43
|
const value = values[name];
|
|
39
44
|
if (value === undefined)
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
import { type Effects } from "./effects.js";
|
|
3
3
|
import type { NextStep } from "./output.js";
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* A step's command: a path such as `messages sync`, or `*` for the command that gave the answer (`page.next`).
|
|
6
|
+
*
|
|
7
|
+
* @experimental
|
|
8
|
+
*/
|
|
5
9
|
export declare const SAME_COMMAND = "*";
|
|
6
10
|
declare const stepSchema: v.UnionSchema<[v.StrictObjectSchema<{
|
|
7
11
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "dotted lower-case words, such as `page.next`">]>;
|
package/dist/standards/steps.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
import { writes } from "./effects.js";
|
|
3
3
|
import { dottedId, duplicates, fill, parseRegistry, SNAKE_CASE, text } from "./registry.js";
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* A step's command: a path such as `messages sync`, or `*` for the command that gave the answer (`page.next`).
|
|
6
|
+
*
|
|
7
|
+
* @experimental
|
|
8
|
+
*/
|
|
5
9
|
export const SAME_COMMAND = "*";
|
|
6
10
|
const commandPath = v.pipe(v.string(), v.regex(/^[a-z][a-z0-9-]*( [a-z][a-z0-9-]*)*$/, "a command path such as `messages sync`"));
|
|
7
11
|
const stepSchema = v.union([
|
|
@@ -58,7 +58,11 @@ export type VocabularyVerb = Vocabulary["verbs"][number];
|
|
|
58
58
|
export type VocabularyNoun = Vocabulary["nouns"][number];
|
|
59
59
|
export type VocabularyFlag = Vocabulary["flags"][number];
|
|
60
60
|
export type FlagType = (typeof FLAG_TYPES)[number];
|
|
61
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* One word, one meaning within its kind: a second entry for the same verb, noun, view, root or flag is refused.
|
|
63
|
+
*
|
|
64
|
+
* @experimental
|
|
65
|
+
*/
|
|
62
66
|
export declare const defineVocabulary: (input: unknown) => Vocabulary;
|
|
63
67
|
/** The words every CLI on cli-base is judged against. Seeded from STANDARD's command-name rules and the glossary. */
|
|
64
68
|
export declare const VOCABULARY: Vocabulary;
|
|
@@ -11,6 +11,7 @@ import { PRIVACY_FLAGS } from "./flags-privacy.js";
|
|
|
11
11
|
import { SCHEDULE_FLAGS } from "./flags-schedule.js";
|
|
12
12
|
import { SEARCH_FLAGS } from "./flags-search.js";
|
|
13
13
|
import { WHAT_FLAGS } from "./flags-what.js";
|
|
14
|
+
import { WORK_FLAGS } from "./flags-work.js";
|
|
14
15
|
import { duplicates, parseRegistry, text, word } from "./registry.js";
|
|
15
16
|
export const FLAG_TYPES = [
|
|
16
17
|
"switch",
|
|
@@ -73,7 +74,11 @@ export const vocabularySchema = v.strictObject({
|
|
|
73
74
|
roots: v.array(rootSchema),
|
|
74
75
|
flags: v.array(flagSchema),
|
|
75
76
|
});
|
|
76
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* One word, one meaning within its kind: a second entry for the same verb, noun, view, root or flag is refused.
|
|
79
|
+
*
|
|
80
|
+
* @experimental
|
|
81
|
+
*/
|
|
77
82
|
export const defineVocabulary = (input) => parseRegistry("vocabulary", vocabularySchema, input, (vocabulary) => {
|
|
78
83
|
const problems = [];
|
|
79
84
|
const kinds = {
|
|
@@ -323,7 +328,7 @@ const collections = [
|
|
|
323
328
|
"files a mirror's sync found changed on both sides and could not merge, each waiting for a side or a final file",
|
|
324
329
|
],
|
|
325
330
|
["versions", "earlier contents of a file that a write replaced or deleted, kept on this computer to be put back"],
|
|
326
|
-
["comments", "comments people left on a thing in the source: a channel post or
|
|
331
|
+
["comments", "comments people left on a thing in the source: a channel post, a file or an issue"],
|
|
327
332
|
["meetings", "stored meetings, from Zoom or another provider"],
|
|
328
333
|
["calls", "phone calls a phone system recorded, stored as meetings with their transcripts"],
|
|
329
334
|
["calendars", "calendars of an account, each synced or not"],
|
|
@@ -470,5 +475,6 @@ export const VOCABULARY = defineVocabulary({
|
|
|
470
475
|
...CONTENT_FLAGS,
|
|
471
476
|
...SEARCH_FLAGS,
|
|
472
477
|
...MIRROR_FLAGS,
|
|
478
|
+
...WORK_FLAGS,
|
|
473
479
|
],
|
|
474
480
|
});
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* The seams a test needs, so that "no test touched the real machine" is a property of the code
|
|
3
3
|
* rather than a hope about every test remembering to opt out.
|
|
4
4
|
*/
|
|
5
|
-
export {
|
|
6
|
-
export { captureStreams } from "../streams.js";
|
|
5
|
+
export { memoryKeyring } from "../keyring.js";
|
|
7
6
|
export { allowNetwork } from "./network.js";
|
|
8
7
|
import { type LogEvent } from "../standards/log.js";
|
|
9
8
|
/** Throws, naming each, when a written log line is not a registered event with its keys. */
|
package/dist/testing/index.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* The seams a test needs, so that "no test touched the real machine" is a property of the code
|
|
3
3
|
* rather than a hope about every test remembering to opt out.
|
|
4
4
|
*/
|
|
5
|
-
export {
|
|
6
|
-
export { captureStreams } from "../streams.js";
|
|
5
|
+
export { memoryKeyring } from "../keyring.js";
|
|
7
6
|
export { allowNetwork } from "./network.js";
|
|
8
7
|
import { logEventProblems } from "../standards/log.js";
|
|
9
8
|
/** Throws, naming each, when a written log line is not a registered event with its keys. */
|
package/dist/update/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const isNewer: (candidate: string, current: string) => boolean;
|
|
|
11
11
|
export declare const latestVersion: (packageName: string, fetch: FetchLike, { timeoutMs }?: {
|
|
12
12
|
timeoutMs?: number;
|
|
13
13
|
}) => Promise<string | undefined>;
|
|
14
|
+
/** @experimental */
|
|
14
15
|
export declare const CHECK_EVERY_MS: number;
|
|
15
16
|
export interface NotifyContext {
|
|
16
17
|
/** `pretty`, `json` or `jsonl` — the line exists only for the first. */
|
|
@@ -24,7 +25,11 @@ export interface NotifyContext {
|
|
|
24
25
|
/** Extra variables that turn it off, for the CLI's own prefix: `MAX_NO_UPDATE_CHECK`. */
|
|
25
26
|
offVariables?: readonly string[];
|
|
26
27
|
}
|
|
27
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Whether a person is at a terminal who could be told — the only case a check is worth making.
|
|
30
|
+
*
|
|
31
|
+
* @experimental
|
|
32
|
+
*/
|
|
28
33
|
export declare const mayNotify: ({ format, stderrIsTTY, quiet, enabled, installer, env, offVariables, }: NotifyContext) => boolean;
|
|
29
34
|
declare const updateState: v.ObjectSchema<{
|
|
30
35
|
readonly checkedAt: v.NumberSchema<undefined>;
|
|
@@ -32,18 +37,34 @@ declare const updateState: v.ObjectSchema<{
|
|
|
32
37
|
/** When the skill hint (`cli-base/skill`) was last shown — the other daily notice kept in this file. */
|
|
33
38
|
readonly skillHintAt: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
34
39
|
}, undefined>;
|
|
40
|
+
/** @experimental */
|
|
35
41
|
export type UpdateState = v.InferOutput<typeof updateState>;
|
|
36
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* The file as it is, `checkedAt: 0` when it is missing or unreadable.
|
|
44
|
+
*
|
|
45
|
+
* @experimental
|
|
46
|
+
*/
|
|
37
47
|
export declare const readNoticeState: (path: string) => UpdateState;
|
|
38
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* What the last check found. A missing or unreadable file is "never checked", not an error.
|
|
50
|
+
*
|
|
51
|
+
* @experimental
|
|
52
|
+
*/
|
|
39
53
|
export declare const readUpdateState: (path: string) => UpdateState | undefined;
|
|
40
54
|
/**
|
|
41
55
|
* Merged into the file as it is at the moment of writing: the update notice reads before it asks
|
|
42
56
|
* npm and writes after, and the skill hint may have written in between.
|
|
57
|
+
*
|
|
58
|
+
* @experimental
|
|
43
59
|
*/
|
|
44
60
|
export declare const writeUpdateState: (path: string, state: Partial<UpdateState>) => void;
|
|
61
|
+
/** @experimental */
|
|
45
62
|
export declare const checkIsDue: (state: UpdateState | undefined, now: number) => boolean;
|
|
46
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Resolve Windows shims from explicit PATH entries; cross-spawn quotes them through the trusted shell.
|
|
65
|
+
*
|
|
66
|
+
* @experimental
|
|
67
|
+
*/
|
|
47
68
|
export declare const spawnPlan: ([command, ...args]: readonly string[], platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv, exists?: (path: string) => boolean) => {
|
|
48
69
|
file: string;
|
|
49
70
|
args: string[];
|
package/dist/update/index.js
CHANGED
|
@@ -59,8 +59,13 @@ export const latestVersion = async (packageName, fetch, { timeoutMs = 1000 } = {
|
|
|
59
59
|
return undefined;
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
+
/** @experimental */
|
|
62
63
|
export const CHECK_EVERY_MS = 24 * 60 * 60 * 1000;
|
|
63
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Whether a person is at a terminal who could be told — the only case a check is worth making.
|
|
66
|
+
*
|
|
67
|
+
* @experimental
|
|
68
|
+
*/
|
|
64
69
|
export const mayNotify = ({ format, stderrIsTTY, quiet, enabled, installer, env, offVariables = [], }) => enabled &&
|
|
65
70
|
format === "pretty" &&
|
|
66
71
|
stderrIsTTY &&
|
|
@@ -75,7 +80,11 @@ const updateState = v.object({
|
|
|
75
80
|
/** When the skill hint (`cli-base/skill`) was last shown — the other daily notice kept in this file. */
|
|
76
81
|
skillHintAt: v.optional(v.number()),
|
|
77
82
|
});
|
|
78
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* The file as it is, `checkedAt: 0` when it is missing or unreadable.
|
|
85
|
+
*
|
|
86
|
+
* @experimental
|
|
87
|
+
*/
|
|
79
88
|
export const readNoticeState = (path) => {
|
|
80
89
|
try {
|
|
81
90
|
return loadConfigFile(path, updateState, () => ({ checkedAt: 0 }));
|
|
@@ -84,7 +93,11 @@ export const readNoticeState = (path) => {
|
|
|
84
93
|
return { checkedAt: 0 };
|
|
85
94
|
}
|
|
86
95
|
};
|
|
87
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* What the last check found. A missing or unreadable file is "never checked", not an error.
|
|
98
|
+
*
|
|
99
|
+
* @experimental
|
|
100
|
+
*/
|
|
88
101
|
export const readUpdateState = (path) => {
|
|
89
102
|
const state = readNoticeState(path);
|
|
90
103
|
return state.checkedAt > 0 ? state : undefined;
|
|
@@ -92,6 +105,8 @@ export const readUpdateState = (path) => {
|
|
|
92
105
|
/**
|
|
93
106
|
* Merged into the file as it is at the moment of writing: the update notice reads before it asks
|
|
94
107
|
* npm and writes after, and the skill hint may have written in between.
|
|
108
|
+
*
|
|
109
|
+
* @experimental
|
|
95
110
|
*/
|
|
96
111
|
export const writeUpdateState = (path, state) => {
|
|
97
112
|
try {
|
|
@@ -101,8 +116,13 @@ export const writeUpdateState = (path, state) => {
|
|
|
101
116
|
// A state file that cannot be written means asking npm again tomorrow, nothing worse.
|
|
102
117
|
}
|
|
103
118
|
};
|
|
119
|
+
/** @experimental */
|
|
104
120
|
export const checkIsDue = (state, now) => state === undefined || now - state.checkedAt >= CHECK_EVERY_MS;
|
|
105
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* Resolve Windows shims from explicit PATH entries; cross-spawn quotes them through the trusted shell.
|
|
123
|
+
*
|
|
124
|
+
* @experimental
|
|
125
|
+
*/
|
|
106
126
|
export const spawnPlan = ([command, ...args], platform = process.platform, env = process.env, exists = existsSync) => ({ file: executableOnPath(command, env, platform, exists), args, shell: false });
|
|
107
127
|
/** Runs the update and answers its exit code. stdout stays one result: the package manager's output goes to stderr. */
|
|
108
128
|
export const runUpdate = (argv) => {
|
package/dist/wcat/manifest.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import * as v from "valibot";
|
|
8
8
|
import { type CommandInfo } from "../commands/registry.js";
|
|
9
9
|
import type { WcatTool } from "./describe.js";
|
|
10
|
+
/** @experimental */
|
|
10
11
|
export declare const MANIFEST_FORMAT = 2;
|
|
11
12
|
export declare const MANIFEST_FILE = "contracts/wirecat.json";
|
|
12
13
|
/**
|
|
@@ -15,12 +16,18 @@ export declare const MANIFEST_FILE = "contracts/wirecat.json";
|
|
|
15
16
|
* and the hosts both redirect their files to. `cli-dev manifest` adds them to the hosts a CLI declares.
|
|
16
17
|
*/
|
|
17
18
|
export declare const SHARED_HOSTS: readonly string[];
|
|
18
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Desktop's `plain_word`: letters, digits and `._:=,/+@-`, at most two leading dashes, `--` alone, `{name}` slots.
|
|
21
|
+
*
|
|
22
|
+
* @experimental
|
|
23
|
+
*/
|
|
19
24
|
export declare const PLAIN_WORD: RegExp;
|
|
20
25
|
/**
|
|
21
26
|
* The one word that is not plain: `runs list` matches `command:` exactly, so a `<noun> sync` is found only as the
|
|
22
27
|
* quoted phrase, `command:"meetings sync" status:success`. Desktop runs it without a shell and accepts this form in
|
|
23
28
|
* `sync.last` only.
|
|
29
|
+
*
|
|
30
|
+
* @experimental
|
|
24
31
|
*/
|
|
25
32
|
export declare const SYNC_QUERY: RegExp;
|
|
26
33
|
declare const signInSchema: v.StrictObjectSchema<{
|
|
@@ -151,6 +158,7 @@ declare const desktopSchema: v.StrictObjectSchema<{
|
|
|
151
158
|
readonly transcript: 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>]>;
|
|
152
159
|
}, undefined>, undefined>;
|
|
153
160
|
}, undefined>;
|
|
161
|
+
/** @experimental */
|
|
154
162
|
export type ManifestDesktop = v.InferOutput<typeof desktopSchema>;
|
|
155
163
|
export declare const manifestSchema: v.StrictObjectSchema<{
|
|
156
164
|
readonly wcat_manifest: v.LiteralSchema<2, undefined>;
|
|
@@ -287,6 +295,7 @@ export declare const manifestSchema: v.StrictObjectSchema<{
|
|
|
287
295
|
}, undefined>;
|
|
288
296
|
}, undefined>;
|
|
289
297
|
export type Manifest = v.InferOutput<typeof manifestSchema>;
|
|
298
|
+
/** @experimental */
|
|
290
299
|
export declare const manifestJsonSchema: () => import("@valibot/to-json-schema").JsonSchema;
|
|
291
300
|
/**
|
|
292
301
|
* What a CLI declares for its manifest: its `wcatStart` argument plus cli-core's `AppIdentity` folders, the tagline
|
|
@@ -330,6 +339,7 @@ export interface ManifestInput {
|
|
|
330
339
|
/** Whether the package ships a `skills/` folder. */
|
|
331
340
|
skills: boolean;
|
|
332
341
|
}
|
|
342
|
+
/** @experimental */
|
|
333
343
|
export declare class ManifestError extends Error {
|
|
334
344
|
readonly problems: readonly string[];
|
|
335
345
|
constructor(problems: readonly string[]);
|
package/dist/wcat/manifest.js
CHANGED
|
@@ -10,6 +10,7 @@ import { HOST_PATTERN } from "../http/hosts.js";
|
|
|
10
10
|
import { effectsSchema } from "../standards/effects.js";
|
|
11
11
|
import { issuesOf, jsonSchemaOf, SNAKE_CASE } from "../standards/registry.js";
|
|
12
12
|
import { PROGRAM_PREFIX, TOOL_NAME } from "./names.js";
|
|
13
|
+
/** @experimental */
|
|
13
14
|
export const MANIFEST_FORMAT = 2;
|
|
14
15
|
export const MANIFEST_FILE = "contracts/wirecat.json";
|
|
15
16
|
/**
|
|
@@ -25,7 +26,11 @@ export const SHARED_HOSTS = [
|
|
|
25
26
|
"github.com",
|
|
26
27
|
"*.githubusercontent.com",
|
|
27
28
|
];
|
|
28
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Desktop's `plain_word`: letters, digits and `._:=,/+@-`, at most two leading dashes, `--` alone, `{name}` slots.
|
|
31
|
+
*
|
|
32
|
+
* @experimental
|
|
33
|
+
*/
|
|
29
34
|
export const PLAIN_WORD = /^(?:--|-{0,2}(?:[A-Za-z0-9]|\{[A-Za-z]+\})(?:[A-Za-z0-9._:=,/+@-]|\{[A-Za-z]+\})*)$/;
|
|
30
35
|
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`));
|
|
31
36
|
const words = v.pipe(v.array(plainWord), v.minLength(1));
|
|
@@ -33,6 +38,8 @@ const words = v.pipe(v.array(plainWord), v.minLength(1));
|
|
|
33
38
|
* The one word that is not plain: `runs list` matches `command:` exactly, so a `<noun> sync` is found only as the
|
|
34
39
|
* quoted phrase, `command:"meetings sync" status:success`. Desktop runs it without a shell and accepts this form in
|
|
35
40
|
* `sync.last` only.
|
|
41
|
+
*
|
|
42
|
+
* @experimental
|
|
36
43
|
*/
|
|
37
44
|
export const SYNC_QUERY = /^command:"[a-z0-9][a-z0-9-]*(?: [a-z0-9][a-z0-9-]*)+" status:success$/;
|
|
38
45
|
const lastWords = v.pipe(v.array(v.union([plainWord, v.pipe(v.string(), v.regex(SYNC_QUERY))])), v.minLength(1));
|
|
@@ -164,7 +171,9 @@ export const manifestSchema = v.strictObject({
|
|
|
164
171
|
network: v.optional(networkSchema),
|
|
165
172
|
desktop: desktopSchema,
|
|
166
173
|
});
|
|
174
|
+
/** @experimental */
|
|
167
175
|
export const manifestJsonSchema = () => jsonSchemaOf(manifestSchema);
|
|
176
|
+
/** @experimental */
|
|
168
177
|
export class ManifestError extends Error {
|
|
169
178
|
problems;
|
|
170
179
|
constructor(problems) {
|
|
@@ -412,10 +412,11 @@ does not take a reserved one.
|
|
|
412
412
|
answer `--wcat-describe`. `cli-dev manifest --program dist/program.js --identity dist/wcat.js --check` fails when
|
|
413
413
|
`contracts/wirecat.json` is stale. `cli-dev release-pr` fails the pull request that raises the version from `0.0.0`,
|
|
414
414
|
the version `new` writes, when `package.json` has no `wcat-` `"bin"` key.
|
|
415
|
-
- **Exceptions:**
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
415
|
+
- **Exceptions:** a short `"bin"` key beside a `wcat-<name>` key that runs the same file is allowed, and `cli-dev lint`
|
|
416
|
+
says nothing about it: the template installs both while users move to the long name. A short key alone, or one that
|
|
417
|
+
runs another file, gets the warning. A CLI that keeps such a key says why in `lint/overrides.json`
|
|
418
|
+
(`"rule": "wcat-bin-name"`, the target as the warning prints it), which silences the warning and counts against the
|
|
419
|
+
budget. Either is allowed: the warning is not a failure.
|
|
419
420
|
An override covers the short name only, never a CLI with no `wcat-<name>`: `cli-dev release-pr` does not read
|
|
420
421
|
`lint/overrides.json`.
|
|
421
422
|
A WireCat CLI listed in Desktop's own catalog needs no manifest until Desktop reads one for it.
|
package/docs/standards/docs.md
CHANGED
|
@@ -157,11 +157,14 @@ Rule ids on this page are `WC-DOC-<n>`. How to read a rule, how ids work and whi
|
|
|
157
157
|
- **Applies to:** all CLIs and shared libraries. **Since:** cli-base 0.41.0; the empty-section check since the
|
|
158
158
|
release after 0.93.0. **Rulings:** none.
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
<a id="wc-doc-15--changelog-entries-go-under-five-fixed-headings-each-at-most-once-per-section"></a>
|
|
161
|
+
|
|
162
|
+
### WC-DOC-15 · Changelog entries go under seven fixed headings, each at most once per section
|
|
161
163
|
|
|
162
164
|
- **Why:** one heading set lets a reader, an agent and one guard read every repository the same way.
|
|
163
165
|
- **Enforced by:** `pnpm docs:check` · `changelog-guard.yml`.
|
|
164
|
-
- **Example:** `### Added`, `### Changed — may break callers`, `###
|
|
166
|
+
- **Example:** `### Added`, `### Changed — may break callers`, `### Changed — experimental`, `### Deprecated`, `### Fixed`,
|
|
167
|
+
`### Security`, `### Removed`. max-cli
|
|
165
168
|
uses this fixed Russian rendering: `Что нового`, `Изменено — может сломать скрипты`, `Исправлено`, `Безопасность`,
|
|
166
169
|
`Удалено`. Every entry sits under one of them: `docs:check` refuses an entry under no heading in the top
|
|
167
170
|
section.
|
|
@@ -82,16 +82,44 @@ on the [CI](ci.md) page.
|
|
|
82
82
|
- **Exceptions:** a shared library that prints no version has no `src/version.ts`.
|
|
83
83
|
- **Applies to:** all CLIs. **Since:** cli-base 0.41.0. **Rulings:** none.
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
<a id="wc-rel-7--versions-are-xyz-before-100-a-breaking-change-raises-the-minor"></a>
|
|
86
86
|
|
|
87
|
-
-
|
|
88
|
-
|
|
89
|
-
- **
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
-
|
|
94
|
-
|
|
87
|
+
### WC-REL-7 · Versions are `x.y.z`; a break of the stable API raises the major from 1.0.0 on, and the minor before it
|
|
88
|
+
|
|
89
|
+
- **Why:** npm's `^1.4.0` takes every `1.x`, so a minor reaches callers who never read its changelog: it must not break
|
|
90
|
+
what the package promises to keep. A library promises only its stable API; what it marks experimental may change in
|
|
91
|
+
a minor, so majors stay rare and work does not wait for them (NEED-2893).
|
|
92
|
+
- **Enforced by:** `<app>: bin/release`, which also stops a version that raises the major unless it runs with
|
|
93
|
+
--major; `release-start.yml:prepare`, which collects the changes/ fragments, takes the level they need and stops a
|
|
94
|
+
major unless the release starts with major allowed; `node-ci.yml:check`, which runs cli-dev api-report --check;
|
|
95
|
+
`changelog-guard.yml:guard`, which asks for the heading a change to the API report needs and for the major label.
|
|
96
|
+
- **Example:**
|
|
97
|
+
- A break of the stable API goes under "Changed — may break callers" or "Removed". Before 1.0.0 it raises the
|
|
98
|
+
minor (`0.40.4` to `0.41.0`); from 1.0.0 on, the major (`1.4.0` to `2.0.0`).
|
|
99
|
+
- A change to what the library marks experimental goes under "Changed — experimental". A stable API that a later
|
|
100
|
+
major removes is marked deprecated and listed under "Deprecated". Both raise the minor, as "Added" does.
|
|
101
|
+
- Raise the patch (`1.4.0` to `1.4.1`) only when every entry is a fix or a change to the documents.
|
|
102
|
+
- A stable break waits for a major the owner chose. Until then it lands as an addition beside the old API, which is
|
|
103
|
+
deprecated, never as a change in place.
|
|
104
|
+
- **How a library marks its stable API.** `package.json` lists the stable entry points, the `exports` keys:
|
|
105
|
+
`"wirecat": { "stable": [".", "./paths"] }`. An entry point not listed is experimental as a whole. Inside a stable
|
|
106
|
+
entry point, a declaration whose TSDoc says `@experimental` is experimental; `@deprecated` keeps its usual meaning.
|
|
107
|
+
A package with no `wirecat.stable` list has no API check.
|
|
108
|
+
- **The API report.** `cli-dev api-report` builds the package and writes `api/<entry>.api.txt` for each stable entry
|
|
109
|
+
point: one line per line of each stable declaration, as `<name> · <kind> · <declaration text>`, sorted by name and
|
|
110
|
+
without comments. Commit it with the change. In CI, `cli-dev api-report --check` fails when it differs from the
|
|
111
|
+
build.
|
|
112
|
+
- **The changelog guard reads the report's diff.** A pull request that removes or changes a line needs an entry under
|
|
113
|
+
"Changed — may break callers" or "Removed"; one that only adds lines needs one under "Added". From 1.0.0 on, a pull
|
|
114
|
+
request with an entry under either break heading also needs the `major` label, and waits for the next major. A
|
|
115
|
+
report the base did not have is a first one and needs nothing.
|
|
116
|
+
- **What the report does not see:** a change in behaviour, in JSON output or in a type the stable declarations import
|
|
117
|
+
from a file the entry point does not export; adding a required field to an options type shows as an addition. Pick
|
|
118
|
+
the heading for those by hand.
|
|
119
|
+
- **Exceptions:** a pre-release version (`1.0.0-rc.1`) is chosen by hand and published under npm's `next` tag; the
|
|
120
|
+
version check reads the last plain release as the one below it.
|
|
121
|
+
- **Applies to:** all CLIs and shared libraries. **Since:** cli-base 0.41.0; the 1.0.0 rules since the next release.
|
|
122
|
+
**Rulings:** NEED-2893.
|
|
95
123
|
|
|
96
124
|
### WC-REL-8 · Any package may release at any time
|
|
97
125
|
|
|
@@ -94,7 +94,7 @@ plus community itself. cli-template follows every rule here as a CLI does
|
|
|
94
94
|
`node-22` job.
|
|
95
95
|
- **Exceptions:** cli-docs and community publish no runtime package. tg needs `^22.19.0`. memo, drive, cli-base and
|
|
96
96
|
the CLIs made from a template before 0.11.0 do not run Node 22 in any workflow yet.
|
|
97
|
-
|
|
97
|
+
The unit suite runs on Windows and macOS for tg, max and drive
|
|
98
98
|
(`platforms: true`), and for gcal at release, monthly and on a manual run; zoom and memo still fail tests there,
|
|
99
99
|
so theirs is off.
|
|
100
100
|
- **Applies to:** the CLIs, cli-core and cli-base. **Since:** cli-base 0.41.0. **Rulings:** NEED-11.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-rc.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",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"type": "module",
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": "^22.16.0 || >=24"
|
|
18
18
|
},
|
|
19
19
|
"packageManager": "pnpm@11.28.8",
|
|
20
20
|
"files": [
|
|
@@ -108,7 +108,25 @@
|
|
|
108
108
|
"./tsconfig.test.json": "./config/tsconfig.test.json",
|
|
109
109
|
"./tsconfig.scripts.json": "./config/tsconfig.scripts.json",
|
|
110
110
|
"./lefthook.yml": "./config/lefthook.yml",
|
|
111
|
-
"./cspell": "./config/cspell.json"
|
|
111
|
+
"./cspell": "./config/cspell.json",
|
|
112
|
+
"./package.json": "./package.json"
|
|
113
|
+
},
|
|
114
|
+
"wirecat": {
|
|
115
|
+
"stable": [
|
|
116
|
+
".",
|
|
117
|
+
"./http",
|
|
118
|
+
"./commands",
|
|
119
|
+
"./completion",
|
|
120
|
+
"./update",
|
|
121
|
+
"./codegen/runtime",
|
|
122
|
+
"./skill",
|
|
123
|
+
"./mcp",
|
|
124
|
+
"./query",
|
|
125
|
+
"./standards",
|
|
126
|
+
"./standards/tables",
|
|
127
|
+
"./wcat/start",
|
|
128
|
+
"./wcat/manifest"
|
|
129
|
+
]
|
|
112
130
|
},
|
|
113
131
|
"scripts": {
|
|
114
132
|
"build": "tsc --build --force",
|
|
@@ -163,10 +181,10 @@
|
|
|
163
181
|
},
|
|
164
182
|
"peerDependencies": {
|
|
165
183
|
"@scalar/openapi-upgrader": "^0.4.6",
|
|
166
|
-
"commander": "
|
|
184
|
+
"commander": "^15.0.0",
|
|
167
185
|
"esbuild": "^0.28.0",
|
|
168
186
|
"swagger-converter": "^2.1.0",
|
|
169
|
-
"vitest": "
|
|
187
|
+
"vitest": "^5.0.0"
|
|
170
188
|
},
|
|
171
189
|
"peerDependenciesMeta": {
|
|
172
190
|
"@scalar/openapi-upgrader": {
|