@wirecat/cli-base 0.132.0 → 1.0.0-rc.1

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.
Files changed (104) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/README.md +7 -1
  3. package/dist/batch.d.ts +1 -0
  4. package/dist/batch.js +1 -0
  5. package/dist/codegen/graphql-fake.d.ts +1 -1
  6. package/dist/codegen/graphql-fake.js +1 -1
  7. package/dist/codegen/graphql.d.ts +1 -12
  8. package/dist/codegen/graphql.js +0 -44
  9. package/dist/codegen/index.d.ts +4 -3
  10. package/dist/codegen/index.js +2 -1
  11. package/dist/codegen/manifest.js +2 -2
  12. package/dist/codegen/model.d.ts +4 -1
  13. package/dist/codegen/pipeline.d.ts +5 -5
  14. package/dist/codegen/runtime.d.ts +9 -2
  15. package/dist/codegen/runtime.js +7 -1
  16. package/dist/codegen/selection.d.ts +13 -0
  17. package/dist/codegen/selection.js +44 -0
  18. package/dist/codegen/wp-json.d.ts +2 -2
  19. package/dist/commands/document.d.ts +3 -0
  20. package/dist/commands/document.js +3 -0
  21. package/dist/commands/page.d.ts +14 -2
  22. package/dist/commands/page.js +3 -0
  23. package/dist/completion/index.d.ts +5 -1
  24. package/dist/completion/index.js +5 -1
  25. package/dist/credentials.d.ts +2 -0
  26. package/dist/credentials.js +2 -0
  27. package/dist/dev/api-report.d.ts +24 -0
  28. package/dist/dev/api-report.js +345 -0
  29. package/dist/dev/main.js +9 -19
  30. package/dist/dev/next-version.d.ts +5 -1
  31. package/dist/dev/next-version.js +30 -2
  32. package/dist/dev/result-shape.d.ts +4 -0
  33. package/dist/dev/result-shape.js +4 -4
  34. package/dist/dev/wcat-lint.d.ts +4 -1
  35. package/dist/dev/wcat-lint.js +9 -2
  36. package/dist/executable.d.ts +2 -0
  37. package/dist/executable.js +2 -0
  38. package/dist/http/fetch.d.ts +1 -0
  39. package/dist/http/fetch.js +1 -0
  40. package/dist/http/hosts.d.ts +11 -2
  41. package/dist/http/hosts.js +11 -2
  42. package/dist/http/index.d.ts +10 -2
  43. package/dist/http/index.js +10 -2
  44. package/dist/index.d.ts +2 -2
  45. package/dist/index.js +2 -2
  46. package/dist/logging.d.ts +3 -0
  47. package/dist/logging.js +3 -0
  48. package/dist/mcp/index.d.ts +17 -3
  49. package/dist/mcp/index.js +12 -2
  50. package/dist/output-buffer.d.ts +3 -0
  51. package/dist/output-buffer.js +1 -0
  52. package/dist/query/dates.d.ts +6 -1
  53. package/dist/query/dates.js +6 -1
  54. package/dist/query/help.d.ts +1 -0
  55. package/dist/query/help.js +1 -0
  56. package/dist/query/registry.d.ts +6 -1
  57. package/dist/query/registry.js +6 -1
  58. package/dist/query/types.d.ts +1 -0
  59. package/dist/query/types.js +1 -0
  60. package/dist/release/fold.d.ts +5 -0
  61. package/dist/release/fold.js +10 -1
  62. package/dist/release/fragments.d.ts +5 -2
  63. package/dist/release/fragments.js +18 -15
  64. package/dist/release/level.js +17 -11
  65. package/dist/skill/index.d.ts +34 -5
  66. package/dist/skill/index.js +21 -3
  67. package/dist/standards/audit.d.ts +15 -1
  68. package/dist/standards/audit.js +12 -1
  69. package/dist/standards/effects.d.ts +2 -0
  70. package/dist/standards/effects.js +1 -0
  71. package/dist/standards/errors.d.ts +2 -0
  72. package/dist/standards/errors.js +2 -0
  73. package/dist/standards/fields.d.ts +3 -0
  74. package/dist/standards/fields.js +2 -0
  75. package/dist/standards/identifiers.d.ts +7 -1
  76. package/dist/standards/identifiers.js +6 -1
  77. package/dist/standards/lint.d.ts +48 -8
  78. package/dist/standards/lint.js +45 -8
  79. package/dist/standards/log.d.ts +15 -3
  80. package/dist/standards/log.js +15 -3
  81. package/dist/standards/monthly.d.ts +2 -0
  82. package/dist/standards/monthly.js +2 -0
  83. package/dist/standards/output.d.ts +8 -1
  84. package/dist/standards/output.js +7 -1
  85. package/dist/standards/registry.d.ts +6 -1
  86. package/dist/standards/registry.js +6 -1
  87. package/dist/standards/steps.d.ts +5 -1
  88. package/dist/standards/steps.js +5 -1
  89. package/dist/standards/vocabulary.d.ts +5 -1
  90. package/dist/standards/vocabulary.js +6 -1
  91. package/dist/testing/index.d.ts +1 -2
  92. package/dist/testing/index.js +1 -2
  93. package/dist/testing/sandbox.js +23 -4
  94. package/dist/update/index.d.ts +25 -4
  95. package/dist/update/index.js +24 -4
  96. package/dist/wcat/manifest.d.ts +11 -1
  97. package/dist/wcat/manifest.js +10 -1
  98. package/docs/standards/accounts.md +5 -4
  99. package/docs/standards/commands.md +5 -4
  100. package/docs/standards/docs.md +5 -2
  101. package/docs/standards/releases.md +37 -9
  102. package/docs/standards/security.md +3 -2
  103. package/docs/standards/toolchain.md +1 -1
  104. package/package.json +23 -5
