@wirecat/cli-base 0.118.0 → 0.119.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 CHANGED
@@ -8,6 +8,27 @@ Versions before 0.8.0 are in the [git tags](https://github.com/WireCatLabs/cli-b
8
8
  Every entry says what changed as a caller sees it, why, and what to watch for — the rules are
9
9
  [`docs/dev/CONVENTIONS.md`](docs/dev/CONVENTIONS.md#the-changelog).
10
10
 
11
+ ## 0.119.0 — 18.11.2026
12
+
13
+ ### Added
14
+
15
+ - **The manifest tells WireCat Desktop how to remove an account.** `desktop.accountRemove` is written from the
16
+ command tree: `signOut` when the CLI has `session end`, `remove` when its `account remove` takes `--keep-data`,
17
+ `--delete-data` and `--dry-run`. The key is left out for a CLI with neither, because a Desktop that does
18
+ not read it refuses the whole manifest. See [the reference](docs/REFERENCE.md). Watch for: WireCat Desktop
19
+ 0.7.2 and older refuse a manifest with the key; 0.7.3 reads it.
20
+
21
+ ### Fixed
22
+
23
+ - **WireCat Desktop shows when a `<noun> sync` last ran.** For `meetings sync`, `desktop.sync.last` was `null`; it is
24
+ now `runs list 'command:"meetings sync" status:success'`, one word as in Desktop's catalog. It is the one word the
25
+ manifest takes that is not plain, and only in `sync.last`. See [the reference](docs/REFERENCE.md). Desktop 0.7.3
26
+ accepts it.
27
+ - **A schema's `additionalProperties: true` (or `{}`) stays open.** `adaptOpenApi` dropped it, so `fakeApi` refused
28
+ every field of an object the spec leaves open, such as Attio's records filter and its `$or`, as "no such field".
29
+ - **`cli-dev ready` knows the tracker category** that `new` writes (`tracker`, or its label "issue tracker (issues,
30
+ projects, teams)") and asks for cli-core's `trackerSourceContract`. A tracker CLI got "is no category new writes".
31
+
11
32
  ## 0.118.0 — 18.11.2026
12
33
 
13
34
  ### Added
@@ -374,10 +374,14 @@ class Adapter {
374
374
  properties,
375
375
  required: Array.isArray(source.required) ? source.required.map(String) : [],
376
376
  };
377
- // `true` and `{}` say "anything else may appear", which a loose object already allows.
377
+ // `true` and `{}` say "anything else may appear": kept as any value, so a strict fake takes a field the spec leaves
378
+ // open (Attio's records filter, whose `$or` it lists nowhere).
378
379
  if (isObject(source.additionalProperties) && Object.keys(source.additionalProperties).length > 0) {
379
380
  node.additionalProperties = this.schema(source.additionalProperties, `${where}.*`);
380
381
  }
382
+ else if (source.additionalProperties === true || isObject(source.additionalProperties)) {
383
+ node.additionalProperties = { type: "unknown" };
384
+ }
381
385
  return node;
382
386
  }
383
387
  /** OpenAPI 3.1 writes a nullable reference as `oneOf: [{$ref}, {type: "null"}]`. */
package/dist/dev/ready.js CHANGED
@@ -30,6 +30,7 @@ const CATEGORY_CONTRACTS = [
30
30
  "meetingTranscriptStoreContract",
31
31
  ],
32
32
  },
33
+ { names: ["tracker", "issue tracker (issues, projects, teams)"], contracts: ["trackerSourceContract"] },
33
34
  { names: ["messenger", "notes"], contracts: [] },
34
35
  ];
35
36
  const DESIGN = "docs/dev/DESIGN.md";
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * `contracts/wirecat.json`, format 2: what a CLI tells WireCat Desktop about itself, built from its command tree so
3
3
  * nothing in it is typed by hand except the tagline and the sign-in texts. Desktop reads it out of the npm tarball
4
- * without running the package, so every array holds plain words only: the same rule as Desktop's `community.rs`.
4
+ * without running the package, so every array holds plain words only, the same rule as Desktop's `community.rs`, but
5
+ * the one query in `sync.last` (`SYNC_QUERY`).
5
6
  */
6
7
  import * as v from "valibot";
