@wirecat/cli-core 0.670.0 → 0.671.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ Notable changes to `@wirecat/cli-core` (`@wirecat/cli-messaging` up to 0.261.0,
5
5
  minor version may break callers, and says how under "Changed — may break callers". `pnpm docs:check` checks the
6
6
  shape of this file.
7
7
 
8
+ ## 0.671.0 — 15.11.2026
9
+
10
+ ### Changed — may break callers
11
+
12
+ - **The shared documents `sync` is cooperative.** It declared `partial` but not `cooperative`, so it got a one-shot's
13
+ 30 s deadline and a budget of about 12 requests per call: a first Notion sync of 5 000 pages took some 830 calls.
14
+ It now gets a sync's deadline, 15 min in a terminal and 45 s over MCP, unless `--timeout` sets one. A cancel no
15
+ longer cuts the command from outside: the walk stops at the next folder on the run's `signal` (with or without a
16
+ budget) and saves where it is, and the batch stops before the next file, as before. See
17
+ [Walks over several syncs](docs/dev/DOCUMENTS.md#walks-over-several-syncs).
18
+
8
19
  ## 0.670.0 — 15.11.2026
9
20
 
10
21
  ### Added
@@ -9,7 +9,10 @@ const addDocumentSyncCommandsDefinition = (program, helpers) => {
9
9
  const { output } = helpers;
10
10
  const wording = wordsOf(helpers.words);
11
11
  const { prefix, text } = wording;
12
- const sync = examples(annotate(program.command("sync"), { effects: FETCH, partial: true })
12
+ const sync = examples(
13
+ // Cooperative: it stops on its own at its budget, its deadline or a cancel and keeps its work, so it gets a sync's
14
+ // deadline (15 min in a terminal, 45 s over MCP) instead of a one-shot's 30 s.
15
+ annotate(program.command("sync"), { effects: FETCH, cooperative: true, partial: true })
13
16
  .summary("import what changed in the chosen folders, and finish an unfinished sync")
14
17
  .description("import what changed in the chosen folders, and finish an unfinished sync; " +
15
18
  `one sync walks about ${helpers.maxEntries} entries under the chosen folders, saves where it stopped, and ` +
@@ -170,7 +170,12 @@ export const planDocuments = async (options, source, state, roots, limit, pictur
170
170
  continue;
171
171
  }
172
172
  // One folder at least per call, so a folder with more children than the bound still gets listed.
173
- stopped = listed > 0 && spent >= maxEntries ? "entries" : (budget?.take() ?? null);
173
+ // The run's own signal too: a cooperative sync is not cut from outside, and a CLI may pass no budget.
174
+ stopped = options.signal?.aborted
175
+ ? "cancelled"
176
+ : listed > 0 && spent >= maxEntries
177
+ ? "entries"
178
+ : (budget?.take() ?? null);
174
179
  if (stopped)
175
180
  break;
176
181
  const folder = step.folder ?? (await source.metadata(step.id));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-core",
3
- "version": "0.670.0",
3
+ "version": "0.671.0",
4
4
  "description": "The messenger-neutral half of a messaging CLI: domain model, message locators, rendering, name resolution, the SQLite seam, the command skeleton and shared read commands, the send guard, run records and the message store",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Viacheslav Ptsarev",