diff --git a/changes/release-1.0.md b/changes/release-1.0.md new file mode 100644 index 0000000..735829b --- /dev/null +++ b/changes/release-1.0.md @@ -0,0 +1,9 @@ +### Changed — may break callers + +- **amo is built on cli-core 1.0 and cli-base 1.0.** After its first run the store is at version 74, and only tools + on cli-core 1.0 open it: upgrade every WireCat CLI on this computer together. The migration keeps a rollback copy, + and refuses to run when it cannot write one (`store migrate --no-backup` migrates anyway). +- **`sync --rescan` no longer lets a sync mark most of a kind deleted.** It only lists everything again. When the + guard holds a pass, `sync --allow-deletions ` lets it mark at most that many records deleted. The flag is + for the owner in a terminal; the MCP server does not offer it. +- **An MCP call that names a refused folder answers `permission_error`**, not `validation_error`. diff --git a/contracts/wirecat.json b/contracts/wirecat.json index 4579a0a..899885e 100644 --- a/contracts/wirecat.json +++ b/contracts/wirecat.json @@ -1259,7 +1259,8 @@ ], "signIn": { "gives": "Lets your agent read and change the account's CRM with the rights of the administrator who made the token, or of the user who signed in through your own integration.", - "asks": "The account's address and a long-lived token from a private integration's Keys and scopes tab, or that integration's ID and secret key." + "asks": "The account's address and a long-lived token from a private integration's Keys and scopes tab, or that integration's ID and secret key.", + "setupFrom": "0.0.0" }, "skill": { "status": [ diff --git a/docs/commands.md b/docs/commands.md index 4278c01..2c335cc 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -137,6 +137,7 @@ amo sync [options] | Option | What it does | |---|---| | `--rescan` | list everything again, every id too, dropping a round in progress. | +| `--allow-deletions ` | let this run mark deleted up to this many of what its full list no longer has, when the guard holds it. | | `--max-pages ` | at most this many requests to the CRM in this run. | | `--embed` | also index new activities and tasks for search all by meaning, with a model already downloaded. | @@ -209,9 +210,13 @@ bring the store up to this build's schema, then normalize, index and stem the me **Changes something on this computer only.** ```sh -amo store migrate +amo 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: amo commands info store migrate **Example:** `amo work store migrate` diff --git a/docs/dev/live-checks.txt b/docs/dev/live-checks.txt index d23ad4a..6879314 100644 --- a/docs/dev/live-checks.txt +++ b/docs/dev/live-checks.txt @@ -7,3 +7,4 @@ 0.3.0 f16bfe674e533e6e5f2bb4bb278448a1d4408af4 2026-11-23 bin/amo-live v2:a0fc1584e5cdcda89859e780f69b37407938cf0145f25fde6da1f236a37074fd 0.3.0 e1eecb2f7819667fd140bbbd5c14b0365ee45480 2026-11-23 bin/amo-live v2:b305c6f30ca8f18d2546d4ecb5d33c29fcfacc8e04fbebdd6cfa54e406384d09 0.4.0 9c4e6a1cca7e6d384ea629c038d6806dd9e5bf1e 2026-11-24 bin/amo-live v2:a6c31b2e25aa7d29c525f89803a011938865779bdac9213a19288317747fb4c7 +0.4.0 b536fd32f59e4fa106fda0822729563d8f886db9 2026-11-25 bin/amo-live v2:9c0734e73ee6c2b0844190f2626dbe4f2aa1250663924f7a96012d2e7674eeb7 diff --git a/docs/dev/test-matrix.md b/docs/dev/test-matrix.md index 7c0e6b7..5d48677 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. -**184 ✅ · 65 ⛔ · 0 ❌** — 87 commands, 162 options. +**185 ✅ · 66 ⛔ · 0 ❌** — 87 commands, 164 options. | Command | Option | | Note | |---|---|---|---| @@ -24,6 +24,7 @@ Measured from the test run (`coverage/argv.jsonl`), not searched for — see | `session list` | | ✅ | | | `sync` | | ✅ | | | `sync` | `--rescan` | ✅ | | +| `sync` | `--allow-deletions` | ✅ | | | `sync` | `--max-pages` | ✅ | | | `sync` | `--embed` | ⛔ | cli-core's CRM sync embeds activities; its src/crm/cli/activity-meaning.test.ts drives sync --embed and search all by meaning on a CRM program with the small test model, and a test here would need a model on disk | | `store status` | | ⛔ | cli-core's addStoreMaintenanceCommands, mounted by addCrmCommands; its store and src/crm/cli/store-file tests drive them on a CRM program | @@ -32,6 +33,7 @@ Measured from the test run (`coverage/argv.jsonl`), not searched for — see | `store info` | | ⛔ | cli-core's addStoreMaintenanceCommands, mounted by addCrmCommands; its store and src/crm/cli/store-file tests drive them on a CRM program | | `store check` | | ⛔ | cli-core's addStoreMaintenanceCommands, mounted by addCrmCommands; its store and src/crm/cli/store-file tests drive them on a CRM program | | `store migrate` | | ⛔ | cli-core's addStoreMaintenanceCommands, mounted by addCrmCommands; its store and src/crm/cli/store-file tests drive them on a CRM program | +| `store migrate` | `--no-backup` | ⛔ | cli-core's addStoreMaintenanceCommands, mounted by addCrmCommands; its store and src/crm/cli/store-file tests drive them on a CRM program | | `store rebuild` | | ⛔ | cli-core's addStoreMaintenanceCommands, mounted by addCrmCommands; its store and src/crm/cli/store-file tests drive them on a CRM program | | `store backup` | | ⛔ | cli-core's addStoreMaintenanceCommands, mounted by addCrmCommands; its store and src/crm/cli/store-file tests drive them on a CRM program | | `store backup` | `--encrypt` | ⛔ | cli-core's addStoreMaintenanceCommands, mounted by addCrmCommands; its store and src/crm/cli/store-file tests drive them on a CRM program | diff --git a/package.json b/package.json index e1261ac..018c145 100644 --- a/package.json +++ b/package.json @@ -61,8 +61,8 @@ "docs:spell": "cspell lint --config cspell.json --no-progress --no-summary README.md SECURITY.md CHANGELOG.md AGENTS.md CLAUDE.md 'docs/*.md' 'skills/**/*.md'" }, "dependencies": { - "@wirecat/cli-base": "0.127.0", - "@wirecat/cli-core": "0.751.0", + "@wirecat/cli-base": "1.0.0", + "@wirecat/cli-core": "1.0.0", "commander": "15.0.0", "valibot": "1.5.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a53ba72..0588a2c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,11 +13,11 @@ importers: .: dependencies: '@wirecat/cli-base': - specifier: 0.127.0 - version: 0.127.0(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.751.0 - version: 0.751.0(@wirecat/cli-base@0.127.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) + specifier: 1.0.0 + version: 1.0.0(@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 @@ -1185,16 +1185,16 @@ packages: '@wasm-audio-decoders/opus-ml@0.0.3': resolution: {integrity: sha512-SEeTmk0eb3q5etJA/NHCRWW6BivTx9tqvNTmG0kg2ynuATEQRUZnwQE6Ibvl1BBvqIGHqI57+qyJMWmJBwb5XQ==} - '@wirecat/cli-base@0.127.0': - resolution: {integrity: sha512-w7LkZhICv4d08N/vEWT4BnxeWt9tPpkVEOFBIUL7sR+JX5PNTHJj3vVTTT/pWhqtmVBFvsFA1xtdoHEX2GfZwQ==} - 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 @@ -1213,14 +1213,14 @@ packages: '@wirecat/cli-core-sqlite@1.1.0': resolution: {integrity: sha512-GpGlh/dAIX/nblBYCdT6DfWSLFxav9mxxeELQAfEuw+QZdT9unKxbi5xa02s/s4JS1P7n0PQx2sCABj4FlMRNw==} - '@wirecat/cli-core@0.751.0': - resolution: {integrity: sha512-jZ6F9wthLPyB3KC480ZFoAa51DWeaadcvK80Bmqn5scYthDHujvd1LAxvs7nJcenP1mnucnrMbnwvkiogRu4bA==} + '@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 @@ -3343,7 +3343,7 @@ snapshots: dependencies: '@wasm-audio-decoders/common': 9.0.7 - '@wirecat/cli-base@0.127.0(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 @@ -3364,7 +3364,7 @@ snapshots: '@wirecat/cli-core-sqlite@1.1.0': {} - '@wirecat/cli-core@0.751.0(@wirecat/cli-base@0.127.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)': + '@wirecat/cli-core@1.0.0(@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) @@ -3374,7 +3374,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.127.0(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 diff --git a/src/amo/allow-list.ts b/src/amo/allow-list.ts index 0ceecae..ad1f3bc 100644 --- a/src/amo/allow-list.ts +++ b/src/amo/allow-list.ts @@ -1,4 +1,4 @@ -import type { SchemaNode } from "@wirecat/cli-base/codegen" +import type { SchemaNode } from "@wirecat/cli-base/codegen/runtime" import type { SpecOperation } from "./operation.js" /* diff --git a/src/amo/operation.ts b/src/amo/operation.ts index 49e65d1..33c5b01 100644 --- a/src/amo/operation.ts +++ b/src/amo/operation.ts @@ -1,5 +1,5 @@ import { CliError } from "@wirecat/cli-base" -import type { Effect } from "@wirecat/cli-base/codegen" +import type { Effect } from "@wirecat/cli-base/codegen/runtime" import { ENTITY_TYPES, EXTRA_OPERATIONS } from "./allow-list.js" import { SPEC_OPERATIONS } from "./operations.js" diff --git a/src/commands/crm-options.test.ts b/src/commands/crm-options.test.ts index 488d31a..0b8e589 100644 --- a/src/commands/crm-options.test.ts +++ b/src/commands/crm-options.test.ts @@ -11,6 +11,7 @@ describe("every option of the CRM commands runs against the fake account", () => const { account } = await synced() for (const argv of [ ["sync", "--rescan", "--max-pages", "50"], + ["sync", "--allow-deletions", "5"], ["deals", "list", "--limit", "1", "--page", "2"], ["deals", "list", "--format", "csv"], ["pipelines", "show", "Продажи"], diff --git a/src/commands/crm-shared.ts b/src/commands/crm-shared.ts index 2d76e1f..bb5736d 100644 --- a/src/commands/crm-shared.ts +++ b/src/commands/crm-shared.ts @@ -58,7 +58,7 @@ const openProfile = async (command: Command, { readOnly }: { readOnly: boolean } const amo = () => (transport ??= transportFor(command, signInOf(command))) let source: ReturnType | undefined const asked = async () => { - const { crmSettingKey } = await import("@wirecat/cli-core/store") + const { crmSettingKey } = await import("@wirecat/cli-core/store/areas") const scope = await store.crm.scope(account) return { mode: scope.mode,