7
8
  import { type CommandInfo } from "../commands/registry.js";
@@ -16,6 +17,12 @@ export declare const MANIFEST_FILE = "contracts/wirecat.json";
16
17
  export declare const SHARED_HOSTS: readonly string[];
17
18
  /** Desktop's `plain_word`: letters, digits and `._:=,/+@-`, at most two leading dashes, `--` alone, `{name}` slots. */
18
19
  export declare const PLAIN_WORD: RegExp;
20
+ /**
21
+ * The one word that is not plain: `runs list` matches `command:` exactly, so a `<noun> sync` is found only as the
22
+ * quoted phrase, `command:"meetings sync" status:success`. Desktop runs it without a shell and accepts this form in
23
+ * `sync.last` only.
24
+ */
25
+ export declare const SYNC_QUERY: RegExp;
19
26
  declare const signInSchema: v.StrictObjectSchema<{
20
27
  /** What signing in lets the agent do, in a sentence: "Lets your agent read your Acme contacts." */
21
28
  readonly gives: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "one line of text">, v.MaxLengthAction<string, number, undefined>]>;
@@ -87,7 +94,7 @@ declare const desktopSchema: v.StrictObjectSchema<{
87
94
  readonly tasks: v.NullSchema<undefined>;
88
95
  readonly sync: v.NullableSchema<v.StrictObjectSchema<{
89
96
  readonly run: 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>]>;
90
- readonly last: v.NullableSchema<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>;
97
+ readonly last: v.NullableSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[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>]>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>], undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>]>, undefined>;
91
98
  readonly lastShape: v.LiteralSchema<"runs", undefined>;
92
99
  readonly what: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "one line of text">, v.MaxLengthAction<string, number, undefined>]>;
93
100
  readonly note: v.NullSchema<undefined>;
@@ -105,6 +112,22 @@ declare const desktopSchema: v.StrictObjectSchema<{
105
112
  readonly env: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "an upper-case environment prefix">]>;
106
113
  }, undefined>;
107
114
  readonly settings: v.NullSchema<undefined>;
115
+ /**
116
+ * Removing one account: `session end` signs it out, cli-core's `account remove` forgets it. `removes` and `keeps`
117
+ * say what the sign-out alone takes and leaves. Left out when the CLI has neither, like `meetings`.
118
+ */
119
+ readonly accountRemove: v.OptionalSchema<v.StrictObjectSchema<{
120
+ readonly signOut: v.NullableSchema<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>;
121
+ readonly remove: v.NullableSchema<v.StrictObjectSchema<{
122
+ readonly minVersion: v.LiteralSchema<"0.0.0", undefined>;
123
+ readonly keepData: 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>]>;
124
+ readonly deleteData: 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>]>;
125
+ readonly dryRun: 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>]>;
126
+ readonly confirm: 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>]>;
127
+ }, undefined>, undefined>;
128
+ readonly removes: v.ArraySchema<v.LiteralSchema<"signIn", undefined>, undefined>;
129
+ readonly keeps: v.ArraySchema<v.PicklistSchema<["settings", "data", "listed"], undefined>, undefined>;
130
+ }, undefined>, undefined>;
108
131
  /**
109
132
  * How a client's call or a meeting this tool saved opens: Desktop finds the tool by `provider`. Left out, not `null`,
110
133
  * when the tool records none, because Desktop 0.6.8 and older refuse a manifest with a key they do not read.
@@ -196,7 +219,7 @@ export declare const manifestSchema: v.StrictObjectSchema<{
196
219
  readonly tasks: v.NullSchema<undefined>;
197
220
  readonly sync: v.NullableSchema<v.StrictObjectSchema<{
198
221
  readonly run: 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>]>;
199
- readonly last: v.NullableSchema<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>;
222
+ readonly last: v.NullableSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[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>]>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>], undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>]>, undefined>;
200
223
  readonly lastShape: v.LiteralSchema<"runs", undefined>;
201
224
  readonly what: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "one line of text">, v.MaxLengthAction<string, number, undefined>]>;
202
225
  readonly note: v.NullSchema<undefined>;
@@ -214,6 +237,22 @@ export declare const manifestSchema: v.StrictObjectSchema<{
214
237
  readonly env: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "an upper-case environment prefix">]>;
215
238
  }, undefined>;
216
239
  readonly settings: v.NullSchema<undefined>;
240
+ /**
241
+ * Removing one account: `session end` signs it out, cli-core's `account remove` forgets it. `removes` and `keeps`
242
+ * say what the sign-out alone takes and leaves. Left out when the CLI has neither, like `meetings`.
243
+ */
244
+ readonly accountRemove: v.OptionalSchema<v.StrictObjectSchema<{
245
+ readonly signOut: v.NullableSchema<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>;
246
+ readonly remove: v.NullableSchema<v.StrictObjectSchema<{
247
+ readonly minVersion: v.LiteralSchema<"0.0.0", undefined>;
248
+ readonly keepData: 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>]>;
249
+ readonly deleteData: 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>]>;
250
+ readonly dryRun: 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>]>;
251
+ readonly confirm: 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>]>;
252
+ }, undefined>, undefined>;
253
+ readonly removes: v.ArraySchema<v.LiteralSchema<"signIn", undefined>, undefined>;
254
+ readonly keeps: v.ArraySchema<v.PicklistSchema<["settings", "data", "listed"], undefined>, undefined>;
255
+ }, undefined>, undefined>;
217
256
  /**
218
257
  * How a client's call or a meeting this tool saved opens: Desktop finds the tool by `provider`. Left out, not `null`,
219
258
  * when the tool records none, because Desktop 0.6.8 and older refuse a manifest with a key they do not read.
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * `contracts/wirecat.json`, format 2: what a CLI tells WireCat Desktop about itself, built from its command tree so
3
3
  * nothing in it is typed by hand except the tagline and the sign-in texts. Desktop reads it out of the npm tarball
4
- * without running the package, so every array holds plain words only: the same rule as Desktop's `community.rs`.
4
+ * without running the package, so every array holds plain words only, the same rule as Desktop's `community.rs`, but
5
+ * the one query in `sync.last` (`SYNC_QUERY`).
5
6
  */
