From fafec99750532fdf6333d36e2f913361156b8227 Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 18 Nov 2026 19:51:14 +0100 Subject: [PATCH 1/6] fix(kit): a tracker CLI from a config builds and its tests catch a failed kind Found building linear-cli from a config (cli-template 0.31.0): - the Desktop sync line listed all seven tracker kinds, 64 characters, and pnpm generate stopped on desktop.sync.what (40 at most); it now keeps the kinds a sync reads last; - the tracker sync test passed while every kind failed on a misspelled variable: it read only issues, not each kind's error; - the GraphQL api test sampled every optional input field, and Linear's filters nest in each other until the worker ran out of memory; it now sends only the required variables; - cspell skips skills/*/references/api/, written from the service's own descriptions. Co-Authored-By: Claude Opus 5.5 --- changes/fix-kit-tracker-pilot-gaps.md | 12 +++++++++++ cspell.json | 2 +- .../config/src/tracker-contracts.test.ts | 5 ++++- kit/seeds/graphql/src/api.test.ts | 20 +++++++++++++++++-- kit/src/new.ts | 18 +++++++++++++---- kit/test/new.test.ts | 10 ++++++++++ 6 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 changes/fix-kit-tracker-pilot-gaps.md diff --git a/changes/fix-kit-tracker-pilot-gaps.md b/changes/fix-kit-tracker-pilot-gaps.md new file mode 100644 index 0000000..9ebd31a --- /dev/null +++ b/changes/fix-kit-tracker-pilot-gaps.md @@ -0,0 +1,12 @@ +### Fixed + +- **A tracker CLI made from a config builds.** Its line in WireCat Desktop's manifest listed all seven kinds (64 + characters), and `pnpm generate` stopped on `desktop.sync.what`, which takes 40. The line now keeps the kinds a sync + reads last: "your projects, issues and comments". +- **A tracker's sync test fails when a kind fails.** A typo in a variable of the source failed every kind before a + request was sent, and the test passed: it read only the answer's `issues`, not each kind's `error`. +- **The `api` test of a GraphQL CLI sends only the variables an operation requires.** A sample of every optional + field nests filter in filter (Linear's `IssueFilter` reaches `TeamFilter` and back): the test ran out of memory + before its first case. +- **Spell checking skips `skills/*/references/api/`,** written by `pnpm generate` from the service's own words, as it + skips `docs/commands.md`. Linear's descriptions of its API stopped `pnpm docs:check` on twelve words. diff --git a/cspell.json b/cspell.json index 7ccc9e0..559672c 100644 --- a/cspell.json +++ b/cspell.json @@ -1,6 +1,6 @@ { "version": "0.2", "import": ["./config/wirecat/cspell.json"], - "ignorePaths": ["docs/commands.md", "docs/dev/**"], + "ignorePaths": ["docs/commands.md", "docs/dev/**", "skills/*/references/api/**"], "words": ["Attio", "clidev", "gifsicle", "Petstore", "typechecks", "ydisk"] } diff --git a/kit/seeds/config/src/tracker-contracts.test.ts b/kit/seeds/config/src/tracker-contracts.test.ts index cc0d5ff..dc3401b 100644 --- a/kit/seeds/config/src/tracker-contracts.test.ts +++ b/kit/seeds/config/src/tracker-contracts.test.ts @@ -22,8 +22,11 @@ it("sync through this CLI sends only calls the schema allows, under the account expect(started.code, started.err).toBe(0) const synced = await runCli(["personal", "sync", "--json"], { keyring, service: fake }) expect(synced.code, synced.err).toBe(0) - // A kind that failed is a partial answer with exit 0: its issues name it. + // A kind that failed is a partial answer with exit 0: its error is on its row, and a typo in a variable fails + // every kind before anything is sent. expect(synced.json().issues ?? []).toEqual([]) + const failed = (synced.json().item.synced as { kind: string; error?: string }[]).filter((one) => one.error) + expect(failed).toEqual([]) const listed = await runCli(["personal", "issues", "list", "--json"], { keyring, service: fake }) expect(listed.code, listed.err).toBe(0) expect(fake.refusals).toEqual([]) diff --git a/kit/seeds/graphql/src/api.test.ts b/kit/seeds/graphql/src/api.test.ts index 15c85ee..02e46fd 100644 --- a/kit/seeds/graphql/src/api.test.ts +++ b/kit/seeds/graphql/src/api.test.ts @@ -1,6 +1,6 @@ import { mkdirSync, rmSync, writeFileSync } from "node:fs" import { join } from "node:path" -import { graphqlFake, sampleOf } from "@wirecat/cli-base/codegen" +import { graphqlFake, type SchemaNode, sampleOf } from "@wirecat/cli-base/codegen" import { apiFlagOf, manifestBaseUrl, sendsBytes } from "@wirecat/cli-core/cli" import { afterEach, expect, it } from "vitest" import { API } from "./config.js" @@ -38,13 +38,29 @@ const deleteKeys = [ ), ] +// Only what an operation requires. GraphQL inputs nest in each other (Linear's IssueFilter reaches TeamFilter and +// back), so a sample of every optional field grows past memory and past what one argument can hold. +const requiredSample = (node: SchemaNode, seen: ReadonlySet = new Set()): unknown => { + if (node.type === "ref") { + const target = definitions[node.ref as keyof typeof definitions] as SchemaNode | undefined + return target && !seen.has(node.ref) ? requiredSample(target, new Set([...seen, node.ref])) : null + } + if (node.type === "object") + return Object.fromEntries( + node.required.map((name) => [name, requiredSample(node.properties[name] as SchemaNode, seen)]), + ) + if (node.type === "array") + return Array.from({ length: Math.max(node.minItems ?? 1, 1) }, () => requiredSample(node.items, seen)) + return sampleOf(node, definitions) +} + const argsOf = (operation: Operation) => [ ...operation.parameters .filter((parameter) => parameter.required) .flatMap((parameter) => [`--${apiFlagOf(parameter.name)}`, String(sampleOf(parameter.schema, definitions))]), ...(sendsBytes(operation) ? ["--body-file", upload] : []), ...(operation.request?.schema - ? ["--body", JSON.stringify(sampleOf({ type: "ref", ref: operation.request.schema }, definitions))] + ? ["--body", JSON.stringify(requiredSample({ type: "ref", ref: operation.request.schema }))] : []), ...(operation.effect === "destructive" ? ["--yes"] : []), ] diff --git a/kit/src/new.ts b/kit/src/new.ts index 171e8a6..d5aa693 100644 --- a/kit/src/new.ts +++ b/kit/src/new.ts @@ -489,11 +489,21 @@ const KIND_WORDS: Readonly> = { lead: "leads", } -/** A CLI with `sync` says what it copies in (contracts/wirecat.json): for a config's source, its kinds. */ +// The manifest's desktop.sync.what takes 40 characters at most. +const SYNCS_MAX = 40 + +const syncsOf = (words: readonly string[]): string => + `your ${words.length > 1 ? `${words.slice(0, -1).join(", ")} and ${words.at(-1)}` : (words[0] ?? "records")}` + +/** + * A CLI with `sync` says what it copies in (contracts/wirecat.json): for a config's source, its kinds. Kinds come + * in the order a sync reads them, the ones others refer to first, so a list too long keeps the last ones: a + * tracker's issues, projects and comments rather than its teams and states. + */ export const withSyncs = (text: string, kinds: readonly string[]): string => { - const words = kinds.map((kind) => KIND_WORDS[kind] ?? `${kind}s`) - const list = words.length > 1 ? `${words.slice(0, -1).join(", ")} and ${words.at(-1)}` : (words[0] ?? "records") - return replaceOnce(IDENTITY_FILE, text, /^( {2}tagline: .*\n)/m, `$1 syncs: ${JSON.stringify(`your ${list}`)},\n`) + let words = kinds.map((kind) => KIND_WORDS[kind] ?? `${kind}s`) + while (words.length > 1 && syncsOf(words).length > SYNCS_MAX) words = words.slice(1) + return replaceOnce(IDENTITY_FILE, text, /^( {2}tagline: .*\n)/m, `$1 syncs: ${JSON.stringify(syncsOf(words))},\n`) } export const withContentLanguages = (text: string, languages: readonly string[]): string => { diff --git a/kit/test/new.test.ts b/kit/test/new.test.ts index 2b609a8..181b9de 100644 --- a/kit/test/new.test.ts +++ b/kit/test/new.test.ts @@ -15,6 +15,7 @@ import { takenMinutes, wirecatMonthlyTime, withContentLanguages, + withSyncs, } from "../src/new.js" import { renamer, stripKit } from "../src/rename.js" import { listTemplate, loadSource, renderTemplate } from "../src/source.js" @@ -109,6 +110,15 @@ describe("new", () => { }) }) + it("says what a config's sync copies within the manifest's 40 characters, keeping the kinds read last", () => { + const identity = ' tagline: "x",\n' + expect(withSyncs(identity, ["organization", "person", "deal"])).toContain( + 'syncs: "your companies, people and deals"', + ) + const tracker = ["team", "user", "state", "label", "project", "issue", "comment"] + expect(withSyncs(identity, tracker)).toContain('syncs: "your projects, issues and comments"') + }) + it("picks a WireCat CLI's monthly minute inside WC-CI-9's window, from the free ones", () => { const taken = takenMinutes("| UTC | Repository |\n|---|---|\n| 02:17 | cli-base |\n| 02:20 | notion-cli |\n") const times = ["a-cli", "b-cli", "c-cli", "d-cli"].map((repo) => wirecatMonthlyTime(repo, taken)) From ff5d1213e29f109b85f22bd0826aa0916c114f5c Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 18 Nov 2026 20:01:46 +0100 Subject: [PATCH 2/6] fix(kit): the GraphQL api test fits a large schema and no api test waits for the pace Review follow-ups: optional plain fields still sent, object flags as JSON, meta.issues read where the sync answer has them, the api reference index skipped by cspell too. Co-Authored-By: Claude Opus 5.5 --- changes/fix-kit-tracker-pilot-gaps.md | 11 +++++---- cspell.json | 2 +- .../config/src/tracker-contracts.test.ts | 6 ++--- kit/seeds/graphql/src/api.test.ts | 24 ++++++++++++++----- kit/seeds/shared/src/api.test.ts | 4 ++++ 5 files changed, 33 insertions(+), 14 deletions(-) diff --git a/changes/fix-kit-tracker-pilot-gaps.md b/changes/fix-kit-tracker-pilot-gaps.md index 9ebd31a..a6214c0 100644 --- a/changes/fix-kit-tracker-pilot-gaps.md +++ b/changes/fix-kit-tracker-pilot-gaps.md @@ -4,9 +4,12 @@ characters), and `pnpm generate` stopped on `desktop.sync.what`, which takes 40. The line now keeps the kinds a sync reads last: "your projects, issues and comments". - **A tracker's sync test fails when a kind fails.** A typo in a variable of the source failed every kind before a - request was sent, and the test passed: it read only the answer's `issues`, not each kind's `error`. -- **The `api` test of a GraphQL CLI sends only the variables an operation requires.** A sample of every optional - field nests filter in filter (Linear's `IssueFilter` reaches `TeamFilter` and back): the test ran out of memory - before its first case. + request was sent, and the test passed: it read `issues` where the answer has none (they are under `meta`), and not each kind's `error`. +- **The `api` test of a GraphQL CLI fits a large schema.** It sends what an operation requires plus its optional plain + fields, and an object flag as JSON. A sample of every optional field nests filter in filter (Linear's + `IssueFilter` reaches `TeamFilter` and back), and the worker ran out of memory; an object flag went as + `[object Object]`. Linear's 493 operations now pass in about 20 seconds. +- **No `api` test waits for the pace.** Every case shared the profile's pace file, so past the burst each case + waited for real; the file is cleared after each case. - **Spell checking skips `skills/*/references/api/`,** written by `pnpm generate` from the service's own words, as it skips `docs/commands.md`. Linear's descriptions of its API stopped `pnpm docs:check` on twelve words. diff --git a/cspell.json b/cspell.json index 559672c..4c15b26 100644 --- a/cspell.json +++ b/cspell.json @@ -1,6 +1,6 @@ { "version": "0.2", "import": ["./config/wirecat/cspell.json"], - "ignorePaths": ["docs/commands.md", "docs/dev/**", "skills/*/references/api/**"], + "ignorePaths": ["docs/commands.md", "docs/dev/**", "skills/*/references/api.md", "skills/*/references/api/**"], "words": ["Attio", "clidev", "gifsicle", "Petstore", "typechecks", "ydisk"] } diff --git a/kit/seeds/config/src/tracker-contracts.test.ts b/kit/seeds/config/src/tracker-contracts.test.ts index dc3401b..6554326 100644 --- a/kit/seeds/config/src/tracker-contracts.test.ts +++ b/kit/seeds/config/src/tracker-contracts.test.ts @@ -24,9 +24,9 @@ it("sync through this CLI sends only calls the schema allows, under the account expect(synced.code, synced.err).toBe(0) // A kind that failed is a partial answer with exit 0: its error is on its row, and a typo in a variable fails // every kind before anything is sent. - expect(synced.json().issues ?? []).toEqual([]) - const failed = (synced.json().item.synced as { kind: string; error?: string }[]).filter((one) => one.error) - expect(failed).toEqual([]) + const answer = synced.json() as { meta?: { issues?: unknown[] }; item: { synced: { error?: string }[] } } + expect(answer.meta?.issues ?? []).toEqual([]) + expect(answer.item.synced.filter((one) => one.error)).toEqual([]) const listed = await runCli(["personal", "issues", "list", "--json"], { keyring, service: fake }) expect(listed.code, listed.err).toBe(0) expect(fake.refusals).toEqual([]) diff --git a/kit/seeds/graphql/src/api.test.ts b/kit/seeds/graphql/src/api.test.ts index 02e46fd..f0e9349 100644 --- a/kit/seeds/graphql/src/api.test.ts +++ b/kit/seeds/graphql/src/api.test.ts @@ -2,9 +2,11 @@ import { mkdirSync, rmSync, writeFileSync } from "node:fs" import { join } from "node:path" import { graphqlFake, type SchemaNode, sampleOf } from "@wirecat/cli-base/codegen" import { apiFlagOf, manifestBaseUrl, sendsBytes } from "@wirecat/cli-core/cli" +import { pacePathFor } from "@wirecat/cli-core/sends" import { afterEach, expect, it } from "vitest" import { API } from "./config.js" import { definitions } from "./generated/definitions.js" +import { IDENTITY } from "./identity.js" import { FAKE_TOKEN } from "./testing/fake-comments.js" import { runCli } from "./testing/harness.js" @@ -14,9 +16,11 @@ const withPermissions = (permissions: Record) => { mkdirSync(join(configFile, ".."), { recursive: true }) writeFileSync(configFile, JSON.stringify({ profiles: { personal: { permissions } } })) } +// Every case shares the profile's pace file, and a few hundred operations would wait for real past its burst. afterEach(() => { rmSync(configFile, { force: true }) rmSync(upload, { force: true }) + rmSync(pacePathFor(IDENTITY, "personal", process.env), { force: true }) }) type Operation = (typeof API.manifest.operations)[number] @@ -38,8 +42,10 @@ const deleteKeys = [ ), ] -// Only what an operation requires. GraphQL inputs nest in each other (Linear's IssueFilter reaches TeamFilter and -// back), so a sample of every optional field grows past memory and past what one argument can hold. +// What an operation requires, plus its optional fields that hold a plain value. GraphQL inputs nest in each other +// (Linear's IssueFilter reaches TeamFilter and back), so sampling every optional object grows past memory and past +// what one argument can hold. +const NESTED = new Set(["ref", "object", "array", "union", "allOf"]) const requiredSample = (node: SchemaNode, seen: ReadonlySet = new Set()): unknown => { if (node.type === "ref") { const target = definitions[node.ref as keyof typeof definitions] as SchemaNode | undefined @@ -47,17 +53,23 @@ const requiredSample = (node: SchemaNode, seen: ReadonlySet = new Set()) } if (node.type === "object") return Object.fromEntries( - node.required.map((name) => [name, requiredSample(node.properties[name] as SchemaNode, seen)]), + Object.entries(node.properties) + .filter(([name, property]) => node.required.includes(name) || !NESTED.has(property.type)) + .map(([name, property]) => [name, requiredSample(property, seen)]), ) - if (node.type === "array") - return Array.from({ length: Math.max(node.minItems ?? 1, 1) }, () => requiredSample(node.items, seen)) + if (node.type === "array") { + const item = requiredSample(node.items, seen) + return item === null ? [] : Array.from({ length: Math.max(node.minItems ?? 1, 1) }, () => item) + } return sampleOf(node, definitions) } +const flagValue = (value: unknown) => (typeof value === "object" ? JSON.stringify(value) : String(value)) + const argsOf = (operation: Operation) => [ ...operation.parameters .filter((parameter) => parameter.required) - .flatMap((parameter) => [`--${apiFlagOf(parameter.name)}`, String(sampleOf(parameter.schema, definitions))]), + .flatMap((parameter) => [`--${apiFlagOf(parameter.name)}`, flagValue(requiredSample(parameter.schema))]), ...(sendsBytes(operation) ? ["--body-file", upload] : []), ...(operation.request?.schema ? ["--body", JSON.stringify(requiredSample({ type: "ref", ref: operation.request.schema }))] diff --git a/kit/seeds/shared/src/api.test.ts b/kit/seeds/shared/src/api.test.ts index 18cb12b..db7b56e 100644 --- a/kit/seeds/shared/src/api.test.ts +++ b/kit/seeds/shared/src/api.test.ts @@ -2,9 +2,11 @@ import { mkdirSync, rmSync, writeFileSync } from "node:fs" import { join } from "node:path" import { fakeApi, sampleOf } from "@wirecat/cli-base/codegen" import { apiFlagOf, manifestBaseUrl, type ServiceApiManifest, sendsBytes } from "@wirecat/cli-core/cli" +import { pacePathFor } from "@wirecat/cli-core/sends" import { afterEach, expect, it } from "vitest" import { API } from "./config.js" import { definitions } from "./generated/definitions.js" +import { IDENTITY } from "./identity.js" import { FAKE_TOKEN } from "./testing/fake-comments.js" import { runCli } from "./testing/harness.js" @@ -14,9 +16,11 @@ const withPermissions = (permissions: Record) => { mkdirSync(join(configFile, ".."), { recursive: true }) writeFileSync(configFile, JSON.stringify({ profiles: { personal: { permissions } } })) } +// Every case shares the profile's pace file, and a few hundred operations would wait for real past its burst. afterEach(() => { rmSync(configFile, { force: true }) rmSync(upload, { force: true }) + rmSync(pacePathFor(IDENTITY, "personal", process.env), { force: true }) }) type Operation = (typeof API.manifest.operations)[number] From b8ad234e868a89defbbbfa3c2096bc005b8ff77e Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 18 Nov 2026 22:01:01 +0100 Subject: [PATCH 3/6] fix(kit): a tracker CLI from a config runs trackerSourceContract over a fake of its API Co-Authored-By: Claude Opus 5.5 --- .../config/src/tracker-contracts.test.ts | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/kit/seeds/config/src/tracker-contracts.test.ts b/kit/seeds/config/src/tracker-contracts.test.ts index 6554326..2df60f3 100644 --- a/kit/seeds/config/src/tracker-contracts.test.ts +++ b/kit/seeds/config/src/tracker-contracts.test.ts @@ -1,11 +1,33 @@ import { memoryKeyring } from "@wirecat/cli-base" import { parseTrackerManifest } from "@wirecat/cli-core/tracker" -import { expect, it } from "vitest" +import { + type TrackerManifestFake, + trackerManifestFixture, + trackerSourceContract, +} from "@wirecat/cli-core/tracker/testing" +import { afterEach, describe, expect, it } from "vitest" import { API } from "./config.js" -import { SOURCE } from "./generated/wirecat-config.js" +import { definitions } from "./generated/definitions.js" +import { HOOK_OPTIONS, SOURCE } from "./generated/wirecat-config.js" import { FAKE_API_TOKEN, fakeServiceApi } from "./testing/fake-api.js" import { runCli } from "./testing/harness.js" +const fakes: TrackerManifestFake[] = [] + +afterEach(() => { + // A call the fake refused is one the schema or the tracker would refuse: the source would fail on the real service. + expect(fakes.splice(0).flatMap((fake) => fake.refusals)).toEqual([]) +}) + +describe("trackerSourceContract over a fake of the API, from wirecat.config.ts", () => { + for (const { name, run } of trackerSourceContract(() => { + const fixture = trackerManifestFixture(SOURCE, { api: API.manifest, definitions, ...HOOK_OPTIONS }) + fakes.push(fixture.fake) + return fixture + })) + it(name, run) +}) + it("the source in wirecat.config.ts reads only what the generated API offers and selects", () => { expect(() => parseTrackerManifest(SOURCE, API.manifest)).not.toThrow() }) From 066e02fedb4af78e784c0835b23096d5c364050f Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 18 Nov 2026 22:08:04 +0100 Subject: [PATCH 4/6] chore(deps): cli-core 0.701.0 and cli-base 0.119.0, so a tracker CLI's contract runs and ready verifies it Co-Authored-By: Claude Opus 5.5 --- changes/fix-kit-tracker-pilot-gaps.md | 3 + package.json | 4 +- pnpm-lock.yaml | 308 +++++++++++++++++++++++++- 3 files changed, 301 insertions(+), 14 deletions(-) diff --git a/changes/fix-kit-tracker-pilot-gaps.md b/changes/fix-kit-tracker-pilot-gaps.md index a6214c0..828d1d0 100644 --- a/changes/fix-kit-tracker-pilot-gaps.md +++ b/changes/fix-kit-tracker-pilot-gaps.md @@ -13,3 +13,6 @@ waited for real; the file is cleared after each case. - **Spell checking skips `skills/*/references/api/`,** written by `pnpm generate` from the service's own words, as it skips `docs/commands.md`. Linear's descriptions of its API stopped `pnpm docs:check` on twelve words. +- **A tracker CLI from a config runs `trackerSourceContract`** over cli-core's `trackerManifestFixture`, a fake of + its API built from the source, so `cli-dev ready` verifies its category (cli-base 0.119.0 asks a tracker for that + contract). cli-core 0.701.0 and cli-base 0.119.0. diff --git a/package.json b/package.json index 1e0f32d..f3adae7 100644 --- a/package.json +++ b/package.json @@ -90,8 +90,8 @@ "kit:docs": "cspell lint --config cspell.json --no-progress --no-summary kit/*.md SKILL.md && rumdl check --config config/wirecat/rumdl.toml kit/*.md SKILL.md" }, "dependencies": { - "@wirecat/cli-base": "0.117.0", - "@wirecat/cli-core": "0.699.0", + "@wirecat/cli-base": "0.119.0", + "@wirecat/cli-core": "0.701.0", "commander": "15.0.0", "valibot": "1.5.0", "yaml": "2.9.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3cf3bc0..85faf70 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,11 +13,11 @@ importers: .: dependencies: '@wirecat/cli-base': - specifier: 0.117.0 - version: 0.117.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5) + specifier: 0.119.0 + version: 0.119.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5) '@wirecat/cli-core': - specifier: 0.699.0 - version: 0.699.0(@wirecat/cli-base@0.117.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5))(commander@15.0.0)(typescript@7.0.2)(zod@4.6.7) + specifier: 0.701.0 + version: 0.701.0(@wirecat/cli-base@0.119.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5))(commander@15.0.0)(typescript@7.0.2)(zod@4.6.7) commander: specifier: 15.0.0 version: 15.0.0 @@ -987,6 +987,9 @@ packages: '@types/estree@1.0.9': resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + '@types/hast@3.0.5': + resolution: {integrity: sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==} + '@types/katex@0.16.8': resolution: {integrity: sha512-trgaNyfU+Xh2Tc+ABIb44a5AYUpicB3uwirOioeOkNPPbmgRNtcWyDeeFRzjPZENO9Vq8gvVqfhaaXWLlevVwg==} @@ -1125,6 +1128,9 @@ packages: cpu: [x64] os: [win32] + '@ungap/structured-clone@1.4.0': + resolution: {integrity: sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==} + '@valibot/to-json-schema@1.8.0': resolution: {integrity: sha512-a0M+uwCuQZEPAo65NYkFSJ14O5c213KoSZmPdoCfuFvUhfULi4T2Z6Tpjv6lTVMW9RoLm74RpRAjNEa43KcN+g==} peerDependencies: @@ -1173,8 +1179,8 @@ packages: '@wasm-audio-decoders/opus-ml@0.0.3': resolution: {integrity: sha512-SEeTmk0eb3q5etJA/NHCRWW6BivTx9tqvNTmG0kg2ynuATEQRUZnwQE6Ibvl1BBvqIGHqI57+qyJMWmJBwb5XQ==} - '@wirecat/cli-base@0.117.0': - resolution: {integrity: sha512-EvvT9thrZihJc+s2taT1rwww5k1bITBG/7CtucjSMsNi1Y89JRARWVSa94/QR/o7002761+b1v5TXoyMJGFTdg==} + '@wirecat/cli-base@0.119.0': + resolution: {integrity: sha512-1j1es80chzH3O7Lazco3H92v0B70nu8yGdOM9xnUUv7iYBHuD4scTQeOcFadUcdS3K4jSwkhGKYa5vpDqgV3pA==} engines: {node: '>=22'} hasBin: true peerDependencies: @@ -1201,13 +1207,13 @@ packages: '@wirecat/cli-core-sqlite@1.1.0': resolution: {integrity: sha512-GpGlh/dAIX/nblBYCdT6DfWSLFxav9mxxeELQAfEuw+QZdT9unKxbi5xa02s/s4JS1P7n0PQx2sCABj4FlMRNw==} - '@wirecat/cli-core@0.699.0': - resolution: {integrity: sha512-HXcxnfcVr6mVHLKk3BG2mnJrbXFiSG6raWiG7RqGO+82OMLaP7gHpxWX5K/j2DbI8zp6k4+Tl9K/iGTyEYaMMg==} + '@wirecat/cli-core@0.701.0': + resolution: {integrity: sha512-Ijk+MgdEWurGy1Q8HsKRI6NAbNl0bP4nwhQnco+RtQnVSMiUyW8yIlRnEXRfW6ksGJvTjlz7UkiUl/nf7iIsqQ==} engines: {node: ^22.16.0 || >=24} hasBin: true peerDependencies: '@napi-rs/canvas': '>=0.1.69 <2' - '@wirecat/cli-base': '>=0.117.0 <1.0.0' + '@wirecat/cli-base': '>=0.118.0 <1.0.0' commander: '>=15' mysql2: ^3.24.6 pg: ^8.23.1 @@ -1299,6 +1305,9 @@ packages: resolution: {integrity: sha512-/Ce6KNm3vIbWdMlNna6RVIZ/ICQxnJxCicet5LBKK9ZffBkqzDw0xh9EiKSljdRtiIQ1S1z4YgcscUUGzNCWrA==} engines: {node: '>=22'} + character-entities-html4@2.1.0: + resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} + character-entities-legacy@3.0.0: resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==} @@ -1318,6 +1327,12 @@ packages: codec-parser@2.5.0: resolution: {integrity: sha512-Ru9t80fV8B0ZiixQl8xhMTLru+dzuis/KQld32/x5T/+3LwZb0/YvQdSKytX9JqCnRdiupvAvyYJINKrXieziQ==} + collapse-white-space@2.1.0: + resolution: {integrity: sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==} + + comma-separated-tokens@2.0.3: + resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} + commander@10.0.1: resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} engines: {node: '>=14'} @@ -1482,6 +1497,10 @@ packages: resolution: {integrity: sha512-kxL7msIffSuh9aaFAMD7rxAIuTRMAHMeBtgHW2yUdWw732ZNh4MehkF2gdjvtdmikkaIP9bFDDJOPlsvm7avrA==} engines: {node: '>=20.19.0'} + entities@9.0.0: + resolution: {integrity: sha512-oJFNDJg3kTPwAD1cNn2+WmUq4wFoo09npc3Ydf1D7ED4smRiWrsKnaLxykrTWgyGEcusc87P5dxlAleol9kpkg==} + engines: {node: '>=20.19.0'} + env-paths@4.0.0: resolution: {integrity: sha512-pxP8eL2SwwaTRi/KHYwLYXinDs7gL3jxFcBYmEdYfZmZXbaVDvdppd0XBU8qVz03rDfKZMXg1omHCbsJjZrMsw==} engines: {node: '>=20'} @@ -1579,9 +1598,54 @@ packages: resolution: {integrity: sha512-c8B/VNLmxRcmqqenRA9t+9IyOjf9+V6lTxPaUJLqOCONdQkWZ0ETYgX0qbtJqPsgCNusT9MZ5Jeidw8Eb9tn2g==} engines: {node: '>=20'} + hast-util-embedded@3.0.0: + resolution: {integrity: sha512-naH8sld4Pe2ep03qqULEtvYr7EjrLK2QHY8KJR6RJkTUjPGObe1vnx585uzem2hGra+s1q08DZZpfgDVYRbaXA==} + + hast-util-from-html@2.1.0: + resolution: {integrity: sha512-873p9AuH93gBnATbH8rU3YvjTKxyrIeWd/M9tiLMzn3G82Os0xhQurctfnbYUSrDXoyjbJGpJ2qmTpefMw7ZaQ==} + + hast-util-from-parse5@8.0.4: + resolution: {integrity: sha512-Yq7XlXor0Cpb71sI2E0zpv8QxQ5a6rfhDEETk4bcgrFX2SvJAY2PHocWwFtL6U9qyfiyByW3wZ6sZEfP2kW81g==} + + hast-util-has-property@3.0.0: + resolution: {integrity: sha512-MNilsvEKLFpV604hwfhVStK0usFY/QmM5zX16bo7EjnAEGofr5YyI37kzopBlZJkHD4t887i+q/C8/tr5Q94cA==} + + hast-util-is-body-ok-link@3.0.1: + resolution: {integrity: sha512-0qpnzOBLztXHbHQenVB8uNuxTnm/QBFUOmdOSsEn7GnBtyY07+ENTWVFBAnXd/zEgd9/SUG3lRY7hSIBWRgGpQ==} + + hast-util-is-element@3.0.0: + resolution: {integrity: sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g==} + + hast-util-minify-whitespace@1.0.1: + resolution: {integrity: sha512-L96fPOVpnclQE0xzdWb/D12VT5FabA7SnZOUMtL1DbXmYiHJMXZvFkIZfiMmTCNJHUeO2K9UYNXoVyfz+QHuOw==} + + hast-util-parse-selector@4.0.0: + resolution: {integrity: sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==} + + hast-util-phrasing@3.0.1: + resolution: {integrity: sha512-6h60VfI3uBQUxHqTyMymMZnEbNl1XmEGtOxxKYL7stY2o601COo62AWAYBQR9lZbYXYSBoxag8UpPRXK+9fqSQ==} + + hast-util-to-html@9.0.6: + resolution: {integrity: sha512-1SZUxCN3TtJAE7e2BQN2MBHsoZ1gnmi9GoCP5Di59CSWptIezSAW09yDZyVbanb78V9eCwrKqdQsjtfVTxYHWA==} + + hast-util-to-mdast@10.1.3: + resolution: {integrity: sha512-8Qc3IBGvw+tvOCi606vYSvizX89hxW22GEuXnqSGq0m3cXotDaNo6LUEIuCjIL+kmrCaMeBTtu+aiJ71HoyE7Q==} + + hast-util-to-text@4.0.3: + resolution: {integrity: sha512-5yrlWOvGFs6CqHriUpSsNrjzT/Tdo+IOQudbznxOn8K5qblp18MJyzOg8IgDOKQ8MYgQcJA7SusuCjSpDr8mSA==} + + hast-util-whitespace@3.0.0: + resolution: {integrity: sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==} + + hastscript@9.0.3: + resolution: {integrity: sha512-1ALZXSmCGmW3h8AMz4R4+QKSKFi7sNgXLVwmwB8FYVtl1CwQ3WDkSAEY/d5tp1g/vbQgq2s1WlHgfO3jbw1TsA==} + html-escaper@3.0.3: resolution: {integrity: sha512-RuMffC89BOWQoY0WKGpIhn5gX3iI54O6nRA0yC124NYVtzjmFWBIiFd8M0x+ZdX0P9R4lADg1mgP8C7PxGOWuQ==} + html-void-elements@3.0.0: + resolution: {integrity: sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==} + htmlparser2@10.1.0: resolution: {integrity: sha512-VTZkM9GWRAtEpveh7MSF6SjjrpNVNNVJfFup7xTY3UpFtm67foy9HDVXneLtFVt4pMz5kZtgNcvCniNFb1hlEQ==} @@ -1910,6 +1974,9 @@ packages: mdast-util-phrasing@4.1.0: resolution: {integrity: sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==} + mdast-util-to-hast@13.2.2: + resolution: {integrity: sha512-l2pnmOuqs+SGLVpTVXnRLQu5v1AzvDe181404fbXzzqObVxrAnnVxapAP27pUwzLBL/ABIkgUhGlPVU7QSvIFg==} + mdast-util-to-markdown@2.2.0: resolution: {integrity: sha512-2Jn/ADrHFFyyniBMi0bncTbJqU78K3/TEYvzvwrWWzD9MYPUa/Gm4r3nOeKFQg/PDM5BsbDYdc8ackW4NTY6NA==} @@ -2057,6 +2124,9 @@ packages: parse-entities@4.0.2: resolution: {integrity: sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==} + parse5@8.1.1: + resolution: {integrity: sha512-EcR/6WDcU7b2N3vQSxKALCk9lXGtUMQxXio008OEMBE0kavu/7JLfBEeFPzi43nMqVDSbEn3QCK+BMCc9zO//w==} + path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} @@ -2090,6 +2160,9 @@ packages: process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + property-information@7.2.0: + resolution: {integrity: sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==} + psl@1.15.0: resolution: {integrity: sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==} @@ -2114,6 +2187,9 @@ packages: readable-stream@2.3.8: resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} + rehype-minify-whitespace@6.0.2: + resolution: {integrity: sha512-Zk0pyQ06A3Lyxhe9vGtOtzz3Z0+qZ5+7icZ/PL/2x1SHPbKao5oB/g/rlc6BCTajqBb33JcOe71Ye1oFsuYbnw==} + resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} @@ -2179,6 +2255,9 @@ packages: resolution: {integrity: sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==} engines: {node: '>=0.10.0'} + space-separated-tokens@2.0.2: + resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} + sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} @@ -2199,6 +2278,9 @@ packages: string_decoder@1.1.1: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} + stringify-entities@4.0.4: + resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==} + strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -2239,6 +2321,12 @@ packages: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} + trim-lines@3.0.1: + resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==} + + trim-trailing-lines@2.1.0: + resolution: {integrity: sha512-5UR5Biq4VlVOtzqkm2AZlgvSlDJtME46uV0br0gENbwN4l5+mMKT4b9gJKqWtuL2zAIqajGJGuvbCbcAJUZqBg==} + ts-algebra@2.0.0: resolution: {integrity: sha512-FPAhNPFMrkwz76P7cdjdmiShwMynZYN6SgOujD1urY4oNm80Ou9oMdmbR45LotcKOXoy7wSmHkRFE6Mxbrhefw==} @@ -2273,6 +2361,9 @@ packages: unist-util-is@6.0.1: resolution: {integrity: sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==} + unist-util-position@5.0.0: + resolution: {integrity: sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==} + unist-util-stringify-position@4.0.0: resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} @@ -2302,6 +2393,15 @@ packages: typescript: optional: true + vfile-location@5.0.4: + resolution: {integrity: sha512-vEvxatYZCIpNvzGk2UD+u4I/sZkSKoOsdRCbkOIsN73QpJbriJ1qvvBAL1PeI0y55Leoqf7pORbaSPpG/smmOg==} + + vfile-message@4.0.4: + resolution: {integrity: sha512-66ycRswIkNmHH9PHku7ADtv5RVwgIrOcuv3J8Svz6h4qgGRrKVa+9/neuKyJZUXyOpYwLTvS+whZ4R2urHHgQg==} + + vfile@6.0.3: + resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} + vite@8.3.5: resolution: {integrity: sha512-z1YpjieJ9g0ebTmQpLBv/oq9E3F9EIlOe+7LahW8SrE3LTiG3udBRUXQOlYXP9b+IC2q2phHeVxj9xGlw34OEQ==} engines: {node: ^20.19.0 || >=22.12.0} @@ -2392,6 +2492,9 @@ packages: vscode-uri@3.2.0: resolution: {integrity: sha512-m2gXo3bn0G1kT9InzMf07fTbqMbGtyckj3bH5ktLO+1Ssv+yiATZ4dhwaQv9UZWxJh6E9IFGnQyjgWVDWVBDrg==} + web-namespaces@2.0.1: + resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==} + which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -3070,6 +3173,10 @@ snapshots: '@types/estree@1.0.9': {} + '@types/hast@3.0.5': + dependencies: + '@types/unist': 3.0.3 + '@types/katex@0.16.8': {} '@types/mdast@4.0.4': @@ -3146,6 +3253,8 @@ snapshots: '@typescript/typescript-win32-x64@7.0.2': optional: true + '@ungap/structured-clone@1.4.0': {} + '@valibot/to-json-schema@1.8.0(valibot@1.5.0(typescript@7.0.2))': dependencies: valibot: 1.5.0(typescript@7.0.2) @@ -3198,7 +3307,7 @@ snapshots: dependencies: '@wasm-audio-decoders/common': 9.0.7 - '@wirecat/cli-base@0.117.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5)': + '@wirecat/cli-base@0.119.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5)': dependencies: '@valibot/to-json-schema': 1.8.0(valibot@1.5.0(typescript@7.0.2)) cli-table3: 0.6.5 @@ -3219,7 +3328,7 @@ snapshots: '@wirecat/cli-core-sqlite@1.1.0': {} - '@wirecat/cli-core@0.699.0(@wirecat/cli-base@0.117.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5))(commander@15.0.0)(typescript@7.0.2)(zod@4.6.7)': + '@wirecat/cli-core@0.701.0(@wirecat/cli-base@0.119.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5))(commander@15.0.0)(typescript@7.0.2)(zod@4.6.7)': dependencies: '@anthropic-ai/sdk': 1.3.0(zod@4.6.7) '@bomb.sh/tab': 0.0.22(commander@15.0.0) @@ -3229,7 +3338,7 @@ snapshots: '@valibot/to-json-schema': 1.8.0(valibot@1.5.0(typescript@7.0.2)) '@wasm-audio-decoders/flac': 0.2.11 '@wasm-audio-decoders/ogg-vorbis': 0.1.20 - '@wirecat/cli-base': 0.117.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5) + '@wirecat/cli-base': 0.119.0(@scalar/openapi-upgrader@0.4.6)(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5) '@wirecat/cli-core-onnx': 1.2.0 '@wirecat/cli-core-sqlite': 1.1.0 '@xmldom/xmldom': 0.9.12 @@ -3242,6 +3351,9 @@ snapshots: disposable-email-domains-js: 1.26.0 echarts: 6.1.0 fflate: 0.8.3 + hast-util-from-html: 2.1.0 + hast-util-to-html: 9.0.6 + hast-util-to-mdast: 10.1.3 iconv-lite: 0.7.3 image-size: 2.0.4 linkedom: 0.18.14 @@ -3250,6 +3362,8 @@ snapshots: mammoth: 1.13.0 mdast-util-from-markdown: 2.1.0 mdast-util-gfm: 3.1.0 + mdast-util-to-hast: 13.2.2 + mdast-util-to-markdown: 2.2.0 micromark-extension-gfm: 3.0.0 mpg123-decoder: 1.0.3 ogg-opus-decoder: 1.7.5 @@ -3326,6 +3440,8 @@ snapshots: chalk@6.0.1: {} + character-entities-html4@2.1.0: {} + character-entities-legacy@3.0.0: {} character-entities@2.0.2: {} @@ -3342,6 +3458,10 @@ snapshots: codec-parser@2.5.0: {} + collapse-white-space@2.1.0: {} + + comma-separated-tokens@2.0.3: {} + commander@10.0.1: {} commander@12.1.0: {} @@ -3550,6 +3670,8 @@ snapshots: entities@8.1.0: {} + entities@9.0.0: {} + env-paths@4.0.0: dependencies: is-safe-filename: 0.1.1 @@ -3658,8 +3780,115 @@ snapshots: slash: 5.1.0 unicorn-magic: 0.4.1 + hast-util-embedded@3.0.0: + dependencies: + '@types/hast': 3.0.5 + hast-util-is-element: 3.0.0 + + hast-util-from-html@2.1.0: + dependencies: + '@types/hast': 3.0.5 + devlop: 1.1.0 + hast-util-from-parse5: 8.0.4 + parse5: 8.1.1 + vfile: 6.0.3 + vfile-message: 4.0.4 + + hast-util-from-parse5@8.0.4: + dependencies: + '@types/hast': 3.0.5 + '@types/unist': 3.0.3 + devlop: 1.1.0 + hastscript: 9.0.3 + property-information: 7.2.0 + vfile: 6.0.3 + vfile-location: 5.0.4 + web-namespaces: 2.0.1 + + hast-util-has-property@3.0.0: + dependencies: + '@types/hast': 3.0.5 + + hast-util-is-body-ok-link@3.0.1: + dependencies: + '@types/hast': 3.0.5 + + hast-util-is-element@3.0.0: + dependencies: + '@types/hast': 3.0.5 + + hast-util-minify-whitespace@1.0.1: + dependencies: + '@types/hast': 3.0.5 + hast-util-embedded: 3.0.0 + hast-util-is-element: 3.0.0 + hast-util-whitespace: 3.0.0 + unist-util-is: 6.0.1 + + hast-util-parse-selector@4.0.0: + dependencies: + '@types/hast': 3.0.5 + + hast-util-phrasing@3.0.1: + dependencies: + '@types/hast': 3.0.5 + hast-util-embedded: 3.0.0 + hast-util-has-property: 3.0.0 + hast-util-is-body-ok-link: 3.0.1 + hast-util-is-element: 3.0.0 + + hast-util-to-html@9.0.6: + dependencies: + '@types/hast': 3.0.5 + '@types/unist': 3.0.3 + ccount: 2.0.1 + comma-separated-tokens: 2.0.3 + hast-util-whitespace: 3.0.0 + html-void-elements: 3.0.0 + mdast-util-to-hast: 13.2.2 + property-information: 7.2.0 + space-separated-tokens: 2.0.2 + stringify-entities: 4.0.4 + zwitch: 2.0.4 + + hast-util-to-mdast@10.1.3: + dependencies: + '@types/hast': 3.0.5 + '@types/mdast': 4.0.4 + '@ungap/structured-clone': 1.4.0 + collapse-white-space: 2.1.0 + hast-util-phrasing: 3.0.1 + hast-util-to-html: 9.0.6 + hast-util-to-text: 4.0.3 + hast-util-whitespace: 3.0.0 + mdast-util-phrasing: 4.1.0 + mdast-util-to-hast: 13.2.2 + mdast-util-to-string: 4.0.0 + rehype-minify-whitespace: 6.0.2 + trim-trailing-lines: 2.1.0 + unist-util-position: 5.0.0 + unist-util-visit: 5.1.0 + + hast-util-to-text@4.0.3: + dependencies: + '@types/hast': 3.0.5 + + hast-util-whitespace@3.0.0: + dependencies: + '@types/hast': 3.0.5 + + hastscript@9.0.3: + dependencies: + '@types/hast': 3.0.5 + comma-separated-tokens: 2.0.3 + hast-util-parse-selector: 4.0.0 + property-information: 7.2.0 + space-separated-tokens: 2.0.2 + html-escaper@3.0.3: {} + html-void-elements@3.0.0: {} + htmlparser2@10.1.0: dependencies: domelementtype: 2.3.0 @@ -4023,6 +4252,18 @@ snapshots: '@types/mdast': 4.0.4 unist-util-is: 6.0.1 + mdast-util-to-hast@13.2.2: + dependencies: + '@types/hast': 3.0.5 + '@types/mdast': 4.0.4 + '@ungap/structured-clone': 1.4.0 + devlop: 1.1.0 + micromark-util-sanitize-uri: 2.0.1 + trim-lines: 3.0.1 + unist-util-position: 5.0.0 + unist-util-visit: 5.1.0 + vfile: 6.0.3 + mdast-util-to-markdown@2.2.0: dependencies: '@types/mdast': 4.0.4 @@ -4308,6 +4549,10 @@ snapshots: is-decimal: 2.0.1 is-hexadecimal: 2.0.1 + parse5@8.1.1: + dependencies: + entities: 9.0.0 + path-key@3.1.1: {} pend@1.2.0: {} @@ -4330,6 +4575,8 @@ snapshots: process-nextick-args@2.0.1: {} + property-information@7.2.0: {} + psl@1.15.0: dependencies: punycode: 2.3.1 @@ -4354,6 +4601,11 @@ snapshots: string_decoder: 1.1.1 util-deprecate: 1.0.2 + rehype-minify-whitespace@6.0.2: + dependencies: + '@types/hast': 3.0.5 + hast-util-minify-whitespace: 1.0.1 + resolve-from@5.0.0: {} reusify@1.1.0: {} @@ -4421,6 +4673,8 @@ snapshots: source-map-js@1.2.2: {} + space-separated-tokens@2.0.2: {} + sprintf-js@1.0.3: {} standardwebhooks@1.1.1: @@ -4445,6 +4699,11 @@ snapshots: dependencies: safe-buffer: 5.1.2 + stringify-entities@4.0.4: + dependencies: + character-entities-html4: 2.1.0 + character-entities-legacy: 3.0.0 + strip-ansi@6.0.1: dependencies: ansi-regex: 5.0.1 @@ -4477,6 +4736,10 @@ snapshots: dependencies: is-number: 7.0.0 + trim-lines@3.0.1: {} + + trim-trailing-lines@2.1.0: {} + ts-algebra@2.0.0: {} tslib@2.3.0: {} @@ -4523,6 +4786,10 @@ snapshots: dependencies: '@types/unist': 3.0.3 + unist-util-position@5.0.0: + dependencies: + '@types/unist': 3.0.3 + unist-util-stringify-position@4.0.0: dependencies: '@types/unist': 3.0.3 @@ -4546,6 +4813,21 @@ snapshots: optionalDependencies: typescript: 7.0.2 + vfile-location@5.0.4: + dependencies: + '@types/unist': 3.0.3 + vfile: 6.0.3 + + vfile-message@4.0.4: + dependencies: + '@types/unist': 3.0.3 + unist-util-stringify-position: 4.0.0 + + vfile@6.0.3: + dependencies: + '@types/unist': 3.0.3 + vfile-message: 4.0.4 + vite@8.3.5(@types/node@22.20.5)(esbuild@0.28.2)(yaml@2.9.1): dependencies: lightningcss: 1.33.0 @@ -4586,6 +4868,8 @@ snapshots: vscode-uri@3.2.0: {} + web-namespaces@2.0.1: {} + which@2.0.2: dependencies: isexe: 2.0.0 From f46f0b44ceb52c904a4a0efe1eeaadb6ff5c2d9a Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 18 Nov 2026 22:19:42 +0100 Subject: [PATCH 5/6] fix(kit): a CLI from a config drives every command and option in its tests linear-cli's test matrix showed 562 options no test drove: --body-file and --all of the GraphQL api group, the tracker commands, session list, api list and --credential-storage. attio-cli wrote the same tests by hand. The seeds now carry them, so a CLI from a config starts with an empty untested list. Co-Authored-By: Claude Opus 5.5 --- changes/fix-kit-tracker-pilot-gaps.md | 4 ++ kit/seeds/config/src/commands/session.test.ts | 16 ++++++++ kit/seeds/config/src/tracker-options.test.ts | 41 +++++++++++++++++++ kit/seeds/graphql/src/api.test.ts | 29 +++++++++++-- kit/src/new.ts | 2 +- 5 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 kit/seeds/config/src/tracker-options.test.ts diff --git a/changes/fix-kit-tracker-pilot-gaps.md b/changes/fix-kit-tracker-pilot-gaps.md index 828d1d0..fd583cd 100644 --- a/changes/fix-kit-tracker-pilot-gaps.md +++ b/changes/fix-kit-tracker-pilot-gaps.md @@ -16,3 +16,7 @@ - **A tracker CLI from a config runs `trackerSourceContract`** over cli-core's `trackerManifestFixture`, a fake of its API built from the source, so `cli-dev ready` verifies its category (cli-base 0.119.0 asks a tracker for that contract). cli-core 0.701.0 and cli-base 0.119.0. +- **A CLI from a config drives every command and option in its tests**, so its test matrix starts with nothing + untested: the session test covers `--credential-storage`, `session list` and `api list`; a tracker gets + `src/tracker-options.test.ts`, which runs each tracker command and option over a synced copy; the GraphQL `api` + test sends every variable, `--body` and `--body-file`, and `--all` on a paged list. diff --git a/kit/seeds/config/src/commands/session.test.ts b/kit/seeds/config/src/commands/session.test.ts index 13a6b9e..67e1764 100644 --- a/kit/seeds/config/src/commands/session.test.ts +++ b/kit/seeds/config/src/commands/session.test.ts @@ -39,3 +39,19 @@ it("session start keeps nothing when the service refuses the token", async () => const status = await runCli(["personal", "session", "status", "--json"], { keyring }) expect(status.json().item).toMatchObject({ state: "missing" }) }) + +it("a sign-in kept in a private file is listed among the sessions; api list names the generated operations", async () => { + const keyring = memoryKeyring() + const started = await runCli(["files", "session", "start", "--credential-storage", "file", "--json"], { + keyring, + service: fakeServiceApi(), + stdin: FAKE_API_TOKEN, + }) + expect(started.code, started.err).toBe(0) + const sessions = await runCli(["session", "list", "--json"], { keyring }) + expect(sessions.code, sessions.err).toBe(0) + expect(JSON.stringify(sessions.json())).toContain("files") + const operations = await runCli(["api", "list", "--json"], { keyring }) + expect((operations.json().items as unknown[]).length).toBeGreaterThan(0) + expect((await runCli(["files", "session", "end", "--json"], { keyring })).code).toBe(0) +}) diff --git a/kit/seeds/config/src/tracker-options.test.ts b/kit/seeds/config/src/tracker-options.test.ts new file mode 100644 index 0000000..2095232 --- /dev/null +++ b/kit/seeds/config/src/tracker-options.test.ts @@ -0,0 +1,41 @@ +import { memoryKeyring } from "@wirecat/cli-base" +import { expect, it } from "vitest" +import { FAKE_API_TOKEN, fakeServiceApi } from "./testing/fake-api.js" +import { runCli } from "./testing/harness.js" + +// The fake answers a sample of each selection, so this proves every command and option runs, not what a real row holds. +it("every option of the tracker commands runs over a synced copy", async () => { + const keyring = memoryKeyring() + const service = fakeServiceApi() + const started = await runCli(["options", "session", "start", "--json"], { keyring, service, stdin: FAKE_API_TOKEN }) + expect(started.code, started.err).toBe(0) + const ran = (argv: string[]) => runCli(["options", ...argv, "--json"], { keyring, service }) + const synced = await ran(["sync", "--rescan", "--max-pages", "50"]) + expect(synced.code, synced.err).toBe(0) + const listed = (await ran(["issues", "list"])).json() as { items: { key?: string; id?: string; title?: string }[] } + const [issue] = listed.items + expect(issue).toBeDefined() + const ref = String(issue?.key ?? issue?.id) + const word = + String(issue?.title ?? "") + .split(/\W+/) + .find((one) => one.length > 2) ?? ref + for (const argv of [ + ["issues", "list", "--limit", "1", "--page", "1"], + ["issues", "show", ref], + ["issues", "search", word, "--limit", "1", "--page", "1"], + ["issues", "assign", ref, "--due", "3d"], + ...["projects", "teams", "users", "states", "labels"].map((group) => [ + group, + "list", + "--limit", + "1", + "--page", + "1", + ]), + ]) { + const answer = await ran(argv) + expect(answer.code, `${argv.join(" ")}: ${answer.err}`).toBe(0) + } + expect(service.refusals).toEqual([]) +}) diff --git a/kit/seeds/graphql/src/api.test.ts b/kit/seeds/graphql/src/api.test.ts index f0e9349..238b51b 100644 --- a/kit/seeds/graphql/src/api.test.ts +++ b/kit/seeds/graphql/src/api.test.ts @@ -66,10 +66,18 @@ const requiredSample = (node: SchemaNode, seen: ReadonlySet = new Set()) const flagValue = (value: unknown) => (typeof value === "object" ? JSON.stringify(value) : String(value)) +const bodyFileOf = (operation: Operation) => { + const path = join(upload, "..", `${operation.command}.json`) + writeFileSync(path, JSON.stringify(requiredSample({ type: "ref", ref: String(operation.request?.schema) }))) + return path +} + const argsOf = (operation: Operation) => [ - ...operation.parameters - .filter((parameter) => parameter.required) - .flatMap((parameter) => [`--${apiFlagOf(parameter.name)}`, flagValue(requiredSample(parameter.schema))]), + // Every variable as its flag, so each flag is driven once; an optional input object goes as its required part. + ...operation.parameters.flatMap((parameter) => [ + `--${apiFlagOf(parameter.name)}`, + flagValue(requiredSample(parameter.schema)), + ]), ...(sendsBytes(operation) ? ["--body-file", upload] : []), ...(operation.request?.schema ? ["--body", JSON.stringify(requiredSample({ type: "ref", ref: operation.request.schema }))] @@ -101,6 +109,21 @@ it.each(API.manifest.operations.map((operation) => [operation.command, operation expect(ran.code, ran.err).toBe(0) expect(service.refusals).toEqual([]) expect(service.calls).toHaveLength(1) + if (operation.request?.schema) { + const body = argsOf(operation) + body.splice(body.indexOf("--body"), 2, "--body-file", bodyFileOf(operation)) + const fromFile = await runCli(["personal", "api", operation.command, ...body, "--json"], { service }) + expect(fromFile.code, fromFile.err).toBe(0) + expect(service.calls[1]?.variables).toEqual(service.calls[0]?.variables) + } + if (!operation.pagination) return + // The fake's sample of pageInfo says no next page, so --all sends one more call and ends. + const all = await runCli(["personal", "api", operation.command, ...argsOf(operation), "--all", "--json"], { + service, + }) + expect(all.code, all.err).toBe(0) + expect(service.calls.at(-1)?.operation).toBe(operation.id) + expect(service.refusals).toEqual([]) }, ) diff --git a/kit/src/new.ts b/kit/src/new.ts index d5aa693..ffb6fb7 100644 --- a/kit/src/new.ts +++ b/kit/src/new.ts @@ -753,7 +753,7 @@ const SOURCE_CHECK = "scripts/source-check.ts" const FROM_CONFIG = "scripts/from-config.ts" const SESSION = ["src/commands/session.ts", "src/commands/session.test.ts", "src/testing/fake-api.ts"] const CRM = ["src/commands/crm.ts", "src/crm-contracts.test.ts", "lint/contract-exceptions.json"] -const TRACKER = ["src/commands/tracker.ts", "src/tracker-contracts.test.ts"] +const TRACKER = ["src/commands/tracker.ts", "src/tracker-contracts.test.ts", "src/tracker-options.test.ts"] const sourceKind = (config: LoadedConfig["config"]): "crm" | "tracker" => config.category === "tracker" ? "tracker" : "crm" From 094571600d21a989f85dc16d99c711c6cd7fc272 Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 18 Nov 2026 22:46:27 +0100 Subject: [PATCH 6/6] fix(kit): refuse a tracker over OpenAPI; seed tests that fail when the option is ignored A fresh review found: the tracker contract test runs over cli-core's GraphQL-only fake, so a tracker from an OpenAPI config failed every case; the --body-file run also passed the variables as flags, the --all check matched the previous call, and the session list check matched any text with the profile's name. Co-Authored-By: Claude Opus 5.5 --- changes/fix-kit-tracker-pilot-gaps.md | 2 ++ kit/seeds/config/src/commands/session.test.ts | 2 +- kit/seeds/graphql/src/api.test.ts | 23 +++++++++++++++---- kit/src/from-config.ts | 5 ++++ kit/test/from-config.test.ts | 12 ++++++++++ 5 files changed, 38 insertions(+), 6 deletions(-) diff --git a/changes/fix-kit-tracker-pilot-gaps.md b/changes/fix-kit-tracker-pilot-gaps.md index fd583cd..3c4c7b2 100644 --- a/changes/fix-kit-tracker-pilot-gaps.md +++ b/changes/fix-kit-tracker-pilot-gaps.md @@ -20,3 +20,5 @@ untested: the session test covers `--credential-storage`, `session list` and `api list`; a tracker gets `src/tracker-options.test.ts`, which runs each tracker command and option over a synced copy; the GraphQL `api` test sends every variable, `--body` and `--body-file`, and `--all` on a paged list. +- **`new --from-config` refuses a tracker over an OpenAPI description** with what is missing: cli-core's tracker + fake answers GraphQL only, so its contract test would fail every case. diff --git a/kit/seeds/config/src/commands/session.test.ts b/kit/seeds/config/src/commands/session.test.ts index 67e1764..61d99a4 100644 --- a/kit/seeds/config/src/commands/session.test.ts +++ b/kit/seeds/config/src/commands/session.test.ts @@ -50,7 +50,7 @@ it("a sign-in kept in a private file is listed among the sessions; api list name expect(started.code, started.err).toBe(0) const sessions = await runCli(["session", "list", "--json"], { keyring }) expect(sessions.code, sessions.err).toBe(0) - expect(JSON.stringify(sessions.json())).toContain("files") + expect(sessions.json().items).toEqual(expect.arrayContaining([expect.objectContaining({ profile: "files" })])) const operations = await runCli(["api", "list", "--json"], { keyring }) expect((operations.json().items as unknown[]).length).toBeGreaterThan(0) expect((await runCli(["files", "session", "end", "--json"], { keyring })).code).toBe(0) diff --git a/kit/seeds/graphql/src/api.test.ts b/kit/seeds/graphql/src/api.test.ts index 238b51b..846c6c7 100644 --- a/kit/seeds/graphql/src/api.test.ts +++ b/kit/seeds/graphql/src/api.test.ts @@ -1,4 +1,4 @@ -import { mkdirSync, rmSync, writeFileSync } from "node:fs" +import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs" import { join } from "node:path" import { graphqlFake, type SchemaNode, sampleOf } from "@wirecat/cli-base/codegen" import { apiFlagOf, manifestBaseUrl, sendsBytes } from "@wirecat/cli-core/cli" @@ -110,18 +110,31 @@ it.each(API.manifest.operations.map((operation) => [operation.command, operation expect(service.refusals).toEqual([]) expect(service.calls).toHaveLength(1) if (operation.request?.schema) { - const body = argsOf(operation) - body.splice(body.indexOf("--body"), 2, "--body-file", bodyFileOf(operation)) - const fromFile = await runCli(["personal", "api", operation.command, ...body, "--json"], { service }) + // The body file alone: with the variables also given as flags, an ignored file would still send them. + const bodyFile = bodyFileOf(operation) + const fromFile = await runCli( + [ + "personal", + "api", + operation.command, + "--body-file", + bodyFile, + ...(operation.effect === "destructive" ? ["--yes"] : []), + "--json", + ], + { service }, + ) expect(fromFile.code, fromFile.err).toBe(0) - expect(service.calls[1]?.variables).toEqual(service.calls[0]?.variables) + expect(service.calls[1]?.variables).toEqual(JSON.parse(readFileSync(bodyFile, "utf8"))) } if (!operation.pagination) return // The fake's sample of pageInfo says no next page, so --all sends one more call and ends. + const before = service.calls.length const all = await runCli(["personal", "api", operation.command, ...argsOf(operation), "--all", "--json"], { service, }) expect(all.code, all.err).toBe(0) + expect(service.calls).toHaveLength(before + 1) expect(service.calls.at(-1)?.operation).toBe(operation.id) expect(service.refusals).toEqual([]) }, diff --git a/kit/src/from-config.ts b/kit/src/from-config.ts index 2b15986..0677ff7 100644 --- a/kit/src/from-config.ts +++ b/kit/src/from-config.ts @@ -46,6 +46,11 @@ export const loadCliConfig = async (path: string): Promise => { throw new Error(`${path}: export the config as default: export default defineCli({…})`) const config = parseCliConfig(module.default) const verifies = config.auth.preset === "token" && config.auth.verify !== undefined + // cli-core's trackerManifestFake, which the tracker's contract test runs over, answers GraphQL only. + if (config.category === "tracker" && config.spec.kind !== "graphql") + throw new Error( + "wirecat.config: a tracker source reads a GraphQL schema yet; cli-core's tracker fake answers no other API", + ) // The source's commands key the store by the account session start checked; the sample's session checks nothing. if (config.source && !verifies) throw new Error( diff --git a/kit/test/from-config.test.ts b/kit/test/from-config.test.ts index 4c8e838..a78d8ea 100644 --- a/kit/test/from-config.test.ts +++ b/kit/test/from-config.test.ts @@ -150,6 +150,18 @@ describe("new --from-config", () => { await expect(loadCliConfig(join(cwd, "wirecat.config.ts"))).rejects.toThrow("a source needs auth") }) + it("refuses a tracker source over an OpenAPI description", async () => { + const cwd = tempDir("from-config-tracker-openapi") + writeFileSync( + join(cwd, "wirecat.config.ts"), + CONFIG.replace('category: "other",', 'category: "tracker",\n source: { provider: "acme" },'), + ) + + await expect(loadCliConfig(join(cwd, "wirecat.config.ts"))).rejects.toThrow( + "a tracker source reads a GraphQL schema", + ) + }) + it("refuses a flag or a folder name the config already sets", async () => { const cwd = tempDir("from-config-twice") writeFileSync(join(cwd, "wirecat.config.ts"), CONFIG)