@wirecat/cli-base 0.124.0 → 0.125.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.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,41 @@ 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.125.1 — 21.11.2026
12
+
13
+ ### Fixed
14
+
15
+ - **`packContents` reads npm's JSON from stdout only.** It parsed stdout and stderr together, so a warning npm prints
16
+ after the JSON broke the check with `Unexpected non-whitespace character after JSON`. pnpm 11 passes `npm_config_*`
17
+ variables to scripts, npm warns `Unknown env config "manage-package-manager-versions"`, and notion-cli's
18
+ `pnpm smoke` failed in `bin/release`. A failing `npm pack` still shows both streams. `run` now also returns
19
+ `stdout`.
20
+
21
+ ## 0.125.0 — 19.11.2026
22
+
23
+ ### Added
24
+
25
+ - **`audit --family` installs wordpress.** `@wirecat/wordpress-cli` is on npm since 0.1.0, so the family audit now
26
+ compares it with the other CLIs of its parity group, `shared-roots`.
27
+ - **linear-cli joins `shared-roots`, the family packages and WC-CI-9.** `@wirecat/linear-cli` is on npm since 0.1.0,
28
+ so the family audit compares its root commands with the other CLIs', and its monthly run holds 03:16 UTC. It is the
29
+ first tracker CLI, so its issues commands have no group yet.
30
+ - **`meta.model_run`: what a model a command calls on its own did in the run.** `{ provider, model, endpoint, sent,
31
+ done, left, usage?, cost_usd, ms }`: the items sent, those handled, those left for the next run, the tokens the
32
+ provider counted and the cost when a price is known. cli-core's mail `inbox` reports its sorting run in it
33
+ ([WC-OUT-7](docs/standards/output.md#wc-out-7--put-the-facts-about-the-run-in-meta)).
34
+ - **`--like <text>` in the vocabulary.** A query flag: a made-up example of the text sought, such as a reply that would
35
+ answer the question, searched by meaning beside the query. cli-core's `search conversations` takes it, so an agent
36
+ searches with the question and a guessed answer in one call.
37
+ - **`cli-dev docs-check` refuses a page header YAML cannot read.** It parses each page's `---` header with `yaml`,
38
+ which moves from the development dependencies to the dependencies. An agent that parses a skill's header refuses a
39
+ bad one: wordpress-cli 0.1.0 shipped `description: … site: posts …` unquoted, and cli-docs' sync stopped on it.
40
+
41
+ ### Fixed
42
+
43
+ - `audit --family` installs amo-cli too, so a CRM CLI is measured against amoCRM's beside Bitrix24's: `@wirecat/amo-cli`
44
+ is on npm since 0.1.0.
45
+
11
46
  ## 0.124.0 — 19.11.2026
12
47
 
13
48
  ### Added
@@ -8,7 +8,10 @@ const PACKAGES = new Map([
8
8
  ...FIRST_PARTY_TOOLS.flatMap((tool) => (tool.package ? [[tool.name, tool.package]] : [])),
9
9
  ["gcal", "@wirecat/gcal-cli"],
10
10
  ["b24", "@wirecat/bitrix24-cli"],
11
+ ["amo", "@wirecat/amo-cli"],
11
12
  ["ydisk", "@wirecat/yandex-disk-cli"],
13
+ ["wordpress", "@wirecat/wordpress-cli"],
14
+ ["linear", "@wirecat/linear-cli"],
12
15
  ]);
13
16
  /** Every other CLI of the parity groups that npm has, by name. */
14
17
  export const familyPackages = (groups, own) => new Map([...new Set(groups.flatMap((group) => group.members))]
@@ -18,6 +18,7 @@ export declare const releaseCheck: (checks: readonly Check[], { version, log }:
18
18
  export declare const run: (root: string, command: string, args: readonly string[]) => {
19
19
  ok: boolean;
20
20
  output: string;
21
+ stdout: string;
21
22
  };
22
23
  /** A check that passes when the command exits 0, and otherwise shows the last 15 lines it printed. */
23
24
  export declare const command: (root: string, name: string, ...args: string[]) => () => string[];
@@ -31,7 +31,7 @@ export const releaseCheck = (checks, { version, log }) => {
31
31
  export const run = (root, command, args) => {
32
32
  const done = spawnSync(command, args, { cwd: root, encoding: "utf8", maxBuffer: 64 * 1024 * 1024 });
33
33
  const output = `${done.stdout ?? ""}${done.stderr ?? ""}${done.error ? String(done.error) : ""}`;
34
- return { ok: done.status === 0, output };
34
+ return { ok: done.status === 0, output, stdout: done.stdout ?? "" };
35
35
  };
36
36
  /** A check that passes when the command exits 0, and otherwise shows the last 15 lines it printed. */
37
37
  export const command = (root, name, ...args) => () => {
@@ -49,10 +49,11 @@ export const packProblems = (paths, allowed, said) => paths
49
49
  .filter((path) => !allowed.some((entry) => (entry.endsWith("/") ? path.startsWith(entry) : path === entry)))
50
50
  .map((path) => `npm pack: ${path} would ship — only ${said} may`);
51
51
  export const packContents = (root, allowed, said) => () => {
52
- const { ok, output } = run(root, "npm", ["pack", "--dry-run", "--json", "--ignore-scripts"]);
52
+ const { ok, output, stdout } = run(root, "npm", ["pack", "--dry-run", "--json", "--ignore-scripts"]);
53
53
  if (!ok)
54
54
  return [output.trim()];
55
- const [packed] = JSON.parse(output.slice(output.indexOf("[")));
55
+ // npm warns on stderr, after the JSON too: `Unknown env config` for the npm_config_* that pnpm 11 passes on.
56
+ const [packed] = JSON.parse(stdout);
56
57
  return packProblems((packed?.files ?? []).map(({ path }) => path), allowed, said);
57
58
  };
58
59
  const VERSION = /export const VERSION = "([^"]*)"/;
@@ -43,4 +43,9 @@ export type DocsRules = {
43
43
  /** A link not to follow — a private or sibling checkout that CI does not have. */
44
44
  skipLink?: (target: string, destination: string) => boolean;
45
45
  };
46
+ /**
47
+ * A page header YAML refuses: an agent that parses a skill's header refuses the skill, and wirecat.dev's sync stops on
48
+ * it. wordpress-cli 0.1.0 shipped `description: … site: posts …` unquoted, and every other check passed (BUG-789).
49
+ */
50
+ export declare const frontmatterProblems: (name: string, text: string) => string[];
46
51
  export declare const docsProblems: (root: string, { files, ids, userPage, correction, skipLink }: DocsRules) => string[];
@@ -1,5 +1,6 @@
1
1
  import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
2
2
  import { dirname, join, relative, resolve } from "node:path";
3
+ import { parseDocument } from "yaml";
3
4
  /** The prefixes of the owner's journal ids; a project adds its own (`CLI`, `MAX`, …). */
4
5
  export const JOURNAL_IDS = ["NEED", "FIND", "BUG", "SEC", "PERF", "UX", "IDEA", "RISK", "DEBT", "ASK", "TASK"];
5
6
  export const idPattern = (prefixes) => new RegExp(`\\b(?:${prefixes.join("|")})-\\d+\\b`, "g");
@@ -144,6 +145,17 @@ export const markdownFiles = (directory, skip = new Set()) => existsSync(directo
144
145
  return stats?.isFile() && entry.name.endsWith(".md") ? [path] : [];
145
146
  })
146
147
  : [];
148
+ const FRONTMATTER = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/;
149
+ /**
150
+ * A page header YAML refuses: an agent that parses a skill's header refuses the skill, and wirecat.dev's sync stops on
151
+ * it. wordpress-cli 0.1.0 shipped `description: … site: posts …` unquoted, and every other check passed (BUG-789).
152
+ */
153
+ export const frontmatterProblems = (name, text) => {
154
+ const header = FRONTMATTER.exec(text)?.[1];
155
+ if (header === undefined)
156
+ return [];
157
+ return parseDocument(header).errors.map((error) => `${name}:${(error.linePos?.[0].line ?? 0) + 1}: the header is not valid YAML: ${error.message.split("\n")[0]}`);
158
+ };
147
159
  export const docsProblems = (root, { files, ids, userPage = () => false, correction = /correction \d{4}/i, skipLink = () => false }) => {
148
160
  const id = idPattern(ids);
149
161
  const cache = new Map();
@@ -159,6 +171,7 @@ export const docsProblems = (root, { files, ids, userPage = () => false, correct
159
171
  for (const path of files.filter((file) => existsSync(file))) {
160
172
  const name = relative(root, path);
161
173
  const user = userPage(name);
174
+ problems.push(...frontmatterProblems(name, readFileSync(path, "utf8")));
162
175
  withoutCode(readFileSync(path, "utf8"))
163
176
  .split("\n")
164
177
  .forEach((line, index) => {
@@ -160,6 +160,7 @@ export const PARITY_GROUPS = defineParityGroups([
160
160
  // recordings, not zoom-cli's: they are compared on the root commands every CLI shares, the way gcal and mail are.
161
161
  // amo-cli, hubspot-cli and attio-cli share them too, and their CRM commands are compared with b24 in `crm` below.
162
162
  // wordpress-cli shares only these roots: it is the first content CLI, so its posts commands have no group yet.
163
+ // linear-cli shares only these roots too: it is the first tracker CLI, so its issues commands have no group yet.
163
164
  // notion-cli joins here until its documents commands ship; then it moves next to drive. ydisk joins here too: in "all"
164
165
  // its search and notes differ from the messengers' and memo's as drive's do, and a documents group of drive, notion
165
166
  // and ydisk differs in 39 paths (session, folders browse, summaries; measured on the published CLIs 2026-11-17).
@@ -181,12 +182,13 @@ export const PARITY_GROUPS = defineParityGroups([
181
182
  "attio",
182
183
  "ydisk",
183
184
  "wordpress",
185
+ "linear",
184
186
  ],
185
187
  covers: ["commands", "doctor", "skill", "mcp", "upgrade"],
186
188
  differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP],
187
189
  },
188
- // The CRM CLIs on cli-core's shared CRM commands. amo-cli (amoCRM and Kommo) is not on npm yet and hubspot-cli is
189
- // not in the family packages, so `audit --family` skips them, as beeline. Only b24 and hubspot have `leads` (amoCRM
190
+ // The CRM CLIs on cli-core's shared CRM commands. hubspot-cli is not in the family packages, so `audit --family`
191
+ // skips it, as beeline. Only b24 and hubspot have `leads` (amoCRM
190
192
  // has no lead apart from a deal), only b24 has `products` (amo leaves them for later) and `deals delete` (amoCRM's
191
193
  // API v4 cannot delete a lead, https://www.amocrm.ru/developers/content/crm_platform/leads-api), and hubspot writes
192
194
  // no deals yet; a list of roots does not compare presence, so these need no difference. `people`, `organizations`,
@@ -0,0 +1,3 @@
1
+ import type { VocabularyFlag } from "./vocabulary.js";
2
+ /** What a search by meaning reads besides its query. */
3
+ export declare const SEARCH_FLAGS: VocabularyFlag[];
@@ -0,0 +1,11 @@
1
+ /** What a search by meaning reads besides its query. */
2
+ export const SEARCH_FLAGS = [
3
+ {
4
+ name: "--like",
5
+ value: "<text>",
6
+ role: "query",
7
+ type: "string",
8
+ meaning: "a made-up example of the text sought, such as a reply that would answer the question, searched by meaning " +
9
+ "beside the query",
10
+ },
11
+ ];
@@ -2,6 +2,6 @@ export { EFFECT_LEVELS, type EffectLevel, type Effects, effectsSchema, writes }
2
2
  export { BASE_REASONS, COMMON_DETAILS, CRASH_CODE, CRASH_REASON, defineReasons, type ErrorObject, type ErrorReason, errorObjectSchema, } from "./errors.js";
3
3
  export { defineLogEvents, isContentKey, LOG_ATTRIBUTE_KEYS, LOG_EVENTS, LOG_SEVERITIES, type LogEvent, type LogRecord, type LogSeverity, logAttributesJsonSchema, logEventProblems, logRecordSchema, traceIdOf, } from "./log.js";
4
4
  export { takenMinutes } from "./monthly.js";
5
- export { COMPACT_FLAG, clockMeta, type Issue, type ItemEnvelope, isoTime, issueSchema, itemEnvelopeSchema, jsonlEndSchema, jsonlItemSchema, jsonlOf, type ListEnvelope, type ListResult, listEnvelopeSchema, localTime, MAX_NEXT_STEPS, type Meta, type Missing, metaSchema, missingSchema, type NextStep, nextStepSchema, type Page, pageSchema, type Query, querySchema, type Ranking, rankingSchema, reference, type Total, totalSchema, } from "./output.js";
5
+ export { COMPACT_FLAG, clockMeta, type Issue, type ItemEnvelope, isoTime, issueSchema, itemEnvelopeSchema, jsonlEndSchema, jsonlItemSchema, jsonlOf, type ListEnvelope, type ListResult, listEnvelopeSchema, localTime, MAX_NEXT_STEPS, type Meta, type Missing, type ModelRun, metaSchema, missingSchema, modelRunSchema, type NextStep, nextStepSchema, type Page, pageSchema, type Query, querySchema, type Ranking, rankingSchema, reference, type Total, totalSchema, } from "./output.js";
6
6
  export { fill, jsonSchemaOf, RegistryError } from "./registry.js";
7
7
  export { defineSteps, SAME_COMMAND, STEPS, type StepDefinition, type StepInput, type StepTarget, stepOf, } from "./steps.js";
@@ -2,6 +2,6 @@ export { EFFECT_LEVELS, effectsSchema, writes } from "./effects.js";
2
2
  export { BASE_REASONS, COMMON_DETAILS, CRASH_CODE, CRASH_REASON, defineReasons, errorObjectSchema, } from "./errors.js";
3
3
  export { defineLogEvents, isContentKey, LOG_ATTRIBUTE_KEYS, LOG_EVENTS, LOG_SEVERITIES, logAttributesJsonSchema, logEventProblems, logRecordSchema, traceIdOf, } from "./log.js";
4
4
  export { takenMinutes } from "./monthly.js";
5
- export { COMPACT_FLAG, clockMeta, isoTime, issueSchema, itemEnvelopeSchema, jsonlEndSchema, jsonlItemSchema, jsonlOf, listEnvelopeSchema, localTime, MAX_NEXT_STEPS, metaSchema, missingSchema, nextStepSchema, pageSchema, querySchema, rankingSchema, reference, totalSchema, } from "./output.js";
5
+ export { COMPACT_FLAG, clockMeta, isoTime, issueSchema, itemEnvelopeSchema, jsonlEndSchema, jsonlItemSchema, jsonlOf, listEnvelopeSchema, localTime, MAX_NEXT_STEPS, metaSchema, missingSchema, modelRunSchema, nextStepSchema, pageSchema, querySchema, rankingSchema, reference, totalSchema, } from "./output.js";
6
6
  export { fill, jsonSchemaOf, RegistryError } from "./registry.js";
7
7
  export { defineSteps, SAME_COMMAND, STEPS, stepOf, } from "./steps.js";
@@ -104,6 +104,25 @@ export declare const rankingSchema: v.StrictObjectSchema<{
104
104
  }, undefined>, undefined>;
105
105
  readonly ms: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
106
106
  }, undefined>;
107
+ /**
108
+ * What a model a command calls on its own did in this run (mail's `inbox` sorting new threads): how many items it was
109
+ * sent, how many it handled, how many wait for the next run, and what that cost. `usage` is absent when the provider
110
+ * counted nothing; `cost_usd` is null when no price is known.
111
+ */
112
+ export declare const modelRunSchema: v.StrictObjectSchema<{
113
+ readonly provider: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
114
+ readonly model: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
115
+ readonly endpoint: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
116
+ readonly sent: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
117
+ readonly done: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
118
+ readonly left: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
119
+ readonly usage: v.OptionalSchema<v.StrictObjectSchema<{
120
+ readonly input: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
121
+ readonly output: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
122
+ }, undefined>, undefined>;
123
+ readonly cost_usd: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
124
+ readonly ms: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
125
+ }, undefined>;
107
126
  /**
108
127
  * What a search made of its query before it searched: `chat` when a word of it named one chat and the search ran
109
128
  * there, `respelled` for each unknown word and the known spellings tried in its place. A program reads it instead of
@@ -154,6 +173,20 @@ export declare const metaSchema: v.StrictObjectSchema<{
154
173
  }, undefined>, undefined>;
155
174
  readonly ms: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
156
175
  }, undefined>, undefined>;
176
+ readonly model_run: v.OptionalSchema<v.StrictObjectSchema<{
177
+ readonly provider: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
178
+ readonly model: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
179
+ readonly endpoint: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
180
+ readonly sent: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
181
+ readonly done: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
182
+ readonly left: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
183
+ readonly usage: v.OptionalSchema<v.StrictObjectSchema<{
184
+ readonly input: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
185
+ readonly output: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
186
+ }, undefined>, undefined>;
187
+ readonly cost_usd: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
188
+ readonly ms: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
189
+ }, undefined>, undefined>;
157
190
  readonly query: v.OptionalSchema<v.StrictObjectSchema<{
158
191
  readonly chat: v.OptionalSchema<v.StrictObjectSchema<{
159
192
  readonly word: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
@@ -271,6 +304,20 @@ export declare const listEnvelopeSchema: <T extends v.GenericSchema>(item: T) =>
271
304
  }, undefined>, undefined>;
272
305
  readonly ms: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
273
306
  }, undefined>, undefined>;
307
+ readonly model_run: v.OptionalSchema<v.StrictObjectSchema<{
308
+ readonly provider: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
309
+ readonly model: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
310
+ readonly endpoint: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
311
+ readonly sent: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
312
+ readonly done: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
313
+ readonly left: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
314
+ readonly usage: v.OptionalSchema<v.StrictObjectSchema<{
315
+ readonly input: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
316
+ readonly output: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
317
+ }, undefined>, undefined>;
318
+ readonly cost_usd: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
319
+ readonly ms: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
320
+ }, undefined>, undefined>;
274
321
  readonly query: v.OptionalSchema<v.StrictObjectSchema<{
275
322
  readonly chat: v.OptionalSchema<v.StrictObjectSchema<{
276
323
  readonly word: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
@@ -361,6 +408,20 @@ export declare const itemEnvelopeSchema: <T extends v.GenericSchema>(item: T) =>
361
408
  }, undefined>, undefined>;
362
409
  readonly ms: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
363
410
  }, undefined>, undefined>;
411
+ readonly model_run: v.OptionalSchema<v.StrictObjectSchema<{
412
+ readonly provider: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
413
+ readonly model: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
414
+ readonly endpoint: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
415
+ readonly sent: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
416
+ readonly done: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
417
+ readonly left: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
418
+ readonly usage: v.OptionalSchema<v.StrictObjectSchema<{
419
+ readonly input: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
420
+ readonly output: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
421
+ }, undefined>, undefined>;
422
+ readonly cost_usd: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
423
+ readonly ms: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
424
+ }, undefined>, undefined>;
364
425
  readonly query: v.OptionalSchema<v.StrictObjectSchema<{
365
426
  readonly chat: v.OptionalSchema<v.StrictObjectSchema<{
366
427
  readonly word: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
@@ -380,6 +441,7 @@ export type Page = v.InferOutput<typeof pageSchema>;
380
441
  export type Issue = v.InferOutput<typeof issueSchema>;
381
442
  export type Meta = v.InferOutput<typeof metaSchema>;
382
443
  export type Ranking = v.InferOutput<typeof rankingSchema>;
444
+ export type ModelRun = v.InferOutput<typeof modelRunSchema>;
383
445
  export type Query = v.InferOutput<typeof querySchema>;
384
446
  export interface ListEnvelope<T> {
385
447
  items: T[];
@@ -95,6 +95,23 @@ export const rankingSchema = v.strictObject({
95
95
  })),
96
96
  ms: v.pipe(v.number(), v.integer(), v.minValue(0)),
97
97
  });
98
+ const count = v.pipe(v.number(), v.integer(), v.minValue(0));
99
+ /**
100
+ * 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
+ * sent, how many it handled, how many wait for the next run, and what that cost. `usage` is absent when the provider
102
+ * counted nothing; `cost_usd` is null when no price is known.
103
+ */
104
+ export const modelRunSchema = v.strictObject({
105
+ provider: text,
106
+ model: text,
107
+ endpoint: text,
108
+ sent: count,
109
+ done: count,
110
+ left: count,
111
+ usage: v.optional(v.strictObject({ input: count, output: count })),
112
+ cost_usd: v.nullable(v.pipe(v.number(), v.minValue(0))),
113
+ ms: count,
114
+ });
98
115
  /**
99
116
  * What a search made of its query before it searched: `chat` when a word of it named one chat and the search ran
100
117
  * there, `respelled` for each unknown word and the known spellings tried in its place. A program reads it instead of
@@ -117,6 +134,7 @@ export const metaSchema = v.strictObject({
117
134
  now_local: v.optional(localTime),
118
135
  window: v.optional(v.strictObject({ since: v.optional(isoTime), until: v.optional(isoTime) })),
119
136
  ranking: v.optional(rankingSchema),
137
+ model_run: v.optional(modelRunSchema),
120
138
  query: v.optional(querySchema),
121
139
  });
122
140
  const offsetOf = (at, zone) => {
@@ -8,6 +8,7 @@ import { KNOWLEDGE_FLAGS } from "./flags-knowledge.js";
8
8
  import { MAIL_FLAGS } from "./flags-mail.js";
9
9
  import { PRIVACY_FLAGS } from "./flags-privacy.js";
10
10
  import { SCHEDULE_FLAGS } from "./flags-schedule.js";
11
+ import { SEARCH_FLAGS } from "./flags-search.js";
11
12
  import { WHAT_FLAGS } from "./flags-what.js";
12
13
  import { duplicates, parseRegistry, text, word } from "./registry.js";
13
14
  export const FLAG_TYPES = [
@@ -451,5 +452,6 @@ export const VOCABULARY = defineVocabulary({
451
452
  ...CRM_FLAGS,
452
453
  ...SCHEDULE_FLAGS,
453
454
  ...CONTENT_FLAGS,
455
+ ...SEARCH_FLAGS,
454
456
  ],
455
457
  });
@@ -189,6 +189,7 @@ its prompt in cli-template says so from cli-template 0.8.0. A CLI on an older te
189
189
  | 03:09 | beeline-cli |
190
190
  | 03:11 | hubspot-cli |
191
191
  | 03:13 | zoom-cli |
192
+ | 03:16 | linear-cli |
192
193
  | 03:17 | wordpress-cli |
193
194
  | 03:20 | cli-docs |
194
195
 
@@ -82,7 +82,7 @@ JSON Schema 2020-12.
82
82
 
83
83
  - **Why:** `run_id` finds the run later, and `complete` says whether the answer can be trusted as whole.
84
84
  - **Enforced by:** review only.
85
- - **Example:** `{ run_id, duration_ms, accounts?, complete, issues?, truncated?, timezone?, window?, ranking?, query? }`.
85
+ - **Example:** `{ run_id, duration_ms, accounts?, complete, issues?, truncated?, timezone?, window?, ranking?, model_run?, query? }`.
86
86
  `timezone`
87
87
  names the zone a time without one was read or shown in, and `window` the UTC bounds a date filter used
88
88
  ([Time](time.md)). `complete: false` with
@@ -90,7 +90,9 @@ JSON Schema 2020-12.
90
90
  answer. Neither one means another page exists: that is `page.has_more`. `ranking` says what a hosted model did to
91
91
  the order of a search's hits: `{ applied, reason_id?, provider, model, endpoint, sent, cost_usd, usage?, ms }`, with
92
92
  `reason_id` (such as `harder.timeout`) when its order was not used and `cost_usd: null` for a model with no known
93
- price. `query` says what a search made of its query before it searched: `{ chat?, respelled? }`, with
93
+ price. `model_run` says what a model a command calls on its own did in the run, such as mail's `inbox` sorting new
94
+ threads: `{ provider, model, endpoint, sent, done, left, usage?, cost_usd, ms }`, with `sent` items sent, `done`
95
+ handled, `left` waiting for the next run. `query` says what a search made of its query before it searched: `{ chat?, respelled? }`, with
94
96
  `chat: { word, chat_id, title }` when a word named one chat and the search ran there, and
95
97
  `respelled: [{ word, tried }]` for each unknown word and the known spellings tried in its place. A program reads
96
98
  these instead of parsing a sentence.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-base",
3
- "version": "0.124.0",
3
+ "version": "0.125.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",
@@ -134,7 +134,8 @@
134
134
  "@valibot/to-json-schema": "1.8.0",
135
135
  "cli-table3": "^0.6.5",
136
136
  "cross-spawn": "7.0.6",
137
- "valibot": "^1.5.0"
137
+ "valibot": "^1.5.0",
138
+ "yaml": "^2.9.1"
138
139
  },
139
140
  "optionalDependencies": {
140
141
  "@napi-rs/keyring": "2.1.2"
@@ -155,8 +156,7 @@
155
156
  "markdownlint-cli2": "0.24.0",
156
157
  "swagger-converter": "2.1.0",
157
158
  "typescript": "^7.0.2",
158
- "vitest": "^5.0.5",
159
- "yaml": "^2.9.1"
159
+ "vitest": "^5.0.5"
160
160
  },
161
161
  "publishConfig": {
162
162
  "access": "public"