Skip to content
Draft
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
12 changes: 12 additions & 0 deletions changes/release-1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Changed — may break callers

- **b24 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 <count>` 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.
- **MCP no longer offers `schedule exec`.** It is the timer's own entry and runs only a schedule file in b24's
schedules folder. An agent runs a saved schedule with `schedule run <name>`. See
[Security](../docs/security.md#timers).
- **An MCP call that names a refused folder answers `permission_error`**, not `validation_error`.
3 changes: 2 additions & 1 deletion contracts/wirecat.json
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,8 @@
],
"signIn": {
"gives": "Lets your agent read and change the portal's CRM with the rights of the employee who made the webhook, or who signed in through a local application.",
"asks": "An inbound webhook address, from Developer resources → Common use cases → Other → Inbound webhook, with the crm, user_basic and department scopes, task for tasks, telephony for calls, disk and documentgenerator for files; or a local application's code and key."
"asks": "An inbound webhook address, from Developer resources → Common use cases → Other → Inbound webhook, with the crm, user_basic and department scopes, task for tasks, telephony for calls, disk and documentgenerator for files; or a local application's code and key.",
"setupFrom": "0.0.0"
},
"skill": {
"status": [
Expand Down
7 changes: 6 additions & 1 deletion docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ b24 sync [options]
| Option | What it does |
|---|---|
| `--rescan` | list everything again, every id too, dropping a round in progress. |
| `--allow-deletions <count>` | let this run mark deleted up to this many of what its full list no longer has, when the guard holds it. |
| `--max-pages <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. |

Expand Down Expand Up @@ -203,9 +204,13 @@ bring the store up to this build's schema, then normalize, index and stem the me
**Changes something on this computer only.**

```sh
b24 store migrate
b24 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: b24 commands info store migrate

**Example:** `b24 work store migrate`
Expand Down
4 changes: 3 additions & 1 deletion docs/dev/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ and `type`); field names are from the REST 3.0 field pages and the `user.get` an
- **No parent company, no dates** ([fields-company](https://apidocs.bitrix24.com/api-reference/crm/rest-v3/items/fields-company.html)). Bitrix24 has neither, so neither is stored.
- **On a timer.** `schedule` is cli-core's shared command, mounted as cli-core gives it, so `b24 <profile>
schedule command <name> --every 1h -- sync` keeps the store fresh. The owner ruled on 2026-11-13 that an agent may
run `schedule run` and `schedule exec` over MCP, behind their own permission keys; installing or removing a timer
run `schedule run` and `schedule exec` over MCP, behind their own permission keys. Since cli-core 0.736 MCP no
longer offers `schedule exec`, cli-core's security fix: it runs only a file in the tool's own schedules folder, and
an agent runs a saved schedule with `schedule run <name>`. Installing or removing a timer
stays behind `permissions.mcp.authority`, as in every CLI on cli-core.

### Search
Expand Down
4 changes: 3 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.

**234 ✅ · 91 ⛔ · 0 ❌** — 112 commands, 213 options.
**235 ✅ · 92 ⛔ · 0 ❌** — 112 commands, 215 options.

| Command | Option | | Note |
|---|---|---|---|
Expand All @@ -23,6 +23,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` | | ✅ | |
Expand All @@ -31,6 +32,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 |
Expand Down
2 changes: 1 addition & 1 deletion lint/baseline/unknown-verb.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["meetings people"]
[]
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"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-core": "0.751.0",
"@wirecat/cli-core": "1.0.0",
"commander": "15.0.0",
"valibot": "1.5.0"
},
Expand All @@ -71,7 +71,7 @@
"@cspell/dict-ru_ru": "2.3.4",
"@types/node": "22.20.5",
"@vitest/coverage-v8": "5.0.5",
"@wirecat/cli-base": "0.127.0",
"@wirecat/cli-base": "1.0.0",
"@wirecat/cli-testing": "0.7.0",
"cspell": "10.4.0",
"esbuild": "0.28.2",
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.

1 change: 1 addition & 0 deletions src/commands/crm-options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ describe("every option of the CRM commands runs against the fake portal", () =>
const { portal } = await synced()
for (const argv of [
["sync", "--rescan", "--max-pages", "50"],
["sync", "--allow-deletions", "5"],
["deals", "list", "--limit", "1", "--page", "2"],
["leads", "list", "--limit", "5", "--page", "1"],
["pipelines", "list", "kind:deal"],
Expand Down
4 changes: 2 additions & 2 deletions src/commands/crm-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const openProfile = async (command: Command, { readOnly }: { readOnly: boolean }
const portal = () => (transport ??= transportFor(command, signInOf(command)))
let source: ReturnType<typeof bitrixCrmSource> | 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,
Expand All @@ -61,7 +61,7 @@ const openProfile = async (command: Command, { readOnly }: { readOnly: boolean }
const copy = {
fields: (kind: CrmKind) => store.crm.fields(account, kind),
contacts: async (externalIds: readonly string[]) => {
const { crmIdentityId } = await import("@wirecat/cli-core/store")
const { crmIdentityId } = await import("@wirecat/cli-core/store/areas")
const held = new Set<string>()
for (const externalId of externalIds)
if (await store.people.personOf({ provider: PROVIDER.name, id: crmIdentityId(account, externalId) }))
Expand Down
4 changes: 2 additions & 2 deletions src/commands/meetings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export const meetingsMount = () => {
await Promise.all([
import("@wirecat/cli-core/crm/cli"),
import("../store.js"),
import("@wirecat/cli-core/store"),
import("@wirecat/cli-core/store/areas"),
import("../calls/source.js"),
import("../calls/recordings.js"),
import("../crm/source.js"),
Expand All @@ -237,7 +237,7 @@ export const meetingsMount = () => {
// The CRM sync's own rule decides whose calls are copied: the signed-in user, or the users chosen in
// `unassigned` that rule keeps. A stored `all` refuses, as the CRM sync does: a copy is never the whole portal.
const users = 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)
const source = crm.bitrixCrmSource(portal, Date.now, memory.NO_MEMORY, async () => ({
mode: scope.mode,
Expand Down
2 changes: 1 addition & 1 deletion src/crm/scope.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe("sync scope", () => {
// The id pass marks only rows saved an hour before it started, so a row a sync is still writing is never taken.
vi.useFakeTimers({ toFake: ["Date"], now: Date.now() + 2 * 3_600_000 })
try {
await b24(["work", "sync", "--rescan", "--json"], { portal: crm })
await b24(["work", "sync", "--rescan", "--allow-deletions", "1", "--json"], { portal: crm })
} finally {
vi.useRealTimers()
}
Expand Down
Loading