@wspc/cli 0.1.13 → 0.1.14

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/dist/cli.js CHANGED
@@ -1520,9 +1520,9 @@ function createConsistencyFetch(opts) {
1520
1520
  }
1521
1521
 
1522
1522
  // src/version.ts
1523
- var VERSION = "0.1.13";
1523
+ var VERSION = "0.1.14";
1524
1524
  var SPEC_SHA = "bec760cd";
1525
- var SPEC_FETCHED_AT = "2026-07-08T04:52:19.152Z";
1525
+ var SPEC_FETCHED_AT = "2026-07-08T06:11:14.456Z";
1526
1526
  var API_BASE = "https://api.wspc.ai";
1527
1527
 
1528
1528
  // src/index.ts
@@ -5843,7 +5843,10 @@ function emptySummary() {
5843
5843
  paths: []
5844
5844
  };
5845
5845
  }
5846
- async function runDriveSyncOnce(root, api, clock = systemDriveClock) {
5846
+ function isActionableAction(action) {
5847
+ return action.type !== "unchanged" && action.type !== "state_only" && action.type !== "remove_state";
5848
+ }
5849
+ async function runDriveSyncOnce(root, api, clock = systemDriveClock, onProgress) {
5847
5850
  return withDriveLock(root, async () => {
5848
5851
  let state = await readDriveState(root);
5849
5852
  const syncApi = api ?? await createDriveApi();
@@ -5858,11 +5861,20 @@ async function runDriveSyncOnce(root, api, clock = systemDriveClock) {
5858
5861
  const paths = Array.from(
5859
5862
  /* @__PURE__ */ new Set([...Object.keys(localFiles), ...Object.keys(remoteFiles), ...Object.keys(state.entries)])
5860
5863
  ).filter((path) => !blockedPaths.has(path)).sort((left, right) => left.localeCompare(right));
5864
+ const total = paths.filter(
5865
+ (path) => isActionableAction(decideDriveAction(state.entries[path], localFiles[path], remoteFiles[path]))
5866
+ ).length;
5867
+ let processed = 0;
5868
+ onProgress?.(processed, total);
5861
5869
  for (const path of paths) {
5862
5870
  const remote = remoteFiles[path];
5863
5871
  const action = decideDriveAction(state.entries[path], localFiles[path], remote);
5864
5872
  const result = await processPath({ root, state, api: syncApi, path, action, remote, local: localFiles[path], summary, clock });
5865
5873
  state = result.state;
5874
+ if (isActionableAction(action)) {
5875
+ processed += 1;
5876
+ onProgress?.(processed, total);
5877
+ }
5866
5878
  if (result.stop) break;
5867
5879
  }
5868
5880
  recordUnresolvedConflicts(summary, state);
@@ -6624,7 +6636,7 @@ function webSocketError(event) {
6624
6636
 
6625
6637
  // src/handwritten/commands/drive/watch.ts
6626
6638
  async function runDriveWatch(root, options = {}) {
6627
- const runSync = options.runSync ?? runDriveSyncOnce;
6639
+ const runSync = options.runSync ?? ((syncRoot, onProgress) => runDriveSyncOnce(syncRoot, void 0, void 0, onProgress));
6628
6640
  const debounceMs = options.debounceMs ?? 500;
6629
6641
  const remoteDebounceMs = options.remoteDebounceMs ?? 2e3;
6630
6642
  const emit = options.onEvent ?? ((event) => {
@@ -6659,7 +6671,9 @@ async function runDriveWatch(root, options = {}) {
6659
6671
  rerunRequested = false;
6660
6672
  try {
6661
6673
  emit({ kind: "drive_sync_start" });
6662
- const summary = await runSync(root);
6674
+ const summary = await runSync(root, (processed, total) => {
6675
+ emit({ kind: "drive_sync_progress", processed, total });
6676
+ });
6663
6677
  emit({ kind: "drive_sync_once", ...summary });
6664
6678
  backoffMs = 1e3;
6665
6679
  } catch (error) {