@@ -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
- /** Fills `{name}` from `values`; a placeholder with no value throws, so a half-filled sentence never ships. */
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
- /** A step's command: a path such as `messages sync`, or `*` for the command that gave the answer (`page.next`). */
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`">]>;
@@ -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
- /** A step's command: a path such as `messages sync`, or `*` for the command that gave the answer (`page.next`). */
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
- /** One word, one meaning within its kind: a second entry for the same verb, noun, view, root or flag is refused. */
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;
@@ -74,7 +74,11 @@ export const vocabularySchema = v.strictObject({
74
74
  roots: v.array(rootSchema),
75
75
  flags: v.array(flagSchema),
76
76
  });
77
- /** One word, one meaning within its kind: a second entry for the same verb, noun, view, root or flag is refused. */
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
+ */
78
82
  export const defineVocabulary = (input) => parseRegistry("vocabulary", vocabularySchema, input, (vocabulary) => {
79
83
  const problems = [];
80
84
  const kinds = {
@@ -300,6 +304,7 @@ const collections = [
300
304
  ["teams", "groups in a tracker that own issues, states and labels"],
301
305
  ["states", "the workflow steps a tracker team moves its issues through, each of a type such as started"],
302
306
  ["labels", "a tracker's shared labels on issues, kept by the tracker and not by the owner"],
307
+ ["sprints", "a tracker team's time-boxed runs of work, such as Linear's cycles, each with a start and an end"],
303
308
  ["fields", "a record type's field definitions: code, label, type and options, such as a CRM's custom fields"],
304
309
  ["activities", "a CRM's calls, e-mails, meetings, to-dos and comments on its records"],
305
310
  ["changes", "what changed in a copied source over a time: records added, moved, closed or reassigned"],
@@ -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 { brokenKeyring, memoryKeyring } from "../keyring.js";
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. */
@@ -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 { brokenKeyring, memoryKeyring } from "../keyring.js";
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. */
@@ -1,10 +1,29 @@
1
- import { mkdirSync, mkdtempSync, rmSync } from "node:fs";
1
+ import { accessSync, constants, mkdirSync, mkdtempSync, rmSync } from "node:fs";
2
2
  import { createRequire } from "node:module";
3
3
  import { tmpdir } from "node:os";
4
4
  import { join } from "node:path";
5
5
  const OVERRIDE = /_(CONFIG|STATE|CACHE)_DIR$/;
6
- // macOS keeps a Unix socket path under 104 bytes, and its per-user temporary folder alone takes about 50.
7
- const baseFor = (platform) => (platform === "darwin" ? "/tmp" : tmpdir());
6
+ const writable = (dir) => {
7
+ if (!dir)
8
+ return false;
9
+ try {
10
+ accessSync(dir, constants.W_OK);
11
+ return true;
12
+ }
13
+ catch {
14
+ return false;
15
+ }
16
+ };
17
+ // macOS keeps a Unix socket path under 104 bytes, and its per-user temporary folder alone takes about 50. On Linux the
18
+ // runtime folder is in memory: a store's every commit waits for fsync, and on a disk other jobs keep busy that made a
19
+ // CRM sync in a test take 14 s instead of 1.5 s, past the test timeout (attio 0.5.1's release, 2026-11-24).
20
+ const baseFor = (platform, env) => {
21
+ if (platform === "darwin")
22
+ return "/tmp";
23
+ if (platform === "linux" && writable(env.XDG_RUNTIME_DIR))
24
+ return env.XDG_RUNTIME_DIR;
25
+ return tmpdir();
26
+ };
8
27
  const LEFT = Symbol.for("@wirecat/cli-base/testing/sandboxes");
9
28
  /**
10
29
  * vitest skips a file's afterAll when the file throws while loading or an earlier afterAll throws,
@@ -46,7 +65,7 @@ const removeOnExit = (dir) => {
46
65
  * process, past the network guard, and print its notice into output the test parses.
47
66
  */
48
67
  export const enterSandbox = (env = process.env, platform = process.platform) => {
49
- const dir = mkdtempSync(join(baseFor(platform), "wirecat-test-"));
68
+ const dir = mkdtempSync(join(baseFor(platform, env), "wirecat-test-"));
50
69
  const forget = removeOnExit(dir);
51
70
  const home = join(dir, "home");
52
71
  mkdirSync(home);
@@ -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
- /** Whether a person is at a terminal who could be told — the only case a check is worth making. */
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
- /** The file as it is, `checkedAt: 0` when it is missing or unreadable. */
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
- /** What the last check found. A missing or unreadable file is "never checked", not an error. */
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
- /** Resolve Windows shims from explicit PATH entries; cross-spawn quotes them through the trusted shell. */
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[];
@@ -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
- /** Whether a person is at a terminal who could be told — the only case a check is worth making. */
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
- /** The file as it is, `checkedAt: 0` when it is missing or unreadable. */
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
- /** What the last check found. A missing or unreadable file is "never checked", not an error. */
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
- /** Resolve Windows shims from explicit PATH entries; cross-spawn quotes them through the trusted shell. */
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) => {
@@ -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
- /** Desktop's `plain_word`: letters, digits and `._:=,/+@-`, at most two leading dashes, `--` alone, `{name}` slots. */
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[]);
@@ -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
- /** Desktop's `plain_word`: letters, digits and `._:=,/+@-`, at most two leading dashes, `--` alone, `{name}` slots. */
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) {
@@ -185,11 +185,12 @@ Every CLI that signs in has four commands under `session`:
185
185
  - **Enforced by:** review only.
186
186
  - **Example:** `gcal personal session status` answers whether the `personal` profile holds a Google login;
187
187
  `gcal session list` lists `personal` and `work` with no profile named.
188
- - **Exceptions:** known gaps, as of 2026-11-12 (gcal and mail have all four):
188
+ - **Exceptions:** known gaps, as of 2026-11-24 (every other CLI that signs in has all four):
189
189
  - tg, max and wa have `session start` and `session end`, no `session status`, and list their profiles with
190
- `account list` instead of `session list`.
191
- - drive has `session start`, `session list` and `session end`, and no `session status`.
192
- - zm has `session start`, `session status` and `session end`, and no `session list`.
190
+ `account list` instead of `session list`. cli-core 0.746.0 gives them both missing commands
191
+ (`messengerSessionCommands`), to add under `session`.
192
+ - drive has `session start`, `session list` and `session end`, and no `session status` until its next release
193
+ (drive-cli #398 adds it).
193
194
  - memo has no `session` group: it has no profiles and reads the stores of the other CLIs, mail's among them.
194
195
 
195
196
  A CLI that adds a missing command adds it under `session`; a renamed path keeps no alias
@@ -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:** `cli-dev lint` warns about every `"bin"` key without the prefix, the short name beside `wcat-<name>`
416
- included. A CLI that keeps the short name says why in `lint/overrides.json` (`"rule": "wcat-bin-name"`, the target
417
- as the warning prints it), which silences the warning and counts against the budget; gcal, pbx and beeline do,
418
- and the other CLIs carry the warning. Either is allowed: the warning is not a failure.
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.
@@ -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
- ### WC-DOC-15 · Changelog entries go under five fixed headings, each at most once per section
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`, `### Fixed`, `### Security`, `### Removed`. max-cli
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
- ### WC-REL-7 · Versions are `x.y.z`; before 1.0.0 a breaking change raises the minor
85
+ <a id="wc-rel-7--versions-are-xyz-before-100-a-breaking-change-raises-the-minor"></a>
86
86
 
