From a6ad8c0c64c2018e4ae8cce9d2c803e8bdfbc74d Mon Sep 17 00:00:00 2001 From: leemour Date: Tue, 24 Nov 2026 02:57:35 +0100 Subject: [PATCH 1/6] chore(deps): build on cli-base 1.0.0-rc.0 for cli-core 1.0 - cli-base 1.0.0-rc.0 (exact). cli-core stays on the npm 0.734.0 so the lockfile installs; parity swaps in the 1.0 build. - The bot generator writes its manifest and definitions against @wirecat/cli-base/codegen/runtime, the stable entry, and the code that runs imports ManifestOperation, SchemaNode and identifier from there. - Override becomes ModelOverride (the old name is a deprecated alias). - Changelog fragment for store version 73 and the MCP path guard. Checked against the cli-core 1.0.0-rc.0 tarball: typecheck, lint, build and all 2330 tests (one worker; the 18 timeouts pass with a longer timeout). Co-Authored-By: Claude Opus 5.5 --- changes/release-1.0.md | 8 ++++++++ scripts/bot/generate.ts | 8 ++++---- scripts/bot/source-adapter.test.ts | 10 ++++++++-- src/bot-api.test.ts | 4 ++-- src/bot/generated/definitions.ts | 2 +- src/bot/generated/manifest.ts | 2 +- src/commands/bot-api.ts | 2 +- 7 files changed, 25 insertions(+), 11 deletions(-) create mode 100644 changes/release-1.0.md diff --git a/changes/release-1.0.md b/changes/release-1.0.md new file mode 100644 index 00000000..c4d56227 --- /dev/null +++ b/changes/release-1.0.md @@ -0,0 +1,8 @@ +### Changed — may break callers + +- **tg builds on cli-core 1.0 and cli-base 1.0.** The store moves to version 73 on its first open: an id is never + handed out twice, and only tools on cli-core 1.0 open the store after that. Upgrade every installed WireCat CLI + before you run this version. The migration writes a rollback copy first and refuses to run without one. +- **An MCP call that names a refused place answers `permission_error`**, not `validation_error`. Before any MCP call + runs, each option and argument that takes a local file or folder is checked by its real path: a call cannot name a + credential folder, a folder of a WireCat tool or the message store. A shell run is unchanged. diff --git a/scripts/bot/generate.ts b/scripts/bot/generate.ts index 67bd4307..3f52a55a 100644 --- a/scripts/bot/generate.ts +++ b/scripts/bot/generate.ts @@ -6,8 +6,8 @@ import { coverageGenerator, definitionsGenerator, generate, + type ModelOverride, manifestGenerator, - type Override, typesGenerator, valibotGenerator, writeArtifacts, @@ -26,8 +26,8 @@ const artifacts = generate( [ typesGenerator({ path: "src/bot/generated/types.ts" }), valibotGenerator({ path: "src/bot/generated/schemas.ts", typesImport: "./types.js" }), - manifestGenerator({ path: "src/bot/generated/manifest.ts" }), - definitionsGenerator({ path: "src/bot/generated/definitions.ts" }), + manifestGenerator({ path: "src/bot/generated/manifest.ts", coreImport: "@wirecat/cli-base/codegen/runtime" }), + definitionsGenerator({ path: "src/bot/generated/definitions.ts", coreImport: "@wirecat/cli-base/codegen/runtime" }), coverageGenerator({ path: "docs/dev/bot-api-coverage.md", title: "Telegram Bot API coverage", @@ -35,7 +35,7 @@ const artifacts = generate( }), ], { - overrides: read("spec/bot/effects.json") as Record, + overrides: read("spec/bot/effects.json") as Record, banner: ["Source: spec/bot/api.json", "Run: pnpm bot:generate"], }, ) diff --git a/scripts/bot/source-adapter.test.ts b/scripts/bot/source-adapter.test.ts index db601170..0edfa255 100644 --- a/scripts/bot/source-adapter.test.ts +++ b/scripts/bot/source-adapter.test.ts @@ -1,12 +1,18 @@ import { readFileSync } from "node:fs" -import { applyOverrides, generate, manifestGenerator, type Override, validateModel } from "@wirecat/cli-base/codegen" +import { + applyOverrides, + generate, + type ModelOverride, + manifestGenerator, + validateModel, +} from "@wirecat/cli-base/codegen" import { describe, expect, it } from "vitest" import { adaptBotApi, type BotApiSource } from "./source-adapter.js" const source = JSON.parse(readFileSync(new URL("../../spec/bot/api.json", import.meta.url), "utf8")) as BotApiSource const effects = JSON.parse(readFileSync(new URL("../../spec/bot/effects.json", import.meta.url), "utf8")) as Record< string, - Override + ModelOverride > const model = () => adaptBotApi(source, { sourceUrl: "upstream", sourceRevision: "pinned" }) diff --git a/src/bot-api.test.ts b/src/bot-api.test.ts index e9bebf50..e36531fc 100644 --- a/src/bot-api.test.ts +++ b/src/bot-api.test.ts @@ -2,8 +2,8 @@ import { mkdirSync, mkdtempSync, truncateSync, writeFileSync } from "node:fs" import { tmpdir } from "node:os" import { join } from "node:path" import { captureStreams, memoryKeyring } from "@wirecat/cli-base" -import type { SchemaNode } from "@wirecat/cli-base/codegen" -import { identifier } from "@wirecat/cli-base/codegen" +import type { SchemaNode } from "@wirecat/cli-base/codegen/runtime" +import { identifier } from "@wirecat/cli-base/codegen/runtime" import { apiFlagOf, apiJson, BotTokenStore, ChatRegistry } from "@wirecat/cli-core/cli" import { beforeEach, describe, expect, it } from "vitest" import { TG } from "./app.js" diff --git a/src/bot/generated/definitions.ts b/src/bot/generated/definitions.ts index 94b106ea..7ac43055 100644 --- a/src/bot/generated/definitions.ts +++ b/src/bot/generated/definitions.ts @@ -2,7 +2,7 @@ // Source: spec/bot/api.json // Run: pnpm bot:generate -import type { SchemaNode } from "@wirecat/cli-base/codegen" +import type { SchemaNode } from "@wirecat/cli-base/codegen/runtime" export const definitions: Readonly> = { Update: { diff --git a/src/bot/generated/manifest.ts b/src/bot/generated/manifest.ts index be92ef4c..eecc16b2 100644 --- a/src/bot/generated/manifest.ts +++ b/src/bot/generated/manifest.ts @@ -2,7 +2,7 @@ // Source: spec/bot/api.json // Run: pnpm bot:generate -import type { ManifestOperation } from "@wirecat/cli-base/codegen" +import type { ManifestOperation } from "@wirecat/cli-base/codegen/runtime" export const operations: readonly ManifestOperation[] = [ { diff --git a/src/commands/bot-api.ts b/src/commands/bot-api.ts index 495fc230..1d3502df 100644 --- a/src/commands/bot-api.ts +++ b/src/commands/bot-api.ts @@ -1,6 +1,6 @@ import { statSync } from "node:fs" import { CliError } from "@wirecat/cli-base" -import type { ManifestOperation } from "@wirecat/cli-base/codegen" +import type { ManifestOperation } from "@wirecat/cli-base/codegen/runtime" import { type ApiCommandInput, apiPlainJson, From c1af815d2aa099596760fde2908aa85728e9b6b2 Mon Sep 17 00:00:00 2001 From: leemour Date: Tue, 24 Nov 2026 03:39:26 +0100 Subject: [PATCH 2/6] docs(changelog): say that schedule exec leaves MCP in cli-core 1.0 Co-Authored-By: Claude Opus 5.5 --- changes/release-1.0.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changes/release-1.0.md b/changes/release-1.0.md index c4d56227..5da0f98a 100644 --- a/changes/release-1.0.md +++ b/changes/release-1.0.md @@ -6,3 +6,5 @@ - **An MCP call that names a refused place answers `permission_error`**, not `validation_error`. Before any MCP call runs, each option and argument that takes a local file or folder is checked by its real path: a call cannot name a credential folder, a folder of a WireCat tool or the message store. A shell run is unchanged. +- **`schedule exec` is no longer offered over MCP.** It runs only a schedule file in the tool's own schedules folder. + An agent runs a saved schedule with `schedule run `. From af61bed1c482cd79748f111a3ed26d90100be55e Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 04:35:52 +0100 Subject: [PATCH 3/6] chore(deps): move to the published cli-core 1.0.0-rc.0 and cli-base 1.0.0-rc.1 release/1.0 built against a packed cli-core 1.0 tarball, while package.json still named cli-core 0.734.0 and cli-base 1.0.0-rc.0, so the branch's own CI was red. Both release candidates are now on npm under the next tag, so the pins point at them and the lockfile follows. - scripts/bot/generate.ts no longer passes coreImport to the manifest and definitions generators: cli-base rc.1 defaults it to the same @wirecat/cli-base/codegen/runtime, and bot:generate writes no file. - docs/commands.md is regenerated from the command tree: store migrate now takes --no-backup, and a search hit has one more field. The changelog fragment changes/release-1.0.md already describes the move to cli-core 1.0 and the store migration to version 73. Co-Authored-By: Claude Opus 5.5 --- docs/commands.md | 6 +++++- scripts/bot/generate.ts | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/commands.md b/docs/commands.md index cab84ddc..f14d46c8 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -3413,9 +3413,13 @@ bring the store up to this build's schema, then normalize, index and stem the me **Changes something on this computer only.** ```sh -tg store migrate +tg store migrate [options] ``` +| Option | What it does | +|---|---| +| `--no-backup` | migrate even when no rollback copy can be written; older tools then cannot open the store again. | + **Returns:** store migration — path, exists, from, to, normalized, indexed, terms, stemmed, and 1 more; every field: tg commands info store migrate **Example:** `tg personal store migrate` diff --git a/scripts/bot/generate.ts b/scripts/bot/generate.ts index 3f52a55a..95c8d341 100644 --- a/scripts/bot/generate.ts +++ b/scripts/bot/generate.ts @@ -26,8 +26,8 @@ const artifacts = generate( [ typesGenerator({ path: "src/bot/generated/types.ts" }), valibotGenerator({ path: "src/bot/generated/schemas.ts", typesImport: "./types.js" }), - manifestGenerator({ path: "src/bot/generated/manifest.ts", coreImport: "@wirecat/cli-base/codegen/runtime" }), - definitionsGenerator({ path: "src/bot/generated/definitions.ts", coreImport: "@wirecat/cli-base/codegen/runtime" }), + manifestGenerator({ path: "src/bot/generated/manifest.ts" }), + definitionsGenerator({ path: "src/bot/generated/definitions.ts" }), coverageGenerator({ path: "docs/dev/bot-api-coverage.md", title: "Telegram Bot API coverage", From 1e6c827e01b1b49ebd36fe0a51c35c991b953ac6 Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 04:57:53 +0100 Subject: [PATCH 4/6] test(contracts): take the store notice cli-core 1.0 prints on migrate contracts/upgrade.json: the first store migrate after an upgrade now also prints cli-core 1.0's notice that the store moved to schema 73. The case takes the notice as optional, the same pattern the other CLIs' upgrade contracts use, and still requires "4 terms". Co-Authored-By: Claude Opus 5.5 --- contracts/upgrade.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/upgrade.json b/contracts/upgrade.json index ca99d6f8..f944fec8 100644 --- a/contracts/upgrade.json +++ b/contracts/upgrade.json @@ -51,7 +51,7 @@ "exit": 0, "stream": "stdout", "kind": "json", - "diagnostic": "4 terms\n" + "diagnosticPattern": "(?:the store moved to schema \\d+; every other WireCat CLI that uses it needs a version that speaks it — run ` upgrade` for each\n)?4 terms\n" }, { "id": "candidate-store-first-read", From 2da8ee805be69ccb5cb54f69210b88e0e5131e47 Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 05:11:10 +0100 Subject: [PATCH 5/6] docs: list schedule exec as left out of MCP and give store migrate --no-backup a reason cli-core 1.0.0-rc.0 no longer offers schedule exec over MCP and adds store migrate --no-backup, and CI's check failed on both. - docs/mcp.md: "Commands the server leaves out" gains schedule exec, and the ask-by-default list names schedule run alone, so check-agent-docs.ts passes. - scripts/test-matrix-untested.ts: store migrate --no-backup is a shared cli-core command tg mounts unchanged, so its reason points at cli-core's store-maintenance.test.ts. docs/dev/test-matrix.md gets the row and the new totals (155 untested, 2021 options). Co-Authored-By: Claude Opus 5.5 --- docs/dev/test-matrix.md | 3 ++- scripts/test-matrix-untested.ts | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/dev/test-matrix.md b/docs/dev/test-matrix.md index 1068472b..e5fdb3ae 100644 --- a/docs/dev/test-matrix.md +++ b/docs/dev/test-matrix.md @@ -7,7 +7,7 @@ ran it · ⛔ not tested offline, with the reason and where it is checked instea Measured from the test run (`coverage/argv.jsonl`), not searched for — see [TESTING.md](TESTING.md) for how, and for the states and failures that cut across commands. -**2413 ✅ · 154 ⛔ · 0 ❌** — 547 commands, 2020 options. +**2413 ✅ · 155 ⛔ · 0 ❌** — 547 commands, 2021 options. | Command | Option | | Note | |---|---|---|---| @@ -423,6 +423,7 @@ Measured from the test run (`coverage/argv.jsonl`), not searched for — see | `store info` | | ✅ | | | `store check` | | ✅ | | | `store migrate` | | ✅ | | +| `store migrate` | `--no-backup` | ⛔ | cli-core src/cli/messenger/store-maintenance.test.ts covers store migrate; consumer mounts the shared command | | `store rebuild` | | ✅ | | | `store backup` | | ✅ | | | `store backup` | `--encrypt` | ✅ | | diff --git a/scripts/test-matrix-untested.ts b/scripts/test-matrix-untested.ts index 33d0904a..39763343 100644 --- a/scripts/test-matrix-untested.ts +++ b/scripts/test-matrix-untested.ts @@ -482,6 +482,12 @@ export const UNTESTED: Untested[] = [ option: "--no-backup", reason: "cli-core src/cli/messenger/store-maintenance.test.ts resets without a copy and checks backup: null", }, + { + command: "store migrate", + option: "--no-backup", + reason: + "cli-core src/cli/messenger/store-maintenance.test.ts covers store migrate; consumer mounts the shared command", + }, { command: "tags add", option: "--contact", From 83f95455f1e1ca028c117dfe35ea992985b3a428 Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 12:06:43 +0100 Subject: [PATCH 6/6] feat!: build on cli-core 1.0.0 and cli-base 1.0.0 Moves the pins from the release candidates (cli-core 1.0.0-rc.0, cli-base 1.0.0-rc.1) to the final 1.0.0 of both, after rebasing release/1.0 onto main. The lockfile follows; the generated command reference and manifest are unchanged. The rebase kept main's wording of the schedule exec line in docs/mcp.md, which says the same as the branch's. The changelog fragment names 1.0.0. Co-Authored-By: Claude Opus 5.5 --- changes/release-1.0.md | 2 +- package.json | 4 ++-- pnpm-lock.yaml | 32 ++++++++++++++++---------------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/changes/release-1.0.md b/changes/release-1.0.md index 5da0f98a..9ab7d005 100644 --- a/changes/release-1.0.md +++ b/changes/release-1.0.md @@ -1,6 +1,6 @@ ### Changed — may break callers -- **tg builds on cli-core 1.0 and cli-base 1.0.** The store moves to version 73 on its first open: an id is never +- **tg builds on cli-core 1.0.0 and cli-base 1.0.0.** The store moves to version 73 on its first open: an id is never handed out twice, and only tools on cli-core 1.0 open the store after that. Upgrade every installed WireCat CLI before you run this version. The migration writes a rollback copy first and refuses to run without one. - **An MCP call that names a refused place answers `permission_error`**, not `validation_error`. Before any MCP call diff --git a/package.json b/package.json index c723a0fc..683cdcc1 100644 --- a/package.json +++ b/package.json @@ -72,8 +72,8 @@ }, "dependencies": { "@mtcute/node": "0.32.7", - "@wirecat/cli-base": "0.126.1", - "@wirecat/cli-core": "0.753.0", + "@wirecat/cli-base": "1.0.0", + "@wirecat/cli-core": "1.0.0", "commander": "15.0.0", "undici": "8.12.3", "valibot": "1.5.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5ac742f2..ee165974 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,11 +16,11 @@ importers: specifier: 0.32.7 version: 0.32.7 '@wirecat/cli-base': - specifier: 0.126.1 - version: 0.126.1(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5) + specifier: 1.0.0 + version: 1.0.0(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5) '@wirecat/cli-core': - specifier: 0.753.0 - version: 0.753.0(@napi-rs/canvas@1.0.13)(@wirecat/cli-base@0.126.1(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: 1.0.0 + version: 1.0.0(@napi-rs/canvas@1.0.13)(@wirecat/cli-base@1.0.0(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 @@ -1292,16 +1292,16 @@ packages: '@wasm-audio-decoders/opus-ml@0.0.3': resolution: {integrity: sha512-SEeTmk0eb3q5etJA/NHCRWW6BivTx9tqvNTmG0kg2ynuATEQRUZnwQE6Ibvl1BBvqIGHqI57+qyJMWmJBwb5XQ==} - '@wirecat/cli-base@0.126.1': - resolution: {integrity: sha512-pZyRiK4Z9O3QZuOgwGZt+ISsaA2UU+u4AarnHjmIWG9aeAJ3ot2Hz7Dbctj2msjb7JgvR2+S7+OS+ZNGKcolQA==} - engines: {node: '>=22'} + '@wirecat/cli-base@1.0.0': + resolution: {integrity: sha512-PJ61d6z0CsWOmoWgf7uvlEo3EstpL2DplXiORPIqgmh0bn/ZGMOhRpDqN43Kh7WickaFSmeX74YQigHXkRO6rA==} + engines: {node: ^22.16.0 || >=24} hasBin: true peerDependencies: '@scalar/openapi-upgrader': ^0.4.6 - commander: '>=15' + commander: ^15.0.0 esbuild: ^0.28.0 swagger-converter: ^2.1.0 - vitest: '>=5' + vitest: ^5.0.0 peerDependenciesMeta: '@scalar/openapi-upgrader': optional: true @@ -1320,14 +1320,14 @@ packages: '@wirecat/cli-core-sqlite@1.1.0': resolution: {integrity: sha512-GpGlh/dAIX/nblBYCdT6DfWSLFxav9mxxeELQAfEuw+QZdT9unKxbi5xa02s/s4JS1P7n0PQx2sCABj4FlMRNw==} - '@wirecat/cli-core@0.753.0': - resolution: {integrity: sha512-jW9Sc/eDgRTmFvP+8Mc7+lyqwtuVZwphKkfCGi9H6t6RvBzfQOOIrSVN3lyVD21mChTGtOrRFRoWHQkPfI+UgQ==} + '@wirecat/cli-core@1.0.0': + resolution: {integrity: sha512-0avQTqu3FAFKE0s+8Pz1Up/TMHTYqCdDn37lcZmkH30sMCMrgJwHzoG4Q0fjVzPsB85u+zBVHHhtQjF/eSTpuw==} engines: {node: ^22.16.0 || >=24} hasBin: true peerDependencies: '@napi-rs/canvas': '>=0.1.69 <2' - '@wirecat/cli-base': '>=0.125.0 <1.0.0' - commander: '>=15' + '@wirecat/cli-base': ^1.0.0-0 + commander: ^15.0.0 mysql2: ^3.24.6 pg: ^8.23.1 ssh2: ^1.17.0 @@ -3662,7 +3662,7 @@ snapshots: dependencies: '@wasm-audio-decoders/common': 9.0.7 - '@wirecat/cli-base@0.126.1(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5)': + '@wirecat/cli-base@1.0.0(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 @@ -3683,7 +3683,7 @@ snapshots: '@wirecat/cli-core-sqlite@1.1.0': {} - '@wirecat/cli-core@0.753.0(@napi-rs/canvas@1.0.13)(@wirecat/cli-base@0.126.1(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@1.0.0(@napi-rs/canvas@1.0.13)(@wirecat/cli-base@1.0.0(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) @@ -3693,7 +3693,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.126.1(commander@15.0.0)(esbuild@0.28.2)(typescript@7.0.2)(vitest@5.0.5) + '@wirecat/cli-base': 1.0.0(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