Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions changes/release-1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Changed — may break callers

- **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
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 <name>`.
2 changes: 1 addition & 1 deletion contracts/upgrade.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<cli> upgrade` for each\n)?4 terms\n"
},
{
"id": "candidate-store-first-read",
Expand Down
6 changes: 5 additions & 1 deletion docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
3 changes: 2 additions & 1 deletion docs/dev/test-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
|---|---|---|---|
Expand Down Expand Up @@ -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` | ✅ | |
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
32 changes: 16 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions scripts/bot/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
coverageGenerator,
definitionsGenerator,
generate,
type ModelOverride,
manifestGenerator,
type Override,
typesGenerator,
valibotGenerator,
writeArtifacts,
Expand Down Expand Up @@ -35,7 +35,7 @@ const artifacts = generate(
}),
],
{
overrides: read("spec/bot/effects.json") as Record<string, Override>,
overrides: read("spec/bot/effects.json") as Record<string, ModelOverride>,
banner: ["Source: spec/bot/api.json", "Run: pnpm bot:generate"],
},
)
Expand Down
10 changes: 8 additions & 2 deletions scripts/bot/source-adapter.test.ts
Original file line number Diff line number Diff line change
@@ -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" })

Expand Down
6 changes: 6 additions & 0 deletions scripts/test-matrix-untested.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/bot-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/bot/generated/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Record<string, SchemaNode>> = {
Update: {
Expand Down
2 changes: 1 addition & 1 deletion src/bot/generated/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
{
Expand Down
2 changes: 1 addition & 1 deletion src/commands/bot-api.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Loading