87
- - **Why:** npm's `^0.40.4` takes every `0.40.x`, so a patch reaches callers who never read its changelog. It must not
88
- break them.
89
- - **Enforced by:** review only.
90
- - **Example:** raise the minor (`0.40.4` to `0.41.0`) for a release with a new feature or with any entry under
91
- "Changed — may break callers" or "Removed". Raise the patch (`0.40.4` to `0.40.5`) only when every entry is a fix
92
- or a change to the documents.
93
- - **Exceptions:** a pre-release version (`0.41.0-rc.1`) is chosen by hand.
94
- - **Applies to:** all CLIs and shared libraries. **Since:** cli-base 0.41.0. **Rulings:** none.
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
 
@@ -452,10 +452,11 @@ the same. `session start` takes such a token, and the CLI keeps it the way it ke
452
452
  - **Example:** `ydisk personal session start` asks `Yandex Disk OAuth token:` without echo, or reads
453
453
  `ydisk personal session start < token.txt`, asks the Disk whose token it is, and answers
454
454
  `{ "profile": "personal", "state": "saved", "stored_in": "keyring", "verified": true, "user": { … } }`.
455
+ `ydisk personal session end` forgets the token; its help, like ydisk's docs, says the token stays valid until the
456
+ owner removes the app in Yandex ID's Data access (<https://id.yandex.ru/personal/data-access>).
455
457
  - **Exceptions:** a sign-in the CLI runs itself follows
456
458
  [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
+ `bot:<profile>` (WC-SECR-4).
459
460
  - **Applies to:** every CLI whose sign-in takes a token the owner pastes (ydisk today). **Since:** cli-base 0.117.0.
460
461
  **Rulings:** none.
461
462
 
@@ -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
- cli-base's own `engines` is still `>=22`. The unit suite runs on Windows and macOS for tg, max and drive
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.132.0",
3
+ "version": "1.0.0-rc.1",
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": ">=22"
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": ">=15",
184
+ "commander": "^15.0.0",
167
185
  "esbuild": "^0.28.0",
168
186
  "swagger-converter": "^2.1.0",
169
- "vitest": ">=5"
187
+ "vitest": "^5.0.0"
170
188
  },
171
189
  "peerDependenciesMeta": {
172
190
  "@scalar/openapi-upgrader": {