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

- **hubspot is built on cli-core 1.0.0 and cli-base 1.0.0.** After its first run the store is at version 73, 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.
- **A sync no longer marks records deleted when HubSpot could not list a whole kind.** The id pass is held until a
full list comes back.
- **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 @@ -3188,7 +3188,8 @@
],
"signIn": {
"gives": "Lets your agent read the account's CRM, and change it if you give the key the write scopes.",
"asks": "A service key or a legacy private app's access token from your HubSpot account, with read scopes, and write scopes if you want changes."
"asks": "A service key or a legacy private app's access token from your HubSpot account, with read scopes, and write scopes if you want changes.",
"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 @@ -120,6 +120,7 @@ hubspot 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 @@ -192,9 +193,13 @@ bring the store up to this build's schema, then normalize, index and stem the me
**Changes something on this computer only.**

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

**Example:** `hubspot work store migrate`
Expand Down
1 change: 1 addition & 0 deletions docs/dev/live-checks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
0.6.0 ae209971690ef16ec86d4a137bea6d3aeee787ad 2026-11-23 scripts/live.sh v2:fc64eefccef50923acd45c7152a37b3a6c92e3c05bda4146a0380574d8069dbe
0.6.0 57a8a4e1e572e87b8cfef004c039f04a853d5bcf 2026-11-24 scripts/live.sh v2:db3050e8f030823f313ef44856f330134bcbc01d1832632b105ff96c22c73edc
0.7.0 e763947b16ee5f35641c6702d6412b5d5bd78ceb 2026-11-24 scripts/live.sh v2:a5a26dffe5dcf00c53fb76fd8b7ced7dede3700f3501b3144c010ebc1620644a
0.7.0 c2745a5dd8176700711e581ad7b0744a60ac2433 2026-11-25 scripts/live.sh v2:1926874a8a6e066d98b0504b12b1a5f489aaaec129e123a6ae20b2c8bd745f31
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.

**846 ✅ · 62 ⛔ · 0 ❌** — 247 commands, 661 options.
**847 ✅ · 63 ⛔ · 0 ❌** — 247 commands, 663 options.

| Command | Option | | Note |
|---|---|---|---|
Expand All @@ -21,6 +21,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 @@ -29,6 +30,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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
"spec:sync": "node --experimental-strip-types scripts/sync-spec.ts"
},
"dependencies": {
"@wirecat/cli-base": "0.127.0",
"@wirecat/cli-core": "0.748.0",
"@wirecat/cli-base": "1.0.0",
"@wirecat/cli-core": "1.0.0",
"commander": "15.0.0",
"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.

1 change: 1 addition & 0 deletions src/commands/crm-options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe("every option of the CRM commands runs against the fake account", () =>
const { account, deal, lead } = 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"],
["deals", "show", deal],
Expand Down
21 changes: 12 additions & 9 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { ManifestOperation } from "@wirecat/cli-base/codegen/runtime"
import type { CrmKind } from "@wirecat/cli-core"
import {
type BodyPermission,
Expand Down Expand Up @@ -204,15 +205,17 @@ const bodyPermissions = Object.fromEntries(
export const API = {
manifest: {
...manifest,
operations: manifest.operations.filter(offered).map((operation) => ({
...operation,
permissions: [
...(operation.permissions ?? []),
...keysOf(operation),
// cli-core takes a body key only when the manifest names it; the run checks it through `bodyPermissions`.
...bodyKeysOf(operation).map(({ named }) => named),
],
})),
operations: manifest.operations.filter(offered).map(
(operation): ManifestOperation => ({
...operation,
permissions: [
...(operation.permissions ?? []),
...keysOf(operation),
// cli-core takes a body key only when the manifest names it; the run checks it through `bodyPermissions`.
...bodyKeysOf(operation).map(({ named }) => named),
],
}),
),
},
service: SERVICE,
bodyPermissions,
Expand Down
2 changes: 1 addition & 1 deletion src/crm/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export const hubspotCrmSource = (hub: () => HubSpotTransport, options: HubSpotSo
},
// Any other refusal fails the pass rather than answer no ids, which would mark every stored row deleted
// (WC-DATA-7). Leads are the exception: an account without Sales Hub Pro never has any, and core holds back a pass
// that would delete most of a kind until --rescan.
// that would delete most of a kind until the owner runs sync --allow-deletions.
async ids(kind, page, context): Promise<CrmIdPage> {
const type = OBJECTS[kind]
try {
Expand Down
2 changes: 1 addition & 1 deletion src/generated/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Source: spec/hubspot/, checked against provenance.json
// Run: pnpm 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>> = {
AssociatedId: {
Expand Down
7 changes: 6 additions & 1 deletion src/generated/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
// Source: spec/hubspot/, checked against provenance.json
// Run: pnpm generate

import type { ApiServer, ManifestOperation, SecurityRequirement, SecurityScheme } from "@wirecat/cli-base/codegen"
import type {
ApiServer,
ManifestOperation,
SecurityRequirement,
SecurityScheme,
} from "@wirecat/cli-base/codegen/runtime"

export const operations: readonly ManifestOperation[] = [
{
Expand Down
2 changes: 1 addition & 1 deletion src/testing/fake-hubspot.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { SchemaNode } from "@wirecat/cli-base/codegen"
import { type FakeAnswer, type FakeCall, fakeApi } from "@wirecat/cli-base/codegen"
import type { SchemaNode } from "@wirecat/cli-base/codegen/runtime"
import { definitions } from "../generated/definitions.js"
import { operations } from "../generated/manifest.js"
import { HUBSPOT_API } from "../hubspot/transport.js"
Expand Down
Loading