6
7
  import * as v from "valibot";
7
8
  import { flatten, summaryOf } from "../commands/registry.js";
@@ -28,6 +29,13 @@ export const SHARED_HOSTS = [
28
29
  export const PLAIN_WORD = /^(?:--|-{0,2}(?:[A-Za-z0-9]|\{[A-Za-z]+\})(?:[A-Za-z0-9._:=,/+@-]|\{[A-Za-z]+\})*)$/;
29
30
  const plainWord = v.pipe(v.string(), v.maxLength(100, "a command word is at most 100 characters"), v.regex(PLAIN_WORD, (issue) => `${JSON.stringify(issue.input)} is not a plain word: letters, digits and ._:=,/+@-, at most two leading dashes, -- alone and {name} slots; no spaces, quotes or shell syntax`));
30
31
  const words = v.pipe(v.array(plainWord), v.minLength(1));
32
+ /**
33
+ * The one word that is not plain: `runs list` matches `command:` exactly, so a `<noun> sync` is found only as the
34
+ * quoted phrase, `command:"meetings sync" status:success`. Desktop runs it without a shell and accepts this form in
35
+ * `sync.last` only.
36
+ */
37
+ export const SYNC_QUERY = /^command:"[a-z0-9][a-z0-9-]*(?: [a-z0-9][a-z0-9-]*)+" status:success$/;
38
+ const lastWords = v.pipe(v.array(v.union([plainWord, v.pipe(v.string(), v.regex(SYNC_QUERY))])), v.minLength(1));
31
39
  const line = (max) => v.pipe(v.string(), v.regex(/^\S(?:[^\n\r]*\S)?$/, "one line of text"), v.maxLength(max));
32
40
  /**
33
41
  * A sign-in Desktop runs in its own window. Only the parts Desktop accepts from a tool it did not build: the words, and
@@ -70,7 +78,7 @@ const desktopSchema = v.strictObject({
70
78
  tasks: v.null(),
71
79
  sync: v.nullable(v.strictObject({
72
80
  run: words,
73
- last: v.nullable(words),
81
+ last: v.nullable(lastWords),
74
82
  lastShape: v.literal("runs"),
75
83
  what: line(40),
76
84
  note: v.null(),
@@ -88,6 +96,22 @@ const desktopSchema = v.strictObject({
88
96
  env: v.pipe(v.string(), v.regex(/^[A-Z][A-Z0-9_]*$/, "an upper-case environment prefix")),
89
97
  }),
90
98
  settings: v.null(),
99
+ /**
100
+ * Removing one account: `session end` signs it out, cli-core's `account remove` forgets it. `removes` and `keeps`
101
+ * say what the sign-out alone takes and leaves. Left out when the CLI has neither, like `meetings`.
102
+ */
103
+ accountRemove: v.optional(v.strictObject({
104
+ signOut: v.nullable(words),
105
+ remove: v.nullable(v.strictObject({
106
+ minVersion: v.literal("0.0.0"),
107
+ keepData: words,
108
+ deleteData: words,
109
+ dryRun: plainWord,
110
+ confirm: plainWord,
111
+ })),
112
+ removes: v.array(v.literal("signIn")),
113
+ keeps: v.array(v.picklist(["settings", "data", "listed"])),
114
+ })),
91
115
  /**
92
116
  * How a client's call or a meeting this tool saved opens: Desktop finds the tool by `provider`. Left out, not `null`,
93
117
  * when the tool records none, because Desktop 0.6.8 and older refuse a manifest with a key they do not read.
@@ -187,10 +211,8 @@ export const buildManifest = ({ identity, commands, pkg, skills }) => {
187
211
  throw new ManifestError([
188
212
  `no syncs: \`${syncPath.join(" ")}\` exists, so add \`syncs\`, what it copies in at most 40 characters`,
189
213
  ]);
190
- // `runs list` matches `command:` exactly and a plain word holds no space, so only a one-word path can be found.
191
- const last = syncPath?.length === 1 && has("runs list")
192
- ? ["runs", "list", "command:sync", "status:success", "--limit", "50", "--no-record", "--json"]
193
- : null;
214
+ const query = syncPath?.length === 1 ? ["command:sync", "status:success"] : [`command:"${syncPath?.join(" ")}" status:success`];
215
+ const last = syncPath && has("runs list") ? ["runs", "list", ...query, "--limit", "50", "--no-record", "--json"] : null;
194
216
  const sync = syncPath
195
217
  ? {
196
218
  run: [...profile, ...syncPath, "--record", "--json"],
@@ -213,6 +235,28 @@ export const buildManifest = ({ identity, commands, pkg, skills }) => {
213
235
  },
214
236
  }
215
237
  : {};
238
+ const signOut = profiles && has("session end") ? [...profile, "session", "end", "--record", "--json"] : null;
239
+ // `--yes` is a global flag of cli-core's programs, read with optsWithGlobals, so `account remove` does not list it.
240
+ const remove = profiles && ["--keep-data", "--delete-data", "--dry-run"].every((flag) => takes("account remove", flag))
241
+ ? {
242
+ // The manifest ships inside the version it describes, so that version always has the command.
243
+ minVersion: "0.0.0",
244
+ keepData: [...profile, "account", "remove", "--keep-data", "--record", "--json"],
245
+ deleteData: [...profile, "account", "remove", "--delete-data", "--record", "--json"],
246
+ dryRun: "--dry-run",
247
+ confirm: "--yes",
248
+ }
249
+ : null;
250
+ const accountRemove = signOut || remove
251
+ ? {
252
+ accountRemove: {
253
+ signOut,
254
+ remove,
255
+ removes: signOut ? ["signIn"] : [],
256
+ keeps: signOut ? ["settings", "data", "listed"] : [],
257
+ },
258
+ }
259
+ : {};
216
260
  const methods = identity.signIn?.methods;
217
261
  for (const method of methods ?? []) {
218
262
  const [first, ...rest] = method.words;
@@ -311,6 +355,7 @@ export const buildManifest = ({ identity, commands, pkg, skills }) => {
311
355
  storeReset: null,
312
356
  storage: { app: identity.appName, env: identity.envPrefix },
313
357
  settings: null,
358
+ ...accountRemove,
314
359
  ...meetings,
315
360
  },
316
361
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-base",
3
- "version": "0.118.0",
3
+ "version": "0.119.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",